@manohub/ui 1.3.3 → 1.3.5

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 (116) hide show
  1. package/README.md +25 -4
  2. package/dist/components/button/index.d.ts +5 -5
  3. package/dist/components/button/index.js +1 -1
  4. package/dist/components/card/index.d.ts +3 -3
  5. package/dist/components/checkbox/index.d.ts +30 -25
  6. package/dist/components/checkbox/index.js +16 -11
  7. package/dist/components/dialog/index.d.ts +121 -120
  8. package/dist/components/dialog/index.js +122 -144
  9. package/dist/components/divider/index.d.ts +1 -1
  10. package/dist/components/drawer/index.d.ts +53 -54
  11. package/dist/components/drawer/index.js +71 -96
  12. package/dist/components/form/index.d.ts +3 -3
  13. package/dist/components/form/index.js +1 -1
  14. package/dist/components/input/index.d.ts +1 -2
  15. package/dist/components/layout/index.d.ts +2 -2
  16. package/dist/components/layout/index.js +1 -1
  17. package/dist/components/list/tree.d.ts +5 -5
  18. package/dist/components/list-view/index.d.ts +1 -1
  19. package/dist/components/notice/index.d.ts +3 -3
  20. package/dist/components/notice/index.js +1 -1
  21. package/dist/components/notification/index.d.ts +2 -2
  22. package/dist/components/page/index.d.ts +1 -1
  23. package/dist/components/pagination/index.d.ts +2 -2
  24. package/dist/components/popup/index.d.ts +117 -0
  25. package/dist/components/popup/index.js +217 -0
  26. package/dist/components/popup/inert-scope.d.ts +22 -0
  27. package/dist/components/popup/inert-scope.js +57 -0
  28. package/dist/components/popup/scroll-lock.d.ts +2 -0
  29. package/dist/components/popup/scroll-lock.js +43 -0
  30. package/dist/components/query-state/index.d.ts +1 -1
  31. package/dist/components/radio/index.d.ts +18 -19
  32. package/dist/components/radio/index.js +12 -6
  33. package/dist/components/scrollbar/index.d.ts +4 -4
  34. package/dist/components/steps/index.d.ts +7 -7
  35. package/dist/components/steps/index.js +1 -1
  36. package/dist/components/tabbar/index.d.ts +1 -1
  37. package/dist/components/table/index.d.ts +1 -1
  38. package/dist/index.d.ts +1 -0
  39. package/dist/index.js +3 -0
  40. package/dist/services/dialog.d.ts +5 -5
  41. package/dist/services/dialog.js +9 -6
  42. package/dist/styles/components/avatar.css +3 -3
  43. package/dist/styles/components/badge.css +4 -4
  44. package/dist/styles/components/button.css +11 -12
  45. package/dist/styles/components/button.tokens.css +20 -21
  46. package/dist/styles/components/capsule.css +4 -4
  47. package/dist/styles/components/capsule.tokens.css +7 -7
  48. package/dist/styles/components/card.css +1 -2
  49. package/dist/styles/components/card.tokens.css +2 -2
  50. package/dist/styles/components/checkbox.css +23 -33
  51. package/dist/styles/components/checkbox.tokens.css +5 -9
  52. package/dist/styles/components/code-block.css +230 -230
  53. package/dist/styles/components/code-block.tokens.css +9 -9
  54. package/dist/styles/components/collapse.css +2 -2
  55. package/dist/styles/components/collapse.tokens.css +2 -2
  56. package/dist/styles/components/date-picker.tokens.css +1 -1
  57. package/dist/styles/components/dialog.css +36 -31
  58. package/dist/styles/components/dialog.tokens.css +7 -7
  59. package/dist/styles/components/divider.css +4 -5
  60. package/dist/styles/components/divider.tokens.css +1 -1
  61. package/dist/styles/components/drawer.css +15 -24
  62. package/dist/styles/components/drawer.tokens.css +4 -4
  63. package/dist/styles/components/filter.css +2 -2
  64. package/dist/styles/components/form.css +4 -4
  65. package/dist/styles/components/form.tokens.css +5 -5
  66. package/dist/styles/components/input.css +14 -8
  67. package/dist/styles/components/input.tokens.css +16 -18
  68. package/dist/styles/components/layout.tokens.css +3 -3
  69. package/dist/styles/components/list-view.tokens.css +2 -2
  70. package/dist/styles/components/list.css +4 -5
  71. package/dist/styles/components/list.tokens.css +3 -3
  72. package/dist/styles/components/loading.css +3 -3
  73. package/dist/styles/components/loading.tokens.css +4 -3
  74. package/dist/styles/components/notice.css +8 -9
  75. package/dist/styles/components/notice.tokens.css +4 -5
  76. package/dist/styles/components/notification.css +11 -12
  77. package/dist/styles/components/notification.tokens.css +12 -14
  78. package/dist/styles/components/page.css +4 -4
  79. package/dist/styles/components/pagination.css +8 -10
  80. package/dist/styles/components/pagination.tokens.css +10 -10
  81. package/dist/styles/components/panel.css +1 -1
  82. package/dist/styles/components/query-state.css +7 -7
  83. package/dist/styles/components/query-state.tokens.css +1 -1
  84. package/dist/styles/components/radio.css +28 -18
  85. package/dist/styles/components/radio.tokens.css +10 -8
  86. package/dist/styles/components/scrollbar.css +2 -2
  87. package/dist/styles/components/select.css +4 -4
  88. package/dist/styles/components/select.tokens.css +5 -5
  89. package/dist/styles/components/skeleton.css +1 -1
  90. package/dist/styles/components/skeleton.tokens.css +7 -8
  91. package/dist/styles/components/steps.css +5 -5
  92. package/dist/styles/components/steps.tokens.css +10 -11
  93. package/dist/styles/components/switch.css +2 -2
  94. package/dist/styles/components/switch.tokens.css +5 -5
  95. package/dist/styles/components/tabbar.css +1 -2
  96. package/dist/styles/components/tabbar.tokens.css +9 -9
  97. package/dist/styles/components/table.css +8 -10
  98. package/dist/styles/components/table.tokens.css +6 -6
  99. package/dist/styles/components/tag.css +3 -3
  100. package/dist/styles/components/tag.tokens.css +2 -2
  101. package/dist/styles/components/toast.css +8 -8
  102. package/dist/styles/components/toast.tokens.css +7 -6
  103. package/dist/styles/components/tooltip.css +3 -3
  104. package/dist/styles/components/tooltip.tokens.css +6 -6
  105. package/dist/styles/components/upload.css +3 -3
  106. package/dist/styles/components/upload.tokens.css +8 -8
  107. package/dist/styles/index.css +1 -0
  108. package/dist/styles/operations/collapse.css +1 -1
  109. package/dist/styles/operations/popup-layer.css +95 -0
  110. package/dist/styles/operations/popup.css +4 -4
  111. package/dist/styles/operations/tabs.css +3 -3
  112. package/dist/utils/popup-host.d.ts +36 -0
  113. package/dist/utils/popup-host.js +21 -0
  114. package/dist/utils/scope-svg-ids.d.ts +4 -4
  115. package/dist/utils/state-illustration.d.ts +8 -8
  116. package/package.json +2 -2
