Module: UI::InputOtpGroupBehavior

Included in:
InputOtpGroup, InputOtpGroupComponent
Defined in:
app/behaviors/ui/input_otp_group_behavior.rb

Overview

InputOtpGroupBehavior

Shared behavior for InputOtpGroup component across ERB, ViewComponent, and Phlex implementations. This module provides consistent HTML attribute generation for grouping OTP slots.

Instance Method Summary collapse

Instance Method Details

#input_otp_group_classes ⇒ Object

Returns combined CSS classes for the input OTP group



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

def input_otp_group_classes
  classes_value = respond_to?(:classes, true) ? classes : @classes
  TailwindMerge::Merger.new.merge([
    input_otp_group_base_classes,
    classes_value
  ].compact.join(" "))
end

#input_otp_group_html_attributes ⇒ Object

Returns HTML attributes for the input OTP group element



11
12
13
14
15
# File 'app/behaviors/ui/input_otp_group_behavior.rb', line 11

def input_otp_group_html_attributes
  {
    class: input_otp_group_classes
  }
end