@vuetify/v0 0.0.2-beta.4 → 0.0.2
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.
- package/README.md +252 -0
- package/dist/browser/index.js +3123 -0
- package/dist/components/{index.d.mts → index.d.ts} +7 -5
- package/dist/components/{index.mjs → index.js} +7 -5
- package/dist/{components-B5iiovK7.mjs → components-Cc48kKWf.js} +5 -33
- package/dist/composables/index.d.ts +7 -0
- package/dist/composables/index.js +8 -0
- package/dist/{composables-C6dl5kjP.mjs → composables-7Cbs2sdO.js} +395 -6
- package/dist/constants/index.d.ts +2 -0
- package/dist/constants/index.js +5 -0
- package/dist/constants-DiTCgvMU.js +1 -0
- package/dist/factories/index.d.ts +2 -0
- package/dist/factories/{index.mjs → index.js} +1 -2
- package/dist/globals--2b7sF4-.js +12 -0
- package/dist/htmlElements-SjqYu0am.js +78 -0
- package/dist/index-BnsMFYhs.d.ts +1407 -0
- package/dist/{index-D4Grk5x1.d.mts → index-BozA2pze.d.ts} +1 -1
- package/dist/{index-oCBJwhpG.d.mts → index-BqrLvboW.d.ts} +31 -13
- package/dist/index-z_zwVNP8.d.ts +79 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +11 -0
- package/dist/transformers/index.d.ts +2 -0
- package/dist/transformers/index.js +4 -0
- package/dist/{transformers-BTjuwbOV.mjs → transformers-BAeg3QJF.js} +1 -1
- package/dist/types/{index.d.mts → index.d.ts} +1 -1
- package/dist/types/index.js +1 -0
- package/dist/{useTheme-tY7MoBKr.mjs → useTheme-DSYiiz0R.js} +65 -19
- package/dist/utilities/{index.d.mts → index.d.ts} +2 -2
- package/dist/utilities/{index.mjs → index.js} +1 -1
- package/package.json +32 -21
- package/dist/composables/index.d.mts +0 -5
- package/dist/composables/index.mjs +0 -7
- package/dist/factories/index.d.mts +0 -3
- package/dist/factories-DOLmqhVS.mjs +0 -0
- package/dist/index-ChaaTPKp.d.mts +0 -421
- package/dist/index-Cya5Y9pB.d.mts +0 -412
- package/dist/index-DfahEz6s.d.mts +0 -18
- package/dist/index-jG0yrC1F.d.mts +0 -467
- package/dist/index.d.mts +0 -9
- package/dist/index.mjs +0 -9
- package/dist/transformers/index.d.mts +0 -2
- package/dist/transformers/index.mjs +0 -4
- package/dist/types/index.mjs +0 -0
- /package/dist/{createTrinity-CwGvQ2ng.mjs → factories-CPq2yMlr.js} +0 -0
- /package/dist/{index-BA3ZFBnL.d.mts → index-LBy5OPMu.d.ts} +0 -0
- /package/dist/{index-CZRh0I2w.d.mts → index-tUyghL98.d.ts} +0 -0
- /package/dist/{utilities-lZSfrXgw.mjs → utilities-D9rWEgQK.js} +0 -0
|
@@ -1,421 +0,0 @@
|
|
|
1
|
-
import { ID } from "./index-BA3ZFBnL.mjs";
|
|
2
|
-
import { ContextTrinity } from "./index-DfahEz6s.mjs";
|
|
3
|
-
import * as vue185 from "vue";
|
|
4
|
-
import { App, ComputedRef, Reactive, Ref, ShallowRef } from "vue";
|
|
5
|
-
|
|
6
|
-
//#region src/composables/useBreakpoints/index.d.ts
|
|
7
|
-
type BreakpointName = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
8
|
-
interface BreakpointsContext {
|
|
9
|
-
breakpoints: Readonly<Record<BreakpointName, number>>;
|
|
10
|
-
name: BreakpointName;
|
|
11
|
-
width: number;
|
|
12
|
-
height: number;
|
|
13
|
-
isMobile: boolean;
|
|
14
|
-
xs: boolean;
|
|
15
|
-
sm: boolean;
|
|
16
|
-
md: boolean;
|
|
17
|
-
lg: boolean;
|
|
18
|
-
xl: boolean;
|
|
19
|
-
xxl: boolean;
|
|
20
|
-
smAndUp: boolean;
|
|
21
|
-
mdAndUp: boolean;
|
|
22
|
-
lgAndUp: boolean;
|
|
23
|
-
xlAndUp: boolean;
|
|
24
|
-
xxlAndUp: boolean;
|
|
25
|
-
smAndDown: boolean;
|
|
26
|
-
mdAndDown: boolean;
|
|
27
|
-
lgAndDown: boolean;
|
|
28
|
-
xlAndDown: boolean;
|
|
29
|
-
xxlAndDown: boolean;
|
|
30
|
-
update: () => void;
|
|
31
|
-
}
|
|
32
|
-
interface BreakpointsOptions {
|
|
33
|
-
mobileBreakpoint?: BreakpointName | number;
|
|
34
|
-
breakpoints?: Partial<Record<BreakpointName, number>>;
|
|
35
|
-
}
|
|
36
|
-
interface BreakpointsPlugin {
|
|
37
|
-
install: (app: App, ...options: any[]) => any;
|
|
38
|
-
}
|
|
39
|
-
declare const useBreakpointsContext: (namespace?: string) => BreakpointsContext, provideBreakpointsContext: (context: BreakpointsContext, app?: App) => BreakpointsContext;
|
|
40
|
-
/**
|
|
41
|
-
* Simple hook to access the breakpoints context.
|
|
42
|
-
*
|
|
43
|
-
* @returns The breakpoints context containing current breakpoint information.
|
|
44
|
-
*/
|
|
45
|
-
declare function useBreakpoints(): BreakpointsContext;
|
|
46
|
-
/**
|
|
47
|
-
* Creates a reactive breakpoints system for responsive behavior management.
|
|
48
|
-
* This function provides access to viewport dimensions, breakpoint detection, and helper flags
|
|
49
|
-
* for determining current screen size and implementing responsive logic.
|
|
50
|
-
*
|
|
51
|
-
* @param options Optional configuration for breakpoint thresholds and mobile breakpoint.
|
|
52
|
-
* @returns A breakpoints context object with reactive state and utility methods.
|
|
53
|
-
*/
|
|
54
|
-
declare function createBreakpoints(options?: BreakpointsOptions): vue185.ShallowReactive<{
|
|
55
|
-
breakpoints: {
|
|
56
|
-
readonly xs: 0;
|
|
57
|
-
readonly sm: 600;
|
|
58
|
-
readonly md: 960;
|
|
59
|
-
readonly lg: 1280;
|
|
60
|
-
readonly xl: 1920;
|
|
61
|
-
readonly xxl: 2560;
|
|
62
|
-
};
|
|
63
|
-
name: BreakpointName;
|
|
64
|
-
width: number;
|
|
65
|
-
height: number;
|
|
66
|
-
isMobile: boolean;
|
|
67
|
-
xs: boolean;
|
|
68
|
-
sm: boolean;
|
|
69
|
-
md: boolean;
|
|
70
|
-
lg: boolean;
|
|
71
|
-
xl: boolean;
|
|
72
|
-
xxl: boolean;
|
|
73
|
-
smAndUp: boolean;
|
|
74
|
-
mdAndUp: boolean;
|
|
75
|
-
lgAndUp: boolean;
|
|
76
|
-
xlAndUp: boolean;
|
|
77
|
-
xxlAndUp: boolean;
|
|
78
|
-
smAndDown: boolean;
|
|
79
|
-
mdAndDown: boolean;
|
|
80
|
-
lgAndDown: boolean;
|
|
81
|
-
xlAndDown: boolean;
|
|
82
|
-
xxlAndDown: boolean;
|
|
83
|
-
update: () => void;
|
|
84
|
-
}>;
|
|
85
|
-
/**
|
|
86
|
-
* Creates a Vue plugin for managing responsive breakpoints with automatic updates.
|
|
87
|
-
* This plugin sets up breakpoint tracking and updates the context when the window
|
|
88
|
-
* is resized, providing reactive breakpoint state throughout the application.
|
|
89
|
-
*
|
|
90
|
-
* @param options Optional configuration for breakpoint thresholds and mobile breakpoint.
|
|
91
|
-
* @returns A Vue plugin object with install method.
|
|
92
|
-
*/
|
|
93
|
-
declare function createBreakpointsPlugin(options?: BreakpointsOptions): BreakpointsPlugin;
|
|
94
|
-
//#endregion
|
|
95
|
-
//#region src/composables/useRegistry/index.d.ts
|
|
96
|
-
interface RegistryTicket {
|
|
97
|
-
/** The unique identifier. Is randomly generated if not provided. */
|
|
98
|
-
id: ID;
|
|
99
|
-
/** The index of the ticket. It's not recommended to manually set this. */
|
|
100
|
-
index: number;
|
|
101
|
-
/** The value associated with the ticket. If not provided, it defaults to the index. */
|
|
102
|
-
value: unknown;
|
|
103
|
-
/** Whether the value is derived from index. It's not recommended to manually set this. */
|
|
104
|
-
valueIsIndex: boolean;
|
|
105
|
-
}
|
|
106
|
-
interface RegistryContext<Z extends RegistryTicket = RegistryTicket> {
|
|
107
|
-
/** The collection of tickets */
|
|
108
|
-
collection: Map<ID, Z>;
|
|
109
|
-
/** Clear the entire registry */
|
|
110
|
-
clear: () => void;
|
|
111
|
-
/** Check if an item exists by id */
|
|
112
|
-
has: (id: ID) => boolean;
|
|
113
|
-
/** Returns an array of registered IDs */
|
|
114
|
-
keys: () => ID[];
|
|
115
|
-
/** Browse for an ID by value */
|
|
116
|
-
browse: (value: unknown) => ID | ID[] | undefined;
|
|
117
|
-
/** lookup a ticket by index number */
|
|
118
|
-
lookup: (index: number) => ID | undefined;
|
|
119
|
-
/** Get a ticket by id */
|
|
120
|
-
get: (id: ID) => Z | undefined;
|
|
121
|
-
/** Get all registered tickets */
|
|
122
|
-
values: () => Z[];
|
|
123
|
-
/** Get all entries as [id, ticket] pairs */
|
|
124
|
-
entries: () => [ID, Z][];
|
|
125
|
-
/** Register a new item */
|
|
126
|
-
register: (item?: Partial<Z>) => Z;
|
|
127
|
-
/** Unregister an item by id */
|
|
128
|
-
unregister: (id: ID) => void;
|
|
129
|
-
/** Reset the index directory and update all tickets */
|
|
130
|
-
reindex: () => void;
|
|
131
|
-
/** Listen for registry events */
|
|
132
|
-
on: (event: string, cb: Function) => void;
|
|
133
|
-
/** Stop listening for registry events */
|
|
134
|
-
off: (event: string, cb: Function) => void;
|
|
135
|
-
/** Emit an event with data */
|
|
136
|
-
emit: (event: string, data: any) => void;
|
|
137
|
-
/** Clears the registry and listeners */
|
|
138
|
-
dispose: () => void;
|
|
139
|
-
/** Onboard multiple new items */
|
|
140
|
-
onboard: (registrations: Partial<Z>[]) => Z[];
|
|
141
|
-
/** The size of the registry */
|
|
142
|
-
size: number;
|
|
143
|
-
}
|
|
144
|
-
interface RegistryOptions {
|
|
145
|
-
/** Enable event emission for registry operations */
|
|
146
|
-
events?: boolean;
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Creates a registry for managing collections of items with registration and lookup capabilities.
|
|
150
|
-
* This function provides the foundation for item management systems with ID-based, value-based,
|
|
151
|
-
* and index-based access patterns.
|
|
152
|
-
*
|
|
153
|
-
* @param options Optional configuration for enabling events.
|
|
154
|
-
* @template Z The type of items managed by the registry.
|
|
155
|
-
* @template E The type of the registry context.
|
|
156
|
-
* @returns The registry context object.
|
|
157
|
-
*/
|
|
158
|
-
declare function useRegistry<Z extends RegistryTicket = RegistryTicket, E extends RegistryContext<Z> = RegistryContext<Z>>(options?: RegistryOptions): E;
|
|
159
|
-
//#endregion
|
|
160
|
-
//#region src/composables/useSelection/index.d.ts
|
|
161
|
-
interface SelectionTicket extends RegistryTicket {
|
|
162
|
-
disabled: boolean;
|
|
163
|
-
isActive: Readonly<Ref<boolean, boolean>>;
|
|
164
|
-
/** Select self */
|
|
165
|
-
select: () => void;
|
|
166
|
-
/** Unselect self */
|
|
167
|
-
unselect: () => void;
|
|
168
|
-
/** Toggle self on and off */
|
|
169
|
-
toggle: () => void;
|
|
170
|
-
}
|
|
171
|
-
interface SelectionContext<Z extends SelectionTicket> extends RegistryContext<Z> {
|
|
172
|
-
selectedIds: Reactive<Set<ID>>;
|
|
173
|
-
selectedItems: ComputedRef<Set<Z>>;
|
|
174
|
-
selectedValues: ComputedRef<Set<unknown>>;
|
|
175
|
-
/** Clear all selected IDs and reindexes */
|
|
176
|
-
reset: () => void;
|
|
177
|
-
/** Select a ticket by ID (Toggle ON) */
|
|
178
|
-
select: (id: ID) => void;
|
|
179
|
-
/** Unselect a ticket by ID (Toggle OFF) */
|
|
180
|
-
unselect: (id: ID) => void;
|
|
181
|
-
/** Toggles a ticket ON and OFF by ID */
|
|
182
|
-
toggle: (id: ID) => void;
|
|
183
|
-
/** Mandates selected ID based on "mandatory" Option */
|
|
184
|
-
mandate: () => void;
|
|
185
|
-
}
|
|
186
|
-
interface SelectionOptions extends RegistryOptions {
|
|
187
|
-
/** When true, newly registered items are automatically selected if not disabled */
|
|
188
|
-
enroll?: boolean;
|
|
189
|
-
mandatory?: boolean | 'force';
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* Creates a selection context for managing collections of selectable items.
|
|
193
|
-
* This function extends the registry functionality with selection state management.
|
|
194
|
-
*
|
|
195
|
-
* @param options Optional configuration for selection behavior.
|
|
196
|
-
* @template Z The type of items managed by the selection.
|
|
197
|
-
* @template E The type of the selection context.
|
|
198
|
-
* @returns The selection context object.
|
|
199
|
-
*/
|
|
200
|
-
declare function useSelection<Z extends SelectionTicket = SelectionTicket, E extends SelectionContext<Z> = SelectionContext<Z>>(options?: SelectionOptions): E;
|
|
201
|
-
//#endregion
|
|
202
|
-
//#region src/composables/useGroup/index.d.ts
|
|
203
|
-
interface GroupTicket extends SelectionTicket {}
|
|
204
|
-
interface GroupContext<Z extends GroupTicket> extends SelectionContext<Z> {
|
|
205
|
-
selectedIndexes: ComputedRef<Set<number>>;
|
|
206
|
-
/** Select one or more Tickets by ID */
|
|
207
|
-
select: (ids: ID | ID[]) => void;
|
|
208
|
-
/** Unselect one or more Tickets by ID */
|
|
209
|
-
unselect: (ids: ID | ID[]) => void;
|
|
210
|
-
/** Toggle one or more Tickets ON and OFF by ID */
|
|
211
|
-
toggle: (ids: ID | ID[]) => void;
|
|
212
|
-
}
|
|
213
|
-
interface GroupOptions extends SelectionOptions {}
|
|
214
|
-
/**
|
|
215
|
-
* Creates a group selection context for managing collections of items where multiple selections can be made.
|
|
216
|
-
* This function extends the selection functionality with group selection capabilities.
|
|
217
|
-
*
|
|
218
|
-
* @param options Optional configuration for group selection behavior.
|
|
219
|
-
* @template Z The type of items managed by the group selection.
|
|
220
|
-
* @template E The type of the group selection context.
|
|
221
|
-
* @returns The group selection context object.
|
|
222
|
-
*/
|
|
223
|
-
declare function useGroup<Z extends GroupTicket = GroupTicket, E extends GroupContext<Z> = GroupContext<Z>>(options?: GroupOptions): E;
|
|
224
|
-
//#endregion
|
|
225
|
-
//#region src/composables/useHydration/index.d.ts
|
|
226
|
-
interface HydrationContext {
|
|
227
|
-
isHydrated: Readonly<ShallowRef<boolean>>;
|
|
228
|
-
hydrate: () => void;
|
|
229
|
-
}
|
|
230
|
-
interface HydrationPlugin {
|
|
231
|
-
install: (app: App, ...options: any[]) => any;
|
|
232
|
-
}
|
|
233
|
-
declare const useHydrationContext: (namespace?: string) => HydrationContext, provideHydrationContext: (context: HydrationContext, app?: App) => HydrationContext;
|
|
234
|
-
/**
|
|
235
|
-
* Creates a hydration context for tracking client-side hydration state in SSR applications.
|
|
236
|
-
* This function provides a way to determine when the application has been fully hydrated
|
|
237
|
-
* on the client side, which is essential for SSR/SSG compatibility.
|
|
238
|
-
*
|
|
239
|
-
* @returns A hydration context object with reactive state and hydration control.
|
|
240
|
-
*/
|
|
241
|
-
declare function createHydration(): HydrationContext;
|
|
242
|
-
/**
|
|
243
|
-
* Simple hook to access the hydration context.
|
|
244
|
-
*
|
|
245
|
-
* @returns The hydration context containing hydration state and controls.
|
|
246
|
-
*/
|
|
247
|
-
declare function useHydration(): HydrationContext;
|
|
248
|
-
/**
|
|
249
|
-
* Creates a Vue plugin for hydration state management in SSR/SSG applications.
|
|
250
|
-
* This plugin automatically detects when the root component is mounted and
|
|
251
|
-
* triggers the hydration process, ensuring proper client-side hydration timing.
|
|
252
|
-
*
|
|
253
|
-
* @returns A Vue plugin object with install method.
|
|
254
|
-
*/
|
|
255
|
-
declare function createHydrationPlugin(): HydrationPlugin;
|
|
256
|
-
//#endregion
|
|
257
|
-
//#region src/composables/useSingle/index.d.ts
|
|
258
|
-
interface SingleTicket extends SelectionTicket {}
|
|
259
|
-
interface SingleContext<Z extends SingleTicket> extends SelectionContext<Z> {
|
|
260
|
-
selectedId: ComputedRef<ID | undefined>;
|
|
261
|
-
selectedIndex: ComputedRef<number>;
|
|
262
|
-
selectedItem: ComputedRef<Z | undefined>;
|
|
263
|
-
selectedValue: ComputedRef<unknown>;
|
|
264
|
-
}
|
|
265
|
-
interface SingleOptions extends SelectionOptions {}
|
|
266
|
-
/**
|
|
267
|
-
* Creates a single selection context for managing collections where only one item can be selected.
|
|
268
|
-
* This function extends the selection functionality with single-selection constraints.
|
|
269
|
-
*
|
|
270
|
-
* @param options Optional configuration for single selection behavior.
|
|
271
|
-
* @template Z The type of items managed by the single selection.
|
|
272
|
-
* @template E The type of the single selection context.
|
|
273
|
-
* @returns The single selection context object.
|
|
274
|
-
*/
|
|
275
|
-
declare function useSingle<Z extends SingleTicket = SingleTicket, E extends SingleContext<Z> = SingleContext<Z>>(options?: SingleOptions): E;
|
|
276
|
-
//#endregion
|
|
277
|
-
//#region src/composables/useStep/index.d.ts
|
|
278
|
-
interface StepTicket extends SingleTicket {}
|
|
279
|
-
interface StepContext<Z extends StepTicket> extends SingleContext<Z> {
|
|
280
|
-
/** Select the first Ticket in the collection */
|
|
281
|
-
first: () => void;
|
|
282
|
-
/** Select the last Ticket in the collection */
|
|
283
|
-
last: () => void;
|
|
284
|
-
/** Select the next Ticket based on current index */
|
|
285
|
-
next: () => void;
|
|
286
|
-
/** Select the previous Ticket based on current index */
|
|
287
|
-
prev: () => void;
|
|
288
|
-
/** Step through the collection by a given count */
|
|
289
|
-
step: (count: number) => void;
|
|
290
|
-
}
|
|
291
|
-
interface StepOptions extends SingleOptions {}
|
|
292
|
-
/**
|
|
293
|
-
* Creates a step selection context for managing collections where users can navigate through items sequentially.
|
|
294
|
-
* This function extends the single selection functionality with stepping navigation.
|
|
295
|
-
*
|
|
296
|
-
* @param options Optional configuration for step behavior.
|
|
297
|
-
* @template Z The type of items managed by the step selection.
|
|
298
|
-
* @template E The type of the step selection context.
|
|
299
|
-
* @returns The step selection context object.
|
|
300
|
-
*/
|
|
301
|
-
declare function useStep<Z extends StepTicket = StepTicket, E extends StepContext<Z> = StepContext<Z>>(options?: StepOptions): E;
|
|
302
|
-
//#endregion
|
|
303
|
-
//#region src/composables/useTheme/adapters/adapter.d.ts
|
|
304
|
-
interface ThemeAdapterInterface {
|
|
305
|
-
update: (colors: Record<string, Colors>) => void;
|
|
306
|
-
}
|
|
307
|
-
declare abstract class ThemeAdapter implements ThemeAdapterInterface {
|
|
308
|
-
protected prefix: string;
|
|
309
|
-
constructor(prefix: string);
|
|
310
|
-
generate(colors: Record<string, Colors>): string;
|
|
311
|
-
abstract update(colors: Record<string, Colors>): void;
|
|
312
|
-
}
|
|
313
|
-
//#endregion
|
|
314
|
-
//#region src/composables/useTokens/index.d.ts
|
|
315
|
-
interface TokenAlias<T = unknown> {
|
|
316
|
-
[key: string]: unknown;
|
|
317
|
-
$value: T;
|
|
318
|
-
$type?: string;
|
|
319
|
-
$description?: string;
|
|
320
|
-
$extensions?: Record<string, unknown>;
|
|
321
|
-
$deprecated?: boolean | string;
|
|
322
|
-
}
|
|
323
|
-
type TokenPrimitive = string | number | boolean;
|
|
324
|
-
type TokenValue = TokenPrimitive | TokenAlias;
|
|
325
|
-
interface TokenCollection {
|
|
326
|
-
[key: string]: TokenValue | TokenCollection;
|
|
327
|
-
}
|
|
328
|
-
type FlatTokenCollection = {
|
|
329
|
-
id: string;
|
|
330
|
-
value: TokenValue;
|
|
331
|
-
};
|
|
332
|
-
interface TokenTicket extends RegistryTicket {}
|
|
333
|
-
interface TokenContext<Z extends TokenTicket> extends RegistryContext<Z> {
|
|
334
|
-
resolve: (token: string | TokenAlias) => unknown | undefined;
|
|
335
|
-
}
|
|
336
|
-
/**
|
|
337
|
-
* Creates a token registry for managing design token collections with alias resolution.
|
|
338
|
-
* Returns the token context directly for simple usage.
|
|
339
|
-
*
|
|
340
|
-
* @param tokens A collection of tokens to initialize with
|
|
341
|
-
* @template Z The structure of the registry token items.
|
|
342
|
-
* @template E The available methods for the token's context.
|
|
343
|
-
* @returns The token context object.
|
|
344
|
-
* @see https://www.designtokens.org/tr/drafts/format/
|
|
345
|
-
*/
|
|
346
|
-
declare function useTokens<Z extends TokenTicket = TokenTicket, E extends TokenContext<Z> = TokenContext<Z>>(tokens?: TokenCollection): E;
|
|
347
|
-
/**
|
|
348
|
-
* Creates a token registry context with full injection/provision control.
|
|
349
|
-
* Returns the complete trinity for advanced usage scenarios.
|
|
350
|
-
*
|
|
351
|
-
* @param namespace The namespace for the token registry context
|
|
352
|
-
* @param tokens An optional collection of tokens to initialize
|
|
353
|
-
* @template Z The structure of the registry token items.
|
|
354
|
-
* @template E The available methods for the token's context.
|
|
355
|
-
* @returns A tuple containing the inject function, provide function, and the token context.
|
|
356
|
-
*/
|
|
357
|
-
declare function createTokensContext<Z extends TokenTicket = TokenTicket, E extends TokenContext<Z> = TokenContext<Z>>(namespace: string, tokens?: TokenCollection): ContextTrinity<E>;
|
|
358
|
-
//#endregion
|
|
359
|
-
//#region src/composables/useTheme/index.d.ts
|
|
360
|
-
type Colors = {
|
|
361
|
-
[key: string]: string;
|
|
362
|
-
};
|
|
363
|
-
type ThemeColors = {
|
|
364
|
-
[key: string]: Colors | string;
|
|
365
|
-
};
|
|
366
|
-
type ThemeRecord = {
|
|
367
|
-
[key: string]: any;
|
|
368
|
-
dark?: boolean;
|
|
369
|
-
lazy?: boolean;
|
|
370
|
-
colors: ThemeColors;
|
|
371
|
-
};
|
|
372
|
-
type ThemeTicket = SingleTicket & {
|
|
373
|
-
lazy: boolean;
|
|
374
|
-
dark: boolean;
|
|
375
|
-
};
|
|
376
|
-
interface ThemeContext<Z extends ThemeTicket> extends SingleContext<Z> {
|
|
377
|
-
colors: ComputedRef<Record<string, Colors>>;
|
|
378
|
-
cycle: (themes: ID[]) => void;
|
|
379
|
-
}
|
|
380
|
-
interface ThemeOptions extends ThemePluginOptions {}
|
|
381
|
-
interface ThemePluginOptions<Z extends ThemeRecord = ThemeRecord> {
|
|
382
|
-
adapter?: ThemeAdapter;
|
|
383
|
-
default?: ID;
|
|
384
|
-
palette?: TokenCollection;
|
|
385
|
-
themes?: Record<ID, Z>;
|
|
386
|
-
}
|
|
387
|
-
interface ThemePlugin {
|
|
388
|
-
install: (app: App, ...options: any[]) => any;
|
|
389
|
-
}
|
|
390
|
-
/**
|
|
391
|
-
* Creates a theme registry for managing theme selections with dynamic color resolution.
|
|
392
|
-
* Supports token-based color systems and lazy theme loading for optimal performance.
|
|
393
|
-
*
|
|
394
|
-
* @param namespace The namespace for the theme context.
|
|
395
|
-
* @param options Configuration including adapter and themes.
|
|
396
|
-
* @template Z The type of theme context.
|
|
397
|
-
* @template E The type of theme items managed by the registry.
|
|
398
|
-
* @returns A tuple containing inject, provide functions and the theme context.
|
|
399
|
-
*/
|
|
400
|
-
declare function createTheme<Z extends ThemeTicket = ThemeTicket, E extends ThemeContext<Z> = ThemeContext<Z>>(namespace?: string, options?: ThemeOptions): ContextTrinity<E>;
|
|
401
|
-
/**
|
|
402
|
-
* Simple hook to access the theme context.
|
|
403
|
-
*
|
|
404
|
-
* @returns The theme context containing current theme state and utilities.
|
|
405
|
-
*/
|
|
406
|
-
declare function useTheme(): ThemeContext<ThemeTicket>;
|
|
407
|
-
/**
|
|
408
|
-
* Creates a Vue plugin for theme management with automatic color system updates.
|
|
409
|
-
* Integrates with token system for dynamic color resolution and provides reactive
|
|
410
|
-
* theme switching capabilities throughout the application.
|
|
411
|
-
*
|
|
412
|
-
* @param options Configuration for themes, palette, and adapter.
|
|
413
|
-
* @template Z The type of theme context.
|
|
414
|
-
* @template E The type of theme items.
|
|
415
|
-
* @template R The type of token context.
|
|
416
|
-
* @template O The type of token items.
|
|
417
|
-
* @returns A Vue plugin object with install method.
|
|
418
|
-
*/
|
|
419
|
-
declare function createThemePlugin<Z extends ThemeTicket = ThemeTicket, E extends ThemeContext<Z> = ThemeContext<Z>, R extends TokenTicket = TokenTicket, O extends TokenContext<R> = TokenContext<R>>(_options?: ThemePluginOptions): ThemePlugin;
|
|
420
|
-
//#endregion
|
|
421
|
-
export { BreakpointName, BreakpointsContext, BreakpointsOptions, BreakpointsPlugin, Colors, FlatTokenCollection, GroupContext, GroupOptions, GroupTicket, HydrationContext, HydrationPlugin, RegistryContext, RegistryOptions, RegistryTicket, SelectionContext, SelectionOptions, SelectionTicket, SingleContext, SingleOptions, SingleTicket, StepContext, StepOptions, StepTicket, ThemeColors, ThemeContext, ThemeOptions, ThemePlugin, ThemePluginOptions, ThemeRecord, ThemeTicket, TokenAlias, TokenCollection, TokenContext, TokenPrimitive, TokenTicket, TokenValue, createBreakpoints, createBreakpointsPlugin, createHydration, createHydrationPlugin, createTheme, createThemePlugin, createTokensContext, provideBreakpointsContext, provideHydrationContext, useBreakpoints, useBreakpointsContext, useGroup, useHydration, useHydrationContext, useRegistry, useSelection, useSingle, useStep, useTheme, useTokens };
|