@plexui/vue 0.10.0 → 0.11.0

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.
Files changed (101) hide show
  1. package/dist/es/components/ButtonGroup/ButtonGroup.js +7 -0
  2. package/dist/es/components/ButtonGroup/ButtonGroup.js.map +1 -1
  3. package/dist/es/components/ButtonGroup/index.js.map +1 -1
  4. package/dist/es/components/ContextMenu/shared.js +3 -2
  5. package/dist/es/components/ContextMenu/shared.js.map +1 -1
  6. package/dist/es/components/Dialog/Dialog.js +135 -18
  7. package/dist/es/components/Dialog/Dialog.js.map +1 -1
  8. package/dist/es/components/Dialog/dialogSteps.js +85 -0
  9. package/dist/es/components/Dialog/dialogSteps.js.map +1 -0
  10. package/dist/es/components/Dialog/dialogViewport.js +74 -0
  11. package/dist/es/components/Dialog/dialogViewport.js.map +1 -0
  12. package/dist/es/components/Dialog/index.js +1 -1
  13. package/dist/es/components/Dialog/index.js.map +1 -1
  14. package/dist/es/components/Dialog/sheetDrag.js +2 -1
  15. package/dist/es/components/Dialog/sheetDrag.js.map +1 -1
  16. package/dist/es/components/IndexBar/IndexBar.js +215 -0
  17. package/dist/es/components/IndexBar/IndexBar.js.map +1 -0
  18. package/dist/es/components/IndexBar/index.js +2 -0
  19. package/dist/es/components/IndexBar/index.js.map +1 -0
  20. package/dist/es/components/MarkdownEditor/MarkdownEditor.js +149 -1
  21. package/dist/es/components/MarkdownEditor/MarkdownEditor.js.map +1 -1
  22. package/dist/es/components/Menu/Menu.js +10 -6
  23. package/dist/es/components/Menu/Menu.js.map +1 -1
  24. package/dist/es/components/Page/Page.js +2 -2
  25. package/dist/es/components/Page/Page.js.map +1 -1
  26. package/dist/es/components/PhoneLayout/PhoneLayout.js +50 -0
  27. package/dist/es/components/PhoneLayout/PhoneLayout.js.map +1 -0
  28. package/dist/es/components/PhoneLayout/index.js +2 -0
  29. package/dist/es/components/PhoneLayout/index.js.map +1 -0
  30. package/dist/es/components/Popover/Popover.js +1 -1
  31. package/dist/es/components/Popover/Popover.js.map +1 -1
  32. package/dist/es/components/Popover/deferredPointerDownOutside.js +59 -4
  33. package/dist/es/components/Popover/deferredPointerDownOutside.js.map +1 -1
  34. package/dist/es/components/Select/Select.js +2 -2
  35. package/dist/es/components/Select/Select.js.map +1 -1
  36. package/dist/es/components/Slider/Slider.js +34 -3
  37. package/dist/es/components/Slider/Slider.js.map +1 -1
  38. package/dist/es/components/SwipeActions/SwipeActions.js +374 -0
  39. package/dist/es/components/SwipeActions/SwipeActions.js.map +1 -0
  40. package/dist/es/components/SwipeActions/index.js +2 -0
  41. package/dist/es/components/SwipeActions/index.js.map +1 -0
  42. package/dist/es/components/Switch/Switch.js +3 -1
  43. package/dist/es/components/Switch/Switch.js.map +1 -1
  44. package/dist/es/components/TabBar/TabBar.js +23 -8
  45. package/dist/es/components/TabBar/TabBar.js.map +1 -1
  46. package/dist/es/components/TabBar/index.js.map +1 -1
  47. package/dist/es/components/Tabs/Tabs.js +1 -0
  48. package/dist/es/components/Tabs/Tabs.js.map +1 -1
  49. package/dist/es/components/TagInput/TagInput.js +3 -46
  50. package/dist/es/components/TagInput/TagInput.js.map +1 -1
  51. package/dist/es/components/Textarea/Textarea.js +1 -0
  52. package/dist/es/components/Textarea/Textarea.js.map +1 -1
  53. package/dist/es/components/Tip/Tip.js +276 -0
  54. package/dist/es/components/Tip/Tip.js.map +1 -0
  55. package/dist/es/components/Tip/index.js +2 -0
  56. package/dist/es/components/Tip/index.js.map +1 -0
  57. package/dist/es/components/Toast/ToastRenderer.js +30 -13
  58. package/dist/es/components/Toast/ToastRenderer.js.map +1 -1
  59. package/dist/es/components/Toast/Toaster.js +17 -6
  60. package/dist/es/components/Toast/Toaster.js.map +1 -1
  61. package/dist/es/components/Toast/toastLifecycle.js +113 -1
  62. package/dist/es/components/Toast/toastLifecycle.js.map +1 -1
  63. package/dist/es/components/Toolbar/Toolbar.js +3 -3
  64. package/dist/es/components/Toolbar/Toolbar.js.map +1 -1
  65. package/dist/es/composables/useEscCloseStack.js +8 -4
  66. package/dist/es/composables/useEscCloseStack.js.map +1 -1
  67. package/dist/es/lib/floatingBoundary.js +3 -1
  68. package/dist/es/lib/floatingBoundary.js.map +1 -1
  69. package/dist/es/lib/helpers.js +21 -0
  70. package/dist/es/lib/helpers.js.map +1 -1
  71. package/dist/es/lib/phoneLayout.js +16 -0
  72. package/dist/es/lib/phoneLayout.js.map +1 -0
  73. package/dist/es/lib/toastRegion.js +6 -0
  74. package/dist/es/lib/toastRegion.js.map +1 -0
  75. package/dist/types/components/ButtonGroup/ButtonGroup.d.ts +13 -0
  76. package/dist/types/components/ButtonGroup/index.d.ts +1 -1
  77. package/dist/types/components/ContextMenu/shared.d.ts +3 -2
  78. package/dist/types/components/Dialog/Dialog.d.ts +93 -3
  79. package/dist/types/components/Dialog/dialogSteps.d.ts +10 -0
  80. package/dist/types/components/Dialog/dialogViewport.d.ts +1 -0
  81. package/dist/types/components/Dialog/index.d.ts +1 -1
  82. package/dist/types/components/IndexBar/IndexBar.d.ts +112 -0
  83. package/dist/types/components/IndexBar/index.d.ts +1 -0
  84. package/dist/types/components/Menu/Menu.d.ts +14 -15
  85. package/dist/types/components/Page/Page.d.ts +2 -2
  86. package/dist/types/components/PhoneLayout/PhoneLayout.d.ts +21 -0
  87. package/dist/types/components/PhoneLayout/index.d.ts +1 -0
  88. package/dist/types/components/Popover/deferredPointerDownOutside.d.ts +1 -1
  89. package/dist/types/components/SwipeActions/SwipeActions.d.ts +135 -0
  90. package/dist/types/components/SwipeActions/index.d.ts +1 -0
  91. package/dist/types/components/TabBar/TabBar.d.ts +55 -6
  92. package/dist/types/components/TabBar/index.d.ts +1 -1
  93. package/dist/types/components/Tip/Tip.d.ts +146 -0
  94. package/dist/types/components/Tip/index.d.ts +1 -0
  95. package/dist/types/components/Toast/toastLifecycle.d.ts +34 -0
  96. package/dist/types/components/Toolbar/Toolbar.d.ts +9 -7
  97. package/dist/types/composables/useEscCloseStack.d.ts +2 -2
  98. package/dist/types/lib/helpers.d.ts +6 -0
  99. package/dist/types/lib/phoneLayout.d.ts +11 -0
  100. package/dist/types/lib/toastRegion.d.ts +5 -0
  101. package/package.json +2 -2
@@ -0,0 +1,2 @@
1
+ export { Tip, TipPopover } from "./Tip.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Tip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,UAAU,EAAiF,MAAM,UAAU,CAAA","sourcesContent":["export { Tip, TipPopover, type TipArrowEdge, type TipMobileActions, type TipPopoverProps, type TipProps } from \"./Tip.js\"\n"]}
@@ -2,7 +2,7 @@ import clsx from "clsx";
2
2
  import { defineComponent, h, isVNode, mergeProps, onBeforeUnmount, onMounted, onUpdated, ref, toRaw, watch } from "vue";
3
3
  import { toast, useVueSonner } from "vue-sonner";
4
4
  import { CheckCircle, InfoCircle, Warning, XCircle } from "../Icon/index.js";
5
- import { documentDirection, offsetStyles, ToastLifecycle } from "./toastLifecycle.js";
5
+ import { announcerStyle, documentDirection, offsetStyles, ToastLifecycle } from "./toastLifecycle.js";
6
6
  const fallbackIcons = { success: CheckCircle, error: XCircle, warning: Warning, info: InfoCircle };
