Module: UI::DrawerDescriptionBehavior
- Included in:
- DrawerDescription, DrawerDescriptionComponent
- Defined in:
- app/behaviors/ui/drawer_description_behavior.rb
Overview
Shared behavior for Drawer Description component ARIA-compliant description for drawer
Instance Method Summary collapse
-
#drawer_description_base_classes ⇒ Object
Base CSS classes for drawer description.
-
#drawer_description_classes ⇒ Object
Merge base classes with custom classes using TailwindMerge.
-
#drawer_description_html_attributes ⇒ Object
Build complete HTML attributes hash for description.
Instance Method Details
#drawer_description_base_classes ⇒ Object
Base CSS classes for drawer description
9 10 11 |
# File 'app/behaviors/ui/drawer_description_behavior.rb', line 9 def drawer_description_base_classes "text-muted-foreground text-sm" end |
#drawer_description_classes ⇒ Object
Merge base classes with custom classes using TailwindMerge
14 15 16 |
# File 'app/behaviors/ui/drawer_description_behavior.rb', line 14 def drawer_description_classes TailwindMerge::Merger.new.merge([drawer_description_base_classes, @classes].compact.join(" ")) end |
#drawer_description_html_attributes ⇒ Object
Build complete HTML attributes hash for description
19 20 21 22 |
# File 'app/behaviors/ui/drawer_description_behavior.rb', line 19 def drawer_description_html_attributes base_attrs = @attributes || {} base_attrs.merge(class: drawer_description_classes) end |