@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.
- package/.babelrc +12 -0
- package/README.md +103 -0
- package/components.json +21 -0
- package/dist/accordion.d.ts +13 -0
- package/dist/accordion.mjs +64 -0
- package/dist/alert-dialog.d.ts +27 -0
- package/dist/alert-dialog.mjs +146 -0
- package/dist/alert.d.ts +16 -0
- package/dist/alert.mjs +66 -0
- package/dist/aspect-ratio.d.ts +6 -0
- package/dist/aspect-ratio.mjs +10 -0
- package/dist/avatar.d.ts +11 -0
- package/dist/avatar.mjs +53 -0
- package/dist/badge.d.ts +14 -0
- package/dist/badge.mjs +39 -0
- package/dist/breadcrumb.d.ts +20 -0
- package/dist/breadcrumb.mjs +102 -0
- package/dist/button.d.ts +15 -0
- package/dist/button.mjs +49 -0
- package/dist/calendar.d.ts +23 -0
- package/dist/calendar.mjs +173 -0
- package/dist/card.d.ts +18 -0
- package/dist/card.mjs +90 -0
- package/dist/carousel.d.ts +42 -0
- package/dist/carousel.mjs +177 -0
- package/dist/checkbox.d.ts +7 -0
- package/dist/checkbox.mjs +31 -0
- package/dist/collapsible.d.ts +10 -0
- package/dist/collapsible.mjs +34 -0
- package/dist/command.d.ts +31 -0
- package/dist/command.mjs +170 -0
- package/dist/context-menu.d.ts +42 -0
- package/dist/context-menu.mjs +223 -0
- package/dist/dialog.d.ts +27 -0
- package/dist/dialog.mjs +136 -0
- package/dist/dropdown-menu.d.ts +42 -0
- package/dist/dropdown-menu.mjs +231 -0
- package/dist/form.d.ts +38 -0
- package/dist/form.mjs +101 -0
- package/dist/hover-card.d.ts +11 -0
- package/dist/hover-card.mjs +38 -0
- package/dist/input.d.ts +6 -0
- package/dist/input.mjs +21 -0
- package/dist/label.d.ts +7 -0
- package/dist/label.mjs +23 -0
- package/dist/menubar.d.ts +44 -0
- package/dist/menubar.mjs +251 -0
- package/dist/navigation-menu.d.ts +26 -0
- package/dist/navigation-menu.mjs +170 -0
- package/dist/pagination.d.ts +33 -0
- package/dist/pagination.mjs +116 -0
- package/dist/popover.d.ts +13 -0
- package/dist/popover.mjs +44 -0
- package/dist/progress.d.ts +7 -0
- package/dist/progress.mjs +31 -0
- package/dist/radio-group.d.ts +9 -0
- package/dist/radio-group.mjs +45 -0
- package/dist/resizable.d.ts +13 -0
- package/dist/resizable.mjs +48 -0
- package/dist/scroll-area.d.ts +9 -0
- package/dist/scroll-area.mjs +60 -0
- package/dist/select.d.ts +27 -0
- package/dist/select.mjs +169 -0
- package/dist/separator.d.ts +7 -0
- package/dist/separator.mjs +26 -0
- package/dist/sheet.d.ts +23 -0
- package/dist/sheet.mjs +126 -0
- package/dist/skeleton.d.ts +5 -0
- package/dist/skeleton.mjs +15 -0
- package/dist/slider.d.ts +7 -0
- package/dist/slider.mjs +63 -0
- package/dist/sonner.d.ts +6 -0
- package/dist/sonner.mjs +22 -0
- package/dist/switch.d.ts +7 -0
- package/dist/switch.mjs +31 -0
- package/dist/table.d.ts +20 -0
- package/dist/table.mjs +114 -0
- package/dist/tabs.d.ts +13 -0
- package/dist/tabs.mjs +67 -0
- package/dist/textarea.d.ts +6 -0
- package/dist/textarea.mjs +18 -0
- package/dist/toggle-group.d.ts +16 -0
- package/dist/toggle-group.mjs +62 -0
- package/dist/toggle.d.ts +14 -0
- package/dist/toggle.mjs +43 -0
- package/dist/tooltip.d.ts +13 -0
- package/dist/tooltip.mjs +55 -0
- package/dist/utils-B7J70Nno.js +8 -0
- package/eslint.config.mjs +12 -0
- package/package.json +273 -0
- package/postcss.config.js +6 -0
- package/src/components/ui/accordion.tsx +64 -0
- package/src/components/ui/alert-dialog.tsx +155 -0
- package/src/components/ui/alert.tsx +66 -0
- package/src/components/ui/aspect-ratio.tsx +9 -0
- package/src/components/ui/avatar.tsx +51 -0
- package/src/components/ui/badge.tsx +46 -0
- package/src/components/ui/breadcrumb.tsx +109 -0
- package/src/components/ui/button.tsx +59 -0
- package/src/components/ui/calendar.tsx +211 -0
- package/src/components/ui/card.tsx +92 -0
- package/src/components/ui/carousel.tsx +239 -0
- package/src/components/ui/checkbox.tsx +30 -0
- package/src/components/ui/collapsible.tsx +31 -0
- package/src/components/ui/command.tsx +182 -0
- package/src/components/ui/context-menu.tsx +250 -0
- package/src/components/ui/dialog.tsx +141 -0
- package/src/components/ui/dropdown-menu.tsx +255 -0
- package/src/components/ui/form.tsx +165 -0
- package/src/components/ui/hover-card.tsx +42 -0
- package/src/components/ui/input.tsx +21 -0
- package/src/components/ui/label.tsx +24 -0
- package/src/components/ui/menubar.tsx +274 -0
- package/src/components/ui/navigation-menu.tsx +168 -0
- package/src/components/ui/pagination.tsx +125 -0
- package/src/components/ui/popover.tsx +46 -0
- package/src/components/ui/progress.tsx +29 -0
- package/src/components/ui/radio-group.tsx +43 -0
- package/src/components/ui/resizable.tsx +54 -0
- package/src/components/ui/scroll-area.tsx +56 -0
- package/src/components/ui/select.tsx +183 -0
- package/src/components/ui/separator.tsx +26 -0
- package/src/components/ui/sheet.tsx +137 -0
- package/src/components/ui/skeleton.tsx +13 -0
- package/src/components/ui/slider.tsx +61 -0
- package/src/components/ui/sonner.tsx +23 -0
- package/src/components/ui/switch.tsx +29 -0
- package/src/components/ui/table.tsx +114 -0
- package/src/components/ui/tabs.tsx +64 -0
- package/src/components/ui/textarea.tsx +18 -0
- package/src/components/ui/toggle-group.tsx +71 -0
- package/src/components/ui/toggle.tsx +45 -0
- package/src/components/ui/tooltip.tsx +59 -0
- package/src/index.ts +46 -0
- package/src/lib/utils.ts +6 -0
- package/src/style.css +0 -0
- package/tailwind.config.js +52 -0
- package/tsconfig.json +19 -0
- package/tsconfig.lib.json +54 -0
- package/tsconfig.spec.json +32 -0
- 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
|
+
});
|