@vuecs/navigation 2.4.1 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/LICENSE +201 -21
  2. package/README.md +10 -167
  3. package/dist/components/index.d.ts +2 -0
  4. package/dist/components/index.d.ts.map +1 -1
  5. package/dist/components/item/module.d.ts +48 -4
  6. package/dist/components/item/module.d.ts.map +1 -1
  7. package/dist/components/items/index.d.ts +1 -0
  8. package/dist/components/items/index.d.ts.map +1 -1
  9. package/dist/components/items/module.d.ts +45 -2
  10. package/dist/components/items/module.d.ts.map +1 -1
  11. package/dist/components/items/theme.d.ts +10 -0
  12. package/dist/components/items/theme.d.ts.map +1 -0
  13. package/dist/components/stepper/Stepper.vue.d.ts +129 -0
  14. package/dist/components/stepper/Stepper.vue.d.ts.map +1 -0
  15. package/dist/components/stepper/StepperDescription.vue.d.ts +79 -0
  16. package/dist/components/stepper/StepperDescription.vue.d.ts.map +1 -0
  17. package/dist/components/stepper/StepperIndicator.vue.d.ts +79 -0
  18. package/dist/components/stepper/StepperIndicator.vue.d.ts.map +1 -0
  19. package/dist/components/stepper/StepperItem.vue.d.ts +99 -0
  20. package/dist/components/stepper/StepperItem.vue.d.ts.map +1 -0
  21. package/dist/components/stepper/StepperSeparator.vue.d.ts +79 -0
  22. package/dist/components/stepper/StepperSeparator.vue.d.ts.map +1 -0
  23. package/dist/components/stepper/StepperTitle.vue.d.ts +79 -0
  24. package/dist/components/stepper/StepperTitle.vue.d.ts.map +1 -0
  25. package/dist/components/stepper/StepperTrigger.vue.d.ts +79 -0
  26. package/dist/components/stepper/StepperTrigger.vue.d.ts.map +1 -0
  27. package/dist/components/stepper/context.d.ts +19 -0
  28. package/dist/components/stepper/context.d.ts.map +1 -0
  29. package/dist/components/stepper/index.d.ts +19 -0
  30. package/dist/components/stepper/index.d.ts.map +1 -0
  31. package/dist/components/stepper/theme.d.ts +4 -0
  32. package/dist/components/stepper/theme.d.ts.map +1 -0
  33. package/dist/components/stepper/types.d.ts +23 -0
  34. package/dist/components/stepper/types.d.ts.map +1 -0
  35. package/dist/components/type.d.ts +22 -0
  36. package/dist/components/type.d.ts.map +1 -0
  37. package/dist/helpers/component/index.d.ts +0 -1
  38. package/dist/helpers/component/index.d.ts.map +1 -1
  39. package/dist/helpers/component/types.d.ts +15 -15
  40. package/dist/helpers/component/types.d.ts.map +1 -1
  41. package/dist/helpers/match.d.ts.map +1 -1
  42. package/dist/helpers/reset.d.ts.map +1 -1
  43. package/dist/index.d.ts +1 -1
  44. package/dist/index.d.ts.map +1 -1
  45. package/dist/index.mjs +818 -566
  46. package/dist/index.mjs.map +1 -1
  47. package/dist/manager/module.d.ts.map +1 -1
  48. package/dist/style.css +100 -0
  49. package/dist/types.d.ts +8 -4
  50. package/dist/types.d.ts.map +1 -1
  51. package/dist/vue.d.ts +8 -1
  52. package/dist/vue.d.ts.map +1 -1
  53. package/package.json +24 -27
  54. package/core/index.cjs +0 -1
  55. package/core/index.d.ts +0 -2
  56. package/core/index.mjs +0 -1
  57. package/core/package.json +0 -5
  58. package/dist/helpers/component/build.d.ts +0 -3
  59. package/dist/helpers/component/build.d.ts.map +0 -1
  60. package/dist/index.cjs +0 -617
  61. package/dist/index.cjs.map +0 -1
  62. package/dist/index.css +0 -82
package/dist/index.mjs CHANGED
@@ -1,606 +1,858 @@
1
- import { createComponentOptionsManager, mergeOption, inject, provide, hasNormalizedSlot, normalizeSlot, installStoreManager, applyStoreManagerOptions } from '@vuecs/core';
2
- import { EventEmitter } from '@posva/event-emitter';
3
- import { VCLink } from '@vuecs/link';
4
- import { defineComponent, resolveComponent, toRef, computed, h, ref, onMounted, onUnmounted } from 'vue';
5
-
6
- function buildComponentOptions() {
7
- const manager = createComponentOptionsManager({
8
- name: 'navigation'
9
- });
10
- return {
11
- groupClass: mergeOption('class', manager.get('groupClass'), 'vc-nav-items'),
12
- groupTag: manager.get('groupTag') || 'ul',
13
- itemClass: mergeOption('class', manager.get('itemClass'), 'vc-nav-item'),
14
- itemNestedClass: mergeOption('class', manager.get('itemNestedClass'), 'vc-nav-item-nested'),
15
- itemTag: manager.get('itemTag') || 'li',
16
- separatorTag: manager.get('separatorTag') || 'div',
17
- separatorClass: mergeOption('class', manager.get('linkIconClass'), 'vc-nav-separator'),
18
- linkIconTag: manager.get('linkIconTag') || 'div',
19
- linkIconClass: mergeOption('class', manager.get('linkIconClass'), 'vc-nav-link-icon'),
20
- linkClass: mergeOption('class', manager.get('linkClass'), 'vc-nav-link'),
21
- linkRootClass: mergeOption('class', manager.get('linkRootClass'), 'vc-nav-link-root'),
22
- linkTextTag: manager.get('linkTextTag') || 'div',
23
- linkTextClass: mergeOption('class', manager.get('linkTextClass'), 'vc-nav-link-text')
24
- };
25
- }
26
-
1
+ import { hasNormalizedSlot, inject, installDefaultsManager, installThemeManager, normalizeSlot, provide, useArrowNavigation, useComponentTheme } from "@vuecs/core";
2
+ import { EventEmitter } from "@posva/event-emitter";
3
+ import { VCLink } from "@vuecs/link";
4
+ import { computed, defineComponent, h, inject as inject$1, mergeProps, onMounted, onUnmounted, provide as provide$1, ref, resolveComponent, toRef } from "vue";
5
+ import { StepperDescription, StepperIndicator, StepperItem, StepperRoot, StepperSeparator, StepperTitle, StepperTrigger } from "reka-ui";
6
+ //#region src/helpers/match.ts
27
7
  function calculateItemScoreForPath(item, currentPath) {
28
- if (item.url === '/') {
29
- return 1;
30
- }
31
- if (item.activeMatch) {
32
- if (item.activeMatch === currentPath) {
33
- return 6;
34
- }
35
- if (currentPath.startsWith(item.activeMatch)) {
36
- return 4;
37
- }
38
- }
39
- if (item.url) {
40
- if (item.url === currentPath) {
41
- return 3;
42
- }
43
- if (currentPath.startsWith(item.url)) {
44
- return 2;
45
- }
46
- }
47
- return 0;
8
+ if (item.url === "/") return 1;
9
+ if (item.activeMatch) {
10
+ if (item.activeMatch === currentPath) return 6;
11
+ if (currentPath.startsWith(item.activeMatch)) return 4;
12
+ }
13
+ if (item.url) {
14
+ if (item.url === currentPath) return 3;
15
+ if (currentPath.startsWith(item.url)) return 2;
16
+ }
17
+ return 0;
48
18
  }
