@vuetify/v0 0.0.6 → 0.0.8

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.
@@ -1,4 +1,4 @@
1
- import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createPropsRestProxy, defineComponent, getCurrentInstance, getCurrentScope, guardReactiveProps, inject, isRef, mergeModels, mergeProps, normalizeProps, normalizeStyle, onMounted, onScopeDispose, onUnmounted, openBlock, provide, reactive, readonly, ref, renderSlot, resolveDynamicComponent, shallowReactive, shallowReadonly, shallowRef, toRef, toValue, unref, useAttrs, useId, useModel, useTemplateRef, vShow, watch, withCtx, withDirectives } from "vue";
1
+ import { computed, createBlock, createCommentVNode, createPropsRestProxy, defineComponent, getCurrentInstance, getCurrentScope, guardReactiveProps, inject, isRef, mergeModels, mergeProps, normalizeProps, normalizeStyle, onMounted, onScopeDispose, onUnmounted, openBlock, provide, reactive, readonly, ref, renderSlot, resolveDynamicComponent, shallowReactive, shallowReadonly, shallowRef, toRef, toValue, unref, useAttrs, useId, useModel, useTemplateRef, vShow, watch, withCtx, withDirectives } from "vue";
2
2
 
3
3
  //#region src/constants/htmlElements.ts
