@vuetify/v0 1.0.0-alpha.1 → 1.0.0-alpha.3

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 (158) hide show
  1. package/README.md +3 -1
  2. package/dist/{adapter-T7AedXkz.d.mts → adapter-58IvIfAZ.d.mts} +1 -1
  3. package/dist/{adapter-DtgIrQsG.mjs → adapter-Be9zUc-n.mjs} +1 -1
  4. package/dist/{adapter-DoziXEzS.d.mts → adapter-BvWEd9w-.d.mts} +2 -2
  5. package/dist/{adapter-J7ude3gO.d.mts → adapter-DlX3FA3A.d.mts} +1 -1
  6. package/dist/{adapter-CDpOQ8sn.mjs → adapter-gQ2SNKZq.mjs} +3 -3
  7. package/dist/{adapters-Da2twiUn.mjs → adapters-BSiqsTZN.mjs} +1 -1
  8. package/dist/adapters-C3QXhf4I.mjs +2 -0
  9. package/dist/adapters-CMJGA1k7.mjs +2 -0
  10. package/dist/adapters-Dse4bPxk.mjs +5 -0
  11. package/dist/adapters-_ZqxCD8f.mjs +4 -0
  12. package/dist/browser/index.js +3880 -425
  13. package/dist/components/index.d.mts +3 -3
  14. package/dist/components/index.mjs +2 -2
  15. package/dist/{components-CaPQCjo5.mjs → components-C4jI-78d.mjs} +3706 -365
  16. package/dist/composables/index.d.mts +19 -19
  17. package/dist/composables/index.mjs +27 -25
  18. package/dist/{consola-Byg0ybzh.d.mts → consola-BdgyPEfx.d.mts} +1 -1
  19. package/dist/constants/index.d.mts +2 -2
  20. package/dist/constants/index.mjs +3 -3
  21. package/dist/{createDataTable-B4UflKnT.mjs → createDataTable-iODP6aKB.mjs} +15 -12
  22. package/dist/{createGroup-BC2nfttd.mjs → createGroup-CGk6hY_Y.mjs} +7 -7
  23. package/dist/{createTokens-oJAeh262.mjs → createRegistry-BXzdXAjq.mjs} +6 -299
  24. package/dist/{createSelection-BA9guLah.mjs → createSelection-B3HJEPNg.mjs} +1 -1
  25. package/dist/{createSingle-BHxHLZeg.mjs → createSingle-Dql8mRi-.mjs} +1 -1
  26. package/dist/createTokens-DgFYsOrv.mjs +302 -0
  27. package/dist/data-table/adapters/client/index.d.mts +1 -1
  28. package/dist/data-table/adapters/client/index.mjs +1 -1
  29. package/dist/data-table/adapters/index.d.mts +4 -4
  30. package/dist/data-table/adapters/index.mjs +5 -5
  31. package/dist/data-table/adapters/server/index.d.mts +1 -1
  32. package/dist/data-table/adapters/server/index.mjs +1 -1
  33. package/dist/data-table/adapters/virtual/index.d.mts +1 -1
  34. package/dist/data-table/adapters/virtual/index.mjs +1 -1
  35. package/dist/data-table/index.d.mts +5 -5
  36. package/dist/data-table/index.mjs +5 -5
  37. package/dist/date/index.d.mts +2 -2
  38. package/dist/date/index.mjs +4 -4
  39. package/dist/features/adapters/flagsmith/index.d.mts +1 -1
  40. package/dist/features/adapters/flagsmith/index.mjs +1 -1
  41. package/dist/features/adapters/launchdarkly/index.d.mts +1 -1
  42. package/dist/features/adapters/launchdarkly/index.mjs +1 -1
  43. package/dist/features/adapters/posthog/index.d.mts +1 -1
  44. package/dist/features/adapters/posthog/index.mjs +1 -1
  45. package/dist/features/index.d.mts +2 -2
  46. package/dist/features/index.mjs +1 -1
  47. package/dist/{globals-Berkg6mP.mjs → globals-zEjWBKCr.mjs} +1 -1
  48. package/dist/htmlElements-D4oMQZPJ.mjs +28 -0
  49. package/dist/{index-M8EpGjjA.d.mts → index-1XdASTjp.d.mts} +1 -1
  50. package/dist/{index-DFvLSoto.d.mts → index-B76iGRE3.d.mts} +164 -15
  51. package/dist/{index-DVPq3_Fz.d.mts → index-BJGcVy7e.d.mts} +4 -4
  52. package/dist/index-BgCkepP_.d.mts +31 -0
  53. package/dist/{index-tyzwWFHS.d.mts → index-BzFHTW59.d.mts} +1 -1
  54. package/dist/{index-CDcl4wPo.d.mts → index-CT5SCLzW.d.mts} +1 -1
  55. package/dist/{index-TtSSvHY6.d.mts → index-DE3bWw11.d.mts} +2 -2
  56. package/dist/{index-Gk3x_7zD.d.mts → index-DNDuacmH.d.mts} +498 -275
  57. package/dist/{index-F2Fmxnzi.d.mts → index-Dp1HjBxJ.d.mts} +1 -1
  58. package/dist/{index-B_AlCD7t.d.mts → index-DuddF-NR.d.mts} +2 -9
  59. package/dist/{index-Dxx0eMLi.d.mts → index-GOpjKzaJ.d.mts} +1 -1
  60. package/dist/index.d.mts +23 -23
  61. package/dist/index.mjs +30 -28
  62. package/dist/json/attributes.json +60 -4
  63. package/dist/json/importMap.json +16 -0
  64. package/dist/json/tags.json +29 -0
  65. package/dist/json/web-types.json +184 -6
  66. package/dist/locale/adapters/index.d.mts +2 -2
  67. package/dist/locale/adapters/index.mjs +2 -2
  68. package/dist/locale/adapters/v0/index.d.mts +1 -1
  69. package/dist/locale/adapters/v0/index.mjs +1 -1
  70. package/dist/locale/adapters/vue-i18n/index.d.mts +1 -1
  71. package/dist/locale/index.d.mts +3 -3
  72. package/dist/locale/index.mjs +2 -2
  73. package/dist/logger/adapters/consola/index.d.mts +1 -1
  74. package/dist/logger/adapters/index.d.mts +4 -4
  75. package/dist/logger/adapters/index.mjs +2 -2
  76. package/dist/logger/adapters/pino/index.d.mts +1 -1
  77. package/dist/logger/adapters/v0/index.d.mts +1 -1
  78. package/dist/logger/adapters/v0/index.mjs +1 -1
  79. package/dist/logger/index.d.mts +5 -5
  80. package/dist/logger/index.mjs +2 -2
  81. package/dist/notifications/index.d.mts +2 -2
  82. package/dist/notifications/index.mjs +3 -54
  83. package/dist/palettes/ant/generate/index.mjs +1 -0
  84. package/dist/palettes/ant/index.d.mts +1 -1
  85. package/dist/palettes/index.d.mts +3 -3
  86. package/dist/palettes/leonardo/generate/index.mjs +3 -1
  87. package/dist/palettes/material/generate/index.mjs +1 -0
  88. package/dist/palettes/material/index.d.mts +1 -1
  89. package/dist/palettes/md1/index.d.mts +1 -1
  90. package/dist/palettes/md2/index.d.mts +1 -1
  91. package/dist/palettes/radix/index.d.mts +1 -1
  92. package/dist/palettes/tailwind/index.d.mts +1 -1
  93. package/dist/permissions/adapters/index.d.mts +1 -1
  94. package/dist/permissions/adapters/index.mjs +2 -2
  95. package/dist/permissions/adapters/v0/index.d.mts +1 -1
  96. package/dist/permissions/adapters/v0/index.mjs +1 -1
  97. package/dist/permissions/index.d.mts +1 -1
  98. package/dist/permissions/index.mjs +2 -2
  99. package/dist/{pino-BxddSW2l.d.mts → pino-DNfCEb0p.d.mts} +1 -1
  100. package/dist/{posthog-CPvNHMUb.mjs → posthog-DmuyycaR.mjs} +1 -1
  101. package/dist/rules/index.d.mts +1 -1
  102. package/dist/rules/index.mjs +1 -1
  103. package/dist/{server-ZiHJ4tfq.d.mts → server-3ilWFwqe.d.mts} +1 -1
  104. package/dist/{server-B6OtHgBT.mjs → server-y7zLSCSx.mjs} +1 -1
  105. package/dist/storage/adapters/index.d.mts +2 -2
  106. package/dist/storage/adapters/index.mjs +1 -1
  107. package/dist/storage/adapters/memory/index.d.mts +1 -1
  108. package/dist/storage/adapters/memory/index.mjs +1 -1
  109. package/dist/storage/index.d.mts +3 -3
  110. package/dist/storage/index.mjs +2 -2
  111. package/dist/theme/adapters/index.d.mts +1 -1
  112. package/dist/theme/adapters/index.mjs +4 -4
  113. package/dist/theme/adapters/unhead/index.d.mts +1 -1
  114. package/dist/theme/adapters/unhead/index.mjs +1 -1
  115. package/dist/theme/adapters/v0/index.d.mts +1 -1
  116. package/dist/theme/adapters/v0/index.mjs +1 -1
  117. package/dist/theme/index.d.mts +1 -1
  118. package/dist/theme/index.mjs +3 -3
  119. package/dist/{toArray-BA_JxFPv.mjs → toArray-as9BWxBK.mjs} +1 -0
  120. package/dist/types/index.d.mts +2 -2
  121. package/dist/{unhead-D2YqAcmF.mjs → unhead-B-I2OS6i.mjs} +2 -2
  122. package/dist/{useClickOutside-B9a6Jext.mjs → useClickOutside-CY4U2J9W.mjs} +176 -914
  123. package/dist/{useFeatures-wgMwaQ5W.mjs → useFeatures-BPOke6iP.mjs} +8 -7
  124. package/dist/{useLocale-qMmVnAwS.mjs → useLocale-BV8e3imF.mjs} +10 -7
  125. package/dist/{useLogger-DFIRqm-N.mjs → useLogger-DvdRTrqC.mjs} +3 -3
  126. package/dist/useNotifications-vSJE6z6t.mjs +880 -0
  127. package/dist/{usePermissions-tZhkBJmq.mjs → usePermissions-D3zPwKQc.mjs} +6 -6
  128. package/dist/{useRules-D3UXEtu7.mjs → useRules-BT6cgoTj.mjs} +7 -5
  129. package/dist/{useTheme-BeD__R8t.mjs → useTheme-cUZb2A9O.mjs} +11 -8
  130. package/dist/utilities/index.d.mts +1 -1
  131. package/dist/utilities/index.mjs +11 -5
  132. package/dist/{v0-I2mHxD9T.mjs → v0-C49OI_wc.mjs} +1 -1
  133. package/dist/{v0-CNitYI9N.mjs → v0-CHZpnMeP.mjs} +1 -1
  134. package/dist/{v0-Dzw5OwNo.d.mts → v0-CdusXjY_.d.mts} +1 -1
  135. package/dist/{v0-CWXUkMY0.d.mts → v0-D7Fm2C3Y.d.mts} +1 -1
  136. package/dist/{v0-BG7RhKBv.mjs → v0-Dq3zhexO.mjs} +2 -2
  137. package/dist/{v0-C2UMaHUa.d.mts → v0-DrOub-e1.d.mts} +1 -1
  138. package/dist/{v0-6XptGYVx.mjs → v0-gpExNexS.mjs} +2 -2
  139. package/dist/{virtual-To-dSw2_.mjs → virtual-C0yHf1DC.mjs} +2 -2
  140. package/dist/{virtual-BCOfxnRS.d.mts → virtual-D4fckewC.d.mts} +1 -1
  141. package/package.json +10 -10
  142. package/dist/adapters-BhNTUuxE.mjs +0 -2
  143. package/dist/adapters-CFjrKxA2.mjs +0 -5
  144. package/dist/adapters-CiCexgsk.mjs +0 -4
  145. package/dist/adapters-DegUcfkd.mjs +0 -2
  146. package/dist/htmlElements-CIePKaTX.mjs +0 -75
  147. package/dist/index-D6mQAEs2.d.mts +0 -79
  148. /package/dist/{adapter-DNKjooxI.d.mts → adapter-Dhq68tz0.d.mts} +0 -0
  149. /package/dist/{createPagination-qvJkcTUY.mjs → createPagination-CHF7SmmK.mjs} +0 -0
  150. /package/dist/{flagsmith-DQnnahG5.mjs → flagsmith-Dbh1h8WF.mjs} +0 -0
  151. /package/dist/{index-DxruGeVY.d.mts → index-C6rdXZ7j.d.mts} +0 -0
  152. /package/dist/{index-DvuJXuAN.d.mts → index-CFhUdAHM.d.mts} +0 -0
  153. /package/dist/{index-PWQavSPf.d.mts → index-CROz1VSV.d.mts} +0 -0
  154. /package/dist/{index-D4odwkZg.d.mts → index-DTvqw22G.d.mts} +0 -0
  155. /package/dist/{launchdarkly-2_48EJ1_.mjs → launchdarkly-BKtW-idu.mjs} +0 -0
  156. /package/dist/{memory-DUyWthic.d.mts → memory-CeSQE-QV.d.mts} +0 -0
  157. /package/dist/{memory-XCMtkld1.mjs → memory-oYBvtkgx.mjs} +0 -0
  158. /package/dist/{v0-4OQBCeda.mjs → v0-Bmow1q_x.mjs} +0 -0
