Class: Pulse::Layout::Sidebar

Inherits:
Component
  • Object
show all
Defined in:
app/components/pulse/layout.rb

Overview

The layout's sidebar content.

Constant Summary collapse

TAG_DEFAULT =
:div
TAG_OPTIONS =
[TAG_DEFAULT, :aside, :nav, :section].freeze

Constants inherited from Component

Component::TW_MERGE

Constants included from AttributesHelper

AttributesHelper::PLURAL_ARIA_ATTRIBUTES, AttributesHelper::PLURAL_DATA_ATTRIBUTES

Instance Method Summary collapse

Methods inherited from Component

generate_id, #merge_attributes, #merge_classes

Methods included from SvgHelper

#render_svg

Methods included from FetchOrFallbackHelper

#fetch_or_fallback, #fetch_or_fallback_boolean

Methods included from AttributesHelper

#aria, #data, #merge_aria, #merge_data, #merge_prefixed_attribute_hashes

Constructor Details

#initialize(tag: TAG_DEFAULT, **system_arguments) ⇒ Sidebar

Returns a new instance of Sidebar.



125
126
127
128
129
130
131
132
133
134
# File 'app/components/pulse/layout.rb', line 125

def initialize(tag: TAG_DEFAULT, **system_arguments)
  @system_arguments = system_arguments

  @system_arguments[:tag] =
    fetch_or_fallback(TAG_OPTIONS, tag, TAG_DEFAULT)
  @system_arguments[:classes] = merge_classes(
    'pulse-col-[1]',
    @system_arguments[:classes]
  )
end

Instance Method Details

#callObject



136
137
138
# File 'app/components/pulse/layout.rb', line 136

def call
  render(Pulse::BaseComponent.new(**@system_arguments)) { content }
end