@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
@@ -0,0 +1,18 @@
1
+ import { FeedbackBus } from '../../../feedback';
2
+ /** Defines props for the notification center's bell button. */
3
+ export interface NotificationCenterButtonProps {
4
+ /** The bus whose unread count and pop-up pause the bell shows. */
5
+ readonly bus: FeedbackBus;
6
+ /** The open state of the panel the bell controls; an open panel hides the unread badge and, on close, marks read. */
7
+ readonly isExpanded?: boolean;
8
+ /** The accessible name before the unread and pause suffixes. Default `"Notifications"`. */
9
+ readonly label?: string;
10
+ }
11
+ declare const _default: import('vue').DefineComponent<NotificationCenterButtonProps, {
12
+ el: import('vue').ComputedRef<HTMLElement | null>;
13
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
14
+ toggle: () => any;
15
+ }, string, import('vue').PublicProps, Readonly<NotificationCenterButtonProps> & Readonly<{
16
+ onToggle?: (() => any) | undefined;
17
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
18
+ export default _default;
@@ -0,0 +1,120 @@
1
+ import { defineComponent, useTemplateRef, shallowRef, computed, watch, onUnmounted, openBlock, createBlock, unref, normalizeClass, withCtx, createElementVNode, createVNode, createElementBlock, toDisplayString, createCommentVNode } from "vue";
2
+ import { BellOff, Bell } from "lucide-vue-next";
3
+ import { animate } from "../../../foundation/animation/Animate.js";
4
+ import { useReducedMotion } from "../../../foundation/device/hooks/UseReducedMotion.js";
5
+ import { useLocale } from "../../../foundation/i18n/providers/LocaleContext.js";
6
+ import _sfc_main$1 from "../../actions/button/Button.vue.js";
7
+ import _sfc_main$2 from "../../../foundation/icons/icon/Icon.vue.js";
8
+ const CueClasses = [
9
+ "pointer-events-none absolute inset-0 rounded-full border border-primary/60 bg-primary/20 opacity-0",
10
+ "forced-colors:border-[Highlight]"
11
+ ];
12
+ const UnreadBadgeClasses = [
13
+ "pointer-events-none absolute -end-0.5 -top-0.5 grid min-w-4 place-items-center rounded-full bg-primary px-1",
14
+ "text-[10px] leading-4 font-semibold text-primary-foreground tabular-nums ring-2 ring-background"
15
+ ];
16
+ const _sfc_main = /* @__PURE__ */ defineComponent({
17
+ ...{ name: "NotificationCenterButton" },
18
+ __name: "NotificationCenterButton",
19
+ props: {
20
+ bus: {},
21
+ isExpanded: { type: Boolean },
22
+ label: {}
23
+ },
24
+ emits: ["toggle"],
25
+ setup(__props, { expose: __expose, emit: __emit }) {
26
+ const props = __props;
27
+ const emit = __emit;
28
+ const locale = useLocale();
29
+ const reducedMotion = useReducedMotion();
30
+ const button = useTemplateRef("button");
31
+ const cue = useTemplateRef("cue");
32
+ const state = shallowRef(props.bus.notificationState());
33
+ let openBus;
34
+ const isPaused = computed(() => state.value.pausedUntil !== null);
35
+ const unreadCount = computed(() => props.isExpanded ? 0 : state.value.unreadCount);
36
+ const name = computed(() => {
37
+ let label = props.label ?? locale.t("NotificationCenterButton.label", void 0, "Notifications");
38
+ const count = unreadCount.value;
39
+ if (count > 0) label = locale.t("NotificationCenterButton.unread", { label, count }, "{label}, {count} unread");
40
+ return isPaused.value ? locale.t("NotificationCenterButton.paused", { label }, "{label}, pop-ups paused") : label;
41
+ });
42
+ __expose({ el: computed(() => button.value?.el ?? null) });
43
+ watch(
44
+ () => props.bus,
45
+ (bus, _previous, onCleanup) => {
46
+ state.value = bus.notificationState();
47
+ if (typeof document === "undefined") return;
48
+ let pulse;
49
+ const stopState = bus.subscribeNotificationState((next) => {
50
+ state.value = next;
51
+ if (next.pausedUntil === null) pulse?.cancel();
52
+ });
53
+ const stopDelivery = bus.subscribe((notice) => {
54
+ if (!bus.suppresses(notice)) return;
55
+ pulse?.cancel();
56
+ pulse = animate(
57
+ cue.value,
58
+ reducedMotion.value ? [{ opacity: 1 }, { opacity: 1 }] : [{ opacity: 0 }, { opacity: 1, offset: 0.08 }, { opacity: 1, offset: 0.25 }, { opacity: 0 }],
59
+ { duration: reducedMotion.value ? 600 : 1200, easing: "linear" }
60
+ );
61
+ });
62
+ onCleanup(() => {
63
+ pulse?.cancel();
64
+ stopState();
65
+ stopDelivery();
66
+ });
67
+ },
68
+ { immediate: true }
69
+ );
70
+ watch(
71
+ [() => props.bus, () => props.isExpanded],
72
+ ([bus, expanded]) => {
73
+ if (typeof document === "undefined") return;
74
+ if (openBus && (openBus !== bus || !expanded)) openBus.markNotificationsRead();
75
+ openBus = expanded ? bus : void 0;
76
+ },
77
+ { immediate: true }
78
+ );
79
+ onUnmounted(() => openBus?.markNotificationsRead());
80
+ return (_ctx, _cache) => {
81
+ return openBlock(), createBlock(unref(_sfc_main$1), {
82
+ ref_key: "button",
83
+ ref: button,
84
+ variant: props.isExpanded ? "soft" : "ghost",
85
+ size: "sm",
86
+ shape: "circle",
87
+ class: normalizeClass(["relative shrink-0 pointer-coarse:size-11", isPaused.value && "text-muted-foreground"]),
88
+ "aria-label": name.value,
89
+ "aria-expanded": props.isExpanded ?? false,
90
+ onClick: _cache[0] || (_cache[0] = ($event) => emit("toggle"))
91
+ }, {
92
+ default: withCtx(() => [
93
+ createElementVNode("span", {
94
+ ref_key: "cue",
95
+ ref: cue,
96
+ "aria-hidden": "true",
97
+ "data-notification-cue": "",
98
+ class: normalizeClass(CueClasses)
99
+ }, null, 512),
100
+ createVNode(unref(_sfc_main$2), {
101
+ icon: isPaused.value ? unref(BellOff) : unref(Bell),
102
+ size: 16,
103
+ class: "relative"
104
+ }, null, 8, ["icon"]),
105
+ unreadCount.value ? (openBlock(), createElementBlock("span", {
106
+ key: 0,
107
+ "aria-hidden": "true",
108
+ "data-notification-unread": "",
109
+ class: normalizeClass(UnreadBadgeClasses)
110
+ }, toDisplayString(unreadCount.value > 99 ? "99+" : unreadCount.value), 1)) : createCommentVNode("", true)
111
+ ]),
112
+ _: 1
113
+ }, 8, ["variant", "class", "aria-label", "aria-expanded"]);
114
+ };
115
+ }
116
+ });
117
+ export {
118
+ _sfc_main as default
119
+ };
120
+ //# sourceMappingURL=NotificationCenterButton.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotificationCenterButton.vue.js","sources":["../../../../src/presentation/display/notificationCenterGroup/NotificationCenterButton.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { FeedbackBus } from '../../../feedback';\n\n/** Defines props for the notification center's bell button. */\nexport interface NotificationCenterButtonProps {\n /** The bus whose unread count and pop-up pause the bell shows. */\n readonly bus: FeedbackBus;\n\n /** The open state of the panel the bell controls; an open panel hides the unread badge and, on close, marks read. */\n readonly isExpanded?: boolean;\n\n /** The accessible name before the unread and pause suffixes. Default `\"Notifications\"`. */\n readonly label?: string;\n}\n\n/** @internal The classes of the pause cue that pulses when a notice is suppressed. */\nconst CueClasses = [\n 'pointer-events-none absolute inset-0 rounded-full border border-primary/60 bg-primary/20 opacity-0',\n 'forced-colors:border-[Highlight]',\n];\n\n/** @internal The classes of the unread count badge. */\nconst UnreadBadgeClasses = [\n 'pointer-events-none absolute -end-0.5 -top-0.5 grid min-w-4 place-items-center rounded-full bg-primary px-1',\n 'text-[10px] leading-4 font-semibold text-primary-foreground tabular-nums ring-2 ring-background',\n];\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, onUnmounted, shallowRef, useTemplateRef, watch } from 'vue';\nimport { Bell, BellOff } from 'lucide-vue-next';\n\nimport { animate, type AnimationHandle } from '../../../foundation/animation';\nimport { useReducedMotion } from '../../../foundation/device';\nimport { useLocale } from '../../../foundation/i18n';\nimport { Icon } from '../../../foundation/icons';\nimport { Button } from '../../actions/button';\n\n/** Renders the notification bell with its unread count and pop-up pause cue. Pass `aria-controls` for its panel. */\ndefineOptions({ name: 'NotificationCenterButton' });\n\nconst props = defineProps<NotificationCenterButtonProps>();\n\nconst emit = defineEmits<{\n /** Requests opening or closing the notification panel. */\n toggle: [];\n}>();\n\nconst locale = useLocale();\nconst reducedMotion = useReducedMotion();\nconst button = useTemplateRef<InstanceType<typeof Button>>('button');\nconst cue = useTemplateRef<HTMLSpanElement>('cue');\n\nconst state = shallowRef(props.bus.notificationState());\nlet openBus: FeedbackBus | undefined;\n\nconst isPaused = computed(() => state.value.pausedUntil !== null);\nconst unreadCount = computed(() => (props.isExpanded ? 0 : state.value.unreadCount));\nconst name = computed(() => {\n let label = props.label ?? locale.t('NotificationCenterButton.label', undefined, 'Notifications');\n const count = unreadCount.value;\n if (count > 0) label = locale.t('NotificationCenterButton.unread', { label, count }, '{label}, {count} unread');\n return isPaused.value ? locale.t('NotificationCenterButton.paused', { label }, '{label}, pop-ups paused') : label;\n});\n\ndefineExpose({ el: computed(() => button.value?.el ?? null) });\n\n/** Syncs the bus's notification state and pulses the pause cue for each notice the pause suppresses. */\nwatch(\n () => props.bus,\n (bus, _previous, onCleanup) => {\n state.value = bus.notificationState();\n if (typeof document === 'undefined') return;\n let pulse: AnimationHandle | undefined;\n const stopState = bus.subscribeNotificationState((next) => {\n state.value = next;\n if (next.pausedUntil === null) pulse?.cancel();\n });\n const stopDelivery = bus.subscribe((notice) => {\n if (!bus.suppresses(notice)) return;\n pulse?.cancel();\n pulse = animate(\n cue.value,\n reducedMotion.value\n ? [{ opacity: 1 }, { opacity: 1 }]\n : [{ opacity: 0 }, { opacity: 1, offset: 0.08 }, { opacity: 1, offset: 0.25 }, { opacity: 0 }],\n { duration: reducedMotion.value ? 600 : 1200, easing: 'linear' },\n );\n });\n onCleanup(() => {\n pulse?.cancel();\n stopState();\n stopDelivery();\n });\n },\n { immediate: true },\n);\n\n/** Marks the open bus read when its panel closes, another bus replaces it or the bell unmounts. */\nwatch(\n [() => props.bus, () => props.isExpanded],\n ([bus, expanded]) => {\n if (typeof document === 'undefined') return;\n if (openBus && (openBus !== bus || !expanded)) openBus.markNotificationsRead();\n openBus = expanded ? bus : undefined;\n },\n { immediate: true },\n);\n\nonUnmounted(() => openBus?.markNotificationsRead());\n</script>\n\n<template>\n <Button\n ref=\"button\"\n :variant=\"props.isExpanded ? 'soft' : 'ghost'\"\n size=\"sm\"\n shape=\"circle\"\n class=\"relative shrink-0 pointer-coarse:size-11\"\n :class=\"isPaused && 'text-muted-foreground'\"\n :aria-label=\"name\"\n :aria-expanded=\"props.isExpanded ?? false\"\n @click=\"emit('toggle')\"\n >\n <span ref=\"cue\" aria-hidden=\"true\" data-notification-cue :class=\"CueClasses\" />\n <Icon :icon=\"isPaused ? BellOff : Bell\" :size=\"16\" class=\"relative\" />\n <span v-if=\"unreadCount\" aria-hidden=\"true\" data-notification-unread :class=\"UnreadBadgeClasses\">\n {{ unreadCount > 99 ? '99+' : unreadCount }}\n </span>\n </Button>\n</template>\n"],"names":["_createBlock","_unref","Button","_normalizeClass","_createElementVNode","_createVNode","Icon","_createElementBlock","_toDisplayString"],"mappings":"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"}
@@ -0,0 +1,5 @@
1
+ import _sfc_main from "./NotificationCenterButton.vue.js";
2
+ export {
3
+ _sfc_main as default
4
+ };
5
+ //# sourceMappingURL=NotificationCenterButton2.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotificationCenterButton2.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,4 +1,5 @@
1
1
  import { FeedbackBus } from '../../../feedback';
2
+ /** Defines props for the notification center panel. */
2
3
  export interface NotificationCenterGroupProps {
3
4
  /** Explicit bus to browse; omitted keeps the slot-only presentation contract. */
4
5
  readonly bus?: FeedbackBus;
@@ -6,15 +7,19 @@ export interface NotificationCenterGroupProps {
6
7
  readonly title?: string;
7
8
  /** The badge / count rendered next to the title. Rich content → the `count` slot. */
8
9
  readonly count?: string | number;
10
+ /** Shows pause and resume controls for the supplied bus. */
11
+ readonly canPause?: boolean;
12
+ /** Shows the "Clear all" header action for the supplied bus. Default `true`. */
13
+ readonly canClear?: boolean;
14
+ /** Fires when the close button is activated; the button renders only when this is supplied. Never clears. */
15
+ readonly onClose?: () => void;
9
16
  }
10
17
  declare const _default: __VLS_WithSlots<import('vue').DefineComponent<NotificationCenterGroupProps, {
11
18
  el: Readonly<import('vue').ShallowRef<HTMLDivElement | null>>;
12
- }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
13
- close: () => any;
14
- }, string, import('vue').PublicProps, Readonly<NotificationCenterGroupProps> & Readonly<{
15
- onClose?: (() => any) | undefined;
16
- }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, {
17
- /** The `NotificationItem` children filling the scrolling list. */
19
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<NotificationCenterGroupProps> & Readonly<{}>, {
20
+ readonly canClear: boolean;
21
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, {
22
+ /** The `NotificationCenterGroupItem` children filling the scrolling list. */
18
23
  default?(): unknown;
19
24
  /** The header title. Falls back to the `title` prop. */
20
25
  title?(): unknown;
@@ -1,77 +1,118 @@
1
- import { defineComponent, getCurrentInstance, useAttrs, useSlots, useTemplateRef, shallowRef, watch, computed, openBlock, createElementBlock, mergeProps, unref, createElementVNode, renderSlot, createTextVNode, toDisplayString, createCommentVNode, createVNode, Fragment, renderList, createBlock, createSlots, withCtx } from "vue";
1
+ import { defineComponent, useAttrs, useSlots, useTemplateRef, useId, shallowRef, computed, watch, onBeforeUpdate, onUpdated, openBlock, createElementBlock, mergeProps, unref, createElementVNode, renderSlot, createTextVNode, toDisplayString, normalizeClass, createCommentVNode, createVNode, Fragment, renderList, createBlock, createSlots, withCtx, nextTick } from "vue";
2
+ import { CheckCheck, ListX, X, Bell } from "lucide-vue-next";
2
3
  import { useLocale } from "../../../foundation/i18n/providers/LocaleContext.js";
3
4
  import { useLocaleDefaults } from "../../../foundation/i18n/UseLocaleDefaults.js";
4
- import _sfc_main$2 from "./NotificationItem.vue.js";
5
- import _sfc_main$3 from "../../feedback/reportAction/ReportAction.vue.js";
6
- import { X, Bell } from "lucide-vue-next";
7
5
  import { cn } from "../../../foundation/styles/Cn.js";
8
6
  import { surfaceVariants } from "../../../foundation/styles/SurfaceStyles.js";
7
+ import _sfc_main$4 from "../../feedback/progressBar/ProgressBar.vue.js";
8
+ import _sfc_main$5 from "../../feedback/reportAction/ReportAction.vue.js";
9
+ import _sfc_main$3 from "../relativeTime/RelativeTime.vue.js";
10
+ import _sfc_main$2 from "./NotificationCenterGroupItem.vue.js";
9
11
  import _sfc_main$1 from "../../../foundation/icons/icon/Icon.vue.js";
10
12
  import { renderableChildren } from "../../../foundation/primitives/slot/Slot.js";
11
13
  const _hoisted_1 = ["aria-label"];
12
14
  const _hoisted_2 = { class: "flex items-center justify-between gap-2 border-b border-border px-3 py-2.5" };
13
- const _hoisted_3 = { class: "flex items-center gap-2" };
14
- const _hoisted_4 = { class: "text-sm font-semibold" };
15
+ const _hoisted_3 = { class: "flex min-w-0 items-center gap-2" };
16
+ const _hoisted_4 = { class: "truncate text-sm font-semibold" };
15
17
  const _hoisted_5 = {
16
18
  key: 0,
17
- class: "inline-flex items-center justify-center rounded-full bg-primary px-1.5 text-[10px] font-semibold leading-5 text-primary-foreground"
19
+ class: "flex shrink-0 items-center gap-1"
18
20
  };
19
- const _hoisted_6 = {
21
+ const _hoisted_6 = ["aria-label", "title"];
22
+ const _hoisted_7 = ["aria-label", "title"];
23
+ const _hoisted_8 = ["aria-label"];
24
+ const _hoisted_9 = {
20
25
  key: 0,
21
- class: "flex items-center gap-2"
26
+ class: "flex flex-wrap items-center justify-between gap-2 border-b border-border px-3 py-2 text-sm"
22
27
  };
23
- const _hoisted_7 = ["aria-label"];
24
- const _hoisted_8 = { class: "max-h-96 overflow-y-auto py-1" };
25
- const _hoisted_9 = { class: "flex flex-col items-center gap-2 px-4 py-10 text-center text-muted-foreground" };
26
- const _hoisted_10 = { class: "text-sm" };
27
- const _hoisted_11 = {
28
+ const _hoisted_10 = ["for"];
29
+ const _hoisted_11 = ["id", "value"];
30
+ const _hoisted_12 = { value: "on" };
31
+ const _hoisted_13 = {
32
+ key: 0,
33
+ value: "timed",
34
+ disabled: ""
35
+ };
36
+ const _hoisted_14 = { value: "15m" };
37
+ const _hoisted_15 = { value: "1h" };
38
+ const _hoisted_16 = { value: "manual" };
39
+ const _hoisted_17 = { class: "max-h-96 overflow-y-auto py-1" };
40
+ const _hoisted_18 = { class: "flex flex-col items-center gap-2 px-4 py-10 text-center text-muted-foreground" };
41
+ const _hoisted_19 = { class: "text-sm" };
42
+ const _hoisted_20 = {
28
43
  key: 1,
29
44
  class: "flex flex-col"
30
45
  };
31
- const _hoisted_12 = {
46
+ const _hoisted_21 = ["id"];
47
+ const _hoisted_22 = {
32
48
  key: 0,
49
+ class: "mt-1 text-xs text-muted-foreground"
50
+ };
51
+ const _hoisted_23 = {
52
+ key: 1,
33
53
  class: "border-t border-border px-3 py-2 text-center text-xs"
34
54
  };
55
+ const HeaderActionClasses = [
56
+ "inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-muted",
57
+ "hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",
58
+ "pointer-coarse:size-11"
59
+ ];
60
+ const CountBadgeClasses = [
61
+ "inline-flex items-center justify-center rounded-full bg-primary px-1.5 text-[10px] font-semibold leading-5",
62
+ "text-primary-foreground"
63
+ ];
64
+ const PauseSelectClasses = [
65
+ "min-w-0 max-w-full rounded-md border border-border bg-background px-2 py-1",
66
+ "focus-visible:outline-2 focus-visible:outline-ring pointer-coarse:min-h-11"
67
+ ];
68
+ const NoticeNodeView = defineComponent({
69
+ name: "NoticeNodeView",
70
+ props: { node: { type: [String, Object], required: true } },
71
+ setup: (nodeProps) => () => nodeProps.node
72
+ });
35
73
  const _sfc_main = /* @__PURE__ */ defineComponent({
36
74
  ...{ name: "NotificationCenterGroup", inheritAttrs: false },
37
75
  __name: "NotificationCenterGroup",
38
76
  props: {
39
77
  bus: {},
40
78
  title: {},
41
- count: {}
79
+ count: {},
80
+ canPause: { type: Boolean },
81
+ canClear: { type: Boolean, default: true },
82
+ onClose: {}
42
83
  },
43
- emits: ["close"],
44
- setup(__props, { expose: __expose, emit: __emit }) {
45
- const locale = useLocale();
84
+ setup(__props, { expose: __expose }) {
46
85
  const componentProps = __props;
47
86
  const props = useLocaleDefaults(componentProps, "NotificationCenterGroup", { title: "Notifications" });
48
- const emit = __emit;
49
- const instance = getCurrentInstance();
50
- const hasClose = () => Boolean(instance?.vnode.props?.onClose);
87
+ const locale = useLocale();
51
88
  const attrs = useAttrs();
52
89
  const slots = useSlots();
53
90
  const el = useTemplateRef("el");
91
+ const pauseLabelId = useId();
92
+ const rowId = useId();
93
+ const pausedUntil = shallowRef(null);
94
+ const unreadIds = shallowRef(/* @__PURE__ */ new Set());
54
95
  const notices = shallowRef([]);
55
- watch(
56
- () => props.bus,
57
- (bus, _previous, onCleanup) => {
58
- notices.value = bus?.retained() ?? [];
59
- if (bus && typeof document !== "undefined")
60
- onCleanup(
61
- bus.subscribeRetained((snapshot) => {
62
- notices.value = snapshot;
63
- })
64
- );
65
- },
66
- { immediate: true }
67
- );
68
- const isEmpty = () => slots.default ? renderableChildren(slots.default()).length === 0 : notices.value.length === 0;
96
+ const now = shallowRef(Date.now());
97
+ let focusedRow;
69
98
  const resolvedCount = computed(() => props.count ?? (props.bus ? notices.value.length : void 0));
70
- const NoticeNodeView = defineComponent({
71
- name: "NoticeNodeView",
72
- props: { node: { type: [String, Object], required: true } },
73
- setup: (nodeProps) => () => nodeProps.node
99
+ const canMarkRead = computed(() => Boolean(props.bus) && unreadIds.value.size > 0);
100
+ const canClearAll = computed(() => Boolean(props.bus) && props.canClear && notices.value.length > 0);
101
+ const pauseChoice = computed(() => typeof pausedUntil.value === "number" ? "timed" : pausedUntil.value ?? "on");
102
+ const resumeTime = computed(() => {
103
+ if (typeof pausedUntil.value !== "number") return "";
104
+ return new Intl.DateTimeFormat(locale.locale.value, { hour: "numeric", minute: "2-digit" }).format(pausedUntil.value);
74
105
  });
106
+ const rows = computed(
107
+ () => notices.value.map((notice) => ({
108
+ notice,
109
+ isUnread: unreadIds.value.has(notice.id),
110
+ progress: notice.progress ? barProgress(notice.progress) : void 0,
111
+ action: notice.expiresAtMs === void 0 || !Number.isFinite(notice.expiresAtMs) || notice.expiresAtMs > now.value ? notice.historyAction ?? notice.action : void 0
112
+ }))
113
+ );
114
+ const markAllReadLabel = computed(() => locale.t("NotificationCenterGroup.markAllRead", void 0, "Mark all read"));
115
+ const clearAllLabel = computed(() => locale.t("NotificationCenterGroup.clearAll", void 0, "Clear all"));
75
116
  const classes = computed(
76
117
  () => cn("flex w-80 flex-col", surfaceVariants({ variant: "surface", radius: "md" }), attrs.class)
77
118
  );
@@ -80,11 +121,94 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
80
121
  return others;
81
122
  });
82
123
  __expose({ el });
124
+ watch(
125
+ () => props.bus,
126
+ (bus, _previous, onCleanup) => {
127
+ notices.value = bus?.retained() ?? [];
128
+ const initial = bus?.notificationState();
129
+ pausedUntil.value = initial?.pausedUntil ?? null;
130
+ unreadIds.value = new Set(initial?.unreadIds);
131
+ if (!bus || typeof document === "undefined") return;
132
+ const stopHistory = bus.subscribeRetained((snapshot) => {
133
+ notices.value = snapshot;
134
+ });
135
+ const stopState = bus.subscribeNotificationState((state) => {
136
+ pausedUntil.value = state.pausedUntil;
137
+ unreadIds.value = new Set(state.unreadIds);
138
+ });
139
+ onCleanup(() => {
140
+ stopHistory();
141
+ stopState();
142
+ });
143
+ },
144
+ { immediate: true }
145
+ );
146
+ watch(
147
+ notices,
148
+ (entries, _previous, onCleanup) => {
149
+ let timer;
150
+ function updateDeadlines() {
151
+ now.value = Date.now();
152
+ if (typeof window === "undefined") return;
153
+ let next = Infinity;
154
+ for (const entry of entries) {
155
+ const deadline = entry.expiresAtMs;
156
+ if (deadline !== void 0 && deadline > now.value) next = Math.min(next, deadline);
157
+ }
158
+ if (Number.isFinite(next)) timer = setTimeout(updateDeadlines, Math.min(next - now.value, 2147483647));
159
+ }
160
+ updateDeadlines();
161
+ onCleanup(() => clearTimeout(timer));
162
+ },
163
+ { immediate: true }
164
+ );
165
+ onBeforeUpdate(() => {
166
+ const active = document.activeElement;
167
+ if (active && el.value?.contains(active))
168
+ focusedRow = active.closest("[data-notification-history-row]") ?? void 0;
169
+ });
170
+ onUpdated(() => {
171
+ if (focusedRow && document.activeElement === document.body) {
172
+ (focusedRow.isConnected ? focusedRow : el.value)?.focus({ preventScroll: true });
173
+ }
174
+ focusedRow = void 0;
175
+ });
176
+ function titleId(index) {
177
+ return `${rowId}-title-${index}`;
178
+ }
179
+ function isEmpty() {
180
+ return slots.default ? renderableChildren(slots.default()).length === 0 : notices.value.length === 0;
181
+ }
182
+ function changePause(event) {
183
+ const select = event.currentTarget;
184
+ const choice = select.value;
185
+ if (choice === "15m") props.bus?.setToastPause(Date.now() + 15 * 6e4);
186
+ else if (choice === "1h") props.bus?.setToastPause(Date.now() + 60 * 6e4);
187
+ else if (choice === "manual") props.bus?.setToastPause("manual");
188
+ else if (choice === "on") props.bus?.setToastPause(null);
189
+ void nextTick(() => {
190
+ select.value = pauseChoice.value;
191
+ });
192
+ }
193
+ function barProgress(progress) {
194
+ const max = progress.max !== void 0 && Number.isFinite(progress.max) && progress.max > 0 ? progress.max : 1;
195
+ const value = typeof progress.value === "number" && Number.isFinite(progress.value) ? Math.min(Math.max(progress.value, 0), max) : void 0;
196
+ return { value, max, label: progress.label };
197
+ }
198
+ function runHeaderAction(event, action) {
199
+ const hadFocus = document.activeElement === event.currentTarget;
200
+ action();
201
+ if (!hadFocus) return;
202
+ void nextTick(() => {
203
+ if (!el.value?.contains(document.activeElement)) el.value?.focus({ preventScroll: true });
204
+ });
205
+ }
83
206
  return (_ctx, _cache) => {
84
207
  return openBlock(), createElementBlock("div", mergeProps({
85
208
  ref_key: "el",
86
209
  ref: el,
87
210
  role: "region",
211
+ tabindex: "-1",
88
212
  "aria-label": unref(locale).t("NotificationCenterGroup.notifications", void 0, "Notifications")
89
213
  }, rest.value, { class: classes.value }), [
90
214
  createElementVNode("header", _hoisted_2, [
@@ -94,46 +218,103 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
94
218
  createTextVNode(toDisplayString(unref(props).title), 1)
95
219
  ])
96
220
  ]),
97
- resolvedCount.value != null || _ctx.$slots.count ? (openBlock(), createElementBlock("span", _hoisted_5, [
221
+ resolvedCount.value != null || _ctx.$slots.count ? (openBlock(), createElementBlock("span", {
222
+ key: 0,
223
+ class: normalizeClass(CountBadgeClasses)
224
+ }, [
98
225
  renderSlot(_ctx.$slots, "count", {}, () => [
99
226
  createTextVNode(toDisplayString(resolvedCount.value), 1)
100
227
  ])
101
228
  ])) : createCommentVNode("", true)
102
229
  ]),
103
- _ctx.$slots.headerActions || hasClose() ? (openBlock(), createElementBlock("div", _hoisted_6, [
230
+ _ctx.$slots.headerActions || canMarkRead.value || canClearAll.value || unref(props).onClose ? (openBlock(), createElementBlock("div", _hoisted_5, [
104
231
  renderSlot(_ctx.$slots, "headerActions"),
105
- hasClose() ? (openBlock(), createElementBlock("button", {
232
+ canMarkRead.value ? (openBlock(), createElementBlock("button", {
106
233
  key: 0,
107
234
  type: "button",
235
+ "aria-label": markAllReadLabel.value,
236
+ title: markAllReadLabel.value,
237
+ class: normalizeClass(HeaderActionClasses),
238
+ onClick: _cache[0] || (_cache[0] = ($event) => runHeaderAction($event, () => unref(props).bus?.markNotificationsRead()))
239
+ }, [
240
+ createVNode(unref(_sfc_main$1), {
241
+ icon: unref(CheckCheck),
242
+ size: 14
243
+ }, null, 8, ["icon"])
244
+ ], 8, _hoisted_6)) : createCommentVNode("", true),
245
+ canClearAll.value ? (openBlock(), createElementBlock("button", {
246
+ key: 1,
247
+ type: "button",
248
+ "aria-label": clearAllLabel.value,
249
+ title: clearAllLabel.value,
250
+ class: normalizeClass(HeaderActionClasses),
251
+ onClick: _cache[1] || (_cache[1] = ($event) => runHeaderAction($event, () => unref(props).bus?.clearRetained()))
252
+ }, [
253
+ createVNode(unref(_sfc_main$1), {
254
+ icon: unref(ListX),
255
+ size: 14
256
+ }, null, 8, ["icon"])
257
+ ], 8, _hoisted_7)) : createCommentVNode("", true),
258
+ unref(props).onClose ? (openBlock(), createElementBlock("button", {
259
+ key: 2,
260
+ type: "button",
108
261
  "aria-label": unref(locale).t("NotificationCenterGroup.closeNotifications", void 0, "Close notifications"),
109
- class: "inline-flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",
110
- onClick: _cache[0] || (_cache[0] = ($event) => emit("close"))
262
+ class: normalizeClass(HeaderActionClasses),
263
+ onClick: _cache[2] || (_cache[2] = ($event) => unref(props).onClose())
111
264
  }, [
112
265
  createVNode(unref(_sfc_main$1), {
113
266
  icon: unref(X),
114
267
  size: 14
115
268
  }, null, 8, ["icon"])
116
- ], 8, _hoisted_7)) : createCommentVNode("", true)
269
+ ], 8, _hoisted_8)) : createCommentVNode("", true)
117
270
  ])) : createCommentVNode("", true)
118
271
  ]),
119
- createElementVNode("div", _hoisted_8, [
272
+ unref(props).canPause && unref(props).bus ? (openBlock(), createElementBlock("div", _hoisted_9, [
273
+ createElementVNode("label", { for: unref(pauseLabelId) }, toDisplayString(unref(locale).t("NotificationCenterGroup.popups", void 0, "Toast pop-ups")), 9, _hoisted_10),
274
+ createElementVNode("select", {
275
+ id: unref(pauseLabelId),
276
+ value: pauseChoice.value,
277
+ class: normalizeClass(PauseSelectClasses),
278
+ onChange: changePause
279
+ }, [
280
+ createElementVNode("option", _hoisted_12, toDisplayString(unref(locale).t("NotificationCenterGroup.popupsOn", void 0, "On")), 1),
281
+ pauseChoice.value === "timed" ? (openBlock(), createElementBlock("option", _hoisted_13, toDisplayString(unref(locale).t("NotificationCenterGroup.pausedUntil", { time: resumeTime.value }, "Paused until {time}")), 1)) : createCommentVNode("", true),
282
+ createElementVNode("option", _hoisted_14, toDisplayString(unref(locale).t("NotificationCenterGroup.pause15", void 0, "Pause for 15 minutes")), 1),
283
+ createElementVNode("option", _hoisted_15, toDisplayString(unref(locale).t("NotificationCenterGroup.pause60", void 0, "Pause for 1 hour")), 1),
284
+ createElementVNode("option", _hoisted_16, toDisplayString(unref(locale).t("NotificationCenterGroup.pauseManual", void 0, "Off until resumed")), 1)
285
+ ], 40, _hoisted_11)
286
+ ])) : createCommentVNode("", true),
287
+ createElementVNode("div", _hoisted_17, [
120
288
  isEmpty() ? renderSlot(_ctx.$slots, "emptyState", {}, () => [
121
- createElementVNode("div", _hoisted_9, [
289
+ createElementVNode("div", _hoisted_18, [
122
290
  createVNode(unref(Bell), { class: "h-6 w-6" }),
123
- createElementVNode("p", _hoisted_10, toDisplayString(unref(locale).t("NotificationCenterGroup.youreAllCaughtUp", void 0, "You're all caught up.")), 1)
291
+ createElementVNode("p", _hoisted_19, toDisplayString(unref(locale).t("NotificationCenterGroup.youreAllCaughtUp", void 0, "You're all caught up.")), 1)
124
292
  ])
125
- ], void 0, 0) : (openBlock(), createElementBlock("div", _hoisted_11, [
293
+ ], void 0, 0) : (openBlock(), createElementBlock("div", _hoisted_20, [
126
294
  renderSlot(_ctx.$slots, "default", {}, () => [
127
- (openBlock(true), createElementBlock(Fragment, null, renderList(notices.value, (notice) => {
295
+ (openBlock(true), createElementBlock(Fragment, null, renderList(rows.value, ({ notice, action, isUnread, progress }, index) => {
128
296
  return openBlock(), createBlock(_sfc_main$2, {
129
297
  key: notice.id,
130
298
  severity: notice.tone,
299
+ "is-unread": isUnread,
300
+ "data-notification-history-row": "",
301
+ tabindex: "-1",
131
302
  onDelete: ($event) => unref(props).bus?.remove(notice.id)
132
303
  }, createSlots({
133
304
  title: withCtx(() => [
134
- createVNode(unref(NoticeNodeView), {
135
- node: notice.title
136
- }, null, 8, ["node"])
305
+ createElementVNode("span", {
306
+ id: progress ? titleId(index) : void 0
307
+ }, [
308
+ createVNode(unref(NoticeNodeView), {
309
+ node: notice.title
310
+ }, null, 8, ["node"])
311
+ ], 8, _hoisted_21)
312
+ ]),
313
+ timestamp: withCtx(() => [
314
+ createVNode(_sfc_main$3, {
315
+ "is-live": "",
316
+ value: notice.publishedAtMs
317
+ }, null, 8, ["value"])
137
318
  ]),
138
319
  _: 2
139
320
  }, [
@@ -146,26 +327,39 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
146
327
  ]),
147
328
  key: "0"
148
329
  } : void 0,
149
- notice.action || notice.report ? {
330
+ progress ? {
331
+ name: "progress",
332
+ fn: withCtx(() => [
333
+ createVNode(_sfc_main$4, {
334
+ size: "sm",
335
+ value: progress.value,
336
+ max: progress.max,
337
+ "aria-labelledby": titleId(index)
338
+ }, null, 8, ["value", "max", "aria-labelledby"]),
339
+ progress.label ? (openBlock(), createElementBlock("p", _hoisted_22, toDisplayString(progress.label), 1)) : createCommentVNode("", true)
340
+ ]),
341
+ key: "1"
342
+ } : void 0,
343
+ action || notice.report ? {
150
344
  name: "actions",
151
345
  fn: withCtx(() => [
152
- notice.action ? (openBlock(), createBlock(unref(NoticeNodeView), {
346
+ action ? (openBlock(), createBlock(unref(NoticeNodeView), {
153
347
  key: 0,
154
- node: notice.action
348
+ node: action
155
349
  }, null, 8, ["node"])) : createCommentVNode("", true),
156
- notice.report ? (openBlock(), createBlock(_sfc_main$3, {
350
+ notice.report ? (openBlock(), createBlock(_sfc_main$5, {
157
351
  key: 1,
158
352
  send: notice.report
159
353
  }, null, 8, ["send"])) : createCommentVNode("", true)
160
354
  ]),
161
- key: "1"
355
+ key: "2"
162
356
  } : void 0
163
- ]), 1032, ["severity", "onDelete"]);
357
+ ]), 1032, ["severity", "is-unread", "onDelete"]);
164
358
  }), 128))
165
359
  ])
166
360
  ]))
167
361
  ]),
168
- _ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_12, [
362
+ _ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_23, [
169
363
  renderSlot(_ctx.$slots, "footer")
170
364
  ])) : createCommentVNode("", true)
171
365
  ], 16, _hoisted_1);