Class: UI::AlertDialogContent

Inherits:
Phlex::HTML
  • Object
show all
Includes:
AlertDialogContentBehavior
Defined in:
app/components/ui/alert_dialog_content.rb

Overview

Content - Phlex implementation

Main alert dialog content area with proper ARIA attributes. Uses AlertDialogContentBehavior module for shared styling logic.

Examples:

Basic usage

render UI::Content.new { "Alert dialog content here" }

Instance Method Summary collapse

Methods included from AlertDialogContentBehavior

#alert_dialog_content_base_classes, #alert_dialog_content_classes, #alert_dialog_content_data_attributes, #alert_dialog_content_html_attributes, #merged_alert_dialog_content_data_attributes

Constructor Details

#initialize(classes: "", **attributes) ⇒ AlertDialogContent

Returns a new instance of AlertDialogContent.

Parameters:

  • classes (String) (defaults to: "")

    Additional CSS classes to merge

  • attributes (Hash)

    Additional HTML attributes



15
16
17
18
# File 'app/components/ui/alert_dialog_content.rb', line 15

def initialize(classes: "", **attributes)
  @classes = classes
  @attributes = attributes
end

Instance Method Details

#view_template(&block) ⇒ Object



20
21
22
23
24
# File 'app/components/ui/alert_dialog_content.rb', line 20

def view_template(&block)
  div(**alert_dialog_content_html_attributes) do
    yield if block_given?
  end
end