package/README.md CHANGED
@@ -6,7 +6,7 @@ AIHub **自绘组件层**:不依赖 farris 的手写 Vue TSX 组件 + 自带
6
6
 
7
7
  | 层 | 入口 | 内容 |
8
8
  |---|---|---|
9
- | ① 主题 | `@manohub/theme/default.css`(兜底)/ `@manohub/theme/farris.css`(Farris 规范) | **全局**令牌(值)—— 随主题包独立发布,换主题只换这一行 |
9
+ | ① 主题 | `@manohub/theme/default.css`(唯一入口) | **全局**令牌(值)—— 随主题包独立发布,换主题只换这一行 |
10
10
  | ② 组件面 | `@manohub/ui/styles.css` | **元素级 reset**(只有盒模型 + 容器基座两面,见下)+ 类与状态协议 + 组件令牌基础值,**无需 JS** 即可使用 |
11
11
  | ③ Vue 层 | `@manohub/ui` | Vue 组件:渲染 ② 的类 + 行为增强 |
12
12
  | ④ 服务层 | `@manohub/ui` | 命令式反馈:`toast()` / `confirm()` / `alert()` / `showLoading()`(宿主 + 队列 + 生命周期,共用 ③ 的组件) |
@@ -113,7 +113,7 @@ toast('error', '导出失败', { action: { text: '重试', onClick: retry } })
113
113
  const pending = toast('loading', '正在导入…', { duration: 0 }) // 常驻,完成后自己收
