MishkaCmsCoreWeb.Live.Admin.Components.DetailModal (Mishka CMS Core v0.0.1)

Copy Markdown View Source

Shared chrome + display helpers for the admin record modals (the runtime preview modal and the site details modal). Keeps ONE source of truth for the modal shell, segmented tabs, and the small card helpers — each consumer supplies only its own header bits (:subtitle/:actions slots), tab list, and tab content (:inner_block).

  • shell/1 — the modal wrapper (<id> / -bg / -container family driven by CoreComponents.show_modal/hide_modal), header (gradient icon box + title + slots), and the segmented tab bar. Closing pushes close_event after hiding, and Escape / click-away do the same.
  • detail/1, status_row/1, metric/1, datetime/1 — the card primitives shared by every tab.

Summary

Functions

The shell's own close transition (hide the modal, then push event) as a public JS command, so a consumer's own buttons (e.g. a footer "Close") dismiss the modal exactly like the header X.

Functions

datetime(dt)

detail(assigns)

Attributes

  • label (:string) (required)

Slots

  • inner_block (required)

dismiss(id, event)

The shell's own close transition (hide the modal, then push event) as a public JS command, so a consumer's own buttons (e.g. a footer "Close") dismiss the modal exactly like the header X.

metric(assigns)

Attributes

  • icon (:string) (required)
  • label (:string) (required)
  • value (:any) (required)
  • real (:boolean) - Defaults to false.

shell(assigns)

Attributes

  • id (:string) (required)
  • icon (:string) (required)
  • icon_class (:string) - Defaults to "bg-[linear-gradient(140deg,#6d69e6,#4f4bcc)]".
  • title (:string) (required)
  • max_width (:string) - Defaults to "max-w-[980px]".
  • active_tab (:string) (required)
  • tabs (:list) - Defaults to [].
  • tab_event (:string) (required)
  • tab_style (:atom) - Defaults to :segmented.
  • close_event (:string) (required)

Slots

  • title_prefix
  • subtitle
  • actions
  • inner_block (required)

status_row(assigns)

Attributes

  • label (:string) (required)

Slots

  • inner_block (required)