@wow-two-beta/fe 0.0.49 → 0.0.51

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 (195) hide show
  1. package/dist/feedback/FeedbackBus.d.ts +154 -29
  2. package/dist/feedback/FeedbackBus.js +264 -27
  3. package/dist/feedback/FeedbackBus.js.map +1 -1
  4. package/dist/feedback/index.d.ts +1 -1
  5. package/dist/feedback/index.js +3 -1
  6. package/dist/foundation/dom/enums/ElementTag.d.ts +2 -0
  7. package/dist/foundation/dom/enums/ElementTag.js +3 -1
  8. package/dist/foundation/dom/enums/ElementTag.js.map +1 -1
  9. package/dist/index.js +404 -382
  10. package/dist/index.js.map +1 -1
  11. package/dist/presentation/actions/button/Button.variants.d.ts +12 -0
  12. package/dist/presentation/actions/button/Button.variants.js +18 -2
  13. package/dist/presentation/actions/button/Button.variants.js.map +1 -1
  14. package/dist/presentation/actions/button/Button.vue.d.ts +8 -1
  15. package/dist/presentation/actions/button/Button.vue.js +106 -58
  16. package/dist/presentation/actions/button/Button.vue.js.map +1 -1
  17. package/dist/presentation/actions/refreshButton/RefreshButton.vue.js.map +1 -1
  18. package/dist/presentation/display/badge/Badge.variants.d.ts +23 -1
  19. package/dist/presentation/display/badge/Badge.variants.js +18 -3
  20. package/dist/presentation/display/badge/Badge.variants.js.map +1 -1
  21. package/dist/presentation/display/badge/Badge.vue.d.ts +3 -0
  22. package/dist/presentation/display/badge/Badge.vue.js +10 -4
  23. package/dist/presentation/display/badge/Badge.vue.js.map +1 -1
  24. package/dist/presentation/display/carousel/Carousel.variants.d.ts +65 -0
  25. package/dist/presentation/display/carousel/Carousel.variants.js +56 -0
  26. package/dist/presentation/display/carousel/Carousel.variants.js.map +1 -0
  27. package/dist/presentation/display/carousel/Carousel.vue.d.ts +7 -0
  28. package/dist/presentation/display/carousel/Carousel.vue.js +7 -2
  29. package/dist/presentation/display/carousel/Carousel.vue.js.map +1 -1
  30. package/dist/presentation/display/carousel/CarouselContext.d.ts +10 -0
  31. package/dist/presentation/display/carousel/CarouselContext.js.map +1 -1
  32. package/dist/presentation/display/carousel/CarouselNext.vue.d.ts +6 -2
  33. package/dist/presentation/display/carousel/CarouselNext.vue.js +12 -4
  34. package/dist/presentation/display/carousel/CarouselNext.vue.js.map +1 -1
  35. package/dist/presentation/display/carousel/CarouselPrev.vue.d.ts +6 -2
  36. package/dist/presentation/display/carousel/CarouselPrev.vue.js +12 -4
  37. package/dist/presentation/display/carousel/CarouselPrev.vue.js.map +1 -1
  38. package/dist/presentation/display/carousel/CarouselViewport.vue.d.ts +13 -2
  39. package/dist/presentation/display/carousel/CarouselViewport.vue.js +54 -2
  40. package/dist/presentation/display/carousel/CarouselViewport.vue.js.map +1 -1
  41. package/dist/presentation/display/carousel/index.d.ts +1 -0
  42. package/dist/presentation/display/index.d.ts +1 -0
  43. package/dist/presentation/display/index.js +120 -108
  44. package/dist/presentation/display/index.js.map +1 -1
  45. package/dist/presentation/display/mediaCard/MediaCard.vue.d.ts +41 -0
  46. package/dist/presentation/display/mediaCard/MediaCard.vue.js +108 -0
  47. package/dist/presentation/display/mediaCard/MediaCard.vue.js.map +1 -0
  48. package/dist/presentation/display/mediaCard/MediaCard2.vue.js +5 -0
  49. package/dist/presentation/display/mediaCard/MediaCard2.vue.js.map +1 -0
  50. package/dist/presentation/display/mediaCard/index.d.ts +1 -0
  51. package/dist/presentation/display/metaInlineText/MetaInlineItem.vue.d.ts +37 -0
  52. package/dist/presentation/display/metaInlineText/MetaInlineItem.vue.js +72 -0
  53. package/dist/presentation/display/metaInlineText/MetaInlineItem.vue.js.map +1 -0
  54. package/dist/presentation/display/metaInlineText/MetaInlineItem2.vue.js +7 -0
  55. package/dist/presentation/display/metaInlineText/MetaInlineItem2.vue.js.map +1 -0
  56. package/dist/presentation/display/metaInlineText/index.d.ts +1 -0
  57. package/dist/presentation/display/notificationCenterGroup/NotificationCenterButton.vue.d.ts +18 -0
  58. package/dist/presentation/display/notificationCenterGroup/NotificationCenterButton.vue.js +120 -0
  59. package/dist/presentation/display/notificationCenterGroup/NotificationCenterButton.vue.js.map +1 -0
  60. package/dist/presentation/display/notificationCenterGroup/NotificationCenterButton2.vue.js +5 -0
  61. package/dist/presentation/display/notificationCenterGroup/NotificationCenterButton2.vue.js.map +1 -0
  62. package/dist/presentation/display/notificationCenterGroup/NotificationCenterGroup.vue.d.ts +11 -6
  63. package/dist/presentation/display/notificationCenterGroup/NotificationCenterGroup.vue.js +255 -61
  64. package/dist/presentation/display/notificationCenterGroup/NotificationCenterGroup.vue.js.map +1 -1
  65. package/dist/presentation/display/notificationCenterGroup/{NotificationItem.vue.d.ts → NotificationCenterGroupItem.vue.d.ts} +13 -12
  66. package/dist/presentation/display/notificationCenterGroup/{NotificationItem.vue.js → NotificationCenterGroupItem.vue.js} +81 -58
  67. package/dist/presentation/display/notificationCenterGroup/NotificationCenterGroupItem.vue.js.map +1 -0
  68. package/dist/presentation/display/notificationCenterGroup/NotificationCenterGroupItem2.vue.js +5 -0
  69. package/dist/presentation/display/notificationCenterGroup/NotificationCenterGroupItem2.vue.js.map +1 -0
  70. package/dist/presentation/display/notificationCenterGroup/index.d.ts +6 -1
  71. package/dist/presentation/feedback/feedbackToastHost/FeedbackToastHost.vue.d.ts +1 -9
  72. package/dist/presentation/feedback/feedbackToastHost/FeedbackToastHost.vue.js +165 -20
  73. package/dist/presentation/feedback/feedbackToastHost/FeedbackToastHost.vue.js.map +1 -1
  74. package/dist/presentation/feedback/feedbackToastHost/RemindLaterButton.vue.d.ts +7 -0
  75. package/dist/presentation/feedback/feedbackToastHost/RemindLaterButton.vue.js +56 -0
  76. package/dist/presentation/feedback/feedbackToastHost/RemindLaterButton.vue.js.map +1 -0
  77. package/dist/presentation/feedback/feedbackToastHost/RemindLaterButton2.vue.js +5 -0
  78. package/dist/presentation/feedback/feedbackToastHost/RemindLaterButton2.vue.js.map +1 -0
  79. package/dist/presentation/feedback/index.js +9 -1
  80. package/dist/presentation/feedback/index.js.map +1 -1
  81. package/dist/presentation/feedback/toast/Toast.vue.d.ts +34 -8
  82. package/dist/presentation/feedback/toast/Toast.vue.js +290 -85
  83. package/dist/presentation/feedback/toast/Toast.vue.js.map +1 -1
  84. package/dist/presentation/feedback/toast/ToastContent.vue.d.ts +25 -0
  85. package/dist/presentation/feedback/toast/ToastContent.vue.js +78 -0
  86. package/dist/presentation/feedback/toast/ToastContent.vue.js.map +1 -0
  87. package/dist/presentation/feedback/toast/ToastContent2.vue.js +5 -0
  88. package/dist/presentation/feedback/toast/ToastContent2.vue.js.map +1 -0
  89. package/dist/presentation/feedback/toast/ToastRunningProgress.vue.d.ts +15 -0
  90. package/dist/presentation/feedback/toast/ToastRunningProgress.vue.js +88 -0
  91. package/dist/presentation/feedback/toast/ToastRunningProgress.vue.js.map +1 -0
  92. package/dist/presentation/feedback/toast/ToastRunningProgress2.vue.js +5 -0
  93. package/dist/presentation/feedback/toast/ToastRunningProgress2.vue.js.map +1 -0
  94. package/dist/presentation/feedback/toast/ToastSurface.d.ts +8 -0
  95. package/dist/presentation/feedback/toast/ToastSurface.js +10 -0
  96. package/dist/presentation/feedback/toast/ToastSurface.js.map +1 -0
  97. package/dist/presentation/feedback/toast/index.d.ts +1 -0
  98. package/dist/presentation/feedback/toastHost/ToastContent.d.ts +3 -0
  99. package/dist/presentation/feedback/toastHost/ToastEntry.d.ts +12 -0
  100. package/dist/presentation/feedback/toastHost/ToastFocusExtensions.d.ts +2 -0
  101. package/dist/presentation/feedback/toastHost/ToastFocusExtensions.js +11 -0
  102. package/dist/presentation/feedback/toastHost/ToastFocusExtensions.js.map +1 -0
  103. package/dist/presentation/feedback/toastHost/ToastGroup.d.ts +8 -0
  104. package/dist/presentation/feedback/toastHost/ToastGroupLatest.d.ts +10 -0
  105. package/dist/presentation/feedback/toastHost/ToastHost.vue.d.ts +55 -110
  106. package/dist/presentation/feedback/toastHost/ToastHost.vue.js +394 -399
  107. package/dist/presentation/feedback/toastHost/ToastHost.vue.js.map +1 -1
  108. package/dist/presentation/feedback/toastHost/ToastHost2.vue.js +4 -5
  109. package/dist/presentation/feedback/toastHost/ToastHostStore.d.ts +37 -0
  110. package/dist/presentation/feedback/toastHost/ToastHostStore.js +98 -0
  111. package/dist/presentation/feedback/toastHost/ToastHostStore.js.map +1 -0
  112. package/dist/presentation/feedback/toastHost/ToastHostStyles.d.ts +34 -0
  113. package/dist/presentation/feedback/toastHost/ToastHostStyles.js +44 -0
  114. package/dist/presentation/feedback/toastHost/ToastHostStyles.js.map +1 -0
  115. package/dist/presentation/feedback/toastHost/ToastNode.d.ts +3 -0
  116. package/dist/presentation/feedback/toastHost/ToastOptions.d.ts +72 -0
  117. package/dist/presentation/feedback/toastHost/ToastProgress.vue.d.ts +11 -0
  118. package/dist/presentation/feedback/toastHost/ToastProgress.vue.js +44 -0
  119. package/dist/presentation/feedback/toastHost/ToastProgress.vue.js.map +1 -0
  120. package/dist/presentation/feedback/toastHost/ToastProgress2.vue.js +5 -0
  121. package/dist/presentation/feedback/toastHost/ToastProgress2.vue.js.map +1 -0
  122. package/dist/presentation/feedback/toastHost/ToastPromiseOptions.d.ts +12 -0
  123. package/dist/presentation/feedback/toastHost/ToastRing.vue.d.ts +14 -0
  124. package/dist/presentation/feedback/toastHost/ToastRing.vue.js +65 -0
  125. package/dist/presentation/feedback/toastHost/ToastRing.vue.js.map +1 -0
  126. package/dist/presentation/feedback/toastHost/ToastRing2.vue.js +5 -0
  127. package/dist/presentation/feedback/toastHost/ToastRing2.vue.js.map +1 -0
  128. package/dist/presentation/feedback/toastHost/ToastSeconds.vue.d.ts +9 -0
  129. package/dist/presentation/feedback/toastHost/ToastSeconds.vue.js +56 -0
  130. package/dist/presentation/feedback/toastHost/ToastSeconds.vue.js.map +1 -0
  131. package/dist/presentation/feedback/toastHost/ToastSeconds2.vue.js +5 -0
  132. package/dist/presentation/feedback/toastHost/ToastSeconds2.vue.js.map +1 -0
  133. package/dist/presentation/feedback/toastHost/ToastSeverity.d.ts +3 -0
  134. package/dist/presentation/feedback/toastHost/UseResolvedToasts.d.ts +27 -0
  135. package/dist/presentation/feedback/toastHost/UseResolvedToasts.js +34 -0
  136. package/dist/presentation/feedback/toastHost/UseResolvedToasts.js.map +1 -0
  137. package/dist/presentation/feedback/toastHost/UseToastAnnouncer.d.ts +14 -0
  138. package/dist/presentation/feedback/toastHost/UseToastAnnouncer.js +106 -0
  139. package/dist/presentation/feedback/toastHost/UseToastAnnouncer.js.map +1 -0
  140. package/dist/presentation/feedback/toastHost/UseToastCapacity.d.ts +34 -0
  141. package/dist/presentation/feedback/toastHost/UseToastCapacity.js +128 -0
  142. package/dist/presentation/feedback/toastHost/UseToastCapacity.js.map +1 -0
  143. package/dist/presentation/feedback/toastHost/UseToastClock.d.ts +44 -0
  144. package/dist/presentation/feedback/toastHost/UseToastClock.js +134 -0
  145. package/dist/presentation/feedback/toastHost/UseToastClock.js.map +1 -0
  146. package/dist/presentation/feedback/toastHost/UseToastCountdown.d.ts +26 -0
  147. package/dist/presentation/feedback/toastHost/UseToastCountdown.js +23 -0
  148. package/dist/presentation/feedback/toastHost/UseToastCountdown.js.map +1 -0
  149. package/dist/presentation/feedback/toastHost/UseToastEntries.d.ts +4 -0
  150. package/dist/presentation/feedback/toastHost/UseToastEntries.js +17 -0
  151. package/dist/presentation/feedback/toastHost/UseToastEntries.js.map +1 -0
  152. package/dist/presentation/feedback/toastHost/UseToastExits.d.ts +11 -0
  153. package/dist/presentation/feedback/toastHost/UseToastExits.js +52 -0
  154. package/dist/presentation/feedback/toastHost/UseToastExits.js.map +1 -0
  155. package/dist/presentation/feedback/toastHost/UseToastGroupMotion.d.ts +43 -0
  156. package/dist/presentation/feedback/toastHost/UseToastGroupMotion.js +173 -0
  157. package/dist/presentation/feedback/toastHost/UseToastGroupMotion.js.map +1 -0
  158. package/dist/presentation/feedback/toastHost/UseToastHost.d.ts +10 -0
  159. package/dist/presentation/feedback/toastHost/UseToastHost.js +14 -0
  160. package/dist/presentation/feedback/toastHost/UseToastHost.js.map +1 -0
  161. package/dist/presentation/feedback/toastHost/UseToastHotkey.d.ts +20 -0
  162. package/dist/presentation/feedback/toastHost/UseToastHotkey.js +66 -0
  163. package/dist/presentation/feedback/toastHost/UseToastHotkey.js.map +1 -0
  164. package/dist/presentation/feedback/toastHost/UseToastPins.d.ts +26 -0
  165. package/dist/presentation/feedback/toastHost/UseToastPins.js +35 -0
  166. package/dist/presentation/feedback/toastHost/UseToastPins.js.map +1 -0
  167. package/dist/presentation/feedback/toastHost/UseToastStackMotion.d.ts +27 -0
  168. package/dist/presentation/feedback/toastHost/UseToastStackMotion.js +96 -0
  169. package/dist/presentation/feedback/toastHost/UseToastStackMotion.js.map +1 -0
  170. package/dist/presentation/feedback/toastHost/UseToastSwipe.d.ts +19 -0
  171. package/dist/presentation/feedback/toastHost/UseToastSwipe.js +173 -0
  172. package/dist/presentation/feedback/toastHost/UseToastSwipe.js.map +1 -0
  173. package/dist/presentation/feedback/toastHost/index.d.ts +8 -1
  174. package/dist/presentation/feedback/toastHost/index.js +7 -1
  175. package/dist/presentation/feedback/toastHost/index.js.map +1 -1
  176. package/dist/presentation/feedback/toastHost/styles.css +14 -2
  177. package/dist/presentation/layout/grid/Grid.variants.d.ts +7 -0
  178. package/dist/presentation/layout/grid/Grid.variants.js +4 -0
  179. package/dist/presentation/layout/grid/Grid.variants.js.map +1 -1
  180. package/dist/presentation/layout/grid/Grid.vue.d.ts +5 -0
  181. package/dist/presentation/layout/grid/Grid.vue.js +16 -4
  182. package/dist/presentation/layout/grid/Grid.vue.js.map +1 -1
  183. package/dist/presentation/layout/grid/index.d.ts +1 -1
  184. package/dist/presentation/layout/index.js +3 -1
  185. package/dist/presentation/nav/accountMenu/AccountMenu.vue.d.ts +1 -1
  186. package/dist/presentation/overlays/hoverCard/HoverCard.vue.d.ts +1 -1
  187. package/dist/presentation/overlays/popover/PopoverContent.vue.js +4 -4
  188. package/dist/presentation/overlays/popover/PopoverContent.vue.js.map +1 -1
  189. package/dist/presentation/overlays/tooltip/Tooltip.vue.d.ts +1 -1
  190. package/dist/presentation/overlays/tooltip/Tooltip.vue.js +8 -9
  191. package/dist/presentation/overlays/tooltip/Tooltip.vue.js.map +1 -1
  192. package/package.json +1 -1
  193. package/dist/presentation/display/notificationCenterGroup/NotificationItem.vue.js.map +0 -1
  194. package/dist/presentation/display/notificationCenterGroup/NotificationItem2.vue.js +0 -5
  195. package/dist/presentation/display/notificationCenterGroup/NotificationItem2.vue.js.map +0 -1
