@vuecs/elements 1.0.0

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 (104) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +21 -0
  3. package/dist/components/alert/Alert.vue.d.ts +177 -0
  4. package/dist/components/alert/Alert.vue.d.ts.map +1 -0
  5. package/dist/components/alert/AlertClose.vue.d.ts +110 -0
  6. package/dist/components/alert/AlertClose.vue.d.ts.map +1 -0
  7. package/dist/components/alert/AlertDescription.vue.d.ts +56 -0
  8. package/dist/components/alert/AlertDescription.vue.d.ts.map +1 -0
  9. package/dist/components/alert/AlertTitle.vue.d.ts +71 -0
  10. package/dist/components/alert/AlertTitle.vue.d.ts.map +1 -0
  11. package/dist/components/alert/index.d.ts +11 -0
  12. package/dist/components/alert/index.d.ts.map +1 -0
  13. package/dist/components/alert/theme.d.ts +6 -0
  14. package/dist/components/alert/theme.d.ts.map +1 -0
  15. package/dist/components/alert/types.d.ts +44 -0
  16. package/dist/components/alert/types.d.ts.map +1 -0
  17. package/dist/components/aspect-ratio/AspectRatio.vue.d.ts +63 -0
  18. package/dist/components/aspect-ratio/AspectRatio.vue.d.ts.map +1 -0
  19. package/dist/components/aspect-ratio/index.d.ts +5 -0
  20. package/dist/components/aspect-ratio/index.d.ts.map +1 -0
  21. package/dist/components/aspect-ratio/theme.d.ts +4 -0
  22. package/dist/components/aspect-ratio/theme.d.ts.map +1 -0
  23. package/dist/components/aspect-ratio/types.d.ts +11 -0
  24. package/dist/components/aspect-ratio/types.d.ts.map +1 -0
  25. package/dist/components/avatar/Avatar.vue.d.ts +174 -0
  26. package/dist/components/avatar/Avatar.vue.d.ts.map +1 -0
  27. package/dist/components/avatar/index.d.ts +5 -0
  28. package/dist/components/avatar/index.d.ts.map +1 -0
  29. package/dist/components/avatar/theme.d.ts +4 -0
  30. package/dist/components/avatar/theme.d.ts.map +1 -0
  31. package/dist/components/avatar/types.d.ts +16 -0
  32. package/dist/components/avatar/types.d.ts.map +1 -0
  33. package/dist/components/badge/Badge.vue.d.ts +104 -0
  34. package/dist/components/badge/Badge.vue.d.ts.map +1 -0
  35. package/dist/components/badge/index.d.ts +5 -0
  36. package/dist/components/badge/index.d.ts.map +1 -0
  37. package/dist/components/badge/theme.d.ts +4 -0
  38. package/dist/components/badge/theme.d.ts.map +1 -0
  39. package/dist/components/badge/types.d.ts +14 -0
  40. package/dist/components/badge/types.d.ts.map +1 -0
  41. package/dist/components/card/Card.vue.d.ts +120 -0
  42. package/dist/components/card/Card.vue.d.ts.map +1 -0
  43. package/dist/components/card/CardBody.vue.d.ts +79 -0
  44. package/dist/components/card/CardBody.vue.d.ts.map +1 -0
  45. package/dist/components/card/CardDescription.vue.d.ts +79 -0
  46. package/dist/components/card/CardDescription.vue.d.ts.map +1 -0
  47. package/dist/components/card/CardFooter.vue.d.ts +79 -0
  48. package/dist/components/card/CardFooter.vue.d.ts.map +1 -0
  49. package/dist/components/card/CardHeader.vue.d.ts +79 -0
  50. package/dist/components/card/CardHeader.vue.d.ts.map +1 -0
  51. package/dist/components/card/CardTitle.vue.d.ts +79 -0
  52. package/dist/components/card/CardTitle.vue.d.ts.map +1 -0
  53. package/dist/components/card/context.d.ts +17 -0
  54. package/dist/components/card/context.d.ts.map +1 -0
  55. package/dist/components/card/index.d.ts +16 -0
  56. package/dist/components/card/index.d.ts.map +1 -0
  57. package/dist/components/card/theme.d.ts +9 -0
  58. package/dist/components/card/theme.d.ts.map +1 -0
  59. package/dist/components/card/types.d.ts +38 -0
  60. package/dist/components/card/types.d.ts.map +1 -0
  61. package/dist/components/collapse/Collapse.vue.d.ts +153 -0
  62. package/dist/components/collapse/Collapse.vue.d.ts.map +1 -0
  63. package/dist/components/collapse/CollapseContent.vue.d.ts +97 -0
  64. package/dist/components/collapse/CollapseContent.vue.d.ts.map +1 -0
  65. package/dist/components/collapse/CollapseTrigger.vue.d.ts +106 -0
  66. package/dist/components/collapse/CollapseTrigger.vue.d.ts.map +1 -0
  67. package/dist/components/collapse/index.d.ts +9 -0
  68. package/dist/components/collapse/index.d.ts.map +1 -0
  69. package/dist/components/collapse/theme.d.ts +6 -0
  70. package/dist/components/collapse/theme.d.ts.map +1 -0
  71. package/dist/components/collapse/types.d.ts +32 -0
  72. package/dist/components/collapse/types.d.ts.map +1 -0
  73. package/dist/components/index.d.ts +10 -0
  74. package/dist/components/index.d.ts.map +1 -0
  75. package/dist/components/separator/Separator.vue.d.ts +106 -0
  76. package/dist/components/separator/Separator.vue.d.ts.map +1 -0
  77. package/dist/components/separator/index.d.ts +5 -0
  78. package/dist/components/separator/index.d.ts.map +1 -0
  79. package/dist/components/separator/theme.d.ts +4 -0
  80. package/dist/components/separator/theme.d.ts.map +1 -0
  81. package/dist/components/separator/types.d.ts +11 -0
  82. package/dist/components/separator/types.d.ts.map +1 -0
  83. package/dist/components/tag/Tag.vue.d.ts +145 -0
  84. package/dist/components/tag/Tag.vue.d.ts.map +1 -0
  85. package/dist/components/tag/Tags.vue.d.ts +115 -0
  86. package/dist/components/tag/Tags.vue.d.ts.map +1 -0
  87. package/dist/components/tag/index.d.ts +7 -0
  88. package/dist/components/tag/index.d.ts.map +1 -0
  89. package/dist/components/tag/theme.d.ts +5 -0
  90. package/dist/components/tag/theme.d.ts.map +1 -0
  91. package/dist/components/tag/types.d.ts +41 -0
  92. package/dist/components/tag/types.d.ts.map +1 -0
  93. package/dist/components/visually-hidden/VisuallyHidden.vue.d.ts +29 -0
  94. package/dist/components/visually-hidden/VisuallyHidden.vue.d.ts.map +1 -0
  95. package/dist/components/visually-hidden/index.d.ts +3 -0
  96. package/dist/components/visually-hidden/index.d.ts.map +1 -0
  97. package/dist/index.d.ts +19 -0
  98. package/dist/index.d.ts.map +1 -0
  99. package/dist/index.mjs +1080 -0
  100. package/dist/index.mjs.map +1 -0
  101. package/dist/style.css +213 -0
  102. package/dist/vue.d.ts +45 -0
  103. package/dist/vue.d.ts.map +1 -0
  104. package/package.json +68 -0