114
114
  pending.close()
115
115
 
116
- if (await confirm({ title: '删除确认', detail: '删除后不可恢复', okDanger: true })) await remove()
116
+ if (await confirm({ title: '删除确认', detail: '删除后不可恢复', confirmDanger: true })) await remove()
117
117
  await alert({ title: '导入完成', detail: '共 128 条' })
118
118
 
119
119
  const loading = showLoading('保存中…') // 引用计数:并发调用要各关各的
@@ -137,6 +137,28 @@ try { await save() } finally { loading.close() } // 句柄与 toast() 同形状
137
137
  两枚命令式句柄**形状统一**:`toast()` 与 `showLoading()` 都返回 **`{ close(): void }`**
138
138
  (`ServiceHandle`)—— 只关自己那一次且**幂等**;「整体动作」另走 `clearToasts()` / `hideLoading()`。
139
139
 
140
+ ## 宿主态:弹窗只盖本应用内容区
141
+
142
+ 微应用挂在门户里时,原生 `showModal()` 的遮罩与 `inert` 是**文档级**的:弹窗一开,宿主的菜单 / 页签
143
+ 也一起变暗、点不动。在应用入口声明一次落点即可(**只写一处,不必动 51 个调用点**):
144
+
145
+ ```ts
146
+ import { resolveAppContainer } from '@manohub/kit' // 本应用自己的锚容器
147
+ import { configurePopupHost } from '@manohub/ui'
148
+
149
+ configurePopupHost(resolveAppContainer)
150
+ ```
151
+
152
+ - 之后 `Dialog` / `Drawer` / `confirm()` / `alert()` 全部走**宿主态**:`<Teleport>` 落进
153
+ `.app-container`,遮罩只盖内容区;开合换成非模态 `show()`,应用内的模态由容器级 `inert` 近似;
154
+ - **没配就是不配**:独立运行、demo 行为一字不变(原生模态);**拿不到目标**(选择器查不到 /
155
+ 显式 `host={null}`)才退回模态;
156
+ - **填哪个就落哪个**:`host` 是 Teleport 目标本身(`'[data-manohub-ui]'` / `'#app'` / 元素 / 取值函数),
157
+ 库不做「归到锚」的二次推断;落点选谁由调用方负责(微应用里通常就是本应用容器);
158
+ - `mask={false}` 只是不要那层压暗(内容仍点不动、Esc 仍关);
159
+ - 弹窗层与遮罩的底色/落位在 `@manohub/ui/styles.css` 的 `operations/popup-layer.css`,色取主题的
160
+ `--ui-mask-popup`(Mask01 黑 45%)。
161
+
140
162
  ## 主题层
141
163
 
142
164
  全局令牌(`--ui-primary` / `--ui-space-*` / `--ui-font-*` 这类跨件共用的值)**不在本包**,已拆成独立包
@@ -162,9 +184,8 @@ try { await save() } finally { loading.close() } // 句柄与 toast() 同形状
162
184
  | 主题 | 入口 | 锚点 | 取值来源 |
163
185
  |---|---|---|---|
164
186
  | `default` | `@manohub/theme/default.css` | `[data-manohub-ui]`(兜底套) | AIHub 品牌蓝(primary `#2660FF`)|
165
- | `farris` | `@manohub/theme/farris.css` | `[data-manohub-ui][data-theme='farris']` | 《Farris Web 基础视觉规范》(primary `#2a87ff`,色板编号 Th/Au/Ne/Te 逐条标注)|
166
187
 
