@apexhub/apex-ui-react 0.0.0-stage → 1.2.2
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/LICENSE +21 -0
- package/README.md +37 -2
- package/dist/en_US.d.ts +191 -0
- package/dist/index.cjs +40727 -0
- package/dist/index.d.ts +6873 -0
- package/dist/index.mjs +40711 -0
- package/dist/llm/alert.tokens.txt +44 -0
- package/dist/llm/alert.txt +167 -0
- package/dist/llm/apex-provider.txt +369 -0
- package/dist/llm/auto-complete.tokens.txt +77 -0
- package/dist/llm/auto-complete.txt +373 -0
- package/dist/llm/avatar.tokens.txt +38 -0
- package/dist/llm/avatar.txt +199 -0
- package/dist/llm/breadcrumb.tokens.txt +143 -0
- package/dist/llm/breadcrumb.txt +251 -0
- package/dist/llm/button.tokens.txt +470 -0
- package/dist/llm/button.txt +270 -0
- package/dist/llm/card.tokens.txt +29 -0
- package/dist/llm/card.txt +118 -0
- package/dist/llm/cascader.tokens.txt +261 -0
- package/dist/llm/cascader.txt +917 -0
- package/dist/llm/checkbox.tokens.txt +36 -0
- package/dist/llm/checkbox.txt +343 -0
- package/dist/llm/collapse.tokens.txt +84 -0
- package/dist/llm/collapse.txt +330 -0
- package/dist/llm/date-picker.tokens.txt +171 -0
- package/dist/llm/date-picker.txt +428 -0
- package/dist/llm/divider.tokens.txt +22 -0
- package/dist/llm/divider.txt +161 -0
- package/dist/llm/drawer.tokens.txt +71 -0
- package/dist/llm/drawer.txt +369 -0
- package/dist/llm/dropdown.tokens.txt +59 -0
- package/dist/llm/dropdown.txt +420 -0
- package/dist/llm/form.tokens.txt +28 -0
- package/dist/llm/form.txt +341 -0
- package/dist/llm/grid.txt +419 -0
- package/dist/llm/image.tokens.txt +28 -0
- package/dist/llm/image.txt +428 -0
- package/dist/llm/input-number.tokens.txt +159 -0
- package/dist/llm/input-number.txt +491 -0
- package/dist/llm/input.tokens.txt +136 -0
- package/dist/llm/input.txt +424 -0
- package/dist/llm/layout.tokens.txt +29 -0
- package/dist/llm/layout.txt +298 -0
- package/dist/llm/menu.tokens.txt +100 -0
- package/dist/llm/menu.txt +687 -0
- package/dist/llm/message.tokens.txt +25 -0
- package/dist/llm/message.txt +301 -0
- package/dist/llm/modal.tokens.txt +96 -0
- package/dist/llm/modal.txt +584 -0
- package/dist/llm/notification.tokens.txt +79 -0
- package/dist/llm/notification.txt +383 -0
- package/dist/llm/pagination.tokens.txt +35 -0
- package/dist/llm/pagination.txt +217 -0
- package/dist/llm/popover.tokens.txt +18 -0
- package/dist/llm/popover.txt +233 -0
- package/dist/llm/progress.tokens.txt +83 -0
- package/dist/llm/progress.txt +279 -0
- package/dist/llm/radio.tokens.txt +26 -0
- package/dist/llm/radio.txt +385 -0
- package/dist/llm/rate.tokens.txt +20 -0
- package/dist/llm/rate.txt +241 -0
- package/dist/llm/select.tokens.txt +160 -0
- package/dist/llm/select.txt +831 -0
- package/dist/llm/skeleton.tokens.txt +15 -0
- package/dist/llm/skeleton.txt +275 -0
- package/dist/llm/spin.tokens.txt +21 -0
- package/dist/llm/spin.txt +294 -0
- package/dist/llm/steps.tokens.txt +30 -0
- package/dist/llm/steps.txt +300 -0
- package/dist/llm/switch.tokens.txt +38 -0
- package/dist/llm/switch.txt +216 -0
- package/dist/llm/table.tokens.txt +94 -0
- package/dist/llm/table.txt +1049 -0
- package/dist/llm/tabs.tokens.txt +78 -0
- package/dist/llm/tabs.txt +306 -0
- package/dist/llm/tag.tokens.txt +75 -0
- package/dist/llm/tag.txt +304 -0
- package/dist/llm/tooltip.tokens.txt +22 -0
- package/dist/llm/tooltip.txt +304 -0
- package/dist/llm/tree-select.tokens.txt +175 -0
- package/dist/llm/tree-select.txt +772 -0
- package/dist/llm/tree.tokens.txt +34 -0
- package/dist/llm/tree.txt +501 -0
- package/dist/llm/typography.tokens.txt +60 -0
- package/dist/llm/typography.txt +413 -0
- package/dist/llm/upload.tokens.txt +205 -0
- package/dist/llm/upload.txt +708 -0
- package/dist/llms-full.txt +16826 -0
- package/dist/llms-theme.txt +32 -0
- package/dist/llms.txt +59 -0
- package/dist/locale/en_US.cjs +160 -0
- package/dist/locale/en_US.d.ts +4 -0
- package/dist/locale/en_US.mjs +161 -0
- package/dist/locale/zh_CN.cjs +160 -0
- package/dist/locale/zh_CN.d.ts +4 -0
- package/dist/locale/zh_CN.mjs +161 -0
- package/dist/style.css +20095 -0
- package/dist/zh_CN.d.ts +191 -0
- package/llms-full.txt +16826 -0
- package/llms-theme.txt +32 -0
- package/llms.txt +59 -0
- package/package.json +118 -3
- package/src/alert/llm.txt +167 -0
- package/src/alert/tokens.txt +44 -0
- package/src/apex-provider/llm.txt +369 -0
- package/src/auto-complete/llm.txt +373 -0
- package/src/auto-complete/tokens.txt +77 -0
- package/src/avatar/llm.txt +199 -0
- package/src/avatar/tokens.txt +38 -0
- package/src/breadcrumb/llm.txt +251 -0
- package/src/breadcrumb/tokens.txt +143 -0
- package/src/button/llm.txt +270 -0
- package/src/button/tokens.txt +470 -0
- package/src/card/llm.txt +118 -0
- package/src/card/tokens.txt +29 -0
- package/src/cascader/llm.txt +917 -0
- package/src/cascader/tokens.txt +261 -0
- package/src/checkbox/llm.txt +343 -0
- package/src/checkbox/tokens.txt +36 -0
- package/src/collapse/llm.txt +330 -0
- package/src/collapse/tokens.txt +84 -0
- package/src/date-picker/llm.txt +428 -0
- package/src/date-picker/tokens.txt +171 -0
- package/src/divider/llm.txt +161 -0
- package/src/divider/tokens.txt +22 -0
- package/src/drawer/llm.txt +369 -0
- package/src/drawer/tokens.txt +71 -0
- package/src/dropdown/llm.txt +420 -0
- package/src/dropdown/tokens.txt +59 -0
- package/src/form/llm.txt +341 -0
- package/src/form/tokens.txt +28 -0
- package/src/grid/llm.txt +419 -0
- package/src/image/llm.txt +428 -0
- package/src/image/tokens.txt +28 -0
- package/src/input/llm.txt +424 -0
- package/src/input/tokens.txt +136 -0
- package/src/input-number/llm.txt +491 -0
- package/src/input-number/tokens.txt +159 -0
- package/src/layout/llm.txt +298 -0
- package/src/layout/tokens.txt +29 -0
- package/src/menu/llm.txt +687 -0
- package/src/menu/tokens.txt +100 -0
- package/src/message/llm.txt +301 -0
- package/src/message/tokens.txt +25 -0
- package/src/modal/llm.txt +584 -0
- package/src/modal/tokens.txt +96 -0
- package/src/notification/llm.txt +383 -0
- package/src/notification/tokens.txt +79 -0
- package/src/pagination/llm.txt +217 -0
- package/src/pagination/tokens.txt +35 -0
- package/src/popover/llm.txt +233 -0
- package/src/popover/tokens.txt +18 -0
- package/src/progress/llm.txt +279 -0
- package/src/progress/tokens.txt +83 -0
- package/src/radio/llm.txt +385 -0
- package/src/radio/tokens.txt +26 -0
- package/src/rate/llm.txt +241 -0
- package/src/rate/tokens.txt +20 -0
- package/src/select/llm.txt +831 -0
- package/src/select/tokens.txt +160 -0
- package/src/skeleton/llm.txt +275 -0
- package/src/skeleton/tokens.txt +15 -0
- package/src/spin/llm.txt +294 -0
- package/src/spin/tokens.txt +21 -0
- package/src/steps/llm.txt +300 -0
- package/src/steps/tokens.txt +30 -0
- package/src/switch/llm.txt +216 -0
- package/src/switch/tokens.txt +38 -0
- package/src/table/llm.txt +1049 -0
- package/src/table/tokens.txt +94 -0
- package/src/tabs/llm.txt +306 -0
- package/src/tabs/tokens.txt +78 -0
- package/src/tag/llm.txt +304 -0
- package/src/tag/tokens.txt +75 -0
- package/src/tooltip/llm.txt +304 -0
- package/src/tooltip/tokens.txt +22 -0
- package/src/tree/llm.txt +501 -0
- package/src/tree/tokens.txt +34 -0
- package/src/tree-select/llm.txt +772 -0
- package/src/tree-select/tokens.txt +175 -0
- package/src/typography/llm.txt +413 -0
- package/src/typography/tokens.txt +60 -0
- package/src/upload/llm.txt +708 -0
- package/src/upload/tokens.txt +205 -0
|
@@ -0,0 +1,584 @@
|
|
|
1
|
+
# Modal
|
|
2
|
+
|
|
3
|
+
> Modal:需要用户阅读并确认、取消或提交,且应暂时阻断当前页面操作时。
|
|
4
|
+
|
|
5
|
+
包:`@apexhub/apex-ui-react`;版本:`1.2.2`(当前源码快照,发布状态以安装包版本为准)。
|
|
6
|
+
|
|
7
|
+
公开导出:`Modal`。
|
|
8
|
+
|
|
9
|
+
以下 API 属于 Apex UI;不要据 antd 的同名组件推断额外属性或默认值。默认值列的空缺表示未声明,不代表 `false`。
|
|
10
|
+
|
|
11
|
+
## 快速开始
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { Button, Modal } from '@apexhub/apex-ui-react'
|
|
15
|
+
|
|
16
|
+
import { useState } from 'react'
|
|
17
|
+
|
|
18
|
+
import '@apexhub/apex-ui-react/style.css'
|
|
19
|
+
|
|
20
|
+
export default () => {
|
|
21
|
+
const [open, setOpen] = useState(false)
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<>
|
|
25
|
+
<Button type="primary" onClick={() => setOpen(true)}>
|
|
26
|
+
打开 Modal
|
|
27
|
+
</Button>
|
|
28
|
+
<Modal
|
|
29
|
+
open={open}
|
|
30
|
+
title="基础 Modal"
|
|
31
|
+
onCancel={() => setOpen(false)}
|
|
32
|
+
onOk={() => setOpen(false)}
|
|
33
|
+
>
|
|
34
|
+
这里是对话框内容。
|
|
35
|
+
</Modal>
|
|
36
|
+
</>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## 何时使用
|
|
42
|
+
|
|
43
|
+
- 需要用户阅读并确认、取消或提交,且应暂时阻断当前页面操作时。
|
|
44
|
+
- 表单、详情等较重内容需要独立浮层承载,而非内联展开时。
|
|
45
|
+
- 若只需角落短暂提示、不打断操作,请使用 Notification 或 Message,而不是 Modal。
|
|
46
|
+
|
|
47
|
+
## API
|
|
48
|
+
|
|
49
|
+
仅使用类型定义支持的属性;原生属性、ref 目标和事件签名因组件而异。关联类型用于解释字段结构;只有「导出类型」中的名称可从包根导入。
|
|
50
|
+
|
|
51
|
+
### Modal
|
|
52
|
+
|
|
53
|
+
| 属性 | 说明 | 类型 | 必填 | 默认值 |
|
|
54
|
+
| --- | --- | --- | --- | --- |
|
|
55
|
+
| ref | 转发至面板(Content)元素的 ref | `React.Ref<HTMLDivElement>` | 否 | — |
|
|
56
|
+
| cancelButtonProps | Cancel 按钮的 props | `ButtonProps` | 否 | — |
|
|
57
|
+
| cancelText | Cancel 按钮文案 | `React.ReactNode` | 否 | `'Cancel'` |
|
|
58
|
+
| centered | 是否垂直居中 | `boolean` | 否 | `false` |
|
|
59
|
+
| size | 预设宽度(`sm` / `md` / `lg` / `xl`)。<br>footer 有无均复用 action 尺寸作用域;`lg` 与 `md` 均挂 `.apex-action-md-modal`。 | `"sm" \| "md" \| "lg" \| "xl"` | 否 | `'md'` |
|
|
60
|
+
| children | 主体内容 | `React.ReactNode` | 否 | — |
|
|
61
|
+
| classNames | 各语义节点的 className,支持对象或函数 | `Partial<Record<SemanticDOM, string>> \| ((info: { props: ModalProps }) => Partial<Record<SemanticDOM, string>>)` | 否 | — |
|
|
62
|
+
| closable | 是否显示右上角关闭按钮 | `boolean \| ClosableType` | 否 | `true` |
|
|
63
|
+
| closeIcon | 自定义关闭图标;设为 `null` 或 `false` 时隐藏关闭按钮 | `React.ReactNode` | 否 | — |
|
|
64
|
+
| footer | 底部区域;`footer={null}` 不渲染默认 OK/Cancel,面板改用 info 尺寸 token(更大底边距)。<br>有 footer(默认 OK/Cancel 或消费方传入)时用 action 尺寸 token。<br>函数形式可复用 `OkBtn` / `CancelBtn` | `React.ReactNode \| (( originNode: React.ReactNode, extra: { OkBtn: React.FC; CancelBtn: React.FC }, ) => React.ReactNode)` | 否 | — |
|
|
65
|
+
| keyboard | 是否支持 Esc 关闭 | `boolean` | 否 | `true` |
|
|
66
|
+
| mask | 蒙层效果(`mask.closable`) | `boolean \| { enabled?: boolean; blur?: boolean; closable?: boolean }` | 否 | `true` |
|
|
67
|
+
| modalRender | 自定义面板内容渲染 | `(node: React.ReactNode) => React.ReactNode` | 否 | — |
|
|
68
|
+
| okButtonProps | OK 按钮的 props | `ButtonProps` | 否 | — |
|
|
69
|
+
| okText | OK 按钮文案 | `React.ReactNode` | 否 | `'OK'` |
|
|
70
|
+
| okType | OK 按钮类型 | `"default" \| "primary" \| "danger" \| "text" \| "link"` | 否 | `'primary'` |
|
|
71
|
+
| className | 面板(Content)的 className,与内置 `apex-modal__container` 合并 | `string` | 否 | — |
|
|
72
|
+
| style | 面板(Content)的内联样式。<br>React 不支持内联 `!important`;需覆盖样式优先级时请用 `className` / `classNames.container` | `React.CSSProperties` | 否 | — |
|
|
73
|
+
| styles | 各语义节点的内联样式,支持对象或函数 | `Partial<Record<SemanticDOM, React.CSSProperties>> \| ((info: { props: ModalProps }) => Partial<Record<SemanticDOM, React.CSSProperties>>)` | 否 | — |
|
|
74
|
+
| title | 标题。`undefined`(缺省)且无关闭钮时自动补 sr-only 标题以满足无障碍;<br>`null` 时消费方在 `children` 中自行提供标题(如 `Modal.confirm`),不渲染标题区且不兜底 sr-only,须配合 `titleId` 关联无障碍名称。 | `React.ReactNode` | 否 | — |
|
|
75
|
+
| open | 是否显示弹窗(受控;必填) | `boolean` | 是 | — |
|
|
76
|
+
| width | 自定义宽度(px 数字或 CSS 长度);设置后覆盖 `size` 对应的宽度。<br>面板高度按内容自然增长,不受宽度对应尺寸档的最小高度约束;超出视口时由外层容器整体滚动。<br>未显式传 `size` 时,数字或 px 宽度仍按 420 / 720 / 1000 断点匹配尺寸样式。<br>兼容:`size` 省略时 `sm` / `md` 字符串仍按 `size` 处理。 | `string \| number` | 否 | — |
|
|
77
|
+
| wrapClassName | 含蒙层的容器 className | `string` | 否 | — |
|
|
78
|
+
| onCancel | 点击蒙层、右上角关闭或 Cancel 时触发 | `(e: React.MouseEvent<HTMLElement> \| React.KeyboardEvent<HTMLElement>) => void` | 否 | — |
|
|
79
|
+
| onOk | 点击 OK 时触发 | `(e: React.MouseEvent<HTMLElement>) => void` | 否 | — |
|
|
80
|
+
| afterOpenChange | 开关动画结束后的回调。<br>由面板 `onAnimationEnd`(`apex-modal-zoom-*`)触发;footer 按钮直接关闭时由父组件 `setOpen(false)` 驱动,仍会在退出动画结束后回调。 | `(open: boolean) => void` | 否 | — |
|
|
81
|
+
|
|
82
|
+
### SemanticDOM
|
|
83
|
+
|
|
84
|
+
`classNames` / `styles` 的语义结构键
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
type SemanticDOM = | 'root'
|
|
88
|
+
| 'wrapper'
|
|
89
|
+
| 'mask'
|
|
90
|
+
| 'container'
|
|
91
|
+
| 'header'
|
|
92
|
+
| 'title'
|
|
93
|
+
| 'close'
|
|
94
|
+
| 'body'
|
|
95
|
+
| 'footer'
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### ClosableType
|
|
99
|
+
|
|
100
|
+
`closable` 为对象时的配置
|
|
101
|
+
|
|
102
|
+
| 属性 | 说明 | 类型 | 必填 | 默认值 |
|
|
103
|
+
| --- | --- | --- | --- | --- |
|
|
104
|
+
| disabled | — | `boolean` | 否 | — |
|
|
105
|
+
|
|
106
|
+
### ModalFuncType
|
|
107
|
+
|
|
108
|
+
命令式确认弹窗的语义类型(决定默认图标与按钮组合)
|
|
109
|
+
|
|
110
|
+
```typescript
|
|
111
|
+
type ModalFuncType = 'info' | 'success' | 'error' | 'warning' | 'confirm'
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### ModalFuncCallback
|
|
115
|
+
|
|
116
|
+
`onOk` / `onCancel` 回调签名。
|
|
117
|
+
|
|
118
|
+
```typescript
|
|
119
|
+
type ModalFuncCallback = (close: () => void) => void | Promise<unknown>
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### ModalFuncProps
|
|
123
|
+
|
|
124
|
+
`Modal.method()` 的配置对象。
|
|
125
|
+
|
|
126
|
+
| 属性 | 说明 | 类型 | 必填 | 默认值 |
|
|
127
|
+
| --- | --- | --- | --- | --- |
|
|
128
|
+
| type | 语义类型(内部使用,由具体方法注入) | `"info" \| "success" \| "error" \| "warning" \| "confirm"` | 否 | — |
|
|
129
|
+
| okCancel | 是否显示取消按钮(内部使用:`confirm` 默认 `true`,其余默认 `false`) | `boolean` | 否 | — |
|
|
130
|
+
| title | 标题 | `React.ReactNode` | 否 | — |
|
|
131
|
+
| content | 内容 | `React.ReactNode` | 否 | — |
|
|
132
|
+
| icon | 自定义图标;未传时按 `type` 渲染默认语义图标。<br>传 `null` / `false` 不渲染图标。 | `React.ReactNode` | 否 | — |
|
|
133
|
+
| closable | 右上角是否显示关闭(×)按钮 | `boolean \| ClosableType` | 否 | `true` |
|
|
134
|
+
| closeIcon | 自定义关闭图标 | `React.ReactNode` | 否 | — |
|
|
135
|
+
| centered | 垂直居中 | `boolean` | 否 | `false` |
|
|
136
|
+
| width | 对话框宽度 | `string \| number` | 否 | `'sm'(420px)` |
|
|
137
|
+
| keyboard | 是否支持按 Esc 关闭 | `boolean` | 否 | `true` |
|
|
138
|
+
| mask | 遮罩 | `ModalProps['mask']` | 否 | `true` |
|
|
139
|
+
| okText | 确认按钮文案 | `React.ReactNode` | 否 | `'OK'` |
|
|
140
|
+
| cancelText | 取消按钮文案(仅 `confirm`) | `React.ReactNode` | 否 | `'Cancel'` |
|
|
141
|
+
| okType | 确认按钮 `Button` type | `"default" \| "primary" \| "danger" \| "text" \| "link"` | 否 | `'primary'` |
|
|
142
|
+
| okButtonProps | 确认按钮 Props | `ButtonProps` | 否 | — |
|
|
143
|
+
| cancelButtonProps | 取消按钮 Props | `ButtonProps` | 否 | — |
|
|
144
|
+
| autoFocusButton | 指定自动聚焦的按钮;`null` 表示都不聚焦 | `"ok" \| "cancel" \| null` | 否 | `'ok'` |
|
|
145
|
+
| wrapClassName | 容器 className | `string` | 否 | — |
|
|
146
|
+
| className | 对话框面板 className | `string` | 否 | — |
|
|
147
|
+
| style | 对话框面板内联样式 | `React.CSSProperties` | 否 | — |
|
|
148
|
+
| styles | 语义分段内联样式 | `ModalProps['styles']` | 否 | — |
|
|
149
|
+
| classNames | 语义分段 className | `ModalProps['classNames']` | 否 | — |
|
|
150
|
+
| getContainer | 已弃用:已废弃,浮层统一挂载 overlay-root<br>指定挂载节点。`false` 表示挂载在当前 DOM 位置。 | `HTMLElement \| (() => HTMLElement) \| false` | 否 | `overlay-root` |
|
|
151
|
+
| afterClose | 完全关闭后触发 | `() => void` | 否 | — |
|
|
152
|
+
| onOk | 点击确认回调。入参为关闭函数;返回 Promise 时 `resolve` 关闭、`reject` 阻止关闭。 | `ModalFuncCallback` | 否 | — |
|
|
153
|
+
| onCancel | 点击取消回调(含 Esc / 遮罩 / 关闭钮)。入参为关闭函数;返回 Promise 时<br>`resolve` 关闭、`reject` 阻止关闭。 | `ModalFuncCallback` | 否 | — |
|
|
154
|
+
|
|
155
|
+
### ModalFuncHandle
|
|
156
|
+
|
|
157
|
+
`Modal.method()` 的返回句柄,可用于更新与关闭对话框。
|
|
158
|
+
|
|
159
|
+
| 属性 | 说明 | 类型 | 必填 | 默认值 |
|
|
160
|
+
| --- | --- | --- | --- | --- |
|
|
161
|
+
| destroy | 关闭并销毁当前对话框 | `() => void` | 是 | — |
|
|
162
|
+
| update | 更新当前对话框配置;支持传入函数基于上一份配置增量更新 | `(configUpdate: ModalFuncProps \| ((prev: ModalFuncProps) => ModalFuncProps)) => void` | 是 | — |
|
|
163
|
+
|
|
164
|
+
### ModalHookFuncHandle
|
|
165
|
+
|
|
166
|
+
继承:`ModalFuncHandle`;本节列出新增或重声明字段。
|
|
167
|
+
|
|
168
|
+
`Modal.useModal()` 返回的句柄;在 `ModalFuncHandle` 基础上支持 `then`(await)。
|
|
169
|
+
|
|
170
|
+
| 属性 | 说明 | 类型 | 必填 | 默认值 |
|
|
171
|
+
| --- | --- | --- | --- | --- |
|
|
172
|
+
| then | Promise 链式调用:点击 OK 时 resolve `true`,点击 Cancel / Esc / 遮罩时 resolve `false`。 | `<T = boolean>( onfulfilled?: (confirmed: boolean) => T \| PromiseLike<T>, onrejected?: (reason: unknown) => T \| PromiseLike<T>, ) => Promise<T>` | 是 | — |
|
|
173
|
+
|
|
174
|
+
### ModalFunc
|
|
175
|
+
|
|
176
|
+
单个命令式方法签名
|
|
177
|
+
|
|
178
|
+
```typescript
|
|
179
|
+
type ModalFunc = (config: ModalFuncProps) => ModalFuncHandle
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### ModalHookFunc
|
|
183
|
+
|
|
184
|
+
`useModal` 暴露的单个方法签名(返回支持 `then` 的句柄)
|
|
185
|
+
|
|
186
|
+
```typescript
|
|
187
|
+
type ModalHookFunc = (config: ModalFuncProps) => ModalHookFuncHandle
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### ModalStaticFunctions
|
|
191
|
+
|
|
192
|
+
挂载在 `Modal` 上的静态方法集合
|
|
193
|
+
|
|
194
|
+
| 属性 | 说明 | 类型 | 必填 | 默认值 |
|
|
195
|
+
| --- | --- | --- | --- | --- |
|
|
196
|
+
| info | — | `ModalFunc` | 是 | — |
|
|
197
|
+
| success | — | `ModalFunc` | 是 | — |
|
|
198
|
+
| error | — | `ModalFunc` | 是 | — |
|
|
199
|
+
| warning | — | `ModalFunc` | 是 | — |
|
|
200
|
+
| confirm | — | `ModalFunc` | 是 | — |
|
|
201
|
+
|
|
202
|
+
### ModalHookApi
|
|
203
|
+
|
|
204
|
+
`Modal.useModal()` 返回的 `modal` 对象
|
|
205
|
+
|
|
206
|
+
| 属性 | 说明 | 类型 | 必填 | 默认值 |
|
|
207
|
+
| --- | --- | --- | --- | --- |
|
|
208
|
+
| info | — | `ModalHookFunc` | 是 | — |
|
|
209
|
+
| success | — | `ModalHookFunc` | 是 | — |
|
|
210
|
+
| error | — | `ModalHookFunc` | 是 | — |
|
|
211
|
+
| warning | — | `ModalHookFunc` | 是 | — |
|
|
212
|
+
| confirm | — | `ModalHookFunc` | 是 | — |
|
|
213
|
+
|
|
214
|
+
### ConfirmDialogProps
|
|
215
|
+
|
|
216
|
+
继承:`Omit<ModalFuncProps, 'getContainer' | 'afterClose'>`;本节列出新增或重声明字段。
|
|
217
|
+
|
|
218
|
+
`ConfirmDialog` 的内部 Props(命令式与 hooks 路径共用)。
|
|
219
|
+
|
|
220
|
+
| 属性 | 说明 | 类型 | 必填 | 默认值 |
|
|
221
|
+
| --- | --- | --- | --- | --- |
|
|
222
|
+
| open | 是否可见(由控制器 / HookModal 驱动) | `boolean` | 是 | — |
|
|
223
|
+
| onClose | 关闭回调:`confirmed` 标记是否点击 OK(用于 hooks `then` 解析) | `(confirmed: boolean) => void` | 是 | — |
|
|
224
|
+
| afterClose | 退出动画结束后触发(卸载 / 移除节点) | `() => void` | 否 | — |
|
|
225
|
+
|
|
226
|
+
其他组件的类型不在此展开:`ButtonProps` 见 `../button/llm.txt`。
|
|
227
|
+
|
|
228
|
+
### 导出类型
|
|
229
|
+
|
|
230
|
+
另可从 `@apexhub/apex-ui-react` 导入:`ClosableType`、`ConfirmDialogProps`、`ModalFunc`、`ModalFuncCallback`、`ModalFuncHandle`、`ModalFuncProps`、`ModalFuncType`、`ModalHookApi`、`ModalHookFunc`、`ModalHookFuncHandle`、`ModalProps`、`ModalStaticFunctions`、`SemanticDOM`(与上文子类型配合使用)。
|
|
231
|
+
|
|
232
|
+
## 代码演示
|
|
233
|
+
|
|
234
|
+
### 居中显示
|
|
235
|
+
|
|
236
|
+
通过 `centered` 让对话框在视口中垂直居中。
|
|
237
|
+
|
|
238
|
+
```tsx
|
|
239
|
+
import { Button, Modal } from '@apexhub/apex-ui-react'
|
|
240
|
+
|
|
241
|
+
import { useState } from 'react'
|
|
242
|
+
|
|
243
|
+
export default () => {
|
|
244
|
+
const [open, setOpen] = useState(false)
|
|
245
|
+
|
|
246
|
+
return (
|
|
247
|
+
<>
|
|
248
|
+
<Button onClick={() => setOpen(true)}>居中显示</Button>
|
|
249
|
+
<Modal
|
|
250
|
+
centered
|
|
251
|
+
open={open}
|
|
252
|
+
title="居中 Modal"
|
|
253
|
+
onCancel={() => setOpen(false)}
|
|
254
|
+
onOk={() => setOpen(false)}
|
|
255
|
+
>
|
|
256
|
+
对话框会在视口中垂直居中展示。
|
|
257
|
+
</Modal>
|
|
258
|
+
</>
|
|
259
|
+
)
|
|
260
|
+
}
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### 尺寸与宽度
|
|
264
|
+
|
|
265
|
+
`size` 对应三档宽度:`sm` 420px、`md` 720px(默认)、`xl` 1000px;`lg` 为 720px 的兼容别名。传入 `width`(数字或 CSS 长度)时会覆盖预设宽度。
|
|
266
|
+
|
|
267
|
+
```tsx
|
|
268
|
+
import { Button, Modal } from '@apexhub/apex-ui-react'
|
|
269
|
+
|
|
270
|
+
import { useState } from 'react'
|
|
271
|
+
|
|
272
|
+
export default () => {
|
|
273
|
+
const [kind, setKind] = useState<'sm' | 'md' | 'xl' | 'custom' | null>(null)
|
|
274
|
+
|
|
275
|
+
return (
|
|
276
|
+
<>
|
|
277
|
+
<div style={{ display: 'flex', gap: 8, flexWrap: 'wrap' }}>
|
|
278
|
+
<Button onClick={() => setKind('sm')}>sm(420px)</Button>
|
|
279
|
+
<Button onClick={() => setKind('md')}>md(720px)</Button>
|
|
280
|
+
<Button onClick={() => setKind('xl')}>xl(1000px)</Button>
|
|
281
|
+
<Button onClick={() => setKind('custom')}>自定义 width</Button>
|
|
282
|
+
</div>
|
|
283
|
+
<Modal
|
|
284
|
+
open={kind === 'sm'}
|
|
285
|
+
size="sm"
|
|
286
|
+
title="小尺寸"
|
|
287
|
+
onCancel={() => setKind(null)}
|
|
288
|
+
onOk={() => setKind(null)}
|
|
289
|
+
>
|
|
290
|
+
使用 size="sm"。
|
|
291
|
+
</Modal>
|
|
292
|
+
<Modal
|
|
293
|
+
open={kind === 'md'}
|
|
294
|
+
size="md"
|
|
295
|
+
title="中尺寸(默认)"
|
|
296
|
+
onCancel={() => setKind(null)}
|
|
297
|
+
onOk={() => setKind(null)}
|
|
298
|
+
>
|
|
299
|
+
使用 size="md"。
|
|
300
|
+
</Modal>
|
|
301
|
+
<Modal
|
|
302
|
+
open={kind === 'xl'}
|
|
303
|
+
size="xl"
|
|
304
|
+
title="大尺寸"
|
|
305
|
+
onCancel={() => setKind(null)}
|
|
306
|
+
onOk={() => setKind(null)}
|
|
307
|
+
>
|
|
308
|
+
使用 size="xl"。
|
|
309
|
+
</Modal>
|
|
310
|
+
<Modal
|
|
311
|
+
open={kind === 'custom'}
|
|
312
|
+
width={480}
|
|
313
|
+
title="自定义宽度"
|
|
314
|
+
onCancel={() => setKind(null)}
|
|
315
|
+
onOk={() => setKind(null)}
|
|
316
|
+
>
|
|
317
|
+
使用 width={480} 覆盖 size 预设。
|
|
318
|
+
</Modal>
|
|
319
|
+
</>
|
|
320
|
+
)
|
|
321
|
+
}
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
### 关闭与遮罩
|
|
325
|
+
|
|
326
|
+
可配置关闭按钮、Esc 关闭和遮罩点击关闭行为。
|
|
327
|
+
|
|
328
|
+
```tsx
|
|
329
|
+
import { Button, Modal } from '@apexhub/apex-ui-react'
|
|
330
|
+
|
|
331
|
+
import { useState } from 'react'
|
|
332
|
+
|
|
333
|
+
export default () => {
|
|
334
|
+
const [open, setOpen] = useState(false)
|
|
335
|
+
|
|
336
|
+
return (
|
|
337
|
+
<>
|
|
338
|
+
<Button onClick={() => setOpen(true)}>关闭与遮罩</Button>
|
|
339
|
+
<Modal
|
|
340
|
+
open={open}
|
|
341
|
+
title="不可点击遮罩关闭"
|
|
342
|
+
mask={{ closable: false }}
|
|
343
|
+
keyboard={false}
|
|
344
|
+
closable={{ disabled: false }}
|
|
345
|
+
onCancel={() => setOpen(false)}
|
|
346
|
+
onOk={() => setOpen(false)}
|
|
347
|
+
>
|
|
348
|
+
该示例禁用了 Esc 和遮罩点击关闭,仍可通过关闭按钮、取消或确认关闭。
|
|
349
|
+
</Modal>
|
|
350
|
+
</>
|
|
351
|
+
)
|
|
352
|
+
}
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
### 自定义页脚
|
|
356
|
+
|
|
357
|
+
`footer` 设为 `null` 可隐藏默认按钮,面板同时改用 info 内边距;函数形式可复用默认的确认与取消按钮。
|
|
358
|
+
|
|
359
|
+
```tsx
|
|
360
|
+
import { Button, Modal } from '@apexhub/apex-ui-react'
|
|
361
|
+
|
|
362
|
+
import { useState } from 'react'
|
|
363
|
+
|
|
364
|
+
export default () => {
|
|
365
|
+
const [kind, setKind] = useState<'none' | 'custom' | null>(null)
|
|
366
|
+
|
|
367
|
+
return (
|
|
368
|
+
<>
|
|
369
|
+
<div style={{ display: 'flex', gap: 8, flexWrap: 'wrap' }}>
|
|
370
|
+
<Button onClick={() => setKind('none')}>隐藏页脚</Button>
|
|
371
|
+
<Button onClick={() => setKind('custom')}>自定义页脚</Button>
|
|
372
|
+
</div>
|
|
373
|
+
<Modal open={kind === 'none'} title="无页脚" footer={null} onCancel={() => setKind(null)}>
|
|
374
|
+
适合只展示内容或由正文区域自行组织操作。
|
|
375
|
+
</Modal>
|
|
376
|
+
<Modal
|
|
377
|
+
open={kind === 'custom'}
|
|
378
|
+
title="自定义页脚"
|
|
379
|
+
footer={(_originNode, { OkBtn, CancelBtn }) => (
|
|
380
|
+
<div style={{ display: 'flex', gap: 8, justifyContent: 'flex-end', width: '100%' }}>
|
|
381
|
+
<CancelBtn />
|
|
382
|
+
<Button onClick={() => setKind(null)}>稍后处理</Button>
|
|
383
|
+
<OkBtn />
|
|
384
|
+
</div>
|
|
385
|
+
)}
|
|
386
|
+
onCancel={() => setKind(null)}
|
|
387
|
+
onOk={() => setKind(null)}
|
|
388
|
+
>
|
|
389
|
+
函数形式可以复用默认确认与取消按钮。
|
|
390
|
+
</Modal>
|
|
391
|
+
</>
|
|
392
|
+
)
|
|
393
|
+
}
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
### 自定义渲染
|
|
397
|
+
|
|
398
|
+
通过 `modalRender` 包裹默认内容节点,适合接入额外容器或拖拽能力。
|
|
399
|
+
|
|
400
|
+
```tsx
|
|
401
|
+
import { Button, Modal } from '@apexhub/apex-ui-react'
|
|
402
|
+
|
|
403
|
+
import { useState } from 'react'
|
|
404
|
+
|
|
405
|
+
export default () => {
|
|
406
|
+
const [open, setOpen] = useState(false)
|
|
407
|
+
|
|
408
|
+
return (
|
|
409
|
+
<>
|
|
410
|
+
<Button onClick={() => setOpen(true)}>自定义渲染</Button>
|
|
411
|
+
<Modal
|
|
412
|
+
open={open}
|
|
413
|
+
title="自定义渲染"
|
|
414
|
+
modalRender={(node) => <div data-demo="modal-shell">{node}</div>}
|
|
415
|
+
onCancel={() => setOpen(false)}
|
|
416
|
+
onOk={() => setOpen(false)}
|
|
417
|
+
>
|
|
418
|
+
使用 modalRender 包裹默认面板节点。
|
|
419
|
+
</Modal>
|
|
420
|
+
</>
|
|
421
|
+
)
|
|
422
|
+
}
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
### 自定义语义结构
|
|
426
|
+
|
|
427
|
+
通过 `classNames` 和 `styles` 定制各语义节点样式。
|
|
428
|
+
|
|
429
|
+
```tsx
|
|
430
|
+
import type { ModalProps } from '@apexhub/apex-ui-react'
|
|
431
|
+
|
|
432
|
+
import { Button, Modal } from '@apexhub/apex-ui-react'
|
|
433
|
+
|
|
434
|
+
import { useState } from 'react'
|
|
435
|
+
|
|
436
|
+
const styles: ModalProps['styles'] = {
|
|
437
|
+
body: {
|
|
438
|
+
minHeight: 80,
|
|
439
|
+
},
|
|
440
|
+
footer: {
|
|
441
|
+
justifyContent: 'space-between',
|
|
442
|
+
},
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
export default () => {
|
|
446
|
+
const [open, setOpen] = useState(false)
|
|
447
|
+
|
|
448
|
+
return (
|
|
449
|
+
<>
|
|
450
|
+
<Button onClick={() => setOpen(true)}>自定义语义结构</Button>
|
|
451
|
+
<Modal
|
|
452
|
+
open={open}
|
|
453
|
+
title="语义结构定制"
|
|
454
|
+
classNames={{
|
|
455
|
+
root: 'custom-modal-root',
|
|
456
|
+
body: 'custom-modal-body',
|
|
457
|
+
}}
|
|
458
|
+
styles={styles}
|
|
459
|
+
onCancel={() => setOpen(false)}
|
|
460
|
+
onOk={() => setOpen(false)}
|
|
461
|
+
>
|
|
462
|
+
可按语义节点定制局部 class 和 style。
|
|
463
|
+
</Modal>
|
|
464
|
+
</>
|
|
465
|
+
)
|
|
466
|
+
}
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
### 命令式确认弹窗
|
|
470
|
+
|
|
471
|
+
通过 `Modal.info` / `success` / `error` / `warning` / `confirm` 直接弹出反馈或确认框;`onOk` / `onCancel` 接收 `close` 函数,返回 Promise 时 `resolve` 关闭、`reject` 保持打开。返回的句柄支持 `destroy()` 关闭与 `update()` 动态更新配置。
|
|
472
|
+
|
|
473
|
+
```tsx
|
|
474
|
+
import { Button, Modal } from '@apexhub/apex-ui-react'
|
|
475
|
+
|
|
476
|
+
export default () => (
|
|
477
|
+
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 8 }}>
|
|
478
|
+
<Button onClick={() => Modal.info({ title: '提示', content: '这是一条信息。' })}>info</Button>
|
|
479
|
+
<Button onClick={() => Modal.success({ title: '成功', content: '操作已完成。' })}>
|
|
480
|
+
success
|
|
481
|
+
</Button>
|
|
482
|
+
<Button onClick={() => Modal.error({ title: '错误', content: '操作失败,请重试。' })}>
|
|
483
|
+
error
|
|
484
|
+
</Button>
|
|
485
|
+
<Button onClick={() => Modal.warning({ title: '注意', content: '请确认后再继续。' })}>
|
|
486
|
+
warning
|
|
487
|
+
</Button>
|
|
488
|
+
<Button
|
|
489
|
+
type="primary"
|
|
490
|
+
onClick={() =>
|
|
491
|
+
Modal.confirm({
|
|
492
|
+
title: '确认删除?',
|
|
493
|
+
content: '删除后无法恢复。',
|
|
494
|
+
})
|
|
495
|
+
}
|
|
496
|
+
>
|
|
497
|
+
confirm
|
|
498
|
+
</Button>
|
|
499
|
+
<Button
|
|
500
|
+
onClick={() =>
|
|
501
|
+
Modal.confirm({
|
|
502
|
+
title: '提交确认',
|
|
503
|
+
content: 'OK 将在短暂延迟后关闭。',
|
|
504
|
+
onOk: () => new Promise((resolve) => setTimeout(resolve, 300)),
|
|
505
|
+
})
|
|
506
|
+
}
|
|
507
|
+
>
|
|
508
|
+
异步 onOk
|
|
509
|
+
</Button>
|
|
510
|
+
<Button onClick={() => Modal.destroyAll()}>destroyAll</Button>
|
|
511
|
+
</div>
|
|
512
|
+
)
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
### useModal
|
|
516
|
+
|
|
517
|
+
`Modal.useModal()` 返回 `[modal, contextHolder]`,弹窗继承 `contextHolder` 所在位置的 React 上下文;`modal.confirm()` 返回的句柄支持 `then` / `await`,得到 `true`(确认)或 `false`(取消)。
|
|
518
|
+
|
|
519
|
+
```tsx
|
|
520
|
+
import { Button, Modal } from '@apexhub/apex-ui-react'
|
|
521
|
+
|
|
522
|
+
import { useState } from 'react'
|
|
523
|
+
|
|
524
|
+
export default () => {
|
|
525
|
+
const [modal, contextHolder] = Modal.useModal()
|
|
526
|
+
const [result, setResult] = useState('')
|
|
527
|
+
|
|
528
|
+
return (
|
|
529
|
+
<>
|
|
530
|
+
<Button
|
|
531
|
+
type="primary"
|
|
532
|
+
onClick={async () => {
|
|
533
|
+
const confirmed = await modal.confirm({
|
|
534
|
+
title: '通过 Hook 确认',
|
|
535
|
+
content: '点击 OK 返回 true,取消返回 false。',
|
|
536
|
+
})
|
|
537
|
+
setResult(confirmed ? '已确认' : '已取消')
|
|
538
|
+
}}
|
|
539
|
+
>
|
|
540
|
+
打开确认框
|
|
541
|
+
</Button>
|
|
542
|
+
{result ? <span style={{ marginLeft: 12 }}>结果:{result}</span> : null}
|
|
543
|
+
{contextHolder}
|
|
544
|
+
</>
|
|
545
|
+
)
|
|
546
|
+
}
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
## DOM 结构
|
|
550
|
+
|
|
551
|
+
源码声明的静态 `data-slot`:`modal-container`、`modal-header`、`modal-title`、`modal-close`、`modal-body`、`modal-footer`、`modal`、`modal-mask`、`modal-wrapper`、`modal-confirm-title`、`modal-confirm-content`。具体节点随模式和状态出现,不表示固定嵌套顺序。
|
|
552
|
+
|
|
553
|
+
## 样式定制
|
|
554
|
+
|
|
555
|
+
优先使用本组件公开的尺寸、类型和状态属性。换肤与变量覆盖方式见 [主题指南](../llms-theme.txt)。
|
|
556
|
+
|
|
557
|
+
需要定制具体样式时再读取 [Token 明细](./modal.tokens.txt),其中包含用途、定义值及适用作用域。常规组件使用无需加载该文件。
|
|
558
|
+
|
|
559
|
+
## FAQ
|
|
560
|
+
|
|
561
|
+
### 命令式弹窗的 `onOk` 为什么要传 `close` 函数?
|
|
562
|
+
|
|
563
|
+
异步流程中可先执行业务逻辑,再手动调用 `close()` 关闭;若 `onOk` 返回 Promise,`resolve` 时自动关闭,`reject` 时保持打开(按钮进入 loading)。
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
|
|
567
|
+
### `useModal` 和静态方法有什么区别?
|
|
568
|
+
|
|
569
|
+
静态方法(`Modal.confirm` 等)每次调用创建独立 React Root,不读取当前 React 上下文。`useModal` 通过 `contextHolder` 在当前树内渲染,可继承 ApexProvider、主题等上下文;且 `modal.confirm()` 支持 `await` 得到布尔结果。
|
|
570
|
+
|
|
571
|
+
|
|
572
|
+
|
|
573
|
+
### 为什么点击 OK/Cancel 后对话框没有关闭?
|
|
574
|
+
|
|
575
|
+
声明式 `<Modal>` 是受控组件,须在 `onCancel` / `onOk` 中将 `open` 设为 `false`。命令式 API 会在回调 `resolve` 或调用 `close()` 后自动关闭。
|
|
576
|
+
|
|
577
|
+
|
|
578
|
+
### 路由切换时如何关闭所有命令式弹窗?
|
|
579
|
+
|
|
580
|
+
调用 `Modal.destroyAll()` 可一次性关闭全部 `Modal.info` / `confirm` 等命令式弹窗,适合路由跳转前清理残留浮层。
|
|
581
|
+
|
|
582
|
+
### `title` 不传、传 `null` 有什么区别?
|
|
583
|
+
|
|
584
|
+
缺省(`undefined`)时 Modal 会渲染标题区;若无可见标题且无关闭钮,会自动补 sr-only 标题以满足无障碍。传 `null` 时不渲染标题区(命令式弹窗由内部布局提供标题),也不再补 sr-only 标题。
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Notification Token 明细
|
|
2
|
+
|
|
3
|
+
包:`@apexhub/apex-ui-react`;版本:`1.2.2`(当前源码快照)。
|
|
4
|
+
|
|
5
|
+
按需读取:[组件用法](./notification.txt) · [主题与覆盖规则](../llms-theme.txt)。
|
|
6
|
+
|
|
7
|
+
以下组件变量在设计 Token 源中已定义,并被组件或其共享样式使用;不包含仅在实现中声明的临时变量。用途来自实际 CSS 属性,不是对外新增的 Props。
|
|
8
|
+
|
|
9
|
+
定义值依赖所列尺寸、变体、状态和媒体作用域;Alias 引用还会随 light/dark 主题改变。它们不是统一默认值或最终计算值。作用域用于解释定义位置,不代表内部选择器是稳定的定制 API。
|
|
10
|
+
|
|
11
|
+
| Token | 用途(CSS 属性) | 定义值 | 定义作用域 |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `--font-fontheight` | `line-height` | `var(--apex-fontheight-20)` | `.apex-font.apex-text-cn-body-font` |
|
|
14
|
+
| `--font-fontheight` | `line-height` | `var(--apex-fontheight-18)` | `.apex-font.apex-text-cn-caption-font` |
|
|
15
|
+
| `--font-fontheight` | `line-height` | `var(--apex-fontheight-36)` | `.apex-font.apex-text-cn-heading-1-font` |
|
|
16
|
+
| `--font-fontheight` | `line-height` | `var(--apex-fontheight-28)` | `.apex-font.apex-text-cn-heading-2-font` |
|
|
17
|
+
| `--font-fontheight` | `line-height` | `var(--apex-fontheight-24)` | `.apex-font.apex-text-cn-heading-3-font` |
|
|
18
|
+
| `--font-fontheight` | `line-height` | `var(--apex-fontheight-24)` | `.apex-font.apex-text-cn-heading-4-font` |
|
|
19
|
+
| `--font-fontheight` | `line-height` | `var(--apex-fontheight-20)` | `.apex-font.apex-text-en-body-font` |
|
|
20
|
+
| `--font-fontheight` | `line-height` | `var(--apex-fontheight-18)` | `.apex-font.apex-text-en-caption-font` |
|
|
21
|
+
| `--font-fontheight` | `line-height` | `var(--apex-fontheight-36)` | `.apex-font.apex-text-en-heading-1-font` |
|
|
22
|
+
| `--font-fontheight` | `line-height` | `var(--apex-fontheight-28)` | `.apex-font.apex-text-en-heading-2-font` |
|
|
23
|
+
| `--font-fontheight` | `line-height` | `var(--apex-fontheight-24)` | `.apex-font.apex-text-en-heading-3-font` |
|
|
24
|
+
| `--font-fontheight` | `line-height` | `var(--apex-fontheight-24)` | `.apex-font.apex-text-en-heading-4-font` |
|
|
25
|
+
| `--font-fontsize` | `font-size` | `var(--apex-fontsize-14)` | `.apex-font.apex-text-cn-body-font` |
|
|
26
|
+
| `--font-fontsize` | `font-size` | `var(--apex-fontsize-12)` | `.apex-font.apex-text-cn-caption-font` |
|
|
27
|
+
| `--font-fontsize` | `font-size` | `var(--apex-fontsize-24)` | `.apex-font.apex-text-cn-heading-1-font` |
|
|
28
|
+
| `--font-fontsize` | `font-size` | `var(--apex-fontsize-18)` | `.apex-font.apex-text-cn-heading-2-font` |
|
|
29
|
+
| `--font-fontsize` | `font-size` | `var(--apex-fontsize-16)` | `.apex-font.apex-text-cn-heading-3-font` |
|
|
30
|
+
| `--font-fontsize` | `font-size` | `var(--apex-fontsize-16)` | `.apex-font.apex-text-cn-heading-4-font` |
|
|
31
|
+
| `--font-fontsize` | `font-size` | `var(--apex-fontsize-14)` | `.apex-font.apex-text-en-body-font` |
|
|
32
|
+
| `--font-fontsize` | `font-size` | `var(--apex-fontsize-12)` | `.apex-font.apex-text-en-caption-font` |
|
|
33
|
+
| `--font-fontsize` | `font-size` | `var(--apex-fontsize-24)` | `.apex-font.apex-text-en-heading-1-font` |
|
|
34
|
+
| `--font-fontsize` | `font-size` | `var(--apex-fontsize-18)` | `.apex-font.apex-text-en-heading-2-font` |
|
|
35
|
+
| `--font-fontsize` | `font-size` | `var(--apex-fontsize-16)` | `.apex-font.apex-text-en-heading-3-font` |
|
|
36
|
+
| `--font-fontsize` | `font-size` | `var(--apex-fontsize-16)` | `.apex-font.apex-text-en-heading-4-font` |
|
|
37
|
+
| `--font-fontspacing` | `letter-spacing` | `var(--apex-fontspacing-0)` | `.apex-font.apex-text-cn-body-font` |
|
|
38
|
+
| `--font-fontspacing` | `letter-spacing` | `var(--apex-fontspacing-0)` | `.apex-font.apex-text-cn-caption-font` |
|
|
39
|
+
| `--font-fontspacing` | `letter-spacing` | `var(--apex-fontspacing-0)` | `.apex-font.apex-text-cn-heading-1-font` |
|
|
40
|
+
| `--font-fontspacing` | `letter-spacing` | `var(--apex-fontspacing-0)` | `.apex-font.apex-text-cn-heading-2-font` |
|
|
41
|
+
| `--font-fontspacing` | `letter-spacing` | `var(--apex-fontspacing-8)` | `.apex-font.apex-text-cn-heading-3-font` |
|
|
42
|
+
| `--font-fontspacing` | `letter-spacing` | `var(--apex-fontspacing-0)` | `.apex-font.apex-text-cn-heading-4-font` |
|
|
43
|
+
| `--font-fontspacing` | `letter-spacing` | `var(--apex-fontspacing-1)` | `.apex-font.apex-text-en-body-font` |
|
|
44
|
+
| `--font-fontspacing` | `letter-spacing` | `var(--apex-fontspacing-1)` | `.apex-font.apex-text-en-caption-font` |
|
|
45
|
+
| `--font-fontspacing` | `letter-spacing` | `var(--apex-fontspacing-1)` | `.apex-font.apex-text-en-heading-1-font` |
|
|
46
|
+
| `--font-fontspacing` | `letter-spacing` | `var(--apex-fontspacing-1)` | `.apex-font.apex-text-en-heading-2-font` |
|
|
47
|
+
| `--font-fontspacing` | `letter-spacing` | `var(--apex-fontspacing-1)` | `.apex-font.apex-text-en-heading-3-font` |
|
|
48
|
+
| `--font-fontspacing` | `letter-spacing` | `var(--apex-fontspacing-1)` | `.apex-font.apex-text-en-heading-4-font` |
|
|
49
|
+
| `--font-fontweight` | `font-weight` | `var(--apex-fontweight-400)` | `.apex-font.apex-text-cn-body-font` |
|
|
50
|
+
| `--font-fontweight` | `font-weight` | `var(--apex-fontweight-400)` | `.apex-font.apex-text-cn-caption-font` |
|
|
51
|
+
| `--font-fontweight` | `font-weight` | `var(--apex-fontweight-600)` | `.apex-font.apex-text-cn-heading-1-font` |
|
|
52
|
+
| `--font-fontweight` | `font-weight` | `var(--apex-fontweight-600)` | `.apex-font.apex-text-cn-heading-2-font` |
|
|
53
|
+
| `--font-fontweight` | `font-weight` | `var(--apex-fontweight-600)` | `.apex-font.apex-text-cn-heading-3-font` |
|
|
54
|
+
| `--font-fontweight` | `font-weight` | `var(--apex-fontweight-400)` | `.apex-font.apex-text-cn-heading-4-font` |
|
|
55
|
+
| `--font-fontweight` | `font-weight` | `var(--apex-fontweight-400)` | `.apex-font.apex-text-en-body-font` |
|
|
56
|
+
| `--font-fontweight` | `font-weight` | `var(--apex-fontweight-400)` | `.apex-font.apex-text-en-caption-font` |
|
|
57
|
+
| `--font-fontweight` | `font-weight` | `var(--apex-fontweight-600)` | `.apex-font.apex-text-en-heading-1-font` |
|
|
58
|
+
| `--font-fontweight` | `font-weight` | `var(--apex-fontweight-600)` | `.apex-font.apex-text-en-heading-2-font` |
|
|
59
|
+
| `--font-fontweight` | `font-weight` | `var(--apex-fontweight-600)` | `.apex-font.apex-text-en-heading-3-font` |
|
|
60
|
+
| `--font-fontweight` | `font-weight` | `var(--apex-fontweight-400)` | `.apex-font.apex-text-en-heading-4-font` |
|
|
61
|
+
| `--notification-fill-default` | `background` | `var(--apex-fill-neutral-secondary)` | `.apex-notification.apex-default-notification` |
|
|
62
|
+
| `--notification-icon-error` | `color` | `var(--apex-icon-error-primary)` | `.apex-notification.apex-default-notification` |
|
|
63
|
+
| `--notification-icon-icon` | `font-size` | `var(--apex-icon-24)` | `.apex-notification.apex-default-notification` |
|
|
64
|
+
| `--notification-icon-info` | `color` | `var(--apex-icon-brand-primary)` | `.apex-notification.apex-default-notification` |
|
|
65
|
+
| `--notification-icon-success` | `color` | `var(--apex-icon-success-primary)` | `.apex-notification.apex-default-notification` |
|
|
66
|
+
| `--notification-icon-warning` | `color` | `var(--apex-icon-warning-primary)` | `.apex-notification.apex-default-notification` |
|
|
67
|
+
| `--notification-radius-radius` | `border-radius` | `var(--apex-radius-8)` | `.apex-notification.apex-default-notification` |
|
|
68
|
+
| `--notification-size-width` | `min-width` | `var(--apex-size-420)` | `.apex-notification.apex-default-notification` |
|
|
69
|
+
| `--notification-spacing-gap-container` | `gap` | `var(--apex-spacing-8)` | `.apex-notification.apex-default-notification` |
|
|
70
|
+
| `--notification-spacing-gap-header` | `gap` | `var(--apex-spacing-4)` | `.apex-notification.apex-default-notification` |
|
|
71
|
+
| `--notification-spacing-margin-x-container` | `left`、`max-width`、`right` | `var(--apex-spacing-16)` | `.apex-notification.apex-default-notification` |
|
|
72
|
+
| `--notification-spacing-margin-y-container` | `bottom`、`top` | `var(--apex-spacing-16)` | `.apex-notification.apex-default-notification` |
|
|
73
|
+
| `--notification-spacing-padding-x-container` | `padding` | `var(--apex-spacing-32)` | `.apex-notification.apex-default-notification` |
|
|
74
|
+
| `--notification-spacing-padding-x-left-content` | `padding-inline-start` | `var(--apex-spacing-28)` | `.apex-notification.apex-default-notification` |
|
|
75
|
+
| `--notification-spacing-padding-y-container` | `padding` | `var(--apex-spacing-24)` | `.apex-notification.apex-default-notification` |
|
|
76
|
+
| `--notification-stroke-default` | `border` | `var(--apex-fill-neutral-quinary)` | `.apex-notification.apex-default-notification` |
|
|
77
|
+
| `--notification-stroke-stroke` | `border` | `var(--apex-border-08)` | `.apex-notification.apex-default-notification` |
|
|
78
|
+
| `--notification-text-body` | `color` | `var(--apex-text-neutral-secondary)` | `.apex-notification.apex-default-notification` |
|
|
79
|
+
| `--notification-text-title` | `color` | `var(--apex-text-neutral-primary)` | `.apex-notification.apex-default-notification` |
|