Class: DaisyUI::Chat

Inherits:
Base
  • Object
show all
Defined in:
lib/daisy_ui/chat.rb

Constant Summary collapse

BUBBLE_MODIFIERS =

Bubble color modifiers (applied to chat-bubble element)

{
  # "sm:chat-bubble-neutral"
  # "@sm:chat-bubble-neutral"
  # "md:chat-bubble-neutral"
  # "@md:chat-bubble-neutral"
  # "lg:chat-bubble-neutral"
  # "@lg:chat-bubble-neutral"
  neutral: "chat-bubble-neutral",
  # "sm:chat-bubble-primary"
  # "@sm:chat-bubble-primary"
  # "md:chat-bubble-primary"
  # "@md:chat-bubble-primary"
  # "lg:chat-bubble-primary"
  # "@lg:chat-bubble-primary"
  primary: "chat-bubble-primary",
  # "sm:chat-bubble-secondary"
  # "@sm:chat-bubble-secondary"
  # "md:chat-bubble-secondary"
  # "@md:chat-bubble-secondary"
  # "lg:chat-bubble-secondary"
  # "@lg:chat-bubble-secondary"
  secondary: "chat-bubble-secondary",
  # "sm:chat-bubble-accent"
  # "@sm:chat-bubble-accent"
  # "md:chat-bubble-accent"
  # "@md:chat-bubble-accent"
  # "lg:chat-bubble-accent"
  # "@lg:chat-bubble-accent"
  accent: "chat-bubble-accent",
  # "sm:chat-bubble-info"
  # "@sm:chat-bubble-info"
  # "md:chat-bubble-info"
  # "@md:chat-bubble-info"
  # "lg:chat-bubble-info"
  # "@lg:chat-bubble-info"
  info: "chat-bubble-info",
  # "sm:chat-bubble-success"
  # "@sm:chat-bubble-success"
  # "md:chat-bubble-success"
  # "@md:chat-bubble-success"
  # "lg:chat-bubble-success"
  # "@lg:chat-bubble-success"
  success: "chat-bubble-success",
  # "sm:chat-bubble-warning"
  # "@sm:chat-bubble-warning"
  # "md:chat-bubble-warning"
  # "@md:chat-bubble-warning"
  # "lg:chat-bubble-warning"
  # "@lg:chat-bubble-warning"
  warning: "chat-bubble-warning",
  # "sm:chat-bubble-error"
  # "@sm:chat-bubble-error"
  # "md:chat-bubble-error"
  # "@md:chat-bubble-error"
  # "lg:chat-bubble-error"
  # "@lg:chat-bubble-error"
  error: "chat-bubble-error"
}.freeze

Constants inherited from Base

Base::BOOLS, Base::COLOR_MODIFIERS

Instance Method Summary collapse

Methods inherited from Base

inherited, #initialize, register_modifiers

Constructor Details

This class inherits a constructor from DaisyUI::Base

Instance Method Details

#bubble(*modifiers, **options) ⇒ Object



80
81
82
83
# File 'lib/daisy_ui/chat.rb', line 80

def bubble(*modifiers, **options, &)
  bubble_classes = build_bubble_classes(modifiers, options)
  div(class: bubble_classes, **options, &)
end


85
86
87
# File 'lib/daisy_ui/chat.rb', line 85

def footer(**options, &)
  div(class: component_classes("chat-footer", options:), **options, &)
end

#header(**options) ⇒ Object



76
77
78
# File 'lib/daisy_ui/chat.rb', line 76

def header(**options, &)
  div(class: component_classes("chat-header", options:), **options, &)
end

#image(**options) ⇒ Object



72
73
74
# File 'lib/daisy_ui/chat.rb', line 72

def image(**options, &)
  div(class: component_classes("chat-image", options:), **options, &)
end

#view_templateObject



68
69
70
# File 'lib/daisy_ui/chat.rb', line 68

def view_template(&)
  public_send(as, class: classes, **attributes, &)
end