Class: Primer::Alpha::UnderlinePanels
- Includes:
- TabbedComponentHelper, UnderlineNavHelper
- Defined in:
- app/components/primer/alpha/underline_panels.rb
Overview
Use ‘UnderlinePanels` to style tabs with an associated panel and an underlined selected state.
Constant Summary
Constants included from UnderlineNavHelper
UnderlineNavHelper::ACTIONS_TAG_DEFAULT, UnderlineNavHelper::ACTIONS_TAG_OPTIONS, UnderlineNavHelper::ALIGN_DEFAULT, UnderlineNavHelper::ALIGN_OPTIONS
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
Constants included from Primer::AttributesHelper
Primer::AttributesHelper::PLURAL_ARIA_ATTRIBUTES, Primer::AttributesHelper::PLURAL_DATA_ATTRIBUTES
Instance Method Summary collapse
-
#initialize(label:, align: ALIGN_DEFAULT, body_arguments: {}, wrapper_arguments: {}, **system_arguments) ⇒ UnderlinePanels
constructor
A new instance of UnderlinePanels.
Methods included from UnderlineNavHelper
#underline_nav_action_classes, #underline_nav_body_classes, #underline_nav_classes, #underline_nav_tab_classes
Methods included from TabbedComponentHelper
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
Methods included from Primer::AttributesHelper
#aria, #data, #merge_aria, #merge_data, #merge_prefixed_attribute_hashes
Constructor Details
#initialize(label:, align: ALIGN_DEFAULT, body_arguments: {}, wrapper_arguments: {}, **system_arguments) ⇒ UnderlinePanels
Returns a new instance of UnderlinePanels.
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'app/components/primer/alpha/underline_panels.rb', line 44 def initialize(label:, align: ALIGN_DEFAULT, body_arguments: {}, wrapper_arguments: {}, **system_arguments) @align = fetch_or_fallback(ALIGN_OPTIONS, align, ALIGN_DEFAULT) @wrapper_arguments = wrapper_arguments @system_arguments = deny_tag_argument(**system_arguments) @system_arguments[:tag] = :div @system_arguments[:classes] = underline_nav_classes(@system_arguments[:classes], @align) @body_arguments = deny_tag_argument(**body_arguments) @body_arguments[:tag] = :ul @body_arguments[:classes] = underline_nav_body_classes(@body_arguments[:classes]) @body_arguments[:role] = :tablist @body_arguments[:"aria-label"] = label end |