@ichaingo/ui 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/.babelrc +12 -0
  2. package/README.md +103 -0
  3. package/components.json +21 -0
  4. package/dist/accordion.d.ts +13 -0
  5. package/dist/accordion.mjs +64 -0
  6. package/dist/alert-dialog.d.ts +27 -0
  7. package/dist/alert-dialog.mjs +146 -0
  8. package/dist/alert.d.ts +16 -0
  9. package/dist/alert.mjs +66 -0
  10. package/dist/aspect-ratio.d.ts +6 -0
  11. package/dist/aspect-ratio.mjs +10 -0
  12. package/dist/avatar.d.ts +11 -0
  13. package/dist/avatar.mjs +53 -0
  14. package/dist/badge.d.ts +14 -0
  15. package/dist/badge.mjs +39 -0
  16. package/dist/breadcrumb.d.ts +20 -0
  17. package/dist/breadcrumb.mjs +102 -0
  18. package/dist/button.d.ts +15 -0
  19. package/dist/button.mjs +49 -0
  20. package/dist/calendar.d.ts +23 -0
  21. package/dist/calendar.mjs +173 -0
  22. package/dist/card.d.ts +18 -0
  23. package/dist/card.mjs +90 -0
  24. package/dist/carousel.d.ts +42 -0
  25. package/dist/carousel.mjs +177 -0
  26. package/dist/checkbox.d.ts +7 -0
  27. package/dist/checkbox.mjs +31 -0
  28. package/dist/collapsible.d.ts +10 -0
  29. package/dist/collapsible.mjs +34 -0
  30. package/dist/command.d.ts +31 -0
  31. package/dist/command.mjs +170 -0
  32. package/dist/context-menu.d.ts +42 -0
  33. package/dist/context-menu.mjs +223 -0
  34. package/dist/dialog.d.ts +27 -0
  35. package/dist/dialog.mjs +136 -0
  36. package/dist/dropdown-menu.d.ts +42 -0
  37. package/dist/dropdown-menu.mjs +231 -0
  38. package/dist/form.d.ts +38 -0
  39. package/dist/form.mjs +101 -0
  40. package/dist/hover-card.d.ts +11 -0
  41. package/dist/hover-card.mjs +38 -0
  42. package/dist/input.d.ts +6 -0
  43. package/dist/input.mjs +21 -0
  44. package/dist/label.d.ts +7 -0
  45. package/dist/label.mjs +23 -0
  46. package/dist/menubar.d.ts +44 -0
  47. package/dist/menubar.mjs +251 -0
  48. package/dist/navigation-menu.d.ts +26 -0
  49. package/dist/navigation-menu.mjs +170 -0
  50. package/dist/pagination.d.ts +33 -0
  51. package/dist/pagination.mjs +116 -0
  52. package/dist/popover.d.ts +13 -0
  53. package/dist/popover.mjs +44 -0
  54. package/dist/progress.d.ts +7 -0
  55. package/dist/progress.mjs +31 -0
  56. package/dist/radio-group.d.ts +9 -0
  57. package/dist/radio-group.mjs +45 -0
  58. package/dist/resizable.d.ts +13 -0
  59. package/dist/resizable.mjs +48 -0
  60. package/dist/scroll-area.d.ts +9 -0
  61. package/dist/scroll-area.mjs +60 -0
  62. package/dist/select.d.ts +27 -0
  63. package/dist/select.mjs +169 -0
  64. package/dist/separator.d.ts +7 -0
  65. package/dist/separator.mjs +26 -0
  66. package/dist/sheet.d.ts +23 -0
  67. package/dist/sheet.mjs +126 -0
  68. package/dist/skeleton.d.ts +5 -0
  69. package/dist/skeleton.mjs +15 -0
  70. package/dist/slider.d.ts +7 -0
  71. package/dist/slider.mjs +63 -0
  72. package/dist/sonner.d.ts +6 -0
  73. package/dist/sonner.mjs +22 -0
  74. package/dist/switch.d.ts +7 -0
  75. package/dist/switch.mjs +31 -0
  76. package/dist/table.d.ts +20 -0
  77. package/dist/table.mjs +114 -0
  78. package/dist/tabs.d.ts +13 -0
  79. package/dist/tabs.mjs +67 -0
  80. package/dist/textarea.d.ts +6 -0
  81. package/dist/textarea.mjs +18 -0
  82. package/dist/toggle-group.d.ts +16 -0
  83. package/dist/toggle-group.mjs +62 -0
  84. package/dist/toggle.d.ts +14 -0
  85. package/dist/toggle.mjs +43 -0
  86. package/dist/tooltip.d.ts +13 -0
  87. package/dist/tooltip.mjs +55 -0
  88. package/dist/utils-B7J70Nno.js +8 -0
  89. package/eslint.config.mjs +12 -0
  90. package/package.json +273 -0
  91. package/postcss.config.js +6 -0
  92. package/src/components/ui/accordion.tsx +64 -0
  93. package/src/components/ui/alert-dialog.tsx +155 -0
  94. package/src/components/ui/alert.tsx +66 -0
  95. package/src/components/ui/aspect-ratio.tsx +9 -0
  96. package/src/components/ui/avatar.tsx +51 -0
  97. package/src/components/ui/badge.tsx +46 -0
  98. package/src/components/ui/breadcrumb.tsx +109 -0
  99. package/src/components/ui/button.tsx +59 -0
  100. package/src/components/ui/calendar.tsx +211 -0
  101. package/src/components/ui/card.tsx +92 -0
  102. package/src/components/ui/carousel.tsx +239 -0
  103. package/src/components/ui/checkbox.tsx +30 -0
  104. package/src/components/ui/collapsible.tsx +31 -0
  105. package/src/components/ui/command.tsx +182 -0
  106. package/src/components/ui/context-menu.tsx +250 -0
  107. package/src/components/ui/dialog.tsx +141 -0
  108. package/src/components/ui/dropdown-menu.tsx +255 -0
  109. package/src/components/ui/form.tsx +165 -0
  110. package/src/components/ui/hover-card.tsx +42 -0
  111. package/src/components/ui/input.tsx +21 -0
  112. package/src/components/ui/label.tsx +24 -0
  113. package/src/components/ui/menubar.tsx +274 -0
  114. package/src/components/ui/navigation-menu.tsx +168 -0
  115. package/src/components/ui/pagination.tsx +125 -0
  116. package/src/components/ui/popover.tsx +46 -0
  117. package/src/components/ui/progress.tsx +29 -0
  118. package/src/components/ui/radio-group.tsx +43 -0
  119. package/src/components/ui/resizable.tsx +54 -0
  120. package/src/components/ui/scroll-area.tsx +56 -0
  121. package/src/components/ui/select.tsx +183 -0
  122. package/src/components/ui/separator.tsx +26 -0
  123. package/src/components/ui/sheet.tsx +137 -0
  124. package/src/components/ui/skeleton.tsx +13 -0
  125. package/src/components/ui/slider.tsx +61 -0
  126. package/src/components/ui/sonner.tsx +23 -0
  127. package/src/components/ui/switch.tsx +29 -0
  128. package/src/components/ui/table.tsx +114 -0
  129. package/src/components/ui/tabs.tsx +64 -0
  130. package/src/components/ui/textarea.tsx +18 -0
  131. package/src/components/ui/toggle-group.tsx +71 -0
  132. package/src/components/ui/toggle.tsx +45 -0
  133. package/src/components/ui/tooltip.tsx +59 -0
  134. package/src/index.ts +46 -0
  135. package/src/lib/utils.ts +6 -0
  136. package/src/style.css +0 -0
  137. package/tailwind.config.js +52 -0
  138. package/tsconfig.json +19 -0
  139. package/tsconfig.lib.json +54 -0
  140. package/tsconfig.spec.json +32 -0
  141. package/vite.config.ts +136 -0
