Class: Anchor::CheckBoxComponent
- Includes:
- DescribableInput
- Defined in:
- app/components/anchor/check_box_component.rb
Constant Summary collapse
- INPUT_CLASSES =
%w( form-checkbox rounded border-2 checked:bg-accent flex-shrink-0 m-[3px] !size-4.5 hover:border-gray-600 checked:hover:border-accent-hover checked:hover:bg-accent-hover disabled:border-subdued disabled:checked:bg-subdued disabled:checked:hover:border-subdued ).freeze
- DESCRIPTION_CLASSES =
%w( text-secondary text-sm col-start-2 ).freeze
Constants included from ViewHelper
Instance Method Summary collapse
-
#initialize(check_box:, attribute:, form_builder:, **kwargs) ⇒ CheckBoxComponent
constructor
A new instance of CheckBoxComponent.
Methods included from DescribableInput
#aria_description, #description, #description_id, #description_text, #description_translation_html_scope, #description_translation_scope, #human_attribute_description, #human_attribute_html_description, #i18n_model_key
Methods inherited from Component
Methods included from ViewHelper
#anchor_form_with, #anchor_svg, #deep_blank?, #merge_options, #popover_trigger_attributes
Methods included from FetchOrFallbackHelper
Constructor Details
#initialize(check_box:, attribute:, form_builder:, **kwargs) ⇒ CheckBoxComponent
Returns a new instance of CheckBoxComponent.
27 28 29 30 31 32 33 |
# File 'app/components/anchor/check_box_component.rb', line 27 def initialize(check_box:, attribute:, form_builder:, **kwargs) @check_box = check_box @attribute = attribute @form_builder = form_builder super(**kwargs) end |