@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.
Files changed (157) hide show
  1. package/bin/apex-ui-react-source.mjs +0 -0
  2. package/dist/files/AGENTS.md +1 -1
  3. package/dist/files/_assets/table-empty.url.ts +1 -1
  4. package/dist/files/alert/Alert.tsx +2 -2
  5. package/dist/files/alert/alert.css +1 -0
  6. package/dist/files/alert/llm.txt +3 -3
  7. package/dist/files/alert/tokens.txt +1 -1
  8. package/dist/files/apex-provider/llm.txt +3 -2
  9. package/dist/files/auto-complete/llm.txt +1 -1
  10. package/dist/files/auto-complete/tokens.txt +1 -1
  11. package/dist/files/avatar/Avatar.tsx +1 -1
  12. package/dist/files/avatar/avatar.css +12 -1
  13. package/dist/files/avatar/llm.txt +1 -1
  14. package/dist/files/avatar/tokens.txt +1 -1
  15. package/dist/files/breadcrumb/Breadcrumb.tsx +17 -10
  16. package/dist/files/breadcrumb/breadcrumb.css +20 -10
  17. package/dist/files/breadcrumb/interface.ts +4 -4
  18. package/dist/files/breadcrumb/llm.txt +8 -8
  19. package/dist/files/breadcrumb/tokens.txt +46 -96
  20. package/dist/files/breadcrumb/variants.ts +6 -0
  21. package/dist/files/button/Button.tsx +25 -8
  22. package/dist/files/button/button.css +20 -2
  23. package/dist/files/button/interface.ts +7 -4
  24. package/dist/files/button/llm.txt +16 -8
  25. package/dist/files/button/tokens.txt +1 -1
  26. package/dist/files/button/variants.ts +8 -0
  27. package/dist/files/card/Card.tsx +8 -1
  28. package/dist/files/card/card-states.stories.css +42 -0
  29. package/dist/files/card/card.css +6 -1
  30. package/dist/files/card/interface.ts +3 -0
  31. package/dist/files/card/llm.txt +24 -1
  32. package/dist/files/card/tokens.txt +3 -1
  33. package/dist/files/cascader/cascader-data.ts +29 -8
  34. package/dist/files/cascader/cascader.css +45 -11
  35. package/dist/files/cascader/llm.txt +25 -6
  36. package/dist/files/cascader/tokens.txt +15 -7
  37. package/dist/files/cascader/variants.ts +1 -1
  38. package/dist/files/checkbox/Checkbox.tsx +26 -10
  39. package/dist/files/checkbox/checkbox.css +64 -22
  40. package/dist/files/checkbox/llm.txt +24 -13
  41. package/dist/files/checkbox/tokens.txt +10 -2
  42. package/dist/files/clear/clear.css +5 -2
  43. package/dist/files/collapse/llm.txt +1 -1
  44. package/dist/files/collapse/tokens.txt +1 -1
  45. package/dist/files/date-picker/RangePicker.tsx +5 -5
  46. package/dist/files/date-picker/Trigger.tsx +5 -5
  47. package/dist/files/date-picker/date-picker.css +53 -23
  48. package/dist/files/date-picker/llm.txt +7 -3
  49. package/dist/files/date-picker/tokens.txt +10 -10
  50. package/dist/files/divider/llm.txt +1 -1
  51. package/dist/files/divider/tokens.txt +1 -1
  52. package/dist/files/drawer/drawer.css +1 -0
  53. package/dist/files/drawer/llm.txt +2 -2
  54. package/dist/files/drawer/tokens.txt +2 -2
  55. package/dist/files/dropdown/llm.txt +1 -1
  56. package/dist/files/dropdown/tokens.txt +1 -1
  57. package/dist/files/form/form.css +10 -0
  58. package/dist/files/form/llm.txt +1 -1
  59. package/dist/files/form/tokens.txt +3 -1
  60. package/dist/files/grid/llm.txt +9 -9
  61. package/dist/files/image/ImagePreview.tsx +7 -6
  62. package/dist/files/image/image.css +0 -10
  63. package/dist/files/image/llm.txt +2 -2
  64. package/dist/files/image/tokens.txt +1 -1
  65. package/dist/files/input/input.css +14 -14
  66. package/dist/files/input/llm.txt +4 -2
  67. package/dist/files/input/tokens.txt +4 -4
  68. package/dist/files/input-number/InputNumber.tsx +2 -0
  69. package/dist/files/input-number/input-number.css +13 -1
  70. package/dist/files/input-number/llm.txt +8 -3
  71. package/dist/files/input-number/tokens.txt +4 -4
  72. package/dist/files/layout/llm.txt +1 -1
  73. package/dist/files/layout/tokens.txt +1 -1
  74. package/dist/files/llms.txt +18 -11
  75. package/dist/files/menu/Menu.tsx +5 -1
  76. package/dist/files/menu/llm.txt +19 -12
  77. package/dist/files/menu/menu.css +41 -15
  78. package/dist/files/menu/menu.figma.stories.css +39 -0
  79. package/dist/files/menu/tokens.txt +21 -8
  80. package/dist/files/message/llm.txt +1 -1
  81. package/dist/files/message/tokens.txt +1 -1
  82. package/dist/files/modal/Modal.tsx +1 -2
  83. package/dist/files/modal/interface.ts +1 -1
  84. package/dist/files/modal/llm.txt +9 -9
  85. package/dist/files/modal/tokens.txt +1 -1
  86. package/dist/files/notification/llm.txt +1 -1
  87. package/dist/files/notification/tokens.txt +1 -1
  88. package/dist/files/pagination/PageButton.tsx +2 -0
  89. package/dist/files/pagination/Pagination.tsx +149 -170
  90. package/dist/files/pagination/interface.ts +2 -2
  91. package/dist/files/pagination/llm.txt +18 -9
  92. package/dist/files/pagination/pagination.css +56 -17
  93. package/dist/files/pagination/tokens.txt +6 -4
  94. package/dist/files/popover/Popover.tsx +11 -3
  95. package/dist/files/popover/llm.txt +3 -3
  96. package/dist/files/popover/popover.css +30 -18
  97. package/dist/files/popover/popover.stories.css +6 -0
  98. package/dist/files/popover/tokens.txt +4 -14
  99. package/dist/files/progress/llm.txt +4 -4
  100. package/dist/files/progress/tokens.txt +1 -1
  101. package/dist/files/radio/llm.txt +38 -1
  102. package/dist/files/radio/radio.css +51 -14
  103. package/dist/files/radio/tokens.txt +11 -6
  104. package/dist/files/rate/llm.txt +1 -1
  105. package/dist/files/rate/tokens.txt +1 -1
  106. package/dist/files/select/llm.txt +8 -7
  107. package/dist/files/select/select.css +30 -16
  108. package/dist/files/select/tokens.txt +4 -4
  109. package/dist/files/skeleton/llm.txt +1 -1
  110. package/dist/files/skeleton/tokens.txt +1 -1
  111. package/dist/files/spin/llm.txt +1 -1
  112. package/dist/files/spin/tokens.txt +1 -1
  113. package/dist/files/steps/llm.txt +1 -1
  114. package/dist/files/steps/tokens.txt +1 -1
  115. package/dist/files/switch/llm.txt +1 -1
  116. package/dist/files/switch/tokens.txt +1 -1
  117. package/dist/files/table/constants.ts +2 -2
  118. package/dist/files/table/hooks/useRowSelection.tsx +3 -3
  119. package/dist/files/table/interface.ts +7 -7
  120. package/dist/files/table/llm.txt +16 -13
  121. package/dist/files/table/parts/TablePagination.tsx +8 -0
  122. package/dist/files/table/table.css +27 -10
  123. package/dist/files/table/tokenScopes.ts +2 -2
  124. package/dist/files/table/tokens.txt +2 -2
  125. package/dist/files/tabs/Tabs.tsx +1 -2
  126. package/dist/files/tabs/llm.txt +1 -1
  127. package/dist/files/tabs/tabs.css +3 -3
  128. package/dist/files/tabs/tokens.txt +1 -1
  129. package/dist/files/tag/interface.ts +2 -2
  130. package/dist/files/tag/llm.txt +7 -8
  131. package/dist/files/tag/tag.css +1 -1
  132. package/dist/files/tag/tokens.txt +1 -2
  133. package/dist/files/tag/variants.ts +12 -2
  134. package/dist/files/theme/aliases.css +1 -1
  135. package/dist/files/theme/component-tokens.css +7 -7
  136. package/dist/files/theme/primitives.css +1 -1
  137. package/dist/files/tooltip/Tooltip.tsx +2 -2
  138. package/dist/files/tooltip/llm.txt +1 -1
  139. package/dist/files/tooltip/tokens.txt +1 -1
  140. package/dist/files/tooltip/tooltip.css +2 -3
  141. package/dist/files/tree/Tree.tsx +8 -38
  142. package/dist/files/tree/llm.txt +11 -15
  143. package/dist/files/tree/tokens.txt +1 -3
  144. package/dist/files/tree/tree-data.ts +30 -2
  145. package/dist/files/tree/tree.css +17 -3
  146. package/dist/files/tree/variants.ts +4 -2
  147. package/dist/files/tree-select/llm.txt +32 -22
  148. package/dist/files/tree-select/tokens.txt +7 -6
  149. package/dist/files/tree-select/tree-select-data.ts +2 -1
  150. package/dist/files/tree-select/tree-select.css +61 -8
  151. package/dist/files/typography/llm.txt +1 -1
  152. package/dist/files/typography/tokens.txt +1 -1
  153. package/dist/files/upload/llm.txt +4 -2
  154. package/dist/files/upload/tokens.txt +5 -1
  155. package/dist/files/upload/upload.css +54 -11
  156. package/dist/manifest.json +155 -153
  157. package/package.json +24 -10
