@teamix-evo/ui 0.1.1 → 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.
- package/README.md +1 -1
- package/package.json +8 -4
- package/src/components/accordion/accordion.meta.md +10 -5
- package/src/components/accordion/accordion.stories.tsx +11 -6
- package/src/components/affix/affix.meta.md +19 -10
- package/src/components/affix/affix.stories.tsx +4 -2
- package/src/components/alert/alert.meta.md +19 -14
- package/src/components/alert/alert.stories.tsx +1 -1
- package/src/components/alert/alert.tsx +5 -5
- package/src/components/alert-dialog/alert-dialog.meta.md +23 -10
- package/src/components/alert-dialog/alert-dialog.stories.tsx +1 -1
- package/src/components/alert-dialog/alert-dialog.tsx +1 -1
- package/src/components/anchor/anchor.meta.md +20 -11
- package/src/components/anchor/anchor.stories.tsx +1 -1
- package/src/components/app/app.meta.md +19 -10
- package/src/components/app/app.stories.tsx +4 -2
- package/src/components/aspect-ratio/aspect-ratio.meta.md +10 -5
- package/src/components/aspect-ratio/aspect-ratio.stories.tsx +1 -1
- package/src/components/auto-complete/auto-complete.meta.md +25 -16
- package/src/components/auto-complete/auto-complete.stories.tsx +4 -2
- package/src/components/avatar/avatar.meta.md +23 -11
- package/src/components/avatar/avatar.stories.tsx +1 -1
- package/src/components/badge/badge.meta.md +26 -21
- package/src/components/badge/badge.tsx +7 -13
- package/src/components/breadcrumb/breadcrumb.meta.md +21 -10
- package/src/components/breadcrumb/breadcrumb.stories.tsx +8 -0
- package/src/components/button/button.meta.md +22 -17
- package/src/components/button/button.stories.tsx +1 -1
- package/src/components/button/demo/as-child.tsx +24 -0
- package/src/components/button/demo/basic.tsx +8 -0
- package/src/components/button/demo/block.tsx +16 -0
- package/src/components/button/demo/loading.tsx +19 -0
- package/src/components/button/demo/shapes.tsx +18 -0
- package/src/components/button/demo/sizes.tsx +19 -0
- package/src/components/button/demo/variants.tsx +19 -0
- package/src/components/button/demo/with-icon.tsx +20 -0
- package/src/components/button-group/button-group.meta.md +18 -9
- package/src/components/button-group/button-group.stories.tsx +5 -2
- package/src/components/calendar/calendar.meta.md +14 -9
- package/src/components/calendar/calendar.stories.tsx +1 -1
- package/src/components/calendar/calendar.tsx +1 -1
- package/src/components/card/card.meta.md +36 -11
- package/src/components/card/card.stories.tsx +8 -0
- package/src/components/carousel/carousel.meta.md +16 -11
- package/src/components/carousel/carousel.stories.tsx +10 -5
- package/src/components/cascader/cascader.meta.md +28 -19
- package/src/components/cascader/cascader.stories.tsx +9 -8
- package/src/components/cascader/cascader.tsx +2 -2
- package/src/components/checkbox/checkbox.meta.md +26 -8
- package/src/components/checkbox/checkbox.stories.tsx +1 -1
- package/src/components/collapsible/collapsible.meta.md +11 -4
- package/src/components/collapsible/collapsible.stories.tsx +8 -0
- package/src/components/color-picker/color-picker.meta.md +27 -18
- package/src/components/color-picker/color-picker.stories.tsx +1 -1
- package/src/components/color-picker/color-picker.tsx +1 -0
- package/src/components/combobox/combobox.meta.md +29 -20
- package/src/components/combobox/combobox.stories.tsx +1 -1
- package/src/components/combobox/combobox.tsx +3 -3
- package/src/components/command/command.meta.md +32 -12
- package/src/components/command/command.stories.tsx +1 -1
- package/src/components/command/command.tsx +1 -1
- package/src/components/context-menu/context-menu.meta.md +34 -11
- package/src/components/context-menu/context-menu.stories.tsx +8 -0
- package/src/components/context-menu/context-menu.tsx +2 -2
- package/src/components/data-table/data-table.meta.md +24 -19
- package/src/components/data-table/data-table.stories.tsx +12 -5
- package/src/components/date-picker/date-picker.meta.md +40 -20
- package/src/components/date-picker/date-picker.stories.tsx +1 -1
- package/src/components/descriptions/descriptions.meta.md +23 -14
- package/src/components/descriptions/descriptions.stories.tsx +1 -1
- package/src/components/dialog/dialog.meta.md +25 -12
- package/src/components/dialog/dialog.stories.tsx +1 -1
- package/src/components/dialog/dialog.tsx +1 -1
- package/src/components/drawer/drawer.meta.md +19 -8
- package/src/components/drawer/drawer.stories.tsx +1 -1
- package/src/components/drawer/drawer.tsx +1 -0
- package/src/components/dropdown-menu/dropdown-menu.meta.md +42 -14
- package/src/components/dropdown-menu/dropdown-menu.stories.tsx +8 -0
- package/src/components/dropdown-menu/dropdown-menu.tsx +2 -2
- package/src/components/empty/empty.meta.md +20 -11
- package/src/components/empty/empty.stories.tsx +1 -1
- package/src/components/field/field.meta.md +27 -10
- package/src/components/field/field.stories.tsx +6 -3
- package/src/components/flex/flex.meta.md +23 -14
- package/src/components/flex/flex.stories.tsx +46 -14
- package/src/components/float-button/float-button.meta.md +35 -11
- package/src/components/float-button/float-button.stories.tsx +4 -2
- package/src/components/float-button/float-button.tsx +1 -1
- package/src/components/form/form.meta.md +57 -14
- package/src/components/form/form.stories.tsx +1 -1
- package/src/components/grid/grid.meta.md +31 -6
- package/src/components/grid/grid.stories.tsx +4 -2
- package/src/components/hover-card/hover-card.meta.md +21 -9
- package/src/components/hover-card/hover-card.stories.tsx +6 -2
- package/src/components/image/image.meta.md +24 -15
- package/src/components/image/image.stories.tsx +1 -1
- package/src/components/image/image.tsx +4 -4
- package/src/components/input/demo/addon.tsx +15 -0
- package/src/components/input/demo/basic.tsx +12 -0
- package/src/components/input/demo/clearable.tsx +21 -0
- package/src/components/input/demo/show-count.tsx +18 -0
- package/src/components/input/demo/sizes.tsx +15 -0
- package/src/components/input/demo/with-prefix-suffix.tsx +19 -0
- package/src/components/input/input.meta.md +21 -16
- package/src/components/input/input.stories.tsx +1 -1
- package/src/components/input/input.tsx +51 -47
- package/src/components/input-group/input-group.meta.md +26 -8
- package/src/components/input-group/input-group.stories.tsx +1 -1
- package/src/components/input-group/input-group.tsx +4 -3
- package/src/components/input-number/input-number.meta.md +26 -17
- package/src/components/input-number/input-number.stories.tsx +14 -3
- package/src/components/input-number/input-number.tsx +20 -6
- package/src/components/input-otp/input-otp.meta.md +22 -9
- package/src/components/input-otp/input-otp.stories.tsx +1 -1
- package/src/components/item/item.meta.md +32 -9
- package/src/components/item/item.stories.tsx +5 -2
- package/src/components/kbd/kbd.meta.md +29 -8
- package/src/components/kbd/kbd.stories.tsx +1 -1
- package/src/components/kbd/kbd.tsx +2 -1
- package/src/components/label/label.meta.md +14 -9
- package/src/components/masonry/masonry.meta.md +18 -9
- package/src/components/masonry/masonry.stories.tsx +4 -2
- package/src/components/masonry/masonry.tsx +1 -0
- package/src/components/mentions/mentions.meta.md +28 -19
- package/src/components/mentions/mentions.stories.tsx +1 -1
- package/src/components/mentions/mentions.tsx +2 -1
- package/src/components/menubar/menubar.meta.md +36 -14
- package/src/components/menubar/menubar.stories.tsx +8 -0
- package/src/components/menubar/menubar.tsx +2 -2
- package/src/components/native-select/native-select.meta.md +17 -8
- package/src/components/native-select/native-select.stories.tsx +6 -3
- package/src/components/navigation-menu/navigation-menu.meta.md +25 -11
- package/src/components/navigation-menu/navigation-menu.stories.tsx +11 -11
- package/src/components/navigation-menu/navigation-menu.tsx +3 -2
- package/src/components/notification/notification.meta.md +14 -5
- package/src/components/notification/notification.stories.tsx +5 -3
- package/src/components/notification/notification.tsx +3 -3
- package/src/components/pagination/pagination.meta.md +59 -28
- package/src/components/pagination/pagination.stories.tsx +9 -3
- package/src/components/popconfirm/popconfirm.meta.md +30 -21
- package/src/components/popconfirm/popconfirm.stories.tsx +1 -2
- package/src/components/popconfirm/popconfirm.tsx +1 -1
- package/src/components/popover/popover.meta.md +13 -8
- package/src/components/popover/popover.stories.tsx +1 -1
- package/src/components/progress/progress.meta.md +28 -13
- package/src/components/progress/progress.stories.tsx +1 -1
- package/src/components/progress/progress.tsx +6 -6
- package/src/components/radio-group/radio-group.meta.md +17 -12
- package/src/components/radio-group/radio-group.stories.tsx +1 -1
- package/src/components/rate/rate.meta.md +25 -16
- package/src/components/rate/rate.stories.tsx +11 -3
- package/src/components/rate/rate.tsx +2 -2
- package/src/components/resizable/resizable.meta.md +19 -8
- package/src/components/resizable/resizable.stories.tsx +1 -1
- package/src/components/result/result.meta.md +21 -12
- package/src/components/result/result.stories.tsx +2 -6
- package/src/components/result/result.tsx +3 -3
- package/src/components/scroll-area/scroll-area.meta.md +10 -5
- package/src/components/scroll-area/scroll-area.stories.tsx +8 -0
- package/src/components/scroll-area/scroll-area.tsx +3 -3
- package/src/components/segmented/segmented.meta.md +19 -14
- package/src/components/segmented/segmented.stories.tsx +35 -6
- package/src/components/select/select.meta.md +22 -9
- package/src/components/select/select.stories.tsx +1 -1
- package/src/components/select/select.tsx +2 -2
- package/src/components/separator/separator.meta.md +16 -11
- package/src/components/separator/separator.stories.tsx +1 -1
- package/src/components/sheet/sheet.meta.md +22 -11
- package/src/components/sheet/sheet.stories.tsx +1 -1
- package/src/components/sidebar/sidebar.meta.md +47 -18
- package/src/components/sidebar/sidebar.stories.tsx +10 -5
- package/src/components/skeleton/skeleton.meta.md +33 -10
- package/src/components/skeleton/skeleton.stories.tsx +1 -1
- package/src/components/slider/slider.meta.md +12 -7
- package/src/components/slider/slider.stories.tsx +1 -1
- package/src/components/sonner/sonner.meta.md +8 -3
- package/src/components/sonner/sonner.stories.tsx +13 -8
- package/src/components/space/space.meta.md +22 -13
- package/src/components/space/space.stories.tsx +20 -6
- package/src/components/spinner/spinner.meta.md +23 -10
- package/src/components/spinner/spinner.stories.tsx +1 -1
- package/src/components/statistic/statistic.meta.md +37 -16
- package/src/components/statistic/statistic.stories.tsx +2 -6
- package/src/components/statistic/statistic.tsx +1 -1
- package/src/components/steps/steps.meta.md +21 -12
- package/src/components/steps/steps.stories.tsx +7 -2
- package/src/components/switch/switch.meta.md +16 -11
- package/src/components/switch/switch.stories.tsx +1 -1
- package/src/components/switch/switch.tsx +58 -36
- package/src/components/table/table.meta.md +24 -9
- package/src/components/table/table.stories.tsx +9 -4
- package/src/components/tabs/tabs.meta.md +14 -9
- package/src/components/tabs/tabs.stories.tsx +8 -0
- package/src/components/tag/tag.meta.md +39 -10
- package/src/components/tag/tag.stories.tsx +7 -2
- package/src/components/tag/tag.tsx +3 -3
- package/src/components/textarea/textarea.meta.md +17 -12
- package/src/components/textarea/textarea.stories.tsx +1 -1
- package/src/components/textarea/textarea.tsx +1 -1
- package/src/components/time-picker/time-picker.meta.md +38 -15
- package/src/components/time-picker/time-picker.stories.tsx +44 -6
- package/src/components/time-picker/time-picker.tsx +74 -10
- package/src/components/timeline/timeline.meta.md +20 -11
- package/src/components/timeline/timeline.stories.tsx +14 -4
- package/src/components/timeline/timeline.tsx +3 -2
- package/src/components/toggle/toggle.meta.md +14 -9
- package/src/components/toggle/toggle.stories.tsx +1 -1
- package/src/components/toggle-group/toggle-group.meta.md +16 -11
- package/src/components/toggle-group/toggle-group.stories.tsx +1 -1
- package/src/components/tooltip/tooltip.meta.md +18 -13
- package/src/components/tooltip/tooltip.stories.tsx +1 -1
- package/src/components/tour/tour.meta.md +25 -16
- package/src/components/tour/tour.stories.tsx +1 -1
- package/src/components/tour/tour.tsx +1 -1
- package/src/components/transfer/transfer.meta.md +29 -20
- package/src/components/transfer/transfer.stories.tsx +2 -6
- package/src/components/tree/tree.meta.md +36 -23
- package/src/components/tree/tree.stories.tsx +30 -11
- package/src/components/tree-select/tree-select.meta.md +37 -22
- package/src/components/tree-select/tree-select.stories.tsx +1 -1
- package/src/components/tree-select/tree-select.tsx +1 -1
- package/src/components/typography/typography.meta.md +41 -16
- package/src/components/typography/typography.stories.tsx +4 -8
- package/src/components/typography/typography.tsx +5 -3
- package/src/components/upload/upload.meta.md +31 -22
- package/src/components/upload/upload.stories.tsx +8 -14
- package/src/components/watermark/watermark.meta.md +26 -17
- package/src/components/watermark/watermark.stories.tsx +4 -2
- package/src/components/watermark/watermark.tsx +1 -0
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: spinner
|
|
3
3
|
name: Spinner
|
|
4
|
+
displayName: 加载指示器
|
|
4
5
|
type: component
|
|
5
6
|
category: foundation
|
|
6
7
|
since: 0.1.0
|
|
7
|
-
package:
|
|
8
|
+
package: '@teamix-evo/ui'
|
|
8
9
|
---
|
|
9
10
|
|
|
10
|
-
# Spinner
|
|
11
|
+
# Spinner 加载指示器
|
|
11
12
|
|
|
12
13
|
旋转加载指示器 — shadcn 2025-10 新增,**等价 antd `Spin`**(无遮罩版)。基于 `lucide-react` 的 `Loader2`,4 档尺寸 + 4 档语义配色,自带 `role="status"` 与读屏文本。
|
|
13
14
|
|
|
@@ -23,22 +24,33 @@ package: "@teamix-evo/ui"
|
|
|
23
24
|
- 整页"模态阻塞 loading" → `Dialog` + Spinner 自行组合(本组件不内置遮罩)
|
|
24
25
|
- 进度可知场景 → `Progress`(线形)或 `ProgressCircle`(环形)
|
|
25
26
|
|
|
27
|
+
## Props
|
|
28
|
+
|
|
29
|
+
> 以下表格由 `pnpm --filter @teamix-evo/ui gen:meta` 自动生成。
|
|
30
|
+
|
|
26
31
|
<!-- auto:props:begin -->
|
|
27
|
-
|
|
28
|
-
|
|
|
29
|
-
|
|
|
30
|
-
| `
|
|
31
|
-
| `
|
|
32
|
+
|
|
33
|
+
| 名称 | 类型 | 默认值 | 必填 | 说明 |
|
|
34
|
+
| ------- | ---------------------------------------------------- | ----------- | ---- | ------------------------------------------------------------------------ |
|
|
35
|
+
| `size` | `'sm' \| 'default' \| 'lg' \| 'xl'` | `"default"` | – | 尺寸 — 与 antd Spin 的 small/middle/large 对齐(加 xl 用于全屏 loading)。 |
|
|
36
|
+
| `tone` | `'default' \| 'muted' \| 'primary' \| 'destructive'` | `"default"` | – | 配色 — `muted` 走次级文本色;`primary` / `destructive` 走语义色。 |
|
|
37
|
+
| `label` | `string` | – | – | 给读屏器的描述(默认 "Loading...")。 |
|
|
38
|
+
|
|
32
39
|
<!-- auto:props:end -->
|
|
33
40
|
|
|
41
|
+
## 依赖
|
|
42
|
+
|
|
43
|
+
> 以下表格由 `pnpm --filter @teamix-evo/ui gen:meta` 自动生成,数据源是 [`manifest.json`](../../../manifest.json)。**手工编辑 marker 之间的内容会在下次生成时被覆盖**。
|
|
44
|
+
|
|
34
45
|
<!-- auto:deps:begin -->
|
|
46
|
+
|
|
35
47
|
### 同库依赖
|
|
36
48
|
|
|
37
49
|
> `teamix-evo ui add spinner` 时,以下 entry 会被自动连带安装(无需手动 add)。
|
|
38
50
|
|
|
39
|
-
| Entry | 类型 | 描述
|
|
40
|
-
|
|
|
41
|
-
| `cn`
|
|
51
|
+
| Entry | 类型 | 描述 |
|
|
52
|
+
| ----- | ---- | -------------------------------------------------- |
|
|
53
|
+
| `cn` | util | Tailwind className 合并工具(clsx + tailwind-merge) |
|
|
42
54
|
|
|
43
55
|
### npm 依赖
|
|
44
56
|
|
|
@@ -47,6 +59,7 @@ package: "@teamix-evo/ui"
|
|
|
47
59
|
```bash
|
|
48
60
|
pnpm add class-variance-authority@^0.7.0 lucide-react@^0.460.0
|
|
49
61
|
```
|
|
62
|
+
|
|
50
63
|
<!-- auto:deps:end -->
|
|
51
64
|
|
|
52
65
|
## AI 生成纪律
|
|
@@ -9,7 +9,7 @@ const meta: Meta<typeof Spinner> = {
|
|
|
9
9
|
docs: {
|
|
10
10
|
description: {
|
|
11
11
|
component:
|
|
12
|
-
'旋转加载指示器 — 局部 / 行内 loading
|
|
12
|
+
'旋转加载指示器 — 局部 / 行内 loading(请求中、按钮提交、占位等待)。基于 lucide Loader2,4 档尺寸 + 4 档配色,自带 role="status" 与 sr-only 读屏文案。对齐 antd `Spin`(无遮罩版本)。',
|
|
13
13
|
},
|
|
14
14
|
},
|
|
15
15
|
},
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: statistic
|
|
3
3
|
name: Statistic
|
|
4
|
+
displayName: 统计数值
|
|
4
5
|
type: component
|
|
5
6
|
category: data-display
|
|
6
7
|
since: 0.1.0
|
|
7
|
-
package:
|
|
8
|
+
package: '@teamix-evo/ui'
|
|
8
9
|
---
|
|
9
10
|
|
|
10
|
-
# Statistic
|
|
11
|
+
# Statistic 统计数值
|
|
11
12
|
|
|
12
13
|
数字展示 — antd 独有补足。**仪表板专用**:大字号数值 + 标题 + 前缀(¥/$ / 图标)+ 后缀(单位)+ 趋势(上 / 下,自动配色)+ 千分位 + 精度。
|
|
13
14
|
|
|
@@ -23,28 +24,47 @@ package: "@teamix-evo/ui"
|
|
|
23
24
|
- 表格内数字 → 直接 `<td className="tabular-nums">`
|
|
24
25
|
- 图表 → `Chart`(本仓暂未提供)
|
|
25
26
|
|
|
27
|
+
## Props
|
|
28
|
+
|
|
26
29
|
<!-- auto:props:begin -->
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
|
31
|
-
|
|
|
32
|
-
| `
|
|
33
|
-
| `
|
|
34
|
-
| `
|
|
35
|
-
| `
|
|
36
|
-
| `
|
|
37
|
-
| `
|
|
30
|
+
|
|
31
|
+
#### Statistic
|
|
32
|
+
|
|
33
|
+
| 名称 | 类型 | 默认值 | 必填 | 说明 |
|
|
34
|
+
| ---------------- | -------------------------- | -------- | ---- | ------------------------------------------------------------------- |
|
|
35
|
+
| `title` | `React.ReactNode` | – | – | 标题(antd `title` 并集)。 |
|
|
36
|
+
| `value` | `number \| string` | – | ✓ | 数值(antd `value` 并集)。 |
|
|
37
|
+
| `prefix` | `React.ReactNode` | – | – | 前缀(图标 / 货币符号 / 单位)。 |
|
|
38
|
+
| `suffix` | `React.ReactNode` | – | – | 后缀(单位 / 趋势)。 |
|
|
39
|
+
| `precision` | `number` | – | – | 数值精度(antd `precision` 并集),仅 number 生效。 |
|
|
40
|
+
| `groupSeparator` | `boolean` | `true` | – | 千分位分隔符。 |
|
|
41
|
+
| `trend` | `'up' \| 'down' \| 'none'` | `"none"` | – | 趋势 — `up`(绿色 ↑)/ `down`(红色 ↓)/ `none`。前置在数值上方或左侧。 |
|
|
42
|
+
| `trendValue` | `string \| number` | – | – | 趋势百分比文字(配 trend 显示在 suffix 区)。 |
|
|
43
|
+
| `valueClassName` | `string` | – | – | 数值颜色覆盖(默认随 trend / 否则 foreground)。 |
|
|
44
|
+
|
|
45
|
+
#### StatisticTimer
|
|
46
|
+
|
|
47
|
+
| 名称 | 类型 | 默认值 | 必填 | 说明 |
|
|
48
|
+
| ---------- | -------------------------- | ------------- | ---- | ------------------------------------------------------------- |
|
|
49
|
+
| `type` | `'countdown' \| 'countup'` | `"countdown"` | – | 计时类型 — `countdown` 倒计时到 `target`;`countup` 向上计时。 |
|
|
50
|
+
| `target` | `number` | – | – | 目标时间(毫秒时间戳)。`countdown` 必填;`countup` 可选。 |
|
|
51
|
+
| `format` | `string` | `"HH:mm:ss"` | – | 时间格式化字符串 — 支持 `HH` `mm` `ss` `SSS`(毫秒);`D` 天数。 |
|
|
52
|
+
| `onFinish` | `() => void` | – | – | 倒计时到达 0 / 计时到达 target 时回调。 |
|
|
53
|
+
| `onChange` | `(msLeft: number) => void` | – | – | 每次 tick 回调。 |
|
|
54
|
+
|
|
38
55
|
<!-- auto:props:end -->
|
|
39
56
|
|
|
57
|
+
## 依赖
|
|
58
|
+
|
|
40
59
|
<!-- auto:deps:begin -->
|
|
60
|
+
|
|
41
61
|
### 同库依赖
|
|
42
62
|
|
|
43
63
|
> `teamix-evo ui add statistic` 时,以下 entry 会被自动连带安装(无需手动 add)。
|
|
44
64
|
|
|
45
|
-
| Entry | 类型 | 描述
|
|
46
|
-
|
|
|
47
|
-
| `cn`
|
|
65
|
+
| Entry | 类型 | 描述 |
|
|
66
|
+
| ----- | ---- | -------------------------------------------------- |
|
|
67
|
+
| `cn` | util | Tailwind className 合并工具(clsx + tailwind-merge) |
|
|
48
68
|
|
|
49
69
|
### npm 依赖
|
|
50
70
|
|
|
@@ -53,6 +73,7 @@ package: "@teamix-evo/ui"
|
|
|
53
73
|
```bash
|
|
54
74
|
pnpm add lucide-react@^0.460.0
|
|
55
75
|
```
|
|
76
|
+
|
|
56
77
|
<!-- auto:deps:end -->
|
|
57
78
|
|
|
58
79
|
## AI 生成纪律
|
|
@@ -11,7 +11,7 @@ const meta: Meta<typeof Statistic> = {
|
|
|
11
11
|
docs: {
|
|
12
12
|
description: {
|
|
13
13
|
component:
|
|
14
|
-
'数字展示 — 仪表板核心指标。大字号 + 千分位 + 精度 + 前后缀 +
|
|
14
|
+
'数字展示 — 仪表板核心指标。大字号 + 千分位 + 精度 + 前后缀 + 趋势(上 / 下,自动配色)。等价 antd Statistic。',
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
},
|
|
@@ -59,11 +59,7 @@ export const InCards: Story = {
|
|
|
59
59
|
</Card>
|
|
60
60
|
<Card>
|
|
61
61
|
<CardContent className="pt-6">
|
|
62
|
-
<Statistic
|
|
63
|
-
title="活跃用户"
|
|
64
|
-
value={12480}
|
|
65
|
-
prefix={<Users />}
|
|
66
|
-
/>
|
|
62
|
+
<Statistic title="活跃用户" value={12480} prefix={<Users />} />
|
|
67
63
|
</CardContent>
|
|
68
64
|
</Card>
|
|
69
65
|
</div>
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: steps
|
|
3
3
|
name: Steps
|
|
4
|
+
displayName: 步骤条
|
|
4
5
|
type: component
|
|
5
6
|
category: navigation
|
|
6
7
|
since: 0.1.0
|
|
7
|
-
package:
|
|
8
|
+
package: '@teamix-evo/ui'
|
|
8
9
|
---
|
|
9
10
|
|
|
10
|
-
# Steps
|
|
11
|
+
# Steps 步骤条
|
|
11
12
|
|
|
12
13
|
步骤条 — antd 独有补足。引导用户完成多步流程(注册 / 下单 / 部署),清晰展示当前 / 已完成 / 待完成 / 错误状态。
|
|
13
14
|
|
|
@@ -23,24 +24,31 @@ package: "@teamix-evo/ui"
|
|
|
23
24
|
- 简单进度 → `Progress` / `ProgressCircle`
|
|
24
25
|
- 历史时间线 → 自定义 timeline(暂无组件)
|
|
25
26
|
|
|
27
|
+
## Props
|
|
28
|
+
|
|
26
29
|
<!-- auto:props:begin -->
|
|
27
|
-
|
|
28
|
-
|
|
|
29
|
-
|
|
|
30
|
-
| `
|
|
31
|
-
| `
|
|
32
|
-
| `
|
|
33
|
-
| `
|
|
30
|
+
|
|
31
|
+
| 名称 | 类型 | 默认值 | 必填 | 说明 |
|
|
32
|
+
| ----------- | ---------------------------- | -------------- | ---- | ------------------------------------------------------------------------------- |
|
|
33
|
+
| `items` | `StepItem[]` | – | ✓ | 步骤列表。 |
|
|
34
|
+
| `current` | `number` | `0` | – | 当前步骤(0-based)。`current` 之前的为 finish,`current` 为 process,之后为 wait。 |
|
|
35
|
+
| `status` | `'process' \| 'error'` | `"process"` | – | 当前步骤的状态(只影响 `current` 那一步;`process` 默认,`error` 标红)。 |
|
|
36
|
+
| `direction` | `'horizontal' \| 'vertical'` | `"horizontal"` | – | 排列方向。 |
|
|
37
|
+
| `size` | `'sm' \| 'default'` | `"default"` | – | 尺寸。 |
|
|
38
|
+
|
|
34
39
|
<!-- auto:props:end -->
|
|
35
40
|
|
|
41
|
+
## 依赖
|
|
42
|
+
|
|
36
43
|
<!-- auto:deps:begin -->
|
|
44
|
+
|
|
37
45
|
### 同库依赖
|
|
38
46
|
|
|
39
47
|
> `teamix-evo ui add steps` 时,以下 entry 会被自动连带安装(无需手动 add)。
|
|
40
48
|
|
|
41
|
-
| Entry | 类型 | 描述
|
|
42
|
-
|
|
|
43
|
-
| `cn`
|
|
49
|
+
| Entry | 类型 | 描述 |
|
|
50
|
+
| ----- | ---- | -------------------------------------------------- |
|
|
51
|
+
| `cn` | util | Tailwind className 合并工具(clsx + tailwind-merge) |
|
|
44
52
|
|
|
45
53
|
### npm 依赖
|
|
46
54
|
|
|
@@ -49,6 +57,7 @@ package: "@teamix-evo/ui"
|
|
|
49
57
|
```bash
|
|
50
58
|
pnpm add lucide-react@^0.460.0
|
|
51
59
|
```
|
|
60
|
+
|
|
52
61
|
<!-- auto:deps:end -->
|
|
53
62
|
|
|
54
63
|
> `StepItem` 类型:`{ title; description?; status?: 'wait' | 'process' | 'finish' | 'error'; icon? }`。
|
|
@@ -9,7 +9,7 @@ const meta: Meta<typeof Steps> = {
|
|
|
9
9
|
docs: {
|
|
10
10
|
description: {
|
|
11
11
|
component:
|
|
12
|
-
'步骤条 — 引导多步流程(注册 / 下单 / 部署)。状态自动推导(wait/process/finish/error),支持横向 / 纵向、两种尺寸、自定义图标。
|
|
12
|
+
'步骤条 — 引导多步流程(注册 / 下单 / 部署)。状态自动推导(wait/process/finish/error),支持横向 / 纵向、两种尺寸、自定义图标。',
|
|
13
13
|
},
|
|
14
14
|
},
|
|
15
15
|
},
|
|
@@ -19,7 +19,12 @@ const meta: Meta<typeof Steps> = {
|
|
|
19
19
|
direction: { control: 'inline-radio', options: ['horizontal', 'vertical'] },
|
|
20
20
|
size: { control: 'inline-radio', options: ['sm', 'default'] },
|
|
21
21
|
},
|
|
22
|
-
args: {
|
|
22
|
+
args: {
|
|
23
|
+
current: 1,
|
|
24
|
+
status: 'process',
|
|
25
|
+
direction: 'horizontal',
|
|
26
|
+
size: 'default',
|
|
27
|
+
},
|
|
23
28
|
};
|
|
24
29
|
|
|
25
30
|
export default meta;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: switch
|
|
3
3
|
name: Switch
|
|
4
|
+
displayName: 开关
|
|
4
5
|
type: component
|
|
5
6
|
category: form
|
|
6
7
|
since: 0.1.0
|
|
7
|
-
package:
|
|
8
|
+
package: '@teamix-evo/ui'
|
|
8
9
|
---
|
|
9
10
|
|
|
10
|
-
# Switch
|
|
11
|
+
# Switch 开关
|
|
11
12
|
|
|
12
13
|
开关 — Radix Switch + antd 的 `loading / checkedChildren / unCheckedChildren / size`。
|
|
13
14
|
|
|
@@ -26,12 +27,14 @@ package: "@teamix-evo/ui"
|
|
|
26
27
|
> 以下表格由 `pnpm --filter @teamix-evo/ui gen:meta` 自动生成。
|
|
27
28
|
|
|
28
29
|
<!-- auto:props:begin -->
|
|
29
|
-
|
|
30
|
-
|
|
|
31
|
-
|
|
|
32
|
-
| `
|
|
33
|
-
| `
|
|
34
|
-
| `
|
|
30
|
+
|
|
31
|
+
| 名称 | 类型 | 默认值 | 必填 | 说明 |
|
|
32
|
+
| ------------------- | ------------------- | ----------- | ---- | -------------------------------------------------------------- |
|
|
33
|
+
| `loading` | `boolean` | `false` | – | 加载态 — 自动 `disabled`,thumb 上叠加自旋 spinner(antd 并集)。 |
|
|
34
|
+
| `checkedChildren` | `React.ReactNode` | – | – | 选中态显示的内文(antd `checkedChildren` 并集)。 |
|
|
35
|
+
| `unCheckedChildren` | `React.ReactNode` | – | – | 未选中态显示的内文(antd `unCheckedChildren` 并集)。 |
|
|
36
|
+
| `size` | `'sm' \| 'default'` | `"default"` | – | 尺寸。 |
|
|
37
|
+
|
|
35
38
|
<!-- auto:props:end -->
|
|
36
39
|
|
|
37
40
|
## 依赖
|
|
@@ -39,13 +42,14 @@ package: "@teamix-evo/ui"
|
|
|
39
42
|
> 以下表格由 `pnpm --filter @teamix-evo/ui gen:meta` 自动生成,数据源是 [`manifest.json`](../../../manifest.json)。**手工编辑 marker 之间的内容会在下次生成时被覆盖**。
|
|
40
43
|
|
|
41
44
|
<!-- auto:deps:begin -->
|
|
45
|
+
|
|
42
46
|
### 同库依赖
|
|
43
47
|
|
|
44
48
|
> `teamix-evo ui add switch` 时,以下 entry 会被自动连带安装(无需手动 add)。
|
|
45
49
|
|
|
46
|
-
| Entry | 类型 | 描述
|
|
47
|
-
|
|
|
48
|
-
| `cn`
|
|
50
|
+
| Entry | 类型 | 描述 |
|
|
51
|
+
| ----- | ---- | -------------------------------------------------- |
|
|
52
|
+
| `cn` | util | Tailwind className 合并工具(clsx + tailwind-merge) |
|
|
49
53
|
|
|
50
54
|
### npm 依赖
|
|
51
55
|
|
|
@@ -54,6 +58,7 @@ package: "@teamix-evo/ui"
|
|
|
54
58
|
```bash
|
|
55
59
|
pnpm add @radix-ui/react-switch@^1.1.0 lucide-react@^0.460.0
|
|
56
60
|
```
|
|
61
|
+
|
|
57
62
|
<!-- auto:deps:end -->
|
|
58
63
|
|
|
59
64
|
> 透传所有 Radix Switch.Root props(`checked` / `defaultChecked` / `onCheckedChange` / `name` / `value` 等)。
|
|
@@ -9,7 +9,7 @@ const meta: Meta<typeof Switch> = {
|
|
|
9
9
|
docs: {
|
|
10
10
|
description: {
|
|
11
11
|
component:
|
|
12
|
-
'开关 — 在开 / 关两种状态间切换,适用于需要即时生效的二值设置。Radix Switch 实现 + antd Switch 的并集能力:支持 `size` (sm / default)、`loading` 异步状态、以及 `checkedChildren` / `unCheckedChildren` 在轨道内渲染状态文本(对齐 antd
|
|
12
|
+
'开关 — 在开 / 关两种状态间切换,适用于需要即时生效的二值设置。Radix Switch 实现 + antd Switch 的并集能力:支持 `size` (sm / default)、`loading` 异步状态、以及 `checkedChildren` / `unCheckedChildren` 在轨道内渲染状态文本(对齐 antd)。',
|
|
13
13
|
},
|
|
14
14
|
},
|
|
15
15
|
},
|
|
@@ -39,59 +39,81 @@ const Switch = React.forwardRef<
|
|
|
39
39
|
ref,
|
|
40
40
|
) => {
|
|
41
41
|
const isSm = size === 'sm';
|
|
42
|
+
const hasInner = checkedChildren != null || unCheckedChildren != null;
|
|
43
|
+
const thumbSize = isSm ? 'size-4' : 'size-5';
|
|
44
|
+
const spinnerSize = isSm ? 'size-3' : 'size-3.5';
|
|
45
|
+
const renderThumb = (extra?: string) => (
|
|
46
|
+
<SwitchPrimitive.Thumb
|
|
47
|
+
className={cn(
|
|
48
|
+
'pointer-events-none flex shrink-0 items-center justify-center rounded-full bg-background shadow-lg ring-0',
|
|
49
|
+
thumbSize,
|
|
50
|
+
extra,
|
|
51
|
+
)}
|
|
52
|
+
>
|
|
53
|
+
{loading ? (
|
|
54
|
+
<Loader2
|
|
55
|
+
className={cn(
|
|
56
|
+
'animate-spin text-muted-foreground motion-reduce:animate-none',
|
|
57
|
+
spinnerSize,
|
|
58
|
+
)}
|
|
59
|
+
aria-hidden="true"
|
|
60
|
+
/>
|
|
61
|
+
) : null}
|
|
62
|
+
</SwitchPrimitive.Thumb>
|
|
63
|
+
);
|
|
64
|
+
|
|
42
65
|
return (
|
|
43
66
|
<SwitchPrimitive.Root
|
|
44
67
|
ref={ref}
|
|
45
68
|
disabled={disabled || loading}
|
|
46
69
|
className={cn(
|
|
47
|
-
'peer
|
|
48
|
-
|
|
70
|
+
'peer group inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input',
|
|
71
|
+
hasInner
|
|
72
|
+
? cn(
|
|
73
|
+
// 内文模式:高度固定,宽度按 thumb + 文字 + gap + padding 自适应
|
|
74
|
+
isSm ? 'h-5 min-w-9 gap-1' : 'h-6 min-w-11 gap-1.5',
|
|
75
|
+
)
|
|
76
|
+
: cn(isSm ? 'h-5 w-9' : 'h-6 w-11'),
|
|
49
77
|
className,
|
|
50
78
|
)}
|
|
51
79
|
{...props}
|
|
52
80
|
>
|
|
53
|
-
{
|
|
54
|
-
{checkedChildren != null || unCheckedChildren != null ? (
|
|
81
|
+
{hasInner ? (
|
|
55
82
|
<>
|
|
83
|
+
{/* thumb 与文字以 flex order 互换位置 */}
|
|
84
|
+
{renderThumb('order-1 group-data-[state=checked]:order-2')}
|
|
56
85
|
<span
|
|
57
86
|
className={cn(
|
|
58
|
-
'pointer-events-none
|
|
59
|
-
isSm ? '
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
'pointer-events-none absolute select-none text-[10px] font-medium leading-none text-muted-foreground transition-opacity peer-data-[state=checked]:opacity-0',
|
|
68
|
-
isSm ? 'right-1.5' : 'right-2',
|
|
87
|
+
'pointer-events-none select-none font-medium leading-none',
|
|
88
|
+
isSm ? 'text-xxs' : 'text-xs',
|
|
89
|
+
'order-2 group-data-[state=checked]:order-1',
|
|
90
|
+
'group-data-[state=checked]:text-primary-foreground',
|
|
91
|
+
'group-data-[state=unchecked]:text-muted-foreground',
|
|
92
|
+
// 文字外侧 padding(远离 thumb 的一侧)—— thumb 侧不加 padding,与其他 switch 一致紧贴边缘
|
|
93
|
+
isSm
|
|
94
|
+
? 'group-data-[state=unchecked]:pr-1 group-data-[state=checked]:pl-1'
|
|
95
|
+
: 'group-data-[state=unchecked]:pr-1.5 group-data-[state=checked]:pl-1.5',
|
|
69
96
|
)}
|
|
70
97
|
aria-hidden="true"
|
|
71
98
|
>
|
|
72
|
-
|
|
99
|
+
<span className="group-data-[state=unchecked]:hidden">
|
|
100
|
+
{checkedChildren}
|
|
101
|
+
</span>
|
|
102
|
+
<span className="group-data-[state=checked]:hidden">
|
|
103
|
+
{unCheckedChildren}
|
|
104
|
+
</span>
|
|
73
105
|
</span>
|
|
74
106
|
</>
|
|
75
|
-
) :
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
)
|
|
84
|
-
|
|
85
|
-
{loading ? (
|
|
86
|
-
<Loader2
|
|
87
|
-
className={cn(
|
|
88
|
-
'animate-spin text-muted-foreground motion-reduce:animate-none',
|
|
89
|
-
isSm ? 'size-3' : 'size-3.5',
|
|
90
|
-
)}
|
|
91
|
-
aria-hidden="true"
|
|
92
|
-
/>
|
|
93
|
-
) : null}
|
|
94
|
-
</SwitchPrimitive.Thumb>
|
|
107
|
+
) : (
|
|
108
|
+
renderThumb(
|
|
109
|
+
cn(
|
|
110
|
+
'transition-transform',
|
|
111
|
+
isSm
|
|
112
|
+
? 'data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0'
|
|
113
|
+
: 'data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0',
|
|
114
|
+
),
|
|
115
|
+
)
|
|
116
|
+
)}
|
|
95
117
|
</SwitchPrimitive.Root>
|
|
96
118
|
);
|
|
97
119
|
},
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: table
|
|
3
3
|
name: Table
|
|
4
|
+
displayName: 表格
|
|
4
5
|
type: component
|
|
5
6
|
category: data-display
|
|
6
7
|
since: 0.1.0
|
|
7
|
-
package:
|
|
8
|
+
package: '@teamix-evo/ui'
|
|
8
9
|
---
|
|
9
10
|
|
|
10
|
-
# Table
|
|
11
|
+
# Table 表格
|
|
11
12
|
|
|
12
13
|
基础表格 — 原生 HTML 元素薄包装。**仅视觉与可访问性骨架**(列宽 / 边框 / hover / 选中态);**无排序 / 筛选 / 分页 / 数据流**(那是 `DataTable` 的范畴)。
|
|
13
14
|
|
|
@@ -28,7 +29,9 @@ package: "@teamix-evo/ui"
|
|
|
28
29
|
> 以下表格由 `pnpm --filter @teamix-evo/ui gen:meta` 自动生成。
|
|
29
30
|
|
|
30
31
|
<!-- auto:props:begin -->
|
|
32
|
+
|
|
31
33
|
_(组件无 `<Name>Props` interface — props 详见 [`table.tsx`](./table.tsx))_
|
|
34
|
+
|
|
32
35
|
<!-- auto:props:end -->
|
|
33
36
|
|
|
34
37
|
## 依赖
|
|
@@ -36,17 +39,19 @@ _(组件无 `<Name>Props` interface — props 详见 [`table.tsx`](./table.tsx))
|
|
|
36
39
|
> 以下表格由 `pnpm --filter @teamix-evo/ui gen:meta` 自动生成,数据源是 [`manifest.json`](../../../manifest.json)。**手工编辑 marker 之间的内容会在下次生成时被覆盖**。
|
|
37
40
|
|
|
38
41
|
<!-- auto:deps:begin -->
|
|
42
|
+
|
|
39
43
|
### 同库依赖
|
|
40
44
|
|
|
41
45
|
> `teamix-evo ui add table` 时,以下 entry 会被自动连带安装(无需手动 add)。
|
|
42
46
|
|
|
43
|
-
| Entry | 类型 | 描述
|
|
44
|
-
|
|
|
45
|
-
| `cn`
|
|
47
|
+
| Entry | 类型 | 描述 |
|
|
48
|
+
| ----- | ---- | -------------------------------------------------- |
|
|
49
|
+
| `cn` | util | Tailwind className 合并工具(clsx + tailwind-merge) |
|
|
46
50
|
|
|
47
51
|
### npm 依赖
|
|
48
52
|
|
|
49
53
|
_无 — 本组件不依赖任何 npm 包。_
|
|
54
|
+
|
|
50
55
|
<!-- auto:deps:end -->
|
|
51
56
|
|
|
52
57
|
> 子组件:`Table` / `TableHeader`(thead)/ `TableBody`(tbody)/ `TableFooter`(tfoot)/ `TableHead`(th)/ `TableRow`(tr)/ `TableCell`(td)/ `TableCaption`(caption)。
|
|
@@ -63,7 +68,13 @@ _无 — 本组件不依赖任何 npm 包。_
|
|
|
63
68
|
|
|
64
69
|
```tsx
|
|
65
70
|
import {
|
|
66
|
-
Table,
|
|
71
|
+
Table,
|
|
72
|
+
TableHeader,
|
|
73
|
+
TableBody,
|
|
74
|
+
TableHead,
|
|
75
|
+
TableRow,
|
|
76
|
+
TableCell,
|
|
77
|
+
TableCaption,
|
|
67
78
|
} from '@/components/ui/table';
|
|
68
79
|
import { Badge } from '@/components/ui/badge';
|
|
69
80
|
|
|
@@ -80,16 +91,20 @@ import { Badge } from '@/components/ui/badge';
|
|
|
80
91
|
<TableBody>
|
|
81
92
|
<TableRow>
|
|
82
93
|
<TableCell className="font-medium">INV001</TableCell>
|
|
83
|
-
<TableCell
|
|
94
|
+
<TableCell>
|
|
95
|
+
<Badge variant="success">已支付</Badge>
|
|
96
|
+
</TableCell>
|
|
84
97
|
<TableCell>信用卡</TableCell>
|
|
85
98
|
<TableCell className="text-right">¥250.00</TableCell>
|
|
86
99
|
</TableRow>
|
|
87
100
|
<TableRow data-state="selected">
|
|
88
101
|
<TableCell className="font-medium">INV002</TableCell>
|
|
89
|
-
<TableCell
|
|
102
|
+
<TableCell>
|
|
103
|
+
<Badge>待支付</Badge>
|
|
104
|
+
</TableCell>
|
|
90
105
|
<TableCell>转账</TableCell>
|
|
91
106
|
<TableCell className="text-right">¥150.00</TableCell>
|
|
92
107
|
</TableRow>
|
|
93
108
|
</TableBody>
|
|
94
|
-
</Table
|
|
109
|
+
</Table>;
|
|
95
110
|
```
|
|
@@ -15,6 +15,14 @@ const meta: Meta<typeof Table> = {
|
|
|
15
15
|
title: '数据展示 · Data Display/Table',
|
|
16
16
|
component: Table,
|
|
17
17
|
tags: ['autodocs'],
|
|
18
|
+
parameters: {
|
|
19
|
+
docs: {
|
|
20
|
+
description: {
|
|
21
|
+
component:
|
|
22
|
+
'基础表格 — 原生 HTML 元素薄包装,仅提供视觉与可访问性骨架(列宽 / 边框 / hover / 选中态)。无排序 / 筛选 / 分页 / 数据流,复杂场景请用 `DataTable`。',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
18
26
|
};
|
|
19
27
|
|
|
20
28
|
export default meta;
|
|
@@ -63,10 +71,7 @@ export const Default: Story = {
|
|
|
63
71
|
<TableRow>
|
|
64
72
|
<TableCell colSpan={3}>合计</TableCell>
|
|
65
73
|
<TableCell className="text-right tabular-nums">
|
|
66
|
-
¥
|
|
67
|
-
{invoices
|
|
68
|
-
.reduce((sum, x) => sum + x.amount, 0)
|
|
69
|
-
.toFixed(2)}
|
|
74
|
+
¥{invoices.reduce((sum, x) => sum + x.amount, 0).toFixed(2)}
|
|
70
75
|
</TableCell>
|
|
71
76
|
</TableRow>
|
|
72
77
|
</TableFooter>
|