@manohub/ui 0.6.1 → 0.7.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.
Files changed (36) hide show
  1. package/README.md +9 -1
  2. package/dist/components/button/index.d.ts +8 -8
  3. package/dist/components/dialog/index.d.ts +58 -6
  4. package/dist/components/dialog/index.js +45 -8
  5. package/dist/components/drawer/index.d.ts +18 -6
  6. package/dist/components/drawer/index.js +11 -5
  7. package/dist/components/input/index.d.ts +4 -4
  8. package/dist/components/input/index.js +1 -1
  9. package/dist/components/notice/index.d.ts +23 -10
  10. package/dist/components/notice/index.js +11 -5
  11. package/dist/components/notification/index.d.ts +1 -1
  12. package/dist/components/search/index.d.ts +26 -6
  13. package/dist/components/search/index.js +22 -4
  14. package/dist/components/tabs/index.d.ts +6 -2
  15. package/dist/components/tabs/index.js +9 -1
  16. package/dist/components/tabset/index.d.ts +6 -2
  17. package/dist/components/tabset/index.js +8 -1
  18. package/dist/components/tag/index.d.ts +1 -1
  19. package/dist/components/text/index.d.ts +120 -0
  20. package/dist/components/text/index.js +55 -0
  21. package/dist/components/toast/index.d.ts +4 -4
  22. package/dist/components/toast/index.js +11 -2
  23. package/dist/components/upload/index.d.ts +30 -0
  24. package/dist/components/upload/index.js +7 -1
  25. package/dist/index.d.ts +1 -0
  26. package/dist/index.js +2 -0
  27. package/dist/services/dialog.d.ts +20 -5
  28. package/dist/services/dialog.js +8 -1
  29. package/dist/styles/components/dialog.css +40 -1
  30. package/dist/styles/components/input.css +1 -1
  31. package/dist/styles/components/select.css +11 -0
  32. package/dist/styles/components/text.css +101 -0
  33. package/dist/styles/components/toast.css +12 -6
  34. package/dist/styles/index.css +5 -1
  35. package/dist/styles/reset.css +205 -0
  36. package/package.json +2 -2
package/README.md CHANGED
@@ -7,7 +7,7 @@ AIHub **自绘组件层**:不依赖 farris 的手写 Vue TSX 组件 + 自带
7
7
  | 层 | 入口 | 内容 |
8
8
  |---|---|---|
9
9
  | ① 主题 | `@manohub/theme/default.css`(兜底)/ `@manohub/theme/farris.css`(Farris 规范) | **全局**令牌(值)—— 随主题包独立发布,换主题只换这一行 |
10
- | ② 组件面 | `@manohub/ui/styles.css` | 类与状态协议 + 组件令牌基础值,**无需 JS** 即可使用 |
10
+ | ② 组件面 | `@manohub/ui/styles.css` | **元素级 reset**(盒模型 / 按钮外观 / 列表序号 / 链接下划线 / 标题字阶归零)+ 类与状态协议 + 组件令牌基础值,**无需 JS** 即可使用 |
11
11
  | ③ Vue 层 | `@manohub/ui` | Vue 组件:渲染 ② 的类 + 行为增强 |
12
12
  | ④ 服务层 | `@manohub/ui` | 命令式反馈:`toast()` / `confirm()` / `alert()` / `showLoading()`(宿主 + 队列 + 生命周期,共用 ③ 的组件) |
13
13
 
@@ -37,6 +37,14 @@ pnpm add @manohub/ui @manohub/theme
37
37
 
38
38
  只写静态页(不装 Vue)时引这两行即可 —— 类名与 `data-*` 状态协议直接可用。
39
39
 
40
+ **② 的第一条 import 就是元素级 reset**(随包内置,不需要第三行):盒模型、按钮外观、
41
+ `ul` / `ol` 的序号与缩进、`a` 的下划线、标题的默认字阶一并归零。作用域锚 `[data-manohub-ui]`
42
+ 且特异性为 0 —— 应用侧写任何元素选择器都能盖过它,所以**不必再自己写一份全局 reset**。
43
+
44
+ 唯一需要留意的是**富文本**:reset 之后 `ul` / `li` 没有圆点、`a` 没有下划线也没有链接色,
45
+ 需要富文本排版的页面请给自己的富文本容器类补回 `list-style` 与链接样式
46
+ (富文本排版暂无合规归属,见 `@manohub/kit/CONTRACT.md` §10)。
47
+
40
48
  本包**可独立发布**:组件与类型一律从 `@manohub/ui` 直接引;下游(如 `@manohub/kit`)若转出口,是下游自己的选择。
41
49
 
