@wow-two-beta/fe 0.0.27 → 0.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{AppSwitcherMenu.vue_vue_type_script_setup_true_lang-DVqdOOst.js → AccountMenu.vue_vue_type_script_setup_true_lang-CWsiHHiy.js} +700 -283
- package/dist/chunks/AccountMenu.vue_vue_type_script_setup_true_lang-CWsiHHiy.js.map +1 -0
- package/dist/chunks/Avatar.vue_vue_type_script_setup_true_lang-BIoaOjCh.js +267 -0
- package/dist/chunks/Avatar.vue_vue_type_script_setup_true_lang-BIoaOjCh.js.map +1 -0
- package/dist/chunks/{BackToTopButton.vue_vue_type_script_setup_true_lang-CNMcUYtR.js → BackToTopButton.vue_vue_type_script_setup_true_lang-6tfkqsrZ.js} +2 -2
- package/dist/chunks/{BackToTopButton.vue_vue_type_script_setup_true_lang-CNMcUYtR.js.map → BackToTopButton.vue_vue_type_script_setup_true_lang-6tfkqsrZ.js.map} +1 -1
- package/dist/chunks/{Button.vue_vue_type_script_setup_true_lang-BrgCAsgC.js → Button.vue_vue_type_script_setup_true_lang-Cw0QS_Mm.js} +2 -3
- package/dist/chunks/{Button.vue_vue_type_script_setup_true_lang-BrgCAsgC.js.map → Button.vue_vue_type_script_setup_true_lang-Cw0QS_Mm.js.map} +1 -1
- package/dist/chunks/{DrawerContent.vue_vue_type_script_setup_true_lang-CZQnfNGk.js → DrawerContent.vue_vue_type_script_setup_true_lang-BA-au7LC.js} +2 -2
- package/dist/chunks/{DrawerContent.vue_vue_type_script_setup_true_lang-CZQnfNGk.js.map → DrawerContent.vue_vue_type_script_setup_true_lang-BA-au7LC.js.map} +1 -1
- package/dist/chunks/{ErrorBoundary.vue_vue_type_script_setup_true_lang-LRQbVAiW.js → ErrorBoundary.vue_vue_type_script_setup_true_lang-DzqE0ZF8.js} +4 -4
- package/dist/chunks/{ErrorBoundary.vue_vue_type_script_setup_true_lang-LRQbVAiW.js.map → ErrorBoundary.vue_vue_type_script_setup_true_lang-DzqE0ZF8.js.map} +1 -1
- package/dist/chunks/{FieldHelperText.vue_vue_type_script_setup_true_lang-eqG5AyoV.js → FieldHelperText.vue_vue_type_script_setup_true_lang-DuMcXUch.js} +2 -2
- package/dist/chunks/{FieldHelperText.vue_vue_type_script_setup_true_lang-eqG5AyoV.js.map → FieldHelperText.vue_vue_type_script_setup_true_lang-DuMcXUch.js.map} +1 -1
- package/dist/chunks/{KanbanCard.vue_vue_type_script_setup_true_lang-BCnquIre.js → KanbanCard.vue_vue_type_script_setup_true_lang-CyXb4ZZw.js} +169 -427
- package/dist/chunks/KanbanCard.vue_vue_type_script_setup_true_lang-CyXb4ZZw.js.map +1 -0
- package/dist/chunks/{LightboxModal.vue_vue_type_script_setup_true_lang-Dm79L1eK.js → LightboxModal.vue_vue_type_script_setup_true_lang-BxdSYLYf.js} +6 -6
- package/dist/chunks/{LightboxModal.vue_vue_type_script_setup_true_lang-Dm79L1eK.js.map → LightboxModal.vue_vue_type_script_setup_true_lang-BxdSYLYf.js.map} +1 -1
- package/dist/chunks/{MasonryLayout.vue_vue_type_script_setup_true_lang-2CWeHWdV.js → MasonryLayout.vue_vue_type_script_setup_true_lang-DD_jRzkM.js} +4 -4
- package/dist/chunks/{MasonryLayout.vue_vue_type_script_setup_true_lang-2CWeHWdV.js.map → MasonryLayout.vue_vue_type_script_setup_true_lang-DD_jRzkM.js.map} +1 -1
- package/dist/chunks/{MentionInput.vue_vue_type_script_setup_true_lang-DdT24dkW.js → MentionInput.vue_vue_type_script_setup_true_lang-5pRxNIcK.js} +133 -82
- package/dist/chunks/MentionInput.vue_vue_type_script_setup_true_lang-5pRxNIcK.js.map +1 -0
- package/dist/chunks/{OverlayCloseButton.vue_vue_type_script_setup_true_lang-D01KYAAn.js → OverlayCloseButton.vue_vue_type_script_setup_true_lang-Df9raD_m.js} +2 -2
- package/dist/chunks/{OverlayCloseButton.vue_vue_type_script_setup_true_lang-D01KYAAn.js.map → OverlayCloseButton.vue_vue_type_script_setup_true_lang-Df9raD_m.js.map} +1 -1
- package/dist/chunks/{PopoverContent.vue_vue_type_script_setup_true_lang-BIHYpwzT.js → PopoverContent.vue_vue_type_script_setup_true_lang-C6YKEo3H.js} +2 -2
- package/dist/chunks/{PopoverContent.vue_vue_type_script_setup_true_lang-BIHYpwzT.js.map → PopoverContent.vue_vue_type_script_setup_true_lang-C6YKEo3H.js.map} +1 -1
- package/dist/chunks/{ReportAction.vue_vue_type_script_setup_true_lang-l4DjtcpM.js → ReportAction.vue_vue_type_script_setup_true_lang-DCnPCczd.js} +2 -2
- package/dist/chunks/{ReportAction.vue_vue_type_script_setup_true_lang-l4DjtcpM.js.map → ReportAction.vue_vue_type_script_setup_true_lang-DCnPCczd.js.map} +1 -1
- package/dist/chunks/{SurfaceStyles-B8KNkFsm.js → SurfaceStyles-BYvRlsWe.js} +2 -2
- package/dist/chunks/{SurfaceStyles-B8KNkFsm.js.map → SurfaceStyles-BYvRlsWe.js.map} +1 -1
- package/dist/chunks/{ToastHost.vue_vue_type_script_setup_true_lang-p0bfXJ9l.js → ToastHost.vue_vue_type_script_setup_true_lang-J1ZPZXn3.js} +3 -3
- package/dist/chunks/{ToastHost.vue_vue_type_script_setup_true_lang-p0bfXJ9l.js.map → ToastHost.vue_vue_type_script_setup_true_lang-J1ZPZXn3.js.map} +1 -1
- package/dist/chunks/{Tones-CQu-OvAk.js → Tones-Bcz8dIo3.js} +159 -1
- package/dist/chunks/Tones-Bcz8dIo3.js.map +1 -0
- package/dist/chunks/{index-C-r59Hob.js → index-CGIXFfl9.js} +3 -4
- package/dist/chunks/{index-C-r59Hob.js.map → index-CGIXFfl9.js.map} +1 -1
- package/dist/foundation/config/ConfigSource.d.ts +12 -5
- package/dist/foundation/config/DefineConfig.d.ts +9 -4
- package/dist/foundation/config/index.d.ts +1 -1
- package/dist/foundation/config/index.js +12 -9
- package/dist/foundation/config/index.js.map +1 -1
- package/dist/foundation/styles/index.js +9 -10
- package/dist/foundation/styles/index.js.map +1 -1
- package/dist/index.css +5 -0
- package/dist/index.js +465 -463
- package/dist/index.js.map +1 -1
- package/dist/presentation/actions/index.js +2 -2
- package/dist/presentation/display/index.js +178 -177
- package/dist/presentation/display/index.js.map +1 -1
- package/dist/presentation/feedback/index.js +3 -3
- package/dist/presentation/feedback/toastHost/index.js +1 -1
- package/dist/presentation/forms/InputStyles.d.ts +4 -4
- package/dist/presentation/forms/comboboxPicker/ComboboxPickerContext.d.ts +3 -0
- package/dist/presentation/forms/index.js +2 -2
- package/dist/presentation/forms/multiSelectPicker/MultiSelectPickerContext.d.ts +3 -0
- package/dist/presentation/forms/selectPicker/SelectPicker.variants.d.ts +5 -5
- package/dist/presentation/forms/selectPicker/SelectPickerContext.d.ts +3 -0
- package/dist/presentation/layout/index.js +1 -1
- package/dist/presentation/nav/accountMenu/AccountMenu.vue.d.ts +131 -0
- package/dist/presentation/nav/accountMenu/index.d.ts +1 -0
- package/dist/presentation/nav/index.d.ts +1 -0
- package/dist/presentation/nav/index.js +72 -71
- package/dist/presentation/overlays/index.js +4 -4
- package/package.json +1 -1
- package/dist/chunks/AppSwitcherMenu.vue_vue_type_script_setup_true_lang-DVqdOOst.js.map +0 -1
- package/dist/chunks/CssExtensions-ctGVlfYU.js +0 -161
- package/dist/chunks/CssExtensions-ctGVlfYU.js.map +0 -1
- package/dist/chunks/KanbanCard.vue_vue_type_script_setup_true_lang-BCnquIre.js.map +0 -1
- package/dist/chunks/MentionInput.vue_vue_type_script_setup_true_lang-DdT24dkW.js.map +0 -1
- package/dist/chunks/Tones-CQu-OvAk.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToastHost.vue_vue_type_script_setup_true_lang-p0bfXJ9l.js","sources":["../../src/presentation/feedback/toastSimple/ToastSimple.vue","../../src/presentation/feedback/toast/Toast.vue","../../src/presentation/feedback/toastHost/ToastHost.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { Severity } from '../../../foundation/styles';\n\n/** Represents the prop surface of `ToastSimple`. */\nexport interface ToastSimpleProps {\n /** The semantic severity palette. */\n readonly severity?: Severity;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs, useTemplateRef } from 'vue';\nimport { cn, surfaceVariants } from '../../../foundation/styles';\nimport type { Tone } from '../../../foundation/styles';\nimport type { ToastSimpleVariants } from './ToastSimple.variants';\n\n/** Maps the toast `severity` keyword to a SurfaceStyles `tone`. */\nconst SeverityToTone: Record<NonNullable<ToastSimpleVariants['severity']>, Tone> = {\n info: 'info',\n success: 'success',\n warning: 'warning',\n danger: 'danger',\n neutral: 'neutral',\n};\n\n/**\n * Renders the atomic toast card — a single tone-driven notification around free-form children.\n *\n * `role=\"status\"` + `aria-live=\"polite\"` are the live-region contract; `role` is\n * bound before `v-bind=\"rest\"` so a caller-supplied `role` still wins.\n */\ndefineOptions({ name: 'ToastSimple', inheritAttrs: false });\n\nconst props = withDefaults(defineProps<ToastSimpleProps>(), { severity: 'neutral' });\n\ndefineSlots<{\n /** The toast content. */\n default?(): unknown;\n}>();\n\nconst attrs = useAttrs();\nconst el = useTemplateRef<HTMLDivElement>('el');\n\nconst classes = computed(() =>\n cn(\n 'pointer-events-auto text-sm',\n surfaceVariants({\n variant: 'surface',\n tone: SeverityToTone[props.severity],\n radius: 'md',\n padding: 'md',\n elevation: 3,\n }),\n attrs.class as string | undefined,\n ),\n);\n\n/** Everything but `class`, which is re-applied through `cn` above. */\nconst rest = computed(() => {\n const { class: _class, ...others } = attrs;\n return others;\n});\n\ndefineExpose({ el });\n</script>\n\n<template>\n <div ref=\"el\" role=\"status\" aria-live=\"polite\" v-bind=\"rest\" :class=\"classes\"><slot /></div>\n</template>\n","<script lang=\"ts\">\nimport type { Severity } from '../../../foundation/styles';\n\nexport interface ToastProps {\n /** The semantic severity palette. */\n readonly severity?: Severity;\n /** The optional leading icon. Rich content → the `icon` slot. */\n readonly icon?: string;\n /** The bold heading line. Rich content → the `title` slot. */\n readonly title?: string;\n /** The body text below the title. Rich content → the `description` slot. */\n readonly description?: string;\n /** The action area below the body. Rich content → the `actions` slot. */\n readonly actions?: string;\n /** The accessible label for the close button. Default `\"Dismiss\"`. */\n readonly closeLabel?: string;\n /** The accessible label for removing a retained notice. Default \"Delete notification\". */\n readonly deleteLabel?: string;\n /**\n * Shows the severity's own glyph when no `icon` is given — a distinct shape per severity, so the meaning\n * never rests on colour alone. `neutral` has none. Default `true`.\n */\n readonly showSeverityIcon?: boolean;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { useLocaleDefaults } from '../../../foundation/i18n';\nimport { computed, getCurrentInstance, useAttrs, useSlots, useTemplateRef } from 'vue';\nimport { Trash2, X } from 'lucide-vue-next';\nimport { cn, Severity as SeverityToken } from '../../../foundation/styles';\nimport { Icon, SeverityIconClasses, SeverityIcons } from '../../../foundation/icons';\nimport ToastSimple from '../toastSimple/ToastSimple.vue';\n\nconst CloseIcon = X;\n\n/**\n * Renders a toast card — icon, title, description, actions, and a close button.\n * Visual only (queue / portal / lifecycle land with `ToastHost` at L5); the atom is `ToastSimple`.\n *\n * Each of React's four `ReactNode` props keeps its string form and gains a\n * same-named slot for rich content; the slot wins when both are supplied.\n */\ndefineOptions({ name: 'Toast', inheritAttrs: false });\n\nconst componentProps = withDefaults(defineProps<ToastProps>(), { showSeverityIcon: true });\nconst props = useLocaleDefaults(componentProps, 'Toast', { closeLabel: 'Dismiss', deleteLabel: 'Delete notification' });\n\n/** Replaces React's `onClose`; omitting `@close` omits the close button. */\nconst emit = defineEmits<{\n /** Fires when the close button is activated. */\n close: [];\n /** Fires when the delete icon is activated; only rendered when bound for retained notices. */\n delete: [];\n}>();\n\ndefineSlots<{\n /** The extra content below the description. */\n default?(): unknown;\n /** The leading icon. Falls back to the `icon` prop. */\n icon?(): unknown;\n /** The heading line. Falls back to the `title` prop. */\n title?(): unknown;\n /** The body text below the title. Falls back to the `description` prop. */\n description?(): unknown;\n /** The action row. Falls back to the `actions` prop. */\n actions?(): unknown;\n /** The adornment beside the close button — a countdown, a timestamp. */\n trailing?(): unknown;\n}>();\n\nconst attrs = useAttrs();\nconst slots = useSlots();\nconst instance = getCurrentInstance();\nconst inner = useTemplateRef<InstanceType<typeof ToastSimple>>('inner');\n\n/**\n * Mirrors React's `onClose && <button/>` guard — the close button renders only\n * when the consumer bound `@close`. Read through a call, not a cached computed:\n * `instance.vnode` is replaced on every re-render.\n */\nconst hasClose = () => Boolean(instance?.vnode.props?.onClose);\nconst hasDelete = () => Boolean(instance?.vnode.props?.onDelete);\n\n/**\n * The glyph standing in for a missing `icon` — `null` when switched off, or for a neutral toast. An `icon`\n * slot replaces it as the slot's fallback content, so slot presence stays out of this cached value.\n */\nconst severityIcon = computed(() =>\n props.showSeverityIcon && !props.icon ? SeverityIcons[props.severity ?? SeverityToken.Neutral] : null,\n);\nconst severityIconClass = computed(() => SeverityIconClasses[props.severity ?? SeverityToken.Neutral]);\n\n/*\n * Slot presence is read through calls, not cached computeds: `slots` is not reactive, and a host that updates a\n * toast in place (a promise settling, a dedup refresh) adds or drops slots between renders.\n */\nconst hasIcon = () => Boolean(props.icon) || Boolean(slots.icon) || severityIcon.value !== null;\nconst hasTitle = () => Boolean(props.title) || Boolean(slots.title);\nconst hasDescription = () => Boolean(props.description) || Boolean(slots.description);\nconst hasActions = () => Boolean(props.actions) || Boolean(slots.actions);\n\nconst classes = computed(() => cn('flex items-start gap-3', attrs.class as string | undefined));\n\nconst descriptionClasses = () => cn('text-sm', hasTitle() && 'mt-0.5 text-muted-foreground');\n\n/** Everything but `class`, which is re-applied through `cn` above. */\nconst rest = computed(() => {\n const { class: _class, ...others } = attrs;\n return others;\n});\n\n/** Re-exposes the underlying `ToastSimple` root element, matching React's forwarded ref. */\nconst el = computed(() => inner.value?.el ?? null);\n\ndefineExpose({ el });\n</script>\n\n<template>\n <ToastSimple ref=\"inner\" :severity=\"props.severity\" v-bind=\"rest\" :class=\"classes\">\n <span v-if=\"hasIcon()\" data-toast-icon class=\"mt-0.5 shrink-0\">\n <slot name=\"icon\">\n <Icon v-if=\"severityIcon\" :icon=\"severityIcon\" :size=\"16\" :class=\"severityIconClass\" />\n <template v-else>{{ props.icon }}</template>\n </slot>\n </span>\n <div class=\"min-w-0 flex-1\">\n <div v-if=\"hasTitle()\" class=\"font-medium\">\n <slot name=\"title\">{{ props.title }}</slot>\n </div>\n <div v-if=\"hasDescription()\" :class=\"descriptionClasses()\">\n <slot name=\"description\">{{ props.description }}</slot>\n </div>\n <div v-if=\"hasActions()\" class=\"mt-2 flex flex-wrap items-center gap-2\">\n <slot name=\"actions\">{{ props.actions }}</slot>\n </div>\n <slot />\n </div>\n <span v-if=\"slots.trailing\" class=\"flex h-5 shrink-0 items-center\">\n <slot name=\"trailing\" />\n </span>\n <button\n v-if=\"hasDelete()\"\n type=\"button\"\n :aria-label=\"props.deleteLabel\"\n class=\"grid h-6 w-6 shrink-0 place-items-center rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring\"\n @click=\"emit('delete')\"\n >\n <Icon :icon=\"Trash2\" :size=\"14\" />\n </button>\n <button\n v-if=\"hasClose()\"\n type=\"button\"\n :aria-label=\"props.closeLabel\"\n class=\"-mr-1 grid h-6 w-6 shrink-0 place-items-center rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring\"\n @click=\"emit('close')\"\n >\n <Icon :icon=\"CloseIcon\" :size=\"14\" />\n </button>\n </ToastSimple>\n</template>\n","<script lang=\"ts\">\nimport type { VNode } from 'vue';\nimport type { OverlayPosition } from '../../../foundation/styles';\nimport type { ReportSend } from '../../../reporting';\nimport type { ToastSimpleVariants } from '../toastSimple/ToastSimple.variants';\n\nexport type ToastSeverity = NonNullable<ToastSimpleVariants['severity']>;\n\n/** Defines how a toast shows the time left before it dismisses itself. */\nexport const ToastTimer = {\n /** Refers to no countdown — the toast still expires on time. */\n None: 'none',\n /** Refers to a bar draining along the toast's bottom edge. */\n Bar: 'bar',\n /** Refers to a ring draining beside the close button. */\n Ring: 'ring',\n /** Refers to the whole seconds left, counted beside the close button. */\n Seconds: 'seconds',\n} as const;\n\nexport type ToastTimer = (typeof ToastTimer)[keyof typeof ToastTimer];\n\n/** Provides the per-severity expiry a `ToastHost` starts from — an error stays long enough to read and report. */\nexport const DefaultToastDurations: Readonly<Partial<Record<ToastSeverity, number>>> = Object.freeze({\n danger: 8000,\n});\n\n/**\n * A renderable slice of a toast. These travel through the imperative\n * `toastHost.toast()` payload, not through a slot, so a caller who wants\n * markup builds it with `h()`.\n */\nexport type ToastNode = string | VNode;\n\nexport interface ToastOptions {\n title?: ToastNode;\n description?: ToastNode;\n icon?: ToastNode;\n severity?: ToastSeverity;\n /**\n * ms before auto-dismiss. Default: the ToastHost's `durations` entry for the severity, then its\n * `defaultDuration`. `Infinity` = sticky.\n */\n duration?: number;\n action?: ToastNode;\n /**\n * Sends a one-click report of the failure this toast shows; the toast renders a Report action that walks\n * sending → reported (with the reference) → retry on failure. Pairs with `/reporting`'s `capture(error).send`.\n */\n report?: ReportSend;\n /** Shows the severity's own glyph when no `icon` is given. Default: the ToastHost's `showSeverityIcon`. */\n showSeverityIcon?: boolean;\n /**\n * Fully custom body — replaces the default `Toast` chrome (icon/title/description/close).\n * Still animates + auto-dismisses; the content owns its close via the returned id.\n */\n content?: ToastNode;\n /**\n * Fired when the toast is removed — auto-dismiss, close button, `dismiss(id)`, or `dismissAll()`.\n * Not fired on a dedup-update. For undo cleanup / analytics.\n */\n onDismiss?: () => void;\n /** Deletes an explicitly retained notification; omitted for transient toasts. */\n onDelete?: () => void;\n /**\n * Dedup key — a `toast` whose `key` is already showing updates that toast in place,\n * refreshing its timer instead of stacking a duplicate.\n */\n key?: string;\n /** How this toast shows its time left. Default: the ToastHost's `timer`. */\n timer?: ToastTimer;\n /**\n * Shows or hides this toast's countdown bar.\n * @deprecated Use `timer` — `ToastTimer.Bar` or `ToastTimer.None`.\n */\n progress?: boolean;\n}\n\n/** Content for a `toastHost.promise` phase — a title string, or a full partial options object. */\nexport type ToastContent = string | Partial<ToastOptions>;\n\n/**\n * Options for `toastHost.promise` — loading / success / error content\n * (success + error may be a fn of the settled value).\n */\nexport interface ToastPromiseOptions<T> {\n loading: ToastContent;\n success: ToastContent | ((value: T) => ToastContent);\n error: ToastContent | ((err: unknown) => ToastContent);\n /** Auto-dismiss (ms) for the settled toast; defaults to the ToastHost's `defaultDuration`. */\n duration?: number;\n}\n\nfunction normalizeContent(content: ToastContent): Partial<ToastOptions> {\n return typeof content === 'string' ? { title: content } : content;\n}\n\ninterface ToastEntry extends ToastOptions {\n id: string;\n /** Bumped on every `update` / dedup so the viewport can reset that toast's auto-dismiss timer. */\n nonce: number;\n}\n\ntype Listener = (toasts: ReadonlyArray<ToastEntry>) => void;\n\nclass ToastHostStore {\n private items: ReadonlyArray<ToastEntry> = [];\n private listeners = new Set<Listener>();\n private idSeq = 0;\n\n toast(opts: ToastOptions): string {\n if (opts.key !== undefined) {\n const existing = this.items.find((t) => t.key === opts.key);\n if (existing) {\n this.update(existing.id, opts);\n return existing.id;\n }\n }\n const id = `t_${++this.idSeq}`;\n this.items = [...this.items, { id, ...opts, nonce: 0 }];\n this.emit();\n return id;\n }\n\n /** Merges a patch into an existing toast (content + severity + duration), refreshing its timer. */\n update(id: string, patch: Partial<ToastOptions>): void {\n this.items = this.items.map((t) => (t.id === id ? { ...t, ...patch, nonce: t.nonce + 1 } : t));\n this.emit();\n }\n\n /** Shows a sticky loading toast; returns the full content-update and promise settlement chain. */\n promise<T>(promise: Promise<T>, opts: ToastPromiseOptions<T>): Promise<T> {\n const id = this.toast({ ...normalizeContent(opts.loading), severity: 'info', duration: Infinity });\n const settle = (content: ToastContent, severity: ToastSeverity) =>\n this.update(id, { ...normalizeContent(content), severity, duration: opts.duration });\n return promise.then(\n (value) => {\n settle(typeof opts.success === 'function' ? opts.success(value) : opts.success, 'success');\n return value;\n },\n (err: unknown) => {\n settle(typeof opts.error === 'function' ? opts.error(err) : opts.error, 'danger');\n throw err;\n },\n );\n }\n\n dismiss(id: string): void {\n const entry = this.items.find((t) => t.id === id);\n this.items = this.items.filter((t) => t.id !== id);\n try {\n entry?.onDismiss?.();\n } finally {\n this.emit();\n }\n }\n\n dismissAll(): void {\n const gone = this.items;\n this.items = [];\n try {\n for (const t of gone) t.onDismiss?.();\n } finally {\n this.emit();\n }\n }\n\n subscribe(fn: Listener): () => void {\n this.listeners.add(fn);\n fn(this.items);\n return () => {\n this.listeners.delete(fn);\n };\n }\n\n private emit() {\n for (const fn of this.listeners) fn(this.items);\n }\n}\n\nexport const toastHost = new ToastHostStore();\n\n/**\n * The imperative toast API, bound to the app-wide store. A plain object — the\n * store is a module singleton, so there is nothing per-instance to memoize.\n */\nexport function useToastHost() {\n return {\n toast: (opts: ToastOptions) => toastHost.toast(opts),\n update: (id: string, patch: Partial<ToastOptions>) => toastHost.update(id, patch),\n promise: <T,>(promise: Promise<T>, opts: ToastPromiseOptions<T>) => toastHost.promise(promise, opts),\n dismiss: (id: string) => toastHost.dismiss(id),\n dismissAll: () => toastHost.dismissAll(),\n };\n}\n\nconst PositionClasses = 'top-4 right-4 items-end';\n\n/** Toasts enter from the right; reduced-motion users get an instant swap. */\nconst MotionClasses =\n 'motion-safe:data-[state=open]:animate-(--animate-slide-in-right) motion-safe:data-[state=closed]:animate-(--animate-slide-out-right) motion-reduce:animate-none';\n\nexport interface ToastHostProps {\n /** @deprecated Toasts always anchor top-right. Accepted for one release, without changing placement. */\n readonly position?: OverlayPosition;\n readonly max?: number;\n /**\n * The auto-dismiss delay in ms for a severity missing from `durations`; per-toast `duration` overrides.\n * Default 5000. `Infinity` to disable.\n */\n readonly defaultDuration?: number;\n /**\n * The auto-dismiss delay in ms per severity; per-toast `duration` overrides, and a severity left out falls\n * back to `defaultDuration`. Default `DefaultToastDurations` — errors stay 8 seconds. Replaces, never merges.\n */\n readonly durations?: Readonly<Partial<Record<ToastSeverity, number>>>;\n readonly canPauseOnHover?: boolean;\n readonly gap?: number;\n /**\n * How each auto-dismissing toast shows its time left; a toast's `timer` overrides. Every display pauses with\n * the expiry timer and restarts when the toast updates; sticky toasts show none, and reduced motion drops the\n * bar and the ring. Custom `content` has no close button to sit beside, so it takes the bar for a ring or\n * seconds. Default `ToastTimer.None`.\n */\n readonly timer?: ToastTimer;\n /**\n * Shows a countdown bar along the bottom of each auto-dismissing toast.\n * @deprecated Use `timer` — `ToastTimer.Bar`.\n */\n readonly showProgress?: boolean;\n /** Shows each severity's glyph on toasts given no `icon`; a toast's `showSeverityIcon` overrides. Default `true`. */\n readonly showSeverityIcon?: boolean;\n}\n\ninterface VisibleToast extends ToastEntry {\n resolvedDuration: number;\n}\n\n/** Countdown fill per severity; the neutral countdown uses the brand primary. */\nconst ProgressClasses: Record<ToastSeverity, string> = {\n neutral: 'bg-primary',\n info: 'bg-info',\n success: 'bg-success',\n warning: 'bg-warning',\n danger: 'bg-destructive',\n};\n\n/** Countdown-ring stroke per severity — the bar's tones, drawn as an arc. */\nconst RingClasses: Record<ToastSeverity, string> = {\n neutral: 'stroke-primary',\n info: 'stroke-info',\n success: 'stroke-success',\n warning: 'stroke-warning',\n danger: 'stroke-destructive',\n};\n\n/** The ring's radius in the 16×16 view box; the circumference is the dash the countdown drains. */\nconst RingRadius = 6;\nconst RingCircumference = 2 * Math.PI * RingRadius;\n\n/** How often the seconds display re-reads its clock — a quarter second keeps a whole-second flip on time. */\nconst SecondsTickMs = 250;\n</script>\n\n<script setup lang=\"ts\">\nimport { useLocale } from '../../../foundation/i18n';\nimport {\n computed,\n defineComponent,\n h,\n onMounted,\n onUnmounted,\n ref,\n shallowRef,\n useAttrs,\n watch,\n type PropType,\n} from 'vue';\nimport { cn, OverlayPosition as OverlayPositionToken } from '../../../foundation/styles';\nimport { Announce, Portal, Presence } from '../../../foundation/primitives';\nimport Toast from '../toast/Toast.vue';\nimport ReportAction from '../reportAction/ReportAction.vue';\n\nconst locale = useLocale();\n\n/** Renders a `ToastNode` — either a plain string or a caller-built VNode. */\nconst ToastNodeView = defineComponent({\n name: 'ToastNodeView',\n props: { node: { type: [String, Object] as PropType<ToastNode>, required: true } },\n setup: (nodeProps) => () => nodeProps.node,\n});\n\n/** The props every countdown display shares — it mirrors the host's expiry timer, never drives it. */\nconst CountdownProps = {\n duration: { type: Number, required: true },\n paused: { type: Boolean, default: false },\n severity: { type: String as PropType<ToastSeverity>, default: 'neutral' },\n} as const;\n\n/**\n * Runs one Web Animations API countdown on a template ref, paused and resumed in step with the host's expiry\n * timer; environments without `animate` leave the element static at full.\n */\nfunction useCountdownAnimation(\n element: () => Element | null,\n keyframes: Keyframe[],\n countdown: { readonly duration: number; readonly paused: boolean },\n): void {\n let animation: Animation | undefined;\n onMounted(() => {\n const target = element();\n if (!target || typeof target.animate !== 'function') return;\n animation = target.animate(keyframes, { duration: countdown.duration, easing: 'linear', fill: 'forwards' });\n if (countdown.paused) animation.pause();\n });\n watch(\n () => countdown.paused,\n (isPaused) => {\n if (isPaused) animation?.pause();\n else animation?.play();\n },\n );\n onUnmounted(() => animation?.cancel());\n}\n\n/** The countdown bar — a scale transform draining along the toast's bottom edge. */\nconst ToastProgress = defineComponent({\n name: 'ToastProgress',\n props: CountdownProps,\n setup(countdown) {\n const fill = ref<HTMLElement | null>(null);\n useCountdownAnimation(() => fill.value, [{ transform: 'scaleX(1)' }, { transform: 'scaleX(0)' }], countdown);\n return () =>\n h(\n 'div',\n {\n 'aria-hidden': 'true',\n 'data-toast-progress': '',\n class: 'absolute inset-x-0 bottom-0 h-1 motion-reduce:hidden',\n },\n [\n h('div', {\n ref: fill,\n class: cn('h-full w-full origin-left opacity-80', ProgressClasses[countdown.severity]),\n }),\n ],\n );\n },\n});\n\n/** The countdown ring — an arc draining clockwise from twelve o'clock, drawn beside the close button. */\nconst ToastRing = defineComponent({\n name: 'ToastRing',\n props: CountdownProps,\n setup(countdown) {\n const arc = ref<SVGCircleElement | null>(null);\n useCountdownAnimation(\n () => arc.value,\n [{ strokeDashoffset: '0' }, { strokeDashoffset: `${RingCircumference}` }],\n countdown,\n );\n return () =>\n h(\n 'svg',\n {\n 'aria-hidden': 'true',\n 'data-toast-timer': ToastTimer.Ring,\n viewBox: '0 0 16 16',\n class: 'size-4 -rotate-90 motion-reduce:hidden',\n },\n [\n h('circle', { cx: 8, cy: 8, r: RingRadius, fill: 'none', 'stroke-width': 2, class: 'stroke-border' }),\n h('circle', {\n ref: arc,\n cx: 8,\n cy: 8,\n r: RingRadius,\n fill: 'none',\n 'stroke-width': 2,\n 'stroke-linecap': 'round',\n 'stroke-dasharray': `${RingCircumference}`,\n class: RingClasses[countdown.severity],\n }),\n ],\n );\n },\n});\n\n/**\n * The seconds display — the whole seconds left, rounded up so it reads `1s` until the toast goes. It keeps its\n * own clock, advancing only while unpaused; the announcement region already carries the toast, so it is hidden.\n */\nconst ToastSeconds = defineComponent({\n name: 'ToastSeconds',\n props: CountdownProps,\n setup(countdown) {\n const left = ref(countdown.duration);\n let lastTick = 0;\n let handle: number | undefined;\n const tick = () => {\n const now = Date.now();\n left.value = Math.max(0, left.value - (now - lastTick));\n lastTick = now;\n };\n const start = () => {\n if (handle !== undefined) return;\n lastTick = Date.now();\n handle = window.setInterval(tick, SecondsTickMs);\n };\n const stop = () => {\n if (handle === undefined) return;\n tick();\n window.clearInterval(handle);\n handle = undefined;\n };\n onMounted(() => {\n if (!countdown.paused) start();\n });\n watch(\n () => countdown.paused,\n (isPaused) => (isPaused ? stop() : start()),\n );\n onUnmounted(() => {\n if (handle !== undefined) window.clearInterval(handle);\n });\n return () =>\n h(\n 'span',\n {\n 'aria-hidden': 'true',\n 'data-toast-timer': ToastTimer.Seconds,\n class: 'text-xs tabular-nums text-muted-foreground',\n },\n `${Math.ceil(left.value / 1000)}s`,\n );\n },\n});\n\n/**\n * Renders the toast viewport — subscribes to the global `toastHost` store and stacks `Toast` cards.\n * Mount once, per app.\n *\n * A caller's `class` attr lands on the stack container.\n */\ndefineOptions({ name: 'ToastHost', inheritAttrs: false });\n\nconst props = withDefaults(defineProps<ToastHostProps>(), {\n position: OverlayPositionToken.TopRight,\n max: 5,\n defaultDuration: 5000,\n durations: () => DefaultToastDurations,\n canPauseOnHover: true,\n gap: 8,\n timer: undefined,\n showProgress: false,\n showSeverityIcon: true,\n});\n\nconst attrs = useAttrs();\n\nconst items = shallowRef<ReadonlyArray<ToastEntry>>([]);\nconst hovered = ref(false);\nconst focused = ref(false);\nconst paused = computed(() => props.canPauseOnHover && (hovered.value || focused.value));\n\n/* Non-reactive state — mutated across ticks, never rendered. */\nconst timers = new Map<string, number>();\nconst remaining = new Map<string, number>();\nconst startedAt = new Map<string, number>();\nconst nonces = new Map<string, number>();\n\nlet unsubscribe: (() => void) | undefined;\nonMounted(() => {\n unsubscribe = toastHost.subscribe((next) => {\n items.value = next;\n });\n});\n\n// Visible window (FIFO).\nconst visible = computed<ReadonlyArray<VisibleToast>>(() =>\n items.value.slice(0, props.max).map((t) => ({\n ...t,\n resolvedDuration: t.duration ?? props.durations[t.severity ?? 'neutral'] ?? props.defaultDuration,\n })),\n);\nconst visibleIds = computed(() => new Set(visible.value.map((v) => v.id)));\n\n// Toasts that just left `visible` (dismissed, or pushed out of the FIFO\n// window) but must still play their exit animation. Kept mounted with\n// `data-state=\"closed\"` until `Presence` unmounts the child — the `@vue:unmounted`\n// hook below then prunes the entry here.\nconst exiting = shallowRef<ReadonlyArray<VisibleToast>>([]);\nlet prevVisible: ReadonlyArray<VisibleToast> = [];\n\nwatch(\n visibleIds,\n (ids) => {\n const gone = prevVisible.filter((p) => !ids.has(p.id));\n prevVisible = visible.value;\n const current = exiting.value;\n const known = new Set(current.map((e) => e.id));\n // Add newly-gone toasts; drop any that re-entered `visible`.\n const merged = [...current, ...gone.filter((g) => !known.has(g.id))].filter((e) => !ids.has(e.id));\n if (merged.length !== current.length || !merged.every((e, i) => e.id === current[i]?.id)) {\n exiting.value = merged;\n }\n },\n { immediate: true, flush: 'post' },\n);\n\nconst removeExiting = (id: string) => {\n exiting.value = exiting.value.filter((e) => e.id !== id);\n};\n\n// Visible (present) first, then the ones animating out.\nconst rendered = computed<Array<VisibleToast & { present: boolean }>>(() => [\n ...visible.value.map((v) => ({ ...v, present: true })),\n ...exiting.value.map((e) => ({ ...e, present: false })),\n]);\n\nconst latestTitle = computed(() => {\n const last = visible.value[visible.value.length - 1];\n if (typeof last?.title === 'string') return last.title;\n if (typeof last?.description === 'string') return last.description;\n return '';\n});\n\n// Schedule auto-dismiss timers.\nwatch(\n [items, () => props.max, () => props.defaultDuration, () => props.durations, paused],\n () => {\n const ids = visibleIds.value;\n // Clear timers for items that are no longer visible.\n for (const [id, handle] of timers) {\n if (!ids.has(id)) {\n window.clearTimeout(handle);\n timers.delete(id);\n remaining.delete(id);\n startedAt.delete(id);\n }\n }\n for (const id of nonces.keys()) {\n if (!ids.has(id)) nonces.delete(id);\n }\n if (paused.value) return;\n // A content update / dedup bumps `nonce` — clear that toast's timer so it reschedules fresh.\n for (const v of visible.value) {\n const seen = nonces.get(v.id);\n if (seen !== undefined && seen !== v.nonce) {\n const handle = timers.get(v.id);\n if (handle !== undefined) window.clearTimeout(handle);\n timers.delete(v.id);\n remaining.delete(v.id);\n startedAt.delete(v.id);\n }\n nonces.set(v.id, v.nonce);\n }\n for (const v of visible.value) {\n if (v.resolvedDuration === Infinity) continue;\n if (timers.has(v.id)) continue;\n const left = remaining.get(v.id) ?? v.resolvedDuration;\n const handle = window.setTimeout(() => {\n toastHost.dismiss(v.id);\n }, left);\n timers.set(v.id, handle);\n startedAt.set(v.id, Date.now());\n remaining.set(v.id, left);\n }\n },\n { immediate: true, flush: 'post' },\n);\n\n// Cleanup on unmount.\nonUnmounted(() => {\n unsubscribe?.();\n for (const handle of timers.values()) window.clearTimeout(handle);\n timers.clear();\n});\n\nwatch(\n paused,\n (isPaused) => {\n if (!isPaused) return;\n for (const [id, handle] of timers) {\n window.clearTimeout(handle);\n const start = startedAt.get(id) ?? Date.now();\n remaining.set(id, Math.max(0, (remaining.get(id) ?? 0) - (Date.now() - start)));\n }\n timers.clear();\n },\n { flush: 'sync' },\n);\n\nwatch(\n () => rendered.value.length,\n (count) => {\n if (count === 0) {\n hovered.value = false;\n focused.value = false;\n }\n },\n);\n\nfunction onFocusout(event: FocusEvent): void {\n const stack = event.currentTarget as HTMLElement;\n if (!(event.relatedTarget instanceof Node) || !stack.contains(event.relatedTarget)) focused.value = false;\n}\n\nconst stackClasses = computed(() =>\n cn('pointer-events-none fixed z-toast flex flex-col', PositionClasses, attrs.class as string | undefined),\n);\n\nconst itemClasses = computed(() => cn('pointer-events-auto relative w-80 overflow-hidden rounded-md', MotionClasses));\n\n/** The display a toast asked for — its own `timer`, its deprecated `progress`, then the host's two. */\nfunction requestedTimer(t: VisibleToast): ToastTimer {\n if (t.timer !== undefined) return t.timer;\n if (t.progress !== undefined) return t.progress ? ToastTimer.Bar : ToastTimer.None;\n if (props.timer !== undefined) return props.timer;\n return props.showProgress ? ToastTimer.Bar : ToastTimer.None;\n}\n\n/**\n * The display a toast gets — none while exiting or sticky, and the bar for custom `content`, which has no close\n * button for a ring or seconds to sit beside.\n */\nfunction timerFor(t: VisibleToast & { present: boolean }): ToastTimer {\n if (!t.present || !Number.isFinite(t.resolvedDuration)) return ToastTimer.None;\n const requested = requestedTimer(t);\n return t.content && requested !== ToastTimer.None ? ToastTimer.Bar : requested;\n}\n\n/** Whether a toast's display sits beside the close button rather than along the bottom edge. */\nconst isTrailingTimer = (timer: ToastTimer): boolean => timer === ToastTimer.Ring || timer === ToastTimer.Seconds;\n\n/** Vue does not auto-suffix numeric style values with `px`. */\nconst stackStyle = computed(() => ({ gap: `${props.gap}px` }));\n</script>\n\n<template>\n <Portal>\n <div\n v-if=\"rendered.length > 0\"\n role=\"region\"\n :aria-label=\"locale.t('ToastHost.notifications', undefined, 'Notifications')\"\n :style=\"stackStyle\"\n :class=\"stackClasses\"\n @mouseenter=\"hovered = true\"\n @mouseleave=\"hovered = false\"\n @focusin=\"focused = true\"\n @focusout=\"onFocusout\"\n >\n <Presence v-for=\"t in rendered\" :key=\"t.id\" :is-present=\"t.present\">\n <!--\n `Presence` clones `data-state` onto this node and keeps it mounted\n until the exit animation ends; the `@vue:unmounted` hook is that\n \"exit finished\" signal (the read-only `Presence` API exposes no\n callback).\n -->\n <div :class=\"itemClasses\" @vue:unmounted=\"t.present ? undefined : removeExiting(t.id)\">\n <ToastNodeView v-if=\"t.content\" :node=\"t.content\" />\n <Toast\n v-else\n :severity=\"t.severity\"\n :show-severity-icon=\"t.showSeverityIcon ?? props.showSeverityIcon\"\n v-on=\"t.onDelete ? { delete: t.onDelete } : {}\"\n @close=\"toastHost.dismiss(t.id)\"\n >\n <template v-if=\"t.icon\" #icon><ToastNodeView :node=\"t.icon\" /></template>\n <template v-if=\"t.title\" #title><ToastNodeView :node=\"t.title\" /></template>\n <template v-if=\"t.description\" #description>\n <ToastNodeView :node=\"t.description\" />\n </template>\n <template v-if=\"t.action || t.report\" #actions>\n <ToastNodeView v-if=\"t.action\" :node=\"t.action\" />\n <ReportAction v-if=\"t.report\" :send=\"t.report\" />\n </template>\n <template v-if=\"isTrailingTimer(timerFor(t))\" #trailing>\n <ToastRing\n v-if=\"timerFor(t) === ToastTimer.Ring\"\n :key=\"`${t.id}:${t.nonce}`\"\n :duration=\"t.resolvedDuration\"\n :paused=\"paused\"\n :severity=\"t.severity ?? 'neutral'\"\n />\n <ToastSeconds\n v-else\n :key=\"`${t.id}:${t.nonce}`\"\n :duration=\"t.resolvedDuration\"\n :paused=\"paused\"\n :severity=\"t.severity ?? 'neutral'\"\n />\n </template>\n </Toast>\n <ToastProgress\n v-if=\"timerFor(t) === ToastTimer.Bar\"\n :key=\"`${t.id}:${t.nonce}`\"\n :duration=\"t.resolvedDuration\"\n :paused=\"paused\"\n :severity=\"t.severity ?? 'neutral'\"\n />\n </div>\n </Presence>\n </div>\n <Announce politeness=\"polite\">{{ latestTitle }}</Announce>\n </Portal>\n</template>\n"],"names":["_openBlock","_createElementBlock","_mergeProps","_renderSlot","SeverityToken","_createBlock","ToastSimple","_unref","_hoisted_1","Icon","_Fragment","_createTextVNode","_toDisplayString","_createElementVNode","_hoisted_2","_createVNode","Portal","_renderList","Toast","_toHandlers","ReportAction","Announce"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAiBA,UAAM,iBAA6E;AAAA,MACjF,MAAM;AAAA,MACN,SAAS;AAAA,MACT,SAAS;AAAA,MACT,QAAQ;AAAA,MACR,SAAS;AAAA,IAAA;AAWX,UAAM,QAAQ;AAOd,UAAM,QAAQ,SAAA;AACd,UAAM,KAAK,eAA+B,IAAI;AAE9C,UAAM,UAAU;AAAA,MAAS,MACvB;AAAA,QACE;AAAA,QACA,gBAAgB;AAAA,UACd,SAAS;AAAA,UACT,MAAM,eAAe,MAAM,QAAQ;AAAA,UACnC,QAAQ;AAAA,UACR,SAAS;AAAA,UACT,WAAW;AAAA,QAAA,CACZ;AAAA,QACD,MAAM;AAAA,MAAA;AAAA,IACR;AAIF,UAAM,OAAO,SAAS,MAAM;AAC1B,YAAM,EAAE,OAAO,QAAQ,GAAG,WAAW;AACrC,aAAO;AAAA,IACT,CAAC;AAED,aAAa,EAAE,IAAI;;AAIjB,aAAAA,UAAA,GAAAC,mBAA4F,OAA5FC,WAA4F;AAAA,iBAAnF;AAAA,QAAJ,KAAI;AAAA,QAAK,MAAK;AAAA,QAAS,aAAU;AAAA,MAAA,GAAiB,KAAA,OAAI,EAAG,OAAO,QAAA,MAAA,CAAO,GAAA;AAAA,QAAEC,WAAQ,KAAA,QAAA,SAAA;AAAA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACjCxF,UAAM,YAAY;AAWlB,UAAM,iBAAiB;AACvB,UAAM,QAAQ,kBAAkB,gBAAgB,SAAS,EAAE,YAAY,WAAW,aAAa,uBAAuB;AAGtH,UAAM,OAAO;AAsBb,UAAM,QAAQ,SAAA;AACd,UAAM,QAAQ,SAAA;AACd,UAAM,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ZPZXn3.js","sources":["../../src/presentation/feedback/toastSimple/ToastSimple.vue","../../src/presentation/feedback/toast/Toast.vue","../../src/presentation/feedback/toastHost/ToastHost.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { Severity } from '../../../foundation/styles';\n\n/** Represents the prop surface of `ToastSimple`. */\nexport interface ToastSimpleProps {\n /** The semantic severity palette. */\n readonly severity?: Severity;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs, useTemplateRef } from 'vue';\nimport { cn, surfaceVariants } from '../../../foundation/styles';\nimport type { Tone } from '../../../foundation/styles';\nimport type { ToastSimpleVariants } from './ToastSimple.variants';\n\n/** Maps the toast `severity` keyword to a SurfaceStyles `tone`. */\nconst SeverityToTone: Record<NonNullable<ToastSimpleVariants['severity']>, Tone> = {\n info: 'info',\n success: 'success',\n warning: 'warning',\n danger: 'danger',\n neutral: 'neutral',\n};\n\n/**\n * Renders the atomic toast card — a single tone-driven notification around free-form children.\n *\n * `role=\"status\"` + `aria-live=\"polite\"` are the live-region contract; `role` is\n * bound before `v-bind=\"rest\"` so a caller-supplied `role` still wins.\n */\ndefineOptions({ name: 'ToastSimple', inheritAttrs: false });\n\nconst props = withDefaults(defineProps<ToastSimpleProps>(), { severity: 'neutral' });\n\ndefineSlots<{\n /** The toast content. */\n default?(): unknown;\n}>();\n\nconst attrs = useAttrs();\nconst el = useTemplateRef<HTMLDivElement>('el');\n\nconst classes = computed(() =>\n cn(\n 'pointer-events-auto text-sm',\n surfaceVariants({\n variant: 'surface',\n tone: SeverityToTone[props.severity],\n radius: 'md',\n padding: 'md',\n elevation: 3,\n }),\n attrs.class as string | undefined,\n ),\n);\n\n/** Everything but `class`, which is re-applied through `cn` above. */\nconst rest = computed(() => {\n const { class: _class, ...others } = attrs;\n return others;\n});\n\ndefineExpose({ el });\n</script>\n\n<template>\n <div ref=\"el\" role=\"status\" aria-live=\"polite\" v-bind=\"rest\" :class=\"classes\"><slot /></div>\n</template>\n","<script lang=\"ts\">\nimport type { Severity } from '../../../foundation/styles';\n\nexport interface ToastProps {\n /** The semantic severity palette. */\n readonly severity?: Severity;\n /** The optional leading icon. Rich content → the `icon` slot. */\n readonly icon?: string;\n /** The bold heading line. Rich content → the `title` slot. */\n readonly title?: string;\n /** The body text below the title. Rich content → the `description` slot. */\n readonly description?: string;\n /** The action area below the body. Rich content → the `actions` slot. */\n readonly actions?: string;\n /** The accessible label for the close button. Default `\"Dismiss\"`. */\n readonly closeLabel?: string;\n /** The accessible label for removing a retained notice. Default \"Delete notification\". */\n readonly deleteLabel?: string;\n /**\n * Shows the severity's own glyph when no `icon` is given — a distinct shape per severity, so the meaning\n * never rests on colour alone. `neutral` has none. Default `true`.\n */\n readonly showSeverityIcon?: boolean;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { useLocaleDefaults } from '../../../foundation/i18n';\nimport { computed, getCurrentInstance, useAttrs, useSlots, useTemplateRef } from 'vue';\nimport { Trash2, X } from 'lucide-vue-next';\nimport { cn, Severity as SeverityToken } from '../../../foundation/styles';\nimport { Icon, SeverityIconClasses, SeverityIcons } from '../../../foundation/icons';\nimport ToastSimple from '../toastSimple/ToastSimple.vue';\n\nconst CloseIcon = X;\n\n/**\n * Renders a toast card — icon, title, description, actions, and a close button.\n * Visual only (queue / portal / lifecycle land with `ToastHost` at L5); the atom is `ToastSimple`.\n *\n * Each of React's four `ReactNode` props keeps its string form and gains a\n * same-named slot for rich content; the slot wins when both are supplied.\n */\ndefineOptions({ name: 'Toast', inheritAttrs: false });\n\nconst componentProps = withDefaults(defineProps<ToastProps>(), { showSeverityIcon: true });\nconst props = useLocaleDefaults(componentProps, 'Toast', { closeLabel: 'Dismiss', deleteLabel: 'Delete notification' });\n\n/** Replaces React's `onClose`; omitting `@close` omits the close button. */\nconst emit = defineEmits<{\n /** Fires when the close button is activated. */\n close: [];\n /** Fires when the delete icon is activated; only rendered when bound for retained notices. */\n delete: [];\n}>();\n\ndefineSlots<{\n /** The extra content below the description. */\n default?(): unknown;\n /** The leading icon. Falls back to the `icon` prop. */\n icon?(): unknown;\n /** The heading line. Falls back to the `title` prop. */\n title?(): unknown;\n /** The body text below the title. Falls back to the `description` prop. */\n description?(): unknown;\n /** The action row. Falls back to the `actions` prop. */\n actions?(): unknown;\n /** The adornment beside the close button — a countdown, a timestamp. */\n trailing?(): unknown;\n}>();\n\nconst attrs = useAttrs();\nconst slots = useSlots();\nconst instance = getCurrentInstance();\nconst inner = useTemplateRef<InstanceType<typeof ToastSimple>>('inner');\n\n/**\n * Mirrors React's `onClose && <button/>` guard — the close button renders only\n * when the consumer bound `@close`. Read through a call, not a cached computed:\n * `instance.vnode` is replaced on every re-render.\n */\nconst hasClose = () => Boolean(instance?.vnode.props?.onClose);\nconst hasDelete = () => Boolean(instance?.vnode.props?.onDelete);\n\n/**\n * The glyph standing in for a missing `icon` — `null` when switched off, or for a neutral toast. An `icon`\n * slot replaces it as the slot's fallback content, so slot presence stays out of this cached value.\n */\nconst severityIcon = computed(() =>\n props.showSeverityIcon && !props.icon ? SeverityIcons[props.severity ?? SeverityToken.Neutral] : null,\n);\nconst severityIconClass = computed(() => SeverityIconClasses[props.severity ?? SeverityToken.Neutral]);\n\n/*\n * Slot presence is read through calls, not cached computeds: `slots` is not reactive, and a host that updates a\n * toast in place (a promise settling, a dedup refresh) adds or drops slots between renders.\n */\nconst hasIcon = () => Boolean(props.icon) || Boolean(slots.icon) || severityIcon.value !== null;\nconst hasTitle = () => Boolean(props.title) || Boolean(slots.title);\nconst hasDescription = () => Boolean(props.description) || Boolean(slots.description);\nconst hasActions = () => Boolean(props.actions) || Boolean(slots.actions);\n\nconst classes = computed(() => cn('flex items-start gap-3', attrs.class as string | undefined));\n\nconst descriptionClasses = () => cn('text-sm', hasTitle() && 'mt-0.5 text-muted-foreground');\n\n/** Everything but `class`, which is re-applied through `cn` above. */\nconst rest = computed(() => {\n const { class: _class, ...others } = attrs;\n return others;\n});\n\n/** Re-exposes the underlying `ToastSimple` root element, matching React's forwarded ref. */\nconst el = computed(() => inner.value?.el ?? null);\n\ndefineExpose({ el });\n</script>\n\n<template>\n <ToastSimple ref=\"inner\" :severity=\"props.severity\" v-bind=\"rest\" :class=\"classes\">\n <span v-if=\"hasIcon()\" data-toast-icon class=\"mt-0.5 shrink-0\">\n <slot name=\"icon\">\n <Icon v-if=\"severityIcon\" :icon=\"severityIcon\" :size=\"16\" :class=\"severityIconClass\" />\n <template v-else>{{ props.icon }}</template>\n </slot>\n </span>\n <div class=\"min-w-0 flex-1\">\n <div v-if=\"hasTitle()\" class=\"font-medium\">\n <slot name=\"title\">{{ props.title }}</slot>\n </div>\n <div v-if=\"hasDescription()\" :class=\"descriptionClasses()\">\n <slot name=\"description\">{{ props.description }}</slot>\n </div>\n <div v-if=\"hasActions()\" class=\"mt-2 flex flex-wrap items-center gap-2\">\n <slot name=\"actions\">{{ props.actions }}</slot>\n </div>\n <slot />\n </div>\n <span v-if=\"slots.trailing\" class=\"flex h-5 shrink-0 items-center\">\n <slot name=\"trailing\" />\n </span>\n <button\n v-if=\"hasDelete()\"\n type=\"button\"\n :aria-label=\"props.deleteLabel\"\n class=\"grid h-6 w-6 shrink-0 place-items-center rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring\"\n @click=\"emit('delete')\"\n >\n <Icon :icon=\"Trash2\" :size=\"14\" />\n </button>\n <button\n v-if=\"hasClose()\"\n type=\"button\"\n :aria-label=\"props.closeLabel\"\n class=\"-mr-1 grid h-6 w-6 shrink-0 place-items-center rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring\"\n @click=\"emit('close')\"\n >\n <Icon :icon=\"CloseIcon\" :size=\"14\" />\n </button>\n </ToastSimple>\n</template>\n","<script lang=\"ts\">\nimport type { VNode } from 'vue';\nimport type { OverlayPosition } from '../../../foundation/styles';\nimport type { ReportSend } from '../../../reporting';\nimport type { ToastSimpleVariants } from '../toastSimple/ToastSimple.variants';\n\nexport type ToastSeverity = NonNullable<ToastSimpleVariants['severity']>;\n\n/** Defines how a toast shows the time left before it dismisses itself. */\nexport const ToastTimer = {\n /** Refers to no countdown — the toast still expires on time. */\n None: 'none',\n /** Refers to a bar draining along the toast's bottom edge. */\n Bar: 'bar',\n /** Refers to a ring draining beside the close button. */\n Ring: 'ring',\n /** Refers to the whole seconds left, counted beside the close button. */\n Seconds: 'seconds',\n} as const;\n\nexport type ToastTimer = (typeof ToastTimer)[keyof typeof ToastTimer];\n\n/** Provides the per-severity expiry a `ToastHost` starts from — an error stays long enough to read and report. */\nexport const DefaultToastDurations: Readonly<Partial<Record<ToastSeverity, number>>> = Object.freeze({\n danger: 8000,\n});\n\n/**\n * A renderable slice of a toast. These travel through the imperative\n * `toastHost.toast()` payload, not through a slot, so a caller who wants\n * markup builds it with `h()`.\n */\nexport type ToastNode = string | VNode;\n\nexport interface ToastOptions {\n title?: ToastNode;\n description?: ToastNode;\n icon?: ToastNode;\n severity?: ToastSeverity;\n /**\n * ms before auto-dismiss. Default: the ToastHost's `durations` entry for the severity, then its\n * `defaultDuration`. `Infinity` = sticky.\n */\n duration?: number;\n action?: ToastNode;\n /**\n * Sends a one-click report of the failure this toast shows; the toast renders a Report action that walks\n * sending → reported (with the reference) → retry on failure. Pairs with `/reporting`'s `capture(error).send`.\n */\n report?: ReportSend;\n /** Shows the severity's own glyph when no `icon` is given. Default: the ToastHost's `showSeverityIcon`. */\n showSeverityIcon?: boolean;\n /**\n * Fully custom body — replaces the default `Toast` chrome (icon/title/description/close).\n * Still animates + auto-dismisses; the content owns its close via the returned id.\n */\n content?: ToastNode;\n /**\n * Fired when the toast is removed — auto-dismiss, close button, `dismiss(id)`, or `dismissAll()`.\n * Not fired on a dedup-update. For undo cleanup / analytics.\n */\n onDismiss?: () => void;\n /** Deletes an explicitly retained notification; omitted for transient toasts. */\n onDelete?: () => void;\n /**\n * Dedup key — a `toast` whose `key` is already showing updates that toast in place,\n * refreshing its timer instead of stacking a duplicate.\n */\n key?: string;\n /** How this toast shows its time left. Default: the ToastHost's `timer`. */\n timer?: ToastTimer;\n /**\n * Shows or hides this toast's countdown bar.\n * @deprecated Use `timer` — `ToastTimer.Bar` or `ToastTimer.None`.\n */\n progress?: boolean;\n}\n\n/** Content for a `toastHost.promise` phase — a title string, or a full partial options object. */\nexport type ToastContent = string | Partial<ToastOptions>;\n\n/**\n * Options for `toastHost.promise` — loading / success / error content\n * (success + error may be a fn of the settled value).\n */\nexport interface ToastPromiseOptions<T> {\n loading: ToastContent;\n success: ToastContent | ((value: T) => ToastContent);\n error: ToastContent | ((err: unknown) => ToastContent);\n /** Auto-dismiss (ms) for the settled toast; defaults to the ToastHost's `defaultDuration`. */\n duration?: number;\n}\n\nfunction normalizeContent(content: ToastContent): Partial<ToastOptions> {\n return typeof content === 'string' ? { title: content } : content;\n}\n\ninterface ToastEntry extends ToastOptions {\n id: string;\n /** Bumped on every `update` / dedup so the viewport can reset that toast's auto-dismiss timer. */\n nonce: number;\n}\n\ntype Listener = (toasts: ReadonlyArray<ToastEntry>) => void;\n\nclass ToastHostStore {\n private items: ReadonlyArray<ToastEntry> = [];\n private listeners = new Set<Listener>();\n private idSeq = 0;\n\n toast(opts: ToastOptions): string {\n if (opts.key !== undefined) {\n const existing = this.items.find((t) => t.key === opts.key);\n if (existing) {\n this.update(existing.id, opts);\n return existing.id;\n }\n }\n const id = `t_${++this.idSeq}`;\n this.items = [...this.items, { id, ...opts, nonce: 0 }];\n this.emit();\n return id;\n }\n\n /** Merges a patch into an existing toast (content + severity + duration), refreshing its timer. */\n update(id: string, patch: Partial<ToastOptions>): void {\n this.items = this.items.map((t) => (t.id === id ? { ...t, ...patch, nonce: t.nonce + 1 } : t));\n this.emit();\n }\n\n /** Shows a sticky loading toast; returns the full content-update and promise settlement chain. */\n promise<T>(promise: Promise<T>, opts: ToastPromiseOptions<T>): Promise<T> {\n const id = this.toast({ ...normalizeContent(opts.loading), severity: 'info', duration: Infinity });\n const settle = (content: ToastContent, severity: ToastSeverity) =>\n this.update(id, { ...normalizeContent(content), severity, duration: opts.duration });\n return promise.then(\n (value) => {\n settle(typeof opts.success === 'function' ? opts.success(value) : opts.success, 'success');\n return value;\n },\n (err: unknown) => {\n settle(typeof opts.error === 'function' ? opts.error(err) : opts.error, 'danger');\n throw err;\n },\n );\n }\n\n dismiss(id: string): void {\n const entry = this.items.find((t) => t.id === id);\n this.items = this.items.filter((t) => t.id !== id);\n try {\n entry?.onDismiss?.();\n } finally {\n this.emit();\n }\n }\n\n dismissAll(): void {\n const gone = this.items;\n this.items = [];\n try {\n for (const t of gone) t.onDismiss?.();\n } finally {\n this.emit();\n }\n }\n\n subscribe(fn: Listener): () => void {\n this.listeners.add(fn);\n fn(this.items);\n return () => {\n this.listeners.delete(fn);\n };\n }\n\n private emit() {\n for (const fn of this.listeners) fn(this.items);\n }\n}\n\nexport const toastHost = new ToastHostStore();\n\n/**\n * The imperative toast API, bound to the app-wide store. A plain object — the\n * store is a module singleton, so there is nothing per-instance to memoize.\n */\nexport function useToastHost() {\n return {\n toast: (opts: ToastOptions) => toastHost.toast(opts),\n update: (id: string, patch: Partial<ToastOptions>) => toastHost.update(id, patch),\n promise: <T,>(promise: Promise<T>, opts: ToastPromiseOptions<T>) => toastHost.promise(promise, opts),\n dismiss: (id: string) => toastHost.dismiss(id),\n dismissAll: () => toastHost.dismissAll(),\n };\n}\n\nconst PositionClasses = 'top-4 right-4 items-end';\n\n/** Toasts enter from the right; reduced-motion users get an instant swap. */\nconst MotionClasses =\n 'motion-safe:data-[state=open]:animate-(--animate-slide-in-right) motion-safe:data-[state=closed]:animate-(--animate-slide-out-right) motion-reduce:animate-none';\n\nexport interface ToastHostProps {\n /** @deprecated Toasts always anchor top-right. Accepted for one release, without changing placement. */\n readonly position?: OverlayPosition;\n readonly max?: number;\n /**\n * The auto-dismiss delay in ms for a severity missing from `durations`; per-toast `duration` overrides.\n * Default 5000. `Infinity` to disable.\n */\n readonly defaultDuration?: number;\n /**\n * The auto-dismiss delay in ms per severity; per-toast `duration` overrides, and a severity left out falls\n * back to `defaultDuration`. Default `DefaultToastDurations` — errors stay 8 seconds. Replaces, never merges.\n */\n readonly durations?: Readonly<Partial<Record<ToastSeverity, number>>>;\n readonly canPauseOnHover?: boolean;\n readonly gap?: number;\n /**\n * How each auto-dismissing toast shows its time left; a toast's `timer` overrides. Every display pauses with\n * the expiry timer and restarts when the toast updates; sticky toasts show none, and reduced motion drops the\n * bar and the ring. Custom `content` has no close button to sit beside, so it takes the bar for a ring or\n * seconds. Default `ToastTimer.None`.\n */\n readonly timer?: ToastTimer;\n /**\n * Shows a countdown bar along the bottom of each auto-dismissing toast.\n * @deprecated Use `timer` — `ToastTimer.Bar`.\n */\n readonly showProgress?: boolean;\n /** Shows each severity's glyph on toasts given no `icon`; a toast's `showSeverityIcon` overrides. Default `true`. */\n readonly showSeverityIcon?: boolean;\n}\n\ninterface VisibleToast extends ToastEntry {\n resolvedDuration: number;\n}\n\n/** Countdown fill per severity; the neutral countdown uses the brand primary. */\nconst ProgressClasses: Record<ToastSeverity, string> = {\n neutral: 'bg-primary',\n info: 'bg-info',\n success: 'bg-success',\n warning: 'bg-warning',\n danger: 'bg-destructive',\n};\n\n/** Countdown-ring stroke per severity — the bar's tones, drawn as an arc. */\nconst RingClasses: Record<ToastSeverity, string> = {\n neutral: 'stroke-primary',\n info: 'stroke-info',\n success: 'stroke-success',\n warning: 'stroke-warning',\n danger: 'stroke-destructive',\n};\n\n/** The ring's radius in the 16×16 view box; the circumference is the dash the countdown drains. */\nconst RingRadius = 6;\nconst RingCircumference = 2 * Math.PI * RingRadius;\n\n/** How often the seconds display re-reads its clock — a quarter second keeps a whole-second flip on time. */\nconst SecondsTickMs = 250;\n</script>\n\n<script setup lang=\"ts\">\nimport { useLocale } from '../../../foundation/i18n';\nimport {\n computed,\n defineComponent,\n h,\n onMounted,\n onUnmounted,\n ref,\n shallowRef,\n useAttrs,\n watch,\n type PropType,\n} from 'vue';\nimport { cn, OverlayPosition as OverlayPositionToken } from '../../../foundation/styles';\nimport { Announce, Portal, Presence } from '../../../foundation/primitives';\nimport Toast from '../toast/Toast.vue';\nimport ReportAction from '../reportAction/ReportAction.vue';\n\nconst locale = useLocale();\n\n/** Renders a `ToastNode` — either a plain string or a caller-built VNode. */\nconst ToastNodeView = defineComponent({\n name: 'ToastNodeView',\n props: { node: { type: [String, Object] as PropType<ToastNode>, required: true } },\n setup: (nodeProps) => () => nodeProps.node,\n});\n\n/** The props every countdown display shares — it mirrors the host's expiry timer, never drives it. */\nconst CountdownProps = {\n duration: { type: Number, required: true },\n paused: { type: Boolean, default: false },\n severity: { type: String as PropType<ToastSeverity>, default: 'neutral' },\n} as const;\n\n/**\n * Runs one Web Animations API countdown on a template ref, paused and resumed in step with the host's expiry\n * timer; environments without `animate` leave the element static at full.\n */\nfunction useCountdownAnimation(\n element: () => Element | null,\n keyframes: Keyframe[],\n countdown: { readonly duration: number; readonly paused: boolean },\n): void {\n let animation: Animation | undefined;\n onMounted(() => {\n const target = element();\n if (!target || typeof target.animate !== 'function') return;\n animation = target.animate(keyframes, { duration: countdown.duration, easing: 'linear', fill: 'forwards' });\n if (countdown.paused) animation.pause();\n });\n watch(\n () => countdown.paused,\n (isPaused) => {\n if (isPaused) animation?.pause();\n else animation?.play();\n },\n );\n onUnmounted(() => animation?.cancel());\n}\n\n/** The countdown bar — a scale transform draining along the toast's bottom edge. */\nconst ToastProgress = defineComponent({\n name: 'ToastProgress',\n props: CountdownProps,\n setup(countdown) {\n const fill = ref<HTMLElement | null>(null);\n useCountdownAnimation(() => fill.value, [{ transform: 'scaleX(1)' }, { transform: 'scaleX(0)' }], countdown);\n return () =>\n h(\n 'div',\n {\n 'aria-hidden': 'true',\n 'data-toast-progress': '',\n class: 'absolute inset-x-0 bottom-0 h-1 motion-reduce:hidden',\n },\n [\n h('div', {\n ref: fill,\n class: cn('h-full w-full origin-left opacity-80', ProgressClasses[countdown.severity]),\n }),\n ],\n );\n },\n});\n\n/** The countdown ring — an arc draining clockwise from twelve o'clock, drawn beside the close button. */\nconst ToastRing = defineComponent({\n name: 'ToastRing',\n props: CountdownProps,\n setup(countdown) {\n const arc = ref<SVGCircleElement | null>(null);\n useCountdownAnimation(\n () => arc.value,\n [{ strokeDashoffset: '0' }, { strokeDashoffset: `${RingCircumference}` }],\n countdown,\n );\n return () =>\n h(\n 'svg',\n {\n 'aria-hidden': 'true',\n 'data-toast-timer': ToastTimer.Ring,\n viewBox: '0 0 16 16',\n class: 'size-4 -rotate-90 motion-reduce:hidden',\n },\n [\n h('circle', { cx: 8, cy: 8, r: RingRadius, fill: 'none', 'stroke-width': 2, class: 'stroke-border' }),\n h('circle', {\n ref: arc,\n cx: 8,\n cy: 8,\n r: RingRadius,\n fill: 'none',\n 'stroke-width': 2,\n 'stroke-linecap': 'round',\n 'stroke-dasharray': `${RingCircumference}`,\n class: RingClasses[countdown.severity],\n }),\n ],\n );\n },\n});\n\n/**\n * The seconds display — the whole seconds left, rounded up so it reads `1s` until the toast goes. It keeps its\n * own clock, advancing only while unpaused; the announcement region already carries the toast, so it is hidden.\n */\nconst ToastSeconds = defineComponent({\n name: 'ToastSeconds',\n props: CountdownProps,\n setup(countdown) {\n const left = ref(countdown.duration);\n let lastTick = 0;\n let handle: number | undefined;\n const tick = () => {\n const now = Date.now();\n left.value = Math.max(0, left.value - (now - lastTick));\n lastTick = now;\n };\n const start = () => {\n if (handle !== undefined) return;\n lastTick = Date.now();\n handle = window.setInterval(tick, SecondsTickMs);\n };\n const stop = () => {\n if (handle === undefined) return;\n tick();\n window.clearInterval(handle);\n handle = undefined;\n };\n onMounted(() => {\n if (!countdown.paused) start();\n });\n watch(\n () => countdown.paused,\n (isPaused) => (isPaused ? stop() : start()),\n );\n onUnmounted(() => {\n if (handle !== undefined) window.clearInterval(handle);\n });\n return () =>\n h(\n 'span',\n {\n 'aria-hidden': 'true',\n 'data-toast-timer': ToastTimer.Seconds,\n class: 'text-xs tabular-nums text-muted-foreground',\n },\n `${Math.ceil(left.value / 1000)}s`,\n );\n },\n});\n\n/**\n * Renders the toast viewport — subscribes to the global `toastHost` store and stacks `Toast` cards.\n * Mount once, per app.\n *\n * A caller's `class` attr lands on the stack container.\n */\ndefineOptions({ name: 'ToastHost', inheritAttrs: false });\n\nconst props = withDefaults(defineProps<ToastHostProps>(), {\n position: OverlayPositionToken.TopRight,\n max: 5,\n defaultDuration: 5000,\n durations: () => DefaultToastDurations,\n canPauseOnHover: true,\n gap: 8,\n timer: undefined,\n showProgress: false,\n showSeverityIcon: true,\n});\n\nconst attrs = useAttrs();\n\nconst items = shallowRef<ReadonlyArray<ToastEntry>>([]);\nconst hovered = ref(false);\nconst focused = ref(false);\nconst paused = computed(() => props.canPauseOnHover && (hovered.value || focused.value));\n\n/* Non-reactive state — mutated across ticks, never rendered. */\nconst timers = new Map<string, number>();\nconst remaining = new Map<string, number>();\nconst startedAt = new Map<string, number>();\nconst nonces = new Map<string, number>();\n\nlet unsubscribe: (() => void) | undefined;\nonMounted(() => {\n unsubscribe = toastHost.subscribe((next) => {\n items.value = next;\n });\n});\n\n// Visible window (FIFO).\nconst visible = computed<ReadonlyArray<VisibleToast>>(() =>\n items.value.slice(0, props.max).map((t) => ({\n ...t,\n resolvedDuration: t.duration ?? props.durations[t.severity ?? 'neutral'] ?? props.defaultDuration,\n })),\n);\nconst visibleIds = computed(() => new Set(visible.value.map((v) => v.id)));\n\n// Toasts that just left `visible` (dismissed, or pushed out of the FIFO\n// window) but must still play their exit animation. Kept mounted with\n// `data-state=\"closed\"` until `Presence` unmounts the child — the `@vue:unmounted`\n// hook below then prunes the entry here.\nconst exiting = shallowRef<ReadonlyArray<VisibleToast>>([]);\nlet prevVisible: ReadonlyArray<VisibleToast> = [];\n\nwatch(\n visibleIds,\n (ids) => {\n const gone = prevVisible.filter((p) => !ids.has(p.id));\n prevVisible = visible.value;\n const current = exiting.value;\n const known = new Set(current.map((e) => e.id));\n // Add newly-gone toasts; drop any that re-entered `visible`.\n const merged = [...current, ...gone.filter((g) => !known.has(g.id))].filter((e) => !ids.has(e.id));\n if (merged.length !== current.length || !merged.every((e, i) => e.id === current[i]?.id)) {\n exiting.value = merged;\n }\n },\n { immediate: true, flush: 'post' },\n);\n\nconst removeExiting = (id: string) => {\n exiting.value = exiting.value.filter((e) => e.id !== id);\n};\n\n// Visible (present) first, then the ones animating out.\nconst rendered = computed<Array<VisibleToast & { present: boolean }>>(() => [\n ...visible.value.map((v) => ({ ...v, present: true })),\n ...exiting.value.map((e) => ({ ...e, present: false })),\n]);\n\nconst latestTitle = computed(() => {\n const last = visible.value[visible.value.length - 1];\n if (typeof last?.title === 'string') return last.title;\n if (typeof last?.description === 'string') return last.description;\n return '';\n});\n\n// Schedule auto-dismiss timers.\nwatch(\n [items, () => props.max, () => props.defaultDuration, () => props.durations, paused],\n () => {\n const ids = visibleIds.value;\n // Clear timers for items that are no longer visible.\n for (const [id, handle] of timers) {\n if (!ids.has(id)) {\n window.clearTimeout(handle);\n timers.delete(id);\n remaining.delete(id);\n startedAt.delete(id);\n }\n }\n for (const id of nonces.keys()) {\n if (!ids.has(id)) nonces.delete(id);\n }\n if (paused.value) return;\n // A content update / dedup bumps `nonce` — clear that toast's timer so it reschedules fresh.\n for (const v of visible.value) {\n const seen = nonces.get(v.id);\n if (seen !== undefined && seen !== v.nonce) {\n const handle = timers.get(v.id);\n if (handle !== undefined) window.clearTimeout(handle);\n timers.delete(v.id);\n remaining.delete(v.id);\n startedAt.delete(v.id);\n }\n nonces.set(v.id, v.nonce);\n }\n for (const v of visible.value) {\n if (v.resolvedDuration === Infinity) continue;\n if (timers.has(v.id)) continue;\n const left = remaining.get(v.id) ?? v.resolvedDuration;\n const handle = window.setTimeout(() => {\n toastHost.dismiss(v.id);\n }, left);\n timers.set(v.id, handle);\n startedAt.set(v.id, Date.now());\n remaining.set(v.id, left);\n }\n },\n { immediate: true, flush: 'post' },\n);\n\n// Cleanup on unmount.\nonUnmounted(() => {\n unsubscribe?.();\n for (const handle of timers.values()) window.clearTimeout(handle);\n timers.clear();\n});\n\nwatch(\n paused,\n (isPaused) => {\n if (!isPaused) return;\n for (const [id, handle] of timers) {\n window.clearTimeout(handle);\n const start = startedAt.get(id) ?? Date.now();\n remaining.set(id, Math.max(0, (remaining.get(id) ?? 0) - (Date.now() - start)));\n }\n timers.clear();\n },\n { flush: 'sync' },\n);\n\nwatch(\n () => rendered.value.length,\n (count) => {\n if (count === 0) {\n hovered.value = false;\n focused.value = false;\n }\n },\n);\n\nfunction onFocusout(event: FocusEvent): void {\n const stack = event.currentTarget as HTMLElement;\n if (!(event.relatedTarget instanceof Node) || !stack.contains(event.relatedTarget)) focused.value = false;\n}\n\nconst stackClasses = computed(() =>\n cn('pointer-events-none fixed z-toast flex flex-col', PositionClasses, attrs.class as string | undefined),\n);\n\nconst itemClasses = computed(() => cn('pointer-events-auto relative w-80 overflow-hidden rounded-md', MotionClasses));\n\n/** The display a toast asked for — its own `timer`, its deprecated `progress`, then the host's two. */\nfunction requestedTimer(t: VisibleToast): ToastTimer {\n if (t.timer !== undefined) return t.timer;\n if (t.progress !== undefined) return t.progress ? ToastTimer.Bar : ToastTimer.None;\n if (props.timer !== undefined) return props.timer;\n return props.showProgress ? ToastTimer.Bar : ToastTimer.None;\n}\n\n/**\n * The display a toast gets — none while exiting or sticky, and the bar for custom `content`, which has no close\n * button for a ring or seconds to sit beside.\n */\nfunction timerFor(t: VisibleToast & { present: boolean }): ToastTimer {\n if (!t.present || !Number.isFinite(t.resolvedDuration)) return ToastTimer.None;\n const requested = requestedTimer(t);\n return t.content && requested !== ToastTimer.None ? ToastTimer.Bar : requested;\n}\n\n/** Whether a toast's display sits beside the close button rather than along the bottom edge. */\nconst isTrailingTimer = (timer: ToastTimer): boolean => timer === ToastTimer.Ring || timer === ToastTimer.Seconds;\n\n/** Vue does not auto-suffix numeric style values with `px`. */\nconst stackStyle = computed(() => ({ gap: `${props.gap}px` }));\n</script>\n\n<template>\n <Portal>\n <div\n v-if=\"rendered.length > 0\"\n role=\"region\"\n :aria-label=\"locale.t('ToastHost.notifications', undefined, 'Notifications')\"\n :style=\"stackStyle\"\n :class=\"stackClasses\"\n @mouseenter=\"hovered = true\"\n @mouseleave=\"hovered = false\"\n @focusin=\"focused = true\"\n @focusout=\"onFocusout\"\n >\n <Presence v-for=\"t in rendered\" :key=\"t.id\" :is-present=\"t.present\">\n <!--\n `Presence` clones `data-state` onto this node and keeps it mounted\n until the exit animation ends; the `@vue:unmounted` hook is that\n \"exit finished\" signal (the read-only `Presence` API exposes no\n callback).\n -->\n <div :class=\"itemClasses\" @vue:unmounted=\"t.present ? undefined : removeExiting(t.id)\">\n <ToastNodeView v-if=\"t.content\" :node=\"t.content\" />\n <Toast\n v-else\n :severity=\"t.severity\"\n :show-severity-icon=\"t.showSeverityIcon ?? props.showSeverityIcon\"\n v-on=\"t.onDelete ? { delete: t.onDelete } : {}\"\n @close=\"toastHost.dismiss(t.id)\"\n >\n <template v-if=\"t.icon\" #icon><ToastNodeView :node=\"t.icon\" /></template>\n <template v-if=\"t.title\" #title><ToastNodeView :node=\"t.title\" /></template>\n <template v-if=\"t.description\" #description>\n <ToastNodeView :node=\"t.description\" />\n </template>\n <template v-if=\"t.action || t.report\" #actions>\n <ToastNodeView v-if=\"t.action\" :node=\"t.action\" />\n <ReportAction v-if=\"t.report\" :send=\"t.report\" />\n </template>\n <template v-if=\"isTrailingTimer(timerFor(t))\" #trailing>\n <ToastRing\n v-if=\"timerFor(t) === ToastTimer.Ring\"\n :key=\"`${t.id}:${t.nonce}`\"\n :duration=\"t.resolvedDuration\"\n :paused=\"paused\"\n :severity=\"t.severity ?? 'neutral'\"\n />\n <ToastSeconds\n v-else\n :key=\"`${t.id}:${t.nonce}`\"\n :duration=\"t.resolvedDuration\"\n :paused=\"paused\"\n :severity=\"t.severity ?? 'neutral'\"\n />\n </template>\n </Toast>\n <ToastProgress\n v-if=\"timerFor(t) === ToastTimer.Bar\"\n :key=\"`${t.id}:${t.nonce}`\"\n :duration=\"t.resolvedDuration\"\n :paused=\"paused\"\n :severity=\"t.severity ?? 'neutral'\"\n />\n </div>\n </Presence>\n </div>\n <Announce politeness=\"polite\">{{ latestTitle }}</Announce>\n </Portal>\n</template>\n"],"names":["_openBlock","_createElementBlock","_mergeProps","_renderSlot","SeverityToken","_createBlock","ToastSimple","_unref","_hoisted_1","Icon","_Fragment","_createTextVNode","_toDisplayString","_createElementVNode","_hoisted_2","_createVNode","Portal","_renderList","Toast","_toHandlers","ReportAction","Announce"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAiBA,UAAM,iBAA6E;AAAA,MACjF,MAAM;AAAA,MACN,SAAS;AAAA,MACT,SAAS;AAAA,MACT,QAAQ;AAAA,MACR,SAAS;AAAA,IAAA;AAWX,UAAM,QAAQ;AAOd,UAAM,QAAQ,SAAA;AACd,UAAM,KAAK,eAA+B,IAAI;AAE9C,UAAM,UAAU;AAAA,MAAS,MACvB;AAAA,QACE;AAAA,QACA,gBAAgB;AAAA,UACd,SAAS;AAAA,UACT,MAAM,eAAe,MAAM,QAAQ;AAAA,UACnC,QAAQ;AAAA,UACR,SAAS;AAAA,UACT,WAAW;AAAA,QAAA,CACZ;AAAA,QACD,MAAM;AAAA,MAAA;AAAA,IACR;AAIF,UAAM,OAAO,SAAS,MAAM;AAC1B,YAAM,EAAE,OAAO,QAAQ,GAAG,WAAW;AACrC,aAAO;AAAA,IACT,CAAC;AAED,aAAa,EAAE,IAAI;;AAIjB,aAAAA,UAAA,GAAAC,mBAA4F,OAA5FC,WAA4F;AAAA,iBAAnF;AAAA,QAAJ,KAAI;AAAA,QAAK,MAAK;AAAA,QAAS,aAAU;AAAA,MAAA,GAAiB,KAAA,OAAI,EAAG,OAAO,QAAA,MAAA,CAAO,GAAA;AAAA,QAAEC,WAAQ,KAAA,QAAA,SAAA;AAAA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACjCxF,UAAM,YAAY;AAWlB,UAAM,iBA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,EAAhD,YAAW,YAAQ;AAAA,6BAAC,MAAiB;AAAA,8CAAd,YAAA,KAAW,GAAA,CAAA;AAAA,YAAA;;;;;;;;;"}
|
|
@@ -1,3 +1,157 @@
|
|
|
1
|
+
const RadiusToken = {
|
|
2
|
+
/** Refers to no rounding (square corners). */
|
|
3
|
+
None: "none",
|
|
4
|
+
/** Refers to an extra-small radius. */
|
|
5
|
+
Xs: "xs",
|
|
6
|
+
/** Refers to a small radius. */
|
|
7
|
+
Sm: "sm",
|
|
8
|
+
/** Refers to a medium radius. */
|
|
9
|
+
Md: "md",
|
|
10
|
+
/** Refers to a large radius. */
|
|
11
|
+
Lg: "lg",
|
|
12
|
+
/** Refers to an extra-large radius. */
|
|
13
|
+
Xl: "xl",
|
|
14
|
+
/** Refers to a fully-rounded (pill) radius. */
|
|
15
|
+
Full: "full"
|
|
16
|
+
};
|
|
17
|
+
const SizePreset = {
|
|
18
|
+
/** Refers to the extra-small step. */
|
|
19
|
+
Xs: "xs",
|
|
20
|
+
/** Refers to the small step. */
|
|
21
|
+
Sm: "sm",
|
|
22
|
+
/** Refers to the medium (default) step. */
|
|
23
|
+
Md: "md",
|
|
24
|
+
/** Refers to the large step. */
|
|
25
|
+
Lg: "lg",
|
|
26
|
+
/** Refers to the extra-large step. */
|
|
27
|
+
Xl: "xl",
|
|
28
|
+
/** Refers to the 2x extra-large step. */
|
|
29
|
+
Xxl: "2xl"
|
|
30
|
+
};
|
|
31
|
+
const AbsolutePositionPreset = {
|
|
32
|
+
/** Refers to the top-right corner. */
|
|
33
|
+
TopRight: "top-right",
|
|
34
|
+
/** Refers to the top-left corner. */
|
|
35
|
+
TopLeft: "top-left",
|
|
36
|
+
/** Refers to the bottom-right corner. */
|
|
37
|
+
BottomRight: "bottom-right",
|
|
38
|
+
/** Refers to the bottom-left corner. */
|
|
39
|
+
BottomLeft: "bottom-left",
|
|
40
|
+
/** Refers to the top edge, horizontally centered. */
|
|
41
|
+
Top: "top",
|
|
42
|
+
/** Refers to the bottom edge, horizontally centered. */
|
|
43
|
+
Bottom: "bottom",
|
|
44
|
+
/** Refers to the left edge, vertically centered. */
|
|
45
|
+
Left: "left",
|
|
46
|
+
/** Refers to the right edge, vertically centered. */
|
|
47
|
+
Right: "right",
|
|
48
|
+
/** Refers to the dead center. */
|
|
49
|
+
Center: "center"
|
|
50
|
+
};
|
|
51
|
+
const PaddingTokenToCss = {
|
|
52
|
+
xs: "0.5rem",
|
|
53
|
+
sm: "0.75rem",
|
|
54
|
+
md: "1rem",
|
|
55
|
+
lg: "1.5rem",
|
|
56
|
+
xl: "2rem"
|
|
57
|
+
};
|
|
58
|
+
const RadiusTokenToCss = {
|
|
59
|
+
xs: "0.125rem",
|
|
60
|
+
sm: "0.25rem",
|
|
61
|
+
md: "0.5rem",
|
|
62
|
+
lg: "0.75rem",
|
|
63
|
+
xl: "1rem"
|
|
64
|
+
};
|
|
65
|
+
function toCss(v) {
|
|
66
|
+
return typeof v === "number" ? `${v}px` : v;
|
|
67
|
+
}
|
|
68
|
+
function resolvePadding(padding) {
|
|
69
|
+
if (!padding) return void 0;
|
|
70
|
+
if (typeof padding === "string") {
|
|
71
|
+
if (padding === "none") {
|
|
72
|
+
return { paddingLeft: 0, paddingRight: 0, paddingTop: 0, paddingBottom: 0 };
|
|
73
|
+
}
|
|
74
|
+
const v = padding === "2xl" ? "3rem" : PaddingTokenToCss[padding];
|
|
75
|
+
return { paddingLeft: v, paddingRight: v, paddingTop: v, paddingBottom: v };
|
|
76
|
+
}
|
|
77
|
+
const style = {};
|
|
78
|
+
if (padding.x !== void 0) {
|
|
79
|
+
const v = toCss(padding.x);
|
|
80
|
+
style.paddingLeft = v;
|
|
81
|
+
style.paddingRight = v;
|
|
82
|
+
}
|
|
83
|
+
if (padding.y !== void 0) {
|
|
84
|
+
const v = toCss(padding.y);
|
|
85
|
+
style.paddingTop = v;
|
|
86
|
+
style.paddingBottom = v;
|
|
87
|
+
}
|
|
88
|
+
return style;
|
|
89
|
+
}
|
|
90
|
+
function resolveRadius(radius) {
|
|
91
|
+
if (radius === void 0 || radius === null) return void 0;
|
|
92
|
+
if (typeof radius === "number") return { borderRadius: `${radius}px` };
|
|
93
|
+
if (radius === "none") return { borderRadius: 0 };
|
|
94
|
+
if (radius === "full") return { borderRadius: "9999px" };
|
|
95
|
+
if (Object.hasOwn(RadiusTokenToCss, radius)) {
|
|
96
|
+
return {
|
|
97
|
+
borderRadius: RadiusTokenToCss[radius]
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
return { borderRadius: radius };
|
|
101
|
+
}
|
|
102
|
+
function resolveBoxSize(overrides) {
|
|
103
|
+
const style = {};
|
|
104
|
+
let hasAny = false;
|
|
105
|
+
const effectiveWidth = overrides.width ?? overrides.boxSize;
|
|
106
|
+
const effectiveHeight = overrides.height ?? overrides.boxSize;
|
|
107
|
+
if (effectiveWidth !== void 0) {
|
|
108
|
+
style.width = toCss(effectiveWidth);
|
|
109
|
+
hasAny = true;
|
|
110
|
+
}
|
|
111
|
+
if (effectiveHeight !== void 0) {
|
|
112
|
+
style.height = toCss(effectiveHeight);
|
|
113
|
+
hasAny = true;
|
|
114
|
+
}
|
|
115
|
+
if (overrides.minWidth !== void 0) {
|
|
116
|
+
style.minWidth = toCss(overrides.minWidth);
|
|
117
|
+
hasAny = true;
|
|
118
|
+
}
|
|
119
|
+
if (overrides.minHeight !== void 0) {
|
|
120
|
+
style.minHeight = toCss(overrides.minHeight);
|
|
121
|
+
hasAny = true;
|
|
122
|
+
}
|
|
123
|
+
if (overrides.maxWidth !== void 0) {
|
|
124
|
+
style.maxWidth = toCss(overrides.maxWidth);
|
|
125
|
+
hasAny = true;
|
|
126
|
+
}
|
|
127
|
+
if (overrides.maxHeight !== void 0) {
|
|
128
|
+
style.maxHeight = toCss(overrides.maxHeight);
|
|
129
|
+
hasAny = true;
|
|
130
|
+
}
|
|
131
|
+
if (overrides.aspectRatio !== void 0) {
|
|
132
|
+
style.aspectRatio = String(overrides.aspectRatio);
|
|
133
|
+
hasAny = true;
|
|
134
|
+
}
|
|
135
|
+
return hasAny ? style : void 0;
|
|
136
|
+
}
|
|
137
|
+
function parseSizeUnion(input, presets) {
|
|
138
|
+
if (input === void 0) return {};
|
|
139
|
+
if (typeof input === "object" && input !== null) return { box: input };
|
|
140
|
+
if (typeof input === "string" && presets.has(input)) return { preset: input };
|
|
141
|
+
if (typeof input === "number" || typeof input === "string") {
|
|
142
|
+
return { box: { boxSize: input } };
|
|
143
|
+
}
|
|
144
|
+
return {};
|
|
145
|
+
}
|
|
146
|
+
const CssExtensions = {
|
|
147
|
+
toCss,
|
|
148
|
+
resolvePadding,
|
|
149
|
+
resolveRadius,
|
|
150
|
+
resolveBoxSize,
|
|
151
|
+
parseSizeUnion,
|
|
152
|
+
PaddingTokenToCss,
|
|
153
|
+
RadiusTokenToCss
|
|
154
|
+
};
|
|
1
155
|
const ToneFamily = {
|
|
2
156
|
/** Refers to an opaque tone bg + foreground. */
|
|
3
157
|
Solid: "solid",
|
|
@@ -117,7 +271,11 @@ const Tones = {
|
|
|
117
271
|
}
|
|
118
272
|
};
|
|
119
273
|
export {
|
|
274
|
+
AbsolutePositionPreset as A,
|
|
275
|
+
CssExtensions as C,
|
|
276
|
+
RadiusToken as R,
|
|
277
|
+
SizePreset as S,
|
|
120
278
|
Tones as T,
|
|
121
279
|
ToneFamily as a
|
|
122
280
|
};
|
|
123
|
-
//# sourceMappingURL=Tones-
|
|
281
|
+
//# sourceMappingURL=Tones-Bcz8dIo3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tones-Bcz8dIo3.js","sources":["../../src/foundation/styles/extensions/CssExtensions.ts","../../src/foundation/styles/constants/Tones.ts"],"sourcesContent":["import type { CSSProperties } from 'vue';\nimport { Padding } from '../enums/StyleTokens';\n\n/** CSS-value extensions — types, token maps, resolvers. Call as `CssExtensions.x(...)`. */\n\n// =============================================================================\n// Tokens (enums + types — individually exported)\n// =============================================================================\n\n/* Padding token vocabulary — reuses the shared `Padding` enum (superset: adds `2xl`). */\nexport type PaddingToken = Padding;\n\n/**\n * Defines the corner-radius token vocabulary local to CSS resolvers — diverges from the shared `Radius`\n * (carries `xs`, omits `2xl`).\n */\nexport const RadiusToken = {\n /** Refers to no rounding (square corners). */\n None: 'none',\n /** Refers to an extra-small radius. */\n Xs: 'xs',\n /** Refers to a small radius. */\n Sm: 'sm',\n /** Refers to a medium radius. */\n Md: 'md',\n /** Refers to a large radius. */\n Lg: 'lg',\n /** Refers to an extra-large radius. */\n Xl: 'xl',\n /** Refers to a fully-rounded (pill) radius. */\n Full: 'full',\n} as const;\n\nexport type RadiusToken = (typeof RadiusToken)[keyof typeof RadiusToken];\n\nexport type SizeValue = string | number;\nexport type PaddingProp = PaddingToken | { x?: SizeValue; y?: SizeValue };\nexport type RadiusProp = RadiusToken | SizeValue;\nexport interface BoxSizeOverrides {\n width?: SizeValue;\n height?: SizeValue;\n minWidth?: SizeValue;\n minHeight?: SizeValue;\n maxWidth?: SizeValue;\n maxHeight?: SizeValue;\n /**\n * Shorthand for square boxes — applied as fallback for both `width` and `height`. Explicit `width`/`height`\n * win when both are set.\n */\n boxSize?: SizeValue;\n\n /** CSS `aspect-ratio`. String like `'16/9'` or number like `1.5`. Pairs naturally with a single width/height. */\n aspectRatio?: string | number;\n}\n\n/**\n * Defines the canonical size preset vocabulary — shared across components. Each component picks the subset it\n * supports via `Extract<SizePreset, ...>` and owns its internal dimension mapping.\n */\nexport const SizePreset = {\n /** Refers to the extra-small step. */\n Xs: 'xs',\n /** Refers to the small step. */\n Sm: 'sm',\n /** Refers to the medium (default) step. */\n Md: 'md',\n /** Refers to the large step. */\n Lg: 'lg',\n /** Refers to the extra-large step. */\n Xl: 'xl',\n /** Refers to the 2x extra-large step. */\n Xxl: '2xl',\n} as const;\n\nexport type SizePreset = (typeof SizePreset)[keyof typeof SizePreset];\n\n/** Defines the absolute-positioning preset — a 9-anchor value-set; pair with raw inset overrides. */\nexport const AbsolutePositionPreset = {\n /** Refers to the top-right corner. */\n TopRight: 'top-right',\n /** Refers to the top-left corner. */\n TopLeft: 'top-left',\n /** Refers to the bottom-right corner. */\n BottomRight: 'bottom-right',\n /** Refers to the bottom-left corner. */\n BottomLeft: 'bottom-left',\n /** Refers to the top edge, horizontally centered. */\n Top: 'top',\n /** Refers to the bottom edge, horizontally centered. */\n Bottom: 'bottom',\n /** Refers to the left edge, vertically centered. */\n Left: 'left',\n /** Refers to the right edge, vertically centered. */\n Right: 'right',\n /** Refers to the dead center. */\n Center: 'center',\n} as const;\n\nexport type AbsolutePositionPreset = (typeof AbsolutePositionPreset)[keyof typeof AbsolutePositionPreset];\n\nexport interface AbsoluteInsetOverrides {\n top?: SizeValue;\n right?: SizeValue;\n bottom?: SizeValue;\n left?: SizeValue;\n}\n\nexport type AbsolutePosition = AbsolutePositionPreset | AbsoluteInsetOverrides;\n\n// =============================================================================\n// Token → CSS maps\n// =============================================================================\n\nconst PaddingTokenToCss: Record<Exclude<PaddingToken, 'none' | '2xl'>, string> = {\n xs: '0.5rem',\n sm: '0.75rem',\n md: '1rem',\n lg: '1.5rem',\n xl: '2rem',\n};\n\nconst RadiusTokenToCss: Record<Exclude<RadiusToken, 'none' | 'full'>, string> = {\n xs: '0.125rem',\n sm: '0.25rem',\n md: '0.5rem',\n lg: '0.75rem',\n xl: '1rem',\n};\n\n// =============================================================================\n// Internal resolvers\n// =============================================================================\n\nfunction toCss(v: SizeValue): string {\n return typeof v === 'number' ? `${v}px` : v;\n}\n\nfunction resolvePadding(padding: PaddingProp | undefined): CSSProperties | undefined {\n if (!padding) return undefined;\n if (typeof padding === 'string') {\n if (padding === 'none') {\n return { paddingLeft: 0, paddingRight: 0, paddingTop: 0, paddingBottom: 0 };\n }\n // `2xl` is carried by the shared `Padding` enum but sits outside the inline rem map.\n const v = padding === '2xl' ? '3rem' : PaddingTokenToCss[padding];\n return { paddingLeft: v, paddingRight: v, paddingTop: v, paddingBottom: v };\n }\n const style: CSSProperties = {};\n if (padding.x !== undefined) {\n const v = toCss(padding.x);\n style.paddingLeft = v;\n style.paddingRight = v;\n }\n if (padding.y !== undefined) {\n const v = toCss(padding.y);\n style.paddingTop = v;\n style.paddingBottom = v;\n }\n return style;\n}\n\nfunction resolveRadius(radius: RadiusProp | undefined): CSSProperties | undefined {\n if (radius === undefined || radius === null) return undefined;\n if (typeof radius === 'number') return { borderRadius: `${radius}px` };\n if (radius === 'none') return { borderRadius: 0 };\n if (radius === 'full') return { borderRadius: '9999px' };\n if (Object.hasOwn(RadiusTokenToCss, radius)) {\n return {\n borderRadius: RadiusTokenToCss[radius as Exclude<RadiusToken, 'none' | 'full'>],\n };\n }\n return { borderRadius: radius };\n}\n\nfunction resolveBoxSize(overrides: BoxSizeOverrides): CSSProperties | undefined {\n const style: CSSProperties = {};\n let hasAny = false;\n // boxSize is the fallback for width AND height — explicit dims win.\n const effectiveWidth = overrides.width ?? overrides.boxSize;\n const effectiveHeight = overrides.height ?? overrides.boxSize;\n if (effectiveWidth !== undefined) {\n style.width = toCss(effectiveWidth);\n hasAny = true;\n }\n if (effectiveHeight !== undefined) {\n style.height = toCss(effectiveHeight);\n hasAny = true;\n }\n if (overrides.minWidth !== undefined) {\n style.minWidth = toCss(overrides.minWidth);\n hasAny = true;\n }\n if (overrides.minHeight !== undefined) {\n style.minHeight = toCss(overrides.minHeight);\n hasAny = true;\n }\n if (overrides.maxWidth !== undefined) {\n style.maxWidth = toCss(overrides.maxWidth);\n hasAny = true;\n }\n if (overrides.maxHeight !== undefined) {\n style.maxHeight = toCss(overrides.maxHeight);\n hasAny = true;\n }\n if (overrides.aspectRatio !== undefined) {\n style.aspectRatio = String(overrides.aspectRatio);\n hasAny = true;\n }\n return hasAny ? style : undefined;\n}\n\n/** Defines a size prop — a named preset, a raw value (applied as `boxSize`), or an explicit dim object. */\nexport type SizeUnion<P extends string> =\n | P\n | (string & {}) // keeps preset literals in autocomplete while accepting any CSS unit string\n | number\n | BoxSizeOverrides;\n\n/**\n * Parse a union-style size prop into (a) a preset name (if matched), or (b) a `BoxSizeOverrides` payload.\n *\n * Resolution order:\n * - `undefined` → `{}`\n * - object → `{ box: input }`\n * - preset string → `{ preset: input }`\n * - any other string → `{ box: { boxSize: input } }`\n * - number → `{ box: { boxSize: input } }`\n */\nfunction parseSizeUnion<P extends string>(\n input: SizeUnion<P> | undefined,\n presets: ReadonlySet<string>,\n): { preset?: P; box?: BoxSizeOverrides } {\n if (input === undefined) return {};\n if (typeof input === 'object' && input !== null) return { box: input };\n if (typeof input === 'string' && presets.has(input)) return { preset: input as P };\n if (typeof input === 'number' || typeof input === 'string') {\n return { box: { boxSize: input } };\n }\n return {};\n}\n\n// =============================================================================\n// Grouped namespace export\n// =============================================================================\n\nexport const CssExtensions = {\n toCss,\n resolvePadding,\n resolveRadius,\n resolveBoxSize,\n parseSizeUnion,\n PaddingTokenToCss,\n RadiusTokenToCss,\n} as const;\n","import type { Tone } from '../enums/StyleTokens';\n\n/* Contains the (variant-family × tone) → Tailwind class lookup shared between\n `surfaceVariants` and `buttonVariants` (and any future variant config). */\n\n/** Defines a tone-family — the variant group that picks the same bg/border/text palette. */\nexport const ToneFamily = {\n /** Refers to an opaque tone bg + foreground. */\n Solid: 'solid',\n /** Refers to a muted/tinted bg + tone-readable foreground. */\n Soft: 'soft',\n /** Refers to a popover bg + tone-accent border. */\n Surface: 'surface',\n /** Refers to a popover bg + a stronger tone border — open menus, listboxes and popovers. */\n Raised: 'raised',\n /** Refers to a transparent bg, tone border + tone text. */\n Outline: 'outline',\n /** Refers to a translucent tone bg + blur. */\n Glass: 'glass',\n /** Refers to a glass fill + tone-accent border at 50% alpha. */\n GlassOutline: 'glassOutline',\n /** Refers to a low-alpha tinted fill + neutral border, no shadow. */\n Subtle: 'subtle',\n} as const;\n\nexport type ToneFamily = (typeof ToneFamily)[keyof typeof ToneFamily];\n\n/** Contains the cross-engine palette: bg / text (+ border where applicable) per tone-family × tone. */\nexport const Tones: Record<ToneFamily, Record<Tone, string>> = {\n /** Opaque tone bg + foreground. Used by `solid`, `elevated`, `flat`, button defaults. */\n solid: {\n neutral: 'bg-popover text-popover-foreground',\n primary: 'bg-primary text-primary-foreground',\n danger: 'bg-destructive text-destructive-foreground',\n success: 'bg-success text-success-foreground',\n warning: 'bg-warning text-warning-foreground',\n info: 'bg-info text-info-foreground',\n },\n /**\n * Muted/tinted bg + tone-readable foreground.\n *\n * Pairs `bg-{tone}-soft` with `text-{tone}-soft-foreground`, the token minted for\n * exactly this background — `themes/Validate.ts` asserts that pair at AA. The\n * full-strength `text-{tone}` is a *solid*-fill foreground: on the soft tint it\n * measured 2.07:1 for `warning` and 3.15:1 for `success`.\n */\n soft: {\n neutral: 'bg-muted text-foreground',\n primary: 'bg-primary-soft text-primary-soft-foreground',\n danger: 'bg-destructive-soft text-destructive-soft-foreground',\n success: 'bg-success-soft text-success-soft-foreground',\n warning: 'bg-warning-soft text-warning-soft-foreground',\n info: 'bg-info-soft text-info-soft-foreground',\n },\n /** Popover bg + tone-accent border. The \"default\" subtle look. */\n surface: {\n neutral: 'border-border bg-popover text-popover-foreground',\n primary: 'border-primary/40 bg-popover text-popover-foreground',\n danger: 'border-destructive/40 bg-popover text-popover-foreground',\n success: 'border-success/40 bg-popover text-popover-foreground',\n warning: 'border-warning/40 bg-popover text-popover-foreground',\n info: 'border-info/40 bg-popover text-popover-foreground',\n },\n /**\n * Popover bg + a visible tone border. The fill differs from the `field` fill of the inputs an open menu covers\n * (in dark mode; light mode separates them by border and shadow), and the border reads at ~2:1 where `surface`'s\n * decorative border fades into a white page.\n */\n raised: {\n neutral: 'border-border-strong/60 bg-popover text-popover-foreground',\n primary: 'border-primary/60 bg-popover text-popover-foreground',\n danger: 'border-destructive/60 bg-popover text-popover-foreground',\n success: 'border-success/60 bg-popover text-popover-foreground',\n warning: 'border-warning/60 bg-popover text-popover-foreground',\n info: 'border-info/60 bg-popover text-popover-foreground',\n },\n /**\n * Transparent bg, tone border + tone text.\n *\n * The fill is transparent, so the text lands on whatever surface hosts the\n * component — the same situation `-soft-foreground` is toned for. Keeping the\n * border at full-strength `{tone}` preserves the tone read; only the text\n * darkens (light) / lightens (dark). Full-strength `text-{tone}` measured\n * 2.15:1 for `warning` on the default light background.\n */\n outline: {\n neutral: 'border-border text-foreground',\n primary: 'border-primary text-primary-soft-foreground',\n danger: 'border-destructive text-destructive-soft-foreground',\n success: 'border-success text-success-soft-foreground',\n warning: 'border-warning text-warning-soft-foreground',\n info: 'border-info text-info-soft-foreground',\n },\n /**\n * Translucent fills use soft foregrounds, verified over background/card/popover/muted.\n * Custom colors and image backdrops require contrast verification by the caller.\n */\n glass: {\n neutral: 'bg-popover/70 text-popover-foreground',\n primary: 'bg-primary/30 text-primary-soft-foreground',\n danger: 'bg-destructive/30 text-destructive-soft-foreground',\n success: 'bg-success/30 text-success-soft-foreground',\n warning: 'bg-warning/30 text-warning-soft-foreground',\n info: 'bg-info/30 text-info-soft-foreground',\n },\n /** Glass + tone-accent border at 50% alpha. Same foreground reasoning as `glass`. */\n glassOutline: {\n neutral: 'border-border/50 bg-popover/70 text-popover-foreground',\n primary: 'border-primary/50 bg-primary/30 text-primary-soft-foreground',\n danger: 'border-destructive/50 bg-destructive/30 text-destructive-soft-foreground',\n success: 'border-success/50 bg-success/30 text-success-soft-foreground',\n warning: 'border-warning/50 bg-warning/30 text-warning-soft-foreground',\n info: 'border-info/50 bg-info/30 text-info-soft-foreground',\n },\n /**\n * Low-alpha tinted fill + neutral `border-border`, no shadow. The understated\n * \"tinted panel / section band\" look — quieter than `soft`, flatter than `surface`.\n * Neutral fills from the muted token; coloured tones tint their `-soft` token at low alpha.\n */\n subtle: {\n neutral: 'border-border bg-muted/30 text-foreground',\n primary: 'border-primary/20 bg-primary-soft/60 text-foreground',\n danger: 'border-destructive/20 bg-destructive-soft/60 text-foreground',\n success: 'border-success/20 bg-success-soft/60 text-foreground',\n warning: 'border-warning/20 bg-warning-soft/60 text-foreground',\n info: 'border-info/20 bg-info-soft/60 text-foreground',\n },\n};\n"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MAAM;AAAA,EAAA;AAAA;AAAA,EAGR,SAAS;AAAA,IACP,SAAS;AAAA,IACT,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,SAAS;AAAA,IACT,MAAM;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOR,QAAQ;AAAA,IACN,SAAS;AAAA,IACT,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,SAAS;AAAA,IACT,MAAM;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWR,SAAS;AAAA,IACP,SAAS;AAAA,IACT,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,SAAS;AAAA,IACT,MAAM;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMR,OAAO;AAAA,IACL,SAAS;AAAA,IACT,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,SAAS;AAAA,IACT,MAAM;AAAA,EAAA;AAAA;AAAA,EAGR,cAAc;AAAA,IACZ,SAAS;AAAA,IACT,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,SAAS;AAAA,IACT,MAAM;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOR,QAAQ;AAAA,IACN,SAAS;AAAA,IACT,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,SAAS;AAAA,IACT,MAAM;AAAA,EAAA;AAEV;"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { c as cn } from "./Cn-C7De6POU.js";
|
|
2
|
-
import { A as AbsolutePositionPreset, C as CssExtensions, R as RadiusToken, S as SizePreset } from "./
|
|
2
|
+
import { A as AbsolutePositionPreset, C as CssExtensions, R as RadiusToken, S as SizePreset, a as ToneFamily, T as Tones } from "./Tones-Bcz8dIo3.js";
|
|
3
3
|
import { C as ColorExtensions, a as ColorTone } from "./ColorExtensions-DiCSaVbJ.js";
|
|
4
|
-
import { S as SurfaceVariant, s as surfaceVariants } from "./SurfaceStyles-
|
|
4
|
+
import { S as SurfaceVariant, s as surfaceVariants } from "./SurfaceStyles-BYvRlsWe.js";
|
|
5
5
|
import { P as Padding, R as Radius, S as Size, T as Tone } from "./StyleTokens-Bkz7Dm5L.js";
|
|
6
|
-
import { a as ToneFamily, T as Tones } from "./Tones-CQu-OvAk.js";
|
|
7
6
|
import { S as Severity } from "./Severity-D0C5oAt-.js";
|
|
8
7
|
import { O as Orientation } from "./Orientation-u-sYunuG.js";
|
|
9
8
|
import { A as Align } from "./Align-DqFtCY3a.js";
|
|
@@ -88,4 +87,4 @@ export {
|
|
|
88
87
|
index as i,
|
|
89
88
|
layerStyle as l
|
|
90
89
|
};
|
|
91
|
-
//# sourceMappingURL=index-
|
|
90
|
+
//# sourceMappingURL=index-CGIXFfl9.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-CGIXFfl9.js","sources":["../../src/foundation/styles/constants/Layers.ts","../../src/foundation/styles/enums/Density.ts"],"sourcesContent":["/* Provides semantic z-index tiers — the single source of truth for stacking order. */\n\n/** Contains the semantic z-index tiers; matching `z-{name}` utilities ship via @theme. */\nexport const Layer = {\n /** Slips under the base layer; visually hidden. */\n Hide: -1,\n /** Sits in the default DOM flow with no z-index applied. */\n Base: 0,\n /** Slightly elevates over siblings — badges, sticky list items, in-grid overlays. */\n Raised: 10,\n /** Pins widgets inside a section — panels, inline overlays. */\n Docked: 20,\n /** Anchors a page-level sticky header or footer. */\n Sticky: 30,\n /** Hosts system banners — cookie notice, status banner, persistent Fab. */\n Banner: 40,\n /** Hosts dropdowns, popovers, comboboxes, menus, hover-cards anchored to a trigger. */\n Dropdown: 50,\n /** Dims the page behind a modal — backdrop / scrim layer. */\n Overlay: 60,\n /** Hosts modal / dialog / drawer / sheet content above its backdrop. */\n Modal: 70,\n /** Hosts popovers / menus opened FROM inside a modal — must beat Modal. */\n Popover: 80,\n /** Hosts toasts, snackbars, undo bars — survives above modals. */\n Toast: 90,\n /** Hosts tooltips and live-cursors — highest functional layer. */\n Tooltip: 100,\n /** Hosts DevTools / design-system inspector overlays — always wins. */\n Debug: 9999,\n} as const;\n\n/** Represents the name of a semantic z-index tier. */\nexport type LayerName = keyof typeof Layer;\n\n/** Provides an inline `style` object for programmatic z-index assignment. */\nexport function layerStyle(layer: LayerName): { zIndex: number } {\n return { zIndex: Layer[layer] };\n}\n","/**\n * Defines the density scale an app or a region renders at, set with `data-density` on any element.\n *\n * Every spacing utility — control heights, padding, gaps — derives from Tailwind's `--spacing`, so one attribute\n * rescales everything inside it; type sizes stay put. `comfortable` is the default scale.\n */\nexport const Density = {\n /** Refers to 87.5% spacing — dense tools and tables. The smallest controls can fall under a 24px target. */\n Compact: 'compact',\n /** Refers to the default spacing. */\n Comfortable: 'comfortable',\n /** Refers to 112.5% spacing — reading and touch-first surfaces. */\n Spacious: 'spacious',\n} as const;\n\nexport type Density = (typeof Density)[keyof typeof Density];\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAGO,MAAM,QAAQ;AAAA;AAAA,EAEnB,MAAM;AAAA;AAAA,EAEN,MAAM;AAAA;AAAA,EAEN,QAAQ;AAAA;AAAA,EAER,QAAQ;AAAA;AAAA,EAER,QAAQ;AAAA;AAAA,EAER,QAAQ;AAAA;AAAA,EAER,UAAU;AAAA;AAAA,EAEV,SAAS;AAAA;AAAA,EAET,OAAO;AAAA;AAAA,EAEP,SAAS;AAAA;AAAA,EAET,OAAO;AAAA;AAAA,EAEP,SAAS;AAAA;AAAA,EAET,OAAO;AACT;AAMO,SAAS,WAAW,OAAsC;AAC/D,SAAO,EAAE,QAAQ,MAAM,KAAK,EAAA;AAC9B;AChCO,MAAM,UAAU;AAAA;AAAA,EAErB,SAAS;AAAA;AAAA,EAET,aAAa;AAAA;AAAA,EAEb,UAAU;AACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -2,11 +2,15 @@
|
|
|
2
2
|
export type ConfigSource = Readonly<Record<string, string | undefined>>;
|
|
3
3
|
/** The default runtime-config global — `window.__APP_CONFIG__`, injected per-environment ahead of build-time env. */
|
|
4
4
|
export declare const DefaultRuntimeConfigKey = "__APP_CONFIG__";
|
|
5
|
+
/** A build-time env record as a bundler exposes it — Vite's `import.meta.env`, with string and boolean values. */
|
|
6
|
+
export type ConfigEnv = Readonly<Record<string, unknown>>;
|
|
5
7
|
/**
|
|
6
|
-
* The build-time source
|
|
7
|
-
*
|
|
8
|
+
* The build-time source over the app's own env — call it as `importMetaEnvSource(import.meta.env)` from an app
|
|
9
|
+
* module, where the bundler inlines `import.meta.env`. Copies every string, number, boolean and bigint value as a
|
|
10
|
+
* string (`DEV: true` → `'true'`) into a frozen snapshot and drops anything else. A missing or non-object `env`
|
|
11
|
+
* yields `{}`.
|
|
8
12
|
*/
|
|
9
|
-
export declare function importMetaEnvSource(): ConfigSource;
|
|
13
|
+
export declare function importMetaEnvSource(env: ConfigEnv | undefined): ConfigSource;
|
|
10
14
|
/**
|
|
11
15
|
* The runtime source — a global object (default `window.__APP_CONFIG__`) a deployment injects before the app
|
|
12
16
|
* boots. Returns `{}` when there is no `window` (SSR / Node) or the global is absent or not an object.
|
|
@@ -14,8 +18,11 @@ export declare function importMetaEnvSource(): ConfigSource;
|
|
|
14
18
|
export declare function windowConfigSource(globalKey?: string): ConfigSource;
|
|
15
19
|
/** An explicit source over a plain record — the injection seam for tests and for values resolved elsewhere. */
|
|
16
20
|
export declare function staticSource(values: Record<string, string | undefined>): ConfigSource;
|
|
17
|
-
/**
|
|
18
|
-
|
|
21
|
+
/**
|
|
22
|
+
* The default source order: runtime `window.__APP_CONFIG__` layered ahead of the app's build-time env. Pass the
|
|
23
|
+
* app's `import.meta.env` as `env`; without it only the runtime source is read.
|
|
24
|
+
*/
|
|
25
|
+
export declare function defaultSources(env?: ConfigEnv): ReadonlyArray<ConfigSource>;
|
|
19
26
|
/**
|
|
20
27
|
* Resolves `key` across an ordered source list, first non-empty match wins (earlier source = higher priority).
|
|
21
28
|
* A non-string hit (e.g. `import.meta.env.DEV` is a boolean) is coerced to its string form; an empty string is
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AnyConfigField, ConfigField } from './ConfigField';
|
|
2
|
-
import { ConfigSource } from './ConfigSource';
|
|
2
|
+
import { ConfigEnv, ConfigSource } from './ConfigSource';
|
|
3
3
|
/** A schema: a map from output key to its field spec. */
|
|
4
4
|
export type ConfigSchema = Readonly<Record<string, AnyConfigField>>;
|
|
5
5
|
/** Widens an optional field's output to include `undefined`; a required / defaulted field stays `T`. */
|
|
@@ -10,8 +10,13 @@ export type InferConfig<S extends ConfigSchema> = {
|
|
|
10
10
|
};
|
|
11
11
|
/** Tunes where `defineConfig` reads from and how keys are namespaced. */
|
|
12
12
|
export interface DefineConfigOptions {
|
|
13
|
-
/** The ordered source list; earlier wins. Defaults to `
|
|
13
|
+
/** The ordered source list; earlier wins. Defaults to `defaultSources(env)`. */
|
|
14
14
|
readonly sources?: ReadonlyArray<ConfigSource>;
|
|
15
|
+
/**
|
|
16
|
+
* The app's build-time env — pass `import.meta.env` from the app's own module. Read after the runtime
|
|
17
|
+
* `window.__APP_CONFIG__` when `sources` is omitted; ignored when `sources` is given.
|
|
18
|
+
*/
|
|
19
|
+
readonly env?: ConfigEnv;
|
|
15
20
|
/** A prefix prepended to every schema key on lookup (e.g. `'VITE_'` → key `API_URL` reads `VITE_API_URL`). */
|
|
16
21
|
readonly prefix?: string;
|
|
17
22
|
}
|
|
@@ -36,8 +41,8 @@ export declare class ConfigError extends Error {
|
|
|
36
41
|
* Resolves a typed configuration object from `schema`. Each key is looked up across the source list (prefix
|
|
37
42
|
* applied), parsed through its field, and defaulted when absent. Empty strings count as absent. All missing /
|
|
38
43
|
* invalid problems are aggregated and thrown together as a single {@link ConfigError}; on success the returned
|
|
39
|
-
* object is frozen. Pass an explicit `sources` (e.g.
|
|
40
|
-
* in tests.
|
|
44
|
+
* object is frozen. Pass the app's `env: import.meta.env`, or an explicit `sources` (e.g.
|
|
45
|
+
* `[staticSource({...})]`) to make resolution deterministic in tests.
|
|
41
46
|
*/
|
|
42
47
|
export declare function defineConfig<const S extends ConfigSchema>(schema: S, options?: DefineConfigOptions): InferConfig<S>;
|
|
43
48
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { type ConfigField, type ConfigJsonDecoder, type ConfigFieldOptions, type AnyConfigField, type ListFieldOptions, str, num, bool, oneOf, url, port, json, list, } from './ConfigField';
|
|
2
|
-
export { type ConfigSource, DefaultRuntimeConfigKey, importMetaEnvSource, windowConfigSource, staticSource, defaultSources, resolveRaw, } from './ConfigSource';
|
|
2
|
+
export { type ConfigEnv, type ConfigSource, DefaultRuntimeConfigKey, importMetaEnvSource, windowConfigSource, staticSource, defaultSources, resolveRaw, } from './ConfigSource';
|
|
3
3
|
export { type ConfigSchema, type InferConfig, type DefineConfigOptions, type ConfigIssue, ConfigError, defineConfig, } from './DefineConfig';
|
|
4
4
|
export { Environment, IsDevelopment, IsProduction } from './Environment';
|