@@ -1,31 +1,41 @@
1
- import { defineComponent, useAttrs, useSlots, getCurrentInstance, useTemplateRef, computed, openBlock, createBlock, mergeProps, unref, withCtx, createElementBlock, renderSlot, normalizeClass, Fragment, createTextVNode, toDisplayString, createCommentVNode, createElementVNode, createVNode } from "vue";
1
+ import { defineComponent, useAttrs, useSlots, useTemplateRef, useId, ref, computed, watch, onBeforeUpdate, onUpdated, openBlock, createBlock, mergeProps, unref, withCtx, createElementVNode, normalizeClass, createElementBlock, renderSlot, Fragment, createTextVNode, toDisplayString, createCommentVNode, createVNode, createSlots, withModifiers, withDirectives, vShow } from "vue";
2
+ import { useLocale } from "../../../foundation/i18n/providers/LocaleContext.js";
2
3
  import { useLocaleDefaults } from "../../../foundation/i18n/UseLocaleDefaults.js";
3
- import { Trash2, X } from "lucide-vue-next";
4
- import { cn } from "../../../foundation/styles/Cn.js";
5
- import { Severity } from "../../../foundation/styles/enums/Severity.js";
6
4
  import { SeverityIcons, SeverityIconClasses } from "../../../foundation/icons/SeverityIcons.js";
