@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,14 +1,27 @@
1
- import { defineComponent, useAttrs, computed, watch, openBlock, createBlock, normalizeProps, guardReactiveProps, unref } from "vue";
2
- import { feedbackBus, NoticeCategory } from "../../../feedback/FeedbackBus.js";
3
- import _sfc_main$1, { toastHost } from "../toastHost/ToastHost.vue.js";
1
+ import { defineComponent, useAttrs, useId, computed, watch, shallowRef, openBlock, createBlock, normalizeProps, guardReactiveProps, unref, h, Fragment, TransitionGroup } from "vue";
2
+ import { ElementTag } from "../../../foundation/dom/enums/ElementTag.js";
3
+ import { useLocale } from "../../../foundation/i18n/providers/LocaleContext.js";
4
+ import _sfc_main$3 from "../reportAction/ReportAction.vue.js";
5
+ import _sfc_main$4 from "../toast/ToastContent.vue.js";
6
+ import _sfc_main$5 from "../toast/ToastRunningProgress.vue.js";
7
+ import _sfc_main$1 from "../toastHost/ToastHost.vue.js";
8
+ import _sfc_main$2 from "./RemindLaterButton.vue.js";
9
+ import { feedbackBus, NoticeCategory, NoticePriorityRank, NoticeTone } from "../../../feedback/FeedbackBus.js";
10
+ import { toastHost } from "../toastHost/ToastHostStore.js";
4
11
  function toToastOptions(notice) {
5
12
  return {
6
13
  title: notice.title,
7
14
  description: notice.description,
15
+ compact: notice.compact,
16
+ details: notice.details,
8
17
  severity: notice.tone,
18
+ priority: notice.priority,
9
19
  duration: notice.durationMs,
20
+ expiresAtMs: notice.expiresAtMs,
21
+ canPin: notice.canPin,
10
22
  action: notice.action,
11
- report: notice.report
23
+ report: notice.report,
24
+ progress: notice.progress
12
25
  };
13
26
  }
