Mixins / foldkit-mixins-ui

Dialog

namespace · packages/mixins-ui/src/dialog.ts:1

export * as Dialog from './dialog.js'

In the guides

Members

Dialog.DialogSlots

const · packages/mixins-ui/src/dialog.ts:16

const DialogSlots: Slots.Contract<{ readonly dialog: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly [Event.EventToken<"cancel">], readonly [Attr.AttrToken<"aria-describedby">], readonly Slot.RequirementName[], boolean>; readonly backdrop: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly [Event.EventToken<"click">], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>; readonly panel: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>; readonly title: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>; readonly description: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>; readonly initialFocus: Slot.UnnamedSlot<Capability.Capability<"F …;

Dialog is a Submodel: each published bundle is a ChildAttribute group that carries the dialog boundary's dispatcher. The resolver treats those as opaque and preserves their identity, so spreading a resolved bundle into the parent's markup keeps routing through the dialog's toParentMessage.

dialog owns cancel (the native Escape handler); backdrop and closeButton own click. A Behavior adding its own handler to one of those is a conflict, not a second silent owner.

Dialog.isDismissal

function · packages/mixins-ui/src/dialog.ts:52

function isDismissal(message: DialogMessage): boolean

Whether message is the dialog dismissing itself: Escape, a press on the backdrop, or its close button, which upstream all send as RequestedClose. An alert dialog, the APG's, answers only to its own buttons: its application drops such a Message in update instead of folding it, closes from those buttons with @foldkit/ui's close, and draws the dialog with role="alertdialog" and no close button.

Dialog.resolve

function · packages/mixins-ui/src/dialog.ts:38

function resolve<Input, Message>(
  render: RenderInfo,
  mixins: MixinList<Message>,
  context: ResolveContext<Input, Message>,
): ResolvedDialog<Message>

Resolves the dialog's render groups; isVisible passes through unchanged.

Dialog.ResolvedDialog

type · packages/mixins-ui/src/dialog.ts:35

type ResolvedDialog<Message> = Resolved<RenderInfo, typeof DialogSlots, Message>

The dialog's bundles with the attached Mixins applied.

Dialog.toView

function · packages/mixins-ui/src/dialog.ts:55

function toView<Message>(
  mixins: MixinList<Message>,
  context: ResolveContext<unknown, Message>,
  draw: (resolved: ResolvedDialog<Message>) => Html,
): (render: RenderInfo) => Html

The dialog's toView: draw receives its bundles with mixins applied.