@vuetify/v0 1.0.0-beta.2 → 1.0.0-beta.4

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 (102) hide show
  1. package/README.md +1 -1
  2. package/dist/{adapter-D2ABPTpo.d.mts → adapter-BI-oyZCe.d.mts} +3 -2
  3. package/dist/{adapter-CQoi3rdC.d.mts → adapter-Butx_2UU.d.mts} +1 -1
  4. package/dist/{adapter-Cj7vxEdB.mjs → adapter-CJY6aQIS.mjs} +5 -1
  5. package/dist/browser/index.d.ts +25318 -0
  6. package/dist/browser/index.js +285 -170
  7. package/dist/components/index.d.mts +1 -1
  8. package/dist/components/index.mjs +1 -1
  9. package/dist/{components-DcOwIGXt.mjs → components-CQ570531.mjs} +119 -72
  10. package/dist/composables/index.d.mts +7 -7
  11. package/dist/composables/index.mjs +22 -22
  12. package/dist/{composables-DxKmYiTj.mjs → composables-Dp_S74ft.mjs} +11 -11
  13. package/dist/constants/index.mjs +1 -1
  14. package/dist/{createDataTable-CBfnCUKU.mjs → createDataTable-xLtNGdr7.mjs} +3 -3
  15. package/dist/{createGroup-BTG6xcyp.mjs → createGroup-CBsJPLpN.mjs} +1 -1
  16. package/dist/{createRegistry-Cb6ftNMU.mjs → createRegistry-CRsG7t_g.mjs} +2 -2
  17. package/dist/{createSelection-BMvXj84C.mjs → createSelection-DuaoHPSc.mjs} +8 -3
  18. package/dist/{createSingle-BCUJuV4D.mjs → createSingle-CiKU87Hj.mjs} +1 -1
  19. package/dist/{createTokens-BSSQAfNX.mjs → createTokens-4BZfgv9F.mjs} +6 -6
  20. package/dist/data-table/index.d.mts +1 -1
  21. package/dist/data-table/index.mjs +1 -1
  22. package/dist/date/index.mjs +1 -1
  23. package/dist/features/adapters/flagsmith/index.d.mts +1 -1
  24. package/dist/features/adapters/launchdarkly/index.d.mts +1 -1
  25. package/dist/features/adapters/posthog/index.d.mts +1 -1
  26. package/dist/features/adapters/posthog/index.mjs +1 -1
  27. package/dist/features/index.d.mts +2 -2
  28. package/dist/features/index.mjs +1 -1
  29. package/dist/{flagsmith-CXzNBqm3.d.mts → flagsmith-DA2GCyGv.d.mts} +1 -1
  30. package/dist/{globals-C1X-9O7K.mjs → globals-B0pQgO4u.mjs} +1 -1
  31. package/dist/{index-LMiCHwZl.d.mts → index-BBJnOUyA.d.mts} +2 -1
  32. package/dist/{index-DLBPM47A.d.mts → index-BkTaCktP.d.mts} +106 -104
  33. package/dist/{index-CKyDkh8J.d.mts → index-CV7bOS7B.d.mts} +82 -12
  34. package/dist/{index-Bmz8PZMY.d.mts → index-CfHm03dg.d.mts} +1 -1
  35. package/dist/{index-B9YmdGZ3.d.mts → index-CyNk9FpR.d.mts} +3 -0
  36. package/dist/{index-DRrHHgE7.d.mts → index-DgPFPx_7.d.mts} +2 -2
  37. package/dist/{index-rJ_lhMYJ.d.mts → index-pM8UX1XI.d.mts} +2 -2
  38. package/dist/index.d.mts +10 -10
  39. package/dist/index.mjs +24 -24
  40. package/dist/json/attributes.json +8 -4
  41. package/dist/json/tags.json +2 -1
  42. package/dist/json/web-types.json +16 -6
  43. package/dist/{launchdarkly-DvhloBts.d.mts → launchdarkly-Bp8p9PMD.d.mts} +1 -1
  44. package/dist/locale/adapters/index.d.mts +2 -2
  45. package/dist/locale/adapters/index.mjs +1 -1
  46. package/dist/locale/adapters/v0/index.d.mts +1 -1
  47. package/dist/locale/adapters/v0/index.mjs +1 -1
  48. package/dist/locale/adapters/vue-i18n/index.d.mts +2 -1
  49. package/dist/locale/adapters/vue-i18n/index.mjs +3 -0
  50. package/dist/locale/index.d.mts +3 -3
  51. package/dist/locale/index.mjs +2 -2
  52. package/dist/locale/messages/en/index.d.mts +70 -0
  53. package/dist/locale/messages/en/index.mjs +56 -0
  54. package/dist/logger/adapters/index.mjs +1 -1
  55. package/dist/logger/adapters/v0/index.mjs +1 -1
  56. package/dist/logger/index.d.mts +1 -1
  57. package/dist/logger/index.mjs +2 -2
  58. package/dist/notifications/index.d.mts +1 -1
  59. package/dist/notifications/index.mjs +2 -2
  60. package/dist/palettes/ant/index.d.mts +1 -1
  61. package/dist/palettes/index.d.mts +3 -3
  62. package/dist/palettes/material/index.d.mts +1 -1
  63. package/dist/palettes/md1/index.d.mts +1 -1
  64. package/dist/palettes/md2/index.d.mts +1 -1
  65. package/dist/palettes/radix/index.d.mts +1 -1
  66. package/dist/palettes/tailwind/index.d.mts +1 -1
  67. package/dist/permissions/adapters/index.d.mts +1 -1
  68. package/dist/permissions/adapters/v0/index.d.mts +1 -1
  69. package/dist/permissions/index.d.mts +1 -1
  70. package/dist/permissions/index.mjs +1 -1
  71. package/dist/{posthog-BOT5W7Ds.d.mts → posthog-sFqk0bGy.d.mts} +1 -1
  72. package/dist/rules/index.d.mts +1 -1
  73. package/dist/rules/index.mjs +1 -1
  74. package/dist/storage/index.d.mts +1 -1
  75. package/dist/storage/index.mjs +1 -1
  76. package/dist/theme/adapters/index.d.mts +1 -1
  77. package/dist/theme/adapters/index.mjs +3 -3
  78. package/dist/theme/adapters/unhead/index.d.mts +1 -1
  79. package/dist/theme/adapters/unhead/index.mjs +1 -1
  80. package/dist/theme/adapters/v0/index.d.mts +1 -1
  81. package/dist/theme/adapters/v0/index.mjs +1 -1
  82. package/dist/theme/index.d.mts +1 -1
  83. package/dist/theme/index.mjs +4 -4
  84. package/dist/types/index.d.mts +1 -1
  85. package/dist/{unhead-i8ji788n.mjs → unhead-Bn7eatWe.mjs} +10 -5
  86. package/dist/{useEventListener-BK_uaXZv.mjs → useEventListener-D1ETqQMm.mjs} +1 -1
  87. package/dist/{useFeatures-BKAK56af.mjs → useFeatures-D3DFBsYY.mjs} +3 -3
  88. package/dist/{useLocale-CTwn8uZk.mjs → useLocale-B44zLhFE.mjs} +9 -4
  89. package/dist/{useLogger-D7_hm4e8.mjs → useLogger-D7Fqcp_l.mjs} +11 -8
  90. package/dist/{useNotifications-B2YeotHN.mjs → useNotifications-DMHmr9C1.mjs} +4 -4
  91. package/dist/{usePermissions-CWYXR7ji.mjs → usePermissions-S0As54sf.mjs} +2 -2
  92. package/dist/{useRovingFocus-BdnSUVrD.mjs → useRovingFocus-u7uhPx2H.mjs} +111 -85
  93. package/dist/{useRules-CB2_tvd0.mjs → useRules-ByuxbMsA.mjs} +2 -2
  94. package/dist/{useStorage-BORz1d1g.mjs → useStorage-Fy5tWYkG.mjs} +3 -3
  95. package/dist/{useTheme-ClUmdmvT.mjs → useTheme-DrR7HoLL.mjs} +4 -4
  96. package/dist/utilities/index.d.mts +1 -1
  97. package/dist/utilities/index.mjs +4 -3
  98. package/dist/{v0-DL9JtgCO.mjs → v0-BDdBMbzN.mjs} +1 -1
  99. package/dist/{v0-BU39ZO4s.mjs → v0-BXjZknUK.mjs} +18 -5
  100. package/dist/{v0-D7NA38Vu.d.mts → v0-Cf5DZ4lw.d.mts} +3 -1
  101. package/dist/{v0-SwedwC_b.mjs → v0-DwKPTLJv.mjs} +16 -10
  102. package/package.json +4 -4
