Class: UI::AlertDialogOverlay

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

Overview

Overlay - Phlex implementation

Container wrapper with backdrop and content for the alert dialog overlay. Uses AlertDialogOverlayBehavior module for shared styling logic.

Examples:

Basic usage

render UI::Overlay.new do
  render UI::Content.new { "Content here" }
end

Instance Method Summary collapse

Methods included from AlertDialogOverlayBehavior

#alert_dialog_overlay_base_classes, #alert_dialog_overlay_classes, #alert_dialog_overlay_container_base_classes, #alert_dialog_overlay_container_classes, #alert_dialog_overlay_container_data_attributes, #alert_dialog_overlay_container_html_attributes, #alert_dialog_overlay_data_attributes, #alert_dialog_overlay_html_attributes, #merged_alert_dialog_overlay_container_data_attributes

Constructor Details

#initialize(open: false, classes: "", **attributes) ⇒ AlertDialogOverlay

Returns a new instance of AlertDialogOverlay.

Parameters:

  • open (Boolean) (defaults to: false)

    Whether the overlay is initially visible

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

    Additional CSS classes to merge

  • attributes (Hash)

    Additional HTML attributes



18
19
20
21
22
# File 'app/components/ui/alert_dialog_overlay.rb', line 18

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

Instance Method Details

#view_template(&block) ⇒ Object



24
25
26
27
28
29
# File 'app/components/ui/alert_dialog_overlay.rb', line 24

def view_template(&block)
  div(**alert_dialog_overlay_container_html_attributes) do
    div(**alert_dialog_overlay_html_attributes) {}
    yield if block_given?
  end
end