@tu-design/vue 0.0.0-stage → 0.2.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.
@@ -0,0 +1,22 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "avatar",
4
+ "type": "registry:ui",
5
+ "description": "头像,含图片加载与回退(Ark UI)。",
6
+ "registryDependencies": ["utils"],
7
+ "dependencies": ["@ark-ui/vue@^5.39.2"],
8
+ "files": [
9
+ {
10
+ "path": "avatar/Avatar.vue",
11
+ "type": "registry:component",
12
+ "target": "components/ui/avatar/Avatar.vue",
13
+ "content": "<script setup lang=\"ts\">\nimport { Avatar as ArkAvatar } from \"@ark-ui/vue/avatar\";\nimport { cn } from \"@/lib/utils\";\n\ninterface Props {\n src?: string;\n alt?: string;\n class?: string;\n}\n\nconst props = defineProps<Props>();\n</script>\n\n<template>\n <ArkAvatar.Root :class=\"cn('inline-flex size-10 overflow-hidden rounded-full', props.class)\">\n <ArkAvatar.Image\n v-if=\"props.src\"\n :src=\"props.src\"\n :alt=\"props.alt\"\n class=\"size-full object-cover\"\n />\n <ArkAvatar.Fallback class=\"flex size-full items-center justify-center bg-muted\">\n <slot />\n </ArkAvatar.Fallback>\n </ArkAvatar.Root>\n</template>\n"
14
+ },
15
+ {
16
+ "path": "avatar/index.ts",
17
+ "type": "registry:component",
18
+ "target": "components/ui/avatar/index.ts",
19
+ "content": "export { default as Avatar } from \"./Avatar.vue\";\n"
20
+ }
21
+ ]
22
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "badge",
4
+ "type": "registry:ui",
5
+ "description": "轻量状态徽标,支持四种变体。",
6
+ "registryDependencies": ["utils"],
7
+ "dependencies": ["class-variance-authority@^0.7.1"],
8
+ "files": [
9
+ {
10
+ "path": "badge/Badge.vue",
11
+ "type": "registry:component",
12
+ "target": "components/ui/badge/Badge.vue",
13
+ "content": "<script setup lang=\"ts\">\nimport { cn } from \"@/lib/utils\";\nimport { badgeVariants, type BadgeVariants } from \"./index\";\n\ninterface Props {\n variant?: BadgeVariants[\"variant\"];\n class?: string;\n}\n\nconst props = defineProps<Props>();\n</script>\n\n<template>\n <span :class=\"cn(badgeVariants({ variant: props.variant }), props.class)\">\n <slot />\n </span>\n</template>\n"
14
+ },
15
+ {
16
+ "path": "badge/index.ts",
17
+ "type": "registry:component",
18
+ "target": "components/ui/badge/index.ts",
19
+ "content": "import { cva, type VariantProps } from \"class-variance-authority\";\n\nexport { default as Badge } from \"./Badge.vue\";\n\nexport const badgeVariants = cva(\n \"inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground\",\n secondary: \"bg-secondary text-secondary-foreground\",\n destructive: \"bg-destructive text-white\",\n outline: \"text-foreground border border-input\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\nexport type BadgeVariants = VariantProps<typeof badgeVariants>;\n"
20
+ }
21
+ ]
22
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "button",
4
+ "type": "registry:ui",
5
+ "description": "带变体与尺寸的按钮,支持 as 标签切换与 asChild 组合。",
6
+ "registryDependencies": ["utils", "slot"],
7
+ "dependencies": ["class-variance-authority@^0.7.1"],
8
+ "files": [
9
+ {
10
+ "path": "button/Button.vue",
11
+ "type": "registry:component",
12
+ "target": "components/ui/button/Button.vue",
13
+ "content": "<script setup lang=\"ts\">\nimport { cn } from \"@/lib/utils\";\nimport { Slot } from \"@/components/slot\";\nimport { buttonVariants, type ButtonVariants } from \"./index\";\n\ninterface Props {\n variant?: ButtonVariants[\"variant\"];\n size?: ButtonVariants[\"size\"];\n as?: string;\n asChild?: boolean;\n class?: string;\n}\n\nconst props = withDefaults(defineProps<Props>(), { as: \"button\" });\n</script>\n\n<template>\n <Slot\n v-if=\"props.asChild\"\n :class=\"cn(buttonVariants({ variant: props.variant, size: props.size }), props.class)\"\n >\n <slot />\n </Slot>\n <component\n v-else\n :is=\"props.as\"\n :class=\"cn(buttonVariants({ variant: props.variant, size: props.size }), props.class)\"\n >\n <slot name=\"icon\" />\n <slot />\n </component>\n</template>\n"
14
+ },
15
+ {
16
+ "path": "button/index.ts",
17
+ "type": "registry:component",
18
+ "target": "components/ui/button/index.ts",
19
+ "content": "import { cva, type VariantProps } from \"class-variance-authority\";\n\nexport { default as Button } from \"./Button.vue\";\n\nexport const buttonVariants = cva(\n \"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]\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90 hover:shadow-sm\",\n destructive: \"bg-destructive text-white shadow-xs hover:bg-destructive/90\",\n outline:\n \"border border-input bg-background hover:border-muted-foreground/25 hover:bg-muted\",\n secondary: \"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80\",\n ghost: \"hover:bg-muted\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 px-4 py-2\",\n sm: \"h-8 px-3\",\n lg: \"h-10 px-6\",\n icon: \"size-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\nexport type ButtonVariants = VariantProps<typeof buttonVariants>;\n"
20
+ }
21
+ ]
22
+ }
@@ -0,0 +1,51 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "card",
4
+ "type": "registry:ui",
5
+ "description": "卡片容器族:Header/Title/Description/Content/Footer。",
6
+ "registryDependencies": ["utils"],
7
+ "files": [
8
+ {
9
+ "path": "card/Card.vue",
10
+ "type": "registry:component",
11
+ "target": "components/ui/card/Card.vue",
12
+ "content": "<script setup lang=\"ts\">\nimport { cn } from \"@/lib/utils\";\n\nconst props = defineProps<{ class?: string }>();\n</script>\n\n<template>\n <div\n :class=\"\n cn('rounded-xl border border-border bg-card text-card-foreground shadow-xs', props.class)\n \"\n >\n <slot />\n </div>\n</template>\n"
13
+ },
14
+ {
15
+ "path": "card/CardContent.vue",
16
+ "type": "registry:component",
17
+ "target": "components/ui/card/CardContent.vue",
18
+ "content": "<script setup lang=\"ts\">\nimport { cn } from \"@/lib/utils\";\n\nconst props = defineProps<{ class?: string }>();\n</script>\n\n<template>\n <div :class=\"cn('p-6 pt-0', props.class)\">\n <slot />\n </div>\n</template>\n"
19
+ },
20
+ {
21
+ "path": "card/CardDescription.vue",
22
+ "type": "registry:component",
23
+ "target": "components/ui/card/CardDescription.vue",
24
+ "content": "<script setup lang=\"ts\">\nimport { cn } from \"@/lib/utils\";\n\nconst props = defineProps<{ class?: string }>();\n</script>\n\n<template>\n <p :class=\"cn('text-sm text-muted-foreground', props.class)\">\n <slot />\n </p>\n</template>\n"
25
+ },
26
+ {
27
+ "path": "card/CardFooter.vue",
28
+ "type": "registry:component",
29
+ "target": "components/ui/card/CardFooter.vue",
30
+ "content": "<script setup lang=\"ts\">\nimport { cn } from \"@/lib/utils\";\n\nconst props = defineProps<{ class?: string }>();\n</script>\n\n<template>\n <div :class=\"cn('flex items-center p-6 pt-0', props.class)\">\n <slot />\n </div>\n</template>\n"
31
+ },
32
+ {
33
+ "path": "card/CardHeader.vue",
34
+ "type": "registry:component",
35
+ "target": "components/ui/card/CardHeader.vue",
36
+ "content": "<script setup lang=\"ts\">\nimport { cn } from \"@/lib/utils\";\n\nconst props = defineProps<{ class?: string }>();\n</script>\n\n<template>\n <div :class=\"cn('flex flex-col gap-1.5 p-6', props.class)\">\n <slot />\n </div>\n</template>\n"
37
+ },
38
+ {
39
+ "path": "card/CardTitle.vue",
40
+ "type": "registry:component",
41
+ "target": "components/ui/card/CardTitle.vue",
42
+ "content": "<script setup lang=\"ts\">\nimport { cn } from \"@/lib/utils\";\n\nconst props = defineProps<{ class?: string }>();\n</script>\n\n<template>\n <h3 :class=\"cn('font-semibold leading-none tracking-tight', props.class)\">\n <slot />\n </h3>\n</template>\n"
43
+ },
44
+ {
45
+ "path": "card/index.ts",
46
+ "type": "registry:component",
47
+ "target": "components/ui/card/index.ts",
48
+ "content": "export { default as Card } from \"./Card.vue\";\nexport { default as CardContent } from \"./CardContent.vue\";\nexport { default as CardDescription } from \"./CardDescription.vue\";\nexport { default as CardFooter } from \"./CardFooter.vue\";\nexport { default as CardHeader } from \"./CardHeader.vue\";\nexport { default as CardTitle } from \"./CardTitle.vue\";\n"
49
+ }
50
+ ]
51
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "checkbox",
4
+ "type": "registry:ui",
5
+ "description": "复选框:基于 Ark UI Checkbox 原语,支持标签插槽、受控/非受控与禁用。",
6
+ "registryDependencies": ["utils"],
7
+ "dependencies": ["@ark-ui/vue@^5.39.2"],
8
+ "files": [
9
+ {
10
+ "path": "checkbox/Checkbox.vue",
11
+ "type": "registry:component",
12
+ "target": "components/ui/checkbox/Checkbox.vue",
13
+ "content": "<script setup lang=\"ts\">\nimport type { PropType } from \"vue\";\nimport { computed, ref } from \"vue\";\nimport { Checkbox as ArkCheckbox } from \"@ark-ui/vue/checkbox\";\nimport { cn } from \"@/lib/utils\";\n\n// checked 用 default: undefined 禁用 Boolean casting(Dialog 同款约定)\nconst props = defineProps({\n checked: { type: Boolean as PropType<boolean | undefined>, default: undefined },\n defaultChecked: { type: Boolean, default: false },\n disabled: { type: Boolean, default: false },\n class: { type: String, default: undefined },\n});\n\nconst emit = defineEmits<{ \"update:checked\": [checked: boolean] }>();\n\n// 对 Root 恒走受控模式,非受控语义由内部 ref 实现(Dialog 同款)\nconst internalChecked = ref(props.defaultChecked);\nconst isChecked = computed(() => props.checked ?? internalChecked.value);\n\nfunction handleUpdate(checked: boolean) {\n internalChecked.value = checked;\n emit(\"update:checked\", checked);\n}\n</script>\n\n<template>\n <ArkCheckbox.Root\n :checked=\"isChecked\"\n :disabled=\"props.disabled\"\n :class=\"cn('inline-flex items-center gap-2', props.class)\"\n @update:checked=\"handleUpdate\"\n >\n <ArkCheckbox.HiddenInput />\n <ArkCheckbox.Control\n 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\"\n >\n <ArkCheckbox.Indicator class=\"flex items-center justify-center text-current\">\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"size-3.5\"\n >\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n </ArkCheckbox.Indicator>\n </ArkCheckbox.Control>\n <ArkCheckbox.Label v-if=\"$slots.default\" class=\"text-sm leading-none font-medium select-none\">\n <slot />\n </ArkCheckbox.Label>\n </ArkCheckbox.Root>\n</template>\n"
14
+ },
15
+ {
16
+ "path": "checkbox/index.ts",
17
+ "type": "registry:component",
18
+ "target": "components/ui/checkbox/index.ts",
19
+ "content": "export { default as Checkbox } from \"./Checkbox.vue\";\n"
20
+ }
21
+ ]
22
+ }
@@ -0,0 +1,64 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "dialog",
4
+ "type": "registry:ui",
5
+ "description": "模态对话框:基于 Ark UI Dialog 原语,含焦点圈定、Escape/遮罩关闭与进出场动画,支持 asChild 与 v-model:open。",
6
+ "registryDependencies": ["utils"],
7
+ "dependencies": ["@ark-ui/vue@^5.39.2"],
8
+ "files": [
9
+ {
10
+ "path": "dialog/Dialog.vue",
11
+ "type": "registry:component",
12
+ "target": "components/ui/dialog/Dialog.vue",
13
+ "content": "<script setup lang=\"ts\">\nimport type { PropType } from \"vue\";\nimport { computed, ref } from \"vue\";\nimport { Dialog as ArkDialog } from \"@ark-ui/vue/dialog\";\n\ninterface Props {\n /** 受控开关(配合 v-model:open);不传时为非受控,由内部状态管理 */\n open?: boolean;\n defaultOpen?: boolean;\n /** 首次打开前不挂载内容 */\n lazyMount?: boolean;\n /** 关闭后卸载内容(关闭动画结束后) */\n unmountOnExit?: boolean;\n}\n\n// 用运行时 props 显式 default: undefined:Boolean prop 缺省时 Vue 会 cast 成 false,\n// 导致无法区分「未传(非受控)」与「传了 false(受控关闭)」。\nconst props = defineProps({\n open: { type: Boolean as PropType<boolean | undefined>, default: undefined },\n defaultOpen: { type: Boolean, default: false },\n lazyMount: { type: Boolean, default: false },\n unmountOnExit: { type: Boolean, default: false },\n});\n\nconst emit = defineEmits<{ \"update:open\": [open: boolean] }>();\n\n// 对 Root 恒走受控模式(open 恒为布尔):非受控语义由内部 ref 实现,\n// 避开 zag uncontrolled 内部状态在部分环境下不同步的问题,两种模式行为一致。\nconst internalOpen = ref(props.defaultOpen);\nconst isOpen = computed(() => props.open ?? internalOpen.value);\n\nfunction handleUpdate(open: boolean) {\n internalOpen.value = open;\n emit(\"update:open\", open);\n}\n</script>\n\n<template>\n <ArkDialog.Root\n :open=\"isOpen\"\n :lazy-mount=\"props.lazyMount\"\n :unmount-on-exit=\"props.unmountOnExit\"\n @update:open=\"handleUpdate\"\n >\n <slot />\n </ArkDialog.Root>\n</template>\n"
14
+ },
15
+ {
16
+ "path": "dialog/DialogClose.vue",
17
+ "type": "registry:component",
18
+ "target": "components/ui/dialog/DialogClose.vue",
19
+ "content": "<script setup lang=\"ts\">\nimport { Dialog as ArkDialog } from \"@ark-ui/vue/dialog\";\n\ninterface Props {\n /** 以默认插槽子元素为渲染目标,不渲染额外按钮 */\n asChild?: boolean;\n}\n\nconst props = defineProps<Props>();\n</script>\n\n<template>\n <ArkDialog.CloseTrigger :as-child=\"props.asChild\">\n <slot />\n </ArkDialog.CloseTrigger>\n</template>\n"
20
+ },
21
+ {
22
+ "path": "dialog/DialogContent.vue",
23
+ "type": "registry:component",
24
+ "target": "components/ui/dialog/DialogContent.vue",
25
+ "content": "<script setup lang=\"ts\">\nimport { Dialog as ArkDialog } from \"@ark-ui/vue/dialog\";\nimport { cn } from \"@/lib/utils\";\n\ninterface Props {\n /** 是否在内容右上角渲染关闭按钮 */\n showCloseButton?: boolean;\n class?: string;\n}\n\nconst props = withDefaults(defineProps<Props>(), { showCloseButton: true });\n</script>\n\n<template>\n <ArkDialog.Backdrop\n 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\"\n />\n <ArkDialog.Positioner class=\"fixed inset-0 z-50 flex items-center justify-center p-4\">\n <ArkDialog.Content\n :class=\"\n cn(\n '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',\n props.class,\n )\n \"\n >\n <slot />\n <ArkDialog.CloseTrigger\n v-if=\"props.showCloseButton\"\n 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\"\n >\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"size-4\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n <span class=\"sr-only\">关闭</span>\n </ArkDialog.CloseTrigger>\n </ArkDialog.Content>\n </ArkDialog.Positioner>\n</template>\n"
26
+ },
27
+ {
28
+ "path": "dialog/DialogDescription.vue",
29
+ "type": "registry:component",
30
+ "target": "components/ui/dialog/DialogDescription.vue",
31
+ "content": "<script setup lang=\"ts\">\nimport { Dialog as ArkDialog } from \"@ark-ui/vue/dialog\";\nimport { cn } from \"@/lib/utils\";\n\ninterface Props {\n class?: string;\n}\n\nconst props = defineProps<Props>();\n</script>\n\n<template>\n <ArkDialog.Description :class=\"cn('text-sm text-muted-foreground', props.class)\">\n <slot />\n </ArkDialog.Description>\n</template>\n"
32
+ },
33
+ {
34
+ "path": "dialog/DialogFooter.vue",
35
+ "type": "registry:component",
36
+ "target": "components/ui/dialog/DialogFooter.vue",
37
+ "content": "<script setup lang=\"ts\">\nimport { cn } from \"@/lib/utils\";\n\ninterface Props {\n class?: string;\n}\n\nconst props = defineProps<Props>();\n</script>\n\n<template>\n <div :class=\"cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', props.class)\">\n <slot />\n </div>\n</template>\n"
38
+ },
39
+ {
40
+ "path": "dialog/DialogHeader.vue",
41
+ "type": "registry:component",
42
+ "target": "components/ui/dialog/DialogHeader.vue",
43
+ "content": "<script setup lang=\"ts\">\nimport { cn } from \"@/lib/utils\";\n\ninterface Props {\n class?: string;\n}\n\nconst props = defineProps<Props>();\n</script>\n\n<template>\n <div :class=\"cn('flex flex-col gap-2 text-center sm:text-left', props.class)\">\n <slot />\n </div>\n</template>\n"
44
+ },
45
+ {
46
+ "path": "dialog/DialogTitle.vue",
47
+ "type": "registry:component",
48
+ "target": "components/ui/dialog/DialogTitle.vue",
49
+ "content": "<script setup lang=\"ts\">\nimport { Dialog as ArkDialog } from \"@ark-ui/vue/dialog\";\nimport { cn } from \"@/lib/utils\";\n\ninterface Props {\n class?: string;\n}\n\nconst props = defineProps<Props>();\n</script>\n\n<template>\n <ArkDialog.Title :class=\"cn('text-lg font-semibold leading-none tracking-tight', props.class)\">\n <slot />\n </ArkDialog.Title>\n</template>\n"
50
+ },
51
+ {
52
+ "path": "dialog/DialogTrigger.vue",
53
+ "type": "registry:component",
54
+ "target": "components/ui/dialog/DialogTrigger.vue",
55
+ "content": "<script setup lang=\"ts\">\nimport { Dialog as ArkDialog } from \"@ark-ui/vue/dialog\";\n\ninterface Props {\n /** 以默认插槽子元素为渲染目标(样式与行为合并其上),不渲染额外按钮 */\n asChild?: boolean;\n}\n\nconst props = defineProps<Props>();\n</script>\n\n<template>\n <ArkDialog.Trigger :as-child=\"props.asChild\">\n <slot />\n </ArkDialog.Trigger>\n</template>\n"
56
+ },
57
+ {
58
+ "path": "dialog/index.ts",
59
+ "type": "registry:component",
60
+ "target": "components/ui/dialog/index.ts",
61
+ "content": "export { default as Dialog } from \"./Dialog.vue\";\nexport { default as DialogClose } from \"./DialogClose.vue\";\nexport { default as DialogContent } from \"./DialogContent.vue\";\nexport { default as DialogDescription } from \"./DialogDescription.vue\";\nexport { default as DialogFooter } from \"./DialogFooter.vue\";\nexport { default as DialogHeader } from \"./DialogHeader.vue\";\nexport { default as DialogTitle } from \"./DialogTitle.vue\";\nexport { default as DialogTrigger } from \"./DialogTrigger.vue\";\n"
62
+ }
63
+ ]
64
+ }
@@ -0,0 +1,58 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "dropdown-menu",
4
+ "type": "registry:ui",
5
+ "description": "下拉菜单:基于 Ark UI Menu 原语,含键盘导航、选中回调与分组/分隔线,Trigger 支持 asChild。",
6
+ "registryDependencies": ["utils"],
7
+ "dependencies": ["@ark-ui/vue@^5.39.2"],
8
+ "files": [
9
+ {
10
+ "path": "dropdown-menu/DropdownMenu.vue",
11
+ "type": "registry:component",
12
+ "target": "components/ui/dropdown-menu/DropdownMenu.vue",
13
+ "content": "<script setup lang=\"ts\">\nimport type { PropType } from \"vue\";\nimport { computed, ref } from \"vue\";\nimport { Menu as ArkMenu } from \"@ark-ui/vue/menu\";\n\ninterface Props {\n /** 受控开关(配合 v-model:open);不传时为非受控 */\n open?: boolean;\n defaultOpen?: boolean;\n lazyMount?: boolean;\n unmountOnExit?: boolean;\n}\n\n// open 用 default: undefined 禁用 Boolean casting(Dialog/Tooltip 同款约定)\nconst props = defineProps({\n open: { type: Boolean as PropType<boolean | undefined>, default: undefined },\n defaultOpen: { type: Boolean, default: false },\n lazyMount: { type: Boolean, default: false },\n unmountOnExit: { type: Boolean, default: false },\n});\n\nconst emit = defineEmits<{\n \"update:open\": [open: boolean];\n /** 选中某个 item 时触发(closeOnSelect 关闭后仍会先发出) */\n select: [details: { value: string }];\n}>();\n\n// 对 Root 恒走受控模式,非受控语义由内部 ref 实现(Dialog 同款)\nconst internalOpen = ref(props.defaultOpen);\nconst isOpen = computed(() => props.open ?? internalOpen.value);\n\nfunction handleUpdate(open: boolean) {\n internalOpen.value = open;\n emit(\"update:open\", open);\n}\n\nfunction handleSelect(details: { value: string }) {\n emit(\"select\", details);\n}\n</script>\n\n<template>\n <ArkMenu.Root\n :open=\"isOpen\"\n :lazy-mount=\"props.lazyMount\"\n :unmount-on-exit=\"props.unmountOnExit\"\n @update:open=\"handleUpdate\"\n @select=\"handleSelect\"\n >\n <slot />\n </ArkMenu.Root>\n</template>\n"
14
+ },
15
+ {
16
+ "path": "dropdown-menu/DropdownMenuContent.vue",
17
+ "type": "registry:component",
18
+ "target": "components/ui/dropdown-menu/DropdownMenuContent.vue",
19
+ "content": "<script setup lang=\"ts\">\nimport { Menu as ArkMenu } from \"@ark-ui/vue/menu\";\nimport { cn } from \"@/lib/utils\";\n\ninterface Props {\n class?: string;\n}\n\nconst props = defineProps<Props>();\n</script>\n\n<template>\n <ArkMenu.Positioner class=\"z-50\">\n <ArkMenu.Content\n :class=\"\n cn(\n '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',\n props.class,\n )\n \"\n >\n <slot />\n </ArkMenu.Content>\n </ArkMenu.Positioner>\n</template>\n"
20
+ },
21
+ {
22
+ "path": "dropdown-menu/DropdownMenuGroup.vue",
23
+ "type": "registry:component",
24
+ "target": "components/ui/dropdown-menu/DropdownMenuGroup.vue",
25
+ "content": "<script setup lang=\"ts\">\nimport { Menu as ArkMenu } from \"@ark-ui/vue/menu\";\n\ninterface Props {\n /** 分组的可访问名称 */\n label?: string;\n}\n\nconst props = defineProps<Props>();\n</script>\n\n<template>\n <ArkMenu.ItemGroup :label=\"props.label\">\n <slot />\n </ArkMenu.ItemGroup>\n</template>\n"
26
+ },
27
+ {
28
+ "path": "dropdown-menu/DropdownMenuItem.vue",
29
+ "type": "registry:component",
30
+ "target": "components/ui/dropdown-menu/DropdownMenuItem.vue",
31
+ "content": "<script setup lang=\"ts\">\nimport { useId } from \"vue\";\nimport { Menu as ArkMenu } from \"@ark-ui/vue/menu\";\nimport { cn } from \"@/lib/utils\";\n\ninterface Props {\n /** 选中回调里回传的标识;缺省自动生成 */\n value?: string;\n disabled?: boolean;\n class?: string;\n}\n\nconst props = withDefaults(defineProps<Props>(), { value: undefined, disabled: false });\n\nconst autoValue = useId();\n</script>\n\n<template>\n <ArkMenu.Item\n :value=\"props.value ?? autoValue\"\n :disabled=\"props.disabled\"\n :class=\"\n cn(\n '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',\n props.class,\n )\n \"\n >\n <slot />\n </ArkMenu.Item>\n</template>\n"
32
+ },
33
+ {
34
+ "path": "dropdown-menu/DropdownMenuLabel.vue",
35
+ "type": "registry:component",
36
+ "target": "components/ui/dropdown-menu/DropdownMenuLabel.vue",
37
+ "content": "<script setup lang=\"ts\">\nimport { cn } from \"@/lib/utils\";\n\ninterface Props {\n class?: string;\n}\n\nconst props = defineProps<Props>();\n</script>\n\n<template>\n <div :class=\"cn('px-2 py-1.5 text-sm font-medium', props.class)\">\n <slot />\n </div>\n</template>\n"
38
+ },
39
+ {
40
+ "path": "dropdown-menu/DropdownMenuSeparator.vue",
41
+ "type": "registry:component",
42
+ "target": "components/ui/dropdown-menu/DropdownMenuSeparator.vue",
43
+ "content": "<script setup lang=\"ts\">\nimport { Menu as ArkMenu } from \"@ark-ui/vue/menu\";\nimport { cn } from \"@/lib/utils\";\n\ninterface Props {\n class?: string;\n}\n\nconst props = defineProps<Props>();\n</script>\n\n<template>\n <ArkMenu.Separator :class=\"cn('-mx-1 my-1 h-px bg-muted', props.class)\" />\n</template>\n"
44
+ },
45
+ {
46
+ "path": "dropdown-menu/DropdownMenuTrigger.vue",
47
+ "type": "registry:component",
48
+ "target": "components/ui/dropdown-menu/DropdownMenuTrigger.vue",
49
+ "content": "<script setup lang=\"ts\">\nimport { Menu as ArkMenu } from \"@ark-ui/vue/menu\";\n\ninterface Props {\n /** 以默认插槽子元素为渲染目标,行为合并其上 */\n asChild?: boolean;\n}\n\nconst props = defineProps<Props>();\n</script>\n\n<template>\n <ArkMenu.Trigger :as-child=\"props.asChild\">\n <slot />\n </ArkMenu.Trigger>\n</template>\n"
50
+ },
51
+ {
52
+ "path": "dropdown-menu/index.ts",
53
+ "type": "registry:component",
54
+ "target": "components/ui/dropdown-menu/index.ts",
55
+ "content": "export { default as DropdownMenu } from \"./DropdownMenu.vue\";\nexport { default as DropdownMenuContent } from \"./DropdownMenuContent.vue\";\nexport { default as DropdownMenuGroup } from \"./DropdownMenuGroup.vue\";\nexport { default as DropdownMenuItem } from \"./DropdownMenuItem.vue\";\nexport { default as DropdownMenuLabel } from \"./DropdownMenuLabel.vue\";\nexport { default as DropdownMenuSeparator } from \"./DropdownMenuSeparator.vue\";\nexport { default as DropdownMenuTrigger } from \"./DropdownMenuTrigger.vue\";\n"
56
+ }
57
+ ]
58
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "input",
4
+ "type": "registry:ui",
5
+ "description": "文本输入框,支持 v-model 与 attrs 透传。",
6
+ "registryDependencies": ["utils"],
7
+ "files": [
8
+ {
9
+ "path": "input/Input.vue",
10
+ "type": "registry:component",
11
+ "target": "components/ui/input/Input.vue",
12
+ "content": "<script setup lang=\"ts\">\nimport { cn } from \"@/lib/utils\";\n\nconst modelValue = defineModel<string | number>();\nconst props = defineProps<{ class?: string }>();\n</script>\n\n<template>\n <input\n v-model=\"modelValue\"\n :class=\"\n cn(\n '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',\n props.class,\n )\n \"\n />\n</template>\n"
13
+ },
14
+ {
15
+ "path": "input/index.ts",
16
+ "type": "registry:component",
17
+ "target": "components/ui/input/index.ts",
18
+ "content": "export { default as Input } from \"./Input.vue\";\n"
19
+ }
20
+ ]
21
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "label",
4
+ "type": "registry:ui",
5
+ "description": "表单标签。",
6
+ "registryDependencies": ["utils"],
7
+ "files": [
8
+ {
9
+ "path": "label/Label.vue",
10
+ "type": "registry:component",
11
+ "target": "components/ui/label/Label.vue",
12
+ "content": "<script setup lang=\"ts\">\nimport { cn } from \"@/lib/utils\";\n\nconst props = defineProps<{ class?: string }>();\n</script>\n\n<template>\n <label :class=\"cn('text-sm font-medium leading-none', props.class)\">\n <slot />\n </label>\n</template>\n"
13
+ },
14
+ {
15
+ "path": "label/index.ts",
16
+ "type": "registry:component",
17
+ "target": "components/ui/label/index.ts",
18
+ "content": "export { default as Label } from \"./Label.vue\";\n"
19
+ }
20
+ ]
21
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "radio-group",
4
+ "type": "registry:ui",
5
+ "description": "单选组:基于 Ark UI Radio Group 原语,键盘导航与受控/非受控双模式。",
6
+ "registryDependencies": ["utils"],
7
+ "dependencies": ["@ark-ui/vue@^5.39.2"],
8
+ "files": [
9
+ {
10
+ "path": "radio-group/RadioGroup.vue",
11
+ "type": "registry:component",
12
+ "target": "components/ui/radio-group/RadioGroup.vue",
13
+ "content": "<script setup lang=\"ts\">\nimport { RadioGroup as ArkRadioGroup } from \"@ark-ui/vue/radio-group\";\nimport { cn } from \"@/lib/utils\";\n\ninterface Props {\n /** 当前值(配合 v-model:value);不传时为非受控 */\n value?: string;\n defaultValue?: string;\n disabled?: boolean;\n orientation?: \"horizontal\" | \"vertical\";\n class?: string;\n}\n\nconst props = defineProps<Props>();\n\nconst emit = defineEmits<{ \"update:value\": [value: string] }>();\n</script>\n\n<template>\n <ArkRadioGroup.Root\n :model-value=\"props.value\"\n :default-value=\"props.defaultValue\"\n :disabled=\"props.disabled\"\n :orientation=\"props.orientation\"\n :class=\"cn('grid gap-2', props.class)\"\n @update:model-value=\"(value: string) => emit('update:value', value)\"\n >\n <slot />\n </ArkRadioGroup.Root>\n</template>\n"
14
+ },
15
+ {
16
+ "path": "radio-group/RadioGroupItem.vue",
17
+ "type": "registry:component",
18
+ "target": "components/ui/radio-group/RadioGroupItem.vue",
19
+ "content": "<script setup lang=\"ts\">\nimport { RadioGroup as ArkRadioGroup } from \"@ark-ui/vue/radio-group\";\nimport { cn } from \"@/lib/utils\";\n\ninterface Props {\n value: string;\n disabled?: boolean;\n class?: string;\n}\n\nconst props = defineProps<Props>();\n</script>\n\n<template>\n <ArkRadioGroup.Item\n :value=\"props.value\"\n :disabled=\"props.disabled\"\n :class=\"cn('flex items-center gap-2', props.class)\"\n >\n <ArkRadioGroup.ItemHiddenInput />\n <ArkRadioGroup.ItemControl\n 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\"\n >\n <div\n class=\"bg-primary size-2 rounded-full opacity-0 transition-opacity group-data-[state=checked]:opacity-100\"\n />\n </ArkRadioGroup.ItemControl>\n <ArkRadioGroup.ItemText v-if=\"$slots.default\" class=\"text-sm\">\n <slot />\n </ArkRadioGroup.ItemText>\n </ArkRadioGroup.Item>\n</template>\n"
20
+ },
21
+ {
22
+ "path": "radio-group/index.ts",
23
+ "type": "registry:component",
24
+ "target": "components/ui/radio-group/index.ts",
25
+ "content": "export { default as RadioGroup } from \"./RadioGroup.vue\";\nexport { default as RadioGroupItem } from \"./RadioGroupItem.vue\";\n"
26
+ }
27
+ ]
28
+ }
@@ -0,0 +1,126 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry.json",
3
+ "name": "tu-design",
4
+ "items": [
5
+ {
6
+ "name": "avatar",
7
+ "title": "Avatar",
8
+ "type": "registry:ui",
9
+ "description": "头像,含图片加载与回退(Ark UI)。"
10
+ },
11
+ {
12
+ "name": "badge",
13
+ "title": "Badge",
14
+ "type": "registry:ui",
15
+ "description": "轻量状态徽标,支持四种变体。"
16
+ },
17
+ {
18
+ "name": "button",
19
+ "title": "Button",
20
+ "type": "registry:ui",
21
+ "description": "带变体与尺寸的按钮,支持 as 标签切换与 asChild 组合。"
22
+ },
23
+ {
24
+ "name": "card",
25
+ "title": "Card",
26
+ "type": "registry:ui",
27
+ "description": "卡片容器族:Header/Title/Description/Content/Footer。"
28
+ },
29
+ {
30
+ "name": "checkbox",
31
+ "title": "Checkbox",
32
+ "type": "registry:ui",
33
+ "description": "复选框:基于 Ark UI Checkbox 原语,支持标签插槽、受控/非受控与禁用。"
34
+ },
35
+ {
36
+ "name": "dialog",
37
+ "title": "Dialog",
38
+ "type": "registry:ui",
39
+ "description": "模态对话框:基于 Ark UI Dialog 原语,含焦点圈定、Escape/遮罩关闭与进出场动画,支持 asChild 与 v-model:open。"
40
+ },
41
+ {
42
+ "name": "dropdown-menu",
43
+ "title": "DropdownMenu",
44
+ "type": "registry:ui",
45
+ "description": "下拉菜单:基于 Ark UI Menu 原语,含键盘导航、选中回调与分组/分隔线,Trigger 支持 asChild。"
46
+ },
47
+ {
48
+ "name": "input",
49
+ "title": "Input",
50
+ "type": "registry:ui",
51
+ "description": "文本输入框,支持 v-model 与 attrs 透传。"
52
+ },
53
+ {
54
+ "name": "label",
55
+ "title": "Label",
56
+ "type": "registry:ui",
57
+ "description": "表单标签。"
58
+ },
59
+ {
60
+ "name": "radio-group",
61
+ "title": "RadioGroup",
62
+ "type": "registry:ui",
63
+ "description": "单选组:基于 Ark UI Radio Group 原语,键盘导航与受控/非受控双模式。"
64
+ },
65
+ {
66
+ "name": "select",
67
+ "title": "Select",
68
+ "type": "registry:ui",
69
+ "description": "下拉选择框:基于 Ark UI Select 原语,含键盘导航、选中回显与勾选指示,Trigger 支持 asChild。"
70
+ },
71
+ {
72
+ "name": "separator",
73
+ "title": "Separator",
74
+ "type": "registry:ui",
75
+ "description": "分隔线,支持水平与垂直方向。"
76
+ },
77
+ {
78
+ "name": "skeleton",
79
+ "title": "Skeleton",
80
+ "type": "registry:ui",
81
+ "description": "加载占位骨架屏。"
82
+ },
83
+ {
84
+ "name": "slider",
85
+ "title": "Slider",
86
+ "type": "registry:ui",
87
+ "description": "滑块:基于 Ark UI Slider 原语,支持单值/区间、步进与键盘微调。"
88
+ },
89
+ {
90
+ "name": "slot",
91
+ "title": "Slot",
92
+ "type": "registry:ui",
93
+ "description": "asChild 组合原语:将组件的 class 与 attrs 合并到子元素上,而不渲染额外 DOM。"
94
+ },
95
+ {
96
+ "name": "switch",
97
+ "title": "Switch",
98
+ "type": "registry:ui",
99
+ "description": "开关:基于 Ark UI Switch 原语,支持标签插槽、受控/非受控与禁用。"
100
+ },
101
+ {
102
+ "name": "tabs",
103
+ "title": "Tabs",
104
+ "type": "registry:ui",
105
+ "description": "选项卡:基于 Ark UI Tabs 原语,键盘导航与受控/非受控双模式。"
106
+ },
107
+ {
108
+ "name": "tokens",
109
+ "title": "Tokens",
110
+ "type": "registry:style",
111
+ "description": "Tailwind CSS v4 语义 tokens(shadcn 官方 v4 集合)。"
112
+ },
113
+ {
114
+ "name": "tooltip",
115
+ "title": "Tooltip",
116
+ "type": "registry:ui",
117
+ "description": "文字提示气泡:悬停触发,基于 Ark UI Tooltip 原语,支持 asChild 与延迟配置。"
118
+ },
119
+ {
120
+ "name": "utils",
121
+ "title": "Utils",
122
+ "type": "registry:lib",
123
+ "description": "cn 类名合并工具(clsx + tailwind-merge)。"
124
+ }
125
+ ]
126
+ }
@@ -0,0 +1,52 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "select",
4
+ "type": "registry:ui",
5
+ "description": "下拉选择框:基于 Ark UI Select 原语,含键盘导航、选中回显与勾选指示,Trigger 支持 asChild。",
6
+ "registryDependencies": ["utils"],
7
+ "dependencies": ["@ark-ui/vue@^5.39.2"],
8
+ "files": [
9
+ {
10
+ "path": "select/Select.vue",
11
+ "type": "registry:component",
12
+ "target": "components/ui/select/Select.vue",
13
+ "content": "<script setup lang=\"ts\">\nimport type { PropType } from \"vue\";\nimport { computed, ref } from \"vue\";\nimport { createListCollection } from \"@ark-ui/vue/collection\";\nimport { Select as ArkSelect } from \"@ark-ui/vue/select\";\nimport type { SelectItemOption } from \"./types\";\n\n// modelValue 为 String 类型无 Boolean casting 问题;「未传」经 default: undefined 保持 undefined\nconst props = defineProps({\n /** 选项列表(构建键盘导航/回显所需的 collection) */\n items: { type: Array as PropType<(string | SelectItemOption)[]>, required: true },\n /** 当前值(配合 v-model);不传时为非受控 */\n modelValue: { type: String as PropType<string | undefined>, default: undefined },\n defaultValue: { type: String, default: undefined },\n open: { type: Boolean as PropType<boolean | undefined>, default: undefined },\n defaultOpen: { type: Boolean, default: false },\n lazyMount: { type: Boolean, default: false },\n unmountOnExit: { type: Boolean, default: false },\n});\n\nconst emit = defineEmits<{\n \"update:modelValue\": [value: string];\n \"update:open\": [open: boolean];\n}>();\n\n// zag select 的 value 内部统一为数组,这里保持单选 string 的公开语义\nconst toArray = (v: string | undefined) => (v === undefined ? undefined : [v]);\n\n// 对 Root 恒走受控模式(Dialog 同款):非受控语义由内部 ref 实现\nconst internalValue = ref<string | undefined>(props.defaultValue);\nconst modelValue = computed(() => props.modelValue ?? internalValue.value);\nconst collection = computed(() =>\n createListCollection({\n items: props.items.map((item) =>\n typeof item === \"string\" ? { label: item, value: item } : item,\n ),\n }),\n);\n\nfunction handleModelUpdate(next: string | string[]) {\n const value = Array.isArray(next) ? next[0]! : next;\n internalValue.value = value;\n emit(\"update:modelValue\", value);\n}\n\nconst internalOpen = ref(props.defaultOpen);\nconst isOpen = computed(() => props.open ?? internalOpen.value);\n\nfunction handleOpenUpdate(open: boolean) {\n internalOpen.value = open;\n emit(\"update:open\", open);\n}\n</script>\n\n<template>\n <ArkSelect.Root\n :collection=\"collection\"\n :model-value=\"toArray(modelValue)\"\n :open=\"isOpen\"\n :lazy-mount=\"props.lazyMount\"\n :unmount-on-exit=\"props.unmountOnExit\"\n @update:model-value=\"handleModelUpdate\"\n @update:open=\"handleOpenUpdate\"\n >\n <slot />\n </ArkSelect.Root>\n</template>\n"
14
+ },
15
+ {
16
+ "path": "select/SelectContent.vue",
17
+ "type": "registry:component",
18
+ "target": "components/ui/select/SelectContent.vue",
19
+ "content": "<script setup lang=\"ts\">\nimport { Select as ArkSelect } from \"@ark-ui/vue/select\";\nimport { cn } from \"@/lib/utils\";\n\ninterface Props {\n class?: string;\n}\n\nconst props = defineProps<Props>();\n</script>\n\n<template>\n <ArkSelect.Positioner class=\"z-50\">\n <ArkSelect.Content\n :class=\"\n cn(\n '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',\n props.class,\n )\n \"\n >\n <slot />\n </ArkSelect.Content>\n </ArkSelect.Positioner>\n</template>\n"
20
+ },
21
+ {
22
+ "path": "select/SelectItem.vue",
23
+ "type": "registry:component",
24
+ "target": "components/ui/select/SelectItem.vue",
25
+ "content": "<script setup lang=\"ts\">\nimport type { PropType } from \"vue\";\nimport { computed } from \"vue\";\nimport { Select as ArkSelect } from \"@ark-ui/vue/select\";\nimport { cn } from \"@/lib/utils\";\nimport { normalizeSelectItem, type SelectItemOption } from \"./types\";\n\ninterface Props {\n /** 选项(与 TSelect 的 items 中对应项一致,或直接传字符串) */\n item: string | SelectItemOption;\n class?: string;\n}\n\nconst props = defineProps({\n item: {\n type: [String, Object] as PropType<string | SelectItemOption>,\n required: true,\n },\n class: { type: String, default: undefined },\n});\n\nconst normalized = computed(() => normalizeSelectItem(props.item));\n</script>\n\n<template>\n <ArkSelect.Item\n :item=\"normalized\"\n :class=\"\n cn(\n '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',\n props.class,\n )\n \"\n >\n <ArkSelect.ItemText>{{ normalized.label }}</ArkSelect.ItemText>\n <ArkSelect.ItemIndicator class=\"absolute right-2\">\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"size-4\"\n >\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n </ArkSelect.ItemIndicator>\n </ArkSelect.Item>\n</template>\n"
26
+ },
27
+ {
28
+ "path": "select/SelectTrigger.vue",
29
+ "type": "registry:component",
30
+ "target": "components/ui/select/SelectTrigger.vue",
31
+ "content": "<script setup lang=\"ts\">\nimport { Select as ArkSelect } from \"@ark-ui/vue/select\";\nimport { cn } from \"@/lib/utils\";\n\ninterface Props {\n /** 以默认插槽子元素为渲染目标(chevron 需自行放置) */\n asChild?: boolean;\n class?: string;\n}\n\nconst props = defineProps<Props>();\n</script>\n\n<template>\n <ArkSelect.Control class=\"w-fit\">\n <ArkSelect.Trigger\n :as-child=\"props.asChild\"\n :class=\"\n cn(\n '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',\n props.class,\n )\n \"\n >\n <slot />\n <svg\n v-if=\"!props.asChild\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"size-4 opacity-50\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </ArkSelect.Trigger>\n </ArkSelect.Control>\n</template>\n"
32
+ },
33
+ {
34
+ "path": "select/SelectValueText.vue",
35
+ "type": "registry:component",
36
+ "target": "components/ui/select/SelectValueText.vue",
37
+ "content": "<script setup lang=\"ts\">\nimport { Select as ArkSelect } from \"@ark-ui/vue/select\";\n\ninterface Props {\n placeholder?: string;\n}\n\nconst props = defineProps<Props>();\n</script>\n\n<!-- 注意:不能向 ValueText 传插槽内容,其内部会对默认插槽做字符串化渲染 -->\n<template>\n <ArkSelect.ValueText :placeholder=\"props.placeholder\" />\n</template>\n"
38
+ },
39
+ {
40
+ "path": "select/index.ts",
41
+ "type": "registry:component",
42
+ "target": "components/ui/select/index.ts",
43
+ "content": "export { default as Select } from \"./Select.vue\";\nexport { default as SelectContent } from \"./SelectContent.vue\";\nexport { default as SelectItem } from \"./SelectItem.vue\";\nexport { default as SelectTrigger } from \"./SelectTrigger.vue\";\nexport { default as SelectValueText } from \"./SelectValueText.vue\";\nexport type { SelectItemOption } from \"./types\";\n"
44
+ },
45
+ {
46
+ "path": "select/types.ts",
47
+ "type": "registry:component",
48
+ "target": "components/ui/select/types.ts",
49
+ "content": "export interface SelectItemOption {\n label: string;\n value: string;\n disabled?: boolean;\n}\n\nexport function normalizeSelectItem(item: string | SelectItemOption): SelectItemOption {\n return typeof item === \"string\" ? { label: item, value: item } : item;\n}\n"
50
+ }
51
+ ]
52
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "separator",
4
+ "type": "registry:ui",
5
+ "description": "分隔线,支持水平与垂直方向。",
6
+ "registryDependencies": ["utils"],
7
+ "files": [
8
+ {
9
+ "path": "separator/Separator.vue",
10
+ "type": "registry:component",
11
+ "target": "components/ui/separator/Separator.vue",
12
+ "content": "<script setup lang=\"ts\">\nimport { cn } from \"@/lib/utils\";\nimport { computed } from \"vue\";\n\ninterface Props {\n orientation?: \"horizontal\" | \"vertical\";\n class?: string;\n}\n\nconst props = withDefaults(defineProps<Props>(), { orientation: \"horizontal\" });\n\nconst orientationClass = computed(() =>\n props.orientation === \"vertical\" ? \"w-px h-full\" : \"h-px w-full\",\n);\n</script>\n\n<template>\n <div\n :data-orientation=\"props.orientation\"\n :class=\"cn('bg-border shrink-0', orientationClass, props.class)\"\n />\n</template>\n"
13
+ },
14
+ {
15
+ "path": "separator/index.ts",
16
+ "type": "registry:component",
17
+ "target": "components/ui/separator/index.ts",
18
+ "content": "export { default as Separator } from \"./Separator.vue\";\n"
19
+ }
20
+ ]
21
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "skeleton",
4
+ "type": "registry:ui",
5
+ "description": "加载占位骨架屏。",
6
+ "registryDependencies": ["utils"],
7
+ "files": [
8
+ {
9
+ "path": "skeleton/Skeleton.vue",
10
+ "type": "registry:component",
11
+ "target": "components/ui/skeleton/Skeleton.vue",
12
+ "content": "<script setup lang=\"ts\">\nimport { cn } from \"@/lib/utils\";\n\nconst props = defineProps<{ class?: string }>();\n</script>\n\n<template>\n <div aria-hidden=\"true\" :class=\"cn('animate-pulse rounded-md bg-muted', props.class)\" />\n</template>\n"
13
+ },
14
+ {
15
+ "path": "skeleton/index.ts",
16
+ "type": "registry:component",
17
+ "target": "components/ui/skeleton/index.ts",
18
+ "content": "export { default as Skeleton } from \"./Skeleton.vue\";\n"
19
+ }
20
+ ]
21
+ }