@@ -1,7 +1,7 @@
1
- import { s as __LOGGER_ENABLED__, t as IN_BROWSER } from "./globals-C1X-9O7K.mjs";
1
+ import { s as __LOGGER_ENABLED__, t as IN_BROWSER } from "./globals-B0pQgO4u.mjs";
2
2
  import { isNullOrUndefined, isUndefined } from "./utilities/index.mjs";
3
3
  import { i as useContext, t as createTrinity } from "./createTrinity-z-3q9QWR.mjs";
4
- import { t as V0LoggerAdapter } from "./v0-DL9JtgCO.mjs";
4
+ import { t as V0LoggerAdapter } from "./v0-BDdBMbzN.mjs";
5
5
  import { hasInjectionContext, inject, watch } from "vue";
6
6
  //#region src/composables/createPlugin/index.ts
7
7
  /**
@@ -108,13 +108,15 @@ function createPluginContext(defaultNamespace, factory, config) {
108
108
  }
109
109
  function createXPlugin(_options = {}) {
110
110
  const { namespace = defaultNamespace, persist: shouldPersist, ...options } = _options;
111
- const [, provide, context] = createXContext({
112
- ...options,
113
- namespace
114
- });
111
+ let context;
115
112
  return createPlugin({
116
113
  namespace,
117
114
  provide: (app) => {
115
+ const [, provide, ctx] = createXContext({
116
+ ...options,
117
+ namespace
118
+ });
119
+ context = ctx;
118
120
  provide(context, app);
119
121
  if (shouldPersist && config?.restore) {
120
122
  const storage = getPersistedStorage();
@@ -124,12 +126,13 @@ function createPluginContext(defaultNamespace, factory, config) {
124
126
  }
125
127
  },
126
128
  setup: config?.setup || shouldPersist ? (app) => {
127
- config?.setup?.(context, app, options);
129
+ const ctx = context;
130
+ config?.setup?.(ctx, app, options);
128
131
  if (shouldPersist && config?.persist) {
129
132
  const storage = getPersistedStorage();
130
133
  const key = deriveKey(namespace);
131
134
  const stored = storage.get(key);
132
- const stop = watch(() => config.persist(context), (val) => {
135
+ const stop = watch(() => config.persist(ctx), (val) => {
133
136
  stored.value = val;
134
137
  });
135
138
  app.onUnmount(stop);
@@ -1,8 +1,8 @@
1
- import { t as IN_BROWSER } from "./globals-C1X-9O7K.mjs";
1
+ import { t as IN_BROWSER } from "./globals-B0pQgO4u.mjs";
2
2
  import { isFunction, isNull, isUndefined, useId as useId$1 } from "./utilities/index.mjs";
3
3
  import { i as useContext, t as createTrinity } from "./createTrinity-z-3q9QWR.mjs";
4
- import { o as createPluginContext } from "./useLogger-D7_hm4e8.mjs";
5
- import { t as createRegistry } from "./createRegistry-Cb6ftNMU.mjs";
4
+ import { o as createPluginContext } from "./useLogger-D7Fqcp_l.mjs";
5
+ import { t as createRegistry } from "./createRegistry-CRsG7t_g.mjs";
6
6
  import { onScopeDispose, shallowRef, toValue } from "vue";
7
7
  //#region src/composables/useTimer/index.ts
8
8
  /**
@@ -233,7 +233,7 @@ function createQueue(_options = {}) {
233
233
  }
234
234
  function register(registration = {}) {
235
235
  const id = registration.id ?? /* @__PURE__ */ useId$1();
