@apexhub/apex-ui-react-source 1.2.1 → 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/bin/apex-ui-react-source.mjs +0 -0
- package/dist/files/AGENTS.md +1 -1
- package/dist/files/_assets/table-empty.url.ts +1 -1
- package/dist/files/alert/Alert.tsx +2 -2
- package/dist/files/alert/alert.css +1 -0
- package/dist/files/alert/llm.txt +3 -3
- package/dist/files/alert/tokens.txt +1 -1
- package/dist/files/apex-provider/llm.txt +3 -2
- package/dist/files/auto-complete/llm.txt +1 -1
- package/dist/files/auto-complete/tokens.txt +1 -1
- package/dist/files/avatar/Avatar.tsx +1 -1
- package/dist/files/avatar/avatar.css +12 -1
- package/dist/files/avatar/llm.txt +1 -1
- package/dist/files/avatar/tokens.txt +1 -1
- package/dist/files/breadcrumb/Breadcrumb.tsx +17 -10
- package/dist/files/breadcrumb/breadcrumb.css +20 -10
- package/dist/files/breadcrumb/interface.ts +4 -4
- package/dist/files/breadcrumb/llm.txt +8 -8
- package/dist/files/breadcrumb/tokens.txt +46 -96
- package/dist/files/breadcrumb/variants.ts +6 -0
- package/dist/files/button/Button.tsx +25 -8
- package/dist/files/button/button.css +20 -2
- package/dist/files/button/interface.ts +7 -4
- package/dist/files/button/llm.txt +16 -8
- package/dist/files/button/tokens.txt +1 -1
- package/dist/files/button/variants.ts +8 -0
- package/dist/files/card/Card.tsx +8 -1
- package/dist/files/card/card-states.stories.css +42 -0
- package/dist/files/card/card.css +6 -1
- package/dist/files/card/interface.ts +3 -0
- package/dist/files/card/llm.txt +24 -1
- package/dist/files/card/tokens.txt +3 -1
- package/dist/files/cascader/cascader-data.ts +29 -8
- package/dist/files/cascader/cascader.css +45 -11
- package/dist/files/cascader/llm.txt +25 -6
- package/dist/files/cascader/tokens.txt +15 -7
- package/dist/files/cascader/variants.ts +1 -1
- package/dist/files/checkbox/Checkbox.tsx +26 -10
- package/dist/files/checkbox/checkbox.css +64 -22
- package/dist/files/checkbox/llm.txt +24 -13
- package/dist/files/checkbox/tokens.txt +10 -2
- package/dist/files/clear/clear.css +5 -2
- package/dist/files/collapse/llm.txt +1 -1
- package/dist/files/collapse/tokens.txt +1 -1
- package/dist/files/date-picker/RangePicker.tsx +5 -5
- package/dist/files/date-picker/Trigger.tsx +5 -5
- package/dist/files/date-picker/date-picker.css +53 -23
- package/dist/files/date-picker/llm.txt +7 -3
- package/dist/files/date-picker/tokens.txt +10 -10
- package/dist/files/divider/llm.txt +1 -1
- package/dist/files/divider/tokens.txt +1 -1
- package/dist/files/drawer/drawer.css +1 -0
- package/dist/files/drawer/llm.txt +2 -2
- package/dist/files/drawer/tokens.txt +2 -2
- package/dist/files/dropdown/llm.txt +1 -1
- package/dist/files/dropdown/tokens.txt +1 -1
- package/dist/files/form/form.css +10 -0
- package/dist/files/form/llm.txt +1 -1
- package/dist/files/form/tokens.txt +3 -1
- package/dist/files/grid/llm.txt +9 -9
- package/dist/files/image/ImagePreview.tsx +7 -6
- package/dist/files/image/image.css +0 -10
- package/dist/files/image/llm.txt +2 -2
- package/dist/files/image/tokens.txt +1 -1
- package/dist/files/input/input.css +14 -14
- package/dist/files/input/llm.txt +4 -2
- package/dist/files/input/tokens.txt +4 -4
- package/dist/files/input-number/InputNumber.tsx +2 -0
- package/dist/files/input-number/input-number.css +13 -1
- package/dist/files/input-number/llm.txt +8 -3
- package/dist/files/input-number/tokens.txt +4 -4
- package/dist/files/layout/llm.txt +1 -1
- package/dist/files/layout/tokens.txt +1 -1
- package/dist/files/llms.txt +18 -11
- package/dist/files/menu/Menu.tsx +5 -1
- package/dist/files/menu/llm.txt +19 -12
- package/dist/files/menu/menu.css +41 -15
- package/dist/files/menu/menu.figma.stories.css +39 -0
- package/dist/files/menu/tokens.txt +21 -8
- package/dist/files/message/llm.txt +1 -1
- package/dist/files/message/tokens.txt +1 -1
- package/dist/files/modal/Modal.tsx +1 -2
- package/dist/files/modal/interface.ts +1 -1
- package/dist/files/modal/llm.txt +9 -9
- package/dist/files/modal/tokens.txt +1 -1
- package/dist/files/notification/llm.txt +1 -1
- package/dist/files/notification/tokens.txt +1 -1
- package/dist/files/pagination/PageButton.tsx +2 -0
- package/dist/files/pagination/Pagination.tsx +149 -170
- package/dist/files/pagination/interface.ts +2 -2
- package/dist/files/pagination/llm.txt +18 -9
- package/dist/files/pagination/pagination.css +56 -17
- package/dist/files/pagination/tokens.txt +6 -4
- package/dist/files/popover/Popover.tsx +11 -3
- package/dist/files/popover/llm.txt +3 -3
- package/dist/files/popover/popover.css +30 -18
- package/dist/files/popover/popover.stories.css +6 -0
- package/dist/files/popover/tokens.txt +4 -14
- package/dist/files/progress/llm.txt +4 -4
- package/dist/files/progress/tokens.txt +1 -1
- package/dist/files/radio/llm.txt +38 -1
- package/dist/files/radio/radio.css +51 -14
- package/dist/files/radio/tokens.txt +11 -6
- package/dist/files/rate/llm.txt +1 -1
- package/dist/files/rate/tokens.txt +1 -1
- package/dist/files/select/llm.txt +8 -7
- package/dist/files/select/select.css +30 -16
- package/dist/files/select/tokens.txt +4 -4
- package/dist/files/skeleton/llm.txt +1 -1
- package/dist/files/skeleton/tokens.txt +1 -1
- package/dist/files/spin/llm.txt +1 -1
- package/dist/files/spin/tokens.txt +1 -1
- package/dist/files/steps/llm.txt +1 -1
- package/dist/files/steps/tokens.txt +1 -1
- package/dist/files/switch/llm.txt +1 -1
- package/dist/files/switch/tokens.txt +1 -1
- package/dist/files/table/constants.ts +2 -2
- package/dist/files/table/hooks/useRowSelection.tsx +3 -3
- package/dist/files/table/interface.ts +7 -7
- package/dist/files/table/llm.txt +16 -13
- package/dist/files/table/parts/TablePagination.tsx +8 -0
- package/dist/files/table/table.css +27 -10
- package/dist/files/table/tokenScopes.ts +2 -2
- package/dist/files/table/tokens.txt +2 -2
- package/dist/files/tabs/Tabs.tsx +1 -2
- package/dist/files/tabs/llm.txt +1 -1
- package/dist/files/tabs/tabs.css +3 -3
- package/dist/files/tabs/tokens.txt +1 -1
- package/dist/files/tag/interface.ts +2 -2
- package/dist/files/tag/llm.txt +7 -8
- package/dist/files/tag/tag.css +1 -1
- package/dist/files/tag/tokens.txt +1 -2
- package/dist/files/tag/variants.ts +12 -2
- package/dist/files/theme/aliases.css +1 -1
- package/dist/files/theme/component-tokens.css +7 -7
- package/dist/files/theme/primitives.css +1 -1
- package/dist/files/tooltip/Tooltip.tsx +2 -2
- package/dist/files/tooltip/llm.txt +1 -1
- package/dist/files/tooltip/tokens.txt +1 -1
- package/dist/files/tooltip/tooltip.css +2 -3
- package/dist/files/tree/Tree.tsx +8 -38
- package/dist/files/tree/llm.txt +11 -15
- package/dist/files/tree/tokens.txt +1 -3
- package/dist/files/tree/tree-data.ts +30 -2
- package/dist/files/tree/tree.css +17 -3
- package/dist/files/tree/variants.ts +4 -2
- package/dist/files/tree-select/llm.txt +32 -22
- package/dist/files/tree-select/tokens.txt +7 -6
- package/dist/files/tree-select/tree-select-data.ts +2 -1
- package/dist/files/tree-select/tree-select.css +61 -8
- package/dist/files/typography/llm.txt +1 -1
- package/dist/files/typography/tokens.txt +1 -1
- package/dist/files/upload/llm.txt +4 -2
- package/dist/files/upload/tokens.txt +5 -1
- package/dist/files/upload/upload.css +54 -11
- package/dist/manifest.json +155 -153
- package/package.json +24 -10
|
@@ -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` |
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import './button.css'
|
|
4
4
|
import { Slot as SlotPrimitive } from 'radix-ui'
|
|
5
5
|
import * as React from 'react'
|
|
6
|
-
import { Typography } from '../typography'
|
|
7
6
|
import { cn } from '../utils/cn'
|
|
8
7
|
import { isDevelopment } from '../utils/env'
|
|
9
8
|
import type { ButtonProps } from './interface'
|
|
@@ -71,7 +70,7 @@ function resolveButtonAppearance(
|
|
|
71
70
|
* 旋转动画由 button.css 中的 @keyframes apex-button-spin 驱动
|
|
72
71
|
*/
|
|
73
72
|
const LoadingIcon = React.memo(() => (
|
|
74
|
-
<span className={`${prefixCls}__loading-icon`} aria-hidden="true">
|
|
73
|
+
<span className={`${prefixCls}__loading-icon`} data-slot="button-loading-icon" aria-hidden="true">
|
|
75
74
|
<svg
|
|
76
75
|
viewBox="0 0 24 24"
|
|
77
76
|
fill="none"
|
|
@@ -104,6 +103,7 @@ export function Button({
|
|
|
104
103
|
target,
|
|
105
104
|
asChild = false,
|
|
106
105
|
icon,
|
|
106
|
+
suffixIcon,
|
|
107
107
|
block = false,
|
|
108
108
|
onClick,
|
|
109
109
|
children,
|
|
@@ -124,8 +124,8 @@ export function Button({
|
|
|
124
124
|
const appearance = resolveButtonAppearance(variantType, variant, tone)
|
|
125
125
|
|
|
126
126
|
const isDisabled = disabled || loading
|
|
127
|
-
const hasIcon = icon !== undefined || loading
|
|
128
|
-
const isIconOnly = hasIcon && children == null
|
|
127
|
+
const hasIcon = icon !== undefined || suffixIcon !== undefined || loading
|
|
128
|
+
const isIconOnly = hasIcon && children == null && !(icon != null && suffixIcon != null)
|
|
129
129
|
|
|
130
130
|
const classes = cn(
|
|
131
131
|
buttonVariants({
|
|
@@ -151,7 +151,11 @@ export function Button({
|
|
|
151
151
|
|
|
152
152
|
const loadingNode =
|
|
153
153
|
loadingIcon != null ? (
|
|
154
|
-
<span
|
|
154
|
+
<span
|
|
155
|
+
className={`${prefixCls}__loading-icon`}
|
|
156
|
+
data-slot="button-loading-icon"
|
|
157
|
+
aria-hidden="true"
|
|
158
|
+
>
|
|
155
159
|
{loadingIcon}
|
|
156
160
|
</span>
|
|
157
161
|
) : (
|
|
@@ -161,13 +165,23 @@ export function Button({
|
|
|
161
165
|
const iconNode = loading ? (
|
|
162
166
|
loadingNode
|
|
163
167
|
) : icon ? (
|
|
164
|
-
<span className={`${prefixCls}__icon`} aria-hidden="true">
|
|
168
|
+
<span className={`${prefixCls}__icon`} data-slot="button-icon" aria-hidden="true">
|
|
165
169
|
{icon}
|
|
166
170
|
</span>
|
|
167
171
|
) : null
|
|
168
172
|
|
|
173
|
+
const suffixIconNode = suffixIcon ? (
|
|
174
|
+
<span className={`${prefixCls}__icon`} data-slot="button-suffix-icon" aria-hidden="true">
|
|
175
|
+
{suffixIcon}
|
|
176
|
+
</span>
|
|
177
|
+
) : null
|
|
178
|
+
|
|
169
179
|
const contentNode =
|
|
170
|
-
children != null ?
|
|
180
|
+
children != null ? (
|
|
181
|
+
<span className={`${prefixCls}__content`} data-slot="button-content">
|
|
182
|
+
{children}
|
|
183
|
+
</span>
|
|
184
|
+
) : null
|
|
171
185
|
|
|
172
186
|
const sharedProps = {
|
|
173
187
|
'data-slot': dataSlot,
|
|
@@ -190,6 +204,7 @@ export function Button({
|
|
|
190
204
|
>
|
|
191
205
|
{iconNode}
|
|
192
206
|
<Slottable>{children}</Slottable>
|
|
207
|
+
{suffixIconNode}
|
|
193
208
|
</Slot>
|
|
194
209
|
)
|
|
195
210
|
}
|
|
@@ -209,7 +224,8 @@ export function Button({
|
|
|
209
224
|
tabIndex={isDisabled ? -1 : anchorTabIndex}
|
|
210
225
|
>
|
|
211
226
|
{iconNode}
|
|
212
|
-
|
|
227
|
+
{contentNode}
|
|
228
|
+
{suffixIconNode}
|
|
213
229
|
</a>
|
|
214
230
|
)
|
|
215
231
|
}
|
|
@@ -226,6 +242,7 @@ export function Button({
|
|
|
226
242
|
>
|
|
227
243
|
{iconNode}
|
|
228
244
|
{contentNode}
|
|
245
|
+
{suffixIconNode}
|
|
229
246
|
</button>
|
|
230
247
|
)
|
|
231
248
|
}
|
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
cursor: pointer;
|
|
25
25
|
user-select: none;
|
|
26
26
|
outline: none;
|
|
27
|
+
font-size: 14px;
|
|
28
|
+
line-height: 20px;
|
|
27
29
|
|
|
28
30
|
height: var(--button-size-height);
|
|
29
31
|
padding: 0 var(--button-spacing-padding-x);
|
|
@@ -153,6 +155,8 @@
|
|
|
153
155
|
|
|
154
156
|
.apex-button--small {
|
|
155
157
|
height: var(--button-size-height);
|
|
158
|
+
font-size: 12px;
|
|
159
|
+
line-height: 16px;
|
|
156
160
|
}
|
|
157
161
|
|
|
158
162
|
/* ── Block / Loading / Disabled 交互 ─────────────────────────────────────── */
|
|
@@ -164,7 +168,6 @@
|
|
|
164
168
|
|
|
165
169
|
.apex-button--loading {
|
|
166
170
|
cursor: default;
|
|
167
|
-
opacity: 0.85;
|
|
168
171
|
}
|
|
169
172
|
|
|
170
173
|
.apex-button:disabled,
|
|
@@ -195,10 +198,25 @@ a.apex-button[aria-disabled='true'] {
|
|
|
195
198
|
align-items: center;
|
|
196
199
|
justify-content: center;
|
|
197
200
|
flex-shrink: 0;
|
|
198
|
-
|
|
201
|
+
width: 20px;
|
|
202
|
+
height: 20px;
|
|
203
|
+
font-size: 20px;
|
|
199
204
|
line-height: 1;
|
|
200
205
|
}
|
|
201
206
|
|
|
207
|
+
.apex-button--small .apex-button__icon,
|
|
208
|
+
.apex-button--small .apex-button__loading-icon {
|
|
209
|
+
width: 16px;
|
|
210
|
+
height: 16px;
|
|
211
|
+
font-size: 16px;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.apex-icon-primary-button .apex-button__icon {
|
|
215
|
+
width: 16px;
|
|
216
|
+
height: 16px;
|
|
217
|
+
font-size: 16px;
|
|
218
|
+
}
|
|
219
|
+
|
|
202
220
|
.apex-button__icon {
|
|
203
221
|
color: var(--button-icon-default, currentColor);
|
|
204
222
|
}
|
|
@@ -31,8 +31,8 @@ export interface ButtonProps
|
|
|
31
31
|
* - `main`: solid emphasis
|
|
32
32
|
* - `outline`: bordered emphasis
|
|
33
33
|
* - `secondary`: neutral filled action
|
|
34
|
-
* - `text` / `link`: low-emphasis actions
|
|
35
|
-
* - `icon`: icon-only
|
|
34
|
+
* - `text` / `text-secondary` / `link`: low-emphasis actions
|
|
35
|
+
* - `icon` / `icon-primary`: icon-only actions with hover fill
|
|
36
36
|
* - `icon-transparent`: icon-only action, fully transparent background
|
|
37
37
|
* @since 0.1.0
|
|
38
38
|
*/
|
|
@@ -40,8 +40,8 @@ export interface ButtonProps
|
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* Visual intent. `main`, `outline`, and `icon` support every tone;
|
|
43
|
-
* `icon-transparent`, `secondary`, `text`,
|
|
44
|
-
* `secondary`,
|
|
43
|
+
* `icon-primary`, `icon-transparent`, `secondary`, `text`,
|
|
44
|
+
* `text-secondary`, and `link` use `default`.
|
|
45
45
|
* When omitted, the legacy `danger` type resolves to `error`; other types
|
|
46
46
|
* resolve to `default`.
|
|
47
47
|
* @since 0.1.0
|
|
@@ -112,6 +112,9 @@ export interface ButtonProps
|
|
|
112
112
|
*/
|
|
113
113
|
icon?: React.ReactNode
|
|
114
114
|
|
|
115
|
+
/** 尾部图标;loading 时仍保留在文案后方。 */
|
|
116
|
+
suffixIcon?: React.ReactNode
|
|
117
|
+
|
|
115
118
|
/**
|
|
116
119
|
* 是否撑满父容器宽度(`display: flex; width: 100%`)
|
|
117
120
|
* @default false
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Button:标记一个或多个操作(提交、确认、跳转等)时。
|
|
4
4
|
|
|
5
|
-
版本:`1.2.
|
|
5
|
+
版本:`1.2.2`。组件源码在本目录,属于当前项目。
|
|
6
6
|
|
|
7
7
|
公开导出:`Button`。
|
|
8
8
|
|
|
@@ -31,8 +31,8 @@ export default () => <Button type="primary">主要按钮</Button>
|
|
|
31
31
|
| 属性 | 说明 | 类型 | 必填 | 默认值 | 版本 |
|
|
32
32
|
| --- | --- | --- | --- | --- | --- |
|
|
33
33
|
| 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` |
|
|
34
|
-
| 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
|
|
35
|
-
| tone | Visual intent. `main`, `outline`, and `icon` support every tone;<br>`icon-transparent`, `secondary`, `text
|
|
34
|
+
| 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` |
|
|
35
|
+
| 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` |
|
|
36
36
|
| size | 按钮尺寸(`medium` 32px / `small` 24px;水平内边距共用 `--button-spacing-padding-x`) | `"small" \| "medium" \| null` | 否 | `'medium'` | `0.1.0` |
|
|
37
37
|
| disabled | 是否禁用。禁用时不可点击,视觉降级 | `boolean` | 否 | `false` | — |
|
|
38
38
|
| loading | 是否显示加载状态。<br>loading 为 true 时:不可点击,icon 位置替换为 loading 指示器 | `boolean` | 否 | `false` | `0.1.0` |
|
|
@@ -42,6 +42,7 @@ export default () => <Button type="primary">主要按钮</Button>
|
|
|
42
42
|
| target | 链接 target。依赖 `href`,仅在 `href` 存在时生效。 | `string` | 否 | — | — |
|
|
43
43
|
| asChild | 将按钮的样式与 props 合并到直接子元素上,而非渲染内置 `<button>` / `<a>`。<br>用于多态组合——让任意元素(如 `<a>`、路由 `Link`)拥有按钮外观。<br>优先级高于 `href` / `htmlType`。 | `boolean` | 否 | `false` | `0.1.0` |
|
|
44
44
|
| icon | 前置图标。loading 为 true 时此 prop 被 loading 指示器替换 | `React.ReactNode` | 否 | — | — |
|
|
45
|
+
| suffixIcon | 尾部图标;loading 时仍保留在文案后方。 | `React.ReactNode` | 否 | — | — |
|
|
45
46
|
| block | 是否撑满父容器宽度(`display: flex; width: 100%`) | `boolean \| null` | 否 | `false` | `0.1.0` |
|
|
46
47
|
| className | 根节点类名 | `string` | 否 | — | — |
|
|
47
48
|
| style | 根节点内联样式(禁止硬编码色值,优先 CSS Token) | `React.CSSProperties` | 否 | — | — |
|
|
@@ -72,7 +73,7 @@ type ButtonVariants = VariantProps<typeof buttonVariants>
|
|
|
72
73
|
|
|
73
74
|
### 外观类型
|
|
74
75
|
|
|
75
|
-
通过 `type` 控制外观:`default`、`primary`、`danger`、`text`、`link`。`main` / `outline` / `icon` 等 Figma 样式可通过 `variant` + `tone`
|
|
76
|
+
通过 `type` 控制外观:`default`、`primary`、`danger`、`text`、`link`。`main` / `outline` / `icon` 等 Figma 样式可通过 `variant` + `tone` 组合;`text-secondary` 对应设计稿的透明文字样式,`icon-primary` 对应主色图标按钮。显式传入 `variant` 时优先于 `type`。
|
|
76
77
|
|
|
77
78
|
```tsx
|
|
78
79
|
import { Button } from '@/components/apex/button'
|
|
@@ -90,7 +91,7 @@ export default () => (
|
|
|
90
91
|
|
|
91
92
|
### 尺寸
|
|
92
93
|
|
|
93
|
-
提供 `medium`(默认)与 `small`
|
|
94
|
+
提供 `medium`(默认)与 `small` 两种尺寸。对应文字为 14px / 20px 与 12px / 16px;前后图标占位分别为 20px 与 16px。
|
|
94
95
|
|
|
95
96
|
```tsx
|
|
96
97
|
import { Button } from '@/components/apex/button'
|
|
@@ -148,9 +149,9 @@ export default () => (
|
|
|
148
149
|
)
|
|
149
150
|
```
|
|
150
151
|
|
|
151
|
-
###
|
|
152
|
+
### 图标
|
|
152
153
|
|
|
153
|
-
通过 `icon`
|
|
154
|
+
通过 `icon` 在文案前插入图标,`suffixIcon` 在文案后插入图标;`loading` 时前置 icon 会被 loading 指示器替换。
|
|
154
155
|
|
|
155
156
|
```tsx
|
|
156
157
|
import { Button } from '@/components/apex/button'
|
|
@@ -167,7 +168,14 @@ export default () => (
|
|
|
167
168
|
<Button type="primary" icon={<StarIcon />}>
|
|
168
169
|
主要带图标
|
|
169
170
|
</Button>
|
|
171
|
+
<Button type="primary" icon={<StarIcon />} suffixIcon={<StarIcon />}>
|
|
172
|
+
前后图标
|
|
173
|
+
</Button>
|
|
174
|
+
<Button variant="text-secondary" suffixIcon={<StarIcon />}>
|
|
175
|
+
透明文字
|
|
176
|
+
</Button>
|
|
170
177
|
<Button type="primary" icon={<StarIcon />} aria-label="收藏" />
|
|
178
|
+
<Button variant="icon-primary" icon={<StarIcon />} aria-label="收藏(主色图标)" />
|
|
171
179
|
</div>
|
|
172
180
|
)
|
|
173
181
|
```
|
|
@@ -220,7 +228,7 @@ export default () => (
|
|
|
220
228
|
|
|
221
229
|
## DOM 结构
|
|
222
230
|
|
|
223
|
-
|
|
231
|
+
源码声明的静态 `data-slot`:`button-loading-icon`、`button-icon`、`button-suffix-icon`、`button-content`。具体节点随模式和状态出现,不表示固定嵌套顺序。
|
|
224
232
|
|
|
225
233
|
## 样式定制
|
|
226
234
|
|
|
@@ -13,8 +13,10 @@ export const buttonVariants = cva('apex-button', {
|
|
|
13
13
|
outline: 'apex-button--outline',
|
|
14
14
|
secondary: 'apex-button--secondary',
|
|
15
15
|
text: 'apex-button--text',
|
|
16
|
+
'text-secondary': 'apex-button--text',
|
|
16
17
|
link: 'apex-button--link',
|
|
17
18
|
icon: 'apex-button--icon-variant',
|
|
19
|
+
'icon-primary': 'apex-button--icon-variant',
|
|
18
20
|
'icon-transparent': 'apex-button--icon-variant',
|
|
19
21
|
},
|
|
20
22
|
tone: {
|
|
@@ -53,8 +55,10 @@ export const buttonVariants = cva('apex-button', {
|
|
|
53
55
|
{ variant: 'outline', tone: 'warning', class: 'apex-outline-warning-button' },
|
|
54
56
|
{ variant: 'secondary', tone: 'default', class: 'apex-secondary-default-button' },
|
|
55
57
|
{ variant: 'text', tone: 'default', class: 'apex-text-default-button' },
|
|
58
|
+
{ variant: 'text-secondary', tone: 'default', class: 'apex-text-secondary-button' },
|
|
56
59
|
{ variant: 'link', tone: 'default', class: 'apex-link-default-button' },
|
|
57
60
|
{ variant: 'icon', tone: 'default', class: 'apex-icon-secondary-button' },
|
|
61
|
+
{ variant: 'icon-primary', tone: 'default', class: 'apex-icon-primary-button' },
|
|
58
62
|
{ variant: 'icon', tone: 'error', class: 'apex-icon-error-button' },
|
|
59
63
|
{ variant: 'icon', tone: 'success', class: 'apex-icon-success-button' },
|
|
60
64
|
{ variant: 'icon', tone: 'warning', class: 'apex-icon-warning-button' },
|
|
@@ -68,10 +72,14 @@ export const buttonVariants = cva('apex-button', {
|
|
|
68
72
|
{ variant: 'secondary', size: 'small', class: 'apex-main-sm-button' },
|
|
69
73
|
{ variant: 'text', size: 'medium', class: 'apex-text-md-button' },
|
|
70
74
|
{ variant: 'text', size: 'small', class: 'apex-text-sm-button' },
|
|
75
|
+
{ variant: 'text-secondary', size: 'medium', class: 'apex-text-md-button' },
|
|
76
|
+
{ variant: 'text-secondary', size: 'small', class: 'apex-text-sm-button' },
|
|
71
77
|
{ variant: 'link', size: 'medium', class: 'apex-link-md-button' },
|
|
72
78
|
{ variant: 'link', size: 'small', class: 'apex-link-sm-button' },
|
|
73
79
|
{ variant: 'icon', size: 'medium', class: 'apex-icon-md-button' },
|
|
74
80
|
{ variant: 'icon', size: 'small', class: 'apex-icon-sm-button' },
|
|
81
|
+
{ variant: 'icon-primary', size: 'medium', class: 'apex-icon-md-button' },
|
|
82
|
+
{ variant: 'icon-primary', size: 'small', class: 'apex-icon-sm-button' },
|
|
75
83
|
{ variant: 'icon-transparent', size: 'medium', class: 'apex-icon-md-button' },
|
|
76
84
|
{ variant: 'icon-transparent', size: 'small', class: 'apex-icon-sm-button' },
|
|
77
85
|
],
|
package/dist/files/card/Card.tsx
CHANGED
|
@@ -19,6 +19,7 @@ const prefixCls = 'apex-card'
|
|
|
19
19
|
* data-headless 属性供 CSS 切换顶部 padding(见 card.css)。
|
|
20
20
|
*/
|
|
21
21
|
export const Card: React.FC<CardProps> = ({
|
|
22
|
+
variant = 'primary',
|
|
22
23
|
title,
|
|
23
24
|
extra,
|
|
24
25
|
children,
|
|
@@ -33,7 +34,13 @@ export const Card: React.FC<CardProps> = ({
|
|
|
33
34
|
ref={ref}
|
|
34
35
|
data-slot="card"
|
|
35
36
|
data-headless={hasHeader ? 'false' : 'true'}
|
|
36
|
-
|
|
37
|
+
data-variant={variant}
|
|
38
|
+
className={cn(
|
|
39
|
+
prefixCls,
|
|
40
|
+
'apex-default-card',
|
|
41
|
+
variant === 'secondary' ? 'apex-secondary-card' : 'apex-primary-card',
|
|
42
|
+
className,
|
|
43
|
+
)}
|
|
37
44
|
{...restProps}
|
|
38
45
|
>
|
|
39
46
|
{hasHeader && (
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
.card-states-gallery {
|
|
2
|
+
display: grid;
|
|
3
|
+
grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
|
|
4
|
+
gap: 24px 16px;
|
|
5
|
+
width: min(100%, 1328px);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.card-states-gallery__item {
|
|
9
|
+
min-width: 0;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.card-states-gallery__label {
|
|
13
|
+
display: block;
|
|
14
|
+
margin-bottom: 8px;
|
|
15
|
+
font-size: 12px;
|
|
16
|
+
color: var(--apex-text-neutral-secondary);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.card-states-gallery__card {
|
|
20
|
+
width: 100%;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.card-states-gallery__content {
|
|
24
|
+
display: grid;
|
|
25
|
+
place-items: center;
|
|
26
|
+
height: 89px;
|
|
27
|
+
font: 400 16px/24px Inter, sans-serif;
|
|
28
|
+
background: color-mix(
|
|
29
|
+
in srgb,
|
|
30
|
+
var(--apex-fill-neutral-secondary),
|
|
31
|
+
var(--apex-fill-neutral-tertiary)
|
|
32
|
+
);
|
|
33
|
+
color: var(--apex-text-neutral-primary);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.card-states-gallery__card[data-preview-state='hover'] {
|
|
37
|
+
border-color: var(--card-stroke-hover);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.card-states-gallery__card[data-preview-state='active'] {
|
|
41
|
+
border-color: var(--card-stroke-active, var(--apex-stroke-brand-tertiary));
|
|
42
|
+
}
|
package/dist/files/card/card.css
CHANGED
|
@@ -20,7 +20,12 @@
|
|
|
20
20
|
border-color: var(--card-stroke-hover);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
.apex-card
|
|
23
|
+
.apex-card:active {
|
|
24
|
+
/* The primary token currently resolves through a missing alias. */
|
|
25
|
+
border-color: var(--card-stroke-active, var(--apex-stroke-brand-tertiary));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.apex-card[data-selected]:not([data-selected='false']),
|
|
24
29
|
.apex-card[aria-selected='true'] {
|
|
25
30
|
border-color: var(--card-stroke-selected);
|
|
26
31
|
}
|
|
@@ -5,6 +5,9 @@ import type * as React from 'react'
|
|
|
5
5
|
* 根据是否传入 title/extra 自动切换「有标题」「无标题」两种形态。
|
|
6
6
|
*/
|
|
7
7
|
export interface CardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
8
|
+
/** 卡片表面层级;primary 用于页面主容器,secondary 用于嵌套区域 */
|
|
9
|
+
variant?: 'primary' | 'secondary'
|
|
10
|
+
|
|
8
11
|
/** 卡片标题,存在时渲染头部区域 */
|
|
9
12
|
title?: React.ReactNode
|
|
10
13
|
|
package/dist/files/card/llm.txt
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Card:需要将一组相关信息收纳在带边框的容器内,与页面背景区分时。
|
|
4
4
|
|
|
5
|
-
版本:`1.2.
|
|
5
|
+
版本:`1.2.2`。组件源码在本目录,属于当前项目。
|
|
6
6
|
|
|
7
7
|
公开导出:`Card`。
|
|
8
8
|
|
|
@@ -34,6 +34,7 @@ export default () => (
|
|
|
34
34
|
|
|
35
35
|
| 属性 | 说明 | 类型 | 必填 | 默认值 |
|
|
36
36
|
| --- | --- | --- | --- | --- |
|
|
37
|
+
| variant | 卡片表面层级;primary 用于页面主容器,secondary 用于嵌套区域 | `"primary" \| "secondary"` | 否 | — |
|
|
37
38
|
| title | 卡片标题,存在时渲染头部区域 | `React.ReactNode` | 否 | — |
|
|
38
39
|
| extra | 卡片右上角操作区域;与 title 任一存在即渲染 header | `React.ReactNode` | 否 | — |
|
|
39
40
|
| children | 卡片内容区 | `React.ReactNode` | 否 | — |
|
|
@@ -72,6 +73,28 @@ export default () => (
|
|
|
72
73
|
)
|
|
73
74
|
```
|
|
74
75
|
|
|
76
|
+
### 表面层级
|
|
77
|
+
|
|
78
|
+
React Card 可用 `variant` 切换 `primary`(默认)和 `secondary` 表面。悬停、按下以及通过 `data-selected` 标记选中时,边框会显示对应状态。
|
|
79
|
+
|
|
80
|
+
```tsx
|
|
81
|
+
import { Card } from '@/components/apex/card'
|
|
82
|
+
|
|
83
|
+
export default () => (
|
|
84
|
+
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 16 }}>
|
|
85
|
+
<Card title="主表面" variant="primary" style={{ width: 240 }}>
|
|
86
|
+
页面中的主要内容区域
|
|
87
|
+
</Card>
|
|
88
|
+
<Card title="次级表面" variant="secondary" style={{ width: 240 }}>
|
|
89
|
+
需要区分层级的内容区域
|
|
90
|
+
</Card>
|
|
91
|
+
<Card title="已选中" variant="secondary" data-selected="" style={{ width: 240 }}>
|
|
92
|
+
通过 data-selected 标记选中状态
|
|
93
|
+
</Card>
|
|
94
|
+
</div>
|
|
95
|
+
)
|
|
96
|
+
```
|
|
97
|
+
|
|
75
98
|
## DOM 结构
|
|
76
99
|
|
|
77
100
|
源码声明的静态 `data-slot`:`card`、`card-header`、`card-title`、`card-extra`、`card-body`。具体节点随模式和状态出现,不表示固定嵌套顺序。
|