@kjun-ui/react 0.14.0 → 0.16.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/dist/index.cjs +391 -258
- package/dist/index.js +305 -172
- package/dist/styles.css +26 -3
- package/dist/types/packages/react/src/collapse.d.cts +3 -1
- package/dist/types/packages/react/src/collapse.d.ts +3 -1
- package/dist/types/packages/react/src/combobox.d.cts +6 -2
- package/dist/types/packages/react/src/combobox.d.ts +6 -2
- package/dist/types/packages/react/src/drawer.d.cts +3 -1
- package/dist/types/packages/react/src/drawer.d.ts +3 -1
- package/dist/types/packages/react/src/dropdown.d.cts +4 -2
- package/dist/types/packages/react/src/dropdown.d.ts +4 -2
- package/dist/types/packages/react/src/floating-panel.d.cts +8 -1
- package/dist/types/packages/react/src/floating-panel.d.ts +8 -1
- package/dist/types/packages/react/src/list.d.cts +9 -2
- package/dist/types/packages/react/src/list.d.ts +9 -2
- package/dist/types/packages/react/src/modal.d.cts +3 -1
- package/dist/types/packages/react/src/modal.d.ts +3 -1
- package/dist/types/packages/react/src/navigation.d.cts +7 -1
- package/dist/types/packages/react/src/navigation.d.ts +7 -1
- package/dist/types/packages/react/src/popover.d.cts +12 -3
- package/dist/types/packages/react/src/popover.d.ts +12 -3
- package/dist/types/packages/react/src/select-control.d.cts +4 -1
- package/dist/types/packages/react/src/select-control.d.ts +4 -1
- package/dist/types/shared/package-runtime/anchor-rect.d.cts +17 -0
- package/dist/types/shared/package-runtime/anchor-rect.d.ts +17 -0
- package/dist/types/shared/package-runtime/nested-controls.d.cts +2 -0
- package/dist/types/shared/package-runtime/nested-controls.d.ts +2 -0
- package/dist/types/shared/package-runtime/use-after-close.d.cts +6 -0
- package/dist/types/shared/package-runtime/use-after-close.d.ts +6 -0
- package/package.json +3 -3
package/dist/styles.css
CHANGED
|
@@ -79,6 +79,8 @@
|
|
|
79
79
|
--_kjun-color-selected-bg: var(--kjun-selected-bg, var(--kjun-active));
|
|
80
80
|
--_kjun-color-on-brand: var(--kjun-on-brand, var(--kjun-inverse));
|
|
81
81
|
--_kjun-color-switch-thumb-on: var(--kjun-switch-thumb-on, var(--kjun-on-brand, var(--kjun-inverse)));
|
|
82
|
+
--_kjun-color-filter-selected-bg: var(--kjun-filter-selected-bg, var(--kjun-text));
|
|
83
|
+
--_kjun-color-filter-selected-text: var(--kjun-filter-selected-text, var(--kjun-inverse));
|
|
82
84
|
--_kjun-color-on-danger: var(--kjun-on-danger, var(--kjun-inverse));
|
|
83
85
|
--_kjun-color-on-success: var(--kjun-on-success, var(--kjun-inverse));
|
|
84
86
|
--_kjun-color-on-warning: var(--kjun-on-warning, var(--kjun-inverse));
|
|
@@ -182,6 +184,8 @@
|
|
|
182
184
|
--_kjun-selected-bg: var(--_kjun-color-selected-bg);
|
|
183
185
|
--_kjun-on-brand: var(--_kjun-color-on-brand);
|
|
184
186
|
--_kjun-switch-thumb-on: var(--_kjun-color-switch-thumb-on);
|
|
187
|
+
--_kjun-filter-selected-bg: var(--_kjun-color-filter-selected-bg);
|
|
188
|
+
--_kjun-filter-selected-text: var(--_kjun-color-filter-selected-text);
|
|
185
189
|
--_kjun-on-danger: var(--_kjun-color-on-danger);
|
|
186
190
|
--_kjun-on-success: var(--_kjun-color-on-success);
|
|
187
191
|
--_kjun-on-warning: var(--_kjun-color-on-warning);
|
|
@@ -532,6 +536,9 @@
|
|
|
532
536
|
--_kjun-extension-switch-label-gap: 8px;
|
|
533
537
|
--_kjun-extension-tooltip-padding-x: 8px;
|
|
534
538
|
--_kjun-extension-tooltip-padding-y: 4px;
|
|
539
|
+
--_kjun-extension-tooltip-max-widths-sm: 192px;
|
|
540
|
+
--_kjun-extension-tooltip-max-widths-md: 256px;
|
|
541
|
+
--_kjun-extension-tooltip-max-widths-lg: 320px;
|
|
535
542
|
--_kjun-extension-tooltip-max-width: 256px;
|
|
536
543
|
--_kjun-extension-tooltip-arrow-size: 8px;
|
|
537
544
|
--_kjun-extension-financial-affix-gap: 4px;
|
|
@@ -833,6 +840,7 @@
|
|
|
833
840
|
--_kjun-geometry-card-radii-sm: 8px;
|
|
834
841
|
--_kjun-geometry-card-radii-md: 12px;
|
|
835
842
|
--_kjun-geometry-card-radii-lg: 16px;
|
|
843
|
+
--_kjun-geometry-card-radii-xl: 24px;
|
|
836
844
|
--_kjun-geometry-card-subtitle-gap: 4px;
|
|
837
845
|
--_kjun-geometry-card-title-gap: 8px;
|
|
838
846
|
--_kjun-geometry-card-glass-blur: 10px;
|
|
@@ -882,6 +890,7 @@
|
|
|
882
890
|
--_kjun-geometry-radius-radius9999: 9999px;
|
|
883
891
|
--_kjun-geometry-radius-radius14: 14px;
|
|
884
892
|
--_kjun-geometry-radius-radius20: 20px;
|
|
893
|
+
--_kjun-geometry-radius-radius24: 24px;
|
|
885
894
|
--_kjun-geometry-native-minimum-touch-target: 44px;
|
|
886
895
|
--_kjun-geometry-space-inline-xs: 4px;
|
|
887
896
|
--_kjun-geometry-space-inline-sm: 8px;
|
|
@@ -2421,8 +2430,8 @@
|
|
|
2421
2430
|
white-space: nowrap;
|
|
2422
2431
|
}
|
|
2423
2432
|
.kjun-filter-chip[aria-pressed="true"] > span {
|
|
2424
|
-
background: var(--_kjun-color-
|
|
2425
|
-
color: var(--_kjun-color-
|
|
2433
|
+
background: var(--_kjun-color-filter-selected-bg);
|
|
2434
|
+
color: var(--_kjun-color-filter-selected-text);
|
|
2426
2435
|
font-weight: var(--_kjun-type-control-weight);
|
|
2427
2436
|
}
|
|
2428
2437
|
.kjun-filter-chip:disabled {
|
|
@@ -2520,6 +2529,17 @@
|
|
|
2520
2529
|
font-weight: var(--_kjun-type-caption-weight);
|
|
2521
2530
|
letter-spacing: var(--_kjun-type-caption-tracking);
|
|
2522
2531
|
}
|
|
2532
|
+
/* Title above the body: a bolder small role in the same tooltip text color. */
|
|
2533
|
+
.kjun-tooltip-title {
|
|
2534
|
+
display: block;
|
|
2535
|
+
font-size: var(--_kjun-type-control-small-size);
|
|
2536
|
+
line-height: var(--_kjun-type-control-small-line);
|
|
2537
|
+
font-weight: var(--_kjun-type-control-small-weight);
|
|
2538
|
+
letter-spacing: var(--_kjun-type-control-small-tracking);
|
|
2539
|
+
}
|
|
2540
|
+
.kjun-tooltip-body { display: block; }
|
|
2541
|
+
.kjun-tooltip[data-align="start"] { text-align: start; }
|
|
2542
|
+
.kjun-tooltip[data-align="center"] { text-align: center; }
|
|
2523
2543
|
.kjun-tooltip svg {
|
|
2524
2544
|
display: block;
|
|
2525
2545
|
color: var(--_kjun-color-chart-tooltip-bg);
|
|
@@ -4800,7 +4820,7 @@
|
|
|
4800
4820
|
|
|
4801
4821
|
.kjun-list-section,.kjun-top-navigation,.kjun-bottom-navigation,.kjun-bottom-action-bar{min-width:0;max-width:100%;color:var(--_kjun-color-text);background:var(--_kjun-color-surface)}
|
|
4802
4822
|
.kjun-list-heading{display:flex;align-items:center;justify-content:space-between;gap:var(--_kjun-extension-list-gap);padding:var(--_kjun-extension-list-padding)}.kjun-list-heading h3{font-size:var(--_kjun-type-card-title-size);margin:0;line-height:var(--_kjun-type-card-title-line);font-weight:var(--_kjun-type-card-title-weight);letter-spacing:var(--_kjun-type-card-title-tracking)}.kjun-list-heading p{margin:var(--_kjun-geometry-dimension-value4) 0 0;font-size:var(--_kjun-type-caption-size);color:var(--_kjun-color-text-secondary);overflow-wrap:anywhere;line-height:var(--_kjun-type-caption-line);font-weight:var(--_kjun-type-caption-weight);letter-spacing:var(--_kjun-type-caption-tracking)}
|
|
4803
|
-
.kjun-list{list-style:none;padding:0;margin:0}.kjun-list-row{display:flex;align-items:center;gap:var(--_kjun-extension-list-gap);border-bottom:var(--_kjun-border-default-width) solid var(--_kjun-color-divider);min-width:0}.kjun-list-row:last-child{border-bottom:0}.kjun-list[data-divider=false]>.kjun-list-row{border-bottom:0}.kjun-list[data-density=compact] .kjun-list-main{min-height:var(--_kjun-extension-list-compact-minimum-height);padding-block:var(--_kjun-extension-list-compact-padding-y)}.kjun-list-main{display:flex;align-items:center;gap:var(--_kjun-extension-list-gap);flex:1;min-width:0;min-height:var(--_kjun-extension-list-minimum-height);padding:var(--_kjun-extension-list-padding);text-align:start;color:inherit;text-decoration:none;background:transparent;border:0;font:inherit}.kjun-list-main:is(button,a):hover{background:var(--_kjun-color-hover)}.kjun-list-body{flex:1;min-width:0}.kjun-list-title,.kjun-list-description{display:block;overflow-wrap:anywhere;line-height:1.5}.kjun-list-title{font-size:var(--_kjun-type-label-size);line-height:var(--_kjun-type-label-line);font-weight:var(--_kjun-type-label-weight);letter-spacing:var(--_kjun-type-label-tracking)}.kjun-list-description{font-size:var(--_kjun-type-caption-size);color:var(--_kjun-color-text-secondary);line-height:var(--_kjun-type-caption-line);font-weight:var(--_kjun-type-caption-weight);letter-spacing:var(--_kjun-type-caption-tracking)}.kjun-list-leading{flex-shrink:0}.kjun-list-trailing{overflow-wrap:anywhere;max-width:35%}.kjun-list-actions{display:flex;flex-wrap:wrap;gap:var(--_kjun-extension-list-actions-gap);padding-inline-end:var(--_kjun-extension-list-actions-padding);max-width:45%}
|
|
4823
|
+
.kjun-list{list-style:none;padding:0;margin:0}.kjun-list-row{display:flex;align-items:center;gap:var(--_kjun-extension-list-gap);border-bottom:var(--_kjun-border-default-width) solid var(--_kjun-color-divider);min-width:0}.kjun-list-row:last-child{border-bottom:0}.kjun-list[data-divider=false]>.kjun-list-row{border-bottom:0}.kjun-list[data-density=compact] .kjun-list-main{min-height:var(--_kjun-extension-list-compact-minimum-height);padding-block:var(--_kjun-extension-list-compact-padding-y)}.kjun-list-main{display:flex;align-items:center;gap:var(--_kjun-extension-list-gap);flex:1;min-width:0;min-height:var(--_kjun-extension-list-minimum-height);padding:var(--_kjun-extension-list-padding);text-align:start;color:inherit;text-decoration:none;background:transparent;border:0;font:inherit}.kjun-list-main:is(button,a):hover{background:var(--_kjun-color-hover)}.kjun-list-body{flex:1;min-width:0}.kjun-list-content{display:block;margin-top:var(--_kjun-extension-list-description-gap)}.kjun-list-title,.kjun-list-description{display:block;overflow-wrap:anywhere;line-height:1.5}.kjun-list-title{font-size:var(--_kjun-type-label-size);line-height:var(--_kjun-type-label-line);font-weight:var(--_kjun-type-label-weight);letter-spacing:var(--_kjun-type-label-tracking)}.kjun-list-description{font-size:var(--_kjun-type-caption-size);color:var(--_kjun-color-text-secondary);line-height:var(--_kjun-type-caption-line);font-weight:var(--_kjun-type-caption-weight);letter-spacing:var(--_kjun-type-caption-tracking)}.kjun-list-leading{flex-shrink:0}.kjun-list-trailing{overflow-wrap:anywhere;max-width:35%}.kjun-list-actions{display:flex;flex-wrap:wrap;gap:var(--_kjun-extension-list-actions-gap);padding-inline-end:var(--_kjun-extension-list-actions-padding);max-width:45%}
|
|
4804
4824
|
/* A disabled row disables its actions too, so the row never reads as partly available. */
|
|
4805
4825
|
.kjun-list-actions[data-disabled]{opacity:var(--_kjun-state-opacity-disabled)}
|
|
4806
4826
|
.kjun-navigation-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:var(--_kjun-extension-navigation-actions-gap);min-width:0}
|
|
@@ -5023,6 +5043,9 @@
|
|
|
5023
5043
|
|
|
5024
5044
|
/* 0.14.0: plain sections, destructive rows, decorative chevrons and non-row list items share the row inset. */
|
|
5025
5045
|
.kjun-list-section[data-surface="false"]{background:transparent}
|
|
5046
|
+
/* A rounded section clips its rows to the corners; row focus rings move inside so the clip does not cut them. */
|
|
5047
|
+
.kjun-list-section[data-radius]{overflow:hidden;overflow:clip}
|
|
5048
|
+
.kjun-list-section[data-radius] .kjun-list-main:focus-visible{outline-offset:var(--_kjun-state-focus-inset-offset)}
|
|
5026
5049
|
.kjun-list-row[data-destructive] .kjun-list-title{color:var(--_kjun-color-danger)}
|
|
5027
5050
|
.kjun-list-chevron{flex-shrink:0;color:var(--_kjun-color-text-tertiary)}
|
|
5028
5051
|
.kjun-list-item{padding:var(--_kjun-extension-list-padding);border-bottom:var(--_kjun-border-default-width) solid var(--_kjun-color-divider);min-width:0}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
|
|
2
|
+
/** keepMounted: once opened, the body stays mounted (inert, hidden from assistive technology) while closed. */
|
|
3
|
+
export declare function Collapse({ open, keepMounted, children }: {
|
|
3
4
|
open: boolean;
|
|
5
|
+
keepMounted?: boolean;
|
|
4
6
|
children: ReactNode;
|
|
5
7
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
|
|
2
|
+
/** keepMounted: once opened, the body stays mounted (inert, hidden from assistive technology) while closed. */
|
|
3
|
+
export declare function Collapse({ open, keepMounted, children }: {
|
|
3
4
|
open: boolean;
|
|
5
|
+
keepMounted?: boolean;
|
|
4
6
|
children: ReactNode;
|
|
5
7
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type InputSize } from "@kjun-ui/tokens";
|
|
2
2
|
import { type ReactNode } from "react";
|
|
3
|
+
import { type FocusReturn } from "./floating-panel.cjs";
|
|
3
4
|
import { OptionValue, SelectOption } from "./select-options.cjs";
|
|
4
5
|
export interface KjunComboboxProps<T extends SelectOption = SelectOption> {
|
|
5
6
|
value: OptionValue | null;
|
|
@@ -19,8 +20,10 @@ export interface KjunComboboxProps<T extends SelectOption = SelectOption> {
|
|
|
19
20
|
onChange?: (v: OptionValue | null) => void;
|
|
20
21
|
onSearch?: (v: string) => void;
|
|
21
22
|
onClear?: () => void;
|
|
23
|
+
/** Where focus goes after choosing an option or Escape. Closing while typing keeps focus in the input. Web only. */
|
|
24
|
+
returnFocus?: FocusReturn;
|
|
22
25
|
}
|
|
23
|
-
export declare function KjunCombobox<T extends SelectOption = SelectOption>({ value, options, placeholder, ariaLabel, labelKey, valueKey, filterFn, size, disabled, error, clearable, emptyText, renderOption, onValueChange, onChange, onSearch, onClear, }: KjunComboboxProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare function KjunCombobox<T extends SelectOption = SelectOption>({ value, options, placeholder, ariaLabel, labelKey, valueKey, filterFn, size, disabled, error, clearable, emptyText, renderOption, onValueChange, onChange, onSearch, onClear, returnFocus, }: KjunComboboxProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
24
27
|
export interface SearchFieldProps<T extends SelectOption> {
|
|
25
28
|
value: string;
|
|
26
29
|
size: InputSize;
|
|
@@ -44,5 +47,6 @@ export interface SearchFieldProps<T extends SelectOption> {
|
|
|
44
47
|
onSelect: (o: T) => void;
|
|
45
48
|
onClear?: () => void;
|
|
46
49
|
onEnter?: () => void;
|
|
50
|
+
returnFocus?: () => HTMLElement | null;
|
|
47
51
|
}
|
|
48
|
-
export declare function SearchField<T extends SelectOption>({ value, size, placeholder, ariaLabel, disabled, error, clearable, open, onOpenChange, options, labelKey, itemKey, emptyText, loading, failed, errorText, renderOption, onValueChange, onSelect, onClear, onEnter, }: SearchFieldProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
export declare function SearchField<T extends SelectOption>({ value, size, placeholder, ariaLabel, disabled, error, clearable, open, onOpenChange, options, labelKey, itemKey, emptyText, loading, failed, errorText, renderOption, onValueChange, onSelect, onClear, onEnter, returnFocus, }: SearchFieldProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type InputSize } from "@kjun-ui/tokens";
|
|
2
2
|
import { type ReactNode } from "react";
|
|
3
|
+
import { type FocusReturn } from "./floating-panel.js";
|
|
3
4
|
import { OptionValue, SelectOption } from "./select-options.js";
|
|
4
5
|
export interface KjunComboboxProps<T extends SelectOption = SelectOption> {
|
|
5
6
|
value: OptionValue | null;
|
|
@@ -19,8 +20,10 @@ export interface KjunComboboxProps<T extends SelectOption = SelectOption> {
|
|
|
19
20
|
onChange?: (v: OptionValue | null) => void;
|
|
20
21
|
onSearch?: (v: string) => void;
|
|
21
22
|
onClear?: () => void;
|
|
23
|
+
/** Where focus goes after choosing an option or Escape. Closing while typing keeps focus in the input. Web only. */
|
|
24
|
+
returnFocus?: FocusReturn;
|
|
22
25
|
}
|
|
23
|
-
export declare function KjunCombobox<T extends SelectOption = SelectOption>({ value, options, placeholder, ariaLabel, labelKey, valueKey, filterFn, size, disabled, error, clearable, emptyText, renderOption, onValueChange, onChange, onSearch, onClear, }: KjunComboboxProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare function KjunCombobox<T extends SelectOption = SelectOption>({ value, options, placeholder, ariaLabel, labelKey, valueKey, filterFn, size, disabled, error, clearable, emptyText, renderOption, onValueChange, onChange, onSearch, onClear, returnFocus, }: KjunComboboxProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
24
27
|
export interface SearchFieldProps<T extends SelectOption> {
|
|
25
28
|
value: string;
|
|
26
29
|
size: InputSize;
|
|
@@ -44,5 +47,6 @@ export interface SearchFieldProps<T extends SelectOption> {
|
|
|
44
47
|
onSelect: (o: T) => void;
|
|
45
48
|
onClear?: () => void;
|
|
46
49
|
onEnter?: () => void;
|
|
50
|
+
returnFocus?: () => HTMLElement | null;
|
|
47
51
|
}
|
|
48
|
-
export declare function SearchField<T extends SelectOption>({ value, size, placeholder, ariaLabel, disabled, error, clearable, open, onOpenChange, options, labelKey, itemKey, emptyText, loading, failed, errorText, renderOption, onValueChange, onSelect, onClear, onEnter, }: SearchFieldProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
export declare function SearchField<T extends SelectOption>({ value, size, placeholder, ariaLabel, disabled, error, clearable, open, onOpenChange, options, labelKey, itemKey, emptyText, loading, failed, errorText, renderOption, onValueChange, onSelect, onClear, onEnter, returnFocus, }: SearchFieldProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -13,6 +13,8 @@ export interface KjunDrawerProps {
|
|
|
13
13
|
footer?: ReactNode;
|
|
14
14
|
children: ReactNode;
|
|
15
15
|
onClose?: () => void;
|
|
16
|
+
/** Called once after the close finishes and the layer has left the screen (not when it mounts closed or reopens during the exit). */
|
|
17
|
+
onAfterClose?: () => void;
|
|
16
18
|
ariaLabel?: string;
|
|
17
19
|
/** Top safe area in px, padded inside top and side drawers and kept clear above a bottom sheet. */
|
|
18
20
|
safeAreaTop?: number;
|
|
@@ -21,4 +23,4 @@ export interface KjunDrawerProps {
|
|
|
21
23
|
/** Height limit in px for top and bottom drawers; by default they stop a sheet gap short of the opposite edge. */
|
|
22
24
|
maxHeight?: number;
|
|
23
25
|
}
|
|
24
|
-
export declare function KjunDrawer({ open, onOpenChange, title, position, width, closable, closeOnOverlay, closeOnEsc, noPadding, header, footer, children, onClose, ariaLabel, safeAreaTop, safeAreaBottom, maxHeight, }: KjunDrawerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
26
|
+
export declare function KjunDrawer({ open, onOpenChange, title, position, width, closable, closeOnOverlay, closeOnEsc, noPadding, header, footer, children, onClose, onAfterClose, ariaLabel, safeAreaTop, safeAreaBottom, maxHeight, }: KjunDrawerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -13,6 +13,8 @@ export interface KjunDrawerProps {
|
|
|
13
13
|
footer?: ReactNode;
|
|
14
14
|
children: ReactNode;
|
|
15
15
|
onClose?: () => void;
|
|
16
|
+
/** Called once after the close finishes and the layer has left the screen (not when it mounts closed or reopens during the exit). */
|
|
17
|
+
onAfterClose?: () => void;
|
|
16
18
|
ariaLabel?: string;
|
|
17
19
|
/** Top safe area in px, padded inside top and side drawers and kept clear above a bottom sheet. */
|
|
18
20
|
safeAreaTop?: number;
|
|
@@ -21,4 +23,4 @@ export interface KjunDrawerProps {
|
|
|
21
23
|
/** Height limit in px for top and bottom drawers; by default they stop a sheet gap short of the opposite edge. */
|
|
22
24
|
maxHeight?: number;
|
|
23
25
|
}
|
|
24
|
-
export declare function KjunDrawer({ open, onOpenChange, title, position, width, closable, closeOnOverlay, closeOnEsc, noPadding, header, footer, children, onClose, ariaLabel, safeAreaTop, safeAreaBottom, maxHeight, }: KjunDrawerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
26
|
+
export declare function KjunDrawer({ open, onOpenChange, title, position, width, closable, closeOnOverlay, closeOnEsc, noPadding, header, footer, children, onClose, onAfterClose, ariaLabel, safeAreaTop, safeAreaBottom, maxHeight, }: KjunDrawerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import { type KjunButtonProps } from "./button.cjs";
|
|
3
|
-
import { type Placement } from "./floating-panel.cjs";
|
|
3
|
+
import { type FocusReturn, type Placement } from "./floating-panel.cjs";
|
|
4
4
|
import { type KjunTooltipProps } from "./popover.cjs";
|
|
5
5
|
export interface KjunDropdownProps {
|
|
6
6
|
disabled?: boolean;
|
|
@@ -12,8 +12,10 @@ export interface KjunDropdownProps {
|
|
|
12
12
|
children: ReactNode;
|
|
13
13
|
onOpen?: () => void;
|
|
14
14
|
onClose?: () => void;
|
|
15
|
+
/** Where focus goes when the menu closes by choosing or Escape, instead of the trigger (e.g. an edited cell). Web only. */
|
|
16
|
+
returnFocus?: FocusReturn;
|
|
15
17
|
}
|
|
16
|
-
export declare function KjunDropdown({ disabled, placement, menuId, triggerId, menuClass, trigger, children, onOpen, onClose, }: KjunDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function KjunDropdown({ disabled, placement, menuId, triggerId, menuClass, trigger, children, onOpen, onClose, returnFocus, }: KjunDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
17
19
|
export interface KjunDropdownItemProps {
|
|
18
20
|
id?: string;
|
|
19
21
|
variant?: "default" | "danger";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import { type KjunButtonProps } from "./button.js";
|
|
3
|
-
import { type Placement } from "./floating-panel.js";
|
|
3
|
+
import { type FocusReturn, type Placement } from "./floating-panel.js";
|
|
4
4
|
import { type KjunTooltipProps } from "./popover.js";
|
|
5
5
|
export interface KjunDropdownProps {
|
|
6
6
|
disabled?: boolean;
|
|
@@ -12,8 +12,10 @@ export interface KjunDropdownProps {
|
|
|
12
12
|
children: ReactNode;
|
|
13
13
|
onOpen?: () => void;
|
|
14
14
|
onClose?: () => void;
|
|
15
|
+
/** Where focus goes when the menu closes by choosing or Escape, instead of the trigger (e.g. an edited cell). Web only. */
|
|
16
|
+
returnFocus?: FocusReturn;
|
|
15
17
|
}
|
|
16
|
-
export declare function KjunDropdown({ disabled, placement, menuId, triggerId, menuClass, trigger, children, onOpen, onClose, }: KjunDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function KjunDropdown({ disabled, placement, menuId, triggerId, menuClass, trigger, children, onOpen, onClose, returnFocus, }: KjunDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
17
19
|
export interface KjunDropdownItemProps {
|
|
18
20
|
id?: string;
|
|
19
21
|
variant?: "default" | "danger";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type CSSProperties, type ReactNode, type RefObject } from "react";
|
|
2
2
|
export type Placement = "top" | "bottom" | "left" | "right" | "bottom-start" | "bottom-end" | "top-start" | "top-end";
|
|
3
|
-
export declare function FloatingPanel({ open, onOpenChange, triggerRef, children, placement, className, matchTriggerWidth, maxHeight, field, flip, nonModal, ownsDismiss, returnFocus, }: {
|
|
3
|
+
export declare function FloatingPanel({ open, onOpenChange, triggerRef, children, placement, className, matchTriggerWidth, maxHeight, field, flip, nonModal, ownsDismiss, returnFocus, repositionKey, inside, }: {
|
|
4
4
|
open: boolean;
|
|
5
5
|
onOpenChange: (v: boolean) => void;
|
|
6
6
|
triggerRef: RefObject<HTMLElement | null>;
|
|
@@ -15,4 +15,11 @@ export declare function FloatingPanel({ open, onOpenChange, triggerRef, children
|
|
|
15
15
|
/** The consumer closes the panel itself (non-modal Popover); ignore react-aria's own close requests. */
|
|
16
16
|
ownsDismiss?: boolean;
|
|
17
17
|
returnFocus?: () => HTMLElement | null | false | undefined;
|
|
18
|
+
/** Changing it makes react-aria place the panel again (it does not watch its trigger move). */
|
|
19
|
+
repositionKey?: number;
|
|
20
|
+
/** Another element that counts as inside (an anchored Popover's trigger area): pressing it is not an outside press. */
|
|
21
|
+
inside?: RefObject<HTMLElement | null>;
|
|
18
22
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
23
|
+
/** A focus target given as an element, a ref or a function read when the panel closes. */
|
|
24
|
+
export type FocusReturn = HTMLElement | RefObject<HTMLElement | null> | (() => HTMLElement | null);
|
|
25
|
+
export declare const resolveFocusReturn: (target: FocusReturn | undefined) => (() => HTMLElement | null) | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type CSSProperties, type ReactNode, type RefObject } from "react";
|
|
2
2
|
export type Placement = "top" | "bottom" | "left" | "right" | "bottom-start" | "bottom-end" | "top-start" | "top-end";
|
|
3
|
-
export declare function FloatingPanel({ open, onOpenChange, triggerRef, children, placement, className, matchTriggerWidth, maxHeight, field, flip, nonModal, ownsDismiss, returnFocus, }: {
|
|
3
|
+
export declare function FloatingPanel({ open, onOpenChange, triggerRef, children, placement, className, matchTriggerWidth, maxHeight, field, flip, nonModal, ownsDismiss, returnFocus, repositionKey, inside, }: {
|
|
4
4
|
open: boolean;
|
|
5
5
|
onOpenChange: (v: boolean) => void;
|
|
6
6
|
triggerRef: RefObject<HTMLElement | null>;
|
|
@@ -15,4 +15,11 @@ export declare function FloatingPanel({ open, onOpenChange, triggerRef, children
|
|
|
15
15
|
/** The consumer closes the panel itself (non-modal Popover); ignore react-aria's own close requests. */
|
|
16
16
|
ownsDismiss?: boolean;
|
|
17
17
|
returnFocus?: () => HTMLElement | null | false | undefined;
|
|
18
|
+
/** Changing it makes react-aria place the panel again (it does not watch its trigger move). */
|
|
19
|
+
repositionKey?: number;
|
|
20
|
+
/** Another element that counts as inside (an anchored Popover's trigger area): pressing it is not an outside press. */
|
|
21
|
+
inside?: RefObject<HTMLElement | null>;
|
|
18
22
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
23
|
+
/** A focus target given as an element, a ref or a function read when the panel closes. */
|
|
24
|
+
export type FocusReturn = HTMLElement | RefObject<HTMLElement | null> | (() => HTMLElement | null);
|
|
25
|
+
export declare const resolveFocusReturn: (target: FocusReturn | undefined) => (() => HTMLElement | null) | undefined;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type CardRadius } from "@kjun-ui/tokens";
|
|
1
2
|
import { type MouseEvent, type ReactNode } from "react";
|
|
2
3
|
export interface KjunListRowProps {
|
|
3
4
|
title: string;
|
|
@@ -12,8 +13,12 @@ export interface KjunListRowProps {
|
|
|
12
13
|
/** Ends the row with a decorative chevron that marks it as navigation. */
|
|
13
14
|
chevron?: boolean;
|
|
14
15
|
onClick?: (event: MouseEvent<HTMLElement>) => void;
|
|
16
|
+
/** Name of a pressable or link row, e.g. with the amount a screen reader should hear. */
|
|
17
|
+
ariaLabel?: string;
|
|
18
|
+
/** Display-only content under the description (a budget bar); no buttons or links inside a pressable row. */
|
|
19
|
+
children?: ReactNode;
|
|
15
20
|
}
|
|
16
|
-
export declare function KjunListRow({ title, description, leading, trailing, actions, href, disabled, destructive, chevron, onClick }: KjunListRowProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function KjunListRow({ title, description, leading, trailing, actions, href, disabled, destructive, chevron, onClick, ariaLabel, children }: KjunListRowProps): import("react/jsx-runtime").JSX.Element;
|
|
17
22
|
export interface KjunListSectionProps {
|
|
18
23
|
title?: string;
|
|
19
24
|
description?: string;
|
|
@@ -26,8 +31,10 @@ export interface KjunListSectionProps {
|
|
|
26
31
|
divider?: boolean;
|
|
27
32
|
/** "compact" rows keep the 16px inset but are 44 tall (the touch minimum) instead of 56. */
|
|
28
33
|
density?: "default" | "compact";
|
|
34
|
+
/** Rounds the section on the card radius steps and clips its rows to the corners (default "none"). */
|
|
35
|
+
radius?: CardRadius;
|
|
29
36
|
}
|
|
30
|
-
export declare function KjunListSection({ title, description, actions, children, ariaLabel, surface, divider, density }: KjunListSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export declare function KjunListSection({ title, description, actions, children, ariaLabel, surface, divider, density, radius }: KjunListSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
31
38
|
export interface KjunListItemProps {
|
|
32
39
|
children: ReactNode;
|
|
33
40
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type CardRadius } from "@kjun-ui/tokens";
|
|
1
2
|
import { type MouseEvent, type ReactNode } from "react";
|
|
2
3
|
export interface KjunListRowProps {
|
|
3
4
|
title: string;
|
|
@@ -12,8 +13,12 @@ export interface KjunListRowProps {
|
|
|
12
13
|
/** Ends the row with a decorative chevron that marks it as navigation. */
|
|
13
14
|
chevron?: boolean;
|
|
14
15
|
onClick?: (event: MouseEvent<HTMLElement>) => void;
|
|
16
|
+
/** Name of a pressable or link row, e.g. with the amount a screen reader should hear. */
|
|
17
|
+
ariaLabel?: string;
|
|
18
|
+
/** Display-only content under the description (a budget bar); no buttons or links inside a pressable row. */
|
|
19
|
+
children?: ReactNode;
|
|
15
20
|
}
|
|
16
|
-
export declare function KjunListRow({ title, description, leading, trailing, actions, href, disabled, destructive, chevron, onClick }: KjunListRowProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function KjunListRow({ title, description, leading, trailing, actions, href, disabled, destructive, chevron, onClick, ariaLabel, children }: KjunListRowProps): import("react/jsx-runtime").JSX.Element;
|
|
17
22
|
export interface KjunListSectionProps {
|
|
18
23
|
title?: string;
|
|
19
24
|
description?: string;
|
|
@@ -26,8 +31,10 @@ export interface KjunListSectionProps {
|
|
|
26
31
|
divider?: boolean;
|
|
27
32
|
/** "compact" rows keep the 16px inset but are 44 tall (the touch minimum) instead of 56. */
|
|
28
33
|
density?: "default" | "compact";
|
|
34
|
+
/** Rounds the section on the card radius steps and clips its rows to the corners (default "none"). */
|
|
35
|
+
radius?: CardRadius;
|
|
29
36
|
}
|
|
30
|
-
export declare function KjunListSection({ title, description, actions, children, ariaLabel, surface, divider, density }: KjunListSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export declare function KjunListSection({ title, description, actions, children, ariaLabel, surface, divider, density, radius }: KjunListSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
31
38
|
export interface KjunListItemProps {
|
|
32
39
|
children: ReactNode;
|
|
33
40
|
}
|
|
@@ -19,6 +19,8 @@ export interface KjunModalProps {
|
|
|
19
19
|
open: boolean;
|
|
20
20
|
onOpenChange: (open: boolean) => void;
|
|
21
21
|
onClose?: () => void;
|
|
22
|
+
/** Called once after the close finishes and the layer has left the screen (not when it mounts closed or reopens during the exit). */
|
|
23
|
+
onAfterClose?: () => void;
|
|
22
24
|
onCancel?: () => void;
|
|
23
25
|
onConfirm?: () => void;
|
|
24
26
|
title?: string;
|
|
@@ -43,4 +45,4 @@ export interface KjunModalProps {
|
|
|
43
45
|
children: ReactNode;
|
|
44
46
|
ariaLabel?: string;
|
|
45
47
|
}
|
|
46
|
-
export declare function KjunModal({ open, onOpenChange, onClose, onCancel, onConfirm, title, size, closable, closeOnOverlay, closeOnEsc, showHeader, showFooter, showConfirmButton, showCancelButton, confirmText, cancelText, confirmDisabled, loading, noPadding, height, confirmVariant, footerSize, header, footer, children, ariaLabel, }: KjunModalProps): import("react/jsx-runtime").JSX.Element | null;
|
|
48
|
+
export declare function KjunModal({ open, onOpenChange, onClose, onAfterClose, onCancel, onConfirm, title, size, closable, closeOnOverlay, closeOnEsc, showHeader, showFooter, showConfirmButton, showCancelButton, confirmText, cancelText, confirmDisabled, loading, noPadding, height, confirmVariant, footerSize, header, footer, children, ariaLabel, }: KjunModalProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -19,6 +19,8 @@ export interface KjunModalProps {
|
|
|
19
19
|
open: boolean;
|
|
20
20
|
onOpenChange: (open: boolean) => void;
|
|
21
21
|
onClose?: () => void;
|
|
22
|
+
/** Called once after the close finishes and the layer has left the screen (not when it mounts closed or reopens during the exit). */
|
|
23
|
+
onAfterClose?: () => void;
|
|
22
24
|
onCancel?: () => void;
|
|
23
25
|
onConfirm?: () => void;
|
|
24
26
|
title?: string;
|
|
@@ -43,4 +45,4 @@ export interface KjunModalProps {
|
|
|
43
45
|
children: ReactNode;
|
|
44
46
|
ariaLabel?: string;
|
|
45
47
|
}
|
|
46
|
-
export declare function KjunModal({ open, onOpenChange, onClose, onCancel, onConfirm, title, size, closable, closeOnOverlay, closeOnEsc, showHeader, showFooter, showConfirmButton, showCancelButton, confirmText, cancelText, confirmDisabled, loading, noPadding, height, confirmVariant, footerSize, header, footer, children, ariaLabel, }: KjunModalProps): import("react/jsx-runtime").JSX.Element | null;
|
|
48
|
+
export declare function KjunModal({ open, onOpenChange, onClose, onAfterClose, onCancel, onConfirm, title, size, closable, closeOnOverlay, closeOnEsc, showHeader, showFooter, showConfirmButton, showCancelButton, confirmText, cancelText, confirmDisabled, loading, noPadding, height, confirmVariant, footerSize, header, footer, children, ariaLabel, }: KjunModalProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -38,11 +38,17 @@ export declare function KjunAccordion({ multiple, tone, children, }: KjunAccordi
|
|
|
38
38
|
export interface KjunAccordionItemProps {
|
|
39
39
|
title?: string;
|
|
40
40
|
defaultOpen?: boolean;
|
|
41
|
+
/** Controlled open state. A controlled item follows this value only and stays out of the Accordion's single-open rule. */
|
|
42
|
+
open?: boolean;
|
|
43
|
+
/** Requests a change on a controlled item; reports every change on an uncontrolled one (also when a sibling closes it). */
|
|
44
|
+
onOpenChange?: (open: boolean) => void;
|
|
45
|
+
/** Keeps the body mounted after it first opens, so inputs keep their state while closed. */
|
|
46
|
+
keepMounted?: boolean;
|
|
41
47
|
disabled?: boolean;
|
|
42
48
|
header?: ReactNode;
|
|
43
49
|
children: ReactNode;
|
|
44
50
|
}
|
|
45
|
-
export declare function KjunAccordionItem({ title, defaultOpen, disabled, header, children, }: KjunAccordionItemProps): import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
export declare function KjunAccordionItem({ title, defaultOpen, disabled, header, open: openProp, onOpenChange, keepMounted, children, }: KjunAccordionItemProps): import("react/jsx-runtime").JSX.Element;
|
|
46
52
|
export interface BreadcrumbItem {
|
|
47
53
|
label: string;
|
|
48
54
|
to?: string;
|
|
@@ -38,11 +38,17 @@ export declare function KjunAccordion({ multiple, tone, children, }: KjunAccordi
|
|
|
38
38
|
export interface KjunAccordionItemProps {
|
|
39
39
|
title?: string;
|
|
40
40
|
defaultOpen?: boolean;
|
|
41
|
+
/** Controlled open state. A controlled item follows this value only and stays out of the Accordion's single-open rule. */
|
|
42
|
+
open?: boolean;
|
|
43
|
+
/** Requests a change on a controlled item; reports every change on an uncontrolled one (also when a sibling closes it). */
|
|
44
|
+
onOpenChange?: (open: boolean) => void;
|
|
45
|
+
/** Keeps the body mounted after it first opens, so inputs keep their state while closed. */
|
|
46
|
+
keepMounted?: boolean;
|
|
41
47
|
disabled?: boolean;
|
|
42
48
|
header?: ReactNode;
|
|
43
49
|
children: ReactNode;
|
|
44
50
|
}
|
|
45
|
-
export declare function KjunAccordionItem({ title, defaultOpen, disabled, header, children, }: KjunAccordionItemProps): import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
export declare function KjunAccordionItem({ title, defaultOpen, disabled, header, open: openProp, onOpenChange, keepMounted, children, }: KjunAccordionItemProps): import("react/jsx-runtime").JSX.Element;
|
|
46
52
|
export interface BreadcrumbItem {
|
|
47
53
|
label: string;
|
|
48
54
|
to?: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type AnchorSource } from "../../../shared/package-runtime/anchor-rect.cjs";
|
|
1
2
|
import { type CSSProperties, type ReactNode, type RefObject } from "react";
|
|
2
3
|
export interface KjunPopoverProps {
|
|
3
4
|
noPadding?: boolean;
|
|
@@ -16,12 +17,20 @@ export interface KjunPopoverProps {
|
|
|
16
17
|
header?: ReactNode;
|
|
17
18
|
/** false keeps the page usable: Tab can leave, and an outside press or focus move closes without returning focus. */
|
|
18
19
|
modal?: boolean;
|
|
19
|
-
|
|
20
|
+
/** Attach to this screen rectangle (or a function read every frame while open) instead of the trigger. Web only.
|
|
21
|
+
* The trigger becomes optional; presses inside it still count as inside a non-modal Popover. */
|
|
22
|
+
anchorRect?: AnchorSource;
|
|
23
|
+
trigger?: ReactNode | ((open: boolean) => ReactNode);
|
|
20
24
|
children: ReactNode | ((close: () => void) => ReactNode);
|
|
21
25
|
}
|
|
22
|
-
export declare function KjunPopover({ noPadding, open: controlled, onOpenChange, manualTrigger, matchTriggerWidth, maxHeight, flip, focusOnOpen, ariaLabel, placement, returnFocus, header, modal, trigger, children, }: KjunPopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare function KjunPopover({ noPadding, open: controlled, onOpenChange, manualTrigger, matchTriggerWidth, maxHeight, flip, focusOnOpen, ariaLabel, placement, returnFocus, header, modal, anchorRect, trigger, children, }: KjunPopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
23
27
|
export interface KjunTooltipProps {
|
|
24
28
|
content?: string;
|
|
29
|
+
/** A bolder line above content (a file name above its path). Read together with content. */
|
|
30
|
+
title?: string;
|
|
31
|
+
align?: "start" | "center";
|
|
32
|
+
/** Maximum width step (tooltip.maxWidths); default is md, the earlier width. */
|
|
33
|
+
width?: "sm" | "md" | "lg";
|
|
25
34
|
placement?: "top" | "bottom" | "left" | "right";
|
|
26
35
|
delay?: number;
|
|
27
36
|
/** Controlled visibility; omit to let hover and focus drive it. */
|
|
@@ -29,4 +38,4 @@ export interface KjunTooltipProps {
|
|
|
29
38
|
onOpenChange?: (open: boolean) => void;
|
|
30
39
|
children: ReactNode;
|
|
31
40
|
}
|
|
32
|
-
export declare function KjunTooltip({ content, placement, delay, open: controlled, onOpenChange, children, }: KjunTooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
export declare function KjunTooltip({ content, title, align, width, placement, delay, open: controlled, onOpenChange, children, }: KjunTooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type AnchorSource } from "../../../shared/package-runtime/anchor-rect.js";
|
|
1
2
|
import { type CSSProperties, type ReactNode, type RefObject } from "react";
|
|
2
3
|
export interface KjunPopoverProps {
|
|
3
4
|
noPadding?: boolean;
|
|
@@ -16,12 +17,20 @@ export interface KjunPopoverProps {
|
|
|
16
17
|
header?: ReactNode;
|
|
17
18
|
/** false keeps the page usable: Tab can leave, and an outside press or focus move closes without returning focus. */
|
|
18
19
|
modal?: boolean;
|
|
19
|
-
|
|
20
|
+
/** Attach to this screen rectangle (or a function read every frame while open) instead of the trigger. Web only.
|
|
21
|
+
* The trigger becomes optional; presses inside it still count as inside a non-modal Popover. */
|
|
22
|
+
anchorRect?: AnchorSource;
|
|
23
|
+
trigger?: ReactNode | ((open: boolean) => ReactNode);
|
|
20
24
|
children: ReactNode | ((close: () => void) => ReactNode);
|
|
21
25
|
}
|
|
22
|
-
export declare function KjunPopover({ noPadding, open: controlled, onOpenChange, manualTrigger, matchTriggerWidth, maxHeight, flip, focusOnOpen, ariaLabel, placement, returnFocus, header, modal, trigger, children, }: KjunPopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare function KjunPopover({ noPadding, open: controlled, onOpenChange, manualTrigger, matchTriggerWidth, maxHeight, flip, focusOnOpen, ariaLabel, placement, returnFocus, header, modal, anchorRect, trigger, children, }: KjunPopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
23
27
|
export interface KjunTooltipProps {
|
|
24
28
|
content?: string;
|
|
29
|
+
/** A bolder line above content (a file name above its path). Read together with content. */
|
|
30
|
+
title?: string;
|
|
31
|
+
align?: "start" | "center";
|
|
32
|
+
/** Maximum width step (tooltip.maxWidths); default is md, the earlier width. */
|
|
33
|
+
width?: "sm" | "md" | "lg";
|
|
25
34
|
placement?: "top" | "bottom" | "left" | "right";
|
|
26
35
|
delay?: number;
|
|
27
36
|
/** Controlled visibility; omit to let hover and focus drive it. */
|
|
@@ -29,4 +38,4 @@ export interface KjunTooltipProps {
|
|
|
29
38
|
onOpenChange?: (open: boolean) => void;
|
|
30
39
|
children: ReactNode;
|
|
31
40
|
}
|
|
32
|
-
export declare function KjunTooltip({ content, placement, delay, open: controlled, onOpenChange, children, }: KjunTooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
export declare function KjunTooltip({ content, title, align, width, placement, delay, open: controlled, onOpenChange, children, }: KjunTooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type InputSize } from "@kjun-ui/tokens";
|
|
2
2
|
import { type ReactNode } from "react";
|
|
3
|
+
import { type FocusReturn } from "./floating-panel.cjs";
|
|
3
4
|
import { OptionValue, SelectOption } from "./select-options.cjs";
|
|
4
5
|
export interface KjunSelectProps<T extends SelectOption = SelectOption> {
|
|
5
6
|
value: OptionValue | OptionValue[] | null;
|
|
@@ -34,5 +35,7 @@ export interface KjunSelectProps<T extends SelectOption = SelectOption> {
|
|
|
34
35
|
/** Extra option fields searched after the label. */
|
|
35
36
|
searchKeys?: string[];
|
|
36
37
|
onClear?: () => void;
|
|
38
|
+
/** Where focus goes when the menu closes by choosing or Escape, instead of the trigger (e.g. an edited cell). Web only. */
|
|
39
|
+
returnFocus?: FocusReturn;
|
|
37
40
|
}
|
|
38
|
-
export declare function KjunSelect<T extends SelectOption = SelectOption>({ value, options, placeholder, ariaLabel, labelKey, id: triggerId, ariaDescribedBy, valueKey, size, disabled, searchable, open: controlled, loading, searchPlaceholder, optionPageSize, clearable, multiple, error, menuHeader, renderOption, renderSelected, onValueChange, onChange, onOpenChange, onSearch, onClear, filterFn, searchKeys, }: KjunSelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
export declare function KjunSelect<T extends SelectOption = SelectOption>({ value, options, placeholder, ariaLabel, labelKey, id: triggerId, ariaDescribedBy, valueKey, size, disabled, searchable, open: controlled, loading, searchPlaceholder, optionPageSize, clearable, multiple, error, menuHeader, renderOption, renderSelected, onValueChange, onChange, onOpenChange, onSearch, onClear, filterFn, searchKeys, returnFocus, }: KjunSelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type InputSize } from "@kjun-ui/tokens";
|
|
2
2
|
import { type ReactNode } from "react";
|
|
3
|
+
import { type FocusReturn } from "./floating-panel.js";
|
|
3
4
|
import { OptionValue, SelectOption } from "./select-options.js";
|
|
4
5
|
export interface KjunSelectProps<T extends SelectOption = SelectOption> {
|
|
5
6
|
value: OptionValue | OptionValue[] | null;
|
|
@@ -34,5 +35,7 @@ export interface KjunSelectProps<T extends SelectOption = SelectOption> {
|
|
|
34
35
|
/** Extra option fields searched after the label. */
|
|
35
36
|
searchKeys?: string[];
|
|
36
37
|
onClear?: () => void;
|
|
38
|
+
/** Where focus goes when the menu closes by choosing or Escape, instead of the trigger (e.g. an edited cell). Web only. */
|
|
39
|
+
returnFocus?: FocusReturn;
|
|
37
40
|
}
|
|
38
|
-
export declare function KjunSelect<T extends SelectOption = SelectOption>({ value, options, placeholder, ariaLabel, labelKey, id: triggerId, ariaDescribedBy, valueKey, size, disabled, searchable, open: controlled, loading, searchPlaceholder, optionPageSize, clearable, multiple, error, menuHeader, renderOption, renderSelected, onValueChange, onChange, onOpenChange, onSearch, onClear, filterFn, searchKeys, }: KjunSelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
export declare function KjunSelect<T extends SelectOption = SelectOption>({ value, options, placeholder, ariaLabel, labelKey, id: triggerId, ariaDescribedBy, valueKey, size, disabled, searchable, open: controlled, loading, searchPlaceholder, optionPageSize, clearable, multiple, error, menuHeader, renderOption, renderSelected, onValueChange, onChange, onOpenChange, onSearch, onClear, filterFn, searchKeys, returnFocus, }: KjunSelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** A screen (viewport) rectangle a popover attaches to instead of its trigger; width and height default to 0. */
|
|
2
|
+
export interface AnchorRect {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
width?: number;
|
|
6
|
+
height?: number;
|
|
7
|
+
}
|
|
8
|
+
export type AnchorSource = AnchorRect | (() => AnchorRect | null);
|
|
9
|
+
/** Keeps the anchor on its source while a popover is open: a value is placed once, a function is read every
|
|
10
|
+
* frame (a text cursor moves without scrolling). A function returning null keeps the last position. */
|
|
11
|
+
export declare function followAnchor(element: HTMLElement, source: () => AnchorSource | undefined, moved: () => void): () => void;
|
|
12
|
+
/** Inline style of the anchor element: fixed, invisible and ignoring the pointer. */
|
|
13
|
+
export declare const anchorStyle: {
|
|
14
|
+
readonly position: "fixed";
|
|
15
|
+
readonly pointerEvents: "none";
|
|
16
|
+
readonly visibility: "hidden";
|
|
17
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** A screen (viewport) rectangle a popover attaches to instead of its trigger; width and height default to 0. */
|
|
2
|
+
export interface AnchorRect {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
width?: number;
|
|
6
|
+
height?: number;
|
|
7
|
+
}
|
|
8
|
+
export type AnchorSource = AnchorRect | (() => AnchorRect | null);
|
|
9
|
+
/** Keeps the anchor on its source while a popover is open: a value is placed once, a function is read every
|
|
10
|
+
* frame (a text cursor moves without scrolling). A function returning null keeps the last position. */
|
|
11
|
+
export declare function followAnchor(element: HTMLElement, source: () => AnchorSource | undefined, moved: () => void): () => void;
|
|
12
|
+
/** Inline style of the anchor element: fixed, invisible and ignoring the pointer. */
|
|
13
|
+
export declare const anchorStyle: {
|
|
14
|
+
readonly position: "fixed";
|
|
15
|
+
readonly pointerEvents: "none";
|
|
16
|
+
readonly visibility: "hidden";
|
|
17
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Calls onAfterClose once when a layer leaves the screen (present true → false). A reopen during the exit keeps
|
|
2
|
+
* present true, so it reports nothing; a layer mounted closed reports nothing either. */
|
|
3
|
+
export declare function useAfterClose(present: boolean, onAfterClose?: () => void, enabled?: boolean): void;
|
|
4
|
+
/** Web overlays can outlive present by a render (react-aria finishes its exit first), so this reports when the
|
|
5
|
+
* overlay element itself leaves the DOM while closed. Attach the returned ref to the overlay. */
|
|
6
|
+
export declare function useAfterCloseRef(open: boolean, onAfterClose?: () => void): (node: Element | null) => void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Calls onAfterClose once when a layer leaves the screen (present true → false). A reopen during the exit keeps
|
|
2
|
+
* present true, so it reports nothing; a layer mounted closed reports nothing either. */
|
|
3
|
+
export declare function useAfterClose(present: boolean, onAfterClose?: () => void, enabled?: boolean): void;
|
|
4
|
+
/** Web overlays can outlive present by a render (react-aria finishes its exit first), so this reports when the
|
|
5
|
+
* overlay element itself leaves the DOM while closed. Attach the returned ref to the overlay. */
|
|
6
|
+
export declare function useAfterCloseRef(open: boolean, onAfterClose?: () => void): (node: Element | null) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kjun-ui/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"homepage": "https://ui.kjun.dev",
|
|
6
6
|
"repository": {
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"./package.json": "./package.json"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@kjun-ui/tokens": "0.
|
|
44
|
+
"@kjun-ui/tokens": "0.16.0",
|
|
45
45
|
"react-aria-components": "1.21.1",
|
|
46
|
-
"@kjun-ui/icons": "0.
|
|
46
|
+
"@kjun-ui/icons": "0.16.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"react": "^19.2.3",
|