Module: UI::DrawerFooterBehavior

Included in:
DrawerFooter, DrawerFooterComponent
Defined in:
app/behaviors/ui/drawer_footer_behavior.rb

Overview

Shared behavior for Drawer Footer component Action area for drawer (buttons, etc.)

Instance Method Summary collapse

Instance Method Details

Base CSS classes for drawer footer



9
10
11
# File 'app/behaviors/ui/drawer_footer_behavior.rb', line 9

def drawer_footer_base_classes
  "mt-auto flex flex-col gap-2 p-4"
end

Merge base classes with custom classes using TailwindMerge



14
15
16
# File 'app/behaviors/ui/drawer_footer_behavior.rb', line 14

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

Build complete HTML attributes hash for footer



19
20
21
22
# File 'app/behaviors/ui/drawer_footer_behavior.rb', line 19

def drawer_footer_html_attributes
  base_attrs = @attributes || {}
  base_attrs.merge(class: drawer_footer_classes)
end