package/vite.config.ts ADDED
@@ -0,0 +1,136 @@
1
+ /// <reference types='vitest' />
2
+ import { defineConfig } from 'vite';
3
+ import react from '@vitejs/plugin-react';
4
+ import dts from 'vite-plugin-dts';
5
+ import * as path from 'path';
6
+ import tailwindcss from '@tailwindcss/vite';
7
+ import type { Plugin } from 'vite';
8
+ import preserveUseClientDirective from 'rollup-plugin-preserve-use-client';
9
+
10
+ export default defineConfig({
11
+ root: __dirname,
12
+ cacheDir: '../node_modules/.vite/ui',
13
+ plugins: [
14
+ react(),
15
+ tailwindcss() as unknown as Plugin,
16
+ preserveUseClientDirective(),
17
+ dts({
18
+ entryRoot: 'src',
19
+ tsconfigPath: path.join(__dirname, 'tsconfig.lib.json'),
20
+ // 为每个入口点生成对应的 .d.ts 文件
21
+ rollupTypes: true,
22
+ // 确保生成类型声明文件
23
+ insertTypesEntry: false,
24
+ // 为每个组件生成独立的类型文件
25
+ copyDtsFiles: false,
26
+ }),
27
+ ],
28
+ resolve: {
29
+ alias: {
30
+ '@': path.resolve(__dirname, 'src'),
31
+ },
32
+ },
33
+ // Uncomment this if you are using workers.
34
+ // worker: {
35
+ // plugins: [ nxViteTsPaths() ],
36
+ // },
37
+ // Configuration for building your library.
38
+ // See: https://vitejs.dev/guide/build.html#library-mode
39
+ build: {
40
+ outDir: './dist',
41
+ emptyOutDir: true,
42
+ minify: true,
43
+ reportCompressedSize: true,
44
+ commonjsOptions: {
45
+ transformMixedEsModules: true,
46
+ },
47
+ lib: {
48
+ // 多入口配置
49
+ entry: {
50
+ accordion: 'src/components/ui/accordion.tsx',
51
+ alert: 'src/components/ui/alert.tsx',
52
+ 'alert-dialog': 'src/components/ui/alert-dialog.tsx',
53
+ 'aspect-ratio': 'src/components/ui/aspect-ratio.tsx',
54
+ avatar: 'src/components/ui/avatar.tsx',
55
+ badge: 'src/components/ui/badge.tsx',
56
+ breadcrumb: 'src/components/ui/breadcrumb.tsx',
57
+ button: 'src/components/ui/button.tsx',
58
+ calendar: 'src/components/ui/calendar.tsx',
59
+ card: 'src/components/ui/card.tsx',
60
+ carousel: 'src/components/ui/carousel.tsx',
61
+ checkbox: 'src/components/ui/checkbox.tsx',
62
+ collapsible: 'src/components/ui/collapsible.tsx',
63
+ command: 'src/components/ui/command.tsx',
64
+ 'context-menu': 'src/components/ui/context-menu.tsx',
65
+ dialog: 'src/components/ui/dialog.tsx',
66
+ 'dropdown-menu': 'src/components/ui/dropdown-menu.tsx',
67
+ form: 'src/components/ui/form.tsx',
68
+ 'hover-card': 'src/components/ui/hover-card.tsx',
69
+ input: 'src/components/ui/input.tsx',
70
+ label: 'src/components/ui/label.tsx',
71
+ menubar: 'src/components/ui/menubar.tsx',
72
+ 'navigation-menu': 'src/components/ui/navigation-menu.tsx',
73
+ pagination: 'src/components/ui/pagination.tsx',
74
+ popover: 'src/components/ui/popover.tsx',
75
+ progress: 'src/components/ui/progress.tsx',
76
+ 'radio-group': 'src/components/ui/radio-group.tsx',
77
+ resizable: 'src/components/ui/resizable.tsx',
78
+ 'scroll-area': 'src/components/ui/scroll-area.tsx',
79
+ select: 'src/components/ui/select.tsx',
80
+ separator: 'src/components/ui/separator.tsx',
81
+ sheet: 'src/components/ui/sheet.tsx',
82
+ skeleton: 'src/components/ui/skeleton.tsx',
83
+ slider: 'src/components/ui/slider.tsx',
84
+ sonner: 'src/components/ui/sonner.tsx',
85
+ switch: 'src/components/ui/switch.tsx',
86
+ table: 'src/components/ui/table.tsx',
87
+ tabs: 'src/components/ui/tabs.tsx',
88
+ textarea: 'src/components/ui/textarea.tsx',
89
+ 'toggle-group': 'src/components/ui/toggle-group.tsx',
90
+ toggle: 'src/components/ui/toggle.tsx',
91
+ tooltip: 'src/components/ui/tooltip.tsx',
92
+ },
93
+ name: '@ichaingo/ui',
94
+ fileName: (format, entryName) => `${entryName}.${format === 'es' ? 'mjs' : 'js'}`,
95
+ // Change this to the formats you want to support.
96
+ // Don't forget to update your package.json as well.
97
+ formats: ['es' as const]
98
+ },
99
+ rollupOptions: {
100
+ // External packages that should not be bundled into your library.
101
+ external: [
102
+ 'react',
103
+ 'react-dom',
104
+ 'react/jsx-runtime',
105
+ 'tailwindcss',
106
+ 'tailwind-merge',
107
+ 'class-variance-authority',
108
+ /^@radix-ui\/.+/,
109
+ 'clsx',
110
+ 'lucide-react',
111
+ 'date-fns',
112
+ 'embla-carousel-react',
113
+ 'react-day-picker',
114
+ 'react-hook-form',
115
+ 'react-resizable-panels',
116
+ 'sonner',
117
+ 'tailwindcss-animate',
118
+ 'zod',
119
+ '@hookform/resolvers',
120
+ 'cmdk',
121
+ 'next-themes'
122
+ ],
123
+ },
124
+ },
125
+ test: {
126
+ watch: false,
127
+ globals: true,
128
+ environment: 'jsdom',
129
+ include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
130
+ reporters: ['default'],
131
+ coverage: {
132
+ reportsDirectory: './test-output/vitest/coverage',
133
+ provider: 'v8' as const,
134
+ },
135
+ },
136
+ });