49
19
  function findItemMatchesIF(items, options, parent) {
50
- const output = [];
51
- for(let i = 0; i < items.length; i++){
52
- const item = items[i];
53
- let { score } = parent;
54
- if (options.path) {
55
- score += calculateItemScoreForPath(item, options.path);
56
- }
57
- if (item.default) {
58
- score += 1;
59
- }
60
- if (item.children) {
61
- const childMatches = findItemMatchesIF(item.children, options, {
62
- score
63
- });
64
- output.push(...childMatches);
65
- }
66
- output.push({
67
- data: item,
68
- score
69
- });
70
- }
71
- return output.sort((a, b)=>b.score - a.score);
20
+ const output = [];
21
+ for (const item of items) {
22
+ let { score } = parent;
23
+ if (options.path) score += calculateItemScoreForPath(item, options.path);
24
+ if (item.default) score += 1;
25
+ if (item.children) {
26
+ const childMatches = findItemMatchesIF(item.children, options, { score });
27
+ output.push(...childMatches);
28
+ }
29
+ output.push({
30
+ data: item,
31
+ score
32
+ });
33
+ }
34
+ return output.sort((a, b) => b.score - a.score);
72
35
  }
73
36
  function findBestItemMatches(items, options = {}) {
74
- const result = findItemMatchesIF(items, options, {
75
- score: 0
76
- });
77
- const [first] = result;
78
- if (!first) {
79
- return [];
80
- }
81
- return result.filter((match)=>match.score === first.score).map((match)=>match.data);
37
+ const result = findItemMatchesIF(items, options, { score: 0 });
38
+ const [first] = result;
39
+ if (!first) return [];
40
+ return result.filter((match) => match.score === first.score).map((match) => match.data);
82
41
  }
