@apexhub/apex-ui-react-source 1.3.1 → 1.3.3

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 (99) hide show
  1. package/dist/files/AGENTS.md +1 -1
  2. package/dist/files/alert/llm.txt +1 -1
  3. package/dist/files/alert/tokens.txt +1 -1
  4. package/dist/files/apex-provider/llm.txt +1 -1
  5. package/dist/files/auto-complete/llm.txt +1 -1
  6. package/dist/files/auto-complete/tokens.txt +1 -1
  7. package/dist/files/avatar/llm.txt +1 -1
  8. package/dist/files/avatar/tokens.txt +1 -1
  9. package/dist/files/breadcrumb/llm.txt +1 -1
  10. package/dist/files/breadcrumb/tokens.txt +1 -1
  11. package/dist/files/button/llm.txt +1 -1
  12. package/dist/files/button/tokens.txt +1 -1
  13. package/dist/files/card/llm.txt +1 -1
  14. package/dist/files/card/tokens.txt +1 -1
  15. package/dist/files/cascader/llm.txt +1 -1
  16. package/dist/files/cascader/tokens.txt +1 -1
  17. package/dist/files/checkbox/llm.txt +1 -1
  18. package/dist/files/checkbox/tokens.txt +1 -1
  19. package/dist/files/collapse/llm.txt +1 -1
  20. package/dist/files/collapse/tokens.txt +1 -1
  21. package/dist/files/date-picker/llm.txt +1 -1
  22. package/dist/files/date-picker/tokens.txt +1 -1
  23. package/dist/files/divider/llm.txt +1 -1
  24. package/dist/files/divider/tokens.txt +1 -1
  25. package/dist/files/drawer/llm.txt +1 -1
  26. package/dist/files/drawer/tokens.txt +1 -1
  27. package/dist/files/dropdown/llm.txt +1 -1
  28. package/dist/files/dropdown/tokens.txt +1 -1
  29. package/dist/files/form/form.css +0 -10
  30. package/dist/files/form/llm.txt +12 -1
  31. package/dist/files/form/tokens.txt +1 -3
  32. package/dist/files/grid/llm.txt +1 -1
  33. package/dist/files/image/llm.txt +1 -1
  34. package/dist/files/image/tokens.txt +1 -1
  35. package/dist/files/input/llm.txt +1 -1
  36. package/dist/files/input/tokens.txt +1 -1
  37. package/dist/files/input-number/input-number.css +15 -2
  38. package/dist/files/input-number/llm.txt +2 -2
  39. package/dist/files/input-number/tokens.txt +5 -5
  40. package/dist/files/layout/llm.txt +1 -1
  41. package/dist/files/layout/tokens.txt +1 -1
  42. package/dist/files/menu/Menu.tsx +27 -11
  43. package/dist/files/menu/icons.tsx +4 -4
  44. package/dist/files/menu/interface.ts +7 -7
  45. package/dist/files/menu/lib.ts +11 -6
  46. package/dist/files/menu/llm.txt +25 -10
  47. package/dist/files/menu/menu.css +73 -32
  48. package/dist/files/menu/tokens.txt +14 -13
  49. package/dist/files/message/llm.txt +1 -1
  50. package/dist/files/message/tokens.txt +1 -1
  51. package/dist/files/modal/llm.txt +1 -1
  52. package/dist/files/modal/tokens.txt +1 -1
  53. package/dist/files/notification/llm.txt +1 -1
  54. package/dist/files/notification/tokens.txt +1 -1
  55. package/dist/files/pagination/Pagination.tsx +20 -2
  56. package/dist/files/pagination/interface.ts +1 -1
  57. package/dist/files/pagination/llm.txt +4 -6
  58. package/dist/files/pagination/tokens.txt +1 -1
  59. package/dist/files/popover/llm.txt +1 -1
  60. package/dist/files/popover/tokens.txt +1 -1
  61. package/dist/files/progress/llm.txt +1 -1
  62. package/dist/files/progress/tokens.txt +1 -1
  63. package/dist/files/radio/llm.txt +1 -1
  64. package/dist/files/radio/tokens.txt +1 -1
  65. package/dist/files/rate/llm.txt +1 -1
  66. package/dist/files/rate/tokens.txt +1 -1
  67. package/dist/files/select/llm.txt +1 -1
  68. package/dist/files/select/tokens.txt +1 -1
  69. package/dist/files/skeleton/llm.txt +1 -1
  70. package/dist/files/skeleton/tokens.txt +1 -1
  71. package/dist/files/spin/llm.txt +1 -1
  72. package/dist/files/spin/tokens.txt +1 -1
  73. package/dist/files/steps/llm.txt +1 -1
  74. package/dist/files/steps/tokens.txt +1 -1
  75. package/dist/files/switch/llm.txt +1 -1
  76. package/dist/files/switch/tokens.txt +1 -1
  77. package/dist/files/table/llm.txt +1 -1
  78. package/dist/files/table/tokens.txt +1 -1
  79. package/dist/files/tabs/llm.txt +1 -1
  80. package/dist/files/tabs/tokens.txt +1 -1
  81. package/dist/files/tag/llm.txt +1 -1
  82. package/dist/files/tag/tokens.txt +1 -1
  83. package/dist/files/theme/aliases.css +1 -1
  84. package/dist/files/theme/component-tokens.css +5 -5
  85. package/dist/files/theme/primitives.css +1 -1
  86. package/dist/files/tooltip/Tooltip.tsx +60 -24
  87. package/dist/files/tooltip/llm.txt +1 -1
  88. package/dist/files/tooltip/tokens.txt +1 -1
  89. package/dist/files/tree/llm.txt +1 -1
  90. package/dist/files/tree/tokens.txt +1 -1
  91. package/dist/files/tree-select/llm.txt +1 -1
  92. package/dist/files/tree-select/tokens.txt +1 -1
  93. package/dist/files/typography/llm.txt +1 -1
  94. package/dist/files/typography/tokens.txt +1 -1
  95. package/dist/files/upload/llm.txt +26 -1
  96. package/dist/files/upload/tokens.txt +1 -1
  97. package/dist/manifest.json +97 -97
  98. package/package.json +4 -4
  99. package/template/index.html +5 -0
