Class: Polaris::Popover::SectionComponent

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

Instance Method Summary collapse

Constructor Details

#initialize(**system_arguments) ⇒ SectionComponent

Returns a new instance of SectionComponent.



2
3
4
# File 'app/components/polaris/popover/section_component.rb', line 2

def initialize(**system_arguments)
  @system_arguments = system_arguments
end

Instance Method Details

#callObject



16
17
18
19
20
21
22
# File 'app/components/polaris/popover/section_component.rb', line 16

def call
  render(Polaris::BaseComponent.new(**system_arguments)) do
    render(Polaris::BoxComponent.new(padding: "2")) do
      content
    end
  end
end

#system_argumentsObject



6
7
8
9
10
11
12
13
14
# File 'app/components/polaris/popover/section_component.rb', line 6

def system_arguments
  @system_arguments.tap do |opts|
    opts[:tag] = "div"
    opts[:classes] = class_names(
      @system_arguments[:classes],
      "Polaris-Popover__Section"
    )
  end
end