@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: field
|
|
3
3
|
name: Field
|
|
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
|
-
# Field
|
|
11
|
+
# Field 表单字段
|
|
11
12
|
|
|
12
13
|
通用表单字段抽象 — shadcn 2025-10 新增。**比 `Form` 更通用**:Form 强绑定 RHF + zod;Field 是纯 UI 抽象,跟任何状态管理(Server Actions / RHF / TanStack Form / 原生 form)都能搭。提供 7 个语义槽:`Field` 容器 / `FieldLabel` 标签 / `FieldDescription` 帮助文案 / `FieldError` 错误提示 / `FieldGroup` 多字段纵向容器 / `FieldSet` 带边框分组 / `FieldLegend` 分组标题。
|
|
13
14
|
|
|
@@ -22,21 +23,36 @@ package: "@teamix-evo/ui"
|
|
|
22
23
|
- 已用 `Form`(RHF)并接受其约定 → 优先 `FormItem / FormLabel / FormMessage`(更紧)
|
|
23
24
|
- 控件本身没有 label / description → 直接用 `Input` / `Select` 自由布局
|
|
24
25
|
|
|
26
|
+
## Props
|
|
27
|
+
|
|
25
28
|
<!-- auto:props:begin -->
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
|
29
|
+
|
|
30
|
+
#### Field
|
|
31
|
+
|
|
32
|
+
| 名称 | 类型 | 默认值 | 必填 | 说明 |
|
|
33
|
+
| ------------- | ---------------------------- | ------------ | ---- | ----------------------------------------------------------------------------------------- |
|
|
34
|
+
| `orientation` | `'vertical' \| 'horizontal'` | `"vertical"` | – | 字段方向 — `vertical`(默认)Label 在控件上;`horizontal` Label 在控件左侧(配长表单)。 |
|
|
35
|
+
| `invalid` | `boolean` | `false` | – | 标记字段为 invalid — 子组件的 ring / 文字色会跟随;同时把内部 `<FieldError>` 渲染为可见。 |
|
|
36
|
+
|
|
37
|
+
#### FieldLabel
|
|
38
|
+
|
|
39
|
+
| 名称 | 类型 | 默认值 | 必填 | 说明 |
|
|
40
|
+
| ---------- | --------- | ------- | ---- | ------------------------------------------------------------------------------------------------ |
|
|
41
|
+
| `required` | `boolean` | `false` | – | 在 label 末尾追加 "\*" 强调必填(antd Form `required` 并集)— 仅视觉,业务侧需在校验层确保必填。 |
|
|
42
|
+
|
|
30
43
|
<!-- auto:props:end -->
|
|
31
44
|
|
|
45
|
+
## 依赖
|
|
46
|
+
|
|
32
47
|
<!-- auto:deps:begin -->
|
|
48
|
+
|
|
33
49
|
### 同库依赖
|
|
34
50
|
|
|
35
51
|
> `teamix-evo ui add field` 时,以下 entry 会被自动连带安装(无需手动 add)。
|
|
36
52
|
|
|
37
|
-
| Entry
|
|
38
|
-
|
|
|
39
|
-
| `cn`
|
|
53
|
+
| Entry | 类型 | 描述 |
|
|
54
|
+
| ------- | --------- | ------------------------------------------------------------------------------------- |
|
|
55
|
+
| `cn` | util | Tailwind className 合并工具(clsx + tailwind-merge) |
|
|
40
56
|
| `label` | component | 表单字段标签 — Radix Label 包装,补 antd Form.Item 风格的 required / disabled 显式视觉 |
|
|
41
57
|
|
|
42
58
|
### npm 依赖
|
|
@@ -46,13 +62,14 @@ package: "@teamix-evo/ui"
|
|
|
46
62
|
```bash
|
|
47
63
|
pnpm add class-variance-authority@^0.7.0
|
|
48
64
|
```
|
|
65
|
+
|
|
49
66
|
<!-- auto:deps:end -->
|
|
50
67
|
|
|
51
68
|
## AI 生成纪律
|
|
52
69
|
|
|
53
70
|
- **`invalid` 是单一真值**:置于 `<Field>`,内部 `FieldLabel` 会变红、`FieldError` 才可见;**不要**同时给控件再传 `aria-invalid`,重复
|
|
54
71
|
- **`FieldError` children 为空时不渲染** — 直接传可空字符串 / `errors?.email` 即可,无需条件渲染
|
|
55
|
-
- **`FieldLabel required`** 仅视觉(红
|
|
72
|
+
- **`FieldLabel required`** 仅视觉(红 \*);**业务层必填**仍要在 schema / submit handler 校验
|
|
56
73
|
- **`FieldSet disabled`** 利用原生 fieldset 的级联禁用 — 内部所有原生 input 都会失能;**不要**手动给每个控件传 disabled
|
|
57
74
|
- **不要嵌套 `Field` in `Field`** — 那是 FieldGroup 的活
|
|
58
75
|
- **与 `Form` 共存**:在 RHF 流程外的小表单(登录、邮件订阅)直接用 Field;复杂业务表单仍走 Form
|
|
@@ -20,12 +20,15 @@ const meta: Meta<typeof Field> = {
|
|
|
20
20
|
docs: {
|
|
21
21
|
description: {
|
|
22
22
|
component:
|
|
23
|
-
'通用表单字段抽象 — 比 Form
|
|
23
|
+
'通用表单字段抽象 — 比 Form 更通用(Form 强绑 RHF;Field 跟任何状态管理都能搭)。7 个语义槽:Field / FieldLabel / FieldDescription / FieldError / FieldGroup / FieldSet / FieldLegend。shadcn 2025-10 新增,与现有 Form 共存。',
|
|
24
24
|
},
|
|
25
25
|
},
|
|
26
26
|
},
|
|
27
27
|
argTypes: {
|
|
28
|
-
orientation: {
|
|
28
|
+
orientation: {
|
|
29
|
+
control: 'inline-radio',
|
|
30
|
+
options: ['vertical', 'horizontal'],
|
|
31
|
+
},
|
|
29
32
|
invalid: { control: 'boolean' },
|
|
30
33
|
},
|
|
31
34
|
args: { orientation: 'vertical', invalid: false },
|
|
@@ -92,7 +95,7 @@ export const ServerActionForm: Story = {
|
|
|
92
95
|
onSubmit={(e) => {
|
|
93
96
|
e.preventDefault();
|
|
94
97
|
const fd = new FormData(e.currentTarget);
|
|
95
|
-
|
|
98
|
+
|
|
96
99
|
alert(`提交: ${JSON.stringify(Object.fromEntries(fd.entries()))}`);
|
|
97
100
|
}}
|
|
98
101
|
className="w-96 space-y-4"
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: flex
|
|
3
3
|
name: Flex
|
|
4
|
+
displayName: 弹性布局
|
|
4
5
|
type: component
|
|
5
6
|
category: layout
|
|
6
7
|
since: 0.1.0
|
|
7
|
-
package:
|
|
8
|
+
package: '@teamix-evo/ui'
|
|
8
9
|
---
|
|
9
10
|
|
|
10
|
-
# Flex
|
|
11
|
+
# Flex 弹性布局
|
|
11
12
|
|
|
12
13
|
Flex 布局容器 — antd 独有补足。**等价 antd `Flex`**(v5.10+),把 Tailwind flex 的常用配置(对齐 / 间距 / 换行 / 方向 / 渲染元素)收敛为枚举,避免散落的 `flex flex-col items-start gap-4 ...` 反复手写。
|
|
13
14
|
|
|
@@ -23,30 +24,38 @@ Flex 布局容器 — antd 独有补足。**等价 antd `Flex`**(v5.10+),把 Tai
|
|
|
23
24
|
- 网格 → `Grid`(`Row + Col`)
|
|
24
25
|
- 仅一次性自由布局 → 直接写 className 也行,不强求
|
|
25
26
|
|
|
27
|
+
## Props
|
|
28
|
+
|
|
26
29
|
<!-- auto:props:begin -->
|
|
27
|
-
|
|
28
|
-
|
|
|
29
|
-
|
|
|
30
|
-
| `
|
|
31
|
-
| `
|
|
32
|
-
| `
|
|
33
|
-
| `
|
|
34
|
-
| `
|
|
35
|
-
| `
|
|
30
|
+
|
|
31
|
+
| 名称 | 类型 | 默认值 | 必填 | 说明 |
|
|
32
|
+
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------- | ----------- | ---- | ----------------------------------------------------------------------------------------------------- |
|
|
33
|
+
| `direction` | `'row' \| 'column' \| 'row-reverse' \| 'column-reverse'` | `"row"` | – | 方向(antd `vertical` 并集) — `row`(默认)/ `column` 直观可读;antd `vertical` boolean 映射为 `column`。 |
|
|
34
|
+
| `gap` | `'none' \| 'xs' \| 'sm' \| 'default' \| 'lg' \| 'xl'` | `"default"` | – | 子项之间的间距档位(走 design 间距刻度,不接受任意 number)。 |
|
|
35
|
+
| `align` | `keyof typeof alignMap` | `"stretch"` | – | 副轴对齐方式。 |
|
|
36
|
+
| `justify` | `keyof typeof justifyMap` | `"start"` | – | 主轴对齐方式。 |
|
|
37
|
+
| `wrap` | `boolean` | `false` | – | 是否允许换行(antd `wrap` 并集)。 |
|
|
38
|
+
| `inline` | `boolean` | `false` | – | inline-flex 而非 block-flex。 |
|
|
39
|
+
| `as` | `keyof Pick< React.JSX.IntrinsicElements, 'div' \| 'section' \| 'header' \| 'footer' \| 'aside' \| 'main' \| 'nav' \| 'article' >` | `"div"` | – | 渲染元素(antd `component` 并集) — 支持 `section / header / aside / main / nav` 等语义标签。 |
|
|
40
|
+
|
|
36
41
|
<!-- auto:props:end -->
|
|
37
42
|
|
|
43
|
+
## 依赖
|
|
44
|
+
|
|
38
45
|
<!-- auto:deps:begin -->
|
|
46
|
+
|
|
39
47
|
### 同库依赖
|
|
40
48
|
|
|
41
49
|
> `teamix-evo ui add flex` 时,以下 entry 会被自动连带安装(无需手动 add)。
|
|
42
50
|
|
|
43
|
-
| Entry | 类型 | 描述
|
|
44
|
-
|
|
|
45
|
-
| `cn`
|
|
51
|
+
| Entry | 类型 | 描述 |
|
|
52
|
+
| ----- | ---- | -------------------------------------------------- |
|
|
53
|
+
| `cn` | util | Tailwind className 合并工具(clsx + tailwind-merge) |
|
|
46
54
|
|
|
47
55
|
### npm 依赖
|
|
48
56
|
|
|
49
57
|
_无 — 本组件不依赖任何 npm 包。_
|
|
58
|
+
|
|
50
59
|
<!-- auto:deps:end -->
|
|
51
60
|
|
|
52
61
|
## AI 生成纪律
|
|
@@ -10,7 +10,7 @@ const meta: Meta<typeof Flex> = {
|
|
|
10
10
|
docs: {
|
|
11
11
|
description: {
|
|
12
12
|
component:
|
|
13
|
-
'Flex 布局容器 — 把 Tailwind flex 的常用配置(对齐 / 间距 / 换行 / 方向 / 渲染元素)收敛为枚举。等价 antd `Flex`(v5.10+),与 Space 互补:Flex 偏完整布局容器,Space 偏 inline
|
|
13
|
+
'Flex 布局容器 — 把 Tailwind flex 的常用配置(对齐 / 间距 / 换行 / 方向 / 渲染元素)收敛为枚举。等价 antd `Flex`(v5.10+),与 Space 互补:Flex 偏完整布局容器,Space 偏 inline 小集合。',
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
16
|
},
|
|
@@ -19,7 +19,10 @@ const meta: Meta<typeof Flex> = {
|
|
|
19
19
|
control: 'inline-radio',
|
|
20
20
|
options: ['row', 'column', 'row-reverse', 'column-reverse'],
|
|
21
21
|
},
|
|
22
|
-
gap: {
|
|
22
|
+
gap: {
|
|
23
|
+
control: 'select',
|
|
24
|
+
options: ['none', 'xs', 'sm', 'default', 'lg', 'xl'],
|
|
25
|
+
},
|
|
23
26
|
align: {
|
|
24
27
|
control: 'inline-radio',
|
|
25
28
|
options: ['start', 'center', 'end', 'baseline', 'stretch'],
|
|
@@ -63,12 +66,23 @@ export const Playground: Story = {
|
|
|
63
66
|
export const Header: Story = {
|
|
64
67
|
parameters: { controls: { disable: true } },
|
|
65
68
|
render: () => (
|
|
66
|
-
<Flex
|
|
69
|
+
<Flex
|
|
70
|
+
as="header"
|
|
71
|
+
justify="between"
|
|
72
|
+
align="center"
|
|
73
|
+
className="rounded-md border bg-card px-6 py-3"
|
|
74
|
+
>
|
|
67
75
|
<span className="font-semibold">Logo</span>
|
|
68
76
|
<Flex gap="sm">
|
|
69
|
-
<a href="#" className="text-sm hover:underline"
|
|
70
|
-
|
|
71
|
-
|
|
77
|
+
<a href="#" className="text-sm hover:underline">
|
|
78
|
+
首页
|
|
79
|
+
</a>
|
|
80
|
+
<a href="#" className="text-sm hover:underline">
|
|
81
|
+
文档
|
|
82
|
+
</a>
|
|
83
|
+
<a href="#" className="text-sm hover:underline">
|
|
84
|
+
价格
|
|
85
|
+
</a>
|
|
72
86
|
</Flex>
|
|
73
87
|
<Button size="sm">登录</Button>
|
|
74
88
|
</Flex>
|
|
@@ -78,7 +92,11 @@ export const Header: Story = {
|
|
|
78
92
|
export const ColumnStack: Story = {
|
|
79
93
|
parameters: { controls: { disable: true } },
|
|
80
94
|
render: () => (
|
|
81
|
-
<Flex
|
|
95
|
+
<Flex
|
|
96
|
+
direction="column"
|
|
97
|
+
gap="sm"
|
|
98
|
+
className="w-80 rounded-md border bg-card p-6"
|
|
99
|
+
>
|
|
82
100
|
<span className="text-lg font-semibold">标题</span>
|
|
83
101
|
<span className="text-sm text-muted-foreground">这是一段描述文字</span>
|
|
84
102
|
<Button>操作</Button>
|
|
@@ -100,13 +118,27 @@ export const WrapCloud: Story = {
|
|
|
100
118
|
parameters: { controls: { disable: true } },
|
|
101
119
|
render: () => (
|
|
102
120
|
<Flex wrap gap="sm" className="w-96 rounded-md border bg-card p-3">
|
|
103
|
-
{[
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
121
|
+
{[
|
|
122
|
+
'React',
|
|
123
|
+
'Vue',
|
|
124
|
+
'Svelte',
|
|
125
|
+
'Solid',
|
|
126
|
+
'Angular',
|
|
127
|
+
'Lit',
|
|
128
|
+
'Qwik',
|
|
129
|
+
'Astro',
|
|
130
|
+
'Next',
|
|
131
|
+
'Remix',
|
|
132
|
+
'Nuxt',
|
|
133
|
+
'Gatsby',
|
|
134
|
+
].map((t) => (
|
|
135
|
+
<span
|
|
136
|
+
key={t}
|
|
137
|
+
className="rounded-md border bg-muted px-2 py-0.5 text-xs"
|
|
138
|
+
>
|
|
139
|
+
{t}
|
|
140
|
+
</span>
|
|
141
|
+
))}
|
|
110
142
|
</Flex>
|
|
111
143
|
),
|
|
112
144
|
};
|
|
@@ -4,10 +4,11 @@ name: FloatButton
|
|
|
4
4
|
type: component
|
|
5
5
|
category: navigation
|
|
6
6
|
since: 0.1.0
|
|
7
|
-
package:
|
|
7
|
+
package: '@teamix-evo/ui'
|
|
8
|
+
displayName: 悬浮按钮
|
|
8
9
|
---
|
|
9
10
|
|
|
10
|
-
# FloatButton
|
|
11
|
+
# FloatButton 悬浮按钮
|
|
11
12
|
|
|
12
13
|
悬浮按钮 — antd 独有补足。**等价 antd `FloatButton`**(v5.0 加入,取代旧 `BackTop`)。`position: fixed` 在右下角的强主张操作按钮:回到顶部、客服入口、新建按钮。配 `FloatButtonGroup` 纵向堆叠多个,`FloatButtonBackTop` 是预置的"回到顶部"快捷件。
|
|
13
14
|
|
|
@@ -24,23 +25,45 @@ package: "@teamix-evo/ui"
|
|
|
24
25
|
- 列表行末操作 → 普通 `Button` / `DropdownMenu`
|
|
25
26
|
- 多个无关操作堆在右下:容易遮挡内容,> 3 个 FloatButton 时换 SpeedDial 模式
|
|
26
27
|
|
|
28
|
+
## Props
|
|
29
|
+
|
|
27
30
|
<!-- auto:props:begin -->
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
|
32
|
-
|
|
|
33
|
-
| `
|
|
31
|
+
|
|
32
|
+
#### FloatButton
|
|
33
|
+
|
|
34
|
+
| 名称 | 类型 | 默认值 | 必填 | 说明 |
|
|
35
|
+
| --------- | ------------------------ | ----------- | ---- | -------------------------------------------------- |
|
|
36
|
+
| `icon` | `React.ReactNode` | – | – | 图标(antd `icon` 并集)。 |
|
|
37
|
+
| `variant` | `'primary' \| 'default'` | `"primary"` | – | 视觉风格 — `primary` 主色填充;`default` 灰色轮廓。 |
|
|
38
|
+
| `shape` | `'circle' \| 'square'` | `"circle"` | – | 形状 — `circle`(默认)圆形;`square` 方形圆角。 |
|
|
39
|
+
| `badge` | `React.ReactNode` | – | – | 触发徽标(antd `badge` 并集) — 简短数字 / 字符。 |
|
|
40
|
+
|
|
41
|
+
#### FloatButtonGroup
|
|
42
|
+
|
|
43
|
+
| 名称 | 类型 | 默认值 | 必填 | 说明 |
|
|
44
|
+
| -------- | -------- | ------ | ---- | -------------------- |
|
|
45
|
+
| `right` | `number` | `24` | – | 距视口右侧距离(px)。 |
|
|
46
|
+
| `bottom` | `number` | `24` | – | 距视口底部距离(px)。 |
|
|
47
|
+
|
|
48
|
+
#### FloatButtonBackTop
|
|
49
|
+
|
|
50
|
+
| 名称 | 类型 | 默认值 | 必填 | 说明 |
|
|
51
|
+
| ------------------ | -------- | ------ | ---- | -------------------------------------- |
|
|
52
|
+
| `visibilityHeight` | `number` | `200` | – | 滚动距离超过此值(px)时才显示回到顶部。 |
|
|
53
|
+
|
|
34
54
|
<!-- auto:props:end -->
|
|
35
55
|
|
|
56
|
+
## 依赖
|
|
57
|
+
|
|
36
58
|
<!-- auto:deps:begin -->
|
|
59
|
+
|
|
37
60
|
### 同库依赖
|
|
38
61
|
|
|
39
62
|
> `teamix-evo ui add float-button` 时,以下 entry 会被自动连带安装(无需手动 add)。
|
|
40
63
|
|
|
41
|
-
| Entry | 类型 | 描述
|
|
42
|
-
|
|
|
43
|
-
| `cn`
|
|
64
|
+
| Entry | 类型 | 描述 |
|
|
65
|
+
| ----- | ---- | -------------------------------------------------- |
|
|
66
|
+
| `cn` | util | Tailwind className 合并工具(clsx + tailwind-merge) |
|
|
44
67
|
|
|
45
68
|
### npm 依赖
|
|
46
69
|
|
|
@@ -49,6 +72,7 @@ package: "@teamix-evo/ui"
|
|
|
49
72
|
```bash
|
|
50
73
|
pnpm add lucide-react@^0.460.0
|
|
51
74
|
```
|
|
75
|
+
|
|
52
76
|
<!-- auto:deps:end -->
|
|
53
77
|
|
|
54
78
|
## AI 生成纪律
|
|
@@ -14,7 +14,7 @@ const meta: Meta<typeof FloatButton> = {
|
|
|
14
14
|
docs: {
|
|
15
15
|
description: {
|
|
16
16
|
component:
|
|
17
|
-
'悬浮按钮 — position: fixed
|
|
17
|
+
'悬浮按钮 — position: fixed 在右下角的强主张操作按钮(回到顶部 / 客服 / 新建)。配 FloatButtonGroup 堆叠多个,FloatButtonBackTop 是预置的“回到顶部”。等价 antd `FloatButton`(v5.0,替代旧 BackTop)。',
|
|
18
18
|
},
|
|
19
19
|
},
|
|
20
20
|
},
|
|
@@ -62,7 +62,9 @@ export const BackTopReal: Story = {
|
|
|
62
62
|
parameters: { controls: { disable: true } },
|
|
63
63
|
render: () => (
|
|
64
64
|
<>
|
|
65
|
-
<div className="text-sm text-muted-foreground"
|
|
65
|
+
<div className="text-sm text-muted-foreground">
|
|
66
|
+
向下滚动 200px 查看回到顶部按钮:
|
|
67
|
+
</div>
|
|
66
68
|
<div className="mt-3 space-y-3">
|
|
67
69
|
{Array.from({ length: 30 }).map((_, i) => (
|
|
68
70
|
<div key={i} className="rounded-md border bg-muted/30 p-6">
|
|
@@ -62,7 +62,7 @@ const FloatButton = React.forwardRef<HTMLButtonElement, FloatButtonProps>(
|
|
|
62
62
|
>
|
|
63
63
|
{icon ?? children}
|
|
64
64
|
{badge != null ? (
|
|
65
|
-
<span className="absolute -right-1 -top-1 flex h-5 min-w-
|
|
65
|
+
<span className="absolute -right-1 -top-1 flex h-5 min-w-counter items-center justify-center rounded-full bg-destructive px-1 text-xxs font-medium leading-none text-destructive-foreground">
|
|
66
66
|
{badge}
|
|
67
67
|
</span>
|
|
68
68
|
) : null}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: form
|
|
3
3
|
name: Form
|
|
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
|
-
# Form
|
|
11
|
+
# Form 表单
|
|
11
12
|
|
|
12
13
|
表单 — 基于 [`react-hook-form`](https://react-hook-form.com/),shadcn 标准 7 件套(`Form / FormField / FormItem / FormLabel / FormControl / FormDescription / FormMessage`)。
|
|
13
14
|
**配合 [`zod`](https://zod.dev/) + `@hookform/resolvers/zod` 做 schema 校验**(行业惯例)。
|
|
@@ -26,12 +27,46 @@ package: "@teamix-evo/ui"
|
|
|
26
27
|
|
|
27
28
|
## Props
|
|
28
29
|
|
|
29
|
-
> 以下表格由 `pnpm --filter @teamix-evo/ui gen:meta` 自动生成。`Form` 是 `FormProvider` 别名,直接接受 `useForm()`
|
|
30
|
+
> 以下表格由 `pnpm --filter @teamix-evo/ui gen:meta` 自动生成。`Form` 是 `FormProvider` 别名,直接接受 `useForm()` 返回值;下表按子组件分节列出各自的 Props。
|
|
30
31
|
|
|
31
32
|
<!-- auto:props:begin -->
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
|
|
34
|
+
#### Form
|
|
35
|
+
|
|
36
|
+
| 名称 | 类型 | 默认值 | 必填 | 说明 |
|
|
37
|
+
| ---------- | ----------------- | ------ | ---- | ------------------------------------------------- |
|
|
38
|
+
| `children` | `React.ReactNode` | – | – | 表单内容 — 通常是 `<form>` + `<FormField>` 列表。 |
|
|
39
|
+
|
|
40
|
+
> `Form` 透传 `useForm()` 返回值的所有属性(`UseFormReturn`),作为 `FormProvider` 下发给子组件。
|
|
41
|
+
|
|
42
|
+
#### FormField
|
|
43
|
+
|
|
44
|
+
| 名称 | 类型 | 默认值 | 必填 | 说明 |
|
|
45
|
+
| --------- | ---------------------------------------------------------- | ------ | ---- | ------------------------------------------- |
|
|
46
|
+
| `name` | `FieldPath<TFieldValues>` | – | ✔ | 字段名称,对应 schema 中的 key。 |
|
|
47
|
+
| `control` | `Control<TFieldValues>` | – | ✔ | `useForm()` 返回的 `control` 实例。 |
|
|
48
|
+
| `render` | `({ field, fieldState, formState }) => React.ReactElement` | – | ✔ | 渲染函数,接收 field/fieldState 注入到控件。 |
|
|
49
|
+
|
|
50
|
+
#### FormItem
|
|
51
|
+
|
|
52
|
+
> 单个表单字段容器,生成稳定 id 供 Label/Description/Message 关联。无自定义 props,仅透传 `HTMLDivElement` 属性。
|
|
53
|
+
|
|
54
|
+
#### FormLabel
|
|
55
|
+
|
|
56
|
+
> 扩展自 `Label` 组件,自动通过 `useFormField()` 关联 `htmlFor`,校验失败时自动变红。支持 `Label` 的所有 props(`required` / `disabled`)。
|
|
57
|
+
|
|
58
|
+
#### FormControl
|
|
59
|
+
|
|
60
|
+
> Slot 包装器,自动注入 `id` / `aria-describedby` / `aria-invalid` 到子控件。无自定义 props。
|
|
61
|
+
|
|
62
|
+
#### FormDescription
|
|
63
|
+
|
|
64
|
+
> 辅助说明文本(`text-xs text-muted-foreground`)。无自定义 props,仅透传 `HTMLParagraphElement` 属性。
|
|
65
|
+
|
|
66
|
+
#### FormMessage
|
|
67
|
+
|
|
68
|
+
> 错误消息显示,自动从 `fieldState.error` 读取。无自定义 props,仅透传 `HTMLParagraphElement` 属性。
|
|
69
|
+
|
|
35
70
|
<!-- auto:props:end -->
|
|
36
71
|
|
|
37
72
|
## 依赖
|
|
@@ -39,13 +74,14 @@ package: "@teamix-evo/ui"
|
|
|
39
74
|
> 以下表格由 `pnpm --filter @teamix-evo/ui gen:meta` 自动生成,数据源是 [`manifest.json`](../../../manifest.json)。**手工编辑 marker 之间的内容会在下次生成时被覆盖**。
|
|
40
75
|
|
|
41
76
|
<!-- auto:deps:begin -->
|
|
77
|
+
|
|
42
78
|
### 同库依赖
|
|
43
79
|
|
|
44
80
|
> `teamix-evo ui add form` 时,以下 entry 会被自动连带安装(无需手动 add)。
|
|
45
81
|
|
|
46
|
-
| Entry
|
|
47
|
-
|
|
|
48
|
-
| `cn`
|
|
82
|
+
| Entry | 类型 | 描述 |
|
|
83
|
+
| ------- | --------- | ------------------------------------------------------------------------------------- |
|
|
84
|
+
| `cn` | util | Tailwind className 合并工具(clsx + tailwind-merge) |
|
|
49
85
|
| `label` | component | 表单字段标签 — Radix Label 包装,补 antd Form.Item 风格的 required / disabled 显式视觉 |
|
|
50
86
|
|
|
51
87
|
### npm 依赖
|
|
@@ -55,9 +91,8 @@ package: "@teamix-evo/ui"
|
|
|
55
91
|
```bash
|
|
56
92
|
pnpm add react-hook-form@^7.50.0 @hookform/resolvers@^3.0.0 zod@^3.22.0 @radix-ui/react-label@^2.1.0 @radix-ui/react-slot@^1.1.0
|
|
57
93
|
```
|
|
58
|
-
<!-- auto:deps:end -->
|
|
59
94
|
|
|
60
|
-
|
|
95
|
+
<!-- auto:deps:end -->
|
|
61
96
|
|
|
62
97
|
## AI 生成纪律
|
|
63
98
|
|
|
@@ -76,8 +111,13 @@ import { useForm } from 'react-hook-form';
|
|
|
76
111
|
import { zodResolver } from '@hookform/resolvers/zod';
|
|
77
112
|
import { z } from 'zod';
|
|
78
113
|
import {
|
|
79
|
-
Form,
|
|
80
|
-
|
|
114
|
+
Form,
|
|
115
|
+
FormField,
|
|
116
|
+
FormItem,
|
|
117
|
+
FormLabel,
|
|
118
|
+
FormControl,
|
|
119
|
+
FormDescription,
|
|
120
|
+
FormMessage,
|
|
81
121
|
} from '@/components/ui/form';
|
|
82
122
|
import { Input } from '@/components/ui/input';
|
|
83
123
|
import { Button } from '@/components/ui/button';
|
|
@@ -95,7 +135,10 @@ function MyForm() {
|
|
|
95
135
|
|
|
96
136
|
return (
|
|
97
137
|
<Form {...form}>
|
|
98
|
-
<form
|
|
138
|
+
<form
|
|
139
|
+
onSubmit={form.handleSubmit((v) => console.log(v))}
|
|
140
|
+
className="space-y-4"
|
|
141
|
+
>
|
|
99
142
|
<FormField
|
|
100
143
|
control={form.control}
|
|
101
144
|
name="username"
|
|
@@ -23,7 +23,7 @@ const meta: Meta<typeof Form> = {
|
|
|
23
23
|
docs: {
|
|
24
24
|
description: {
|
|
25
25
|
component:
|
|
26
|
-
'表单 — `react-hook-form` + `zod` 校验 +
|
|
26
|
+
'表单 — `react-hook-form` + `zod` 校验 + 语义化字段组件(`FormItem` / `FormLabel` / `FormControl` / `FormDescription` / `FormMessage`)。对齐 shadcn Form 的可组合范式;对比 antd Form 用 `Field` 命令式注册的方式,本组件采用 RHF 的声明式 controller,类型安全且性能更好。',
|
|
27
27
|
},
|
|
28
28
|
},
|
|
29
29
|
},
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: grid
|
|
3
3
|
name: Grid
|
|
4
|
+
displayName: 栅格
|
|
4
5
|
type: component
|
|
5
6
|
category: layout
|
|
6
7
|
since: 0.1.0
|
|
7
|
-
package:
|
|
8
|
+
package: '@teamix-evo/ui'
|
|
8
9
|
---
|
|
9
10
|
|
|
10
|
-
# Grid (Row / Col)
|
|
11
|
+
# Grid (Row / Col) 栅格
|
|
11
12
|
|
|
12
13
|
24 栅格系统 — antd 独有补足。**等价 antd `Row` + `Col`**:基于 CSS Grid 的 24 列容器,支持 `span` / `offset` / `order` / `flex` / `gutter` / `justify` / `align` 等核心 API,中后台表单 / 看板布局基石。
|
|
13
14
|
|
|
@@ -23,22 +24,46 @@ package: "@teamix-evo/ui"
|
|
|
23
24
|
- inline 间距小集合 → `Space`
|
|
24
25
|
- 不固定列数的卡片墙 → 直接用 Tailwind `grid-cols-N` 或 `Item` 配 `ItemGroup`
|
|
25
26
|
|
|
27
|
+
## Props
|
|
28
|
+
|
|
26
29
|
<!-- auto:props:begin -->
|
|
27
|
-
|
|
30
|
+
|
|
31
|
+
#### Row
|
|
32
|
+
|
|
33
|
+
| 名称 | 类型 | 默认值 | 必填 | 说明 |
|
|
34
|
+
| --------- | ------------------------------------------------------------------- | --------- | ---- | ---------------------------------------------------------------------------- |
|
|
35
|
+
| `gutter` | `number \| [number, number]` | `0` | – | 子项间距 — number 等价 `[n, n]`;`[h, v]` 分别控制水平 / 垂直(实际值 n×4px)。 |
|
|
36
|
+
| `justify` | `'start' \| 'end' \| 'center' \| 'between' \| 'around' \| 'evenly'` | `"start"` | – | 水平排列(antd `justify` 并集)。 |
|
|
37
|
+
| `align` | `'top' \| 'middle' \| 'bottom' \| 'stretch'` | `"top"` | – | 垂直对齐(antd `align` 并集)。 |
|
|
38
|
+
| `wrap` | `boolean` | `true` | – | 是否允许换行(antd `wrap` 并集)。 |
|
|
39
|
+
|
|
40
|
+
#### Col
|
|
41
|
+
|
|
42
|
+
| 名称 | 类型 | 默认值 | 必填 | 说明 |
|
|
43
|
+
| -------- | --------- | ------- | ---- | ------------------------------------------------------------- |
|
|
44
|
+
| `span` | `number` | `24` | – | 占用栅格数(1~24,antd `span` 并集) — 0 表示隐藏。 |
|
|
45
|
+
| `offset` | `number` | `0` | – | 左侧偏移栅格数(antd `offset` 并集)。 |
|
|
46
|
+
| `order` | `number` | – | – | 顺序(antd `order` 并集) — 用于响应式 / a11y 顺序变更场景。 |
|
|
47
|
+
| `flex` | `boolean` | `false` | – | 自动撑满剩余空间(antd `flex="auto"` 等价) — 设置后忽略 span。 |
|
|
48
|
+
|
|
28
49
|
<!-- auto:props:end -->
|
|
29
50
|
|
|
51
|
+
## 依赖
|
|
52
|
+
|
|
30
53
|
<!-- auto:deps:begin -->
|
|
54
|
+
|
|
31
55
|
### 同库依赖
|
|
32
56
|
|
|
33
57
|
> `teamix-evo ui add grid` 时,以下 entry 会被自动连带安装(无需手动 add)。
|
|
34
58
|
|
|
35
|
-
| Entry | 类型 | 描述
|
|
36
|
-
|
|
|
37
|
-
| `cn`
|
|
59
|
+
| Entry | 类型 | 描述 |
|
|
60
|
+
| ----- | ---- | -------------------------------------------------- |
|
|
61
|
+
| `cn` | util | Tailwind className 合并工具(clsx + tailwind-merge) |
|
|
38
62
|
|
|
39
63
|
### npm 依赖
|
|
40
64
|
|
|
41
65
|
_无 — 本组件不依赖任何 npm 包。_
|
|
66
|
+
|
|
42
67
|
<!-- auto:deps:end -->
|
|
43
68
|
|
|
44
69
|
## AI 生成纪律
|
|
@@ -9,7 +9,7 @@ const meta: Meta<typeof Row> = {
|
|
|
9
9
|
docs: {
|
|
10
10
|
description: {
|
|
11
11
|
component:
|
|
12
|
-
'24 栅格 — 基于 CSS Grid 的 24 列容器(antd Row + Col)。中后台表单 / 看板布局基石,支持 span / offset / order / flex / gutter / justify / align。响应式建议直接用 Tailwind 断点 className
|
|
12
|
+
'24 栅格 — 基于 CSS Grid 的 24 列容器(antd Row + Col)。中后台表单 / 看板布局基石,支持 span / offset / order / flex / gutter / justify / align。响应式建议直接用 Tailwind 断点 className。',
|
|
13
13
|
},
|
|
14
14
|
},
|
|
15
15
|
},
|
|
@@ -19,7 +19,9 @@ export default meta;
|
|
|
19
19
|
type Story = StoryObj<typeof Row>;
|
|
20
20
|
|
|
21
21
|
const Box = ({ children }: { children: React.ReactNode }) => (
|
|
22
|
-
<div className="rounded-md bg-muted px-3 py-4 text-center text-sm">
|
|
22
|
+
<div className="rounded-md bg-muted px-3 py-4 text-center text-sm">
|
|
23
|
+
{children}
|
|
24
|
+
</div>
|
|
23
25
|
);
|
|
24
26
|
|
|
25
27
|
export const Playground: Story = {
|