Class: Yattho::Alpha::ActionList::Heading
- Inherits:
-
Component
- Object
- ViewComponent::Base
- Component
- Yattho::Alpha::ActionList::Heading
- Defined in:
- app/components/yattho/alpha/action_list/heading.rb
Overview
Heading used to describe each sub list within an action list.
Constant Summary collapse
- DEFAULT_SCHEME =
:subtle
- SCHEME_MAPPINGS =
{ DEFAULT_SCHEME => nil, :filled => "ActionList-sectionDivider--filled" }.freeze
- SCHEME_OPTIONS =
SCHEME_MAPPINGS.keys.freeze
Constants inherited from Component
Component::INVALID_ARIA_LABEL_TAGS
Constants included from Status::Dsl
Constants included from ViewHelper
Constants included from TestSelectorHelper
TestSelectorHelper::TEST_SELECTOR_TAG
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Instance Method Summary collapse
-
#initialize(list_id:, title:, tag: :h3, scheme: DEFAULT_SCHEME, subtitle: nil, **system_arguments) ⇒ Heading
constructor
A new instance of Heading.
Methods inherited from Component
Methods included from JoinStyleArgumentsHelper
Methods included from TestSelectorHelper
Methods included from FetchOrFallbackHelper
#fetch_or_fallback, #fetch_or_fallback_boolean, #silence_deprecations?
Methods included from ClassNameHelper
Constructor Details
#initialize(list_id:, title:, tag: :h3, scheme: DEFAULT_SCHEME, subtitle: nil, **system_arguments) ⇒ Heading
Returns a new instance of Heading.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/components/yattho/alpha/action_list/heading.rb', line 21 def initialize(list_id:, title:, tag: :h3, scheme: DEFAULT_SCHEME, subtitle: nil, **system_arguments) @tag = tag @system_arguments = system_arguments @list_id = list_id @title = title @subtitle = subtitle @scheme = fetch_or_fallback(SCHEME_OPTIONS, scheme, DEFAULT_SCHEME) @system_arguments[:tag] = :li @system_arguments[:classes] = class_names( "ActionList-sectionDivider", SCHEME_MAPPINGS[@scheme], @system_arguments[:classes] ) end |