Mixins / foldkit-mixins-ui

ToastView

namespace · packages/mixins-ui/src/toastView.ts:15

export * as ToastView from './toastView.js'

A Toast view with the consumer toView seam @foldkit/ui/toast does not expose. State, Messages, update, Commands, Mounts, and subscriptions stay upstream: make binds upstream's Toast.make for the payload and swaps in only markup assembly, transcribed from @foldkit/ui@0.165.0 (packages/ui/src/toast/index.ts, MIT (c) 2025 Devin Jameson) at tag @foldkit/ui@0.165.0, with the computed bundles named (ToastRenderInfo) and handed to toView.

The default toView reproduces upstream's markup; the parity battery draws both views over the same models, so drift fails loudly. If upstream gains a seam, delete this module; on a bump, re-transcribe and re-run the battery.

In the guides

Members

ToastView.make

function · packages/mixins-ui/src/toastView.ts:112

function make<A, I>(payloadSchema: Schema.Codec<A, I>): { view: SubmodelView<{ readonly id: string; readonly defaultDuration: Duration; readonly entries: readonly { readonly id: string; readonly variant: "Info" | "Success" | "Warning" | "Error"; readonly animation: { readonly id: string; readonly isShowing: boolean; readonly transitionState: "Idle" | "EnterStart" | "EnterAnimating" | "LeaveStart" | "LeaveAnimating"; readonly transitionGeneration: number; }; readonly maybeDuration: Option.Option<Duration>; readonly pendingDismissVersion: number; readonly isHovered: boolean; readonly swipeState: { readonly _tag: "Idle"; } | { readonly _tag: "Dragging"; readonly pointerId: number; readonly startX: number; readonly currentX: number; } | { readonly _tag: "Settling"; readonly offsetX: number; } | { readonly _tag: "Dismissing"; readonly offsetX: number; readonly direction: "Left" | "Right"; }; readonly swipeVersion: number; readonly payload: A; }[]; readonly nextEntryKey: number; readonly maybeSwipeConfig: Option.Option<{ readonly direction: "Left" | "Right"; readonly threshold: number; }>; }, { readonly _tag: "GotAnimationMessage"; readonly entryId: string; readonly message: { readonly _tag: "Showed"; } | { readonly _tag: "Hid"; } | { readonly _tag: "CompletedWaitForPaint"; readonly generation: number; } | { readonly _tag: "EndedAnimation"; readonly generation: number; }; } | { readonly _tag: "Added"; readonly entry: { readonly id: string; readonly variant: "Info" | "Success" | "Warning" | "Error"; readonly animation: { readonly id: str …;

Binds upstream's Toast.make for the payload and swaps in the forked view: behavior is untouched, only markup assembly carries the seam.

ToastView.ToastEntryRender

type · packages/mixins-ui/src/toastView.ts:23

type ToastEntryRender = Readonly<{
  id: string
  attributes: ReadonlyArray<ChildAttribute>
  content: Html
}>

One toast entry's bundle: element id, attributes, and drawn content.

ToastView.ToastRenderInfo

type · packages/mixins-ui/src/toastView.ts:30

type ToastRenderInfo = Readonly<{
  id: string
  container: ReadonlyArray<ChildAttribute>
  entries: ReadonlyArray<ToastEntryRender>
}>

The toast stack's computed bundles.