@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.
- package/dist/files/AGENTS.md +1 -1
- package/dist/files/alert/llm.txt +1 -1
- package/dist/files/alert/tokens.txt +1 -1
- package/dist/files/apex-provider/llm.txt +1 -1
- package/dist/files/auto-complete/llm.txt +1 -1
- package/dist/files/auto-complete/tokens.txt +1 -1
- package/dist/files/avatar/llm.txt +1 -1
- package/dist/files/avatar/tokens.txt +1 -1
- package/dist/files/breadcrumb/llm.txt +1 -1
- package/dist/files/breadcrumb/tokens.txt +1 -1
- package/dist/files/button/llm.txt +1 -1
- package/dist/files/button/tokens.txt +1 -1
- package/dist/files/card/llm.txt +1 -1
- package/dist/files/card/tokens.txt +1 -1
- package/dist/files/cascader/llm.txt +1 -1
- package/dist/files/cascader/tokens.txt +1 -1
- package/dist/files/checkbox/llm.txt +1 -1
- package/dist/files/checkbox/tokens.txt +1 -1
- package/dist/files/collapse/llm.txt +1 -1
- package/dist/files/collapse/tokens.txt +1 -1
- package/dist/files/date-picker/llm.txt +1 -1
- package/dist/files/date-picker/tokens.txt +1 -1
- package/dist/files/divider/llm.txt +1 -1
- package/dist/files/divider/tokens.txt +1 -1
- package/dist/files/drawer/llm.txt +1 -1
- package/dist/files/drawer/tokens.txt +1 -1
- package/dist/files/dropdown/llm.txt +1 -1
- package/dist/files/dropdown/tokens.txt +1 -1
- package/dist/files/form/form.css +0 -10
- package/dist/files/form/llm.txt +12 -1
- package/dist/files/form/tokens.txt +1 -3
- package/dist/files/grid/llm.txt +1 -1
- package/dist/files/image/llm.txt +1 -1
- package/dist/files/image/tokens.txt +1 -1
- package/dist/files/input/llm.txt +1 -1
- package/dist/files/input/tokens.txt +1 -1
- package/dist/files/input-number/input-number.css +15 -2
- package/dist/files/input-number/llm.txt +2 -2
- package/dist/files/input-number/tokens.txt +5 -5
- package/dist/files/layout/llm.txt +1 -1
- package/dist/files/layout/tokens.txt +1 -1
- package/dist/files/menu/Menu.tsx +27 -11
- package/dist/files/menu/icons.tsx +4 -4
- package/dist/files/menu/interface.ts +7 -7
- package/dist/files/menu/lib.ts +11 -6
- package/dist/files/menu/llm.txt +25 -10
- package/dist/files/menu/menu.css +73 -32
- package/dist/files/menu/tokens.txt +14 -13
- package/dist/files/message/llm.txt +1 -1
- package/dist/files/message/tokens.txt +1 -1
- package/dist/files/modal/llm.txt +1 -1
- 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/Pagination.tsx +20 -2
- package/dist/files/pagination/interface.ts +1 -1
- package/dist/files/pagination/llm.txt +4 -6
- package/dist/files/pagination/tokens.txt +1 -1
- package/dist/files/popover/llm.txt +1 -1
- package/dist/files/popover/tokens.txt +1 -1
- package/dist/files/progress/llm.txt +1 -1
- package/dist/files/progress/tokens.txt +1 -1
- package/dist/files/radio/llm.txt +1 -1
- package/dist/files/radio/tokens.txt +1 -1
- package/dist/files/rate/llm.txt +1 -1
- package/dist/files/rate/tokens.txt +1 -1
- package/dist/files/select/llm.txt +1 -1
- package/dist/files/select/tokens.txt +1 -1
- 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/llm.txt +1 -1
- package/dist/files/table/tokens.txt +1 -1
- package/dist/files/tabs/llm.txt +1 -1
- package/dist/files/tabs/tokens.txt +1 -1
- package/dist/files/tag/llm.txt +1 -1
- package/dist/files/tag/tokens.txt +1 -1
- package/dist/files/theme/aliases.css +1 -1
- package/dist/files/theme/component-tokens.css +5 -5
- package/dist/files/theme/primitives.css +1 -1
- package/dist/files/tooltip/Tooltip.tsx +60 -24
- package/dist/files/tooltip/llm.txt +1 -1
- package/dist/files/tooltip/tokens.txt +1 -1
- package/dist/files/tree/llm.txt +1 -1
- package/dist/files/tree/tokens.txt +1 -1
- package/dist/files/tree-select/llm.txt +1 -1
- package/dist/files/tree-select/tokens.txt +1 -1
- package/dist/files/typography/llm.txt +1 -1
- package/dist/files/typography/tokens.txt +1 -1
- package/dist/files/upload/llm.txt +26 -1
- package/dist/files/upload/tokens.txt +1 -1
- package/dist/manifest.json +97 -97
- package/package.json +4 -4
- package/template/index.html +5 -0
package/dist/files/AGENTS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Apex UI source (React) — rules for AI assistants
|
|
2
2
|
|
|
3
|
-
This folder is Apex UI 1.3.
|
|
3
|
+
This folder is Apex UI 1.3.3, installed as source code by `@apexhub/apex-ui-react-source`.
|
|
4
4
|
The code now belongs to this project: you may edit it.
|
|
5
5
|
|
|
6
6
|
## Using components
|
package/dist/files/alert/llm.txt
CHANGED
package/dist/files/card/llm.txt
CHANGED
package/dist/files/form/form.css
CHANGED
|
@@ -222,16 +222,6 @@
|
|
|
222
222
|
color: var(--form-text-caption-default);
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
-
/* Figma form1/form2:caption 从控件底边下方 4px 开始。 */
|
|
226
|
-
.apex-form__item--vertical .apex-form__item-caption {
|
|
227
|
-
margin-top: var(--form-spacing-gap);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
.apex-form__item--horizontal .apex-form__item-caption,
|
|
231
|
-
.apex-form__item--inline .apex-form__item-caption {
|
|
232
|
-
margin-top: var(--form-spacing-gap-y);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
225
|
/* caption 预留态:保证最小高度防止布局跳动 */
|
|
236
226
|
.apex-form__item-caption[data-reserve] {
|
|
237
227
|
min-height: 16px;
|
package/dist/files/form/llm.txt
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Form:需要收集、校验并提交一组结构化字段数据时。
|
|
4
4
|
|
|
5
|
-
版本:`1.3.
|
|
5
|
+
版本:`1.3.3`。组件源码在本目录,属于当前项目。
|
|
6
6
|
|
|
7
7
|
公开导出:`Form`、`FormItem`、`useForm`。
|
|
8
8
|
|
|
@@ -280,6 +280,8 @@ export default () => (
|
|
|
280
280
|
|
|
281
281
|
在 `Form.Item` 的 `rules` 中声明同步或异步校验;失败时触发提交失败事件。
|
|
282
282
|
|
|
283
|
+
提示和校验文字紧贴输入框;字段之间仍保留表单布局间距。
|
|
284
|
+
|
|
283
285
|
```tsx
|
|
284
286
|
import { Button } from '@/components/apex/button'
|
|
285
287
|
import { Form } from '@/components/apex/form'
|
|
@@ -344,3 +346,12 @@ export default () => (
|
|
|
344
346
|
### `Form.Item` 的 `name` 支持 `user.name` 这种路径吗?
|
|
345
347
|
|
|
346
348
|
v1 不支持点号或方括号嵌套路径,`name` 须为单层字符串字段名。
|
|
349
|
+
|
|
350
|
+
### `valuePropName` 和 `getValueFromEvent` 什么时候用?
|
|
351
|
+
|
|
352
|
+
`Form.Item` 默认把字段值通过子组件的 `value` 传入,并把 `onChange` 的参数当作新值(参数是事件时取 `event.target.value`,勾选框取 `checked`)。子组件不符合这个约定时用这两个属性:
|
|
353
|
+
|
|
354
|
+
- `valuePropName`:值要传给哪个属性,例如 Switch 用 `checked`,Upload 用 `fileList`。
|
|
355
|
+
- `getValueFromEvent`:从 `onChange` 的参数里取出要存的值,例如 Upload 的 `(info) => info.fileList`。
|
|
356
|
+
|
|
357
|
+
Upload 的完整写法见 [Upload](/components/upload) 页 FAQ 的“在 `Form` 里怎么用 Upload?”。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Form Token 明细
|
|
2
2
|
|
|
3
|
-
包:`@apexhub/apex-ui-react`;版本:`1.3.
|
|
3
|
+
包:`@apexhub/apex-ui-react`;版本:`1.3.3`(当前源码快照)。
|
|
4
4
|
|
|
5
5
|
按需读取:[组件用法](./llm.txt) · [主题与覆盖规则](../../llms-theme.txt)。
|
|
6
6
|
|
|
@@ -10,12 +10,10 @@
|
|
|
10
10
|
|
|
11
11
|
| Token | 用途(CSS 属性) | 定义值 | 定义作用域 |
|
|
12
12
|
| --- | --- | --- | --- |
|
|
13
|
-
| `--form-spacing-gap` | `margin-top` | `var(--apex-spacing-4)` | `.apex-form.apex-vertical-form` |
|
|
14
13
|
| `--form-spacing-gap-caption` | `gap` | `var(--apex-spacing-0)` | `.apex-form.apex-horizontal-form` |
|
|
15
14
|
| `--form-spacing-gap-caption` | `gap` | `var(--apex-spacing-0)` | `.apex-form.apex-vertical-form` |
|
|
16
15
|
| `--form-spacing-gap-title` | `column-gap`、`gap` | `var(--apex-spacing-8)` | `.apex-form.apex-horizontal-form` |
|
|
17
16
|
| `--form-spacing-gap-title` | `column-gap`、`gap` | `var(--apex-spacing-4)` | `.apex-form.apex-vertical-form` |
|
|
18
|
-
| `--form-spacing-gap-y` | `margin-top` | `var(--apex-spacing-4)` | `.apex-form.apex-horizontal-form` |
|
|
19
17
|
| `--form-text-caption-default` | `color` | `var(--apex-text-neutral-secondary)` | `.apex-form.apex-default-form` |
|
|
20
18
|
| `--form-text-caption-disabled` | `color` | `var(--apex-text-neutral-disabled)` | `.apex-form.apex-default-form` |
|
|
21
19
|
| `--form-text-caption-error` | `color` | `var(--apex-text-error-primary)` | `.apex-form.apex-default-form` |
|
package/dist/files/grid/llm.txt
CHANGED
package/dist/files/image/llm.txt
CHANGED
package/dist/files/input/llm.txt
CHANGED
|
@@ -95,9 +95,22 @@
|
|
|
95
95
|
gap: var(--input-spacing-gap-x);
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
.apex-input-number--mode-input
|
|
98
|
+
.apex-input-number--mode-input .apex-input-number__prefix {
|
|
99
|
+
padding-inline-start: var(--input-spacing-padding-x);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.apex-input-number--mode-input .apex-input-number__suffix {
|
|
103
|
+
padding-inline-end: var(--input-spacing-padding-x);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.apex-input-number--mode-input:has(.apex-input-number__prefix)
|
|
99
107
|
.apex-input-number__field {
|
|
100
|
-
padding-inline: 0;
|
|
108
|
+
padding-inline-start: 0;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.apex-input-number--mode-input:has(.apex-input-number__suffix)
|
|
112
|
+
.apex-input-number__field {
|
|
113
|
+
padding-inline-end: 0;
|
|
101
114
|
}
|
|
102
115
|
|
|
103
116
|
/* input.css 的 __inner:focus-within 会染整壳;input 模式改由 field 承担 focus 皮肤 */
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> InputNumber:需要录入有上下界的数值,并支持步进增减时。
|
|
4
4
|
|
|
5
|
-
版本:`1.3.
|
|
5
|
+
版本:`1.3.3`。组件源码在本目录,属于当前项目。
|
|
6
6
|
|
|
7
7
|
公开导出:`InputNumber`。
|
|
8
8
|
|
|
@@ -381,7 +381,7 @@ export default () => {
|
|
|
381
381
|
|
|
382
382
|
### 前缀与后缀
|
|
383
383
|
|
|
384
|
-
通过 `prefix` 和 `suffix` 在数值两侧添加单位或符号等辅助信息。
|
|
384
|
+
通过 `prefix` 和 `suffix` 在数值两侧添加单位或符号等辅助信息。 两个属性可以单独使用,例如只设置 `suffix="%"` 显示百分号。
|
|
385
385
|
|
|
386
386
|
```tsx
|
|
387
387
|
import { InputNumber } from '@/components/apex/input-number'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# InputNumber Token 明细
|
|
2
2
|
|
|
3
|
-
包:`@apexhub/apex-ui-react`;版本:`1.3.
|
|
3
|
+
包:`@apexhub/apex-ui-react`;版本:`1.3.3`(当前源码快照)。
|
|
4
4
|
|
|
5
5
|
按需读取:[组件用法](./llm.txt) · [主题与覆盖规则](../../llms-theme.txt)。
|
|
6
6
|
|
|
@@ -113,10 +113,10 @@
|
|
|
113
113
|
| `--input-spacing-height` | `height`、`min-height`、`min-width`、`padding-top`、`width` | `var(--apex-size-32)` | `.apex-input.apex-md-input` |
|
|
114
114
|
| `--input-spacing-height` | `height`、`min-height`、`min-width`、`padding-top`、`width` | `var(--apex-size-24)` | `.apex-input.apex-sm-input` |
|
|
115
115
|
| `--input-spacing-height-max` | `max-height` | `var(--apex-size-130)` | `.apex-input.apex-textarea-input` |
|
|
116
|
-
| `--input-spacing-padding-x` | `padding-inline` | `var(--apex-spacing-12)` | `.apex-input.apex-lg-input` |
|
|
117
|
-
| `--input-spacing-padding-x` | `padding-inline` | `var(--apex-spacing-12)` | `.apex-input.apex-md-input` |
|
|
118
|
-
| `--input-spacing-padding-x` | `padding-inline` | `var(--apex-spacing-8)` | `.apex-input.apex-sm-input` |
|
|
119
|
-
| `--input-spacing-padding-x` | `padding-inline` | `var(--apex-spacing-12)` | `.apex-input.apex-textarea-input` |
|
|
116
|
+
| `--input-spacing-padding-x` | `padding-inline`、`padding-inline-end`、`padding-inline-start` | `var(--apex-spacing-12)` | `.apex-input.apex-lg-input` |
|
|
117
|
+
| `--input-spacing-padding-x` | `padding-inline`、`padding-inline-end`、`padding-inline-start` | `var(--apex-spacing-12)` | `.apex-input.apex-md-input` |
|
|
118
|
+
| `--input-spacing-padding-x` | `padding-inline`、`padding-inline-end`、`padding-inline-start` | `var(--apex-spacing-8)` | `.apex-input.apex-sm-input` |
|
|
119
|
+
| `--input-spacing-padding-x` | `padding-inline`、`padding-inline-end`、`padding-inline-start` | `var(--apex-spacing-12)` | `.apex-input.apex-textarea-input` |
|
|
120
120
|
| `--input-spacing-padding-y` | `padding-block` | `var(--apex-spacing-12)` | `.apex-input.apex-lg-input` |
|
|
121
121
|
| `--input-spacing-padding-y` | `padding-block` | `var(--apex-spacing-6)` | `.apex-input.apex-md-input` |
|
|
122
122
|
| `--input-spacing-padding-y` | `padding-block` | `var(--apex-spacing-4)` | `.apex-input.apex-sm-input` |
|
package/dist/files/menu/Menu.tsx
CHANGED
|
@@ -6,7 +6,7 @@ import { Dropdown } from '../dropdown'
|
|
|
6
6
|
import { Tooltip } from '../tooltip'
|
|
7
7
|
import { Typography } from '../typography'
|
|
8
8
|
import { cn } from '../utils/cn'
|
|
9
|
-
import {
|
|
9
|
+
import { CaretDownIcon } from './icons'
|
|
10
10
|
import type {
|
|
11
11
|
MenuChildRenderInfo,
|
|
12
12
|
MenuClickInfo,
|
|
@@ -32,10 +32,12 @@ const prefix = 'apex-menu'
|
|
|
32
32
|
function menuButtonScopeClasses(options: { iconOnly?: boolean; secondary?: boolean }) {
|
|
33
33
|
return cn(
|
|
34
34
|
'apex-menu-button',
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
// Rail buttons inherit primary colors from their list item so icon sizing wins locally.
|
|
36
|
+
options.iconOnly
|
|
37
|
+
? 'apex-icon-menu-button'
|
|
38
|
+
: options.secondary
|
|
39
|
+
? 'apex-secondary-menu-button'
|
|
40
|
+
: 'apex-primary-menu-button',
|
|
39
41
|
)
|
|
40
42
|
}
|
|
41
43
|
|
|
@@ -196,7 +198,7 @@ function renderDefaultMenuRow({
|
|
|
196
198
|
</Typography.Text>
|
|
197
199
|
{hasChildren ? (
|
|
198
200
|
<span className={`${prefix}__caret`} aria-hidden>
|
|
199
|
-
<
|
|
201
|
+
<CaretDownIcon />
|
|
200
202
|
</span>
|
|
201
203
|
) : null}
|
|
202
204
|
</button>
|
|
@@ -269,6 +271,7 @@ function MenuRail({
|
|
|
269
271
|
selectable,
|
|
270
272
|
selectedKeys,
|
|
271
273
|
selectedKeyPath,
|
|
274
|
+
openKeys,
|
|
272
275
|
onOpenKeysChange,
|
|
273
276
|
onItemClick,
|
|
274
277
|
onItemSelect,
|
|
@@ -316,6 +319,12 @@ function MenuRail({
|
|
|
316
319
|
return
|
|
317
320
|
}
|
|
318
321
|
|
|
322
|
+
if (hasChildren) {
|
|
323
|
+
if (!openKeys.includes(item.key)) onOpenKeysChange([...openKeys, item.key])
|
|
324
|
+
onExpand()
|
|
325
|
+
return
|
|
326
|
+
}
|
|
327
|
+
|
|
319
328
|
const info: MenuClickInfo = { key: item.key, keyPath, domEvent: event }
|
|
320
329
|
item.onClick?.(info)
|
|
321
330
|
onItemClick(info, item)
|
|
@@ -371,7 +380,11 @@ function MenuRail({
|
|
|
371
380
|
)
|
|
372
381
|
|
|
373
382
|
return (
|
|
374
|
-
<li
|
|
383
|
+
<li
|
|
384
|
+
key={item.key}
|
|
385
|
+
className={`${prefix}__rail-item apex-menu-button apex-primary-menu-button`}
|
|
386
|
+
data-slot="menu-item"
|
|
387
|
+
>
|
|
375
388
|
{railTrigger}
|
|
376
389
|
</li>
|
|
377
390
|
)
|
|
@@ -408,9 +421,9 @@ function MenuList({
|
|
|
408
421
|
const isOpen = openKeys.includes(item.key)
|
|
409
422
|
const isPrimarySelected = isPrimarySelectedInPath(item.key, selectedKeyPath)
|
|
410
423
|
const isSecondarySelected = isSecondarySelectedInPath(item.key, selectedKeyPath)
|
|
411
|
-
const isActive = selectedKeys.includes(item.key)
|
|
424
|
+
const isActive = !item.children?.length && selectedKeys.includes(item.key)
|
|
412
425
|
const hasChildren = Boolean(item.children?.length)
|
|
413
|
-
const isDisabled = Boolean(item.disabled)
|
|
426
|
+
const isDisabled = Boolean(item.disabled || item.loading)
|
|
414
427
|
|
|
415
428
|
if (item.type === 'divider') {
|
|
416
429
|
return (
|
|
@@ -475,12 +488,15 @@ function MenuList({
|
|
|
475
488
|
return
|
|
476
489
|
}
|
|
477
490
|
|
|
491
|
+
if (hasChildren) {
|
|
492
|
+
onOpenKeysChange(toggleKey(openKeys, item.key))
|
|
493
|
+
return
|
|
494
|
+
}
|
|
495
|
+
|
|
478
496
|
const info: MenuClickInfo = { key: item.key, keyPath, domEvent: event }
|
|
479
497
|
item.onClick?.(info)
|
|
480
498
|
onItemClick(info, item)
|
|
481
499
|
|
|
482
|
-
if (hasChildren) onOpenKeysChange(toggleKey(openKeys, item.key))
|
|
483
|
-
|
|
484
500
|
if (selectable) onItemSelect({ ...info, selectedKeys: [item.key] }, item)
|
|
485
501
|
}
|
|
486
502
|
|
|
@@ -15,19 +15,19 @@ export function AppGridIcon({ className }: MenuIconProps) {
|
|
|
15
15
|
|
|
16
16
|
export { DoubleCaretLeftIcon }
|
|
17
17
|
|
|
18
|
-
/**
|
|
19
|
-
export function
|
|
18
|
+
/** 24×24 rounded chevron; the wrapper rotates when the directory opens. */
|
|
19
|
+
export function CaretDownIcon({ className }: MenuIconProps) {
|
|
20
20
|
return (
|
|
21
21
|
<svg
|
|
22
22
|
className={className}
|
|
23
|
-
viewBox="0 0
|
|
23
|
+
viewBox="0 0 24 24"
|
|
24
24
|
fill="none"
|
|
25
25
|
xmlns="http://www.w3.org/2000/svg"
|
|
26
26
|
aria-hidden
|
|
27
27
|
preserveAspectRatio="xMidYMid meet"
|
|
28
28
|
>
|
|
29
29
|
<path
|
|
30
|
-
d="
|
|
30
|
+
d="M6 9.5L12 15.5L18 9.5"
|
|
31
31
|
stroke="currentColor"
|
|
32
32
|
strokeWidth="1.5"
|
|
33
33
|
strokeLinecap="round"
|