167
- 换皮只需给容器加属性(`createSubApp({ theme: 'farris' })` 会写 `data-theme`),不动类名、不动组件代码、不重打包。
188
+ 换皮只动本包的令牌值,不动类名、不动组件代码、不重打包(`createSubApp({ theme })` 仍会写 `data-theme`,留给将来新增的主题)。
168
189
  新增主题 = `packages/theme/src/<name>/` 新目录,令牌锚 `[data-manohub-ui][data-theme='<name>']`,
169
190
  且必须**全量覆盖** default 的令牌。
170
191
 
@@ -34,7 +34,7 @@ export type ButtonShape = 'default' | 'round' | 'circle';
34
34
  * (`<a>` 没有原生禁用),这是有意的取舍。
35
35
  */
36
36
  export declare const Button: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
37
- /** 按钮型(缺省 `secondary`,与规范「次要为默认」一致) */
37
+ /** 按钮型(缺省 `secondary`) */
38
38
  variant: {
39
39
  type: PropType<ButtonVariant>;
40
40
  default: string;
@@ -103,7 +103,7 @@ export declare const Button: import("vue").DefineComponent<import("vue").Extract
103
103
  default: undefined;
104
104
  };
105
105
  }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
106
- /** 按钮型(缺省 `secondary`,与规范「次要为默认」一致) */
106
+ /** 按钮型(缺省 `secondary`) */
107
107
  variant: {
108
108
  type: PropType<ButtonVariant>;
109
109
  default: string;
@@ -240,7 +240,7 @@ export declare const ButtonGroup: import("vue").DefineComponent<import("vue").Ex
240
240
  }>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
