@apexhub/apex-ui-react-source 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -4
- package/bin/apex-ui-react-source.mjs +208 -24
- package/dist/files/AGENTS.md +2 -2
- 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 +6 -5
- package/template/_gitignore +5 -0
- package/template/index.html +12 -0
- package/template/src/App.tsx +25 -0
- package/template/src/main.tsx +14 -0
- package/template/tsconfig.app.json +22 -0
- package/template/tsconfig.json +4 -0
- package/template/tsconfig.node.json +16 -0
- package/template/vite.config.ts +8 -0
package/dist/files/menu/llm.txt
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Menu:侧栏持久导航,需要在图标 rail 与展开列表之间切换时。
|
|
4
4
|
|
|
5
|
-
版本:`1.2.
|
|
5
|
+
版本:`1.2.2`。组件源码在本目录,属于当前项目。
|
|
6
6
|
|
|
7
7
|
公开导出:`isKeySelected`、`Menu`。
|
|
8
8
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
```tsx
|
|
14
14
|
import { Button } from '@/components/apex/button'
|
|
15
|
-
import { Menu, MenuItemType } from '@/components/apex/menu'
|
|
15
|
+
import { Menu, type MenuItemType } from '@/components/apex/menu'
|
|
16
16
|
|
|
17
17
|
import { useState } from 'react'
|
|
18
18
|
|
|
@@ -32,13 +32,20 @@ const items: MenuItemType[] = [
|
|
|
32
32
|
|
|
33
33
|
export default () => {
|
|
34
34
|
const [collapsed, setCollapsed] = useState(false)
|
|
35
|
+
|
|
35
36
|
return (
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
<Menu
|
|
38
|
+
items={items}
|
|
39
|
+
collapsed={collapsed}
|
|
40
|
+
onCollapse={setCollapsed}
|
|
41
|
+
defaultOpenKeys={['workspace']}
|
|
42
|
+
defaultSelectedKeys={['projects']}
|
|
43
|
+
footer={
|
|
44
|
+
<Button type="text" onClick={() => setCollapsed((current) => !current)}>
|
|
45
|
+
{collapsed ? '展开菜单' : '收起菜单'}
|
|
46
|
+
</Button>
|
|
47
|
+
}
|
|
48
|
+
/>
|
|
42
49
|
)
|
|
43
50
|
}
|
|
44
51
|
```
|
|
@@ -265,8 +272,8 @@ const railStyle = {
|
|
|
265
272
|
flexDirection: 'column' as const,
|
|
266
273
|
width: 'fit-content',
|
|
267
274
|
height: '100%',
|
|
268
|
-
backgroundColor: '
|
|
269
|
-
borderRight: '
|
|
275
|
+
backgroundColor: 'var(--apex-fill-neutral-secondary)',
|
|
276
|
+
borderRight: 'var(--apex-border-1) solid var(--apex-stroke-neutral-tertiary)',
|
|
270
277
|
padding: 8,
|
|
271
278
|
boxSizing: 'border-box' as const,
|
|
272
279
|
justifyContent: 'space-between' as const,
|
|
@@ -476,7 +483,7 @@ export default () => {
|
|
|
476
483
|
|
|
477
484
|
### 自定义顶栏
|
|
478
485
|
|
|
479
|
-
通过 `header` 与 `footer`
|
|
486
|
+
通过 `header` 与 `footer` 插槽自定义收窄与展开态的顶栏、底栏内容;展开态的顶栏沿用菜单 Token 表面样式。
|
|
480
487
|
|
|
481
488
|
```tsx
|
|
482
489
|
import { Avatar } from '@/components/apex/avatar'
|
|
@@ -599,7 +606,7 @@ export default () => {
|
|
|
599
606
|
height: '100%',
|
|
600
607
|
cursor: 'pointer',
|
|
601
608
|
backgroundColor: profileHovered
|
|
602
|
-
? '
|
|
609
|
+
? 'var(--apex-fill-neutral-tertiary)'
|
|
603
610
|
: undefined,
|
|
604
611
|
transition: 'background-color 0.15s ease',
|
|
605
612
|
}}
|
package/dist/files/menu/menu.css
CHANGED
|
@@ -41,7 +41,9 @@
|
|
|
41
41
|
justify-content: space-between;
|
|
42
42
|
width: var(--menu-spacing-width-panel);
|
|
43
43
|
min-width: var(--menu-spacing-width-panel);
|
|
44
|
-
padding:
|
|
44
|
+
padding:
|
|
45
|
+
calc(var(--menu-spacing-padding-y) + var(--menu-spacing-gap-sm) * 0.5)
|
|
46
|
+
calc(var(--menu-spacing-padding-x) + var(--menu-spacing-gap-sm) * 0.5);
|
|
45
47
|
background-color: var(--menu-fill-container-default);
|
|
46
48
|
}
|
|
47
49
|
|
|
@@ -118,6 +120,10 @@
|
|
|
118
120
|
gap: var(--menu-spacing-gap-md);
|
|
119
121
|
}
|
|
120
122
|
|
|
123
|
+
.apex-menu.apex-menu--menu-maximized .apex-menu__body {
|
|
124
|
+
gap: calc(var(--menu-spacing-gap-md) + var(--menu-spacing-gap-sm) * 0.5);
|
|
125
|
+
}
|
|
126
|
+
|
|
121
127
|
.apex-menu.apex-menu--menu-collapsed .apex-menu__body {
|
|
122
128
|
align-items: center;
|
|
123
129
|
}
|
|
@@ -135,7 +141,11 @@
|
|
|
135
141
|
padding-bottom: var(--menu-spacing-gap-md);
|
|
136
142
|
overflow: hidden;
|
|
137
143
|
white-space: nowrap;
|
|
138
|
-
color: var(--menu-button-
|
|
144
|
+
color: var(--menu-button-text-default);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.apex-menu.apex-menu--menu-maximized .apex-menu__header {
|
|
148
|
+
padding-bottom: 0;
|
|
139
149
|
}
|
|
140
150
|
|
|
141
151
|
/* ── Footer (always present) ─────────────────────────────────────────────── */
|
|
@@ -222,7 +232,7 @@
|
|
|
222
232
|
min-height: 0;
|
|
223
233
|
padding: 0;
|
|
224
234
|
margin: 0;
|
|
225
|
-
gap: var(--menu-spacing-gap-sm);
|
|
235
|
+
gap: var(--apex-spacing-12, var(--menu-spacing-gap-sm));
|
|
226
236
|
overflow-x: visible;
|
|
227
237
|
overflow-y: auto;
|
|
228
238
|
list-style: none;
|
|
@@ -280,7 +290,8 @@
|
|
|
280
290
|
grid-template-columns: minmax(0, 1fr);
|
|
281
291
|
width: 100%;
|
|
282
292
|
min-height: 0;
|
|
283
|
-
|
|
293
|
+
align-content: start;
|
|
294
|
+
gap: calc(var(--menu-spacing-gap-sm) * 2);
|
|
284
295
|
margin: 0;
|
|
285
296
|
padding: 0;
|
|
286
297
|
overflow-x: hidden;
|
|
@@ -302,6 +313,7 @@
|
|
|
302
313
|
height: var(--menu-button-spacing-height);
|
|
303
314
|
padding: 0 var(--menu-button-spacing-padding-x);
|
|
304
315
|
gap: var(--menu-button-spacing-gap);
|
|
316
|
+
border: var(--menu-button-stroke-stroke) solid var(--menu-button-stroke-default);
|
|
305
317
|
border-radius: var(--menu-button-radius-radius);
|
|
306
318
|
background-color: var(--menu-button-fill-default);
|
|
307
319
|
color: var(--menu-button-text-default);
|
|
@@ -337,6 +349,7 @@
|
|
|
337
349
|
|
|
338
350
|
.apex-menu .apex-menu__row:hover:not(:disabled) {
|
|
339
351
|
background-color: var(--menu-button-fill-hover);
|
|
352
|
+
border-color: var(--menu-button-stroke-hover);
|
|
340
353
|
color: var(--menu-button-text-hover);
|
|
341
354
|
}
|
|
342
355
|
|
|
@@ -346,6 +359,7 @@
|
|
|
346
359
|
|
|
347
360
|
.apex-menu .apex-menu__row:active:not(:disabled) {
|
|
348
361
|
background-color: var(--menu-button-fill-active);
|
|
362
|
+
border-color: var(--menu-button-stroke-active);
|
|
349
363
|
color: var(--menu-button-text-active);
|
|
350
364
|
}
|
|
351
365
|
|
|
@@ -356,13 +370,22 @@
|
|
|
356
370
|
.apex-menu .apex-menu__row[data-selected-secondary]:hover:not(:disabled),
|
|
357
371
|
.apex-menu .apex-menu__row[data-selected-secondary]:active:not(:disabled) {
|
|
358
372
|
background-color: var(--menu-button-fill-selected);
|
|
373
|
+
border-color: var(--menu-button-stroke-selected);
|
|
359
374
|
color: var(--menu-button-text-selected);
|
|
360
375
|
}
|
|
361
376
|
|
|
362
|
-
.apex-menu .apex-menu__row[data-selected] .apex-
|
|
363
|
-
.apex-menu .apex-menu__row[data-selected] .apex-
|
|
364
|
-
.apex-menu .apex-menu__row[data-selected-secondary] .apex-
|
|
365
|
-
|
|
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 {
|
|
380
|
+
color: var(--menu-button-text-selected);
|
|
381
|
+
}
|
|
382
|
+
|
|
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 {
|
|
366
389
|
color: var(--menu-button-icon-selected);
|
|
367
390
|
}
|
|
368
391
|
|
|
@@ -376,6 +399,7 @@
|
|
|
376
399
|
.apex-menu .apex-menu__row:disabled,
|
|
377
400
|
.apex-menu .apex-menu__row[data-disabled] {
|
|
378
401
|
background-color: var(--menu-button-fill-disabled);
|
|
402
|
+
border-color: var(--menu-button-stroke-disabled);
|
|
379
403
|
color: var(--menu-button-text-disabled);
|
|
380
404
|
}
|
|
381
405
|
|
|
@@ -411,20 +435,22 @@
|
|
|
411
435
|
width: 100%;
|
|
412
436
|
min-width: 0;
|
|
413
437
|
max-width: 100%;
|
|
414
|
-
gap:
|
|
438
|
+
gap: 0;
|
|
415
439
|
}
|
|
416
440
|
|
|
417
441
|
.apex-menu .apex-menu__sublist {
|
|
418
|
-
|
|
442
|
+
--menu-sublist-offset: max(0px, calc(var(--menu-inline-indent) - var(--menu-spacing-gap-sm)));
|
|
443
|
+
gap: calc(var(--menu-spacing-gap-sm) * 2);
|
|
419
444
|
position: relative;
|
|
420
445
|
display: grid;
|
|
421
446
|
grid-template-columns: minmax(0, 1fr);
|
|
422
|
-
width: calc(100% - var(--menu-
|
|
447
|
+
width: calc(100% - var(--menu-sublist-offset));
|
|
423
448
|
min-width: 0;
|
|
424
|
-
max-width: calc(100% - var(--menu-
|
|
449
|
+
max-width: calc(100% - var(--menu-sublist-offset));
|
|
425
450
|
box-sizing: border-box;
|
|
426
|
-
margin-block-start: var(--menu-spacing-gap-
|
|
427
|
-
margin-
|
|
451
|
+
margin-block-start: var(--menu-spacing-gap-md);
|
|
452
|
+
margin-block-end: calc(var(--menu-spacing-gap-sm) * 2);
|
|
453
|
+
margin-inline-start: var(--menu-sublist-offset);
|
|
428
454
|
padding: 0;
|
|
429
455
|
padding-inline-start: var(--menu-spacing-gap-sublist);
|
|
430
456
|
list-style: none;
|
|
@@ -434,7 +460,7 @@
|
|
|
434
460
|
content: '';
|
|
435
461
|
position: absolute;
|
|
436
462
|
inset-block: 0;
|
|
437
|
-
inset-inline-start:
|
|
463
|
+
inset-inline-start: 0;
|
|
438
464
|
width: var(--menu-stroke-stroke);
|
|
439
465
|
background-color: var(--menu-button-fill-hover);
|
|
440
466
|
pointer-events: none;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
.menu-figma-reference {
|
|
2
|
+
font-family: 'PingFang SC', sans-serif;
|
|
3
|
+
font-size: var(--apex-typography-body-font-size);
|
|
4
|
+
font-weight: var(--apex-typography-body-font-weight);
|
|
5
|
+
line-height: var(--apex-typography-body-line-height);
|
|
6
|
+
letter-spacing: 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.menu-figma-header {
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
justify-content: space-between;
|
|
13
|
+
width: 100%;
|
|
14
|
+
min-width: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.menu-figma-header__collapse {
|
|
18
|
+
display: inline-flex;
|
|
19
|
+
flex: none;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
width: calc(var(--menu-button-spacing-height) - var(--menu-button-spacing-gap));
|
|
23
|
+
height: calc(var(--menu-button-spacing-height) - var(--menu-button-spacing-gap));
|
|
24
|
+
padding: 0;
|
|
25
|
+
border: 0;
|
|
26
|
+
background: transparent;
|
|
27
|
+
color: var(--menu-button-icon-default);
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.menu-figma-header__collapse:hover {
|
|
32
|
+
color: var(--menu-button-icon-hover);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.menu-figma-header__collapse svg {
|
|
36
|
+
display: block;
|
|
37
|
+
width: calc(var(--menu-button-icon-icon) - var(--menu-button-spacing-gap));
|
|
38
|
+
height: calc(var(--menu-button-icon-icon) - var(--menu-button-spacing-gap));
|
|
39
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Menu 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
|
|
|
@@ -48,6 +48,19 @@
|
|
|
48
48
|
| `--menu-button-spacing-padding-x` | `padding` | `var(--apex-spacing-8)` | `.apex-menu-button.apex-icon-menu-button` |
|
|
49
49
|
| `--menu-button-spacing-padding-x` | `padding` | `var(--apex-spacing-12)` | `.apex-menu-button.apex-primary-menu-button` |
|
|
50
50
|
| `--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-quaternary)` | `.apex-menu-button.apex-secondary-menu-button` |
|
|
53
|
+
| `--menu-button-stroke-default` | `border` | `var(--apex-stroke-neutral-secondary)` | `.apex-menu-button.apex-primary-menu-button` |
|
|
54
|
+
| `--menu-button-stroke-default` | `border` | `var(--apex-stroke-neutral-secondary)` | `.apex-menu-button.apex-secondary-menu-button` |
|
|
55
|
+
| `--menu-button-stroke-disabled` | `border-color` | `var(--apex-stroke-neutral-primary)` | `.apex-menu-button.apex-primary-menu-button` |
|
|
56
|
+
| `--menu-button-stroke-disabled` | `border-color` | `var(--apex-stroke-neutral-primary)` | `.apex-menu-button.apex-secondary-menu-button` |
|
|
57
|
+
| `--menu-button-stroke-hover` | `border-color` | `var(--apex-stroke-neutral-tertiary)` | `.apex-menu-button.apex-primary-menu-button` |
|
|
58
|
+
| `--menu-button-stroke-hover` | `border-color` | `var(--apex-stroke-neutral-tertiary)` | `.apex-menu-button.apex-secondary-menu-button` |
|
|
59
|
+
| `--menu-button-stroke-selected` | `border-color` | `var(--apex-stroke-neutral-secondary)` | `.apex-menu-button.apex-primary-menu-button` |
|
|
60
|
+
| `--menu-button-stroke-selected` | `border-color` | `var(--apex-stroke-brand-transparent)` | `.apex-menu-button.apex-secondary-menu-button` |
|
|
61
|
+
| `--menu-button-stroke-stroke` | `border` | `var(--apex-border-1)` | `.apex-menu-button.apex-icon-menu-button` |
|
|
62
|
+
| `--menu-button-stroke-stroke` | `border` | `var(--apex-border-1)` | `.apex-menu-button.apex-primary-menu-button` |
|
|
63
|
+
| `--menu-button-stroke-stroke` | `border` | `var(--apex-border-1)` | `.apex-menu-button.apex-secondary-menu-button` |
|
|
51
64
|
| `--menu-button-text-active` | `color` | `var(--apex-text-neutral-tertiary)` | `.apex-menu-button.apex-primary-menu-button` |
|
|
52
65
|
| `--menu-button-text-active` | `color` | `var(--apex-text-neutral-primary)` | `.apex-menu-button.apex-secondary-menu-button` |
|
|
53
66
|
| `--menu-button-text-default` | `color` | `var(--apex-text-neutral-primary)` | `.apex-menu-button.apex-primary-menu-button` |
|
|
@@ -62,13 +75,13 @@
|
|
|
62
75
|
| `--menu-fill-container-default` | `background-color` | `var(--apex-fill-neutral-secondary)` | `.apex-menu.apex-default-menu` |
|
|
63
76
|
| `--menu-radius-radius` | `border-radius` | `var(--apex-radius-8)` | `.apex-menu.apex-container-md-menu` |
|
|
64
77
|
| `--menu-radius-radius` | `border-radius` | `var(--apex-radius-8)` | `.apex-menu.apex-container-sm-menu` |
|
|
65
|
-
| `--menu-spacing-gap-md` | `gap`、`margin-
|
|
66
|
-
| `--menu-spacing-gap-md` | `gap`、`margin-
|
|
67
|
-
| `--menu-spacing-gap-sm` | `gap`、`
|
|
68
|
-
| `--menu-spacing-gap-sm` | `gap`、`
|
|
69
|
-
| `--menu-spacing-gap-sm` | `gap`、`
|
|
70
|
-
| `--menu-spacing-gap-sublist` | `padding-inline-start` | `var(--apex-spacing-12)` | `.apex-menu.apex-container-md-menu` |
|
|
71
|
-
| `--menu-spacing-gap-sublist` | `padding-inline-start` | `var(--apex-spacing-12)` | `.apex-menu.apex-container-sm-menu` |
|
|
78
|
+
| `--menu-spacing-gap-md` | `gap`、`margin-block-start`、`padding`、`padding-bottom` | `var(--apex-spacing-12)` | `.apex-menu.apex-container-md-menu` |
|
|
79
|
+
| `--menu-spacing-gap-md` | `gap`、`margin-block-start`、`padding`、`padding-bottom` | `var(--apex-spacing-8)` | `.apex-menu.apex-container-sm-menu` |
|
|
80
|
+
| `--menu-spacing-gap-sm` | `gap`、`margin-block`、`margin-block-end`、`margin-inline-start`、`max-width`、`padding`、`width` | `var(--apex-spacing-4)` | `.apex-menu-sliding-panel` |
|
|
81
|
+
| `--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-md-menu` |
|
|
82
|
+
| `--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
|
+
| `--menu-spacing-gap-sublist` | `margin-inline-start`、`max-width`、`padding-inline-start`、`width` | `var(--apex-spacing-12)` | `.apex-menu.apex-container-md-menu` |
|
|
84
|
+
| `--menu-spacing-gap-sublist` | `margin-inline-start`、`max-width`、`padding-inline-start`、`width` | `var(--apex-spacing-12)` | `.apex-menu.apex-container-sm-menu` |
|
|
72
85
|
| `--menu-spacing-padding-x` | `padding` | `var(--apex-spacing-8)` | `.apex-menu-sliding-panel` |
|
|
73
86
|
| `--menu-spacing-padding-x` | `padding` | `var(--apex-spacing-8)` | `.apex-menu.apex-container-md-menu` |
|
|
74
87
|
| `--menu-spacing-padding-x` | `padding` | `var(--apex-spacing-4)` | `.apex-menu.apex-container-sm-menu` |
|
|
@@ -133,8 +133,7 @@ function inferSizeFromCustomWidth(
|
|
|
133
133
|
|
|
134
134
|
if (numericWidth == null || !Number.isFinite(numericWidth)) return null
|
|
135
135
|
if (numericWidth <= 420) return 'sm'
|
|
136
|
-
if (numericWidth <=
|
|
137
|
-
if (numericWidth <= 720) return 'lg'
|
|
136
|
+
if (numericWidth <= 720) return 'md'
|
|
138
137
|
return 'xl'
|
|
139
138
|
}
|
|
140
139
|
|
|
@@ -144,7 +144,7 @@ export interface ModalProps {
|
|
|
144
144
|
/**
|
|
145
145
|
* 自定义宽度(px 数字或 CSS 长度);设置后覆盖 `size` 对应的宽度。
|
|
146
146
|
* 面板高度按内容自然增长,不受宽度对应尺寸档的最小高度约束;超出视口时由外层容器整体滚动。
|
|
147
|
-
* 未显式传 `size` 时,数字或 px 宽度仍按 420 /
|
|
147
|
+
* 未显式传 `size` 时,数字或 px 宽度仍按 420 / 720 / 1000 断点匹配尺寸样式。
|
|
148
148
|
* 兼容:`size` 省略时 `sm` / `md` 字符串仍按 `size` 处理。
|
|
149
149
|
*/
|
|
150
150
|
width?: string | number
|
package/dist/files/modal/llm.txt
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Modal:需要用户阅读并确认、取消或提交,且应暂时阻断当前页面操作时。
|
|
4
4
|
|
|
5
|
-
版本:`1.2.
|
|
5
|
+
版本:`1.2.2`。组件源码在本目录,属于当前项目。
|
|
6
6
|
|
|
7
7
|
公开导出:`Modal`。
|
|
8
8
|
|
|
@@ -72,7 +72,7 @@ export default () => {
|
|
|
72
72
|
| styles | 各语义节点的内联样式,支持对象或函数 | `Partial<Record<SemanticDOM, React.CSSProperties>> \| ((info: { props: ModalProps }) => Partial<Record<SemanticDOM, React.CSSProperties>>)` | 否 | — |
|
|
73
73
|
| title | 标题。`undefined`(缺省)且无关闭钮时自动补 sr-only 标题以满足无障碍;<br>`null` 时消费方在 `children` 中自行提供标题(如 `Modal.confirm`),不渲染标题区且不兜底 sr-only,须配合 `titleId` 关联无障碍名称。 | `React.ReactNode` | 否 | — |
|
|
74
74
|
| open | 是否显示弹窗(受控;必填) | `boolean` | 是 | — |
|
|
75
|
-
| width | 自定义宽度(px 数字或 CSS 长度);设置后覆盖 `size` 对应的宽度。<br>面板高度按内容自然增长,不受宽度对应尺寸档的最小高度约束;超出视口时由外层容器整体滚动。<br>未显式传 `size` 时,数字或 px 宽度仍按 420 /
|
|
75
|
+
| width | 自定义宽度(px 数字或 CSS 长度);设置后覆盖 `size` 对应的宽度。<br>面板高度按内容自然增长,不受宽度对应尺寸档的最小高度约束;超出视口时由外层容器整体滚动。<br>未显式传 `size` 时,数字或 px 宽度仍按 420 / 720 / 1000 断点匹配尺寸样式。<br>兼容:`size` 省略时 `sm` / `md` 字符串仍按 `size` 处理。 | `string \| number` | 否 | — |
|
|
76
76
|
| wrapClassName | 含蒙层的容器 className | `string` | 否 | — |
|
|
77
77
|
| onCancel | 点击蒙层、右上角关闭或 Cancel 时触发 | `(e: React.MouseEvent<HTMLElement> \| React.KeyboardEvent<HTMLElement>) => void` | 否 | — |
|
|
78
78
|
| onOk | 点击 OK 时触发 | `(e: React.MouseEvent<HTMLElement>) => void` | 否 | — |
|
|
@@ -262,7 +262,7 @@ export default () => {
|
|
|
262
262
|
|
|
263
263
|
### 尺寸与宽度
|
|
264
264
|
|
|
265
|
-
`size`
|
|
265
|
+
`size` 对应三档宽度:`sm` 420px、`md` 720px(默认)、`xl` 1000px;`lg` 为 720px 的兼容别名。传入 `width`(数字或 CSS 长度)时会覆盖预设宽度。
|
|
266
266
|
|
|
267
267
|
```tsx
|
|
268
268
|
import { Button } from '@/components/apex/button'
|
|
@@ -271,14 +271,14 @@ import { Modal } from '@/components/apex/modal'
|
|
|
271
271
|
import { useState } from 'react'
|
|
272
272
|
|
|
273
273
|
export default () => {
|
|
274
|
-
const [kind, setKind] = useState<'sm' | 'md' | '
|
|
274
|
+
const [kind, setKind] = useState<'sm' | 'md' | 'xl' | 'custom' | null>(null)
|
|
275
275
|
|
|
276
276
|
return (
|
|
277
277
|
<>
|
|
278
278
|
<div style={{ display: 'flex', gap: 8, flexWrap: 'wrap' }}>
|
|
279
279
|
<Button onClick={() => setKind('sm')}>sm(420px)</Button>
|
|
280
|
-
<Button onClick={() => setKind('md')}>md(
|
|
281
|
-
<Button onClick={() => setKind('
|
|
280
|
+
<Button onClick={() => setKind('md')}>md(720px)</Button>
|
|
281
|
+
<Button onClick={() => setKind('xl')}>xl(1000px)</Button>
|
|
282
282
|
<Button onClick={() => setKind('custom')}>自定义 width</Button>
|
|
283
283
|
</div>
|
|
284
284
|
<Modal
|
|
@@ -300,13 +300,13 @@ export default () => {
|
|
|
300
300
|
使用 size="md"。
|
|
301
301
|
</Modal>
|
|
302
302
|
<Modal
|
|
303
|
-
open={kind === '
|
|
304
|
-
size="
|
|
303
|
+
open={kind === 'xl'}
|
|
304
|
+
size="xl"
|
|
305
305
|
title="大尺寸"
|
|
306
306
|
onCancel={() => setKind(null)}
|
|
307
307
|
onOk={() => setKind(null)}
|
|
308
308
|
>
|
|
309
|
-
使用 size="
|
|
309
|
+
使用 size="xl"。
|
|
310
310
|
</Modal>
|
|
311
311
|
<Modal
|
|
312
312
|
open={kind === 'custom'}
|
|
@@ -31,7 +31,9 @@ export const PageButton: React.FC<PageButtonProps> = ({
|
|
|
31
31
|
|
|
32
32
|
return (
|
|
33
33
|
<Button
|
|
34
|
+
variant="text"
|
|
34
35
|
data-slot="pagination-button"
|
|
36
|
+
data-pagination-type={_type}
|
|
35
37
|
className={cn('apex-pagination-button', 'apex-default-pagination-button')}
|
|
36
38
|
disabled={isDisabled}
|
|
37
39
|
onClick={() => {
|