Class: UiComponents::DaisyUi::DataDisplay::Accordion::ItemComponent

Inherits:
BaseComponent
  • Object
show all
Defined in:
app/components/ui_components/daisy_ui/data_display/accordion/item_component.rb

Constant Summary collapse

ICONS =
%w[arrow plus]
CSS_CLASSES_DEFAULT =
%w[collapse bg-base-100 border border-base-300].freeze
CSS_CLASSES_VARIANTS =
(ICONS.map { |key| "collapse-#{key}" }).freeze
CSS_CLASSES =
(
  CSS_CLASSES_DEFAULT +
  CSS_CLASSES_VARIANTS +
  AnchorComponent::CSS_CLASSES +
  BodyComponent::CSS_CLASSES
).freeze

Constants inherited from BaseComponent

BaseComponent::ALIGNS, BaseComponent::AXES, BaseComponent::COLORS, BaseComponent::KINDS, BaseComponent::SIZES

Instance Method Summary collapse

Constructor Details

#initialize(opener:, toggle:, opened: false, icon: nil, **args) ⇒ ItemComponent

Returns a new instance of ItemComponent.



30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'app/components/ui_components/daisy_ui/data_display/accordion/item_component.rb', line 30

def initialize(
    opener:,
    toggle:,
    opened: false,
    icon: nil,
    **args
  )
  @opener = opener
  @toggle = toggle
  @opened = opened
  @icon = icon

  super(**args)
end