@tu-design/vue 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +74 -0
  2. package/dist/index.d.mts +54 -50
  3. package/dist/index.mjs +985 -874
  4. package/dist/registry/vue/alert-dialog.json +3 -3
  5. package/dist/registry/vue/alert.json +1 -1
  6. package/dist/registry/vue/avatar-group.json +1 -1
  7. package/dist/registry/vue/avatar.json +1 -1
  8. package/dist/registry/vue/badge.json +1 -1
  9. package/dist/registry/vue/button.json +2 -2
  10. package/dist/registry/vue/calendar.json +3 -3
  11. package/dist/registry/vue/card.json +1 -1
  12. package/dist/registry/vue/cascader.json +5 -5
  13. package/dist/registry/vue/checkbox.json +1 -1
  14. package/dist/registry/vue/context-menu.json +2 -2
  15. package/dist/registry/vue/currency-input.json +2 -2
  16. package/dist/registry/vue/date-picker.json +2 -2
  17. package/dist/registry/vue/date-range-picker.json +3 -3
  18. package/dist/registry/vue/date-shared.json +16 -2
  19. package/dist/registry/vue/dialog.json +3 -3
  20. package/dist/registry/vue/drawer.json +3 -3
  21. package/dist/registry/vue/dropdown-menu.json +4 -4
  22. package/dist/registry/vue/empty.json +1 -1
  23. package/dist/registry/vue/form-render.json +35 -34
  24. package/dist/registry/vue/form.json +2 -2
  25. package/dist/registry/vue/input.json +1 -1
  26. package/dist/registry/vue/label.json +1 -1
  27. package/dist/registry/vue/month-picker.json +2 -2
  28. package/dist/registry/vue/number-input.json +2 -2
  29. package/dist/registry/vue/overlay-shared.json +20 -0
  30. package/dist/registry/vue/password-input.json +1 -1
  31. package/dist/registry/vue/pin-input.json +1 -1
  32. package/dist/registry/vue/popconfirm.json +3 -3
  33. package/dist/registry/vue/popover.json +3 -3
  34. package/dist/registry/vue/progress.json +1 -1
  35. package/dist/registry/vue/radio-group.json +1 -1
  36. package/dist/registry/vue/registry.json +7 -1
  37. package/dist/registry/vue/select.json +4 -4
  38. package/dist/registry/vue/separator.json +1 -1
  39. package/dist/registry/vue/skeleton.json +1 -1
  40. package/dist/registry/vue/slider.json +1 -1
  41. package/dist/registry/vue/slot.json +3 -3
  42. package/dist/registry/vue/spin.json +1 -1
  43. package/dist/registry/vue/switch.json +1 -1
  44. package/dist/registry/vue/table-render.json +39 -11
  45. package/dist/registry/vue/tabs.json +1 -1
  46. package/dist/registry/vue/textarea.json +1 -1
  47. package/dist/registry/vue/toast.json +3 -3
  48. package/dist/registry/vue/tokens.json +2 -1
  49. package/dist/registry/vue/tooltip.json +3 -3
  50. package/dist/registry/vue/tree-select.json +5 -5
  51. package/dist/registry/vue/tree-shared.json +13 -12
  52. package/dist/registry/vue/week-picker.json +2 -2
  53. package/dist/registry/vue/year-picker.json +2 -2
  54. package/package.json +3 -2
