Class: Pulse::BorderBox::Header

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

Overview

BorderBox::Header is used inside BorderBox to render its header slot.

Constant Summary collapse

TITLE_TAG_FALLBACK =
:h2
TITLE_TAG_OPTIONS =
[:h1, TITLE_TAG_FALLBACK, :h3, :h4, :h5, :h6].freeze

Constants inherited from Component

Component::TW_MERGE

Constants included from AttributesHelper

AttributesHelper::PLURAL_ARIA_ATTRIBUTES, AttributesHelper::PLURAL_DATA_ATTRIBUTES

Instance Attribute Summary collapse

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(**system_arguments) ⇒ Header

Returns a new instance of Header.

Parameters:

  • system_arguments (Hash)

    <%= link_to_system_arguments_docs %>



33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'app/components/pulse/border_box/header.rb', line 33

def initialize(**system_arguments)
  @system_arguments = system_arguments
  @system_arguments[:id] ||= self.class.generate_id
  @system_arguments[:tag] = :div
  @system_arguments[:classes] = class_names(
    'pulse-px-4 pulse-py-5 pulse-bg-gray-50 sm:pulse-p-6',
    'pulse-rounded-t-md pulse-border-b pulse-border-gray-300',
    'pulse-border-solid',
    'Box-header',
    system_arguments[:classes]
  )
  @id = @system_arguments[:id]
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



9
10
11
# File 'app/components/pulse/border_box/header.rb', line 9

def id
  @id
end