@apexhub/apex-ui-react 1.2.0 → 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/dist/index.cjs +3363 -3328
- package/dist/index.d.ts +26 -22
- package/dist/index.mjs +3363 -3328
- package/dist/llm/alert.tokens.txt +1 -1
- package/dist/llm/alert.txt +3 -3
- package/dist/llm/apex-provider.txt +3 -2
- package/dist/llm/auto-complete.tokens.txt +1 -1
- package/dist/llm/auto-complete.txt +1 -1
- package/dist/llm/avatar.tokens.txt +1 -1
- package/dist/llm/avatar.txt +1 -1
- package/dist/llm/breadcrumb.tokens.txt +46 -96
- package/dist/llm/breadcrumb.txt +8 -8
- package/dist/llm/button.tokens.txt +1 -1
- package/dist/llm/button.txt +16 -8
- package/dist/llm/card.tokens.txt +3 -1
- package/dist/llm/card.txt +24 -1
- package/dist/llm/cascader.tokens.txt +15 -7
- package/dist/llm/cascader.txt +25 -6
- package/dist/llm/checkbox.tokens.txt +10 -2
- package/dist/llm/checkbox.txt +24 -13
- package/dist/llm/collapse.tokens.txt +1 -1
- package/dist/llm/collapse.txt +1 -1
- package/dist/llm/date-picker.tokens.txt +10 -10
- package/dist/llm/date-picker.txt +7 -3
- package/dist/llm/divider.tokens.txt +1 -1
- package/dist/llm/divider.txt +1 -1
- package/dist/llm/drawer.tokens.txt +2 -2
- package/dist/llm/drawer.txt +2 -2
- package/dist/llm/dropdown.tokens.txt +1 -1
- package/dist/llm/dropdown.txt +1 -1
- package/dist/llm/form.tokens.txt +3 -1
- package/dist/llm/form.txt +1 -1
- package/dist/llm/grid.txt +9 -9
- package/dist/llm/image.tokens.txt +1 -1
- package/dist/llm/image.txt +2 -2
- package/dist/llm/input-number.tokens.txt +4 -4
- package/dist/llm/input-number.txt +8 -3
- package/dist/llm/input.tokens.txt +4 -4
- package/dist/llm/input.txt +4 -2
- package/dist/llm/layout.tokens.txt +1 -1
- package/dist/llm/layout.txt +1 -1
- package/dist/llm/menu.tokens.txt +21 -8
- package/dist/llm/menu.txt +19 -12
- package/dist/llm/message.tokens.txt +1 -1
- package/dist/llm/message.txt +1 -1
- package/dist/llm/modal.tokens.txt +1 -1
- package/dist/llm/modal.txt +9 -9
- package/dist/llm/notification.tokens.txt +1 -1
- package/dist/llm/notification.txt +1 -1
- package/dist/llm/pagination.tokens.txt +6 -4
- package/dist/llm/pagination.txt +18 -9
- package/dist/llm/popover.tokens.txt +4 -14
- package/dist/llm/popover.txt +3 -3
- package/dist/llm/progress.tokens.txt +1 -1
- package/dist/llm/progress.txt +4 -4
- package/dist/llm/radio.tokens.txt +11 -6
- package/dist/llm/radio.txt +38 -1
- package/dist/llm/rate.tokens.txt +1 -1
- package/dist/llm/rate.txt +1 -1
- package/dist/llm/select.tokens.txt +4 -4
- package/dist/llm/select.txt +8 -7
- package/dist/llm/skeleton.tokens.txt +1 -1
- package/dist/llm/skeleton.txt +1 -1
- package/dist/llm/spin.tokens.txt +1 -1
- package/dist/llm/spin.txt +1 -1
- package/dist/llm/steps.tokens.txt +1 -1
- package/dist/llm/steps.txt +1 -1
- package/dist/llm/switch.tokens.txt +1 -1
- package/dist/llm/switch.txt +1 -1
- package/dist/llm/table.tokens.txt +2 -2
- package/dist/llm/table.txt +16 -13
- package/dist/llm/tabs.tokens.txt +1 -1
- package/dist/llm/tabs.txt +1 -1
- package/dist/llm/tag.tokens.txt +1 -2
- package/dist/llm/tag.txt +7 -8
- package/dist/llm/tooltip.tokens.txt +1 -1
- package/dist/llm/tooltip.txt +1 -1
- package/dist/llm/tree-select.tokens.txt +7 -6
- package/dist/llm/tree-select.txt +32 -22
- package/dist/llm/tree.tokens.txt +1 -3
- package/dist/llm/tree.txt +11 -15
- package/dist/llm/typography.tokens.txt +1 -1
- package/dist/llm/typography.txt +1 -1
- package/dist/llm/upload.tokens.txt +5 -1
- package/dist/llm/upload.txt +4 -2
- package/dist/llms-full.txt +321 -184
- package/dist/llms.txt +1 -1
- package/dist/style.css +1716 -1240
- package/llms-full.txt +321 -184
- package/llms.txt +1 -1
- package/package.json +1 -1
- package/src/alert/llm.txt +3 -3
- package/src/alert/tokens.txt +1 -1
- package/src/apex-provider/llm.txt +3 -2
- package/src/auto-complete/llm.txt +1 -1
- package/src/auto-complete/tokens.txt +1 -1
- package/src/avatar/llm.txt +1 -1
- package/src/avatar/tokens.txt +1 -1
- package/src/breadcrumb/llm.txt +8 -8
- package/src/breadcrumb/tokens.txt +46 -96
- package/src/button/llm.txt +16 -8
- package/src/button/tokens.txt +1 -1
- package/src/card/llm.txt +24 -1
- package/src/card/tokens.txt +3 -1
- package/src/cascader/llm.txt +25 -6
- package/src/cascader/tokens.txt +15 -7
- package/src/checkbox/llm.txt +24 -13
- package/src/checkbox/tokens.txt +10 -2
- package/src/collapse/llm.txt +1 -1
- package/src/collapse/tokens.txt +1 -1
- package/src/date-picker/llm.txt +7 -3
- package/src/date-picker/tokens.txt +10 -10
- package/src/divider/llm.txt +1 -1
- package/src/divider/tokens.txt +1 -1
- package/src/drawer/llm.txt +2 -2
- package/src/drawer/tokens.txt +2 -2
- package/src/dropdown/llm.txt +1 -1
- package/src/dropdown/tokens.txt +1 -1
- package/src/form/llm.txt +1 -1
- package/src/form/tokens.txt +3 -1
- package/src/grid/llm.txt +9 -9
- package/src/image/llm.txt +2 -2
- package/src/image/tokens.txt +1 -1
- package/src/input/llm.txt +4 -2
- package/src/input/tokens.txt +4 -4
- package/src/input-number/llm.txt +8 -3
- package/src/input-number/tokens.txt +4 -4
- package/src/layout/llm.txt +1 -1
- package/src/layout/tokens.txt +1 -1
- package/src/menu/llm.txt +19 -12
- package/src/menu/tokens.txt +21 -8
- package/src/message/llm.txt +1 -1
- package/src/message/tokens.txt +1 -1
- package/src/modal/llm.txt +9 -9
- package/src/modal/tokens.txt +1 -1
- package/src/notification/llm.txt +1 -1
- package/src/notification/tokens.txt +1 -1
- package/src/pagination/llm.txt +18 -9
- package/src/pagination/tokens.txt +6 -4
- package/src/popover/llm.txt +3 -3
- package/src/popover/tokens.txt +4 -14
- package/src/progress/llm.txt +4 -4
- package/src/progress/tokens.txt +1 -1
- package/src/radio/llm.txt +38 -1
- package/src/radio/tokens.txt +11 -6
- package/src/rate/llm.txt +1 -1
- package/src/rate/tokens.txt +1 -1
- package/src/select/llm.txt +8 -7
- package/src/select/tokens.txt +4 -4
- package/src/skeleton/llm.txt +1 -1
- package/src/skeleton/tokens.txt +1 -1
- package/src/spin/llm.txt +1 -1
- package/src/spin/tokens.txt +1 -1
- package/src/steps/llm.txt +1 -1
- package/src/steps/tokens.txt +1 -1
- package/src/switch/llm.txt +1 -1
- package/src/switch/tokens.txt +1 -1
- package/src/table/llm.txt +16 -13
- package/src/table/tokens.txt +2 -2
- package/src/tabs/llm.txt +1 -1
- package/src/tabs/tokens.txt +1 -1
- package/src/tag/llm.txt +7 -8
- package/src/tag/tokens.txt +1 -2
- package/src/tooltip/llm.txt +1 -1
- package/src/tooltip/tokens.txt +1 -1
- package/src/tree/llm.txt +11 -15
- package/src/tree/tokens.txt +1 -3
- package/src/tree-select/llm.txt +32 -22
- package/src/tree-select/tokens.txt +7 -6
- package/src/typography/llm.txt +1 -1
- package/src/typography/tokens.txt +1 -1
- package/src/upload/llm.txt +4 -2
- package/src/upload/tokens.txt +5 -1
package/llms.txt
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
安装:`pnpm add @apexhub/apex-ui-react`。导入:`import { Button } from "@apexhub/apex-ui-react"`,并引入样式 `import "@apexhub/apex-ui-react/style.css"`。
|
|
6
6
|
|
|
7
|
-
版本:`1.2.
|
|
7
|
+
版本:`1.2.2`(当前源码快照)。要求 React `>=19.0.0`、React DOM `>=19.0.0`;DatePicker / RangePicker 使用 Dayjs `^1.11.0`。
|
|
8
8
|
|
|
9
9
|
先读取本索引定位组件,再按需读取单组件文档;跨组件任务再使用全量文档。以安装版本对应的 API、导出类型和完整示例为准,不要套用 antd 的默认值或推测未导出的 API。
|
|
10
10
|
|
package/package.json
CHANGED
package/src/alert/llm.txt
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Alert:需要在当前页面内展示操作结果、风险提示或补充说明,且信息应持续可见时。
|
|
4
4
|
|
|
5
|
-
包:`@apexhub/apex-ui-react`;版本:`1.2.
|
|
5
|
+
包:`@apexhub/apex-ui-react`;版本:`1.2.2`(当前源码快照,发布状态以安装包版本为准)。
|
|
6
6
|
|
|
7
7
|
公开导出:`Alert`。
|
|
8
8
|
|
|
@@ -104,7 +104,7 @@ export default () => <Alert type="warning" title="可关闭的警告" closable s
|
|
|
104
104
|
|
|
105
105
|
### 操作区
|
|
106
106
|
|
|
107
|
-
通过 `action`
|
|
107
|
+
通过 `action` 在右侧放置操作按钮或链接。示例使用 `text-secondary` 的 medium 按钮;关闭控件使用 medium 图标按钮。
|
|
108
108
|
|
|
109
109
|
```tsx
|
|
110
110
|
import { Alert, Button } from '@apexhub/apex-ui-react'
|
|
@@ -115,7 +115,7 @@ export default () => (
|
|
|
115
115
|
title="提交失败"
|
|
116
116
|
description="网络异常,请稍后重试。"
|
|
117
117
|
action={
|
|
118
|
-
<Button
|
|
118
|
+
<Button variant="text-secondary" size="medium">
|
|
119
119
|
重试
|
|
120
120
|
</Button>
|
|
121
121
|
}
|
package/src/alert/tokens.txt
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> ApexProvider:在应用或微前端子应用最外层包裹,确保组件库 Token、主题、滚动条样式在整个组件树生效。
|
|
4
4
|
|
|
5
|
-
包:`@apexhub/apex-ui-react`;版本:`1.2.
|
|
5
|
+
包:`@apexhub/apex-ui-react`;版本:`1.2.2`(当前源码快照,发布状态以安装包版本为准)。
|
|
6
6
|
|
|
7
7
|
公开导出:`ApexProvider`、`useConfig`。
|
|
8
8
|
|
|
@@ -269,7 +269,7 @@ export default () => {
|
|
|
269
269
|
</Form.Item>
|
|
270
270
|
</Form>
|
|
271
271
|
|
|
272
|
-
<Pagination total={60} defaultCurrent={1}
|
|
272
|
+
<Pagination total={60} defaultCurrent={1} showSizeChanger />
|
|
273
273
|
|
|
274
274
|
<DatePicker />
|
|
275
275
|
</div>
|
|
@@ -294,6 +294,7 @@ const canvasStyle: CSSProperties = {
|
|
|
294
294
|
gap: 16,
|
|
295
295
|
maxWidth: 480,
|
|
296
296
|
background: 'var(--apex-fill-neutral-secondary)',
|
|
297
|
+
color: 'var(--apex-text-neutral-primary)',
|
|
297
298
|
borderRadius: 8,
|
|
298
299
|
}
|
|
299
300
|
|
package/src/avatar/llm.txt
CHANGED
package/src/avatar/tokens.txt
CHANGED
package/src/breadcrumb/llm.txt
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Breadcrumb:页面层级较深,用户需要知道「当前在哪」并快速返回上级时。
|
|
4
4
|
|
|
5
|
-
包:`@apexhub/apex-ui-react`;版本:`1.2.
|
|
5
|
+
包:`@apexhub/apex-ui-react`;版本:`1.2.2`(当前源码快照,发布状态以安装包版本为准)。
|
|
6
6
|
|
|
7
7
|
公开导出:`Breadcrumb`、`BreadcrumbLink`、`BreadcrumbSeparatorIcon`、`isBreadcrumbSeparatorItem`。
|
|
8
8
|
|
|
@@ -18,9 +18,9 @@ import { Breadcrumb, BreadcrumbSeparatorIcon } from '@apexhub/apex-ui-react'
|
|
|
18
18
|
import '@apexhub/apex-ui-react/style.css'
|
|
19
19
|
|
|
20
20
|
const items: BreadcrumbItemType[] = [
|
|
21
|
-
{ type: 'section', title: '
|
|
22
|
-
{ title: '
|
|
23
|
-
{ title: '
|
|
21
|
+
{ type: 'section', title: '首页', href: '/' },
|
|
22
|
+
{ title: 'Button', href: '/components/button' },
|
|
23
|
+
{ title: 'Breadcrumb' },
|
|
24
24
|
]
|
|
25
25
|
|
|
26
26
|
export default () => <Breadcrumb items={items} separator={<BreadcrumbSeparatorIcon />} />
|
|
@@ -55,10 +55,10 @@ export default () => <Breadcrumb items={items} separator={<BreadcrumbSeparatorIc
|
|
|
55
55
|
| --- | --- | --- | --- | --- |
|
|
56
56
|
| type | 栏目标题项;使用 heading-3 字阶与默认字色,其后自动渲染竖向 Divider | `"section"` | 否 | — |
|
|
57
57
|
| title | 展示名称(可内嵌图标) | `React.ReactNode` | 否 | — |
|
|
58
|
-
| href |
|
|
58
|
+
| href | 上级项链接;末项作为当前页始终不可点击。与 `path` 共存时优先 `href` | `string` | 否 | — |
|
|
59
59
|
| path | 相对路径段;累加并支持 `:key` + `Breadcrumb.params` | `string` | 否 | — |
|
|
60
60
|
| className | 该项最外层 DOM 的类名(`li` 或链接/文案壳层,非 `Breadcrumb` 根) | `string` | 否 | — |
|
|
61
|
-
| onClick |
|
|
61
|
+
| onClick | 上级链接单击事件;末项不会绑定 | `React.MouseEventHandler<HTMLAnchorElement \| HTMLElement>` | 否 | — |
|
|
62
62
|
|
|
63
63
|
### BreadcrumbSeparatorItem
|
|
64
64
|
|
|
@@ -79,7 +79,7 @@ type BreadcrumbItemType = BreadcrumbRouteItem | BreadcrumbSeparatorItem
|
|
|
79
79
|
|
|
80
80
|
### BreadcrumbItemRender
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
自定义上级项渲染(当前页始终使用 `title`,避免生成可点击节点)
|
|
83
83
|
|
|
84
84
|
```typescript
|
|
85
85
|
type BreadcrumbItemRender = (
|
|
@@ -156,7 +156,7 @@ export default () => <Breadcrumb separator={<BreadcrumbSeparatorIcon />} items={
|
|
|
156
156
|
|
|
157
157
|
### 路径参数与自定义渲染
|
|
158
158
|
|
|
159
|
-
通过 `path` 与 `params` 拼接路径,也可以用 `itemRender`
|
|
159
|
+
通过 `path` 与 `params` 拼接路径,也可以用 `itemRender` 自定义上级项展示。未解析的路径参数不会生成链接;当前项始终使用 `title`,避免自定义渲染产生可点击节点。
|
|
160
160
|
|
|
161
161
|
```tsx
|
|
162
162
|
import type { BreadcrumbItemRender, BreadcrumbItemType } from '@apexhub/apex-ui-react'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Breadcrumb Token 明细
|
|
2
2
|
|
|
3
|
-
包:`@apexhub/apex-ui-react`;版本:`1.2.
|
|
3
|
+
包:`@apexhub/apex-ui-react`;版本:`1.2.2`(当前源码快照)。
|
|
4
4
|
|
|
5
5
|
按需读取:[组件用法](./llm.txt) · [主题与覆盖规则](../../llms-theme.txt)。
|
|
6
6
|
|
|
@@ -12,63 +12,25 @@
|
|
|
12
12
|
| --- | --- | --- | --- |
|
|
13
13
|
| `--breadcrumb-spacing-gap-md` | `margin-inline` | `var(--apex-spacing-24)` | `.apex-breadcrumb.apex-default-breadcrumb` |
|
|
14
14
|
| `--breadcrumb-spacing-gap-sm` | `gap`、`margin-inline` | `var(--apex-spacing-12)` | `.apex-breadcrumb.apex-default-breadcrumb` |
|
|
15
|
-
| `--button-
|
|
16
|
-
| `--button-
|
|
17
|
-
| `--button-
|
|
18
|
-
| `--button-
|
|
19
|
-
| `--button-
|
|
20
|
-
| `--button-
|
|
21
|
-
| `--button-
|
|
22
|
-
| `--button-
|
|
23
|
-
| `--button-
|
|
24
|
-
| `--button-
|
|
25
|
-
| `--button-
|
|
26
|
-
| `--button-
|
|
27
|
-
| `--button-
|
|
28
|
-
| `--button-
|
|
29
|
-
| `--button-
|
|
30
|
-
| `--button-
|
|
31
|
-
| `--button-
|
|
32
|
-
| `--button-
|
|
33
|
-
| `--button-
|
|
34
|
-
| `--button-fill-selected` | `background-color` | `var(--apex-fill-neutral-transparent)` | `.apex-button.apex-icon-error-button` |
|
|
35
|
-
| `--button-fill-selected` | `background-color` | `var(--apex-fill-neutral-secondary)` | `.apex-button.apex-icon-primary-button` |
|
|
36
|
-
| `--button-fill-selected` | `background-color` | `var(--apex-fill-neutral-transparent)` | `.apex-button.apex-icon-secondary-button` |
|
|
37
|
-
| `--button-fill-selected` | `background-color` | `var(--apex-fill-neutral-transparent)` | `.apex-button.apex-icon-success-button` |
|
|
38
|
-
| `--button-fill-selected` | `background-color` | `var(--apex-fill-neutral-transparent)` | `.apex-button.apex-icon-transparent-button` |
|
|
39
|
-
| `--button-fill-selected` | `background-color` | `var(--apex-fill-neutral-transparent)` | `.apex-button.apex-icon-warning-button` |
|
|
40
|
-
| `--button-fill-selected` | `background-color` | `var(--apex-fill-neutral-transparent)` | `.apex-button.apex-link-default-button` |
|
|
41
|
-
| `--button-fill-selected` | `background-color` | `var(--apex-fill-brand-primary)` | `.apex-button.apex-main-default-button` |
|
|
42
|
-
| `--button-fill-selected` | `background-color` | `var(--apex-fill-error-primary)` | `.apex-button.apex-main-error-button` |
|
|
43
|
-
| `--button-fill-selected` | `background-color` | `var(--apex-fill-success-primary)` | `.apex-button.apex-main-success-button` |
|
|
44
|
-
| `--button-fill-selected` | `background-color` | `var(--apex-fill-warning-primary)` | `.apex-button.apex-main-warning-button` |
|
|
45
|
-
| `--button-fill-selected` | `background-color` | `var(--apex-fill-brand-alpha-secondary)` | `.apex-button.apex-outline-brand-button` |
|
|
46
|
-
| `--button-fill-selected` | `background-color` | `var(--apex-fill-neutral-secondary)` | `.apex-button.apex-outline-default-button` |
|
|
47
|
-
| `--button-fill-selected` | `background-color` | `var(--apex-fill-error-alpha-secondary)` | `.apex-button.apex-outline-error-button` |
|
|
48
|
-
| `--button-fill-selected` | `background-color` | `var(--apex-fill-success-alpha-secondary)` | `.apex-button.apex-outline-success-button` |
|
|
49
|
-
| `--button-fill-selected` | `background-color` | `var(--apex-fill-warning-alpha-secondary)` | `.apex-button.apex-outline-warning-button` |
|
|
50
|
-
| `--button-fill-selected` | `background-color` | `var(--apex-fill-brand-primary)` | `.apex-button.apex-secondary-default-button` |
|
|
51
|
-
| `--button-fill-selected` | `background-color` | `var(--apex-fill-neutral-transparent)` | `.apex-button.apex-text-default-button` |
|
|
52
|
-
| `--button-fill-selected` | `background-color` | `var(--apex-fill-neutral-transparent)` | `.apex-button.apex-text-secondary-button` |
|
|
53
|
-
| `--button-icon-default` | `color` | `var(--apex-icon-error-primary)` | `.apex-button.apex-icon-error-button` |
|
|
54
|
-
| `--button-icon-default` | `color` | `var(--apex-icon-neutral-secondary)` | `.apex-button.apex-icon-primary-button` |
|
|
55
|
-
| `--button-icon-default` | `color` | `var(--apex-icon-neutral-secondary)` | `.apex-button.apex-icon-secondary-button` |
|
|
56
|
-
| `--button-icon-default` | `color` | `var(--apex-icon-success-primary)` | `.apex-button.apex-icon-success-button` |
|
|
57
|
-
| `--button-icon-default` | `color` | `var(--apex-icon-neutral-secondary)` | `.apex-button.apex-icon-transparent-button` |
|
|
58
|
-
| `--button-icon-default` | `color` | `var(--apex-icon-warning-primary)` | `.apex-button.apex-icon-warning-button` |
|
|
59
|
-
| `--button-icon-default` | `color` | `var(--apex-icon-neutral-primary)` | `.apex-button.apex-link-default-button` |
|
|
60
|
-
| `--button-icon-default` | `color` | `var(--apex-icon-neutral-inverse)` | `.apex-button.apex-main-default-button` |
|
|
61
|
-
| `--button-icon-default` | `color` | `var(--apex-icon-neutral-inverse)` | `.apex-button.apex-main-error-button` |
|
|
62
|
-
| `--button-icon-default` | `color` | `var(--apex-icon-neutral-inverse)` | `.apex-button.apex-main-success-button` |
|
|
63
|
-
| `--button-icon-default` | `color` | `var(--apex-icon-neutral-inverse)` | `.apex-button.apex-main-warning-button` |
|
|
64
|
-
| `--button-icon-default` | `color` | `var(--apex-icon-neutral-primary)` | `.apex-button.apex-outline-brand-button` |
|
|
65
|
-
| `--button-icon-default` | `color` | `var(--apex-icon-neutral-primary)` | `.apex-button.apex-outline-default-button` |
|
|
66
|
-
| `--button-icon-default` | `color` | `var(--apex-icon-neutral-primary)` | `.apex-button.apex-outline-error-button` |
|
|
67
|
-
| `--button-icon-default` | `color` | `var(--apex-icon-neutral-primary)` | `.apex-button.apex-outline-success-button` |
|
|
68
|
-
| `--button-icon-default` | `color` | `var(--apex-icon-neutral-primary)` | `.apex-button.apex-outline-warning-button` |
|
|
69
|
-
| `--button-icon-default` | `color` | `var(--apex-icon-neutral-primary)` | `.apex-button.apex-secondary-default-button` |
|
|
70
|
-
| `--button-icon-default` | `color` | `var(--apex-icon-neutral-primary)` | `.apex-button.apex-text-default-button` |
|
|
71
|
-
| `--button-icon-default` | `color` | `var(--apex-icon-neutral-primary)` | `.apex-button.apex-text-secondary-button` |
|
|
15
|
+
| `--button-icon-disabled` | `color` | `var(--apex-icon-error-disabled)` | `.apex-button.apex-icon-error-button` |
|
|
16
|
+
| `--button-icon-disabled` | `color` | `var(--apex-icon-neutral-disabled)` | `.apex-button.apex-icon-primary-button` |
|
|
17
|
+
| `--button-icon-disabled` | `color` | `var(--apex-icon-neutral-disabled)` | `.apex-button.apex-icon-secondary-button` |
|
|
18
|
+
| `--button-icon-disabled` | `color` | `var(--apex-icon-success-disabled)` | `.apex-button.apex-icon-success-button` |
|
|
19
|
+
| `--button-icon-disabled` | `color` | `var(--apex-icon-neutral-disabled)` | `.apex-button.apex-icon-transparent-button` |
|
|
20
|
+
| `--button-icon-disabled` | `color` | `var(--apex-icon-warning-disabled)` | `.apex-button.apex-icon-warning-button` |
|
|
21
|
+
| `--button-icon-disabled` | `color` | `var(--apex-icon-neutral-disabled)` | `.apex-button.apex-link-default-button` |
|
|
22
|
+
| `--button-icon-disabled` | `color` | `var(--apex-icon-neutral-disabled)` | `.apex-button.apex-main-default-button` |
|
|
23
|
+
| `--button-icon-disabled` | `color` | `var(--apex-icon-neutral-disabled)` | `.apex-button.apex-main-error-button` |
|
|
24
|
+
| `--button-icon-disabled` | `color` | `var(--apex-icon-neutral-disabled)` | `.apex-button.apex-main-success-button` |
|
|
25
|
+
| `--button-icon-disabled` | `color` | `var(--apex-icon-neutral-disabled)` | `.apex-button.apex-main-warning-button` |
|
|
26
|
+
| `--button-icon-disabled` | `color` | `var(--apex-icon-neutral-disabled)` | `.apex-button.apex-outline-brand-button` |
|
|
27
|
+
| `--button-icon-disabled` | `color` | `var(--apex-icon-neutral-disabled)` | `.apex-button.apex-outline-default-button` |
|
|
28
|
+
| `--button-icon-disabled` | `color` | `var(--apex-icon-neutral-disabled)` | `.apex-button.apex-outline-error-button` |
|
|
29
|
+
| `--button-icon-disabled` | `color` | `var(--apex-icon-neutral-disabled)` | `.apex-button.apex-outline-success-button` |
|
|
30
|
+
| `--button-icon-disabled` | `color` | `var(--apex-icon-neutral-disabled)` | `.apex-button.apex-outline-warning-button` |
|
|
31
|
+
| `--button-icon-disabled` | `color` | `var(--apex-icon-neutral-disabled)` | `.apex-button.apex-secondary-default-button` |
|
|
32
|
+
| `--button-icon-disabled` | `color` | `var(--apex-icon-neutral-disabled)` | `.apex-button.apex-text-default-button` |
|
|
33
|
+
| `--button-icon-disabled` | `color` | `var(--apex-icon-neutral-disabled)` | `.apex-button.apex-text-secondary-button` |
|
|
72
34
|
| `--button-icon-icon` | `height`、`width` | `var(--apex-icon-20)` | `.apex-button.apex-icon-md-button` |
|
|
73
35
|
| `--button-icon-icon` | `height`、`width` | `var(--apex-icon-16)` | `.apex-button.apex-icon-sm-button` |
|
|
74
36
|
| `--button-icon-icon` | `height`、`width` | `var(--apex-icon-16)` | `.apex-button.apex-link-md-button` |
|
|
@@ -91,44 +53,19 @@
|
|
|
91
53
|
| `--button-spacing-gap` | `height` | `var(--apex-spacing-4)` | `.apex-button.apex-main-sm-button` |
|
|
92
54
|
| `--button-spacing-gap` | `height` | `var(--apex-spacing-4)` | `.apex-button.apex-text-md-button` |
|
|
93
55
|
| `--button-spacing-gap` | `height` | `var(--apex-spacing-4)` | `.apex-button.apex-text-sm-button` |
|
|
94
|
-
| `--button-
|
|
95
|
-
| `--button-
|
|
96
|
-
| `--button-
|
|
97
|
-
| `--button-
|
|
98
|
-
| `--button-
|
|
99
|
-
| `--button-
|
|
100
|
-
| `--button-
|
|
101
|
-
| `--button-
|
|
102
|
-
| `--button-
|
|
103
|
-
| `--button-
|
|
104
|
-
| `--button-
|
|
105
|
-
| `--button-
|
|
106
|
-
| `--button-
|
|
107
|
-
| `--button-stroke-default` | `border-color` | `var(--apex-stroke-error-primary)` | `.apex-button.apex-outline-error-button` |
|
|
108
|
-
| `--button-stroke-default` | `border-color` | `var(--apex-stroke-success-primary)` | `.apex-button.apex-outline-success-button` |
|
|
109
|
-
| `--button-stroke-default` | `border-color` | `var(--apex-stroke-warning-primary)` | `.apex-button.apex-outline-warning-button` |
|
|
110
|
-
| `--button-stroke-default` | `border-color` | `var(--apex-stroke-neutral-secondary)` | `.apex-button.apex-secondary-default-button` |
|
|
111
|
-
| `--button-stroke-default` | `border-color` | `var(--apex-stroke-neutral-transparent)` | `.apex-button.apex-text-default-button` |
|
|
112
|
-
| `--button-stroke-default` | `border-color` | `var(--apex-stroke-neutral-transparent)` | `.apex-button.apex-text-secondary-button` |
|
|
113
|
-
| `--button-stroke-selected` | `border-color` | `var(--apex-stroke-neutral-transparent)` | `.apex-button.apex-icon-error-button` |
|
|
114
|
-
| `--button-stroke-selected` | `border-color` | `var(--apex-stroke-brand-primary)` | `.apex-button.apex-icon-primary-button` |
|
|
115
|
-
| `--button-stroke-selected` | `border-color` | `var(--apex-stroke-neutral-transparent)` | `.apex-button.apex-icon-secondary-button` |
|
|
116
|
-
| `--button-stroke-selected` | `border-color` | `var(--apex-stroke-neutral-transparent)` | `.apex-button.apex-icon-success-button` |
|
|
117
|
-
| `--button-stroke-selected` | `border-color` | `var(--apex-stroke-neutral-transparent)` | `.apex-button.apex-icon-transparent-button` |
|
|
118
|
-
| `--button-stroke-selected` | `border-color` | `var(--apex-stroke-neutral-transparent)` | `.apex-button.apex-icon-warning-button` |
|
|
119
|
-
| `--button-stroke-selected` | `border-color` | `var(--apex-stroke-neutral-transparent)` | `.apex-button.apex-link-default-button` |
|
|
120
|
-
| `--button-stroke-selected` | `border-color` | `var(--apex-stroke-brand-primary)` | `.apex-button.apex-main-default-button` |
|
|
121
|
-
| `--button-stroke-selected` | `border-color` | `var(--apex-stroke-error-primary)` | `.apex-button.apex-main-error-button` |
|
|
122
|
-
| `--button-stroke-selected` | `border-color` | `var(--apex-stroke-success-primary)` | `.apex-button.apex-main-success-button` |
|
|
123
|
-
| `--button-stroke-selected` | `border-color` | `var(--apex-stroke-warning-primary)` | `.apex-button.apex-main-warning-button` |
|
|
124
|
-
| `--button-stroke-selected` | `border-color` | `var(--apex-stroke-brand-primary)` | `.apex-button.apex-outline-brand-button` |
|
|
125
|
-
| `--button-stroke-selected` | `border-color` | `var(--apex-stroke-neutral-quaternary)` | `.apex-button.apex-outline-default-button` |
|
|
126
|
-
| `--button-stroke-selected` | `border-color` | `var(--apex-stroke-error-primary)` | `.apex-button.apex-outline-error-button` |
|
|
127
|
-
| `--button-stroke-selected` | `border-color` | `var(--apex-stroke-success-primary)` | `.apex-button.apex-outline-success-button` |
|
|
128
|
-
| `--button-stroke-selected` | `border-color` | `var(--apex-stroke-warning-primary)` | `.apex-button.apex-outline-warning-button` |
|
|
129
|
-
| `--button-stroke-selected` | `border-color` | `var(--apex-stroke-brand-primary)` | `.apex-button.apex-secondary-default-button` |
|
|
130
|
-
| `--button-stroke-selected` | `border-color` | `var(--apex-stroke-neutral-transparent)` | `.apex-button.apex-text-default-button` |
|
|
131
|
-
| `--button-stroke-selected` | `border-color` | `var(--apex-stroke-neutral-transparent)` | `.apex-button.apex-text-secondary-button` |
|
|
56
|
+
| `--button-text-active` | `color` | `var(--apex-text-brand-primary)` | `.apex-button.apex-link-default-button` |
|
|
57
|
+
| `--button-text-active` | `color` | `var(--apex-text-neutral-inverse)` | `.apex-button.apex-main-default-button` |
|
|
58
|
+
| `--button-text-active` | `color` | `var(--apex-text-neutral-inverse)` | `.apex-button.apex-main-error-button` |
|
|
59
|
+
| `--button-text-active` | `color` | `var(--apex-text-neutral-inverse)` | `.apex-button.apex-main-success-button` |
|
|
60
|
+
| `--button-text-active` | `color` | `var(--apex-text-neutral-inverse)` | `.apex-button.apex-main-warning-button` |
|
|
61
|
+
| `--button-text-active` | `color` | `var(--apex-text-neutral-primary)` | `.apex-button.apex-outline-brand-button` |
|
|
62
|
+
| `--button-text-active` | `color` | `var(--apex-text-neutral-primary)` | `.apex-button.apex-outline-default-button` |
|
|
63
|
+
| `--button-text-active` | `color` | `var(--apex-text-neutral-primary)` | `.apex-button.apex-outline-error-button` |
|
|
64
|
+
| `--button-text-active` | `color` | `var(--apex-text-neutral-primary)` | `.apex-button.apex-outline-success-button` |
|
|
65
|
+
| `--button-text-active` | `color` | `var(--apex-text-neutral-primary)` | `.apex-button.apex-outline-warning-button` |
|
|
66
|
+
| `--button-text-active` | `color` | `var(--apex-text-neutral-inverse)` | `.apex-button.apex-secondary-default-button` |
|
|
67
|
+
| `--button-text-active` | `color` | `var(--apex-text-brand-primary)` | `.apex-button.apex-text-default-button` |
|
|
68
|
+
| `--button-text-active` | `color` | `var(--apex-text-brand-tertiary)` | `.apex-button.apex-text-secondary-button` |
|
|
132
69
|
| `--button-text-default` | `color` | `var(--apex-text-neutral-secondary)` | `.apex-button.apex-link-default-button` |
|
|
133
70
|
| `--button-text-default` | `color` | `var(--apex-text-neutral-inverse)` | `.apex-button.apex-main-default-button` |
|
|
134
71
|
| `--button-text-default` | `color` | `var(--apex-text-neutral-inverse)` | `.apex-button.apex-main-error-button` |
|
|
@@ -142,6 +79,19 @@
|
|
|
142
79
|
| `--button-text-default` | `color` | `var(--apex-text-neutral-primary)` | `.apex-button.apex-secondary-default-button` |
|
|
143
80
|
| `--button-text-default` | `color` | `var(--apex-text-neutral-primary)` | `.apex-button.apex-text-default-button` |
|
|
144
81
|
| `--button-text-default` | `color` | `var(--apex-text-neutral-primary)` | `.apex-button.apex-text-secondary-button` |
|
|
82
|
+
| `--button-text-hover` | `color`、`outline` | `var(--apex-text-brand-secondary)` | `.apex-button.apex-link-default-button` |
|
|
83
|
+
| `--button-text-hover` | `color`、`outline` | `var(--apex-text-neutral-inverse)` | `.apex-button.apex-main-default-button` |
|
|
84
|
+
| `--button-text-hover` | `color`、`outline` | `var(--apex-text-neutral-inverse)` | `.apex-button.apex-main-error-button` |
|
|
85
|
+
| `--button-text-hover` | `color`、`outline` | `var(--apex-text-neutral-inverse)` | `.apex-button.apex-main-success-button` |
|
|
86
|
+
| `--button-text-hover` | `color`、`outline` | `var(--apex-text-neutral-inverse)` | `.apex-button.apex-main-warning-button` |
|
|
87
|
+
| `--button-text-hover` | `color`、`outline` | `var(--apex-text-neutral-primary)` | `.apex-button.apex-outline-brand-button` |
|
|
88
|
+
| `--button-text-hover` | `color`、`outline` | `var(--apex-text-neutral-primary)` | `.apex-button.apex-outline-default-button` |
|
|
89
|
+
| `--button-text-hover` | `color`、`outline` | `var(--apex-text-neutral-primary)` | `.apex-button.apex-outline-error-button` |
|
|
90
|
+
| `--button-text-hover` | `color`、`outline` | `var(--apex-text-neutral-primary)` | `.apex-button.apex-outline-success-button` |
|
|
91
|
+
| `--button-text-hover` | `color`、`outline` | `var(--apex-text-neutral-primary)` | `.apex-button.apex-outline-warning-button` |
|
|
92
|
+
| `--button-text-hover` | `color`、`outline` | `var(--apex-text-neutral-primary)` | `.apex-button.apex-secondary-default-button` |
|
|
93
|
+
| `--button-text-hover` | `color`、`outline` | `var(--apex-text-neutral-secondary)` | `.apex-button.apex-text-default-button` |
|
|
94
|
+
| `--button-text-hover` | `color`、`outline` | `var(--apex-text-brand-secondary)` | `.apex-button.apex-text-secondary-button` |
|
|
145
95
|
| `--button-text-selected` | `color` | `var(--apex-text-brand-primary)` | `.apex-button.apex-link-default-button` |
|
|
146
96
|
| `--button-text-selected` | `color` | `var(--apex-text-neutral-inverse)` | `.apex-button.apex-main-default-button` |
|
|
147
97
|
| `--button-text-selected` | `color` | `var(--apex-text-neutral-inverse)` | `.apex-button.apex-main-error-button` |
|
package/src/button/llm.txt
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Button:标记一个或多个操作(提交、确认、跳转等)时。
|
|
4
4
|
|
|
5
|
-
包:`@apexhub/apex-ui-react`;版本:`1.2.
|
|
5
|
+
包:`@apexhub/apex-ui-react`;版本:`1.2.2`(当前源码快照,发布状态以安装包版本为准)。
|
|
6
6
|
|
|
7
7
|
公开导出:`Button`。
|
|
8
8
|
|
|
@@ -33,8 +33,8 @@ export default () => <Button type="primary">主要按钮</Button>
|
|
|
33
33
|
| 属性 | 说明 | 类型 | 必填 | 默认值 | 版本 |
|
|
34
34
|
| --- | --- | --- | --- | --- | --- |
|
|
35
35
|
| type | 按钮类型,控制外观样式<br>- `default`:默认边框按钮(白底)<br>- `primary`:主色实心按钮<br>- `danger`:危险操作(边框红色)<br>- `text`:纯文字,无边框无背景<br>- `link`:链接样式,无边框无背景<br>注:`tabCapsule` 为 Tabs capsule 内部变体,不在对外 API 中暴露。 | `"default" \| "primary" \| "danger" \| "text" \| "link"` | 否 | `'default'` | `0.1.0` |
|
|
36
|
-
| variant | Figma visual style. When provided, it overrides the style implied by `type`.<br>- `main`: solid emphasis<br>- `outline`: bordered emphasis<br>- `secondary`: neutral filled action<br>- `text` / `link`: low-emphasis actions<br>- `icon`: icon-only
|
|
37
|
-
| tone | Visual intent. `main`, `outline`, and `icon` support every tone;<br>`icon-transparent`, `secondary`, `text
|
|
36
|
+
| variant | Figma visual style. When provided, it overrides the style implied by `type`.<br>- `main`: solid emphasis<br>- `outline`: bordered emphasis<br>- `secondary`: neutral filled action<br>- `text` / `text-secondary` / `link`: low-emphasis actions<br>- `icon` / `icon-primary`: icon-only actions with hover fill<br>- `icon-transparent`: icon-only action, fully transparent background | `"text" \| "link" \| "main" \| "outline" \| "secondary" \| "text-secondary" \| "icon" \| "icon-primary" \| "icon-transparent" \| null` | 否 | — | `0.1.0` |
|
|
37
|
+
| tone | Visual intent. `main`, `outline`, and `icon` support every tone;<br>`icon-primary`, `icon-transparent`, `secondary`, `text`,<br>`text-secondary`, and `link` use `default`.<br>When omitted, the legacy `danger` type resolves to `error`; other types<br>resolve to `default`. | `"default" \| "error" \| "success" \| "warning" \| null` | 否 | — | `0.1.0` |
|
|
38
38
|
| size | 按钮尺寸(`medium` 32px / `small` 24px;水平内边距共用 `--button-spacing-padding-x`) | `"small" \| "medium" \| null` | 否 | `'medium'` | `0.1.0` |
|
|
39
39
|
| disabled | 是否禁用。禁用时不可点击,视觉降级 | `boolean` | 否 | `false` | — |
|
|
40
40
|
| loading | 是否显示加载状态。<br>loading 为 true 时:不可点击,icon 位置替换为 loading 指示器 | `boolean` | 否 | `false` | `0.1.0` |
|
|
@@ -44,6 +44,7 @@ export default () => <Button type="primary">主要按钮</Button>
|
|
|
44
44
|
| target | 链接 target。依赖 `href`,仅在 `href` 存在时生效。 | `string` | 否 | — | — |
|
|
45
45
|
| asChild | 将按钮的样式与 props 合并到直接子元素上,而非渲染内置 `<button>` / `<a>`。<br>用于多态组合——让任意元素(如 `<a>`、路由 `Link`)拥有按钮外观。<br>优先级高于 `href` / `htmlType`。 | `boolean` | 否 | `false` | `0.1.0` |
|
|
46
46
|
| icon | 前置图标。loading 为 true 时此 prop 被 loading 指示器替换 | `React.ReactNode` | 否 | — | — |
|
|
47
|
+
| suffixIcon | 尾部图标;loading 时仍保留在文案后方。 | `React.ReactNode` | 否 | — | — |
|
|
47
48
|
| block | 是否撑满父容器宽度(`display: flex; width: 100%`) | `boolean \| null` | 否 | `false` | `0.1.0` |
|
|
48
49
|
| className | 根节点类名 | `string` | 否 | — | — |
|
|
49
50
|
| style | 根节点内联样式(禁止硬编码色值,优先 CSS Token) | `React.CSSProperties` | 否 | — | — |
|
|
@@ -74,7 +75,7 @@ type ButtonVariants = VariantProps<typeof buttonVariants>
|
|
|
74
75
|
|
|
75
76
|
### 外观类型
|
|
76
77
|
|
|
77
|
-
通过 `type` 控制外观:`default`、`primary`、`danger`、`text`、`link`。`main` / `outline` / `icon` 等 Figma 样式可通过 `variant` + `tone`
|
|
78
|
+
通过 `type` 控制外观:`default`、`primary`、`danger`、`text`、`link`。`main` / `outline` / `icon` 等 Figma 样式可通过 `variant` + `tone` 组合;`text-secondary` 对应设计稿的透明文字样式,`icon-primary` 对应主色图标按钮。显式传入 `variant` 时优先于 `type`。
|
|
78
79
|
|
|
79
80
|
```tsx
|
|
80
81
|
import { Button } from '@apexhub/apex-ui-react'
|
|
@@ -92,7 +93,7 @@ export default () => (
|
|
|
92
93
|
|
|
93
94
|
### 尺寸
|
|
94
95
|
|
|
95
|
-
提供 `medium`(默认)与 `small`
|
|
96
|
+
提供 `medium`(默认)与 `small` 两种尺寸。对应文字为 14px / 20px 与 12px / 16px;前后图标占位分别为 20px 与 16px。
|
|
96
97
|
|
|
97
98
|
```tsx
|
|
98
99
|
import { Button } from '@apexhub/apex-ui-react'
|
|
@@ -150,9 +151,9 @@ export default () => (
|
|
|
150
151
|
)
|
|
151
152
|
```
|
|
152
153
|
|
|
153
|
-
###
|
|
154
|
+
### 图标
|
|
154
155
|
|
|
155
|
-
通过 `icon`
|
|
156
|
+
通过 `icon` 在文案前插入图标,`suffixIcon` 在文案后插入图标;`loading` 时前置 icon 会被 loading 指示器替换。
|
|
156
157
|
|
|
157
158
|
```tsx
|
|
158
159
|
import { Button } from '@apexhub/apex-ui-react'
|
|
@@ -169,7 +170,14 @@ export default () => (
|
|
|
169
170
|
<Button type="primary" icon={<StarIcon />}>
|
|
170
171
|
主要带图标
|
|
171
172
|
</Button>
|
|
173
|
+
<Button type="primary" icon={<StarIcon />} suffixIcon={<StarIcon />}>
|
|
174
|
+
前后图标
|
|
175
|
+
</Button>
|
|
176
|
+
<Button variant="text-secondary" suffixIcon={<StarIcon />}>
|
|
177
|
+
透明文字
|
|
178
|
+
</Button>
|
|
172
179
|
<Button type="primary" icon={<StarIcon />} aria-label="收藏" />
|
|
180
|
+
<Button variant="icon-primary" icon={<StarIcon />} aria-label="收藏(主色图标)" />
|
|
173
181
|
</div>
|
|
174
182
|
)
|
|
175
183
|
```
|
|
@@ -222,7 +230,7 @@ export default () => (
|
|
|
222
230
|
|
|
223
231
|
## DOM 结构
|
|
224
232
|
|
|
225
|
-
|
|
233
|
+
源码声明的静态 `data-slot`:`button-loading-icon`、`button-icon`、`button-suffix-icon`、`button-content`。具体节点随模式和状态出现,不表示固定嵌套顺序。
|
|
226
234
|
|
|
227
235
|
## 样式定制
|
|
228
236
|
|
package/src/button/tokens.txt
CHANGED
package/src/card/llm.txt
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Card:需要将一组相关信息收纳在带边框的容器内,与页面背景区分时。
|
|
4
4
|
|
|
5
|
-
包:`@apexhub/apex-ui-react`;版本:`1.2.
|
|
5
|
+
包:`@apexhub/apex-ui-react`;版本:`1.2.2`(当前源码快照,发布状态以安装包版本为准)。
|
|
6
6
|
|
|
7
7
|
公开导出:`Card`。
|
|
8
8
|
|
|
@@ -36,6 +36,7 @@ export default () => (
|
|
|
36
36
|
|
|
37
37
|
| 属性 | 说明 | 类型 | 必填 | 默认值 |
|
|
38
38
|
| --- | --- | --- | --- | --- |
|
|
39
|
+
| variant | 卡片表面层级;primary 用于页面主容器,secondary 用于嵌套区域 | `"primary" \| "secondary"` | 否 | — |
|
|
39
40
|
| title | 卡片标题,存在时渲染头部区域 | `React.ReactNode` | 否 | — |
|
|
40
41
|
| extra | 卡片右上角操作区域;与 title 任一存在即渲染 header | `React.ReactNode` | 否 | — |
|
|
41
42
|
| children | 卡片内容区 | `React.ReactNode` | 否 | — |
|
|
@@ -73,6 +74,28 @@ export default () => (
|
|
|
73
74
|
)
|
|
74
75
|
```
|
|
75
76
|
|
|
77
|
+
### 表面层级
|
|
78
|
+
|
|
79
|
+
React Card 可用 `variant` 切换 `primary`(默认)和 `secondary` 表面。悬停、按下以及通过 `data-selected` 标记选中时,边框会显示对应状态。
|
|
80
|
+
|
|
81
|
+
```tsx
|
|
82
|
+
import { Card } from '@apexhub/apex-ui-react'
|
|
83
|
+
|
|
84
|
+
export default () => (
|
|
85
|
+
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 16 }}>
|
|
86
|
+
<Card title="主表面" variant="primary" style={{ width: 240 }}>
|
|
87
|
+
页面中的主要内容区域
|
|
88
|
+
</Card>
|
|
89
|
+
<Card title="次级表面" variant="secondary" style={{ width: 240 }}>
|
|
90
|
+
需要区分层级的内容区域
|
|
91
|
+
</Card>
|
|
92
|
+
<Card title="已选中" variant="secondary" data-selected="" style={{ width: 240 }}>
|
|
93
|
+
通过 data-selected 标记选中状态
|
|
94
|
+
</Card>
|
|
95
|
+
</div>
|
|
96
|
+
)
|
|
97
|
+
```
|
|
98
|
+
|
|
76
99
|
## DOM 结构
|
|
77
100
|
|
|
78
101
|
源码声明的静态 `data-slot`:`card`、`card-header`、`card-title`、`card-extra`、`card-body`。具体节点随模式和状态出现,不表示固定嵌套顺序。
|
package/src/card/tokens.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Card Token 明细
|
|
2
2
|
|
|
3
|
-
包:`@apexhub/apex-ui-react`;版本:`1.2.
|
|
3
|
+
包:`@apexhub/apex-ui-react`;版本:`1.2.2`(当前源码快照)。
|
|
4
4
|
|
|
5
5
|
按需读取:[组件用法](./llm.txt) · [主题与覆盖规则](../../llms-theme.txt)。
|
|
6
6
|
|
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
| `--card-spacing-padding-y-bottom` | `padding` | `var(--apex-spacing-16)` | `.apex-card.apex-default-card` |
|
|
19
19
|
| `--card-spacing-padding-y-top` | `padding-top` | `var(--apex-spacing-16)` | `.apex-card.apex-default-card` |
|
|
20
20
|
| `--card-spacing-padding-y-top-header` | `padding` | `var(--apex-spacing-12)` | `.apex-card.apex-default-card` |
|
|
21
|
+
| `--card-stroke-active` | `border-color` | `var(--apex-button-outline-brand-stroke-active)` | `.apex-card.apex-primary-card` |
|
|
22
|
+
| `--card-stroke-active` | `border-color` | `var(--apex-stroke-brand-tertiary)` | `.apex-card.apex-secondary-card` |
|
|
21
23
|
| `--card-stroke-default` | `border` | `var(--apex-stroke-neutral-secondary)` | `.apex-card.apex-primary-card` |
|
|
22
24
|
| `--card-stroke-default` | `border` | `var(--apex-stroke-neutral-tertiary)` | `.apex-card.apex-secondary-card` |
|
|
23
25
|
| `--card-stroke-hover` | `border-color` | `var(--apex-stroke-brand-secondary)` | `.apex-card.apex-primary-card` |
|
package/src/cascader/llm.txt
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Cascader:选项具有清晰的层级关系(省市区、分类目录等),需要从根到叶逐级选择时。
|
|
4
4
|
|
|
5
|
-
包:`@apexhub/apex-ui-react`;版本:`1.2.
|
|
5
|
+
包:`@apexhub/apex-ui-react`;版本:`1.2.2`(当前源码快照,发布状态以安装包版本为准)。
|
|
6
6
|
|
|
7
7
|
公开导出:`Cascader`。
|
|
8
8
|
|
|
@@ -268,7 +268,7 @@ type MaxTagCount = number | 'responsive'
|
|
|
268
268
|
|
|
269
269
|
### 默认值
|
|
270
270
|
|
|
271
|
-
通过 `defaultValue`
|
|
271
|
+
通过 `defaultValue` 设置非受控初始选中路径。示例可悬停查看清除按钮:medium/large 的下拉箭头为 16px、small 为 14px;清除按钮保持 14px。
|
|
272
272
|
|
|
273
273
|
```tsx
|
|
274
274
|
import { Cascader } from '@apexhub/apex-ui-react'
|
|
@@ -679,7 +679,7 @@ export default () => (
|
|
|
679
679
|
|
|
680
680
|
### 禁用选项
|
|
681
681
|
|
|
682
|
-
在 `options` 中为单项设置 `disabled: true`
|
|
682
|
+
在 `options` 中为单项设置 `disabled: true` 禁止选中。多选时预选一个可用子项,父级显示半选;点击父级只勾选可用子项,不会勾选禁用子项。
|
|
683
683
|
|
|
684
684
|
```tsx
|
|
685
685
|
import type { CascaderOption } from '@apexhub/apex-ui-react'
|
|
@@ -725,9 +725,27 @@ const options: CascaderOption[] = [
|
|
|
725
725
|
},
|
|
726
726
|
]
|
|
727
727
|
|
|
728
|
+
const multipleOptions: CascaderOption[] = [
|
|
729
|
+
{
|
|
730
|
+
value: 'team',
|
|
731
|
+
label: '项目组',
|
|
732
|
+
children: [
|
|
733
|
+
{ value: 'design', label: '设计', isLeaf: true },
|
|
734
|
+
{ value: 'engineering', label: '研发', isLeaf: true },
|
|
735
|
+
{ value: 'archived', label: '已归档', disabled: true, isLeaf: true },
|
|
736
|
+
],
|
|
737
|
+
},
|
|
738
|
+
]
|
|
739
|
+
|
|
728
740
|
export default () => (
|
|
729
|
-
<div style={cascaderWrapStyle}>
|
|
730
|
-
<Cascader options={options} placeholder="
|
|
741
|
+
<div style={{ ...cascaderWrapStyle, display: 'flex', flexDirection: 'column', gap: 12 }}>
|
|
742
|
+
<Cascader options={options} placeholder="禁用父级" />
|
|
743
|
+
<Cascader
|
|
744
|
+
multiple
|
|
745
|
+
options={multipleOptions}
|
|
746
|
+
defaultValue={[['team', 'design']]}
|
|
747
|
+
placeholder="多选与禁用子项"
|
|
748
|
+
/>
|
|
731
749
|
</div>
|
|
732
750
|
)
|
|
733
751
|
```
|
|
@@ -823,7 +841,7 @@ export default () => (
|
|
|
823
841
|
|
|
824
842
|
### 只读
|
|
825
843
|
|
|
826
|
-
`readOnly` 为 true
|
|
844
|
+
`readOnly` 为 true 时不可打开下拉、不可清除或修改;视觉使用禁用配色,但仍可聚焦。示例对照空值与已选路径。
|
|
827
845
|
|
|
828
846
|
```tsx
|
|
829
847
|
import { Cascader } from '@apexhub/apex-ui-react'
|
|
@@ -863,6 +881,7 @@ export default () => (
|
|
|
863
881
|
placeholder="可编辑"
|
|
864
882
|
allowClear
|
|
865
883
|
/>
|
|
884
|
+
<Cascader options={CASCADER_OPTIONS} readOnly placeholder="只读空值" />
|
|
866
885
|
<Cascader
|
|
867
886
|
options={CASCADER_OPTIONS}
|
|
868
887
|
defaultValue={['zhejiang', 'hangzhou', 'xihu']}
|