klun-ui 0.5.0 → 0.6.0
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/CHANGELOG.md +44 -0
- package/README.md +6 -0
- package/dist/{chunk-ODVX2AVA.cjs → chunk-GDPWRDDU.cjs} +1207 -224
- package/dist/chunk-GDPWRDDU.cjs.map +1 -0
- package/dist/{chunk-WONPY7ZX.js → chunk-K5GUNGCR.js} +1211 -228
- package/dist/chunk-K5GUNGCR.js.map +1 -0
- package/dist/index.cjs +235 -235
- package/dist/index.d.cts +123 -19
- package/dist/index.d.ts +123 -19
- package/dist/index.js +1 -1
- package/dist/styles.css +520 -207
- package/dist/templates/index.cjs +943 -943
- package/dist/templates/index.js +1 -1
- package/package.json +10 -3
- package/dist/chunk-ODVX2AVA.cjs.map +0 -1
- package/dist/chunk-WONPY7ZX.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -271,6 +271,7 @@ interface Locale {
|
|
|
271
271
|
imageUpload: {
|
|
272
272
|
label: string;
|
|
273
273
|
remove: string;
|
|
274
|
+
hint: string;
|
|
274
275
|
};
|
|
275
276
|
passwordStrength: {
|
|
276
277
|
weak: string;
|
|
@@ -366,6 +367,55 @@ interface Locale {
|
|
|
366
367
|
min: string;
|
|
367
368
|
max: string;
|
|
368
369
|
};
|
|
370
|
+
/** 多步流程的底栏按钮。此前 Wizard 把这三个词**硬编码成英文**,locale 里也没有对应键。 */
|
|
371
|
+
wizard: {
|
|
372
|
+
back: string;
|
|
373
|
+
next: string;
|
|
374
|
+
finish: string;
|
|
375
|
+
};
|
|
376
|
+
/**
|
|
377
|
+
* 组件内建的**无障碍名称**。
|
|
378
|
+
* 这些此前是硬编码英文 `aria-label`——消费方**无法覆盖**,读屏会直接念英文,
|
|
379
|
+
* 与「可被 props 覆盖的默认值」是两回事。
|
|
380
|
+
*/
|
|
381
|
+
a11y: {
|
|
382
|
+
zoomIn: string;
|
|
383
|
+
zoomOut: string;
|
|
384
|
+
rotate: string;
|
|
385
|
+
collapseStart: string;
|
|
386
|
+
collapseEnd: string;
|
|
387
|
+
bulkActions: string;
|
|
388
|
+
clearSelection: string;
|
|
389
|
+
back: string;
|
|
390
|
+
};
|
|
391
|
+
/** 富文本编辑器的空态占位与编辑区无障碍名(此前是英文默认值)。 */
|
|
392
|
+
richEditor: {
|
|
393
|
+
placeholder: string;
|
|
394
|
+
editorLabel: string;
|
|
395
|
+
};
|
|
396
|
+
/** 复制按钮的默认提示。 */
|
|
397
|
+
copy: {
|
|
398
|
+
label: string;
|
|
399
|
+
};
|
|
400
|
+
/** 表情选择器:搜索占位、空态、以及触发按钮的名称。 */
|
|
401
|
+
emojiPicker: {
|
|
402
|
+
searchPlaceholder: string;
|
|
403
|
+
emptyText: string;
|
|
404
|
+
addReaction: string;
|
|
405
|
+
};
|
|
406
|
+
/** 侧边栏:搜索框占位与导航地标名(此前 `aria-label="Primary"` 是硬编码)。 */
|
|
407
|
+
sidebar: {
|
|
408
|
+
searchPlaceholder: string;
|
|
409
|
+
primary: string;
|
|
410
|
+
};
|
|
411
|
+
/**
|
|
412
|
+
* 图片查看器。仅 `reset`/`download` 需要新键;
|
|
413
|
+
* `previous`/`next` 复用 `pagination`,`close` 复用 `modal`——语义与文案一致,避免重复。
|
|
414
|
+
*/
|
|
415
|
+
imageViewer: {
|
|
416
|
+
reset: string;
|
|
417
|
+
download: string;
|
|
418
|
+
};
|
|
369
419
|
/** `pageRange` has `{from}`/`{to}`/`{total}`; `perPage` has `{size}`. */
|
|
370
420
|
table: {
|
|
371
421
|
noData: string;
|
|
@@ -1577,7 +1627,7 @@ interface TableProps<Row = any> extends Omit<HTMLAttributes<HTMLDivElement>, "st
|
|
|
1577
1627
|
* pagination, expandable & tree rows, density/zebra/sticky, fixed columns,
|
|
1578
1628
|
* inline editing, drag resize/reorder, CSV export, copy & context menu.
|
|
1579
1629
|
*/
|
|
1580
|
-
declare function Table<Row = any>({ columns, rows, getRowId, selectable, selected, onSelectRow, onSelectAll, sortable, sort, onSortChange, defaultSort, filters, onFiltersChange, pagination, expandable, density, zebra, stickyHeader, hover, bordered, selectionType, rowStatus, summary, contextMenu, copyable, onCopy, resizable, tree, childrenKey, indentSize, defaultExpandedRowKeys, columnSettings, rowDraggable, onReorder, onCellEdit, title, toolbar, exportable, selectionActions, onRowClick, rowHref, loading, loadingRows, empty, caption, footer, className, style, ...props }: TableProps<Row>): react.JSX.Element;
|
|
1630
|
+
declare function Table<Row = any>({ columns, rows, getRowId, selectable, selected, onSelectRow, onSelectAll, sortable, sort, onSortChange, defaultSort, filters, onFiltersChange, pagination, expandable, density: densityProp, zebra, stickyHeader, hover, bordered, selectionType, rowStatus, summary, contextMenu, copyable, onCopy, resizable, tree, childrenKey, indentSize, defaultExpandedRowKeys, columnSettings, rowDraggable, onReorder, onCellEdit, title, toolbar, exportable, selectionActions, onRowClick, rowHref, loading, loadingRows, empty, caption, footer, className, style, ...props }: TableProps<Row>): react.JSX.Element;
|
|
1581
1631
|
|
|
1582
1632
|
interface TagProps extends HTMLAttributes<HTMLSpanElement> {
|
|
1583
1633
|
leadingIcon?: ReactNode;
|
|
@@ -2274,6 +2324,16 @@ interface AutoCompleteProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChan
|
|
|
2274
2324
|
leadingIcon?: ReactNode;
|
|
2275
2325
|
emptyText?: ReactNode;
|
|
2276
2326
|
maxVisible?: number;
|
|
2327
|
+
/** 校验错误态(FormItem 会自动注入)。消费它是必要的:否则该布尔值会被透传到 DOM。 */
|
|
2328
|
+
error?: boolean;
|
|
2329
|
+
/**
|
|
2330
|
+
* 透传到**真实 `<input>`** 的属性通道。
|
|
2331
|
+
*
|
|
2332
|
+
* 本组件的根节点是 wrapper `div`,因此用 `InputHTMLAttributes` 之外的属性
|
|
2333
|
+
* (如 `name`、`required`)无法直接写在组件上——它们既不在类型里,写上去也会落到
|
|
2334
|
+
* wrapper 而不是输入框。需要这些原生输入属性时用这个通道。
|
|
2335
|
+
*/
|
|
2336
|
+
inputProps?: InputHTMLAttributes<HTMLInputElement>;
|
|
2277
2337
|
}
|
|
2278
2338
|
/**
|
|
2279
2339
|
* AutoComplete — text input with a filtered suggestion dropdown + keyboard nav.
|
|
@@ -2554,8 +2614,13 @@ interface DatePickerProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange
|
|
|
2554
2614
|
placeholder?: string;
|
|
2555
2615
|
/** Intl options used to format the trigger label. */
|
|
2556
2616
|
format?: Intl.DateTimeFormatOptions;
|
|
2557
|
-
/**
|
|
2558
|
-
|
|
2617
|
+
/**
|
|
2618
|
+
* 面板与触发器的对齐边。
|
|
2619
|
+
*
|
|
2620
|
+
* `"start"`(默认)/`"end"` 是**逻辑**值:LTR 下 start=左、**RTL 下 start=右**。
|
|
2621
|
+
* `"left"` / `"right"` 保留为**物理**值,不随方向变化。
|
|
2622
|
+
*/
|
|
2623
|
+
align?: "start" | "end" | "left" | "right";
|
|
2559
2624
|
/** Disable the trigger. */
|
|
2560
2625
|
disabled?: boolean;
|
|
2561
2626
|
style?: CSSProperties;
|
|
@@ -2580,8 +2645,13 @@ interface DateRangePickerProps extends Omit<HTMLAttributes<HTMLDivElement>, "onC
|
|
|
2580
2645
|
placeholder?: string;
|
|
2581
2646
|
/** Intl options used to format the trigger labels. */
|
|
2582
2647
|
format?: Intl.DateTimeFormatOptions;
|
|
2583
|
-
/**
|
|
2584
|
-
|
|
2648
|
+
/**
|
|
2649
|
+
* 面板与触发器的对齐边。
|
|
2650
|
+
*
|
|
2651
|
+
* `"start"`(默认)/`"end"` 是**逻辑**值:LTR 下 start=左、**RTL 下 start=右**。
|
|
2652
|
+
* `"left"` / `"right"` 保留为**物理**值,不随方向变化。
|
|
2653
|
+
*/
|
|
2654
|
+
align?: "start" | "end" | "left" | "right";
|
|
2585
2655
|
/** Disable the trigger. */
|
|
2586
2656
|
disabled?: boolean;
|
|
2587
2657
|
style?: CSSProperties;
|
|
@@ -2601,8 +2671,13 @@ interface DateTimePickerProps extends Omit<HTMLAttributes<HTMLDivElement>, "onCh
|
|
|
2601
2671
|
placeholder?: string;
|
|
2602
2672
|
/** Intl options used to format the trigger label. */
|
|
2603
2673
|
format?: Intl.DateTimeFormatOptions;
|
|
2604
|
-
/**
|
|
2605
|
-
|
|
2674
|
+
/**
|
|
2675
|
+
* 面板与触发器的对齐边。
|
|
2676
|
+
*
|
|
2677
|
+
* `"start"`(默认)/`"end"` 是**逻辑**值:LTR 下 start=左、**RTL 下 start=右**。
|
|
2678
|
+
* `"left"` / `"right"` 保留为**物理**值,不随方向变化。
|
|
2679
|
+
*/
|
|
2680
|
+
align?: "start" | "end" | "left" | "right";
|
|
2606
2681
|
/** Disable the trigger. */
|
|
2607
2682
|
disabled?: boolean;
|
|
2608
2683
|
style?: CSSProperties;
|
|
@@ -2759,8 +2834,6 @@ interface FormInstance {
|
|
|
2759
2834
|
/** Scroll to + focus a field. */
|
|
2760
2835
|
scrollToField: (name: NamePath) => void;
|
|
2761
2836
|
reset: () => void;
|
|
2762
|
-
/** @deprecated use FormItem rules; kept for back-compat. */
|
|
2763
|
-
registerRules: (name: NamePath, rules: FormRule[]) => void;
|
|
2764
2837
|
}
|
|
2765
2838
|
interface UseFormOptions {
|
|
2766
2839
|
initialValues?: Record<string, any>;
|
|
@@ -3198,8 +3271,13 @@ interface SelectMenuProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange
|
|
|
3198
3271
|
leadingIcon?: ReactNode;
|
|
3199
3272
|
error?: boolean;
|
|
3200
3273
|
disabled?: boolean;
|
|
3201
|
-
/**
|
|
3202
|
-
|
|
3274
|
+
/**
|
|
3275
|
+
* 面板与触发器的对齐边。
|
|
3276
|
+
*
|
|
3277
|
+
* `"start"`(默认)/`"end"` 是**逻辑**值:LTR 下 start=左、**RTL 下 start=右**。
|
|
3278
|
+
* `"left"` / `"right"` 保留为**物理**值,不随方向变化。
|
|
3279
|
+
*/
|
|
3280
|
+
align?: "start" | "end" | "left" | "right";
|
|
3203
3281
|
/** Style applied to the outer wrapper. */
|
|
3204
3282
|
style?: CSSProperties;
|
|
3205
3283
|
}
|
|
@@ -3974,8 +4052,6 @@ interface DrawerProps extends Omit<HTMLAttributes<HTMLDivElement>, "title" | "st
|
|
|
3974
4052
|
title?: ReactNode;
|
|
3975
4053
|
/** Edge the drawer slides from. Default `"right"`. */
|
|
3976
4054
|
placement?: DrawerPlacement;
|
|
3977
|
-
/** Alias of `placement`, kept for back-compat. */
|
|
3978
|
-
side?: "left" | "right";
|
|
3979
4055
|
/** Width for left/right placements. Default `"50%"`. */
|
|
3980
4056
|
width?: number | string;
|
|
3981
4057
|
/** Height for top/bottom placements. Default `"50%"`. */
|
|
@@ -4019,7 +4095,8 @@ interface DropdownItem {
|
|
|
4019
4095
|
interface DropdownProps extends HTMLAttributes<HTMLSpanElement> {
|
|
4020
4096
|
trigger: ReactNode;
|
|
4021
4097
|
items: DropdownItem[];
|
|
4022
|
-
|
|
4098
|
+
/** 同 Popover:`"start"`/`"end"` 为逻辑值(随 RTL 翻转),`"left"`/`"right"` 为物理值。默认 `"start"`。 */
|
|
4099
|
+
align?: "start" | "end" | "left" | "right";
|
|
4023
4100
|
width?: number;
|
|
4024
4101
|
}
|
|
4025
4102
|
/** Klun UI Dropdown — click-to-open menu anchored to a trigger. */
|
|
@@ -4175,19 +4252,46 @@ declare const Popconfirm: react.ForwardRefExoticComponent<PopconfirmProps & reac
|
|
|
4175
4252
|
|
|
4176
4253
|
interface PopoverProps extends Omit<HTMLAttributes<HTMLSpanElement>, "children"> {
|
|
4177
4254
|
trigger: ReactNode;
|
|
4178
|
-
|
|
4255
|
+
/**
|
|
4256
|
+
* 面板与触发器的对齐边。
|
|
4257
|
+
*
|
|
4258
|
+
* `"start"`(默认)与 `"end"` 是**逻辑**值:随书写方向解析——
|
|
4259
|
+
* LTR 下 start=左、end=右;**RTL 下 start=右、end=左**。
|
|
4260
|
+
* `"left"` / `"right"` 保留为**物理**值(不随方向变化),供确需固定一侧的场景使用。
|
|
4261
|
+
*
|
|
4262
|
+
* 修复前只有 `"left" | "right"` 且默认 `"left"`,于是 RTL 下面板仍贴物理左边缘,
|
|
4263
|
+
* 相当于「末尾对齐」——与 LTR 的语义相反,是覆盖层最典型的 RTL 破法。
|
|
4264
|
+
*/
|
|
4265
|
+
align?: "start" | "end" | "left" | "right";
|
|
4179
4266
|
width?: number;
|
|
4180
4267
|
/** Panel content, or a render-fn receiving a close() callback. */
|
|
4181
4268
|
children: ReactNode | ((close: () => void) => ReactNode);
|
|
4269
|
+
/** Controlled open state. Leave undefined for uncontrolled. */
|
|
4270
|
+
open?: boolean;
|
|
4271
|
+
/** Initial state when uncontrolled. */
|
|
4272
|
+
defaultOpen?: boolean;
|
|
4273
|
+
/** Called whenever the open state should change. */
|
|
4274
|
+
onOpenChange?: (open: boolean) => void;
|
|
4275
|
+
/** Explicit id for the panel; otherwise generated. The trigger references it via aria-controls. */
|
|
4276
|
+
panelId?: string;
|
|
4182
4277
|
}
|
|
4183
4278
|
/**
|
|
4184
|
-
* Klun UI Popover — click-triggered floating panel anchored to a trigger.
|
|
4279
|
+
* Klun UI Popover — click- **or keyboard**-triggered floating panel anchored to a trigger.
|
|
4280
|
+
*
|
|
4281
|
+
* 键盘支持(KDS 04-accessibility.md):触发器原本只是一个 `<span onClick>`,
|
|
4282
|
+
* 既不可聚焦也无法用键盘打开——DatePicker / DateTimePicker 因此完全无法用键盘操作。
|
|
4283
|
+
* 现在:
|
|
4284
|
+
* - 触发器内部**没有**可聚焦元素时,外层本身变成 `role="button" tabIndex={0}`;
|
|
4285
|
+
* 有可聚焦元素时(readonly Input、Button…)不额外增加 Tab 停靠点,只给它绑
|
|
4286
|
+
* `aria-haspopup="dialog"` / `aria-expanded` / `aria-controls`。
|
|
4287
|
+
* - ArrowDown 打开;Enter/Space 在「当前焦点不是原生按钮」时打开(避免与原生
|
|
4288
|
+
* click 重复触发);Escape 关闭并把焦点还给触发器。
|
|
4289
|
+
* - 键盘打开后把焦点送进面板,否则焦点留在触发器、Tab 顺序不可预期。
|
|
4185
4290
|
*
|
|
4186
4291
|
* The panel renders in a portal on `document.body` and is positioned with
|
|
4187
4292
|
* `fixed` coordinates anchored to the trigger, so no ancestor `overflow`/
|
|
4188
|
-
* `transform` can clip it
|
|
4189
|
-
*
|
|
4190
|
-
* there's no room below, is clamped to the viewport, and sits above overlays.
|
|
4293
|
+
* `transform` can clip it. It follows the trigger on scroll/resize, flips above
|
|
4294
|
+
* when there's no room below, is clamped to the viewport, and sits above overlays.
|
|
4191
4295
|
*/
|
|
4192
4296
|
declare const Popover: react.ForwardRefExoticComponent<PopoverProps & react.RefAttributes<HTMLSpanElement>>;
|
|
4193
4297
|
|
package/dist/index.d.ts
CHANGED
|
@@ -271,6 +271,7 @@ interface Locale {
|
|
|
271
271
|
imageUpload: {
|
|
272
272
|
label: string;
|
|
273
273
|
remove: string;
|
|
274
|
+
hint: string;
|
|
274
275
|
};
|
|
275
276
|
passwordStrength: {
|
|
276
277
|
weak: string;
|
|
@@ -366,6 +367,55 @@ interface Locale {
|
|
|
366
367
|
min: string;
|
|
367
368
|
max: string;
|
|
368
369
|
};
|
|
370
|
+
/** 多步流程的底栏按钮。此前 Wizard 把这三个词**硬编码成英文**,locale 里也没有对应键。 */
|
|
371
|
+
wizard: {
|
|
372
|
+
back: string;
|
|
373
|
+
next: string;
|
|
374
|
+
finish: string;
|
|
375
|
+
};
|
|
376
|
+
/**
|
|
377
|
+
* 组件内建的**无障碍名称**。
|
|
378
|
+
* 这些此前是硬编码英文 `aria-label`——消费方**无法覆盖**,读屏会直接念英文,
|
|
379
|
+
* 与「可被 props 覆盖的默认值」是两回事。
|
|
380
|
+
*/
|
|
381
|
+
a11y: {
|
|
382
|
+
zoomIn: string;
|
|
383
|
+
zoomOut: string;
|
|
384
|
+
rotate: string;
|
|
385
|
+
collapseStart: string;
|
|
386
|
+
collapseEnd: string;
|
|
387
|
+
bulkActions: string;
|
|
388
|
+
clearSelection: string;
|
|
389
|
+
back: string;
|
|
390
|
+
};
|
|
391
|
+
/** 富文本编辑器的空态占位与编辑区无障碍名(此前是英文默认值)。 */
|
|
392
|
+
richEditor: {
|
|
393
|
+
placeholder: string;
|
|
394
|
+
editorLabel: string;
|
|
395
|
+
};
|
|
396
|
+
/** 复制按钮的默认提示。 */
|
|
397
|
+
copy: {
|
|
398
|
+
label: string;
|
|
399
|
+
};
|
|
400
|
+
/** 表情选择器:搜索占位、空态、以及触发按钮的名称。 */
|
|
401
|
+
emojiPicker: {
|
|
402
|
+
searchPlaceholder: string;
|
|
403
|
+
emptyText: string;
|
|
404
|
+
addReaction: string;
|
|
405
|
+
};
|
|
406
|
+
/** 侧边栏:搜索框占位与导航地标名(此前 `aria-label="Primary"` 是硬编码)。 */
|
|
407
|
+
sidebar: {
|
|
408
|
+
searchPlaceholder: string;
|
|
409
|
+
primary: string;
|
|
410
|
+
};
|
|
411
|
+
/**
|
|
412
|
+
* 图片查看器。仅 `reset`/`download` 需要新键;
|
|
413
|
+
* `previous`/`next` 复用 `pagination`,`close` 复用 `modal`——语义与文案一致,避免重复。
|
|
414
|
+
*/
|
|
415
|
+
imageViewer: {
|
|
416
|
+
reset: string;
|
|
417
|
+
download: string;
|
|
418
|
+
};
|
|
369
419
|
/** `pageRange` has `{from}`/`{to}`/`{total}`; `perPage` has `{size}`. */
|
|
370
420
|
table: {
|
|
371
421
|
noData: string;
|
|
@@ -1577,7 +1627,7 @@ interface TableProps<Row = any> extends Omit<HTMLAttributes<HTMLDivElement>, "st
|
|
|
1577
1627
|
* pagination, expandable & tree rows, density/zebra/sticky, fixed columns,
|
|
1578
1628
|
* inline editing, drag resize/reorder, CSV export, copy & context menu.
|
|
1579
1629
|
*/
|
|
1580
|
-
declare function Table<Row = any>({ columns, rows, getRowId, selectable, selected, onSelectRow, onSelectAll, sortable, sort, onSortChange, defaultSort, filters, onFiltersChange, pagination, expandable, density, zebra, stickyHeader, hover, bordered, selectionType, rowStatus, summary, contextMenu, copyable, onCopy, resizable, tree, childrenKey, indentSize, defaultExpandedRowKeys, columnSettings, rowDraggable, onReorder, onCellEdit, title, toolbar, exportable, selectionActions, onRowClick, rowHref, loading, loadingRows, empty, caption, footer, className, style, ...props }: TableProps<Row>): react.JSX.Element;
|
|
1630
|
+
declare function Table<Row = any>({ columns, rows, getRowId, selectable, selected, onSelectRow, onSelectAll, sortable, sort, onSortChange, defaultSort, filters, onFiltersChange, pagination, expandable, density: densityProp, zebra, stickyHeader, hover, bordered, selectionType, rowStatus, summary, contextMenu, copyable, onCopy, resizable, tree, childrenKey, indentSize, defaultExpandedRowKeys, columnSettings, rowDraggable, onReorder, onCellEdit, title, toolbar, exportable, selectionActions, onRowClick, rowHref, loading, loadingRows, empty, caption, footer, className, style, ...props }: TableProps<Row>): react.JSX.Element;
|
|
1581
1631
|
|
|
1582
1632
|
interface TagProps extends HTMLAttributes<HTMLSpanElement> {
|
|
1583
1633
|
leadingIcon?: ReactNode;
|
|
@@ -2274,6 +2324,16 @@ interface AutoCompleteProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChan
|
|
|
2274
2324
|
leadingIcon?: ReactNode;
|
|
2275
2325
|
emptyText?: ReactNode;
|
|
2276
2326
|
maxVisible?: number;
|
|
2327
|
+
/** 校验错误态(FormItem 会自动注入)。消费它是必要的:否则该布尔值会被透传到 DOM。 */
|
|
2328
|
+
error?: boolean;
|
|
2329
|
+
/**
|
|
2330
|
+
* 透传到**真实 `<input>`** 的属性通道。
|
|
2331
|
+
*
|
|
2332
|
+
* 本组件的根节点是 wrapper `div`,因此用 `InputHTMLAttributes` 之外的属性
|
|
2333
|
+
* (如 `name`、`required`)无法直接写在组件上——它们既不在类型里,写上去也会落到
|
|
2334
|
+
* wrapper 而不是输入框。需要这些原生输入属性时用这个通道。
|
|
2335
|
+
*/
|
|
2336
|
+
inputProps?: InputHTMLAttributes<HTMLInputElement>;
|
|
2277
2337
|
}
|
|
2278
2338
|
/**
|
|
2279
2339
|
* AutoComplete — text input with a filtered suggestion dropdown + keyboard nav.
|
|
@@ -2554,8 +2614,13 @@ interface DatePickerProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange
|
|
|
2554
2614
|
placeholder?: string;
|
|
2555
2615
|
/** Intl options used to format the trigger label. */
|
|
2556
2616
|
format?: Intl.DateTimeFormatOptions;
|
|
2557
|
-
/**
|
|
2558
|
-
|
|
2617
|
+
/**
|
|
2618
|
+
* 面板与触发器的对齐边。
|
|
2619
|
+
*
|
|
2620
|
+
* `"start"`(默认)/`"end"` 是**逻辑**值:LTR 下 start=左、**RTL 下 start=右**。
|
|
2621
|
+
* `"left"` / `"right"` 保留为**物理**值,不随方向变化。
|
|
2622
|
+
*/
|
|
2623
|
+
align?: "start" | "end" | "left" | "right";
|
|
2559
2624
|
/** Disable the trigger. */
|
|
2560
2625
|
disabled?: boolean;
|
|
2561
2626
|
style?: CSSProperties;
|
|
@@ -2580,8 +2645,13 @@ interface DateRangePickerProps extends Omit<HTMLAttributes<HTMLDivElement>, "onC
|
|
|
2580
2645
|
placeholder?: string;
|
|
2581
2646
|
/** Intl options used to format the trigger labels. */
|
|
2582
2647
|
format?: Intl.DateTimeFormatOptions;
|
|
2583
|
-
/**
|
|
2584
|
-
|
|
2648
|
+
/**
|
|
2649
|
+
* 面板与触发器的对齐边。
|
|
2650
|
+
*
|
|
2651
|
+
* `"start"`(默认)/`"end"` 是**逻辑**值:LTR 下 start=左、**RTL 下 start=右**。
|
|
2652
|
+
* `"left"` / `"right"` 保留为**物理**值,不随方向变化。
|
|
2653
|
+
*/
|
|
2654
|
+
align?: "start" | "end" | "left" | "right";
|
|
2585
2655
|
/** Disable the trigger. */
|
|
2586
2656
|
disabled?: boolean;
|
|
2587
2657
|
style?: CSSProperties;
|
|
@@ -2601,8 +2671,13 @@ interface DateTimePickerProps extends Omit<HTMLAttributes<HTMLDivElement>, "onCh
|
|
|
2601
2671
|
placeholder?: string;
|
|
2602
2672
|
/** Intl options used to format the trigger label. */
|
|
2603
2673
|
format?: Intl.DateTimeFormatOptions;
|
|
2604
|
-
/**
|
|
2605
|
-
|
|
2674
|
+
/**
|
|
2675
|
+
* 面板与触发器的对齐边。
|
|
2676
|
+
*
|
|
2677
|
+
* `"start"`(默认)/`"end"` 是**逻辑**值:LTR 下 start=左、**RTL 下 start=右**。
|
|
2678
|
+
* `"left"` / `"right"` 保留为**物理**值,不随方向变化。
|
|
2679
|
+
*/
|
|
2680
|
+
align?: "start" | "end" | "left" | "right";
|
|
2606
2681
|
/** Disable the trigger. */
|
|
2607
2682
|
disabled?: boolean;
|
|
2608
2683
|
style?: CSSProperties;
|
|
@@ -2759,8 +2834,6 @@ interface FormInstance {
|
|
|
2759
2834
|
/** Scroll to + focus a field. */
|
|
2760
2835
|
scrollToField: (name: NamePath) => void;
|
|
2761
2836
|
reset: () => void;
|
|
2762
|
-
/** @deprecated use FormItem rules; kept for back-compat. */
|
|
2763
|
-
registerRules: (name: NamePath, rules: FormRule[]) => void;
|
|
2764
2837
|
}
|
|
2765
2838
|
interface UseFormOptions {
|
|
2766
2839
|
initialValues?: Record<string, any>;
|
|
@@ -3198,8 +3271,13 @@ interface SelectMenuProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange
|
|
|
3198
3271
|
leadingIcon?: ReactNode;
|
|
3199
3272
|
error?: boolean;
|
|
3200
3273
|
disabled?: boolean;
|
|
3201
|
-
/**
|
|
3202
|
-
|
|
3274
|
+
/**
|
|
3275
|
+
* 面板与触发器的对齐边。
|
|
3276
|
+
*
|
|
3277
|
+
* `"start"`(默认)/`"end"` 是**逻辑**值:LTR 下 start=左、**RTL 下 start=右**。
|
|
3278
|
+
* `"left"` / `"right"` 保留为**物理**值,不随方向变化。
|
|
3279
|
+
*/
|
|
3280
|
+
align?: "start" | "end" | "left" | "right";
|
|
3203
3281
|
/** Style applied to the outer wrapper. */
|
|
3204
3282
|
style?: CSSProperties;
|
|
3205
3283
|
}
|
|
@@ -3974,8 +4052,6 @@ interface DrawerProps extends Omit<HTMLAttributes<HTMLDivElement>, "title" | "st
|
|
|
3974
4052
|
title?: ReactNode;
|
|
3975
4053
|
/** Edge the drawer slides from. Default `"right"`. */
|
|
3976
4054
|
placement?: DrawerPlacement;
|
|
3977
|
-
/** Alias of `placement`, kept for back-compat. */
|
|
3978
|
-
side?: "left" | "right";
|
|
3979
4055
|
/** Width for left/right placements. Default `"50%"`. */
|
|
3980
4056
|
width?: number | string;
|
|
3981
4057
|
/** Height for top/bottom placements. Default `"50%"`. */
|
|
@@ -4019,7 +4095,8 @@ interface DropdownItem {
|
|
|
4019
4095
|
interface DropdownProps extends HTMLAttributes<HTMLSpanElement> {
|
|
4020
4096
|
trigger: ReactNode;
|
|
4021
4097
|
items: DropdownItem[];
|
|
4022
|
-
|
|
4098
|
+
/** 同 Popover:`"start"`/`"end"` 为逻辑值(随 RTL 翻转),`"left"`/`"right"` 为物理值。默认 `"start"`。 */
|
|
4099
|
+
align?: "start" | "end" | "left" | "right";
|
|
4023
4100
|
width?: number;
|
|
4024
4101
|
}
|
|
4025
4102
|
/** Klun UI Dropdown — click-to-open menu anchored to a trigger. */
|
|
@@ -4175,19 +4252,46 @@ declare const Popconfirm: react.ForwardRefExoticComponent<PopconfirmProps & reac
|
|
|
4175
4252
|
|
|
4176
4253
|
interface PopoverProps extends Omit<HTMLAttributes<HTMLSpanElement>, "children"> {
|
|
4177
4254
|
trigger: ReactNode;
|
|
4178
|
-
|
|
4255
|
+
/**
|
|
4256
|
+
* 面板与触发器的对齐边。
|
|
4257
|
+
*
|
|
4258
|
+
* `"start"`(默认)与 `"end"` 是**逻辑**值:随书写方向解析——
|
|
4259
|
+
* LTR 下 start=左、end=右;**RTL 下 start=右、end=左**。
|
|
4260
|
+
* `"left"` / `"right"` 保留为**物理**值(不随方向变化),供确需固定一侧的场景使用。
|
|
4261
|
+
*
|
|
4262
|
+
* 修复前只有 `"left" | "right"` 且默认 `"left"`,于是 RTL 下面板仍贴物理左边缘,
|
|
4263
|
+
* 相当于「末尾对齐」——与 LTR 的语义相反,是覆盖层最典型的 RTL 破法。
|
|
4264
|
+
*/
|
|
4265
|
+
align?: "start" | "end" | "left" | "right";
|
|
4179
4266
|
width?: number;
|
|
4180
4267
|
/** Panel content, or a render-fn receiving a close() callback. */
|
|
4181
4268
|
children: ReactNode | ((close: () => void) => ReactNode);
|
|
4269
|
+
/** Controlled open state. Leave undefined for uncontrolled. */
|
|
4270
|
+
open?: boolean;
|
|
4271
|
+
/** Initial state when uncontrolled. */
|
|
4272
|
+
defaultOpen?: boolean;
|
|
4273
|
+
/** Called whenever the open state should change. */
|
|
4274
|
+
onOpenChange?: (open: boolean) => void;
|
|
4275
|
+
/** Explicit id for the panel; otherwise generated. The trigger references it via aria-controls. */
|
|
4276
|
+
panelId?: string;
|
|
4182
4277
|
}
|
|
4183
4278
|
/**
|
|
4184
|
-
* Klun UI Popover — click-triggered floating panel anchored to a trigger.
|
|
4279
|
+
* Klun UI Popover — click- **or keyboard**-triggered floating panel anchored to a trigger.
|
|
4280
|
+
*
|
|
4281
|
+
* 键盘支持(KDS 04-accessibility.md):触发器原本只是一个 `<span onClick>`,
|
|
4282
|
+
* 既不可聚焦也无法用键盘打开——DatePicker / DateTimePicker 因此完全无法用键盘操作。
|
|
4283
|
+
* 现在:
|
|
4284
|
+
* - 触发器内部**没有**可聚焦元素时,外层本身变成 `role="button" tabIndex={0}`;
|
|
4285
|
+
* 有可聚焦元素时(readonly Input、Button…)不额外增加 Tab 停靠点,只给它绑
|
|
4286
|
+
* `aria-haspopup="dialog"` / `aria-expanded` / `aria-controls`。
|
|
4287
|
+
* - ArrowDown 打开;Enter/Space 在「当前焦点不是原生按钮」时打开(避免与原生
|
|
4288
|
+
* click 重复触发);Escape 关闭并把焦点还给触发器。
|
|
4289
|
+
* - 键盘打开后把焦点送进面板,否则焦点留在触发器、Tab 顺序不可预期。
|
|
4185
4290
|
*
|
|
4186
4291
|
* The panel renders in a portal on `document.body` and is positioned with
|
|
4187
4292
|
* `fixed` coordinates anchored to the trigger, so no ancestor `overflow`/
|
|
4188
|
-
* `transform` can clip it
|
|
4189
|
-
*
|
|
4190
|
-
* there's no room below, is clamped to the viewport, and sits above overlays.
|
|
4293
|
+
* `transform` can clip it. It follows the trigger on scroll/resize, flips above
|
|
4294
|
+
* when there's no room below, is clamped to the viewport, and sits above overlays.
|
|
4191
4295
|
*/
|
|
4192
4296
|
declare const Popover: react.ForwardRefExoticComponent<PopoverProps & react.RefAttributes<HTMLSpanElement>>;
|
|
4193
4297
|
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Accordion, ActivityHeatmap, ActorAvatar, Alert, AutoComplete, Avatar, AvatarGroup, Badge, Banner, BorderBeam, Breadcrumb, BulkAction, BulkActionBar, Button, ButtonGroup, CRON_PRESETS, CapabilityBanner, CappedNumberFlow, Card, Carousel, Cascader, CharacterCounter, ChartLegend, ChartTooltip, Checkbox, CheckboxCard, CheckboxGroup, Chip, CircularProgress, CodeViewer, Col, Collapse, ColorDot, ColorPicker, ColorSlider, CommandMenu, CompactNumberFlow, CompactSelect, CompactSelectForInput, ConfigProvider, Confirm, ContentLabel, ContextMenu, CopyButton, CounterInput, CronEditor, CrossRefBadge, CurrencyNumberFlow, DatePicker, DateRangePicker, DateTimePicker, Descriptions, DiffViewer, DigitInput, Divider, DotSphere, Drawer, Dropdown, EmojiPicker, EmptyState, ExpiryCountdown, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldTitle, FileUpload, Flex, Form, FormItem, FormList, Format, GaugeBar, Grid, Hint, HorizontalFilter, HoverCard, HoverCardContent, HoverCardTrigger, ICON_GROUPS, IconPicker, ImageUpload, ImageViewer, InlineInput, InlineSelect, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Kanban, Kbd, KeyIcon, LIST_GRID_BOTTOM_CLEARANCE, Label, Layout, LayoutContent, LayoutFooter, LayoutHeader, LayoutSider, List, ListGrid, ListGridBody, ListGridCell, ListGridHeader, ListGridHeaderCell, ListGridRow, ListItem, LiveDot, LogViewer, Markdown, Masonry, Menu, Message, Modal, Money, NavigationProgress, Notification, NumberFlow, PageHeader, Pagination, PasswordStrength, Popconfirm, Popover, ProgressBar, QUICK_EMOJIS, QuickEmojiPicker, Radio, RadioCard, RangeSlider, Rating, ReactionBar, RelativeTime, Result, RichEditor, RichEditorToolbar, Row, SegmentedControl, SegmentedProgress, Select, SelectMenu, ShimmerText, Sidebar, Skeleton, Slider, Space, Spinner, Splitter, SplitterPanel, StatCard, Statistic, StatusBadge, StatusDot, StepIndicator, Stepper, StepperContent, StepperDescription, StepperIndicator, StepperItem, StepperNav, StepperPanel, StepperSeparator, StepperTitle, StepperTrigger, Switch, Table, Tabs, Tag, Textarea, TimePicker, Timeline, Toast, Toaster, Toggle, Tooltip, Tree, UnicodeSpinner, VirtualTable, Wizard, arSA, buildHeatmapGrid, deDE, describeCron, enUS, esES, fmt, formatAvatarEmoji, frFR, groupReactions, idID, itIT, jaJP, koKR, localTodayIso, locales, nlNL, parseAvatarEmoji, parsePatch, plPL, primaryColorVars, ptBR, renderMarkdown, resolveMove, ruRU, summarizeHeatmap, toast, trTR, useBreakpoint, useConfig, useContextMenu, useForm, useLocale, useMappedSize, useMessage, useNotification, useSize, useStepItem, useStepper, viVN, zhCN, zhTW } from './chunk-
|
|
1
|
+
export { Accordion, ActivityHeatmap, ActorAvatar, Alert, AutoComplete, Avatar, AvatarGroup, Badge, Banner, BorderBeam, Breadcrumb, BulkAction, BulkActionBar, Button, ButtonGroup, CRON_PRESETS, CapabilityBanner, CappedNumberFlow, Card, Carousel, Cascader, CharacterCounter, ChartLegend, ChartTooltip, Checkbox, CheckboxCard, CheckboxGroup, Chip, CircularProgress, CodeViewer, Col, Collapse, ColorDot, ColorPicker, ColorSlider, CommandMenu, CompactNumberFlow, CompactSelect, CompactSelectForInput, ConfigProvider, Confirm, ContentLabel, ContextMenu, CopyButton, CounterInput, CronEditor, CrossRefBadge, CurrencyNumberFlow, DatePicker, DateRangePicker, DateTimePicker, Descriptions, DiffViewer, DigitInput, Divider, DotSphere, Drawer, Dropdown, EmojiPicker, EmptyState, ExpiryCountdown, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldTitle, FileUpload, Flex, Form, FormItem, FormList, Format, GaugeBar, Grid, Hint, HorizontalFilter, HoverCard, HoverCardContent, HoverCardTrigger, ICON_GROUPS, IconPicker, ImageUpload, ImageViewer, InlineInput, InlineSelect, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Kanban, Kbd, KeyIcon, LIST_GRID_BOTTOM_CLEARANCE, Label, Layout, LayoutContent, LayoutFooter, LayoutHeader, LayoutSider, List, ListGrid, ListGridBody, ListGridCell, ListGridHeader, ListGridHeaderCell, ListGridRow, ListItem, LiveDot, LogViewer, Markdown, Masonry, Menu, Message, Modal, Money, NavigationProgress, Notification, NumberFlow, PageHeader, Pagination, PasswordStrength, Popconfirm, Popover, ProgressBar, QUICK_EMOJIS, QuickEmojiPicker, Radio, RadioCard, RangeSlider, Rating, ReactionBar, RelativeTime, Result, RichEditor, RichEditorToolbar, Row, SegmentedControl, SegmentedProgress, Select, SelectMenu, ShimmerText, Sidebar, Skeleton, Slider, Space, Spinner, Splitter, SplitterPanel, StatCard, Statistic, StatusBadge, StatusDot, StepIndicator, Stepper, StepperContent, StepperDescription, StepperIndicator, StepperItem, StepperNav, StepperPanel, StepperSeparator, StepperTitle, StepperTrigger, Switch, Table, Tabs, Tag, Textarea, TimePicker, Timeline, Toast, Toaster, Toggle, Tooltip, Tree, UnicodeSpinner, VirtualTable, Wizard, arSA, buildHeatmapGrid, deDE, describeCron, enUS, esES, fmt, formatAvatarEmoji, frFR, groupReactions, idID, itIT, jaJP, koKR, localTodayIso, locales, nlNL, parseAvatarEmoji, parsePatch, plPL, primaryColorVars, ptBR, renderMarkdown, resolveMove, ruRU, summarizeHeatmap, toast, trTR, useBreakpoint, useConfig, useContextMenu, useForm, useLocale, useMappedSize, useMessage, useNotification, useSize, useStepItem, useStepper, viVN, zhCN, zhTW } from './chunk-K5GUNGCR.js';
|
|
2
2
|
export { cx } from './chunk-T225J6LV.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|