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

Instance Method Details

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 alert_dialog_footer_base_classes
  "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end"
end

Merge base classes with custom classes using TailwindMerge



15
16
17
# File 'app/behaviors/ui/alert_dialog_footer_behavior.rb', line 15

def alert_dialog_footer_classes
  TailwindMerge::Merger.new.merge([alert_dialog_footer_base_classes, @classes].compact.join(" "))
end

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 alert_dialog_footer_html_attributes
  base_attrs = @attributes || {}
  base_attrs.merge(
    class: alert_dialog_footer_classes
  )
end