241
241
  export declare const ButtonCompound: {
242
242
  new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
243
- /** 按钮型(缺省 `secondary`,与规范「次要为默认」一致) */
243
+ /** 按钮型(缺省 `secondary`) */
244
244
  variant: {
245
245
  type: PropType<ButtonVariant>;
246
246
  default: string;
@@ -334,7 +334,7 @@ export declare const ButtonCompound: {
334
334
  M: {};
335
335
  Defaults: {};
336
336
  }, Readonly<import("vue").ExtractPropTypes<{
337
- /** 按钮型(缺省 `secondary`,与规范「次要为默认」一致) */
337
+ /** 按钮型(缺省 `secondary`) */
338
338
  variant: {
339
339
  type: PropType<ButtonVariant>;
340
340
  default: string;
@@ -422,7 +422,7 @@ export declare const ButtonCompound: {
422
422
  __isTeleport?: never;
423
423
  __isSuspense?: never;
424
424
  } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
425
- /** 按钮型(缺省 `secondary`,与规范「次要为默认」一致) */
425
+ /** 按钮型(缺省 `secondary`) */
426
426
  variant: {
427
427
  type: PropType<ButtonVariant>;
428
428
  default: string;
@@ -5,7 +5,7 @@ const Button = /* @__PURE__ */ defineComponent({
5
5
  name: "Button",
6
6
  inheritAttrs: false,
7
7
  props: {
8
- /** 按钮型(缺省 `secondary`,与规范「次要为默认」一致) */
8
+ /** 按钮型(缺省 `secondary`) */
9
9
  variant: {
10
10
  type: String,
11
11
  default: "secondary"
@@ -12,10 +12,10 @@ export type CardHeaderIcon = string | (() => VNodeChild);
12
12
  * 消费方(含 `ListView.CardItem`)不得再自绘卡片外观(描边 / 圆角 / 阴影 / 底色),也不得在应用侧写这四类
13
13
  * 属性 —— 需要不同形态就用本件的维度(`variant` / `interactive` / `selected` / `disabled`),或提为骨架层待建件。
14
14
  *
15
- * ## 几何来源(技能市场卡片实测,逐项落 `--ui-*` 令牌)
15
+ * ## 几何(逐项落 `--ui-*` 令牌)
16
16
  *
17
- * 圆角 8(`--ui-radius-md`)、内距 20(`--ui-card-padding`,原型 `p-5`)、底 `--ui-base-100`、弱描边
18
- * `--ui-base-300`(原型 `border-border`)、悬浮转 `--ui-primary` 描边 + 主色 12% 阴影
17
+ * 圆角 8(`--ui-radius-md`)、内距 20(`--ui-card-padding`)、底 `--ui-base-100`、弱描边
18
+ * `--ui-base-300`、悬浮转 `--ui-primary` 描边 + 主色 12% 阴影
19
19
  * (`--ui-shadow-card-hover`)。
20
20
  *
21
21
  * 列表卡片项那套几何(最小高 144、状态胶囊、标签片…)属 `ListView.CardItem`,**不在本件** —— 通用卡片不该被
@@ -1,5 +1,4 @@
1
1
  import { type PropType, type SlotsType, type VNodeChild } from 'vue';
2
- import type { ControlSize } from '../control-size';
3
2
  export interface CheckboxOption {
4
3
  label: string;
5
4
  value: string | number;
@@ -8,8 +7,9 @@ export interface CheckboxOption {
8
7
  /**
9
8
  * 复选框(**自建**,不封装 farris)。
10
9
  *
11
- * 形态与 `Switch` / `Radio` 对齐(统一词表 `modelValue` / `onChange` / `disabled` / `size`,
12
- * 三档尺寸只覆盖 `--ui-checkbox-*` 令牌)。
10
+ * 形态与 `Switch` / `Radio` 对齐(统一词表 `modelValue` / `onChange` / `disabled`);
11
+ * **尺寸只有一条通道**:`size` 直接给像素数(不设 sm / md / lg 档),写进 `--ui-checkbox-size`,
12
+ * 勾字由 `calc(尺寸 - 4px)` 自己跟(见 `checkbox.tokens.css`)。不传就用令牌的 14。
13
13
  *
14
14
  * 实现要点:
15
15
  * - 真实 `<input type="checkbox">` 负责可访问性与键盘(Tab / Space),视觉由旁边的方块自绘;
@@ -19,7 +19,7 @@ export interface CheckboxOption {
19
19
  * 可交互元素上才算数(挂到根 `label` 上读屏与表单都取不到)。本件 `inheritAttrs: false`,
20
20
  * 不透传就会**静默丢掉** —— `Table` 的勾选列正是靠这条拿到 `aria-label`。
21
21
  * - **选中 / 半选填主色**(没有色彩角色维度):与 `Switch` 的选中轨道、`Table` 勾选列
22
- * (复用本件)以及 `@aihub/theme` 的「已选择背景取主色」三处同一口径。
22
+ * (复用本件)两处同一口径。
23
23
  * 要再引入中性面填充请做成 `tone` 的第二档,**不要**把默认改回深色;
24
24
  * - 半选(`indeterminate`)是**旁路态**:点击后由消费方自行决定落到 `checked` 还是 `unchecked`。
25
25
  * - **根 `label` 拦掉 `click` 冒泡**(与 `Switch` / `Radio` 同口径):行内叶控件常嵌在「整块可点」容器里
@@ -43,9 +43,10 @@ export declare const Checkbox: import("vue").DefineComponent<import("vue").Extra
43
43
  type: BooleanConstructor;
44
44
  default: boolean;
45
45
  };
46
+ /** 框体边长(px)。不传 = 令牌基准 14;要给别的尺寸就传一个数(勾字自动跟随) */
46
47
  size: {
47
- type: PropType<ControlSize>;
48
- default: string;
48
+ type: NumberConstructor;
49
+ default: undefined;
49
50
  };
50
51
  /** 自动聚焦 */
51
52
  autofocus: {
@@ -74,9 +75,10 @@ export declare const Checkbox: import("vue").DefineComponent<import("vue").Extra
74
75
  type: BooleanConstructor;
75
76
  default: boolean;
76
77
  };
78
+ /** 框体边长(px)。不传 = 令牌基准 14;要给别的尺寸就传一个数(勾字自动跟随) */
77
79
  size: {
78
- type: PropType<ControlSize>;
79
- default: string;
80
+ type: NumberConstructor;
81
+ default: undefined;
80
82
  };
81
83
  /** 自动聚焦 */
82
84
  autofocus: {
@@ -91,7 +93,7 @@ export declare const Checkbox: import("vue").DefineComponent<import("vue").Extra
91
93
  }>> & Readonly<{
92
94
  "onUpdate:modelValue"?: ((v: boolean) => any) | undefined;
93
95
  }>, {
94
- size: ControlSize;
96
+ size: number;
95
97
  disabled: boolean;
96
98
  onChange: (v: boolean) => void;
97
99
  autofocus: boolean;
@@ -116,9 +118,10 @@ export declare const CheckboxCompound: {
116
118
  type: BooleanConstructor;
117
119
  default: boolean;
118
120
  };
121
+ /** 框体边长(px)。不传 = 令牌基准 14;要给别的尺寸就传一个数(勾字自动跟随) */
119
122
  size: {
120
- type: PropType<ControlSize>;
121
- default: string;
123
+ type: NumberConstructor;
124
+ default: undefined;
122
125
  };
123
126
  /** 自动聚焦 */
124
127
  autofocus: {
@@ -135,7 +138,7 @@ export declare const CheckboxCompound: {
135
138
  }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
136
139
  'update:modelValue': (v: boolean) => true;
137
140
  }, import("vue").PublicProps, {
138
- size: ControlSize;
141
+ size: number;
139
142
  disabled: boolean;
140
143
  onChange: (v: boolean) => void;
141
144
  autofocus: boolean;
@@ -165,9 +168,10 @@ export declare const CheckboxCompound: {
165
168
  type: BooleanConstructor;
166
169
  default: boolean;
167
170
  };
171
+ /** 框体边长(px)。不传 = 令牌基准 14;要给别的尺寸就传一个数(勾字自动跟随) */
168
172
  size: {
169
- type: PropType<ControlSize>;
170
- default: string;
173
+ type: NumberConstructor;
174
+ default: undefined;
171
175
  };
172
176
  /** 自动聚焦 */
173
177
  autofocus: {
@@ -182,7 +186,7 @@ export declare const CheckboxCompound: {
182
186
  }>> & Readonly<{
183
187
  "onUpdate:modelValue"?: ((v: boolean) => any) | undefined;
184
188
  }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {
185
- size: ControlSize;
189
+ size: number;
186
190
  disabled: boolean;
187
191
  onChange: (v: boolean) => void;
188
192
  autofocus: boolean;
@@ -207,9 +211,10 @@ export declare const CheckboxCompound: {
207
211
  type: BooleanConstructor;
208
212
  default: boolean;
209
213
  };
214
+ /** 框体边长(px)。不传 = 令牌基准 14;要给别的尺寸就传一个数(勾字自动跟随) */
210
215
  size: {
211
- type: PropType<ControlSize>;
212
- default: string;
216
+ type: NumberConstructor;
217
+ default: undefined;
213
218
  };
214
219
  /** 自动聚焦 */
215
220
  autofocus: {
@@ -226,7 +231,7 @@ export declare const CheckboxCompound: {
226
231
  }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
227
232
  'update:modelValue': (v: boolean) => true;
228
233
  }, string, {
229
- size: ControlSize;
234
+ size: number;
230
235
  disabled: boolean;
231
236
  onChange: (v: boolean) => void;
232
237
  autofocus: boolean;
@@ -261,10 +266,10 @@ export declare const CheckboxCompound: {
261
266
  type: BooleanConstructor;
262
267
  default: boolean;
263
268
  };
264
- /** 尺寸档(透传给组内每一项) */
269
+ /** 框体边长(px,透传给组内每一项);不传 = 令牌基准 14 */
265
270
  size: {
266
- type: PropType<ControlSize>;
267
- default: string;
271
+ type: NumberConstructor;
272
+ default: undefined;
268
273
  };
269
274
  /** 值变更回调;参数为新的选中数组 */
270
275
  onChange: {
@@ -299,10 +304,10 @@ export declare const CheckboxCompound: {
299
304
  type: BooleanConstructor;
300
305
  default: boolean;
301
306
  };
302
- /** 尺寸档(透传给组内每一项) */
307
+ /** 框体边长(px,透传给组内每一项);不传 = 令牌基准 14 */
303
308
  size: {
304
- type: PropType<ControlSize>;
305
- default: string;
309
+ type: NumberConstructor;
310
+ default: undefined;
306
311
  };
307
312
  /** 值变更回调;参数为新的选中数组 */
308
313
  onChange: {
@@ -312,7 +317,7 @@ export declare const CheckboxCompound: {
312
317
  }>> & Readonly<{
313
318
  "onUpdate:modelValue"?: ((v: (string | number)[]) => any) | undefined;
314
319
  }>, {
315
- size: ControlSize;
320
+ size: number;
316
321
  vertical: boolean;
317
322
  disabled: boolean;
318
323
  onChange: (v: Array<string | number>) => void;
@@ -18,9 +18,10 @@ const Checkbox = /* @__PURE__ */ defineComponent({
18
18
  type: Boolean,
19
19
  default: false
20
20
  },
21
+ /** 框体边长(px)。不传 = 令牌基准 14;要给别的尺寸就传一个数(勾字自动跟随) */
21
22
  size: {
22
- type: String,
23
- default: "md"
23
+ type: Number,
24
+ default: void 0
24
25
  },
25
26
  /** 自动聚焦 */
26
27
  autofocus: {
@@ -66,12 +67,18 @@ const Checkbox = /* @__PURE__ */ defineComponent({
66
67
  if (el && el.checked !== !!props.modelValue) el.checked = !!props.modelValue;
67
68
  });
68
69
  };
70
+ const sizeStyle = computed(() => props.size === void 0 ? void 0 : {
71
+ "--ui-checkbox-size": `${props.size}px`
72
+ });
69
73
  return () => {
70
74
  const state = props.indeterminate ? "indeterminate" : props.modelValue ? "checked" : "unchecked";
71
75
  return createVNode("label", {
72
- "class": ["mh-checkbox", props.size === "md" ? "" : `mh-checkbox--${props.size}`, props.disabled ? "is-disabled" : "", attrs.class].filter(Boolean).join(" "),
76
+ "class": ["mh-checkbox", props.disabled ? "is-disabled" : "", attrs.class].filter(Boolean).join(" "),
73
77
  "data-inline-control": "true",
74
- "style": attrs.style,
78
+ "style": {
79
+ ...sizeStyle.value,
80
+ ...attrs.style
81
+ },
75
82
  "onClick": onRootClick
76
83
  }, [createVNode("input", mergeProps(inputAttrs.value, {
77
84
  "ref": inputRef,
@@ -84,10 +91,8 @@ const Checkbox = /* @__PURE__ */ defineComponent({
84
91
  }), null), createVNode("span", {
85
92
  "class": "mh-checkbox__box",
86
93
  "data-state": state
87
- }, [props.indeterminate ? createVNode("span", {
88
- "class": "mh-checkbox__dash"
89
- }, null) : createVNode(Icon, {
90
- "name": "check",
94
+ }, [createVNode(Icon, {
95
+ "name": props.indeterminate ? "minus" : "check",
91
96
  "class": "mh-checkbox__icon"
92
97
  }, null)]), slots.default ? createVNode("span", {
93
98
  "class": "mh-checkbox__label"
@@ -124,10 +129,10 @@ const CheckboxGroup = /* @__PURE__ */ defineComponent({
124
129
  type: Boolean,
125
130
  default: false
126
131
  },
127
- /** 尺寸档(透传给组内每一项) */
132
+ /** 框体边长(px,透传给组内每一项);不传 = 令牌基准 14 */
128
133
  size: {
129
- type: String,
130
- default: "md"
134
+ type: Number,
135
+ default: void 0
131
136
  },
132
137
  /** 值变更回调;参数为新的选中数组 */
133
138
  onChange: {