@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: mentions
|
|
3
3
|
name: Mentions
|
|
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
|
-
# Mentions
|
|
11
|
+
# Mentions 提及
|
|
11
12
|
|
|
12
13
|
@提及 — antd 独有补足。在 Textarea 中输入 `@`(或自定义 `prefix`)即弹出候选下拉,选中后插入 `@name `。键盘 ↑↓ 切换、Enter / Tab 选中、Esc 关闭。**异步候选**用 `onSearch(query)` 由消费方刷新 `options`。
|
|
13
14
|
|
|
@@ -21,34 +22,42 @@ package: "@teamix-evo/ui"
|
|
|
21
22
|
- 全字段候选(下拉选单)→ `Select` / `Combobox`
|
|
22
23
|
- 仅是搜索输入 → `Input` + 业务侧自渲染建议列表
|
|
23
24
|
|
|
25
|
+
## Props
|
|
26
|
+
|
|
24
27
|
<!-- auto:props:begin -->
|
|
25
|
-
|
|
26
|
-
|
|
|
27
|
-
|
|
|
28
|
-
| `
|
|
29
|
-
| `
|
|
30
|
-
| `
|
|
31
|
-
| `
|
|
32
|
-
| `
|
|
33
|
-
| `
|
|
34
|
-
| `
|
|
35
|
-
| `
|
|
36
|
-
| `
|
|
28
|
+
|
|
29
|
+
| 名称 | 类型 | 默认值 | 必填 | 说明 |
|
|
30
|
+
| -------------- | -------------------------------------------------- | ------ | ---- | --------------------------------------------------------------- |
|
|
31
|
+
| `options` | `MentionsOption[]` | – | ✓ | 候选项(antd `options` 并集)。 |
|
|
32
|
+
| `value` | `string` | – | – | 受控值。 |
|
|
33
|
+
| `defaultValue` | `string` | – | – | uncontrolled 初值。 |
|
|
34
|
+
| `onChange` | `(value: string) => void` | – | – | 文本变化回调。 |
|
|
35
|
+
| `prefix` | `string` | `"@"` | – | 触发符(antd `prefix` 并集) — 通常是 `@` 或 `#`。 |
|
|
36
|
+
| `split` | `string` | `" "` | – | 选中候选项后插入文本的尾随分隔(对齐 antd `split` 默认空格)。 |
|
|
37
|
+
| `onSearch` | `(query: string, prefix: string) => void` | – | – | 用户在 prefix 后输入时的搜索回调,用于业务侧异步刷新 `options`。 |
|
|
38
|
+
| `onSelect` | `(option: MentionsOption, prefix: string) => void` | – | – | 选中候选项时回调。 |
|
|
39
|
+
| `rows` | `number` | `3` | – | 文本框尺寸传透传 Textarea(行数)。 |
|
|
40
|
+
| `disabled` | `boolean` | – | – | 禁用。 |
|
|
41
|
+
|
|
37
42
|
<!-- auto:props:end -->
|
|
38
43
|
|
|
44
|
+
## 依赖
|
|
45
|
+
|
|
39
46
|
<!-- auto:deps:begin -->
|
|
47
|
+
|
|
40
48
|
### 同库依赖
|
|
41
49
|
|
|
42
50
|
> `teamix-evo ui add mentions` 时,以下 entry 会被自动连带安装(无需手动 add)。
|
|
43
51
|
|
|
44
|
-
| Entry
|
|
45
|
-
|
|
|
46
|
-
| `cn`
|
|
52
|
+
| Entry | 类型 | 描述 |
|
|
53
|
+
| ---------- | --------- | ------------------------------------------------------ |
|
|
54
|
+
| `cn` | util | Tailwind className 合并工具(clsx + tailwind-merge) |
|
|
47
55
|
| `textarea` | component | 多行文本输入 — shadcn 基底 + antd autoSize / showCount |
|
|
48
56
|
|
|
49
57
|
### npm 依赖
|
|
50
58
|
|
|
51
59
|
_无 — 本组件不依赖任何 npm 包。_
|
|
60
|
+
|
|
52
61
|
<!-- auto:deps:end -->
|
|
53
62
|
|
|
54
63
|
## AI 生成纪律
|
|
@@ -73,7 +82,7 @@ const users = [
|
|
|
73
82
|
];
|
|
74
83
|
|
|
75
84
|
// 静态候选
|
|
76
|
-
<Mentions options={users} placeholder="输入 @ 提及同事..."
|
|
85
|
+
<Mentions options={users} placeholder="输入 @ 提及同事..." />;
|
|
77
86
|
|
|
78
87
|
// 异步候选
|
|
79
88
|
const [opts, setOpts] = React.useState(users);
|
|
@@ -83,7 +92,7 @@ const [opts, setOpts] = React.useState(users);
|
|
|
83
92
|
const list = await fetchUsers(q);
|
|
84
93
|
setOpts(list);
|
|
85
94
|
}}
|
|
86
|
-
|
|
95
|
+
/>;
|
|
87
96
|
|
|
88
97
|
// 双触发符:@ + # — 当前组件支持单 prefix,如需多触发请实例化两个 Mentions
|
|
89
98
|
```
|
|
@@ -10,7 +10,7 @@ const meta: Meta<typeof Mentions> = {
|
|
|
10
10
|
docs: {
|
|
11
11
|
description: {
|
|
12
12
|
component:
|
|
13
|
-
'@提及输入 — Textarea + @
|
|
13
|
+
'@提及输入 — Textarea + @ 触发候选下拉(评论 @ 同事、# 话题)。↑↓ 切换、Enter / Tab 选中、Esc 关闭。异步候选用 onSearch 由消费方刷新 options。等价 antd `Mentions`。',
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
16
|
},
|
|
@@ -68,10 +68,11 @@ function getTriggerContext(
|
|
|
68
68
|
// Walk backwards from caret until we hit a whitespace, newline, or `prefix`.
|
|
69
69
|
for (let i = caret - 1; i >= 0; i--) {
|
|
70
70
|
const ch = value[i];
|
|
71
|
+
if (ch === undefined) return null;
|
|
71
72
|
if (ch === prefix) {
|
|
72
73
|
// The char immediately before prefix must be start-of-string / whitespace / newline,
|
|
73
74
|
// otherwise we'd trigger on emails like a@b.
|
|
74
|
-
const prev = i === 0 ? '' : value[i - 1];
|
|
75
|
+
const prev = i === 0 ? '' : (value[i - 1] ?? '');
|
|
75
76
|
if (prev === '' || /\s/.test(prev)) {
|
|
76
77
|
return { start: i, query: value.slice(i + 1, caret) };
|
|
77
78
|
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: menubar
|
|
3
3
|
name: Menubar
|
|
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
|
-
# Menubar
|
|
11
|
+
# Menubar 菜单栏
|
|
11
12
|
|
|
12
13
|
应用顶部菜单栏 — Radix Menubar(典型 macOS 风格,文件 / 编辑 / 视图 / 帮助)。
|
|
13
14
|
**与 DropdownMenu 区别**:Menubar 是**横排多个一级菜单**,鼠标 hover 切换;DropdownMenu 是单个独立下拉。
|
|
@@ -28,7 +29,9 @@ package: "@teamix-evo/ui"
|
|
|
28
29
|
> 以下表格由 `pnpm --filter @teamix-evo/ui gen:meta` 自动生成。下表是 `Menubar`(Root) 的 props。
|
|
29
30
|
|
|
30
31
|
<!-- auto:props:begin -->
|
|
32
|
+
|
|
31
33
|
_(组件无 `<Name>Props` interface — props 详见 [`menubar.tsx`](./menubar.tsx))_
|
|
34
|
+
|
|
32
35
|
<!-- auto:props:end -->
|
|
33
36
|
|
|
34
37
|
## 依赖
|
|
@@ -36,13 +39,14 @@ _(组件无 `<Name>Props` interface — props 详见 [`menubar.tsx`](./menubar.t
|
|
|
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 menubar` 时,以下 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
|
|
|
@@ -51,6 +55,7 @@ _(组件无 `<Name>Props` interface — props 详见 [`menubar.tsx`](./menubar.t
|
|
|
51
55
|
```bash
|
|
52
56
|
pnpm add @radix-ui/react-menubar@^1.1.0 lucide-react@^0.460.0
|
|
53
57
|
```
|
|
58
|
+
|
|
54
59
|
<!-- auto:deps:end -->
|
|
55
60
|
|
|
56
61
|
> 完整子组件:`Menubar` / `MenubarMenu` / `MenubarTrigger` / `MenubarContent` / `MenubarItem` / `MenubarCheckboxItem` / `MenubarRadioItem` / `MenubarLabel` / `MenubarSeparator` / `MenubarShortcut` / `MenubarSub` / `MenubarSubTrigger` / `MenubarSubContent` / `MenubarGroup` / `MenubarRadioGroup` / `MenubarPortal`。
|
|
@@ -66,17 +71,28 @@ pnpm add @radix-ui/react-menubar@^1.1.0 lucide-react@^0.460.0
|
|
|
66
71
|
|
|
67
72
|
```tsx
|
|
68
73
|
import {
|
|
69
|
-
Menubar,
|
|
70
|
-
|
|
71
|
-
|
|
74
|
+
Menubar,
|
|
75
|
+
MenubarMenu,
|
|
76
|
+
MenubarTrigger,
|
|
77
|
+
MenubarContent,
|
|
78
|
+
MenubarItem,
|
|
79
|
+
MenubarSeparator,
|
|
80
|
+
MenubarShortcut,
|
|
81
|
+
MenubarSub,
|
|
82
|
+
MenubarSubTrigger,
|
|
83
|
+
MenubarSubContent,
|
|
72
84
|
} from '@/components/ui/menubar';
|
|
73
85
|
|
|
74
86
|
<Menubar>
|
|
75
87
|
<MenubarMenu>
|
|
76
88
|
<MenubarTrigger>文件</MenubarTrigger>
|
|
77
89
|
<MenubarContent>
|
|
78
|
-
<MenubarItem
|
|
79
|
-
|
|
90
|
+
<MenubarItem>
|
|
91
|
+
新建文件 <MenubarShortcut>⌘N</MenubarShortcut>
|
|
92
|
+
</MenubarItem>
|
|
93
|
+
<MenubarItem>
|
|
94
|
+
打开 <MenubarShortcut>⌘O</MenubarShortcut>
|
|
95
|
+
</MenubarItem>
|
|
80
96
|
<MenubarSeparator />
|
|
81
97
|
<MenubarSub>
|
|
82
98
|
<MenubarSubTrigger>分享</MenubarSubTrigger>
|
|
@@ -86,15 +102,21 @@ import {
|
|
|
86
102
|
</MenubarSubContent>
|
|
87
103
|
</MenubarSub>
|
|
88
104
|
<MenubarSeparator />
|
|
89
|
-
<MenubarItem
|
|
105
|
+
<MenubarItem>
|
|
106
|
+
退出 <MenubarShortcut>⌘Q</MenubarShortcut>
|
|
107
|
+
</MenubarItem>
|
|
90
108
|
</MenubarContent>
|
|
91
109
|
</MenubarMenu>
|
|
92
110
|
<MenubarMenu>
|
|
93
111
|
<MenubarTrigger>编辑</MenubarTrigger>
|
|
94
112
|
<MenubarContent>
|
|
95
|
-
<MenubarItem
|
|
96
|
-
|
|
113
|
+
<MenubarItem>
|
|
114
|
+
撤销 <MenubarShortcut>⌘Z</MenubarShortcut>
|
|
115
|
+
</MenubarItem>
|
|
116
|
+
<MenubarItem>
|
|
117
|
+
重做 <MenubarShortcut>⇧⌘Z</MenubarShortcut>
|
|
118
|
+
</MenubarItem>
|
|
97
119
|
</MenubarContent>
|
|
98
120
|
</MenubarMenu>
|
|
99
|
-
</Menubar
|
|
121
|
+
</Menubar>;
|
|
100
122
|
```
|
|
@@ -16,6 +16,14 @@ const meta: Meta<typeof Menubar> = {
|
|
|
16
16
|
title: '导航 · Navigation/Menubar',
|
|
17
17
|
component: Menubar,
|
|
18
18
|
tags: ['autodocs'],
|
|
19
|
+
parameters: {
|
|
20
|
+
docs: {
|
|
21
|
+
description: {
|
|
22
|
+
component:
|
|
23
|
+
'应用顶部菜单栏 — Radix Menubar(macOS 风格)。支持多级子菜单、快捷键、Checkbox/Radio 选项、hover 切换。',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
19
27
|
};
|
|
20
28
|
|
|
21
29
|
export default meta;
|
|
@@ -72,7 +72,7 @@ const MenubarSubContent = React.forwardRef<
|
|
|
72
72
|
<MenubarPrimitive.SubContent
|
|
73
73
|
ref={ref}
|
|
74
74
|
className={cn(
|
|
75
|
-
'z-50 min-w-
|
|
75
|
+
'z-50 min-w-menu overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',
|
|
76
76
|
className,
|
|
77
77
|
)}
|
|
78
78
|
{...props}
|
|
@@ -95,7 +95,7 @@ const MenubarContent = React.forwardRef<
|
|
|
95
95
|
alignOffset={alignOffset}
|
|
96
96
|
sideOffset={sideOffset}
|
|
97
97
|
className={cn(
|
|
98
|
-
'z-50 min-w-
|
|
98
|
+
'z-50 min-w-menu-md overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',
|
|
99
99
|
className,
|
|
100
100
|
)}
|
|
101
101
|
{...props}
|
|
@@ -4,10 +4,11 @@ name: NativeSelect
|
|
|
4
4
|
type: component
|
|
5
5
|
category: form
|
|
6
6
|
since: 0.1.0
|
|
7
|
-
package:
|
|
7
|
+
package: '@teamix-evo/ui'
|
|
8
|
+
displayName: 原生下拉
|
|
8
9
|
---
|
|
9
10
|
|
|
10
|
-
# NativeSelect
|
|
11
|
+
# NativeSelect 原生下拉
|
|
11
12
|
|
|
12
13
|
原生下拉选择 — shadcn 2025-10 新增。**原生 `<select>` 元素**的样式封装,零 JS 开销,移动端弹起系统 picker,直接参与 form `submit`。与 `Select`(Radix)互为补充,分别面向"原生友好"与"可定制项 UI"两种诉求。
|
|
13
14
|
|
|
@@ -23,20 +24,27 @@ package: "@teamix-evo/ui"
|
|
|
23
24
|
- 需要搜索 / 虚拟列表 / 自定义选项渲染 → `Select`(Radix)/ `Combobox`
|
|
24
25
|
- 多选 → `Select multiple`(原生 multi 体验差)→ 用 Radix 版
|
|
25
26
|
|
|
27
|
+
## Props
|
|
28
|
+
|
|
26
29
|
<!-- auto:props:begin -->
|
|
27
|
-
|
|
28
|
-
|
|
|
29
|
-
|
|
|
30
|
+
|
|
31
|
+
| 名称 | 类型 | 默认值 | 必填 | 说明 |
|
|
32
|
+
| ------------------ | -------- | ------ | ---- | --------------------------------------------------------- |
|
|
33
|
+
| `wrapperClassName` | `string` | – | – | 容器额外 className(给外层 wrapper,而非 `<select>` 本身)。 |
|
|
34
|
+
|
|
30
35
|
<!-- auto:props:end -->
|
|
31
36
|
|
|
37
|
+
## 依赖
|
|
38
|
+
|
|
32
39
|
<!-- auto:deps:begin -->
|
|
40
|
+
|
|
33
41
|
### 同库依赖
|
|
34
42
|
|
|
35
43
|
> `teamix-evo ui add native-select` 时,以下 entry 会被自动连带安装(无需手动 add)。
|
|
36
44
|
|
|
37
|
-
| Entry | 类型 | 描述
|
|
38
|
-
|
|
|
39
|
-
| `cn`
|
|
45
|
+
| Entry | 类型 | 描述 |
|
|
46
|
+
| ----- | ---- | -------------------------------------------------- |
|
|
47
|
+
| `cn` | util | Tailwind className 合并工具(clsx + tailwind-merge) |
|
|
40
48
|
|
|
41
49
|
### npm 依赖
|
|
42
50
|
|
|
@@ -45,6 +53,7 @@ package: "@teamix-evo/ui"
|
|
|
45
53
|
```bash
|
|
46
54
|
pnpm add lucide-react@^0.460.0
|
|
47
55
|
```
|
|
56
|
+
|
|
48
57
|
<!-- auto:deps:end -->
|
|
49
58
|
|
|
50
59
|
## AI 生成纪律
|
|
@@ -9,7 +9,7 @@ const meta: Meta<typeof NativeSelect> = {
|
|
|
9
9
|
docs: {
|
|
10
10
|
description: {
|
|
11
11
|
component:
|
|
12
|
-
'原生下拉选择 — 原生 `<select>`
|
|
12
|
+
'原生下拉选择 — 原生 `<select>` 元素的样式封装,零 JS 开销,移动端弹起系统 picker,直接参与 form submit。与 Radix `Select` 互为补充:NativeSelect 面向原生 / 移动端友好,Radix Select 面向自定义项 UI / 受控复杂表单。shadcn 2025-10 新增。',
|
|
13
13
|
},
|
|
14
14
|
},
|
|
15
15
|
},
|
|
@@ -63,7 +63,7 @@ export const InForm: Story = {
|
|
|
63
63
|
onSubmit={(e) => {
|
|
64
64
|
e.preventDefault();
|
|
65
65
|
const fd = new FormData(e.currentTarget);
|
|
66
|
-
|
|
66
|
+
|
|
67
67
|
alert(`提交: sort=${fd.get('sort')}`);
|
|
68
68
|
}}
|
|
69
69
|
className="flex items-center gap-2"
|
|
@@ -72,7 +72,10 @@ export const InForm: Story = {
|
|
|
72
72
|
<option value="date">按日期</option>
|
|
73
73
|
<option value="name">按名称</option>
|
|
74
74
|
</NativeSelect>
|
|
75
|
-
<button
|
|
75
|
+
<button
|
|
76
|
+
type="submit"
|
|
77
|
+
className="rounded-md border px-3 py-1 text-sm hover:bg-accent"
|
|
78
|
+
>
|
|
76
79
|
提交
|
|
77
80
|
</button>
|
|
78
81
|
</form>
|
|
@@ -4,10 +4,11 @@ name: NavigationMenu
|
|
|
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
|
-
# NavigationMenu
|
|
11
|
+
# NavigationMenu 导航菜单
|
|
11
12
|
|
|
12
13
|
主导航菜单 — Radix NavigationMenu。**用于网站 / 营销页 / 应用顶部主导航**(产品 / 文档 / 定价 / 关于)。
|
|
13
14
|
**与 Menubar 区别**:NavigationMenu 是**网页级横向导航**(每项可有富 Content 面板,展示子页面预览);Menubar 是**应用级菜单**(文件 / 编辑等)。
|
|
@@ -29,7 +30,9 @@ package: "@teamix-evo/ui"
|
|
|
29
30
|
> 以下表格由 `pnpm --filter @teamix-evo/ui gen:meta` 自动生成。下表是 `NavigationMenu`(Root) 的 props。
|
|
30
31
|
|
|
31
32
|
<!-- auto:props:begin -->
|
|
33
|
+
|
|
32
34
|
_(组件无 `<Name>Props` interface — props 详见 [`navigation-menu.tsx`](./navigation-menu.tsx))_
|
|
35
|
+
|
|
33
36
|
<!-- auto:props:end -->
|
|
34
37
|
|
|
35
38
|
## 依赖
|
|
@@ -37,13 +40,14 @@ _(组件无 `<Name>Props` interface — props 详见 [`navigation-menu.tsx`](./n
|
|
|
37
40
|
> 以下表格由 `pnpm --filter @teamix-evo/ui gen:meta` 自动生成,数据源是 [`manifest.json`](../../../manifest.json)。**手工编辑 marker 之间的内容会在下次生成时被覆盖**。
|
|
38
41
|
|
|
39
42
|
<!-- auto:deps:begin -->
|
|
43
|
+
|
|
40
44
|
### 同库依赖
|
|
41
45
|
|
|
42
46
|
> `teamix-evo ui add navigation-menu` 时,以下 entry 会被自动连带安装(无需手动 add)。
|
|
43
47
|
|
|
44
|
-
| Entry | 类型 | 描述
|
|
45
|
-
|
|
|
46
|
-
| `cn`
|
|
48
|
+
| Entry | 类型 | 描述 |
|
|
49
|
+
| ----- | ---- | -------------------------------------------------- |
|
|
50
|
+
| `cn` | util | Tailwind className 合并工具(clsx + tailwind-merge) |
|
|
47
51
|
|
|
48
52
|
### npm 依赖
|
|
49
53
|
|
|
@@ -52,6 +56,7 @@ _(组件无 `<Name>Props` interface — props 详见 [`navigation-menu.tsx`](./n
|
|
|
52
56
|
```bash
|
|
53
57
|
pnpm add @radix-ui/react-navigation-menu@^1.2.0 class-variance-authority@^0.7.0 lucide-react@^0.460.0
|
|
54
58
|
```
|
|
59
|
+
|
|
55
60
|
<!-- auto:deps:end -->
|
|
56
61
|
|
|
57
62
|
> 完整子组件:`NavigationMenu` / `NavigationMenuList` / `NavigationMenuItem` / `NavigationMenuTrigger` / `NavigationMenuContent` / `NavigationMenuLink` / `NavigationMenuIndicator` / `NavigationMenuViewport` + `navigationMenuTriggerStyle`(给独立 Link 复用 trigger 视觉)。
|
|
@@ -68,9 +73,13 @@ pnpm add @radix-ui/react-navigation-menu@^1.2.0 class-variance-authority@^0.7.0
|
|
|
68
73
|
```tsx
|
|
69
74
|
import * as React from 'react';
|
|
70
75
|
import {
|
|
71
|
-
NavigationMenu,
|
|
72
|
-
|
|
73
|
-
|
|
76
|
+
NavigationMenu,
|
|
77
|
+
NavigationMenuList,
|
|
78
|
+
NavigationMenuItem,
|
|
79
|
+
NavigationMenuTrigger,
|
|
80
|
+
NavigationMenuContent,
|
|
81
|
+
NavigationMenuLink,
|
|
82
|
+
navigationMenuTriggerStyle,
|
|
74
83
|
} from '@/components/ui/navigation-menu';
|
|
75
84
|
|
|
76
85
|
<NavigationMenu>
|
|
@@ -81,9 +90,14 @@ import {
|
|
|
81
90
|
<ul className="grid w-[400px] gap-3 p-4 md:w-[500px] md:grid-cols-2">
|
|
82
91
|
<li>
|
|
83
92
|
<NavigationMenuLink asChild>
|
|
84
|
-
<a
|
|
93
|
+
<a
|
|
94
|
+
href="/design"
|
|
95
|
+
className="block rounded-md p-3 hover:bg-accent"
|
|
96
|
+
>
|
|
85
97
|
<div className="text-sm font-medium">Design</div>
|
|
86
|
-
<p className="text-xs text-muted-foreground"
|
|
98
|
+
<p className="text-xs text-muted-foreground">
|
|
99
|
+
设计体系与 tokens
|
|
100
|
+
</p>
|
|
87
101
|
</a>
|
|
88
102
|
</NavigationMenuLink>
|
|
89
103
|
</li>
|
|
@@ -104,5 +118,5 @@ import {
|
|
|
104
118
|
</NavigationMenuLink>
|
|
105
119
|
</NavigationMenuItem>
|
|
106
120
|
</NavigationMenuList>
|
|
107
|
-
</NavigationMenu
|
|
121
|
+
</NavigationMenu>;
|
|
108
122
|
```
|
|
@@ -13,6 +13,14 @@ const meta: Meta<typeof NavigationMenu> = {
|
|
|
13
13
|
title: '导航 · Navigation/NavigationMenu',
|
|
14
14
|
component: NavigationMenu,
|
|
15
15
|
tags: ['autodocs'],
|
|
16
|
+
parameters: {
|
|
17
|
+
docs: {
|
|
18
|
+
description: {
|
|
19
|
+
component:
|
|
20
|
+
'导航菜单 — 网站 / 营销页 / 应用顶部主导航(产品 / 文档 / 定价),每项可有富 Content 面板展示子页面预览。Radix NavigationMenu 实现,shadcn 显式版,与 Menubar(应用级菜单)互补。',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
16
24
|
};
|
|
17
25
|
|
|
18
26
|
export default meta;
|
|
@@ -77,9 +85,7 @@ export const Default: Story = {
|
|
|
77
85
|
className="block rounded-md p-3 hover:bg-accent"
|
|
78
86
|
>
|
|
79
87
|
<div className="text-sm font-medium">Skills</div>
|
|
80
|
-
<p className="text-xs text-muted-foreground">
|
|
81
|
-
AI IDE 技能
|
|
82
|
-
</p>
|
|
88
|
+
<p className="text-xs text-muted-foreground">AI IDE 技能</p>
|
|
83
89
|
</a>
|
|
84
90
|
</NavigationMenuLink>
|
|
85
91
|
</li>
|
|
@@ -87,20 +93,14 @@ export const Default: Story = {
|
|
|
87
93
|
</NavigationMenuContent>
|
|
88
94
|
</NavigationMenuItem>
|
|
89
95
|
<NavigationMenuItem>
|
|
90
|
-
<NavigationMenuLink
|
|
91
|
-
asChild
|
|
92
|
-
className={navigationMenuTriggerStyle()}
|
|
93
|
-
>
|
|
96
|
+
<NavigationMenuLink asChild className={navigationMenuTriggerStyle()}>
|
|
94
97
|
<a href="#docs" onClick={(e) => e.preventDefault()}>
|
|
95
98
|
文档
|
|
96
99
|
</a>
|
|
97
100
|
</NavigationMenuLink>
|
|
98
101
|
</NavigationMenuItem>
|
|
99
102
|
<NavigationMenuItem>
|
|
100
|
-
<NavigationMenuLink
|
|
101
|
-
asChild
|
|
102
|
-
className={navigationMenuTriggerStyle()}
|
|
103
|
-
>
|
|
103
|
+
<NavigationMenuLink asChild className={navigationMenuTriggerStyle()}>
|
|
104
104
|
<a href="#pricing" onClick={(e) => e.preventDefault()}>
|
|
105
105
|
定价
|
|
106
106
|
</a>
|
|
@@ -84,7 +84,7 @@ const NavigationMenuViewport = React.forwardRef<
|
|
|
84
84
|
<NavigationMenuPrimitive.Viewport
|
|
85
85
|
ref={ref}
|
|
86
86
|
className={cn(
|
|
87
|
-
'origin-top-center relative mt-1.5 h-
|
|
87
|
+
'origin-top-center relative mt-1.5 h-radix-nav-viewport w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-radix-nav-viewport',
|
|
88
88
|
className,
|
|
89
89
|
)}
|
|
90
90
|
{...props}
|
|
@@ -101,11 +101,12 @@ const NavigationMenuIndicator = React.forwardRef<
|
|
|
101
101
|
<NavigationMenuPrimitive.Indicator
|
|
102
102
|
ref={ref}
|
|
103
103
|
className={cn(
|
|
104
|
-
'top-full z-
|
|
104
|
+
'top-full z-1 flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in',
|
|
105
105
|
className,
|
|
106
106
|
)}
|
|
107
107
|
{...props}
|
|
108
108
|
>
|
|
109
|
+
{/* eslint-disable-next-line teamix-evo/no-arbitrary-tw-value -- indicator arrow tip alignment 60% is shadcn-canonical, not a tokenizable layout value. */}
|
|
109
110
|
<div className="relative top-[60%] size-2 rotate-45 rounded-tl-sm bg-border shadow-md" />
|
|
110
111
|
</NavigationMenuPrimitive.Indicator>
|
|
111
112
|
));
|
|
@@ -4,10 +4,11 @@ name: notification
|
|
|
4
4
|
type: component
|
|
5
5
|
category: feedback
|
|
6
6
|
since: 0.1.0
|
|
7
|
-
package:
|
|
7
|
+
package: '@teamix-evo/ui'
|
|
8
|
+
displayName: 通知
|
|
8
9
|
---
|
|
9
10
|
|
|
10
|
-
# Notification
|
|
11
|
+
# Notification 通知
|
|
11
12
|
|
|
12
13
|
卡片式通知 — antd 独有补足。**等价 antd `Notification`**(右上角 title + description 卡片),与 sonner 同一渲染栈。基于 sonner `toast.custom` 二次封装,业务侧**只需要挂载一次 `<Toaster />`**,后续在任意地方调 `notification.success(...)` / `notification.error(...)` 等触发。
|
|
13
14
|
|
|
@@ -23,18 +24,25 @@ package: "@teamix-evo/ui"
|
|
|
23
24
|
- 阻塞式确认 → `Dialog` / `AlertDialog` / `Popconfirm`
|
|
24
25
|
- 表单字段错误 → `FieldError`(就近显示)
|
|
25
26
|
|
|
27
|
+
## Props
|
|
28
|
+
|
|
26
29
|
<!-- auto:props:begin -->
|
|
30
|
+
|
|
27
31
|
_(组件无 `<Name>Props` interface — props 详见 [`notification.tsx`](./notification.tsx))_
|
|
32
|
+
|
|
28
33
|
<!-- auto:props:end -->
|
|
29
34
|
|
|
35
|
+
## 依赖
|
|
36
|
+
|
|
30
37
|
<!-- auto:deps:begin -->
|
|
38
|
+
|
|
31
39
|
### 同库依赖
|
|
32
40
|
|
|
33
41
|
> `teamix-evo ui add notification` 时,以下 entry 会被自动连带安装(无需手动 add)。
|
|
34
42
|
|
|
35
|
-
| Entry
|
|
36
|
-
|
|
|
37
|
-
| `cn`
|
|
43
|
+
| Entry | 类型 | 描述 |
|
|
44
|
+
| -------- | --------- | ------------------------------------------------------------------------------------------------- |
|
|
45
|
+
| `cn` | util | Tailwind className 合并工具(clsx + tailwind-merge) |
|
|
38
46
|
| `sonner` | component | Toast 通知 — sonner 包装,等价 antd message + notification 并集(toast() 函数式 API + Toaster 容器) |
|
|
39
47
|
|
|
40
48
|
### npm 依赖
|
|
@@ -44,6 +52,7 @@ _(组件无 `<Name>Props` interface — props 详见 [`notification.tsx`](./noti
|
|
|
44
52
|
```bash
|
|
45
53
|
pnpm add sonner@^1.5.0 lucide-react@^0.460.0
|
|
46
54
|
```
|
|
55
|
+
|
|
47
56
|
<!-- auto:deps:end -->
|
|
48
57
|
|
|
49
58
|
## AI 生成纪律
|
|
@@ -10,7 +10,7 @@ const meta: Meta = {
|
|
|
10
10
|
docs: {
|
|
11
11
|
description: {
|
|
12
12
|
component:
|
|
13
|
-
'卡片式通知 — 右上角 title + description
|
|
13
|
+
'卡片式通知 — 右上角 title + description 卡片(部署成功 / 配额提醒)。基于 sonner toast.custom,业务侧只需挂载一次 `<Toaster />`,后续在任意地方 imperative 触发。等价 antd `Notification`,与 toast(message)互补。',
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
16
|
},
|
|
@@ -27,7 +27,10 @@ export const Playground: Story = {
|
|
|
27
27
|
<Button
|
|
28
28
|
variant="outline"
|
|
29
29
|
onClick={() =>
|
|
30
|
-
notification.info({
|
|
30
|
+
notification.info({
|
|
31
|
+
title: '提示',
|
|
32
|
+
description: '这是一条 info 通知',
|
|
33
|
+
})
|
|
31
34
|
}
|
|
32
35
|
>
|
|
33
36
|
Info
|
|
@@ -82,7 +85,6 @@ export const WithAction: Story = {
|
|
|
82
85
|
action: {
|
|
83
86
|
label: '刷新',
|
|
84
87
|
onClick: () => {
|
|
85
|
-
// eslint-disable-next-line no-alert
|
|
86
88
|
alert('刷新');
|
|
87
89
|
},
|
|
88
90
|
},
|
|
@@ -30,8 +30,8 @@ export interface NotificationOptions extends Omit<ExternalToast, 'description' |
|
|
|
30
30
|
|
|
31
31
|
const iconMap: Record<NotificationType, React.ReactNode> = {
|
|
32
32
|
info: <Info className="size-5 text-primary" />,
|
|
33
|
-
success: <CheckCircle2 className="size-5 text-
|
|
34
|
-
warning: <AlertCircle className="size-5 text-
|
|
33
|
+
success: <CheckCircle2 className="size-5 text-success" />,
|
|
34
|
+
warning: <AlertCircle className="size-5 text-warning" />,
|
|
35
35
|
error: <XCircle className="size-5 text-destructive" />,
|
|
36
36
|
};
|
|
37
37
|
|
|
@@ -44,7 +44,7 @@ function fire(
|
|
|
44
44
|
<div
|
|
45
45
|
role="alert"
|
|
46
46
|
className={cn(
|
|
47
|
-
'flex w-
|
|
47
|
+
'flex w-notification gap-3 rounded-md border bg-background p-4 text-sm shadow-lg',
|
|
48
48
|
)}
|
|
49
49
|
>
|
|
50
50
|
<span className="mt-0.5 shrink-0">{iconMap[type]}</span>
|