package/README.md ADDED
@@ -0,0 +1,74 @@
1
+ # @tu-design/vue
2
+
3
+ shadcn 风格的 Vue 3 组件库 —— Tailwind CSS v4 + oklch CSS 变量主题,基于 [Ark UI](https://ark-ui.com) 原语,组件源码通过 [`tu-design` CLI](../cli) 按 registry 分发到你的项目中。
4
+
5
+ - 文档站:<https://gopowerteam.github.io/tu-design/>
6
+ - 组件清单与用法示例见文档站 Components 章节,本 README 只覆盖接入方式。
7
+
8
+ ## 分发模式
9
+
10
+ 和 shadcn/ui 一样,**推荐用法不是安装本包**,而是把组件源码复制进你的项目:
11
+
12
+ ```bash
13
+ npx tu-design init # 初始化 components.json / tokens / cn 工具
14
+ npx tu-design add button # 添加组件源码到 src/components/ui/button/
15
+ ```
16
+
17
+ 源码进入你的项目后归你所有,可以直接修改;组件依赖的运行时只有 `clsx`、`tailwind-merge`、`class-variance-authority`(及组件自身声明的 Ark UI / TanStack 等 npm 依赖)。
18
+
19
+ 作为 npm 包安装时,本包导出:
20
+
21
+ - `TuDesignResolver` — unplugin-vue 组件自动导入解析器
22
+ - `cn` — clsx + tailwind-merge 封装
23
+ - 全部组件(`TButton`、`TTabs`……)供直接 import 使用
24
+
25
+ ## 前置要求
26
+
27
+ - Vue 3.5+
28
+ - Tailwind CSS 4(含 `@tailwindcss/vite` 插件)
29
+ - 构建工具中将 `@` 别名指向 `src`(registry 源码以 `@/lib/utils` 导入 `cn`)
30
+
31
+ ## 主题
32
+
33
+ `src/styles/tokens.css` 定义 shadcn 风格的 CSS 变量(oklch)并通过 Tailwind v4 `@theme inline` 映射为工具类:
34
+
35
+ - `:root` / `.dark` 提供默认亮/暗主题
36
+ - 支持 `data-theme` 自定义品牌主题配方(详见文档站主题指南)
37
+
38
+ `tokens.css` 依赖 `tw-animate-css`,需一并安装。CLI 的 `init` / `add tokens` 会自动合并注入。
39
+
40
+ ## 自动导入
41
+
42
+ 配合 [unplugin-vue-components](https://github.com/unplugin/unplugin-vue-components):
43
+
44
+ ```bash
45
+ pnpm add -D unplugin-vue-components
46
+ ```
47
+
48
+ ```ts
49
+ // vite.config.ts
50
+ import Components from "unplugin-vue-components/vite";
51
+ import { TuDesignResolver } from "@tu-design/vue";
52
+
53
+ export default {
54
+ plugins: [Components({ resolvers: [TuDesignResolver()] })],
55
+ };
56
+ ```
57
+
58
+ 模板中可直接使用 `TButton` / `t-button`(`T` 前缀 + 组件名)。解析器按组件名白名单工作,`Transition`、`Teleport` 等 Vue 内置组件不会被误解析。
59
+
60
+ ## Registry
61
+
62
+ `registry/vue/*.json` 是 CLI 分发的数据源(遵循 shadcn registry-item schema),由 `scripts/generate-registry.ts` 从组件源码生成并有防漂移测试保护。线上地址为 `https://gopowerteam.github.io/tu-design/r/vue`。
63
+
64
+ ```bash
65
+ vp run generate:registry # 改动组件源码 / utils / tokens 后重新生成
66
+ vp test # 运行组件测试
67
+ vp run typecheck # vue-tsc 类型检查
68
+ ```
69
+
70
+ ## 相关
71
+
72
+ - [`@tu-design/cli`](../cli) — registry 分发 CLI
73
+ - 仓库:<https://github.com/gopowerteam/tu-design>
74
+ - 许可:MIT
package/dist/index.d.mts CHANGED
@@ -91,9 +91,9 @@ declare const __VLS_base$31: import("vue").DefineComponent<import("vue").Extract
91
91
  }>> & Readonly<{
92
92
  "onUpdate:checked"?: (checked: boolean) => any;
93
93
  }>, {
94
- name: string;
95
- class: string;
96
94
  disabled: boolean;
95
+ class: string;
96
+ name: string;
97
97
  checked: boolean | "indeterminate";
98
98
  defaultChecked: boolean;
99
99
  form: string;
@@ -192,10 +192,10 @@ declare const __VLS_export$49: import("vue").DefineComponent<import("vue").Extra
192
192
  "onUpdate:modelValue"?: (value: number) => any;
193
193
  }>, {
194
194
  modelValue: number;
195
- class: string;
196
- invalid: boolean;
197
195
  placeholder: string;
198
196
  disabled: boolean;
197
+ invalid: boolean;
198
+ class: string;
199
199
  labelUnit: CurrencyUnit;
200
200
  valueUnit: CurrencyUnit;
201
201
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -339,18 +339,18 @@ declare const __VLS_export$48: import("vue").DefineComponent<import("vue").Extra
339
339
  }>, {
340
340
  modelValue: string;
341
341
  defaultValue: string;
342
- min: string;
343
- max: string;
344
- isDateUnavailable: (date: DateValue) => boolean;
345
- locale: string;
346
- class: string;
347
- invalid: boolean;
348
342
  open: boolean;
349
343
  defaultOpen: boolean;
350
344
  placeholder: string;
351
345
  disabled: boolean;
346
+ invalid: boolean;
352
347
  readOnly: boolean;
348
+ min: string;
349
+ max: string;
353
350
  closeOnSelect: boolean;
351
+ locale: string;
352
+ class: string;
353
+ isDateUnavailable: (date: DateValue) => boolean;
354
354
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
355
355
  declare const _default$12: typeof __VLS_export$48;
356
356
  //#endregion
@@ -500,21 +500,21 @@ declare const __VLS_export$47: import("vue").DefineComponent<import("vue").Extra
500
500
  "onUpdate:modelValue"?: (value: [string, string]) => any;
501
501
  "onUpdate:open"?: (open: boolean) => any;
502
502
  }>, {
503
- numOfMonths: number;
504
503
  modelValue: [string, string];
505
504
  defaultValue: [string, string];
506
- min: string;
507
- max: string;
508
- isDateUnavailable: (date: DateValue) => boolean;
509
- locale: string;
510
- class: string;
511
- invalid: boolean;
512
505
  open: boolean;
513
506
  defaultOpen: boolean;
514
507
  placeholder: string;
515
508
  disabled: boolean;
509
+ invalid: boolean;
516
510
  readOnly: boolean;
511
+ min: string;
512
+ max: string;
517
513
  closeOnSelect: boolean;
514
+ locale: string;
515
+ class: string;
516
+ numOfMonths: number;
517
+ isDateUnavailable: (date: DateValue) => boolean;
518
518
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
519
519
  declare const _default$13: typeof __VLS_export$47;
520
520
  //#endregion
@@ -664,17 +664,17 @@ declare const __VLS_export$45: import("vue").DefineComponent<import("vue").Extra
664
664
  }>, {
665
665
  modelValue: string;
666
666
  defaultValue: string;
667
- min: string;
668
- max: string;
669
- locale: string;
670
- class: string;
671
- invalid: boolean;
672
667
  open: boolean;
673
668
  defaultOpen: boolean;
674
669
  placeholder: string;
675
670
  disabled: boolean;
671
+ invalid: boolean;
676
672
  readOnly: boolean;
673
+ min: string;
674
+ max: string;
677
675
  closeOnSelect: boolean;
676
+ locale: string;
677
+ class: string;
678
678
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
679
679
  declare const _default$29: typeof __VLS_export$45;
680
680
  //#endregion
@@ -818,18 +818,18 @@ declare const __VLS_export$44: import("vue").DefineComponent<import("vue").Extra
818
818
  }>, {
819
819
  modelValue: string;
820
820
  defaultValue: string;
821
- min: string;
822
- max: string;
823
- isDateUnavailable: (date: DateValue) => boolean;
824
- locale: string;
825
- class: string;
826
- invalid: boolean;
827
821
  open: boolean;
828
822
  defaultOpen: boolean;
829
823
  placeholder: string;
830
824
  disabled: boolean;
825
+ invalid: boolean;
831
826
  readOnly: boolean;
827
+ min: string;
828
+ max: string;
832
829
  closeOnSelect: boolean;
830
+ locale: string;
831
+ class: string;
832
+ isDateUnavailable: (date: DateValue) => boolean;
833
833
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
834
834
  declare const _default$49: typeof __VLS_export$44;
835
835
  //#endregion
@@ -914,11 +914,11 @@ declare const __VLS_base$30: import("vue").DefineComponent<import("vue").Extract
914
914
  "onUpdate:modelValue"?: (value: number) => any;
915
915
  }>, {
916
916
  modelValue: number;
917
+ disabled: boolean;
918
+ invalid: boolean;
917
919
  min: number;
918
920
  max: number;
919
921
  class: string;
920
- invalid: boolean;
921
- disabled: boolean;
922
922
  step: number;
923
923
  formatOptions: Intl.NumberFormatOptions;
924
924
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1014,10 +1014,10 @@ declare const __VLS_base$29: import("vue").DefineComponent<import("vue").Extract
1014
1014
  "onUpdate:visible"?: (visible: boolean) => any;
1015
1015
  }>, {
1016
1016
  modelValue: string;
1017
- class: string;
1018
- invalid: boolean;
1019
1017
  placeholder: string;
1020
1018
  disabled: boolean;
1019
+ invalid: boolean;
1020
+ class: string;
1021
1021
  visible: boolean;
1022
1022
  autoComplete: "current-password" | "new-password";
1023
1023
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1183,6 +1183,7 @@ declare const __VLS_export$40: import("vue").DefineComponent<import("vue").Extra
1183
1183
  };
1184
1184
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
1185
1185
  "update:modelValue": (value: Key | Key[]) => any;
1186
+ "update:open": (open: boolean) => any;
1186
1187
  "update:show": (open: boolean) => any;
1187
1188
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
1188
1189
  /** 树形选项(key 必填,label 展示名,children 子级) */
@@ -1267,15 +1268,16 @@ declare const __VLS_export$40: import("vue").DefineComponent<import("vue").Extra
1267
1268
  };
