@meta-1/design 0.0.159
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/README.md +412 -0
- package/package.json +138 -0
- package/src/assets/icons/empty.svg +1 -0
- package/src/assets/icons/spin.svg +1 -0
- package/src/assets/locales/en-us.ts +74 -0
- package/src/assets/locales/zh-cn.ts +74 -0
- package/src/assets/locales/zh-tw.ts +74 -0
- package/src/assets/style/theme.css +173 -0
- package/src/components/icons/Empty.tsx +18 -0
- package/src/components/icons/Spin.tsx +16 -0
- package/src/components/icons/index.ts +2 -0
- package/src/components/ui/alert-dialog.tsx +111 -0
- package/src/components/ui/alert.tsx +49 -0
- package/src/components/ui/avatar.tsx +32 -0
- package/src/components/ui/badge.tsx +36 -0
- package/src/components/ui/breadcrumb.tsx +92 -0
- package/src/components/ui/button.tsx +52 -0
- package/src/components/ui/calendar.tsx +56 -0
- package/src/components/ui/card.tsx +56 -0
- package/src/components/ui/checkbox.tsx +28 -0
- package/src/components/ui/command.tsx +137 -0
- package/src/components/ui/dialog.tsx +127 -0
- package/src/components/ui/dropdown-menu.tsx +217 -0
- package/src/components/ui/form.tsx +138 -0
- package/src/components/ui/hover-card.tsx +36 -0
- package/src/components/ui/input-otp.tsx +66 -0
- package/src/components/ui/input.tsx +21 -0
- package/src/components/ui/label.tsx +21 -0
- package/src/components/ui/navigation-menu.tsx +142 -0
- package/src/components/ui/pagination.tsx +118 -0
- package/src/components/ui/popover.tsx +40 -0
- package/src/components/ui/progress.tsx +22 -0
- package/src/components/ui/radio-group.tsx +31 -0
- package/src/components/ui/resizable.tsx +46 -0
- package/src/components/ui/scroll-area.tsx +46 -0
- package/src/components/ui/select.tsx +158 -0
- package/src/components/ui/separator.tsx +26 -0
- package/src/components/ui/sheet.tsx +101 -0
- package/src/components/ui/skeleton.tsx +7 -0
- package/src/components/ui/sonner.tsx +23 -0
- package/src/components/ui/switch.tsx +26 -0
- package/src/components/ui/table.tsx +73 -0
- package/src/components/ui/tabs.tsx +40 -0
- package/src/components/ui/textarea.tsx +18 -0
- package/src/components/ui/tooltip.tsx +46 -0
- package/src/components/uix/action/index.tsx +37 -0
- package/src/components/uix/alert/index.tsx +43 -0
- package/src/components/uix/alert-dialog/index.tsx +109 -0
- package/src/components/uix/avatar/index.tsx +25 -0
- package/src/components/uix/breadcrumbs/index.tsx +38 -0
- package/src/components/uix/broadcast-channel-context/index.tsx +28 -0
- package/src/components/uix/button/index.tsx +29 -0
- package/src/components/uix/card/index.tsx +32 -0
- package/src/components/uix/checkbox/index.tsx +79 -0
- package/src/components/uix/checkbox-group/index.tsx +60 -0
- package/src/components/uix/combo-select/index.tsx +364 -0
- package/src/components/uix/config-provider/index.tsx +31 -0
- package/src/components/uix/data-table/index.tsx +491 -0
- package/src/components/uix/data-table/style.css +40 -0
- package/src/components/uix/date-picker/index.tsx +88 -0
- package/src/components/uix/date-range-picker/index.tsx +71 -0
- package/src/components/uix/dialog/index.tsx +70 -0
- package/src/components/uix/divider/index.tsx +23 -0
- package/src/components/uix/dropdown/index.tsx +117 -0
- package/src/components/uix/empty/index.tsx +29 -0
- package/src/components/uix/filters/index.tsx +105 -0
- package/src/components/uix/form/index.tsx +274 -0
- package/src/components/uix/image/index.tsx +13 -0
- package/src/components/uix/loading/index.tsx +24 -0
- package/src/components/uix/message/index.tsx +21 -0
- package/src/components/uix/pagination/index.tsx +180 -0
- package/src/components/uix/radio-group/index.tsx +35 -0
- package/src/components/uix/result/index.tsx +45 -0
- package/src/components/uix/select/index.tsx +93 -0
- package/src/components/uix/space/index.tsx +24 -0
- package/src/components/uix/spin/index.tsx +12 -0
- package/src/components/uix/steps/index.tsx +67 -0
- package/src/components/uix/switch/index.tsx +33 -0
- package/src/components/uix/tooltip/index.tsx +29 -0
- package/src/components/uix/tree/index.tsx +39 -0
- package/src/components/uix/tree/style.css +75 -0
- package/src/components/uix/tree-select/index.tsx +137 -0
- package/src/components/uix/tree-table/action.tsx +24 -0
- package/src/components/uix/tree-table/config.ts +2 -0
- package/src/components/uix/tree-table/index.tsx +86 -0
- package/src/components/uix/tree-table/utils.tsx +63 -0
- package/src/components/uix/uploader/index.tsx +237 -0
- package/src/components/uix/uploader/type.ts +20 -0
- package/src/components/uix/uploader/utils.ts +41 -0
- package/src/components/uix/value-formatter/index.tsx +59 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/resize.ts +29 -0
- package/src/hooks/use.outside.ts +30 -0
- package/src/index.ts +159 -0
- package/src/lib/formatters.ts +13 -0
- package/src/lib/index.ts +4 -0
- package/src/lib/is.ts +6 -0
- package/src/lib/react-dom.ts +98 -0
- package/src/lib/utils.ts +39 -0
package/README.md
ADDED
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
# @meta-1/design - React UI 组件库
|
|
2
|
+
|
|
3
|
+
基于 Radix UI 和 Tailwind CSS 构建的现代化 React 组件库,提供美观、易用、无障碍的 UI 组件。
|
|
4
|
+
|
|
5
|
+
## ✨ 特性
|
|
6
|
+
|
|
7
|
+
- 🎨 **现代设计** - 美观、简洁的视觉设计
|
|
8
|
+
- ♿ **无障碍访问** - 符合 WCAG 标准,基于 Radix UI
|
|
9
|
+
- 🎯 **类型安全** - 完整的 TypeScript 支持
|
|
10
|
+
- 🌗 **主题系统** - 支持明暗主题切换
|
|
11
|
+
- 📦 **模块化** - 按需导入,减小包体积
|
|
12
|
+
- 🎭 **灵活定制** - 基于 Tailwind CSS,易于定制
|
|
13
|
+
- 🔧 **工具齐全** - 内置表单、表格、树形控件等常用组件
|
|
14
|
+
- 🌍 **国际化** - 内置多语言支持
|
|
15
|
+
|
|
16
|
+
## 📦 安装
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install @meta-1/design
|
|
20
|
+
# 或
|
|
21
|
+
pnpm add @meta-1/design
|
|
22
|
+
# 或
|
|
23
|
+
yarn add @meta-1/design
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### 依赖安装
|
|
27
|
+
|
|
28
|
+
确保安装必要的依赖:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pnpm add react react-dom next tailwindcss
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## 🚀 快速开始
|
|
35
|
+
|
|
36
|
+
### 1. 配置 Tailwind CSS
|
|
37
|
+
|
|
38
|
+
在你的 `tailwind.config.js` 中:
|
|
39
|
+
|
|
40
|
+
```js
|
|
41
|
+
module.exports = {
|
|
42
|
+
content: [
|
|
43
|
+
'./src/**/*.{js,ts,jsx,tsx}',
|
|
44
|
+
'./node_modules/@meta-1/design/**/*.{js,ts,jsx,tsx}',
|
|
45
|
+
],
|
|
46
|
+
// ... 其他配置
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### 2. 导入主题样式
|
|
51
|
+
|
|
52
|
+
在你的应用入口文件中导入主题样式:
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
import '@meta-1/design/theme.css';
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### 3. 使用组件
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
import { Button, Input, Card } from '@meta-1/design';
|
|
62
|
+
|
|
63
|
+
export default function App() {
|
|
64
|
+
return (
|
|
65
|
+
<Card>
|
|
66
|
+
<h1>欢迎使用 @meta-1/design</h1>
|
|
67
|
+
<Input placeholder="输入内容" />
|
|
68
|
+
<Button>提交</Button>
|
|
69
|
+
</Card>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## 📚 组件列表
|
|
75
|
+
|
|
76
|
+
### 基础组件
|
|
77
|
+
|
|
78
|
+
#### Button - 按钮
|
|
79
|
+
```tsx
|
|
80
|
+
import { Button } from '@meta-1/design';
|
|
81
|
+
|
|
82
|
+
<Button variant="primary">主要按钮</Button>
|
|
83
|
+
<Button variant="outline">边框按钮</Button>
|
|
84
|
+
<Button variant="ghost">幽灵按钮</Button>
|
|
85
|
+
<Button size="sm">小按钮</Button>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
#### Input - 输入框
|
|
89
|
+
```tsx
|
|
90
|
+
import { Input } from '@meta-1/design';
|
|
91
|
+
|
|
92
|
+
<Input placeholder="请输入" />
|
|
93
|
+
<Input type="password" />
|
|
94
|
+
<Input disabled />
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
#### Checkbox - 复选框
|
|
98
|
+
```tsx
|
|
99
|
+
import { Checkbox } from '@meta-1/design';
|
|
100
|
+
|
|
101
|
+
<Checkbox>记住我</Checkbox>
|
|
102
|
+
<Checkbox checked>已选中</Checkbox>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
#### Radio - 单选框
|
|
106
|
+
```tsx
|
|
107
|
+
import { RadioGroup, RadioGroupItem } from '@meta-1/design';
|
|
108
|
+
|
|
109
|
+
<RadioGroup>
|
|
110
|
+
<RadioGroupItem value="1">选项 1</RadioGroupItem>
|
|
111
|
+
<RadioGroupItem value="2">选项 2</RadioGroupItem>
|
|
112
|
+
</RadioGroup>
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
#### Switch - 开关
|
|
116
|
+
```tsx
|
|
117
|
+
import { Switch } from '@meta-1/design';
|
|
118
|
+
|
|
119
|
+
<Switch />
|
|
120
|
+
<Switch checked />
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
#### Select - 选择器
|
|
124
|
+
```tsx
|
|
125
|
+
import { Select, SelectTrigger, SelectContent, SelectItem } from '@meta-1/design';
|
|
126
|
+
|
|
127
|
+
<Select>
|
|
128
|
+
<SelectTrigger>选择选项</SelectTrigger>
|
|
129
|
+
<SelectContent>
|
|
130
|
+
<SelectItem value="1">选项 1</SelectItem>
|
|
131
|
+
<SelectItem value="2">选项 2</SelectItem>
|
|
132
|
+
</SelectContent>
|
|
133
|
+
</Select>
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### 布局组件
|
|
137
|
+
|
|
138
|
+
#### Card - 卡片
|
|
139
|
+
```tsx
|
|
140
|
+
import { Card, CardHeader, CardTitle, CardContent } from '@meta-1/design';
|
|
141
|
+
|
|
142
|
+
<Card>
|
|
143
|
+
<CardHeader>
|
|
144
|
+
<CardTitle>标题</CardTitle>
|
|
145
|
+
</CardHeader>
|
|
146
|
+
<CardContent>
|
|
147
|
+
内容
|
|
148
|
+
</CardContent>
|
|
149
|
+
</Card>
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
#### Dialog - 对话框
|
|
153
|
+
```tsx
|
|
154
|
+
import { Dialog, DialogTrigger, DialogContent, DialogTitle } from '@meta-1/design';
|
|
155
|
+
|
|
156
|
+
<Dialog>
|
|
157
|
+
<DialogTrigger>打开对话框</DialogTrigger>
|
|
158
|
+
<DialogContent>
|
|
159
|
+
<DialogTitle>标题</DialogTitle>
|
|
160
|
+
<p>内容</p>
|
|
161
|
+
</DialogContent>
|
|
162
|
+
</Dialog>
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
#### Tabs - 标签页
|
|
166
|
+
```tsx
|
|
167
|
+
import { Tabs, TabsList, TabsTrigger, TabsContent } from '@meta-1/design';
|
|
168
|
+
|
|
169
|
+
<Tabs defaultValue="tab1">
|
|
170
|
+
<TabsList>
|
|
171
|
+
<TabsTrigger value="tab1">标签 1</TabsTrigger>
|
|
172
|
+
<TabsTrigger value="tab2">标签 2</TabsTrigger>
|
|
173
|
+
</TabsList>
|
|
174
|
+
<TabsContent value="tab1">内容 1</TabsContent>
|
|
175
|
+
<TabsContent value="tab2">内容 2</TabsContent>
|
|
176
|
+
</Tabs>
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### 数据展示
|
|
180
|
+
|
|
181
|
+
#### Table - 表格
|
|
182
|
+
```tsx
|
|
183
|
+
import { Table, TableHeader, TableBody, TableRow, TableCell } from '@meta-1/design';
|
|
184
|
+
|
|
185
|
+
<Table>
|
|
186
|
+
<TableHeader>
|
|
187
|
+
<TableRow>
|
|
188
|
+
<TableCell>列 1</TableCell>
|
|
189
|
+
<TableCell>列 2</TableCell>
|
|
190
|
+
</TableRow>
|
|
191
|
+
</TableHeader>
|
|
192
|
+
<TableBody>
|
|
193
|
+
<TableRow>
|
|
194
|
+
<TableCell>数据 1</TableCell>
|
|
195
|
+
<TableCell>数据 2</TableCell>
|
|
196
|
+
</TableRow>
|
|
197
|
+
</TableBody>
|
|
198
|
+
</Table>
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
#### Tree - 树形控件
|
|
202
|
+
```tsx
|
|
203
|
+
import { Tree } from '@meta-1/design';
|
|
204
|
+
|
|
205
|
+
<Tree
|
|
206
|
+
data={[
|
|
207
|
+
{ key: '1', title: '节点 1', children: [...] }
|
|
208
|
+
]}
|
|
209
|
+
/>
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
#### Badge - 徽章
|
|
213
|
+
```tsx
|
|
214
|
+
import { Badge } from '@meta-1/design';
|
|
215
|
+
|
|
216
|
+
<Badge>徽章</Badge>
|
|
217
|
+
<Badge variant="success">成功</Badge>
|
|
218
|
+
<Badge variant="error">错误</Badge>
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
#### Avatar - 头像
|
|
222
|
+
```tsx
|
|
223
|
+
import { Avatar, AvatarImage, AvatarFallback } from '@meta-1/design';
|
|
224
|
+
|
|
225
|
+
<Avatar>
|
|
226
|
+
<AvatarImage src="/avatar.jpg" />
|
|
227
|
+
<AvatarFallback>UN</AvatarFallback>
|
|
228
|
+
</Avatar>
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### 反馈组件
|
|
232
|
+
|
|
233
|
+
#### Toast - 消息提示
|
|
234
|
+
```tsx
|
|
235
|
+
import { useToast } from '@meta-1/design';
|
|
236
|
+
|
|
237
|
+
const { toast } = useToast();
|
|
238
|
+
|
|
239
|
+
toast({
|
|
240
|
+
title: '成功',
|
|
241
|
+
description: '操作已完成',
|
|
242
|
+
});
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
#### Alert - 警告提示
|
|
246
|
+
```tsx
|
|
247
|
+
import { Alert, AlertTitle, AlertDescription } from '@meta-1/design';
|
|
248
|
+
|
|
249
|
+
<Alert>
|
|
250
|
+
<AlertTitle>提示</AlertTitle>
|
|
251
|
+
<AlertDescription>这是一条提示信息</AlertDescription>
|
|
252
|
+
</Alert>
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
#### Progress - 进度条
|
|
256
|
+
```tsx
|
|
257
|
+
import { Progress } from '@meta-1/design';
|
|
258
|
+
|
|
259
|
+
<Progress value={60} />
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### 导航组件
|
|
263
|
+
|
|
264
|
+
#### Menu - 菜单
|
|
265
|
+
```tsx
|
|
266
|
+
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem } from '@meta-1/design';
|
|
267
|
+
|
|
268
|
+
<DropdownMenu>
|
|
269
|
+
<DropdownMenuTrigger>菜单</DropdownMenuTrigger>
|
|
270
|
+
<DropdownMenuContent>
|
|
271
|
+
<DropdownMenuItem>选项 1</DropdownMenuItem>
|
|
272
|
+
<DropdownMenuItem>选项 2</DropdownMenuItem>
|
|
273
|
+
</DropdownMenuContent>
|
|
274
|
+
</DropdownMenu>
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
## 🎨 主题定制
|
|
278
|
+
|
|
279
|
+
### 使用主题
|
|
280
|
+
|
|
281
|
+
```tsx
|
|
282
|
+
import { ThemeProvider } from 'next-themes';
|
|
283
|
+
|
|
284
|
+
<ThemeProvider attribute="class" defaultTheme="system">
|
|
285
|
+
<App />
|
|
286
|
+
</ThemeProvider>
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### 切换主题
|
|
290
|
+
|
|
291
|
+
```tsx
|
|
292
|
+
import { useTheme } from 'next-themes';
|
|
293
|
+
|
|
294
|
+
const { theme, setTheme } = useTheme();
|
|
295
|
+
|
|
296
|
+
<button onClick={() => setTheme('dark')}>深色模式</button>
|
|
297
|
+
<button onClick={() => setTheme('light')}>浅色模式</button>
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
### 自定义颜色
|
|
301
|
+
|
|
302
|
+
在你的 CSS 文件中覆盖 CSS 变量:
|
|
303
|
+
|
|
304
|
+
```css
|
|
305
|
+
:root {
|
|
306
|
+
--primary: 220 90% 56%;
|
|
307
|
+
--secondary: 220 14% 96%;
|
|
308
|
+
/* ... 更多变量 */
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.dark {
|
|
312
|
+
--primary: 220 90% 56%;
|
|
313
|
+
--secondary: 220 14% 20%;
|
|
314
|
+
/* ... 更多变量 */
|
|
315
|
+
}
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
## 📖 高级用法
|
|
319
|
+
|
|
320
|
+
### 表单集成
|
|
321
|
+
|
|
322
|
+
与 React Hook Form 集成:
|
|
323
|
+
|
|
324
|
+
```tsx
|
|
325
|
+
import { useForm } from 'react-hook-form';
|
|
326
|
+
import { Input, Button } from '@meta-1/design';
|
|
327
|
+
|
|
328
|
+
export default function Form() {
|
|
329
|
+
const { register, handleSubmit } = useForm();
|
|
330
|
+
|
|
331
|
+
const onSubmit = (data) => console.log(data);
|
|
332
|
+
|
|
333
|
+
return (
|
|
334
|
+
<form onSubmit={handleSubmit(onSubmit)}>
|
|
335
|
+
<Input {...register('name')} placeholder="姓名" />
|
|
336
|
+
<Button type="submit">提交</Button>
|
|
337
|
+
</form>
|
|
338
|
+
);
|
|
339
|
+
}
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
### 表格高级功能
|
|
343
|
+
|
|
344
|
+
使用 TanStack Table:
|
|
345
|
+
|
|
346
|
+
```tsx
|
|
347
|
+
import { useReactTable } from '@tanstack/react-table';
|
|
348
|
+
import { Table } from '@meta-1/design';
|
|
349
|
+
|
|
350
|
+
// 完整示例请参考文档
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
## 🌍 国际化
|
|
354
|
+
|
|
355
|
+
```tsx
|
|
356
|
+
import zhCN from '@meta-1/design/locales/zh-cn';
|
|
357
|
+
import enUS from '@meta-1/design/locales/en-us';
|
|
358
|
+
|
|
359
|
+
// 使用你的 i18n 配置
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
## 🔧 工具函数
|
|
363
|
+
|
|
364
|
+
### cn - 类名合并
|
|
365
|
+
|
|
366
|
+
```tsx
|
|
367
|
+
import { cn } from '@meta-1/design/lib';
|
|
368
|
+
|
|
369
|
+
<div className={cn('base-class', condition && 'conditional-class')} />
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
## 📝 开发指南
|
|
373
|
+
|
|
374
|
+
### 项目结构
|
|
375
|
+
|
|
376
|
+
```
|
|
377
|
+
packages/design/
|
|
378
|
+
├── src/
|
|
379
|
+
│ ├── components/
|
|
380
|
+
│ │ ├── ui/ # 基础 UI 组件
|
|
381
|
+
│ │ ├── uix/ # 复杂组件
|
|
382
|
+
│ │ └── icons/ # 图标组件
|
|
383
|
+
│ ├── lib/ # 工具函数
|
|
384
|
+
│ ├── hooks/ # 自定义 Hooks
|
|
385
|
+
│ └── assets/ # 样式和资源
|
|
386
|
+
└── package.json
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
### 按需导入
|
|
390
|
+
|
|
391
|
+
```tsx
|
|
392
|
+
// 推荐:按需导入
|
|
393
|
+
import { Button } from '@meta-1/design';
|
|
394
|
+
import { Input } from '@meta-1/design';
|
|
395
|
+
|
|
396
|
+
// 或者从子路径导入
|
|
397
|
+
import { Button } from '@meta-1/design/components/ui/button';
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
## 🤝 贡献
|
|
401
|
+
|
|
402
|
+
欢迎贡献代码、报告问题或提出建议!
|
|
403
|
+
|
|
404
|
+
## 📄 许可证
|
|
405
|
+
|
|
406
|
+
MIT
|
|
407
|
+
|
|
408
|
+
## 🔗 相关链接
|
|
409
|
+
|
|
410
|
+
- [Radix UI](https://www.radix-ui.com/)
|
|
411
|
+
- [Tailwind CSS](https://tailwindcss.com/)
|
|
412
|
+
- [示例网站](https://design.example.com)
|
package/package.json
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@meta-1/design",
|
|
3
|
+
"version": "0.0.159",
|
|
4
|
+
"keywords": [
|
|
5
|
+
"easykit",
|
|
6
|
+
"design",
|
|
7
|
+
"tailwindcss",
|
|
8
|
+
"react"
|
|
9
|
+
],
|
|
10
|
+
"description": "Easy kit design components",
|
|
11
|
+
"author": "Grant <284885069@qq.com>",
|
|
12
|
+
"homepage": "https://github.com/zkit-org",
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/zkit-org/packages.git"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"icon": "svgr src/assets/icons --out-dir src/components/icons --typescript --icon"
|
|
20
|
+
},
|
|
21
|
+
"type": "module",
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@emotion/react": "11.11.4",
|
|
24
|
+
"@hookform/resolvers": "5.2.2",
|
|
25
|
+
"@radix-ui/react-alert-dialog": "1.1.2",
|
|
26
|
+
"@radix-ui/react-avatar": "1.1.1",
|
|
27
|
+
"@radix-ui/react-checkbox": "1.1.2",
|
|
28
|
+
"@radix-ui/react-dialog": "1.1.2",
|
|
29
|
+
"@radix-ui/react-dismissable-layer": "1.1.1",
|
|
30
|
+
"@radix-ui/react-dropdown-menu": "2.1.2",
|
|
31
|
+
"@radix-ui/react-focus-scope": "1.1.0",
|
|
32
|
+
"@radix-ui/react-hover-card": "1.1.2",
|
|
33
|
+
"@radix-ui/react-icons": "1.3.2",
|
|
34
|
+
"@radix-ui/react-label": "2.1.0",
|
|
35
|
+
"@radix-ui/react-navigation-menu": "^1.2.5",
|
|
36
|
+
"@radix-ui/react-popover": "1.1.2",
|
|
37
|
+
"@radix-ui/react-progress": "1.1.0",
|
|
38
|
+
"@radix-ui/react-radio-group": "1.2.1",
|
|
39
|
+
"@radix-ui/react-scroll-area": "1.2.1",
|
|
40
|
+
"@radix-ui/react-select": "2.1.2",
|
|
41
|
+
"@radix-ui/react-separator": "1.1.0",
|
|
42
|
+
"@radix-ui/react-slot": "1.1.0",
|
|
43
|
+
"@radix-ui/react-switch": "1.1.1",
|
|
44
|
+
"@radix-ui/react-tabs": "1.1.1",
|
|
45
|
+
"@radix-ui/react-toast": "1.2.2",
|
|
46
|
+
"@radix-ui/react-tooltip": "1.1.4",
|
|
47
|
+
"@tanstack/react-table": "8.20.5",
|
|
48
|
+
"class-variance-authority": "0.7.0",
|
|
49
|
+
"clsx": "2.1.1",
|
|
50
|
+
"cmdk": "1.0.0",
|
|
51
|
+
"date-fns": "3.6.0",
|
|
52
|
+
"escape-html": "1.0.3",
|
|
53
|
+
"github-markdown-css": "5.6.1",
|
|
54
|
+
"input-otp": "^1.4.2",
|
|
55
|
+
"is-hotkey": "0.2.0",
|
|
56
|
+
"lodash": "4.17.21",
|
|
57
|
+
"lucide-react": "0.400.0",
|
|
58
|
+
"next-themes": "0.4.4",
|
|
59
|
+
"rc-tree": "5.12.4",
|
|
60
|
+
"react-day-picker": "8.10.1",
|
|
61
|
+
"react-dropzone": "14.2.3",
|
|
62
|
+
"react-hook-form": "7.52.1",
|
|
63
|
+
"react-resizable-panels": "2.0.20",
|
|
64
|
+
"slate": "0.103.0",
|
|
65
|
+
"slate-history": "0.100.0",
|
|
66
|
+
"slate-react": "0.106.0",
|
|
67
|
+
"sonner": "^2.0.3",
|
|
68
|
+
"uuid": "10.0.0"
|
|
69
|
+
},
|
|
70
|
+
"devDependencies": {
|
|
71
|
+
"@types/uuid": "10.0.0"
|
|
72
|
+
},
|
|
73
|
+
"module": "./src/index.ts",
|
|
74
|
+
"types": "./src/index.ts",
|
|
75
|
+
"exports": {
|
|
76
|
+
".": {
|
|
77
|
+
"types": "./src/index.ts",
|
|
78
|
+
"default": "./src/index.ts"
|
|
79
|
+
},
|
|
80
|
+
"./components/*": {
|
|
81
|
+
"types": "./src/components/*/index.tsx",
|
|
82
|
+
"default": "./src/components/*/index.tsx"
|
|
83
|
+
},
|
|
84
|
+
"./components/ui/*": {
|
|
85
|
+
"types": "./src/components/ui/*.tsx",
|
|
86
|
+
"default": "./src/components/ui/*.tsx"
|
|
87
|
+
},
|
|
88
|
+
"./components/uix/*": {
|
|
89
|
+
"types": "./src/components/uix/*/index.tsx",
|
|
90
|
+
"default": "./src/components/uix/*/index.tsx"
|
|
91
|
+
},
|
|
92
|
+
"./components/icons": {
|
|
93
|
+
"types": "./src/components/icons/index.ts",
|
|
94
|
+
"default": "./src/components/icons/index.ts"
|
|
95
|
+
},
|
|
96
|
+
"./lib/*": {
|
|
97
|
+
"types": "./src/lib/*.ts",
|
|
98
|
+
"default": "./src/lib/*.ts"
|
|
99
|
+
},
|
|
100
|
+
"./lib": {
|
|
101
|
+
"types": "./src/lib/index.ts",
|
|
102
|
+
"default": "./src/lib/index.ts"
|
|
103
|
+
},
|
|
104
|
+
"./hooks/*": {
|
|
105
|
+
"types": "./src/hooks/*.ts",
|
|
106
|
+
"default": "./src/hooks/*.ts"
|
|
107
|
+
},
|
|
108
|
+
"./hooks": {
|
|
109
|
+
"types": "./src/hooks/index.ts",
|
|
110
|
+
"default": "./src/hooks/index.ts"
|
|
111
|
+
},
|
|
112
|
+
"./locales/*": {
|
|
113
|
+
"types": "./src/assets/locales/*",
|
|
114
|
+
"default": "./src/assets/locales/*"
|
|
115
|
+
},
|
|
116
|
+
"./locales/zh-cn": {
|
|
117
|
+
"types": "./src/assets/locales/zh-cn.ts",
|
|
118
|
+
"default": "./src/assets/locales/zh-cn.ts"
|
|
119
|
+
},
|
|
120
|
+
"./locales/zh-tw": {
|
|
121
|
+
"types": "./src/assets/locales/zh-tw.ts",
|
|
122
|
+
"default": "./src/assets/locales/zh-tw.ts"
|
|
123
|
+
},
|
|
124
|
+
"./locales/en-us": {
|
|
125
|
+
"types": "./src/assets/locales/en-us.ts",
|
|
126
|
+
"default": "./src/assets/locales/en-us.ts"
|
|
127
|
+
},
|
|
128
|
+
"./theme.css": "./src/assets/style/theme.css"
|
|
129
|
+
},
|
|
130
|
+
"publishConfig": {
|
|
131
|
+
"access": "public"
|
|
132
|
+
},
|
|
133
|
+
"files": [
|
|
134
|
+
"/src",
|
|
135
|
+
"package.json",
|
|
136
|
+
"README.md"
|
|
137
|
+
]
|
|
138
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg class="svg_21efd88b67__icon" viewBox="0 0 1485 1024" xmlns="http://www.w3.org/2000/svg" width="34.80472" height="24"><path d="M1243.625 633.444l-161.107-269.618c-3.034-6.358-8.38-10.26-14.593-10.26H401.248c-6.068 0-11.559 3.18-14.593 10.26L225.549 633.444c-1.59 1.59-1.59 3.179-1.59 6.357v329.87c0 10.26 6.069 16.617 16.183 16.617h989.756c9.97 0 16.183-6.357 16.183-16.616v-329.87c-0.867-2.457-0.867-4.046-2.456-6.358zM411.218 387.522h647.604l145.068 236.24H847.722c-9.97 0-16.183 6.359-16.183 16.617 0 54.762-43.78 99.843-96.663 99.843s-96.664-45.226-96.664-99.843c0-10.258-6.069-16.616-16.183-16.616H265.283l145.935-236.241z m801.775 566.256H256.18V657.14h351.4c8.38 65.02 62.852 116.603 127.295 116.603S854.513 722.161 862.17 657.14h351.544v296.493h-0.722zM149.547 796.718v-18.206c0-4.769-3.901-8.67-8.38-8.67s-8.38 3.901-8.38 8.67v18.205h-17.629c-4.623 0-8.38 3.902-8.38 8.67s3.901 8.67 8.38 8.67h17.628v18.205c0 4.768 3.901 8.67 8.38 8.67 4.624 0 8.381-3.902 8.381-8.67v-18.206h17.628c4.624 0 8.38-3.901 8.38-8.67s-3.901-8.669-8.38-8.669h-17.628z m1157.075-360.792h26.875c6.936 0 13.004 6.358 13.004 13.438 0 7.947-5.346 13.437-13.004 13.437h-26.875v27.742c0 7.08-6.068 13.438-13.004 13.438s-13.004-5.49-13.004-13.438v-27.742h-26.875c-6.936 0-13.004-6.357-13.004-13.437 0-7.947 5.346-13.438 13.004-13.438h26.875v-27.742c0-7.08 6.069-13.438 13.004-13.438 7.658 0 13.004 5.491 13.004 13.438v27.742z m94.352 118.193h16.905c4.624 0 8.38 3.901 8.38 8.67s-3.9 8.669-8.38 8.669h-16.905v17.483c0 4.768-3.901 8.67-8.38 8.67-4.624 0-8.38-3.902-8.38-7.948V572.18h-16.906c-4.624 0-8.38-3.901-8.38-8.67s3.9-8.669 8.38-8.669h16.905v-18.205c0-4.769 3.902-8.67 8.38-8.67 4.624 0 8.381 3.901 8.381 8.67v17.483zM171.8 413.819v-27.742c0-7.947-6.07-13.438-13.005-13.438-7.658 0-13.004 6.358-13.004 13.438v27.02h-26.152c-7.658 0-13.004 6.357-13.004 13.437 0 7.947 6.068 13.438 13.004 13.438h26.152v27.02c0 7.946 6.069 13.437 13.004 13.437 7.658 0 13.005-6.358 13.005-13.438v-27.02h26.152c7.658 0 13.004-6.357 13.004-13.437 0-7.947-6.068-13.437-13.004-13.437 0 0.722-26.152 0.722-26.152 0.722zM52.883 684.16C23.696 684.16 0 659.597 0 629.4s23.84-54.763 52.883-54.763c29.187 0 52.884 24.564 52.884 54.762 0.144 30.92-23.697 54.762-52.884 54.762z m0-27.019c14.594 0 26.153-11.848 26.153-27.02 0-15.026-11.56-27.02-26.153-27.02-14.593 0-26.152 11.85-26.152 27.02 0.144 15.172 11.559 27.02 26.152 27.02z m1407.91-151.425c-13.004 0-24.563-11.126-24.563-25.43 0-14.305 10.692-25.43 24.563-25.43 13.004 0 24.563 11.125 24.563 25.43 0 14.304-10.692 25.43-24.563 25.43z m0-11.848c6.936 0 12.282-5.491 12.282-12.716s-5.346-12.715-12.282-12.715-12.282 5.49-12.282 12.715c0 7.08 6.213 12.716 12.282 12.716zM393.591 94.93c10.692-11.126 28.32-11.126 39.156 0L531 195.64c10.693 11.125 10.693 29.33 0 40.457-10.692 11.125-28.32 11.125-39.156 0l-98.253-100.71c-10.693-11.126-10.693-29.331 0-40.457z m341.43-50.716c15.315 0 27.597 12.715 27.597 28.609v142.756c0 15.894-12.282 28.609-27.598 28.609-15.316 0-27.597-12.715-27.597-28.61V72.824c-0.867-15.172 12.281-28.61 27.597-28.61-0.722 0 0 0 0 0z m342.151 43.636c10.693 11.126 10.693 29.331 0 40.457l-97.386 100.71c-10.692 11.125-28.32 11.125-39.157 0-10.692-11.126-10.692-29.332 0-40.458l97.387-100.71c10.836-11.125 28.464-11.125 39.156 0z" fill="currentColor"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg fill="currentColor" class="svg_f013ea9dcb__svg_a0d71e7da7__icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="24" height="24"><path d="M512 1024c-136.768 0-265.344-53.248-362.048-149.952S0 648.768 0 512c0-96.832 27.2-191.104 78.592-272.704A513.28 513.28 0 0 1 282.944 54.016l43.008 85.824a417.92 417.92 0 0 0-166.144 150.656A414.72 414.72 0 0 0 96 512c0 229.376 186.624 416 416 416s416-186.624 416-416c0-78.72-22.08-155.264-63.808-221.504a416.96 416.96 0 0 0-166.144-150.656l43.008-85.824a513.28 513.28 0 0 1 204.352 185.28A510.784 510.784 0 0 1 1024 512c0 136.768-53.248 265.344-149.952 362.048S648.768 1024 512 1024z"/></svg>
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import "dayjs/locale/en";
|
|
2
|
+
import { enUS } from "date-fns/locale";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
key: "en-US",
|
|
6
|
+
Alert: {
|
|
7
|
+
okText: "Confirm",
|
|
8
|
+
cancelText: "Cancel",
|
|
9
|
+
},
|
|
10
|
+
ComboSelect: {
|
|
11
|
+
empty: "No data",
|
|
12
|
+
clearText: "Clear",
|
|
13
|
+
},
|
|
14
|
+
DataTable: {
|
|
15
|
+
empty: "No data",
|
|
16
|
+
},
|
|
17
|
+
Filters: {
|
|
18
|
+
searchText: "Search",
|
|
19
|
+
resetText: "Reset",
|
|
20
|
+
},
|
|
21
|
+
Pagination: {
|
|
22
|
+
totalPage: "Total %total items",
|
|
23
|
+
total: "%page pages",
|
|
24
|
+
size: "%size items/page",
|
|
25
|
+
go: "Go to",
|
|
26
|
+
goSuffix: "page",
|
|
27
|
+
},
|
|
28
|
+
Tree: {
|
|
29
|
+
emptyText: "No data",
|
|
30
|
+
},
|
|
31
|
+
TreeTable: {
|
|
32
|
+
emptyText: "No data",
|
|
33
|
+
},
|
|
34
|
+
DateRangePicker: {
|
|
35
|
+
locale: enUS,
|
|
36
|
+
format: "LLL dd, y",
|
|
37
|
+
},
|
|
38
|
+
Uploader: {
|
|
39
|
+
placeholder: "Drag 'n' drop some files here, or click to select files",
|
|
40
|
+
uploadText: "Upload",
|
|
41
|
+
maxFilesExceeded: "Maximum number of files exceeded",
|
|
42
|
+
partialFilesAdded: ", only %count more files can be added",
|
|
43
|
+
},
|
|
44
|
+
DatePicker: {
|
|
45
|
+
locale: enUS,
|
|
46
|
+
format: "LLL dd, y",
|
|
47
|
+
presetPlaceholder: "Quick select",
|
|
48
|
+
options: [
|
|
49
|
+
{
|
|
50
|
+
label: "Today",
|
|
51
|
+
value: "0",
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
label: "Tomorrow",
|
|
55
|
+
value: "1",
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
label: "In 3 days",
|
|
59
|
+
value: "3",
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
label: "In a week",
|
|
63
|
+
value: "7",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
label: "In a Month",
|
|
67
|
+
value: "30",
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
Empty: {
|
|
72
|
+
text: "No data",
|
|
73
|
+
},
|
|
74
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import "dayjs/locale/zh-cn";
|
|
2
|
+
import { zhCN } from "date-fns/locale";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
key: "zh-CN",
|
|
6
|
+
Alert: {
|
|
7
|
+
okText: "确定",
|
|
8
|
+
cancelText: "取消",
|
|
9
|
+
},
|
|
10
|
+
ComboSelect: {
|
|
11
|
+
empty: "暂无数据",
|
|
12
|
+
clearText: "清空",
|
|
13
|
+
},
|
|
14
|
+
DataTable: {
|
|
15
|
+
empty: "暂无数据",
|
|
16
|
+
},
|
|
17
|
+
Filters: {
|
|
18
|
+
searchText: "搜索",
|
|
19
|
+
resetText: "重置",
|
|
20
|
+
},
|
|
21
|
+
Pagination: {
|
|
22
|
+
totalPage: "共 %total 条",
|
|
23
|
+
total: "%page 页",
|
|
24
|
+
size: "%size 条/页",
|
|
25
|
+
go: "前往",
|
|
26
|
+
goSuffix: "页",
|
|
27
|
+
},
|
|
28
|
+
Tree: {
|
|
29
|
+
emptyText: "暂无数据",
|
|
30
|
+
},
|
|
31
|
+
TreeTable: {
|
|
32
|
+
emptyText: "暂无数据",
|
|
33
|
+
},
|
|
34
|
+
DateRangePicker: {
|
|
35
|
+
locale: zhCN,
|
|
36
|
+
format: "yyyy-MM-dd",
|
|
37
|
+
},
|
|
38
|
+
Uploader: {
|
|
39
|
+
placeholder: "请拖动文件到此处或者点击选择文件",
|
|
40
|
+
uploadText: "上传",
|
|
41
|
+
maxFilesExceeded: "已达到最大文件数量限制",
|
|
42
|
+
partialFilesAdded: ",只能再添加 %count 个文件",
|
|
43
|
+
},
|
|
44
|
+
DatePicker: {
|
|
45
|
+
locale: zhCN,
|
|
46
|
+
format: "yyyy-MM-dd",
|
|
47
|
+
presetPlaceholder: "快速选择",
|
|
48
|
+
options: [
|
|
49
|
+
{
|
|
50
|
+
label: "今天",
|
|
51
|
+
value: "0",
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
label: "明天",
|
|
55
|
+
value: "1",
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
label: "三天后",
|
|
59
|
+
value: "3",
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
label: "一周后",
|
|
63
|
+
value: "7",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
label: "一月后",
|
|
67
|
+
value: "30",
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
Empty: {
|
|
72
|
+
text: "暂无数据",
|
|
73
|
+
},
|
|
74
|
+
};
|