Class: UiComponents::DaisyUi::DataDisplay::CardComponent

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

Constant Summary collapse

SIZES =
%w[xs sm md lg xl].freeze
BORDER_KINDS =
%w[border dash].freeze
CSS_CLASSES_DEFAULT =
%w[card w-96 bg-base-100 shadow-sm].freeze
CSS_CLASSES_VARIANTS =
(
  %w[card-side image-full] +
  SIZES.map { |key| "card-#{key}" } +
  BORDER_KINDS.map { |key| "card-#{key}" }
).freeze
CSS_CLASSES =
(
  CSS_CLASSES_DEFAULT +
  CSS_CLASSES_VARIANTS +
  Card::BodyComponent::CSS_CLASSES
).freeze

Constants inherited from BaseComponent

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

Instance Attribute Summary

Attributes inherited from BaseComponent

#slot_order

Instance Method Summary collapse

Methods inherited from BaseComponent

tracks_slot_order

Constructor Details

#initialize(size: nil, side: false, border_kind: nil, image_full: nil, **args) ⇒ CardComponent

Returns a new instance of CardComponent.



37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'app/components/ui_components/daisy_ui/data_display/card_component.rb', line 37

def initialize(
    size: nil,
    side: false,
    border_kind: nil,
    image_full: nil,
    **args
  )
  @size = size
  @side = side
  @border_kind = border_kind
  @image_full = image_full

  super(**args)
end