1268
1269
  }>> & Readonly<{
1269
1270
  "onUpdate:modelValue"?: (value: Key | Key[]) => any;
1271
+ "onUpdate:open"?: (open: boolean) => any;
1270
1272
  "onUpdate:show"?: (open: boolean) => any;
1271
1273
  }>, {
1272
1274
  modelValue: Key | Key[];
1273
1275
  defaultValue: Key | Key[];
1274
- class: string;
1275
1276
  open: boolean;
1276
1277
  defaultOpen: boolean;
1277
1278
  placeholder: string;
1278
1279
  disabled: boolean;
1280
+ class: string;
1279
1281
  multiple: boolean;
1280
1282
  checkable: boolean;
1281
1283
  cascade: boolean;
@@ -1376,6 +1378,7 @@ declare const __VLS_export$39: import("vue").DefineComponent<import("vue").Extra
1376
1378
  };
1377
1379
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
1378
1380
  "update:modelValue": (value: Key | Key[]) => any;
1381
+ "update:open": (open: boolean) => any;
1379
1382
  "update:show": (open: boolean) => any;
1380
1383
  "update:expandedKeys": (keys: Key[]) => any;
1381
1384
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
@@ -1465,16 +1468,17 @@ declare const __VLS_export$39: import("vue").DefineComponent<import("vue").Extra
1465
1468
  };