7
7
  const CloseIcon = () => h("svg", { xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", width: 12, height: 12, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }, [h("line", { x1: 18, y1: 6, x2: 6, y2: 18 }), h("line", { x1: 6, y1: 6, x2: 18, y2: 18 })]);
8
8
  const actionObject = (value) => typeof value === "object" && value !== null && "label" in value;
@@ -37,8 +37,16 @@ const ToastItem = defineComponent({
37
37
  props.lifecycle.measure(props.entry.toast.id, element.offsetHeight || element.getBoundingClientRect().height);
38
38
  element.style.height = height;
39
39
  };
40
+ const custom = () => Boolean(props.entry.toast.component);
41
+ const alert = () => props.lifecycle.alertRole(props.entry, custom());
42
+ // After every render: a new toast, or new words in one (a promise that settles), is read once
43
+ const announce = () => { if (node.value)
44
+ props.lifecycle.speak(props.entry.toast.id, node.value, custom()); };
45
+ // A custom toast that changes its own words, without a new render here, is read again too
46
+ let words = null;
40
47
  onMounted(() => {
41
48
  props.lifecycle.setNode(props.entry.toast.id, node.value);
49
+ announce();
42
50
  measure();
43
51
  observer = typeof ResizeObserver !== "undefined" ? new ResizeObserver(measure) : null;
44
52
  if (node.value) {
@@ -46,9 +54,12 @@ const ToastItem = defineComponent({
46
54
  for (const child of node.value.children)
47
55
  observer?.observe(child);
48
56
  }
57
+ words = typeof MutationObserver !== "undefined" ? new MutationObserver(announce) : null;
58
+ if (node.value)
59
+ words?.observe(node.value, { childList: true, characterData: true, subtree: true });
49
60
  });
50
- onUpdated(measure);
51
- onBeforeUnmount(() => { observer?.disconnect(); props.lifecycle.setNode(props.entry.toast.id, null); });
61
+ onUpdated(() => { announce(); measure(); });
62
+ onBeforeUnmount(() => { observer?.disconnect(); words?.disconnect(); props.lifecycle.setNode(props.entry.toast.id, null); });
52
63
  return () => {
53
64
  const { entry, lifecycle, options, index, count } = props;
54
65
  const item = entry.toast;
@@ -95,7 +106,7 @@ const ToastItem = defineComponent({
95
106
  item.promise || item.type === "loading" ? item.icon ? content(item.icon) : loader() : null,
96
107
  item.type !== "loading" ? type && slots[`${type}-icon`] && !item.icon ? slots[`${type}-icon`]?.() : content(icon) : null,
97
108
  ]) : null,
98
- h("div", { "data-content": "", class: slot("content") }, [h("div", { "data-title": "", class: slot("title") }, content(item.title, item.componentProps)), item.description ? h("div", { "data-description": "", class: clsx(options.toastOptions?.descriptionClass, slot("description")) }, content(item.description, item.componentProps)) : null]),
109
+ h("div", { "data-content": "", role: alert() ? "alert" : undefined, class: slot("content") }, [h("div", { "data-title": "", class: slot("title") }, content(item.title, item.componentProps)), item.description ? h("div", { "data-description": "", class: clsx(options.toastOptions?.descriptionClass, slot("description")) }, content(item.description, item.componentProps)) : null]),
99
110
  actionButton("cancel"), actionButton("action"),
100
111
  ],
101
112
  ]);
@@ -129,15 +140,21 @@ export const ToastRenderer = defineComponent({
129
140
  const hotkeyLabel = (props.hotkey ?? ["altKey", "KeyT"]).join("+").replace(/Key|Digit/g, "");
130
141
  const positions = [...new Set(lifecycle.entries.map((entry) => lifecycle.position(entry)))];
131
142
  const dir = props.dir === "auto" || !props.dir ? documentDirection(typeof document === "undefined" ? undefined : document) : props.dir;
132
- return h("section", { "aria-label": `${props.containerAriaLabel ?? "Notifications"} ${hotkeyLabel}`, tabindex: -1, "aria-live": "polite", "aria-relevant": "additions text", "aria-atomic": "false" }, positions.map((position) => {
133
- const entries = lifecycle.at(position);
134
- const [y, x] = position.split("-");
135
- return h("ol", mergeProps({ key: position, ref: (node) => lifecycle.setList(position, node instanceof HTMLElement ? node : null), dir, tabindex: -1, class: props.class,
136
- "data-sonner-toaster": "true", "data-sonner-theme": props.theme ?? "light", "data-y-position": y, "data-x-position": x,
137
- style: { "--front-toast-height": `${entries.find((entry) => !entry.removed)?.height ?? 0}px`, "--width": "356px", "--gap": `${props.gap ?? 14}px`, ...props.style, ...offsetStyles(props.offset, props.mobileOffset) },
138
- onFocusin: (event) => lifecycle.focusIn(event), onFocusout: (event) => lifecycle.focusOut(event),
139
- onPointerenter: (event) => lifecycle.pointerEnter(event), onMouseenter: () => lifecycle.hover(true), onMousemove: () => lifecycle.hover(true), onMouseleave: () => lifecycle.hover(false), }, attrs), entries.map((entry, index) => h(ToastItem, { key: entry.toast.id, entry, lifecycle, options: props, index, count: entries.length, revision: version }, slots)));
140
- }));
143
+ // aria-live="off": not a live region itself (an announcer or an alert's role speaks, once), but a modal's
144
+ // aria-hidden on everything else (Radix and Reka call aria-hidden's hideOthers) keeps any [aria-live]
145
+ return h("section", { ref: (node) => lifecycle.setRegion(node instanceof HTMLElement ? node : null), "aria-label": `${props.containerAriaLabel ?? "Notifications"} ${hotkeyLabel}`, tabindex: -1, "aria-live": "off" }, [
146
+ h("div", { key: "polite", ref: (node) => lifecycle.setAnnouncer("polite", node instanceof HTMLElement ? node : null), role: "status", "aria-live": "polite", "aria-atomic": "false", "data-toast-announcer": "polite", style: announcerStyle }),
147
+ h("div", { key: "assertive", ref: (node) => lifecycle.setAnnouncer("assertive", node instanceof HTMLElement ? node : null), role: "alert", "aria-live": "assertive", "aria-atomic": "false", "data-toast-announcer": "assertive", style: announcerStyle }),
148
+ ...positions.map((position) => {
149
+ const entries = lifecycle.at(position);
150
+ const [y, x] = position.split("-");
151
+ return h("ol", mergeProps({ key: position, ref: (node) => lifecycle.setList(position, node instanceof HTMLElement ? node : null), dir, tabindex: -1, class: props.class,
152
+ "data-sonner-toaster": "true", "data-sonner-theme": props.theme ?? "light", "data-y-position": y, "data-x-position": x,
153
+ style: { "--front-toast-height": `${entries.find((entry) => !entry.removed)?.height ?? 0}px`, "--width": "356px", "--gap": `${props.gap ?? 14}px`, ...props.style, ...offsetStyles(props.offset, props.mobileOffset) },
154
+ onFocusin: (event) => lifecycle.focusIn(event), onFocusout: (event) => lifecycle.focusOut(event),
155
+ onPointerenter: (event) => lifecycle.pointerEnter(event), onMouseenter: () => lifecycle.hover(true), onMousemove: () => lifecycle.hover(true), onMouseleave: () => lifecycle.hover(false), }, attrs), entries.map((entry, index) => h(ToastItem, { key: entry.toast.id, entry, lifecycle, options: props, index, count: entries.length, revision: version }, slots)));
156
+ }),
157
+ ]);
141
158
  };
142
159
  },
143
160
  });
@@ -1 +1 @@
1
- {"version":3,"file":"ToastRenderer.js","sourceRoot":"","sources":["../../../../src/components/Toast/ToastRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAqD,MAAM,KAAK,CAAA;AAC1K,OAAO,EAA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C,CAAA","sourcesContent":["import clsx from \"clsx\"\nimport { defineComponent, h, isVNode, mergeProps, onBeforeUnmount, onMounted, onUpdated, ref, toRaw, watch, type Component, type CSSProperties, type PropType } from \"vue\"\nimport { toast, useVueSonner, type Action, type ToastT, type ToasterProps } from \"vue-sonner\"\nimport { CheckCircle, InfoCircle, Warning, XCircle } from \"../Icon/index.js\"\nimport { documentDirection, offsetStyles, ToastLifecycle, type Position, type ToastEntry } from \"./toastLifecycle.js\"\n\ntype Classes = NonNullable<NonNullable<ToasterProps[\"toastOptions\"]>[\"classes\"]>\nconst fallbackIcons = { success: CheckCircle, error: XCircle, warning: Warning, info: InfoCircle }\nconst CloseIcon = () => h(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", \"aria-hidden\": \"true\", width: 12, height: 12, viewBox: \"0 0 24 24\", fill: \"none\", stroke: \"currentColor\", \"stroke-width\": \"1.5\", \"stroke-linecap\": \"round\", \"stroke-linejoin\": \"round\" }, [h(\"line\", { x1: 18, y1: 6, x2: 6, y2: 18 }), h(\"line\", { x1: 6, y1: 6, x2: 18, y2: 18 })])\nconst actionObject = (value: Action | Component | undefined): value is Action => typeof value === \"object\" && value !== null && \"label\" in value\nconst content = (value: unknown, componentProps?: unknown) => {\n if (value === undefined || value === null || value === false) return undefined\n if (typeof value === \"string\" || typeof value === \"number\") return String(value)\n if (isVNode(value)) return value\n if (typeof value === \"object\" || typeof value === \"function\") return h(toRaw(value) as Component, typeof componentProps === \"object\" && componentProps !== null ? componentProps : {})\n return undefined\n}\n\nconst ToastItem = defineComponent({\n name: \"ToastItem\",\n props: {\n entry: { type: Object as PropType<ToastEntry<ToastT>>, required: true },\n lifecycle: { type: Object as PropType<ToastLifecycle<ToastT>>, required: true },\n options: { type: Object as PropType<ToasterProps>, required: true },\n index: { type: Number, required: true }, count: { type: Number, required: true }, revision: Number,\n },\n setup(props, { slots }) {\n const node = ref<HTMLElement | null>(null)\n let observer: ResizeObserver | null = null\n const measure = () => {\n const element = node.value\n if (!element) return\n const height = element.style.height\n element.style.height = \"auto\"\n props.lifecycle.measure(props.entry.toast.id, element.offsetHeight || element.getBoundingClientRect().height)\n element.style.height = height\n }\n onMounted(() => {\n props.lifecycle.setNode(props.entry.toast.id, node.value)\n measure()\n observer = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(measure) : null\n if (node.value) { observer?.observe(node.value); for (const child of node.value.children) observer?.observe(child) }\n })\n onUpdated(measure)\n onBeforeUnmount(() => { observer?.disconnect(); props.lifecycle.setNode(props.entry.toast.id, null) })\n return () => {\n const { entry, lifecycle, options, index, count } = props\n const item = entry.toast\n const slot = (name: keyof Classes) => clsx(options.toastOptions?.classes?.[name], item.classes?.[name])\n const [y, x] = lifecycle.position(entry).split(\"-\")\n const visible = index < (options.visibleToasts ?? 3)\n const disabled = item.dismissible === false || item.type === \"loading\"\n const type = item.type === \"normal\" || item.type === \"default\" ? undefined : item.type\n const icon = item.icon ?? (type && type in fallbackIcons ? options.icons?.[type as keyof typeof fallbackIcons] ?? fallbackIcons[type as keyof typeof fallbackIcons] : undefined)\n const actionButton = (kind: \"action\" | \"cancel\") => {\n const action = item[kind]\n if (!action) return null\n if (!actionObject(action)) return content(action)\n return h(\"button\", { type: \"button\", \"data-button\": \"true\", [`data-${kind}`]: \"true\", disabled: kind === \"cancel\" && disabled,\n class: slot(kind === \"action\" ? \"actionButton\" : \"cancelButton\"),\n style: kind === \"action\" ? item.actionButtonStyle ?? options.toastOptions?.actionButtonStyle : item.cancelButtonStyle ?? options.toastOptions?.cancelButtonStyle,\n onClick: (event: MouseEvent) => { if (kind === \"cancel\" && disabled) return; action.onClick(event); if (kind === \"cancel\" || !event.defaultPrevented) lifecycle.close(item.id, \"action\") },\n }, content(action.label))\n }\n const loader = () => h(\"div\", { class: clsx(\"sonner-loading-wrapper\", slot(\"loader\")), \"data-visible\": item.type === \"loading\" },\n slots[\"loading-icon\"] ? slots[\"loading-icon\"]() : options.icons?.loading ? h(\"div\", { class: \"sonner-loader\", \"data-visible\": item.type === \"loading\" }, content(options.icons.loading)) : h(\"div\", { class: \"sonner-spinner\" }, Array.from({ length: 12 }, (_, i) => h(\"div\", { key: i, class: \"sonner-loading-bar\" }))))\n return h(\"li\", {\n ref: node, tabindex: visible && !entry.removed ? 0 : -1, inert: !visible || entry.removed ? \"\" : undefined, \"aria-hidden\": !visible || entry.removed || undefined,\n class: clsx(options.toastOptions?.class, item.class, slot(\"toast\"), slot(\"default\"), type && slot(type as keyof Classes)),\n \"data-sonner-toast\": \"\", \"data-rich-colors\": item.richColors ?? options.richColors ?? undefined, \"data-styled\": !Boolean(item.component || item.unstyled || options.toastOptions?.unstyled),\n \"data-mounted\": entry.mounted, \"data-promise\": Boolean(item.promise), \"data-swiped\": Boolean(entry.x || entry.y), \"data-removed\": entry.removed,\n \"data-visible\": visible, \"data-y-position\": y, \"data-x-position\": x, \"data-index\": index, \"data-front\": index === 0, \"data-swiping\": entry.swiping,\n \"data-dismissible\": item.dismissible !== false, \"data-type\": type, \"data-invert\": item.invert || options.invert || undefined,\n \"data-swipe-out\": Boolean(entry.swipeOut), \"data-swipe-direction\": entry.swipeOut, \"data-expanded\": lifecycle.expanded || Boolean(options.expand && entry.mounted), \"data-testid\": item.testId,\n style: { \"--index\": index, \"--toasts-before\": index, \"--z-index\": count - index, \"--offset\": `${lifecycle.offset(entry)}px`, \"--initial-height\": options.expand ? \"auto\" : `${entry.height}px`, \"--swipe-amount-x\": `${entry.x}px`, \"--swipe-amount-y\": `${entry.y}px`, ...options.toastOptions?.style, ...item.style },\n onPointerdown: (event: PointerEvent) => lifecycle.pointerDown(item.id, event), onPointermove: (event: PointerEvent) => lifecycle.pointerMove(item.id, event),\n onPointerup: (event: PointerEvent) => lifecycle.pointerEnd(item.id, event), onPointercancel: (event: PointerEvent) => lifecycle.pointerEnd(item.id, event, true), onLostpointercapture: (event: PointerEvent) => lifecycle.pointerEnd(item.id, event, true),\n }, [\n (item.closeButton ?? options.toastOptions?.closeButton ?? options.closeButton) && !item.component && item.type !== \"loading\" ? h(\"button\", {\n type: \"button\", \"aria-label\": options.toastOptions?.closeButtonAriaLabel ?? \"Close toast\", \"data-disabled\": disabled, disabled, \"data-close-button\": \"true\", \"data-close-button-position\": item.closeButtonPosition ?? options.closeButtonPosition ?? \"top-left\", class: slot(\"closeButton\"),\n onClick: () => lifecycle.close(item.id, \"dismiss\"),\n }, options.icons?.close ? content(options.icons.close) : slots[\"close-icon\"]?.() ?? h(CloseIcon)) : null,\n item.component ? h(toRaw(item.component), { ...item.componentProps, onCloseToast: () => { if (!disabled) lifecycle.close(item.id, \"dismiss\") }, isPaused: lifecycle.paused }) : [\n (type || item.icon || item.promise) && item.icon !== null ? h(\"div\", { \"data-icon\": \"\", class: slot(\"icon\") }, [\n item.promise || item.type === \"loading\" ? item.icon ? content(item.icon) : loader() : null,\n item.type !== \"loading\" ? type && slots[`${type}-icon`] && !item.icon ? slots[`${type}-icon`]?.() : content(icon) : null,\n ]) : null,\n h(\"div\", { \"data-content\": \"\", class: slot(\"content\") }, [h(\"div\", { \"data-title\": \"\", class: slot(\"title\") }, content(item.title, item.componentProps)), item.description ? h(\"div\", { \"data-description\": \"\", class: clsx(options.toastOptions?.descriptionClass, slot(\"description\")) }, content(item.description, item.componentProps)) : null]),\n actionButton(\"cancel\"), actionButton(\"action\"),\n ],\n ])\n }\n },\n})\n\n/** Owns presentation/interaction only; vue-sonner remains the public toast store. */\nexport const ToastRenderer = defineComponent({\n name: \"ToastRenderer\", inheritAttrs: false,\n props: {\n id: String, position: String as PropType<ToasterProps[\"position\"]>, duration: Number, gap: Number, visibleToasts: Number,\n expand: { type: Boolean, default: undefined }, closeButton: { type: Boolean, default: undefined }, invert: { type: Boolean, default: undefined }, richColors: { type: Boolean, default: undefined },\n theme: String as PropType<ToasterProps[\"theme\"]>, hotkey: Array as PropType<string[]>, dir: String as PropType<ToasterProps[\"dir\"]>,\n swipeDirections: Array as PropType<ToasterProps[\"swipeDirections\"]>, icons: Object as PropType<ToasterProps[\"icons\"]>, containerAriaLabel: String,\n offset: [String, Number, Object] as PropType<ToasterProps[\"offset\"]>, mobileOffset: [String, Number, Object] as PropType<ToasterProps[\"mobileOffset\"]>,\n class: String, style: Object as PropType<CSSProperties>, toastOptions: Object as PropType<ToasterProps[\"toastOptions\"]>, closeButtonPosition: String as PropType<ToasterProps[\"closeButtonPosition\"]>,\n },\n setup(props, { attrs, slots }) {\n const { activeToasts } = useVueSonner()\n const revision = ref(0)\n const lifecycle = new ToastLifecycle<ToastT>(toast.dismiss, (reason, item) => reason === \"auto\" ? item.onAutoClose?.(item) : item.onDismiss?.(item))\n const unsubscribe = lifecycle.subscribe(() => { revision.value++ })\n const keydown = (event: KeyboardEvent) => lifecycle.keyDown(event, props.hotkey ?? [\"altKey\", \"KeyT\"])\n onMounted(() => { lifecycle.connect(document); document.addEventListener(\"keydown\", keydown) })\n onBeforeUnmount(() => { unsubscribe(); lifecycle.disconnect(); document.removeEventListener(\"keydown\", keydown) })\n watch(() => [activeToasts.value, props.id, props.position, props.duration, props.toastOptions?.duration, props.gap, props.visibleToasts, props.expand, props.swipeDirections], () => {\n lifecycle.sync(activeToasts.value, { id: props.id, position: props.position ?? \"bottom-right\", duration: props.toastOptions?.duration ?? props.duration ?? 4000, gap: props.gap ?? 14, visibleToasts: props.visibleToasts ?? 3, expand: props.expand, swipeDirections: props.swipeDirections })\n }, { immediate: true })\n return () => {\n const version = revision.value\n const hotkeyLabel = (props.hotkey ?? [\"altKey\", \"KeyT\"]).join(\"+\").replace(/Key|Digit/g, \"\")\n const positions = [...new Set(lifecycle.entries.map((entry) => lifecycle.position(entry)))]\n const dir = props.dir === \"auto\" || !props.dir ? documentDirection(typeof document === \"undefined\" ? undefined : document) : props.dir\n return h(\"section\", { \"aria-label\": `${props.containerAriaLabel ?? \"Notifications\"} ${hotkeyLabel}`, tabindex: -1, \"aria-live\": \"polite\", \"aria-relevant\": \"additions text\", \"aria-atomic\": \"false\" }, positions.map((position: Position) => {\n const entries = lifecycle.at(position)\n const [y, x] = position.split(\"-\")\n return h(\"ol\", mergeProps({ key: position, ref: (node) => lifecycle.setList(position, node instanceof HTMLElement ? node : null), dir, tabindex: -1, class: props.class,\n \"data-sonner-toaster\": \"true\", \"data-sonner-theme\": props.theme ?? \"light\", \"data-y-position\": y, \"data-x-position\": x,\n style: { \"--front-toast-height\": `${entries.find((entry) => !entry.removed)?.height ?? 0}px`, \"--width\": \"356px\", \"--gap\": `${props.gap ?? 14}px`, ...props.style, ...offsetStyles(props.offset, props.mobileOffset) },\n onFocusin: (event: FocusEvent) => lifecycle.focusIn(event), onFocusout: (event: FocusEvent) => lifecycle.focusOut(event),\n onPointerenter: (event: PointerEvent) => lifecycle.pointerEnter(event), onMouseenter: () => lifecycle.hover(true), onMousemove: () => lifecycle.hover(true), onMouseleave: () => lifecycle.hover(false),\n }, attrs), entries.map((entry, index) => h(ToastItem, { key: entry.toast.id, entry, lifecycle, options: props, index, count: entries.length, revision: version }, slots)))\n }))\n }\n },\n})\n"]}
1
+ {"version":3,"file":"ToastRenderer.js","sourceRoot":"","sources":["../../../../src/components/Toast/ToastRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAqD,MAAM,KAAK,CAAA;AAC1K,OAAO,EAAE,KAAK,EAAE,YAAY,EAA+C,MAAM,YAAY,CAAA;AAC7F,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC5E,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,YAAY,EAAE,cAAc,EAAkC,MAAM,qBAAqB,CAAA;AAGrI,MAAM,aAAa,GAAG,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAA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,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,CAAA;gBAC1K,CAAC,CAAC;aACH,CAAC,CAAA;QACJ,CAAC,CAAA;IACH,CAAC;CACF,CAAC,CAAA","sourcesContent":["import clsx from \"clsx\"\nimport { defineComponent, h, isVNode, mergeProps, onBeforeUnmount, onMounted, onUpdated, ref, toRaw, watch, type Component, type CSSProperties, type PropType } from \"vue\"\nimport { toast, useVueSonner, type Action, type ToastT, type ToasterProps } from \"vue-sonner\"\nimport { CheckCircle, InfoCircle, Warning, XCircle } from \"../Icon/index.js\"\nimport { announcerStyle, documentDirection, offsetStyles, ToastLifecycle, type Position, type ToastEntry } from \"./toastLifecycle.js\"\n\ntype Classes = NonNullable<NonNullable<ToasterProps[\"toastOptions\"]>[\"classes\"]>\nconst fallbackIcons = { success: CheckCircle, error: XCircle, warning: Warning, info: InfoCircle }\nconst CloseIcon = () => h(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", \"aria-hidden\": \"true\", width: 12, height: 12, viewBox: \"0 0 24 24\", fill: \"none\", stroke: \"currentColor\", \"stroke-width\": \"1.5\", \"stroke-linecap\": \"round\", \"stroke-linejoin\": \"round\" }, [h(\"line\", { x1: 18, y1: 6, x2: 6, y2: 18 }), h(\"line\", { x1: 6, y1: 6, x2: 18, y2: 18 })])\nconst actionObject = (value: Action | Component | undefined): value is Action => typeof value === \"object\" && value !== null && \"label\" in value\nconst content = (value: unknown, componentProps?: unknown) => {\n if (value === undefined || value === null || value === false) return undefined\n if (typeof value === \"string\" || typeof value === \"number\") return String(value)\n if (isVNode(value)) return value\n if (typeof value === \"object\" || typeof value === \"function\") return h(toRaw(value) as Component, typeof componentProps === \"object\" && componentProps !== null ? componentProps : {})\n return undefined\n}\n\nconst ToastItem = defineComponent({\n name: \"ToastItem\",\n props: {\n entry: { type: Object as PropType<ToastEntry<ToastT>>, required: true },\n lifecycle: { type: Object as PropType<ToastLifecycle<ToastT>>, required: true },\n options: { type: Object as PropType<ToasterProps>, required: true },\n index: { type: Number, required: true }, count: { type: Number, required: true }, revision: Number,\n },\n setup(props, { slots }) {\n const node = ref<HTMLElement | null>(null)\n let observer: ResizeObserver | null = null\n const measure = () => {\n const element = node.value\n if (!element) return\n const height = element.style.height\n element.style.height = \"auto\"\n props.lifecycle.measure(props.entry.toast.id, element.offsetHeight || element.getBoundingClientRect().height)\n element.style.height = height\n }\n const custom = () => Boolean(props.entry.toast.component)\n const alert = () => props.lifecycle.alertRole(props.entry, custom())\n // After every render: a new toast, or new words in one (a promise that settles), is read once\n const announce = () => { if (node.value) props.lifecycle.speak(props.entry.toast.id, node.value, custom()) }\n // A custom toast that changes its own words, without a new render here, is read again too\n let words: MutationObserver | null = null\n onMounted(() => {\n props.lifecycle.setNode(props.entry.toast.id, node.value)\n announce()\n measure()\n observer = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(measure) : null\n if (node.value) { observer?.observe(node.value); for (const child of node.value.children) observer?.observe(child) }\n words = typeof MutationObserver !== \"undefined\" ? new MutationObserver(announce) : null\n if (node.value) words?.observe(node.value, { childList: true, characterData: true, subtree: true })\n })\n onUpdated(() => { announce(); measure() })\n onBeforeUnmount(() => { observer?.disconnect(); words?.disconnect(); props.lifecycle.setNode(props.entry.toast.id, null) })\n return () => {\n const { entry, lifecycle, options, index, count } = props\n const item = entry.toast\n const slot = (name: keyof Classes) => clsx(options.toastOptions?.classes?.[name], item.classes?.[name])\n const [y, x] = lifecycle.position(entry).split(\"-\")\n const visible = index < (options.visibleToasts ?? 3)\n const disabled = item.dismissible === false || item.type === \"loading\"\n const type = item.type === \"normal\" || item.type === \"default\" ? undefined : item.type\n const icon = item.icon ?? (type && type in fallbackIcons ? options.icons?.[type as keyof typeof fallbackIcons] ?? fallbackIcons[type as keyof typeof fallbackIcons] : undefined)\n const actionButton = (kind: \"action\" | \"cancel\") => {\n const action = item[kind]\n if (!action) return null\n if (!actionObject(action)) return content(action)\n return h(\"button\", { type: \"button\", \"data-button\": \"true\", [`data-${kind}`]: \"true\", disabled: kind === \"cancel\" && disabled,\n class: slot(kind === \"action\" ? \"actionButton\" : \"cancelButton\"),\n style: kind === \"action\" ? item.actionButtonStyle ?? options.toastOptions?.actionButtonStyle : item.cancelButtonStyle ?? options.toastOptions?.cancelButtonStyle,\n onClick: (event: MouseEvent) => { if (kind === \"cancel\" && disabled) return; action.onClick(event); if (kind === \"cancel\" || !event.defaultPrevented) lifecycle.close(item.id, \"action\") },\n }, content(action.label))\n }\n const loader = () => h(\"div\", { class: clsx(\"sonner-loading-wrapper\", slot(\"loader\")), \"data-visible\": item.type === \"loading\" },\n slots[\"loading-icon\"] ? slots[\"loading-icon\"]() : options.icons?.loading ? h(\"div\", { class: \"sonner-loader\", \"data-visible\": item.type === \"loading\" }, content(options.icons.loading)) : h(\"div\", { class: \"sonner-spinner\" }, Array.from({ length: 12 }, (_, i) => h(\"div\", { key: i, class: \"sonner-loading-bar\" }))))\n return h(\"li\", {\n ref: node, tabindex: visible && !entry.removed ? 0 : -1, inert: !visible || entry.removed ? \"\" : undefined, \"aria-hidden\": !visible || entry.removed || undefined,\n class: clsx(options.toastOptions?.class, item.class, slot(\"toast\"), slot(\"default\"), type && slot(type as keyof Classes)),\n \"data-sonner-toast\": \"\", \"data-rich-colors\": item.richColors ?? options.richColors ?? undefined, \"data-styled\": !Boolean(item.component || item.unstyled || options.toastOptions?.unstyled),\n \"data-mounted\": entry.mounted, \"data-promise\": Boolean(item.promise), \"data-swiped\": Boolean(entry.x || entry.y), \"data-removed\": entry.removed,\n \"data-visible\": visible, \"data-y-position\": y, \"data-x-position\": x, \"data-index\": index, \"data-front\": index === 0, \"data-swiping\": entry.swiping,\n \"data-dismissible\": item.dismissible !== false, \"data-type\": type, \"data-invert\": item.invert || options.invert || undefined,\n \"data-swipe-out\": Boolean(entry.swipeOut), \"data-swipe-direction\": entry.swipeOut, \"data-expanded\": lifecycle.expanded || Boolean(options.expand && entry.mounted), \"data-testid\": item.testId,\n style: { \"--index\": index, \"--toasts-before\": index, \"--z-index\": count - index, \"--offset\": `${lifecycle.offset(entry)}px`, \"--initial-height\": options.expand ? \"auto\" : `${entry.height}px`, \"--swipe-amount-x\": `${entry.x}px`, \"--swipe-amount-y\": `${entry.y}px`, ...options.toastOptions?.style, ...item.style },\n onPointerdown: (event: PointerEvent) => lifecycle.pointerDown(item.id, event), onPointermove: (event: PointerEvent) => lifecycle.pointerMove(item.id, event),\n onPointerup: (event: PointerEvent) => lifecycle.pointerEnd(item.id, event), onPointercancel: (event: PointerEvent) => lifecycle.pointerEnd(item.id, event, true), onLostpointercapture: (event: PointerEvent) => lifecycle.pointerEnd(item.id, event, true),\n }, [\n (item.closeButton ?? options.toastOptions?.closeButton ?? options.closeButton) && !item.component && item.type !== \"loading\" ? h(\"button\", {\n type: \"button\", \"aria-label\": options.toastOptions?.closeButtonAriaLabel ?? \"Close toast\", \"data-disabled\": disabled, disabled, \"data-close-button\": \"true\", \"data-close-button-position\": item.closeButtonPosition ?? options.closeButtonPosition ?? \"top-left\", class: slot(\"closeButton\"),\n onClick: () => lifecycle.close(item.id, \"dismiss\"),\n }, options.icons?.close ? content(options.icons.close) : slots[\"close-icon\"]?.() ?? h(CloseIcon)) : null,\n item.component ? h(toRaw(item.component), { ...item.componentProps, onCloseToast: () => { if (!disabled) lifecycle.close(item.id, \"dismiss\") }, isPaused: lifecycle.paused }) : [\n (type || item.icon || item.promise) && item.icon !== null ? h(\"div\", { \"data-icon\": \"\", class: slot(\"icon\") }, [\n item.promise || item.type === \"loading\" ? item.icon ? content(item.icon) : loader() : null,\n item.type !== \"loading\" ? type && slots[`${type}-icon`] && !item.icon ? slots[`${type}-icon`]?.() : content(icon) : null,\n ]) : null,\n h(\"div\", { \"data-content\": \"\", role: alert() ? \"alert\" : undefined, class: slot(\"content\") }, [h(\"div\", { \"data-title\": \"\", class: slot(\"title\") }, content(item.title, item.componentProps)), item.description ? h(\"div\", { \"data-description\": \"\", class: clsx(options.toastOptions?.descriptionClass, slot(\"description\")) }, content(item.description, item.componentProps)) : null]),\n actionButton(\"cancel\"), actionButton(\"action\"),\n ],\n ])\n }\n },\n})\n\n/** Owns presentation/interaction only; vue-sonner remains the public toast store. */\nexport const ToastRenderer = defineComponent({\n name: \"ToastRenderer\", inheritAttrs: false,\n props: {\n id: String, position: String as PropType<ToasterProps[\"position\"]>, duration: Number, gap: Number, visibleToasts: Number,\n expand: { type: Boolean, default: undefined }, closeButton: { type: Boolean, default: undefined }, invert: { type: Boolean, default: undefined }, richColors: { type: Boolean, default: undefined },\n theme: String as PropType<ToasterProps[\"theme\"]>, hotkey: Array as PropType<string[]>, dir: String as PropType<ToasterProps[\"dir\"]>,\n swipeDirections: Array as PropType<ToasterProps[\"swipeDirections\"]>, icons: Object as PropType<ToasterProps[\"icons\"]>, containerAriaLabel: String,\n offset: [String, Number, Object] as PropType<ToasterProps[\"offset\"]>, mobileOffset: [String, Number, Object] as PropType<ToasterProps[\"mobileOffset\"]>,\n class: String, style: Object as PropType<CSSProperties>, toastOptions: Object as PropType<ToasterProps[\"toastOptions\"]>, closeButtonPosition: String as PropType<ToasterProps[\"closeButtonPosition\"]>,\n },\n setup(props, { attrs, slots }) {\n const { activeToasts } = useVueSonner()\n const revision = ref(0)\n const lifecycle = new ToastLifecycle<ToastT>(toast.dismiss, (reason, item) => reason === \"auto\" ? item.onAutoClose?.(item) : item.onDismiss?.(item))\n const unsubscribe = lifecycle.subscribe(() => { revision.value++ })\n const keydown = (event: KeyboardEvent) => lifecycle.keyDown(event, props.hotkey ?? [\"altKey\", \"KeyT\"])\n onMounted(() => { lifecycle.connect(document); document.addEventListener(\"keydown\", keydown) })\n onBeforeUnmount(() => { unsubscribe(); lifecycle.disconnect(); document.removeEventListener(\"keydown\", keydown) })\n watch(() => [activeToasts.value, props.id, props.position, props.duration, props.toastOptions?.duration, props.gap, props.visibleToasts, props.expand, props.swipeDirections], () => {\n lifecycle.sync(activeToasts.value, { id: props.id, position: props.position ?? \"bottom-right\", duration: props.toastOptions?.duration ?? props.duration ?? 4000, gap: props.gap ?? 14, visibleToasts: props.visibleToasts ?? 3, expand: props.expand, swipeDirections: props.swipeDirections })\n }, { immediate: true })\n return () => {\n const version = revision.value\n const hotkeyLabel = (props.hotkey ?? [\"altKey\", \"KeyT\"]).join(\"+\").replace(/Key|Digit/g, \"\")\n const positions = [...new Set(lifecycle.entries.map((entry) => lifecycle.position(entry)))]\n const dir = props.dir === \"auto\" || !props.dir ? documentDirection(typeof document === \"undefined\" ? undefined : document) : props.dir\n // aria-live=\"off\": not a live region itself (an announcer or an alert's role speaks, once), but a modal's\n // aria-hidden on everything else (Radix and Reka call aria-hidden's hideOthers) keeps any [aria-live]\n return h(\"section\", { ref: (node) => lifecycle.setRegion(node instanceof HTMLElement ? node : null), \"aria-label\": `${props.containerAriaLabel ?? \"Notifications\"} ${hotkeyLabel}`, tabindex: -1, \"aria-live\": \"off\" }, [\n h(\"div\", { key: \"polite\", ref: (node) => lifecycle.setAnnouncer(\"polite\", node instanceof HTMLElement ? node : null), role: \"status\", \"aria-live\": \"polite\", \"aria-atomic\": \"false\", \"data-toast-announcer\": \"polite\", style: announcerStyle }),\n h(\"div\", { key: \"assertive\", ref: (node) => lifecycle.setAnnouncer(\"assertive\", node instanceof HTMLElement ? node : null), role: \"alert\", \"aria-live\": \"assertive\", \"aria-atomic\": \"false\", \"data-toast-announcer\": \"assertive\", style: announcerStyle }),\n ...positions.map((position: Position) => {\n const entries = lifecycle.at(position)\n const [y, x] = position.split(\"-\")\n return h(\"ol\", mergeProps({ key: position, ref: (node) => lifecycle.setList(position, node instanceof HTMLElement ? node : null), dir, tabindex: -1, class: props.class,\n \"data-sonner-toaster\": \"true\", \"data-sonner-theme\": props.theme ?? \"light\", \"data-y-position\": y, \"data-x-position\": x,\n style: { \"--front-toast-height\": `${entries.find((entry) => !entry.removed)?.height ?? 0}px`, \"--width\": \"356px\", \"--gap\": `${props.gap ?? 14}px`, ...props.style, ...offsetStyles(props.offset, props.mobileOffset) },\n onFocusin: (event: FocusEvent) => lifecycle.focusIn(event), onFocusout: (event: FocusEvent) => lifecycle.focusOut(event),\n onPointerenter: (event: PointerEvent) => lifecycle.pointerEnter(event), onMouseenter: () => lifecycle.hover(true), onMousemove: () => lifecycle.hover(true), onMouseleave: () => lifecycle.hover(false),\n }, attrs), entries.map((entry, index) => h(ToastItem, { key: entry.toast.id, entry, lifecycle, options: props, index, count: entries.length, revision: version }, slots)))\n }),\n ])\n }\n },\n})\n"]}
@@ -19,13 +19,24 @@ export const compact = { class: s.Compact };
19
19
  const readTheme = () => document.documentElement.getAttribute("data-theme") === "dark" ? "dark" : "light";
20
20
  // Keep a gutter outside the safe area; explicit offsets override each supplied
21
21
  // edge, while omitted edges retain the safe default. Sonner applies these only
22
- // at its mobile breakpoint, so desktop positioning is unchanged.
22
+ // at its mobile breakpoint (600px), where a toast fills the width between the
23
+ // side gutters: 14, as the iOS 27 kit's notifications on a phone (Notification -
24
+ // Collapsed - List 135:73247, 374 of 402). A page moves the top and bottom edges
25
+ // with --toast-mobile-offset-top / -bottom (below its own top bar, say), and
26
+ // --toast-offset-top / -bottom above the breakpoint.
23
27
  const safeMobileOffset = {
24
- top: "calc(16px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)))",
25
- right: "calc(16px + var(--safe-area-inset-right, env(safe-area-inset-right, 0px)))",
26
- bottom: "calc(16px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)))",
27
- left: "calc(16px + var(--safe-area-inset-left, env(safe-area-inset-left, 0px)))",
28
+ top: "var(--toast-mobile-offset-top, calc(16px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px))))",
29
+ right: "calc(14px + var(--safe-area-inset-right, env(safe-area-inset-right, 0px)))",
30
+ bottom: "var(--toast-mobile-offset-bottom, calc(16px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))))",
31
+ left: "calc(14px + var(--safe-area-inset-left, env(safe-area-inset-left, 0px)))",
28
32
  };
33
+ const pageOffset = {
34
+ top: "var(--toast-offset-top, 32px)",
35
+ bottom: "var(--toast-offset-bottom, 32px)",
36
+ };
37
+ const resolveOffset = (offset) => typeof offset === "number" || typeof offset === "string"
38
+ ? offset
39
+ : { ...offset, top: offset?.top ?? pageOffset.top, bottom: offset?.bottom ?? pageOffset.bottom };
29
40
  const resolveMobileOffset = (offset) => typeof offset === "number" || typeof offset === "string"
30
41
  ? offset
31
42
  : {
@@ -143,7 +154,7 @@ const ToasterComponent = defineComponent({
143
154
  "theme": theme.value,
144
155
  "position": props.position,
145
156
  "duration": props.duration,
146
- "offset": props.offset,
157
+ "offset": resolveOffset(props.offset),
147
158
  "mobileOffset": resolveMobileOffset(props.mobileOffset),
148
159
  "gap": props.gap,
149
160
  "class": s.Toaster,
@@ -1 +1 @@
1
- {"version":3,"file":"Toaster.js","sourceRoot":"","sources":["../../../../src/components/Toast/Toaster.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,eAAe,EAAE,SAAS,EAAE,GAAG,EAAiC,MAAM,KAAK,CAAA;AACxG,OAAO,EAA2C,MAAM,YAAY,CAAA;AACpE,OAAO,EAAE,aAAa,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACnE,mFAAmF;AACnF,OAAO,sBAAsB,CAAA;AAC7B,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC5E,OAAO,CAAC,MAAM,kDAAkD,CAAA;AAEhE,8EAA8E;AAC9E,8EAA8E;AAC9E,6EAA6E;AAC7E,2EAA2E;AAC3E,4EAA4E;AAC5E,oDAAoD;AAEpD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CAAC,MAAM;gBACtB,cAAc,EAAE,mBAAmB,CAAC,KAAK,CAAC,YAAY,CAAC;gBACvD,KAAK,EAAE,KAAK,CAAC,GAAG;gBAChB,OAAO,EAAE,CAAC,CAAC,OAAO;gBAClB,OAAO,EAAE,YAAY;gBACrB,cAAc,EAAE,YAAY;gBAC5B,iEAAiE;gBACjE,qEAAqE;gBACrE,0EAA0E;gBAC1E,QAAQ,EAAE,IAAI;gBACd,YAAY,EAAE,IAAI;gBAClB,qEAAqE;gBACrE,sEAAsE;gBACtE,qEAAqE;gBACrE,qBAAqB,EAAE,MAAM;gBAC7B,YAAY,EAAE,SAAS;gBACvB,GAAG,KAAK;aACT,EACD,SAAS,CACV,CAAA;QACH,CAAC,CAAA;IACH,CAAC;CACF,CAAC,CAAA;AAWF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAkF,CAAA","sourcesContent":["import { defineComponent, h, onBeforeUnmount, onMounted, ref, type Component, type PropType } from \"vue\"\nimport { type ToasterProps as SonnerToasterProps } from \"vue-sonner\"\nimport { ToastRenderer as SonnerToaster } from \"./ToastRenderer.js\"\n// sonner (React) injects its stylesheet on import; vue-sonner 2 ships it as a file\nimport \"vue-sonner/style.css\"\nimport { CheckCircle, InfoCircle, Warning, XCircle } from \"../Icon/index.js\"\nimport s from \"@plexui/styles/components/Toast/Toast.module.css\"\n\n// Vue port of packages/ui/src/components/Toast/Toaster.tsx on vue-sonner, the\n// Vue port of sonner. vue-sonner names a few options differently from sonner:\n// `class` (sonner `className`), `classes` (`classNames`), `descriptionClass`\n// (`descriptionClassName`), and `toast.custom` takes a component. The type\n// icons are slots in vue-sonner (`icons` only feeds the close icon), so the\n// Plex icons and a caller's `icons` go in as slots.\n\n/**\n * Spread into any `toast(...)` options to get a shrink-to-fit, centered\n * layout: `toast(\"Saved\", compact)`, `toast.success(\"Done\", { ...compact, description })`.\n */\nexport const compact = { class: s.Compact } as const\n\ntype PlexTheme = \"light\" | \"dark\"\n\ntype ToastIcons = NonNullable<SonnerToasterProps[\"icons\"]>\n\nconst readTheme = (): PlexTheme =>\n document.documentElement.getAttribute(\"data-theme\") === \"dark\" ? \"dark\" : \"light\"\n\n// Keep a gutter outside the safe area; explicit offsets override each supplied\n// edge, while omitted edges retain the safe default. Sonner applies these only\n// at its mobile breakpoint, so desktop positioning is unchanged.\nconst safeMobileOffset = {\n top: \"calc(16px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)))\",\n right: \"calc(16px + var(--safe-area-inset-right, env(safe-area-inset-right, 0px)))\",\n bottom: \"calc(16px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)))\",\n left: \"calc(16px + var(--safe-area-inset-left, env(safe-area-inset-left, 0px)))\",\n}\n\nconst resolveMobileOffset = (offset: SonnerToasterProps[\"mobileOffset\"]) =>\n typeof offset === \"number\" || typeof offset === \"string\"\n ? offset\n : {\n top: offset?.top ?? safeMobileOffset.top,\n right: offset?.right ?? safeMobileOffset.right,\n bottom: offset?.bottom ?? safeMobileOffset.bottom,\n left: offset?.left ?? safeMobileOffset.left,\n }\n\n/* Maps PlexUI semantic tokens onto sonner's CSS-variable hooks. Sonner's own\n stylesheet reads these for every toast, so the base look stays aligned with\n <Popover> / <Menu> without overriding each slot. */\nconst toasterStyle = {\n \"--normal-bg\": \"var(--color-surface-elevated)\",\n \"--normal-text\": \"var(--color-text)\",\n \"--normal-border\": \"transparent\",\n \"--border-radius\": \"var(--radius-xl)\",\n \"--width\": \"400px\",\n}\n\nconst toastOptions = {\n classes: {\n toast: s.Toast,\n title: s.Title,\n description: s.Description,\n content: s.Content,\n icon: s.Icon,\n actionButton: s.ActionButton,\n cancelButton: s.CancelButton,\n success: s.Success,\n error: s.Error,\n warning: s.Warning,\n info: s.Info,\n },\n}\n\nconst PLEX_ICONS = {\n success: CheckCircle,\n error: XCircle,\n warning: Warning,\n info: InfoCircle,\n} as const\n\n// sonner's close icon. vue-sonner's own misspells `stroke-width` (`stoke-width`),\n// so its X draws at the default 1px instead of 1.5px.\nconst CloseIcon = () =>\n h(\n \"svg\",\n {\n \"xmlns\": \"http://www.w3.org/2000/svg\",\n \"aria-hidden\": \"true\",\n \"width\": \"12\",\n \"height\": \"12\",\n \"viewBox\": \"0 0 24 24\",\n \"fill\": \"none\",\n \"stroke\": \"currentColor\",\n \"stroke-width\": \"1.5\",\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n },\n [h(\"line\", { x1: \"18\", y1: \"6\", x2: \"6\", y2: \"18\" }), h(\"line\", { x1: \"6\", y1: \"6\", x2: \"18\", y2: \"18\" })],\n )\n\nconst ToasterComponent = defineComponent({\n name: \"Toaster\",\n inheritAttrs: false,\n props: {\n /** Where toasts anchor on the viewport. @default \"top-center\" */\n position: { type: String as PropType<SonnerToasterProps[\"position\"]>, default: \"top-center\" },\n /** Default auto-dismiss duration in ms. @default 3000 */\n duration: { type: Number, default: 3000 },\n /** Distance from the viewport edge */\n offset: [String, Number, Object] as PropType<SonnerToasterProps[\"offset\"]>,\n /** Mobile distance from each safe viewport edge; explicit values override the default. */\n mobileOffset: [String, Number, Object] as PropType<SonnerToasterProps[\"mobileOffset\"]>,\n /** Gap between stacked toasts in px */\n gap: Number,\n },\n setup(props, { attrs, slots }) {\n const theme = ref<PlexTheme>(\"light\")\n let observer: MutationObserver | null = null\n\n onMounted(() => {\n theme.value = readTheme()\n\n observer = new MutationObserver(() => {\n theme.value = readTheme()\n })\n\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: [\"data-theme\"],\n })\n })\n\n onBeforeUnmount(() => observer?.disconnect())\n\n // React passes `icons={{ success: <CheckCircle aria-hidden=\"true\" />, ... }}`,\n // which a caller's `icons` replaces as a whole (sonner's own icons then)\n const iconSlot = (type: keyof typeof PLEX_ICONS) => {\n const own = slots[`${type}-icon`]\n if (own) return own\n const userIcons = attrs.icons as ToastIcons | undefined\n if (userIcons) {\n const icon = userIcons[type]\n return icon ? () => h(icon as Component) : undefined\n }\n return () => h(PLEX_ICONS[type], { \"aria-hidden\": \"true\" })\n }\n\n return () => {\n const iconSlots: Record<string, () => unknown> = {}\n for (const type of Object.keys(PLEX_ICONS) as Array<keyof typeof PLEX_ICONS>) {\n const slot = iconSlot(type)\n if (slot) iconSlots[`${type}-icon`] = slot\n }\n // sonner wraps a custom `icons.loading` in its loader box (vue-sonner\n // ignores it); the slot renders only while the toast is loading\n const loadingIcon = (attrs.icons as ToastIcons | undefined)?.loading\n if (slots[\"loading-icon\"]) iconSlots[\"loading-icon\"] = slots[\"loading-icon\"]\n else if (loadingIcon) {\n iconSlots[\"loading-icon\"] = () => h(\"div\", { \"class\": \"sonner-loader\", \"data-visible\": \"true\" }, [h(loadingIcon)])\n }\n // vue-sonner prefers `icons.close` over this slot, as sonner does over its own icon\n iconSlots[\"close-icon\"] = slots[\"close-icon\"] ?? CloseIcon\n\n // vue-sonner's prop types reject `undefined`, which it treats as \"use the default\"\n return h(\n SonnerToaster as Component,\n {\n \"theme\": theme.value,\n \"position\": props.position,\n \"duration\": props.duration,\n \"offset\": props.offset,\n \"mobileOffset\": resolveMobileOffset(props.mobileOffset),\n \"gap\": props.gap,\n \"class\": s.Toaster,\n \"style\": toasterStyle,\n \"toastOptions\": toastOptions,\n // sonner leaves these unset, so React renders no `data-invert` /\n // `data-rich-colors`. vue-sonner defaults them to `false` and prints\n // \"false\"; `null` keeps the attributes off, as `undefined` does in React.\n \"invert\": null,\n \"richColors\": null,\n // vue-sonner binds `$attrs` last on its <ol>: React's sonner renders\n // `data-sonner-toaster=\"true\"` there and no `data-theme` (which would\n // also re-scope Plex's `:where([data-theme])` tokens at the toaster)\n \"data-sonner-toaster\": \"true\",\n \"data-theme\": undefined,\n ...attrs,\n },\n iconSlots,\n )\n }\n },\n})\n\ntype ToasterOwnProps = InstanceType<typeof ToasterComponent>[\"$props\"]\n\n/** Toaster props plus the vue-sonner `Toaster` props it forwards. */\nexport type ToasterProps = ToasterOwnProps &\n Omit<\n SonnerToasterProps,\n \"position\" | \"duration\" | \"closeButton\" | \"offset\" | \"mobileOffset\" | \"gap\" | \"theme\" | \"richColors\" | \"toastOptions\" | \"style\"\n >\n\n/**\n * Toast viewport. Every other vue-sonner `Toaster` prop (`expand`,\n * `visible-toasts`, `hotkey`, `dir`, `swipe-directions`, ...) is forwarded,\n * last, as React spreads `restProps`. Icon slots (`success-icon`, ...,\n * `close-icon`) replace the default icons.\n */\nexport const Toaster = ToasterComponent as typeof ToasterComponent & { new (): { $props: ToasterProps } }\n"]}
1
+ {"version":3,"file":"Toaster.js","sourceRoot":"","sources":["../../../../src/components/Toast/Toaster.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,eAAe,EAAE,SAAS,EAAE,GAAG,EAAiC,MAAM,KAAK,CAAA;AACxG,OAAO,EAA2C,MAAM,YAAY,CAAA;AACpE,OAAO,EAAE,aAAa,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACnE,mFAAmF;AACnF,OAAO,sBAAsB,CAAA;AAC7B,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC5E,OAAO,CAAC,MAAM,kDAAkD,CAAA;AAEhE,8EAA8E;AAC9E,8EAA8E;AAC9E,6EAA6E;AAC7E,2EAA2E;AAC3E,4EAA4E;AAC5E,oDAAoD;AAEpD;;;GAGG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC,OAAO,EAAW,CAAA;AAMpD,MAAM,SAAS,GAAG,GAAc,EAAE,CAChC,QAAQ,CAAC,eAAe,CAAC,YAAY,CAAC,YAAY,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAA;AAEnF,+EAA+E;AAC/E,+EAA+E;AAC/E,8EAA8E;AAC9E,iFAAiF;AACjF,iFAAiF;AACjF,6EAA6E;AAC7E,qDAAqD;AACrD,MAAM,gBAAg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AC,QAAQ;gBAC1B,UAAU,EAAE,KAAK,CAAC,QAAQ;gBAC1B,QAAQ,EAAE,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC;gBACrC,cAAc,EAAE,mBAAmB,CAAC,KAAK,CAAC,YAAY,CAAC;gBACvD,KAAK,EAAE,KAAK,CAAC,GAAG;gBAChB,OAAO,EAAE,CAAC,CAAC,OAAO;gBAClB,OAAO,EAAE,YAAY;gBACrB,cAAc,EAAE,YAAY;gBAC5B,iEAAiE;gBACjE,qEAAqE;gBACrE,0EAA0E;gBAC1E,QAAQ,EAAE,IAAI;gBACd,YAAY,EAAE,IAAI;gBAClB,qEAAqE;gBACrE,sEAAsE;gBACtE,qEAAqE;gBACrE,qBAAqB,EAAE,MAAM;gBAC7B,YAAY,EAAE,SAAS;gBACvB,GAAG,KAAK;aACT,EACD,SAAS,CACV,CAAA;QACH,CAAC,CAAA;IACH,CAAC;CACF,CAAC,CAAA;AAWF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAkF,CAAA","sourcesContent":["import { defineComponent, h, onBeforeUnmount, onMounted, ref, type Component, type PropType } from \"vue\"\nimport { type ToasterProps as SonnerToasterProps } from \"vue-sonner\"\nimport { ToastRenderer as SonnerToaster } from \"./ToastRenderer.js\"\n// sonner (React) injects its stylesheet on import; vue-sonner 2 ships it as a file\nimport \"vue-sonner/style.css\"\nimport { CheckCircle, InfoCircle, Warning, XCircle } from \"../Icon/index.js\"\nimport s from \"@plexui/styles/components/Toast/Toast.module.css\"\n\n// Vue port of packages/ui/src/components/Toast/Toaster.tsx on vue-sonner, the\n// Vue port of sonner. vue-sonner names a few options differently from sonner:\n// `class` (sonner `className`), `classes` (`classNames`), `descriptionClass`\n// (`descriptionClassName`), and `toast.custom` takes a component. The type\n// icons are slots in vue-sonner (`icons` only feeds the close icon), so the\n// Plex icons and a caller's `icons` go in as slots.\n\n/**\n * Spread into any `toast(...)` options to get a shrink-to-fit, centered\n * layout: `toast(\"Saved\", compact)`, `toast.success(\"Done\", { ...compact, description })`.\n */\nexport const compact = { class: s.Compact } as const\n\ntype PlexTheme = \"light\" | \"dark\"\n\ntype ToastIcons = NonNullable<SonnerToasterProps[\"icons\"]>\n\nconst readTheme = (): PlexTheme =>\n document.documentElement.getAttribute(\"data-theme\") === \"dark\" ? \"dark\" : \"light\"\n\n// Keep a gutter outside the safe area; explicit offsets override each supplied\n// edge, while omitted edges retain the safe default. Sonner applies these only\n// at its mobile breakpoint (600px), where a toast fills the width between the\n// side gutters: 14, as the iOS 27 kit's notifications on a phone (Notification -\n// Collapsed - List 135:73247, 374 of 402). A page moves the top and bottom edges\n// with --toast-mobile-offset-top / -bottom (below its own top bar, say), and\n// --toast-offset-top / -bottom above the breakpoint.\nconst safeMobileOffset = {\n top: \"var(--toast-mobile-offset-top, calc(16px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px))))\",\n right: \"calc(14px + var(--safe-area-inset-right, env(safe-area-inset-right, 0px)))\",\n bottom: \"var(--toast-mobile-offset-bottom, calc(16px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))))\",\n left: \"calc(14px + var(--safe-area-inset-left, env(safe-area-inset-left, 0px)))\",\n}\n\nconst pageOffset = {\n top: \"var(--toast-offset-top, 32px)\",\n bottom: \"var(--toast-offset-bottom, 32px)\",\n}\n\nconst resolveOffset = (offset: SonnerToasterProps[\"offset\"]) =>\n typeof offset === \"number\" || typeof offset === \"string\"\n ? offset\n : { ...offset, top: offset?.top ?? pageOffset.top, bottom: offset?.bottom ?? pageOffset.bottom }\n\nconst resolveMobileOffset = (offset: SonnerToasterProps[\"mobileOffset\"]) =>\n typeof offset === \"number\" || typeof offset === \"string\"\n ? offset\n : {\n top: offset?.top ?? safeMobileOffset.top,\n right: offset?.right ?? safeMobileOffset.right,\n bottom: offset?.bottom ?? safeMobileOffset.bottom,\n left: offset?.left ?? safeMobileOffset.left,\n }\n\n/* Maps PlexUI semantic tokens onto sonner's CSS-variable hooks. Sonner's own\n stylesheet reads these for every toast, so the base look stays aligned with\n <Popover> / <Menu> without overriding each slot. */\nconst toasterStyle = {\n \"--normal-bg\": \"var(--color-surface-elevated)\",\n \"--normal-text\": \"var(--color-text)\",\n \"--normal-border\": \"transparent\",\n \"--border-radius\": \"var(--radius-xl)\",\n \"--width\": \"400px\",\n}\n\nconst toastOptions = {\n classes: {\n toast: s.Toast,\n title: s.Title,\n description: s.Description,\n content: s.Content,\n icon: s.Icon,\n actionButton: s.ActionButton,\n cancelButton: s.CancelButton,\n success: s.Success,\n error: s.Error,\n warning: s.Warning,\n info: s.Info,\n },\n}\n\nconst PLEX_ICONS = {\n success: CheckCircle,\n error: XCircle,\n warning: Warning,\n info: InfoCircle,\n} as const\n\n// sonner's close icon. vue-sonner's own misspells `stroke-width` (`stoke-width`),\n// so its X draws at the default 1px instead of 1.5px.\nconst CloseIcon = () =>\n h(\n \"svg\",\n {\n \"xmlns\": \"http://www.w3.org/2000/svg\",\n \"aria-hidden\": \"true\",\n \"width\": \"12\",\n \"height\": \"12\",\n \"viewBox\": \"0 0 24 24\",\n \"fill\": \"none\",\n \"stroke\": \"currentColor\",\n \"stroke-width\": \"1.5\",\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n },\n [h(\"line\", { x1: \"18\", y1: \"6\", x2: \"6\", y2: \"18\" }), h(\"line\", { x1: \"6\", y1: \"6\", x2: \"18\", y2: \"18\" })],\n )\n\nconst ToasterComponent = defineComponent({\n name: \"Toaster\",\n inheritAttrs: false,\n props: {\n /** Where toasts anchor on the viewport. @default \"top-center\" */\n position: { type: String as PropType<SonnerToasterProps[\"position\"]>, default: \"top-center\" },\n /** Default auto-dismiss duration in ms. @default 3000 */\n duration: { type: Number, default: 3000 },\n /** Distance from the viewport edge */\n offset: [String, Number, Object] as PropType<SonnerToasterProps[\"offset\"]>,\n /** Mobile distance from each safe viewport edge; explicit values override the default. */\n mobileOffset: [String, Number, Object] as PropType<SonnerToasterProps[\"mobileOffset\"]>,\n /** Gap between stacked toasts in px */\n gap: Number,\n },\n setup(props, { attrs, slots }) {\n const theme = ref<PlexTheme>(\"light\")\n let observer: MutationObserver | null = null\n\n onMounted(() => {\n theme.value = readTheme()\n\n observer = new MutationObserver(() => {\n theme.value = readTheme()\n })\n\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: [\"data-theme\"],\n })\n })\n\n onBeforeUnmount(() => observer?.disconnect())\n\n // React passes `icons={{ success: <CheckCircle aria-hidden=\"true\" />, ... }}`,\n // which a caller's `icons` replaces as a whole (sonner's own icons then)\n const iconSlot = (type: keyof typeof PLEX_ICONS) => {\n const own = slots[`${type}-icon`]\n if (own) return own\n const userIcons = attrs.icons as ToastIcons | undefined\n if (userIcons) {\n const icon = userIcons[type]\n return icon ? () => h(icon as Component) : undefined\n }\n return () => h(PLEX_ICONS[type], { \"aria-hidden\": \"true\" })\n }\n\n return () => {\n const iconSlots: Record<string, () => unknown> = {}\n for (const type of Object.keys(PLEX_ICONS) as Array<keyof typeof PLEX_ICONS>) {\n const slot = iconSlot(type)\n if (slot) iconSlots[`${type}-icon`] = slot\n }\n // sonner wraps a custom `icons.loading` in its loader box (vue-sonner\n // ignores it); the slot renders only while the toast is loading\n const loadingIcon = (attrs.icons as ToastIcons | undefined)?.loading\n if (slots[\"loading-icon\"]) iconSlots[\"loading-icon\"] = slots[\"loading-icon\"]\n else if (loadingIcon) {\n iconSlots[\"loading-icon\"] = () => h(\"div\", { \"class\": \"sonner-loader\", \"data-visible\": \"true\" }, [h(loadingIcon)])\n }\n // vue-sonner prefers `icons.close` over this slot, as sonner does over its own icon\n iconSlots[\"close-icon\"] = slots[\"close-icon\"] ?? CloseIcon\n\n // vue-sonner's prop types reject `undefined`, which it treats as \"use the default\"\n return h(\n SonnerToaster as Component,\n {\n \"theme\": theme.value,\n \"position\": props.position,\n \"duration\": props.duration,\n \"offset\": resolveOffset(props.offset),\n \"mobileOffset\": resolveMobileOffset(props.mobileOffset),\n \"gap\": props.gap,\n \"class\": s.Toaster,\n \"style\": toasterStyle,\n \"toastOptions\": toastOptions,\n // sonner leaves these unset, so React renders no `data-invert` /\n // `data-rich-colors`. vue-sonner defaults them to `false` and prints\n // \"false\"; `null` keeps the attributes off, as `undefined` does in React.\n \"invert\": null,\n \"richColors\": null,\n // vue-sonner binds `$attrs` last on its <ol>: React's sonner renders\n // `data-sonner-toaster=\"true\"` there and no `data-theme` (which would\n // also re-scope Plex's `:where([data-theme])` tokens at the toaster)\n \"data-sonner-toaster\": \"true\",\n \"data-theme\": undefined,\n ...attrs,\n },\n iconSlots,\n )\n }\n },\n})\n\ntype ToasterOwnProps = InstanceType<typeof ToasterComponent>[\"$props\"]\n\n/** Toaster props plus the vue-sonner `Toaster` props it forwards. */\nexport type ToasterProps = ToasterOwnProps &\n Omit<\n SonnerToasterProps,\n \"position\" | \"duration\" | \"closeButton\" | \"offset\" | \"mobileOffset\" | \"gap\" | \"theme\" | \"richColors\" | \"toastOptions\" | \"style\"\n >\n\n/**\n * Toast viewport. Every other vue-sonner `Toaster` prop (`expand`,\n * `visible-toasts`, `hotkey`, `dir`, `swipe-directions`, ...) is forwarded,\n * last, as React spreads `restProps`. Icon slots (`success-icon`, ...,\n * `close-icon`) replace the default icons.\n */\nexport const Toaster = ToasterComponent as typeof ToasterComponent & { new (): { $props: ToasterProps } }\n"]}
@@ -1,4 +1,6 @@
1
1
  const EXIT_DURATION = 200;
2
+ /** How long an announced line stays in the polite region before it leaves the DOM */
3
+ const ANNOUNCE_DURATION = 7000;
2
4
  export class ToastLifecycle {
3
5
  dismissStore;
4
6
  notify;
@@ -16,6 +18,14 @@ export class ToastLifecycle {
16
18
  lists = new Map();
17
19
  suppressed = new Map();
18
20
  lastPointerType = "";
21
+ region = null;
22
+ announcers = { polite: null, assertive: null };
23
+ announced = new Map();
24
+ /** Alerts read by the assertive announcer: shown behind the stack, their own role could not speak */
25
+ assertive = new Set();
26
+ announceTimers = new Set();
27
+ pending = new Map();
28
+ flushTimer;
19
29
  constructor(dismissStore, notify) {
20
30
  this.dismissStore = dismissStore;
21
31
  this.notify = notify;
@@ -25,10 +35,95 @@ export class ToastLifecycle {
25
35
  emit() { this.revision++; this.listeners.forEach((listener) => listener()); }
26
36
  get expanded() { return this.hovered || this.focused; }
27
37
  get paused() { return this.expanded || Boolean(this.gesture) || this.hidden; }
28
- connect(doc) { this.doc = doc; this.hidden = doc.hidden; doc.addEventListener("visibilitychange", this.visibility); this.refreshTimers(); }
38
+ connect(doc) {
39
+ this.doc = doc;
40
+ this.hidden = doc.hidden;
41
+ doc.addEventListener("visibilitychange", this.visibility);
42
+ for (const type of ISOLATED_EVENTS)
43
+ doc.addEventListener(type, this.isolate);
44
+ this.refreshTimers();
45
+ }
29
46
  visibility = () => { this.hidden = Boolean(this.doc?.hidden); this.refreshTimers(); this.emit(); };
47
+ /* The region is a layer of its own, above any modal. A modal layer (Radix, Reka) listens on the
48
+ document for focus and presses outside it: it would pull focus back out of a toast and close
49
+ on a press of its close or action. This listener, added when the Toaster mounts and so before a
50
+ Dialog opens, runs after the framework's own (React delegates to its root, Vue binds to the
51
+ element) and stops the ones added after it, only while a modal layer has turned the page's
52
+ pointer events off: then nothing under the toast should hear it. Without a modal, a Popover a
53
+ custom toast opened still hears a press elsewhere in the toast. */
54
+ isolate = (event) => {
55
+ const region = this.region;
56
+ if (!region || this.doc?.body.style.pointerEvents !== "none")
57
+ return;
58
+ const related = event.type === "focusout" ? event.relatedTarget : null;
59
+ if (event.target instanceof Node && region.contains(event.target) || related instanceof Node && region.contains(related))
60
+ event.stopImmediatePropagation();
61
+ };
62
+ setRegion(node) { this.region = node; }
63
+ setAnnouncer(kind, node) { this.announcers[kind] = node; }
64
+ /** An error that waits to be closed interrupts as an alert; every other toast is read politely. */
65
+ alert(entry) { return entry.toast.type === "error" && (entry.toast.duration || this.config.duration) === Infinity; }
66
+ /** Whether a toast's content carries role="alert": an alert, unless it came in behind the stack and the assertive announcer read it. */
67
+ alertRole(entry, custom) { return !custom && this.alert(entry) && !this.assertive.has(entry.toast.id); }
68
+ visible(entry) { return this.at(this.position(entry)).indexOf(entry) < this.config.visibleToasts; }
69
+ /** Reads a toast's words once, and again only when they change (a promise that settles, a custom toast's own state). */
70
+ speak(id, node, custom) {
71
+ const entry = this.entries.find((item) => item.toast.id === id);
72
+ if (!entry || entry.removed)
73
+ return;
74
+ const text = toastText(node);
75
+ const alert = this.alert(entry) && !custom;
76
+ // An alert speaks at once, never also politely: words still waiting to be read politely are read as the alert
77
+ if (alert && this.pending.get(id)?.assertive === false) {
78
+ this.pending.delete(id);
79
+ this.announced.delete(id);
80
+ }
81
+ if (!text || this.announced.get(id) === text)
82
+ return;
83
+ this.announced.set(id, text);
84
+ // A shown alert reads itself by its role; one that came in behind the stack (inert, aria-hidden) cannot
85
+ if (alert && this.visible(entry) && !this.assertive.has(id))
86
+ return;
87
+ this.pending.set(id, { text, assertive: alert });
88
+ // Its content then drops role="alert", so it does not speak again once the stack brings it forward
89
+ if (alert && !this.assertive.has(id)) {
90
+ this.assertive.add(id);
91
+ this.emit();
92
+ }
93
+ // Toasts shown together are read together, the oldest first, whichever framework renders them first
94
+ if (this.flushTimer === undefined)
95
+ this.flushTimer = setTimeout(this.flush, 0);
96
+ }
97
+ flush = () => {
98
+ this.flushTimer = undefined;
99
+ const order = this.entries.map((entry) => entry.toast.id).reverse();
100
+ const lines = [...this.pending].sort(([a], [b]) => order.indexOf(a) - order.indexOf(b));
101
+ this.pending.clear();
102
+ for (const [, { text, assertive }] of lines) {
103
+ const node = this.announcers[assertive ? "assertive" : "polite"];
104
+ if (!node)
105
+ continue;
106
+ const line = node.ownerDocument.createElement("div");
107
+ line.textContent = text;
108
+ node.append(line);
109
+ const timer = setTimeout(() => { line.remove(); this.announceTimers.delete(timer); }, ANNOUNCE_DURATION);
110
+ this.announceTimers.add(timer);
111
+ }
112
+ };
30
113
  disconnect() {
31
114
  this.doc?.removeEventListener("visibilitychange", this.visibility);
115
+ for (const type of ISOLATED_EVENTS)
116
+ this.doc?.removeEventListener(type, this.isolate);
117
+ for (const timer of this.announceTimers)
118
+ clearTimeout(timer);
119
+ clearTimeout(this.flushTimer);
120
+ this.flushTimer = undefined;
121
+ this.announceTimers.clear();
122
+ this.announced.clear();
123
+ this.assertive.clear();
124
+ this.pending.clear();
125
+ this.announcers.polite?.replaceChildren();
126
+ this.announcers.assertive?.replaceChildren();
32
127
  for (const entry of this.entries) {
33
128
  clearTimeout(entry.timer);
34
129
  clearTimeout(entry.exitTimer);
@@ -141,6 +236,9 @@ export class ToastLifecycle {
141
236
  return;
142
237
  entry.exitOffset = this.offset(entry);
143
238
  entry.removed = true;
239
+ this.announced.delete(id);
240
+ this.assertive.delete(id);
241
+ this.pending.delete(id);
144
242
  entry.detached = reason === "detach";
145
243
  this.pause(entry);
146
244
  if (this.gesture?.id === id)
@@ -264,6 +362,20 @@ export class ToastLifecycle {
264
362
  this.emit();
265
363
  }
266
364
  }
365
+ const ISOLATED_EVENTS = ["focusin", "focusout", "pointerdown"];
366
+ /** The words a toast says: its title and description, or a custom toast's text. */
367
+ export const toastText = (node) => {
368
+ const words = (element) => element?.textContent?.replace(/\s+/g, " ").trim() ?? "";
369
+ if (!node.querySelector("[data-content]"))
370
+ return words(node);
371
+ const title = words(node.querySelector("[data-title]"));
372
+ const description = words(node.querySelector("[data-description]"));
373
+ if (!title || !description)
374
+ return title || description;
375
+ return `${/[.!?…:;。!?]$/u.test(title) ? title : `${title}.`} ${description}`;
376
+ };
377
+ /** Hides the polite announcer from sight, not from a screen reader. */
378
+ export const announcerStyle = { position: "absolute", width: "1px", height: "1px", margin: "-1px", padding: "0", overflow: "hidden", clip: "rect(0 0 0 0)", clipPath: "inset(50%)", whiteSpace: "nowrap", border: "0" };
267
379
  export const offsetStyles = (offset, mobileOffset) => {
268
380
  const style = {};
269
381
  for (const [prefix, value, fallback] of [["--offset", offset, "32px"], ["--mobile-offset", mobileOffset, "16px"]]) {