package/dist/index.mjs ADDED
@@ -0,0 +1,1080 @@
1
+ import { installDefaultsManager, installThemeManager, themableProps, useComponentDefaults, useComponentTheme, useThemeProps } from "@vuecs/core";
2
+ import { computed, defineComponent, h, inject, mergeProps, provide, resolveComponent } from "vue";
3
+ import { AspectRatio, AvatarFallback, AvatarImage, AvatarRoot, CollapsibleContent, CollapsibleRoot, CollapsibleTrigger, Primitive, Separator, VisuallyHidden } from "reka-ui";
4
+ //#region src/components/alert/theme.ts
5
+ const alertThemeDefaults = { classes: {
6
+ root: "vc-alert",
7
+ icon: "vc-alert-icon",
8
+ content: "vc-alert-content",
9
+ closeIcon: "vc-alert-close-icon",
10
+ close: "vc-alert-close"
11
+ } };
12
+ const alertTitleThemeDefaults = { classes: { root: "vc-alert-title" } };
13
+ const alertDescriptionThemeDefaults = { classes: { root: "vc-alert-description" } };
14
+ //#endregion
15
+ //#region src/components/alert/Alert.vue?vue&type=script&lang.ts
16
+ const alertProps = {
17
+ /** Semantic color. Drives the `color` theme variant + auto-resolves the default icon + ARIA role. */
18
+ color: {
19
+ type: String,
20
+ default: void 0
21
+ },
22
+ /** Visual treatment — solid / soft / outline. */
23
+ variant: {
24
+ type: String,
25
+ default: void 0
26
+ },
27
+ /** Padding / font-size tier. */
28
+ size: {
29
+ type: String,
30
+ default: void 0
31
+ },
32
+ /**
33
+ * Iconify name for the leading icon (e.g. `'lucide:triangle-alert'`).
34
+ * When omitted, resolves from the active icon preset based on `color`
35
+ * (`errorIcon` / `warningIcon` / `successIcon` / `infoIcon`). Pass an
36
+ * empty string to suppress the icon entirely.
37
+ */
38
+ icon: {
39
+ type: String,
40
+ default: void 0
41
+ },
42
+ /**
43
+ * ARIA role. Defaults to `'alert'` for `error` / `warning` (assertive)
44
+ * and `'status'` for `info` / `success` / `neutral` (polite) — matches
45
+ * WAI-ARIA's intended semantics. Override for custom interaction
46
+ * patterns (e.g. `role="log"` for chat-style toasts).
47
+ */
48
+ role: {
49
+ type: String,
50
+ default: void 0
51
+ },
52
+ /** HTML tag to render. */
53
+ as: {
54
+ type: String,
55
+ default: "div"
56
+ },
57
+ ...themableProps()
58
+ };
59
+ const alertBehavioralDefaults = {
60
+ primaryIcon: "",
61
+ neutralIcon: "",
62
+ infoIcon: "",
63
+ successIcon: "",
64
+ warningIcon: "",
65
+ errorIcon: ""
66
+ };
67
+ //#endregion
68
+ //#region src/components/alert/Alert.vue
69
+ var Alert_default = defineComponent({
70
+ name: "VCAlert",
71
+ inheritAttrs: false,
72
+ props: alertProps,
73
+ setup(props, { attrs, slots }) {
74
+ const theme = useComponentTheme("alert", useThemeProps(props, "color", "variant", "size"), alertThemeDefaults);
75
+ const defaults = useComponentDefaults("alert", {}, alertBehavioralDefaults);
76
+ const iconName = computed(() => {
77
+ if (props.icon !== void 0) return props.icon;
78
+ switch (props.color) {
79
+ case "error": return defaults.value.errorIcon;
80
+ case "warning": return defaults.value.warningIcon;
81
+ case "success": return defaults.value.successIcon;
82
+ case "info": return defaults.value.infoIcon;
83
+ case "primary": return defaults.value.primaryIcon;
84
+ case "neutral": return defaults.value.neutralIcon;
85
+ default: return "";
86
+ }
87
+ });
88
+ const resolvedRole = computed(() => {
89
+ if (props.role) return props.role;
90
+ return props.color === "error" || props.color === "warning" ? "alert" : "status";
91
+ });
92
+ const VCIcon = resolveComponent("VCIcon");
93
+ const hasIconComponent = typeof VCIcon !== "string";
94
+ return () => {
95
+ const iconValue = iconName.value;
96
+ const showIcon = !!iconValue && hasIconComponent;
97
+ return h(props.as, mergeProps(attrs, {
98
+ role: resolvedRole.value,
99
+ class: theme.value.root || void 0
100
+ }), [showIcon ? h("span", {
101
+ class: theme.value.icon || void 0,
102
+ "aria-hidden": "true"
103
+ }, [h(VCIcon, { name: iconValue })]) : null, h("div", { class: theme.value.content || void 0 }, slots.default?.())]);
104
+ };
105
+ }
106
+ });
107
+ //#endregion
108
+ //#region src/components/alert/AlertTitle.vue
109
+ var AlertTitle_default = defineComponent({
110
+ name: "VCAlertTitle",
111
+ inheritAttrs: false,
112
+ props: {
113
+ /**
114
+ * HTML tag to render.
115
+ *
116
+ * Vuecs convention: defaults to `'h4'` (semantically-correct alert
117
+ * heading). Override via `:as` for nested-heading hierarchies.
118
+ */
119
+ as: {
120
+ type: String,
121
+ default: "h4"
122
+ },
123
+ ...themableProps()
124
+ },
125
+ setup(props, { attrs, slots }) {
126
+ const theme = useComponentTheme("alertTitle", useThemeProps(props), alertTitleThemeDefaults);
127
+ return () => h(props.as, mergeProps(attrs, { class: theme.value.root || void 0 }), slots.default?.());
128
+ }
129
+ });
130
+ //#endregion
131
+ //#region src/components/alert/AlertDescription.vue
132
+ var AlertDescription_default = defineComponent({
133
+ name: "VCAlertDescription",
134
+ inheritAttrs: false,
135
+ props: {
136
+ /** HTML tag to render. */
137
+ as: {
138
+ type: String,
139
+ default: "div"
140
+ },
141
+ ...themableProps()
142
+ },
143
+ setup(props, { attrs, slots }) {
144
+ const theme = useComponentTheme("alertDescription", useThemeProps(props), alertDescriptionThemeDefaults);
145
+ return () => h(props.as, mergeProps(attrs, { class: theme.value.root || void 0 }), slots.default?.());
146
+ }
147
+ });
148
+ //#endregion
149
+ //#region src/components/alert/AlertClose.vue
150
+ var AlertClose_default = defineComponent({
151
+ name: "VCAlertClose",
152
+ inheritAttrs: false,
153
+ props: {
154
+ /** HTML tag to render. */
155
+ as: {
156
+ type: String,
157
+ default: "button"
158
+ },
159
+ /**
160
+ * Force the corner-X presentation (reads the theme's `closeIcon` slot).
161
+ * When false (default), the slot-presence heuristic decides:
162
+ * - slotless → corner-X (`closeIcon`)
163
+ * - slotted → labeled-button (`close`)
164
+ *
165
+ * Same convention as `<VCModalClose>` / `<VCPopoverClose>` / `<VCToastClose>`.
166
+ */
167
+ icon: {
168
+ type: Boolean,
169
+ default: false
170
+ },
171
+ /** Per-instance theme override — flat slot key map. */
172
+ themeClass: {
173
+ type: Object,
174
+ default: void 0
175
+ },
176
+ /** Per-instance variant values. */
177
+ themeVariant: {
178
+ type: Object,
179
+ default: void 0
180
+ }
181
+ },
182
+ setup(props, { slots, attrs }) {
183
+ const theme = useComponentTheme("alert", props, alertThemeDefaults);
184
+ return () => {
185
+ const hasSlot = !!slots.default;
186
+ const slotKey = props.icon || !hasSlot ? "closeIcon" : "close";
187
+ const ariaLabel = attrs["aria-label"] ?? (slotKey === "closeIcon" ? "Close" : void 0);
188
+ return h(props.as, mergeProps(attrs, {
189
+ type: props.as === "button" ? "button" : void 0,
190
+ class: theme.value[slotKey] || void 0,
191
+ "aria-label": ariaLabel
192
+ }), { default: () => slots.default?.() ?? "×" });
193
+ };
194
+ }
195
+ });
196
+ //#endregion
197
+ //#region src/components/aspect-ratio/theme.ts
198
+ const aspectRatioThemeDefaults = { classes: { root: "vc-aspect-ratio" } };
199
+ //#endregion
200
+ //#region src/components/aspect-ratio/AspectRatio.vue
201
+ var AspectRatio_default = defineComponent({
202
+ name: "VCAspectRatio",
203
+ inheritAttrs: false,
204
+ props: {
205
+ /** Desired ratio — width / height (e.g. `16/9`, `4/3`, `1`). */
206
+ ratio: {
207
+ type: Number,
208
+ default: 1
209
+ },
210
+ /** Theme-class overrides for this component instance. */
211
+ themeClass: {
212
+ type: Object,
213
+ default: void 0
214
+ },
215
+ /** Theme-variant values for this component instance. */
216
+ themeVariant: {
217
+ type: Object,
218
+ default: void 0
219
+ }
220
+ },
221
+ setup(props, { attrs, slots }) {
222
+ const theme = useComponentTheme("aspectRatio", props, aspectRatioThemeDefaults);
223
+ return () => h(AspectRatio, mergeProps(attrs, {
224
+ ratio: props.ratio,
225
+ class: theme.value.root || void 0
226
+ }), { default: () => slots.default?.() });
227
+ }
228
+ });
229
+ //#endregion
230
+ //#region src/components/avatar/theme.ts
231
+ const avatarThemeDefaults = { classes: {
232
+ root: "vc-avatar",
233
+ image: "vc-avatar-image",
234
+ fallback: "vc-avatar-fallback"
235
+ } };
236
+ //#endregion
237
+ //#region src/components/avatar/Avatar.vue
238
+ var Avatar_default = defineComponent({
239
+ name: "VCAvatar",
240
+ inheritAttrs: false,
241
+ props: {
242
+ /** Image source. When omitted, the fallback renders immediately. */
243
+ src: {
244
+ type: String,
245
+ default: void 0
246
+ },
247
+ /**
248
+ * Image alt text. Defaults to `''` so the rendered `<img>` always
249
+ * carries the attribute (decorative-image semantics) — pass a
250
+ * meaningful string when the avatar conveys identity.
251
+ */
252
+ alt: {
253
+ type: String,
254
+ default: ""
255
+ },
256
+ /**
257
+ * Delay (ms) before the fallback appears. Useful to avoid a flicker
258
+ * on fast connections — gives the image a brief window to load before
259
+ * the placeholder shows. Forwarded to Reka's `AvatarFallback`.
260
+ *
261
+ * Vuecs convention: keep this at `undefined` rather than mirroring a
262
+ * concrete Reka default. Reka's `AvatarFallback` treats `delayMs: 0`
263
+ * as "wait forever" instead of "render immediately"; the spread-guard
264
+ * in `setup()` works around that quirk so omitting the prop renders
265
+ * the fallback right away. This is the ONE place where the
266
+ * Reka-wrapping convention's natural-forwarding rule is bent.
267
+ */
268
+ delayMs: {
269
+ type: Number,
270
+ default: void 0
271
+ },
272
+ /**
273
+ * Size variant — resolved by the active theme. `sm` ≈ 32px, `md` ≈
274
+ * 40px (default), `lg` ≈ 56px. For arbitrary pixel sizes, use
275
+ * `themeClass={ root: extend('h-12 w-12') }` instead.
276
+ */
277
+ size: {
278
+ type: String,
279
+ default: void 0
280
+ },
281
+ /** Theme-class overrides for this component instance. */
282
+ themeClass: {
283
+ type: Object,
284
+ default: void 0
285
+ },
286
+ /** Theme-variant values for this component instance. */
287
+ themeVariant: {
288
+ type: Object,
289
+ default: void 0
290
+ }
291
+ },
292
+ slots: Object,
293
+ setup(props, { attrs, slots }) {
294
+ const theme = useComponentTheme("avatar", {
295
+ get themeClass() {
296
+ return props.themeClass;
297
+ },
298
+ get themeVariant() {
299
+ return {
300
+ ...props.themeVariant ?? {},
301
+ ...props.size !== void 0 ? { size: props.size } : {}
302
+ };
303
+ }
304
+ }, avatarThemeDefaults);
305
+ return () => {
306
+ const resolved = theme.value;
307
+ const children = [];
308
+ if (props.src) children.push(h(AvatarImage, {
309
+ src: props.src,
310
+ alt: props.alt,
311
+ class: resolved.image || void 0
312
+ }));
313
+ children.push(h(AvatarFallback, {
314
+ ...typeof props.delayMs === "number" && props.delayMs > 0 ? { delayMs: props.delayMs } : {},
315
+ class: resolved.fallback || void 0
316
+ }, { default: () => slots.fallback?.({ class: resolved.fallback }) ?? "" }));
317
+ return h(AvatarRoot, mergeProps(attrs, { class: resolved.root || void 0 }), { default: () => children });
318
+ };
319
+ }
320
+ });
321
+ //#endregion
322
+ //#region src/components/badge/theme.ts
323
+ const badgeThemeDefaults = { classes: { root: "vc-badge" } };
324
+ //#endregion
325
+ //#region src/components/badge/Badge.vue
326
+ var Badge_default = defineComponent({
327
+ name: "VCBadge",
328
+ inheritAttrs: false,
329
+ props: {
330
+ /** Color variant key — resolved by the active theme. */
331
+ color: {
332
+ type: String,
333
+ default: void 0
334
+ },
335
+ /** Style variant key — resolved by the active theme (e.g. `solid`, `soft`, `outline`). */
336
+ variant: {
337
+ type: String,
338
+ default: void 0
339
+ },
340
+ /** Size variant key — resolved by the active theme. */
341
+ size: {
342
+ type: String,
343
+ default: void 0
344
+ },
345
+ /** HTML tag to render. */
346
+ tag: {
347
+ type: String,
348
+ default: "span"
349
+ },
350
+ ...themableProps()
351
+ },
352
+ setup(props, { attrs, slots }) {
353
+ const theme = useComponentTheme("badge", useThemeProps(props, "color", "variant", "size"), badgeThemeDefaults);
354
+ return () => h(props.tag, mergeProps(attrs, { class: theme.value.root || void 0 }), slots.default?.());
355
+ }
356
+ });
357
+ //#endregion
358
+ //#region src/components/card/context.ts
359
+ const CARD_CONTEXT_KEY = Symbol("vcCardContext");
360
+ function provideCardContext(ctx) {
361
+ provide(CARD_CONTEXT_KEY, ctx);
362
+ }
363
+ function useCardContext() {
364
+ return inject(CARD_CONTEXT_KEY, null);
365
+ }
366
+ //#endregion
367
+ //#region src/components/card/theme.ts
368
+ const cardThemeDefaults = { classes: { root: "vc-card" } };
369
+ const cardHeaderThemeDefaults = { classes: { root: "vc-card-header" } };
370
+ const cardTitleThemeDefaults = { classes: { root: "vc-card-title" } };
371
+ const cardDescriptionThemeDefaults = { classes: { root: "vc-card-description" } };
372
+ const cardBodyThemeDefaults = { classes: { root: "vc-card-body" } };
373
+ const cardFooterThemeDefaults = { classes: { root: "vc-card-footer" } };
374
+ //#endregion
375
+ //#region src/components/card/Card.vue
376
+ var Card_default = defineComponent({
377
+ name: "VCCard",
378
+ inheritAttrs: false,
379
+ props: {
380
+ /** Visual style variant — resolved by the active theme. */
381
+ variant: {
382
+ type: String,
383
+ default: void 0
384
+ },
385
+ /** Inner padding scale; propagates to child parts via card context. */
386
+ padding: {
387
+ type: String,
388
+ default: void 0
389
+ },
390
+ /** Adds hover / focus styling — useful for link-cards. */
391
+ interactive: {
392
+ type: Boolean,
393
+ default: void 0
394
+ },
395
+ /** HTML tag to render. Use `:as-child` to compose onto an existing component. */
396
+ as: {
397
+ type: String,
398
+ default: "div"
399
+ },
400
+ /** Render the consumer's slot child as the card root (Reka `asChild` pattern). */
401
+ asChild: {
402
+ type: Boolean,
403
+ default: false
404
+ },
405
+ ...themableProps()
406
+ },
407
+ setup(props, { attrs, slots }) {
408
+ const themeProps = useThemeProps(props, "variant", "padding", "interactive");
409
+ const theme = useComponentTheme("card", themeProps, cardThemeDefaults);
410
+ provideCardContext({ themeVariant: () => themeProps.themeVariant });
411
+ return () => h(Primitive, mergeProps(attrs, {
412
+ as: props.as,
413
+ asChild: props.asChild,
414
+ class: theme.value.root || void 0
415
+ }), { default: () => slots.default?.() });
416
+ }
417
+ });
418
+ //#endregion
419
+ //#region src/components/card/CardHeader.vue
420
+ var CardHeader_default = defineComponent({
421
+ name: "VCCardHeader",
422
+ inheritAttrs: false,
423
+ props: {
424
+ /** HTML tag to render. Use `:as-child` to compose onto an existing component. */
425
+ as: {
426
+ type: String,
427
+ default: "header"
428
+ },
429
+ /** Render the consumer's slot child as the root (Reka `asChild` pattern). */
430
+ asChild: {
431
+ type: Boolean,
432
+ default: false
433
+ },
434
+ /** Theme-class overrides for this component instance. */
435
+ themeClass: {
436
+ type: Object,
437
+ default: void 0
438
+ },
439
+ /** Theme-variant values for this component instance. */
440
+ themeVariant: {
441
+ type: Object,
442
+ default: void 0
443
+ }
444
+ },
445
+ setup(props, { attrs, slots }) {
446
+ const ctx = useCardContext();
447
+ const theme = useComponentTheme("cardHeader", {
448
+ get themeClass() {
449
+ return props.themeClass;
450
+ },
451
+ get themeVariant() {
452
+ return {
453
+ ...ctx?.themeVariant() ?? {},
454
+ ...props.themeVariant ?? {}
455
+ };
456
+ }
457
+ }, cardHeaderThemeDefaults);
458
+ return () => h(Primitive, mergeProps(attrs, {
459
+ as: props.as,
460
+ asChild: props.asChild,
461
+ class: theme.value.root || void 0
462
+ }), { default: () => slots.default?.() });
463
+ }
464
+ });
465
+ //#endregion
466
+ //#region src/components/card/CardTitle.vue
467
+ var CardTitle_default = defineComponent({
468
+ name: "VCCardTitle",
469
+ inheritAttrs: false,
470
+ props: {
471
+ /** HTML tag to render. Use `:as-child` to compose onto an existing component. */
472
+ as: {
473
+ type: String,
474
+ default: "h3"
475
+ },
476
+ /** Render the consumer's slot child as the root (Reka `asChild` pattern). */
477
+ asChild: {
478
+ type: Boolean,
479
+ default: false
480
+ },
481
+ /** Theme-class overrides for this component instance. */
482
+ themeClass: {
483
+ type: Object,
484
+ default: void 0
485
+ },
486
+ /** Theme-variant values for this component instance. */
487
+ themeVariant: {
488
+ type: Object,
489
+ default: void 0
490
+ }
491
+ },
492
+ setup(props, { attrs, slots }) {
493
+ const ctx = useCardContext();
494
+ const theme = useComponentTheme("cardTitle", {
495
+ get themeClass() {
496
+ return props.themeClass;
497
+ },
498
+ get themeVariant() {
499
+ return {
500
+ ...ctx?.themeVariant() ?? {},
501
+ ...props.themeVariant ?? {}
502
+ };
503
+ }
504
+ }, cardTitleThemeDefaults);
505
+ return () => h(Primitive, mergeProps(attrs, {
506
+ as: props.as,
507
+ asChild: props.asChild,
508
+ class: theme.value.root || void 0
509
+ }), { default: () => slots.default?.() });
510
+ }
511
+ });
512
+ //#endregion
513
+ //#region src/components/card/CardDescription.vue
514
+ var CardDescription_default = defineComponent({
515
+ name: "VCCardDescription",
516
+ inheritAttrs: false,
517
+ props: {
518
+ /** HTML tag to render. Use `:as-child` to compose onto an existing component. */
519
+ as: {
520
+ type: String,
521
+ default: "p"
522
+ },
523
+ /** Render the consumer's slot child as the root (Reka `asChild` pattern). */
524
+ asChild: {
525
+ type: Boolean,
526
+ default: false
527
+ },
528
+ /** Theme-class overrides for this component instance. */
529
+ themeClass: {
530
+ type: Object,
531
+ default: void 0
532
+ },
533
+ /** Theme-variant values for this component instance. */
534
+ themeVariant: {
535
+ type: Object,
536
+ default: void 0
537
+ }
538
+ },
539
+ setup(props, { attrs, slots }) {
540
+ const ctx = useCardContext();
541
+ const theme = useComponentTheme("cardDescription", {
542
+ get themeClass() {
543
+ return props.themeClass;
544
+ },
545
+ get themeVariant() {
546
+ return {
547
+ ...ctx?.themeVariant() ?? {},
548
+ ...props.themeVariant ?? {}
549
+ };
550
+ }
551
+ }, cardDescriptionThemeDefaults);
552
+ return () => h(Primitive, mergeProps(attrs, {
553
+ as: props.as,
554
+ asChild: props.asChild,
555
+ class: theme.value.root || void 0
556
+ }), { default: () => slots.default?.() });
557
+ }
558
+ });
559
+ //#endregion
560
+ //#region src/components/card/CardBody.vue
561
+ var CardBody_default = defineComponent({
562
+ name: "VCCardBody",
563
+ inheritAttrs: false,
564
+ props: {
565
+ /** HTML tag to render. Use `:as-child` to compose onto an existing component. */
566
+ as: {
567
+ type: String,
568
+ default: "div"
569
+ },
570
+ /** Render the consumer's slot child as the root (Reka `asChild` pattern). */
571
+ asChild: {
572
+ type: Boolean,
573
+ default: false
574
+ },
575
+ /** Theme-class overrides for this component instance. */
576
+ themeClass: {
577
+ type: Object,
578
+ default: void 0
579
+ },
580
+ /** Theme-variant values for this component instance. */
581
+ themeVariant: {
582
+ type: Object,
583
+ default: void 0
584
+ }
585
+ },
586
+ setup(props, { attrs, slots }) {
587
+ const ctx = useCardContext();
588
+ const theme = useComponentTheme("cardBody", {
589
+ get themeClass() {
590
+ return props.themeClass;
591
+ },
592
+ get themeVariant() {
593
+ return {
594
+ ...ctx?.themeVariant() ?? {},
595
+ ...props.themeVariant ?? {}
596
+ };
597
+ }
598
+ }, cardBodyThemeDefaults);
599
+ return () => h(Primitive, mergeProps(attrs, {
600
+ as: props.as,
601
+ asChild: props.asChild,
602
+ class: theme.value.root || void 0
603
+ }), { default: () => slots.default?.() });
604
+ }
605
+ });
606
+ //#endregion
607
+ //#region src/components/card/CardFooter.vue
608
+ var CardFooter_default = defineComponent({
609
+ name: "VCCardFooter",
610
+ inheritAttrs: false,
611
+ props: {
612
+ /** HTML tag to render. Use `:as-child` to compose onto an existing component. */
613
+ as: {
614
+ type: String,
615
+ default: "footer"
616
+ },
617
+ /** Render the consumer's slot child as the root (Reka `asChild` pattern). */
618
+ asChild: {
619
+ type: Boolean,
620
+ default: false
621
+ },
622
+ /** Theme-class overrides for this component instance. */
623
+ themeClass: {
624
+ type: Object,
625
+ default: void 0
626
+ },
627
+ /** Theme-variant values for this component instance. */
628
+ themeVariant: {
629
+ type: Object,
630
+ default: void 0
631
+ }
632
+ },
633
+ setup(props, { attrs, slots }) {
634
+ const ctx = useCardContext();
635
+ const theme = useComponentTheme("cardFooter", {
636
+ get themeClass() {
637
+ return props.themeClass;
638
+ },
639
+ get themeVariant() {
640
+ return {
641
+ ...ctx?.themeVariant() ?? {},
642
+ ...props.themeVariant ?? {}
643
+ };
644
+ }
645
+ }, cardFooterThemeDefaults);
646
+ return () => h(Primitive, mergeProps(attrs, {
647
+ as: props.as,
648
+ asChild: props.asChild,
649
+ class: theme.value.root || void 0
650
+ }), { default: () => slots.default?.() });
651
+ }
652
+ });
653
+ //#endregion
654
+ //#region src/components/collapse/theme.ts
655
+ const collapseThemeDefaults = { classes: { root: "vc-collapse" } };
656
+ const collapseTriggerThemeDefaults = { classes: {
657
+ root: "vc-collapse-trigger",
658
+ chevron: "vc-collapse-chevron"
659
+ } };
660
+ const collapseContentThemeDefaults = { classes: { root: "vc-collapse-content" } };
661
+ //#endregion
662
+ //#region src/components/collapse/Collapse.vue
663
+ var Collapse_default = defineComponent({
664
+ name: "VCCollapse",
665
+ inheritAttrs: false,
666
+ props: {
667
+ /** Controlled open state. Leave undefined for uncontrolled (driven by `defaultOpen`). */
668
+ open: {
669
+ type: Boolean,
670
+ default: void 0
671
+ },
672
+ /** Initial open state when `open` is undefined. Reka default: `false`. */
673
+ defaultOpen: {
674
+ type: Boolean,
675
+ default: false
676
+ },
677
+ /** Disable interaction (trigger ignores clicks; pane stays in its current state). */
678
+ disabled: {
679
+ type: Boolean,
680
+ default: false
681
+ },
682
+ /**
683
+ * Unmount the content element when closed. When `false`, the element is
684
+ * kept in the DOM with `hidden` set — useful for preserving state inside
685
+ * the pane (form inputs, animations) across collapse/expand cycles.
686
+ * Reka default: `true`.
687
+ */
688
+ unmountOnHide: {
689
+ type: Boolean,
690
+ default: true
691
+ },
692
+ /** HTML tag to render. */
693
+ as: {
694
+ type: String,
695
+ default: "div"
696
+ },
697
+ /** Render the consumer's slot child as the root (Reka `asChild` pattern). */
698
+ asChild: {
699
+ type: Boolean,
700
+ default: false
701
+ },
702
+ ...themableProps()
703
+ },
704
+ emits: ["update:open"],
705
+ setup(props, { attrs, slots, emit }) {
706
+ const theme = useComponentTheme("collapse", useThemeProps(props), collapseThemeDefaults);
707
+ return () => h(CollapsibleRoot, mergeProps(attrs, {
708
+ as: props.as,
709
+ asChild: props.asChild,
710
+ open: props.open,
711
+ defaultOpen: props.defaultOpen,
712
+ disabled: props.disabled,
713
+ unmountOnHide: props.unmountOnHide,
714
+ class: theme.value.root || void 0,
715
+ "onUpdate:open": (open) => emit("update:open", open)
716
+ }), { default: () => slots.default?.() });
717
+ }
718
+ });
719
+ //#endregion
720
+ //#region src/components/collapse/CollapseTrigger.vue?vue&type=script&lang.ts
721
+ const collapseTriggerProps = {
722
+ /**
723
+ * Auto-render a rotating chevron next to the consumer's trigger content
724
+ * (`'auto'`, default) or render plain trigger content only (`'none'`).
725
+ * The chevron icon name comes from `ComponentDefaults['collapseTrigger'].chevronIcon`
726
+ * — usually wired by an icon preset (`@vuecs/icons-lucide` ships
727
+ * `'lucide:chevron-down'`).
728
+ */
729
+ chevron: {
730
+ type: String,
731
+ default: void 0
732
+ },
733
+ /** HTML tag (or component) to render as. Reka default: `'button'`. */
734
+ as: {
735
+ type: String,
736
+ default: "button"
737
+ },
738
+ /** Render the consumer's slot child as the trigger (Reka `asChild` pattern). */
739
+ asChild: {
740
+ type: Boolean,
741
+ default: false
742
+ },
743
+ ...themableProps()
744
+ };
745
+ const collapseTriggerBehavioralDefaults = { chevronIcon: "" };
746
+ //#endregion
747
+ //#region src/components/collapse/CollapseTrigger.vue
748
+ var CollapseTrigger_default = defineComponent({
749
+ name: "VCCollapseTrigger",
750
+ inheritAttrs: false,
751
+ props: collapseTriggerProps,
752
+ setup(props, { attrs, slots }) {
753
+ const theme = useComponentTheme("collapseTrigger", useThemeProps(props, "chevron"), collapseTriggerThemeDefaults);
754
+ const defaults = useComponentDefaults("collapseTrigger", {}, collapseTriggerBehavioralDefaults);
755
+ const VCIcon = resolveComponent("VCIcon");
756
+ const hasIconComponent = typeof VCIcon !== "string";
757
+ return () => {
758
+ const chevron = props.chevron ?? "auto";
759
+ const { chevronIcon } = defaults.value;
760
+ const showChevron = !props.asChild && chevron === "auto" && !!chevronIcon && hasIconComponent;
761
+ return h(CollapsibleTrigger, mergeProps(attrs, {
762
+ as: props.as,
763
+ asChild: props.asChild,
764
+ class: theme.value.root || void 0
765
+ }), { default: () => [slots.default?.(), showChevron ? h(VCIcon, {
766
+ name: chevronIcon,
767
+ class: theme.value.chevron || void 0,
768
+ "aria-hidden": "true"
769
+ }) : null] });
770
+ };
771
+ }
772
+ });
773
+ //#endregion
774
+ //#region src/components/collapse/CollapseContent.vue
775
+ var CollapseContent_default = defineComponent({
776
+ name: "VCCollapseContent",
777
+ inheritAttrs: false,
778
+ props: {
779
+ /**
780
+ * Force the content to stay mounted while closed. Use when you need
781
+ * Vue/transition-group control of the unmount cascade. Reka default: `false`.
782
+ */
783
+ forceMount: {
784
+ type: Boolean,
785
+ default: false
786
+ },
787
+ /** HTML tag to render. */
788
+ as: {
789
+ type: String,
790
+ default: "div"
791
+ },
792
+ /** Render the consumer's slot child as the pane root (Reka `asChild` pattern). */
793
+ asChild: {
794
+ type: Boolean,
795
+ default: false
796
+ },
797
+ ...themableProps()
798
+ },
799
+ setup(props, { attrs, slots }) {
800
+ const theme = useComponentTheme("collapseContent", useThemeProps(props), collapseContentThemeDefaults);
801
+ return () => h(CollapsibleContent, mergeProps(attrs, {
802
+ as: props.as,
803
+ asChild: props.asChild,
804
+ forceMount: props.forceMount || void 0,
805
+ class: theme.value.root || void 0
806
+ }), { default: () => slots.default?.() });
807
+ }
808
+ });
809
+ //#endregion
810
+ //#region src/components/separator/theme.ts
811
+ const separatorThemeDefaults = { classes: { root: "vc-separator" } };
812
+ //#endregion
813
+ //#region src/components/separator/Separator.vue
814
+ var Separator_default = defineComponent({
815
+ name: "VCSeparator",
816
+ inheritAttrs: false,
817
+ props: {
818
+ /** Layout direction. */
819
+ orientation: {
820
+ type: String,
821
+ default: "horizontal"
822
+ },
823
+ /**
824
+ * When `true`, removes the separator from the a11y tree (`role="none"`).
825
+ * Pass `:decorative="false"` to expose it with `role="separator"` +
826
+ * `aria-orientation`.
827
+ *
828
+ * Vuecs convention: defaults to `true` (Reka has no explicit default
829
+ * — undefined falls through to `role="separator"`). Most consumer
830
+ * usages of `<VCSeparator>` are visual dividers, so the safer
831
+ * a11y default is "decorative".
832
+ */
833
+ decorative: {
834
+ type: Boolean,
835
+ default: true
836
+ },
837
+ /** Theme-class overrides for this component instance. */
838
+ themeClass: {
839
+ type: Object,
840
+ default: void 0
841
+ },
842
+ /** Theme-variant values for this component instance. */
843
+ themeVariant: {
844
+ type: Object,
845
+ default: void 0
846
+ }
847
+ },
848
+ setup(props, { attrs }) {
849
+ const theme = useComponentTheme("separator", props, separatorThemeDefaults);
850
+ return () => h(Separator, mergeProps(attrs, {
851
+ orientation: props.orientation,
852
+ decorative: props.decorative,
853
+ class: theme.value.root || void 0
854
+ }));
855
+ }
856
+ });
857
+ //#endregion
858
+ //#region src/components/tag/theme.ts
859
+ const tagThemeDefaults = { classes: {
860
+ root: "vc-tag",
861
+ icon: "vc-tag-icon",
862
+ remove: "vc-tag-remove"
863
+ } };
864
+ const tagsThemeDefaults = { classes: {
865
+ root: "vc-tags",
866
+ item: "vc-tags-item"
867
+ } };
868
+ //#endregion
869
+ //#region src/components/tag/Tag.vue
870
+ var Tag_default = defineComponent({
871
+ name: "VCTag",
872
+ inheritAttrs: false,
873
+ props: {
874
+ /** Bound value — emitted on remove, also used by `<VCTags>` as the chip key. */
875
+ value: {
876
+ type: [String, Number],
877
+ default: void 0
878
+ },
879
+ /** Display label. Default slot wins if both are passed. */
880
+ label: {
881
+ type: String,
882
+ default: void 0
883
+ },
884
+ /** Iconify-style icon name forwarded to the leading `icon` slot. */
885
+ icon: {
886
+ type: String,
887
+ default: void 0
888
+ },
889
+ /** When `true`, renders the trailing remove button. */
890
+ removable: {
891
+ type: Boolean,
892
+ default: false
893
+ },
894
+ /** Size variant key — resolved by the active theme. */
895
+ size: {
896
+ type: String,
897
+ default: void 0
898
+ },
899
+ /** Theme-class overrides for this component instance. */
900
+ themeClass: {
901
+ type: Object,
902
+ default: void 0
903
+ },
904
+ /** Theme-variant values for this component instance. */
905
+ themeVariant: {
906
+ type: Object,
907
+ default: void 0
908
+ }
909
+ },
910
+ emits: ["remove"],
911
+ slots: Object,
912
+ setup(props, { attrs, slots, emit }) {
913
+ const VCIcon = resolveComponent("VCIcon");
914
+ const hasIconComponent = typeof VCIcon !== "string";
915
+ const theme = useComponentTheme("tag", {
916
+ get themeClass() {
917
+ return props.themeClass;
918
+ },
919
+ get themeVariant() {
920
+ return {
921
+ ...props.themeVariant ?? {},
922
+ ...props.size !== void 0 ? { size: props.size } : {}
923
+ };
924
+ }
925
+ }, tagThemeDefaults);
926
+ return () => {
927
+ const resolved = theme.value;
928
+ const label = props.label ?? (props.value !== void 0 ? String(props.value) : "");
929
+ const children = [];
930
+ if (props.icon || slots.icon) {
931
+ const iconSlot = slots.icon;
932
+ let iconNode;
933
+ if (iconSlot) iconNode = iconSlot({ class: resolved.icon });
934
+ else if (hasIconComponent) iconNode = [h(VCIcon, { name: props.icon })];
935
+ else iconNode = [props.icon];
936
+ children.push(h("span", { class: resolved.icon || void 0 }, iconNode));
937
+ }
938
+ children.push(slots.default ? slots.default({ label }) : [label]);
939
+ if (props.removable) {
940
+ const remove = () => emit("remove", props.value);
941
+ children.push(slots.remove ? slots.remove({
942
+ class: resolved.remove,
943
+ remove
944
+ }) : h("button", {
945
+ type: "button",
946
+ "aria-label": label ? `Remove ${label}` : "Remove",
947
+ class: resolved.remove || void 0,
948
+ onClick: (event) => {
949
+ event.stopPropagation();
950
+ remove();
951
+ }
952
+ }, "×"));
953
+ }
954
+ return h("span", mergeProps(attrs, { class: resolved.root || void 0 }), children);
955
+ };
956
+ }
957
+ });
958
+ //#endregion
959
+ //#region src/components/tag/Tags.vue?vue&type=script&lang.ts
960
+ const tagsProps = {
961
+ /**
962
+ * Items to render. Strings/numbers are coerced to `{ value, label: String(value) }`.
963
+ * Objects follow the `TagItem` shape (structurally compatible with `FormOption`).
964
+ */
965
+ items: {
966
+ type: Array,
967
+ default: () => []
968
+ },
969
+ /** When `true`, every chip renders its remove button (per-item `disabled` opts out). */
970
+ removable: {
971
+ type: Boolean,
972
+ default: false
973
+ },
974
+ /** Default size forwarded to every chip; per-item `size` overrides. */
975
+ size: {
976
+ type: String,
977
+ default: void 0
978
+ },
979
+ /** Theme-class overrides for this component instance. */
980
+ themeClass: {
981
+ type: Object,
982
+ default: void 0
983
+ },
984
+ /** Theme-variant values for this component instance. */
985
+ themeVariant: {
986
+ type: Object,
987
+ default: void 0
988
+ }
989
+ };
990
+ function normalize(item) {
991
+ if (typeof item === "string" || typeof item === "number") return {
992
+ value: item,
993
+ label: String(item)
994
+ };
995
+ return item;
996
+ }
997
+ //#endregion
998
+ //#region src/components/tag/Tags.vue
999
+ var Tags_default = defineComponent({
1000
+ name: "VCTags",
1001
+ inheritAttrs: false,
1002
+ props: tagsProps,
1003
+ emits: ["remove"],
1004
+ slots: Object,
1005
+ setup(props, { attrs, slots, emit }) {
1006
+ const theme = useComponentTheme("tags", props, tagsThemeDefaults);
1007
+ return () => {
1008
+ const resolved = theme.value;
1009
+ const children = props.items.map((raw, index) => {
1010
+ const item = normalize(raw);
1011
+ if (slots.item) return slots.item({
1012
+ item,
1013
+ index,
1014
+ class: resolved.item
1015
+ });
1016
+ return h(Tag_default, {
1017
+ key: item.value,
1018
+ value: item.value,
1019
+ label: item.label,
1020
+ icon: item.icon,
1021
+ size: item.size ?? props.size,
1022
+ removable: props.removable && !item.disabled,
1023
+ class: resolved.item || void 0,
1024
+ onRemove: (value) => emit("remove", value, item)
1025
+ });
1026
+ });
1027
+ return h("div", mergeProps(attrs, { class: resolved.root || void 0 }), children);
1028
+ };
1029
+ }
1030
+ });
1031
+ //#endregion
1032
+ //#region src/components/visually-hidden/VisuallyHidden.vue
1033
+ var VisuallyHidden_default = defineComponent({
1034
+ name: "VCVisuallyHidden",
1035
+ inheritAttrs: false,
1036
+ props: {
1037
+ /** HTML tag to render. */
1038
+ as: {
1039
+ type: String,
1040
+ default: "span"
1041
+ } },
1042
+ setup(props, { attrs, slots }) {
1043
+ return () => h(VisuallyHidden, mergeProps(attrs, { as: props.as }), { default: () => slots.default?.() });
1044
+ }
1045
+ });
1046
+ //#endregion
1047
+ //#region src/index.ts
1048
+ function install(app, options = {}) {
1049
+ installThemeManager(app, options);
1050
+ installDefaultsManager(app, options);
1051
+ Object.entries({
1052
+ VCSeparator: Separator_default,
1053
+ VCTag: Tag_default,
1054
+ VCTags: Tags_default,
1055
+ VCAvatar: Avatar_default,
1056
+ VCAspectRatio: AspectRatio_default,
1057
+ VCVisuallyHidden: VisuallyHidden_default,
1058
+ VCBadge: Badge_default,
1059
+ VCCard: Card_default,
1060
+ VCCardHeader: CardHeader_default,
1061
+ VCCardTitle: CardTitle_default,
1062
+ VCCardDescription: CardDescription_default,
1063
+ VCCardBody: CardBody_default,
1064
+ VCCardFooter: CardFooter_default,
1065
+ VCCollapse: Collapse_default,
1066
+ VCCollapseTrigger: CollapseTrigger_default,
1067
+ VCCollapseContent: CollapseContent_default,
1068
+ VCAlert: Alert_default,
1069
+ VCAlertTitle: AlertTitle_default,
1070
+ VCAlertDescription: AlertDescription_default,
1071
+ VCAlertClose: AlertClose_default
1072
+ }).forEach(([name, component]) => {
1073
+ app.component(name, component);
1074
+ });
1075
+ }
1076
+ var src_default = { install };
1077
+ //#endregion
1078
+ export { Alert_default as VCAlert, AlertClose_default as VCAlertClose, AlertDescription_default as VCAlertDescription, AlertTitle_default as VCAlertTitle, AspectRatio_default as VCAspectRatio, Avatar_default as VCAvatar, Badge_default as VCBadge, Card_default as VCCard, CardBody_default as VCCardBody, CardDescription_default as VCCardDescription, CardFooter_default as VCCardFooter, CardHeader_default as VCCardHeader, CardTitle_default as VCCardTitle, Collapse_default as VCCollapse, CollapseContent_default as VCCollapseContent, CollapseTrigger_default as VCCollapseTrigger, Separator_default as VCSeparator, Tag_default as VCTag, Tags_default as VCTags, VisuallyHidden_default as VCVisuallyHidden, alertDescriptionThemeDefaults, alertThemeDefaults, alertTitleThemeDefaults, aspectRatioThemeDefaults, avatarThemeDefaults, badgeThemeDefaults, cardBodyThemeDefaults, cardDescriptionThemeDefaults, cardFooterThemeDefaults, cardHeaderThemeDefaults, cardThemeDefaults, cardTitleThemeDefaults, collapseContentThemeDefaults, collapseThemeDefaults, collapseTriggerThemeDefaults, src_default as default, install, provideCardContext, separatorThemeDefaults, tagThemeDefaults, tagsThemeDefaults, useCardContext };
1079
+
1080
+ //# sourceMappingURL=index.mjs.map