@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
@@ -1,6 +1,6 @@
1
- import { clamp, isObject, isString, isUndefined, useId as useId$1 } from "./utilities/index.mjs";
1
+ import { clamp, isUndefined, useId as useId$1 } from "./utilities/index.mjs";
2
2
  import { i as useContext, t as createTrinity } from "./createTrinity-BTCs1pYx.mjs";
3
- import { i as useLogger } from "./useLogger-DFIRqm-N.mjs";
3
+ import { i as useLogger } from "./useLogger-DvdRTrqC.mjs";
4
4
  import { shallowReactive } from "vue";
5
5
  //#region src/composables/createRegistry/index.ts
6
6
  /**
@@ -171,6 +171,7 @@ function createRegistry(options) {
171
171
  else catalog.set(value, next);
172
172
  }
173
173
  function keys() {
174
+ if (reactive) return Array.from(collection.keys());
174
175
  const cached = cache.get("keys");
175
176
  if (!/* @__PURE__ */ isUndefined(cached)) return cached;
176
177
  const keys = Array.from(collection.keys());
@@ -178,6 +179,7 @@ function createRegistry(options) {
178
179
  return keys;
179
180
  }
180
181
  function values() {
182
+ if (reactive) return Array.from(collection.values());
181
183
  const cached = cache.get("values");
182
184
  if (!/* @__PURE__ */ isUndefined(cached)) return cached;
183
185
  const values = Array.from(collection.values());
@@ -185,6 +187,7 @@ function createRegistry(options) {
185
187
  return values;
186
188
  }
187
189
  function entries() {
190
+ if (reactive) return Array.from(collection.entries());
188
191
  const cached = cache.get("entries");
189
192
  if (!/* @__PURE__ */ isUndefined(cached)) return cached;
190
193
  const entries = Array.from(collection.entries());
@@ -432,300 +435,4 @@ function useRegistry(namespace = "v0:registry") {
432
435
  return useContext(namespace);
433
436
  }
434
437
  //#endregion
435
- //#region src/composables/createTokens/index.ts
436
- /**
437
- * @module createTokens
438
- *
439
- * @see https://0.vuetifyjs.com/composables/registration/create-tokens
440
- *
441
- * @remarks
442
- * Design token registry with alias resolution and W3C Design Tokens format support.
443
- *
444
- * Key features:
445
- * - Alias resolution with circular reference detection
446
- * - Nested token flattening with dot notation
447
- * - W3C Design Tokens format ($value, $type, $description, $extensions)
448
- * - Path-based resolution (e.g., {colors}.blue.500)
449
- * - Resolution caching for performance (~28,590 ops/sec)
450
- *
451
- * Used by useTheme, useLocale, and useFeatures for token-based configuration.
452
- *
453
- * @example
454
- * ```ts
455
- * import { createTokens } from '@vuetify/v0'
456
- *
457
- * const tokens = createTokens({
458
- * colors: { primary: '#1976d2' },
459
- * })
460
- * console.log(tokens.resolve('{colors.primary}'))
461
- * ```
462
- */
463
- /**
464
- * Creates a new token instance.
465
- *
466
- * @param tokens The tokens to use.
467
- * @param options The options for the token instance.
468
- * @template Z The type of the token ticket.
469
- * @template E The type of the token context.
470
- * @returns A new token instance.
471
- *
472
- * @see https://www.designtokens.org/tr/drafts/format/
473
- * @see https://0.vuetifyjs.com/composables/registration/create-tokens
474
- *
475
- * @example
476
- * ```ts
477
- * import { createTokens } from '@vuetify/v0'
478
- *
479
- * const tokens = createTokens({
480
- * colors: {
481
- * primary: '#3b82f6',
482
- * secondary: '{colors.primary}', // Alias reference
483
- * },
484
- * })
485
- *
486
- * console.log(tokens.resolve('{colors.primary}')) // '#3b82f6'
487
- * console.log(tokens.resolve('{colors.secondary}')) // '#3b82f6'
488
- * ```
489
- */
490
- function createTokens(tokens = {}, options = {}) {
491
- const logger = useLogger();
492
- const registry = createRegistry(options);
493
- const cache = /* @__PURE__ */ new Map();
494
- registry.onboard(flatten(tokens, options.prefix, !!options.flat));
495
- function isAlias(token) {
496
- return /* @__PURE__ */ isString(token) && token.length > 2 && token[0] === "{" && token.at(-1) === "}";
497
- }
498
- function isTokenAlias(value) {
499
- return /* @__PURE__ */ isObject(value) && "$value" in value;
500
- }
501
- function resolve(token, visited = /* @__PURE__ */ new Set()) {
502
- const cacheKey = /* @__PURE__ */ isString(token) ? token : JSON.stringify(token);
503
- if (cache.has(cacheKey)) return cache.get(cacheKey);
504
- const reference = isTokenAlias(token) ? token.$value : token;
505
- const isAliasReference = /* @__PURE__ */ isString(reference) && isAlias(reference);
506
- const clean = isAliasReference ? reference.slice(1, -1) : String(reference);
507
- if (visited.has(clean)) {
508
- logger.warn(`Circular alias detected for "${clean}"`);
509
- cache.set(cacheKey, void 0);
510
- return;
511
- }
512
- visited.add(clean);
513
- let found = registry.get(clean);
514
- let segments = [];
515
- if (!found && clean.includes(".")) {
516
- const parts = clean.split(".");
517
- for (let i = parts.length - 1; i > 0; i--) {
518
- const prefix = parts.slice(0, i).join(".");
519
- const suffix = parts.slice(i);
520
- const candidate = registry.get(prefix);
521
- if (!/* @__PURE__ */ isUndefined(candidate?.value)) {
522
- found = candidate;
523
- segments = suffix;
524
- break;
525
- }
526
- }
527
- }
528
- if (/* @__PURE__ */ isUndefined(found?.value)) {
529
- if (isAliasReference) logger.warn(`Alias not found for "${String(reference)}"`);
530
- cache.set(cacheKey, void 0);
531
- return;
532
- }
533
- let result;
534
- let current = found.value;
535
- if (segments.length > 0) {
536
- if (isTokenAlias(current)) current = current.$value;
537
- for (const segment of segments) {
538
- if (!/* @__PURE__ */ isObject(current) || !(segment in current)) {
539
- current = void 0;
540
- break;
541
- }
542
- current = current[segment];
543
- if (isTokenAlias(current)) current = current.$value;
544
- }
545
- if (/* @__PURE__ */ isUndefined(current)) {
546
- logger.warn(`Path not found inside "${clean}": ${segments.join(".")}`);
547
- cache.set(cacheKey, void 0);
548
- return;
549
- }
550
- result = current;
551
- } else if (isTokenAlias(current)) {
552
- const inner = current.$value;
553
- if (/* @__PURE__ */ isString(inner) && isAlias(inner)) return resolve(inner, visited);
554
- result = inner;
555
- } else if (/* @__PURE__ */ isString(current) && isAlias(current)) return resolve(current, visited);
556
- else result = current;
557
- cache.set(cacheKey, result);
558
- return result;
559
- }
560
- const { register: _register, upsert: _upsert, unregister: _unregister, onboard: _onboard, offboard: _offboard, move: _move, clear: _clear } = registry;
561
- function register(registration) {
562
- cache.clear();
563
- return _register(registration);
564
- }
565
- function upsert(id, registration) {
566
- cache.clear();
567
- return _upsert(id, registration);
568
- }
569
- function unregister(id) {
570
- cache.clear();
571
- return _unregister(id);
572
- }
573
- function onboard(registrations) {
574
- cache.clear();
575
- return _onboard(registrations);
576
- }
577
- function offboard(ids) {
578
- cache.clear();
579
- return _offboard(ids);
580
- }
581
- function move(id, index) {
582
- cache.clear();
583
- return _move(id, index);
584
- }
585
- function clear() {
586
- cache.clear();
587
- return _clear();
588
- }
589
- return {
590
- ...registry,
591
- register,
592
- upsert,
593
- unregister,
594
- onboard,
595
- offboard,
596
- move,
597
- clear,
598
- resolve,
599
- isAlias,
600
- get size() {
601
- return registry.size;
602
- }
603
- };
604
- }
605
- /**
606
- * Creates a new token context.
607
- *
608
- * @param namespace The namespace for the token context.
609
- * @param tokens The tokens to use.
610
- * @template Z The type of the token ticket.
611
- * @template E The type of the token context.
612
- * @returns A new token context.
613
- *
614
- * @see https://0.vuetifyjs.com/composables/registration/create-tokens
615
- *
616
- * @example
617
- * ```ts
618
- * import { createTokensContext } from '@vuetify/v0'
619
- *
620
- * export const [useTokens, provideTokens, context] = createTokensContext({
621
- * namespace: 'v0:tokens',
622
- * tokens: {
623
- * colors: {
624
- * primary: '#3b82f6',
625
- * secondary: '{colors.primary}', // Alias reference
626
- * },
627
- * },
628
- * })
629
- * ```
630
- */
631
- function createTokensContext(_options) {
632
- const { namespace = "v0:tokens", tokens = {}, ...options } = _options;
633
- return createTrinity(namespace, createTokens(tokens, options));
634
- }
635
- /**
636
- * Returns the current tokens instance.
637
- *
638
- * @param namespace The namespace for the tokens context. Defaults to `'v0:tokens'`.
639
- * @returns The current tokens instance.
640
- *
641
- * @see https://0.vuetifyjs.com/composables/registration/create-tokens
642
- *
643
- * @example
644
- * ```vue
645
- * <script setup lang="ts">
646
- * import { useTokens } from '@vuetify/v0'
647
- *
648
- * const tokens = useTokens()
649
- * <\/script>
650
- * ```
651
- */
652
- function useTokens(namespace = "v0:tokens") {
653
- return useContext(namespace);
654
- }
655
- /**
656
- * Flattens a nested collection of tokens into a flat array of tokens.
657
- * Each token is represented by an object containing its ID & value.
658
- * @param tokens The collection of tokens to flatten.
659
- * @param prefix An optional prefix to prepend to each token ID.
660
- * @returns An array of flattened tokens, each with an ID and value.
661
- */
662
- function flatten(tokens, prefix = "", flat = false) {
663
- const flattened = [];
664
- const stack = [{
665
- tokens,
666
- prefix,
667
- flat
668
- }];
669
- while (stack.length > 0) {
670
- const { tokens: currentTokens, prefix: currentPrefix, flat } = stack.pop();
671
- const meta = {};
672
- for (const k in currentTokens) if (k.startsWith("$")) meta[k] = currentTokens[k];
673
- if (Object.keys(meta).length > 0 && currentPrefix) flattened.push({
674
- id: currentPrefix,
675
- value: meta
676
- });
677
- for (const key in currentTokens) {
678
- if (key.startsWith("$")) continue;
679
- const value = currentTokens[key];
680
- const id = currentPrefix ? `${currentPrefix}.${key}` : key;
681
- if (!/* @__PURE__ */ isObject(value)) {
682
- flattened.push({
683
- id,
684
- value
685
- });
686
- continue;
687
- }
688
- if ("$value" in value) {
689
- flattened.push({
690
- id,
691
- value
692
- });
693
- const inner = value.$value;
694
- if (/* @__PURE__ */ isObject(inner) && !flat) for (const innerKey in inner) {
695
- if (innerKey.startsWith("$")) continue;
696
- const child = inner[innerKey];
697
- const childId = `${id}.${innerKey}`;
698
- if (!/* @__PURE__ */ isObject(child)) flattened.push({
699
- id: childId,
700
- value: child
701
- });
702
- else if ("$value" in child) flattened.push({
703
- id: childId,
704
- value: child
705
- });
706
- else stack.push({
707
- tokens: child,
708
- prefix: childId,
709
- flat
710
- });
711
- }
712
- continue;
713
- }
714
- if (flat) {
715
- flattened.push({
716
- id,
717
- value
718
- });
719
- continue;
720
- }
721
- stack.push({
722
- tokens: value,
723
- prefix: id,
724
- flat
725
- });
726
- }
727
- }
728
- return flattened;
729
- }
730
- //#endregion
731
- export { createRegistry as a, useTokens as i, createTokensContext as n, createRegistryContext as o, flatten as r, useRegistry as s, createTokens as t };
438
+ export { createRegistryContext as n, useRegistry as r, createRegistry as t };
@@ -1,6 +1,6 @@
1
1
  import { isUndefined, resolveIds, useId as useId$1 } from "./utilities/index.mjs";
2
2
  import { i as useContext, t as createTrinity } from "./createTrinity-BTCs1pYx.mjs";
3
- import { a as createRegistry } from "./createTokens-oJAeh262.mjs";
3
+ import { t as createRegistry } from "./createRegistry-BXzdXAjq.mjs";
4
4
  import { computed, isRef, shallowReactive, toRaw, toRef, toValue } from "vue";
5
5
  //#region src/composables/createModel/index.ts
6
6
  /**
@@ -1,5 +1,5 @@
1
1
  import { i as useContext, t as createTrinity } from "./createTrinity-BTCs1pYx.mjs";
2
- import { t as createSelection } from "./createSelection-BA9guLah.mjs";
2
+ import { t as createSelection } from "./createSelection-B3HJEPNg.mjs";
3
3
  import { toRef } from "vue";
4
4
  //#region src/composables/createSingle/index.ts
5
5
  /**
@@ -0,0 +1,302 @@
1
+ import { isObject, isString, isUndefined } from "./utilities/index.mjs";
2
+ import { i as useContext, t as createTrinity } from "./createTrinity-BTCs1pYx.mjs";
3
+ import { i as useLogger } from "./useLogger-DvdRTrqC.mjs";
4
+ import { t as createRegistry } from "./createRegistry-BXzdXAjq.mjs";
5
+ //#region src/composables/createTokens/index.ts
6
+ /**
7
+ * @module createTokens
8
+ *
9
+ * @see https://0.vuetifyjs.com/composables/registration/create-tokens
10
+ *
11
+ * @remarks
12
+ * Design token registry with alias resolution and W3C Design Tokens format support.
13
+ *
14
+ * Key features:
15
+ * - Alias resolution with circular reference detection
16
+ * - Nested token flattening with dot notation
17
+ * - W3C Design Tokens format ($value, $type, $description, $extensions)
18
+ * - Path-based resolution (e.g., {colors}.blue.500)
19
+ * - Resolution caching for performance (~28,590 ops/sec)
20
+ *
21
+ * Used by useTheme, useLocale, and useFeatures for token-based configuration.
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * import { createTokens } from '@vuetify/v0'
26
+ *
27
+ * const tokens = createTokens({
28
+ * colors: { primary: '#1976d2' },
29
+ * })
30
+ * console.log(tokens.resolve('{colors.primary}'))
31
+ * ```
32
+ */
33
+ /**
34
+ * Creates a new token instance.
35
+ *
36
+ * @param tokens The tokens to use.
37
+ * @param options The options for the token instance.
38
+ * @template Z The type of the token ticket.
39
+ * @template E The type of the token context.
40
+ * @returns A new token instance.
41
+ *
42
+ * @see https://www.designtokens.org/tr/drafts/format/
43
+ * @see https://0.vuetifyjs.com/composables/registration/create-tokens
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * import { createTokens } from '@vuetify/v0'
48
+ *
49
+ * const tokens = createTokens({
50
+ * colors: {
51
+ * primary: '#3b82f6',
52
+ * secondary: '{colors.primary}', // Alias reference
53
+ * },
54
+ * })
55
+ *
56
+ * console.log(tokens.resolve('{colors.primary}')) // '#3b82f6'
57
+ * console.log(tokens.resolve('{colors.secondary}')) // '#3b82f6'
58
+ * ```
59
+ */
60
+ function createTokens(tokens = {}, options = {}) {
61
+ const logger = useLogger();
62
+ const registry = createRegistry(options);
63
+ const cache = /* @__PURE__ */ new Map();
64
+ registry.onboard(/* @__PURE__ */ flatten(tokens, options.prefix, !!options.flat));
65
+ function isAlias(token) {
66
+ return /* @__PURE__ */ isString(token) && token.length > 2 && token[0] === "{" && token.at(-1) === "}";
67
+ }
68
+ function isTokenAlias(value) {
69
+ return /* @__PURE__ */ isObject(value) && "$value" in value;
70
+ }
71
+ function resolve(token, visited = /* @__PURE__ */ new Set()) {
72
+ const cacheKey = /* @__PURE__ */ isString(token) ? token : JSON.stringify(token);
73
+ if (cache.has(cacheKey)) return cache.get(cacheKey);
74
+ const reference = isTokenAlias(token) ? token.$value : token;
75
+ const isAliasReference = /* @__PURE__ */ isString(reference) && isAlias(reference);
76
+ const clean = isAliasReference ? reference.slice(1, -1) : String(reference);
77
+ if (visited.has(clean)) {
78
+ logger.warn(`Circular alias detected for "${clean}"`);
79
+ cache.set(cacheKey, void 0);
80
+ return;
81
+ }
82
+ visited.add(clean);
83
+ let found = registry.get(clean);
84
+ let segments = [];
85
+ if (!found && clean.includes(".")) {
86
+ const parts = clean.split(".");
87
+ for (let i = parts.length - 1; i > 0; i--) {
88
+ const prefix = parts.slice(0, i).join(".");
89
+ const suffix = parts.slice(i);
90
+ const candidate = registry.get(prefix);
91
+ if (!/* @__PURE__ */ isUndefined(candidate?.value)) {
92
+ found = candidate;
93
+ segments = suffix;
94
+ break;
95
+ }
96
+ }
97
+ }
98
+ if (/* @__PURE__ */ isUndefined(found?.value)) {
99
+ if (isAliasReference) logger.warn(`Alias not found for "${String(reference)}"`);
100
+ cache.set(cacheKey, void 0);
101
+ return;
102
+ }
103
+ let result;
104
+ let current = found.value;
105
+ if (segments.length > 0) {
106
+ if (isTokenAlias(current)) current = current.$value;
107
+ for (const segment of segments) {
108
+ if (!/* @__PURE__ */ isObject(current) || !(segment in current)) {
109
+ current = void 0;
110
+ break;
111
+ }
112
+ current = current[segment];
113
+ if (isTokenAlias(current)) current = current.$value;
114
+ }
115
+ if (/* @__PURE__ */ isUndefined(current)) {
116
+ logger.warn(`Path not found inside "${clean}": ${segments.join(".")}`);
117
+ cache.set(cacheKey, void 0);
118
+ return;
119
+ }
120
+ result = current;
121
+ } else if (isTokenAlias(current)) {
122
+ const inner = current.$value;
123
+ if (/* @__PURE__ */ isString(inner) && isAlias(inner)) return resolve(inner, visited);
124
+ result = inner;
125
+ } else if (/* @__PURE__ */ isString(current) && isAlias(current)) return resolve(current, visited);
126
+ else result = current;
127
+ cache.set(cacheKey, result);
128
+ return result;
129
+ }
130
+ const { register: _register, upsert: _upsert, unregister: _unregister, onboard: _onboard, offboard: _offboard, move: _move, clear: _clear } = registry;
131
+ function register(registration) {
132
+ cache.clear();
133
+ return _register(registration);
134
+ }
135
+ function upsert(id, registration) {
136
+ cache.clear();
137
+ return _upsert(id, registration);
138
+ }
139
+ function unregister(id) {
140
+ cache.clear();
141
+ return _unregister(id);
142
+ }
143
+ function onboard(registrations) {
144
+ cache.clear();
145
+ return _onboard(registrations);
146
+ }
147
+ function offboard(ids) {
148
+ cache.clear();
149
+ return _offboard(ids);
150
+ }
151
+ function move(id, index) {
152
+ cache.clear();
153
+ return _move(id, index);
154
+ }
155
+ function clear() {
156
+ cache.clear();
157
+ return _clear();
158
+ }
159
+ return {
160
+ ...registry,
161
+ register,
162
+ upsert,
163
+ unregister,
164
+ onboard,
165
+ offboard,
166
+ move,
167
+ clear,
168
+ resolve,
169
+ isAlias,
170
+ get size() {
171
+ return registry.size;
172
+ }
173
+ };
174
+ }
175
+ /**
176
+ * Creates a new token context.
177
+ *
178
+ * @param namespace The namespace for the token context.
179
+ * @param tokens The tokens to use.
180
+ * @template Z The type of the token ticket.
181
+ * @template E The type of the token context.
182
+ * @returns A new token context.
183
+ *
184
+ * @see https://0.vuetifyjs.com/composables/registration/create-tokens
185
+ *
186
+ * @example
187
+ * ```ts
188
+ * import { createTokensContext } from '@vuetify/v0'
189
+ *
190
+ * export const [useTokens, provideTokens, context] = createTokensContext({
191
+ * namespace: 'v0:tokens',
192
+ * tokens: {
193
+ * colors: {
194
+ * primary: '#3b82f6',
195
+ * secondary: '{colors.primary}', // Alias reference
196
+ * },
197
+ * },
198
+ * })
199
+ * ```
200
+ */
201
+ function createTokensContext(_options) {
202
+ const { namespace = "v0:tokens", tokens = {}, ...options } = _options;
203
+ return createTrinity(namespace, createTokens(tokens, options));
204
+ }
205
+ /**
206
+ * Returns the current tokens instance.
207
+ *
208
+ * @param namespace The namespace for the tokens context. Defaults to `'v0:tokens'`.
209
+ * @returns The current tokens instance.
210
+ *
211
+ * @see https://0.vuetifyjs.com/composables/registration/create-tokens
212
+ *
213
+ * @example
214
+ * ```vue
215
+ * <script setup lang="ts">
216
+ * import { useTokens } from '@vuetify/v0'
217
+ *
218
+ * const tokens = useTokens()
219
+ * <\/script>
220
+ * ```
221
+ */
222
+ function useTokens(namespace = "v0:tokens") {
223
+ return useContext(namespace);
224
+ }
225
+ /**
226
+ * Flattens a nested collection of tokens into a flat array of tokens.
227
+ * Each token is represented by an object containing its ID & value.
228
+ * @param tokens The collection of tokens to flatten.
229
+ * @param prefix An optional prefix to prepend to each token ID.
230
+ * @returns An array of flattened tokens, each with an ID and value.
231
+ */
232
+ /* @__NO_SIDE_EFFECTS__ */
233
+ function flatten(tokens, prefix = "", flat = false) {
234
+ const flattened = [];
235
+ const stack = [{
236
+ tokens,
237
+ prefix,
238
+ flat
239
+ }];
240
+ while (stack.length > 0) {
241
+ const { tokens: currentTokens, prefix: currentPrefix, flat } = stack.pop();
242
+ const meta = {};
243
+ for (const k in currentTokens) if (k.startsWith("$")) meta[k] = currentTokens[k];
244
+ if (Object.keys(meta).length > 0 && currentPrefix) flattened.push({
245
+ id: currentPrefix,
246
+ value: meta
247
+ });
248
+ for (const key in currentTokens) {
249
+ if (key.startsWith("$")) continue;
250
+ const value = currentTokens[key];
251
+ const id = currentPrefix ? `${currentPrefix}.${key}` : key;
252
+ if (!/* @__PURE__ */ isObject(value)) {
253
+ flattened.push({
254
+ id,
255
+ value
256
+ });
257
+ continue;
258
+ }
259
+ if ("$value" in value) {
260
+ flattened.push({
261
+ id,
262
+ value
263
+ });
264
+ const inner = value.$value;
265
+ if (/* @__PURE__ */ isObject(inner) && !flat) for (const innerKey in inner) {
266
+ if (innerKey.startsWith("$")) continue;
267
+ const child = inner[innerKey];
268
+ const childId = `${id}.${innerKey}`;
269
+ if (!/* @__PURE__ */ isObject(child)) flattened.push({
270
+ id: childId,
271
+ value: child
272
+ });
273
+ else if ("$value" in child) flattened.push({
274
+ id: childId,
275
+ value: child
276
+ });
277
+ else stack.push({
278
+ tokens: child,
279
+ prefix: childId,
280
+ flat
281
+ });
282
+ }
283
+ continue;
284
+ }
285
+ if (flat) {
286
+ flattened.push({
287
+ id,
288
+ value
289
+ });
290
+ continue;
291
+ }
292
+ stack.push({
293
+ tokens: value,
294
+ prefix: id,
295
+ flat
296
+ });
297
+ }
298
+ }
299
+ return flattened;
300
+ }
301
+ //#endregion
302
+ export { useTokens as i, createTokensContext as n, flatten as r, createTokens as t };
@@ -1,2 +1,2 @@
1
- import { t as ClientAdapter } from "../../../v0-Dzw5OwNo.mjs";
1
+ import { t as ClientAdapter } from "../../../v0-CdusXjY_.mjs";
2
2
  export { ClientAdapter };
@@ -1,2 +1,2 @@
1
- import { t as ClientAdapter } from "../../../v0-BG7RhKBv.mjs";
1
+ import { t as ClientAdapter } from "../../../v0-Dq3zhexO.mjs";
2
2
  export { ClientAdapter };
@@ -1,5 +1,5 @@
1
- import { a as SortDirection, i as DataTableAdapterResult, n as DataTableAdapterContext, o as SortEntry, r as DataTableAdapterInterface, t as DataTableAdapter } from "../../adapter-J7ude3gO.mjs";
2
- import { n as ServerAdapterOptions, t as ServerAdapter } from "../../server-ZiHJ4tfq.mjs";
3
- import { t as ClientAdapter } from "../../v0-Dzw5OwNo.mjs";
4
- import { t as VirtualAdapter } from "../../virtual-BCOfxnRS.mjs";
1
+ import { a as SortDirection, i as DataTableAdapterResult, n as DataTableAdapterContext, o as SortEntry, r as DataTableAdapterInterface, t as DataTableAdapter } from "../../adapter-DlX3FA3A.mjs";
2
+ import { n as ServerAdapterOptions, t as ServerAdapter } from "../../server-3ilWFwqe.mjs";
3
+ import { t as ClientAdapter } from "../../v0-CdusXjY_.mjs";
4
+ import { t as VirtualAdapter } from "../../virtual-D4fckewC.mjs";
5
5
  export { ClientAdapter, DataTableAdapter, DataTableAdapterContext, DataTableAdapterInterface, DataTableAdapterResult, ServerAdapter, ServerAdapterOptions, SortDirection, SortEntry, VirtualAdapter };
@@ -1,6 +1,6 @@
1
- import { t as DataTableAdapter } from "../../adapter-CDpOQ8sn.mjs";
2
- import { t as ClientAdapter } from "../../v0-BG7RhKBv.mjs";
3
- import { t as ServerAdapter } from "../../server-B6OtHgBT.mjs";
4
- import { t as VirtualAdapter } from "../../virtual-To-dSw2_.mjs";
5
- import "../../adapters-CFjrKxA2.mjs";
1
+ import { t as DataTableAdapter } from "../../adapter-gQ2SNKZq.mjs";
2
+ import { t as ClientAdapter } from "../../v0-Dq3zhexO.mjs";
3
+ import { t as ServerAdapter } from "../../server-y7zLSCSx.mjs";
4
+ import { t as VirtualAdapter } from "../../virtual-C0yHf1DC.mjs";
5
+ import "../../adapters-Dse4bPxk.mjs";
6
6
  export { ClientAdapter, DataTableAdapter, ServerAdapter, VirtualAdapter };
@@ -1,2 +1,2 @@
1
- import { n as ServerAdapterOptions, t as ServerAdapter } from "../../../server-ZiHJ4tfq.mjs";
1
+ import { n as ServerAdapterOptions, t as ServerAdapter } from "../../../server-3ilWFwqe.mjs";
2
2
  export { ServerAdapter, ServerAdapterOptions };
@@ -1,2 +1,2 @@
1
- import { t as ServerAdapter } from "../../../server-B6OtHgBT.mjs";
1
+ import { t as ServerAdapter } from "../../../server-y7zLSCSx.mjs";
2
2
  export { ServerAdapter };
@@ -1,2 +1,2 @@
1
- import { t as VirtualAdapter } from "../../../virtual-BCOfxnRS.mjs";
1
+ import { t as VirtualAdapter } from "../../../virtual-D4fckewC.mjs";
2
2
  export { VirtualAdapter };