1466
1469
  }>> & Readonly<{
1467
1470
  "onUpdate:modelValue"?: (value: Key | Key[]) => any;
1471
+ "onUpdate:open"?: (open: boolean) => any;
1468
1472
  "onUpdate:show"?: (open: boolean) => any;
1469
1473
  "onUpdate:expandedKeys"?: (keys: Key[]) => any;
1470
1474
  }>, {
1471
1475
  modelValue: Key | Key[];
1472
1476
  defaultValue: Key | Key[];
1473
- class: string;
1474
1477
  open: boolean;
1475
1478
  defaultOpen: boolean;
1476
1479
  placeholder: string;
1477
1480
  disabled: boolean;
1481
+ class: string;
1478
1482
  multiple: boolean;
1479
1483
  checkable: boolean;
1480
1484
  cascade: boolean;
@@ -1673,8 +1677,8 @@ declare const __VLS_base$26: import("vue").DefineComponent<import("vue").Extract
1673
1677
  }>> & Readonly<{
1674
1678
  "onUpdate:checked"?: (checked: boolean) => any;
1675
1679
  }>, {
1676
- class: string;
1677
1680
  disabled: boolean;
1681
+ class: string;
1678
1682
  checked: boolean;
1679
1683
  defaultChecked: boolean;
1680
1684
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1832,17 +1836,17 @@ declare const __VLS_export$34: import("vue").DefineComponent<import("vue").Extra
1832
1836
  }>, {
1833
1837
  modelValue: string;
1834
1838
  defaultValue: string;
1835
- min: string;
1836
- max: string;
1837
- locale: string;
1838
- class: string;
1839
- invalid: boolean;
1840
1839
  open: boolean;
1841
1840
  defaultOpen: boolean;
1842
1841
  placeholder: string;
1843
1842
  disabled: boolean;
1843
+ invalid: boolean;
1844
1844
  readOnly: boolean;
1845
+ min: string;
1846
+ max: string;
1845
1847
  closeOnSelect: boolean;
1848
+ locale: string;
1849
+ class: string;
1846
1850
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1847
1851
  declare const _default$50: typeof __VLS_export$34;
1848
1852
  //#endregion
@@ -2305,7 +2309,7 @@ type __VLS_WithSlots$21<T, S> = T & {
2305
2309
  //#region src/components/button/index.d.ts
2306
2310
  export declare const buttonVariants: (props?: {
2307
2311
  variant?: "default" | "secondary" | "destructive" | "outline" | "ghost" | "link";
2308
- size?: "default" | "sm" | "lg" | "icon";
2312
+ size?: "sm" | "lg" | "default" | "icon";
2309
2313
  } & import("class-variance-authority/types").ClassProp) => string;
2310
2314
  export type ButtonVariants = VariantProps<typeof buttonVariants>;
2311
2315
  //#endregion
@@ -2407,14 +2411,14 @@ declare const __VLS_export$28: import("vue").DefineComponent<import("vue").Extra
2407
2411
  }>> & Readonly<{
2408
2412
  "onUpdate:modelValue"?: (value: string) => any;
2409
2413
  }>, {
2410
- mode: "day" | "month" | "year";
2411
- numOfMonths: number;
2412
2414
  modelValue: string;
2413
2415
  defaultValue: string;
2414
2416
  min: string;
2415
2417
  max: string;
2416
- isDateUnavailable: (date: DateValue) => boolean;
2417
2418
  locale: string;
2419
+ mode: "day" | "month" | "year";
2420
+ numOfMonths: number;
2421
+ isDateUnavailable: (date: DateValue) => boolean;
2418
2422
  week: boolean;
2419
2423
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2420
2424
  declare const _default$6: typeof __VLS_export$28;
@@ -2477,7 +2481,7 @@ type __VLS_WithSlots$20<T, S> = T & {
2477
2481
  //#endregion
2478
2482
  //#region src/components/card/index.d.ts
2479
2483
  export declare const cardVariants: (props?: {
2480
- size?: "default" | "sm" | "lg";
2484
+ size?: "sm" | "lg" | "default";
2481
2485
  bordered?: boolean;
2482
2486
  hoverable?: boolean;
2483
2487
  interactive?: boolean;
@@ -2594,10 +2598,10 @@ declare const __VLS_base$19: import("vue").DefineComponent<import("vue").Extract
2594
2598
  defaultOpen: boolean;
2595
2599
  lazyMount: boolean;
2596
2600
  unmountOnExit: boolean;
2601
+ contentClass: string;
2597
2602
  title: string;
2598
2603
  description: string;
2599
2604
  showCloseButton: boolean;
2600
- contentClass: string;
2601
2605
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2602
2606
  declare const __VLS_export$26: __VLS_WithSlots$19<typeof __VLS_base$19, __VLS_Slots$19>;
2603
2607
  declare const _default$14: typeof __VLS_export$26;
@@ -3025,12 +3029,12 @@ declare const __VLS_base$11: import("vue").DefineComponent<import("vue").Extract
3025
3029
  onComplete?: (value: string[]) => any;
3026
3030
  }>, {
3027
3031
  length: number;
3028
- type: "numeric" | "alphanumeric";
3029
3032
  modelValue: string[];
3030
- class: string;
3031
- invalid: boolean;
3033
+ type: "numeric" | "alphanumeric";
3032
3034
  placeholder: string;
3033
3035
  disabled: boolean;
3036
+ invalid: boolean;
3037
+ class: string;
3034
3038
  otp: boolean;
3035
3039
  mask: boolean;
3036
3040
  autoSubmit: boolean;
@@ -3134,8 +3138,8 @@ declare const __VLS_base$10: import("vue").DefineComponent<import("vue").Extract
3134
3138
  defaultOpen: boolean;
3135
3139
  lazyMount: boolean;
3136
3140
  unmountOnExit: boolean;
3137
- contentClass: string;
3138
3141
  align: Align;
3142
+ contentClass: string;
3139
3143
  contentProps: Record<string, unknown>;
3140
3144
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
3141
3145
  declare const __VLS_export$14: __VLS_WithSlots$10<typeof __VLS_base$10, __VLS_Slots$10>;