Class: Polaris::Card::SectionComponent

Inherits:
Polaris::Component
  • Object
show all
Defined in:
app/components/polaris/card/section_component.rb

Instance Method Summary collapse

Constructor Details

#initialize(title: "", subdued: false, flush: false, full_width: false, unstyled: false, border_top: false, border_bottom: false, actions: [], **system_arguments) ⇒ SectionComponent

Returns a new instance of SectionComponent.



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'app/components/polaris/card/section_component.rb', line 4

def initialize(
  title: "",
  subdued: false,
  flush: false,
  full_width: false,
  unstyled: false,
  border_top: false,
  border_bottom: false,
  actions: [],
  **system_arguments
)
  @system_arguments = system_arguments
  @system_arguments[:tag] = :div
  @system_arguments[:classes] = class_names(
    @system_arguments[:classes],
    "Polaris-LegacyCard__Section": !unstyled,
    "Polaris-LegacyCard__Section--flush": flush,
    "Polaris-LegacyCard__Section--subdued": subdued,
    "Polaris-LegacyCard__Section--fullWidth": full_width,
    "Polaris-LegacyCard__Section--borderTop": border_top,
    "Polaris-LegacyCard__Section--borderBottom": border_bottom
  )

  @title = title
  @actions = actions.map { |a| a.merge(plain: true) }
end