4
4
  const selfClosingTags = [
@@ -120,20 +120,25 @@ var Atom_default = Atom_vue_vue_type_script_setup_true_lang_default;
120
120
  * Injects a context provided by an ancestor component.
121
121
  *
122
122
  * @param key The key of the context to inject.
123
+ * @param defaultValue Optional default value if context is not found.
123
124
  * @template Z The type of the context.
124
125
  * @returns The injected context.
125
- * @throws An error if the context is not found.
126
+ * @throws An error if the context is not found and no default is provided.
126
127
  *
127
128
  * @see https://vuejs.org/api/composition-api-dependency-injection.html#inject
128
- * @see https://0.vuetifyjs.com/composables/foundation/create-context
129
+ * @see https://0.vuetifyjs.com/composables/foundation/create-context#use-context
129
130
  *
130
131
  * @example
131
132
  * ```ts
132
- * const myContext = useContext<MyContext>('my-context')
133
+ * // Without default value
134
+ * const context = useContext<MyContext>('my-context')
135
+ *
136
+ * // With default value
137
+ * const context = useContext<MyContext>('my-context', defaultContext)
133
138
  * ```
134
139
  */
135
- function useContext(key) {
136
- const context = inject(key, void 0);
140
+ function useContext(key, defaultValue) {
141
+ const context = inject(key, defaultValue);
137
142
  if (context === void 0) throw new Error(`Context "${String(key)}" not found. Ensure it's provided by an ancestor.`);
138
143
  return context;
139
144
  }
@@ -142,43 +147,58 @@ function useContext(key) {
142
147
  *
143
148
  * @param key The key of the context to provide.
144
149
  * @param context The context to provide.
145
- * @param app The Vue app instance to provide the context to.
150
+ * @param app Optional Vue app instance to provide the context at app level instead of component level.
146
151
  * @template Z The type of the context.
147
152
  * @returns The provided context.
148
153
  *
154
+ * @remarks
155
+ * When `app` parameter is provided, the context is made available to all components in the app.
156
+ * When omitted, the context is provided at the current component level and available to descendants only.
157
+ *
149
158
  * @see https://vuejs.org/api/composition-api-dependency-injection.html#provide
150
- * @see https://0.vuetifyjs.com/composables/foundation/create-context
159
+ * @see https://0.vuetifyjs.com/composables/foundation/create-context#provide-context
151
160
  *
152
161
  * @example
153
162
  * ```ts
154
- * provideContext<MyContext>('my-context', myContext)
163
+ * // Component-level provision
164
+ * provideContext<MyContext>('my-context', context)
165
+ *
166
+ * // App-level provision (typically used in plugins)
167
+ * const app = createApp()
168
+ * provideContext<MyContext>('my-context', context, app)
155
169
  * ```
156
170
  */
157
171
  function provideContext(key, context, app) {
158
- app?.provide(key, context) ?? provide(key, context);
172
+ if (app) app.provide(key, context);
173
+ else provide(key, context);
159
174
  return context;
160
175
  }
161
176
  /**
162
177
  * Creates a new context for providing and injecting data.
163
178
  *
164
179
  * @param key The key of the context to create.
180
+ * @param defaultValue Optional default value if context is not found.
165
181
  * @template Z The type of the context.
166
182
  * @returns A tuple containing the `useContext` and `provideContext` functions.
167
183
  *
168
184
  * @see https://vuejs.org/api/composition-api-dependency-injection.html
169
- * @see https://0.vuetifyjs.com/composables/foundation/create-context
185
+ * @see https://0.vuetifyjs.com/composables/foundation/create-context#create-context
170
186
  *
171
187
  * @example
172
188
  * ```ts
173
- * const [provideMyContext, useMyContext] = createContext<MyContext>('my-context')
189
+ * // Without default value
190
+ * const [useMyContext, provideMyContext] = createContext<MyContext>('my-context')
191
+ *
192
+ * // With default value
193
+ * const [useMyContext, provideMyContext] = createContext<MyContext>('my-context', defaultContext)
174
194
  * ```
175
195
  */
176
- function createContext(_key) {
196
+ function createContext(_key, defaultValue) {
177
197
  function _provideContext(context, app) {
178
198
  return provideContext(_key, context, app);
179
199
  }
180
200
  function _useContext(key = _key) {
181
- return useContext(key);
201
+ return useContext(key, defaultValue);
182
202
  }
183
203
  return [_useContext, _provideContext];
184
204
  }
@@ -191,8 +211,7 @@ function createContext(_key) {
191
211
  * @param options The plugin options.
192
212
  * @returns A new Vue plugin.
193
213
  *
194
- * @see https://vuejs.org/guide/reusability/plugins.html
195
- * @see https://0.vuetifyjs.com/composables/foundation/create-plugin
214
+ * @see https://0.vuetifyjs.com/composables/foundation/create-plugin#create-plugin
196
215
  *
197
216
  * @example
198
217
  * ```ts
@@ -224,13 +243,21 @@ function createPlugin(options) {
224
243
  /**
225
244
  * Creates a new trinity for a context composable and its provider.
226
245
  *
227
- * @param createContext The function that creates the context.
228
- * @param provideContext The function that provides the context.
229
- * @param context The context to provide.
246
+ * @param createContext The function that retrieves/uses the context (typically named `useContext`).
247
+ * @param provideContext The function that provides the context to descendants.
248
+ * @param context The default context instance to use when no custom context is provided.
230
249
  * @template Z The type of the context.
231
- * @returns A new trinity.
250
+ * @returns A readonly tuple containing: [useContext function, provideContext wrapper function, default context instance].
251
+ *
252
+ * @remarks The trinity pattern is a foundational pattern used throughout the codebase for creating reusable context systems. It provides three related elements:
253
+ *
254
+ * 1. A function to retrieve/use the context
255
+ * 2. A function to provide the context (with default value support)
256
+ * 3. The default context instance
257
+ *
258
+ * The returned tuple is readonly (using `as const`) to ensure proper type inference.
232
259
  *
233
- * @see https://0.vuetifyjs.com/composables/foundation/create-trinity
260
+ * @see https://0.vuetifyjs.com/composables/foundation/create-trinity#create-trinity
234
261
  *
235
262
  * @example
236
263
  * ```ts
@@ -250,6 +277,7 @@ function createPlugin(options) {
250
277
  *
251
278
  * return createTrinity<E>(useContext, provideContext, context)
252
279
  * }
280
+ * ```
253
281
  */
254
282
  function createTrinity(createContext$1, provideContext$1, context) {
255
283
  return [
@@ -351,7 +379,7 @@ function toArray(value) {
351
379
  * @template Z The type of the object.
352
380
  * @returns The converted object.
353
381
  *
354
- * @see https://vuejs.org/api/reactivity-utilities.html#toreactive
382
+ * @see https://0.vuetifyjs.com/composables/transformers/to-reactive
355
383
  *
356
384
  * @example
357
385
  * ```ts
@@ -464,7 +492,6 @@ function toReactive(objectRef) {
464
492
 
465
493
  //#endregion
466
494
  //#region src/composables/useHydration/index.ts
467
- const [useHydrationContext, provideHydrationContext] = createContext("v0:hydration");
468
495
  /**
469
496
  * Creates a new hydration instance.
470
497
  *
@@ -476,7 +503,10 @@ const [useHydrationContext, provideHydrationContext] = createContext("v0:hydrati
476
503
  * ```ts
477
504
  * import { createHydration } from '@vuetify/v0'
478
505
  *
479
- * const [useHydration, provideHydration] = createHydration()
506
+ * const hydration = createHydration()
507
+ * console.log(hydration.isHydrated.value) // false
508
+ * hydration.hydrate()
509
+ * console.log(hydration.isHydrated.value) // true
480
510
  * ```
481
511
  */
482
512
  function createHydration() {
@@ -490,33 +520,37 @@ function createHydration() {
490
520
  };
491
521
  }
492
522
  /**
493
- * Returns the current hydration instance.
523
+ * Creates a new hydration context trinity.
494
524
  *
495
- * @returns The current hydration instance.
525
+ * @param options Options for creating the hydration context.
526
+ * @template E The type of the hydration context.
527
+ * @returns A new hydration context trinity.
496
528
  *
497
529
  * @see https://0.vuetifyjs.com/composables/plugins/use-hydration
498
530
  *
499
531
  * @example
500
- * ```vue
501
- * <script setup lang="ts">
502
- * import { useHydration } from '@vuetify/v0'
503
- *
504
- * const hydration = useHydration()
505
- * <\/script>
532
+ * ```ts
533
+ * import { createHydrationContext } from '@vuetify/v0'
506
534
  *
507
- * <template>
508
- * <div>
509
- * <p>Is hydrated: {{ hydration.isHydrated.value }}</p>
510
- * </div>
511
- * </template>
535
+ * export const [useHydrationContext, provideHydrationContext, context] = createHydrationContext({
536
+ * namespace: 'app:hydration',
537
+ * })
512
538
  * ```
513
539
  */
514
- function useHydration() {
515
- return useHydrationContext();
540
+ function createHydrationContext(_options = {}) {
541
+ const { namespace = "v0:hydration" } = _options;
542
+ const [useHydrationContext, _provideHydrationContext] = createContext(namespace);
543
+ const context = createHydration();
544
+ function provideHydrationContext(_context = context, app) {
545
+ return _provideHydrationContext(_context, app);
546
+ }
547
+ return createTrinity(useHydrationContext, provideHydrationContext, context);
516
548
  }
517
549
  /**
518
550
  * Creates a new hydration plugin.
519
551
  *
552
+ * @param options The options for the hydration plugin.
553
+ * @template E The type of the hydration context.
520
554
  * @returns A new hydration plugin.
521
555
  *
522
556
  * @see https://0.vuetifyjs.com/composables/plugins/use-hydration
@@ -527,19 +561,21 @@ function useHydration() {
527
561
  * import { createHydrationPlugin } from '@vuetify/v0'
528
562
  * import App from './App.vue'
529
563
  *
530
- * const plugin = createHydrationPlugin()
531
- *
532
564
  * const app = createApp(App)
533
565
  *
534
- * app.use(plugin)
566
+ * app.use(createHydrationPlugin())
535
567
  *
536
568
  * app.mount('#app')
537
569
  * ```
538
570
  */
539
- function createHydrationPlugin() {
540
- const context = createHydration();
571
+ function createHydrationPlugin(_options = {}) {
572
+ const { namespace = "v0:hydration",...options } = _options;
573
+ const [, provideHydrationContext, context] = createHydrationContext({
574
+ ...options,
575
+ namespace
576
+ });
541
577
  return createPlugin({
542
- namespace: "v0:hydration",
578
+ namespace,
543
579
  provide: (app) => {
544
580
  provideHydrationContext(context, app);
545
581
  },
@@ -551,6 +587,32 @@ function createHydrationPlugin() {
551
587
  }
552
588
  });
553
589
  }
590
+ /**
591
+ * Returns the current hydration instance.
592
+ *
593
+ * @param namespace The namespace for the hydration context. Defaults to `v0:hydration`.
594
+ * @returns The current hydration instance.
595
+ *
596
+ * @see https://0.vuetifyjs.com/composables/plugins/use-hydration
597
+ *
598
+ * @example
599
+ * ```vue
600
+ * <script setup lang="ts">
601
+ * import { useHydration } from '@vuetify/v0'
602
+ *
603
+ * const hydration = useHydration()
604
+ * <\/script>
605
+ *
606
+ * <template>
607
+ * <div>
608
+ * <p>Is hydrated: {{ hydration.isHydrated.value }}</p>
609
+ * </div>
610
+ * </template>
611
+ * ```
612
+ */
613
+ function useHydration(namespace = "v0:hydration") {
614
+ return useContext(namespace);
615
+ }
554
616
 
555
617
  //#endregion
556
618
  //#region src/constants/globals.ts
@@ -560,7 +622,7 @@ const SUPPORTS_MATCH_MEDIA = IN_BROWSER && "matchMedia" in window && typeof wind
560
622
  const SUPPORTS_OBSERVER = IN_BROWSER && "ResizeObserver" in window;
561
623
  const SUPPORTS_INTERSECTION_OBSERVER = IN_BROWSER && "IntersectionObserver" in window;
562
624
  const SUPPORTS_MUTATION_OBSERVER = IN_BROWSER && "MutationObserver" in window;
563
- const version = "0.0.6";
625
+ const version = "0.0.8";
564
626
  const __LOGGER_ENABLED__ = false;
565
627
 
566
628
  //#endregion
@@ -586,7 +648,6 @@ function createDefaultBreakpoints() {
586
648
  /**
587
649
  * Creates a new breakpoints instance.
588
650
  *
589
- * @param namespace The namespace to use for the breakpoints instance.
590
651
  * @param options The options for the breakpoints instance.
591
652
  * @template E The type of the breakpoints context.
592
653
  * @returns A new breakpoints instance.
@@ -597,7 +658,8 @@ function createDefaultBreakpoints() {
597
658
  * ```ts
598
659
  * import { createBreakpoints } from '@vuetify/v0'
599
660
  *
600
- * export const [useBreakpoints, provideBreakpoints] = createBreakpoints('v0:breakpoints', {
661
+ * export const [useBreakpoints, provideBreakpoints] = createBreakpoints({
662
+ * namespace: 'v0:breakpoints',
601
663
  * mobileBreakpoint: 'sm',
602
664
  * breakpoints: {
603
665
  * xs: 0,
@@ -610,12 +672,11 @@ function createDefaultBreakpoints() {
610
672
  * })
611
673
  * ```
612
674
  */
613
- function createBreakpoints(namespace = "v0:breakpoints", options = {}) {
614
- const [useBreakpointsContext, _provideBreakpointsContext] = createContext(namespace);
615
- const { mobileBreakpoint, breakpoints } = /* @__PURE__ */ mergeDeep(createDefaultBreakpoints(), options);
616
- const sorted = Object.entries(breakpoints).sort((a, b) => a[1] - b[1]);
675
+ function createBreakpoints(_options = {}) {
676
+ const { mobileBreakpoint, breakpoints } = /* @__PURE__ */ mergeDeep(createDefaultBreakpoints(), _options);
677
+ const sorted = Object.entries(breakpoints).toSorted((a, b) => a[1] - b[1]);
617
678
  const names = sorted.map(([n]) => n);
618
- const mb = typeof mobileBreakpoint === "number" ? mobileBreakpoint : breakpoints[mobileBreakpoint] ?? breakpoints.md;
679
+ const mb = /* @__PURE__ */ isNumber(mobileBreakpoint) ? mobileBreakpoint : breakpoints[mobileBreakpoint] ?? breakpoints.md;
619
680
  const name = shallowRef("xs");
620
681
  const width = shallowRef(0);
621
682
  const height = shallowRef(0);
@@ -665,21 +726,7 @@ function createBreakpoints(namespace = "v0:breakpoints", options = {}) {
665
726
  xlAndDown.value = index <= 4;
666
727
  xxlAndDown.value = index <= 5;
667
728
  }
668
- if (getCurrentInstance()) onMounted(() => {
669
- const { isHydrated } = useHydration();
670
- if (isHydrated.value) update();
671
- watch(isHydrated, (hydrated) => {
672
- if (hydrated) update();
673
- }, { immediate: true });
674
- });
675
- if (IN_BROWSER) {
676
- function listener() {
677
- update();
678
- }
679
- window.addEventListener("resize", listener, { passive: true });
680
- onScopeDispose(() => window.removeEventListener("resize", listener), true);
681
- }
682
- const context = {
729
+ return {
683
730
  breakpoints,
684
731
  name: readonly(name),
685
732
  width: readonly(width),
@@ -703,36 +750,34 @@ function createBreakpoints(namespace = "v0:breakpoints", options = {}) {
703
750
  xxlAndDown: readonly(xxlAndDown),
704
751
  update
705
752
  };
706
- function provideBreakpointsContext(_context = context, app) {
707
- return _provideBreakpointsContext(_context, app);
708
- }
709
- return createTrinity(useBreakpointsContext, provideBreakpointsContext, context);
710
753
  }
711
754
  /**
712
- * Returns the current breakpoints instance.
755
+ * Creates a new breakpoints context.
713
756
  *
714
- * @returns The current breakpoints instance.
757
+ * @param options The options for the breakpoints context.
758
+ * @template E The type of the breakpoints context.
759
+ * @returns A new breakpoints context.
715
760
  *
716
761
  * @see https://0.vuetifyjs.com/composables/plugins/use-breakpoints
717
762
  *
718
763
  * @example
719
- * ```vue
720
- * <script setup lang="ts">
721
- * import { useBreakpoints } from '@vuetify/v0'
722
- *
723
- * const { isMobile, mdAndUp } = useBreakpoints()
724
- * <\/script>
764
+ * ```ts
765
+ * import { createBreakpointsContext } from '@vuetify/v0'
725
766
  *
726
- * <template>
727
- * <div class="pa-4">
728
- * <p v-if="isMobile.value">Mobile layout active</p>
729
- * <p v-else-if="mdAndUp.value">Medium and up layout active</p>
730
- * </div>
731
- * </template>
767
+ * export const [useBreakpoints, provideBreakpoints, context] = createBreakpointsContext({
768
+ * namespace: 'v0:breakpoints',
769
+ * mobileBreakpoint: 'sm',
770
+ * })
732
771
  * ```
733
772
  */
734
- function useBreakpoints() {
735
- return useContext("v0:breakpoints");
773
+ function createBreakpointsContext(_options = {}) {
774
+ const { namespace = "v0:breakpoints",...options } = _options;
775
+ const [useBreakpointsContext, _provideBreakpointsContext] = createContext(namespace);
776
+ const context = createBreakpoints(options);
777
+ function provideBreakpointsContext(_context = context, app) {
778
+ return _provideBreakpointsContext(_context, app);
779
+ }
780
+ return createTrinity(useBreakpointsContext, provideBreakpointsContext, context);
736
781
  }
737
782
  /**
738
783
  * Creates a new breakpoints plugin.
@@ -753,6 +798,7 @@ function useBreakpoints() {
753
798
  *
754
799
  * app.use(
755
800
  * createBreakpointsPlugin({
801
+ * namespace: 'v0:breakpoints',
756
802
  * mobileBreakpoint: 'sm',
757
803
  * breakpoints: {
758
804
  * xs: 0,
@@ -768,20 +814,63 @@ function useBreakpoints() {
768
814
  * app.mount('#app')
769
815
  * ```
770
816
  */
771
- function createBreakpointsPlugin(options = {}) {
772
- const [, provideBreakpointsContext, context] = createBreakpoints("v0:breakpoints", options);
817
+ function createBreakpointsPlugin(_options = {}) {
818
+ const { namespace = "v0:breakpoints",...options } = _options;
819
+ const [, provideBreakpointsContext, context] = createBreakpointsContext({
820
+ ...options,
821
+ namespace
822
+ });
773
823
  return createPlugin({
774
- namespace: "v0:breakpoints",
824
+ namespace,
775
825
  provide: (app) => {
776
826
  provideBreakpointsContext(context, app);
777
827
  },
778
828
  setup: (app) => {
779
829
  app.mixin({ mounted() {
780
- context.update();
830
+ if (this.$parent !== null) return;
831
+ const hydration = useHydration();
832
+ function listener() {
833
+ context.update();
834
+ }
835
+ const unwatch = watch(hydration.isHydrated, (hydrated) => {
836
+ if (hydrated) listener();
837
+ }, { immediate: true });
838
+ window.addEventListener("resize", listener, { passive: true });
839
+ onScopeDispose(() => {
840
+ window.removeEventListener("resize", listener);
841
+ unwatch();
842
+ }, true);
781
843
  } });
782
844
  }
783
845
  });
784
846
  }
847
+ /**
848
+ * Returns the current breakpoints instance.
849
+ *
850
+ * @param namespace The namespace for the breakpoints context. Defaults to `v0:breakpoints`.
851
+ * @returns The current breakpoints instance.
852
+ *
853
+ * @see https://0.vuetifyjs.com/composables/plugins/use-breakpoints
854
+ *
855
+ * @example
856
+ * ```vue
857
+ * <script setup lang="ts">
858
+ * import { useBreakpoints } from '@vuetify/v0'
859
+ *
860
+ * const { isMobile, mdAndUp } = useBreakpoints()
861
+ * <\/script>
862
+ *
863
+ * <template>
864
+ * <div class="pa-4">
865
+ * <p v-if="isMobile.value">Mobile layout active</p>
866
+ * <p v-else-if="mdAndUp.value">Medium and up layout active</p>
867
+ * </div>
868
+ * </template>
869
+ * ```
870
+ */
871
+ function useBreakpoints(namespace = "v0:breakpoints") {
872
+ return useContext(namespace);
873
+ }
785
874
 
786
875
  //#endregion
787
876
  //#region src/composables/useEventListener/index.ts
@@ -922,7 +1011,7 @@ var PinoLoggerAdapter = class {
922
1011
  }
923
1012
  format(message, ...args) {
924
1013
  if (args.length === 0) return { msg: message };
925
- if (args.length === 1 && typeof args[0] === "object" && args[0] !== null) return {
1014
+ if (args.length === 1 && /* @__PURE__ */ isObject(args[0])) return {
926
1015
  ...args[0],
927
1016
  msg: message
928
1017
  };
@@ -995,14 +1084,13 @@ var Vuetify0LoggerAdapter = class {
995
1084
  log(level, method, message, ...args) {
996
1085
  const [formattedMessage, ...restArgs] = this.format(level, message, ...args);
997
1086
  const style = this.style(level);
998
- if (IN_BROWSER && style && typeof console[method] === "function") console[method](`%c${formattedMessage}`, style, ...restArgs);
999
- else if (typeof console[method] === "function") console[method](formattedMessage, ...restArgs);
1087
+ if (IN_BROWSER && style && /* @__PURE__ */ isFunction(console[method])) console[method](`%c${formattedMessage}`, style, ...restArgs);
1088
+ else if (/* @__PURE__ */ isFunction(console[method])) console[method](formattedMessage, ...restArgs);
1000
1089
  }
1001
1090
  };
1002
1091
 
1003
1092
  //#endregion
1004
1093
  //#region src/composables/useLogger/index.ts
1005
- const [useLoggerContext, provideLoggerContext] = createContext("v0:logger");
1006
1094
  /**
1007
1095
  * Creates a new logger instance.
1008
1096
  *
@@ -1010,6 +1098,22 @@ const [useLoggerContext, provideLoggerContext] = createContext("v0:logger");
1010
1098
  * @returns A new logger instance.
1011
1099
  *
1012
1100
  * @see https://0.vuetifyjs.com/composables/plugins/use-logger
1101
+ *
1102
+ * @example
1103
+ * ```ts
1104
+ * import { createLogger } from '@vuetify/v0'
1105
+ *
1106
+ * const logger = createLogger({
1107
+ * level: 'debug',
1108
+ * prefix: '[MyApp]',
1109
+ * })
1110
+ *
1111
+ * logger.info('This is an info message')
1112
+ * logger.debug('This is a debug message')
1113
+ * logger.error('This is an error message')
1114
+ * logger.level('debug')
1115
+ * logger.debug('This debug message will now be logged')
1116
+ * ```
1013
1117
  */
1014
1118
  function createLogger(options = {}) {
1015
1119
  const { adapter = new Vuetify0LoggerAdapter({ prefix: options.prefix }), level: initialLevel = "info", enabled: initialEnabled = __LOGGER_ENABLED__ } = options;
@@ -1099,18 +1203,32 @@ function createFallbackLogger(namespace = "v0:logger") {
1099
1203
  };
1100
1204
  }
1101
1205
  /**
1102
- * Uses an existing or creates a new logger instance.
1206
+ * Creates a new logger context.
1103
1207
  *
1104
- * @param namespace The namespace for the logger context.
1105
- * @returns The logger instance.
1208
+ * @param options The options for the logger context.
1209
+ * @template E The type of the logger context.
1210
+ * @returns A new logger context.
1106
1211
  *
1107
1212
  * @see https://0.vuetifyjs.com/composables/plugins/use-logger
1213
+ *
1214
+ * @example
1215
+ * ```ts
1216
+ * import { createLoggerContext } from '@vuetify/v0'
1217
+ *
1218
+ * export const [useAppLogger, provideAppLogger, appLogger] = createLoggerContext({
1219
+ * namespace: 'app:logger',
1220
+ * level: 'debug',
1221
+ * })
1222
+ * ```
1108
1223
  */
1109
- function useLogger(namespace) {
1110
- if (getCurrentInstance()) try {
1111
- return useLoggerContext(namespace);
1112
- } catch (error) {}
1113
- return createFallbackLogger(namespace);
1224
+ function createLoggerContext(_options = {}) {
1225
+ const { namespace = "v0:logger",...options } = _options;
1226
+ const [useLoggerContext, _provideLoggerContext] = createContext(namespace);
1227
+ const context = createLogger(options);
1228
+ function provideLoggerContext(_context = context, app) {
1229
+ return _provideLoggerContext(_context, app);
1230
+ }
1231
+ return createTrinity(useLoggerContext, provideLoggerContext, context);
1114
1232
  }
1115
1233
  /**
1116
1234
  * Creates a new logger plugin.
@@ -1119,17 +1237,69 @@ function useLogger(namespace) {
1119
1237
  * @returns A new logger plugin.
1120
1238
  *
1121
1239
  * @see https://0.vuetifyjs.com/composables/plugins/use-logger
1240
+ *
1241
+ * @example
1242
+ * ```ts
1243
+ * import { createApp } from 'vue'
1244
+ * import { createLoggerPlugin } from '@vuetify/v0'
1245
+ * import App from './App.vue'
1246
+ *
1247
+ * const app = createApp(App)
1248
+ *
1249
+ * app.use(
1250
+ * createLoggerPlugin({
1251
+ * level: 'debug',
1252
+ * prefix: '[MyApp]',
1253
+ * })
1254
+ * )
1255
+ *
1256
+ * app.mount('#app')
1257
+ * ```
1122
1258
  */
1123
- function createLoggerPlugin(options = {}) {
1124
- const context = createLogger(options);
1259
+ function createLoggerPlugin(_options = {}) {
1260
+ const { namespace = "v0:logger",...options } = _options;
1261
+ const [, provideLoggerContext, context] = createLoggerContext({
1262
+ ...options,
1263
+ namespace
1264
+ });
1125
1265
  return createPlugin({
1126
- namespace: "v0:logger",
1266
+ namespace,
1127
1267
  provide: (app) => {
1128
1268
  provideLoggerContext(context, app);
1129
1269
  },
1130
1270
  setup: (_app) => {}
1131
1271
  });
1132
1272
  }
1273
+ /**
1274
+ * Uses an existing or creates a new logger instance.
1275
+ *
1276
+ * @param namespace The namespace for the logger context. Defaults to `'v0:logger'`.
1277
+ * @returns The logger instance.
1278
+ *
1279
+ * @see https://0.vuetifyjs.com/composables/plugins/use-logger
1280
+ *
1281
+ * @example
1282
+ * ```ts
1283
+ * import { useLogger } from '@vuetify/v0'
1284
+ *
1285
+ * const logger = useLogger()
1286
+ *
1287
+ * logger.info('This is an info message')
1288
+ * logger.debug('This is a debug message')
1289
+ * logger.error('This is an error message')
1290
+ * logger.level('debug')
1291
+ * logger.debug('This debug message will now be logged')
1292
+ * ```
1293
+ */
1294
+ function useLogger(namespace = "v0:logger") {
1295
+ const fallback = createFallbackLogger(namespace);
1296
+ if (!getCurrentInstance()) return fallback;
1297
+ try {
1298
+ return useContext(namespace, fallback);
1299
+ } catch {
1300
+ return fallback;
1301
+ }
1302
+ }
1133
1303
 
1134
1304
  //#endregion
1135
1305
  //#region src/composables/useRegistry/index.ts
@@ -1141,7 +1311,7 @@ function createLoggerPlugin(options = {}) {
1141
1311
  * @template E The type of registry context that extends RegistryContext<Z>. Use this when extending the registry with additional methods.
1142
1312
  * @returns A new registry instance.
1143
1313
  *
1144
- * @see https://0.vuetifyjs.com/composables/registration/use-registry
1314
+ * @see https://0.vuetifyjs.com/composables/registration/use-registry#use-registry
1145
1315
  *
1146
1316
  * @example
1147
1317
  * ```ts
@@ -1380,11 +1550,11 @@ function useRegistry(options) {
1380
1550
  *
1381
1551
  * @param namespace The namespace for the registry context.
1382
1552
  * @param options The options for the registry context.
1383
- *
1384
1553
  * @template Z The type of registry ticket that extends RegistryTicket. Use this to add custom properties to tickets.
1385
1554
  * @template E The type of registry context that extends RegistryContext<Z>. Use this when extending the registry with additional methods.
1555
+ * @returns A new registry context.
1386
1556
  *
1387
- * @see https://0.vuetifyjs.com/composables/registration/use-registry
1557
+ * @see https://0.vuetifyjs.com/composables/registration/use-registry#create-registry-context
1388
1558
  *
1389
1559
  * @example
1390
1560
  * ```ts
@@ -1400,7 +1570,8 @@ function useRegistry(options) {
1400
1570
  * items.register({ id: 'item-1', value: 'Value 1' })
1401
1571
  * ```
1402
1572
  */
1403
- function createRegistryContext(namespace, options) {
1573
+ function createRegistryContext(_options) {
1574
+ const { namespace,...options } = _options;
1404
1575
  const [useRegistryContext, _provideRegistryContext] = createContext(namespace);
1405
1576
  const context = useRegistry(options);
1406
1577
  function provideRegistryContext(_context = context, app) {
@@ -1412,20 +1583,37 @@ function createRegistryContext(namespace, options) {
1412
1583
  //#endregion
1413
1584
  //#region src/composables/useSelection/index.ts
1414
1585
  /**
1415
- * Creates a new selection instance.
1586
+ * Creates a new selection instance for managing multiple selected items.
1587
+ *
1588
+ * Extends `useRegistry` with selection tracking via a reactive `Set` of selected IDs.
1589
+ * Supports disabled items, mandatory selection enforcement, and auto-enrollment.
1416
1590
  *
1417
1591
  * @param options The options for the selection instance.
1418
1592
  * @template Z The type of the selection ticket.
1419
1593
  * @template E The type of the selection context.
1420
- * @returns A new selection instance.
1594
+ * @returns A new selection instance with selection management methods.
1595
+ *
1596
+ * @remarks
1597
+ * **Key Features:**
1598
+ * - Multi-selection support (unlike `useSingle` which enforces single selection)
1599
+ * - Set-based `selectedIds` tracking for efficient lookups
1600
+ * - Computed `selectedItems` and `selectedValues` for reactive access
1601
+ * - Each ticket gets `isSelected`, `select()`, `unselect()`, and `toggle()` methods
1602
+ * - Disabled items cannot be selected
1603
+ * - Mandatory mode prevents deselecting the last item
1604
+ * - Force mode auto-selects first non-disabled item on registration
1605
+ * - Enroll option auto-selects all non-disabled items on registration
1606
+ *
1607
+ * **Inheritance Chain:**
1608
+ * `useRegistry` → `createSelection` → `createSingle`/`createGroup` → `createStep`
1421
1609
  *
1422
1610
  * @see https://0.vuetifyjs.com/composables/selection/use-selection
1423
1611
  *
1424
1612
  * @example
1425
1613
  * ```ts
1426
- * import { useSelection } from '@vuetify/v0'
1614
+ * import { createSelection } from '@vuetify/v0'
1427
1615
  *
1428
- * const selection = useSelection({ mandatory: true })
1616
+ * const selection = createSelection({ mandatory: true })
1429
1617
  *
1430
1618
  * selection.onboard([
1431
1619
  * { id: 'item-1', value: 'Item 1' },
@@ -1437,9 +1625,10 @@ function createRegistryContext(namespace, options) {
1437
1625
  * selection.select('item-3')
1438
1626
  *
1439
1627
  * console.log(selection.selectedIds) // Set { 'item-1', 'item-3' }
1628
+ * console.log(Array.from(selection.selectedValues.value)) // ['Item 1', 'Item 3']
1440
1629
  * ```
1441
1630
  */
1442
- function useSelection(options) {
1631
+ function createSelection(options) {
1443
1632
  const registry$1 = useRegistry(options);
1444
1633
  const selectedIds = shallowReactive(/* @__PURE__ */ new Set());
1445
1634
  const enroll = options?.enroll ?? false;
@@ -1543,46 +1732,103 @@ function useSelection(options) {
1543
1732
  * checkboxes.select('checkbox-1')
1544
1733
  * ```
1545
1734
  */
1546
- function createSelectionContext(namespace, options) {
1735
+ function createSelectionContext(_options) {
1736
+ const { namespace,...options } = _options;
1547
1737
  const [useSelectionContext, _provideSelectionContext] = createContext(namespace);
1548
- const context = useSelection(options);
1738
+ const context = createSelection(options);
1549
1739
  function provideSelectionContext(_context = context, app) {
1550
1740
  return _provideSelectionContext(_context, app);
1551
1741
  }
1552
1742
  return createTrinity(useSelectionContext, provideSelectionContext, context);
1553
1743
  }
1744
+ /**
1745
+ * Returns the current selection instance.
1746
+ *
1747
+ * @param namespace The namespace for the selection context. Defaults to `'v0:selection'`.
1748
+ * @returns The current selection instance.
1749
+ *
1750
+ * @see https://0.vuetifyjs.com/composables/selection/use-selection
1751
+ *
1752
+ * @example
1753
+ * ```vue
1754
+ * <script setup lang="ts">
1755
+ * import { useSelection } from '@vuetify/v0'
1756
+ *
1757
+ * const selection = useSelection()
1758
+ * <\/script>
1759
+ *
1760
+ * <template>
1761
+ * <div>
1762
+ * <p>Selected: {{ selection.selectedIds.size }}</p>
1763
+ * </div>
1764
+ * </template>
1765
+ * ```
1766
+ */
1767
+ function useSelection(namespace = "v0:selection") {
1768
+ return useContext(namespace);
1769
+ }
1554
1770
 
1555
1771
  //#endregion
1556
1772
  //#region src/composables/useGroup/index.ts
1557
1773
  /**
1558
- * Creates a new group instance.
1774
+ * Creates a new group instance with batch selection operations.
1775
+ *
1776
+ * Extends `createSelection` to support selecting, unselecting, and toggling multiple items
1777
+ * at once by passing an array of IDs. Adds `selectedIndexes` computed property.
1559
1778
  *
1560
1779
  * @param options The options for the group instance.
1561
1780
  * @template Z The type of the group ticket.
1562
1781
  * @template E The type of the group context.
1563
- * @returns A new group instance.
1782
+ * @returns A new group instance with batch selection support.
1783
+ *
1784
+ * @remarks
1785
+ * **Key Differences from `createSelection`:**
1786
+ * - `select()` accepts `ID | ID[]` for batch operations
1787
+ * - `unselect()` accepts `ID | ID[]` for batch operations
1788
+ * - `toggle()` accepts `ID | ID[]` for batch operations
1789
+ * - Adds `selectedIndexes` computed Set for getting selected item indexes
1790
+ * - Perfect for checkboxes, multi-select dropdowns, and bulk operations
1791
+ *
1792
+ * **Batch Operations:**
1793
+ * - Single ID: `group.select('item-1')`
1794
+ * - Array of IDs: `group.select(['item-1', 'item-2', 'item-3'])`
1795
+ * - Uses `toArray()` utility internally to normalize input
1796
+ * - Disabled items are automatically skipped in batch operations
1797
+ * - Non-existent IDs are silently ignored
1798
+ *
1799
+ * **Inheritance Chain:**
1800
+ * `useRegistry` → `createSelection` → `createGroup`
1801
+ *
1802
+ * **Used By:**
1803
+ * - `createFeatures` for feature flag management with multiple selections
1564
1804
  *
1565
1805
  * @see https://0.vuetifyjs.com/composables/selection/use-group
1566
1806
  *
1567
1807
  * @example
1568
1808
  * ```ts
1569
- * import { useGroup } from '@vuetify/v0'
1809
+ * import { createGroup } from '@vuetify/v0'
1570
1810
  *
1571
- * const group = useGroup()
1811
+ * const checkboxes = createGroup()
1572
1812
  *
1573
- * group.onboard([
1574
- * { id: 'item-1', value: 'Item 1' },
1575
- * { id: 'item-2', value: 'Item 2' },
1576
- * { id: 'item-3', value: 'Item 3' },
1813
+ * checkboxes.onboard([
1814
+ * { id: 'option-a', value: 'Option A' },
1815
+ * { id: 'option-b', value: 'Option B' },
1816
+ * { id: 'option-c', value: 'Option C' },
1577
1817
  * ])
1578
1818
  *
1579
- * group.select(['item-1', 'item-2'])
1819
+ * // Select multiple items at once
1820
+ * checkboxes.select(['option-a', 'option-c'])
1821
+ *
1822
+ * console.log(checkboxes.selectedIds) // Set { 'option-a', 'option-c' }
1823
+ * console.log(Array.from(checkboxes.selectedIndexes.value)) // [0, 2]
1580
1824
  *
1581
- * console.log(group.selectedIds) // Set { 'item-1', 'item-2' }
1825
+ * // Toggle operations
1826
+ * checkboxes.toggle(['option-a', 'option-b'])
1827
+ * console.log(checkboxes.selectedIds) // Set { 'option-b', 'option-c' }
1582
1828
  * ```
1583
1829
  */
1584
- function useGroup(options) {
1585
- const registry$1 = useSelection(options);
1830
+ function createGroup(options) {
1831
+ const registry$1 = createSelection(options);
1586
1832
  const selectedIndexes = computed(() => {
1587
1833
  return new Set(Array.from(registry$1.selectedItems.value).map((item) => item?.index));
1588
1834
  });
@@ -1630,14 +1876,41 @@ function useGroup(options) {
1630
1876
  * const group = useMyGroup()
1631
1877
  * ```
1632
1878
  */
1633
- function createGroupContext(namespace, options) {
1879
+ function createGroupContext(_options) {
1880
+ const { namespace,...options } = _options;
1634
1881
  const [useGroupContext, _provideGroupContext] = createContext(namespace);
1635
- const context = useGroup(options);
1882
+ const context = createGroup(options);
1636
1883
  function provideGroupContext(_context = context, app) {
1637
1884
  return _provideGroupContext(_context, app);
1638
1885
  }
1639
1886
  return createTrinity(useGroupContext, provideGroupContext, context);
1640
1887
  }
1888
+ /**
1889
+ * Returns the current group instance.
1890
+ *
1891
+ * @param namespace The namespace for the group context. Defaults to `'v0:group'`.
1892
+ * @returns The current group instance.
1893
+ *
1894
+ * @see https://0.vuetifyjs.com/composables/selection/use-group
1895
+ *
1896
+ * @example
1897
+ * ```vue
1898
+ * <script setup lang="ts">
1899
+ * import { useGroup } from '@vuetify/v0'
1900
+ *
1901
+ * const group = useGroup()
1902
+ * <\/script>
1903
+ *
1904
+ * <template>
1905
+ * <div>
1906
+ * <p>Selected: {{ group.selectedIds.size }}</p>
1907
+ * </div>
1908
+ * </template>
1909
+ * ```
1910
+ */
1911
+ function useGroup(namespace) {
1912
+ return useContext(namespace);
1913
+ }
1641
1914
 
1642
1915
  //#endregion
1643
1916
  //#region src/composables/useTokens/index.ts
@@ -1668,9 +1941,9 @@ function createGroupContext(namespace, options) {
1668
1941
  * console.log(tokens.resolve('{colors.secondary}')) // '#3b82f6'
1669
1942
  * ```
1670
1943
  */
1671
- function useTokens(tokens = {}, options = {}) {
1944
+ function createTokens(tokens = {}, options = {}) {
1672
1945
  const logger = useLogger();
1673
- const registry$1 = useRegistry();
1946
+ const registry$1 = useRegistry(options);
1674
1947
  const cache = /* @__PURE__ */ new Map();
1675
1948
  registry$1.onboard(flatten(tokens, options.prefix, !!options.flat));
1676
1949
  function isAlias(token) {
@@ -1679,12 +1952,18 @@ function useTokens(tokens = {}, options = {}) {
1679
1952
  function isTokenAlias(value) {
1680
1953
  return /* @__PURE__ */ isObject(value) && "$value" in value;
1681
1954
  }
1682
- function resolve(token) {
1955
+ function resolve(token, visited = /* @__PURE__ */ new Set()) {
1683
1956
  const cacheKey = /* @__PURE__ */ isString(token) ? token : JSON.stringify(token);
1684
1957
  const cached = cache.get(cacheKey);
1685
1958
  if (cached !== void 0) return cached;
1686
1959
  const reference = isTokenAlias(token) ? token.$value : token;
1687
1960
  const clean = /* @__PURE__ */ isString(reference) && isAlias(reference) ? reference.slice(1, -1) : String(reference);
1961
+ if (visited.has(clean)) {
1962
+ logger.warn(`Circular alias detected for "${clean}"`);
1963
+ cache.set(cacheKey, void 0);
1964
+ return;
1965
+ }
1966
+ visited.add(clean);
1688
1967
  let found = registry$1.get(clean);
1689
1968
  let segments = [];
1690
1969
  if (!found && clean.includes(".")) {
@@ -1725,9 +2004,9 @@ function useTokens(tokens = {}, options = {}) {
1725
2004
  result = current;
1726
2005
  } else if (isTokenAlias(current)) {
1727
2006
  const inner = current.$value;
1728
- if (/* @__PURE__ */ isString(inner) && isAlias(inner)) return resolve(inner);
2007
+ if (/* @__PURE__ */ isString(inner) && isAlias(inner)) return resolve(inner, visited);
1729
2008
  result = inner;
1730
- } else if (/* @__PURE__ */ isString(current) && isAlias(current)) return resolve(current);
2009
+ } else if (/* @__PURE__ */ isString(current) && isAlias(current)) return resolve(current, visited);
1731
2010
  else result = current;
1732
2011
  cache.set(cacheKey, result);
1733
2012
  return result;
@@ -1756,34 +2035,47 @@ function useTokens(tokens = {}, options = {}) {
1756
2035
  * ```ts
1757
2036
  * import { createTokensContext } from '@vuetify/v0'
1758
2037
  *
1759
- * const myTokens = {
1760
- * spacing: {
1761
- * sm: '8px',
1762
- * md: '16px',
1763
- * lg: '24px',
1764
- * },
1765
- * }
1766
- *
1767
- * export const [useDesignTokens, provideDesignTokens, designTokens] = createTokensContext('design-tokens', myTokens)
1768
- *
1769
- * // In a parent component:
1770
- * provideDesignTokens()
1771
- *
1772
- * // In a child component:
1773
- * const tokens = useDesignTokens()
1774
- *
1775
- * console.log(tokens.resolve('{spacing.md}')) // '16px'
2038
+ * export const [useTokens, provideTokens, context] = createTokensContext({
2039
+ * namespace: 'v0:tokens',
2040
+ * tokens: {
2041
+ * colors: {
2042
+ * primary: '#3b82f6',
2043
+ * secondary: '{colors.primary}', // Alias reference
2044
+ * },
2045
+ * },
2046
+ * })
1776
2047
  * ```
1777
2048
  */
1778
- function createTokensContext(namespace, tokens = {}) {
2049
+ function createTokensContext(_options) {
2050
+ const { namespace, tokens = {},...options } = _options;
1779
2051
  const [useTokensContext, _provideTokensContext] = createContext(namespace);
1780
- const context = useTokens(tokens);
2052
+ const context = createTokens(tokens, options);
1781
2053
  function provideTokensContext(_context = context, app) {
1782
2054
  return _provideTokensContext(_context, app);
1783
2055
  }
1784
2056
  return createTrinity(useTokensContext, provideTokensContext, context);
1785
2057
  }
1786
2058
  /**
2059
+ * Returns the current tokens instance.
2060
+ *
2061
+ * @param namespace The namespace for the tokens context. Defaults to `'v0:tokens'`.
2062
+ * @returns The current tokens instance.
2063
+ *
2064
+ * @see https://0.vuetifyjs.com/composables/registration/use-tokens
2065
+ *
2066
+ * @example
2067
+ * ```vue
2068
+ * <script setup lang="ts">
2069
+ * import { useTokens } from '@vuetify/v0'
2070
+ *
2071
+ * const tokens = useTokens()
2072
+ * <\/script>
2073
+ * ```
2074
+ */
2075
+ function useTokens(namespace = "v0:tokens") {
2076
+ return useContext(namespace);
2077
+ }
2078
+ /**
1787
2079
  * Flattens a nested collection of tokens into a flat array of tokens.
1788
2080
  * Each token is represented by an object containing its ID & value.
1789
2081
  * @param tokens The collection of tokens to flatten.
@@ -1864,19 +2156,19 @@ function flatten(tokens, prefix = "", flat = false) {
1864
2156
  /**
1865
2157
  * Creates a new features instance.
1866
2158
  *
1867
- * @param namespace The namespace to use for the features instance.
1868
2159
  * @param options The options for the features instance.
1869
2160
  * @template Z The type of the feature ticket.
1870
2161
  * @template E The type of the feature context.
1871
2162
  * @returns A new features instance.
1872
2163
  *
1873
- * @see https://0.vuetifyjs.com/composables/plugins/create-features
2164
+ * @see https://0.vuetifyjs.com/composables/plugins/use-features
1874
2165
  *
1875
2166
  * @example
1876
2167
  * ```ts
1877
2168
  * import { createFeatures } from '@vuetify/v0'
1878
2169
  *
1879
- * const [useFeatures, provideFeaturesContext] = createFeatures('v0:features', {
2170
+ * const [useFeatures, provideFeaturesContext, context] = createFeatures({
2171
+ * namespace: 'v0:features',
1880
2172
  * features: {
1881
2173
  * 'dark-mode': true,
1882
2174
  * 'theme-color': { $variation: 'blue' },
@@ -1884,10 +2176,10 @@ function flatten(tokens, prefix = "", flat = false) {
1884
2176
  * })
1885
2177
  * ```
1886
2178
  */
1887
- function createFeatures(namespace = "v0:features", options = {}) {
1888
- const [useFeaturesContext, _provideFeaturesContext] = createContext(namespace);
1889
- const tokens = useTokens(options.features, { flat: true });
1890
- const registry$1 = useGroup();
2179
+ function createFeatures(_options = {}) {
2180
+ const { features,...options } = _options;
2181
+ const tokens = createTokens(features, { flat: true });
2182
+ const registry$1 = createGroup(options);
1891
2183
  for (const [id, { value }] of tokens.entries()) register({
1892
2184
  id,
1893
2185
  value
@@ -1906,7 +2198,7 @@ function createFeatures(namespace = "v0:features", options = {}) {
1906
2198
  if (/* @__PURE__ */ isBoolean(ticket.value) && ticket.value === true || /* @__PURE__ */ isObject(ticket.value) && /* @__PURE__ */ isBoolean(ticket.value.$value) && ticket.value.$value === true) registry$1.select(ticket.id);
1907
2199
  return ticket;
1908
2200
  }
1909
- const context = {
2201
+ return {
1910
2202
  ...registry$1,
1911
2203
  variation,
1912
2204
  register,
@@ -1914,37 +2206,38 @@ function createFeatures(namespace = "v0:features", options = {}) {
1914
2206
  return registry$1.size;
1915
2207
  }
1916
2208
  };
1917
- function provideFeaturesContext(_context = context, app) {
1918
- return _provideFeaturesContext(_context, app);
1919
- }
1920
- return createTrinity(useFeaturesContext, provideFeaturesContext, context);
1921
2209
  }
1922
2210
  /**
1923
- * Returns the current features instance.
2211
+ * Creates a new features context.
1924
2212
  *
2213
+ * @param options The options for the features context.
1925
2214
  * @template Z The type of the feature ticket.
1926
- * @returns The current features instance.
2215
+ * @template E The type of the feature context.
2216
+ * @returns A new features context.
1927
2217
  *
1928
- * @see https://0.vuetifyjs.com/composables/plugins/create-features
2218
+ * @see https://0.vuetifyjs.com/composables/plugins/use-features
1929
2219
  *
1930
2220
  * @example
1931
- * ```vue
1932
- * <script setup lang="ts">
1933
- * import { useFeatures } from '@vuetify/v0'
1934
- *
1935
- * const features = useFeatures()
1936
- * <\/script>
2221
+ * ```ts
2222
+ * import { createFeaturesContext } from '@vuetify/v0'
1937
2223
  *
1938
- * <template>
1939
- * <div>
1940
- * <p>Features: {{ features.get('dark-mode') }}</p>
1941
- * <p>Theme Color: {{ features.variation('theme-color') }}</p>
1942
- * </div>
1943
- * </template>
2224
+ * export const [useFeatures, provideFeatures, context] = createFeaturesContext({
2225
+ * namespace: 'app:features',
2226
+ * features: {
2227
+ * 'dark-mode': true,
2228
+ * 'theme-color': { $variation: 'blue' },
2229
+ * },
2230
+ * })
1944
2231
  * ```
1945
2232
  */
1946
- function useFeatures() {
1947
- return useContext("v0:features");
2233
+ function createFeaturesContext(_options = {}) {
2234
+ const { namespace = "v0:features",...options } = _options;
2235
+ const [useFeaturesContext, _provideFeaturesContext] = createContext(namespace);
2236
+ const context = createFeatures(options);
2237
+ function provideFeaturesContext(_context = context, app) {
2238
+ return _provideFeaturesContext(_context, app);
2239
+ }
2240
+ return createTrinity(useFeaturesContext, provideFeaturesContext, context);
1948
2241
  }
1949
2242
  /**
1950
2243
  * Creates a new features plugin.
@@ -1954,7 +2247,7 @@ function useFeatures() {
1954
2247
  * @template E The type of the feature context.
1955
2248
  * @returns A new features plugin.
1956
2249
  *
1957
- * @see https://0.vuetifyjs.com/composables/plugins/create-features
2250
+ * @see https://0.vuetifyjs.com/composables/plugins/use-features
1958
2251
  *
1959
2252
  * @example
1960
2253
  * ```ts
@@ -1976,15 +2269,47 @@ function useFeatures() {
1976
2269
  * app.mount('#app')
1977
2270
  * ```
1978
2271
  */
1979
- function createFeaturesPlugin(options = {}) {
1980
- const [, provideFeaturesContext, context] = createFeatures("v0:features", options);
2272
+ function createFeaturesPlugin(_options = {}) {
2273
+ const { namespace = "v0:features",...options } = _options;
2274
+ const [, provideFeaturesContext, context] = createFeaturesContext({
2275
+ ...options,
2276
+ namespace
2277
+ });
1981
2278
  return createPlugin({
1982
- namespace: "v0:features",
2279
+ namespace,
1983
2280
  provide: (app) => {
1984
2281
  provideFeaturesContext(context, app);
1985
2282
  }
1986
2283
  });
1987
2284
  }
2285
+ /**
2286
+ * Returns the current features instance.
2287
+ *
2288
+ * @param namespace The namespace for the features context. Defaults to `v0:features`.
2289
+ * @template Z The type of the feature ticket.
2290
+ * @returns The current features instance.
2291
+ *
2292
+ * @see https://0.vuetifyjs.com/composables/plugins/use-features
2293
+ *
2294
+ * @example
2295
+ * ```vue
2296
+ * <script setup lang="ts">
2297
+ * import { useFeatures } from '@vuetify/v0'
2298
+ *
2299
+ * const features = useFeatures()
2300
+ * <\/script>
2301
+ *
2302
+ * <template>
2303
+ * <div>
2304
+ * <p>Features: {{ features.get('dark-mode') }}</p>
2305
+ * <p>Theme Color: {{ features.variation('theme-color') }}</p>
2306
+ * </div>
2307
+ * </template>
2308
+ * ```
2309
+ */
2310
+ function useFeatures(namespace = "v0:features") {
2311
+ return useContext(namespace);
2312
+ }
1988
2313
 
1989
2314
  //#endregion
1990
2315
  //#region src/composables/useFilter/index.ts
@@ -1993,7 +2318,7 @@ function defaultFilter(query, item, keys, mode = "some") {
1993
2318
  function match(value, q) {
1994
2319
  return String(value).toLowerCase().includes(q);
1995
2320
  }
1996
- const stringValues = (typeof item === "object" && item !== null ? keys?.length ? keys.map((k) => item[k]) : Object.values(item) : [item]).map((v) => String(v).toLowerCase());
2321
+ const stringValues = (/* @__PURE__ */ isObject(item) ? keys?.length ? keys.map((k) => item[k]) : Object.values(item) : [item]).map((v) => String(v).toLowerCase());
1997
2322
  if (mode === "some") return stringValues.some((val) => match(val, queries[0]));
1998
2323
  if (mode === "every") return stringValues.every((val) => match(val, queries[0]));
1999
2324
  if (mode === "union") return queries.some((q) => stringValues.some((val) => match(val, q)));
@@ -2056,9 +2381,9 @@ function useFilter(query, items, options = {}) {
2056
2381
  *
2057
2382
  * @example
2058
2383
  * ```ts
2059
- * import { useForm } from '@vuetify/v0'
2384
+ * import { createForm } from '@vuetify/v0'
2060
2385
  *
2061
- * const form = useForm()
2386
+ * const form = createForm()
2062
2387
  *
2063
2388
  * const username = form.register({
2064
2389
  * id: 'username',
@@ -2073,7 +2398,7 @@ function useFilter(query, items, options = {}) {
2073
2398
  * form.reset()
2074
2399
  * ```
2075
2400
  */
2076
- function useForm(options) {
2401
+ function createForm(options) {
2077
2402
  const registry$1 = useRegistry(options);
2078
2403
  const validateOn = options?.validateOn || "submit";
2079
2404
  function parse(value) {
@@ -2093,7 +2418,7 @@ function useForm(options) {
2093
2418
  if (ticket.isValid.value === false) return false;
2094
2419
  if (ticket.isValid.value === null) return null;
2095
2420
  }
2096
- return hasFields ? true : null;
2421
+ return hasFields || null;
2097
2422
  });
2098
2423
  function reset() {
2099
2424
  for (const ticket of registry$1.values()) ticket.reset();
@@ -2125,10 +2450,10 @@ function useForm(options) {
2125
2450
  isValid$1.value = null;
2126
2451
  }
2127
2452
  async function validate$1(silent = false) {
2128
- if (rules.length === 0) return true;
2453
+ if (rules.length === 0) return isValid$1.value = true;
2129
2454
  isValidating$1.value = true;
2130
2455
  try {
2131
- const errorMessages = (await Promise.all(rules.map((rule) => rule(model.value)))).filter((result) => typeof result === "string");
2456
+ const errorMessages = (await Promise.all(rules.map((rule) => rule(model.value)))).filter((result) => /* @__PURE__ */ isString(result));
2132
2457
  if (!silent) {
2133
2458
  errors.value = errorMessages;
2134
2459
  isValid$1.value = errorMessages.length === 0;
@@ -2180,6 +2505,68 @@ function useForm(options) {
2180
2505
  }
2181
2506
  };
2182
2507
  }
2508
+ /**
2509
+ * Creates a new form context.
2510
+ *
2511
+ * @param namespace The namespace for the form context.
2512
+ * @param options The options for the form context.
2513
+ * @template Z The type of the form ticket.
2514
+ * @template E The type of the form context.
2515
+ * @returns A new form context.
2516
+ *
2517
+ * @see https://0.vuetifyjs.com/composables/forms/use-form
2518
+ *
2519
+ * @example
2520
+ * ```ts
2521
+ * import { createFormContext } from '@vuetify/v0'
2522
+ *
2523
+ * export const [useMyForm, provideMyForm, myForm] = createFormContext('my-form', {
2524
+ * validateOn: 'change',
2525
+ * })
2526
+ *
2527
+ * // In a parent component:
2528
+ * provideMyForm()
2529
+ *
2530
+ * // In a child component:
2531
+ * const form = useMyForm()
2532
+ * form.register({ id: 'field', value: ref(''), rules: [...] })
2533
+ * ```
2534
+ */
2535
+ function createFormContext(_options) {
2536
+ const { namespace,...options } = _options;
2537
+ const [useFormContext, _provideFormContext] = createContext(namespace);
2538
+ const context = createForm(options);
2539
+ function provideFormContext(_context = context, app) {
2540
+ return _provideFormContext(_context, app);
2541
+ }
2542
+ return createTrinity(useFormContext, provideFormContext, context);
2543
+ }
2544
+ /**
2545
+ * Returns the current form instance.
2546
+ *
2547
+ * @param namespace The namespace for the form context. Defaults to `'v0:form'`.
2548
+ * @returns The current form instance.
2549
+ *
2550
+ * @see https://0.vuetifyjs.com/composables/forms/use-form
2551
+ *
2552
+ * @example
2553
+ * ```vue
2554
+ * <script setup lang="ts">
2555
+ * import { useForm } from '@vuetify/v0'
2556
+ *
2557
+ * const form = useForm()
2558
+ * <\/script>
2559
+ *
2560
+ * <template>
2561
+ * <div>
2562
+ * <p>Form is {{ form.isValid.value ? 'valid' : 'invalid' }}</p>
2563
+ * </div>
2564
+ * </template>
2565
+ * ```
2566
+ */
2567
+ function useForm(namespace = "v0:form") {
2568
+ return useContext(namespace);
2569
+ }
2183
2570
 
2184
2571
  //#endregion
2185
2572
  //#region src/composables/useIntersectionObserver/index.ts
@@ -2395,33 +2782,57 @@ function useKeydown(handlers) {
2395
2782
  //#endregion
2396
2783
  //#region src/composables/useSingle/index.ts
2397
2784
  /**
2398
- * Creates a new single selection instance.
2785
+ * Creates a new single selection instance that enforces only one selected item at a time.
2786
+ *
2787
+ * Extends `createSelection` by automatically clearing previous selections when a new item is selected.
2788
+ * Adds computed singular properties: `selectedId`, `selectedItem`, `selectedIndex`, `selectedValue`.
2399
2789
  *
2400
2790
  * @param options The options for the single selection instance.
2401
2791
  * @template Z The type of the single selection ticket.
2402
2792
  * @template E The type of the single selection context.
2403
- * @returns A new single selection instance.
2793
+ * @returns A new single selection instance with single-selection enforcement.
2794
+ *
2795
+ * @remarks
2796
+ * **Key Differences from `createSelection`:**
2797
+ * - Automatically clears `selectedIds` before selecting a new item (enforces single selection)
2798
+ * - Provides singular computed properties instead of plural sets
2799
+ * - Perfect for tabs, radio buttons, theme selectors, and other single-choice UI components
2800
+ *
2801
+ * **Computed Properties:**
2802
+ * - `selectedId`: The ID of the selected item (undefined if none selected)
2803
+ * - `selectedItem`: The selected ticket object (undefined if none selected)
2804
+ * - `selectedIndex`: The index of the selected item (-1 if none selected)
2805
+ * - `selectedValue`: The value of the selected item (undefined if none selected)
2806
+ *
2807
+ * **Inheritance Chain:**
2808
+ * `useRegistry` → `createSelection` → `createSingle` → `createStep`
2404
2809
  *
2405
2810
  * @see https://0.vuetifyjs.com/composables/selection/use-single
2406
2811
  *
2407
2812
  * @example
2408
2813
  * ```ts
2409
- * import { useSingle } from '@vuetify/v0'
2814
+ * import { createSingle } from '@vuetify/v0'
2410
2815
  *
2411
- * const single = useSingle()
2816
+ * const tabs = createSingle({ mandatory: true })
2412
2817
  *
2413
- * single.onboard([
2414
- * { id: 'option-1', value: 'Option 1' },
2415
- * { id: 'option-2', value: 'Option 2' },
2818
+ * tabs.onboard([
2819
+ * { id: 'home', value: 'Home' },
2820
+ * { id: 'about', value: 'About' },
2821
+ * { id: 'contact', value: 'Contact' },
2416
2822
  * ])
2417
2823
  *
2418
- * single.select('option-1')
2824
+ * tabs.first() // Select first tab
2419
2825
  *
2420
- * console.log(single.selectedId.value) // 'option-1'
2826
+ * console.log(tabs.selectedId.value) // 'home'
2827
+ * console.log(tabs.selectedIndex.value) // 0
2828
+ *
2829
+ * tabs.select('about') // Switch to about tab
2830
+ * console.log(tabs.selectedId.value) // 'about'
2831
+ * console.log(tabs.selectedIds.size) // 1 (always enforces single selection)
2421
2832
  * ```
2422
2833
  */
2423
- function useSingle(options) {
2424
- const registry$1 = useSelection(options);
2834
+ function createSingle(options) {
2835
+ const registry$1 = createSelection(options);
2425
2836
  const mandatory = options?.mandatory ?? false;
2426
2837
  const selectedId = computed(() => registry$1.selectedIds.values().next().value);
2427
2838
  const selectedItem = computed(() => registry$1.selectedItems.value.values().next().value);
@@ -2480,14 +2891,41 @@ function useSingle(options) {
2480
2891
  * tabs.select('tab-1')
2481
2892
  * ```
2482
2893
  */
2483
- function createSingleContext(namespace, options) {
2894
+ function createSingleContext(_options) {
2895
+ const { namespace,...options } = _options;
2484
2896
  const [useSingleContext, _provideSingleContext] = createContext(namespace);
2485
- const context = useSingle(options);
2897
+ const context = createSingle(options);
2486
2898
  function provideSingleContext(_context = context, app) {
2487
2899
  return _provideSingleContext(_context, app);
2488
2900
  }
2489
2901
  return createTrinity(useSingleContext, provideSingleContext, context);
2490
2902
  }
2903
+ /**
2904
+ * Returns the current single selection instance.
2905
+ *
2906
+ * @param namespace The namespace for the single selection context. Defaults to `'v0:single'`.
2907
+ * @returns The current single selection instance.
2908
+ *
2909
+ * @see https://0.vuetifyjs.com/composables/selection/use-single
2910
+ *
2911
+ * @example
2912
+ * ```vue
2913
+ * <script setup lang="ts">
2914
+ * import { useSingle } from '@vuetify/v0'
2915
+ *
2916
+ * const tabs = useSingle()
2917
+ * <\/script>
2918
+ *
2919
+ * <template>
2920
+ * <div>
2921
+ * <p>Selected: {{ tabs.selectedId }}</p>
2922
+ * </div>
2923
+ * </template>
2924
+ * ```
2925
+ */
2926
+ function useSingle(namespace = "v0:single") {
2927
+ return useContext(namespace);
2928
+ }
2491
2929
 
2492
2930
  //#endregion
2493
2931
  //#region src/composables/useLocale/adapters/v0.ts
@@ -2501,7 +2939,7 @@ function createSingleContext(namespace, options) {
2501
2939
  var Vuetify0LocaleAdapter = class {
2502
2940
  t(message, ...params) {
2503
2941
  let resolvedMessage = message;
2504
- if (params.length > 0 && typeof params[0] === "object" && params[0] !== null && !Array.isArray(params[0])) {
2942
+ if (params.length > 0 && /* @__PURE__ */ isObject(params[0])) {
2505
2943
  const variables = params[0];
2506
2944
  resolvedMessage = resolvedMessage.replace(/{([a-zA-Z][a-zA-Z0-9_]*)}/g, (match, name) => {
2507
2945
  return variables[name] === void 0 ? match : String(variables[name]);
@@ -2527,7 +2965,6 @@ var Vuetify0LocaleAdapter = class {
2527
2965
  /**
2528
2966
  * Creates a new locale instance.
2529
2967
  *
2530
- * @param namespace The namespace for the locale instance.
2531
2968
  * @param options The options for the locale instance.
2532
2969
  * @template Z The type of the locale ticket.
2533
2970
  * @template E The type of the locale context.
@@ -2535,38 +2972,45 @@ var Vuetify0LocaleAdapter = class {
2535
2972
  *
2536
2973
  * @see https://0.vuetifyjs.com/composables/plugins/use-locale
2537
2974
  */
2538
- function createLocale(namespace = "v0:locale", options = {}) {
2539
- const { adapter = new Vuetify0LocaleAdapter(), messages = {} } = options;
2540
- const [useLocaleContext, _provideLocaleContext] = createContext(namespace);
2541
- const registry$1 = useSingle();
2975
+ function createLocale(_options = {}) {
2976
+ const { adapter = new Vuetify0LocaleAdapter(), messages = {},...options } = _options;
2977
+ const tokens = createTokens(messages, { flat: true });
2978
+ const registry$1 = createSingle(options);
2542
2979
  for (const id in messages) {
2543
2980
  registry$1.register({
2544
- value: messages[id],
2545
- id
2981
+ id,
2982
+ value: messages[id]
2546
2983
  });
2547
2984
  if (id === options.default && !registry$1.selectedId.value) registry$1.select(id);
2548
2985
  }
2549
2986
  function t(key, ...params) {
2550
2987
  const locale = registry$1.selectedId.value;
2551
2988
  if (!locale) return key;
2552
- const message = messages[locale]?.[key];
2553
- const template = typeof message === "string" ? resolve(locale, message) : key;
2989
+ const message = (registry$1.get(locale)?.value)?.[key];
2990
+ const template = /* @__PURE__ */ isString(message) ? resolve(locale, message) : key;
2554
2991
  return adapter.t(template, ...params);
2555
2992
  }
2556
2993
  function n(value, ...params) {
2557
2994
  return adapter.n(value, registry$1.selectedId.value, ...params);
2558
2995
  }
2559
2996
  function resolve(locale, str) {
2560
- return str.replace(/{([a-zA-Z0-9.-_]+)}/g, (match, linkedKey) => {
2561
- const [linkedLocale, ...rest] = linkedKey.split(".");
2562
- const keyPath = rest.join(".");
2563
- const targetLocale = messages[linkedLocale] ? linkedLocale : locale;
2564
- const targetKey = messages[linkedLocale] ? keyPath : linkedKey;
2565
- const resolved = messages[targetLocale]?.[targetKey];
2566
- return typeof resolved === "string" ? resolve(targetLocale, resolved) : match;
2997
+ return str.replace(/{([a-zA-Z0-9.-_]+)}/g, (match, key) => {
2998
+ const [prefix, ...rest] = key.split(".");
2999
+ const path = rest.join(".");
3000
+ const prefixTicket = registry$1.get(prefix);
3001
+ const target = prefixTicket ? prefix : locale;
3002
+ const name = prefixTicket ? path : key;
3003
+ const resolved = (registry$1.get(target)?.value)?.[name];
3004
+ if (/* @__PURE__ */ isString(resolved)) return resolve(target, resolved);
3005
+ const alias = `{${key}}`;
3006
+ if (tokens.isAlias(alias)) {
3007
+ const result = tokens.resolve(alias);
3008
+ return /* @__PURE__ */ isString(result) ? result : match;
3009
+ }
3010
+ return match;
2567
3011
  });
2568
3012
  }
2569
- const context = {
3013
+ return {
2570
3014
  ...registry$1,
2571
3015
  t,
2572
3016
  n,
@@ -2574,20 +3018,45 @@ function createLocale(namespace = "v0:locale", options = {}) {
2574
3018
  return registry$1.size;
2575
3019
  }
2576
3020
  };
2577
- function provideLocaleContext(_context = context, app) {
2578
- return _provideLocaleContext(_context, app);
2579
- }
2580
- return createTrinity(useLocaleContext, provideLocaleContext, context);
2581
3021
  }
2582
3022
  /**
2583
- * Returns the current locale instance.
3023
+ * Creates a new locale context.
2584
3024
  *
2585
- * @returns The current locale instance.
3025
+ * @param options The options for the locale context.
3026
+ * @template Z The type of the locale ticket.
3027
+ * @template E The type of the locale context.
3028
+ * @returns A new locale context.
2586
3029
  *
2587
3030
  * @see https://0.vuetifyjs.com/composables/plugins/use-locale
3031
+ *
3032
+ * @example
3033
+ * ```ts
3034
+ * import { createLocaleContext } from '@vuetify/v0'
3035
+ *
3036
+ * export const [useAppLocale, provideAppLocale, appLocale] = createLocaleContext({
3037
+ * namespace: 'app:locale',
3038
+ * messages: {
3039
+ * en: { hello: 'Hello' },
3040
+ * es: { hello: 'Hola' },
3041
+ * },
3042
+ * })
3043
+ *
3044
+ * // In a parent component:
3045
+ * provideAppLocale()
3046
+ *
3047
+ * // In a child component:
3048
+ * const locale = useAppLocale()
3049
+ * locale.select('es')
3050
+ * ```
2588
3051
  */
2589
- function useLocale() {
2590
- return useContext("v0:locale");
3052
+ function createLocaleContext(_options = {}) {
3053
+ const { namespace = "v0:locale",...options } = _options;
3054
+ const [useLocaleContext, _provideLocaleContext] = createContext(namespace);
3055
+ const context = createLocale(options);
3056
+ function provideLocaleContext(_context = context, app) {
3057
+ return _provideLocaleContext(_context, app);
3058
+ }
3059
+ return createTrinity(useLocaleContext, provideLocaleContext, context);
2591
3060
  }
2592
3061
  /**
2593
3062
  * Creates a new locale plugin.
@@ -2601,21 +3070,31 @@ function useLocale() {
2601
3070
  *
2602
3071
  * @see https://0.vuetifyjs.com/composables/plugins/use-locale
2603
3072
  */
2604
- function createLocalePlugin(options = {}) {
2605
- const { adapter = new Vuetify0LocaleAdapter(), messages = {} } = options;
2606
- const [, provideLocaleTokenContext, tokensContext] = createTokensContext("v0:locale:tokens", messages);
2607
- const [, provideLocaleContext, localeContext] = createLocale("v0:locale", {
3073
+ function createLocalePlugin(_options = {}) {
3074
+ const { namespace = "v0:locale", adapter = new Vuetify0LocaleAdapter(), messages = {},...options } = _options;
3075
+ const [, provideLocaleContext, context] = createLocaleContext({
3076
+ ...options,
3077
+ namespace,
2608
3078
  adapter,
2609
3079
  messages
2610
3080
  });
2611
3081
  return createPlugin({
2612
- namespace: "v0:locale",
3082
+ namespace,
2613
3083
  provide: (app) => {
2614
- provideLocaleContext(localeContext, app);
2615
- provideLocaleTokenContext(tokensContext, app);
3084
+ provideLocaleContext(context, app);
2616
3085
  }
2617
3086
  });
2618
3087
  }
3088
+ /**
3089
+ * Returns the current locale instance.
3090
+ *
3091
+ * @returns The current locale instance.
3092
+ *
3093
+ * @see https://0.vuetifyjs.com/composables/plugins/use-locale
3094
+ */
3095
+ function useLocale(namespace = "v0:locale") {
3096
+ return useContext(namespace);
3097
+ }
2619
3098
 
2620
3099
  //#endregion
2621
3100
  //#region src/composables/useMutationObserver/index.ts
@@ -2764,19 +3243,19 @@ var Vuetify0PermissionAdapter = class extends PermissionAdapter {
2764
3243
  /**
2765
3244
  * Creates a new permissions instance.
2766
3245
  *
2767
- * @param namespace The namespace for the permissions instance.
2768
3246
  * @param options The options for the permissions instance.
2769
3247
  * @template Z The type of the permission ticket.
2770
3248
  * @template E The type of the permission context.
2771
3249
  * @returns A new permissions instance.
2772
3250
  *
2773
- * @see https://0.vuetifyjs.com/composables/plugins/create-permissions
3251
+ * @see https://0.vuetifyjs.com/composables/plugins/use-permissions
2774
3252
  *
2775
3253
  * @example
2776
3254
  * ```ts
2777
3255
  * import { createPermissions } from '@vuetify/v0'
2778
3256
  *
2779
- * const [usePermissions, providePermissions] = createPermissions('v0:permissions', {
3257
+ * const [usePermissions, providePermissions] = createPermissions({
3258
+ * namespace: 'v0:permissions',
2780
3259
  * permissions: {
2781
3260
  * admin: [['read', 'users']],
2782
3261
  * editor: [['edit', 'posts']],
@@ -2784,9 +3263,8 @@ var Vuetify0PermissionAdapter = class extends PermissionAdapter {
2784
3263
  * })
2785
3264
  * ```
2786
3265
  */
2787
- function createPermissions(namespace = "v0:permissions", options = {}) {
2788
- const { adapter = new Vuetify0PermissionAdapter(), permissions = {} } = options;
2789
- const [usePermissionsContext, _providePermissionsContext] = createContext(namespace);
3266
+ function createPermissions(_options = {}) {
3267
+ const { adapter = new Vuetify0PermissionAdapter(), permissions = {},...options } = _options;
2790
3268
  const record = {};
2791
3269
  for (const role in permissions) {
2792
3270
  if (!record[role]) record[role] = {};
@@ -2795,44 +3273,46 @@ function createPermissions(namespace = "v0:permissions", options = {}) {
2795
3273
  record[role][action][subject] = condition;
2796
3274
  }
2797
3275
  }
2798
- const tokens = useTokens(record);
2799
- function can(id, action, subject, context$1 = {}) {
2800
- return adapter.can(id, action, subject, context$1, tokens);
3276
+ const tokens = createTokens(record, options);
3277
+ function can(id, action, subject, context = {}) {
3278
+ return adapter.can(id, action, subject, context, tokens);
2801
3279
  }
2802
- const context = {
3280
+ return {
2803
3281
  ...tokens,
2804
3282
  can
2805
3283
  };
2806
- function providePermissionsContext(_context = context, app) {
2807
- return _providePermissionsContext(_context, app);
2808
- }
2809
- return createTrinity(usePermissionsContext, providePermissionsContext, context);
2810
3284
  }
2811
3285
  /**
2812
- * Returns the current permissions instance.
3286
+ * Creates a new permissions context.
2813
3287
  *
3288
+ * @param options The options for the permissions context.
2814
3289
  * @template Z The type of the permission ticket.
2815
- * @returns The current permissions instance.
3290
+ * @template E The type of the permission context.
3291
+ * @returns A new permissions context.
2816
3292
  *
2817
3293
  * @see https://0.vuetifyjs.com/composables/plugins/use-permissions
2818
3294
  *
2819
3295
  * @example
2820
- * ```vue
2821
- * <script setup lang="ts">
2822
- * import { usePermissions } from '@vuetify/v0'
2823
- *
2824
- * const { can } = usePermissions()
2825
- * <\/script>
3296
+ * ```ts
3297
+ * import { createPermissionsContext } from '@vuetify/v0'
2826
3298
  *
2827
- * <template>
2828
- * <div>
2829
- * <p v-if="can('admin', 'read', 'users')">Admin access</p>
2830
- * </div>
2831
- * </template>
3299
+ * export const [usePermissions, providePermissions, context] = createPermissionsContext({
3300
+ * namespace: 'app:permissions',
3301
+ * permissions: {
3302
+ * admin: [['read', 'users'], ['edit', 'users']],
3303
+ * editor: [['edit', 'posts']],
3304
+ * },
3305
+ * })
2832
3306
  * ```
2833
3307
  */
2834
- function usePermissions() {
2835
- return useContext("v0:permissions");
3308
+ function createPermissionsContext(_options = {}) {
3309
+ const { namespace = "v0:permissions",...options } = _options;
3310
+ const [usePermissionsContext, _providePermissionsContext] = createContext(namespace);
3311
+ const context = createPermissions(options);
3312
+ function providePermissionsContext(_context = context, app) {
3313
+ return _providePermissionsContext(_context, app);
3314
+ }
3315
+ return createTrinity(usePermissionsContext, providePermissionsContext, context);
2836
3316
  }
2837
3317
  /**
2838
3318
  * Creates a new permissions plugin.
@@ -2864,15 +3344,45 @@ function usePermissions() {
2864
3344
  * app.mount('#app')
2865
3345
  * ```
2866
3346
  */
2867
- function createPermissionsPlugin(options = {}) {
2868
- const [, providePermissionContext, context] = createPermissions("v0:permissions", options);
3347
+ function createPermissionsPlugin(_options = {}) {
3348
+ const { namespace = "v0:permissions",...options } = _options;
3349
+ const [, providePermissionContext, context] = createPermissionsContext({
3350
+ ...options,
3351
+ namespace
3352
+ });
2869
3353
  return createPlugin({
2870
- namespace: "v0:permissions",
3354
+ namespace,
2871
3355
  provide: (app) => {
2872
3356
  providePermissionContext(context, app);
2873
3357
  }
2874
3358
  });
2875
3359
  }
3360
+ /**
3361
+ * Returns the current permissions instance.
3362
+ *
3363
+ * @template Z The type of the permission ticket.
3364
+ * @returns The current permissions instance.
3365
+ *
3366
+ * @see https://0.vuetifyjs.com/composables/plugins/use-permissions
3367
+ *
3368
+ * @example
3369
+ * ```vue
3370
+ * <script setup lang="ts">
3371
+ * import { usePermissions } from '@vuetify/v0'
3372
+ *
3373
+ * const { can } = usePermissions()
3374
+ * <\/script>
3375
+ *
3376
+ * <template>
3377
+ * <div>
3378
+ * <p v-if="can('admin', 'read', 'users')">Admin access</p>
3379
+ * </div>
3380
+ * </template>
3381
+ * ```
3382
+ */
3383
+ function usePermissions(namespace = "v0:permissions") {
3384
+ return useContext(namespace);
3385
+ }
2876
3386
 
2877
3387
  //#endregion
2878
3388
  //#region src/composables/useProxyModel/index.ts
@@ -2891,9 +3401,9 @@ function createPermissionsPlugin(options = {}) {
2891
3401
  *
2892
3402
  * @example
2893
3403
  * ```ts
2894
- * import { useSelection, useProxyModel } from '@vuetify/v0'
3404
+ * import { createSelection, useProxyModel } from '@vuetify/v0'
2895
3405
  *
2896
- * const registry = useSelection({ events: true })
3406
+ * const registry = createSelection({ events: true })
2897
3407
  * registry.onboard([
2898
3408
  * { id: 'item-1', value: 'Item 1' },
2899
3409
  * { id: 'item-2', value: 'Item 2' },
@@ -3030,7 +3540,7 @@ function useProxyRegistry(registry$1, options) {
3030
3540
  registry$1.on("update:ticket", update);
3031
3541
  registry$1.on("clear:registry", update);
3032
3542
  onScopeDispose(() => {
3033
- registry$1.off("register:item", update);
3543
+ registry$1.off("register:ticket", update);
3034
3544
  registry$1.off("unregister:ticket", update);
3035
3545
  registry$1.off("update:ticket", update);
3036
3546
  registry$1.off("clear:registry", update);
@@ -3071,8 +3581,8 @@ function useProxyRegistry(registry$1, options) {
3071
3581
  * console.log(queue.size) // 2
3072
3582
  * ```
3073
3583
  */
3074
- function useQueue(_options) {
3075
- const { timeout: _timeout = 3e3,...options } = _options ?? {};
3584
+ function createQueue(_options = {}) {
3585
+ const { timeout: _timeout = 3e3,...options } = _options;
3076
3586
  const registry$1 = useRegistry({
3077
3587
  ...options,
3078
3588
  events: true
@@ -3153,6 +3663,55 @@ function useQueue(_options) {
3153
3663
  }
3154
3664
  };
3155
3665
  }
3666
+ /**
3667
+ * Creates a new queue context.
3668
+ *
3669
+ * @param namespace The namespace for the queue context.
3670
+ * @param options The options for the queue context.
3671
+ * @template Z The type of the queue ticket.
3672
+ * @template E The type of the queue context.
3673
+ * @returns A new queue context.
3674
+ *
3675
+ * @see https://0.vuetifyjs.com/composables/registration/use-queue
3676
+ *
3677
+ * @example
3678
+ * ```ts
3679
+ * import { createQueueContext } from '@vuetify/v0'
3680
+ *
3681
+ * export const [useQueue, provideQueue] = createQueueContext('v0:queue', {
3682
+ * timeout: 5000,
3683
+ * })
3684
+ * ```
3685
+ */
3686
+ function createQueueContext(_options) {
3687
+ const { namespace,...options } = _options;
3688
+ const [useQueueContext, _provideQueueContext] = createContext(namespace);
3689
+ const context = createQueue(options);
3690
+ function provideQueueContext(_context = context, app) {
3691
+ return _provideQueueContext(_context, app);
3692
+ }
3693
+ return createTrinity(useQueueContext, provideQueueContext, context);
3694
+ }
3695
+ /**
3696
+ * Returns the current queue instance.
3697
+ *
3698
+ * @param namespace The namespace for the queue context. Defaults to `'v0:queue'`.
3699
+ * @returns The current queue instance.
3700
+ *
3701
+ * @see https://0.vuetifyjs.com/composables/registration/use-queue
3702
+ *
3703
+ * @example
3704
+ * ```vue
3705
+ * <script setup lang="ts">
3706
+ * import { useQueue } from '@vuetify/v0'
3707
+ *
3708
+ * const queue = useQueue()
3709
+ * <\/script>
3710
+ * ```
3711
+ */
3712
+ function useQueue(namespace = "v0:queue") {
3713
+ return useContext(namespace);
3714
+ }
3156
3715
 
3157
3716
  //#endregion
3158
3717
  //#region src/composables/useResizeObserver/index.ts
@@ -3308,35 +3867,66 @@ function useElementSize(target) {
3308
3867
  //#endregion
3309
3868
  //#region src/composables/useStep/index.ts
3310
3869
  /**
3311
- * Creates a new step instance.
3870
+ * Creates a new step instance with circular navigation through items.
3871
+ *
3872
+ * Extends `createSingle` with `first()`, `last()`, `next()`, `prev()`, and `step(count)` methods
3873
+ * for sequential navigation. Automatically wraps around at boundaries (circular navigation).
3312
3874
  *
3313
3875
  * @param options The options for the step instance.
3314
3876
  * @template Z The type of the step ticket.
3315
3877
  * @template E The type of the step context.
3316
- * @returns A new step instance.
3878
+ * @returns A new step instance with navigation methods.
3879
+ *
3880
+ * @remarks
3881
+ * **Key Features:**
3882
+ * - **Circular Navigation**: Wrapping at start/end boundaries
3883
+ * - **Disabled Item Skipping**: Automatically skips disabled items during navigation
3884
+ * - **Bidirectional**: Forward (`next`, positive `step`) and backward (`prev`, negative `step`)
3885
+ * - **Safe Edge Cases**: Handles empty registries and all-disabled scenarios gracefully
3886
+ *
3887
+ * **Navigation Methods:**
3888
+ * - `first()`: Select first non-disabled item
3889
+ * - `last()`: Select last non-disabled item
3890
+ * - `next()`: Move to next item (wraps to first)
3891
+ * - `prev()`: Move to previous item (wraps to last)
3892
+ * - `step(count)`: Move by `count` positions (negative for backward)
3893
+ *
3894
+ * **Wrapping Behavior:**
3895
+ * - Uses modulo arithmetic for circular wrapping: `((index % length) + length) % length`
3896
+ * - Works correctly with negative indexes and large step counts
3897
+ * - Continues searching if landing on disabled items (up to registry length iterations)
3898
+ * - Returns early if all items are disabled to prevent infinite loops
3899
+ *
3900
+ * **Inheritance Chain:**
3901
+ * `useRegistry` → `createSelection` → `createSingle` → `createStep`
3317
3902
  *
3318
3903
  * @see https://0.vuetifyjs.com/composables/selection/use-step
3319
3904
  *
3320
3905
  * @example
3321
3906
  * ```ts
3322
- * import { useStep } from '@vuetify/v0'
3907
+ * import { createStep } from '@vuetify/v0'
3323
3908
  *
3324
- * const stepper = useStep()
3909
+ * const wizard = createStep({ mandatory: true })
3325
3910
  *
3326
- * stepper.onboard([
3327
- * { id: 'step-1', value: 'Account Info' },
3328
- * { id: 'step-2', value: 'Payment' },
3329
- * { id: 'step-3', value: 'Confirmation' },
3911
+ * wizard.onboard([
3912
+ * { id: 'account', value: 'Account Info' },
3913
+ * { id: 'payment', value: 'Payment Details' },
3914
+ * { id: 'review', value: 'Review', disabled: true },
3915
+ * { id: 'confirm', value: 'Confirmation' },
3330
3916
  * ])
3331
3917
  *
3332
- * stepper.first()
3333
- * stepper.next() // Move to step-2
3918
+ * wizard.first() // Select 'account'
3919
+ * console.log(wizard.selectedId.value) // 'account'
3334
3920
  *
3335
- * console.log(stepper.selectedIndex.value) // 1
3921
+ * wizard.next() // Move to 'payment'
3922
+ * wizard.next() // Skip disabled 'review', move to 'confirm'
3923
+ * wizard.next() // Wrap around to 'account'
3924
+ *
3925
+ * wizard.step(-2) // Go back 2 steps (wraps correctly)
3336
3926
  * ```
3337
3927
  */
3338
- function useStep(options) {
3339
- const registry$1 = useSingle(options);
3928
+ function createStep(options) {
3929
+ const registry$1 = createSingle(options);
3340
3930
  function first() {
3341
3931
  const ticket = registry$1.seek("first");
3342
3932
  if (ticket) registry$1.select(ticket.id);
@@ -3407,14 +3997,42 @@ function useStep(options) {
3407
3997
  * wizard.next() // Progress to next step
3408
3998
  * ```
3409
3999
  */
3410
- function createStepContext(namespace, options) {
4000
+ function createStepContext(_options) {
4001
+ const { namespace,...options } = _options;
3411
4002
  const [useStepContext, _provideStepContext] = createContext(namespace);
3412
- const context = useStep(options);
4003
+ const context = createStep(options);
3413
4004
  function provideStepContext(_context = context, app) {
3414
4005
  return _provideStepContext(_context, app);
3415
4006
  }
3416
4007
  return createTrinity(useStepContext, provideStepContext, context);
3417
4008
  }
4009
+ /**
4010
+ * Returns the current step instance.
4011
+ *
4012
+ * @param namespace The namespace for the step context. Defaults to `'v0:step'`.
4013
+ * @returns The current step instance.
4014
+ *
4015
+ * @see https://0.vuetifyjs.com/composables/selection/use-step
4016
+ *
4017
+ * @example
4018
+ * ```vue
4019
+ * <script setup lang="ts">
4020
+ * import { useStep } from '@vuetify/v0'
4021
+ *
4022
+ * const wizard = useStep()
4023
+ * <\/script>
4024
+ *
4025
+ * <template>
4026
+ * <div>
4027
+ * <p>Current step: {{ wizard.selectedIndex }}</p>
4028
+ * <button @click="wizard.next()">Next</button>
4029
+ * </div>
4030
+ * </template>
4031
+ * ```
4032
+ */
4033
+ function useStep(namespace = "v0:step") {
4034
+ return useContext(namespace);
4035
+ }
3418
4036
 
3419
4037
  //#endregion
3420
4038
  //#region src/composables/useStorage/adapters/memory.ts
@@ -3530,31 +4148,14 @@ function createStorage(options = {}) {
3530
4148
  clear
3531
4149
  };
3532
4150
  }
3533
- /**
3534
- * Returns the current storage instance.
3535
- *
3536
- * @returns The current storage instance.
3537
- *
3538
- * @see https://0.vuetifyjs.com/composables/plugins/use-storage
3539
- *
3540
- * @example
3541
- * ```vue
3542
- * <script setup lang="ts">
3543
- * import { useStorage } from '@vuetify/v0'
3544
- *
3545
- * const storage = useStorage()
3546
- * const username = storage.get('username', 'Guest')
3547
- * <\/script>
3548
- *
3549
- * <template>
3550
- * <div>
3551
- * <p>Username: {{ username }}</p>
3552
- * </div>
3553
- * </template>
3554
- * ```
3555
- */
3556
- function useStorage() {
3557
- return useStorageContext();
4151
+ function createStorageContext(_options = {}) {
4152
+ const { namespace = "v0:storage",...options } = _options;
4153
+ const [useStorageContext$1, _provideStorageContext] = createContext(namespace);
4154
+ const context = createStorage(options);
4155
+ function provideStorageContext$1(_context = context, app) {
4156
+ return _provideStorageContext(_context, app);
4157
+ }
4158
+ return createTrinity(useStorageContext$1, provideStorageContext$1, context);
3558
4159
  }
3559
4160
  /**
3560
4161
  * Creates a new storage plugin.
@@ -3577,15 +4178,46 @@ function useStorage() {
3577
4178
  * app.mount('#app')
3578
4179
  * ```
3579
4180
  */
3580
- function createStoragePlugin(options = {}) {
3581
- const context = createStorage(options);
4181
+ function createStoragePlugin(_options = {}) {
4182
+ const { namespace = "v0:storage",...options } = _options;
4183
+ const [, provideStorageContext$1, context] = createStorageContext({
4184
+ ...options,
4185
+ namespace
4186
+ });
3582
4187
  return createPlugin({
3583
- namespace: "v0:storage",
4188
+ namespace,
3584
4189
  provide: (app) => {
3585
- provideStorageContext(context, app);
4190
+ provideStorageContext$1(context, app);
3586
4191
  }
3587
4192
  });
3588
4193
  }
4194
+ /**
4195
+ * Returns the current storage instance.
4196
+ *
4197
+ * @param namespace The namespace for the storage context. Defaults to `'v0:storage'`.
4198
+ * @returns The current storage instance.
4199
+ *
4200
+ * @see https://0.vuetifyjs.com/composables/plugins/use-storage
4201
+ *
4202
+ * @example
4203
+ * ```vue
4204
+ * <script setup lang="ts">
4205
+ * import { useStorage } from '@vuetify/v0'
4206
+ *
4207
+ * const storage = useStorage()
4208
+ * const username = storage.get('username', 'Guest')
4209
+ * <\/script>
4210
+ *
4211
+ * <template>
4212
+ * <div>
4213
+ * <p>Username: {{ username }}</p>
4214
+ * </div>
4215
+ * </template>
4216
+ * ```
4217
+ */
4218
+ function useStorage(namespace = "v0:storage") {
4219
+ return useContext(namespace);
4220
+ }
3589
4221
 
3590
4222
  //#endregion
3591
4223
  //#region src/composables/useTheme/adapters/adapter.ts
@@ -3643,7 +4275,6 @@ var Vuetify0ThemeAdapter = class extends ThemeAdapter {
3643
4275
  /**
3644
4276
  * Creates a new theme instance.
3645
4277
  *
3646
- * @param namespace The namespace for the theme instance.
3647
4278
  * @param options The options for the theme instance.
3648
4279
  * @template Z The type of the theme ticket.
3649
4280
  * @template E The type of the theme context.
@@ -3655,7 +4286,8 @@ var Vuetify0ThemeAdapter = class extends ThemeAdapter {
3655
4286
  * ```ts
3656
4287
  * import { createTheme } from '@vuetify/v0'
3657
4288
  *
3658
- * export const [useTheme, provideTheme] = createTheme('v0:theme', {
4289
+ * export const [useTheme, provideTheme] = createTheme({
4290
+ * namespace: 'v0:theme',
3659
4291
  * default: 'light',
3660
4292
  * themes: {
3661
4293
  * light: {
@@ -3674,14 +4306,13 @@ var Vuetify0ThemeAdapter = class extends ThemeAdapter {
3674
4306
  * })
3675
4307
  * ```
3676
4308
  */
3677
- function createTheme(namespace = "v0:theme", options = {}) {
3678
- const { themes = {}, palette = {} } = options;
3679
- const [useThemeContext, _provideThemeContext] = createContext(namespace);
3680
- const tokens = useTokens({
4309
+ function createTheme(_options = {}) {
4310
+ const { themes = {}, palette = {},...options } = _options;
4311
+ const tokens = createTokens({
3681
4312
  palette,
3682
4313
  ...themes
3683
4314
  }, { flat: true });
3684
- const registry$1 = useSingle();
4315
+ const registry$1 = createSingle(options);
3685
4316
  for (const id in themes) {
3686
4317
  const { colors: value,...theme } = themes[id];
3687
4318
  register({
@@ -3718,7 +4349,7 @@ function createTheme(namespace = "v0:theme", options = {}) {
3718
4349
  };
3719
4350
  return registry$1.register(item);
3720
4351
  }
3721
- const context = {
4352
+ return {
3722
4353
  ...registry$1,
3723
4354
  colors,
3724
4355
  register,
@@ -3727,40 +4358,54 @@ function createTheme(namespace = "v0:theme", options = {}) {
3727
4358
  return registry$1.size;
3728
4359
  }
3729
4360
  };
3730
- function provideThemeContext(_context = context, app) {
3731
- return _provideThemeContext(_context, app);
3732
- }
3733
- return createTrinity(useThemeContext, provideThemeContext, context);
3734
4361
  }
3735
4362
  /**
3736
- * Returns the current theme instance.
4363
+ * Creates a new theme context trinity.
3737
4364
  *
3738
- * @returns The current theme instance.
4365
+ * @param options The options for the theme context.
4366
+ * @template Z The type of the theme ticket.
4367
+ * @template E The type of the theme context.
4368
+ * @returns A new theme context trinity.
3739
4369
  *
3740
4370
  * @see https://0.vuetifyjs.com/composables/plugins/use-theme
3741
4371
  *
3742
4372
  * @example
3743
- * ```vue
3744
- * <script setup lang="ts">
3745
- * import { useTheme } from '@vuetify/v0'
3746
- *
3747
- * const theme = useTheme()
3748
- * <\/script>
4373
+ * ```ts
4374
+ * import { createThemeContext } from '@vuetify/v0'
3749
4375
  *
3750
- * <template>
3751
- * <div>
3752
- * <p>Current theme: {{ theme.selected.value }}</p>
3753
- * </div>
3754
- * </template>
4376
+ * export const [useThemeContext, provideThemeContext, context] = createThemeContext({
4377
+ * namespace: 'v0:theme',
4378
+ * default: 'light',
4379
+ * themes: {
4380
+ * light: {
4381
+ * dark: false,
4382
+ * colors: {
4383
+ * primary: '#3b82f6',
4384
+ * },
4385
+ * },
4386
+ * dark: {
4387
+ * dark: true,
4388
+ * colors: {
4389
+ * primary: '#675496',
4390
+ * },
4391
+ * },
4392
+ * },
4393
+ * })
3755
4394
  * ```
3756
4395
  */
3757
- function useTheme() {
3758
- return useContext("v0:theme");
4396
+ function createThemeContext(_options = {}) {
4397
+ const { namespace = "v0:theme",...options } = _options;
4398
+ const [useThemeContext, _provideThemeContext] = createContext(namespace);
4399
+ const context = createTheme(options);
4400
+ function provideThemeContext(_context = context, app) {
4401
+ return _provideThemeContext(_context, app);
4402
+ }
4403
+ return createTrinity(useThemeContext, provideThemeContext, context);
3759
4404
  }
3760
4405
  /**
3761
4406
  * Creates a new theme plugin.
3762
4407
  *
3763
- * @param _options The options for the theme plugin.
4408
+ * @param options The options for the theme plugin.
3764
4409
  * @template Z The type of the theme ticket.
3765
4410
  * @template E The type of the theme context.
3766
4411
  * @returns A new theme plugin.
@@ -3799,27 +4444,28 @@ function useTheme() {
3799
4444
  * ```
3800
4445
  */
3801
4446
  function createThemePlugin(_options = {}) {
3802
- const { adapter = new Vuetify0ThemeAdapter(), palette = {}, themes = {}, target,...options } = _options;
3803
- const [, provideThemeContext, themeContext] = createTheme("v0:theme", {
4447
+ const { adapter = new Vuetify0ThemeAdapter(), namespace = "v0:theme", palette = {}, themes = {}, target,...options } = _options;
4448
+ const [, provideThemeContext, context] = createThemeContext({
3804
4449
  ...options,
4450
+ namespace,
3805
4451
  themes,
3806
4452
  palette
3807
4453
  });
3808
4454
  return createPlugin({
3809
- namespace: "v0:theme",
4455
+ namespace,
3810
4456
  provide: (app) => {
3811
- provideThemeContext(themeContext, app);
4457
+ provideThemeContext(context, app);
3812
4458
  },
3813
4459
  setup: (app) => {
3814
4460
  if (IN_BROWSER) {
3815
- onScopeDispose(watch(themeContext.colors, (colors) => {
4461
+ onScopeDispose(watch(context.colors, (colors) => {
3816
4462
  adapter.update(colors);
3817
4463
  }, { immediate: true }), true);
3818
4464
  if (target === null) return;
3819
- const targetEl = target instanceof HTMLElement ? target : typeof target === "string" ? document.querySelector(target) : app._container || document.querySelector("#app") || document.body;
4465
+ const targetEl = target instanceof HTMLElement ? target : /* @__PURE__ */ isString(target) ? document.querySelector(target) : app._container || document.querySelector("#app") || document.body;
3820
4466
  if (!targetEl) return;
3821
4467
  let prevClass = "";
3822
- onScopeDispose(watch(themeContext.selectedId, (id) => {
4468
+ onScopeDispose(watch(context.selectedId, (id) => {
3823
4469
  if (!id) return;
3824
4470
  const themeClass = `${adapter.prefix}-theme--${id}`;
3825
4471
  if (prevClass) targetEl.classList.remove(prevClass);
@@ -3829,11 +4475,11 @@ function createThemePlugin(_options = {}) {
3829
4475
  } else {
3830
4476
  const head = app._context?.provides?.usehead ?? app._context?.provides?.head;
3831
4477
  if (head?.push) {
3832
- const id = themeContext.selectedId.value;
4478
+ const id = context.selectedId.value;
3833
4479
  head.push({
3834
4480
  htmlAttrs: { class: id ? `${adapter.prefix}-theme--${id}` : "" },
3835
4481
  style: [{
3836
- innerHTML: adapter.generate(themeContext.colors.value),
4482
+ innerHTML: adapter.generate(context.colors.value),
3837
4483
  id: adapter.stylesheetId
3838
4484
  }]
3839
4485
  });
@@ -3842,6 +4488,32 @@ function createThemePlugin(_options = {}) {
3842
4488
  }
3843
4489
  });
3844
4490
  }
4491
+ /**
4492
+ * Returns the current theme instance.
4493
+ *
4494
+ * @param namespace The namespace for the theme context. Defaults to `v0:theme`.
4495
+ * @returns The current theme instance.
4496
+ *
4497
+ * @see https://0.vuetifyjs.com/composables/plugins/use-theme
4498
+ *
4499
+ * @example
4500
+ * ```vue
4501
+ * <script setup lang="ts">
4502
+ * import { useTheme } from '@vuetify/v0'
4503
+ *
4504
+ * const theme = useTheme()
4505
+ * <\/script>
4506
+ *
4507
+ * <template>
4508
+ * <div>
4509
+ * <p>Current theme: {{ theme.selected.value }}</p>
4510
+ * </div>
4511
+ * </template>
4512
+ * ```
4513
+ */
4514
+ function useTheme(namespace = "v0:theme") {
4515
+ return useContext(namespace);
4516
+ }
3845
4517
 
3846
4518
  //#endregion
3847
4519
  //#region src/composables/useTimeline/index.ts
@@ -3872,7 +4544,7 @@ function createThemePlugin(_options = {}) {
3872
4544
  * console.log(timeline.values()) // [{ id: 'one' }, { id: 'two' }, { id: 'three' }]
3873
4545
  * ```
3874
4546
  */
3875
- function useTimeline(_options = {}) {
4547
+ function createTimeline(_options = {}) {
3876
4548
  const { size = 10,...options } = _options;
3877
4549
  const registry$1 = useRegistry(options);
3878
4550
  const stack = [];
@@ -3919,10 +4591,66 @@ function useTimeline(_options = {}) {
3919
4591
  }
3920
4592
  };
3921
4593
  }
4594
+ /**
4595
+ * Creates a new timeline plugin.
4596
+ *
4597
+ * @param namespace The namespace for the timeline plugin.
4598
+ * @param options The options for the timeline plugin.
4599
+ * @template Z The type of the timeline ticket.
4600
+ * @template E The type of the timeline context.
4601
+ * @returns A new timeline plugin.
4602
+ *
4603
+ * @see https://0.vuetifyjs.com/composables/registration/use-timeline
4604
+ *
4605
+ * @example
4606
+ * ```ts
4607
+ * import { createTimelineContext } from '@vuetify/v0'
4608
+ *
4609
+ * export const [useTimeline, provideTimeline, context] = createTimelineContext('v0:timeline', { size: 5 })
4610
+ * context.register({ id: 'example' })
4611
+ *
4612
+ * // In a parent component
4613
+ * provideTimeline()
4614
+ *
4615
+ * // In a child component
4616
+ * const timeline = useTimeline()
4617
+ *
4618
+ * console.log(timeline.values()) // [{ id: 'example' }]
4619
+ * ```
4620
+ */
4621
+ function createTimelineContext(_options) {
4622
+ const { namespace,...options } = _options;
4623
+ const [useTimelineContext, _provideTimelineContext] = createContext(namespace);
4624
+ const context = createTimeline(options);
4625
+ function provideTimelineContext(_context = context, app) {
4626
+ return _provideTimelineContext(_context, app);
4627
+ }
4628
+ return createTrinity(useTimelineContext, provideTimelineContext, context);
4629
+ }
4630
+ /**
4631
+ * Returns the current timeline instance.
4632
+ *
4633
+ * @param namespace The namespace for the timeline context. Defaults to `'v0:timeline'`.
4634
+ * @returns The current timeline instance.
4635
+ *
4636
+ * @see https://0.vuetifyjs.com/composables/registration/use-timeline
4637
+ *
4638
+ * @example
4639
+ * ```vue
4640
+ * <script setup lang="ts">
4641
+ * import { useTimeline } from '@vuetify/v0'
4642
+ *
4643
+ * const timeline = useTimeline()
4644
+ * <\/script>
4645
+ * ```
4646
+ */
4647
+ function useTimeline(namespace = "v0:timeline") {
4648
+ return useContext(namespace);
4649
+ }
3922
4650
 
3923
4651
  //#endregion
3924
4652
  //#region src/components/Avatar/AvatarRoot.vue?vue&type=script&setup=true&lang.ts
3925
- const [useAvatarContext, provideAvatarContext, registry] = createRegistryContext("avatar");
4653
+ const [useAvatarContext, provideAvatarContext, registry] = createRegistryContext({ namespace: "avatar" });
3926
4654
  var AvatarRoot_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
3927
4655
  name: "AvatarRoot",
3928
4656
  __name: "AvatarRoot",
@@ -4076,143 +4804,6 @@ const Avatar = {
4076
4804
  Root: AvatarRoot_default
4077
4805
  };
4078
4806
 
4079
- //#endregion
4080
- //#region src/components/Breakpoints/BreakpointsItem.vue?vue&type=script&setup=true&lang.ts
4081
- var BreakpointsItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
4082
- name: "BreakpointsItem",
4083
- __name: "BreakpointsItem",
4084
- setup(__props) {
4085
- const breakpointsContext = useBreakpoints();
4086
- return (_ctx, _cache) => {
4087
- return openBlock(), createElementBlock(Fragment, null, [_ctx.$slots.xs && unref(breakpointsContext).xs ? renderSlot(_ctx.$slots, "xs", normalizeProps(mergeProps({ key: 0 }, unref(breakpointsContext)))) : _ctx.$slots.sm && unref(breakpointsContext).sm ? renderSlot(_ctx.$slots, "sm", normalizeProps(mergeProps({ key: 1 }, unref(breakpointsContext)))) : _ctx.$slots.md && unref(breakpointsContext).md ? renderSlot(_ctx.$slots, "md", normalizeProps(mergeProps({ key: 2 }, unref(breakpointsContext)))) : _ctx.$slots.lg && unref(breakpointsContext).lg ? renderSlot(_ctx.$slots, "lg", normalizeProps(mergeProps({ key: 3 }, unref(breakpointsContext)))) : _ctx.$slots.xl && unref(breakpointsContext).xl ? renderSlot(_ctx.$slots, "xl", normalizeProps(mergeProps({ key: 4 }, unref(breakpointsContext)))) : _ctx.$slots.xxl && unref(breakpointsContext).xxl ? renderSlot(_ctx.$slots, "xxl", normalizeProps(mergeProps({ key: 5 }, unref(breakpointsContext)))) : createCommentVNode("v-if", true), renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(breakpointsContext))))], 64);
4088
- };
4089
- }
4090
- });
4091
-
4092
- //#endregion
4093
- //#region src/components/Breakpoints/BreakpointsItem.vue
4094
- var BreakpointsItem_default = BreakpointsItem_vue_vue_type_script_setup_true_lang_default;
4095
-
4096
- //#endregion
4097
- //#region src/components/Breakpoints/BreakpointsRoot.vue?vue&type=script&setup=true&lang.ts
4098
- var BreakpointsRoot_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
4099
- name: "BreakpointsRoot",
4100
- __name: "BreakpointsRoot",
4101
- props: {
4102
- mobileBreakpoint: {},
4103
- breakpoints: {}
4104
- },
4105
- setup(__props) {
4106
- const [, provideBreakpointsContext, context] = createBreakpoints("v0:breakpoints", __props);
4107
- provideBreakpointsContext(context);
4108
- return (_ctx, _cache) => {
4109
- return renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(context))));
4110
- };
4111
- }
4112
- });
4113
-
4114
- //#endregion
4115
- //#region src/components/Breakpoints/BreakpointsRoot.vue
4116
- var BreakpointsRoot_default = BreakpointsRoot_vue_vue_type_script_setup_true_lang_default;
4117
-
4118
- //#endregion
4119
- //#region src/components/Breakpoints/index.ts
4120
- const Breakpoints = {
4121
- Item: BreakpointsItem_default,
4122
- Root: BreakpointsRoot_default
4123
- };
4124
-
4125
- //#endregion
4126
- //#region src/components/Context/ContextItem.vue?vue&type=script&setup=true&lang.ts
4127
- var ContextItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
4128
- name: "ContextItem",
4129
- __name: "ContextItem",
4130
- props: {
4131
- contextKey: {},
4132
- value: {}
4133
- },
4134
- setup(__props) {
4135
- let contextValue;
4136
- if (__props.value !== void 0) contextValue = __props.value;
4137
- else if (__props.contextKey) {
4138
- const [injectContext] = createContext(__props.contextKey);
4139
- contextValue = injectContext();
4140
- } else throw new Error("Context component requires either a \"value\" prop or a \"contextKey\" prop");
4141
- const bindableProps = toRef(() => ({ value: contextValue }));
4142
- return (_ctx, _cache) => {
4143
- return renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(bindableProps.value)));
4144
- };
4145
- }
4146
- });
4147
-
4148
- //#endregion
4149
- //#region src/components/Context/ContextItem.vue
4150
- var ContextItem_default = ContextItem_vue_vue_type_script_setup_true_lang_default;
4151
-
4152
- //#endregion
4153
- //#region src/components/Context/ContextRoot.vue?vue&type=script&setup=true&lang.ts
4154
- var ContextRoot_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
4155
- name: "ContextRoot",
4156
- __name: "ContextRoot",
4157
- props: {
4158
- contextKey: {},
4159
- value: {}
4160
- },
4161
- setup(__props) {
4162
- const [, provideContext$1] = createContext(__props.contextKey);
4163
- provideContext$1(__props.value);
4164
- return (_ctx, _cache) => {
4165
- return renderSlot(_ctx.$slots, "default");
4166
- };
4167
- }
4168
- });
4169
-
4170
- //#endregion
4171
- //#region src/components/Context/ContextRoot.vue
4172
- var ContextRoot_default = ContextRoot_vue_vue_type_script_setup_true_lang_default;
4173
-
4174
- //#endregion
4175
- //#region src/components/Context/index.ts
4176
- const Context = {
4177
- Item: ContextItem_default,
4178
- Root: ContextRoot_default
4179
- };
4180
-
4181
- //#endregion
4182
- //#region src/components/Hydration/Hydration.vue?vue&type=script&setup=true&lang.ts
4183
- var Hydration_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
4184
- name: "Hydration",
4185
- __name: "Hydration",
4186
- setup(__props) {
4187
- const hydrationContext = useHydration();
4188
- return (_ctx, _cache) => {
4189
- return renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(hydrationContext))));
4190
- };
4191
- }
4192
- });
4193
-
4194
- //#endregion
4195
- //#region src/components/Hydration/Hydration.vue
4196
- var Hydration_default = Hydration_vue_vue_type_script_setup_true_lang_default;
4197
-
4198
- //#endregion
4199
- //#region src/components/Hydration/HydrationRoot.vue?vue&type=script&setup=true&lang.ts
4200
- var HydrationRoot_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
4201
- name: "HydrationRoot",
4202
- __name: "HydrationRoot",
4203
- setup(__props) {
4204
- const hydrationContext = createHydration();
4205
- provideHydrationContext(hydrationContext);
4206
- return (_ctx, _cache) => {
4207
- return renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(hydrationContext))));
4208
- };
4209
- }
4210
- });
4211
-
4212
- //#endregion
4213
- //#region src/components/Hydration/HydrationRoot.vue
4214
- var HydrationRoot_default = HydrationRoot_vue_vue_type_script_setup_true_lang_default;
4215
-
4216
4807
  //#endregion
4217
4808
  //#region src/components/Popover/PopoverRoot.vue?vue&type=script&setup=true&lang.ts
4218
4809
  const [usePopoverContext, providePopoverContext] = createContext("Popover");
@@ -4364,51 +4955,4 @@ const Popover = {
4364
4955
  };
4365
4956
 
4366
4957
  //#endregion
4367
- //#region src/components/Theme/ThemeItem.vue?vue&type=script&setup=true&lang.ts
4368
- var ThemeItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
4369
- name: "ThemeItem",
4370
- __name: "ThemeItem",
4371
- setup(__props) {
4372
- const themeContext = useTheme();
4373
- return (_ctx, _cache) => {
4374
- return renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(themeContext))));
4375
- };
4376
- }
4377
- });
4378
-
4379
- //#endregion
4380
- //#region src/components/Theme/ThemeItem.vue
4381
- var ThemeItem_default = ThemeItem_vue_vue_type_script_setup_true_lang_default;
4382
-
4383
- //#endregion
4384
- //#region src/components/Theme/ThemeRoot.vue?vue&type=script&setup=true&lang.ts
4385
- var ThemeRoot_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
4386
- name: "ThemeRoot",
4387
- __name: "ThemeRoot",
4388
- props: {
4389
- namespace: { default: "v0:theme" },
4390
- themes: { default: () => [] }
4391
- },
4392
- setup(__props) {
4393
- const [provideThemeContext] = createTheme(__props.namespace);
4394
- const themeContext = provideThemeContext();
4395
- for (const theme of __props.themes) themeContext.register(theme);
4396
- return (_ctx, _cache) => {
4397
- return renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(themeContext))));
4398
- };
4399
- }
4400
- });
4401
-
4402
- //#endregion
4403
- //#region src/components/Theme/ThemeRoot.vue
4404
- var ThemeRoot_default = ThemeRoot_vue_vue_type_script_setup_true_lang_default;
4405
-
4406
- //#endregion
4407
- //#region src/components/Theme/index.ts
4408
- const Theme = {
4409
- Item: ThemeItem_default,
4410
- Root: ThemeRoot_default
4411
- };
4412
-
4413
- //#endregion
4414
- export { Atom_default as Atom, Avatar, Breakpoints, COMMON_ELEMENTS, ConsolaLoggerAdapter, Context, Hydration_default as Hydration, HydrationRoot_default as HydrationRoot, IN_BROWSER, MemoryAdapter, PermissionAdapter, PinoLoggerAdapter, Popover, SELF_CLOSING_TAGS, SUPPORTS_INTERSECTION_OBSERVER, SUPPORTS_MATCH_MEDIA, SUPPORTS_MUTATION_OBSERVER, SUPPORTS_OBSERVER, SUPPORTS_TOUCH, Theme, Vuetify0LocaleAdapter, Vuetify0LoggerAdapter, Vuetify0ThemeAdapter, __LOGGER_ENABLED__, createBreakpoints, createBreakpointsPlugin, createContext, createFeatures, createFeaturesPlugin, createGroupContext, createHydration, createHydrationPlugin, createLocale, createLocalePlugin, createLogger, createLoggerPlugin, createPermissions, createPermissionsPlugin, createPlugin, createRegistryContext, createSelectionContext, createSingleContext, createStepContext, createStorage, createStoragePlugin, createTheme, createThemePlugin, createTokensContext, createTrinity, genId, isArray, isBoolean, isFunction, isNullOrUndefined, isNumber, isObject, isPrimitive, isSelfClosingTag, isString, isUndefined, mergeDeep, provideAvatarContext, provideContext, provideHydrationContext, providePopoverContext, provideStorageContext, registry, toArray, toReactive, useAvatarContext, useBreakpoints, useContext, useDocumentEventListener, useElementIntersection, useElementSize, useEventListener, useFeatures, useFilter, useForm, useGroup, useHydration, useHydrationContext, useIntersectionObserver, useKeydown, useLocale, useLogger, useMutationObserver, usePermissions, usePopoverContext, useProxyModel, useProxyRegistry, useQueue, useRegistry, useResizeObserver, useSelection, useSingle, useStep, useStorage, useStorageContext, useTheme, useTimeline, useTokens, useWindowEventListener, version };
4958
+ export { Atom_default as Atom, Avatar, COMMON_ELEMENTS, ConsolaLoggerAdapter, IN_BROWSER, MemoryAdapter, PermissionAdapter, PinoLoggerAdapter, Popover, SELF_CLOSING_TAGS, SUPPORTS_INTERSECTION_OBSERVER, SUPPORTS_MATCH_MEDIA, SUPPORTS_MUTATION_OBSERVER, SUPPORTS_OBSERVER, SUPPORTS_TOUCH, Vuetify0LocaleAdapter, Vuetify0LoggerAdapter, Vuetify0ThemeAdapter, __LOGGER_ENABLED__, createBreakpoints, createBreakpointsContext, createBreakpointsPlugin, createContext, createFeatures, createFeaturesContext, createFeaturesPlugin, createForm, createFormContext, createGroup, createGroupContext, createHydration, createHydrationContext, createHydrationPlugin, createLocale, createLocaleContext, createLocalePlugin, createLogger, createLoggerContext, createLoggerPlugin, createPermissions, createPermissionsContext, createPermissionsPlugin, createPlugin, createQueue, createQueueContext, createRegistryContext, createSelection, createSelectionContext, createSingle, createSingleContext, createStep, createStepContext, createStorage, createStorageContext, createStoragePlugin, createTheme, createThemeContext, createThemePlugin, createTimeline, createTimelineContext, createTokens, createTokensContext, createTrinity, genId, isArray, isBoolean, isFunction, isNullOrUndefined, isNumber, isObject, isPrimitive, isSelfClosingTag, isString, isUndefined, mergeDeep, provideAvatarContext, provideContext, providePopoverContext, provideStorageContext, registry, toArray, toReactive, useAvatarContext, useBreakpoints, useContext, useDocumentEventListener, useElementIntersection, useElementSize, useEventListener, useFeatures, useFilter, useForm, useGroup, useHydration, useIntersectionObserver, useKeydown, useLocale, useLogger, useMutationObserver, usePermissions, usePopoverContext, useProxyModel, useProxyRegistry, useQueue, useRegistry, useResizeObserver, useSelection, useSingle, useStep, useStorage, useStorageContext, useTheme, useTimeline, useTokens, useWindowEventListener, version };