236
- const timeout = Object.prototype.hasOwnProperty.call(registration, "timeout") ? registration.timeout : _timeout;
236
+ const timeout = Object.hasOwn(registration, "timeout") ? registration.timeout : _timeout;
237
237
  const ticket = {
238
238
  ...registration,
239
239
  id,
@@ -1,6 +1,6 @@
1
1
  import { UNSAFE_KEYS } from "./utilities/index.mjs";
2
- import { o as createPluginContext } from "./useLogger-D7_hm4e8.mjs";
3
- import { t as createTokens } from "./createTokens-BSSQAfNX.mjs";
2
+ import { o as createPluginContext } from "./useLogger-D7Fqcp_l.mjs";
3
+ import { t as createTokens } from "./createTokens-4BZfgv9F.mjs";
4
4
  import { t as toArray } from "./toArray-C89ZaEuF.mjs";
5
5
  import { t as V0PermissionsAdapter } from "./v0-UNyykD27.mjs";
6
6
  //#region src/composables/usePermissions/index.ts
@@ -1,16 +1,16 @@
1
- import { a as SUPPORTS_OBSERVER, n as SUPPORTS_INTERSECTION_OBSERVER, t as IN_BROWSER } from "./globals-C1X-9O7K.mjs";
1
+ import { a as SUPPORTS_OBSERVER, n as SUPPORTS_INTERSECTION_OBSERVER, t as IN_BROWSER } from "./globals-B0pQgO4u.mjs";
2
2
  import { clamp, instanceExists, isArray, isElement, isFunction, isNull, isNullOrUndefined, isObject, isString, isUndefined, range, resolveIds, resolveIndexes, useId as useId$1 } from "./utilities/index.mjs";
3
3
  import { i as useContext, t as createTrinity } from "./createTrinity-z-3q9QWR.mjs";
4
- import { a as createPlugin, i as useLogger, o as createPluginContext } from "./useLogger-D7_hm4e8.mjs";
5
- import { t as createRegistry } from "./createRegistry-Cb6ftNMU.mjs";
6
- import { i as createModel, t as createSelection } from "./createSelection-BMvXj84C.mjs";
7
- import { t as createSingle } from "./createSingle-BCUJuV4D.mjs";
4
+ import { a as createPlugin, i as useLogger, o as createPluginContext } from "./useLogger-D7Fqcp_l.mjs";
5
+ import { t as createRegistry } from "./createRegistry-CRsG7t_g.mjs";
6
+ import { i as createModel, t as createSelection } from "./createSelection-DuaoHPSc.mjs";
7
+ import { t as createSingle } from "./createSingle-CiKU87Hj.mjs";
8
8
  import { t as toArray } from "./toArray-C89ZaEuF.mjs";
9
- import { n as useEventListener, r as useWindowEventListener, t as useDocumentEventListener } from "./useEventListener-BK_uaXZv.mjs";
10
- import { t as createGroup } from "./createGroup-BTG6xcyp.mjs";
11
- import { c as useTimer } from "./useNotifications-B2YeotHN.mjs";
9
+ import { n as useEventListener, r as useWindowEventListener, t as useDocumentEventListener } from "./useEventListener-D1ETqQMm.mjs";
10
+ import { t as createGroup } from "./createGroup-CBsJPLpN.mjs";
11
+ import { c as useTimer } from "./useNotifications-DMHmr9C1.mjs";
12
12
  import { i as createFilter } from "./createPagination-B5dfqY-a.mjs";
13
- import { a as useRules, o as isStandardSchema } from "./useRules-CB2_tvd0.mjs";
13
+ import { a as useRules, o as isStandardSchema } from "./useRules-ByuxbMsA.mjs";
14
14
  import { computed, effectScope, hasInjectionContext, isReadonly, isRef, nextTick, onMounted, onScopeDispose, ref, shallowReactive, shallowReadonly, shallowRef, toRef, toValue, watch } from "vue";
15
15
  //#region src/composables/useClickOutside/index.ts
16
16
  /**
@@ -192,6 +192,19 @@ function useClickOutside(target, handler, options = {}) {
192
192
  });
193
193
  }
194
194
  /**
195
+ * Check if the event target is a strict descendant of any target element.
196
+ *
197
+ * @remarks Used by bounds mode so content rendered *inside* the element but
198
+ * positioned outside its box (e.g. a top-layer overlay teleported into a
199
+ * native `<dialog>`) is not treated as an outside click. A backdrop click has
200
+ * `target === el`, so it is not a strict descendant and still counts as outside.
201
+ */
202
+ function isDescendant(eventTarget) {
203
+ /* v8 ignore next -- defensive guard, callers always pass an Element */
204
+ if (!(eventTarget instanceof Node)) return false;
205
+ return getTargets().some((el) => el !== eventTarget && el.contains(eventTarget));
206
+ }
207
+ /**
195
208
  * Validate that the target is still in the DOM.
196
209
  */
197
210
  function isValidTarget(eventTarget) {
@@ -231,7 +244,7 @@ function useClickOutside(target, handler, options = {}) {
231
244
  const dy = Math.abs(event.clientY - startPosition.y);
232
245
  if (dx >= touchScrollThreshold || dy >= touchScrollThreshold) return;
233
246
  }
234
- if ((bounds ? startedOutsideBounds && isOutsideBounds(event.clientX, event.clientY) : isOutside(pointerdownTarget) && isOutside(pointerupTarget)) && !shouldIgnore(path)) handler(event);
247
+ if ((bounds ? startedOutsideBounds && isOutsideBounds(event.clientX, event.clientY) && !isDescendant(pointerdownTarget) && !isDescendant(pointerupTarget) : isOutside(pointerdownTarget) && isOutside(pointerupTarget)) && !shouldIgnore(path)) handler(event);
235
248
  }
236
249
  /**
237
250
  * Handle window blur - detect focus moving to iframe.
@@ -288,6 +301,63 @@ function useClickOutside(target, handler, options = {}) {
288
301
  };
289
302
  }
290
303
  //#endregion
304
+ //#region src/composables/toElement/index.ts
305
+ /**
306
+ * @module toElement
307
+ *
308
+ * @see https://0.vuetifyjs.com/composables/transformers/to-element
309
+ *
310
+ * @remarks
311
+ * Resolves various element reference types to a DOM Element.
312
+ *
313
+ * Accepts refs, getters, raw DOM elements, or Vue component instances
314
+ * and normalizes them to a plain Element. Uses structural typing to
315
+ * avoid cross-version Vue Ref incompatibilities.
316
+ *
317
+ * @example
318
+ * ```ts
319
+ * import { shallowRef } from 'vue'
320
+ * import { toElement } from '@vuetify/v0'
321
+ *
322
+ * const el = shallowRef<HTMLElement | null>(null)
323
+ * const resolved = toElement(el) // HTMLElement | undefined
324
+ * ```
325
+ */
326
+ /**
327
+ * Resolves a {@link MaybeElementRef} to a DOM Element or undefined.
328
+ *
329
+ * Handles:
330
+ * - `Ref<Element>`, `ShallowRef<HTMLElement>`, getter functions
331
+ * - Vue component instances (extracts `$el`)
332
+ * - Raw DOM elements (pass-through)
333
+ * - null/undefined (returns undefined)
334
+ *
335
+ * @param target The element ref, getter, or raw value to resolve
336
+ * @returns The resolved DOM Element, or undefined if not available
337
+ *
338
+ * @see https://0.vuetifyjs.com/composables/transformers/to-element
339
+ *
340
+ * @example
341
+ * ```ts
342
+ * import { toElement } from '@vuetify/v0'
343
+ *
344
+ * const el = shallowRef<HTMLElement | null>(null)
345
+ * toElement(el) // HTMLElement | undefined
346
+ *
347
+ * const component = ref<ComponentPublicInstance>()
348
+ * toElement(component) // Element | undefined (from $el)
349
+ * ```
350
+ */
351
+ /* @__NO_SIDE_EFFECTS__ */
352
+ function toElement(target) {
353
+ if (!target) return void 0;
354
+ if (/* @__PURE__ */ isElement(target)) return target;
355
+ const raw = /* @__PURE__ */ isFunction(target) ? target() : /* @__PURE__ */ isObject(target) && "value" in target ? target.value : target;
356
+ if (!raw) return void 0;
357
+ if (/* @__PURE__ */ isElement(raw)) return raw;
358
+ if (/* @__PURE__ */ isObject(raw) && "$el" in raw) return raw.$el;
359
+ }
360
+ //#endregion
291
361
  //#region src/composables/useStack/index.ts
292
362
  /**
293
363
  * @module useStack
@@ -344,23 +414,31 @@ function createStack(_options = {}) {
344
414
  ...options,
345
415
  multiple: true
346
416
  });
347
- const isActive = toRef(() => selection.selectedIds.size > 0);
348
- const top = toRef(() => {
349
- const ids = Array.from(selection.selectedIds);
350
- if (ids.length === 0) return void 0;
351
- return selection.get(ids.at(-1));
352
- });
417
+ function selectedScrims() {
418
+ return Array.from(selection.selectedIds).map((id) => selection.get(id)).filter((ticket) => !!ticket && ticket.scrim.value !== false);
419
+ }
420
+ const isActive = toRef(() => selectedScrims().length > 0);
421
+ const top = toRef(() => selectedScrims().at(-1));
353
422
  const scrimZIndex = toRef(() => {
354
423
  const ticket = top.value;
355
424
  return ticket ? ticket.zIndex.value - 1 : 0;
356
425
  });
357
- const isBlocking = toRef(() => top.value?.blocking ?? false);
426
+ const isBlocking = toRef(() => toValue(top.value?.blocking) ?? false);
427
+ const topElement = toRef(() => {
428
+ const scrims = selectedScrims();
429
+ for (let i = scrims.length - 1; i >= 0; i--) {
430
+ const el = /* @__PURE__ */ toElement(toValue(scrims[i].el));
431
+ if (el) return el;
432
+ }
433
+ return null;
434
+ });
358
435
  function ids() {
359
436
  return Array.from(selection.selectedIds);
360
437
  }