@@ -34,9 +34,9 @@ export interface MenuItemType {
34
34
  danger?: boolean
35
35
  /** 分组标题或分割线 */
36
36
  type?: MenuItemKind
37
- /** 子级;可再嵌套内联展开 */
37
+ /** 非空子级表示目录:只展开/收起,不触发点击或选中;可嵌套 */
38
38
  children?: MenuItemType[]
39
- /** 项点击 */
39
+ /** 仅页面项点击;目录不触发 */
40
40
  onClick?: (info: MenuClickInfo) => void
41
41
  }
42
42
 
@@ -110,18 +110,18 @@ export interface MenuProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onCl
110
110
  items: MenuItemType[]
111
111
 
112
112
  /**
113
- * 项是否可选中
113
+ * 页面项是否可选中(目录始终不可选中)
114
114
  * @default true
115
115
  */
116
116
  selectable?: boolean
117
117
 
118
118
  /**
119
- * 受控:当前选中(单选,length ≤ 1)
119
+ * 受控:当前页面项(单选,length ≤ 1;不传目录 key)
120
120
  */
121
121
  selectedKeys?: string[]
122
122
 
123
123
  /**
124
- * 默认选中
124
+ * 默认选中的页面项(不传目录 key)
125
125
  */
126
126
  defaultSelectedKeys?: string[]
127
127
 
@@ -179,12 +179,12 @@ export interface MenuProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onCl
179
179
  styles?: MenuStyles
180
180
 
181
181
  /**
182
- * 选中变化
182
+ * 页面项选中变化;目录展开/收起不触发
183
183
  */
184
184
  onSelect?: (info: MenuSelectInfo) => void
185
185
 
186
186
  /**
187
- * 任意项点击
187
+ * 页面项点击;目录不触发
188
188
  */
189
189
  onClick?: (info: MenuClickInfo) => void
190
190
 
