Class: Primer::Alpha::HellipButton
- Defined in:
- app/components/primer/alpha/hellip_button.rb
Overview
Use ‘HellipButton` to render a button with a hellip. Often used for hidden text expanders.
Constant Summary
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(inline: false, disabled: false, **system_arguments) ⇒ HellipButton
constructor
A new instance of HellipButton.
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(inline: false, disabled: false, **system_arguments) ⇒ HellipButton
Returns a new instance of HellipButton.
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/components/primer/alpha/hellip_button.rb', line 15 def initialize(inline: false, disabled: false, **system_arguments) @system_arguments = deny_tag_argument(**system_arguments) validate_aria_label @system_arguments[:tag] = :button @system_arguments[:"aria-expanded"] = false @system_arguments[:classes] = class_names( @system_arguments[:classes], "inline" => inline ) @system_arguments[:disabled] = disabled end |
Instance Method Details
#call ⇒ Object
29 30 31 |
# File 'app/components/primer/alpha/hellip_button.rb', line 29 def call render(Primer::Beta::BaseButton.new(**@system_arguments)) { "…".html_safe } end |