Module: UI::DialogHeaderBehavior

Included in:
DialogHeader, DialogHeaderComponent
Defined in:
app/behaviors/ui/dialog_header_behavior.rb

Overview

Shared behavior for Dialog Header component

Instance Method Summary collapse

Instance Method Details

#dialog_header_base_classesObject

Base classes applied to dialog header



23
24
25
# File 'app/behaviors/ui/dialog_header_behavior.rb', line 23

def dialog_header_base_classes
  "flex flex-col gap-2 text-center sm:text-left"
end

#dialog_header_classesObject

Returns combined CSS classes for the dialog header



15
16
17
18
19
20
# File 'app/behaviors/ui/dialog_header_behavior.rb', line 15

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

#dialog_header_html_attributesObject

Returns HTML attributes for the dialog header



8
9
10
11
12
# File 'app/behaviors/ui/dialog_header_behavior.rb', line 8

def dialog_header_html_attributes
  {
    class: dialog_header_classes
  }
end