83
-
84
- /*
85
- * Copyright (c) 2024.
86
- * Author Peter Placzek (tada5hi)
87
- * For the full copyright and license information,
88
- * view the LICENSE file that was distributed with this source code.
89
- */ function normalizeItemIF(item, defaults, trace) {
90
- const output = {
91
- ...item,
92
- level: defaults.level,
93
- children: [],
94
- trace: [
95
- ...trace,
96
- item.name
97
- ],
98
- meta: item.meta || {}
99
- };
100
- if (!item.children) {
101
- return output;
102
- }
103
- for(let i = 0; i < item.children.length; i++){
104
- output.children.push(normalizeItemIF(item.children[i], defaults, output.trace));
105
- }
106
- return output;
42
+ //#endregion
43
+ //#region src/helpers/normalize.ts
44
+ function normalizeItemIF(item, defaults, trace) {
45
+ const output = {
46
+ ...item,
47
+ level: defaults.level,
48
+ children: [],
49
+ trace: [...trace, item.name],
50
+ meta: item.meta || {}
51
+ };
52
+ if (!item.children) return output;
53
+ for (let i = 0; i < item.children.length; i++) output.children.push(normalizeItemIF(item.children[i], defaults, output.trace));
54
+ return output;
107
55
  }
108
56
  function normalizeItem(item, defaults) {
109
- return normalizeItemIF(item, defaults, []);
57
+ return normalizeItemIF(item, defaults, []);
110
58
  }
111
59
  function normalizeItems(items, options) {
112
- return items.map((item)=>normalizeItem(item, options));
60
+ return items.map((item) => normalizeItem(item, options));
113
61
  }
114
-
115
- /*
116
- * Copyright (c) 2024.
117
- * Author Peter Placzek (tada5hi)
118
- * For the full copyright and license information,
119
- * view the LICENSE file that was distributed with this source code.
120
- */ function isTraceEqual(a, b) {
121
- if (a.length !== b.length) {
122
- return false;
123
- }
124
- for(let i = 0; i < a.length; i++){
125
- if (a[i] !== b[i]) {
126
- return false;
127
- }
128
- }
129
- return true;
62
+ //#endregion
63
+ //#region src/helpers/trace.ts
64
+ function isTraceEqual(a, b) {
65
+ if (a.length !== b.length) return false;
66
+ for (const [i, element] of a.entries()) if (element !== b[i]) return false;
67
+ return true;
130
68
  }
131
69
  function isTracePartOf(item, parent) {
132
- for(let i = 0; i < item.length; i++){
133
- if (parent[i] !== item[i]) {
134
- return false;
135
- }
136
- }
137
- return true;
70
+ for (const [i, element] of item.entries()) if (parent[i] !== element) return false;
71
+ return true;
138
72
  }
139
-
73
+ //#endregion
74
+ //#region src/helpers/reset.ts
140
75
  function resetItemsByTraceIF(items, trace) {
141
- for(let i = 0; i < items.length; i++){
142
- const item = items[i];
143
- const isEqual = isTraceEqual(items[i].trace, trace);
144
- item.active = isEqual;
145
- item.display = true;
146
- if (isEqual) {
147
- item.displayChildren = true;
148
- } else {
149
- item.displayChildren = isTracePartOf(item.trace, trace);
150
- }
151
- item.children = resetItemsByTraceIF(item.children, trace);
152
- }
153
- return items;
76
+ for (const item of items) {
77
+ const isEqual = isTraceEqual(item.trace, trace);
78
+ item.active = isEqual;
79
+ item.display = true;
80
+ if (isEqual) item.displayChildren = true;
81
+ else item.displayChildren = isTracePartOf(item.trace, trace);
82
+ item.children = resetItemsByTraceIF(item.children, trace);
83
+ }
84
+ return items;
154
85
  }
155
86
  function resetItemsByTrace(items, trace) {
156
- return resetItemsByTraceIF(items, trace);
87
+ return resetItemsByTraceIF(items, trace);
157
88
  }
158
-
89
+ //#endregion
90
+ //#region src/helpers/level.ts
159
91
  function findItemsWithLevel(items, tier) {
160
- return items.filter((item)=>item.level === tier);
92
+ return items.filter((item) => item.level === tier);
161
93
  }
162
94
  function findItemWithLevel(tier, items) {
163
- const data = findItemsWithLevel(items, tier);
164
- if (data.length >= 1) {
165
- return data[0];
166
- }
167
- return undefined;
95
+ const data = findItemsWithLevel(items, tier);
96
+ if (data.length >= 1) return data[0];
168
97
  }
169
98
  function removeItemsWithLevel(tier, items) {
170
- return items.filter((item)=>item.level !== tier);
99
+ return items.filter((item) => item.level !== tier);
171
100
  }
172
101
  function replaceLevelItem(tier, input, next) {
173
- const output = removeItemsWithLevel(tier, input);
174
- if (next) {
175
- next.level = tier;
176
- return [
177
- ...output,
178
- next
179
- ];
180
- }
181
- return output;
102
+ const output = removeItemsWithLevel(tier, input);
103
+ if (next) {
104
+ next.level = tier;
105
+ return [...output, next];
106
+ }
107
+ return output;
182
108
  }
183
109
  function replaceLevelItems(tier, src, next) {
184
- const componentsExisting = removeItemsWithLevel(tier, src);
185
- return [
186
- ...componentsExisting,
187
- ...next
188
- ];
110
+ return [...removeItemsWithLevel(tier, src), ...next];
189
111
  }
190
-
112
+ //#endregion
113
+ //#region src/helpers/url.ts
191
114
  function isAbsoluteURL(str) {
192
- return str.substring(0, 7) === 'http://' || str.substring(0, 8) === 'https://';
193
- }
194
-
195
- class NavigationManager extends EventEmitter {
196
- getItems(tier) {
197
- if (typeof tier === 'undefined') {
198
- return this.items;
199
- }
200
- return this.items.filter((item)=>item.level === tier);
201
- }
202
- reset() {
203
- this.built = false;
204
- this.items = [];
205
- this.itemsActive = [];
206
- }
207
- async build(options) {
208
- if (this.built || this.building) {
209
- return;
210
- }
211
- this.building = true;
212
- this.emit('building');
213
- let parent;
214
- let level = 0;
215
- while(true){
216
- const raw = await this.itemsFn({
217
- level,
218
- parent
219
- });
220
- if (!raw || raw.length === 0) {
221
- break;
222
- }
223
- const items = normalizeItems(raw, {
224
- level
225
- });
226
- const matches = findBestItemMatches(items, {
227
- path: options.path
228
- });
229
- const [match] = matches;
230
- if (!match) {
231
- break;
232
- }
233
- this.itemsActive.push(match);
234
- await this.buildLevel(level);
235
- parent = match;
236
- level++;
237
- }
238
- this.building = false;
239
- this.built = true;
240
- this.emit('built');
241
- this.emit('updated', this.items);
242
- }
243
- async select(level, itemNew) {
244
- const itemOld = findItemWithLevel(level, this.itemsActive);
245
- if (itemOld && isTraceEqual(itemOld.trace, itemNew.trace)) {
246
- return;
247
- }
248
- this.itemsActive = this.itemsActive.filter((el)=>el.level < level);
249
- this.itemsActive.push(itemNew);
250
- const startLevel = level;
251
- while(true){
252
- const built = await this.buildLevel(level, startLevel === level);
253
- if (!built) {
254
- break;
255
- }
256
- level++;
257
- }
258
- }
259
- async toggle(level, item) {
260
- let isMatch;
261
- if (item.displayChildren) {
262
- isMatch = true;
263
- } else {
264
- const itemOld = findItemWithLevel(level, this.itemsActive);
265
- isMatch = !!itemOld && isTraceEqual(item.trace, itemOld.trace);
266
- }
267
- if (isMatch) {
268
- this.itemsActive = removeItemsWithLevel(level, this.itemsActive);
269
- } else {
270
- this.itemsActive = replaceLevelItem(level, this.itemsActive, item);
271
- }
272
- await this.buildLevel(level, true);
273
- }
274
- async buildLevel(level, useCache) {
275
- let items;
276
- if (useCache) {
277
- items = findItemsWithLevel(this.items, level);
278
- } else {
279
- const parent = findItemWithLevel(level - 1, this.itemsActive);
280
- const raw = await this.itemsFn({
281
- level,
282
- parent
283
- });
284
- items = raw && raw.length > 0 ? normalizeItems(raw, {
285
- level
286
- }) : [];
287
- }
288
- if (!items || items.length === 0) {
289
- this.items = this.items.filter((item)=>item.level < level);
290
- this.emit('levelUpdated', level, []);
291
- return false;
292
- }
293
- let trace = [];
294
- const item = findItemWithLevel(level, this.itemsActive);
295
- if (item) {
296
- trace = item.trace;
297
- }
298
- resetItemsByTrace(items, trace);
299
- this.items = replaceLevelItems(level, this.items, items);
300
- this.emit('levelUpdated', level, items);
301
- return true;
302
- }
303
- constructor(options){
304
- super();
305
- let itemsFn;
306
- if (typeof options.items === 'function') {
307
- itemsFn = options.items;
308
- } else {
309
- itemsFn = async ({ level })=>{
310
- if (level > 0) {
311
- return [];
312
- }
313
- return options.items;
314
- };
315
- }
316
- this.itemsFn = itemsFn;
317
- this.items = [];
318
- this.itemsActive = [];
319
- this.built = false;
320
- this.building = false;
321
- }
115
+ return str.substring(0, 7) === "http://" || str.substring(0, 8) === "https://";
322
116
  }
323
-
324
- const sym = Symbol.for('VCNavigationManager');
117
+ //#endregion
118
+ //#region src/manager/module.ts
119
+ var NavigationManager = class extends EventEmitter {
120
+ itemsActive;
121
+ items;
122
+ itemsFn;
123
+ built;
124
+ building;
125
+ constructor(options) {
126
+ super();
127
+ let itemsFn;
128
+ if (typeof options.items === "function") itemsFn = options.items;
129
+ else itemsFn = async ({ level }) => {
130
+ if (level > 0) return [];
131
+ return options.items;
132
+ };
133
+ this.itemsFn = itemsFn;
134
+ this.items = [];
135
+ this.itemsActive = [];
136
+ this.built = false;
137
+ this.building = false;
138
+ }
139
+ getItems(tier) {
140
+ if (typeof tier === "undefined") return this.items;
141
+ return this.items.filter((item) => item.level === tier);
142
+ }
143
+ reset() {
144
+ this.built = false;
145
+ this.items = [];
146
+ this.itemsActive = [];
147
+ }
148
+ async build(options) {
149
+ if (this.built || this.building) return;
150
+ this.building = true;
151
+ this.emit("building");
152
+ let parent;
153
+ let level = 0;
154
+ while (true) {
155
+ const raw = await this.itemsFn({
156
+ level,
157
+ parent
158
+ });
159
+ if (!raw || raw.length === 0) break;
160
+ const [match] = findBestItemMatches(normalizeItems(raw, { level }), { path: options.path });
161
+ if (!match) break;
162
+ this.itemsActive.push(match);
163
+ await this.buildLevel(level);
164
+ parent = match;
165
+ level++;
166
+ }
167
+ this.building = false;
168
+ this.built = true;
169
+ this.emit("built");
170
+ this.emit("updated", this.items);
171
+ }
172
+ async select(level, itemNew) {
173
+ const itemOld = findItemWithLevel(level, this.itemsActive);
174
+ if (itemOld && isTraceEqual(itemOld.trace, itemNew.trace)) return;
175
+ this.itemsActive = this.itemsActive.filter((el) => el.level < level);
176
+ this.itemsActive.push(itemNew);
177
+ const startLevel = level;
178
+ while (true) {
179
+ if (!await this.buildLevel(level, startLevel === level)) break;
180
+ level++;
181
+ }
182
+ }
183
+ async toggle(level, item) {
184
+ let isMatch;
185
+ if (item.displayChildren) isMatch = true;
186
+ else {
187
+ const itemOld = findItemWithLevel(level, this.itemsActive);
188
+ isMatch = !!itemOld && isTraceEqual(item.trace, itemOld.trace);
189
+ }
190
+ if (isMatch) this.itemsActive = removeItemsWithLevel(level, this.itemsActive);
191
+ else this.itemsActive = replaceLevelItem(level, this.itemsActive, item);
192
+ await this.buildLevel(level, true);
193
+ }
194
+ async buildLevel(level, useCache) {
195
+ let items;
196
+ if (useCache) items = findItemsWithLevel(this.items, level);
197
+ else {
198
+ const parent = findItemWithLevel(level - 1, this.itemsActive);
199
+ const raw = await this.itemsFn({
200
+ level,
201
+ parent
202
+ });
203
+ items = raw && raw.length > 0 ? normalizeItems(raw, { level }) : [];
204
+ }
205
+ if (!items || items.length === 0) {
206
+ this.items = this.items.filter((item) => item.level < level);
207
+ this.emit("levelUpdated", level, []);
208
+ return false;
209
+ }
210
+ let trace = [];
211
+ const item = findItemWithLevel(level, this.itemsActive);
212
+ if (item) trace = item.trace;
213
+ resetItemsByTrace(items, trace);
214
+ this.items = replaceLevelItems(level, this.items, items);
215
+ this.emit("levelUpdated", level, items);
216
+ return true;
217
+ }
218
+ };
219
+ //#endregion
220
+ //#region src/manager/singleton.ts
221
+ const sym = Symbol.for("VCNavigationManager");
325
222
  function injectNavigationManager(app) {
326
- const instance = inject(sym, app);
327
- if (!instance) {
328
- throw new Error('A navigation provider has not been provided.');
329
- }
330
- return instance;
223
+ const instance = inject(sym, app);
224
+ if (!instance) throw new Error("A navigation provider has not been provided.");
225
+ return instance;
331
226
  }
332
227
  function provideNavigationManager(manager, app) {
333
- provide(sym, manager, app);
228
+ provide(sym, manager, app);
334
229
  }
335
-
336
- var SlotName = /*#__PURE__*/ function(SlotName) {
337
- SlotName["ITEM"] = "item";
338
- SlotName["SEPARATOR"] = "separator";
339
- SlotName["LINK"] = "link";
340
- SlotName["SUB"] = "sub";
341
- SlotName["SUB_TITLE"] = "sub-title";
342
- SlotName["SUB_ITEMS"] = "sub-items";
343
- return SlotName;
344
- }({});
345
- var ElementType = /*#__PURE__*/ function(ElementType) {
346
- ElementType["LINK"] = "link";
347
- ElementType["SEPARATOR"] = "separator";
348
- return ElementType;
349
- }({});
350
-
230
+ //#endregion
231
+ //#region src/components/items/theme.ts
232
+ /**
233
+ * Default classes for the `navigation` theme entry. Shared between
234
+ * `<VCNavItems>` (the container) and `<VCNavItem>` (the per-row
235
+ * component) — both call `useComponentTheme('navigation', …)` with
236
+ * the same slot defaults, so the source of truth lives here.
237
+ */
238
+ const navigationThemeDefaults = { classes: {
239
+ group: "vc-nav-items",
240
+ item: "vc-nav-item",
241
+ itemNested: "vc-nav-item-nested",
242
+ separator: "vc-nav-separator",
243
+ link: "vc-nav-link",
244
+ linkRoot: "vc-nav-link-root",
245
+ linkIcon: "vc-nav-link-icon",
246
+ linkText: "vc-nav-link-text"
247
+ } };
351
248
  const VCNavItem = defineComponent({
352
- props: {
353
- data: {
354
- type: Object,
355
- required: true
356
- }
357
- },
358
- setup (props, { slots }) {
359
- const itemsNode = resolveComponent('VCNavItems');
360
- const options = buildComponentOptions();
361
- const manager = injectNavigationManager();
362
- const data = toRef(props, 'data');
363
- const hasChildren = computed(()=>data.value.children && data.value.children.length > 0);
364
- const select = async (value)=>{
365
- await manager.select(data.value.level, value);
366
- };
367
- const toggle = async (value)=>{
368
- await manager.toggle(data.value.level, value);
369
- };
370
- return ()=>{
371
- const buildItem = ()=>{
372
- // type: separator
373
- if (data.value.type === ElementType.SEPARATOR) {
374
- const hasSlot = hasNormalizedSlot(SlotName.SEPARATOR, slots);
375
- if (hasSlot) {
376
- return normalizeSlot(SlotName.SEPARATOR, {
377
- data: data.value
378
- }, slots);
379
- }
380
- return h(options.separatorTag, {
381
- class: options.separatorClass
382
- }, data.value.name);
383
- }
384
- // type: group
385
- if (!hasChildren.value) {
386
- const hasSlot = hasNormalizedSlot(SlotName.LINK, slots);
387
- if (hasSlot) {
388
- return normalizeSlot(SlotName.LINK, {
389
- data: data.value,
390
- select,
391
- isActive: data.value.active
392
- }, slots);
393
- }
394
- const linkProps = {
395
- active: data.value.active,
396
- disabled: false,
397
- prefetch: true
398
- };
399
- if (data.value.url) {
400
- if (isAbsoluteURL(data.value.url) || data.value.url.startsWith('#')) {
401
- linkProps.href = data.value.url;
402
- if (data.value.urlTarget) {
403
- linkProps.target = data.value.urlTarget;
404
- }
405
- } else {
406
- linkProps.to = data.value.url;
407
- }
408
- }
409
- return h(VCLink, {
410
- class: [
411
- options.linkClass
412
- ],
413
- ...linkProps,
414
- onClicked () {
415
- if (!data.value.url) {
416
- return select.call(null, data.value);
417
- }
418
- return undefined;
419
- },
420
- onClick () {
421
- return select.call(null, data.value);
422
- }
423
- }, {
424
- default: ()=>[
425
- ...data.value.icon ? [
426
- h(options.linkIconTag, {
427
- class: options.linkIconClass
428
- }, [
429
- h('i', {
430
- class: data.value.icon
431
- })
432
- ])
433
- ] : [],
434
- h(options.linkTextTag, {
435
- class: options.linkTextClass
436
- }, [
437
- data.value.name
438
- ])
439
- ]
440
- });
441
- }
442
- if (hasNormalizedSlot(SlotName.SUB, slots)) {
443
- return normalizeSlot(SlotName.SUB, {
444
- data: data.value,
445
- select,
446
- toggle
447
- }, slots);
448
- }
449
- let title;
450
- if (hasNormalizedSlot(SlotName.SUB_TITLE, slots)) {
451
- title = normalizeSlot(SlotName.SUB_TITLE, {
452
- data: data.value,
453
- select,
454
- toggle
455
- });
456
- } else {
457
- title = h('div', {
458
- class: options.linkClass,
459
- onClick ($event) {
460
- $event.preventDefault();
461
- return toggle(data.value);
462
- }
463
- }, [
464
- ...data.value.icon ? [
465
- h(options.linkIconTag, {
466
- class: options.linkIconClass
467
- }, [
468
- h('i', {
469
- class: data.value.icon
470
- })
471
- ])
472
- ] : [],
473
- h(options.linkTextTag, {
474
- class: options.linkTextClass
475
- }, [
476
- data.value.name
477
- ])
478
- ]);
479
- }
480
- if (!hasChildren.value) {
481
- return title;
482
- }
483
- let vNodes;
484
- if (hasNormalizedSlot(SlotName.SUB_ITEMS, slots)) {
485
- vNodes = normalizeSlot(SlotName.SUB_ITEMS, {
486
- data: data.value,
487
- select,
488
- toggle
489
- });
490
- } else {
491
- vNodes = h(itemsNode, {
492
- level: data.value.level,
493
- data: data.value.children
494
- });
495
- }
496
- return [
497
- title,
498
- vNodes
499
- ];
500
- };
501
- return h(options.itemTag, {
502
- class: [
503
- options.itemClass,
504
- ...hasChildren.value ? [
505
- options.itemNestedClass
506
- ] : [],
507
- {
508
- active: data.value.active || data.value.displayChildren
509
- }
510
- ]
511
- }, [
512
- buildItem()
513
- ]);
514
- };
515
- }
249
+ name: "VCNavItem",
250
+ props: {
251
+ data: {
252
+ type: Object,
253
+ required: true
254
+ },
255
+ themeClass: {
256
+ type: Object,
257
+ default: void 0
258
+ },
259
+ themeVariant: {
260
+ type: Object,
261
+ default: void 0
262
+ }
263
+ },
264
+ slots: Object,
265
+ setup(props, { slots }) {
266
+ const itemsNode = resolveComponent("VCNavItems");
267
+ const theme = useComponentTheme("navigation", props, navigationThemeDefaults);
268
+ const manager = injectNavigationManager();
269
+ const data = toRef(props, "data");
270
+ const hasChildren = computed(() => data.value.children && data.value.children.length > 0);
271
+ const select = async (value) => {
272
+ await manager.select(data.value.level, value);
273
+ };
274
+ const renderIcon = (icon) => {
275
+ if (icon.includes(":")) return h(resolveComponent("VCIcon"), { name: icon });
276
+ return h("i", { class: icon });
277
+ };
278
+ const toggle = async (value) => {
279
+ await manager.toggle(data.value.level, value);
280
+ };
281
+ return () => {
282
+ const resolved = theme.value;
283
+ const buildItem = () => {
284
+ if (data.value.type === "separator") {
285
+ if (hasNormalizedSlot("separator", slots)) return normalizeSlot("separator", { data: data.value }, slots);
286
+ return h("div", { class: resolved.separator || void 0 }, data.value.name);
287
+ }
288
+ if (!hasChildren.value) {
289
+ if (hasNormalizedSlot("link", slots)) return normalizeSlot("link", {
290
+ data: data.value,
291
+ select,
292
+ isActive: data.value.active
293
+ }, slots);
294
+ const linkProps = {
295
+ active: data.value.active,
296
+ disabled: false,
297
+ prefetch: true
298
+ };
299
+ if (data.value.url) if (isAbsoluteURL(data.value.url) || data.value.url.startsWith("#")) {
300
+ linkProps.href = data.value.url;
301
+ if (data.value.urlTarget) linkProps.target = data.value.urlTarget;
302
+ } else linkProps.to = data.value.url;
303
+ return h(VCLink, {
304
+ class: [resolved.link],
305
+ "data-vc-collection-item": "",
306
+ ...linkProps,
307
+ onClicked() {
308
+ if (!data.value.url) return select.call(null, data.value);
309
+ },
310
+ onClick() {
311
+ return select.call(null, data.value);
312
+ }
313
+ }, { default: () => [...data.value.icon ? [h("div", { class: resolved.linkIcon || void 0 }, [renderIcon(data.value.icon)])] : [], h("div", { class: resolved.linkText || void 0 }, [data.value.name])] });
314
+ }
315
+ if (hasNormalizedSlot("sub", slots)) return normalizeSlot("sub", {
316
+ data: data.value,
317
+ select,
318
+ toggle
319
+ }, slots);
320
+ let title;
321
+ if (hasNormalizedSlot("sub-title", slots)) title = normalizeSlot("sub-title", {
322
+ data: data.value,
323
+ select,
324
+ toggle
325
+ });
326
+ else title = h("div", {
327
+ class: resolved.link,
328
+ "data-vc-collection-item": "",
329
+ "data-state": data.value.displayChildren ? "open" : "closed",
330
+ "data-active": data.value.active ? "" : void 0,
331
+ tabindex: 0,
332
+ role: "button",
333
+ "aria-expanded": data.value.displayChildren ? "true" : "false",
334
+ onClick($event) {
335
+ $event.preventDefault();
336
+ return toggle(data.value);
337
+ },
338
+ onKeydown($event) {
339
+ if ($event.key === "Enter" || $event.key === " ") {
340
+ $event.preventDefault();
341
+ return toggle(data.value);
342
+ }
343
+ }
344
+ }, [...data.value.icon ? [h("div", { class: resolved.linkIcon || void 0 }, [renderIcon(data.value.icon)])] : [], h("div", { class: resolved.linkText || void 0 }, [data.value.name])]);
345
+ if (!hasChildren.value) return title;
346
+ let vNodes;
347
+ if (hasNormalizedSlot("sub-items", slots)) vNodes = normalizeSlot("sub-items", {
348
+ data: data.value,
349
+ select,
350
+ toggle
351
+ });
352
+ else vNodes = h(itemsNode, {
353
+ level: data.value.level,
354
+ data: data.value.children
355
+ });
356
+ return [title, vNodes];
357
+ };
358
+ return h("li", {
359
+ class: [
360
+ resolved.item,
361
+ ...hasChildren.value ? [resolved.itemNested] : [],
362
+ { active: data.value.active || data.value.displayChildren }
363
+ ],
364
+ "data-active": data.value.active || data.value.displayChildren ? "" : void 0,
365
+ ...hasChildren.value ? { "data-state": data.value.displayChildren ? "open" : "closed" } : {}
366
+ }, [buildItem()]);
367
+ };
368
+ }
516
369
  });
517
-
518
370
  const VCNavItems = defineComponent({
519
- props: {
520
- level: {
521
- type: Number,
522
- default: 0
523
- },
524
- data: {
525
- type: Array,
526
- default: undefined
527
- }
528
- },
529
- setup (props, { slots }) {
530
- const options = buildComponentOptions();
531
- const manager = injectNavigationManager();
532
- const managerItems = ref([]);
533
- if (!props.data) {
534
- managerItems.value = manager.getItems(props.level);
535
- }
536
- const counter = ref(0);
537
- let removeListener;
538
- onMounted(()=>{
539
- removeListener = manager.on('levelUpdated', (level, items)=>{
540
- if (level !== props.level) {
541
- return;
542
- }
543
- managerItems.value = items;
544
- counter.value++;
545
- });
546
- });
547
- onUnmounted(()=>{
548
- if (typeof removeListener === 'function') {
549
- removeListener();
550
- removeListener = undefined;
551
- }
552
- });
553
- const items = computed(()=>{
554
- if (typeof props.data !== 'undefined') {
555
- return props.data;
556
- }
557
- return managerItems.value;
558
- });
559
- return ()=>{
560
- const vNodes = [];
561
- for(let i = 0; i < items.value.length; i++){
562
- if (!items.value[i].display && !items.value[i].displayChildren) {
563
- continue;
564
- }
565
- let vNode;
566
- if (hasNormalizedSlot(SlotName.ITEM, slots)) {
567
- vNode = normalizeSlot(SlotName.ITEM, {
568
- data: items.value[i]
569
- }, slots);
570
- } else {
571
- vNode = h(VCNavItem, {
572
- key: `${i}:${counter.value}`,
573
- data: items.value[i]
574
- });
575
- }
576
- vNodes.push(vNode);
577
- }
578
- return h(options.groupTag, {
579
- class: options.groupClass
580
- }, vNodes);
581
- };
582
- }
371
+ name: "VCNavItems",
372
+ props: {
373
+ level: {
374
+ type: Number,
375
+ default: 0
376
+ },
377
+ data: {
378
+ type: Array,
379
+ default: void 0
380
+ },
381
+ themeClass: {
382
+ type: Object,
383
+ default: void 0
384
+ },
385
+ themeVariant: {
386
+ type: Object,
387
+ default: void 0
388
+ }
389
+ },
390
+ slots: Object,
391
+ setup(props, { slots }) {
392
+ const theme = useComponentTheme("navigation", props, navigationThemeDefaults);
393
+ const rootRef = ref(null);
394
+ const onKeyDown = (event) => {
395
+ useArrowNavigation(event, event.target, rootRef.value, {
396
+ arrowKeyOptions: "vertical",
397
+ focus: true,
398
+ loop: true
399
+ });
400
+ };
401
+ const manager = injectNavigationManager();
402
+ const managerItems = ref([]);
403
+ if (!props.data) managerItems.value = manager.getItems(props.level);
404
+ const counter = ref(0);
405
+ let removeListener;
406
+ onMounted(() => {
407
+ removeListener = manager.on("levelUpdated", (level, items) => {
408
+ if (level !== props.level) return;
409
+ managerItems.value = items;
410
+ counter.value++;
411
+ });
412
+ });
413
+ onUnmounted(() => {
414
+ if (typeof removeListener === "function") {
415
+ removeListener();
416
+ removeListener = void 0;
417
+ }
418
+ });
419
+ const items = computed(() => {
420
+ if (typeof props.data !== "undefined") return props.data;
421
+ return managerItems.value;
422
+ });
423
+ return () => {
424
+ const resolved = theme.value;
425
+ const vNodes = [];
426
+ for (let i = 0; i < items.value.length; i++) {
427
+ if (!items.value[i].display && !items.value[i].displayChildren) continue;
428
+ let vNode;
429
+ if (hasNormalizedSlot("item", slots)) vNode = normalizeSlot("item", { data: items.value[i] }, slots);
430
+ else vNode = h(VCNavItem, {
431
+ key: `${i}:${counter.value}`,
432
+ data: items.value[i]
433
+ });
434
+ vNodes.push(vNode);
435
+ }
436
+ const isRoot = props.level === 0;
437
+ return h("ul", {
438
+ class: resolved.group || void 0,
439
+ ...isRoot ? {
440
+ ref: rootRef,
441
+ onKeydown: onKeyDown
442
+ } : {}
443
+ }, vNodes);
444
+ };
445
+ }
583
446
  });
584
-
585
- function install(instance, options) {
586
- const manager = new NavigationManager({
587
- items: options.items
588
- });
589
- provideNavigationManager(manager, instance);
590
- const storeManager = installStoreManager(instance);
591
- if (options.storeManager) {
592
- applyStoreManagerOptions(storeManager, options.storeManager);
593
- }
594
- Object.entries({
595
- VCNavItem,
596
- VCNavItems
597
- }).forEach(([componentName, component])=>{
598
- instance.component(componentName, component);
599
- });
447
+ //#endregion
448
+ //#region src/components/stepper/context.ts
449
+ const STEPPER_CONTEXT_KEY = Symbol("vcStepperContext");
450
+ function provideStepperContext(ctx) {
451
+ provide$1(STEPPER_CONTEXT_KEY, ctx);
600
452
  }
601
- var index = {
602
- install
603
- };
453
+ function useStepperContext() {
454
+ return inject$1(STEPPER_CONTEXT_KEY, null);
455
+ }
456
+ //#endregion
457
+ //#region src/components/stepper/theme.ts
458
+ const stepperThemeDefaults = { classes: {
459
+ root: "vc-stepper",
460
+ item: "vc-stepper-item",
461
+ trigger: "vc-stepper-trigger",
462
+ indicator: "vc-stepper-indicator",
463
+ title: "vc-stepper-title",
464
+ description: "vc-stepper-description",
465
+ separator: "vc-stepper-separator"
466
+ } };
467
+ //#endregion
468
+ //#region src/components/stepper/Stepper.vue
469
+ var Stepper_default = defineComponent({
470
+ name: "VCStepper",
471
+ inheritAttrs: false,
472
+ props: {
473
+ /** Active step (1-based). v-modeled. */
474
+ modelValue: {
475
+ type: Number,
476
+ default: void 0
477
+ },
478
+ /** Initial active step for uncontrolled usage. */
479
+ defaultValue: {
480
+ type: Number,
481
+ default: 1
482
+ },
483
+ /** Layout direction. */
484
+ orientation: {
485
+ type: String,
486
+ default: "horizontal"
487
+ },
488
+ /** Reading direction. Falls back to the ConfigManager's `dir` value when omitted. */
489
+ dir: {
490
+ type: String,
491
+ default: void 0
492
+ },
493
+ /** When `true`, steps must be completed in order — Reka blocks navigation past the next incomplete step. */
494
+ linear: {
495
+ type: Boolean,
496
+ default: true
497
+ },
498
+ /** Theme-class overrides for this component instance. */
499
+ themeClass: {
500
+ type: Object,
501
+ default: void 0
502
+ },
503
+ /** Theme-variant values for this component instance. */
504
+ themeVariant: {
505
+ type: Object,
506
+ default: void 0
507
+ }
508
+ },
509
+ emits: ["update:modelValue"],
510
+ setup(props, { attrs, slots, emit }) {
511
+ provideStepperContext({
512
+ themeClass: () => props.themeClass,
513
+ themeVariant: () => props.themeVariant
514
+ });
515
+ const theme = useComponentTheme("stepper", props, stepperThemeDefaults);
516
+ return () => h(StepperRoot, mergeProps(attrs, {
517
+ modelValue: props.modelValue,
518
+ defaultValue: props.defaultValue,
519
+ orientation: props.orientation,
520
+ dir: props.dir,
521
+ linear: props.linear,
522
+ "onUpdate:modelValue": (value) => emit("update:modelValue", value),
523
+ class: theme.value.root || void 0
524
+ }), { default: () => slots.default?.() });
525
+ }
526
+ });
527
+ //#endregion
528
+ //#region src/components/stepper/StepperItem.vue
529
+ var StepperItem_default = defineComponent({
530
+ name: "VCStepperItem",
531
+ inheritAttrs: false,
532
+ props: {
533
+ /** 1-based step index. Required by Reka — used to determine completion / active state. */
534
+ step: {
535
+ type: Number,
536
+ required: true
537
+ },
538
+ /** Block interaction with this step. */
539
+ disabled: {
540
+ type: Boolean,
541
+ default: false
542
+ },
543
+ /** Force completion state. Reka derives this automatically when `false`. */
544
+ completed: {
545
+ type: Boolean,
546
+ default: false
547
+ },
548
+ /** Theme-class overrides for this component instance. */
549
+ themeClass: {
550
+ type: Object,
551
+ default: void 0
552
+ },
553
+ /** Theme-variant values for this component instance. */
554
+ themeVariant: {
555
+ type: Object,
556
+ default: void 0
557
+ }
558
+ },
559
+ slots: Object,
560
+ setup(props, { attrs, slots }) {
561
+ const ctx = useStepperContext();
562
+ const theme = useComponentTheme("stepper", {
563
+ get themeClass() {
564
+ return {
565
+ ...ctx?.themeClass() ?? {},
566
+ ...props.themeClass ?? {}
567
+ };
568
+ },
569
+ get themeVariant() {
570
+ return {
571
+ ...ctx?.themeVariant() ?? {},
572
+ ...props.themeVariant ?? {}
573
+ };
574
+ }
575
+ }, stepperThemeDefaults);
576
+ return () => h(StepperItem, {
577
+ step: props.step,
578
+ disabled: props.disabled,
579
+ completed: props.completed,
580
+ ...mergeProps(attrs, { class: ["group", theme.value.item || void 0] })
581
+ }, { default: ({ state }) => slots.default?.({ state }) });
582
+ }
583
+ });
584
+ //#endregion
585
+ //#region src/components/stepper/StepperTrigger.vue
586
+ var StepperTrigger_default = defineComponent({
587
+ name: "VCStepperTrigger",
588
+ inheritAttrs: false,
589
+ props: {
590
+ /** Render the consumer's slot child as the trigger root (Reka `asChild` pattern). */
591
+ asChild: {
592
+ type: Boolean,
593
+ default: false
594
+ },
595
+ /** HTML tag to render. */
596
+ as: {
597
+ type: [String, Object],
598
+ default: "button"
599
+ },
600
+ /** Theme-class overrides for this component instance. */
601
+ themeClass: {
602
+ type: Object,
603
+ default: void 0
604
+ },
605
+ /** Theme-variant values for this component instance. */
606
+ themeVariant: {
607
+ type: Object,
608
+ default: void 0
609
+ }
610
+ },
611
+ setup(props, { attrs, slots }) {
612
+ const ctx = useStepperContext();
613
+ const theme = useComponentTheme("stepper", {
614
+ get themeClass() {
615
+ return {
616
+ ...ctx?.themeClass() ?? {},
617
+ ...props.themeClass ?? {}
618
+ };
619
+ },
620
+ get themeVariant() {
621
+ return {
622
+ ...ctx?.themeVariant() ?? {},
623
+ ...props.themeVariant ?? {}
624
+ };
625
+ }
626
+ }, stepperThemeDefaults);
627
+ return () => h(StepperTrigger, mergeProps(props.as === "button" ? { type: "button" } : {}, attrs, {
628
+ as: props.as,
629
+ asChild: props.asChild,
630
+ class: theme.value.trigger || void 0
631
+ }), { default: () => slots.default?.() });
632
+ }
633
+ });
634
+ //#endregion
635
+ //#region src/components/stepper/StepperIndicator.vue
636
+ var StepperIndicator_default = defineComponent({
637
+ name: "VCStepperIndicator",
638
+ inheritAttrs: false,
639
+ props: {
640
+ /** Render the consumer's slot child as the indicator root (Reka `asChild` pattern). */
641
+ asChild: {
642
+ type: Boolean,
643
+ default: false
644
+ },
645
+ /** HTML tag to render. */
646
+ as: {
647
+ type: [String, Object],
648
+ default: "div"
649
+ },
650
+ /** Theme-class overrides for this component instance. */
651
+ themeClass: {
652
+ type: Object,
653
+ default: void 0
654
+ },
655
+ /** Theme-variant values for this component instance. */
656
+ themeVariant: {
657
+ type: Object,
658
+ default: void 0
659
+ }
660
+ },
661
+ setup(props, { attrs, slots }) {
662
+ const ctx = useStepperContext();
663
+ const theme = useComponentTheme("stepper", {
664
+ get themeClass() {
665
+ return {
666
+ ...ctx?.themeClass() ?? {},
667
+ ...props.themeClass ?? {}
668
+ };
669
+ },
670
+ get themeVariant() {
671
+ return {
672
+ ...ctx?.themeVariant() ?? {},
673
+ ...props.themeVariant ?? {}
674
+ };
675
+ }
676
+ }, stepperThemeDefaults);
677
+ return () => h(StepperIndicator, mergeProps(attrs, {
678
+ as: props.as,
679
+ asChild: props.asChild,
680
+ class: theme.value.indicator || void 0
681
+ }), { default: () => slots.default?.() });
682
+ }
683
+ });
684
+ //#endregion
685
+ //#region src/components/stepper/StepperTitle.vue
686
+ var StepperTitle_default = defineComponent({
687
+ name: "VCStepperTitle",
688
+ inheritAttrs: false,
689
+ props: {
690
+ /** Render the consumer's slot child as the title root (Reka `asChild` pattern). */
691
+ asChild: {
692
+ type: Boolean,
693
+ default: false
694
+ },
695
+ /** HTML tag to render. */
696
+ as: {
697
+ type: [String, Object],
698
+ default: "h4"
699
+ },
700
+ /** Theme-class overrides for this component instance. */
701
+ themeClass: {
702
+ type: Object,
703
+ default: void 0
704
+ },
705
+ /** Theme-variant values for this component instance. */
706
+ themeVariant: {
707
+ type: Object,
708
+ default: void 0
709
+ }
710
+ },
711
+ setup(props, { attrs, slots }) {
712
+ const ctx = useStepperContext();
713
+ const theme = useComponentTheme("stepper", {
714
+ get themeClass() {
715
+ return {
716
+ ...ctx?.themeClass() ?? {},
717
+ ...props.themeClass ?? {}
718
+ };
719
+ },
720
+ get themeVariant() {
721
+ return {
722
+ ...ctx?.themeVariant() ?? {},
723
+ ...props.themeVariant ?? {}
724
+ };
725
+ }
726
+ }, stepperThemeDefaults);
727
+ return () => h(StepperTitle, mergeProps(attrs, {
728
+ as: props.as,
729
+ asChild: props.asChild,
730
+ class: theme.value.title || void 0
731
+ }), { default: () => slots.default?.() });
732
+ }
733
+ });
734
+ //#endregion
735
+ //#region src/components/stepper/StepperDescription.vue
736
+ var StepperDescription_default = defineComponent({
737
+ name: "VCStepperDescription",
738
+ inheritAttrs: false,
739
+ props: {
740
+ /** Render the consumer's slot child as the description root (Reka `asChild` pattern). */
741
+ asChild: {
742
+ type: Boolean,
743
+ default: false
744
+ },
745
+ /** HTML tag to render. */
746
+ as: {
747
+ type: [String, Object],
748
+ default: "p"
749
+ },
750
+ /** Theme-class overrides for this component instance. */
751
+ themeClass: {
752
+ type: Object,
753
+ default: void 0
754
+ },
755
+ /** Theme-variant values for this component instance. */
756
+ themeVariant: {
757
+ type: Object,
758
+ default: void 0
759
+ }
760
+ },
761
+ setup(props, { attrs, slots }) {
762
+ const ctx = useStepperContext();
763
+ const theme = useComponentTheme("stepper", {
764
+ get themeClass() {
765
+ return {
766
+ ...ctx?.themeClass() ?? {},
767
+ ...props.themeClass ?? {}
768
+ };
769
+ },
770
+ get themeVariant() {
771
+ return {
772
+ ...ctx?.themeVariant() ?? {},
773
+ ...props.themeVariant ?? {}
774
+ };
775
+ }
776
+ }, stepperThemeDefaults);
777
+ return () => h(StepperDescription, mergeProps(attrs, {
778
+ as: props.as,
779
+ asChild: props.asChild,
780
+ class: theme.value.description || void 0
781
+ }), { default: () => slots.default?.() });
782
+ }
783
+ });
784
+ //#endregion
785
+ //#region src/components/stepper/StepperSeparator.vue
786
+ var StepperSeparator_default = defineComponent({
787
+ name: "VCStepperSeparator",
788
+ inheritAttrs: false,
789
+ props: {
790
+ /** Render the consumer's slot child as the separator root (Reka `asChild` pattern). */
791
+ asChild: {
792
+ type: Boolean,
793
+ default: false
794
+ },
795
+ /** HTML tag to render. */
796
+ as: {
797
+ type: [String, Object],
798
+ default: "div"
799
+ },
800
+ /** Theme-class overrides for this component instance. */
801
+ themeClass: {
802
+ type: Object,
803
+ default: void 0
804
+ },
805
+ /** Theme-variant values for this component instance. */
806
+ themeVariant: {
807
+ type: Object,
808
+ default: void 0
809
+ }
810
+ },
811
+ setup(props, { attrs, slots }) {
812
+ const ctx = useStepperContext();
813
+ const theme = useComponentTheme("stepper", {
814
+ get themeClass() {
815
+ return {
816
+ ...ctx?.themeClass() ?? {},
817
+ ...props.themeClass ?? {}
818
+ };
819
+ },
820
+ get themeVariant() {
821
+ return {
822
+ ...ctx?.themeVariant() ?? {},
823
+ ...props.themeVariant ?? {}
824
+ };
825
+ }
826
+ }, stepperThemeDefaults);
827
+ return () => h(StepperSeparator, mergeProps(attrs, {
828
+ as: props.as,
829
+ asChild: props.asChild,
830
+ class: theme.value.separator || void 0
831
+ }), { default: () => slots.default?.() });
832
+ }
833
+ });
834
+ //#endregion
835
+ //#region src/index.ts
836
+ function install(instance, options = {}) {
837
+ provideNavigationManager(new NavigationManager({ items: options.items ?? [] }), instance);
838
+ installThemeManager(instance, options);
839
+ installDefaultsManager(instance, options);
840
+ Object.entries({
841
+ VCNavItem,
842
+ VCNavItems,
843
+ VCStepper: Stepper_default,
844
+ VCStepperItem: StepperItem_default,
845
+ VCStepperTrigger: StepperTrigger_default,
846
+ VCStepperIndicator: StepperIndicator_default,
847
+ VCStepperTitle: StepperTitle_default,
848
+ VCStepperDescription: StepperDescription_default,
849
+ VCStepperSeparator: StepperSeparator_default
850
+ }).forEach(([componentName, component]) => {
851
+ instance.component(componentName, component);
852
+ });
853
+ }
854
+ var src_default = { install };
855
+ //#endregion
856
+ export { NavigationManager, VCNavItem, VCNavItems, Stepper_default as VCStepper, StepperDescription_default as VCStepperDescription, StepperIndicator_default as VCStepperIndicator, StepperItem_default as VCStepperItem, StepperSeparator_default as VCStepperSeparator, StepperTitle_default as VCStepperTitle, StepperTrigger_default as VCStepperTrigger, src_default as default, injectNavigationManager, install, navigationThemeDefaults, provideNavigationManager, provideStepperContext, stepperThemeDefaults, useStepperContext };
604
857
 
605
- export { NavigationManager, VCNavItem, VCNavItems, index as default, injectNavigationManager, install, provideNavigationManager };
606
- //# sourceMappingURL=index.mjs.map
858
+ //# sourceMappingURL=index.mjs.map