@@ -1,6 +1,6 @@
1
1
  # Card Token 明细
2
2
 
3
- 包:`@apexhub/apex-ui-react`;版本:`1.2.0`(当前源码快照)。
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` |
@@ -192,6 +192,22 @@ export function getDescendantKeys(pathKey: string, index: CascaderIndex): string
192
192
  return index.nodes.get(pathKey)?.descendantKeys ?? []
193
193
  }
194
194
 
195
+ function getCheckableDescendantKeys(pathKey: string, index: CascaderIndex): string[] {
196
+ const result: string[] = []
197
+ const walk = (key: string) => {
198
+ const meta = index.nodes.get(key)
199
+ if (!meta?.option.children || meta.option.disabled) return
200
+ for (const child of meta.option.children) {
201
+ if (child.disabled) continue
202
+ const childKey = pathToKey([...meta.path, child.value])
203
+ result.push(childKey)
204
+ walk(childKey)
205
+ }
206
+ }
207
+ walk(pathKey)
208
+ return result
209
+ }
210
+
195
211
  export function expandPathsToCheckedKeys(
196
212
  paths: CascaderValuePath[],
197
213
  index: CascaderIndex,
@@ -201,7 +217,7 @@ export function expandPathsToCheckedKeys(
201
217
  const key = pathToKey(path)
202
218
  if (!index.nodes.has(key)) continue
203
219
  result.add(key)
204
- for (const descendant of getDescendantKeys(key, index)) {
220
+ for (const descendant of getCheckableDescendantKeys(key, index)) {
205
221
  result.add(descendant)
206
222
  }
207
223
  }
@@ -218,7 +234,7 @@ export function applyCascaderShowCheckedStrategy(
218
234
  if (strategy === 'SHOW_CHILD') {
219
235
  return checkedKeys
220
236
  .filter((key) => {
221
- const descendants = getDescendantKeys(key, index)
237
+ const descendants = getCheckableDescendantKeys(key, index)
222
238
  return !descendants.some((childKey) => checkedSet.has(childKey))
223
239
  })
224
240
  .map((key) => index.nodes.get(key)!.path)
@@ -226,7 +242,7 @@ export function applyCascaderShowCheckedStrategy(
226
242
 
227
243
  const hidden = new Set<string>()
228
244
  for (const key of checkedKeys) {
229
- const descendants = getDescendantKeys(key, index)
245
+ const descendants = getCheckableDescendantKeys(key, index)
230
246
  if (descendants.length > 0 && descendants.every((childKey) => checkedSet.has(childKey))) {
231
247
  for (const childKey of descendants) hidden.add(childKey)
232
248
  }
@@ -243,7 +259,7 @@ export function getCheckState(
243
259
  if (checkedKeys.has(pathKey)) {
244
260
  return { checked: true, indeterminate: false }
245
261
  }
246
- const descendants = getDescendantKeys(pathKey, index)
262
+ const descendants = getCheckableDescendantKeys(pathKey, index)
247
263
  const some = descendants.some((key) => checkedKeys.has(key))
248
264
  return { checked: false, indeterminate: some }
249
265
  }
@@ -255,9 +271,9 @@ export function toggleCascadeCheck(
255
271
  ): Set<string> {
256
272
  const next = new Set(checkedKeys)
257
273
  const meta = index.nodes.get(pathKey)
258
- if (!meta) return next
274
+ if (!meta || meta.option.disabled) return next
259
275
 
260
- const keysToToggle = [pathKey, ...meta.descendantKeys]
276
+ const keysToToggle = [pathKey, ...getCheckableDescendantKeys(pathKey, index)]
261
277
  const allChecked = keysToToggle.every((key) => next.has(key))
262
278
 
263
279
  if (allChecked) {
@@ -270,7 +286,7 @@ export function toggleCascadeCheck(
270
286
 
271
287
  /**
272
288
  * Reconcile parent checked-state bottom-up: a non-leaf node is checked iff all of
273
- * its direct children are checked. Toggling leaves only mutates leaf keys, so this
289
+ * its checkable direct children are checked. Toggling leaves only mutates leaf keys, so this
274
290
  * is what promotes a parent from indeterminate to fully checked once every child is
275
291
  * selected (and demotes it when a child is unchecked).
276
292
  */
@@ -279,9 +295,14 @@ export function reconcileCheckedKeys(checkedKeys: Set<string>, index: CascaderIn
279
295
  // Deepest paths first so a child's reconciled state is known before its parent.
280
296
  const metas = [...index.nodes.values()].sort((a, b) => b.path.length - a.path.length)
281
297
  for (const meta of metas) {
298
+ if (meta.option.disabled) continue
282
299
  const children = meta.option.children
283
300
  if (!children || children.length === 0) continue
284
- const allChecked = children.every((child) => next.has(pathToKey([...meta.path, child.value])))
301
+ const checkableChildren = children.filter((child) => !child.disabled)
302
+ if (checkableChildren.length === 0) continue
303
+ const allChecked = checkableChildren.every((child) =>
304
+ next.has(pathToKey([...meta.path, child.value])),
305
+ )
285
306
  if (allChecked) next.add(meta.pathKey)
286
307
  else next.delete(meta.pathKey)
287
308
  }
@@ -58,13 +58,13 @@
58
58
  pointer-events: auto;
59
59
  }
60
60
 
61
- /* 只读:focus / hover 保持 default */
61
+ /* 只读沿用 disabled 视觉。 */
62
62
  .apex-cascader__selector[data-readonly]:not([data-disabled]) .apex-input__inner,
63
63
  .apex-cascader__selector[data-readonly]:not([data-disabled]):hover .apex-input__inner,
64
64
  .apex-cascader__selector[data-readonly]:not([data-disabled]):focus-within .apex-input__inner {
65
- background-color: var(--input-fill-default);
66
- border-color: var(--input-stroke-default);
67
- color: var(--input-text-placeholder-default);
65
+ background-color: var(--input-fill-disabled);
66
+ border-color: var(--input-stroke-disabled);
67
+ color: var(--input-text-filled-disabled);
68
68
  }
69
69
 
70
70
  .apex-cascader__selector[data-status='error']:not([data-disabled]):not([data-readonly]) .apex-input__inner {
@@ -92,12 +92,7 @@
92
92
  color: inherit;
93
93
  }
94
94
 
95
- .apex-cascader__selector:not([data-disabled]):not([data-state='open']):not(:focus-within):not(
96
- [data-status='error']
97
- )
98
- .apex-cascader__selection[data-selected]
99
- .apex-typography__content,
100
- .apex-cascader__selector[data-readonly]:not([data-disabled]):not([data-state='open']):not(
95
+ .apex-cascader__selector:not([data-disabled]):not([data-readonly]):not([data-state='open']):not(:focus-within):not(
101
96
  [data-status='error']
102
97
  )
103
98
  .apex-cascader__selection[data-selected]
@@ -105,6 +100,13 @@
105
100
  color: var(--input-text-filled-default);
106
101
  }
107
102
 
103
+ .apex-cascader__selector[data-status='error']:not([data-disabled]):not([data-readonly])
104
+ .apex-cascader__selection[data-selected],
105
+ .apex-cascader__selector[data-status='error']:not([data-disabled]):not([data-readonly])
106
+ .apex-cascader__selection[data-selected] .apex-typography__content {
107
+ color: var(--input-text-filled-error);
108
+ }
109
+
108
110
  .apex-cascader__selector.apex-input:hover:not([data-disabled]):not([data-readonly])
109
111
  .apex-cascader__placeholder {
110
112
  color: var(--input-text-placeholder-hover);
@@ -173,6 +175,19 @@
173
175
  color: var(--input-text-placeholder-disabled);
174
176
  }
175
177
 
178
+ .apex-cascader__selector.apex-input[data-readonly]:not([data-disabled])
179
+ .apex-cascader__search::placeholder,
180
+ .apex-cascader__selector.apex-input[data-readonly]:not([data-disabled])
181
+ .apex-cascader__placeholder {
182
+ color: var(--input-text-placeholder-disabled);
183
+ }
184
+
185
+ .apex-cascader__selector:is([data-disabled], [data-readonly])
186
+ .apex-cascader__selection[data-selected]
187
+ .apex-typography__content {
188
+ color: var(--input-text-filled-disabled);
189
+ }
190
+
176
191
  /* showSearch:clear / suffix 贴右;search 保持 field-sizing: content 宽度。
177
192
  __search / .apex-clear / __suffix 为 .apex-input__inner 直接子级,:has(>) 锚定到 __inner。 */
178
193
  .apex-cascader__selector
@@ -224,6 +239,18 @@
224
239
  color: var(--input-icon-default);
225
240
  }
226
241
 
242
+ /* 图标尺寸显式锚到 --input-icon-icon(md/lg 16px、sm 14px):BEM 类是 __suffix 而非
243
+ input.css 的 .apex-input__suffix,拿不到那边的 svg 尺寸规则,否则 svg 的
244
+ width="1em" 会跟随继承字号渲染成 14px,比设计稿小 2px。
245
+ 注意 Clear Button 走 --clear-size-size(恒 14px),与此处不同轨。 */
246
+ .apex-cascader__prefix svg,
247
+ .apex-cascader__suffix svg {
248
+ display: block;
249
+ flex-shrink: 0;
250
+ width: var(--input-icon-icon);
251
+ height: var(--input-icon-icon);
252
+ }
253
+
227
254
  .apex-cascader__selector.apex-input:hover:not([data-disabled]):not([data-readonly])
228
255
  .apex-cascader__prefix,
229
256
  .apex-cascader__selector.apex-input:hover:not([data-disabled]):not([data-readonly])
@@ -254,6 +281,11 @@
254
281
  color: var(--input-icon-disabled);
255
282
  }
256
283
 
284
+ .apex-cascader__selector.apex-input[data-readonly]:not([data-disabled]) .apex-cascader__prefix,
285
+ .apex-cascader__selector.apex-input[data-readonly]:not([data-disabled]) .apex-cascader__suffix {
286
+ color: var(--input-icon-disabled);
287
+ }
288
+
257
289
  .apex-cascader__popup {
258
290
  z-index: var(--apex-z-index-cascader, 1050);
259
291
  }
@@ -263,12 +295,14 @@
263
295
  height: auto;
264
296
  min-height: 100%;
265
297
  margin-inline: 0;
298
+ width: var(--apex-border-1);
299
+ background: var(--dropdown-stroke-container-default, var(--apex-stroke-neutral-quaternary));
266
300
  }
267
301
 
268
302
  /* Menus fill the popup viewport; columns own vertical scroll (not __viewport).
269
303
  Column max-height subtracts menus padding so content stays inside the shell. */
270
304
  .apex-cascader__menus {
271
- gap: var(--dropdown-size-container-gap);
305
+ gap: var(--cascader-spacing-gap);
272
306
  display: flex;
273
307
  flex-direction: row;
274
308
  align-items: stretch;
@@ -2,7 +2,7 @@
2
2
 
3
3
  > Cascader:选项具有清晰的层级关系(省市区、分类目录等),需要从根到叶逐级选择时。
4
4
 
5
- 版本:`1.2.1`。组件源码在本目录,属于当前项目。
5
+ 版本:`1.2.2`。组件源码在本目录,属于当前项目。
6
6
 
7
7
  公开导出:`Cascader`。
8
8
 
@@ -266,7 +266,7 @@ type MaxTagCount = number | 'responsive'
266
266
 
267
267
  ### 默认值
268
268
 
269
- 通过 `defaultValue` 设置非受控初始选中路径。
269
+ 通过 `defaultValue` 设置非受控初始选中路径。示例可悬停查看清除按钮:medium/large 的下拉箭头为 16px、small 为 14px;清除按钮保持 14px。
270
270
 
271
271
  ```tsx
