Class: Primer::Alpha::ActionList::Divider
- Inherits:
 - 
      Component
      
        
- Object
 - ViewComponent::Base
 - Component
 - Primer::Alpha::ActionList::Divider
 
 
- Defined in:
 - app/components/primer/alpha/action_list/divider.rb
 
Overview
Separator with optional text rendered above groups or between individual items.
Direct Known Subclasses
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
Constants included from Primer::AttributesHelper
Primer::AttributesHelper::PLURAL_ARIA_ATTRIBUTES, Primer::AttributesHelper::PLURAL_DATA_ATTRIBUTES
Instance Method Summary collapse
- #call ⇒ Object
 - 
  
    
      #initialize(scheme: DEFAULT_SCHEME, **system_arguments)  ⇒ Divider 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of Divider.
 
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(scheme: DEFAULT_SCHEME, **system_arguments) ⇒ Divider
Returns a new instance of Divider.
      17 18 19 20 21 22 23 24 25 26 27  | 
    
      # File 'app/components/primer/alpha/action_list/divider.rb', line 17 def initialize(scheme: DEFAULT_SCHEME, **system_arguments) @system_arguments = system_arguments @system_arguments[:tag] = :li @system_arguments[:role] = :presentation @system_arguments[:'aria-hidden'] = true @scheme = fetch_or_fallback(SCHEME_OPTIONS, scheme, DEFAULT_SCHEME) @system_arguments[:classes] = class_names( "ActionList-sectionDivider", SCHEME_MAPPINGS[@scheme] ) end  | 
  
Instance Method Details
#call ⇒ Object
      29 30 31  | 
    
      # File 'app/components/primer/alpha/action_list/divider.rb', line 29 def call render(Primer::BaseComponent.new(**@system_arguments)) { content } end  |