@tu-design/vue 0.0.0-stage → 0.2.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.
package/dist/index.mjs ADDED
@@ -0,0 +1,1377 @@
1
+ import { clsx } from "clsx";
2
+ import { twMerge } from "tailwind-merge";
3
+ import { Comment, Fragment, Text, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, h, mergeModels, normalizeClass, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, unref, useId, useModel, vModelText, withCtx, withDirectives } from "vue";
4
+ import { Avatar } from "@ark-ui/vue/avatar";
5
+ import { cva } from "class-variance-authority";
6
+ import { Checkbox } from "@ark-ui/vue/checkbox";
7
+ import { Dialog } from "@ark-ui/vue/dialog";
8
+ import { Menu } from "@ark-ui/vue/menu";
9
+ import { RadioGroup } from "@ark-ui/vue/radio-group";
10
+ import { createListCollection } from "@ark-ui/vue/collection";
11
+ import { Select } from "@ark-ui/vue/select";
12
+ import { Slider } from "@ark-ui/vue/slider";
13
+ import { Switch } from "@ark-ui/vue/switch";
14
+ import { Tabs } from "@ark-ui/vue/tabs";
15
+ import { Tooltip } from "@ark-ui/vue/tooltip";
16
+ //#region src/lib/utils.ts
17
+ function cn(...inputs) {
18
+ return twMerge(clsx(inputs));
19
+ }
20
+ //#endregion
21
+ //#region src/resolver.ts
22
+ /**
23
+ * unplugin-vue-components 专用 Resolver:
24
+ * 消费者配置后可在模板中直接使用 <TButton> / <t-button>,无需手动 import。
25
+ *
26
+ * 采用白名单而非裸 /^T[A-Z]/ 正则,避免误捕 Vue 内置组件
27
+ * (Transition/Teleport 等 T 开头名称会被 slice(1) 解析成错误导入)。
28
+ * 白名单与 index.ts 的组件导出保持同步(resolver.test.ts 强制校验)。
29
+ */
30
+ const COMPONENT_NAMES = [
31
+ "Avatar",
32
+ "Badge",
33
+ "Button",
34
+ "Card",
35
+ "CardContent",
36
+ "CardDescription",
37
+ "CardFooter",
38
+ "CardHeader",
39
+ "CardTitle",
40
+ "Checkbox",
41
+ "Dialog",
42
+ "DialogClose",
43
+ "DialogContent",
44
+ "DialogDescription",
45
+ "DialogFooter",
46
+ "DialogHeader",
47
+ "DialogTitle",
48
+ "DialogTrigger",
49
+ "DropdownMenu",
50
+ "DropdownMenuContent",
51
+ "DropdownMenuGroup",
52
+ "DropdownMenuItem",
53
+ "DropdownMenuLabel",
54
+ "DropdownMenuSeparator",
55
+ "DropdownMenuTrigger",
56
+ "Input",
57
+ "Label",
58
+ "RadioGroup",
59
+ "RadioGroupItem",
60
+ "Select",
61
+ "SelectContent",
62
+ "SelectItem",
63
+ "SelectTrigger",
64
+ "SelectValueText",
65
+ "Separator",
66
+ "Skeleton",
67
+ "Slider",
68
+ "Slot",
69
+ "Switch",
70
+ "Tabs",
71
+ "TabsContent",
72
+ "TabsList",
73
+ "TabsTrigger",
74
+ "Tooltip",
75
+ "TooltipContent",
76
+ "TooltipTrigger"
77
+ ];
78
+ function TuDesignResolver() {
79
+ return (name) => {
80
+ if (!/^T[A-Z]/.test(name)) return;
81
+ const partial = name.slice(1);
82
+ if (!COMPONENT_NAMES.includes(partial)) return;
83
+ return {
84
+ name: partial,
85
+ from: "@tu-design/vue"
86
+ };
87
+ };
88
+ }
89
+ //#endregion
90
+ //#region src/components/avatar/Avatar.vue
91
+ const _sfc_main = /*@__PURE__*/ defineComponent({
92
+ __name: "Avatar",
93
+ props: {
94
+ src: {},
95
+ alt: {},
96
+ class: {}
97
+ },
98
+ setup(__props) {
99
+ const props = __props;
100
+ return (_ctx, _cache) => {
101
+ return openBlock(), createBlock(unref(Avatar).Root, { class: normalizeClass(unref(cn)("inline-flex size-10 overflow-hidden rounded-full", props.class)) }, {
102
+ default: withCtx(() => [props.src ? (openBlock(), createBlock(unref(Avatar).Image, {
103
+ key: 0,
104
+ src: props.src,
105
+ alt: props.alt,
106
+ class: "size-full object-cover"
107
+ }, null, 8, ["src", "alt"])) : createCommentVNode("v-if", true), createVNode(unref(Avatar).Fallback, { class: "flex size-full items-center justify-center bg-muted" }, {
108
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
109
+ _: 3
110
+ })]),
111
+ _: 3
112
+ }, 8, ["class"]);
113
+ };
114
+ }
115
+ });
116
+ //#endregion
117
+ //#region src/components/badge/Badge.vue
118
+ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
119
+ __name: "Badge",
120
+ props: {
121
+ variant: {},
122
+ class: {}
123
+ },
124
+ setup(__props) {
125
+ const props = __props;
126
+ return (_ctx, _cache) => {
127
+ return openBlock(), createElementBlock("span", { class: normalizeClass(unref(cn)(unref(badgeVariants)({ variant: props.variant }), props.class)) }, [renderSlot(_ctx.$slots, "default")], 2);
128
+ };
129
+ }
130
+ });
131
+ //#endregion
132
+ //#region src/components/badge/index.ts
133
+ const badgeVariants = cva("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0", {
134
+ variants: { variant: {
135
+ default: "bg-primary text-primary-foreground",
136
+ secondary: "bg-secondary text-secondary-foreground",
137
+ destructive: "bg-destructive text-white",
138
+ outline: "text-foreground border border-input"
139
+ } },
140
+ defaultVariants: { variant: "default" }
141
+ });
142
+ //#endregion
143
+ //#region src/components/slot/Slot.ts
144
+ /** 递归展平 `<slot />` 插槽出口(renderSlot)产生的 Fragment 包裹,取出真实子节点。 */
145
+ function flattenVNodes(children) {
146
+ const out = [];
147
+ for (const child of children) if (child.type === Fragment && Array.isArray(child.children)) out.push(...flattenVNodes(child.children));
148
+ else out.push(child);
149
+ return out;
150
+ }
151
+ /**
152
+ * asChild 组合原语:把落在自身上的 attrs(class、事件、透传属性)合并到默认插槽的
153
+ * 第一个元素子节点上,而不是渲染额外 DOM。Button 的 asChild 与后续交互组件批次的
154
+ * 组合能力都以此为基础。
155
+ *
156
+ * 合并语义(对齐 radix Slot):
157
+ * - 子元素自身标量 props 优先于注入的同名属性;
158
+ * - class 经 cn 做 tailwind-merge 冲突合并(注入方的变体类可被子元素同类覆盖),
159
+ * 且以 createVNode 重建子节点,避免 cloneVNode 拼接造成 class 重复;
160
+ * - 事件处理器链式合并(子元素先触发,注入方后触发);
161
+ * - 子节点为文本/注释(如 v-if 为 false)时原样渲染,class 等注入丢弃;
162
+ * - 默认插槽展平后为空时抛错。
163
+ */
164
+ const Slot = defineComponent({
165
+ name: "Slot",
166
+ inheritAttrs: false,
167
+ setup(_, { attrs, slots }) {
168
+ return () => {
169
+ const children = flattenVNodes(slots.default?.() ?? []);
170
+ if (children.length === 0) throw new Error("Slot:需要一个默认插槽子节点");
171
+ const [first, ...rest] = children;
172
+ if (first.type === Text || first.type === Comment) return rest.length > 0 ? h(Fragment, children) : first;
173
+ const childProps = first.props ?? {};
174
+ const injected = attrs;
175
+ const props = {
176
+ ...childProps,
177
+ key: first.key
178
+ };
179
+ for (const [key, value] of Object.entries(injected)) {
180
+ if (key === "class") continue;
181
+ if (key === "style") props.style = props.style === void 0 ? value : [value, props.style];
182
+ else if (key.startsWith("on")) {
183
+ const prev = props[key];
184
+ props[key] = prev === void 0 ? value : Array.isArray(prev) ? [...prev, value] : [prev, value];
185
+ } else if (!(key in props)) props[key] = value;
186
+ }
187
+ props.class = cn(injected.class, childProps.class);
188
+ const target = createVNode(first.type, props, first.children);
189
+ return rest.length > 0 ? h(Fragment, [target, ...rest]) : target;
190
+ };
191
+ }
192
+ });
193
+ //#endregion
194
+ //#region src/components/button/Button.vue
195
+ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
196
+ __name: "Button",
197
+ props: {
198
+ variant: {},
199
+ size: {},
200
+ as: { default: "button" },
201
+ asChild: { type: Boolean },
202
+ class: {}
203
+ },
204
+ setup(__props) {
205
+ const props = __props;
206
+ return (_ctx, _cache) => {
207
+ return props.asChild ? (openBlock(), createBlock(unref(Slot), {
208
+ key: 0,
209
+ class: normalizeClass(unref(cn)(unref(buttonVariants)({
210
+ variant: props.variant,
211
+ size: props.size
212
+ }), props.class))
213
+ }, {
214
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
215
+ _: 3
216
+ }, 8, ["class"])) : (openBlock(), createBlock(resolveDynamicComponent(props.as), {
217
+ key: 1,
218
+ class: normalizeClass(unref(cn)(unref(buttonVariants)({
219
+ variant: props.variant,
220
+ size: props.size
221
+ }), props.class))
222
+ }, {
223
+ default: withCtx(() => [renderSlot(_ctx.$slots, "icon"), renderSlot(_ctx.$slots, "default")]),
224
+ _: 3
225
+ }, 8, ["class"]));
226
+ };
227
+ }
228
+ });
229
+ //#endregion
230
+ //#region src/components/button/index.ts
231
+ const buttonVariants = cva("inline-flex select-none items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium transition-[color,background-color,border-color,box-shadow,transform] [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 disabled:pointer-events-none disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background active:scale-[0.98]", {
232
+ variants: {
233
+ variant: {
234
+ default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90 hover:shadow-sm",
235
+ destructive: "bg-destructive text-white shadow-xs hover:bg-destructive/90",
236
+ outline: "border border-input bg-background hover:border-muted-foreground/25 hover:bg-muted",
237
+ secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
238
+ ghost: "hover:bg-muted",
239
+ link: "text-primary underline-offset-4 hover:underline"
240
+ },
241
+ size: {
242
+ default: "h-9 px-4 py-2",
243
+ sm: "h-8 px-3",
244
+ lg: "h-10 px-6",
245
+ icon: "size-9"
246
+ }
247
+ },
248
+ defaultVariants: {
249
+ variant: "default",
250
+ size: "default"
251
+ }
252
+ });
253
+ //#endregion
254
+ //#region src/components/card/Card.vue
255
+ const _sfc_main$3 = /*@__PURE__*/ defineComponent({
256
+ __name: "Card",
257
+ props: { class: {} },
258
+ setup(__props) {
259
+ const props = __props;
260
+ return (_ctx, _cache) => {
261
+ return openBlock(), createElementBlock("div", { class: normalizeClass(unref(cn)("rounded-xl border border-border bg-card text-card-foreground shadow-xs", props.class)) }, [renderSlot(_ctx.$slots, "default")], 2);
262
+ };
263
+ }
264
+ });
265
+ //#endregion
266
+ //#region src/components/card/CardContent.vue
267
+ const _sfc_main$4 = /*@__PURE__*/ defineComponent({
268
+ __name: "CardContent",
269
+ props: { class: {} },
270
+ setup(__props) {
271
+ const props = __props;
272
+ return (_ctx, _cache) => {
273
+ return openBlock(), createElementBlock("div", { class: normalizeClass(unref(cn)("p-6 pt-0", props.class)) }, [renderSlot(_ctx.$slots, "default")], 2);
274
+ };
275
+ }
276
+ });
277
+ //#endregion
278
+ //#region src/components/card/CardDescription.vue
279
+ const _sfc_main$5 = /*@__PURE__*/ defineComponent({
280
+ __name: "CardDescription",
281
+ props: { class: {} },
282
+ setup(__props) {
283
+ const props = __props;
284
+ return (_ctx, _cache) => {
285
+ return openBlock(), createElementBlock("p", { class: normalizeClass(unref(cn)("text-sm text-muted-foreground", props.class)) }, [renderSlot(_ctx.$slots, "default")], 2);
286
+ };
287
+ }
288
+ });
289
+ //#endregion
290
+ //#region src/components/card/CardFooter.vue
291
+ const _sfc_main$6 = /*@__PURE__*/ defineComponent({
292
+ __name: "CardFooter",
293
+ props: { class: {} },
294
+ setup(__props) {
295
+ const props = __props;
296
+ return (_ctx, _cache) => {
297
+ return openBlock(), createElementBlock("div", { class: normalizeClass(unref(cn)("flex items-center p-6 pt-0", props.class)) }, [renderSlot(_ctx.$slots, "default")], 2);
298
+ };
299
+ }
300
+ });
301
+ //#endregion
302
+ //#region src/components/card/CardHeader.vue
303
+ const _sfc_main$7 = /*@__PURE__*/ defineComponent({
304
+ __name: "CardHeader",
305
+ props: { class: {} },
306
+ setup(__props) {
307
+ const props = __props;
308
+ return (_ctx, _cache) => {
309
+ return openBlock(), createElementBlock("div", { class: normalizeClass(unref(cn)("flex flex-col gap-1.5 p-6", props.class)) }, [renderSlot(_ctx.$slots, "default")], 2);
310
+ };
311
+ }
312
+ });
313
+ //#endregion
314
+ //#region src/components/card/CardTitle.vue
315
+ const _sfc_main$8 = /*@__PURE__*/ defineComponent({
316
+ __name: "CardTitle",
317
+ props: { class: {} },
318
+ setup(__props) {
319
+ const props = __props;
320
+ return (_ctx, _cache) => {
321
+ return openBlock(), createElementBlock("h3", { class: normalizeClass(unref(cn)("font-semibold leading-none tracking-tight", props.class)) }, [renderSlot(_ctx.$slots, "default")], 2);
322
+ };
323
+ }
324
+ });
325
+ //#endregion
326
+ //#region src/components/checkbox/Checkbox.vue
327
+ const _sfc_main$9 = /*@__PURE__*/ defineComponent({
328
+ __name: "Checkbox",
329
+ props: {
330
+ checked: {
331
+ type: Boolean,
332
+ default: void 0
333
+ },
334
+ defaultChecked: {
335
+ type: Boolean,
336
+ default: false
337
+ },
338
+ disabled: {
339
+ type: Boolean,
340
+ default: false
341
+ },
342
+ class: {
343
+ type: String,
344
+ default: void 0
345
+ }
346
+ },
347
+ emits: ["update:checked"],
348
+ setup(__props, { emit: __emit }) {
349
+ const props = __props;
350
+ const emit = __emit;
351
+ const internalChecked = ref(props.defaultChecked);
352
+ const isChecked = computed(() => props.checked ?? internalChecked.value);
353
+ function handleUpdate(checked) {
354
+ internalChecked.value = checked;
355
+ emit("update:checked", checked);
356
+ }
357
+ return (_ctx, _cache) => {
358
+ return openBlock(), createBlock(unref(Checkbox).Root, {
359
+ checked: isChecked.value,
360
+ disabled: props.disabled,
361
+ class: normalizeClass(unref(cn)("inline-flex items-center gap-2", props.class)),
362
+ "onUpdate:checked": handleUpdate
363
+ }, {
364
+ default: withCtx(() => [
365
+ createVNode(unref(Checkbox).HiddenInput),
366
+ createVNode(unref(Checkbox).Control, { class: "border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 peer size-4 shrink-0 rounded-[4px] border bg-transparent shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50" }, {
367
+ default: withCtx(() => [createVNode(unref(Checkbox).Indicator, { class: "flex items-center justify-center text-current" }, {
368
+ default: withCtx(() => [..._cache[0] || (_cache[0] = [createElementVNode("svg", {
369
+ viewBox: "0 0 24 24",
370
+ fill: "none",
371
+ stroke: "currentColor",
372
+ "stroke-width": "3",
373
+ "stroke-linecap": "round",
374
+ "stroke-linejoin": "round",
375
+ class: "size-3.5"
376
+ }, [createElementVNode("path", { d: "M20 6 9 17l-5-5" })], -1)])]),
377
+ _: 1
378
+ })]),
379
+ _: 1
380
+ }),
381
+ _ctx.$slots.default ? (openBlock(), createBlock(unref(Checkbox).Label, {
382
+ key: 0,
383
+ class: "text-sm leading-none font-medium select-none"
384
+ }, {
385
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
386
+ _: 3
387
+ })) : createCommentVNode("v-if", true)
388
+ ]),
389
+ _: 3
390
+ }, 8, [
391
+ "checked",
392
+ "disabled",
393
+ "class"
394
+ ]);
395
+ };
396
+ }
397
+ });
398
+ //#endregion
399
+ //#region src/components/dialog/Dialog.vue
400
+ const _sfc_main$10 = /*@__PURE__*/ defineComponent({
401
+ __name: "Dialog",
402
+ props: {
403
+ open: {
404
+ type: Boolean,
405
+ default: void 0
406
+ },
407
+ defaultOpen: {
408
+ type: Boolean,
409
+ default: false
410
+ },
411
+ lazyMount: {
412
+ type: Boolean,
413
+ default: false
414
+ },
415
+ unmountOnExit: {
416
+ type: Boolean,
417
+ default: false
418
+ }
419
+ },
420
+ emits: ["update:open"],
421
+ setup(__props, { emit: __emit }) {
422
+ const props = __props;
423
+ const emit = __emit;
424
+ const internalOpen = ref(props.defaultOpen);
425
+ const isOpen = computed(() => props.open ?? internalOpen.value);
426
+ function handleUpdate(open) {
427
+ internalOpen.value = open;
428
+ emit("update:open", open);
429
+ }
430
+ return (_ctx, _cache) => {
431
+ return openBlock(), createBlock(unref(Dialog).Root, {
432
+ open: isOpen.value,
433
+ "lazy-mount": props.lazyMount,
434
+ "unmount-on-exit": props.unmountOnExit,
435
+ "onUpdate:open": handleUpdate
436
+ }, {
437
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
438
+ _: 3
439
+ }, 8, [
440
+ "open",
441
+ "lazy-mount",
442
+ "unmount-on-exit"
443
+ ]);
444
+ };
445
+ }
446
+ });
447
+ //#endregion
448
+ //#region src/components/dialog/DialogClose.vue
449
+ const _sfc_main$11 = /*@__PURE__*/ defineComponent({
450
+ __name: "DialogClose",
451
+ props: { asChild: { type: Boolean } },
452
+ setup(__props) {
453
+ const props = __props;
454
+ return (_ctx, _cache) => {
455
+ return openBlock(), createBlock(unref(Dialog).CloseTrigger, { "as-child": props.asChild }, {
456
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
457
+ _: 3
458
+ }, 8, ["as-child"]);
459
+ };
460
+ }
461
+ });
462
+ //#endregion
463
+ //#region src/components/dialog/DialogContent.vue
464
+ const _sfc_main$12 = /*@__PURE__*/ defineComponent({
465
+ __name: "DialogContent",
466
+ props: {
467
+ showCloseButton: {
468
+ type: Boolean,
469
+ default: true
470
+ },
471
+ class: {}
472
+ },
473
+ setup(__props) {
474
+ const props = __props;
475
+ return (_ctx, _cache) => {
476
+ return openBlock(), createElementBlock(Fragment, null, [createVNode(unref(Dialog).Backdrop, { class: "fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0" }), createVNode(unref(Dialog).Positioner, { class: "fixed inset-0 z-50 flex items-center justify-center p-4" }, {
477
+ default: withCtx(() => [createVNode(unref(Dialog).Content, { class: normalizeClass(unref(cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed left-1/2 top-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border p-6 shadow-lg duration-200 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:max-w-lg", props.class)) }, {
478
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default"), props.showCloseButton ? (openBlock(), createBlock(unref(Dialog).CloseTrigger, {
479
+ key: 0,
480
+ class: "absolute right-4 top-4 cursor-pointer rounded-sm opacity-70 transition-opacity hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none"
481
+ }, {
482
+ default: withCtx(() => [..._cache[0] || (_cache[0] = [createElementVNode("svg", {
483
+ viewBox: "0 0 24 24",
484
+ fill: "none",
485
+ stroke: "currentColor",
486
+ "stroke-width": "2",
487
+ "stroke-linecap": "round",
488
+ "stroke-linejoin": "round",
489
+ class: "size-4"
490
+ }, [createElementVNode("path", { d: "M18 6 6 18" }), createElementVNode("path", { d: "m6 6 12 12" })], -1), createElementVNode("span", { class: "sr-only" }, "关闭", -1)])]),
491
+ _: 1
492
+ })) : createCommentVNode("v-if", true)]),
493
+ _: 3
494
+ }, 8, ["class"])]),
495
+ _: 3
496
+ })], 64);
497
+ };
498
+ }
499
+ });
500
+ //#endregion
501
+ //#region src/components/dialog/DialogDescription.vue
502
+ const _sfc_main$13 = /*@__PURE__*/ defineComponent({
503
+ __name: "DialogDescription",
504
+ props: { class: {} },
505
+ setup(__props) {
506
+ const props = __props;
507
+ return (_ctx, _cache) => {
508
+ return openBlock(), createBlock(unref(Dialog).Description, { class: normalizeClass(unref(cn)("text-sm text-muted-foreground", props.class)) }, {
509
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
510
+ _: 3
511
+ }, 8, ["class"]);
512
+ };
513
+ }
514
+ });
515
+ //#endregion
516
+ //#region src/components/dialog/DialogFooter.vue
517
+ const _sfc_main$14 = /*@__PURE__*/ defineComponent({
518
+ __name: "DialogFooter",
519
+ props: { class: {} },
520
+ setup(__props) {
521
+ const props = __props;
522
+ return (_ctx, _cache) => {
523
+ return openBlock(), createElementBlock("div", { class: normalizeClass(unref(cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", props.class)) }, [renderSlot(_ctx.$slots, "default")], 2);
524
+ };
525
+ }
526
+ });
527
+ //#endregion
528
+ //#region src/components/dialog/DialogHeader.vue
529
+ const _sfc_main$15 = /*@__PURE__*/ defineComponent({
530
+ __name: "DialogHeader",
531
+ props: { class: {} },
532
+ setup(__props) {
533
+ const props = __props;
534
+ return (_ctx, _cache) => {
535
+ return openBlock(), createElementBlock("div", { class: normalizeClass(unref(cn)("flex flex-col gap-2 text-center sm:text-left", props.class)) }, [renderSlot(_ctx.$slots, "default")], 2);
536
+ };
537
+ }
538
+ });
539
+ //#endregion
540
+ //#region src/components/dialog/DialogTitle.vue
541
+ const _sfc_main$16 = /*@__PURE__*/ defineComponent({
542
+ __name: "DialogTitle",
543
+ props: { class: {} },
544
+ setup(__props) {
545
+ const props = __props;
546
+ return (_ctx, _cache) => {
547
+ return openBlock(), createBlock(unref(Dialog).Title, { class: normalizeClass(unref(cn)("text-lg font-semibold leading-none tracking-tight", props.class)) }, {
548
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
549
+ _: 3
550
+ }, 8, ["class"]);
551
+ };
552
+ }
553
+ });
554
+ //#endregion
555
+ //#region src/components/dialog/DialogTrigger.vue
556
+ const _sfc_main$17 = /*@__PURE__*/ defineComponent({
557
+ __name: "DialogTrigger",
558
+ props: { asChild: { type: Boolean } },
559
+ setup(__props) {
560
+ const props = __props;
561
+ return (_ctx, _cache) => {
562
+ return openBlock(), createBlock(unref(Dialog).Trigger, { "as-child": props.asChild }, {
563
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
564
+ _: 3
565
+ }, 8, ["as-child"]);
566
+ };
567
+ }
568
+ });
569
+ //#endregion
570
+ //#region src/components/dropdown-menu/DropdownMenu.vue
571
+ const _sfc_main$18 = /*@__PURE__*/ defineComponent({
572
+ __name: "DropdownMenu",
573
+ props: {
574
+ open: {
575
+ type: Boolean,
576
+ default: void 0
577
+ },
578
+ defaultOpen: {
579
+ type: Boolean,
580
+ default: false
581
+ },
582
+ lazyMount: {
583
+ type: Boolean,
584
+ default: false
585
+ },
586
+ unmountOnExit: {
587
+ type: Boolean,
588
+ default: false
589
+ }
590
+ },
591
+ emits: ["update:open", "select"],
592
+ setup(__props, { emit: __emit }) {
593
+ const props = __props;
594
+ const emit = __emit;
595
+ const internalOpen = ref(props.defaultOpen);
596
+ const isOpen = computed(() => props.open ?? internalOpen.value);
597
+ function handleUpdate(open) {
598
+ internalOpen.value = open;
599
+ emit("update:open", open);
600
+ }
601
+ function handleSelect(details) {
602
+ emit("select", details);
603
+ }
604
+ return (_ctx, _cache) => {
605
+ return openBlock(), createBlock(unref(Menu).Root, {
606
+ open: isOpen.value,
607
+ "lazy-mount": props.lazyMount,
608
+ "unmount-on-exit": props.unmountOnExit,
609
+ "onUpdate:open": handleUpdate,
610
+ onSelect: handleSelect
611
+ }, {
612
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
613
+ _: 3
614
+ }, 8, [
615
+ "open",
616
+ "lazy-mount",
617
+ "unmount-on-exit"
618
+ ]);
619
+ };
620
+ }
621
+ });
622
+ //#endregion
623
+ //#region src/components/dropdown-menu/DropdownMenuContent.vue
624
+ const _sfc_main$19 = /*@__PURE__*/ defineComponent({
625
+ __name: "DropdownMenuContent",
626
+ props: { class: {} },
627
+ setup(__props) {
628
+ const props = __props;
629
+ return (_ctx, _cache) => {
630
+ return openBlock(), createBlock(unref(Menu).Positioner, { class: "z-50" }, {
631
+ default: withCtx(() => [createVNode(unref(Menu).Content, { class: normalizeClass(unref(cn)("bg-popover text-popover-foreground z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95", props.class)) }, {
632
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
633
+ _: 3
634
+ }, 8, ["class"])]),
635
+ _: 3
636
+ });
637
+ };
638
+ }
639
+ });
640
+ //#endregion
641
+ //#region src/components/dropdown-menu/DropdownMenuGroup.vue
642
+ const _sfc_main$20 = /*@__PURE__*/ defineComponent({
643
+ __name: "DropdownMenuGroup",
644
+ props: { label: {} },
645
+ setup(__props) {
646
+ const props = __props;
647
+ return (_ctx, _cache) => {
648
+ return openBlock(), createBlock(unref(Menu).ItemGroup, { label: props.label }, {
649
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
650
+ _: 3
651
+ }, 8, ["label"]);
652
+ };
653
+ }
654
+ });
655
+ //#endregion
656
+ //#region src/components/dropdown-menu/DropdownMenuItem.vue
657
+ const _sfc_main$21 = /*@__PURE__*/ defineComponent({
658
+ __name: "DropdownMenuItem",
659
+ props: {
660
+ value: { default: void 0 },
661
+ disabled: {
662
+ type: Boolean,
663
+ default: false
664
+ },
665
+ class: {}
666
+ },
667
+ setup(__props) {
668
+ const props = __props;
669
+ const autoValue = useId();
670
+ return (_ctx, _cache) => {
671
+ return openBlock(), createBlock(unref(Menu).Item, {
672
+ value: props.value ?? unref(autoValue),
673
+ disabled: props.disabled,
674
+ class: normalizeClass(unref(cn)("relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0", props.class))
675
+ }, {
676
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
677
+ _: 3
678
+ }, 8, [
679
+ "value",
680
+ "disabled",
681
+ "class"
682
+ ]);
683
+ };
684
+ }
685
+ });
686
+ //#endregion
687
+ //#region src/components/dropdown-menu/DropdownMenuLabel.vue
688
+ const _sfc_main$22 = /*@__PURE__*/ defineComponent({
689
+ __name: "DropdownMenuLabel",
690
+ props: { class: {} },
691
+ setup(__props) {
692
+ const props = __props;
693
+ return (_ctx, _cache) => {
694
+ return openBlock(), createElementBlock("div", { class: normalizeClass(unref(cn)("px-2 py-1.5 text-sm font-medium", props.class)) }, [renderSlot(_ctx.$slots, "default")], 2);
695
+ };
696
+ }
697
+ });
698
+ //#endregion
699
+ //#region src/components/dropdown-menu/DropdownMenuSeparator.vue
700
+ const _sfc_main$23 = /*@__PURE__*/ defineComponent({
701
+ __name: "DropdownMenuSeparator",
702
+ props: { class: {} },
703
+ setup(__props) {
704
+ const props = __props;
705
+ return (_ctx, _cache) => {
706
+ return openBlock(), createBlock(unref(Menu).Separator, { class: normalizeClass(unref(cn)("-mx-1 my-1 h-px bg-muted", props.class)) }, null, 8, ["class"]);
707
+ };
708
+ }
709
+ });
710
+ //#endregion
711
+ //#region src/components/dropdown-menu/DropdownMenuTrigger.vue
712
+ const _sfc_main$24 = /*@__PURE__*/ defineComponent({
713
+ __name: "DropdownMenuTrigger",
714
+ props: { asChild: { type: Boolean } },
715
+ setup(__props) {
716
+ const props = __props;
717
+ return (_ctx, _cache) => {
718
+ return openBlock(), createBlock(unref(Menu).Trigger, { "as-child": props.asChild }, {
719
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
720
+ _: 3
721
+ }, 8, ["as-child"]);
722
+ };
723
+ }
724
+ });
725
+ //#endregion
726
+ //#region src/components/input/Input.vue
727
+ const _sfc_main$25 = /*@__PURE__*/ defineComponent({
728
+ __name: "Input",
729
+ props: /*@__PURE__*/ mergeModels({ class: {} }, {
730
+ "modelValue": {},
731
+ "modelModifiers": {}
732
+ }),
733
+ emits: ["update:modelValue"],
734
+ setup(__props) {
735
+ const modelValue = useModel(__props, "modelValue");
736
+ const props = __props;
737
+ return (_ctx, _cache) => {
738
+ return withDirectives((openBlock(), createElementBlock("input", {
739
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
740
+ class: normalizeClass(unref(cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50", props.class))
741
+ }, null, 2)), [[vModelText, modelValue.value]]);
742
+ };
743
+ }
744
+ });
745
+ //#endregion
746
+ //#region src/components/label/Label.vue
747
+ const _sfc_main$26 = /*@__PURE__*/ defineComponent({
748
+ __name: "Label",
749
+ props: { class: {} },
750
+ setup(__props) {
751
+ const props = __props;
752
+ return (_ctx, _cache) => {
753
+ return openBlock(), createElementBlock("label", { class: normalizeClass(unref(cn)("text-sm font-medium leading-none", props.class)) }, [renderSlot(_ctx.$slots, "default")], 2);
754
+ };
755
+ }
756
+ });
757
+ //#endregion
758
+ //#region src/components/radio-group/RadioGroup.vue
759
+ const _sfc_main$27 = /*@__PURE__*/ defineComponent({
760
+ __name: "RadioGroup",
761
+ props: {
762
+ value: {},
763
+ defaultValue: {},
764
+ disabled: { type: Boolean },
765
+ orientation: {},
766
+ class: {}
767
+ },
768
+ emits: ["update:value"],
769
+ setup(__props, { emit: __emit }) {
770
+ const props = __props;
771
+ const emit = __emit;
772
+ return (_ctx, _cache) => {
773
+ return openBlock(), createBlock(unref(RadioGroup).Root, {
774
+ "model-value": props.value,
775
+ "default-value": props.defaultValue,
776
+ disabled: props.disabled,
777
+ orientation: props.orientation,
778
+ class: normalizeClass(unref(cn)("grid gap-2", props.class)),
779
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = (value) => emit("update:value", value))
780
+ }, {
781
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
782
+ _: 3
783
+ }, 8, [
784
+ "model-value",
785
+ "default-value",
786
+ "disabled",
787
+ "orientation",
788
+ "class"
789
+ ]);
790
+ };
791
+ }
792
+ });
793
+ //#endregion
794
+ //#region src/components/radio-group/RadioGroupItem.vue
795
+ const _sfc_main$28 = /*@__PURE__*/ defineComponent({
796
+ __name: "RadioGroupItem",
797
+ props: {
798
+ value: {},
799
+ disabled: { type: Boolean },
800
+ class: {}
801
+ },
802
+ setup(__props) {
803
+ const props = __props;
804
+ return (_ctx, _cache) => {
805
+ return openBlock(), createBlock(unref(RadioGroup).Item, {
806
+ value: props.value,
807
+ disabled: props.disabled,
808
+ class: normalizeClass(unref(cn)("flex items-center gap-2", props.class))
809
+ }, {
810
+ default: withCtx(() => [
811
+ createVNode(unref(RadioGroup).ItemHiddenInput),
812
+ createVNode(unref(RadioGroup).ItemControl, { class: "border-input text-primary shadow-xs focus-visible:border-ring focus-visible:ring-ring/50 group aspect-square size-4 shrink-0 rounded-full border outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50" }, {
813
+ default: withCtx(() => [..._cache[0] || (_cache[0] = [createElementVNode("div", { class: "bg-primary size-2 rounded-full opacity-0 transition-opacity group-data-[state=checked]:opacity-100" }, null, -1)])]),
814
+ _: 1
815
+ }),
816
+ _ctx.$slots.default ? (openBlock(), createBlock(unref(RadioGroup).ItemText, {
817
+ key: 0,
818
+ class: "text-sm"
819
+ }, {
820
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
821
+ _: 3
822
+ })) : createCommentVNode("v-if", true)
823
+ ]),
824
+ _: 3
825
+ }, 8, [
826
+ "value",
827
+ "disabled",
828
+ "class"
829
+ ]);
830
+ };
831
+ }
832
+ });
833
+ //#endregion
834
+ //#region src/components/select/Select.vue
835
+ const _sfc_main$29 = /*@__PURE__*/ defineComponent({
836
+ __name: "Select",
837
+ props: {
838
+ /** 选项列表(构建键盘导航/回显所需的 collection) */
839
+ items: {
840
+ type: Array,
841
+ required: true
842
+ },
843
+ /** 当前值(配合 v-model);不传时为非受控 */
844
+ modelValue: {
845
+ type: String,
846
+ default: void 0
847
+ },
848
+ defaultValue: {
849
+ type: String,
850
+ default: void 0
851
+ },
852
+ open: {
853
+ type: Boolean,
854
+ default: void 0
855
+ },
856
+ defaultOpen: {
857
+ type: Boolean,
858
+ default: false
859
+ },
860
+ lazyMount: {
861
+ type: Boolean,
862
+ default: false
863
+ },
864
+ unmountOnExit: {
865
+ type: Boolean,
866
+ default: false
867
+ }
868
+ },
869
+ emits: ["update:modelValue", "update:open"],
870
+ setup(__props, { emit: __emit }) {
871
+ const props = __props;
872
+ const emit = __emit;
873
+ const toArray = (v) => v === void 0 ? void 0 : [v];
874
+ const internalValue = ref(props.defaultValue);
875
+ const modelValue = computed(() => props.modelValue ?? internalValue.value);
876
+ const collection = computed(() => createListCollection({ items: props.items.map((item) => typeof item === "string" ? {
877
+ label: item,
878
+ value: item
879
+ } : item) }));
880
+ function handleModelUpdate(next) {
881
+ const value = Array.isArray(next) ? next[0] : next;
882
+ internalValue.value = value;
883
+ emit("update:modelValue", value);
884
+ }
885
+ const internalOpen = ref(props.defaultOpen);
886
+ const isOpen = computed(() => props.open ?? internalOpen.value);
887
+ function handleOpenUpdate(open) {
888
+ internalOpen.value = open;
889
+ emit("update:open", open);
890
+ }
891
+ return (_ctx, _cache) => {
892
+ return openBlock(), createBlock(unref(Select).Root, {
893
+ collection: collection.value,
894
+ "model-value": toArray(modelValue.value),
895
+ open: isOpen.value,
896
+ "lazy-mount": props.lazyMount,
897
+ "unmount-on-exit": props.unmountOnExit,
898
+ "onUpdate:modelValue": handleModelUpdate,
899
+ "onUpdate:open": handleOpenUpdate
900
+ }, {
901
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
902
+ _: 3
903
+ }, 8, [
904
+ "collection",
905
+ "model-value",
906
+ "open",
907
+ "lazy-mount",
908
+ "unmount-on-exit"
909
+ ]);
910
+ };
911
+ }
912
+ });
913
+ //#endregion
914
+ //#region src/components/select/SelectContent.vue
915
+ const _sfc_main$30 = /*@__PURE__*/ defineComponent({
916
+ __name: "SelectContent",
917
+ props: { class: {} },
918
+ setup(__props) {
919
+ const props = __props;
920
+ return (_ctx, _cache) => {
921
+ return openBlock(), createBlock(unref(Select).Positioner, { class: "z-50" }, {
922
+ default: withCtx(() => [createVNode(unref(Select).Content, { class: normalizeClass(unref(cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md", props.class)) }, {
923
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
924
+ _: 3
925
+ }, 8, ["class"])]),
926
+ _: 3
927
+ });
928
+ };
929
+ }
930
+ });
931
+ //#endregion
932
+ //#region src/components/select/types.ts
933
+ function normalizeSelectItem(item) {
934
+ return typeof item === "string" ? {
935
+ label: item,
936
+ value: item
937
+ } : item;
938
+ }
939
+ //#endregion
940
+ //#region src/components/select/SelectItem.vue
941
+ const _sfc_main$31 = /*@__PURE__*/ defineComponent({
942
+ __name: "SelectItem",
943
+ props: {
944
+ item: {
945
+ type: [String, Object],
946
+ required: true
947
+ },
948
+ class: {
949
+ type: String,
950
+ default: void 0
951
+ }
952
+ },
953
+ setup(__props) {
954
+ const props = __props;
955
+ const normalized = computed(() => normalizeSelectItem(props.item));
956
+ return (_ctx, _cache) => {
957
+ return openBlock(), createBlock(unref(Select).Item, {
958
+ item: normalized.value,
959
+ class: normalizeClass(unref(cn)("data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground relative flex w-full cursor-pointer items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50", props.class))
960
+ }, {
961
+ default: withCtx(() => [createVNode(unref(Select).ItemText, null, {
962
+ default: withCtx(() => [createTextVNode(toDisplayString(normalized.value.label), 1)]),
963
+ _: 1
964
+ }), createVNode(unref(Select).ItemIndicator, { class: "absolute right-2" }, {
965
+ default: withCtx(() => [..._cache[0] || (_cache[0] = [createElementVNode("svg", {
966
+ viewBox: "0 0 24 24",
967
+ fill: "none",
968
+ stroke: "currentColor",
969
+ "stroke-width": "2",
970
+ "stroke-linecap": "round",
971
+ "stroke-linejoin": "round",
972
+ class: "size-4"
973
+ }, [createElementVNode("path", { d: "M20 6 9 17l-5-5" })], -1)])]),
974
+ _: 1
975
+ })]),
976
+ _: 1
977
+ }, 8, ["item", "class"]);
978
+ };
979
+ }
980
+ });
981
+ //#endregion
982
+ //#region src/components/select/SelectTrigger.vue
983
+ const _hoisted_1$1 = {
984
+ key: 0,
985
+ viewBox: "0 0 24 24",
986
+ fill: "none",
987
+ stroke: "currentColor",
988
+ "stroke-width": "2",
989
+ "stroke-linecap": "round",
990
+ "stroke-linejoin": "round",
991
+ class: "size-4 opacity-50"
992
+ };
993
+ const _sfc_main$32 = /*@__PURE__*/ defineComponent({
994
+ __name: "SelectTrigger",
995
+ props: {
996
+ asChild: { type: Boolean },
997
+ class: {}
998
+ },
999
+ setup(__props) {
1000
+ const props = __props;
1001
+ return (_ctx, _cache) => {
1002
+ return openBlock(), createBlock(unref(Select).Control, { class: "w-fit" }, {
1003
+ default: withCtx(() => [createVNode(unref(Select).Trigger, {
1004
+ "as-child": props.asChild,
1005
+ class: normalizeClass(unref(cn)("border-input data-[placeholder]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 flex h-9 w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs focus-visible:outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4", props.class))
1006
+ }, {
1007
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default"), !props.asChild ? (openBlock(), createElementBlock("svg", _hoisted_1$1, [..._cache[0] || (_cache[0] = [createElementVNode("path", { d: "m6 9 6 6 6-6" }, null, -1)])])) : createCommentVNode("v-if", true)]),
1008
+ _: 3
1009
+ }, 8, ["as-child", "class"])]),
1010
+ _: 3
1011
+ });
1012
+ };
1013
+ }
1014
+ });
1015
+ //#endregion
1016
+ //#region src/components/select/SelectValueText.vue
1017
+ const _sfc_main$33 = /*@__PURE__*/ defineComponent({
1018
+ __name: "SelectValueText",
1019
+ props: { placeholder: {} },
1020
+ setup(__props) {
1021
+ const props = __props;
1022
+ return (_ctx, _cache) => {
1023
+ return openBlock(), createBlock(unref(Select).ValueText, { placeholder: props.placeholder }, null, 8, ["placeholder"]);
1024
+ };
1025
+ }
1026
+ });
1027
+ //#endregion
1028
+ //#region src/components/separator/Separator.vue
1029
+ const _hoisted_1 = ["data-orientation"];
1030
+ const _sfc_main$34 = /*@__PURE__*/ defineComponent({
1031
+ __name: "Separator",
1032
+ props: {
1033
+ orientation: { default: "horizontal" },
1034
+ class: {}
1035
+ },
1036
+ setup(__props) {
1037
+ const props = __props;
1038
+ const orientationClass = computed(() => props.orientation === "vertical" ? "w-px h-full" : "h-px w-full");
1039
+ return (_ctx, _cache) => {
1040
+ return openBlock(), createElementBlock("div", {
1041
+ "data-orientation": props.orientation,
1042
+ class: normalizeClass(unref(cn)("bg-border shrink-0", orientationClass.value, props.class))
1043
+ }, null, 10, _hoisted_1);
1044
+ };
1045
+ }
1046
+ });
1047
+ //#endregion
1048
+ //#region src/components/skeleton/Skeleton.vue
1049
+ const _sfc_main$35 = /*@__PURE__*/ defineComponent({
1050
+ __name: "Skeleton",
1051
+ props: { class: {} },
1052
+ setup(__props) {
1053
+ const props = __props;
1054
+ return (_ctx, _cache) => {
1055
+ return openBlock(), createElementBlock("div", {
1056
+ "aria-hidden": "true",
1057
+ class: normalizeClass(unref(cn)("animate-pulse rounded-md bg-muted", props.class))
1058
+ }, null, 2);
1059
+ };
1060
+ }
1061
+ });
1062
+ //#endregion
1063
+ //#region src/components/slider/Slider.vue
1064
+ const _sfc_main$36 = /*@__PURE__*/ defineComponent({
1065
+ __name: "Slider",
1066
+ props: {
1067
+ value: {},
1068
+ defaultValue: {},
1069
+ min: { default: 0 },
1070
+ max: { default: 100 },
1071
+ step: { default: 1 },
1072
+ disabled: { type: Boolean },
1073
+ class: {}
1074
+ },
1075
+ emits: ["update:modelValue"],
1076
+ setup(__props, { emit: __emit }) {
1077
+ const props = __props;
1078
+ const emit = __emit;
1079
+ const toArray = (v) => v === void 0 ? void 0 : Array.isArray(v) ? v : [v];
1080
+ const thumbs = computed(() => toArray(props.value) ?? toArray(props.defaultValue) ?? [props.min]);
1081
+ return (_ctx, _cache) => {
1082
+ return openBlock(), createBlock(unref(Slider).Root, {
1083
+ "model-value": toArray(props.value),
1084
+ "default-value": toArray(props.defaultValue),
1085
+ min: props.min,
1086
+ max: props.max,
1087
+ step: props.step,
1088
+ disabled: props.disabled,
1089
+ class: normalizeClass(unref(cn)("relative flex w-full touch-none select-none items-center data-[disabled]:opacity-50", props.class)),
1090
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = (value) => emit("update:modelValue", value))
1091
+ }, {
1092
+ default: withCtx(() => [createVNode(unref(Slider).Control, { class: "relative flex h-5 w-full items-center" }, {
1093
+ default: withCtx(() => [createVNode(unref(Slider).Track, { class: "bg-muted relative h-1 w-full grow overflow-hidden rounded-full" }, {
1094
+ default: withCtx(() => [createVNode(unref(Slider).Range, { class: "bg-primary absolute h-full" })]),
1095
+ _: 1
1096
+ }), (openBlock(true), createElementBlock(Fragment, null, renderList(thumbs.value, (_, index) => {
1097
+ return openBlock(), createBlock(unref(Slider).Thumb, {
1098
+ key: index,
1099
+ index,
1100
+ class: "border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50"
1101
+ }, {
1102
+ default: withCtx(() => [createVNode(unref(Slider).HiddenInput)]),
1103
+ _: 1
1104
+ }, 8, ["index"]);
1105
+ }), 128))]),
1106
+ _: 1
1107
+ })]),
1108
+ _: 1
1109
+ }, 8, [
1110
+ "model-value",
1111
+ "default-value",
1112
+ "min",
1113
+ "max",
1114
+ "step",
1115
+ "disabled",
1116
+ "class"
1117
+ ]);
1118
+ };
1119
+ }
1120
+ });
1121
+ //#endregion
1122
+ //#region src/components/switch/Switch.vue
1123
+ const _sfc_main$37 = /*@__PURE__*/ defineComponent({
1124
+ __name: "Switch",
1125
+ props: {
1126
+ checked: {
1127
+ type: Boolean,
1128
+ default: void 0
1129
+ },
1130
+ defaultChecked: {
1131
+ type: Boolean,
1132
+ default: false
1133
+ },
1134
+ disabled: {
1135
+ type: Boolean,
1136
+ default: false
1137
+ },
1138
+ class: {
1139
+ type: String,
1140
+ default: void 0
1141
+ }
1142
+ },
1143
+ emits: ["update:checked"],
1144
+ setup(__props, { emit: __emit }) {
1145
+ const props = __props;
1146
+ const emit = __emit;
1147
+ const internalChecked = ref(props.defaultChecked);
1148
+ const isChecked = computed(() => props.checked ?? internalChecked.value);
1149
+ function handleUpdate(checked) {
1150
+ internalChecked.value = checked;
1151
+ emit("update:checked", checked);
1152
+ }
1153
+ return (_ctx, _cache) => {
1154
+ return openBlock(), createBlock(unref(Switch).Root, {
1155
+ checked: isChecked.value,
1156
+ disabled: props.disabled,
1157
+ class: normalizeClass(unref(cn)("inline-flex items-center gap-2", props.class)),
1158
+ "onUpdate:checked": handleUpdate
1159
+ }, {
1160
+ default: withCtx(() => [
1161
+ createVNode(unref(Switch).HiddenInput),
1162
+ createVNode(unref(Switch).Control, { class: "peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:ring-ring/50 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50" }, {
1163
+ default: withCtx(() => [createVNode(unref(Switch).Thumb, { class: "bg-background pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0" })]),
1164
+ _: 1
1165
+ }),
1166
+ _ctx.$slots.default ? (openBlock(), createBlock(unref(Switch).Label, {
1167
+ key: 0,
1168
+ class: "text-sm font-medium select-none"
1169
+ }, {
1170
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
1171
+ _: 3
1172
+ })) : createCommentVNode("v-if", true)
1173
+ ]),
1174
+ _: 3
1175
+ }, 8, [
1176
+ "checked",
1177
+ "disabled",
1178
+ "class"
1179
+ ]);
1180
+ };
1181
+ }
1182
+ });
1183
+ //#endregion
1184
+ //#region src/components/tabs/Tabs.vue
1185
+ const _sfc_main$38 = /*@__PURE__*/ defineComponent({
1186
+ __name: "Tabs",
1187
+ props: {
1188
+ value: {},
1189
+ defaultValue: {},
1190
+ activationMode: {},
1191
+ lazyMount: { type: Boolean },
1192
+ unmountOnExit: { type: Boolean }
1193
+ },
1194
+ emits: ["update:value"],
1195
+ setup(__props, { emit: __emit }) {
1196
+ const props = __props;
1197
+ const emit = __emit;
1198
+ return (_ctx, _cache) => {
1199
+ return openBlock(), createBlock(unref(Tabs).Root, {
1200
+ "model-value": props.value,
1201
+ "default-value": props.defaultValue,
1202
+ "activation-mode": props.activationMode,
1203
+ "lazy-mount": props.lazyMount,
1204
+ "unmount-on-exit": props.unmountOnExit,
1205
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = (value) => emit("update:value", value))
1206
+ }, {
1207
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
1208
+ _: 3
1209
+ }, 8, [
1210
+ "model-value",
1211
+ "default-value",
1212
+ "activation-mode",
1213
+ "lazy-mount",
1214
+ "unmount-on-exit"
1215
+ ]);
1216
+ };
1217
+ }
1218
+ });
1219
+ //#endregion
1220
+ //#region src/components/tabs/TabsContent.vue
1221
+ const _sfc_main$39 = /*@__PURE__*/ defineComponent({
1222
+ __name: "TabsContent",
1223
+ props: {
1224
+ value: {},
1225
+ class: {}
1226
+ },
1227
+ setup(__props) {
1228
+ const props = __props;
1229
+ return (_ctx, _cache) => {
1230
+ return openBlock(), createBlock(unref(Tabs).Content, {
1231
+ value: props.value,
1232
+ class: normalizeClass(unref(cn)("flex-1 outline-none", props.class))
1233
+ }, {
1234
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
1235
+ _: 3
1236
+ }, 8, ["value", "class"]);
1237
+ };
1238
+ }
1239
+ });
1240
+ //#endregion
1241
+ //#region src/components/tabs/TabsList.vue
1242
+ const _sfc_main$40 = /*@__PURE__*/ defineComponent({
1243
+ __name: "TabsList",
1244
+ props: { class: {} },
1245
+ setup(__props) {
1246
+ const props = __props;
1247
+ return (_ctx, _cache) => {
1248
+ return openBlock(), createBlock(unref(Tabs).List, { class: normalizeClass(unref(cn)("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]", props.class)) }, {
1249
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
1250
+ _: 3
1251
+ }, 8, ["class"]);
1252
+ };
1253
+ }
1254
+ });
1255
+ //#endregion
1256
+ //#region src/components/tabs/TabsTrigger.vue
1257
+ const _sfc_main$41 = /*@__PURE__*/ defineComponent({
1258
+ __name: "TabsTrigger",
1259
+ props: {
1260
+ value: {},
1261
+ disabled: { type: Boolean },
1262
+ class: {}
1263
+ },
1264
+ setup(__props) {
1265
+ const props = __props;
1266
+ return (_ctx, _cache) => {
1267
+ return openBlock(), createBlock(unref(Tabs).Trigger, {
1268
+ value: props.value,
1269
+ disabled: props.disabled,
1270
+ class: normalizeClass(unref(cn)("data-[selected]:bg-background data-[selected]:text-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-ring/50 focus-visible:outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 data-[selected]:shadow-sm", props.class))
1271
+ }, {
1272
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
1273
+ _: 3
1274
+ }, 8, [
1275
+ "value",
1276
+ "disabled",
1277
+ "class"
1278
+ ]);
1279
+ };
1280
+ }
1281
+ });
1282
+ //#endregion
1283
+ //#region src/components/tooltip/Tooltip.vue
1284
+ const _sfc_main$42 = /*@__PURE__*/ defineComponent({
1285
+ __name: "Tooltip",
1286
+ props: {
1287
+ open: {
1288
+ type: Boolean,
1289
+ default: void 0
1290
+ },
1291
+ defaultOpen: {
1292
+ type: Boolean,
1293
+ default: false
1294
+ },
1295
+ delayDuration: {
1296
+ type: Number,
1297
+ default: void 0
1298
+ },
1299
+ closeDuration: {
1300
+ type: Number,
1301
+ default: void 0
1302
+ },
1303
+ lazyMount: {
1304
+ type: Boolean,
1305
+ default: false
1306
+ },
1307
+ unmountOnExit: {
1308
+ type: Boolean,
1309
+ default: false
1310
+ }
1311
+ },
1312
+ emits: ["update:open"],
1313
+ setup(__props, { emit: __emit }) {
1314
+ const props = __props;
1315
+ const emit = __emit;
1316
+ const internalOpen = ref(props.defaultOpen);
1317
+ const isOpen = computed(() => props.open ?? internalOpen.value);
1318
+ function handleUpdate(open) {
1319
+ internalOpen.value = open;
1320
+ emit("update:open", open);
1321
+ }
1322
+ return (_ctx, _cache) => {
1323
+ return openBlock(), createBlock(unref(Tooltip).Root, {
1324
+ open: isOpen.value,
1325
+ "open-delay": props.delayDuration,
1326
+ "close-delay": props.closeDuration,
1327
+ "lazy-mount": props.lazyMount,
1328
+ "unmount-on-exit": props.unmountOnExit,
1329
+ "onUpdate:open": handleUpdate
1330
+ }, {
1331
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
1332
+ _: 3
1333
+ }, 8, [
1334
+ "open",
1335
+ "open-delay",
1336
+ "close-delay",
1337
+ "lazy-mount",
1338
+ "unmount-on-exit"
1339
+ ]);
1340
+ };
1341
+ }
1342
+ });
1343
+ //#endregion
1344
+ //#region src/components/tooltip/TooltipContent.vue
1345
+ const _sfc_main$43 = /*@__PURE__*/ defineComponent({
1346
+ __name: "TooltipContent",
1347
+ props: { class: {} },
1348
+ setup(__props) {
1349
+ const props = __props;
1350
+ return (_ctx, _cache) => {
1351
+ return openBlock(), createBlock(unref(Tooltip).Positioner, { class: "z-50" }, {
1352
+ default: withCtx(() => [createVNode(unref(Tooltip).Content, { class: normalizeClass(unref(cn)("bg-primary text-primary-foreground z-50 w-fit rounded-md px-3 py-1.5 text-sm data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95", props.class)) }, {
1353
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
1354
+ _: 3
1355
+ }, 8, ["class"])]),
1356
+ _: 3
1357
+ });
1358
+ };
1359
+ }
1360
+ });
1361
+ //#endregion
1362
+ //#region src/components/tooltip/TooltipTrigger.vue
1363
+ const _sfc_main$44 = /*@__PURE__*/ defineComponent({
1364
+ __name: "TooltipTrigger",
1365
+ props: { asChild: { type: Boolean } },
1366
+ setup(__props) {
1367
+ const props = __props;
1368
+ return (_ctx, _cache) => {
1369
+ return openBlock(), createBlock(unref(Tooltip).Trigger, { "as-child": props.asChild }, {
1370
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
1371
+ _: 3
1372
+ }, 8, ["as-child"]);
1373
+ };
1374
+ }
1375
+ });
1376
+ //#endregion
1377
+ export { _sfc_main as Avatar, _sfc_main$1 as Badge, _sfc_main$2 as Button, COMPONENT_NAMES, _sfc_main$3 as Card, _sfc_main$4 as CardContent, _sfc_main$5 as CardDescription, _sfc_main$6 as CardFooter, _sfc_main$7 as CardHeader, _sfc_main$8 as CardTitle, _sfc_main$9 as Checkbox, _sfc_main$10 as Dialog, _sfc_main$11 as DialogClose, _sfc_main$12 as DialogContent, _sfc_main$13 as DialogDescription, _sfc_main$14 as DialogFooter, _sfc_main$15 as DialogHeader, _sfc_main$16 as DialogTitle, _sfc_main$17 as DialogTrigger, _sfc_main$18 as DropdownMenu, _sfc_main$19 as DropdownMenuContent, _sfc_main$20 as DropdownMenuGroup, _sfc_main$21 as DropdownMenuItem, _sfc_main$22 as DropdownMenuLabel, _sfc_main$23 as DropdownMenuSeparator, _sfc_main$24 as DropdownMenuTrigger, _sfc_main$25 as Input, _sfc_main$26 as Label, _sfc_main$27 as RadioGroup, _sfc_main$28 as RadioGroupItem, _sfc_main$29 as Select, _sfc_main$30 as SelectContent, _sfc_main$31 as SelectItem, _sfc_main$32 as SelectTrigger, _sfc_main$33 as SelectValueText, _sfc_main$34 as Separator, _sfc_main$35 as Skeleton, _sfc_main$36 as Slider, Slot, _sfc_main$37 as Switch, _sfc_main$38 as Tabs, _sfc_main$39 as TabsContent, _sfc_main$40 as TabsList, _sfc_main$41 as TabsTrigger, _sfc_main$42 as Tooltip, _sfc_main$43 as TooltipContent, _sfc_main$44 as TooltipTrigger, TuDesignResolver, badgeVariants, buttonVariants, cn };