Module: UI::AlertDialogFooterBehavior
- Included in:
- AlertDialogFooter
- Defined in:
- app/behaviors/ui/alert_dialog_footer_behavior.rb
Overview
Shared behavior for AlertDialog Footer component Handles footer section styling with action buttons
Instance Method Summary collapse
-
#alert_dialog_footer_base_classes ⇒ Object
Base CSS classes for alert dialog footer Note: flex-col-reverse on mobile so cancel appears below action, then row on desktop with buttons at end.
-
#alert_dialog_footer_classes ⇒ Object
Merge base classes with custom classes using TailwindMerge.
-
#alert_dialog_footer_html_attributes ⇒ Object
Build complete HTML attributes hash for alert dialog footer.
Instance Method Details
#alert_dialog_footer_base_classes ⇒ Object
Base CSS classes for alert dialog footer Note: flex-col-reverse on mobile so cancel appears below action, then row on desktop with buttons at end
10 11 12 |
# File 'app/behaviors/ui/alert_dialog_footer_behavior.rb', line 10 def "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end" end |
#alert_dialog_footer_classes ⇒ Object
Merge base classes with custom classes using TailwindMerge
15 16 17 |
# File 'app/behaviors/ui/alert_dialog_footer_behavior.rb', line 15 def TailwindMerge::Merger.new.merge([, @classes].compact.join(" ")) end |
#alert_dialog_footer_html_attributes ⇒ Object
Build complete HTML attributes hash for alert dialog footer
20 21 22 23 24 25 |
# File 'app/behaviors/ui/alert_dialog_footer_behavior.rb', line 20 def base_attrs = @attributes || {} base_attrs.merge( class: ) end |