272
272
  import { Cascader } from '@/components/apex/cascader'
@@ -678,7 +678,7 @@ export default () => (
678
678
 
679
679
  ### 禁用选项
680
680
 
681
- 在 `options` 中为单项设置 `disabled: true` 禁止选中。
681
+ 在 `options` 中为单项设置 `disabled: true` 禁止选中。多选时预选一个可用子项,父级显示半选;点击父级只勾选可用子项,不会勾选禁用子项。
682
682
 
683
683
  ```tsx
684
684
  import type { CascaderOption } from '@/components/apex/cascader'
@@ -724,9 +724,27 @@ const options: CascaderOption[] = [
724
724
  },
725
725
  ]
726
726
 
727
+ const multipleOptions: CascaderOption[] = [
728
+ {
729
+ value: 'team',
730
+ label: '项目组',
731
+ children: [
732
+ { value: 'design', label: '设计', isLeaf: true },
733
+ { value: 'engineering', label: '研发', isLeaf: true },
734
+ { value: 'archived', label: '已归档', disabled: true, isLeaf: true },
735
+ ],
736
+ },
737
+ ]
738
+
727
739
  export default () => (
728
- <div style={cascaderWrapStyle}>
729
- <Cascader options={options} placeholder="禁用选项" />
740
+ <div style={{ ...cascaderWrapStyle, display: 'flex', flexDirection: 'column', gap: 12 }}>
741
+ <Cascader options={options} placeholder="禁用父级" />
742
+ <Cascader
743
+ multiple
744
+ options={multipleOptions}
745
+ defaultValue={[['team', 'design']]}
746
+ placeholder="多选与禁用子项"
747
+ />
730
748
  </div>
731
749
  )
732
750
  ```
@@ -822,7 +840,7 @@ export default () => (
822
840
 
823
841
  ### 只读
824
842
 
825
- `readOnly` 为 true 时仅展示已选值,不可打开下拉、不可清除或修改;与 `disabled` 正交,适合表单预览等场景。
843
+ `readOnly` 为 true 时不可打开下拉、不可清除或修改;视觉使用禁用配色,但仍可聚焦。示例对照空值与已选路径。
826
844
 
827
845
  ```tsx
828
846
  import { Cascader } from '@/components/apex/cascader'
@@ -862,6 +880,7 @@ export default () => (
862
880
  placeholder="可编辑"
863
881
  allowClear
864
882
  />
883
+ <Cascader options={CASCADER_OPTIONS} readOnly placeholder="只读空值" />
865
884
  <Cascader
866
885
  options={CASCADER_OPTIONS}
867
886
  defaultValue={['zhejiang', 'hangzhou', 'xihu']}
@@ -1,6 +1,6 @@
1
1
  # Cascader Token 明细
2
2
 
3
- 包:`@apexhub/apex-ui-react`;版本:`1.2.0`(当前源码快照)。
3
+ 包:`@apexhub/apex-ui-react`;版本:`1.2.2`(当前源码快照)。
4
4
 
5
5
  按需读取:[组件用法](./llm.txt) · [主题与覆盖规则](../../llms-theme.txt)。
6
6
 
@@ -10,7 +10,11 @@
10
10
 
11
11
  | Token | 用途(CSS 属性) | 定义值 | 定义作用域 |
12
12
  | --- | --- | --- | --- |
13
+ | `--cascader-spacing-gap` | `gap` | `var(--apex-spacing-4)` | `.apex-cascader.apex-default-cascader` |
14
+ | `--checkbox-fill-check-active` | `fill` | `var(--apex-fill-brand-tertiary)` | `.apex-checkbox.apex-default-checkbox` |
15
+ | `--checkbox-fill-check-hover` | `fill` | `var(--apex-fill-brand-secondary)` | `.apex-checkbox.apex-default-checkbox` |
13
16
  | `--checkbox-fill-checked` | `fill`、`outline` | `var(--apex-fill-brand-primary)` | `.apex-checkbox.apex-default-checkbox` |
17
+ | `--checkbox-fill-disabled` | `fill` | `var(--apex-fill-neutral-quinary)` | `.apex-checkbox.apex-default-checkbox` |
14
18
  | `--checkbox-fill-indeterminate` | `fill` | `var(--apex-fill-brand-primary)` | `.apex-checkbox.apex-default-checkbox` |
15
19
  | `--checkbox-group-spacing-gap-x` | `column-gap` | `var(--apex-spacing-12)` | `.apex-checkbox-group.apex-default-checkbox-group` |
16
20
  | `--checkbox-group-spacing-gap-y` | `row-gap` | `var(--apex-spacing-8)` | `.apex-checkbox-group.apex-default-checkbox-group` |
@@ -19,13 +23,18 @@
19
23
  | `--checkbox-icon-indeterminate` | `color` | `var(--apex-icon-neutral-quaternary-stable)` | `.apex-checkbox.apex-default-checkbox` |
20
24
  | `--checkbox-radius-radius` | `border-radius` | `var(--apex-radius-4)` | `.apex-checkbox.apex-default-checkbox` |
21
25
  | `--checkbox-spacing-gap` | `gap` | `var(--apex-spacing-4)` | `.apex-checkbox.apex-default-checkbox` |
26
+ | `--checkbox-stroke-active` | `color` | `var(--apex-stroke-neutral-septenary)` | `.apex-checkbox.apex-default-checkbox` |
27
+ | `--checkbox-stroke-check-active` | `color` | `var(--apex-stroke-brand-tertiary)` | `.apex-checkbox.apex-default-checkbox` |
28
+ | `--checkbox-stroke-check-hover` | `color` | `var(--apex-stroke-brand-secondary)` | `.apex-checkbox.apex-default-checkbox` |
22
29
  | `--checkbox-stroke-checked` | `color` | `var(--apex-stroke-brand-primary)` | `.apex-checkbox.apex-default-checkbox` |
23
30
  | `--checkbox-stroke-default` | `color` | `var(--apex-stroke-neutral-denary)` | `.apex-checkbox.apex-default-checkbox` |
24
- | `--checkbox-stroke-disabled` | `color`、`fill` | `var(--apex-stroke-neutral-quinary)` | `.apex-checkbox.apex-default-checkbox` |
31
+ | `--checkbox-stroke-disabled` | `color` | `var(--apex-stroke-neutral-quinary)` | `.apex-checkbox.apex-default-checkbox` |
25
32
  | `--checkbox-stroke-hover` | `color` | `var(--apex-stroke-neutral-octonary)` | `.apex-checkbox.apex-default-checkbox` |
26
33
  | `--checkbox-stroke-indeterminate` | `color` | `var(--apex-stroke-brand-primary)` | `.apex-checkbox.apex-default-checkbox` |
34
+ | `--checkbox-text-active` | `color` | `var(--apex-text-neutral-tertiary)` | `.apex-checkbox.apex-default-checkbox` |
27
35
  | `--checkbox-text-default` | `color` | `var(--apex-text-neutral-primary)` | `.apex-checkbox.apex-default-checkbox` |
28
36
  | `--checkbox-text-disabled` | `color` | `var(--apex-text-neutral-disabled)` | `.apex-checkbox.apex-default-checkbox` |
37
+ | `--checkbox-text-hover` | `color` | `var(--apex-text-neutral-secondary)` | `.apex-checkbox.apex-default-checkbox` |
29
38
  | `--dropdown-fill-active` | `background-color` | `var(--apex-fill-neutral-quaternary)` | `.apex-dropdown.apex-default-dropdown` |
30
39
  | `--dropdown-fill-container-default` | `background-color` | `var(--apex-fill-neutral-secondary)` | `.apex-dropdown.apex-default-dropdown` |
31
40
  | `--dropdown-fill-default` | `background-color` | `var(--apex-fill-neutral-transparent)` | `.apex-dropdown.apex-default-dropdown` |
@@ -65,7 +74,7 @@
65
74
  | `--dropdown-spacing-item-padding-x-item` | `padding`、`padding-inline` | `var(--apex-spacing-12)` | `.apex-dropdown.apex-sm-dropdown` |
66
75
  | `--dropdown-stroke` | `border-width` | `var(--apex-border-1)` | `.apex-dropdown.apex-lg-dropdown` |
67
76
  | `--dropdown-stroke` | `border-width` | `var(--apex-border-1)` | `.apex-dropdown.apex-sm-dropdown` |
68
- | `--dropdown-stroke-container-default` | `border-color` | `var(--apex-stroke-neutral-quinary)` | `.apex-dropdown.apex-default-dropdown` |
77
+ | `--dropdown-stroke-container-default` | `background`、`border-color` | `var(--apex-stroke-neutral-quinary)` | `.apex-dropdown.apex-default-dropdown` |
69
78
  | `--dropdown-text-active` | `color` | `var(--apex-text-neutral-primary)` | `.apex-dropdown.apex-default-dropdown` |
70
79
  | `--dropdown-text-default` | `color` | `var(--apex-text-neutral-primary)` | `.apex-dropdown.apex-default-dropdown` |
71
80
  | `--dropdown-text-disabled` | `color` | `var(--apex-text-neutral-disabled)` | `.apex-dropdown.apex-default-dropdown` |
@@ -181,10 +190,10 @@
181
190
  | `--input-stroke-stroke` | `border-width`、`padding-block` | `var(--apex-border-1)` | `.apex-input.apex-sm-input` |
182
191
  | `--input-text-filled-default` | `-webkit-text-fill-color`、`caret-color`、`color` | `var(--apex-text-neutral-primary)` | `.apex-input.apex-default-input` |
183
192
  | `--input-text-filled-default` | `-webkit-text-fill-color`、`caret-color`、`color` | `var(--apex-text-neutral-primary)` | `.apex-input.apex-elevated-input` |
184
- | `--input-text-filled-disabled` | `-webkit-text-fill-color`、`caret-color`、`color` | `var(--apex-text-neutral-secondary)` | `.apex-input.apex-default-input` |
193
+ | `--input-text-filled-disabled` | `-webkit-text-fill-color`、`caret-color`、`color` | `var(--apex-text-neutral-disabled)` | `.apex-input.apex-default-input` |
185
194
  | `--input-text-filled-disabled` | `-webkit-text-fill-color`、`caret-color`、`color` | `var(--apex-text-neutral-disabled)` | `.apex-input.apex-elevated-input` |
186
- | `--input-text-filled-error` | `-webkit-text-fill-color`、`caret-color`、`color` | `var(--apex-text-neutral-tertiary)` | `.apex-input.apex-default-input` |
187
- | `--input-text-filled-error` | `-webkit-text-fill-color`、`caret-color`、`color` | `var(--apex-text-neutral-tertiary)` | `.apex-input.apex-elevated-input` |
195
+ | `--input-text-filled-error` | `-webkit-text-fill-color`、`caret-color`、`color` | `var(--apex-text-neutral-primary)` | `.apex-input.apex-default-input` |
196
+ | `--input-text-filled-error` | `-webkit-text-fill-color`、`caret-color`、`color` | `var(--apex-text-neutral-primary)` | `.apex-input.apex-elevated-input` |
188
197
  | `--input-text-filled-focused` | `-webkit-text-fill-color`、`caret-color`、`color` | `var(--apex-text-neutral-primary)` | `.apex-input.apex-default-input` |
189
198
  | `--input-text-filled-focused` | `-webkit-text-fill-color`、`caret-color`、`color` | `var(--apex-text-neutral-primary)` | `.apex-input.apex-elevated-input` |
190
199
  | `--input-text-filled-hover` | `-webkit-text-fill-color`、`caret-color`、`color` | `var(--apex-text-neutral-primary)` | `.apex-input.apex-default-input` |
@@ -200,7 +209,6 @@
200
209
  | `--input-text-placeholder-hover` | `color` | `var(--apex-text-neutral-tertiary)` | `.apex-input.apex-default-input` |
201
210
  | `--input-text-placeholder-hover` | `color` | `var(--apex-text-neutral-tertiary)` | `.apex-input.apex-elevated-input` |
202
211
  | `--tag-active` | `color` | `var(--apex-icon-neutral-tertiary)` | `.apex-tag.apex-close-tag` |
203
- | `--tag-default` | `color` | `var(--apex-icon-neutral-primary)` | `.apex-tag.apex-close-tag` |
204
212
  | `--tag-fill-default` | `background-color` | `var(--apex-fill-brand-alpha-secondary)` | `.apex-tag.apex-filled-default-brand-tag` |
205
213
  | `--tag-fill-default` | `background-color` | `var(--apex-fill-neutral-secondary)` | `.apex-tag.apex-filled-default-default-tag` |
206
214
  | `--tag-fill-default` | `background-color` | `var(--apex-fill-error-alpha-secondary)` | `.apex-tag.apex-filled-default-error-tag` |
@@ -23,7 +23,7 @@ export const cascaderSelectorVariants = cva('apex-cascader__selector apex-input'
23
23
  选项行复用 `.apex-dropdown__item` BEM 拿布局(flex / padding / min-height),
24
24
  token 值从祖先 popup 继承(对齐 Select)。 */
25
25
  export const cascaderPopupVariants = cva(
26
- 'apex-cascader__popup apex-dropdown apex-default-dropdown apex-sm-dropdown shadow',
26
+ 'apex-cascader__popup apex-cascader apex-default-cascader apex-dropdown apex-default-dropdown apex-sm-dropdown shadow',
27
27
  )
28
28
 
29
29
  export const cascaderMenusVariants = cva('apex-cascader__menus')
@@ -23,11 +23,15 @@ import {
23
23
  // 颜色由 CSS 通过 `currentColor` + `--checkbox-*` token 注入,不在 SVG 内硬编码。
24
24
  // ────────────────────────────────────────────────────────────────────────────
25
25
 
26
- const BOX_PATH =
27
- 'M1.33334 8C1.33334 4.85731 1.33334 3.28596 2.30965 2.30965C3.28596 1.33334 4.85731 1.33334 8 1.33334C11.1427 1.33334 12.714 1.33334 13.6904 2.30965C14.6667 3.28596 14.6667 4.85731 14.6667 8C14.6667 11.1427 14.6667 12.714 13.6904 13.6904C12.714 14.6667 11.1427 14.6667 8 14.6667C4.85731 14.6667 3.28596 14.6667 2.30965 13.6904C1.33334 12.714 1.33334 11.1427 1.33334 8Z'
26
+ // The 20px control contains the smaller Figma glyph, leaving its designed
27
+ // internal breathing room while keeping the full control area clickable.
28
+ const BOX_OUTLINE_PATH =
29
+ 'M16.1665 10.0005C16.1665 8.41528 16.1658 7.27626 16.0493 6.40967C15.9348 5.55764 15.717 5.04331 15.3374 4.66357C14.9577 4.28382 14.4435 4.06527 13.5913 3.95068C12.7247 3.83417 11.5858 3.8335 10.0005 3.8335C8.41531 3.8335 7.27626 3.83423 6.40967 3.95068C5.5574 4.06527 5.04334 4.2838 4.66357 4.66357C4.2838 5.04334 4.06527 5.5574 3.95068 6.40967C3.83423 7.27626 3.8335 8.41531 3.8335 10.0005C3.8335 11.5858 3.83417 12.7247 3.95068 13.5913C4.06527 14.4435 4.28382 14.9577 4.66357 15.3374C5.04331 15.717 5.55764 15.9348 6.40967 16.0493C7.27626 16.1658 8.41528 16.1665 10.0005 16.1665C11.5858 16.1665 12.7247 16.1658 13.5913 16.0493C14.4435 15.9347 14.9577 15.7171 15.3374 15.3374C15.7171 14.9577 15.9347 14.4435 16.0493 13.5913C16.1658 12.7247 16.1665 11.5858 16.1665 10.0005ZM17.1665 10.0005C17.1665 11.5574 17.168 12.7755 17.0405 13.7241C16.911 14.6873 16.641 15.4479 16.0444 16.0444C15.4479 16.641 14.6873 16.911 13.7241 17.0405C12.7755 17.168 11.5574 17.1665 10.0005 17.1665C8.44327 17.1665 7.22465 17.1681 6.27588 17.0405C5.31292 16.9111 4.55302 16.6407 3.95654 16.0444C3.36 15.4479 3.08994 14.6873 2.96045 13.7241C2.83292 12.7754 2.8335 11.5575 2.8335 10.0005C2.8335 8.44327 2.83289 7.22465 2.96045 6.27588C3.08995 5.31279 3.36003 4.55305 3.95654 3.95654C4.55305 3.36003 5.31279 3.08995 6.27588 2.96045C7.22465 2.83289 8.44327 2.8335 10.0005 2.8335C11.5575 2.8335 12.7754 2.83292 13.7241 2.96045C14.6873 3.08994 15.4479 3.36 16.0444 3.95654C16.6407 4.55302 16.9111 5.31292 17.0405 6.27588C17.1681 7.22465 17.1665 8.44327 17.1665 10.0005Z'
30
+ const BOX_FILLED_PATH =
31
+ 'M3.33333 10C3.33333 6.8573 3.33333 5.28595 4.30964 4.30964C5.28595 3.33333 6.8573 3.33333 10 3.33333C13.1427 3.33333 14.714 3.33333 15.6904 4.30964C16.6667 5.28595 16.6667 6.8573 16.6667 10C16.6667 13.1427 16.6667 14.714 15.6904 15.6904C14.714 16.6667 13.1427 16.6667 10 16.6667C6.8573 16.6667 5.28595 16.6667 4.30964 15.6904C3.33333 14.714 3.33333 13.1427 3.33333 10Z'
28
32
 
29
- const CHECK_PATH = 'M5.6 8.4L7.12381 10L10.9333 6'
30
- const MINUS_PATH = 'M5.33334 8L10.6667 8'
33
+ const CHECK_PATH = 'M7.6 10.4L9.12381 12L12.9333 8'
34
+ const MINUS_PATH = 'M7.33333 10L12.6667 10'
31
35
 
32
36
  // ────────────────────────────────────────────────────────────────────────────
33
37
  // Group Context —— 子项 Checkbox 通过此 Context 接管 value / disabled / 回调
@@ -48,8 +52,15 @@ const CheckboxGroupContext = React.createContext<CheckboxGroupContextValue | nul
48
52
 
49
53
  const CheckboxBox = React.memo(function CheckboxBox() {
50
54
  return (
51
- <svg className="apex-checkbox__box" viewBox="0 0 16 16" aria-hidden="true" focusable="false">
52
- <path className="apex-checkbox__box-path" d={BOX_PATH} />
55
+ <svg className="apex-checkbox__box" viewBox="0 0 20 20" aria-hidden="true" focusable="false">
56
+ <path
57
+ className="apex-checkbox__box-path apex-checkbox__box-path--outline"
58
+ d={BOX_OUTLINE_PATH}
59
+ />
60
+ <path
61
+ className="apex-checkbox__box-path apex-checkbox__box-path--filled"
62
+ d={BOX_FILLED_PATH}
63
+ />
53
64
  </svg>
54
65
  )
55
66
  })
@@ -59,7 +70,7 @@ const CheckboxIcons = React.memo(function CheckboxIcons() {
59
70
  <>
60
71
  <svg
61
72
  className="apex-checkbox__icon-check"
62
- viewBox="0 0 16 16"
73
+ viewBox="0 0 20 20"
63
74
  aria-hidden="true"
64
75
  focusable="false"
65
76
  >
@@ -67,7 +78,7 @@ const CheckboxIcons = React.memo(function CheckboxIcons() {
67
78
  </svg>
68
79
  <svg
69
80
  className="apex-checkbox__icon-indeterminate"
70
- viewBox="0 0 16 16"
81
+ viewBox="0 0 20 20"
71
82
  aria-hidden="true"
72
83
  focusable="false"
73
84
  >
@@ -220,6 +231,7 @@ function CheckboxRoot({
220
231
  const inGroup = group !== null && value !== undefined
221
232
  const effectiveDisabled = Boolean(disabled || (group?.disabled ?? false))
222
233
  const groupChecked = inGroup ? group.value.some((v) => v === value) : undefined
234
+ const [innerChecked, setInnerChecked] = React.useState(Boolean(defaultChecked))
223
235
 
224
236
  // ── Radix `CheckedState` 映射:indeterminate 优先,再按受控/非受控 ────
225
237
  const radixCheckedProps: { checked?: CheckedState; defaultChecked?: CheckedState } = {}
@@ -248,12 +260,14 @@ function CheckboxRoot({
248
260
  const nextChecked = next === 'indeterminate' ? false : Boolean(next)
249
261
  if (inGroup && value !== undefined) {
250
262
  groupOnChangeRef.current?.(value, nextChecked)
263
+ } else if (checked === undefined && !indeterminate) {
264
+ setInnerChecked(nextChecked)
251
265
  }
252
266
  if (onChangeRef.current && source) {
253
267
  onChangeRef.current(buildChangeEvent(source, nextChecked, next === 'indeterminate'))
254
268
  }
255
269
  },
256
- [inGroup, value],
270
+ [inGroup, value, checked, indeterminate],
257
271
  )
258
272
 
259
273
  const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
@@ -284,7 +298,9 @@ function CheckboxRoot({
284
298
  ? 'indeterminate'
285
299
  : radixCheckedProps.checked === true || (inGroup && groupChecked === true)
286
300
  ? 'checked'
287
- : 'unchecked'
301
+ : checked === undefined && !inGroup && innerChecked
302
+ ? 'checked'
303
+ : 'unchecked'
288
304
 
289
305
  const labelClassName = cn(checkboxVariants(), resolvedClassNames.root, className)
290
306
 
@@ -21,6 +21,14 @@
21
21
  transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
22
22
  }
23
23
 
24
+ .apex-checkbox.apex-default-checkbox:not([data-disabled]):hover {
25
+ color: var(--checkbox-text-hover);
26
+ }
27
+
28
+ .apex-checkbox.apex-default-checkbox:not([data-disabled]):active {
29
+ color: var(--checkbox-text-active);
30
+ }
31
+
24
32
  .apex-checkbox.apex-default-checkbox[data-disabled] {
25
33
  cursor: not-allowed;
26
34
  color: var(--checkbox-text-disabled);
@@ -68,29 +76,26 @@
68
76
  pointer-events: none;
69
77
  fill: transparent;
70
78
  color: var(--checkbox-stroke-default);
79
+ transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
71
80
  }
72
81
 
73
82
  .apex-checkbox__box-path {
74
- fill: transparent;
75
- stroke: currentColor;
76
- stroke-width: 1;
77
- vector-effect: non-scaling-stroke;
78
- transition:
79
- fill 0.18s cubic-bezier(0.4, 0, 0.2, 1),
80
- stroke 0.18s cubic-bezier(0.4, 0, 0.2, 1);
83
+ fill: currentColor;
84
+ transition: fill 0.18s cubic-bezier(0.4, 0, 0.2, 1);
81
85
  }
82
86
 
83
- /* hover */
84
- /* .apex-checkbox.apex-default-checkbox:not([data-disabled])
85
- .apex-checkbox__control:hover
86
- .apex-checkbox__box:not([data-state='checked']) {
87
- color: var(--checkbox-stroke-hover);
88
- } */
89
- /* hover — only when unchecked */
90
- .apex-checkbox.apex-default-checkbox:not([data-disabled])
91
- .apex-checkbox__control:not([data-state='checked']):not([data-state='indeterminate']):hover
92
- .apex-checkbox__box {
93
- color: var(--checkbox-stroke-hover);
87
+ .apex-checkbox__box-path--filled {
88
+ display: none;
89
+ }
90
+
91
+ .apex-checkbox__control[data-state='checked'] .apex-checkbox__box-path--outline,
92
+ .apex-checkbox__control[data-state='indeterminate'] .apex-checkbox__box-path--outline {
93
+ display: none;
94
+ }
95
+
96
+ .apex-checkbox__control[data-state='checked'] .apex-checkbox__box-path--filled,
97
+ .apex-checkbox__control[data-state='indeterminate'] .apex-checkbox__box-path--filled {
98
+ display: block;
94
99
  }
95
100
 
96
101
  /* checked:填充 brand,描边同色 */
@@ -111,15 +116,52 @@ color: var(--checkbox-stroke-hover);
111
116
  fill: var(--checkbox-fill-indeterminate);
112
117
  }
113
118
 
119
+ /* 交互状态由整行 label 驱动,方框与文案保持一致。 */
120
+ .apex-checkbox.apex-default-checkbox:not([data-disabled]):hover
121
+ .apex-checkbox__control[data-state='unchecked']
122
+ .apex-checkbox__box {
123
+ color: var(--checkbox-stroke-hover);
124
+ }
125
+
126
+ .apex-checkbox.apex-default-checkbox:not([data-disabled]):active
127
+ .apex-checkbox__control[data-state='unchecked']
128
+ .apex-checkbox__box {
129
+ color: var(--checkbox-stroke-active);
130
+ }
131
+
132
+ .apex-checkbox.apex-default-checkbox:not([data-disabled]):hover
133
+ .apex-checkbox__control:is([data-state='checked'], [data-state='indeterminate'])
134
+ .apex-checkbox__box {
135
+ color: var(--checkbox-stroke-check-hover);
136
+ }
137
+
138
+ .apex-checkbox.apex-default-checkbox:not([data-disabled]):hover
139
+ .apex-checkbox__control:is([data-state='checked'], [data-state='indeterminate'])
140
+ .apex-checkbox__box-path--filled {
141
+ fill: var(--checkbox-fill-check-hover);
142
+ }
143
+
144
+ .apex-checkbox.apex-default-checkbox:not([data-disabled]):active
145
+ .apex-checkbox__control:is([data-state='checked'], [data-state='indeterminate'])
146
+ .apex-checkbox__box {
147
+ color: var(--checkbox-stroke-check-active);
148
+ }
149
+
150
+ .apex-checkbox.apex-default-checkbox:not([data-disabled]):active
151
+ .apex-checkbox__control:is([data-state='checked'], [data-state='indeterminate'])
152
+ .apex-checkbox__box-path--filled {
153
+ fill: var(--checkbox-fill-check-active);
154
+ }
155
+
114
156
  /* disabled:覆盖所有状态色 */
115
157
  .apex-checkbox.apex-default-checkbox[data-disabled] .apex-checkbox__box {
116
158
  color: var(--checkbox-stroke-disabled);
117
159
  }
118
160
 
119
161
  .apex-checkbox.apex-default-checkbox[data-disabled]
120
- .apex-checkbox__control[data-state='checked']
121
- .apex-checkbox__box-path {
122
- fill: var(--checkbox-stroke-disabled);
162
+ .apex-checkbox__control:is([data-state='checked'], [data-state='indeterminate'])
163
+ .apex-checkbox__box-path--filled {
164
+ fill: var(--checkbox-fill-disabled);
123
165
  }
124
166
 
125
167
  /* ── Indicator(Radix 仅在 checked / indeterminate 时挂载)──────────────── */
@@ -165,7 +207,7 @@ color: var(--checkbox-stroke-hover);
165
207
  .apex-checkbox__icon-indeterminate path {
166
208
  fill: none;
167
209
  stroke: currentColor;
168
- stroke-width: 1.2;
210
+ stroke-width: 1;
169
211
  stroke-linecap: round;
170
212
  stroke-linejoin: round;
171
213
  vector-effect: non-scaling-stroke;
@@ -2,7 +2,7 @@
2
2
 
3
3
  > Checkbox:用户可从多个选项中任选零个、一个或多个时(与 Radio 互斥单选相对)。
4
4
 
5
- 版本:`1.2.1`。组件源码在本目录,属于当前项目。
5
+ 版本:`1.2.2`。组件源码在本目录,属于当前项目。
6
6
 
7
7
  公开导出:`Checkbox`、`CheckboxGroup`。
8
8
 
@@ -142,17 +142,28 @@ export default () => (
142
142
  import { Checkbox } from '@/components/apex/checkbox'
143
143
 
144
144
  export default () => (
145
- <div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>
146
- <Checkbox>未选中</Checkbox>
147
- <Checkbox defaultChecked>已选中</Checkbox>
148
- <Checkbox indeterminate>半选</Checkbox>
149
- <Checkbox disabled>禁用 - 未选</Checkbox>
150
- <Checkbox disabled defaultChecked>
151
- 禁用 - 选中
152
- </Checkbox>
153
- <Checkbox disabled indeterminate>
154
- 禁用 - 半选
155
- </Checkbox>
145
+ <div
146
+ style={{
147
+ display: 'grid',
148
+ gridTemplateColumns: 'auto repeat(3, minmax(72px, 1fr))',
149
+ alignItems: 'center',
150
+ columnGap: 16,
151
+ rowGap: 12,
152
+ width: 'min(100%, 360px)',
153
+ }}
154
+ >
155
+ <span />
156
+ <span>未选中</span>
157
+ <span>已选中</span>
158
+ <span>半选</span>
159
+ <span>默认</span>
160
+ <Checkbox aria-label="默认-未选中" />
161
+ <Checkbox defaultChecked aria-label="默认-已选中" />
162
+ <Checkbox indeterminate aria-label="默认-半选" />
163
+ <span>禁用</span>
164
+ <Checkbox disabled aria-label="禁用-未选中" />
165
+ <Checkbox disabled defaultChecked aria-label="禁用-已选中" />
166
+ <Checkbox disabled indeterminate aria-label="禁用-半选" />
156
167
  </div>
157
168
  )
158
169
  ```
@@ -280,7 +291,7 @@ import type * as React from 'react'
280
291
 
281
292
  const styles: CheckboxProps['styles'] = {
282
293
  root: {
283
- '--checkbox-gap': 'var(--apex-spacing-3)',
294
+ '--checkbox-spacing-gap': 'var(--apex-spacing-8)',
284
295
  } as React.CSSProperties,
285
296
  indicator: {
286
297
  opacity: 0.9,