Module: UI::ItemSeparatorBehavior

Included in:
ItemSeparator, ItemSeparatorComponent
Defined in:
app/behaviors/ui/item_separator_behavior.rb

Overview

ItemSeparatorBehavior

Shared behavior for Item separator across ERB, ViewComponent, and Phlex implementations. This module provides consistent HTML attribute generation and styling.

Instance Method Summary collapse

Instance Method Details

#item_separator_classesObject

Returns combined CSS classes



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

def item_separator_classes
  classes_value = respond_to?(:classes, true) ? classes : @classes
  TailwindMerge::Merger.new.merge([
    item_separator_base_classes,
    classes_value

  ].compact.join(" "))
end

#item_separator_html_attributesObject

Returns HTML attributes for the item separator element



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

def item_separator_html_attributes
  attributes_value = respond_to?(:attributes, true) ? attributes : @attributes
  {
    class: item_separator_classes
  }.merge(attributes_value || {})
end