@kjun-ui/react 0.15.0 → 0.17.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 +524 -408
- package/dist/index.js +644 -527
- package/dist/styles.css +99 -32
- package/dist/types/packages/react/src/app-navigation.d.cts +9 -3
- package/dist/types/packages/react/src/app-navigation.d.ts +9 -3
- package/dist/types/packages/react/src/controls.d.cts +3 -1
- package/dist/types/packages/react/src/controls.d.ts +3 -1
- package/dist/types/packages/react/src/display.d.cts +5 -2
- package/dist/types/packages/react/src/display.d.ts +5 -2
- package/dist/types/packages/react/src/floating-panel.d.cts +5 -1
- package/dist/types/packages/react/src/floating-panel.d.ts +5 -1
- package/dist/types/packages/react/src/kpi.d.cts +6 -2
- package/dist/types/packages/react/src/kpi.d.ts +6 -2
- package/dist/types/packages/react/src/list.d.cts +7 -2
- package/dist/types/packages/react/src/list.d.ts +7 -2
- package/dist/types/packages/react/src/media.d.cts +1 -1
- package/dist/types/packages/react/src/media.d.ts +1 -1
- package/dist/types/packages/react/src/navigation.d.cts +5 -1
- package/dist/types/packages/react/src/navigation.d.ts +5 -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/range-input.d.cts +4 -0
- package/dist/types/packages/react/src/range-input.d.ts +4 -0
- package/dist/types/shared/package-runtime/alert-exit.d.cts +5 -0
- package/dist/types/shared/package-runtime/alert-exit.d.ts +5 -0
- package/dist/types/shared/package-runtime/alert-tone.d.cts +11 -0
- package/dist/types/shared/package-runtime/alert-tone.d.ts +11 -0
- 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/drawer-geometry.d.cts +10 -4
- package/dist/types/shared/package-runtime/drawer-geometry.d.ts +10 -4
- package/dist/types/shared/package-runtime/progress-circle.d.cts +5 -0
- package/dist/types/shared/package-runtime/progress-circle.d.ts +5 -0
- package/package.json +3 -3
|
@@ -14,6 +14,10 @@ export interface KjunTabsProps {
|
|
|
14
14
|
variant?: "underline" | "pills";
|
|
15
15
|
actions?: ReactNode;
|
|
16
16
|
children?: ReactNode;
|
|
17
|
+
/** Keep the header inside its scroll container while the tab panels scroll. */
|
|
18
|
+
stickyHeader?: boolean;
|
|
19
|
+
/** Top gap of the sticky header: a number in px or a CSS length. */
|
|
20
|
+
stickyOffset?: number | string;
|
|
17
21
|
ariaLabel?: string;
|
|
18
22
|
onValueChange?: (value: string) => void;
|
|
19
23
|
onChange?: (value: string) => void;
|
|
@@ -24,7 +28,7 @@ export interface KjunTabsProps {
|
|
|
24
28
|
pointer: "mouse" | "touch";
|
|
25
29
|
}) => void;
|
|
26
30
|
}
|
|
27
|
-
export declare function KjunTabs({ value, items, density, variant, actions, children, ariaLabel, onValueChange, onChange, onTabMenu, }: KjunTabsProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export declare function KjunTabs({ value, items, density, variant, actions, children, stickyHeader, stickyOffset, ariaLabel, onValueChange, onChange, onTabMenu, }: KjunTabsProps): import("react/jsx-runtime").JSX.Element;
|
|
28
32
|
export interface KjunTabPaneProps extends TabItem {
|
|
29
33
|
children?: ReactNode;
|
|
30
34
|
}
|
|
@@ -14,6 +14,10 @@ export interface KjunTabsProps {
|
|
|
14
14
|
variant?: "underline" | "pills";
|
|
15
15
|
actions?: ReactNode;
|
|
16
16
|
children?: ReactNode;
|
|
17
|
+
/** Keep the header inside its scroll container while the tab panels scroll. */
|
|
18
|
+
stickyHeader?: boolean;
|
|
19
|
+
/** Top gap of the sticky header: a number in px or a CSS length. */
|
|
20
|
+
stickyOffset?: number | string;
|
|
17
21
|
ariaLabel?: string;
|
|
18
22
|
onValueChange?: (value: string) => void;
|
|
19
23
|
onChange?: (value: string) => void;
|
|
@@ -24,7 +28,7 @@ export interface KjunTabsProps {
|
|
|
24
28
|
pointer: "mouse" | "touch";
|
|
25
29
|
}) => void;
|
|
26
30
|
}
|
|
27
|
-
export declare function KjunTabs({ value, items, density, variant, actions, children, ariaLabel, onValueChange, onChange, onTabMenu, }: KjunTabsProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export declare function KjunTabs({ value, items, density, variant, actions, children, stickyHeader, stickyOffset, ariaLabel, onValueChange, onChange, onTabMenu, }: KjunTabsProps): import("react/jsx-runtime").JSX.Element;
|
|
28
32
|
export interface KjunTabPaneProps extends TabItem {
|
|
29
33
|
children?: ReactNode;
|
|
30
34
|
}
|
|
@@ -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;
|
|
@@ -6,6 +6,10 @@ export interface KjunSliderProps {
|
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
label?: string;
|
|
8
8
|
ariaLabel?: string;
|
|
9
|
+
/** Hides the visible value only; each thumb still reports its value to assistive technology. */
|
|
10
|
+
showValue?: boolean;
|
|
11
|
+
/** Formats the visible value and each thumb's accessible value text. Values stay numeric. */
|
|
12
|
+
formatValue?: (value: number) => string;
|
|
9
13
|
onValueChange?: (value: number) => void;
|
|
10
14
|
onChangeCommit?: (value: number) => void;
|
|
11
15
|
}
|
|
@@ -6,6 +6,10 @@ export interface KjunSliderProps {
|
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
label?: string;
|
|
8
8
|
ariaLabel?: string;
|
|
9
|
+
/** Hides the visible value only; each thumb still reports its value to assistive technology. */
|
|
10
|
+
showValue?: boolean;
|
|
11
|
+
/** Formats the visible value and each thumb's accessible value text. Values stay numeric. */
|
|
12
|
+
formatValue?: (value: number) => string;
|
|
9
13
|
onValueChange?: (value: number) => void;
|
|
10
14
|
onChangeCommit?: (value: number) => void;
|
|
11
15
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Collapses a dismissed web Alert's height and padding while it fades, so the content below slides up
|
|
3
|
+
* instead of jumping; `done` runs once it is gone. Reduced motion (or no Web Animations) finishes at once.
|
|
4
|
+
*/
|
|
5
|
+
export declare function collapseAlert(el: HTMLElement | null, reduced: boolean, done: () => void): void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Collapses a dismissed web Alert's height and padding while it fades, so the content below slides up
|
|
3
|
+
* instead of jumping; `done` runs once it is gone. Reduced motion (or no Web Animations) finishes at once.
|
|
4
|
+
*/
|
|
5
|
+
export declare function collapseAlert(el: HTMLElement | null, reduced: boolean, done: () => void): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Color roles a soft-fill Alert paints per tone. Info has no fill role: it uses a translucent text tint so it
|
|
3
|
+
* stays visible on any page background; the semantic tones carry the color, titles stay on the text role.
|
|
4
|
+
*/
|
|
5
|
+
export declare function alertToneRoles(tone: string): {
|
|
6
|
+
bg: string | null;
|
|
7
|
+
icon: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const alertIcons: Record<string, string>;
|
|
10
|
+
/** Native has no color-mix: tints a hex or rgb() color with alpha, or returns undefined for other formats. */
|
|
11
|
+
export declare function tintColor(color: string, alpha: number): string | undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Color roles a soft-fill Alert paints per tone. Info has no fill role: it uses a translucent text tint so it
|
|
3
|
+
* stays visible on any page background; the semantic tones carry the color, titles stay on the text role.
|
|
4
|
+
*/
|
|
5
|
+
export declare function alertToneRoles(tone: string): {
|
|
6
|
+
bg: string | null;
|
|
7
|
+
icon: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const alertIcons: Record<string, string>;
|
|
10
|
+
/** Native has no color-mix: tints a hex or rgb() color with alpha, or returns undefined for other formats. */
|
|
11
|
+
export declare function tintColor(color: string, alpha: number): string | undefined;
|
|
@@ -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
|
+
};
|
|
@@ -18,15 +18,21 @@ export interface DrawerFrame {
|
|
|
18
18
|
lift: number;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
|
-
* Keyboard events a drawer listens to.
|
|
22
|
-
*
|
|
21
|
+
* Keyboard events a drawer listens to. Android reports only after the keyboard moved; edge-to-edge
|
|
22
|
+
* windows no longer resize for it (adjustResize), so the drawer lifts itself there too.
|
|
23
23
|
*/
|
|
24
24
|
export declare function keyboardEvents(os: string): {
|
|
25
25
|
readonly show: "keyboardWillShow";
|
|
26
26
|
readonly hide: "keyboardWillHide";
|
|
27
|
+
} | {
|
|
28
|
+
readonly show: "keyboardDidShow";
|
|
29
|
+
readonly hide: "keyboardDidHide";
|
|
27
30
|
} | null;
|
|
28
|
-
/**
|
|
29
|
-
|
|
31
|
+
/**
|
|
32
|
+
* The part of the modal root the keyboard covers. Measured against the root, a window the platform
|
|
33
|
+
* already resized ends at or above the keyboard and gives 0, so the drawer never lifts twice.
|
|
34
|
+
*/
|
|
35
|
+
export declare function keyboardOverlap(rootHeight: number, keyboardScreenY: number): number;
|
|
30
36
|
export declare function drawerFrame({ position, windowHeight, safeAreaTop, safeAreaBottom, gap, keyboard, maxHeight }: DrawerFrameInput): DrawerFrame;
|
|
31
37
|
/** Web overlay variables read by the drawer CSS (tokens controls.css). */
|
|
32
38
|
export declare function drawerOverlayVars({ safeAreaTop, safeAreaBottom, maxHeight }: {
|
|
@@ -18,15 +18,21 @@ export interface DrawerFrame {
|
|
|
18
18
|
lift: number;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
|
-
* Keyboard events a drawer listens to.
|
|
22
|
-
*
|
|
21
|
+
* Keyboard events a drawer listens to. Android reports only after the keyboard moved; edge-to-edge
|
|
22
|
+
* windows no longer resize for it (adjustResize), so the drawer lifts itself there too.
|
|
23
23
|
*/
|
|
24
24
|
export declare function keyboardEvents(os: string): {
|
|
25
25
|
readonly show: "keyboardWillShow";
|
|
26
26
|
readonly hide: "keyboardWillHide";
|
|
27
|
+
} | {
|
|
28
|
+
readonly show: "keyboardDidShow";
|
|
29
|
+
readonly hide: "keyboardDidHide";
|
|
27
30
|
} | null;
|
|
28
|
-
/**
|
|
29
|
-
|
|
31
|
+
/**
|
|
32
|
+
* The part of the modal root the keyboard covers. Measured against the root, a window the platform
|
|
33
|
+
* already resized ends at or above the keyboard and gives 0, so the drawer never lifts twice.
|
|
34
|
+
*/
|
|
35
|
+
export declare function keyboardOverlap(rootHeight: number, keyboardScreenY: number): number;
|
|
30
36
|
export declare function drawerFrame({ position, windowHeight, safeAreaTop, safeAreaBottom, gap, keyboard, maxHeight }: DrawerFrameInput): DrawerFrame;
|
|
31
37
|
/** Web overlay variables read by the drawer CSS (tokens controls.css). */
|
|
32
38
|
export declare function drawerOverlayVars({ safeAreaTop, safeAreaBottom, maxHeight }: {
|
|
@@ -9,3 +9,8 @@ export declare function progressCircle(size: ProgressCircleSize, percentage: num
|
|
|
9
9
|
offset: number;
|
|
10
10
|
showsPercentage: boolean;
|
|
11
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* What a progress value means: indeterminate work wins, then a null, non-finite value or an invalid max is
|
|
14
|
+
* missing data (never 0%). An omitted value keeps the 0 default before it reaches here.
|
|
15
|
+
*/
|
|
16
|
+
export declare function progressState(value: number | null, max: number, indeterminate: boolean): "indeterminate" | "missing" | "determinate";
|
|
@@ -9,3 +9,8 @@ export declare function progressCircle(size: ProgressCircleSize, percentage: num
|
|
|
9
9
|
offset: number;
|
|
10
10
|
showsPercentage: boolean;
|
|
11
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* What a progress value means: indeterminate work wins, then a null, non-finite value or an invalid max is
|
|
14
|
+
* missing data (never 0%). An omitted value keeps the 0 default before it reaches here.
|
|
15
|
+
*/
|
|
16
|
+
export declare function progressState(value: number | null, max: number, indeterminate: boolean): "indeterminate" | "missing" | "determinate";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kjun-ui/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.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.17.0",
|
|
45
45
|
"react-aria-components": "1.21.1",
|
|
46
|
-
"@kjun-ui/icons": "0.
|
|
46
|
+
"@kjun-ui/icons": "0.17.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"react": "^19.2.3",
|