Module: UI::ButtonGroupTextBehavior
- Included in:
- ButtonGroupText, ButtonGroupTextComponent
- Defined in:
- app/behaviors/ui/button_group_text_behavior.rb
Overview
TextBehavior
Shared behavior for ButtonGroupText component across ERB, ViewComponent, and Phlex implementations. This module provides consistent styling and HTML attribute generation.
Based on shadcn/ui ButtonGroup: ui.shadcn.com/docs/components/button-group
Instance Method Summary collapse
-
#text_classes ⇒ Object
Returns combined CSS classes for the text element.
-
#text_html_attributes ⇒ Object
Returns HTML attributes for the text element.
Instance Method Details
#text_classes ⇒ Object
Returns combined CSS classes for the text element
18 19 20 21 22 23 24 |
# File 'app/behaviors/ui/button_group_text_behavior.rb', line 18 def text_classes classes_value = respond_to?(:classes, true) ? classes : @classes TailwindMerge::Merger.new.merge([ text_base_classes, classes_value ].compact.join(" ")) end |
#text_html_attributes ⇒ Object
Returns HTML attributes for the text element
11 12 13 14 15 |
# File 'app/behaviors/ui/button_group_text_behavior.rb', line 11 def text_html_attributes { class: text_classes } end |