7
5
  import _sfc_main$1 from "../toastSimple/ToastSimple.vue.js";
6
+ import _sfc_main$3 from "./ToastContent.vue.js";
7
+ import _sfc_main$4 from "./ToastRunningProgress.vue.js";
8
+ import { ChevronDown, Pin, Trash2, X } from "lucide-vue-next";
9
+ import { cn } from "../../../foundation/styles/Cn.js";
10
+ import { Severity } from "../../../foundation/styles/enums/Severity.js";
11
+ import { ToastSurface } from "./ToastSurface.js";
8
12
  import _sfc_main$2 from "../../../foundation/icons/icon/Icon.vue.js";
13
+ import _sfc_main$5 from "../../actions/button/Button.vue.js";
9
14
  const _hoisted_1 = {
10
15
  key: 0,
11
16
  "data-toast-icon": "",
12
17
  class: "mt-0.5 shrink-0"
13
18
  };
14
- const _hoisted_2 = { class: "min-w-0 flex-1" };
15
- const _hoisted_3 = {
16
- key: 0,
17
- class: "font-medium"
18
- };
19
+ const _hoisted_2 = ["aria-label", "aria-pressed", "title"];
20
+ const _hoisted_3 = ["aria-label"];
19
21
  const _hoisted_4 = {
20
- key: 2,
21
- class: "mt-2 flex flex-wrap items-center gap-2"
22
- };
23
- const _hoisted_5 = {
24
- key: 1,
22
+ key: 3,
25
23
  class: "flex h-5 shrink-0 items-center"
26
24
  };