@@ -28,15 +28,15 @@ export function wrapRailDropdownItems(
28
28
  return {
29
29
  ...item,
30
30
  onClick: (info) => {
31
- const fullInfo: MenuClickInfo = { ...info, keyPath }
32
- item.onClick?.(fullInfo)
33
- handlers.onItemClick(fullInfo, item)
34
-
35
31
  // Submenu parents are opened by Dropdown Sub; only leaves select + expand menu-maximized.
36
32
  if (hasChildren || item.type === 'divider' || item.type === 'group') {
37
33
  return
38
34
  }
39
35
 
36
+ const fullInfo: MenuClickInfo = { ...info, keyPath }
37
+ item.onClick?.(fullInfo)
38
+ handlers.onItemClick(fullInfo, item)
39
+
40
40
  if (handlers.selectable) {
41
41
  handlers.onItemSelect({ ...fullInfo, selectedKeys: [item.key] }, item)
42
42
  }
@@ -109,10 +109,15 @@ function findSelectedKeyPath(
109
109
  path: string[] = [],
110
110
  ): string[] | null {
111
111
  for (const item of items) {
112
- if (item.type === 'divider' || item.type === 'group') continue
112
+ if (item.type === 'divider') continue
113
+ if (item.type === 'group') {
114
+ const found = findSelectedKeyPath(item.children ?? [], selectedKey, path)
115
+ if (found) return found
116
+ continue
117
+ }
113
118
 
114
119
  const keyPath = [...path, item.key]
115
- if (item.key === selectedKey) return keyPath
120
+ if (item.key === selectedKey && !item.children?.length) return keyPath
116
121
 
117
122
  if (item.children?.length) {
118
123
  const found = findSelectedKeyPath(item.children, selectedKey, keyPath)
@@ -2,7 +2,7 @@
2
2
 
3
3
  > Menu:侧栏持久导航,需要在图标 rail 与展开列表之间切换时。
4
4
 
5
- 版本:`1.3.1`。组件源码在本目录,属于当前项目。
5
+ 版本:`1.3.3`。组件源码在本目录,属于当前项目。
6
6
 
7
7
  公开导出:`isKeySelected`、`Menu`。
8
8
 
@@ -56,6 +56,14 @@ export default () => {
56
56
  - 需要内联子菜单展开、受控选中项或自定义顶栏/底栏时。
57
57
  - 触发器旁的临时操作菜单请使用 Dropdown,不要用 Menu。
58
58
 
59
+ ### 目录与页面
60
+
61
+ 有非空 `children` 的普通菜单项是目录,点击整行或按 Enter / 空格只展开、收起,触发 `onOpenChange`;不会触发项级 `onClick`、Menu 的 `onClick` 或 `onSelect`。只有无子级的页面项进入点击、选中回调,`selectedKeys` 也应只传页面 key。
62
+
63
+ 收起目录会保留当前页面选中;重新展开后仍显示原选中项。未选中目录使用默认文字和图标颜色;子页面选中后,祖先目录不保留选中背景。目录仅在悬停和按下时使用 hover / active Token,松开并移出后恢复默认状态;页面项保留带透明度的选中背景和主题色文字。目录箭头默认隐藏,悬停目录行或键盘聚焦时显示;收起向下、展开向上,颜色跟随 `menu-button-icon` 状态 Token。`type: 'group'` 是静态分组标题,不承担折叠交互。
64
+
65
+ 收窄为图标时,悬停目录仍显示浮出子菜单;点击目录图标只请求展开侧栏并打开该目录,不切换页面。若目录需要总览页,请新增一个“总览”子项。
66
+
59
67
  ## API
60
68
 
61
69
  仅使用类型定义支持的属性;原生属性、ref 目标和事件签名因组件而异。关联类型用于解释字段结构;只有「导出类型」中的名称可从包根导入。
@@ -65,9 +73,9 @@ export default () => {
65
73
  | 属性 | 说明 | 类型 | 必填 | 默认值 |
66
74
  | --- | --- | --- | --- | --- |
67
75
  | items | 菜单树 | `MenuItemType[]` | 是 | — |
68
- | selectable | 项是否可选中 | `boolean` | 否 | `true` |
69
- | selectedKeys | 受控:当前选中(单选,length ≤ 1) | `string[]` | 否 | — |
70
- | defaultSelectedKeys | 默认选中 | `string[]` | 否 | — |
76
+ | selectable | 页面项是否可选中(目录始终不可选中) | `boolean` | 否 | `true` |
77
+ | selectedKeys | 受控:当前页面项(单选,length ≤ 1;不传目录 key) | `string[]` | 否 | — |
78
+ | defaultSelectedKeys | 默认选中的页面项(不传目录 key) | `string[]` | 否 | — |
71
79
  | openKeys | 受控:内联子菜单展开 keys(menu-maximized 态) | `string[]` | 否 | — |
72
80
  | defaultOpenKeys | 默认展开的子菜单 keys | `string[]` | 否 | — |
73
81
  | theme | 颜色主题 | `"light" \| "dark"` | 否 | `'dark'` |
@@ -78,8 +86,8 @@ export default () => {
78
86
  | inlineIndent | 内联子级缩进(px,menu-maximized 态) | `number` | 否 | `24` |
79
87
  | classNames | 语义节点 class | `MenuClassNames` | 否 | — |
80
88
  | styles | 语义节点内联样式 | `MenuStyles` | 否 | — |
81
- | onSelect | 选中变化 | `(info: MenuSelectInfo) => void` | 否 | — |
82
- | onClick | 任意项点击 | `(info: MenuClickInfo) => void` | 否 | — |
89
+ | onSelect | 页面项选中变化;目录展开/收起不触发 | `(info: MenuSelectInfo) => void` | 否 | — |
90
+ | onClick | 页面项点击;目录不触发 | `(info: MenuClickInfo) => void` | 否 | — |
83
91
  | onOpenChange | 内联子菜单展开变化 | `(openKeys: string[]) => void` | 否 | — |
84
92
  | renderChild | 自定义 **子级** menu-maximized 列表项整行渲染(`depth > 0`);<br>顶层 root 项不受影响。返回节点请绑定 `domProps` 以保留选中、展开、点击等行为。 | `MenuRenderChild` | 否 | — |
85
93
  | ref | 根 nav ref(React 19) | `React.Ref<HTMLElement>` | 否 | — |
@@ -127,8 +135,8 @@ type MenuItemKind = 'group' | 'divider'
127
135
  | loading | 加载中(不可交互,展示 loading 样式) | `boolean` | 否 | — |
128
136
  | danger | 危险样式 | `boolean` | 否 | — |
129
137
  | type | 分组标题或分割线 | `"group" \| "divider"` | 否 | — |
130
- | children | 子级;可再嵌套内联展开 | `MenuItemType[]` | 否 | — |
131
- | onClick | 项点击 | `(info: MenuClickInfo) => void` | 否 | — |
138
+ | children | 非空子级表示目录:只展开/收起,不触发点击或选中;可嵌套 | `MenuItemType[]` | 否 | — |
139
+ | onClick | 仅页面项点击;目录不触发 | `(info: MenuClickInfo) => void` | 否 | — |
132
140
 
133
141
  ### MenuClickInfo
134
142
 
@@ -215,7 +223,7 @@ Dropdown `menu` prop 用扁平列表
215
223
 
216
224
  ### 子菜单面板
217
225
 
218
- 侧栏 icon rail 与 Menu 面板组合:点击 rail 图标选中并展开子菜单面板,适合多应用切换场景。
226
+ 侧栏 icon rail 与 Menu 面板组合:点击目录 rail 图标展开子菜单面板,选择页面项才改变选中,适合多应用切换场景。
219
227
 
220
228
  ```tsx
221
229
  import { Button } from '@/components/apex/button'
@@ -281,6 +289,7 @@ const railStyle = {
281
289
 
282
290
  export default () => {
283
291
  const [selectedKeys, setSelectedKeys] = useState<string[]>([])
292
+ const [openKeys, setOpenKeys] = useState<string[]>([])
284
293
  const [collapsed, setCollapsed] = useState(true)
285
294
 
286
295
  return (
@@ -294,7 +303,11 @@ export default () => {
294
303
  size="medium"
295
304
  style={{ width: 32, height: 32, padding: 0, minWidth: 0 }}
296
305
  onClick={() => {
297
- setSelectedKeys([item.key])
306
+ if (item.children?.length) {
307
+ setOpenKeys((keys) => (keys.includes(item.key) ? keys : [...keys, item.key]))
308
+ } else {
309
+ setSelectedKeys([item.key])
310
+ }
298
311
  if (collapsed) setCollapsed(false)
299
312
  }}
300
313
  >
@@ -316,6 +329,8 @@ export default () => {
316
329
  <Menu
317
330
  items={menuItems}
318
331
  collapsed={false}
332
+ openKeys={openKeys}
333
+ onOpenChange={setOpenKeys}
319
334
  selectedKeys={selectedKeys}
320
335
  onSelect={({ selectedKeys: keys }) => setSelectedKeys(keys)}
321
336
  footer={
@@ -28,8 +28,8 @@
28
28
  flex-direction: column;
29
29
  justify-content: space-between;
30
30
  align-items: center;
31
- width: var(--menu-spacing-width-rail);
32
- min-width: var(--menu-spacing-width-rail);
31
+ width: calc(var(--menu-spacing-width-rail) + var(--menu-spacing-padding-x));
32
+ min-width: calc(var(--menu-spacing-width-rail) + var(--menu-spacing-padding-x));
33
33
  padding: var(--menu-spacing-padding-y) var(--menu-spacing-padding-x);
34
34
  gap: var(--menu-spacing-gap-sm);
35
35
  }
@@ -223,26 +223,32 @@
223
223
 
224
224
  /* ── menu-collapsed rail ─────────────────────────────────────────────────── */
225
225
 
226
- .apex-menu .apex-menu__rail {
226
+ .apex-menu.apex-menu--menu-collapsed .apex-menu__rail[data-slot='menu-rail'] {
227
227
  display: flex;
228
228
  flex: 1 1 auto;
229
229
  flex-direction: column;
230
- align-items: stretch;
231
- width: fit-content;
230
+ align-items: center;
231
+ width: 100%;
232
232
  min-height: 0;
233
233
  padding: 0;
234
234
  margin: 0;
235
235
  gap: var(--apex-spacing-12, var(--menu-spacing-gap-sm));
236
- overflow-x: visible;
236
+ overflow-x: hidden;
237
237
  overflow-y: auto;
238
+ scrollbar-width: none;
238
239
  list-style: none;
239
240
  }
240
241
 
242
+ .apex-menu.apex-menu--menu-collapsed .apex-menu__rail[data-slot='menu-rail']::-webkit-scrollbar {
243
+ display: none;
244
+ }
245
+
241
246
  .apex-menu .apex-menu__rail-item {
242
247
  position: relative;
243
248
  display: flex;
244
249
  flex-shrink: 0;
245
- justify-content: flex-start;
250
+ justify-content: center;
251
+ width: 100%;
246
252
  list-style: none;
247
253
  }
248
254
 
@@ -260,11 +266,20 @@
260
266
  }
261
267
 
262
268
  .apex-menu .apex-menu__rail-button {
269
+ display: inline-flex;
270
+ align-items: center;
271
+ justify-content: center;
263
272
  width: var(--menu-button-spacing-height);
264
273
  height: var(--menu-button-spacing-height);
274
+ padding: 0;
265
275
  border-radius: var(--menu-button-radius-radius);
266
276
  }
267
277
 
278
+ /* Keep the rail hit area at 32px while using the compact 16px menu glyph. */
279
+ .apex-menu.apex-menu--menu-collapsed .apex-menu__rail-button.apex-icon-menu-button {
280
+ --menu-button-icon-icon: var(--apex-icon-16);
281
+ }
282
+
268
283
  .apex-menu .apex-menu__collapse {
269
284
  display: inline-flex;
270
285
  align-items: center;
@@ -326,6 +341,7 @@
326
341
  }
327
342
 
328
343
  .apex-menu .apex-menu__row .apex-menu__label {
344
+ color: inherit;
329
345
  flex: 1 1 auto;
330
346
  min-width: 0;
331
347
  overflow: hidden;
@@ -338,11 +354,25 @@
338
354
  align-items: center;
339
355
  justify-content: center;
340
356
  color: var(--menu-button-icon-default);
341
- transition: transform 0.2s ease;
357
+ opacity: 0;
358
+ transition:
359
+ transform 0.36s cubic-bezier(0.4, 0, 0.2, 1),
360
+ opacity 0.2s ease;
361
+ }
362
+
363
+ .apex-menu .apex-menu__row:hover:not(:disabled) .apex-menu__caret,
364
+ .apex-menu .apex-menu__row:focus-visible:not(:disabled) .apex-menu__caret {
365
+ opacity: 1;
366
+ }
367
+
368
+ .apex-menu .apex-menu__caret svg {
369
+ display: block;
370
+ width: var(--menu-button-icon-icon);
371
+ height: var(--menu-button-icon-icon);
342
372
  }
343
373
 
344
374
  .apex-menu .apex-menu__row[data-open] .apex-menu__caret {
345
- transform: rotate(90deg);
375
+ transform: rotate(180deg);
346
376
  }
347
377
 
348
378
  /* Row states (from --menu-button-* on primary / secondary scopes) */
@@ -353,7 +383,8 @@
353
383
  color: var(--menu-button-text-hover);
354
384
  }
355
385
 
356
- .apex-menu .apex-menu__row:hover:not(:disabled) .apex-menu__icon {
386
+ .apex-menu .apex-menu__row:hover:not(:disabled) .apex-menu__icon,
387
+ .apex-menu .apex-menu__row:hover:not(:disabled) .apex-menu__caret {
357
388
  color: var(--menu-button-icon-hover);
358
389
  }
359
390
 
@@ -363,37 +394,45 @@
363
394
  color: var(--menu-button-text-active);
364
395
  }
365
396
 
366
- .apex-menu .apex-menu__row[data-selected],
367
- .apex-menu .apex-menu__row[data-selected]:hover:not(:disabled),
368
- .apex-menu .apex-menu__row[data-selected]:active:not(:disabled),
369
- .apex-menu .apex-menu__row[data-selected-secondary],
370
- .apex-menu .apex-menu__row[data-selected-secondary]:hover:not(:disabled),
371
- .apex-menu .apex-menu__row[data-selected-secondary]:active:not(:disabled) {
397
+ .apex-menu .apex-menu__row:active:not(:disabled) .apex-menu__icon,
398
+ .apex-menu .apex-menu__row:active:not(:disabled) .apex-menu__caret {
399
+ color: var(--menu-button-icon-active);
400
+ }
401
+
402
+ .apex-menu .apex-menu__row:where(:not(:disabled):not([data-disabled])):not([aria-expanded])[data-selected],
403
+ .apex-menu .apex-menu__row:where(:not(:disabled):not([data-disabled])):not([aria-expanded])[data-selected]:hover:not(:disabled),
404
+ .apex-menu .apex-menu__row:where(:not(:disabled):not([data-disabled])):not([aria-expanded])[data-selected]:active:not(:disabled),
405
+ .apex-menu .apex-menu__row:where(:not(:disabled):not([data-disabled])):not([aria-expanded])[data-selected-secondary],
406
+ .apex-menu .apex-menu__row:where(:not(:disabled):not([data-disabled])):not([aria-expanded])[data-selected-secondary]:hover:not(:disabled),
407
+ .apex-menu .apex-menu__row:where(:not(:disabled):not([data-disabled])):not([aria-expanded])[data-selected-secondary]:active:not(:disabled) {
372
408
  background-color: var(--menu-button-fill-selected);
373
409
  border-color: var(--menu-button-stroke-selected);
374
410
  color: var(--menu-button-text-selected);
375
411
  }
376
412
 
377
- .apex-menu .apex-menu__row:is([data-selected], [data-selected-secondary]) .apex-menu__label,
378
- .apex-menu .apex-menu__row:is([data-selected], [data-selected-secondary]):hover:not(:disabled) .apex-menu__label,
379
- .apex-menu .apex-menu__row:is([data-selected], [data-selected-secondary]):active:not(:disabled) .apex-menu__label {
413
+ .apex-menu .apex-menu__row:where(:not(:disabled):not([data-disabled])):not([aria-expanded]):is([data-selected], [data-selected-secondary]) .apex-menu__label,
414
+ .apex-menu .apex-menu__row:where(:not(:disabled):not([data-disabled])):not([aria-expanded]):is([data-selected], [data-selected-secondary]):hover:not(:disabled) .apex-menu__label,
415
+ .apex-menu .apex-menu__row:where(:not(:disabled):not([data-disabled])):not([aria-expanded]):is([data-selected], [data-selected-secondary]):active:not(:disabled) .apex-menu__label {
380
416
  color: var(--menu-button-text-selected);
381
417
  }
382
418
 
383
- .apex-menu .apex-menu__row:is([data-selected], [data-selected-secondary]) .apex-menu__icon,
384
- .apex-menu .apex-menu__row:is([data-selected], [data-selected-secondary]) .apex-menu__caret,
385
- .apex-menu .apex-menu__row:is([data-selected], [data-selected-secondary]):hover:not(:disabled) .apex-menu__icon,
386
- .apex-menu .apex-menu__row:is([data-selected], [data-selected-secondary]):hover:not(:disabled) .apex-menu__caret,
387
- .apex-menu .apex-menu__row:is([data-selected], [data-selected-secondary]):active:not(:disabled) .apex-menu__icon,
388
- .apex-menu .apex-menu__row:is([data-selected], [data-selected-secondary]):active:not(:disabled) .apex-menu__caret {
389
- color: var(--menu-button-icon-selected);
419
+ .apex-menu .apex-menu__row:where(:not(:disabled):not([data-disabled])):not([aria-expanded]):is([data-selected], [data-selected-secondary]) .apex-menu__icon,
420
+ .apex-menu .apex-menu__row:where(:not(:disabled):not([data-disabled])):not([aria-expanded]):is([data-selected], [data-selected-secondary]) .apex-menu__caret,
421
+ .apex-menu .apex-menu__row:where(:not(:disabled):not([data-disabled])):not([aria-expanded]):is([data-selected], [data-selected-secondary]):hover:not(:disabled) .apex-menu__icon,
422
+ .apex-menu .apex-menu__row:where(:not(:disabled):not([data-disabled])):not([aria-expanded]):is([data-selected], [data-selected-secondary]):hover:not(:disabled) .apex-menu__caret,
423
+ .apex-menu .apex-menu__row:where(:not(:disabled):not([data-disabled])):not([aria-expanded]):is([data-selected], [data-selected-secondary]):active:not(:disabled) .apex-menu__icon,
424
+ .apex-menu .apex-menu__row:where(:not(:disabled):not([data-disabled])):not([aria-expanded]):is([data-selected], [data-selected-secondary]):active:not(:disabled) .apex-menu__caret {
425
+ /* The selected leaf icon follows its label, including in the secondary scope. */
426
+ color: var(--menu-button-text-selected);
390
427
  }
391
428
 
392
- /* Selected styling already identifies the current item; suppress the browser's native blue ring. */
393
- .apex-menu
394
- .apex-menu__rail-button:is([data-selected], [data-selected-secondary]):focus-visible,
395
- .apex-menu .apex-menu__row:is([data-selected], [data-selected-secondary]):focus-visible {
396
- outline: none;
429
+ /* Directories use only default / hover / active states; selection belongs to pages. */
430
+
431
+ /* Keep keyboard focus visible even on the selected path. */
432
+ .apex-menu .apex-menu__rail-button:focus-visible,
433
+ .apex-menu .apex-menu__row:focus-visible {
434
+ outline: var(--menu-stroke-stroke) solid var(--menu-button-icon-selected);
435
+ outline-offset: var(--menu-stroke-stroke);
397
436
  }
398
437
 
399
438
  .apex-menu .apex-menu__row:disabled,
@@ -404,7 +443,9 @@
404
443
  }
405
444
 
406
445
  .apex-menu .apex-menu__row:disabled .apex-menu__icon,
407
- .apex-menu .apex-menu__row[data-disabled] .apex-menu__icon {
446
+ .apex-menu .apex-menu__row[data-disabled] .apex-menu__icon,
447
+ .apex-menu .apex-menu__row:disabled .apex-menu__caret,
448
+ .apex-menu .apex-menu__row[data-disabled] .apex-menu__caret {
408
449
  color: var(--menu-button-icon-disabled);
409
450
  }
410
451
 
@@ -1,6 +1,6 @@
1
1
  # Menu Token 明细
2
2
 
3
- 包:`@apexhub/apex-ui-react`;版本:`1.3.0`(当前源码快照)。
3
+ 包:`@apexhub/apex-ui-react`;版本:`1.3.3`(当前源码快照)。
4
4
 
5
5
  按需读取:[组件用法](./llm.txt) · [主题与覆盖规则](../../llms-theme.txt)。
6
6
 
@@ -10,7 +10,7 @@
10
10
 
11
11
  | Token | 用途(CSS 属性) | 定义值 | 定义作用域 |
12
12
  | --- | --- | --- | --- |
13
- | `--menu-button-fill-active` | `background-color` | `var(--apex-fill-neutral-quaternary)` | `.apex-menu-button.apex-primary-menu-button` |
13
+ | `--menu-button-fill-active` | `background-color` | `var(--apex-fill-neutral-tertiary)` | `.apex-menu-button.apex-primary-menu-button` |
14
14
  | `--menu-button-fill-active` | `background-color` | `var(--apex-fill-neutral-quaternary)` | `.apex-menu-button.apex-secondary-menu-button` |
15
15
  | `--menu-button-fill-default` | `background-color` | `var(--apex-fill-neutral-secondary)` | `.apex-menu-button.apex-primary-menu-button` |
16
16
  | `--menu-button-fill-default` | `background-color` | `var(--apex-fill-neutral-secondary)` | `.apex-menu-button.apex-secondary-menu-button` |
@@ -21,7 +21,7 @@
21
21
  | `--menu-button-fill-loading` | `background-color` | `var(--apex-fill-neutral-tertiary)` | `.apex-menu-button.apex-primary-menu-button` |
22
22
  | `--menu-button-fill-loading` | `background-color` | `var(--apex-fill-neutral-tertiary)` | `.apex-menu-button.apex-secondary-menu-button` |
23
23
  | `--menu-button-fill-selected` | `background-color` | `var(--apex-fill-neutral-secondary)` | `.apex-menu-button.apex-primary-menu-button` |
24
- | `--menu-button-fill-selected` | `background-color` | `var(--apex-fill-brand-primary)` | `.apex-menu-button.apex-secondary-menu-button` |
24
+ | `--menu-button-fill-selected` | `background-color` | `var(--apex-fill-brand-alpha-secondary)` | `.apex-menu-button.apex-secondary-menu-button` |
25
25
  | `--menu-button-icon-active` | `color` | `var(--apex-icon-neutral-tertiary)` | `.apex-menu-button.apex-primary-menu-button` |
26
26
  | `--menu-button-icon-active` | `color` | `var(--apex-icon-neutral-primary)` | `.apex-menu-button.apex-secondary-menu-button` |
27
27
  | `--menu-button-icon-default` | `color` | `var(--apex-icon-neutral-secondary)` | `.apex-menu-button.apex-primary-menu-button` |
@@ -33,10 +33,11 @@
33
33
  | `--menu-button-icon-icon` | `font-size`、`height`、`width` | `var(--apex-icon-24)` | `.apex-menu-button.apex-icon-menu-button` |
34
34
  | `--menu-button-icon-icon` | `font-size`、`height`、`width` | `var(--apex-icon-16)` | `.apex-menu-button.apex-primary-menu-button` |
35
35
  | `--menu-button-icon-icon` | `font-size`、`height`、`width` | `var(--apex-icon-16)` | `.apex-menu-button.apex-secondary-menu-button` |
36
+ | `--menu-button-icon-icon` | `font-size`、`height`、`width` | `var(--apex-icon-16)` | `.apex-menu.apex-menu--menu-collapsed .apex-menu__rail-button.apex-icon-menu-button` |
36
37
  | `--menu-button-icon-loading` | `color` | `var(--apex-icon-neutral-disabled)` | `.apex-menu-button.apex-primary-menu-button` |
37
38
  | `--menu-button-icon-loading` | `color` | `var(--apex-icon-neutral-disabled)` | `.apex-menu-button.apex-secondary-menu-button` |
38
- | `--menu-button-icon-selected` | `color` | `var(--apex-icon-brand-primary)` | `.apex-menu-button.apex-primary-menu-button` |
39
- | `--menu-button-icon-selected` | `color` | `var(--apex-text-neutral-primary)` | `.apex-menu-button.apex-secondary-menu-button` |
39
+ | `--menu-button-icon-selected` | `color`、`outline` | `var(--apex-icon-brand-primary)` | `.apex-menu-button.apex-primary-menu-button` |
40
+ | `--menu-button-icon-selected` | `color`、`outline` | `var(--apex-text-neutral-primary)` | `.apex-menu-button.apex-secondary-menu-button` |
40
41
  | `--menu-button-radius-radius` | `border-radius` | `var(--apex-radius-8)` | `.apex-menu-button.apex-icon-menu-button` |
41
42
  | `--menu-button-radius-radius` | `border-radius` | `var(--apex-radius-8)` | `.apex-menu-button.apex-primary-menu-button` |
42
43
  | `--menu-button-radius-radius` | `border-radius` | `var(--apex-radius-8)` | `.apex-menu-button.apex-secondary-menu-button` |
@@ -48,7 +49,7 @@
48
49
  | `--menu-button-spacing-padding-x` | `padding` | `var(--apex-spacing-8)` | `.apex-menu-button.apex-icon-menu-button` |
49
50
  | `--menu-button-spacing-padding-x` | `padding` | `var(--apex-spacing-12)` | `.apex-menu-button.apex-primary-menu-button` |
50
51
  | `--menu-button-spacing-padding-x` | `padding` | `var(--apex-spacing-8)` | `.apex-menu-button.apex-secondary-menu-button` |
51
- | `--menu-button-stroke-active` | `border-color` | `var(--apex-stroke-neutral-quaternary)` | `.apex-menu-button.apex-primary-menu-button` |
52
+ | `--menu-button-stroke-active` | `border-color` | `var(--apex-stroke-neutral-tertiary)` | `.apex-menu-button.apex-primary-menu-button` |
52
53
  | `--menu-button-stroke-active` | `border-color` | `var(--apex-stroke-neutral-quaternary)` | `.apex-menu-button.apex-secondary-menu-button` |
53
54
  | `--menu-button-stroke-default` | `border` | `var(--apex-stroke-neutral-secondary)` | `.apex-menu-button.apex-primary-menu-button` |
54
55
  | `--menu-button-stroke-default` | `border` | `var(--apex-stroke-neutral-secondary)` | `.apex-menu-button.apex-secondary-menu-button` |
@@ -70,7 +71,7 @@
70
71
  | `--menu-button-text-hover` | `background-color`、`color` | `var(--apex-text-neutral-primary)` | `.apex-menu-button.apex-primary-menu-button` |
71
72
  | `--menu-button-text-hover` | `background-color`、`color` | `var(--apex-text-neutral-primary)` | `.apex-menu-button.apex-secondary-menu-button` |
72
73
  | `--menu-button-text-selected` | `color` | `var(--apex-text-brand-primary)` | `.apex-menu-button.apex-primary-menu-button` |
73
- | `--menu-button-text-selected` | `color` | `var(--apex-text-neutral-primary)` | `.apex-menu-button.apex-secondary-menu-button` |
74
+ | `--menu-button-text-selected` | `color` | `var(--apex-text-brand-primary)` | `.apex-menu-button.apex-secondary-menu-button` |
74
75
  | `--menu-fill-container-default` | `background-color` | `var(--apex-fill-neutral-secondary)` | `.apex-menu-sliding-panel` |
75
76
  | `--menu-fill-container-default` | `background-color` | `var(--apex-fill-neutral-secondary)` | `.apex-menu.apex-default-menu` |
76
77
  | `--menu-radius-radius` | `border-radius` | `var(--apex-radius-8)` | `.apex-menu.apex-container-md-menu` |
@@ -82,9 +83,9 @@
82
83
  | `--menu-spacing-gap-sm` | `gap`、`margin-block`、`margin-block-end`、`margin-inline-start`、`max-width`、`padding`、`width` | `var(--apex-spacing-4)` | `.apex-menu.apex-container-sm-menu` |
83
84
  | `--menu-spacing-gap-sublist` | `margin-inline-start`、`max-width`、`padding-inline-start`、`width` | `var(--apex-spacing-12)` | `.apex-menu.apex-container-md-menu` |
84
85
  | `--menu-spacing-gap-sublist` | `margin-inline-start`、`max-width`、`padding-inline-start`、`width` | `var(--apex-spacing-12)` | `.apex-menu.apex-container-sm-menu` |
85
- | `--menu-spacing-padding-x` | `padding` | `var(--apex-spacing-8)` | `.apex-menu-sliding-panel` |
86
- | `--menu-spacing-padding-x` | `padding` | `var(--apex-spacing-8)` | `.apex-menu.apex-container-md-menu` |
87
- | `--menu-spacing-padding-x` | `padding` | `var(--apex-spacing-4)` | `.apex-menu.apex-container-sm-menu` |
86
+ | `--menu-spacing-padding-x` | `min-width`、`padding`、`width` | `var(--apex-spacing-8)` | `.apex-menu-sliding-panel` |
87
+ | `--menu-spacing-padding-x` | `min-width`、`padding`、`width` | `var(--apex-spacing-8)` | `.apex-menu.apex-container-md-menu` |
88
+ | `--menu-spacing-padding-x` | `min-width`、`padding`、`width` | `var(--apex-spacing-4)` | `.apex-menu.apex-container-sm-menu` |
88
89
  | `--menu-spacing-padding-y` | `padding` | `var(--apex-spacing-12)` | `.apex-menu-sliding-panel` |
89
90
  | `--menu-spacing-padding-y` | `padding` | `var(--apex-spacing-12)` | `.apex-menu.apex-container-md-menu` |
90
91
  | `--menu-spacing-padding-y` | `padding` | `var(--apex-spacing-8)` | `.apex-menu.apex-container-sm-menu` |
@@ -95,6 +96,6 @@
95
96
  | `--menu-spacing-width-rail` | `min-width`、`width` | `var(--apex-size-56)` | `.apex-menu.apex-container-sm-menu` |
96
97
  | `--menu-stroke-container-default` | `background-color`、`border-inline-end` | `var(--apex-stroke-neutral-tertiary)` | `.apex-menu-sliding-panel` |
97
98
  | `--menu-stroke-container-default` | `background-color`、`border-inline-end` | `var(--apex-stroke-neutral-tertiary)` | `.apex-menu.apex-default-menu` |
98
- | `--menu-stroke-stroke` | `border-inline-end`、`height`、`width` | `var(--apex-border-1)` | `.apex-menu-sliding-panel` |
99
- | `--menu-stroke-stroke` | `border-inline-end`、`height`、`width` | `var(--apex-border-1)` | `.apex-menu.apex-container-md-menu` |
100
- | `--menu-stroke-stroke` | `border-inline-end`、`height`、`width` | `var(--apex-border-1)` | `.apex-menu.apex-container-sm-menu` |
99
+ | `--menu-stroke-stroke` | `border-inline-end`、`height`、`outline`、`outline-offset`、`width` | `var(--apex-border-1)` | `.apex-menu-sliding-panel` |
100
+ | `--menu-stroke-stroke` | `border-inline-end`、`height`、`outline`、`outline-offset`、`width` | `var(--apex-border-1)` | `.apex-menu.apex-container-md-menu` |
101
+ | `--menu-stroke-stroke` | `border-inline-end`、`height`、`outline`、`outline-offset`、`width` | `var(--apex-border-1)` | `.apex-menu.apex-container-sm-menu` |
@@ -2,7 +2,7 @@
2
2
 
3
3
  > Message:操作结果的轻量全局反馈(成功、失败、警告、进行中等)时。
4
4
 
5
- 版本:`1.3.1`。组件源码在本目录,属于当前项目。
5
+ 版本:`1.3.3`。组件源码在本目录,属于当前项目。
6
6
 
7
7
  公开导出:`message`。
8
8
 
@@ -1,6 +1,6 @@
1
1
  # Message Token 明细
2
2
 
3
- 包:`@apexhub/apex-ui-react`;版本:`1.3.0`(当前源码快照)。
3
+ 包:`@apexhub/apex-ui-react`;版本:`1.3.3`(当前源码快照)。
4
4
 
5
5
  按需读取:[组件用法](./llm.txt) · [主题与覆盖规则](../../llms-theme.txt)。
6
6
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > Modal:需要用户阅读并确认、取消或提交,且应暂时阻断当前页面操作时。
4
4
 
5
- 版本:`1.3.1`。组件源码在本目录,属于当前项目。
5
+ 版本:`1.3.3`。组件源码在本目录,属于当前项目。
6
6
 
7
7
  公开导出:`Modal`。
8
8
 
@@ -1,6 +1,6 @@
1
1
  # Modal Token 明细
2
2
 
3
- 包:`@apexhub/apex-ui-react`;版本:`1.3.0`(当前源码快照)。
3
+ 包:`@apexhub/apex-ui-react`;版本:`1.3.3`(当前源码快照)。
4
4
 
5
5
  按需读取:[组件用法](./llm.txt) · [主题与覆盖规则](../../llms-theme.txt)。
6
6
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > Notification:操作完成后的全局反馈,需要用户注意到但不必立即处理时。
4
4
 
5
- 版本:`1.3.1`。组件源码在本目录,属于当前项目。
5
+ 版本:`1.3.3`。组件源码在本目录,属于当前项目。
6
6
 
7
7
  公开导出:`notification`。
8
8
 
@@ -1,6 +1,6 @@
1
1
  # Notification Token 明细
2
2
 
3
- 包:`@apexhub/apex-ui-react`;版本:`1.3.0`(当前源码快照)。
3
+ 包:`@apexhub/apex-ui-react`;版本:`1.3.3`(当前源码快照)。
4
4
 
5
5
  按需读取:[组件用法](./llm.txt) · [主题与覆盖规则](../../llms-theme.txt)。
6
6
 
@@ -17,6 +17,7 @@ import { PaginationContext } from './context'
17
17
  import type { PaginationProps } from './interface'
18
18
  import { PageButton } from './PageButton'
19
19
  import { PageSizeChanger } from './PageSizeChanger'
20
+ import { TotalText } from './TotalText'
20
21
  import { useResizeObserver } from './useResizeObserver'
21
22
  import { paginationVariants } from './variants'
22
23
 
@@ -31,6 +32,7 @@ export const Pagination: React.FC<PaginationProps> = ({
31
32
  pageSizeOptions,
32
33
  disabled = false,
33
34
  showSizeChanger,
35
+ showTotal,
34
36
  hideOnSinglePage = false,
35
37
  itemRender,
36
38
  responsive = false,
@@ -121,7 +123,6 @@ export const Pagination: React.FC<PaginationProps> = ({
121
123
  const isPrevDisabled = disabled || safeCurrent === 1
122
124
  const isNextDisabled = disabled || safeCurrent === totalPages
123
125
 
124
- // showTotal / showQuickJumper 不在设计稿中,props 保留以兼容调用方但不渲染
125
126
  const showSizeChangerFinal = effectiveShowSizeChanger && (!responsive || display.showSizeChanger)
126
127
 
127
128
  const paginationNav = (
@@ -279,7 +280,24 @@ export const Pagination: React.FC<PaginationProps> = ({
279
280
  )
280
281
 
281
282
  return (
282
- <PaginationContext.Provider value={contextValue}>{paginationNav}</PaginationContext.Provider>
283
+ <PaginationContext.Provider value={contextValue}>
284
+ {showTotal ? (
285
+ <div
286
+ className={cn('apex-pagination__root', paginationVariants())}
287
+ {...(disabled ? { 'data-disabled': '' } : {})}
288
+ >
289
+ <TotalText
290
+ total={total}
291
+ current={safeCurrent}
292
+ pageSize={pageSize}
293
+ showTotal={showTotal}
294
+ />
295
+ {paginationNav}
296
+ </div>
297
+ ) : (
298
+ paginationNav
299
+ )}
300
+ </PaginationContext.Provider>
283
301
  )
284
302
  }
285
303
 
@@ -33,7 +33,7 @@ export interface PaginationProps {
33
33
  showSizeChanger?: boolean
34
34
  /** 兼容旧调用方;当前 React 设计不渲染快速跳转输入 */
35
35
  showQuickJumper?: boolean
36
- /** 兼容旧调用方;当前 React 设计不渲染总数区域 */
36
+ /** 自定义总条数文案和当前页范围。不传时隐藏总数区域。 */
37
37
  showTotal?: ShowTotalFn
38
38
  /** 总页数 ≤ 1 时不渲染整个组件 @default false */
39
39
  hideOnSinglePage?: boolean
@@ -2,7 +2,7 @@
2
2
 
3
3
  > Pagination:数据量较大、需要分批次浏览列表或表格时。
4
4
 
5
- 版本:`1.3.1`。组件源码在本目录,属于当前项目。
5
+ 版本:`1.3.3`。组件源码在本目录,属于当前项目。
6
6
 
7
7
  公开导出:`Pagination`。
8
8
 
@@ -41,7 +41,7 @@ export default () => <Pagination total={85} defaultCurrent={1} />
41
41
  | disabled | 整体禁用 | `boolean` | 否 | `false` |
42
42
  | showSizeChanger | 显示 pageSize 切换器。<br>未传 → total > 50 时自动 true;显式 false → 永远关;显式 true → 永远开 | `boolean` | 否 | — |
43
43
  | showQuickJumper | 兼容旧调用方;当前 React 设计不渲染快速跳转输入 | `boolean` | 否 | — |
44
- | showTotal | 兼容旧调用方;当前 React 设计不渲染总数区域 | `ShowTotalFn` | 否 | — |
44
+ | showTotal | 自定义总条数文案和当前页范围。不传时隐藏总数区域。 | `ShowTotalFn` | 否 | — |
45
45
  | hideOnSinglePage | 总页数 ≤ 1 时不渲染整个组件 | `boolean` | 否 | `false` |
46
46
  | itemRender | 自定义每项渲染。<br>所有可点项(prev/next/jump-prev/jump-next/page)都调用此函数。<br>业务方应用 React.cloneElement(originalElement, ...) 保留 a11y props。 | `ItemRender` | 否 | — |
47
47
  | responsive | 开启容器宽度自适应(ResizeObserver 四档)。 | `boolean` | 否 | `false` |
@@ -157,11 +157,9 @@ export default () => {
157
157
  }
158
158
  ```
159
159
 
160
- ### 受控用法 (show-total)
160
+ ### 显示总数
161
161
 
162
- **显示总数**
163
-
164
- `showTotal` 自定义总数展示文案,接收 `(total, range) => 自定义节点`。
162
+ 传入 `showTotal` 可自定义总数文案。回调接收 `(total, range)`,其中 `range` 是当前页的起止序号。默认隐藏总数区域。
165
163
 
166
164
  ```tsx
167
165
  import { Pagination } from '@/components/apex/pagination'
@@ -1,6 +1,6 @@
1
1
  # Pagination Token 明细
2
2
 
3
- 包:`@apexhub/apex-ui-react`;版本:`1.3.0`(当前源码快照)。
3
+ 包:`@apexhub/apex-ui-react`;版本:`1.3.3`(当前源码快照)。
4
4
 
5
5
  按需读取:[组件用法](./llm.txt) · [主题与覆盖规则](../../llms-theme.txt)。
6
6
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > Popover:需要在触发元素旁展示标题 + 正文,且正文内可包含链接、按钮等可交互元素时。
4
4
 
5
- 版本:`1.3.1`。组件源码在本目录,属于当前项目。
5
+ 版本:`1.3.3`。组件源码在本目录,属于当前项目。
6
6
 
7
7
  公开导出:`Popover`。
8
8
 
@@ -1,6 +1,6 @@
1
1
  # Popover Token 明细
2
2
 
3
- 包:`@apexhub/apex-ui-react`;版本:`1.3.0`(当前源码快照)。
3
+ 包:`@apexhub/apex-ui-react`;版本:`1.3.3`(当前源码快照)。
4
4
 
5
5
  按需读取:[组件用法](./llm.txt) · [主题与覆盖规则](../../llms-theme.txt)。
6
6
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > Progress:需要向用户展示任务、上传、加载等操作的完成百分比时。
4
4
 
5
- 版本:`1.3.1`。组件源码在本目录,属于当前项目。
5
+ 版本:`1.3.3`。组件源码在本目录,属于当前项目。
6
6
 
7
7
  公开导出:`Progress`。
8
8