Class: PhlexKit::AlertDialogMedia

Inherits:
BaseComponent show all
Defined in:
app/components/phlex_kit/alert_dialog/alert_dialog_media.rb

Overview

Icon/image tile in an AlertDialogHeader — a muted circle above the title (beside the text column in size :sm dialogs). Ported from shadcn/ui's AlertDialogMedia (newer than ruby_ui's alert dialog). See alert_dialog.rb.

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(**attrs) ⇒ AlertDialogMedia

Returns a new instance of AlertDialogMedia.



6
7
8
# File 'app/components/phlex_kit/alert_dialog/alert_dialog_media.rb', line 6

def initialize(**attrs)
  @attrs = attrs
end

Instance Method Details

#view_templateObject



10
11
12
13
14
15
# File 'app/components/phlex_kit/alert_dialog/alert_dialog_media.rb', line 10

def view_template(&)
  base = { class: "pk-alert-dialog-media" }
  # Default only when the caller didn't supply their own — `mix` fuses.
  base[:aria] = { hidden: "true" } unless aria_key_set?(:hidden)
  div(**mix(base, @attrs), &)
end