Class: Ariadne::UI::Heroicon::Component
- Inherits:
-
BaseComponent
- Object
- ViewComponentContrib::Base
- BaseComponent
- Ariadne::UI::Heroicon::Component
- Includes:
- IconHelper, HeroiconsHelper
- Defined in:
- app/components/ariadne/ui/heroicon/component.rb
Overview
Constant Summary
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::INTEGER_TYPES, FetchOrFallbackHelper::InvalidValueError, FetchOrFallbackHelper::TRUE_OR_FALSE
Constants inherited from BaseComponent
BaseComponent::ACCEPT_ANYTHING
Constants included from ViewHelper
Constants included from AttributesHelper
AttributesHelper::PLURAL_ARIA_ATTRIBUTES, AttributesHelper::PLURAL_DATA_ATTRIBUTES
Instance Attribute Summary collapse
-
#dark_mode ⇒ Object
Returns the value of attribute dark_mode.
Instance Method Summary collapse
-
#initialize(**options) ⇒ Component
constructor
A new instance of Component.
- #inner ⇒ Object
- #svg_attributes ⇒ Object
Methods included from IconHelper
#check_icon_presence!, ensure_valid_variant, #has_partial_icon?, #icon_presence!, #variant_presence!
Methods included from FetchOrFallbackHelper
#check_incoming_attribute, #check_incoming_tag, #check_incoming_value, #fetch_or_fallback, #fetch_or_raise, #fetch_or_raise_boolean, #fetch_or_raise_integer
Methods included from LoggerHelper
#logger, #silence_deprecations?, #silence_warnings?
Methods inherited from BaseComponent
#class_for, #component, component_id, #component_id, component_name, #html_attributes, i18n_scope, #in_turbo_frame, #in_turbo_stream, #options, stimulus_name, #styles, translate, #validate_aria_label!
Methods included from ViewHelper
Methods included from AttributesHelper
#aria, #data, #merge_aria, #merge_data, #merge_prefixed_attribute_hashes, #prepend_action, #prepend_controller, #prepend_data_attribute
Methods included from ViewComponent::StyleVariants
Constructor Details
#initialize(**options) ⇒ Component
Returns a new instance of Component.
41 42 43 44 45 46 47 |
# File 'app/components/ariadne/ui/heroicon/component.rb', line 41 def initialize(**) super check_icon_presence!(icon, variant) @heroicon = heroicon(@icon, variant: @variant) end |
Instance Attribute Details
#dark_mode ⇒ Object
Returns the value of attribute dark_mode.
25 26 27 |
# File 'app/components/ariadne/ui/heroicon/component.rb', line 25 def dark_mode @dark_mode end |
Instance Method Details
#inner ⇒ Object
53 54 55 |
# File 'app/components/ariadne/ui/heroicon/component.rb', line 53 def inner ActiveSupport::SafeBuffer.new(@heroicon.inner) end |
#svg_attributes ⇒ Object
49 50 51 |
# File 'app/components/ariadne/ui/heroicon/component.rb', line 49 def svg_attributes tag.attributes(html_attrs.except(:class).merge(@heroicon.attributes.except("class", "aria-hidden"))) end |