27
- const _hoisted_6 = ["aria-label"];
28
- const _hoisted_7 = ["aria-label"];
25
+ const _hoisted_5 = ["aria-label"];
26
+ const _hoisted_6 = {
27
+ key: 0,
28
+ "aria-hidden": "true",
29
+ class: "pointer-events-none absolute inset-0"
30
+ };
31
+ const _hoisted_7 = ["id"];
32
+ const CloseIcon = X;
33
+ const GlassClasses = [
34
+ "data-[toast-surface=glass]:surface-glass-menu",
35
+ "data-[toast-surface=glass]:[box-shadow:var(--glass-menu-shadow,0_10px_15px_-3px_rgb(0_0_0/0.1),0_4px_6px_-4px_rgb(0_0_0/0.1)),inset_0_1px_0_var(--glass-highlight,transparent)]"
36
+ ];
37
+ const GlassEdgeClass = "data-[toast-surface=glass]:border-glass-edge";
38
+ const IconControlClass = "grid size-6 shrink-0 place-items-center rounded-full text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring pointer-coarse:size-9";
29
39
  const _sfc_main = /* @__PURE__ */ defineComponent({
30
40
  ...{ name: "Toast", inheritAttrs: false },
31
41
  __name: "Toast",
@@ -37,106 +47,301 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
37
47
  actions: {},
38
48
  closeLabel: {},
39
49
  deleteLabel: {},
40
- showSeverityIcon: { type: Boolean, default: true }
50
+ isPinned: { type: Boolean, default: void 0 },
51
+ pinLabel: {},
52
+ unpinLabel: {},
53
+ detailsOpen: { type: Boolean, default: void 0 },
54
+ isCompact: { type: Boolean },
55
+ isGrouped: { type: Boolean },
56
+ showSeverityIcon: { type: Boolean, default: true },
57
+ surface: {},
58
+ progress: {},
59
+ onClose: {},
60
+ onDelete: {}
41
61
  },
42
- emits: ["close", "delete"],
62
+ emits: ["togglePin", "update:detailsOpen"],
43
63
  setup(__props, { expose: __expose, emit: __emit }) {
44
- const CloseIcon = X;
45
64
  const componentProps = __props;
46
- const props = useLocaleDefaults(componentProps, "Toast", { closeLabel: "Dismiss", deleteLabel: "Delete notification" });
65
+ const props = useLocaleDefaults(componentProps, "Toast", {
66
+ closeLabel: "Dismiss",
67
+ deleteLabel: "Delete notification",
68
+ pinLabel: "Pin notification",
69
+ unpinLabel: "Unpin notification"
70
+ });
47
71
  const emit = __emit;
48
72
  const attrs = useAttrs();
49
73
  const slots = useSlots();
50
- const instance = getCurrentInstance();
74
+ const locale = useLocale();
51
75
  const inner = useTemplateRef("inner");
52
- const hasClose = () => Boolean(instance?.vnode.props?.onClose);
53
- const hasDelete = () => Boolean(instance?.vnode.props?.onDelete);
76
+ const header = useTemplateRef("header");
77
+ const details = useTemplateRef("details");
78
+ const detailsId = useId();
79
+ const titleId = useId();
80
+ const localExpanded = ref(false);
81
+ let readingAnchor;
82
+ const isDetailsOpen = computed(() => props.detailsOpen ?? localExpanded.value);
54
83
  const severityIcon = computed(
55
84
  () => props.showSeverityIcon && !props.icon ? SeverityIcons[props.severity ?? Severity.Neutral] : null
56
85
  );
57
86
  const severityIconClass = computed(() => SeverityIconClasses[props.severity ?? Severity.Neutral]);
58
- const hasIcon = () => Boolean(props.icon) || Boolean(slots.icon) || severityIcon.value !== null;
59
- const hasTitle = () => Boolean(props.title) || Boolean(slots.title);
60
- const hasDescription = () => Boolean(props.description) || Boolean(slots.description);
61
- const hasActions = () => Boolean(props.actions) || Boolean(slots.actions);
62
- const classes = computed(() => cn("flex items-start gap-3", attrs.class));
63
- const descriptionClasses = () => cn("text-sm", hasTitle() && "mt-0.5 text-muted-foreground");
87
+ const isGlass = computed(() => props.surface === ToastSurface.Glass);
88
+ const classes = computed(
89
+ () => cn(
90
+ "min-w-0 [overflow-wrap:anywhere]",
91
+ isGlass.value && GlassClasses,
92
+ isGlass.value && (props.severity ?? Severity.Neutral) === Severity.Neutral && GlassEdgeClass,
93
+ props.isCompact && "py-2",
94
+ props.isGrouped && "flex max-h-(--toast-available-height) flex-col overflow-hidden p-0",
95
+ attrs.class
96
+ )
97
+ );
64
98
  const rest = computed(() => {
65
99
  const { class: _class, ...others } = attrs;
66
100
  return others;
67
101
  });
68
102
  const el = computed(() => inner.value?.el ?? null);
69
103
  __expose({ el });
104
+ watch(
105
+ [details, isDetailsOpen, () => props.isGrouped],
106
+ ([viewport, open, grouped], _previous, onCleanup) => {
107
+ if (!viewport || !open || !grouped) {
108
+ if (viewport?.style.maxHeight) viewport.style.removeProperty("max-height");
109
+ return;
110
+ }
111
+ fitGroupDetails();
112
+ const observer = typeof ResizeObserver === "undefined" ? void 0 : new ResizeObserver(fitGroupDetails);
113
+ if (header.value) observer?.observe(header.value);
114
+ if (viewport.firstElementChild) observer?.observe(viewport.firstElementChild);
115
+ window.addEventListener("resize", fitGroupDetails);
116
+ onCleanup(() => {
117
+ observer?.disconnect();
118
+ window.removeEventListener("resize", fitGroupDetails);
119
+ });
120
+ },
121
+ { flush: "post" }
122
+ );
123
+ onBeforeUpdate(() => {
124
+ const viewport = details.value;
125
+ if (!props.isGrouped || !isDetailsOpen.value || !viewport) return;
126
+ if (viewport.scrollTop === 0 && !viewport.contains(document.activeElement)) return;
127
+ const row = Array.from(groupRows(viewport)).find((item) => item.offsetTop + item.offsetHeight > viewport.scrollTop);
128
+ if (row) readingAnchor = { row, offset: row.offsetTop - viewport.scrollTop };
129
+ });
130
+ onUpdated(() => {
131
+ fitGroupDetails();
132
+ const viewport = details.value;
133
+ if (viewport && readingAnchor && viewport.contains(readingAnchor.row)) {
134
+ viewport.scrollTop = readingAnchor.row.offsetTop - readingAnchor.offset;
135
+ }
136
+ readingAnchor = void 0;
137
+ });
138
+ function toggleDetails() {
139
+ const next = !isDetailsOpen.value;
140
+ localExpanded.value = next;
141
+ emit("update:detailsOpen", next);
142
+ }
143
+ function hasIcon() {
144
+ return Boolean(props.icon) || Boolean(slots.icon) || severityIcon.value !== null;
145
+ }
146
+ function hasTitle() {
147
+ return Boolean(props.title) || Boolean(slots.title);
148
+ }
149
+ function hasDescription() {
150
+ return Boolean(props.description) || Boolean(slots.description);
151
+ }
152
+ function hasActions() {
153
+ return Boolean(props.actions) || Boolean(slots.actions);
154
+ }
155
+ function groupRows(viewport) {
156
+ return viewport.querySelectorAll(":scope > ul > [data-toast-group-row]");
157
+ }
158
+ function blockEdges(style) {
159
+ return [style.paddingTop, style.paddingBottom, style.borderTopWidth, style.borderBottomWidth].reduce(
160
+ (sum, value) => sum + (Number.parseFloat(value) || 0),
161
+ 0
162
+ );
163
+ }
164
+ function fitGroupDetails() {
165
+ if (!props.isGrouped || !isDetailsOpen.value || !details.value || !header.value || !el.value) return;
166
+ const viewport = details.value;
167
+ const rows = groupRows(viewport);
168
+ const first = rows[0];
169
+ if (!first) return;
170
+ const surfaceStyle = getComputedStyle(el.value);
171
+ const viewportStyle = getComputedStyle(viewport);
172
+ const boxEdges = blockEdges(viewportStyle);
173
+ const limit = Number.parseFloat(surfaceStyle.maxHeight);
174
+ const chrome = header.value.offsetHeight + blockEdges(surfaceStyle) + (Number.parseFloat(viewportStyle.marginTop) || 0);
175
+ const room = Number.isFinite(limit) ? Math.max(0, limit - chrome - boxEdges) : window.innerHeight * 0.55;
176
+ let height = 0;
177
+ for (const row of Array.from(rows).slice(0, 3)) {
178
+ if (height + row.offsetHeight > room) break;
179
+ height += row.offsetHeight;
180
+ }
181
+ const cap = `${boxEdges + (height || Math.min(first.offsetHeight, room))}px`;
182
+ if (viewport.style.maxHeight !== cap) viewport.style.maxHeight = cap;
183
+ }
70
184
  return (_ctx, _cache) => {
71
185
  return openBlock(), createBlock(_sfc_main$1, mergeProps({
72
186
  ref_key: "inner",
73
187
  ref: inner,
74
- severity: unref(props).severity
188
+ severity: unref(props).severity,
189
+ "data-toast-card": "",
190
+ "data-toast-surface": isGlass.value ? unref(ToastSurface).Glass : void 0
75
191
  }, rest.value, { class: classes.value }), {
76
192
  default: withCtx(() => [
77
- hasIcon() ? (openBlock(), createElementBlock("span", _hoisted_1, [
78
- renderSlot(_ctx.$slots, "icon", {}, () => [
79
- severityIcon.value ? (openBlock(), createBlock(unref(_sfc_main$2), {
80
- key: 0,
81
- icon: severityIcon.value,
82
- size: 16,
83
- class: normalizeClass(severityIconClass.value)
84
- }, null, 8, ["icon", "class"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
85
- createTextVNode(toDisplayString(unref(props).icon), 1)
86
- ], 64))
87
- ])
88
- ])) : createCommentVNode("", true),
89
- createElementVNode("div", _hoisted_2, [
90
- hasTitle() ? (openBlock(), createElementBlock("div", _hoisted_3, [
91
- renderSlot(_ctx.$slots, "title", {}, () => [
92
- createTextVNode(toDisplayString(unref(props).title), 1)
193
+ createElementVNode("div", {
194
+ ref_key: "header",
195
+ ref: header,
196
+ class: normalizeClass(["flex shrink-0 items-start gap-3", unref(props).isGrouped && ["px-3", unref(props).isCompact ? "py-2" : "py-3"]])
197
+ }, [
198
+ hasIcon() ? (openBlock(), createElementBlock("span", _hoisted_1, [
199
+ renderSlot(_ctx.$slots, "icon", {}, () => [
200
+ severityIcon.value ? (openBlock(), createBlock(unref(_sfc_main$2), {
201
+ key: 0,
202
+ icon: severityIcon.value,
203
+ size: 16,
204
+ class: normalizeClass(severityIconClass.value)
205
+ }, null, 8, ["icon", "class"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
206
+ createTextVNode(toDisplayString(unref(props).icon), 1)
207
+ ], 64))
93
208
  ])
94
209
  ])) : createCommentVNode("", true),
95
- hasDescription() ? (openBlock(), createElementBlock("div", {
210
+ createVNode(_sfc_main$3, {
211
+ class: "min-w-0 flex-1",
212
+ "is-compact": unref(props).isCompact,
213
+ "title-id": unref(titleId)
214
+ }, createSlots({ _: 2 }, [
215
+ hasTitle() ? {
216
+ name: "title",
217
+ fn: withCtx(() => [
218
+ renderSlot(_ctx.$slots, "title", {}, () => [
219
+ createTextVNode(toDisplayString(unref(props).title), 1)
220
+ ])
221
+ ]),
222
+ key: "0"
223
+ } : void 0,
224
+ hasDescription() ? {
225
+ name: "description",
226
+ fn: withCtx(() => [
227
+ renderSlot(_ctx.$slots, "description", {}, () => [
228
+ createTextVNode(toDisplayString(unref(props).description), 1)
229
+ ])
230
+ ]),
231
+ key: "1"
232
+ } : void 0,
233
+ unref(props).progress ? {
234
+ name: "progress",
235
+ fn: withCtx(() => [
236
+ createVNode(_sfc_main$4, {
237
+ progress: unref(props).progress,
238
+ severity: unref(props).severity,
239
+ "is-compact": unref(props).isCompact,
240
+ "aria-labelledby": hasTitle() ? unref(titleId) : void 0
241
+ }, null, 8, ["progress", "severity", "is-compact", "aria-labelledby"])
242
+ ]),
243
+ key: "2"
244
+ } : void 0,
245
+ hasActions() || unref(slots).details ? {
246
+ name: "actions",
247
+ fn: withCtx(() => [
248
+ renderSlot(_ctx.$slots, "actions", {}, () => [
249
+ createTextVNode(toDisplayString(unref(props).actions), 1)
250
+ ]),
251
+ unref(slots).details ? (openBlock(), createBlock(unref(_sfc_main$5), {
252
+ key: 0,
253
+ size: "xs",
254
+ variant: "ghost",
255
+ "aria-expanded": isDetailsOpen.value,
256
+ "aria-controls": unref(detailsId),
257
+ onClick: toggleDetails
258
+ }, {
259
+ trailing: withCtx(() => [
260
+ createVNode(unref(_sfc_main$2), {
261
+ icon: unref(ChevronDown),
262
+ size: 12,
263
+ class: normalizeClass({ "rotate-180": isDetailsOpen.value })
264
+ }, null, 8, ["icon", "class"])
265
+ ]),
266
+ default: withCtx(() => [
267
+ createTextVNode(" " + toDisplayString(isDetailsOpen.value ? unref(locale).t("Toast.hideDetails", void 0, "Hide details") : unref(locale).t("Toast.showDetails", void 0, "Show details")), 1)
268
+ ]),
269
+ _: 1
270
+ }, 8, ["aria-expanded", "aria-controls"])) : createCommentVNode("", true)
271
+ ]),
272
+ key: "3"
273
+ } : void 0,
274
+ unref(slots).default ? {
275
+ name: "default",
276
+ fn: withCtx(() => [
277
+ renderSlot(_ctx.$slots, "default")
278
+ ]),
279
+ key: "4"
280
+ } : void 0
281
+ ]), 1032, ["is-compact", "title-id"]),
282
+ unref(props).isPinned !== void 0 ? (openBlock(), createElementBlock("button", {
96
283
  key: 1,
97
- class: normalizeClass(descriptionClasses())
284
+ type: "button",
285
+ "aria-label": unref(props).pinLabel,
286
+ "aria-pressed": unref(props).isPinned,
287
+ title: unref(props).isPinned ? unref(props).unpinLabel : unref(props).pinLabel,
288
+ class: normalizeClass(unref(cn)(IconControlClass, unref(props).isPinned && "bg-primary-soft text-primary-soft-foreground")),
289
+ onMousedown: _cache[0] || (_cache[0] = withModifiers(() => {
290
+ }, ["prevent"])),
291
+ onClick: _cache[1] || (_cache[1] = ($event) => emit("togglePin"))
98
292
  }, [
99
- renderSlot(_ctx.$slots, "description", {}, () => [
100
- createTextVNode(toDisplayString(unref(props).description), 1)
101
- ])
102
- ], 2)) : createCommentVNode("", true),
103
- hasActions() ? (openBlock(), createElementBlock("div", _hoisted_4, [
104
- renderSlot(_ctx.$slots, "actions", {}, () => [
105
- createTextVNode(toDisplayString(unref(props).actions), 1)
106
- ])
293
+ createVNode(unref(_sfc_main$2), {
294
+ icon: unref(Pin),
295
+ size: 14,
296
+ class: normalizeClass(unref(props).isPinned ? "fill-current" : void 0)
297
+ }, null, 8, ["icon", "class"])
298
+ ], 42, _hoisted_2)) : createCommentVNode("", true),
299
+ unref(props).onDelete ? (openBlock(), createElementBlock("button", {
300
+ key: 2,
301
+ type: "button",
302
+ "aria-label": unref(props).deleteLabel,
303
+ class: normalizeClass(IconControlClass),
304
+ onClick: _cache[2] || (_cache[2] = ($event) => unref(props).onDelete())
305
+ }, [
306
+ createVNode(unref(_sfc_main$2), {
307
+ icon: unref(Trash2),
308
+ size: 14
309
+ }, null, 8, ["icon"])
310
+ ], 8, _hoisted_3)) : createCommentVNode("", true),
311
+ unref(slots).trailing ? (openBlock(), createElementBlock("span", _hoisted_4, [
312
+ renderSlot(_ctx.$slots, "trailing")
107
313
  ])) : createCommentVNode("", true),
108
- renderSlot(_ctx.$slots, "default")
109
- ]),
110
- unref(slots).trailing ? (openBlock(), createElementBlock("span", _hoisted_5, [
111
- renderSlot(_ctx.$slots, "trailing")
112
- ])) : createCommentVNode("", true),
113
- hasDelete() ? (openBlock(), createElementBlock("button", {
114
- key: 2,
115
- type: "button",
116
- "aria-label": unref(props).deleteLabel,
117
- 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",
118
- onClick: _cache[0] || (_cache[0] = ($event) => emit("delete"))
119
- }, [
120
- createVNode(unref(_sfc_main$2), {
121
- icon: unref(Trash2),
122
- size: 14
123
- }, null, 8, ["icon"])
124
- ], 8, _hoisted_6)) : createCommentVNode("", true),
125
- hasClose() ? (openBlock(), createElementBlock("button", {
126
- key: 3,
127
- type: "button",
128
- "aria-label": unref(props).closeLabel,
129
- 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",
130
- onClick: _cache[1] || (_cache[1] = ($event) => emit("close"))
314
+ unref(props).onClose ? (openBlock(), createElementBlock("button", {
315
+ key: 4,
316
+ type: "button",
317
+ "aria-label": unref(props).closeLabel,
318
+ class: normalizeClass(unref(cn)(IconControlClass, "relative -mr-1")),
319
+ onClick: _cache[3] || (_cache[3] = ($event) => unref(props).onClose())
320
+ }, [
321
+ unref(slots).closeIndicator ? (openBlock(), createElementBlock("span", _hoisted_6, [
322
+ renderSlot(_ctx.$slots, "closeIndicator")
323
+ ])) : createCommentVNode("", true),
324
+ createVNode(unref(_sfc_main$2), {
325
+ icon: unref(CloseIcon),
326
+ size: 14
327
+ }, null, 8, ["icon"])
328
+ ], 10, _hoisted_5)) : createCommentVNode("", true)
329
+ ], 2),
330
+ unref(slots).details ? withDirectives((openBlock(), createElementBlock("div", {
331
+ key: 0,
332
+ id: unref(detailsId),
333
+ ref_key: "details",
334
+ ref: details,
335
+ "data-toast-details": "",
336
+ class: normalizeClass(["relative max-h-[min(18rem,55dvh)] overflow-y-auto overscroll-contain border-t border-border", unref(props).isGrouped ? "scroll-py-1 [overflow-anchor:none]" : "mt-2 pt-2"])
131
337
  }, [
132
- createVNode(unref(_sfc_main$2), {
133
- icon: unref(CloseIcon),
134
- size: 14
135
- }, null, 8, ["icon"])
136
- ], 8, _hoisted_7)) : createCommentVNode("", true)
338
+ isDetailsOpen.value ? renderSlot(_ctx.$slots, "details", {}, void 0, void 0, 0) : createCommentVNode("", true)
339
+ ], 10, _hoisted_7)), [
340
+ [vShow, isDetailsOpen.value]
341
+ ]) : createCommentVNode("", true)
137
342
  ]),
138
343
  _: 3
139
- }, 16, ["severity", "class"]);
344
+ }, 16, ["severity", "data-toast-surface", "class"]);
140
345
  };
141
346
  }
142
347
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.vue.js","sources":["../../../../src/presentation/feedback/toast/Toast.vue"],"sourcesContent":["<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"],"names":["SeverityToken","_openBlock","_createBlock","ToastSimple","_mergeProps","_unref","_createElementBlock","_renderSlot","Icon","_Fragment","_createTextVNode","_toDisplayString","_createElementVNode","_createVNode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,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,WAAW,mBAAA;AACjB,UAAM,QAAQ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AA;AAAA;YANP,MAAK;AAAA,YACJ,cAAYD,MAAA,KAAA,EAAM;AAAA,YACnB,OAAM;AAAA,YACL,+CAAO,KAAI,OAAA;AAAA,UAAA;YAEZQ,YAAqCR,MAAAG,WAAA,GAAA;AAAA,cAA9B,MAAMH,MAAA,SAAA;AAAA,cAAY,MAAM;AAAA,YAAA;;;;;;;;"}
1
+ {"version":3,"file":"Toast.vue.js","sources":["../../../../src/presentation/feedback/toast/Toast.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { ChevronDown, Pin, Trash2, X } from 'lucide-vue-next';\n\nimport type { NoticeProgress } from '../../../feedback';\nimport { cn, Severity } from '../../../foundation/styles';\nimport { ToastSurface } from './ToastSurface';\n\n/** Defines props for the toast card. */\nexport interface ToastProps {\n /** The semantic severity palette. */\n readonly severity?: Severity;\n\n /** The optional leading icon. Rich content → the `icon` slot. */\n readonly icon?: string;\n\n /** The bold heading line. Rich content → the `title` slot. */\n readonly title?: string;\n\n /** The body text below the title. Rich content → the `description` slot. */\n readonly description?: string;\n\n /** The action area below the body. Rich content → the `actions` slot. */\n readonly actions?: string;\n\n /** The accessible label for the close button. Default `\"Dismiss\"`. */\n readonly closeLabel?: string;\n\n /** The accessible label for removing a retained notice. Default \"Delete notification\". */\n readonly deleteLabel?: string;\n\n /** The pin toggle's pressed state; the toggle renders only when this is supplied. */\n readonly isPinned?: boolean;\n\n /** The accessible label for the pin toggle. Default \"Pin notification\". */\n readonly pinLabel?: string;\n\n /** The tooltip shown on a pinned toggle. Default \"Unpin notification\". */\n readonly unpinLabel?: string;\n\n /** The details disclosure's open state; supplying it makes the disclosure controlled. */\n readonly detailsOpen?: boolean;\n\n /** The compact layout, which places actions alongside the copy and wraps them as space requires. */\n readonly isCompact?: boolean;\n\n /** @internal The grouped layout, which fits the details viewport to at most three complete rows. */\n readonly isGrouped?: boolean;\n\n /** The switch for the severity's own glyph, shown when no `icon` is given; `neutral` has none. Default `true`. */\n readonly showSeverityIcon?: boolean;\n\n /** The card material. Default `ToastSurface.Solid`. */\n readonly surface?: ToastSurface;\n\n /** The running operation's progress, shown under the copy when supplied. */\n readonly progress?: NoticeProgress;\n\n /** Fires when the close button is activated; the button renders only when this is supplied. */\n readonly onClose?: () => void;\n\n /** Fires when the delete button is activated; the button renders only when this is supplied. */\n readonly onDelete?: () => void;\n}\n\n/** @internal The glyph on the close button. */\nconst CloseIcon = X;\n\n/** @internal The glass material's utilities, keyed on `data-toast-surface`. */\nconst GlassClasses = [\n 'data-[toast-surface=glass]:surface-glass-menu',\n 'data-[toast-surface=glass]:[box-shadow:var(--glass-menu-shadow,0_10px_15px_-3px_rgb(0_0_0/0.1),0_4px_6px_-4px_rgb(0_0_0/0.1)),inset_0_1px_0_var(--glass-highlight,transparent)]',\n];\n\n/** @internal The glass hairline, taken only by the neutral card — a severity's own border keeps its accent. */\nconst GlassEdgeClass = 'data-[toast-surface=glass]:border-glass-edge';\n\n/** @internal The classes shared by the card's icon-only controls. */\nconst IconControlClass =\n 'grid size-6 shrink-0 place-items-center rounded-full text-muted-foreground transition-colors ' +\n 'hover:bg-muted hover:text-foreground focus-visible:outline-hidden focus-visible:ring-1 ' +\n 'focus-visible:ring-ring pointer-coarse:size-9';\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, onBeforeUpdate, onUpdated, ref, useAttrs, useId, useSlots, useTemplateRef, watch } from 'vue';\n\nimport { useLocale, useLocaleDefaults } from '../../../foundation/i18n';\nimport { Icon, SeverityIconClasses, SeverityIcons } from '../../../foundation/icons';\nimport { Button } from '../../actions/button';\nimport ToastSimple from '../toastSimple/ToastSimple.vue';\nimport ToastContent from './ToastContent.vue';\nimport ToastRunningProgress from './ToastRunningProgress.vue';\n\n/** Renders a transient toast card — icon, title, description, actions and close. */\ndefineOptions({ name: 'Toast', inheritAttrs: false });\n\nconst componentProps = withDefaults(defineProps<ToastProps>(), {\n showSeverityIcon: true,\n isPinned: undefined,\n detailsOpen: undefined,\n});\nconst props = useLocaleDefaults(componentProps, 'Toast', {\n closeLabel: 'Dismiss',\n deleteLabel: 'Delete notification',\n pinLabel: 'Pin notification',\n unpinLabel: 'Unpin notification',\n});\n\nconst emit = defineEmits<{\n /** Requests a change to the pin toggle's pressed state. */\n togglePin: [];\n /** Requests expanding or collapsing the details panel. */\n 'update:detailsOpen': [value: boolean];\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 /** Extra content shown on demand below the summary and its controls. */\n details?(): unknown;\n /** The adornment beside the close button — a countdown, a timestamp. */\n trailing?(): unknown;\n /** The decorative indicator wrapping the close glyph. */\n closeIndicator?(): unknown;\n}>();\n\nconst attrs = useAttrs();\nconst slots = useSlots();\nconst locale = useLocale();\nconst inner = useTemplateRef<InstanceType<typeof ToastSimple>>('inner');\nconst header = useTemplateRef<HTMLDivElement>('header');\nconst details = useTemplateRef<HTMLDivElement>('details');\nconst detailsId = useId();\nconst titleId = useId();\n\nconst localExpanded = ref(false);\nlet readingAnchor: { row: HTMLElement; offset: number } | undefined;\n\n/** Whether the details disclosure is open — the controlled `detailsOpen`, else the card's own state. */\nconst isDetailsOpen = computed(() => props.detailsOpen ?? localExpanded.value);\n\n/** The glyph standing in for a missing `icon`, or `null` when switched off or for a neutral toast. */\nconst severityIcon = computed(() =>\n props.showSeverityIcon && !props.icon ? SeverityIcons[props.severity ?? Severity.Neutral] : null,\n);\nconst severityIconClass = computed(() => SeverityIconClasses[props.severity ?? Severity.Neutral]);\n\nconst isGlass = computed(() => props.surface === ToastSurface.Glass);\n\nconst classes = computed(() =>\n cn(\n 'min-w-0 [overflow-wrap:anywhere]',\n isGlass.value && GlassClasses,\n isGlass.value && (props.severity ?? Severity.Neutral) === Severity.Neutral && GlassEdgeClass,\n props.isCompact && 'py-2',\n props.isGrouped && 'flex max-h-(--toast-available-height) flex-col overflow-hidden p-0',\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\n/** The underlying `ToastSimple` root element. */\nconst el = computed(() => inner.value?.el ?? null);\n\ndefineExpose({ el });\n\nwatch(\n [details, isDetailsOpen, () => props.isGrouped],\n ([viewport, open, grouped], _previous, onCleanup) => {\n if (!viewport || !open || !grouped) {\n if (viewport?.style.maxHeight) viewport.style.removeProperty('max-height');\n return;\n }\n fitGroupDetails();\n const observer = typeof ResizeObserver === 'undefined' ? undefined : new ResizeObserver(fitGroupDetails);\n if (header.value) observer?.observe(header.value);\n if (viewport.firstElementChild) observer?.observe(viewport.firstElementChild);\n window.addEventListener('resize', fitGroupDetails);\n onCleanup(() => {\n observer?.disconnect();\n window.removeEventListener('resize', fitGroupDetails);\n });\n },\n { flush: 'post' },\n);\n\nonBeforeUpdate(() => {\n const viewport = details.value;\n if (!props.isGrouped || !isDetailsOpen.value || !viewport) return;\n if (viewport.scrollTop === 0 && !viewport.contains(document.activeElement)) return;\n const row = Array.from(groupRows(viewport)).find((item) => item.offsetTop + item.offsetHeight > viewport.scrollTop);\n if (row) readingAnchor = { row, offset: row.offsetTop - viewport.scrollTop };\n});\n\nonUpdated(() => {\n fitGroupDetails();\n const viewport = details.value;\n if (viewport && readingAnchor && viewport.contains(readingAnchor.row)) {\n viewport.scrollTop = readingAnchor.row.offsetTop - readingAnchor.offset;\n }\n readingAnchor = undefined;\n});\n\n/** Opens or closes the details panel, announcing the change through `update:detailsOpen`. */\nfunction toggleDetails(): void {\n const next = !isDetailsOpen.value;\n localExpanded.value = next;\n emit('update:detailsOpen', next);\n}\n\n// Slot presence is read through calls, never cached — `slots` is not reactive.\nfunction hasIcon(): boolean {\n return Boolean(props.icon) || Boolean(slots.icon) || severityIcon.value !== null;\n}\n\nfunction hasTitle(): boolean {\n return Boolean(props.title) || Boolean(slots.title);\n}\n\nfunction hasDescription(): boolean {\n return Boolean(props.description) || Boolean(slots.description);\n}\n\nfunction hasActions(): boolean {\n return Boolean(props.actions) || Boolean(slots.actions);\n}\n\n/** Lists the member rows of an expanded group's details viewport. */\nfunction groupRows(viewport: HTMLElement): NodeListOf<HTMLElement> {\n return viewport.querySelectorAll<HTMLElement>(':scope > ul > [data-toast-group-row]');\n}\n\n/** Sums an element's vertical padding and border widths, in px. */\nfunction blockEdges(style: CSSStyleDeclaration): number {\n return [style.paddingTop, style.paddingBottom, style.borderTopWidth, style.borderBottomWidth].reduce(\n (sum, value) => sum + (Number.parseFloat(value) || 0),\n 0,\n );\n}\n\n/** Caps the grouped details viewport at its first three complete rows, within the card's available height. */\nfunction fitGroupDetails(): void {\n if (!props.isGrouped || !isDetailsOpen.value || !details.value || !header.value || !el.value) return;\n const viewport = details.value;\n const rows = groupRows(viewport);\n const first = rows[0];\n if (!first) return;\n\n const surfaceStyle = getComputedStyle(el.value);\n const viewportStyle = getComputedStyle(viewport);\n const boxEdges = blockEdges(viewportStyle);\n const limit = Number.parseFloat(surfaceStyle.maxHeight);\n const chrome =\n header.value.offsetHeight + blockEdges(surfaceStyle) + (Number.parseFloat(viewportStyle.marginTop) || 0);\n const room = Number.isFinite(limit) ? Math.max(0, limit - chrome - boxEdges) : window.innerHeight * 0.55;\n let height = 0;\n for (const row of Array.from(rows).slice(0, 3)) {\n if (height + row.offsetHeight > room) break;\n height += row.offsetHeight;\n }\n // A single long row can scroll when even that row exceeds the viewport.\n const cap = `${boxEdges + (height || Math.min(first.offsetHeight, room))}px`;\n if (viewport.style.maxHeight !== cap) viewport.style.maxHeight = cap;\n}\n</script>\n\n<template>\n <ToastSimple\n ref=\"inner\"\n :severity=\"props.severity\"\n data-toast-card\n :data-toast-surface=\"isGlass ? ToastSurface.Glass : undefined\"\n v-bind=\"rest\"\n :class=\"classes\"\n >\n <div\n ref=\"header\"\n class=\"flex shrink-0 items-start gap-3\"\n :class=\"props.isGrouped && ['px-3', props.isCompact ? 'py-2' : 'py-3']\"\n >\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 <ToastContent class=\"min-w-0 flex-1\" :is-compact=\"props.isCompact\" :title-id=\"titleId\">\n <template v-if=\"hasTitle()\" #title>\n <slot name=\"title\">{{ props.title }}</slot>\n </template>\n <template v-if=\"hasDescription()\" #description>\n <slot name=\"description\">{{ props.description }}</slot>\n </template>\n <template v-if=\"props.progress\" #progress>\n <ToastRunningProgress\n :progress=\"props.progress\"\n :severity=\"props.severity\"\n :is-compact=\"props.isCompact\"\n :aria-labelledby=\"hasTitle() ? titleId : undefined\"\n />\n </template>\n <template v-if=\"hasActions() || slots.details\" #actions>\n <slot name=\"actions\">{{ props.actions }}</slot>\n <Button\n v-if=\"slots.details\"\n size=\"xs\"\n variant=\"ghost\"\n :aria-expanded=\"isDetailsOpen\"\n :aria-controls=\"detailsId\"\n @click=\"toggleDetails\"\n >\n <template #trailing\n ><Icon :icon=\"ChevronDown\" :size=\"12\" :class=\"{ 'rotate-180': isDetailsOpen }\"\n /></template>\n {{\n isDetailsOpen\n ? locale.t('Toast.hideDetails', undefined, 'Hide details')\n : locale.t('Toast.showDetails', undefined, 'Show details')\n }}\n </Button>\n </template>\n <template v-if=\"slots.default\" #default><slot /></template>\n </ToastContent>\n <button\n v-if=\"props.isPinned !== undefined\"\n type=\"button\"\n :aria-label=\"props.pinLabel\"\n :aria-pressed=\"props.isPinned\"\n :title=\"props.isPinned ? props.unpinLabel : props.pinLabel\"\n :class=\"cn(IconControlClass, props.isPinned && 'bg-primary-soft text-primary-soft-foreground')\"\n @mousedown.prevent\n @click=\"emit('togglePin')\"\n >\n <Icon :icon=\"Pin\" :size=\"14\" :class=\"props.isPinned ? 'fill-current' : undefined\" />\n </button>\n <button\n v-if=\"props.onDelete\"\n type=\"button\"\n :aria-label=\"props.deleteLabel\"\n :class=\"IconControlClass\"\n @click=\"props.onDelete()\"\n >\n <Icon :icon=\"Trash2\" :size=\"14\" />\n </button>\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=\"props.onClose\"\n type=\"button\"\n :aria-label=\"props.closeLabel\"\n :class=\"cn(IconControlClass, 'relative -mr-1')\"\n @click=\"props.onClose()\"\n >\n <span v-if=\"slots.closeIndicator\" aria-hidden=\"true\" class=\"pointer-events-none absolute inset-0\">\n <slot name=\"closeIndicator\" />\n </span>\n <Icon :icon=\"CloseIcon\" :size=\"14\" />\n </button>\n </div>\n <div\n v-if=\"slots.details\"\n v-show=\"isDetailsOpen\"\n :id=\"detailsId\"\n ref=\"details\"\n data-toast-details\n class=\"relative max-h-[min(18rem,55dvh)] overflow-y-auto overscroll-contain border-t border-border\"\n :class=\"props.isGrouped ? 'scroll-py-1 [overflow-anchor:none]' : 'mt-2 pt-2'\"\n >\n <slot v-if=\"isDetailsOpen\" name=\"details\" />\n </div>\n </ToastSimple>\n</template>\n"],"names":["_openBlock","_createBlock","ToastSimple","_mergeProps","_unref","_createElementVNode","_normalizeClass","_createElementBlock","_renderSlot","Icon","_Fragment","_createTextVNode","_toDisplayString","_createVNode","ToastContent","ToastRunningProgress","Button"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,MAAM,YAAY;AAGlB,MAAM,eAAe;AAAA,EACnB;AAAA,EACA;AACF;AAGA,MAAM,iBAAiB;AAGvB,MAAM,mBACJ;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBF,UAAM,iBAAiB;AAKvB,UAAM,QAAQ,kBAAkB,gBAAgB,SAAS;AAAA,MACvD,YAAY;AAAA,MACZ,aAAa;AAAA,MACb,UAAU;AAAA,MACV,YAAY;AAAA,IAAA,CACb;AAED,UAAM,OAA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A,KAAA,EAAM,QAAA;AAAA,YAAO;cAETA,MAAA,KAAA,EAAM,kBAAlBJ,aAAAO,mBAEO,QAFP,YAEO;AAAA,gBADLC,WAA8B,KAAA,QAAA,gBAAA;AAAA,cAAA;cAEhCK,YAAqCT,MAAAK,WAAA,GAAA;AAAA,gBAA9B,MAAML,MAAA,SAAA;AAAA,gBAAY,MAAM;AAAA,cAAA;;;UAI3BA,MAAA,KAAA,EAAM,uCADdG,mBAUM,OAAA;AAAA;YAPH,IAAIH,MAAA,SAAA;AAAA,qBACD;AAAA,YAAJ,KAAI;AAAA,YACJ,sBAAA;AAAA,YACA,OAAKE,eAAA,CAAC,+FACEF,MAAA,KAAA,EAAM,YAAS,uCAAA,WAAA,CAAA;AAAA,UAAA;YAEX,cAAA,QAAZI,WAA4C,KAAA,QAAA,WAAA,IAAA,QAAA,QAAA,CAAA;;oBAPpC,cAAA,KAAa;AAAA,UAAA;;;;;;;"}
@@ -0,0 +1,25 @@
1
+ /** Defines props for the toast card's copy column. */
2
+ export interface ToastContentProps {
3
+ /** The compact layout, which wraps the copy, actions and progress into one row. */
4
+ readonly isCompact?: boolean;
5
+ /** The id given to the title element, so the running progress can name itself after it. */
6
+ readonly titleId?: string;
7
+ }
8
+ declare const _default: __VLS_WithSlots<import('vue').DefineComponent<ToastContentProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ToastContentProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, {
9
+ /** The heading line. */
10
+ title?(): unknown;
11
+ /** The body text below the title. */
12
+ description?(): unknown;
13
+ /** A running operation's progress — under the copy, above the actions; below the row when compact. */
14
+ progress?(): unknown;
15
+ /** The action row. */
16
+ actions?(): unknown;
17
+ /** The extra content below the actions. */
18
+ default?(): unknown;
19
+ }>;
20
+ export default _default;
21
+ type __VLS_WithSlots<T, S> = T & {
22
+ new (): {
23
+ $slots: S;
24
+ };
25
+ };
@@ -0,0 +1,78 @@
1
+ import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, renderSlot, createCommentVNode } from "vue";
2
+ import { dataAttr } from "../../../foundation/dom/DataAttr.js";
3
+ const _hoisted_1 = ["data-toast-compact"];
4
+ const _hoisted_2 = ["id"];
5
+ const _hoisted_3 = {
6
+ key: 1,
7
+ class: "mt-2"
8
+ };
9
+ const _hoisted_4 = {
10
+ key: 3,
11
+ class: "min-w-0 basis-full"
12
+ };
13
+ const _hoisted_5 = {
14
+ key: 5,
15
+ class: "min-w-0 basis-full"
16
+ };
17
+ const _sfc_main = /* @__PURE__ */ defineComponent({
18
+ ...{ name: "ToastContent" },
19
+ __name: "ToastContent",
20
+ props: {
21
+ isCompact: { type: Boolean },
22
+ titleId: {}
23
+ },
24
+ setup(__props) {
25
+ return (_ctx, _cache) => {
26
+ return openBlock(), createElementBlock("div", {
27
+ "data-toast-summary": "",
28
+ "data-toast-compact": unref(dataAttr)(__props.isCompact),
29
+ class: normalizeClass(__props.isCompact && "flex min-w-0 flex-wrap items-center gap-x-2.5 gap-y-1.5 [overflow-wrap:anywhere]")
30
+ }, [
31
+ _ctx.$slots.title || _ctx.$slots.description ? (openBlock(), createElementBlock("div", {
32
+ key: 0,
33
+ class: normalizeClass(__props.isCompact ? "min-w-0 flex-[1_1_6rem]" : "contents")
34
+ }, [
35
+ _ctx.$slots.title ? (openBlock(), createElementBlock("div", {
36
+ key: 0,
37
+ id: __props.titleId,
38
+ class: "font-medium"
39
+ }, [
40
+ renderSlot(_ctx.$slots, "title")
41
+ ], 8, _hoisted_2)) : createCommentVNode("", true),
42
+ _ctx.$slots.description ? (openBlock(), createElementBlock("div", {
43
+ key: 1,
44
+ class: normalizeClass(["text-sm", _ctx.$slots.title && "mt-0.5 text-muted-foreground"])
45
+ }, [
46
+ renderSlot(_ctx.$slots, "description")
47
+ ], 2)) : createCommentVNode("", true)
48
+ ], 2)) : createCommentVNode("", true),
49
+ _ctx.$slots.progress && !__props.isCompact ? (openBlock(), createElementBlock("div", _hoisted_3, [
50
+ renderSlot(_ctx.$slots, "progress")
51
+ ])) : createCommentVNode("", true),
52
+ _ctx.$slots.actions ? (openBlock(), createElementBlock("div", {
53
+ key: 2,
54
+ class: normalizeClass([
55
+ "flex flex-wrap items-center",
56
+ __props.isCompact ? [
57
+ "min-w-0 max-w-full gap-1.5 [&_a]:max-w-full [&_a]:whitespace-normal",
58
+ "[&_button]:max-w-full [&_button]:whitespace-normal",
59
+ "pointer-coarse:[&_a]:min-h-11 pointer-coarse:[&_button]:min-h-11"
60
+ ] : "mt-2 gap-2"
61
+ ])
62
+ }, [
63
+ renderSlot(_ctx.$slots, "actions")
64
+ ], 2)) : createCommentVNode("", true),
65
+ _ctx.$slots.progress && __props.isCompact ? (openBlock(), createElementBlock("div", _hoisted_4, [
66
+ renderSlot(_ctx.$slots, "progress")
67
+ ])) : createCommentVNode("", true),
68
+ !__props.isCompact ? renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 4) : _ctx.$slots.default ? (openBlock(), createElementBlock("div", _hoisted_5, [
69
+ renderSlot(_ctx.$slots, "default")
70
+ ])) : createCommentVNode("", true)
71
+ ], 10, _hoisted_1);
72
+ };
73
+ }
74
+ });
75
+ export {
76
+ _sfc_main as default
77
+ };
78
+ //# sourceMappingURL=ToastContent.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToastContent.vue.js","sources":["../../../../src/presentation/feedback/toast/ToastContent.vue"],"sourcesContent":["<script lang=\"ts\">\n/** Defines props for the toast card's copy column. */\nexport interface ToastContentProps {\n /** The compact layout, which wraps the copy, actions and progress into one row. */\n readonly isCompact?: boolean;\n\n /** The id given to the title element, so the running progress can name itself after it. */\n readonly titleId?: string;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { dataAttr } from '../../../foundation/dom';\n\n/** Renders the toast card's copy column — title, description, running progress and actions. */\ndefineOptions({ name: 'ToastContent' });\n\ndefineProps<ToastContentProps>();\n\ndefineSlots<{\n /** The heading line. */\n title?(): unknown;\n /** The body text below the title. */\n description?(): unknown;\n /** A running operation's progress — under the copy, above the actions; below the row when compact. */\n progress?(): unknown;\n /** The action row. */\n actions?(): unknown;\n /** The extra content below the actions. */\n default?(): unknown;\n}>();\n</script>\n\n<template>\n <div\n data-toast-summary\n :data-toast-compact=\"dataAttr(isCompact)\"\n :class=\"isCompact && 'flex min-w-0 flex-wrap items-center gap-x-2.5 gap-y-1.5 [overflow-wrap:anywhere]'\"\n >\n <div v-if=\"$slots.title || $slots.description\" :class=\"isCompact ? 'min-w-0 flex-[1_1_6rem]' : 'contents'\">\n <div v-if=\"$slots.title\" :id=\"titleId\" class=\"font-medium\"><slot name=\"title\" /></div>\n <div v-if=\"$slots.description\" :class=\"['text-sm', $slots.title && 'mt-0.5 text-muted-foreground']\">\n <slot name=\"description\" />\n </div>\n </div>\n <div v-if=\"$slots.progress && !isCompact\" class=\"mt-2\"><slot name=\"progress\" /></div>\n <div\n v-if=\"$slots.actions\"\n class=\"flex flex-wrap items-center\"\n :class=\"\n isCompact\n ? [\n 'min-w-0 max-w-full gap-1.5 [&_a]:max-w-full [&_a]:whitespace-normal',\n '[&_button]:max-w-full [&_button]:whitespace-normal',\n 'pointer-coarse:[&_a]:min-h-11 pointer-coarse:[&_button]:min-h-11',\n ]\n : 'mt-2 gap-2'\n \"\n >\n <slot name=\"actions\" />\n </div>\n <div v-if=\"$slots.progress && isCompact\" class=\"min-w-0 basis-full\"><slot name=\"progress\" /></div>\n <slot v-if=\"!isCompact\" />\n <div v-else-if=\"$slots.default\" class=\"min-w-0 basis-full\"><slot /></div>\n </div>\n</template>\n"],"names":["_createElementBlock","_unref","$slots","_renderSlot","_normalizeClass","_openBlock"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;0BAkCEA,mBA8BM,OAAA;AAAA,QA7BJ,sBAAA;AAAA,QACC,sBAAoBC,MAAA,QAAA,EAAS,QAAA,SAAS;AAAA,QACtC,sBAAO,QAAA,aAAS,k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