Sha256: 249b796244c2f0eef8bacfa22f37aa922e15a5851731b7690312e1ffdd77dcfa

Contents?: true

Size: 1.05 KB

Versions: 49

Compression:

Stored size: 1.05 KB

Contents

require "view_component"
require "dry-initializer"
require "active_support/notifications"

load File.join(__dir__, "attributes.rb")

module PlutoniumUi
  # Base class for all Plutonium UI components.
  # This class inherits from `ViewComponent::Base` and includes additional functionality
  # provided by `Dry::Initializer` for managing component options, and the
  # `PlutoniumUi::Attributes` module for handling UI attributes.
  #
  # It also includes `Plutonium::Helpers::ComponentHelper` for additional helper methods
  # and delegates missing methods to the Rails helpers.
  class Base < ViewComponent::Base
    extend Dry::Initializer
    include Plutonium::Helpers::ComponentHelper
    include PlutoniumUi::Attributes

    delegate_missing_to :helpers
  end
end

ActiveSupport::Notifications.instrument("plutonium.components.load") do
  # Require all component files within the same directory and subdirectories
  Dir.glob(File.expand_path("**/*.rb", __dir__)) do |component_file_path|
    load component_file_path unless component_file_path == __FILE__
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
plutonium-0.15.2 app/views/components/base.rb
plutonium-0.15.1 app/views/components/base.rb
plutonium-0.15.0 app/views/components/base.rb
plutonium-0.15.0.pre.rc3 app/views/components/base.rb
plutonium-0.15.0.pre.rc2 app/views/components/base.rb
plutonium-0.15.0.pre.rc1 app/views/components/base.rb
plutonium-0.14.1 app/views/components/base.rb
plutonium-0.14.0 app/views/components/base.rb
plutonium-0.13.3 app/views/components/base.rb
plutonium-0.13.2 app/views/components/base.rb
plutonium-0.13.1 app/views/components/base.rb
plutonium-0.13.0 app/views/components/base.rb
plutonium-0.12.14 app/views/components/base.rb
plutonium-0.12.13 app/views/components/base.rb
plutonium-0.12.12 app/views/components/base.rb
plutonium-0.12.11 app/views/components/base.rb
plutonium-0.12.10 app/views/components/base.rb
plutonium-0.12.9 app/views/components/base.rb
plutonium-0.12.8 app/views/components/base.rb
plutonium-0.12.7 app/views/components/base.rb