361
438
  function register(input = {}) {
362
439
  const id = input.id ?? /* @__PURE__ */ useId$1();
363
- const blocking = input.blocking ?? false;
440
+ const blocking = toRef(() => toValue(input.blocking) ?? false);
441
+ const scrim = toRef(() => toValue(input.scrim) ?? true);
364
442
  const onDismiss = input.onDismiss;
365
443
  const zIndex = toRef(() => {
366
444
  const position = ids().indexOf(id);
@@ -373,17 +451,18 @@ function createStack(_options = {}) {
373
451
  return list.at(-1) === id;
374
452
  });
375
453
  function dismiss() {
376
- if (blocking) return;
454
+ if (blocking.value) return;
377
455
  onDismiss?.();
378
456
  selection.unselect(id);
379
457
  }
380
458
  const ticket = selection.register({
459
+ ...input,
381
460
  blocking,
461
+ scrim,
382
462
  onDismiss,
383
463
  zIndex,
384
464
  globalTop,
385
465
  dismiss,
386
- ...input,
387
466
  id
388
467
  });
389
468
  if (/* @__PURE__ */ instanceExists()) onScopeDispose(() => {
@@ -398,6 +477,7 @@ function createStack(_options = {}) {
398
477
  top,
399
478
  scrimZIndex,
400
479
  isBlocking,
480
+ topElement,
401
481
  get size() {
402
482
  return selection.size;
403
483
  }
@@ -464,6 +544,7 @@ function createStackPlugin(_options = {}) {
464
544
  }
465
545
  let fallbackStack;
466
546
  function getStackFallback() {
547
+ if (!IN_BROWSER) return createStack();
467
548
  if (!fallbackStack) fallbackStack = createStack();
468
549
  return fallbackStack;
469
550
  }
@@ -730,63 +811,6 @@ const [createHydrationContext, createHydrationPlugin, useHydration] = createPlug
730
811
  }
731
812
  });
732
813
  //#endregion
733
- //#region src/composables/toElement/index.ts
734
- /**
735
- * @module toElement
736
- *
737
- * @see https://0.vuetifyjs.com/composables/transformers/to-element
738
- *
739
- * @remarks
740
- * Resolves various element reference types to a DOM Element.
741
- *
742
- * Accepts refs, getters, raw DOM elements, or Vue component instances
743
- * and normalizes them to a plain Element. Uses structural typing to
744
- * avoid cross-version Vue Ref incompatibilities.
745
- *
746
- * @example
747
- * ```ts
748
- * import { shallowRef } from 'vue'
749
- * import { toElement } from '@vuetify/v0'
750
- *
751
- * const el = shallowRef<HTMLElement | null>(null)
752
- * const resolved = toElement(el) // HTMLElement | undefined
753
- * ```
754
- */
755
- /**
756
- * Resolves a {@link MaybeElementRef} to a DOM Element or undefined.
757
- *
758
- * Handles:
759
- * - `Ref<Element>`, `ShallowRef<HTMLElement>`, getter functions
760
- * - Vue component instances (extracts `$el`)
761
- * - Raw DOM elements (pass-through)
762
- * - null/undefined (returns undefined)
763
- *
764
- * @param target The element ref, getter, or raw value to resolve
765
- * @returns The resolved DOM Element, or undefined if not available
766
- *
767
- * @see https://0.vuetifyjs.com/composables/transformers/to-element
768
- *
769
- * @example
770
- * ```ts
771
- * import { toElement } from '@vuetify/v0'
772
- *
773
- * const el = shallowRef<HTMLElement | null>(null)
774
- * toElement(el) // HTMLElement | undefined
775
- *
776
- * const component = ref<ComponentPublicInstance>()
777
- * toElement(component) // Element | undefined (from $el)
778
- * ```
779
- */
780
- /* @__NO_SIDE_EFFECTS__ */
781
- function toElement(target) {
782
- if (!target) return void 0;
783
- if (/* @__PURE__ */ isElement(target)) return target;
784
- const raw = /* @__PURE__ */ isFunction(target) ? target() : /* @__PURE__ */ isObject(target) && "value" in target ? target.value : target;
785
- if (!raw) return void 0;
786
- if (/* @__PURE__ */ isElement(raw)) return raw;
787
- if (/* @__PURE__ */ isObject(raw) && "$el" in raw) return raw.$el;
788
- }
789
- //#endregion
790
814
  //#region src/composables/createObserver/index.ts
791
815
  /**
792
816
  * @module createObserver
@@ -1990,6 +2014,7 @@ function useDelay(callback, options = {}) {
1990
2014
  function usePopover(options = {}) {
1991
2015
  const { id: _id, positionArea = "bottom", positionTry = "most-width bottom", openDelay, closeDelay } = options;
1992
2016
  const id = _id ?? /* @__PURE__ */ useId$1();
2017
+ const anchor = `--${String(id).replace(/[^a-zA-Z0-9_-]/g, "")}`;
1993
2018
  const isOpen = options.isOpen ?? shallowRef(false);
1994
2019
  const delay = useDelay((direction) => {
1995
2020
  isOpen.value = direction;
@@ -2010,7 +2035,7 @@ function usePopover(options = {}) {
2010
2035
  function cancel() {
2011
2036
  delay.stop();
2012
2037
  }
2013
- const anchorStyles = toRef(() => ({ anchorName: `--${id}` }));
2038
+ const anchorStyles = toRef(() => ({ anchorName: anchor }));
2014
2039
  const contentAttrs = toRef(() => ({
2015
2040
  id,
2016
2041
  popover: ""
@@ -2020,7 +2045,7 @@ function usePopover(options = {}) {
2020
2045
  "margin": "unset",
2021
2046
  "inset-area": positionArea,
2022
2047
  "position-area": positionArea,
2023
- "position-anchor": `--${id}`,
2048
+ "position-anchor": anchor,
2024
2049
  "position-try-fallbacks": positionTry
2025
2050
  }));
2026
2051
  /* v8 ignore start -- browser popover API */
@@ -3444,16 +3469,17 @@ function createNumberField(options = {}) {
3444
3469
  const result = Number(cleaned);
3445
3470
  return Number.isNaN(result) ? null : result;
3446
3471
  }
3447
- function commit() {
3448
- if (/* @__PURE__ */ isNull(value.value)) return;
3449
- if (!shouldClamp && (value.value < numeric.min || value.value > numeric.max)) {
3472
+ function commit(next) {
3473
+ const val = arguments.length === 0 ? value.value : next;
3474
+ if (/* @__PURE__ */ isNull(val)) return;
3475
+ if (!shouldClamp && (val < numeric.min || val > numeric.max)) {
3450
3476
  if (numeric.step > 0 && Number.isFinite(numeric.min)) {
3451
- const steps = Math.round((value.value - numeric.min) / numeric.step);
3477
+ const steps = Math.round((val - numeric.min) / numeric.step);
3452
3478
  value.value = numeric.min + steps * numeric.step;
3453
3479
  }
3454
3480
  return;
3455
3481
  }
3456
- value.value = numeric.snap(value.value);
3482
+ value.value = numeric.snap(val);
3457
3483
  }
3458
3484
  return {
3459
3485
  value,
@@ -4980,4 +5006,4 @@ function useRovingFocus(items, options = {}) {
4980
5006
  };
4981
5007
  }
4982
5008
  //#endregion
4983
- export { createHydrationContext as $, useCombobox as A, createBreadcrumbs as B, useIntersectionObserver as C, useLazy as D, useForm as E, useDelay as F, createOverflowContext as G, useBreadcrumbs as H, createStep as I, useResizeObserver as J, useOverflow as K, createStepContext as L, ComboboxAdapter as M, useVirtualFocus as N, createCombobox as O, usePopover as P, createHydration as Q, useStep as R, useElementIntersection as S, createFormContext as T, useImage as U, createBreadcrumbsContext as V, createOverflow as W, toElement as X, createObserver as Y, createFallbackHydration as Z, useRaf as _, createTooltipContext as a, createStackPlugin as at, createInput as b, useTooltip as c, createRatingContext as d, createHydrationPlugin as et, useRating as f, usePresence as g, useProgress as h, useNested as i, createStackContext as it, ClientComboboxAdapter as j, createComboboxContext as k, createSlider as l, createProgressContext as m, createNested as n, useToggleScope as nt, createTooltipFallback as o, useStack as ot, createProgress as p, useElementSize as q, createNestedContext as r, createStack as rt, createTooltipPlugin as s, useClickOutside as st, useRovingFocus as t, useHydration as tt, createRating as u, createNumberField as v, createForm as w, createValidation as x, createNumeric as y, useProxyModel as z };
5009
+ export { createHydrationPlugin as $, useCombobox as A, createBreadcrumbs as B, useIntersectionObserver as C, useLazy as D, useForm as E, useDelay as F, createOverflowContext as G, useBreadcrumbs as H, createStep as I, useResizeObserver as J, useOverflow as K, createStepContext as L, ComboboxAdapter as M, useVirtualFocus as N, createCombobox as O, usePopover as P, createHydrationContext as Q, useStep as R, useElementIntersection as S, createFormContext as T, useImage as U, createBreadcrumbsContext as V, createOverflow as W, createFallbackHydration as X, createObserver as Y, createHydration as Z, useRaf as _, createTooltipContext as a, useStack as at, createInput as b, useTooltip as c, createRatingContext as d, useHydration as et, useRating as f, usePresence as g, useProgress as h, useNested as i, createStackPlugin as it, ClientComboboxAdapter as j, createComboboxContext as k, createSlider as l, createProgressContext as m, createNested as n, createStack as nt, createTooltipFallback as o, toElement as ot, createProgress as p, useElementSize as q, createNestedContext as r, createStackContext as rt, createTooltipPlugin as s, useClickOutside as st, useRovingFocus as t, useToggleScope as tt, createRating as u, createNumberField as v, createForm as w, createValidation as x, createNumeric as y, useProxyModel as z };
@@ -1,6 +1,6 @@
1
1
  import { instanceExists, isFunction, isObject } from "./utilities/index.mjs";
2
- import { i as useLogger, o as createPluginContext } from "./useLogger-D7_hm4e8.mjs";
3
- import { a as useLocale } from "./useLocale-CTwn8uZk.mjs";
2
+ import { i as useLogger, o as createPluginContext } from "./useLogger-D7Fqcp_l.mjs";
3
+ import { a as useLocale } from "./useLocale-B44zLhFE.mjs";
4
4
  //#region src/composables/useRules/adapters/standard.ts
5
5
  /**
6
6
  * Type guard for Standard Schema objects.
@@ -1,7 +1,7 @@
1
- import { t as IN_BROWSER } from "./globals-C1X-9O7K.mjs";
1
+ import { t as IN_BROWSER } from "./globals-B0pQgO4u.mjs";
2
2
  import { isArray, isNullOrUndefined, isObject } from "./utilities/index.mjs";
3
- import { i as useLogger, o as createPluginContext } from "./useLogger-D7_hm4e8.mjs";
4
- import { r as useWindowEventListener } from "./useEventListener-BK_uaXZv.mjs";
3
+ import { i as useLogger, o as createPluginContext } from "./useLogger-D7Fqcp_l.mjs";
4
+ import { r as useWindowEventListener } from "./useEventListener-D1ETqQMm.mjs";
5
5
  import { t as MemoryStorageAdapter } from "./memory-BJjkQzxs.mjs";
6
6
  import { ref, watch } from "vue";
7
7
  //#region src/composables/useStorage/index.ts
@@ -1,8 +1,8 @@
1
1
  import { foreground } from "./utilities/index.mjs";
2
- import { o as createPluginContext } from "./useLogger-D7_hm4e8.mjs";
3
- import { t as createSingle } from "./createSingle-BCUJuV4D.mjs";
4
- import { r as flatten, t as createTokens } from "./createTokens-BSSQAfNX.mjs";
5
- import { t as V0StyleSheetThemeAdapter } from "./v0-BU39ZO4s.mjs";
2
+ import { o as createPluginContext } from "./useLogger-D7Fqcp_l.mjs";
3
+ import { t as createSingle } from "./createSingle-CiKU87Hj.mjs";
4
+ import { r as flatten, t as createTokens } from "./createTokens-4BZfgv9F.mjs";
5
+ import { t as V0StyleSheetThemeAdapter } from "./v0-BXjZknUK.mjs";
6
6
  import { computed, shallowRef, toRef } from "vue";
7
7
  //#region src/composables/useTheme/index.ts
8
8
  /**
@@ -1,2 +1,2 @@
1
- import { A as rgbToHex, C as useId, D as foreground, E as apca, O as RGB, S as resolveIndexes, T as isV0Error, _ as isThenable, a as isArray, b as range, c as isFunction, d as isNullOrUndefined, f as isNumber, g as isSymbol, h as isString, i as clamp, k as hexToRgb, l as isNaN, m as isPrimitive, n as instanceName, o as isBoolean, p as isObject, r as UNSAFE_KEYS, s as isElement, t as instanceExists, u as isNull, v as isUndefined, w as V0Error, x as resolveIds, y as mergeDeep } from "../index-LMiCHwZl.mjs";
1
+ import { A as rgbToHex, C as useId, D as foreground, E as apca, O as RGB, S as resolveIndexes, T as isV0Error, _ as isThenable, a as isArray, b as range, c as isFunction, d as isNullOrUndefined, f as isNumber, g as isSymbol, h as isString, i as clamp, k as hexToRgb, l as isNaN, m as isPrimitive, n as instanceName, o as isBoolean, p as isObject, r as UNSAFE_KEYS, s as isElement, t as instanceExists, u as isNull, v as isUndefined, w as V0Error, x as resolveIds, y as mergeDeep } from "../index-BBJnOUyA.mjs";
2
2
  export { RGB, UNSAFE_KEYS, V0Error, apca, clamp, foreground, hexToRgb, instanceExists, instanceName, isArray, isBoolean, isElement, isFunction, isNaN, isNull, isNullOrUndefined, isNumber, isObject, isPrimitive, isString, isSymbol, isThenable, isUndefined, isV0Error, mergeDeep, range, resolveIds, resolveIndexes, rgbToHex, useId };
@@ -1,4 +1,4 @@
1
- import { t as IN_BROWSER } from "../globals-C1X-9O7K.mjs";
1
+ import { t as IN_BROWSER } from "../globals-B0pQgO4u.mjs";
2
2
  import * as Vue from "vue";
3
3
  import { useId as useId$1 } from "vue";
4
4
  //#region src/utilities/color.ts
@@ -448,12 +448,12 @@ function isPlainObject(value) {
448
448
  /* @__NO_SIDE_EFFECTS__ */
449
449
  function mergeDeep(target, ...sources) {
450
450
  const out = {};
451
- for (const key in target) if (Object.prototype.hasOwnProperty.call(target, key)) out[key] = target[key];
451
+ for (const key in target) if (Object.hasOwn(target, key)) out[key] = target[key];
452
452
  for (const source of sources) {
453
453
  if (!/* @__PURE__ */ isObject(source)) continue;
454
454
  for (const key in source) {
455
455
  if (UNSAFE_KEYS.has(key)) continue;
456
- if (!Object.prototype.hasOwnProperty.call(source, key)) continue;
456
+ if (!Object.hasOwn(source, key)) continue;
457
457
  const sourceValue = source[key];
458
458
  if (/* @__PURE__ */ isUndefined(sourceValue)) continue;
459
459
  const targetValue = out[key];
@@ -620,6 +620,7 @@ var V0Error = class extends Error {
620
620
  seed;
621
621
  variant;
622
622
  adapter;
623
+ prefix;
623
624
  constructor(message, details) {
624
625
  const { cause, ...rest } = details;
625
626
  super(message, /* @__PURE__ */ isUndefined(cause) ? void 0 : { cause });
@@ -1,4 +1,4 @@
1
- import { t as IN_BROWSER } from "./globals-C1X-9O7K.mjs";
1
+ import { t as IN_BROWSER } from "./globals-B0pQgO4u.mjs";
2
2
  import { isFunction } from "./utilities/index.mjs";
3
3
  import { t as LoggerAdapter } from "./adapter-Chznb9Ju.mjs";
4
4
  //#region src/composables/useLogger/adapters/v0.ts
@@ -1,6 +1,6 @@
1
- import { t as IN_BROWSER } from "./globals-C1X-9O7K.mjs";
1
+ import { t as IN_BROWSER } from "./globals-B0pQgO4u.mjs";
2
2
  import { isNull, isString } from "./utilities/index.mjs";
3
- import { t as ThemeAdapter } from "./adapter-Cj7vxEdB.mjs";
3
+ import { t as ThemeAdapter } from "./adapter-CJY6aQIS.mjs";
4
4
  import { watch } from "vue";
5
5
  //#region src/composables/useTheme/adapters/v0.ts
6
6
  /**
@@ -22,12 +22,18 @@ var V0StyleSheetThemeAdapter = class extends ThemeAdapter {
22
22
  this.update(colors, isDark);
23
23
  });
24
24
  if (/* @__PURE__ */ isNull(target)) {
25
- this.dispose = stopWatch;
25
+ this.dispose = () => {
26
+ stopWatch();
27
+ this.detach();
28
+ };
26
29
  return;
27
30
  }
28
31
  const targetEl = target instanceof HTMLElement ? target : /* @__PURE__ */ isString(target) ? document.querySelector(target) : app._container || document.querySelector("#app") || document.body;
29
32
  if (!targetEl) {
30
- this.dispose = stopWatch;
33
+ this.dispose = () => {
34
+ stopWatch();
35
+ this.detach();
36
+ };
31
37
  return;
32
38
  }
33
39
  if (context.selectedId.value) targetEl.dataset.theme = String(context.selectedId.value);
@@ -38,6 +44,7 @@ var V0StyleSheetThemeAdapter = class extends ThemeAdapter {
38
44
  this.dispose = () => {
39
45
  stopWatch();
40
46
  stopTheme();
47
+ this.detach();
41
48
  };
42
49
  } else {
43
50
  const head = app._context?.provides?.usehead ?? app._context?.provides?.head;
@@ -47,7 +54,8 @@ var V0StyleSheetThemeAdapter = class extends ThemeAdapter {
47
54
  htmlAttrs: { "data-theme": id ? String(id) : "" },
48
55
  style: [{
49
56
  innerHTML: this.generate(context.colors.value, context.isDark.value),
50
- id: this.stylesheetId
57
+ id: this.stylesheetId,
58
+ ...this.cspNonce ? { nonce: this.cspNonce } : {}
51
59
  }]
52
60
  });
53
61
  if (entry?.dispose) this.dispose = entry.dispose;
@@ -66,6 +74,11 @@ var V0StyleSheetThemeAdapter = class extends ThemeAdapter {
66
74
  }
67
75
  this.sheet.replaceSync(styles);
68
76
  }
77
+ detach() {
78
+ if (!IN_BROWSER) return;
79
+ document.adoptedStyleSheets = document.adoptedStyleSheets.filter((s) => s !== this.sheet);
80
+ this.sheet = void 0;
81
+ }
69
82
  };
70
83
  //#endregion
71
84
  export { V0StyleSheetThemeAdapter as t };
@@ -1,4 +1,4 @@
1
- import { n as LocaleAdapterContext, t as LocaleAdapter } from "./adapter-D2ABPTpo.mjs";
1
+ import { n as LocaleAdapterContext, t as LocaleAdapter } from "./adapter-BI-oyZCe.mjs";
2
2
 
3
3
  //#region src/composables/useLocale/adapters/v0.d.ts
4
4
  /**
@@ -11,7 +11,9 @@ declare class V0LocaleAdapter extends LocaleAdapter {
11
11
  private context;
12
12
  constructor(context: LocaleAdapterContext);
13
13
  t(key: string, ...params: unknown[]): string;
14
+ ti(key: string, ...params: unknown[]): string | undefined;
14
15
  n(value: number): string;
16
+ private lookup;
15
17
  private resolve;
16
18
  private interpolate;
17
19
  }
@@ -1,4 +1,4 @@
1
- import { t as IN_BROWSER } from "./globals-C1X-9O7K.mjs";
1
+ import { t as IN_BROWSER } from "./globals-B0pQgO4u.mjs";
2
2
  import { isObject, isString, isUndefined } from "./utilities/index.mjs";
3
3
  import { t as LocaleAdapter } from "./adapter-bwZo7b5p.mjs";
4
4
  //#region src/composables/useLocale/adapters/v0.ts
@@ -15,21 +15,27 @@ var V0LocaleAdapter = class extends LocaleAdapter {
15
15
  this.context = context;
16
16
  }
17
17
  t(key, ...params) {
18
- const locale = this.context.selectedId.value;
19
- if (!locale) return this.interpolate(key, params);
20
- const message = this.context.tokens.get(`${locale}.${key}`)?.value;
21
- if (/* @__PURE__ */ isString(message)) return this.interpolate(this.resolve(locale, message), params);
22
- if (this.context.fallbackLocale) {
23
- const fbMessage = this.context.tokens.get(`${this.context.fallbackLocale}.${key}`)?.value;
24
- if (/* @__PURE__ */ isString(fbMessage)) return this.interpolate(this.resolve(this.context.fallbackLocale, fbMessage), params);
25
- }
26
- return this.interpolate(key, params);
18
+ const found = this.lookup(key, params);
19
+ return /* @__PURE__ */ isUndefined(found) ? this.interpolate(key, params) : found;
20
+ }
21
+ ti(key, ...params) {
22
+ return this.lookup(key, params);
27
23
  }
28
24
  n(value) {
29
25
  const locale = this.context.selectedId.value;
30
26
  if (!IN_BROWSER || !locale) return value.toString();
31
27
  return new Intl.NumberFormat(String(locale)).format(value);
32
28
  }
29
+ lookup(key, params) {
30
+ const locale = this.context.selectedId.value;
31
+ if (!locale) return void 0;
32
+ const message = this.context.tokens.get(`${locale}.${key}`)?.value;
33
+ if (/* @__PURE__ */ isString(message)) return this.interpolate(this.resolve(locale, message), params);
34
+ if (this.context.fallbackLocale) {
35
+ const fb = this.context.tokens.get(`${this.context.fallbackLocale}.${key}`)?.value;
36
+ if (/* @__PURE__ */ isString(fb)) return this.interpolate(this.resolve(this.context.fallbackLocale, fb), params);
37
+ }
38
+ }
33
39
  resolve(locale, str, visited = /* @__PURE__ */ new Set()) {
34
40
  return str.replace(/{([a-zA-Z0-9.\-_]+)}/g, (match, key) => {
35
41
  const [prefix, ...rest] = key.split(".");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuetify/v0",
3
- "version": "1.0.0-beta.2",
3
+ "version": "1.0.0-beta.4",
4
4
  "description": "A meta UI framework for building applications, component libraries, and design systems with Vue 3",
5
5
  "license": "MIT",
6
6
  "funding": [
@@ -73,7 +73,6 @@
73
73
  "launchdarkly-js-client-sdk": "^3.9.1",
74
74
  "posthog-js": "^1.372.6",
75
75
  "tsdown": "^0.21.10",
76
- "tsx": "4.21.0",
77
76
  "typescript": "6.0.3",
78
77
  "unplugin-vue": "^7.2.0",
79
78
  "vue": "3.5.33",
@@ -105,6 +104,7 @@
105
104
  "./locale/adapters": "./dist/locale/adapters/index.mjs",
106
105
  "./locale/adapters/v0": "./dist/locale/adapters/v0/index.mjs",
107
106
  "./locale/adapters/vue-i18n": "./dist/locale/adapters/vue-i18n/index.mjs",
107
+ "./locale/messages/en": "./dist/locale/messages/en/index.mjs",
108
108
  "./logger": "./dist/logger/index.mjs",
109
109
  "./logger/adapters": "./dist/logger/adapters/index.mjs",
110
110
  "./logger/adapters/consola": "./dist/logger/adapters/consola/index.mjs",
@@ -140,8 +140,8 @@
140
140
  "scripts": {
141
141
  "build": "pnpm build:tsdown && pnpm build:web-types",
142
142
  "build:tsdown": "tsdown",
143
- "build:web-types": "tsx scripts/generate-web-types.ts",
144
- "generate:web-types": "tsx scripts/generate-web-types.ts",
143
+ "build:web-types": "node scripts/generate-web-types.ts",
144
+ "generate:web-types": "node scripts/generate-web-types.ts",
145
145
  "typecheck": "vue-tsc --noEmit --incremental"
146
146
  }
147
147
  }