Module: UI::DropdownMenuSeparatorBehavior

Included in:
DropdownMenuSeparator, DropdownMenuSeparatorComponent
Defined in:
app/behaviors/ui/dropdown_menu_separator_behavior.rb

Overview

DropdownMenuSeparatorBehavior

Shared behavior for DropdownMenuSeparator component across ERB, ViewComponent, and Phlex implementations.

Instance Method Summary collapse

Instance Method Details

Returns combined CSS classes for the separator



17
18
19
20
21
22
# File 'app/behaviors/ui/dropdown_menu_separator_behavior.rb', line 17

def dropdown_menu_separator_classes
  classes_value = respond_to?(:classes, true) ? classes : @classes
  base_classes = "bg-border -mx-1 my-1 h-px"

  TailwindMerge::Merger.new.merge([base_classes, classes_value].compact.join(" "))
end

Returns HTML attributes for the separator



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

def dropdown_menu_separator_html_attributes
  {
    class: dropdown_menu_separator_classes,
    role: "separator",
    "aria-orientation": "horizontal"
  }
end