42
50
  ```tsx
@@ -212,7 +212,7 @@ export declare const Button: import("vue").DefineComponent<import("vue").Extract
212
212
  }>> & Readonly<{}>, {
213
213
  block: boolean;
214
214
  size: ControlSize;
215
- icon: "filter" | "copy" | "help" | "table" | "menu" | "search" | "link" | "delete" | "image" | "close" | "key" | "page-title" | "loading" | "info" | "alert" | "chevron-left" | "chevron-right" | "chevron-down" | "chevron-up" | "check" | "user" | "download" | "back" | "folder" | "folder-open" | "file" | "file-code" | "file-json" | "file-text" | "terminal" | "shield" | "wrench" | "plus" | "bell" | "settings" | "logout" | "home" | "workbench" | "grid-dots" | "heart" | "heart-filled" | "edit" | "refresh" | "upload" | "save" | "more" | "eye" | "external-link" | "minus" | "plus-circle" | "close-circle" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "sparkles" | "shield-check" | "shield-alert" | "history";
215
+ icon: "filter" | "copy" | "help" | "table" | "menu" | "search" | "link" | "delete" | "image" | "close" | "key" | "page-title" | "loading" | "info" | "alert" | "chevron-left" | "chevron-right" | "chevron-down" | "chevron-up" | "check" | "user" | "download" | "back" | "folder" | "folder-open" | "file" | "file-code" | "file-json" | "file-text" | "terminal" | "shield" | "tool" | "plus" | "notification" | "settings" | "logout" | "home" | "workbench" | "apps" | "favorite" | "favorite-filled" | "drag-handle" | "edit" | "refresh" | "upload" | "save" | "more" | "preview" | "external-link" | "minus" | "plus-circle" | "close-circle" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "ai" | "shield-check" | "shield-alert" | "history";
216
216
  menu: boolean;
217
217
  caret: boolean;
218
218
  disabled: boolean;
@@ -223,7 +223,7 @@ export declare const Button: import("vue").DefineComponent<import("vue").Extract
223
223
  variant: ButtonVariant;
224
224
  danger: boolean;
225
225
  shape: ButtonShape;
226
- trailingIcon: "filter" | "copy" | "help" | "table" | "menu" | "search" | "link" | "delete" | "image" | "close" | "key" | "page-title" | "loading" | "info" | "alert" | "chevron-left" | "chevron-right" | "chevron-down" | "chevron-up" | "check" | "user" | "download" | "back" | "folder" | "folder-open" | "file" | "file-code" | "file-json" | "file-text" | "terminal" | "shield" | "wrench" | "plus" | "bell" | "settings" | "logout" | "home" | "workbench" | "grid-dots" | "heart" | "heart-filled" | "edit" | "refresh" | "upload" | "save" | "more" | "eye" | "external-link" | "minus" | "plus-circle" | "close-circle" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "sparkles" | "shield-check" | "shield-alert" | "history";
226
+ trailingIcon: "filter" | "copy" | "help" | "table" | "menu" | "search" | "link" | "delete" | "image" | "close" | "key" | "page-title" | "loading" | "info" | "alert" | "chevron-left" | "chevron-right" | "chevron-down" | "chevron-up" | "check" | "user" | "download" | "back" | "folder" | "folder-open" | "file" | "file-code" | "file-json" | "file-text" | "terminal" | "shield" | "tool" | "plus" | "notification" | "settings" | "logout" | "home" | "workbench" | "apps" | "favorite" | "favorite-filled" | "drag-handle" | "edit" | "refresh" | "upload" | "save" | "more" | "preview" | "external-link" | "minus" | "plus-circle" | "close-circle" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "ai" | "shield-check" | "shield-alert" | "history";
227
227
  href: string;
228
228
  target: string;
229
229
  popoverTarget: string;
@@ -319,7 +319,7 @@ export declare const ButtonCompound: {
319
319
  }>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
320
320
  block: boolean;
321
321
  size: ControlSize;
322
- icon: "filter" | "copy" | "help" | "table" | "menu" | "search" | "link" | "delete" | "image" | "close" | "key" | "page-title" | "loading" | "info" | "alert" | "chevron-left" | "chevron-right" | "chevron-down" | "chevron-up" | "check" | "user" | "download" | "back" | "folder" | "folder-open" | "file" | "file-code" | "file-json" | "file-text" | "terminal" | "shield" | "wrench" | "plus" | "bell" | "settings" | "logout" | "home" | "workbench" | "grid-dots" | "heart" | "heart-filled" | "edit" | "refresh" | "upload" | "save" | "more" | "eye" | "external-link" | "minus" | "plus-circle" | "close-circle" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "sparkles" | "shield-check" | "shield-alert" | "history";
322
+ icon: "filter" | "copy" | "help" | "table" | "menu" | "search" | "link" | "delete" | "image" | "close" | "key" | "page-title" | "loading" | "info" | "alert" | "chevron-left" | "chevron-right" | "chevron-down" | "chevron-up" | "check" | "user" | "download" | "back" | "folder" | "folder-open" | "file" | "file-code" | "file-json" | "file-text" | "terminal" | "shield" | "tool" | "plus" | "notification" | "settings" | "logout" | "home" | "workbench" | "apps" | "favorite" | "favorite-filled" | "drag-handle" | "edit" | "refresh" | "upload" | "save" | "more" | "preview" | "external-link" | "minus" | "plus-circle" | "close-circle" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "ai" | "shield-check" | "shield-alert" | "history";
323
323
  menu: boolean;
324
324
  caret: boolean;
325
325
  disabled: boolean;
@@ -330,7 +330,7 @@ export declare const ButtonCompound: {
330
330
  variant: ButtonVariant;
331
331
  danger: boolean;
332
332
  shape: ButtonShape;
333
- trailingIcon: "filter" | "copy" | "help" | "table" | "menu" | "search" | "link" | "delete" | "image" | "close" | "key" | "page-title" | "loading" | "info" | "alert" | "chevron-left" | "chevron-right" | "chevron-down" | "chevron-up" | "check" | "user" | "download" | "back" | "folder" | "folder-open" | "file" | "file-code" | "file-json" | "file-text" | "terminal" | "shield" | "wrench" | "plus" | "bell" | "settings" | "logout" | "home" | "workbench" | "grid-dots" | "heart" | "heart-filled" | "edit" | "refresh" | "upload" | "save" | "more" | "eye" | "external-link" | "minus" | "plus-circle" | "close-circle" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "sparkles" | "shield-check" | "shield-alert" | "history";
333
+ trailingIcon: "filter" | "copy" | "help" | "table" | "menu" | "search" | "link" | "delete" | "image" | "close" | "key" | "page-title" | "loading" | "info" | "alert" | "chevron-left" | "chevron-right" | "chevron-down" | "chevron-up" | "check" | "user" | "download" | "back" | "folder" | "folder-open" | "file" | "file-code" | "file-json" | "file-text" | "terminal" | "shield" | "tool" | "plus" | "notification" | "settings" | "logout" | "home" | "workbench" | "apps" | "favorite" | "favorite-filled" | "drag-handle" | "edit" | "refresh" | "upload" | "save" | "more" | "preview" | "external-link" | "minus" | "plus-circle" | "close-circle" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "ai" | "shield-check" | "shield-alert" | "history";
334
334
  href: string;
335
335
  target: string;
336
336
  popoverTarget: string;
@@ -431,7 +431,7 @@ export declare const ButtonCompound: {
431
431
  }>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {
432
432
  block: boolean;
433
433
  size: ControlSize;
434
- icon: "filter" | "copy" | "help" | "table" | "menu" | "search" | "link" | "delete" | "image" | "close" | "key" | "page-title" | "loading" | "info" | "alert" | "chevron-left" | "chevron-right" | "chevron-down" | "chevron-up" | "check" | "user" | "download" | "back" | "folder" | "folder-open" | "file" | "file-code" | "file-json" | "file-text" | "terminal" | "shield" | "wrench" | "plus" | "bell" | "settings" | "logout" | "home" | "workbench" | "grid-dots" | "heart" | "heart-filled" | "edit" | "refresh" | "upload" | "save" | "more" | "eye" | "external-link" | "minus" | "plus-circle" | "close-circle" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "sparkles" | "shield-check" | "shield-alert" | "history";
434
+ icon: "filter" | "copy" | "help" | "table" | "menu" | "search" | "link" | "delete" | "image" | "close" | "key" | "page-title" | "loading" | "info" | "alert" | "chevron-left" | "chevron-right" | "chevron-down" | "chevron-up" | "check" | "user" | "download" | "back" | "folder" | "folder-open" | "file" | "file-code" | "file-json" | "file-text" | "terminal" | "shield" | "tool" | "plus" | "notification" | "settings" | "logout" | "home" | "workbench" | "apps" | "favorite" | "favorite-filled" | "drag-handle" | "edit" | "refresh" | "upload" | "save" | "more" | "preview" | "external-link" | "minus" | "plus-circle" | "close-circle" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "ai" | "shield-check" | "shield-alert" | "history";
435
435
  menu: boolean;
436
436
  caret: boolean;
437
437
  disabled: boolean;
@@ -442,7 +442,7 @@ export declare const ButtonCompound: {
442
442
  variant: ButtonVariant;
443
443
  danger: boolean;
444
444
  shape: ButtonShape;
445
- trailingIcon: "filter" | "copy" | "help" | "table" | "menu" | "search" | "link" | "delete" | "image" | "close" | "key" | "page-title" | "loading" | "info" | "alert" | "chevron-left" | "chevron-right" | "chevron-down" | "chevron-up" | "check" | "user" | "download" | "back" | "folder" | "folder-open" | "file" | "file-code" | "file-json" | "file-text" | "terminal" | "shield" | "wrench" | "plus" | "bell" | "settings" | "logout" | "home" | "workbench" | "grid-dots" | "heart" | "heart-filled" | "edit" | "refresh" | "upload" | "save" | "more" | "eye" | "external-link" | "minus" | "plus-circle" | "close-circle" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "sparkles" | "shield-check" | "shield-alert" | "history";
445
+ trailingIcon: "filter" | "copy" | "help" | "table" | "menu" | "search" | "link" | "delete" | "image" | "close" | "key" | "page-title" | "loading" | "info" | "alert" | "chevron-left" | "chevron-right" | "chevron-down" | "chevron-up" | "check" | "user" | "download" | "back" | "folder" | "folder-open" | "file" | "file-code" | "file-json" | "file-text" | "terminal" | "shield" | "tool" | "plus" | "notification" | "settings" | "logout" | "home" | "workbench" | "apps" | "favorite" | "favorite-filled" | "drag-handle" | "edit" | "refresh" | "upload" | "save" | "more" | "preview" | "external-link" | "minus" | "plus-circle" | "close-circle" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "ai" | "shield-check" | "shield-alert" | "history";
446
446
  href: string;
447
447
  target: string;
448
448
  popoverTarget: string;
@@ -537,7 +537,7 @@ export declare const ButtonCompound: {
537
537
  }>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
538
538
  block: boolean;
539
539
  size: ControlSize;
540
- icon: "filter" | "copy" | "help" | "table" | "menu" | "search" | "link" | "delete" | "image" | "close" | "key" | "page-title" | "loading" | "info" | "alert" | "chevron-left" | "chevron-right" | "chevron-down" | "chevron-up" | "check" | "user" | "download" | "back" | "folder" | "folder-open" | "file" | "file-code" | "file-json" | "file-text" | "terminal" | "shield" | "wrench" | "plus" | "bell" | "settings" | "logout" | "home" | "workbench" | "grid-dots" | "heart" | "heart-filled" | "edit" | "refresh" | "upload" | "save" | "more" | "eye" | "external-link" | "minus" | "plus-circle" | "close-circle" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "sparkles" | "shield-check" | "shield-alert" | "history";
540
+ icon: "filter" | "copy" | "help" | "table" | "menu" | "search" | "link" | "delete" | "image" | "close" | "key" | "page-title" | "loading" | "info" | "alert" | "chevron-left" | "chevron-right" | "chevron-down" | "chevron-up" | "check" | "user" | "download" | "back" | "folder" | "folder-open" | "file" | "file-code" | "file-json" | "file-text" | "terminal" | "shield" | "tool" | "plus" | "notification" | "settings" | "logout" | "home" | "workbench" | "apps" | "favorite" | "favorite-filled" | "drag-handle" | "edit" | "refresh" | "upload" | "save" | "more" | "preview" | "external-link" | "minus" | "plus-circle" | "close-circle" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "ai" | "shield-check" | "shield-alert" | "history";
541
541
  menu: boolean;
542
542
  caret: boolean;
543
543
  disabled: boolean;
@@ -548,7 +548,7 @@ export declare const ButtonCompound: {
548
548
  variant: ButtonVariant;
549
549
  danger: boolean;
550
550
  shape: ButtonShape;
551
- trailingIcon: "filter" | "copy" | "help" | "table" | "menu" | "search" | "link" | "delete" | "image" | "close" | "key" | "page-title" | "loading" | "info" | "alert" | "chevron-left" | "chevron-right" | "chevron-down" | "chevron-up" | "check" | "user" | "download" | "back" | "folder" | "folder-open" | "file" | "file-code" | "file-json" | "file-text" | "terminal" | "shield" | "wrench" | "plus" | "bell" | "settings" | "logout" | "home" | "workbench" | "grid-dots" | "heart" | "heart-filled" | "edit" | "refresh" | "upload" | "save" | "more" | "eye" | "external-link" | "minus" | "plus-circle" | "close-circle" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "sparkles" | "shield-check" | "shield-alert" | "history";
551
+ trailingIcon: "filter" | "copy" | "help" | "table" | "menu" | "search" | "link" | "delete" | "image" | "close" | "key" | "page-title" | "loading" | "info" | "alert" | "chevron-left" | "chevron-right" | "chevron-down" | "chevron-up" | "check" | "user" | "download" | "back" | "folder" | "folder-open" | "file" | "file-code" | "file-json" | "file-text" | "terminal" | "shield" | "tool" | "plus" | "notification" | "settings" | "logout" | "home" | "workbench" | "apps" | "favorite" | "favorite-filled" | "drag-handle" | "edit" | "refresh" | "upload" | "save" | "more" | "preview" | "external-link" | "minus" | "plus-circle" | "close-circle" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "ai" | "shield-check" | "shield-alert" | "history";
552
552
  href: string;
553
553
  target: string;
554
554
  popoverTarget: string;
@@ -1,5 +1,7 @@
1
1
  import { type PropType, type SlotsType, type VNodeChild } from 'vue';
2
2
  export type DialogWidth = 'md' | 'lg';
3
+ /** 语义档:决定标题左侧裸符号的图形与颜色(缺省不渲染图标) */
4
+ export type DialogTone = 'info' | 'success' | 'warning' | 'error';
3
5
  /**
4
6
  * 对话框(**自绘**;模态语义与遮罩全由原生 `<dialog>` 给)。
5
7
  *
@@ -45,6 +47,15 @@ export declare const Dialog: import("vue").DefineComponent<import("vue").Extract
45
47
  type: StringConstructor;
46
48
  default: undefined;
47
49
  };
50
+ /**
51
+ * 语义档(缺省不渲染图标):`warning` / `error` 用于「这一步有风险」的确认 ——
52
+ * 服务层的 `confirm()` / `alert()` 就是靠它把「删除确认」与「保存成功」区分开的。
53
+ * 它**只加一个裸符号与配色**,不改标题文案、不动底栏按钮的语义(危险色仍由 `okDanger` 定)。
54
+ */
55
+ tone: {
56
+ type: PropType<DialogTone>;
57
+ default: undefined;
58
+ };
48
59
  /** 宽度:尺寸档 `md` 520 / `lg` 760,或直接给像素数 */
49
60
  width: {
50
61
  type: PropType<DialogWidth | number>;
@@ -55,17 +66,24 @@ export declare const Dialog: import("vue").DefineComponent<import("vue").Extract
55
66
  type: BooleanConstructor;
56
67
  default: boolean;
57
68
  };
58
- /** 点遮罩是否关闭(模态确认类弹窗通常**不**给,防误关) */
69
+ /**
70
+ * 点遮罩是否关闭(**默认开**,与主流组件形态一致)。
71
+ *
72
+ * 组件是「受控弹窗」,用户点遮罩想退出是最常见的心智;「防误关」只对**命令式确认框**成立
73
+ * (那里一条误点就丢一次决策),故服务层的 `confirm()` / `alert()` 会**显式**传 `false` 把它关掉 ——
74
+ * 与 Ant Design 的分工相同(`<Modal maskClosable>` 默认 `true`,`Modal.confirm` 默认 `false`)。
75
+ * 表单类弹窗若怕手滑丢内容,自己显式传 `:close-on-backdrop="false"`。
76
+ */
59
77
  closeOnBackdrop: {
60
78
  type: BooleanConstructor;
61
79
  default: boolean;
62
80
  };
63
- /** `closeOnBackdrop` 的别名(主流库的通行叫法,两者取或) */
81
+ /** `closeOnBackdrop` 的别名(主流库的通行叫法,两者取或;默认同 `true`) */
64
82
  maskClosable: {
65
83
  type: BooleanConstructor;
66
84
  default: boolean;
67
85
  };
68
- /** Esc 是否关闭(缺省关;表单类弹窗常关掉它,防手滑丢内容) */
86
+ /** Esc 是否关闭(缺省开,与 `closeOnBackdrop` 一致 —— 两者面对同一个「误关」风险,口径不得相反) */
69
87
  keyboard: {
70
88
  type: BooleanConstructor;
71
89
  default: boolean;
@@ -75,6 +93,14 @@ export declare const Dialog: import("vue").DefineComponent<import("vue").Extract
75
93
  type: StringConstructor;
76
94
  default: undefined;
77
95
  };
96
+ /**
97
+ * 固定高度(如 `480px` / `min(560px, 80vh)`)—— 与 `panelWidth` 对称。
98
+ * 给了之后内容区吃满剩余高度并自行滚动,页头与底栏始终可见(`styles/components/dialog.css` 的三段布局)。
99
+ */
100
+ panelHeight: {
101
+ type: StringConstructor;
102
+ default: undefined;
103
+ };
78
104
  /** 内建底栏:确定按钮文案 */
79
105
  okText: {
80
106
  type: StringConstructor;
@@ -128,6 +154,15 @@ export declare const Dialog: import("vue").DefineComponent<import("vue").Extract
128
154
  type: StringConstructor;
129
155
  default: undefined;
130
156
  };
157
+ /**
158
+ * 语义档(缺省不渲染图标):`warning` / `error` 用于「这一步有风险」的确认 ——
159
+ * 服务层的 `confirm()` / `alert()` 就是靠它把「删除确认」与「保存成功」区分开的。
160
+ * 它**只加一个裸符号与配色**,不改标题文案、不动底栏按钮的语义(危险色仍由 `okDanger` 定)。
161
+ */
162
+ tone: {
163
+ type: PropType<DialogTone>;
164
+ default: undefined;
165
+ };
131
166
  /** 宽度:尺寸档 `md` 520 / `lg` 760,或直接给像素数 */
132
167
  width: {
133
168
  type: PropType<DialogWidth | number>;
@@ -138,17 +173,24 @@ export declare const Dialog: import("vue").DefineComponent<import("vue").Extract
138
173
  type: BooleanConstructor;
139
174
  default: boolean;
140
175
  };
141
- /** 点遮罩是否关闭(模态确认类弹窗通常**不**给,防误关) */
176
+ /**
177
+ * 点遮罩是否关闭(**默认开**,与主流组件形态一致)。
178
+ *
179
+ * 组件是「受控弹窗」,用户点遮罩想退出是最常见的心智;「防误关」只对**命令式确认框**成立
180
+ * (那里一条误点就丢一次决策),故服务层的 `confirm()` / `alert()` 会**显式**传 `false` 把它关掉 ——
181
+ * 与 Ant Design 的分工相同(`<Modal maskClosable>` 默认 `true`,`Modal.confirm` 默认 `false`)。
182
+ * 表单类弹窗若怕手滑丢内容,自己显式传 `:close-on-backdrop="false"`。
183
+ */
142
184
  closeOnBackdrop: {
143
185
  type: BooleanConstructor;
144
186
  default: boolean;
145
187
  };
146
- /** `closeOnBackdrop` 的别名(主流库的通行叫法,两者取或) */
188
+ /** `closeOnBackdrop` 的别名(主流库的通行叫法,两者取或;默认同 `true`) */
147
189
  maskClosable: {
148
190
  type: BooleanConstructor;
149
191
  default: boolean;
150
192
  };
151
- /** Esc 是否关闭(缺省关;表单类弹窗常关掉它,防手滑丢内容) */
193
+ /** Esc 是否关闭(缺省开,与 `closeOnBackdrop` 一致 —— 两者面对同一个「误关」风险,口径不得相反) */
152
194
  keyboard: {
153
195
  type: BooleanConstructor;
154
196
  default: boolean;
@@ -158,6 +200,14 @@ export declare const Dialog: import("vue").DefineComponent<import("vue").Extract
158
200
  type: StringConstructor;
159
201
  default: undefined;
160
202
  };
203
+ /**
204
+ * 固定高度(如 `480px` / `min(560px, 80vh)`)—— 与 `panelWidth` 对称。
205
+ * 给了之后内容区吃满剩余高度并自行滚动,页头与底栏始终可见(`styles/components/dialog.css` 的三段布局)。
206
+ */
207
+ panelHeight: {
208
+ type: StringConstructor;
209
+ default: undefined;
210
+ };
161
211
  /** 内建底栏:确定按钮文案 */
162
212
  okText: {
163
213
  type: StringConstructor;
@@ -206,11 +256,13 @@ export declare const Dialog: import("vue").DefineComponent<import("vue").Extract
206
256
  onCancel: () => void;
207
257
  onClose: () => void;
208
258
  width: number | DialogWidth;
259
+ tone: DialogTone;
209
260
  closable: boolean;
210
261
  closeOnBackdrop: boolean;
211
262
  maskClosable: boolean;
212
263
  keyboard: boolean;
213
264
  panelWidth: string;
265
+ panelHeight: string;
214
266
  okText: string;
215
267
  cancelText: string;
216
268
  okDanger: boolean;
@@ -1,6 +1,12 @@
1
1
  import { defineComponent, ref, watch, onMounted, onBeforeUnmount, computed, createVNode } from "vue";
2
2
  import { Icon } from "@manohub/icon";
3
3
  import { Button } from "../button/index.js";
4
+ const TONE_ICON = {
5
+ info: "info",
6
+ success: "check",
7
+ warning: "alert",
8
+ error: "close"
9
+ };
4
10
  const Dialog = /* @__PURE__ */ defineComponent({
5
11
  name: "Dialog",
6
12
  inheritAttrs: false,
@@ -15,6 +21,15 @@ const Dialog = /* @__PURE__ */ defineComponent({
15
21
  type: String,
16
22
  default: void 0
17
23
  },
24
+ /**
25
+ * 语义档(缺省不渲染图标):`warning` / `error` 用于「这一步有风险」的确认 ——
26
+ * 服务层的 `confirm()` / `alert()` 就是靠它把「删除确认」与「保存成功」区分开的。
27
+ * 它**只加一个裸符号与配色**,不改标题文案、不动底栏按钮的语义(危险色仍由 `okDanger` 定)。
28
+ */
29
+ tone: {
30
+ type: String,
31
+ default: void 0
32
+ },
18
33
  /** 宽度:尺寸档 `md` 520 / `lg` 760,或直接给像素数 */
19
34
  width: {
20
35
  type: [String, Number],
@@ -25,17 +40,24 @@ const Dialog = /* @__PURE__ */ defineComponent({
25
40
  type: Boolean,
26
41
  default: true
27
42
  },
28
- /** 点遮罩是否关闭(模态确认类弹窗通常**不**给,防误关) */
43
+ /**
44
+ * 点遮罩是否关闭(**默认开**,与主流组件形态一致)。
45
+ *
46
+ * 组件是「受控弹窗」,用户点遮罩想退出是最常见的心智;「防误关」只对**命令式确认框**成立
47
+ * (那里一条误点就丢一次决策),故服务层的 `confirm()` / `alert()` 会**显式**传 `false` 把它关掉 ——
48
+ * 与 Ant Design 的分工相同(`<Modal maskClosable>` 默认 `true`,`Modal.confirm` 默认 `false`)。
49
+ * 表单类弹窗若怕手滑丢内容,自己显式传 `:close-on-backdrop="false"`。
50
+ */
29
51
  closeOnBackdrop: {
30
52
  type: Boolean,
31
- default: false
53
+ default: true
32
54
  },
33
- /** `closeOnBackdrop` 的别名(主流库的通行叫法,两者取或) */
55
+ /** `closeOnBackdrop` 的别名(主流库的通行叫法,两者取或;默认同 `true`) */
34
56
  maskClosable: {
35
57
  type: Boolean,
36
- default: false
58
+ default: true
37
59
  },
38
- /** Esc 是否关闭(缺省关;表单类弹窗常关掉它,防手滑丢内容) */
60
+ /** Esc 是否关闭(缺省开,与 `closeOnBackdrop` 一致 —— 两者面对同一个「误关」风险,口径不得相反) */
39
61
  keyboard: {
40
62
  type: Boolean,
41
63
  default: true
@@ -45,6 +67,14 @@ const Dialog = /* @__PURE__ */ defineComponent({
45
67
  type: String,
46
68
  default: void 0
47
69
  },
70
+ /**
71
+ * 固定高度(如 `480px` / `min(560px, 80vh)`)—— 与 `panelWidth` 对称。
72
+ * 给了之后内容区吃满剩余高度并自行滚动,页头与底栏始终可见(`styles/components/dialog.css` 的三段布局)。
73
+ */
74
+ panelHeight: {
75
+ type: String,
76
+ default: void 0
77
+ },
48
78
  /** 内建底栏:确定按钮文案 */
49
79
  okText: {
50
80
  type: String,
@@ -139,11 +169,15 @@ const Dialog = /* @__PURE__ */ defineComponent({
139
169
  };
140
170
  return void 0;
141
171
  });
172
+ const heightStyle = computed(() => props.panelHeight ? {
173
+ height: props.panelHeight
174
+ } : void 0);
142
175
  return () => createVNode("dialog", {
143
176
  "ref": dialogRef,
144
- "class": ["mh-popup", "mh-dialog", props.width === "lg" ? "mh-dialog--lg" : "", attrs.class].filter(Boolean).join(" "),
177
+ "class": ["mh-popup", "mh-dialog", props.width === "lg" ? "mh-dialog--lg" : "", props.tone ? `mh-dialog--${props.tone}` : "", attrs.class].filter(Boolean).join(" "),
145
178
  "style": {
146
179
  ...widthStyle.value,
180
+ ...heightStyle.value,
147
181
  ...attrs.style
148
182
  },
149
183
  "onCancel": (event) => {
@@ -156,9 +190,12 @@ const Dialog = /* @__PURE__ */ defineComponent({
156
190
  requestClose("close");
157
191
  }
158
192
  }
159
- }, [props.title || slots.title || props.closable ? createVNode("div", {
193
+ }, [props.title || slots.title || props.closable || props.tone ? createVNode("div", {
160
194
  "class": "mh-dialog__header"
161
- }, [createVNode("span", {
195
+ }, [props.tone ? createVNode(Icon, {
196
+ "name": TONE_ICON[props.tone],
197
+ "class": "mh-dialog__tone-icon"
198
+ }, null) : null, createVNode("span", {
162
199
  "class": "mh-dialog__title"
163
200
  }, [slots.title ? slots.title() : props.title]), props.closable ? createVNode("button", {
164
201
  "type": "button",
@@ -62,17 +62,23 @@ export declare const Drawer: import("vue").DefineComponent<import("vue").Extract
62
62
  type: BooleanConstructor;
63
63
  default: boolean;
64
64
  };
65
- /** 点遮罩是否关闭(表单类抽屉通常**不**给,防误关) */
65
+ /**
66
+ * 点遮罩是否关闭(**默认开**,与主流组件形态一致)。
67
+ *
68
+ * 与 `Dialog` 同一口径:组件形态默认开,「防误关」只对**命令式**形态成立
69
+ * (服务层的 `confirm()` / `alert()` 显式传 `false`)。
70
+ * 表单类抽屉若怕手滑丢内容,自己显式传 `:close-on-backdrop="false"`。
71
+ */
66
72
  closeOnBackdrop: {
67
73
  type: BooleanConstructor;
68
74
  default: boolean;
69
75
  };
70
- /** `closeOnBackdrop` 的别名(主流库的通行叫法,两者取或) */
76
+ /** `closeOnBackdrop` 的别名(主流库的通行叫法,两者取或;默认同 `true`) */
71
77
  maskClosable: {
72
78
  type: BooleanConstructor;
73
79
  default: boolean;
74
80
  };
75
- /** Esc 是否关闭(缺省开;表单类抽屉常关掉它,防手滑丢内容) */
81
+ /** Esc 是否关闭(缺省开,与 `closeOnBackdrop` 一致) */
76
82
  keyboard: {
77
83
  type: BooleanConstructor;
78
84
  default: boolean;
@@ -145,17 +151,23 @@ export declare const Drawer: import("vue").DefineComponent<import("vue").Extract
145
151
  type: BooleanConstructor;
146
152
  default: boolean;
147
153
  };
148
- /** 点遮罩是否关闭(表单类抽屉通常**不**给,防误关) */
154
+ /**
155
+ * 点遮罩是否关闭(**默认开**,与主流组件形态一致)。
156
+ *
157
+ * 与 `Dialog` 同一口径:组件形态默认开,「防误关」只对**命令式**形态成立
158
+ * (服务层的 `confirm()` / `alert()` 显式传 `false`)。
159
+ * 表单类抽屉若怕手滑丢内容,自己显式传 `:close-on-backdrop="false"`。
160
+ */
149
161
  closeOnBackdrop: {
150
162
  type: BooleanConstructor;
151
163
  default: boolean;
152
164
  };
153
- /** `closeOnBackdrop` 的别名(主流库的通行叫法,两者取或) */
165
+ /** `closeOnBackdrop` 的别名(主流库的通行叫法,两者取或;默认同 `true`) */
154
166
  maskClosable: {
155
167
  type: BooleanConstructor;
156
168
  default: boolean;
157
169
  };
158
- /** Esc 是否关闭(缺省开;表单类抽屉常关掉它,防手滑丢内容) */
170
+ /** Esc 是否关闭(缺省开,与 `closeOnBackdrop` 一致) */
159
171
  keyboard: {
160
172
  type: BooleanConstructor;
161
173
  default: boolean;
@@ -30,17 +30,23 @@ const Drawer = /* @__PURE__ */ defineComponent({
30
30
  type: Boolean,
31
31
  default: true
32
32
  },
33
- /** 点遮罩是否关闭(表单类抽屉通常**不**给,防误关) */
33
+ /**
34
+ * 点遮罩是否关闭(**默认开**,与主流组件形态一致)。
35
+ *
36
+ * 与 `Dialog` 同一口径:组件形态默认开,「防误关」只对**命令式**形态成立
37
+ * (服务层的 `confirm()` / `alert()` 显式传 `false`)。
38
+ * 表单类抽屉若怕手滑丢内容,自己显式传 `:close-on-backdrop="false"`。
39
+ */
34
40
  closeOnBackdrop: {
35
41
  type: Boolean,
36
- default: false
42
+ default: true
37
43
  },
38
- /** `closeOnBackdrop` 的别名(主流库的通行叫法,两者取或) */
44
+ /** `closeOnBackdrop` 的别名(主流库的通行叫法,两者取或;默认同 `true`) */
39
45
  maskClosable: {
40
46
  type: Boolean,
41
- default: false
47
+ default: true
42
48
  },
43
- /** Esc 是否关闭(缺省开;表单类抽屉常关掉它,防手滑丢内容) */
49
+ /** Esc 是否关闭(缺省开,与 `closeOnBackdrop` 一致) */
44
50
  keyboard: {
45
51
  type: Boolean,
46
52
  default: true
@@ -249,12 +249,12 @@ export declare const Input: import("vue").DefineComponent<import("vue").ExtractP
249
249
  autofocus: boolean;
250
250
  modelValue: string;
251
251
  status: InputStatus;
252
+ as: "button" | "input";
252
253
  readonly: boolean;
253
254
  clearable: boolean;
254
255
  maxlength: number;
255
256
  showCount: boolean;
256
257
  onEnter: (v: string) => void;
257
- as: "button" | "input";
258
258
  controlClass: string;
259
259
  controlAttrs: Record<string, unknown>;
260
260
  hasValue: boolean;
@@ -547,12 +547,12 @@ export declare const InputCompound: {
547
547
  autofocus: boolean;
548
548
  modelValue: string;
549
549
  status: InputStatus;
550
+ as: "button" | "input";
550
551
  readonly: boolean;
551
552
  clearable: boolean;
552
553
  maxlength: number;
553
554
  showCount: boolean;
554
555
  onEnter: (v: string) => void;
555
- as: "button" | "input";
556
556
  controlClass: string;
557
557
  controlAttrs: Record<string, unknown>;
558
558
  hasValue: boolean;
@@ -678,12 +678,12 @@ export declare const InputCompound: {
678
678
  autofocus: boolean;
679
679
  modelValue: string;
680
680
  status: InputStatus;
681
+ as: "button" | "input";
681
682
  readonly: boolean;
682
683
  clearable: boolean;
683
684
  maxlength: number;
684
685
  showCount: boolean;
685
686
  onEnter: (v: string) => void;
686
- as: "button" | "input";
687
687
  controlClass: string;
688
688
  controlAttrs: Record<string, unknown>;
689
689
  hasValue: boolean;
@@ -804,12 +804,12 @@ export declare const InputCompound: {
804
804
  autofocus: boolean;
805
805
  modelValue: string;
806
806
  status: InputStatus;
807
+ as: "button" | "input";
807
808
  readonly: boolean;
808
809
  clearable: boolean;
809
810
  maxlength: number;
810
811
  showCount: boolean;
811
812
  onEnter: (v: string) => void;
812
- as: "button" | "input";
813
813
  controlClass: string;
814
814
  controlAttrs: Record<string, unknown>;
815
815
  hasValue: boolean;
@@ -184,7 +184,7 @@ const Input = /* @__PURE__ */ defineComponent({
184
184
  "tabindex": -1,
185
185
  "onClick": () => revealed.value = !revealed.value
186
186
  }, [createVNode(Icon, {
187
- "name": "eye",
187
+ "name": "preview",
188
188
  "class": "mh-input__eye-icon"
189
189
  }, null)]) : null, slots.suffix ? createVNode("span", {
190
190
  "class": "mh-input__suffix"
@@ -1,3 +1,4 @@
1
+ import { type IconName } from '@manohub/icon';
1
2
  import { type PropType, type SlotsType, type VNodeChild } from 'vue';
2
3
  export type NoticeTone = 'info' | 'success' | 'warning' | 'error';
3
4
  /**
@@ -24,10 +25,10 @@ export type NoticeTone = 'info' | 'success' | 'warning' | 'error';
24
25
  * | 有标题 | `message` + `description`(或插槽) | **标题行 + 描述行**两行 |
25
26
  *
26
27
  * @example 可关闭的说明条(列表页顶部)
27
- * <Notice closable onClose={() => (visible = false)} show-icon>值映射用于将来源向量转换为目标值。</Notice>
28
+ * <Notice closable onClose={() => (visible = false)} icon>值映射用于将来源向量转换为目标值。</Notice>
28
29
  *
29
30
  * @example 带标题与操作
30
- * <Notice tone="warning" show-icon message="尚未完成实名认证" description="使用该服务前须完成认证"
31
+ * <Notice tone="warning" icon message="尚未完成实名认证" description="使用该服务前须完成认证"
31
32
  * action="立即认证" :on-action="goAuth" />
32
33
  */
33
34
  export declare const Notice: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
@@ -46,9 +47,15 @@ export declare const Notice: import("vue").DefineComponent<import("vue").Extract
46
47
  type: StringConstructor;
47
48
  default: undefined;
48
49
  };
49
- /** 是否显示语义图标 */
50
- showIcon: {
51
- type: BooleanConstructor;
50
+ /**
51
+ * 前置图标:缺省 `false` 不出图标;`true` 按 `tone` 映射;也可直接给字形名。
52
+ *
53
+ * 与 `Toast.icon` / `Notification.icon` **同名同型**(0.6.x 本件叫 `showIcon` 且只收布尔,
54
+ * 三件三个名字三种默认 —— 已统一)。默认值仍与 `Toast` 不同:`Toast` 是「浮出即走」的
55
+ * 消息条,图标是它的主要语义承载;本件是嵌在页面里的说明条,页面里别处往往已经有图标,故缺省不出。
56
+ */
57
+ icon: {
58
+ type: PropType<boolean | IconName>;
52
59
  default: boolean;
53
60
  };
54
61
  /** 是否渲染右上关闭按钮(规范:仅通知类信息可关闭) */
@@ -92,9 +99,15 @@ export declare const Notice: import("vue").DefineComponent<import("vue").Extract
92
99
  type: StringConstructor;
93
100
  default: undefined;
94
101
  };
95
- /** 是否显示语义图标 */
96
- showIcon: {
97
- type: BooleanConstructor;
102
+ /**
103
+ * 前置图标:缺省 `false` 不出图标;`true` 按 `tone` 映射;也可直接给字形名。
104
+ *
105
+ * 与 `Toast.icon` / `Notification.icon` **同名同型**(0.6.x 本件叫 `showIcon` 且只收布尔,
106
+ * 三件三个名字三种默认 —— 已统一)。默认值仍与 `Toast` 不同:`Toast` 是「浮出即走」的
107
+ * 消息条,图标是它的主要语义承载;本件是嵌在页面里的说明条,页面里别处往往已经有图标,故缺省不出。
108
+ */
109
+ icon: {
110
+ type: PropType<boolean | IconName>;
98
111
  default: boolean;
99
112
  };
100
113
  /** 是否渲染右上关闭按钮(规范:仅通知类信息可关闭) */
@@ -123,14 +136,14 @@ export declare const Notice: import("vue").DefineComponent<import("vue").Extract
123
136
  default: undefined;
124
137
  };
125
138
  }>> & Readonly<{}>, {
139
+ icon: boolean | "filter" | "copy" | "help" | "table" | "menu" | "search" | "link" | "delete" | "image" | "close" | "key" | "page-title" | "loading" | "info" | "alert" | "chevron-left" | "chevron-right" | "chevron-down" | "chevron-up" | "check" | "user" | "download" | "back" | "folder" | "folder-open" | "file" | "file-code" | "file-json" | "file-text" | "terminal" | "shield" | "tool" | "plus" | "notification" | "settings" | "logout" | "home" | "workbench" | "apps" | "favorite" | "favorite-filled" | "drag-handle" | "edit" | "refresh" | "upload" | "save" | "more" | "preview" | "external-link" | "minus" | "plus-circle" | "close-circle" | "list" | "calendar" | "clock" | "lock" | "unlock" | "users" | "archive" | "package" | "plug" | "branch" | "tag" | "ai" | "shield-check" | "shield-alert" | "history";
126
140
  onClose: () => void;
127
141
  message: string;
128
142
  tone: NoticeTone;
129
143
  closable: boolean;
130
144
  description: string;
131
- showIcon: boolean;
132
- closeText: string;
133
145
  action: string;
146
+ closeText: string;
134
147
  onAction: () => void;
135
148
  }, SlotsType<{
136
149
  default?: () => VNodeChild;
@@ -25,9 +25,15 @@ const Notice = /* @__PURE__ */ defineComponent({
25
25
  type: String,
26
26
  default: void 0
27
27
  },
28
- /** 是否显示语义图标 */
29
- showIcon: {
30
- type: Boolean,
28
+ /**
29
+ * 前置图标:缺省 `false` 不出图标;`true` 按 `tone` 映射;也可直接给字形名。
30
+ *
31
+ * 与 `Toast.icon` / `Notification.icon` **同名同型**(0.6.x 本件叫 `showIcon` 且只收布尔,
32
+ * 三件三个名字三种默认 —— 已统一)。默认值仍与 `Toast` 不同:`Toast` 是「浮出即走」的
33
+ * 消息条,图标是它的主要语义承载;本件是嵌在页面里的说明条,页面里别处往往已经有图标,故缺省不出。
34
+ */
35
+ icon: {
36
+ type: [Boolean, String],
31
37
  default: false
32
38
  },
33
39
  /** 是否渲染右上关闭按钮(规范:仅通知类信息可关闭) */
@@ -73,8 +79,8 @@ const Notice = /* @__PURE__ */ defineComponent({
73
79
  return () => createVNode("div", {
74
80
  "class": [attrs.class, "mh-notice", `mh-notice--${props.tone}`, props.message ? "mh-notice--titled" : ""].filter(Boolean).join(" "),
75
81
  "role": "alert"
76
- }, [props.showIcon ? createVNode(Icon, {
77
- "name": TONE_ICON[props.tone],
82
+ }, [props.icon ? createVNode(Icon, {
83
+ "name": typeof props.icon === "string" ? props.icon : TONE_ICON[props.tone],
78
84
  "class": "mh-notice__icon"
79
85
  }, null) : null, createVNode("div", {
80
86
  "class": "mh-notice__body"