14
27
  const _sfc_main = /* @__PURE__ */ defineComponent({
@@ -20,34 +33,166 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
20
33
  setup(__props) {
21
34
  const props = __props;
22
35
  const attrs = useAttrs();
36
+ const locale = useLocale();
37
+ const rowIdBase = useId();
23
38
  const bus = computed(() => props.bus ?? feedbackBus);
24
39
  watch(
25
40
  bus,
26
41
  (current, _previous, onCleanup) => {
27
42
  if (typeof document === "undefined") return;
28
- const toastIds = /* @__PURE__ */ new Map();
29
- const close = (id) => {
30
- if (id !== null) {
31
- const toastId = toastIds.get(id);
32
- if (toastId) toastHost.dismiss(toastId);
43
+ const members = /* @__PURE__ */ new Map();
44
+ const groups = /* @__PURE__ */ new Map();
45
+ let active = true;
46
+ function forget(entry) {
47
+ if (entry.groupKey && groups.get(entry.groupKey) === entry) groups.delete(entry.groupKey);
48
+ for (const id of entry.notices.keys()) {
49
+ if (members.get(id) === entry) members.delete(id);
50
+ }
51
+ }
52
+ function reminderFor(entry, notice) {
53
+ const remind = current.remindLater;
54
+ if (!remind || !notice.reminderKey || Number.isFinite(notice.expiresAtMs)) return void 0;
55
+ return h(_sfc_main$2, {
56
+ key: notice.id,
57
+ schedule: async () => {
58
+ entry.pending.value += 1;
59
+ try {
60
+ await remind(notice);
61
+ if (active) {
62
+ current.notify({
63
+ tone: NoticeTone.Info,
64
+ title: locale.t("FeedbackToastHost.reminderScheduled", void 0, "Reminder scheduled."),
65
+ canPin: false
66
+ });
67
+ }
68
+ } finally {
69
+ entry.pending.value -= 1;
70
+ }
71
+ }
72
+ });
73
+ }
74
+ function renderGroup(entry, rows) {
75
+ return h(
76
+ TransitionGroup,
77
+ {
78
+ tag: ElementTag.Ul,
79
+ class: "divide-y divide-border px-3",
80
+ enterActiveClass: "motion-safe:transition-[opacity,translate] motion-safe:duration-(--toast-group-duration) ease-out",
81
+ enterFromClass: "motion-safe:translate-y-2 motion-safe:opacity-0"
82
+ },
83
+ {
84
+ default: () => [...rows].reverse().map((notice) => {
85
+ const reminder = reminderFor(entry, notice);
86
+ const report = notice.report ? h(_sfc_main$3, { send: notice.report }) : void 0;
87
+ const copy = notice.compact ?? notice;
88
+ const running = notice.progress;
89
+ const titleId = `${rowIdBase}-title-${notice.id}`;
90
+ return h(ElementTag.Li, { key: notice.id, "data-toast-group-row": notice.id, class: "py-1.5" }, [
91
+ h(
92
+ _sfc_main$4,
93
+ { isCompact: true, titleId },
94
+ {
95
+ title: () => copy.title,
96
+ description: copy.description ? () => copy.description : void 0,
97
+ progress: running ? () => h(_sfc_main$5, {
98
+ progress: running,
99
+ severity: notice.tone,
100
+ isCompact: true,
101
+ "aria-labelledby": titleId
102
+ }) : void 0,
103
+ actions: notice.action || reminder || report ? () => [notice.action, reminder, report] : void 0,
104
+ default: notice.details ? () => notice.details : void 0
105
+ }
106
+ )
107
+ ]);
108
+ })
109
+ }
110
+ );
111
+ }
112
+ function render(entry) {
113
+ const rows = [...entry.notices.values()];
114
+ const first = rows[0];
115
+ if (!first) {
116
+ forget(entry);
117
+ if (entry.id) toastHost.dismiss(entry.id);
33
118
  return;
34
119
  }
35
- for (const toastId of [...toastIds.values()]) toastHost.dismiss(toastId);
36
- };
37
- const unsubscribe = current.subscribe((notice) => {
38
120
  const options = {
39
- ...toToastOptions(notice),
40
- onDelete: notice.category === NoticeCategory.Retained ? () => current.remove(notice.id) : void 0,
41
- onDismiss: () => {
42
- toastIds.delete(notice.id);
43
- }
121
+ ...toToastOptions(first),
122
+ pauseExpiry: () => entry.pending.value > 0,
123
+ onDismiss: () => forget(entry)
44
124
  };
45
- const existing = toastIds.get(notice.id);
46
- if (existing) toastHost.update(existing, options);
47
- else toastIds.set(notice.id, toastHost.toast(options));
125
+ if (entry.groupKey) {
126
+ const latest = rows.at(-1) ?? first;
127
+ options.group = {
128
+ count: rows.length,
129
+ latest: {
130
+ title: typeof latest.title === "string" ? latest.title : void 0,
131
+ description: typeof latest.description === "string" ? latest.description : void 0,
132
+ severity: latest.tone
133
+ }
134
+ };
135
+ }
136
+ if (rows.length === 1) {
137
+ const reminder = reminderFor(entry, first);
138
+ if (reminder) options.action = h(Fragment, null, [first.action, reminder]);
139
+ options.onDelete = first.category === NoticeCategory.Retained ? () => current.remove(first.id) : void 0;
140
+ } else {
141
+ options.title = first.group?.title ?? first.title;
142
+ options.description = locale.t(
143
+ "FeedbackToastHost.groupedCount",
144
+ { count: rows.length },
145
+ "{count} notifications"
146
+ );
147
+ options.details = renderGroup(entry, rows);
148
+ options.compact = void 0;
149
+ options.canPin = rows.some((notice) => notice.canPin === false) ? false : first.canPin;
150
+ options.priority = rows.reduce((highest, { priority }) => {
151
+ if (priority === void 0) return highest;
152
+ return highest === void 0 || NoticePriorityRank[priority] > NoticePriorityRank[highest] ? priority : highest;
153
+ }, void 0);
154
+ options.action = void 0;
155
+ options.report = void 0;
156
+ options.progress = void 0;
157
+ options.onDelete = void 0;
158
+ if (rows.some((notice) => notice.progress)) options.duration = Infinity;
159
+ }
160
+ if (entry.id) toastHost.update(entry.id, options);
161
+ else entry.id = toastHost.toast(options);
162
+ }
163
+ function removeMember(id, entry) {
164
+ members.delete(id);
165
+ entry.notices.delete(id);
166
+ render(entry);
167
+ }
168
+ function close(id) {
169
+ if (id !== null) {
170
+ const entry = members.get(id);
171
+ if (entry) removeMember(id, entry);
172
+ return;
173
+ }
174
+ for (const entry of new Set(members.values())) if (entry.id) toastHost.dismiss(entry.id);
175
+ }
176
+ const unsubscribe = current.subscribe((notice) => {
177
+ if (current.suppresses(notice)) return;
178
+ const groupKey = Number.isFinite(notice.expiresAtMs) ? void 0 : notice.group?.key || void 0;
179
+ let entry = members.get(notice.id);
180
+ if (entry && entry.groupKey !== groupKey) {
181
+ removeMember(notice.id, entry);
182
+ entry = void 0;
183
+ }
184
+ entry ??= groupKey ? groups.get(groupKey) : void 0;
185
+ if (!entry) {
186
+ entry = { groupKey, notices: /* @__PURE__ */ new Map(), pending: shallowRef(0) };
187
+ if (groupKey) groups.set(groupKey, entry);
188
+ }
189
+ members.set(notice.id, entry);
190
+ entry.notices.set(notice.id, notice);
191
+ render(entry);
48
192
  });
49
193
  const unsubscribeDismiss = current.subscribeDismiss(close);
50
194
  onCleanup(() => {
195
+ active = false;
51
196
  unsubscribe();
52
197
  unsubscribeDismiss();
53
198
  close(null);
@@ -1 +1 @@
1
- {"version":3,"file":"FeedbackToastHost.vue.js","sources":["../../../../src/presentation/feedback/feedbackToastHost/FeedbackToastHost.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { FeedbackBus, PublishedNotice } from '../../../feedback';\nimport type { ToastHostProps, ToastOptions } from '../toastHost';\n\n/**\n * The prop surface of `FeedbackToastHost` — `bus`, plus every `ToastHost` prop.\n *\n * The `ToastHostProps` heritage is marked `@vue-ignore` so only `bus` becomes a\n * runtime prop and the rest arrive as attrs; the template hands those to\n * `<ToastHost>`, which declares them and resolves them back into props. Consumers\n * still get the full checked surface, because the heritage is real to\n * TypeScript — it is only the SFC compiler's runtime-props pass that skips it.\n */\nexport interface FeedbackToastHostProps extends /* @vue-ignore */ ToastHostProps {\n /** The bus to render. Default: the app-wide `feedbackBus` singleton (what `notify()` publishes on). */\n readonly bus?: FeedbackBus;\n}\n\n/**\n * Maps a bus notice onto the imperative toast payload. `NoticeTone` is a subset of the toast\n * `Severity` vocabulary and `NoticeNode` is `ToastNode` — drift in either is a compile error.\n */\nfunction toToastOptions(notice: PublishedNotice): ToastOptions {\n return {\n title: notice.title,\n description: notice.description,\n severity: notice.tone,\n duration: notice.durationMs,\n action: notice.action,\n report: notice.report,\n };\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs, watch } from 'vue';\nimport { feedbackBus, NoticeCategory } from '../../../feedback';\nimport ToastHost from '../toastHost/ToastHost.vue';\nimport { toastHost } from '../toastHost';\n\n/**\n * Renders the toast viewport and forwards every `/feedback` bus notice into `toastHost.toast()`.\n * All `ToastHostProps` pass through. Mount once per app **in place of** a bare `<ToastHost/>` —\n * mounting both would render every toast twice. Nothing toasts until this (or another subscriber)\n * is mounted; notices published before mount are dropped, so mount it at the app root.\n */\ndefineOptions({ name: 'FeedbackToastHost', inheritAttrs: false });\n\nconst props = defineProps<FeedbackToastHostProps>();\n\nconst attrs = useAttrs();\n\n/** A `computed` keeps the fallback reactive, so a swapped `bus` re-subscribes. */\nconst bus = computed(() => props.bus ?? feedbackBus);\n\n/*\n * React's `useEffect(() => bus.subscribe(...), [bus])`: `onCleanup` receives the\n * unsubscribe, so a changed `bus` drops the old subscription before opening the\n * new one, and scope disposal drops the last.\n */\nwatch(\n bus,\n (current, _previous, onCleanup) => {\n // Client-only, as the effect was: a server render has no viewport to forward into.\n if (typeof document === 'undefined') return;\n const toastIds = new Map<string, string>();\n const close = (id: string | null): void => {\n if (id !== null) {\n const toastId = toastIds.get(id);\n if (toastId) toastHost.dismiss(toastId);\n return;\n }\n for (const toastId of [...toastIds.values()]) toastHost.dismiss(toastId);\n };\n const unsubscribe = current.subscribe((notice) => {\n const options: ToastOptions = {\n ...toToastOptions(notice),\n onDelete: notice.category === NoticeCategory.Retained ? () => current.remove(notice.id) : undefined,\n onDismiss: () => {\n toastIds.delete(notice.id);\n },\n };\n const existing = toastIds.get(notice.id);\n if (existing) toastHost.update(existing, options);\n else toastIds.set(notice.id, toastHost.toast(options));\n });\n const unsubscribeDismiss = current.subscribeDismiss(close);\n onCleanup(() => {\n unsubscribe();\n unsubscribeDismiss();\n close(null);\n });\n },\n { immediate: true },\n);\n</script>\n\n<template>\n <!-- Every non-`bus` attr is a `ToastHost` prop by construction — see `FeedbackToastHostProps`. -->\n <ToastHost v-bind=\"attrs\" />\n</template>\n"],"names":["_openBlock","_createBlock","ToastHost","_unref"],"mappings":";;;AAsBA,SAAS,eAAe,QAAuC;AAC7D,SAAO;AAAA,IACL,OAAO,OAAO;AAAA,IACd,aAAa,OAAO;AAAA,IACpB,UAAU,OAAO;AAAA,IACjB,UAAU,OAAO;AAAA,IACjB,QAAQ,OAAO;AAAA,IACf,QAAQ,OA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"sourcesContent":["<script lang=\"ts\">\nimport { computed, Fragment, h, shallowRef, TransitionGroup, useAttrs, useId, watch, type ShallowRef } from 'vue';\n\nimport {\n feedbackBus,\n NoticeCategory,\n NoticePriority,\n NoticePriorityRank,\n NoticeTone,\n type FeedbackBus,\n type PublishedNotice,\n} from '../../../feedback';\nimport { toastHost, type ToastHostProps, type ToastOptions } from '../toastHost';\n\n/** Defines props for the bus-fed toast viewport — `bus` plus every `ToastHost` prop. */\nexport interface FeedbackToastHostProps extends /* @vue-ignore */ ToastHostProps {\n /** The bus to render. Default: the app-wide `feedbackBus` singleton (what `notify()` publishes on). */\n readonly bus?: FeedbackBus;\n}\n\n/** @internal A live toast and the notices it stands for. */\ninterface LiveToast {\n id?: string;\n readonly groupKey?: string;\n readonly notices: Map<string, PublishedNotice>;\n readonly pending: ShallowRef<number>;\n}\n\n/** @internal Maps a bus notice onto the toast payload. */\nfunction toToastOptions(notice: PublishedNotice): ToastOptions {\n return {\n title: notice.title,\n description: notice.description,\n compact: notice.compact,\n details: notice.details,\n severity: notice.tone,\n priority: notice.priority,\n duration: notice.durationMs,\n expiresAtMs: notice.expiresAtMs,\n canPin: notice.canPin,\n action: notice.action,\n report: notice.report,\n progress: notice.progress,\n };\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { ElementTag } from '../../../foundation/dom';\nimport { useLocale } from '../../../foundation/i18n';\nimport ReportAction from '../reportAction/ReportAction.vue';\nimport ToastContent from '../toast/ToastContent.vue';\nimport ToastRunningProgress from '../toast/ToastRunningProgress.vue';\nimport ToastHost from '../toastHost/ToastHost.vue';\nimport RemindLaterButton from './RemindLaterButton.vue';\n\n/**\n * Renders the app's transient notification stack from the feedback bus; every `ToastHostProps` prop passes through.\n * Mount once per app at the root, in place of a bare `<ToastHost/>`; notices published before mount are dropped.\n */\ndefineOptions({ name: 'FeedbackToastHost', inheritAttrs: false });\n\nconst props = defineProps<FeedbackToastHostProps>();\n\nconst attrs = useAttrs();\nconst locale = useLocale();\nconst rowIdBase = useId();\n\n/** The bus in use — the prop, else the app-wide `feedbackBus`. */\nconst bus = computed(() => props.bus ?? feedbackBus);\n\n/** Syncs the bus's notices into the toast store, resubscribing when `bus` changes. */\nwatch(\n bus,\n (current, _previous, onCleanup) => {\n // Client-only — a server render has no viewport to forward into.\n if (typeof document === 'undefined') return;\n const members = new Map<string, LiveToast>();\n const groups = new Map<string, LiveToast>();\n let active = true;\n\n function forget(entry: LiveToast): void {\n if (entry.groupKey && groups.get(entry.groupKey) === entry) groups.delete(entry.groupKey);\n for (const id of entry.notices.keys()) {\n if (members.get(id) === entry) members.delete(id);\n }\n }\n\n function reminderFor(entry: LiveToast, notice: PublishedNotice) {\n const remind = current.remindLater;\n if (!remind || !notice.reminderKey || Number.isFinite(notice.expiresAtMs)) return undefined;\n return h(RemindLaterButton, {\n key: notice.id,\n schedule: async () => {\n entry.pending.value += 1;\n try {\n await remind(notice);\n if (active) {\n current.notify({\n tone: NoticeTone.Info,\n title: locale.t('FeedbackToastHost.reminderScheduled', undefined, 'Reminder scheduled.'),\n canPin: false,\n });\n }\n } finally {\n entry.pending.value -= 1;\n }\n },\n });\n }\n\n function renderGroup(entry: LiveToast, rows: ReadonlyArray<PublishedNotice>) {\n return h(\n TransitionGroup,\n {\n tag: ElementTag.Ul,\n class: 'divide-y divide-border px-3',\n enterActiveClass:\n 'motion-safe:transition-[opacity,translate] motion-safe:duration-(--toast-group-duration) ease-out',\n enterFromClass: 'motion-safe:translate-y-2 motion-safe:opacity-0',\n },\n {\n default: () =>\n [...rows].reverse().map((notice) => {\n const reminder = reminderFor(entry, notice);\n const report = notice.report ? h(ReportAction, { send: notice.report }) : undefined;\n const copy = notice.compact ?? notice;\n const running = notice.progress;\n const titleId = `${rowIdBase}-title-${notice.id}`;\n return h(ElementTag.Li, { key: notice.id, 'data-toast-group-row': notice.id, class: 'py-1.5' }, [\n h(\n ToastContent,\n { isCompact: true, titleId },\n {\n title: () => copy.title,\n description: copy.description ? () => copy.description : undefined,\n progress: running\n ? () =>\n h(ToastRunningProgress, {\n progress: running,\n severity: notice.tone,\n isCompact: true,\n 'aria-labelledby': titleId,\n })\n : undefined,\n actions: notice.action || reminder || report ? () => [notice.action, reminder, report] : undefined,\n default: notice.details ? () => notice.details : undefined,\n },\n ),\n ]);\n }),\n },\n );\n }\n\n function render(entry: LiveToast): void {\n const rows = [...entry.notices.values()];\n const first = rows[0];\n if (!first) {\n forget(entry);\n if (entry.id) toastHost.dismiss(entry.id);\n return;\n }\n const options: ToastOptions = {\n ...toToastOptions(first),\n pauseExpiry: () => entry.pending.value > 0,\n onDismiss: () => forget(entry),\n };\n if (entry.groupKey) {\n const latest = rows.at(-1) ?? first;\n options.group = {\n count: rows.length,\n latest: {\n title: typeof latest.title === 'string' ? latest.title : undefined,\n description: typeof latest.description === 'string' ? latest.description : undefined,\n severity: latest.tone,\n },\n };\n }\n if (rows.length === 1) {\n const reminder = reminderFor(entry, first);\n if (reminder) options.action = h(Fragment, null, [first.action, reminder]);\n options.onDelete = first.category === NoticeCategory.Retained ? () => current.remove(first.id) : undefined;\n } else {\n options.title = first.group?.title ?? first.title;\n options.description = locale.t(\n 'FeedbackToastHost.groupedCount',\n { count: rows.length },\n '{count} notifications',\n );\n options.details = renderGroup(entry, rows);\n options.compact = undefined;\n options.canPin = rows.some((notice) => notice.canPin === false) ? false : first.canPin;\n // The highest explicit priority; unclassified members leave the host's severity durations in charge.\n options.priority = rows.reduce<NoticePriority | undefined>((highest, { priority }) => {\n if (priority === undefined) return highest;\n return highest === undefined || NoticePriorityRank[priority] > NoticePriorityRank[highest]\n ? priority\n : highest;\n }, undefined);\n options.action = undefined;\n options.report = undefined;\n options.progress = undefined;\n options.onDelete = undefined;\n // Rows own their progress; the card stays up while any member runs and takes its duration back after.\n if (rows.some((notice) => notice.progress)) options.duration = Infinity;\n }\n if (entry.id) toastHost.update(entry.id, options);\n else entry.id = toastHost.toast(options);\n }\n\n function removeMember(id: string, entry: LiveToast): void {\n members.delete(id);\n entry.notices.delete(id);\n render(entry);\n }\n\n function close(id: string | null): void {\n if (id !== null) {\n const entry = members.get(id);\n if (entry) removeMember(id, entry);\n return;\n }\n for (const entry of new Set(members.values())) if (entry.id) toastHost.dismiss(entry.id);\n }\n\n const unsubscribe = current.subscribe((notice) => {\n if (current.suppresses(notice)) return;\n const groupKey = Number.isFinite(notice.expiresAtMs) ? undefined : notice.group?.key || undefined;\n let entry = members.get(notice.id);\n if (entry && entry.groupKey !== groupKey) {\n removeMember(notice.id, entry);\n entry = undefined;\n }\n entry ??= groupKey ? groups.get(groupKey) : undefined;\n if (!entry) {\n entry = { groupKey, notices: new Map(), pending: shallowRef(0) };\n if (groupKey) groups.set(groupKey, entry);\n }\n members.set(notice.id, entry);\n entry.notices.set(notice.id, notice);\n render(entry);\n });\n const unsubscribeDismiss = current.subscribeDismiss(close);\n onCleanup(() => {\n active = false;\n unsubscribe();\n unsubscribeDismiss();\n close(null);\n });\n },\n { immediate: true },\n);\n</script>\n\n<template>\n <!-- Every non-`bus` attr is a `ToastHost` prop by construction — see `FeedbackToastHostProps`. -->\n <ToastHost v-bind=\"attrs\" />\n</template>\n"],"names":["RemindLaterButton","ReportAction","ToastContent","ToastRunningProgress","_openBlock","_createBlock","ToastHost","_unref"],"mappings":";;;;;;;;;;AA6BA,SAAS,eAAe,QAAuC;AAC7D,SAAO;AAAA,IACL,OAAO,OAAO;AAAA,IACd,aAAa,OAAO;AAAA,IACpB,SAAS,OAAO;AAAA,IAChB,SAAS,OAAO;AAAA,IAChB,UAAU,OAAO;AAAA,IACjB,UAAU,OAAO;AAAA,IACjB,UAAU,OAAO;AAAA,IACjB,aAAa,OAAO;AAAA,IACpB,QAAQ,OAAO;AAAA,IACf,QAAQ,OAAO;AAAA,IACf,QAAQ,OAAO;AAAA,IACf,UAAU,OAAO;AAAA,EAAA;AAErB;;;;;;;;AAkBA,UAAM,QAAQ;AAEd,UAAM,QAAQ,SAAA;AACd,UAAM,SAAS,UAAA;AACf,UAAM,YAAY,MA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lB,aAAAC,UAAA,GAAAC,YAA4BC,+CAATC,MAAA,KAAA,CAAK,CAAA,GAAA,MAAA,EAAA;AAAA;;;"}
@@ -0,0 +1,7 @@
1
+ /** Defines props for the Remind later button of a bus notice. */
2
+ export interface RemindLaterButtonProps {
3
+ /** Schedules the reminder. A rejection shows the retry hint and keeps the button available. */
4
+ readonly schedule: () => Promise<void>;
5
+ }
6
+ declare const _default: import('vue').DefineComponent<RemindLaterButtonProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<RemindLaterButtonProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
7
+ export default _default;
@@ -0,0 +1,56 @@
1
+ import { defineComponent, shallowRef, openBlock, createElementBlock, createVNode, unref, withCtx, createTextVNode, toDisplayString, createCommentVNode } from "vue";
2
+ import { useLocale } from "../../../foundation/i18n/providers/LocaleContext.js";
3
+ import _sfc_main$1 from "../../actions/button/Button.vue.js";
4
+ const _hoisted_1 = { class: "flex flex-wrap items-center gap-2" };
5
+ const _hoisted_2 = {
6
+ key: 0,
7
+ role: "status",
8
+ class: "text-xs text-destructive-soft-foreground"
9
+ };
10
+ const _sfc_main = /* @__PURE__ */ defineComponent({
11
+ ...{ name: "RemindLaterButton" },
12
+ __name: "RemindLaterButton",
13
+ props: {
14
+ schedule: { type: Function }
15
+ },
16
+ setup(__props) {
17
+ const props = __props;
18
+ const locale = useLocale();
19
+ const pending = shallowRef(false);
20
+ const failed = shallowRef(false);
21
+ async function remind(event) {
22
+ event.currentTarget?.focus();
23
+ if (pending.value) return;
24
+ pending.value = true;
25
+ failed.value = false;
26
+ try {
27
+ await props.schedule();
28
+ } catch {
29
+ failed.value = true;
30
+ } finally {
31
+ pending.value = false;
32
+ }
33
+ }
34
+ return (_ctx, _cache) => {
35
+ return openBlock(), createElementBlock("div", _hoisted_1, [
36
+ createVNode(unref(_sfc_main$1), {
37
+ size: "xs",
38
+ variant: "outline",
39
+ "is-loading": pending.value,
40
+ "loading-text": unref(locale).t("FeedbackToastHost.schedulingReminder", void 0, "Scheduling…"),
41
+ onClick: remind
42
+ }, {
43
+ default: withCtx(() => [
44
+ createTextVNode(toDisplayString(unref(locale).t("FeedbackToastHost.remindLater", void 0, "Remind later")), 1)
45
+ ]),
46
+ _: 1
47
+ }, 8, ["is-loading", "loading-text"]),
48
+ failed.value ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(unref(locale).t("FeedbackToastHost.reminderFailed", void 0, "Could not schedule the reminder. Try again.")), 1)) : createCommentVNode("", true)
49
+ ]);
50
+ };
51
+ }
52
+ });
53
+ export {
54
+ _sfc_main as default
55
+ };
56
+ //# sourceMappingURL=RemindLaterButton.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RemindLaterButton.vue.js","sources":["../../../../src/presentation/feedback/feedbackToastHost/RemindLaterButton.vue"],"sourcesContent":["<script lang=\"ts\">\n/** Defines props for the Remind later button of a bus notice. */\nexport interface RemindLaterButtonProps {\n /** Schedules the reminder. A rejection shows the retry hint and keeps the button available. */\n readonly schedule: () => Promise<void>;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { shallowRef } from 'vue';\n\nimport { useLocale } from '../../../foundation/i18n';\nimport { Button } from '../../actions/button';\n\n/** Renders the Remind later button of a bus notice: loading while the scheduler runs, a status line on failure. */\ndefineOptions({ name: 'RemindLaterButton' });\n\nconst props = defineProps<RemindLaterButtonProps>();\n\nconst locale = useLocale();\nconst pending = shallowRef(false);\nconst failed = shallowRef(false);\n\n/** Runs the scheduler, holding the button while it runs and flagging a rejection. */\nasync function remind(event: MouseEvent): Promise<void> {\n (event.currentTarget as HTMLElement | null)?.focus();\n if (pending.value) return;\n pending.value = true;\n failed.value = false;\n try {\n await props.schedule();\n } catch {\n failed.value = true;\n } finally {\n pending.value = false;\n }\n}\n</script>\n\n<template>\n <div class=\"flex flex-wrap items-center gap-2\">\n <Button\n size=\"xs\"\n variant=\"outline\"\n :is-loading=\"pending\"\n :loading-text=\"locale.t('FeedbackToastHost.schedulingReminder', undefined, 'Scheduling…')\"\n @click=\"remind\"\n >\n {{ locale.t('FeedbackToastHost.remindLater', undefined, 'Remind later') }}\n </Button>\n <span v-if=\"failed\" role=\"status\" class=\"text-xs text-destructive-soft-foreground\">\n {{ locale.t('FeedbackToastHost.reminderFailed', undefined, 'Could not schedule the reminder. Try again.') }}\n </span>\n </div>\n</template>\n"],"names":["_openBlock","_createElementBlock","_createVNode","_unref","Button","_toDisplayString"],"mappings":";;;;;;;;;;;;;;;;AAiBA,UAAM,QAAQ;AAEd,UAAM,SAAS,UAAA;AACf,UAAM,UAAU,WAAW,KAAK;AAChC,UAAM,SAAS,WAAW,KAAK;AAG/B,mBAAe,OAAO,OAAkC;AACrD,YAAM,eAAsC,MAAA;AAC7C,UAAI,QAAQ,MAAO;AACnB,cAAQ,QAAQ;AAChB,aAAO,QAAQ;AACf,UAAI;AACF,cAAM,MAAM,SAAA;AAAA,MACd,QAAQ;AACN,eAAO,QAAQ;AAAA,MACjB,UAAA;AACE,gBAAQ,QAAQ;AAAA,MAClB;AAAA,IACF;;AAIE,aAAAA,UAAA,GAAAC,mBAaM,OAbN,YAaM;AAAA,QAZJC,YAQSC,MAAAC,WAAA,GAAA;AAAA,UAPP,MAAK;AAAA,UACL,SAAQ;AAAA,UACP,cAAY,QAAA;AAAA,UACZ,gBAAcD,MAAA,MAAA,EAAO,0CAA0C,QAAS,aAAA;AAAA,UACxE,SAAO;AAAA,QAAA;2BAER,MAA0E;AAAA,4CAAvEA,MAAA,MAAA,EAAO,EAAC,iCAAkC,QAAS,cAAA,CAAA,GAAA,CAAA;AAAA,UAAA;;;QAE5C,OAAA,SAAZH,aAAAC,mBAEO,QAFP,YAEOI,gBADFF,cAAO,sCAAsC,QAAS,6CAAA,CAAA,GAAA,CAAA;;;;;"}
@@ -0,0 +1,5 @@
1
+ import _sfc_main from "./RemindLaterButton.vue.js";
2
+ export {
3
+ _sfc_main as default
4
+ };
5
+ //# sourceMappingURL=RemindLaterButton2.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RemindLaterButton2.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,4 +1,7 @@
1
- import { DefaultToastDurations, default as default2, ToastTimer, toastHost, useToastHost } from "./toastHost/ToastHost.vue.js";
1
+ import { ToastGroupMotion, default as default2, ToastMotion, ToastTimer } from "./toastHost/ToastHost.vue.js";
2
+ import { toastHost } from "./toastHost/ToastHostStore.js";
3
+ import { DefaultToastDurations, DefaultToastPriorityDurations } from "./toastHost/UseResolvedToasts.js";
4
+ import { useToastHost } from "./toastHost/UseToastHost.js";
2
5
  import { default as default3 } from "./alert/Alert.vue.js";
3
6
  import { default as default4 } from "./alertSimple/AlertSimple.vue.js";
4
7
  import { default as default5 } from "./banner/Banner.vue.js";
@@ -34,6 +37,7 @@ import { default as default34, TypingTone } from "./typingIndicator/TypingIndica
34
37
  import { default as default35 } from "./undoBar/UndoBar.vue.js";
35
38
  import { SkeletonStateAnimation, SkeletonStateShape, skeletonBoxClass, skeletonLineClass, skeletonPaintClass, skeletonSlotVariants, skeletonVariants } from "./skeletonState/SkeletonState.variants.js";
36
39
  import { SpinnerTone, spinnerVariants } from "./spinner/Spinner.variants.js";
40
+ import { ToastSurface } from "./toast/ToastSurface.js";
37
41
  import { alertSimpleVariants } from "./alertSimple/AlertSimple.variants.js";
38
42
  import { bannerSimpleVariants } from "./bannerSimple/BannerSimple.variants.js";
39
43
  import { progressFillVariants, progressTrackVariants } from "./progressBar/ProgressBar.variants.js";
@@ -50,6 +54,7 @@ export {
50
54
  default9 as DataRegion,
51
55
  DataRegionState,
52
56
  DefaultToastDurations,
57
+ DefaultToastPriorityDurations,
53
58
  default10 as ErrorBoundary,
54
59
  default11 as FeedbackToastHost,
55
60
  default12 as FieldErrorCallout,
@@ -77,8 +82,11 @@ export {
77
82
  default29 as SplashScreen,
78
83
  default30 as StatusIndicator,
79
84
  default31 as Toast,
85
+ ToastGroupMotion,
80
86
  default2 as ToastHost,
87
+ ToastMotion,
81
88
  default32 as ToastSimple,
89
+ ToastSurface,
82
90
  ToastTimer,
83
91
  default33 as TrendIndicator,
84
92
  default34 as TypingIndicator,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,4 +1,7 @@
1
+ import { NoticeProgress } from '../../../feedback';
1
2
  import { Severity } from '../../../foundation/styles';
3
+ import { ToastSurface } from './ToastSurface';
4
+ /** Defines props for the toast card. */
2
5
  export interface ToastProps {
3
6
  /** The semantic severity palette. */
4
7
  readonly severity?: Severity;
@@ -14,21 +17,40 @@ export interface ToastProps {
14
17
  readonly closeLabel?: string;
15
18
  /** The accessible label for removing a retained notice. Default "Delete notification". */
16
19
  readonly deleteLabel?: string;
17
- /**
18
- * Shows the severity's own glyph when no `icon` is given — a distinct shape per severity, so the meaning
19
- * never rests on colour alone. `neutral` has none. Default `true`.
20
- */
20
+ /** The pin toggle's pressed state; the toggle renders only when this is supplied. */
21
+ readonly isPinned?: boolean;
22
+ /** The accessible label for the pin toggle. Default "Pin notification". */
23
+ readonly pinLabel?: string;
24
+ /** The tooltip shown on a pinned toggle. Default "Unpin notification". */
25
+ readonly unpinLabel?: string;
26
+ /** The details disclosure's open state; supplying it makes the disclosure controlled. */
27
+ readonly detailsOpen?: boolean;
28
+ /** The compact layout, which places actions alongside the copy and wraps them as space requires. */
29
+ readonly isCompact?: boolean;
30
+ /** @internal The grouped layout, which fits the details viewport to at most three complete rows. */
31
+ readonly isGrouped?: boolean;
32
+ /** The switch for the severity's own glyph, shown when no `icon` is given; `neutral` has none. Default `true`. */
21
33
  readonly showSeverityIcon?: boolean;
34
+ /** The card material. Default `ToastSurface.Solid`. */
35
+ readonly surface?: ToastSurface;
36
+ /** The running operation's progress, shown under the copy when supplied. */
37
+ readonly progress?: NoticeProgress;
38
+ /** Fires when the close button is activated; the button renders only when this is supplied. */
39
+ readonly onClose?: () => void;
40
+ /** Fires when the delete button is activated; the button renders only when this is supplied. */
41
+ readonly onDelete?: () => void;
22
42
  }
23
43
  declare const _default: __VLS_WithSlots<import('vue').DefineComponent<ToastProps, {
24
44
  el: import('vue').ComputedRef<HTMLDivElement | null>;
25
45
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
26
- delete: () => any;
27
- close: () => any;
46
+ togglePin: () => any;
47
+ "update:detailsOpen": (value: boolean) => any;
28
48
  }, string, import('vue').PublicProps, Readonly<ToastProps> & Readonly<{
29
- onDelete?: (() => any) | undefined;
30
- onClose?: (() => any) | undefined;
49
+ onTogglePin?: (() => any) | undefined;
50
+ "onUpdate:detailsOpen"?: ((value: boolean) => any) | undefined;
31
51
  }>, {
52
+ readonly isPinned: boolean;
53
+ readonly detailsOpen: boolean;
32
54
  readonly showSeverityIcon: boolean;
33
55
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, {
34
56
  /** The extra content below the description. */
@@ -41,8 +63,12 @@ declare const _default: __VLS_WithSlots<import('vue').DefineComponent<ToastProps
41
63
  description?(): unknown;
42
64
  /** The action row. Falls back to the `actions` prop. */
43
65
  actions?(): unknown;
66
+ /** Extra content shown on demand below the summary and its controls. */
67
+ details?(): unknown;
44
68
  /** The adornment beside the close button — a countdown, a timestamp. */
45
69
  trailing?(): unknown;
70
+ /** The decorative indicator wrapping the close glyph. */
71
+ closeIndicator?(): unknown;
46
72
  }>;
47
73
  export default _default;
48
74
  type __VLS_WithSlots<T, S> = T & {