@kjun-ui/react 0.17.0 → 0.18.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 +3279 -1407
- package/dist/index.js +3226 -1353
- package/dist/styles.css +993 -191
- package/dist/types/packages/react/src/actions.d.cts +12 -3
- package/dist/types/packages/react/src/actions.d.ts +12 -3
- package/dist/types/packages/react/src/app-navigation.d.cts +22 -3
- package/dist/types/packages/react/src/app-navigation.d.ts +22 -3
- package/dist/types/packages/react/src/calendar.d.cts +30 -0
- package/dist/types/packages/react/src/calendar.d.ts +30 -0
- package/dist/types/packages/react/src/carousel.d.cts +39 -0
- package/dist/types/packages/react/src/carousel.d.ts +39 -0
- package/dist/types/packages/react/src/controls.d.cts +16 -11
- package/dist/types/packages/react/src/controls.d.ts +16 -11
- package/dist/types/packages/react/src/date-picker.d.cts +34 -6
- package/dist/types/packages/react/src/date-picker.d.ts +34 -6
- package/dist/types/packages/react/src/display.d.cts +7 -1
- package/dist/types/packages/react/src/display.d.ts +7 -1
- package/dist/types/packages/react/src/dropdown.d.cts +35 -3
- package/dist/types/packages/react/src/dropdown.d.ts +35 -3
- package/dist/types/packages/react/src/financial-display.d.cts +10 -1
- package/dist/types/packages/react/src/financial-display.d.ts +10 -1
- package/dist/types/packages/react/src/financial.d.cts +2 -2
- package/dist/types/packages/react/src/financial.d.ts +2 -2
- package/dist/types/packages/react/src/index.d.cts +8 -6
- package/dist/types/packages/react/src/index.d.ts +8 -6
- package/dist/types/packages/react/src/layers.d.cts +1 -1
- package/dist/types/packages/react/src/layers.d.ts +1 -1
- package/dist/types/packages/react/src/list.d.cts +27 -4
- package/dist/types/packages/react/src/list.d.ts +27 -4
- package/dist/types/packages/react/src/market-model.d.cts +8 -1
- package/dist/types/packages/react/src/market-model.d.ts +8 -1
- package/dist/types/packages/react/src/navigation.d.cts +24 -42
- package/dist/types/packages/react/src/navigation.d.ts +24 -42
- package/dist/types/packages/react/src/number-display.d.cts +12 -12
- package/dist/types/packages/react/src/number-display.d.ts +12 -12
- package/dist/types/packages/react/src/popover.d.cts +9 -4
- package/dist/types/packages/react/src/popover.d.ts +9 -4
- package/dist/types/packages/react/src/select-control.d.cts +3 -1
- package/dist/types/packages/react/src/select-control.d.ts +3 -1
- package/dist/types/packages/react/src/select.d.cts +2 -2
- package/dist/types/packages/react/src/select.d.ts +2 -2
- package/dist/types/packages/react/src/table-cards.d.cts +1 -1
- package/dist/types/packages/react/src/table-cards.d.ts +1 -1
- package/dist/types/packages/react/src/table-grid.d.cts +1 -1
- package/dist/types/packages/react/src/table-grid.d.ts +1 -1
- package/dist/types/packages/react/src/table-list.d.cts +14 -0
- package/dist/types/packages/react/src/table-list.d.ts +14 -0
- package/dist/types/packages/react/src/table-model.d.cts +1 -0
- package/dist/types/packages/react/src/table-model.d.ts +1 -0
- package/dist/types/packages/react/src/table-toolbar.d.cts +1 -1
- package/dist/types/packages/react/src/table-toolbar.d.ts +1 -1
- package/dist/types/packages/react/src/tabs.d.cts +38 -0
- package/dist/types/packages/react/src/tabs.d.ts +38 -0
- package/dist/types/packages/react/src/textarea.d.cts +29 -0
- package/dist/types/packages/react/src/textarea.d.ts +29 -0
- package/dist/types/packages/react/src/time-picker.d.cts +10 -1
- package/dist/types/packages/react/src/time-picker.d.ts +10 -1
- package/dist/types/shared/package-runtime/accordion-state.d.cts +11 -0
- package/dist/types/shared/package-runtime/accordion-state.d.ts +11 -0
- package/dist/types/shared/package-runtime/action-size.d.cts +1 -1
- package/dist/types/shared/package-runtime/action-size.d.ts +1 -1
- package/dist/types/shared/package-runtime/alert-action-size.d.cts +2 -0
- package/dist/types/shared/package-runtime/alert-action-size.d.ts +2 -0
- package/dist/types/shared/package-runtime/badge-tone.d.cts +59 -0
- package/dist/types/shared/package-runtime/badge-tone.d.ts +59 -0
- package/dist/types/shared/package-runtime/breadcrumb.d.cts +20 -0
- package/dist/types/shared/package-runtime/breadcrumb.d.ts +20 -0
- package/dist/types/shared/package-runtime/calendar.d.cts +106 -0
- package/dist/types/shared/package-runtime/calendar.d.ts +106 -0
- package/dist/types/shared/package-runtime/carousel-scroll.d.cts +22 -0
- package/dist/types/shared/package-runtime/carousel-scroll.d.ts +22 -0
- package/dist/types/shared/package-runtime/carousel.d.cts +47 -0
- package/dist/types/shared/package-runtime/carousel.d.ts +47 -0
- package/dist/types/shared/package-runtime/center-option.d.cts +1 -0
- package/dist/types/shared/package-runtime/center-option.d.ts +1 -0
- package/dist/types/shared/package-runtime/list-row.d.cts +14 -0
- package/dist/types/shared/package-runtime/list-row.d.ts +14 -0
- package/dist/types/shared/package-runtime/messages/ko.d.cts +38 -5
- package/dist/types/shared/package-runtime/messages/ko.d.ts +38 -5
- package/dist/types/shared/package-runtime/messages-context.d.cts +38 -5
- package/dist/types/shared/package-runtime/messages-context.d.ts +38 -5
- package/dist/types/shared/package-runtime/navigation-badge.d.cts +12 -0
- package/dist/types/shared/package-runtime/navigation-badge.d.ts +12 -0
- package/dist/types/shared/package-runtime/navigation.d.cts +1 -1
- package/dist/types/shared/package-runtime/navigation.d.ts +1 -1
- package/dist/types/shared/package-runtime/scroll-fade.d.cts +25 -0
- package/dist/types/shared/package-runtime/scroll-fade.d.ts +25 -0
- package/dist/types/shared/package-runtime/sparkline.d.cts +58 -0
- package/dist/types/shared/package-runtime/sparkline.d.ts +58 -0
- package/dist/types/shared/package-runtime/table-groups.d.cts +11 -0
- package/dist/types/shared/package-runtime/table-groups.d.ts +11 -0
- package/dist/types/shared/package-runtime/table-model.d.cts +25 -2
- package/dist/types/shared/package-runtime/table-model.d.ts +25 -2
- package/dist/types/shared/package-runtime/table-presentation.d.cts +30 -4
- package/dist/types/shared/package-runtime/table-presentation.d.ts +30 -4
- package/dist/types/shared/package-runtime/table.d.cts +18 -2
- package/dist/types/shared/package-runtime/table.d.ts +18 -2
- package/dist/types/shared/package-runtime/textarea-grow.d.cts +1 -0
- package/dist/types/shared/package-runtime/textarea-grow.d.ts +1 -0
- package/dist/types/shared/package-runtime/textarea.d.cts +53 -0
- package/dist/types/shared/package-runtime/textarea.d.ts +53 -0
- package/dist/types/shared/package-runtime/time-segments.d.cts +25 -0
- package/dist/types/shared/package-runtime/time-segments.d.ts +25 -0
- package/package.json +3 -3
- package/dist/types/shared/package-runtime/relative-time.d.cts +0 -1
- package/dist/types/shared/package-runtime/relative-time.d.ts +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
1
2
|
export declare const finiteNumber: (value: unknown) => number | null;
|
|
2
3
|
export declare const format: (value: number, decimals?: number) => string;
|
|
3
4
|
export declare function useCountUp(value: number | string, animated: boolean, fromPrevious: boolean): string | number;
|
|
@@ -12,21 +13,21 @@ export interface KjunAnimatedNumberProps {
|
|
|
12
13
|
className?: string;
|
|
13
14
|
}
|
|
14
15
|
export declare function KjunAnimatedNumber({ value, decimals, prefix, suffix, animated, fromPrevious, formatter, className, }: KjunAnimatedNumberProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
export declare function KjunFreshness({ stale, source, fetchedAt, formatter, }: KjunFreshnessProps): import("react/jsx-runtime").JSX.Element | null;
|
|
22
|
-
export interface KjunPriceCellProps extends Omit<KjunFreshnessProps, "formatter"> {
|
|
16
|
+
/** The status slot after a price; nothing when the app gives no status. */
|
|
17
|
+
export declare function PriceStatus({ status }: {
|
|
18
|
+
status?: ReactNode;
|
|
19
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
20
|
+
export interface KjunPriceCellProps {
|
|
23
21
|
value?: number | null;
|
|
24
22
|
formatter?: (value: number) => string;
|
|
23
|
+
stale?: boolean;
|
|
24
|
+
/** The app's status after the price, such as a KjunBadge; KJUN owns only its spacing and alignment.
|
|
25
|
+
* With no price (value null) a status still shows after a dash, for states such as "거래정지"; without one null is loading. */
|
|
26
|
+
status?: ReactNode;
|
|
25
27
|
flashClass?: string;
|
|
26
28
|
fromPrevious?: boolean;
|
|
27
|
-
showFreshness?: boolean;
|
|
28
29
|
}
|
|
29
|
-
export declare function KjunPriceCell({ value, formatter, stale,
|
|
30
|
+
export declare function KjunPriceCell({ value, formatter, stale, status, flashClass, fromPrevious, }: KjunPriceCellProps): import("react/jsx-runtime").JSX.Element;
|
|
30
31
|
export interface KjunSignedValueProps {
|
|
31
32
|
value?: number | string | null;
|
|
32
33
|
format?: "number" | "percent";
|
|
@@ -38,7 +39,6 @@ export interface KjunSignedValueProps {
|
|
|
38
39
|
tone?: "plain" | "pill";
|
|
39
40
|
loading?: boolean;
|
|
40
41
|
stale?: boolean;
|
|
41
|
-
showFreshness?: boolean;
|
|
42
42
|
formatter?: (value: number) => string;
|
|
43
43
|
}
|
|
44
|
-
export declare function KjunSignedValue({ value, format: kind, isRaw, decimals, prefix, suffix, showSign, tone, loading, stale,
|
|
44
|
+
export declare function KjunSignedValue({ value, format: kind, isRaw, decimals, prefix, suffix, showSign, tone, loading, stale, formatter, }: KjunSignedValueProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,15 +6,19 @@ export interface KjunPopoverProps {
|
|
|
6
6
|
onOpenChange?: (v: boolean) => void;
|
|
7
7
|
manualTrigger?: boolean;
|
|
8
8
|
matchTriggerWidth?: boolean;
|
|
9
|
+
/** Width step (popover.widths): sm 192, md 240 (default), lg 320. matchTriggerWidth takes the trigger's width instead. */
|
|
10
|
+
width?: "sm" | "md" | "lg";
|
|
9
11
|
maxHeight?: CSSProperties["maxHeight"];
|
|
10
12
|
flip?: boolean;
|
|
11
13
|
focusOnOpen?: boolean;
|
|
12
14
|
ariaLabel?: string;
|
|
13
|
-
|
|
15
|
+
/** A side, or a side with an aligned edge: "bottom-start" lines the panel up with the trigger's start edge. */
|
|
16
|
+
placement?: PopoverPlacement;
|
|
14
17
|
/** Where focus goes when the Popover closes. Defaults to the trigger, also when the target is gone. */
|
|
15
18
|
returnFocus?: HTMLElement | RefObject<HTMLElement | null> | (() => HTMLElement | null);
|
|
16
|
-
/** Fixed header above the body; only the body scrolls and maxHeight covers both. Names the dialog without ariaLabel.
|
|
17
|
-
|
|
19
|
+
/** Fixed header above the body; only the body scrolls and maxHeight covers both. Names the dialog without ariaLabel.
|
|
20
|
+
* A function receives close, for a close button in the header. */
|
|
21
|
+
header?: ReactNode | ((close: () => void) => ReactNode);
|
|
18
22
|
/** false keeps the page usable: Tab can leave, and an outside press or focus move closes without returning focus. */
|
|
19
23
|
modal?: boolean;
|
|
20
24
|
/** Attach to this screen rectangle (or a function read every frame while open) instead of the trigger. Web only.
|
|
@@ -23,7 +27,8 @@ export interface KjunPopoverProps {
|
|
|
23
27
|
trigger?: ReactNode | ((open: boolean) => ReactNode);
|
|
24
28
|
children: ReactNode | ((close: () => void) => ReactNode);
|
|
25
29
|
}
|
|
26
|
-
export
|
|
30
|
+
export type PopoverPlacement = "top" | "bottom" | "left" | "right" | "top-start" | "top-end" | "bottom-start" | "bottom-end";
|
|
31
|
+
export declare function KjunPopover({ noPadding, open: controlled, onOpenChange, manualTrigger, matchTriggerWidth, width, maxHeight, flip, focusOnOpen, ariaLabel, placement, returnFocus, header, modal, anchorRect, trigger, children, }: KjunPopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
27
32
|
export interface KjunTooltipProps {
|
|
28
33
|
content?: string;
|
|
29
34
|
/** A bolder line above content (a file name above its path). Read together with content. */
|
|
@@ -6,15 +6,19 @@ export interface KjunPopoverProps {
|
|
|
6
6
|
onOpenChange?: (v: boolean) => void;
|
|
7
7
|
manualTrigger?: boolean;
|
|
8
8
|
matchTriggerWidth?: boolean;
|
|
9
|
+
/** Width step (popover.widths): sm 192, md 240 (default), lg 320. matchTriggerWidth takes the trigger's width instead. */
|
|
10
|
+
width?: "sm" | "md" | "lg";
|
|
9
11
|
maxHeight?: CSSProperties["maxHeight"];
|
|
10
12
|
flip?: boolean;
|
|
11
13
|
focusOnOpen?: boolean;
|
|
12
14
|
ariaLabel?: string;
|
|
13
|
-
|
|
15
|
+
/** A side, or a side with an aligned edge: "bottom-start" lines the panel up with the trigger's start edge. */
|
|
16
|
+
placement?: PopoverPlacement;
|
|
14
17
|
/** Where focus goes when the Popover closes. Defaults to the trigger, also when the target is gone. */
|
|
15
18
|
returnFocus?: HTMLElement | RefObject<HTMLElement | null> | (() => HTMLElement | null);
|
|
16
|
-
/** Fixed header above the body; only the body scrolls and maxHeight covers both. Names the dialog without ariaLabel.
|
|
17
|
-
|
|
19
|
+
/** Fixed header above the body; only the body scrolls and maxHeight covers both. Names the dialog without ariaLabel.
|
|
20
|
+
* A function receives close, for a close button in the header. */
|
|
21
|
+
header?: ReactNode | ((close: () => void) => ReactNode);
|
|
18
22
|
/** false keeps the page usable: Tab can leave, and an outside press or focus move closes without returning focus. */
|
|
19
23
|
modal?: boolean;
|
|
20
24
|
/** Attach to this screen rectangle (or a function read every frame while open) instead of the trigger. Web only.
|
|
@@ -23,7 +27,8 @@ export interface KjunPopoverProps {
|
|
|
23
27
|
trigger?: ReactNode | ((open: boolean) => ReactNode);
|
|
24
28
|
children: ReactNode | ((close: () => void) => ReactNode);
|
|
25
29
|
}
|
|
26
|
-
export
|
|
30
|
+
export type PopoverPlacement = "top" | "bottom" | "left" | "right" | "top-start" | "top-end" | "bottom-start" | "bottom-end";
|
|
31
|
+
export declare function KjunPopover({ noPadding, open: controlled, onOpenChange, manualTrigger, matchTriggerWidth, width, maxHeight, flip, focusOnOpen, ariaLabel, placement, returnFocus, header, modal, anchorRect, trigger, children, }: KjunPopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
27
32
|
export interface KjunTooltipProps {
|
|
28
33
|
content?: string;
|
|
29
34
|
/** A bolder line above content (a file name above its path). Read together with content. */
|
|
@@ -15,6 +15,8 @@ export interface KjunSelectProps<T extends SelectOption = SelectOption> {
|
|
|
15
15
|
valueKey?: string;
|
|
16
16
|
size?: InputSize;
|
|
17
17
|
disabled?: boolean;
|
|
18
|
+
/** Shows the value without opening the list or clearing it. */
|
|
19
|
+
readOnly?: boolean;
|
|
18
20
|
searchable?: boolean;
|
|
19
21
|
open?: boolean;
|
|
20
22
|
loading?: boolean;
|
|
@@ -38,4 +40,4 @@ export interface KjunSelectProps<T extends SelectOption = SelectOption> {
|
|
|
38
40
|
/** Where focus goes when the menu closes by choosing or Escape, instead of the trigger (e.g. an edited cell). Web only. */
|
|
39
41
|
returnFocus?: FocusReturn;
|
|
40
42
|
}
|
|
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;
|
|
43
|
+
export declare function KjunSelect<T extends SelectOption = SelectOption>({ value, options, placeholder, ariaLabel, labelKey, id: triggerId, ariaDescribedBy, valueKey, size, disabled, readOnly, 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;
|
|
@@ -15,6 +15,8 @@ export interface KjunSelectProps<T extends SelectOption = SelectOption> {
|
|
|
15
15
|
valueKey?: string;
|
|
16
16
|
size?: InputSize;
|
|
17
17
|
disabled?: boolean;
|
|
18
|
+
/** Shows the value without opening the list or clearing it. */
|
|
19
|
+
readOnly?: boolean;
|
|
18
20
|
searchable?: boolean;
|
|
19
21
|
open?: boolean;
|
|
20
22
|
loading?: boolean;
|
|
@@ -38,4 +40,4 @@ export interface KjunSelectProps<T extends SelectOption = SelectOption> {
|
|
|
38
40
|
/** Where focus goes when the menu closes by choosing or Escape, instead of the trigger (e.g. an edited cell). Web only. */
|
|
39
41
|
returnFocus?: FocusReturn;
|
|
40
42
|
}
|
|
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;
|
|
43
|
+
export declare function KjunSelect<T extends SelectOption = SelectOption>({ value, options, placeholder, ariaLabel, labelKey, id: triggerId, ariaDescribedBy, valueKey, size, disabled, readOnly, 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,7 +1,7 @@
|
|
|
1
1
|
export { KjunCombobox } from "./combobox.cjs";
|
|
2
2
|
export type { KjunComboboxProps } from "./combobox.cjs";
|
|
3
|
-
export { KjunDatePicker } from "./date-picker.cjs";
|
|
4
|
-
export type { KjunDatePickerProps } from "./date-picker.cjs";
|
|
3
|
+
export { KjunDatePicker, KjunDateRangePicker } from "./date-picker.cjs";
|
|
4
|
+
export type { KjunDatePickerProps, KjunDateRangePickerProps, DateRange, DateRangePreset } from "./date-picker.cjs";
|
|
5
5
|
export { KjunSearchInput } from "./search-input.cjs";
|
|
6
6
|
export type { KjunSearchInputProps } from "./search-input.cjs";
|
|
7
7
|
export { KjunSelect } from "./select-control.cjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { KjunCombobox } from "./combobox.js";
|
|
2
2
|
export type { KjunComboboxProps } from "./combobox.js";
|
|
3
|
-
export { KjunDatePicker } from "./date-picker.js";
|
|
4
|
-
export type { KjunDatePickerProps } from "./date-picker.js";
|
|
3
|
+
export { KjunDatePicker, KjunDateRangePicker } from "./date-picker.js";
|
|
4
|
+
export type { KjunDatePickerProps, KjunDateRangePickerProps, DateRange, DateRangePreset } from "./date-picker.js";
|
|
5
5
|
export { KjunSearchInput } from "./search-input.js";
|
|
6
6
|
export type { KjunSearchInputProps } from "./search-input.js";
|
|
7
7
|
export { KjunSelect } from "./select-control.js";
|
|
@@ -5,5 +5,5 @@ interface Props<Row extends object> extends TableCardsProps<Row> {
|
|
|
5
5
|
customClass: (row: Row, index: number) => string;
|
|
6
6
|
rowKeyDown: (event: KeyboardEvent<HTMLElement>, row: Row, index: number) => void;
|
|
7
7
|
}
|
|
8
|
-
export declare function TableCards<Row extends object>({ initialLoading, skeletonRows, skeletonHidden, state, onRowClick, selectable, checkbox, cell, expandable, expand, renderExpand, emptyContent, emptyText, layout, ariaLabel, customClass, rowKeyDown }: Props<Row>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function TableCards<Row extends object>({ initialLoading, skeletonRows, skeletonHidden, state, onRowClick, selectable, checkbox, cell, expandable, expand, renderExpand, emptyContent, emptyText, layout, ariaLabel, customClass, rowKeyDown, totals }: Props<Row>): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -5,5 +5,5 @@ interface Props<Row extends object> extends TableCardsProps<Row> {
|
|
|
5
5
|
customClass: (row: Row, index: number) => string;
|
|
6
6
|
rowKeyDown: (event: KeyboardEvent<HTMLElement>, row: Row, index: number) => void;
|
|
7
7
|
}
|
|
8
|
-
export declare function TableCards<Row extends object>({ initialLoading, skeletonRows, skeletonHidden, state, onRowClick, selectable, checkbox, cell, expandable, expand, renderExpand, emptyContent, emptyText, layout, ariaLabel, customClass, rowKeyDown }: Props<Row>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function TableCards<Row extends object>({ initialLoading, skeletonRows, skeletonHidden, state, onRowClick, selectable, checkbox, cell, expandable, expand, renderExpand, emptyContent, emptyText, layout, ariaLabel, customClass, rowKeyDown, totals }: Props<Row>): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -5,5 +5,5 @@ interface Props<Row extends object> extends TableGridProps<Row, CSSProperties["m
|
|
|
5
5
|
customClass: (row: Row, index: number) => string;
|
|
6
6
|
rowKeyDown: (event: KeyboardEvent<HTMLElement>, row: Row, index: number) => void;
|
|
7
7
|
}
|
|
8
|
-
export declare function TableGrid<Row extends object>({ initialLoading, skeletonRows, skeletonHidden, state, onRowClick, selectable, checkbox, cell, expandable, expand, renderExpand, emptyContent, emptyText, visible, maxHeight, stickyHeader, sortable, compact, striped, hoverable, ariaLabel, customClass, rowKeyDown }: Props<Row>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function TableGrid<Row extends object>({ initialLoading, skeletonRows, skeletonHidden, state, onRowClick, selectable, checkbox, cell, expandable, expand, renderExpand, emptyContent, emptyText, visible, maxHeight, stickyHeader, sortable, compact, striped, hoverable, ariaLabel, customClass, rowKeyDown, groups, collapsed, toggleGroup, groupLabel, summary, stickyOffset }: Props<Row>): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -5,5 +5,5 @@ interface Props<Row extends object> extends TableGridProps<Row, CSSProperties["m
|
|
|
5
5
|
customClass: (row: Row, index: number) => string;
|
|
6
6
|
rowKeyDown: (event: KeyboardEvent<HTMLElement>, row: Row, index: number) => void;
|
|
7
7
|
}
|
|
8
|
-
export declare function TableGrid<Row extends object>({ initialLoading, skeletonRows, skeletonHidden, state, onRowClick, selectable, checkbox, cell, expandable, expand, renderExpand, emptyContent, emptyText, visible, maxHeight, stickyHeader, sortable, compact, striped, hoverable, ariaLabel, customClass, rowKeyDown }: Props<Row>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function TableGrid<Row extends object>({ initialLoading, skeletonRows, skeletonHidden, state, onRowClick, selectable, checkbox, cell, expandable, expand, renderExpand, emptyContent, emptyText, visible, maxHeight, stickyHeader, sortable, compact, striped, hoverable, ariaLabel, customClass, rowKeyDown, groups, collapsed, toggleGroup, groupLabel, summary, stickyOffset }: Props<Row>): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { KeyboardEvent } from "react";
|
|
2
|
+
import type { TableCardsProps, TableTotal } from "../../../shared/package-runtime/table-presentation.cjs";
|
|
3
|
+
interface Props<Row extends object> extends TableCardsProps<Row> {
|
|
4
|
+
ariaLabel: string;
|
|
5
|
+
customClass: (row: Row, index: number) => string;
|
|
6
|
+
rowKeyDown: (event: KeyboardEvent<HTMLElement>, row: Row, index: number) => void;
|
|
7
|
+
}
|
|
8
|
+
/** responsive="list": no header row; each row is a title over one meta line with its value and badges at the end. */
|
|
9
|
+
export declare function TableList<Row extends object>({ initialLoading, skeletonRows, skeletonHidden, state, onRowClick, selectable, checkbox, cell, expandable, expand, renderExpand, emptyContent, emptyText, layout, ariaLabel, customClass, rowKeyDown, totals }: Props<Row>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
/** The summary on narrow layouts: one closing block with each summarized column's total. */
|
|
11
|
+
export declare function TableTotals({ totals }: {
|
|
12
|
+
totals?: TableTotal[];
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { KeyboardEvent } from "react";
|
|
2
|
+
import type { TableCardsProps, TableTotal } from "../../../shared/package-runtime/table-presentation.js";
|
|
3
|
+
interface Props<Row extends object> extends TableCardsProps<Row> {
|
|
4
|
+
ariaLabel: string;
|
|
5
|
+
customClass: (row: Row, index: number) => string;
|
|
6
|
+
rowKeyDown: (event: KeyboardEvent<HTMLElement>, row: Row, index: number) => void;
|
|
7
|
+
}
|
|
8
|
+
/** responsive="list": no header row; each row is a title over one meta line with its value and badges at the end. */
|
|
9
|
+
export declare function TableList<Row extends object>({ initialLoading, skeletonRows, skeletonHidden, state, onRowClick, selectable, checkbox, cell, expandable, expand, renderExpand, emptyContent, emptyText, layout, ariaLabel, customClass, rowKeyDown, totals }: Props<Row>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
/** The summary on narrow layouts: one closing block with each summarized column's total. */
|
|
11
|
+
export declare function TableTotals({ totals }: {
|
|
12
|
+
totals?: TableTotal[];
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
14
|
+
export {};
|
|
@@ -6,6 +6,7 @@ export interface KjunTableProps<Row extends object = Record<string, unknown>> ex
|
|
|
6
6
|
}
|
|
7
7
|
export declare function useTableModel<Row extends object>(props: KjunTableProps<Row>): {
|
|
8
8
|
rows: Row[];
|
|
9
|
+
rowIndex: (row: Row) => number;
|
|
9
10
|
key: (row: Row, index?: number) => string | number;
|
|
10
11
|
sort: import("@kjun-ui/tokens").TableSort;
|
|
11
12
|
search: string;
|
|
@@ -6,6 +6,7 @@ export interface KjunTableProps<Row extends object = Record<string, unknown>> ex
|
|
|
6
6
|
}
|
|
7
7
|
export declare function useTableModel<Row extends object>(props: KjunTableProps<Row>): {
|
|
8
8
|
rows: Row[];
|
|
9
|
+
rowIndex: (row: Row) => number;
|
|
9
10
|
key: (row: Row, index?: number) => string | number;
|
|
10
11
|
sort: import("@kjun-ui/tokens").TableSort;
|
|
11
12
|
search: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { TableToolbarProps } from "../../../shared/package-runtime/table-presentation.cjs";
|
|
2
|
-
export declare function TableToolbar<Row extends object>({ selectable, selected, toggleAll, clearSelection, renderSelectionToolbar, searchable, search, searchChange, searchPlaceholder, toolbar }: TableToolbarProps<Row>): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function TableToolbar<Row extends object>({ selectable, selected, allSelected, toggleAll, clearSelection, renderSelectionToolbar, searchable, search, searchChange, searchPlaceholder, toolbar }: TableToolbarProps<Row>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { TableToolbarProps } from "../../../shared/package-runtime/table-presentation.js";
|
|
2
|
-
export declare function TableToolbar<Row extends object>({ selectable, selected, toggleAll, clearSelection, renderSelectionToolbar, searchable, search, searchChange, searchPlaceholder, toolbar }: TableToolbarProps<Row>): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function TableToolbar<Row extends object>({ selectable, selected, allSelected, toggleAll, clearSelection, renderSelectionToolbar, searchable, search, searchChange, searchPlaceholder, toolbar }: TableToolbarProps<Row>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface TabItem {
|
|
3
|
+
name: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: string;
|
|
6
|
+
/** A count or short text after the label; numbers over 99 show 99+, and 0 or "" draws nothing. */
|
|
7
|
+
badge?: string | number;
|
|
8
|
+
badgeVariant?: "default" | "secondary" | "primary" | "danger" | "success" | "warning" | "info";
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface KjunTabsProps {
|
|
12
|
+
value: string;
|
|
13
|
+
items?: TabItem[];
|
|
14
|
+
density?: "comfortable" | "compact";
|
|
15
|
+
variant?: "underline" | "pills";
|
|
16
|
+
/** Tabs share the row equally; an underline then spans the whole tab. */
|
|
17
|
+
fullWidth?: boolean;
|
|
18
|
+
actions?: ReactNode;
|
|
19
|
+
children?: ReactNode;
|
|
20
|
+
/** Keep the header inside its scroll container while the tab panels scroll. */
|
|
21
|
+
stickyHeader?: boolean;
|
|
22
|
+
/** Top gap of the sticky header: a number in px or a CSS length. */
|
|
23
|
+
stickyOffset?: number | string;
|
|
24
|
+
ariaLabel?: string;
|
|
25
|
+
onValueChange?: (value: string) => void;
|
|
26
|
+
onChange?: (value: string) => void;
|
|
27
|
+
onTabMenu?: (event: {
|
|
28
|
+
name: string;
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
pointer: "mouse" | "touch";
|
|
32
|
+
}) => void;
|
|
33
|
+
}
|
|
34
|
+
export declare function KjunTabs({ value, items, density, variant, fullWidth, actions, children, stickyHeader, stickyOffset, ariaLabel, onValueChange, onChange, onTabMenu, }: KjunTabsProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export interface KjunTabPaneProps extends TabItem {
|
|
36
|
+
children?: ReactNode;
|
|
37
|
+
}
|
|
38
|
+
export declare function KjunTabPane({ name, children }: KjunTabPaneProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface TabItem {
|
|
3
|
+
name: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: string;
|
|
6
|
+
/** A count or short text after the label; numbers over 99 show 99+, and 0 or "" draws nothing. */
|
|
7
|
+
badge?: string | number;
|
|
8
|
+
badgeVariant?: "default" | "secondary" | "primary" | "danger" | "success" | "warning" | "info";
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface KjunTabsProps {
|
|
12
|
+
value: string;
|
|
13
|
+
items?: TabItem[];
|
|
14
|
+
density?: "comfortable" | "compact";
|
|
15
|
+
variant?: "underline" | "pills";
|
|
16
|
+
/** Tabs share the row equally; an underline then spans the whole tab. */
|
|
17
|
+
fullWidth?: boolean;
|
|
18
|
+
actions?: ReactNode;
|
|
19
|
+
children?: ReactNode;
|
|
20
|
+
/** Keep the header inside its scroll container while the tab panels scroll. */
|
|
21
|
+
stickyHeader?: boolean;
|
|
22
|
+
/** Top gap of the sticky header: a number in px or a CSS length. */
|
|
23
|
+
stickyOffset?: number | string;
|
|
24
|
+
ariaLabel?: string;
|
|
25
|
+
onValueChange?: (value: string) => void;
|
|
26
|
+
onChange?: (value: string) => void;
|
|
27
|
+
onTabMenu?: (event: {
|
|
28
|
+
name: string;
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
pointer: "mouse" | "touch";
|
|
32
|
+
}) => void;
|
|
33
|
+
}
|
|
34
|
+
export declare function KjunTabs({ value, items, density, variant, fullWidth, actions, children, stickyHeader, stickyOffset, ariaLabel, onValueChange, onChange, onTabMenu, }: KjunTabsProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export interface KjunTabPaneProps extends TabItem {
|
|
36
|
+
children?: ReactNode;
|
|
37
|
+
}
|
|
38
|
+
export declare function KjunTabPane({ name, children }: KjunTabPaneProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type TextareaSubmitKey } from "../../../shared/package-runtime/textarea.cjs";
|
|
2
|
+
import { type InputSize } from "@kjun-ui/tokens";
|
|
3
|
+
import { type ReactNode, type TextareaHTMLAttributes } from "react";
|
|
4
|
+
export interface KjunTextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "size" | "value" | "onSubmit"> {
|
|
5
|
+
value: string;
|
|
6
|
+
size?: InputSize;
|
|
7
|
+
error?: boolean;
|
|
8
|
+
/** Manual resizing (default "none"). A field the user can drag taller keeps that height instead of growing with its text. */
|
|
9
|
+
resize?: "none" | "vertical" | "horizontal" | "both";
|
|
10
|
+
ariaLabel?: string;
|
|
11
|
+
/** The field grows with its text from rows up to maxRows, then scrolls (default 6; rows keeps it fixed). */
|
|
12
|
+
maxRows?: number;
|
|
13
|
+
/** Character limit (UTF-16 units, like the attribute); the count shows "length/maxLength" and a longer value reads as an error. */
|
|
14
|
+
maxLength?: number;
|
|
15
|
+
/** Shows the character count inside the field, as "length/maxLength" when maxLength is set. */
|
|
16
|
+
showCount?: boolean;
|
|
17
|
+
/** Composer: controls at the start of the bar inside the field (attach, mention). */
|
|
18
|
+
actions?: ReactNode;
|
|
19
|
+
/** Composer: shows a submit button at the end of the bar, named by this label. */
|
|
20
|
+
submitLabel?: string;
|
|
21
|
+
/** Sends the text: the submit button or the submit key, while there is text within maxLength and nothing is sending. */
|
|
22
|
+
onSubmit?: (value: string) => void;
|
|
23
|
+
/** "mod-enter" (default) sends on Ctrl/⌘+Enter; "enter" sends on Enter, and Shift+Enter starts a new line. */
|
|
24
|
+
submitOn?: TextareaSubmitKey;
|
|
25
|
+
/** Sending: the submit button spins and the field ignores further sends until it ends. */
|
|
26
|
+
submitting?: boolean;
|
|
27
|
+
onValueChange?: (value: string) => void;
|
|
28
|
+
}
|
|
29
|
+
export declare const KjunTextarea: import("react").ForwardRefExoticComponent<KjunTextareaProps & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type TextareaSubmitKey } from "../../../shared/package-runtime/textarea.js";
|
|
2
|
+
import { type InputSize } from "@kjun-ui/tokens";
|
|
3
|
+
import { type ReactNode, type TextareaHTMLAttributes } from "react";
|
|
4
|
+
export interface KjunTextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "size" | "value" | "onSubmit"> {
|
|
5
|
+
value: string;
|
|
6
|
+
size?: InputSize;
|
|
7
|
+
error?: boolean;
|
|
8
|
+
/** Manual resizing (default "none"). A field the user can drag taller keeps that height instead of growing with its text. */
|
|
9
|
+
resize?: "none" | "vertical" | "horizontal" | "both";
|
|
10
|
+
ariaLabel?: string;
|
|
11
|
+
/** The field grows with its text from rows up to maxRows, then scrolls (default 6; rows keeps it fixed). */
|
|
12
|
+
maxRows?: number;
|
|
13
|
+
/** Character limit (UTF-16 units, like the attribute); the count shows "length/maxLength" and a longer value reads as an error. */
|
|
14
|
+
maxLength?: number;
|
|
15
|
+
/** Shows the character count inside the field, as "length/maxLength" when maxLength is set. */
|
|
16
|
+
showCount?: boolean;
|
|
17
|
+
/** Composer: controls at the start of the bar inside the field (attach, mention). */
|
|
18
|
+
actions?: ReactNode;
|
|
19
|
+
/** Composer: shows a submit button at the end of the bar, named by this label. */
|
|
20
|
+
submitLabel?: string;
|
|
21
|
+
/** Sends the text: the submit button or the submit key, while there is text within maxLength and nothing is sending. */
|
|
22
|
+
onSubmit?: (value: string) => void;
|
|
23
|
+
/** "mod-enter" (default) sends on Ctrl/⌘+Enter; "enter" sends on Enter, and Shift+Enter starts a new line. */
|
|
24
|
+
submitOn?: TextareaSubmitKey;
|
|
25
|
+
/** Sending: the submit button spins and the field ignores further sends until it ends. */
|
|
26
|
+
submitting?: boolean;
|
|
27
|
+
onValueChange?: (value: string) => void;
|
|
28
|
+
}
|
|
29
|
+
export declare const KjunTextarea: import("react").ForwardRefExoticComponent<KjunTextareaProps & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type HourCycle } from "../../../shared/package-runtime/time-segments.cjs";
|
|
1
2
|
import { type TimePrecision, type InputSize } from "@kjun-ui/tokens";
|
|
2
3
|
export interface KjunTimePickerProps {
|
|
3
4
|
value: string | null;
|
|
@@ -11,7 +12,15 @@ export interface KjunTimePickerProps {
|
|
|
11
12
|
clearable?: boolean;
|
|
12
13
|
size?: InputSize;
|
|
13
14
|
ariaLabel?: string;
|
|
15
|
+
/** 24 (default) shows 00–23; 12 adds an AM/PM segment and shows 1–12. The value stays "HH:mm". */
|
|
16
|
+
hourCycle?: HourCycle;
|
|
17
|
+
/** Shows the time without changing it. */
|
|
18
|
+
readOnly?: boolean;
|
|
19
|
+
/** Submits the value with a form through a hidden input. */
|
|
20
|
+
name?: string;
|
|
21
|
+
/** Stretches the field to its container's width (default false: the field hugs the time). */
|
|
22
|
+
block?: boolean;
|
|
14
23
|
onValueChange?: (value: string | null) => void;
|
|
15
24
|
onChangeCommit?: (value: string | null) => void;
|
|
16
25
|
}
|
|
17
|
-
export declare function KjunTimePicker({ value, precision, min, max, minuteStep, secondStep, disabled, error, clearable, size, ariaLabel, onValueChange, onChangeCommit }: KjunTimePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare function KjunTimePicker({ value, precision, min, max, minuteStep, secondStep, disabled, error, clearable, size, ariaLabel, hourCycle, readOnly, name, block, onValueChange, onChangeCommit }: KjunTimePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type HourCycle } from "../../../shared/package-runtime/time-segments.js";
|
|
1
2
|
import { type TimePrecision, type InputSize } from "@kjun-ui/tokens";
|
|
2
3
|
export interface KjunTimePickerProps {
|
|
3
4
|
value: string | null;
|
|
@@ -11,7 +12,15 @@ export interface KjunTimePickerProps {
|
|
|
11
12
|
clearable?: boolean;
|
|
12
13
|
size?: InputSize;
|
|
13
14
|
ariaLabel?: string;
|
|
15
|
+
/** 24 (default) shows 00–23; 12 adds an AM/PM segment and shows 1–12. The value stays "HH:mm". */
|
|
16
|
+
hourCycle?: HourCycle;
|
|
17
|
+
/** Shows the time without changing it. */
|
|
18
|
+
readOnly?: boolean;
|
|
19
|
+
/** Submits the value with a form through a hidden input. */
|
|
20
|
+
name?: string;
|
|
21
|
+
/** Stretches the field to its container's width (default false: the field hugs the time). */
|
|
22
|
+
block?: boolean;
|
|
14
23
|
onValueChange?: (value: string | null) => void;
|
|
15
24
|
onChangeCommit?: (value: string | null) => void;
|
|
16
25
|
}
|
|
17
|
-
export declare function KjunTimePicker({ value, precision, min, max, minuteStep, secondStep, disabled, error, clearable, size, ariaLabel, onValueChange, onChangeCommit }: KjunTimePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare function KjunTimePicker({ value, precision, min, max, minuteStep, secondStep, disabled, error, clearable, size, ariaLabel, hourCycle, readOnly, name, block, onValueChange, onChangeCommit }: KjunTimePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type OpenedItems = ReadonlySet<string>;
|
|
2
|
+
/** Opens or closes one item; a single-open Accordion closes the others. */
|
|
3
|
+
export declare function toggleOpened(opened: OpenedItems, id: string, multiple: boolean): Set<string>;
|
|
4
|
+
/** A defaultOpen item joins the open set, unless a single-open Accordion already has one open. */
|
|
5
|
+
export declare function registerOpened(opened: OpenedItems, id: string, defaultOpen: boolean, multiple: boolean): OpenedItems;
|
|
6
|
+
/** An item that unmounts leaves the open set. */
|
|
7
|
+
export declare function unregisterOpened(opened: OpenedItems, id: string): OpenedItems;
|
|
8
|
+
/** Switching to single-open keeps only the most recently opened item. */
|
|
9
|
+
export declare const trimToSingle: (opened: OpenedItems) => OpenedItems;
|
|
10
|
+
/** Up/Down/Home/End move between the headers of an Accordion, as in the WAI-ARIA accordion pattern. */
|
|
11
|
+
export declare function accordionKeyTarget(key: string, index: number, count: number): number | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type OpenedItems = ReadonlySet<string>;
|
|
2
|
+
/** Opens or closes one item; a single-open Accordion closes the others. */
|
|
3
|
+
export declare function toggleOpened(opened: OpenedItems, id: string, multiple: boolean): Set<string>;
|
|
4
|
+
/** A defaultOpen item joins the open set, unless a single-open Accordion already has one open. */
|
|
5
|
+
export declare function registerOpened(opened: OpenedItems, id: string, defaultOpen: boolean, multiple: boolean): OpenedItems;
|
|
6
|
+
/** An item that unmounts leaves the open set. */
|
|
7
|
+
export declare function unregisterOpened(opened: OpenedItems, id: string): OpenedItems;
|
|
8
|
+
/** Switching to single-open keeps only the most recently opened item. */
|
|
9
|
+
export declare const trimToSingle: (opened: OpenedItems) => OpenedItems;
|
|
10
|
+
/** Up/Down/Home/End move between the headers of an Accordion, as in the WAI-ARIA accordion pattern. */
|
|
11
|
+
export declare function accordionKeyTarget(key: string, index: number, count: number): number | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ButtonSize } from "@kjun-ui/tokens";
|
|
2
|
-
export { alertActionSizes } from "./alert-action-size.cjs";
|
|
2
|
+
export { alertActionSizes, popoverActionSize } from "./alert-action-size.cjs";
|
|
3
3
|
/** A container's default size for buttons that leave `size` unset; an explicit size always wins. */
|
|
4
4
|
export declare const ActionSizeContext: import("react").Context<"xs" | "sm" | "md" | "lg" | "xl" | null>;
|
|
5
5
|
export declare function useActionSize(requested: ButtonSize | undefined, fallback: ButtonSize): ButtonSize;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ButtonSize } from "@kjun-ui/tokens";
|
|
2
|
-
export { alertActionSizes } from "./alert-action-size.js";
|
|
2
|
+
export { alertActionSizes, popoverActionSize } from "./alert-action-size.js";
|
|
3
3
|
/** A container's default size for buttons that leave `size` unset; an explicit size always wins. */
|
|
4
4
|
export declare const ActionSizeContext: import("react").Context<"xs" | "sm" | "md" | "lg" | "xl" | null>;
|
|
5
5
|
export declare function useActionSize(requested: ButtonSize | undefined, fallback: ButtonSize): ButtonSize;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { tokens } from "@kjun-ui/tokens";
|
|
2
|
+
type BadgeSize = keyof typeof tokens.extensions.badge.padding;
|
|
3
|
+
export type BadgeVariant = "default" | "secondary" | "primary" | "success" | "warning" | "danger" | "info" | "price-up" | "price-down";
|
|
4
|
+
export interface BadgeToneRoles {
|
|
5
|
+
bg: string;
|
|
6
|
+
text: string;
|
|
7
|
+
dot: string;
|
|
8
|
+
}
|
|
9
|
+
/** Color roles a badge paints: the tone's subtle fill, its darker text and its accent dot. */
|
|
10
|
+
export declare function badgeToneRoles(variant: BadgeVariant): BadgeToneRoles;
|
|
11
|
+
/** Size geometry shared by every platform: one type step, radius, gap and dot per size. */
|
|
12
|
+
export declare function badgeGeometry(size: BadgeSize): {
|
|
13
|
+
padding: {
|
|
14
|
+
readonly x: 6;
|
|
15
|
+
readonly y: 0;
|
|
16
|
+
} | {
|
|
17
|
+
readonly x: 8;
|
|
18
|
+
readonly y: 2;
|
|
19
|
+
} | {
|
|
20
|
+
readonly x: 8;
|
|
21
|
+
readonly y: 2;
|
|
22
|
+
} | {
|
|
23
|
+
readonly x: 10;
|
|
24
|
+
readonly y: 4;
|
|
25
|
+
} | {
|
|
26
|
+
readonly x: 12;
|
|
27
|
+
readonly y: 4;
|
|
28
|
+
};
|
|
29
|
+
radius: 4 | 10 | 8 | 6;
|
|
30
|
+
gap: 4 | 6;
|
|
31
|
+
dotSize: 8 | 6;
|
|
32
|
+
type: {
|
|
33
|
+
fontWeight: 500;
|
|
34
|
+
fontSizePx: 12;
|
|
35
|
+
lineHeightPx: 16;
|
|
36
|
+
letterSpacingEm: 0;
|
|
37
|
+
} | {
|
|
38
|
+
fontWeight: 500;
|
|
39
|
+
fontSizePx: 12;
|
|
40
|
+
lineHeightPx: 16;
|
|
41
|
+
letterSpacingEm: 0;
|
|
42
|
+
} | {
|
|
43
|
+
fontWeight: 500;
|
|
44
|
+
fontSizePx: 14;
|
|
45
|
+
lineHeightPx: 20;
|
|
46
|
+
letterSpacingEm: 0;
|
|
47
|
+
} | {
|
|
48
|
+
fontWeight: 500;
|
|
49
|
+
fontSizePx: 14;
|
|
50
|
+
lineHeightPx: 20;
|
|
51
|
+
letterSpacingEm: 0;
|
|
52
|
+
} | {
|
|
53
|
+
fontWeight: 500;
|
|
54
|
+
fontSizePx: 16;
|
|
55
|
+
lineHeightPx: 24;
|
|
56
|
+
letterSpacingEm: 0;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
export {};
|