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.22 app/views/components/base.rb
plutonium-0.15.21 app/views/components/base.rb
plutonium-0.15.20 app/views/components/base.rb
plutonium-0.15.19 app/views/components/base.rb
plutonium-0.15.18 app/views/components/base.rb
plutonium-0.15.17 app/views/components/base.rb
plutonium-0.15.16 app/views/components/base.rb
plutonium-0.15.15 app/views/components/base.rb
plutonium-0.15.14 app/views/components/base.rb
plutonium-0.15.13 app/views/components/base.rb
plutonium-0.15.12 app/views/components/base.rb
plutonium-0.15.11 app/views/components/base.rb
plutonium-0.15.10 app/views/components/base.rb
plutonium-0.15.9 app/views/components/base.rb
plutonium-0.15.8 app/views/components/base.rb
plutonium-0.15.7 app/views/components/base.rb
plutonium-0.15.6 app/views/components/base.rb
plutonium-0.15.5 app/views/components/base.rb
plutonium-0.15.4 app/views/components/base.rb
plutonium-0.15.3 app/views/components/base.rb