Class: Pulse::ActionList::Divider
- Defined in:
- app/components/pulse/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 => 'pulse-border-t-color-gray pulse-border-b-color-gray ' \ 'pulse-border-y-solid empty:pulse-h-2 empty:pulse-box-border' }.freeze
- SCHEME_OPTIONS =
SCHEME_MAPPINGS.keys.freeze
Constants inherited from Component
Constants included from Pulse::AttributesHelper
Pulse::AttributesHelper::PLURAL_ARIA_ATTRIBUTES, Pulse::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
generate_id, #merge_attributes, #merge_classes
Methods included from SvgHelper
Methods included from FetchOrFallbackHelper
#fetch_or_fallback, #fetch_or_fallback_boolean
Methods included from Pulse::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 28 |
# File 'app/components/pulse/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] = merge_classes( 'pulse-block pulse-h-[1px] pulse-p-0 pulse-border-0 pulse-ms-2 ', 'pulse-me-2 pulse-bg-gray-100', SCHEME_MAPPINGS[@scheme] ) end |
Instance Method Details
#call ⇒ Object
30 31 32 |
# File 'app/components/pulse/action_list/divider.rb', line 30 def call render(Pulse::BaseComponent.new(**@system_arguments)) { content } end |