@@ -0,0 +1,880 @@
1
+ import { t as IN_BROWSER } from "./globals-zEjWBKCr.mjs";
2
+ import { isFunction, isNull, isUndefined, useId as useId$1 } from "./utilities/index.mjs";
3
+ import { i as useContext, t as createTrinity } from "./createTrinity-BTCs1pYx.mjs";
4
+ import { o as createPluginContext } from "./useLogger-DvdRTrqC.mjs";
5
+ import { t as createRegistry } from "./createRegistry-BXzdXAjq.mjs";
6
+ import { onScopeDispose, shallowRef, toValue } from "vue";
7
+ //#region src/composables/useTimer/index.ts
8
+ /**
9
+ * @module useTimer
10
+ *
11
+ * @see https://0.vuetifyjs.com/composables/system/use-timer
12
+ *
13
+ * @remarks
14
+ * A reactive timer composable with pause/resume support.
15
+ *
16
+ * Key features:
17
+ * - Start/stop/pause/resume controls
18
+ * - Reactive remaining time tracking
19
+ * - Reactive `duration` via `MaybeRefOrGetter` — read fresh on each `start()`
20
+ * - One-shot (default) or repeating mode
21
+ * - Automatic cleanup on scope disposal
22
+ * - SSR-safe
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * import { useTimer } from '@vuetify/v0'
27
+ *
28
+ * const timer = useTimer(() => console.log('fired'), { duration: 5000 })
29
+ * timer.start()
30
+ * ```
31
+ */
32
+ /**
33
+ * Creates a reactive timer with pause/resume support.
34
+ *
35
+ * @param handler Callback invoked when the timer fires.
36
+ * @param options Timer configuration.
37
+ * @returns Timer controls and reactive state.
38
+ *
39
+ * @see https://0.vuetifyjs.com/composables/system/use-timer
40
+ *
41
+ * @example
42
+ * ```ts
43
+ * const timer = useTimer(() => console.log('fired'), { duration: 5000 })
44
+ *
45
+ * timer.start()
46
+ * timer.pause()
47
+ * timer.resume()
48
+ * timer.stop()
49
+ *
50
+ * // Reactive duration — re-read on each start()
51
+ * const duration = shallowRef(1000)
52
+ * const reactive = useTimer(handler, { duration })
53
+ * duration.value = 2000
54
+ * reactive.start() // fires after 2000ms
55
+ * ```
56
+ */
57
+ function useTimer(handler, options = {}) {
58
+ const { duration = 1e3, repeat = false } = options;
59
+ function resolveDuration() {
60
+ return toValue(duration);
61
+ }
62
+ const remaining = shallowRef(resolveDuration());
63
+ const isActive = shallowRef(false);
64
+ const isPaused = shallowRef(false);
65
+ let timeoutId;
66
+ let trackingId;
67
+ let startedAt = 0;
68
+ let budget = remaining.value;
69
+ function clearTimer() {
70
+ if (!/* @__PURE__ */ isUndefined(timeoutId)) {
71
+ globalThis.clearTimeout(timeoutId);
72
+ timeoutId = void 0;
73
+ }
74
+ }
75
+ function startTracking() {
76
+ stopTracking();
77
+ if (!IN_BROWSER) return;
78
+ trackingId = globalThis.setInterval(() => {
79
+ if (!isActive.value || isPaused.value) return;
80
+ const elapsed = Date.now() - startedAt;
81
+ remaining.value = Math.max(0, budget - elapsed);
82
+ }, 100);
83
+ }
84
+ function stopTracking() {
85
+ if (!/* @__PURE__ */ isUndefined(trackingId)) {
86
+ globalThis.clearInterval(trackingId);
87
+ trackingId = void 0;
88
+ }
89
+ }
90
+ function fire() {
91
+ clearTimer();
92
+ stopTracking();
93
+ handler();
94
+ if (repeat) begin(resolveDuration());
95
+ else {
96
+ isActive.value = false;
97
+ remaining.value = 0;
98
+ }
99
+ }
100
+ function begin(ms) {
101
+ clearTimer();
102
+ stopTracking();
103
+ budget = ms;
104
+ startedAt = Date.now();
105
+ remaining.value = ms;
106
+ isActive.value = true;
107
+ isPaused.value = false;
108
+ timeoutId = globalThis.setTimeout(fire, ms);
109
+ startTracking();
110
+ }
111
+ function start() {
112
+ const ms = resolveDuration();
113
+ if (ms < 0) return;
114
+ begin(ms);
115
+ }
116
+ function stop() {
117
+ clearTimer();
118
+ stopTracking();
119
+ isActive.value = false;
120
+ isPaused.value = false;
121
+ remaining.value = resolveDuration();
122
+ }
123
+ function pause() {
124
+ if (!isActive.value || isPaused.value) return;
125
+ const elapsed = Date.now() - startedAt;
126
+ budget = Math.max(0, budget - elapsed);
127
+ remaining.value = budget;
128
+ clearTimer();
129
+ stopTracking();
130
+ isPaused.value = true;
131
+ }
132
+ function resume() {
133
+ if (!isPaused.value) return;
134
+ isPaused.value = false;
135
+ startedAt = Date.now();
136
+ timeoutId = globalThis.setTimeout(fire, budget);
137
+ startTracking();
138
+ }
139
+ onScopeDispose(() => {
140
+ clearTimer();
141
+ stopTracking();
142
+ }, true);
143
+ return {
144
+ start,
145
+ stop,
146
+ pause,
147
+ resume,
148
+ remaining,
149
+ isActive,
150
+ isPaused
151
+ };
152
+ }
153
+ //#endregion
154
+ //#region src/composables/createQueue/index.ts
155
+ /**
156
+ * @module createQueue
157
+ *
158
+ * @see https://0.vuetifyjs.com/composables/registration/create-queue
159
+ *
160
+ * @remarks
161
+ * A queue composable for managing time-based collections with:
162
+ * - Automatic timeout-based removal
163
+ * - Pause/resume functionality
164
+ * - FIFO (First In, First Out) ordering
165
+ * - Manual dismissal support
166
+ * - Queue progression management
167
+ *
168
+ * Built on top of createRegistry, the queue automatically manages timeouts for tickets,
169
+ * ensuring only the first ticket in the queue is active at any time. When a ticket
170
+ * expires or is removed, the next ticket in the queue automatically becomes active.
171
+ *
172
+ * @example
173
+ * ```ts
174
+ * import { createQueue } from '@vuetify/v0'
175
+ *
176
+ * const queue = createQueue()
177
+ * queue.register({ value: 'Notification 1', timeout: 3000 })
178
+ * queue.register({ value: 'Notification 2', timeout: 3000 })
179
+ * ```
180
+ */
181
+ /**
182
+ * Creates a new queue instance
183
+ *
184
+ * @param options The options for the queue instance
185
+ * @returns A new queue instance
186
+ *
187
+ * @see https://0.vuetifyjs.com/composables/registration/create-queue
188
+ *
189
+ * @example
190
+ * ```ts
191
+ * import { useQueue } from '@vuetify/v0'
192
+ *
193
+ * const queue = useQueue()
194
+ *
195
+ * // Register an ticket with default timeout (3000ms)
196
+ * const ticket1 = queue.register({ value: 'Ticket 1' })
197
+ *
198
+ * // Register an ticket with custom timeout
199
+ * const ticket2 = queue.register({ value: 'Ticket 2', timeout: 5000 })
200
+ *
201
+ * // Register a persistent ticket that must be manually dismissed
202
+ * const ticket3 = queue.register({ value: 'Ticket 3', timeout: -1 })
203
+ *
204
+ * // Dismiss an ticket using the convenience method
205
+ * ticket3.dismiss()
206
+ *
207
+ * console.log(queue.size) // 2
208
+ * ```
209
+ */
210
+ function createQueue(_options = {}) {
211
+ const { timeout: _timeout = 3e3, ...options } = _options;
212
+ const registry = createRegistry({
213
+ ...options,
214
+ events: true
215
+ });
216
+ const timers = /* @__PURE__ */ new Map();
217
+ function createTicketTimer(ticket) {
218
+ if (/* @__PURE__ */ isUndefined(ticket.timeout) || ticket.timeout < 0 || ticket.isPaused) return;
219
+ const timer = useTimer(() => {
220
+ timers.delete(ticket.id);
221
+ registry.unregister(ticket.id);
222
+ resume();
223
+ }, { duration: ticket.timeout });
224
+ timers.set(ticket.id, timer);
225
+ timer.start();
226
+ }
227
+ function stopTimer(id) {
228
+ const timer = timers.get(id);
229
+ if (timer) {
230
+ timer.stop();
231
+ timers.delete(id);
232
+ }
233
+ }
234
+ function register(registration = {}) {
235
+ const id = registration.id ?? /* @__PURE__ */ useId$1();
236
+ const timeout = Object.prototype.hasOwnProperty.call(registration, "timeout") ? registration.timeout : _timeout;
237
+ const ticket = {
238
+ ...registration,
239
+ id,
240
+ timeout,
241
+ isPaused: registry.size > 0,
242
+ dismiss: () => unregister(id)
243
+ };
244
+ const registered = registry.register(ticket);
245
+ createTicketTimer(registered);
246
+ return registered;
247
+ }
248
+ function unregister(id) {
249
+ const ticket = /* @__PURE__ */ isUndefined(id) ? registry.seek("first") : registry.get(id);
250
+ if (!ticket) return void 0;
251
+ const wasFirst = ticket.index === 0;
252
+ stopTimer(ticket.id);
253
+ registry.unregister(ticket.id);
254
+ if (wasFirst) resume();
255
+ return ticket;
256
+ }
257
+ function offboard(ids) {
258
+ let hadFirst = false;
259
+ for (const id of ids) {
260
+ const ticket = registry.get(id);
261
+ if (!ticket) continue;
262
+ if (ticket.index === 0) hadFirst = true;
263
+ stopTimer(ticket.id);
264
+ }
265
+ registry.offboard(ids);
266
+ if (hadFirst) resume();
267
+ }
268
+ function pause() {
269
+ const ticket = registry.seek("first");
270
+ if (!ticket || ticket.isPaused) return void 0;
271
+ timers.get(ticket.id)?.pause();
272
+ return registry.upsert(ticket.id, { isPaused: true });
273
+ }
274
+ function resume() {
275
+ const ticket = registry.seek("first");
276
+ if (!ticket || ticket.index !== 0 || !ticket.isPaused) return void 0;
277
+ const updated = registry.upsert(ticket.id, { isPaused: false });
278
+ const timer = timers.get(updated.id);
279
+ if (timer) timer.start();
280
+ else createTicketTimer(updated);
281
+ return updated;
282
+ }
283
+ function clear() {
284
+ for (const timer of timers.values()) timer.stop();
285
+ timers.clear();
286
+ registry.clear();
287
+ }
288
+ function dispose() {
289
+ clear();
290
+ registry.dispose();
291
+ }
292
+ onScopeDispose(dispose, true);
293
+ function onboard(registrations) {
294
+ return registry.batch(() => registrations.map((registration) => register(registration)));
295
+ }
296
+ return {
297
+ ...registry,
298
+ register,
299
+ unregister,
300
+ onboard,
301
+ offboard,
302
+ pause,
303
+ resume,
304
+ clear,
305
+ dispose,
306
+ get size() {
307
+ return registry.size;
308
+ }
309
+ };
310
+ }
311
+ /**
312
+ * Creates a new queue context.
313
+ *
314
+ * @param options The options for the queue context.
315
+ * @returns A new queue context.
316
+ *
317
+ * @see https://0.vuetifyjs.com/composables/registration/create-queue
318
+ *
319
+ * @example
320
+ * ```ts
321
+ * import { createQueueContext } from '@vuetify/v0'
322
+ *
323
+ * export const [useQueue, provideQueue, context] = createQueueContext({
324
+ * timeout: 5000,
325
+ * })
326
+ * ```
327
+ */
328
+ function createQueueContext(_options = {}) {
329
+ const { namespace = "v0:queue", ...options } = _options;
330
+ return createTrinity(namespace, createQueue(options));
331
+ }
332
+ /**
333
+ * Returns the current queue instance.
334
+ *
335
+ * @param namespace The namespace for the queue context. Defaults to `'v0:queue'`.
336
+ * @returns The current queue instance.
337
+ *
338
+ * @see https://0.vuetifyjs.com/composables/registration/create-queue
339
+ *
340
+ * @example
341
+ * ```vue
342
+ * <script setup lang="ts">
343
+ * import { useQueue } from '@vuetify/v0'
344
+ *
345
+ * const queue = useQueue()
346
+ * <\/script>
347
+ * ```
348
+ */
349
+ function useQueue(namespace = "v0:queue") {
350
+ return useContext(namespace);
351
+ }
352
+ //#endregion
353
+ //#region src/composables/useNotifications/index.ts
354
+ /**
355
+ * @module useNotifications
356
+ * @see https://0.vuetifyjs.com/composables/plugins/use-notifications
357
+ *
358
+ * @remarks
359
+ * Notification management composable built on createRegistry and createQueue.
360
+ * Registry stores the full notification lifecycle (permanent record).
361
+ * Queue manages the display surface (toasts) with FIFO ordering and auto-dismiss.
362
+ *
363
+ * Supports:
364
+ * - Push notifications with severity levels and configurable timeouts
365
+ * - State mutations: read, seen, archived, snoozed
366
+ * - Bulk operations: readAll, archiveAll, clear
367
+ * - Toast queue with pause/resume and auto-dismiss
368
+ * - Adapter integration via event system
369
+ * - Plugin installation via createNotificationsPlugin
370
+ *
371
+ * @example
372
+ * ```ts
373
+ * import { useNotifications } from '@vuetify/v0'
374
+ *
375
+ * const notifications = useNotifications()
376
+ * notifications.send({ subject: 'Saved', severity: 'success' })
377
+ * ```
378
+ */
379
+ function createNotifications(options = {}) {
380
+ const { timeout = 3e3, ...registryOptions } = options;
381
+ const registry = createRegistry({
382
+ ...registryOptions,
383
+ events: true,
384
+ reactive: true
385
+ });
386
+ const queue = createQueue({
387
+ timeout,
388
+ events: true,
389
+ reactive: true
390
+ });
391
+ registry.on("unregister:ticket", (ticket) => {
392
+ if (queue.has(ticket.id)) queue.unregister(ticket.id);
393
+ });
394
+ /**
395
+ * Build a full {@link NotificationTicket} from raw input
396
+ *
397
+ * @param input The notification input to hydrate.
398
+ * @returns A partial ticket with timestamps, lifecycle methods, and an ID.
399
+ * @internal Used by {@link send}, {@link register}, and {@link onboard}.
400
+ */
401
+ function hydrate(input) {
402
+ const id = input.id ?? /* @__PURE__ */ useId$1();
403
+ const now = /* @__PURE__ */ new Date();
404
+ return {
405
+ ...input,
406
+ id,
407
+ createdAt: now,
408
+ readAt: null,
409
+ seenAt: null,
410
+ archivedAt: null,
411
+ snoozedUntil: null,
412
+ read: () => read(id),
413
+ unread: () => unread(id),
414
+ seen: () => seen(id),
415
+ archive: () => archive(id),
416
+ unarchive: () => unarchive(id),
417
+ snooze: (until) => snooze(id, until),
418
+ wake: () => wake(id),
419
+ dismiss: () => queue.unregister(id)
420
+ };
421
+ }
422
+ /**
423
+ * Create a notification and enqueue it for toast display
424
+ *
425
+ * @param input The notification input to create.
426
+ * @returns The hydrated notification ticket.
427
+ * @remarks Hydrates the input with timestamps and lifecycle methods, registers
428
+ * it in the registry, adds it to the display queue, and emits
429
+ * `notification:received`. The ticket auto-dismisses after the configured
430
+ * timeout unless paused.
431
+ *
432
+ * @see https://0.vuetifyjs.com/composables/plugins/use-notifications
433
+ *
434
+ * @example
435
+ * ```ts
436
+ * import { useNotifications } from '@vuetify/v0'
437
+ *
438
+ * const notifications = useNotifications()
439
+ *
440
+ * // Basic toast
441
+ * notifications.send({ subject: 'Changes saved', severity: 'success' })
442
+ *
443
+ * // With custom timeout
444
+ * const ticket = notifications.send({ subject: 'Connection lost', severity: 'error', timeout: 10000 })
445
+ *
446
+ * console.log(ticket.id) // 'generated-id'
447
+ * console.log(ticket.createdAt) // Date
448
+ * console.log(ticket.readAt) // null
449
+ *
450
+ * // Ticket convenience methods
451
+ * ticket.read() // marks as read
452
+ * ticket.dismiss() // removes from toast queue, keeps in registry
453
+ * ```
454
+ */
455
+ function send(input) {
456
+ const ticket = registry.register(hydrate(input));
457
+ queue.register(/* @__PURE__ */ isUndefined(input.timeout) ? { id: ticket.id } : {
458
+ id: ticket.id,
459
+ timeout: input.timeout
460
+ });
461
+ registry.emit("notification:received", ticket);
462
+ return ticket;
463
+ }
464
+ /**
465
+ * Register a notification in the registry without adding it to the toast queue
466
+ *
467
+ * @param input The notification input to register.
468
+ * @returns The hydrated notification ticket.
469
+ * @remarks Overrides the base registry `register` to hydrate the input with
470
+ * timestamps and lifecycle methods. Use for historical or pre-existing items
471
+ * that should appear in an inbox but not pop up as toasts.
472
+ *
473
+ * @see https://0.vuetifyjs.com/composables/plugins/use-notifications
474
+ *
475
+ * @example
476
+ * ```ts
477
+ * import { useNotifications } from '@vuetify/v0'
478
+ *
479
+ * const notifications = useNotifications()
480
+ *
481
+ * // Register a historical item (appears in inbox, not as toast)
482
+ * const ticket = notifications.register({ id: 'old-1', subject: 'Deployed v2.1' })
483
+ *
484
+ * console.log(ticket.createdAt) // Date
485
+ * console.log(ticket.readAt) // null
486
+ *
487
+ * // Lifecycle methods work the same as send()
488
+ * ticket.read()
489
+ * ticket.archive()
490
+ * ```
491
+ */
492
+ function register(input) {
493
+ return registry.register(hydrate(input));
494
+ }
495
+ /**
496
+ * Bulk version of {@link register}
497
+ *
498
+ * @param inputs Array of notification inputs to register.
499
+ * @returns Array of hydrated notification tickets.
500
+ * @remarks Registers multiple notifications into the registry without toast
501
+ * display. Wraps all registrations in a single `registry.batch()` call so
502
+ * reactive updates are deferred until the entire batch completes.
503
+ *
504
+ * @see https://0.vuetifyjs.com/composables/plugins/use-notifications
505
+ *
506
+ * @example
507
+ * ```ts
508
+ * import { useNotifications } from '@vuetify/v0'
509
+ *
510
+ * const notifications = useNotifications()
511
+ *
512
+ * // Load historical items on mount
513
+ * const tickets = notifications.onboard([
514
+ * { id: 'n1', subject: 'Welcome to the team' },
515
+ * { id: 'n2', subject: 'Setup complete', severity: 'success' },
516
+ * ])
517
+ *
518
+ * console.log(tickets.length) // 2
519
+ * console.log(notifications.queue.values()) // [] (no toasts)
520
+ * console.log(notifications.values().length) // 2 (in registry)
521
+ * ```
522
+ */
523
+ function onboard(inputs) {
524
+ return registry.batch(() => inputs.map((input) => register(input)));
525
+ }
526
+ /**
527
+ * Mark a notification as read
528
+ *
529
+ * @param id The ID of the notification to mark as read.
530
+ * @remarks Sets `readAt` to the current time and emits `notification:read`.
531
+ * Adapters listen to this event for outbound sync.
532
+ *
533
+ * @see https://0.vuetifyjs.com/composables/plugins/use-notifications
534
+ *
535
+ * @example
536
+ * ```ts
537
+ * import { useNotifications } from '@vuetify/v0'
538
+ *
539
+ * const notifications = useNotifications()
540
+ *
541
+ * const ticket = notifications.send({ subject: 'New message' })
542
+ *
543
+ * notifications.read(ticket.id)
544
+ * console.log(ticket.readAt) // Date
545
+ *
546
+ * // Or via ticket convenience method
547
+ * ticket.read()
548
+ * ```
549
+ */
550
+ function read(id) {
551
+ registry.upsert(id, { readAt: /* @__PURE__ */ new Date() }, "notification:read");
552
+ }
553
+ /**
554
+ * Mark a notification as unread
555
+ *
556
+ * @param id The ID of the notification to mark as unread.
557
+ * @remarks Clears `readAt` and emits `notification:unread`.
558
+ *
559
+ * @see https://0.vuetifyjs.com/composables/plugins/use-notifications
560
+ *
561
+ * @example
562
+ * ```ts
563
+ * import { useNotifications } from '@vuetify/v0'
564
+ *
565
+ * const notifications = useNotifications()
566
+ *
567
+ * notifications.unread('notif-1')
568
+ * ```
569
+ */
570
+ function unread(id) {
571
+ registry.upsert(id, { readAt: null }, "notification:unread");
572
+ }
573
+ /**
574
+ * Mark a notification as seen
575
+ *
576
+ * @param id The ID of the notification to mark as seen.
577
+ * @remarks Sets `seenAt` to the current time and emits `notification:seen`.
578
+ * Distinct from read — seen tracks whether the notification appeared in the
579
+ * user's viewport, while read indicates the user actively engaged with it.
580
+ *
581
+ * @see https://0.vuetifyjs.com/composables/plugins/use-notifications
582
+ *
583
+ * @example
584
+ * ```ts
585
+ * import { useNotifications } from '@vuetify/v0'
586
+ *
587
+ * const notifications = useNotifications()
588
+ *
589
+ * // Mark as seen when visible in inbox viewport
590
+ * notifications.seen('notif-1')
591
+ * ```
592
+ */
593
+ function seen(id) {
594
+ registry.upsert(id, { seenAt: /* @__PURE__ */ new Date() }, "notification:seen");
595
+ }
596
+ /**
597
+ * Archive a notification
598
+ *
599
+ * @param id The ID of the notification to archive.
600
+ * @remarks Sets `archivedAt` to the current time and emits `notification:archived`.
601
+ *
602
+ * @see https://0.vuetifyjs.com/composables/plugins/use-notifications
603
+ *
604
+ * @example
605
+ * ```ts
606
+ * import { useNotifications } from '@vuetify/v0'
607
+ *
608
+ * const notifications = useNotifications()
609
+ *
610
+ * notifications.archive('notif-1')
611
+ * ```
612
+ */
613
+ function archive(id) {
614
+ registry.upsert(id, { archivedAt: /* @__PURE__ */ new Date() }, "notification:archived");
615
+ }
616
+ /**
617
+ * Restore an archived notification
618
+ *
619
+ * @param id The ID of the notification to unarchive.
620
+ * @remarks Clears `archivedAt` and emits `notification:unarchived`.
621
+ *
622
+ * @see https://0.vuetifyjs.com/composables/plugins/use-notifications
623
+ *
624
+ * @example
625
+ * ```ts
626
+ * import { useNotifications } from '@vuetify/v0'
627
+ *
628
+ * const notifications = useNotifications()
629
+ *
630
+ * notifications.unarchive('notif-1')
631
+ * ```
632
+ */
633
+ function unarchive(id) {
634
+ registry.upsert(id, { archivedAt: null }, "notification:unarchived");
635
+ }
636
+ /**
637
+ * Snooze a notification until a given time
638
+ *
639
+ * @param id The ID of the notification to snooze.
640
+ * @param until The time at which the snooze expires.
641
+ * @remarks Sets `snoozedUntil` and emits `notification:snoozed`. The composable
642
+ * does not auto-wake — consumers are responsible for calling {@link wake} when
643
+ * the snooze expires (e.g., via a timer or server push).
644
+ *
645
+ * @see https://0.vuetifyjs.com/composables/plugins/use-notifications
646
+ *
647
+ * @example
648
+ * ```ts
649
+ * import { useNotifications } from '@vuetify/v0'
650
+ *
651
+ * const notifications = useNotifications()
652
+ *
653
+ * const tomorrow = new Date(Date.now() + 86_400_000)
654
+ * notifications.snooze('notif-1', tomorrow)
655
+ * ```
656
+ */
657
+ function snooze(id, until) {
658
+ registry.upsert(id, { snoozedUntil: until }, "notification:snoozed");
659
+ }
660
+ /**
661
+ * Cancel a snooze
662
+ *
663
+ * @param id The ID of the notification to wake.
664
+ * @remarks Clears `snoozedUntil` and emits `notification:unsnoozed`.
665
+ *
666
+ * @see https://0.vuetifyjs.com/composables/plugins/use-notifications
667
+ *
668
+ * @example
669
+ * ```ts
670
+ * import { useNotifications } from '@vuetify/v0'
671
+ *
672
+ * const notifications = useNotifications()
673
+ *
674
+ * notifications.wake('notif-1')
675
+ * ```
676
+ */
677
+ function wake(id) {
678
+ registry.upsert(id, { snoozedUntil: null }, "notification:unsnoozed");
679
+ }
680
+ /**
681
+ * Mark all unread notifications as read
682
+ *
683
+ * @remarks Iterates all notifications and marks unread ones as read in a single
684
+ * batch. Skips already-read notifications to preserve their original `readAt`
685
+ * timestamp. Emits `notification:read` for each affected notification.
686
+ *
687
+ * @see https://0.vuetifyjs.com/composables/plugins/use-notifications
688
+ *
689
+ * @example
690
+ * ```ts
691
+ * import { useNotifications } from '@vuetify/v0'
692
+ *
693
+ * const notifications = useNotifications()
694
+ *
695
+ * notifications.send({ subject: 'Message 1' })
696
+ * notifications.send({ subject: 'Message 2' })
697
+ *
698
+ * notifications.readAll()
699
+ *
700
+ * console.log(notifications.values().every(t => t.readAt !== null)) // true
701
+ * ```
702
+ */
703
+ function readAll() {
704
+ const now = /* @__PURE__ */ new Date();
705
+ registry.batch(() => {
706
+ for (const ticket of registry.values()) if (/* @__PURE__ */ isNull(ticket.readAt)) registry.upsert(ticket.id, { readAt: now }, "notification:read");
707
+ });
708
+ }
709
+ /**
710
+ * Archive all unarchived notifications
711
+ *
712
+ * @remarks Iterates all notifications and archives unarchived ones in a single
713
+ * batch. Skips already-archived notifications to preserve their original
714
+ * `archivedAt` timestamp. Emits `notification:archived` for each affected notification.
715
+ *
716
+ * @see https://0.vuetifyjs.com/composables/plugins/use-notifications
717
+ *
718
+ * @example
719
+ * ```ts
720
+ * import { useNotifications } from '@vuetify/v0'
721
+ *
722
+ * const notifications = useNotifications()
723
+ *
724
+ * notifications.send({ subject: 'Alert 1' })
725
+ * notifications.send({ subject: 'Alert 2' })
726
+ *
727
+ * notifications.archiveAll()
728
+ *
729
+ * console.log(notifications.values().every(t => t.archivedAt !== null)) // true
730
+ * ```
731
+ */
732
+ function archiveAll() {
733
+ const now = /* @__PURE__ */ new Date();
734
+ registry.batch(() => {
735
+ for (const ticket of registry.values()) if (/* @__PURE__ */ isNull(ticket.archivedAt)) registry.upsert(ticket.id, { archivedAt: now }, "notification:archived");
736
+ });
737
+ }
738
+ return {
739
+ ...registry,
740
+ send,
741
+ register,
742
+ onboard,
743
+ queue,
744
+ read,
745
+ unread,
746
+ seen,
747
+ archive,
748
+ unarchive,
749
+ snooze,
750
+ wake,
751
+ readAll,
752
+ archiveAll,
753
+ get size() {
754
+ return registry.size;
755
+ }
756
+ };
757
+ }
758
+ function noop() {}
759
+ const EMPTY = [];
760
+ function createNotificationsFallback() {
761
+ const stub = {
762
+ id: "",
763
+ index: 0,
764
+ value: 0,
765
+ valueIsIndex: true,
766
+ createdAt: /* @__PURE__ */ new Date(0),
767
+ readAt: null,
768
+ seenAt: null,
769
+ archivedAt: null,
770
+ snoozedUntil: null,
771
+ read: noop,
772
+ unread: noop,
773
+ seen: noop,
774
+ archive: noop,
775
+ unarchive: noop,
776
+ snooze: noop,
777
+ wake: noop,
778
+ dismiss: noop,
779
+ unregister: noop
780
+ };
781
+ return {
782
+ collection: /* @__PURE__ */ new Map(),
783
+ size: 0,
784
+ send: () => stub,
785
+ queue: {
786
+ collection: /* @__PURE__ */ new Map(),
787
+ size: 0,
788
+ register: () => ({}),
789
+ unregister: () => void 0,
790
+ has: () => false,
791
+ get: () => void 0,
792
+ keys: () => EMPTY,
793
+ values: () => EMPTY,
794
+ entries: () => EMPTY,
795
+ browse: () => void 0,
796
+ lookup: () => void 0,
797
+ upsert: () => ({}),
798
+ seek: () => void 0,
799
+ move: () => void 0,
800
+ on: noop,
801
+ off: noop,
802
+ emit: noop,
803
+ dispose: noop,
804
+ clear: noop,
805
+ reindex: noop,
806
+ batch: (fn) => fn(),
807
+ onboard: () => EMPTY,
808
+ offboard: noop,
809
+ pause: () => void 0,
810
+ resume: () => void 0
811
+ },
812
+ read: noop,
813
+ unread: noop,
814
+ seen: noop,
815
+ archive: noop,
816
+ unarchive: noop,
817
+ snooze: noop,
818
+ wake: noop,
819
+ readAll: noop,
820
+ archiveAll: noop,
821
+ clear: noop,
822
+ has: () => false,
823
+ get: () => void 0,
824
+ keys: () => EMPTY,
825
+ values: () => EMPTY,
826
+ entries: () => EMPTY,
827
+ browse: () => void 0,
828
+ lookup: () => void 0,
829
+ upsert: () => stub,
830
+ register: () => stub,
831
+ unregister: noop,
832
+ reindex: noop,
833
+ move: () => void 0,
834
+ seek: () => void 0,
835
+ on: noop,
836
+ off: noop,
837
+ emit: noop,
838
+ dispose: noop,
839
+ batch: (fn) => fn(),
840
+ onboard: () => EMPTY,
841
+ offboard: noop
842
+ };
843
+ }
844
+ /**
845
+ * Notification management with registry, event system, and optional adapters.
846
+ *
847
+ * @see https://0.vuetifyjs.com/composables/plugins/use-notifications
848
+ *
849
+ * @example
850
+ * ```ts
851
+ * import { createNotificationsPlugin, useNotifications } from '@vuetify/v0'
852
+ *
853
+ * // Install as plugin
854
+ * app.use(createNotificationsPlugin())
855
+ *
856
+ * // Use in components
857
+ * const notifications = useNotifications()
858
+ * notifications.send({ subject: 'Saved', severity: 'success' })
859
+ * ```
860
+ */
861
+ const [createNotificationsContext, createNotificationsPlugin, useNotifications] = createPluginContext("v0:notifications", (options) => createNotifications(options), {
862
+ fallback: () => createNotificationsFallback(),
863
+ setup: (context, app, options) => {
864
+ app.onUnmount(() => {
865
+ context.dispose();
866
+ context.queue.dispose();
867
+ });
868
+ const { adapter } = options;
869
+ if (!adapter) return;
870
+ adapter.setup({
871
+ send: context.send,
872
+ register: context.register,
873
+ on: context.on,
874
+ off: context.off
875
+ });
876
+ if (/* @__PURE__ */ isFunction(adapter.dispose)) app.onUnmount(() => adapter.dispose());
877
+ }
878
+ });
879
+ //#endregion
880
+ export { createQueue as a, useTimer as c, useNotifications as i, createNotificationsContext as n, createQueueContext as o, createNotificationsPlugin as r, useQueue as s, createNotifications as t };