Class: Tailwinds::FlashComponent

Inherits:
BaseComponent show all
Defined in:
app/components/tailwinds/flash_component.rb

Overview

Description: A Tailwinds flash message component for displaying notifications.

Constant Summary

Constants inherited from BaseComponent

BaseComponent::TYPE_COLOR_MAP

Constants included from Tramway::Helpers::ViewsHelper

Tramway::Helpers::ViewsHelper::FORM_SIZES

Instance Method Summary collapse

Methods inherited from BaseComponent

#normalized_type, #resolved_color, #type_color

Methods included from Tramway::Helpers::ViewsHelper

#tramway_back_button, #tramway_badge, #tramway_button, #tramway_cell, #tramway_container, #tramway_flash, #tramway_form_for, #tramway_header, #tramway_main_container, #tramway_row, #tramway_table, #tramway_title

Methods included from Tramway::Helpers::ComponentHelper

#component

Methods included from Tramway::Helpers::DecorateHelper

#tramway_decorate

Instance Method Details

#container_classesObject



11
12
13
14
15
# File 'app/components/tailwinds/flash_component.rb', line 11

def container_classes
  theme_classes(
    classic: 'fixed top-4 right-4 z-50 space-y-2'
  )
end

#flash_classesObject



17
18
19
20
21
22
# File 'app/components/tailwinds/flash_component.rb', line 17

def flash_classes
  theme_classes(
    classic: "flash opacity-100 px-4 py-2 rounded-xl shadow-md bg-#{resolved_color}-100 " \
             "text-#{resolved_color}-800"
  )
end

#title_classesObject



24
25
26
27
28
# File 'app/components/tailwinds/flash_component.rb', line 24

def title_classes
  theme_classes(
    classic: 'text-xl font-semibold'
  )
end