@kjun-ui/react 0.18.0 → 0.19.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.
Files changed (76) hide show
  1. package/dist/index.cjs +1911 -1281
  2. package/dist/index.js +1998 -1366
  3. package/dist/styles.css +644 -411
  4. package/dist/types/packages/react/src/app-navigation.d.cts +12 -8
  5. package/dist/types/packages/react/src/app-navigation.d.ts +12 -8
  6. package/dist/types/packages/react/src/display.d.cts +8 -2
  7. package/dist/types/packages/react/src/display.d.ts +8 -2
  8. package/dist/types/packages/react/src/drawer.d.cts +3 -5
  9. package/dist/types/packages/react/src/drawer.d.ts +3 -5
  10. package/dist/types/packages/react/src/fab.d.cts +3 -3
  11. package/dist/types/packages/react/src/fab.d.ts +3 -3
  12. package/dist/types/packages/react/src/feedback.d.cts +12 -3
  13. package/dist/types/packages/react/src/feedback.d.ts +12 -3
  14. package/dist/types/packages/react/src/index.d.cts +2 -0
  15. package/dist/types/packages/react/src/index.d.ts +2 -0
  16. package/dist/types/packages/react/src/layout-primitives.d.cts +24 -24
  17. package/dist/types/packages/react/src/layout-primitives.d.ts +24 -24
  18. package/dist/types/packages/react/src/modal.d.cts +3 -1
  19. package/dist/types/packages/react/src/modal.d.ts +3 -1
  20. package/dist/types/packages/react/src/provider.d.cts +4 -1
  21. package/dist/types/packages/react/src/provider.d.ts +4 -1
  22. package/dist/types/packages/react/src/skeleton-phase.d.cts +2 -0
  23. package/dist/types/packages/react/src/skeleton-phase.d.ts +2 -0
  24. package/dist/types/packages/react/src/skeletons.d.cts +19 -4
  25. package/dist/types/packages/react/src/skeletons.d.ts +19 -4
  26. package/dist/types/packages/react/src/table-cards.d.cts +6 -3
  27. package/dist/types/packages/react/src/table-cards.d.ts +6 -3
  28. package/dist/types/packages/react/src/table-list.d.cts +2 -6
  29. package/dist/types/packages/react/src/table-list.d.ts +2 -6
  30. package/dist/types/packages/react/src/table-model.d.cts +1 -0
  31. package/dist/types/packages/react/src/table-model.d.ts +1 -0
  32. package/dist/types/packages/react/src/table-toolbar.d.cts +1 -1
  33. package/dist/types/packages/react/src/table-toolbar.d.ts +1 -1
  34. package/dist/types/packages/react/src/table-totals.d.cts +5 -0
  35. package/dist/types/packages/react/src/table-totals.d.ts +5 -0
  36. package/dist/types/packages/react/src/toast-stack.d.cts +7 -2
  37. package/dist/types/packages/react/src/toast-stack.d.ts +7 -2
  38. package/dist/types/shared/package-runtime/chart-skeleton.d.cts +15 -3
  39. package/dist/types/shared/package-runtime/chart-skeleton.d.ts +15 -3
  40. package/dist/types/shared/package-runtime/drawer-geometry.d.cts +2 -3
  41. package/dist/types/shared/package-runtime/drawer-geometry.d.ts +2 -3
  42. package/dist/types/shared/package-runtime/feedback-dialog.d.cts +5 -4
  43. package/dist/types/shared/package-runtime/feedback-dialog.d.ts +5 -4
  44. package/dist/types/shared/package-runtime/feedback-motion.d.cts +2 -5
  45. package/dist/types/shared/package-runtime/feedback-motion.d.ts +2 -5
  46. package/dist/types/shared/package-runtime/feedback-prompt.d.cts +58 -0
  47. package/dist/types/shared/package-runtime/feedback-prompt.d.ts +58 -0
  48. package/dist/types/shared/package-runtime/market-layout.d.cts +0 -1
  49. package/dist/types/shared/package-runtime/market-layout.d.ts +0 -1
  50. package/dist/types/shared/package-runtime/messages/ko.d.cts +7 -0
  51. package/dist/types/shared/package-runtime/messages/ko.d.ts +7 -0
  52. package/dist/types/shared/package-runtime/messages-context.d.cts +7 -0
  53. package/dist/types/shared/package-runtime/messages-context.d.ts +7 -0
  54. package/dist/types/shared/package-runtime/safe-area.d.cts +20 -0
  55. package/dist/types/shared/package-runtime/safe-area.d.ts +20 -0
  56. package/dist/types/shared/package-runtime/skeleton-text.d.cts +12 -0
  57. package/dist/types/shared/package-runtime/skeleton-text.d.ts +12 -0
  58. package/dist/types/shared/package-runtime/stable-value.d.cts +3 -0
  59. package/dist/types/shared/package-runtime/stable-value.d.ts +3 -0
  60. package/dist/types/shared/package-runtime/table-presentation.d.cts +38 -2
  61. package/dist/types/shared/package-runtime/table-presentation.d.ts +38 -2
  62. package/dist/types/shared/package-runtime/table.d.cts +6 -0
  63. package/dist/types/shared/package-runtime/table.d.ts +6 -0
  64. package/dist/types/shared/package-runtime/toast-entry.d.cts +3 -0
  65. package/dist/types/shared/package-runtime/toast-entry.d.ts +3 -0
  66. package/dist/types/shared/package-runtime/toast-placement.d.cts +4 -0
  67. package/dist/types/shared/package-runtime/toast-placement.d.ts +4 -0
  68. package/dist/types/shared/package-runtime/toast-presence.d.cts +12 -0
  69. package/dist/types/shared/package-runtime/toast-presence.d.ts +12 -0
  70. package/dist/types/shared/package-runtime/toast-presentation.d.cts +42 -0
  71. package/dist/types/shared/package-runtime/toast-presentation.d.ts +42 -0
  72. package/dist/types/shared/package-runtime/toast-swipe.d.cts +20 -0
  73. package/dist/types/shared/package-runtime/toast-swipe.d.ts +20 -0
  74. package/dist/types/shared/package-runtime/use-toast-stack.d.cts +22 -0
  75. package/dist/types/shared/package-runtime/use-toast-stack.d.ts +22 -0
  76. package/package.json +3 -3
@@ -1,5 +1,6 @@
1
1
  import { type KjunMessages } from "../../../shared/package-runtime/messages/index.js";
2
2
  import type { KjunIconRegistry } from "@kjun-ui/icons";
3
+ import { type KjunSafeArea } from "../../../shared/package-runtime/safe-area.js";
3
4
  import { type HTMLAttributes, type ReactNode } from "react";
4
5
  export declare const useKjunPortalContainer: () => HTMLElement | null | undefined;
5
6
  export interface KjunProviderProps extends HTMLAttributes<HTMLDivElement> {
@@ -9,5 +10,7 @@ export interface KjunProviderProps extends HTMLAttributes<HTMLDivElement> {
9
10
  locale?: string;
10
11
  /** Replaces part of KJUN's copy, e.g. with the app's own translations. */
11
12
  messages?: Partial<KjunMessages>;
13
+ /** Screen insets in px for toasts, modals, menus and edge components; without it the browser's env(safe-area-inset-*) applies. */
14
+ safeArea?: KjunSafeArea;
12
15
  }
13
- export declare function KjunProvider({ icons, locale, messages, children, className, ...props }: KjunProviderProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare function KjunProvider({ icons, locale, messages, children, className, safeArea, style, ...props }: KjunProviderProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ /** Puts a skeleton on the shared pulse clock once it mounts, so skeletons that appear later still pulse together. */
2
+ export declare function useSkeletonPhase(active?: boolean): import("react").RefObject<HTMLDivElement | null>;
@@ -0,0 +1,2 @@
1
+ /** Puts a skeleton on the shared pulse clock once it mounts, so skeletons that appear later still pulse together. */
2
+ export declare function useSkeletonPhase(active?: boolean): import("react").RefObject<HTMLDivElement | null>;
@@ -3,12 +3,19 @@ import { type CSSProperties } from "react";
3
3
  import { type KjunChartSkeletonKind } from "../../../shared/package-runtime/chart-skeleton.cjs";
4
4
  export interface KjunListSkeletonProps {
5
5
  rows?: number;
6
- variant?: "market" | "compact" | "notification";
6
+ /** "row" is the silhouette of KjunListRow: title and description lines, a text-start divider, no avatar unless asked. */
7
+ variant?: "market" | "compact" | "notification" | "row";
7
8
  avatar?: boolean;
8
9
  avatarSize?: CSSProperties["width"];
9
10
  quote?: boolean;
11
+ /** Row variant: draws the description line (default true). */
12
+ description?: boolean;
13
+ /** Row variant: what ends the row, a value (default), a switch or a chevron; quote={false} leaves it empty. */
14
+ trailing?: "value" | "switch" | "chevron";
15
+ /** Announces loading to screen readers (a status); the skeleton itself stays silent. */
16
+ loadingText?: string;
10
17
  }
11
- export declare function KjunListSkeleton({ rows, variant, avatar, avatarSize, quote, }: KjunListSkeletonProps): import("react/jsx-runtime").JSX.Element;
18
+ export declare function KjunListSkeleton({ rows, variant, avatar, avatarSize, quote, description, trailing, loadingText, }: KjunListSkeletonProps): import("react/jsx-runtime").JSX.Element;
12
19
  export interface KjunFormSkeletonProps {
13
20
  fields?: (string | {
14
21
  label?: string;
@@ -17,8 +24,10 @@ export interface KjunFormSkeletonProps {
17
24
  columns?: number;
18
25
  multiline?: boolean;
19
26
  size?: InputSize;
27
+ /** Announces loading to screen readers (a status); the skeleton itself stays silent. */
28
+ loadingText?: string;
20
29
  }
21
- export declare function KjunFormSkeleton({ fields, columns, multiline, size, }: KjunFormSkeletonProps): import("react/jsx-runtime").JSX.Element;
30
+ export declare function KjunFormSkeleton({ fields, columns, multiline, size, loadingText, }: KjunFormSkeletonProps): import("react/jsx-runtime").JSX.Element;
22
31
  export interface KjunChartSkeletonProps {
23
32
  kind?: KjunChartSkeletonKind;
24
33
  height?: CSSProperties["height"];
@@ -27,7 +36,13 @@ export interface KjunChartSkeletonProps {
27
36
  loadingDelay?: number;
28
37
  rows?: number;
29
38
  columns?: number;
39
+ /** Frame: horizontal grid lines of the app's chart, top to baseline (default 5). */
40
+ gridLines?: number;
41
+ /** Frame: x-axis tick labels (default 6). */
42
+ xTicks?: number;
43
+ /** Frame: y-axis label width in px (default 40); label bars fill it, less the label gap. */
44
+ axisWidth?: number;
30
45
  }
31
- export declare function KjunChartSkeleton({ kind: requestedKind, height, loadingText, skeleton, loadingDelay, rows, columns, }: KjunChartSkeletonProps): import("react/jsx-runtime").JSX.Element;
46
+ export declare function KjunChartSkeleton({ kind: requestedKind, height, loadingText, skeleton, loadingDelay, rows, columns, gridLines, xTicks, axisWidth, }: KjunChartSkeletonProps): import("react/jsx-runtime").JSX.Element;
32
47
  export { KjunMarketTableSkeleton } from "./market-skeleton.cjs";
33
48
  export type { KjunMarketTableSkeletonProps } from "./market-skeleton.cjs";
@@ -3,12 +3,19 @@ import { type CSSProperties } from "react";
3
3
  import { type KjunChartSkeletonKind } from "../../../shared/package-runtime/chart-skeleton.js";
4
4
  export interface KjunListSkeletonProps {
5
5
  rows?: number;
6
- variant?: "market" | "compact" | "notification";
6
+ /** "row" is the silhouette of KjunListRow: title and description lines, a text-start divider, no avatar unless asked. */
7
+ variant?: "market" | "compact" | "notification" | "row";
7
8
  avatar?: boolean;
8
9
  avatarSize?: CSSProperties["width"];
9
10
  quote?: boolean;
11
+ /** Row variant: draws the description line (default true). */
12
+ description?: boolean;
13
+ /** Row variant: what ends the row, a value (default), a switch or a chevron; quote={false} leaves it empty. */
14
+ trailing?: "value" | "switch" | "chevron";
15
+ /** Announces loading to screen readers (a status); the skeleton itself stays silent. */
16
+ loadingText?: string;
10
17
  }
11
- export declare function KjunListSkeleton({ rows, variant, avatar, avatarSize, quote, }: KjunListSkeletonProps): import("react/jsx-runtime").JSX.Element;
18
+ export declare function KjunListSkeleton({ rows, variant, avatar, avatarSize, quote, description, trailing, loadingText, }: KjunListSkeletonProps): import("react/jsx-runtime").JSX.Element;
12
19
  export interface KjunFormSkeletonProps {
13
20
  fields?: (string | {
14
21
  label?: string;
@@ -17,8 +24,10 @@ export interface KjunFormSkeletonProps {
17
24
  columns?: number;
18
25
  multiline?: boolean;
19
26
  size?: InputSize;
27
+ /** Announces loading to screen readers (a status); the skeleton itself stays silent. */
28
+ loadingText?: string;
20
29
  }
21
- export declare function KjunFormSkeleton({ fields, columns, multiline, size, }: KjunFormSkeletonProps): import("react/jsx-runtime").JSX.Element;
30
+ export declare function KjunFormSkeleton({ fields, columns, multiline, size, loadingText, }: KjunFormSkeletonProps): import("react/jsx-runtime").JSX.Element;
22
31
  export interface KjunChartSkeletonProps {
23
32
  kind?: KjunChartSkeletonKind;
24
33
  height?: CSSProperties["height"];
@@ -27,7 +36,13 @@ export interface KjunChartSkeletonProps {
27
36
  loadingDelay?: number;
28
37
  rows?: number;
29
38
  columns?: number;
39
+ /** Frame: horizontal grid lines of the app's chart, top to baseline (default 5). */
40
+ gridLines?: number;
41
+ /** Frame: x-axis tick labels (default 6). */
42
+ xTicks?: number;
43
+ /** Frame: y-axis label width in px (default 40); label bars fill it, less the label gap. */
44
+ axisWidth?: number;
30
45
  }
31
- export declare function KjunChartSkeleton({ kind: requestedKind, height, loadingText, skeleton, loadingDelay, rows, columns, }: KjunChartSkeletonProps): import("react/jsx-runtime").JSX.Element;
46
+ export declare function KjunChartSkeleton({ kind: requestedKind, height, loadingText, skeleton, loadingDelay, rows, columns, gridLines, xTicks, axisWidth, }: KjunChartSkeletonProps): import("react/jsx-runtime").JSX.Element;
32
47
  export { KjunMarketTableSkeleton } from "./market-skeleton.js";
33
48
  export type { KjunMarketTableSkeletonProps } from "./market-skeleton.js";
@@ -1,9 +1,12 @@
1
- import type { KeyboardEvent } from "react";
2
- import type { TableCardsProps } from "../../../shared/package-runtime/table-presentation.cjs";
1
+ import type { KeyboardEvent, ReactNode } from "react";
2
+ import { type TableCardsProps } from "../../../shared/package-runtime/table-presentation.cjs";
3
+ import type { TableRowGroup } from "../../../shared/package-runtime/table-groups.cjs";
3
4
  interface Props<Row extends object> extends TableCardsProps<Row> {
4
5
  ariaLabel: string;
5
6
  customClass: (row: Row, index: number) => string;
6
7
  rowKeyDown: (event: KeyboardEvent<HTMLElement>, row: Row, index: number) => void;
7
8
  }
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
+ /** Groups as labelled groups, each a header line over its own list; ungrouped rows stay one list. */
10
+ export declare function useTableGroups<Row extends object>({ groupLabel, groupTotals, state }: Pick<TableCardsProps<Row>, "groupLabel" | "groupTotals" | "state">, className: string, itemsClass: string | undefined, item: (row: Row, index: number) => ReactNode): (list: TableRowGroup<Row>[]) => import("react/jsx-runtime").JSX.Element[];
11
+ export declare function TableCards<Row extends object>(props: Props<Row>): import("react/jsx-runtime").JSX.Element;
9
12
  export {};
@@ -1,9 +1,12 @@
1
- import type { KeyboardEvent } from "react";
2
- import type { TableCardsProps } from "../../../shared/package-runtime/table-presentation.js";
1
+ import type { KeyboardEvent, ReactNode } from "react";
2
+ import { type TableCardsProps } from "../../../shared/package-runtime/table-presentation.js";
3
+ import type { TableRowGroup } from "../../../shared/package-runtime/table-groups.js";
3
4
  interface Props<Row extends object> extends TableCardsProps<Row> {
4
5
  ariaLabel: string;
5
6
  customClass: (row: Row, index: number) => string;
6
7
  rowKeyDown: (event: KeyboardEvent<HTMLElement>, row: Row, index: number) => void;
7
8
  }
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
+ /** Groups as labelled groups, each a header line over its own list; ungrouped rows stay one list. */
10
+ export declare function useTableGroups<Row extends object>({ groupLabel, groupTotals, state }: Pick<TableCardsProps<Row>, "groupLabel" | "groupTotals" | "state">, className: string, itemsClass: string | undefined, item: (row: Row, index: number) => ReactNode): (list: TableRowGroup<Row>[]) => import("react/jsx-runtime").JSX.Element[];
11
+ export declare function TableCards<Row extends object>(props: Props<Row>): import("react/jsx-runtime").JSX.Element;
9
12
  export {};
@@ -1,14 +1,10 @@
1
1
  import type { KeyboardEvent } from "react";
2
- import type { TableCardsProps, TableTotal } from "../../../shared/package-runtime/table-presentation.cjs";
2
+ import type { TableCardsProps } from "../../../shared/package-runtime/table-presentation.cjs";
3
3
  interface Props<Row extends object> extends TableCardsProps<Row> {
4
4
  ariaLabel: string;
5
5
  customClass: (row: Row, index: number) => string;
6
6
  rowKeyDown: (event: KeyboardEvent<HTMLElement>, row: Row, index: number) => void;
7
7
  }
8
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;
9
+ export declare function TableList<Row extends object>(props: Props<Row>): import("react/jsx-runtime").JSX.Element;
14
10
  export {};
@@ -1,14 +1,10 @@
1
1
  import type { KeyboardEvent } from "react";
2
- import type { TableCardsProps, TableTotal } from "../../../shared/package-runtime/table-presentation.js";
2
+ import type { TableCardsProps } from "../../../shared/package-runtime/table-presentation.js";
3
3
  interface Props<Row extends object> extends TableCardsProps<Row> {
4
4
  ariaLabel: string;
5
5
  customClass: (row: Row, index: number) => string;
6
6
  rowKeyDown: (event: KeyboardEvent<HTMLElement>, row: Row, index: number) => void;
7
7
  }
8
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;
9
+ export declare function TableList<Row extends object>(props: Props<Row>): import("react/jsx-runtime").JSX.Element;
14
10
  export {};
@@ -16,6 +16,7 @@ export declare function useTableModel<Row extends object>(props: KjunTableProps<
16
16
  expanded: (string | number)[];
17
17
  searchChange: (q: string) => void;
18
18
  sortColumn: (col: import("./table-model.cjs").TableColumn<Row>) => void;
19
+ sortTo: (next: import("@kjun-ui/tokens").TableSort) => void;
19
20
  toggleRow: (row: Row) => void | undefined;
20
21
  toggleAll: () => void | undefined;
21
22
  toggleExpand: (row: Row, index: number) => void;
@@ -16,6 +16,7 @@ export declare function useTableModel<Row extends object>(props: KjunTableProps<
16
16
  expanded: (string | number)[];
17
17
  searchChange: (q: string) => void;
18
18
  sortColumn: (col: import("./table-model.js").TableColumn<Row>) => void;
19
+ sortTo: (next: import("@kjun-ui/tokens").TableSort) => void;
19
20
  toggleRow: (row: Row) => void | undefined;
20
21
  toggleAll: () => void | undefined;
21
22
  toggleExpand: (row: Row, index: number) => void;
@@ -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, allSelected, 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, sortOptions, sortValue, sortChange }: 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, allSelected, 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, sortOptions, sortValue, sortChange }: TableToolbarProps<Row>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import type { TableTotal } from "../../../shared/package-runtime/table-presentation.cjs";
2
+ /** The summary on narrow layouts: one closing block with each summarized column's total. */
3
+ export declare function TableTotals({ totals }: {
4
+ totals?: TableTotal[];
5
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,5 @@
1
+ import type { TableTotal } from "../../../shared/package-runtime/table-presentation.js";
2
+ /** The summary on narrow layouts: one closing block with each summarized column's total. */
3
+ export declare function TableTotals({ totals }: {
4
+ totals?: TableTotal[];
5
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -1,6 +1,11 @@
1
1
  import type { createFeedbackController } from "@kjun-ui/tokens";
2
2
  import { type PresentedToast } from "../../../shared/package-runtime/feedback-motion.cjs";
3
- export declare function ToastStack({ items, controller }: {
3
+ import { type ToastPlacement } from "../../../shared/package-runtime/toast-placement.cjs";
4
+ type Controller = ReturnType<typeof createFeedbackController>;
5
+ export declare function ToastStack({ items, controller, placement, offset }: {
4
6
  items: PresentedToast[];
5
- controller: ReturnType<typeof createFeedbackController>;
7
+ controller: Controller;
8
+ placement?: ToastPlacement;
9
+ offset?: number;
6
10
  }): import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -1,6 +1,11 @@
1
1
  import type { createFeedbackController } from "@kjun-ui/tokens";
2
2
  import { type PresentedToast } from "../../../shared/package-runtime/feedback-motion.js";
3
- export declare function ToastStack({ items, controller }: {
3
+ import { type ToastPlacement } from "../../../shared/package-runtime/toast-placement.js";
4
+ type Controller = ReturnType<typeof createFeedbackController>;
5
+ export declare function ToastStack({ items, controller, placement, offset }: {
4
6
  items: PresentedToast[];
5
- controller: ReturnType<typeof createFeedbackController>;
7
+ controller: Controller;
8
+ placement?: ToastPlacement;
9
+ offset?: number;
6
10
  }): import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -1,7 +1,19 @@
1
1
  export type KjunChartSkeletonKind = "frame" | "donut" | "matrix";
2
- /** Axes plus three horizontal grid lines in the frame's 600×240 viewBox. */
3
- export declare const chartFrameViewBox = "0 0 600 240";
4
- export declare const chartFramePath = "M20 10V220H590 M20 65H590 M20 120H590 M20 175H590";
2
+ /**
3
+ * The frame follows the app's chart layout: horizontal grid lines, x-axis ticks and the y-axis label width.
4
+ * KJUN cannot know where the real chart puts them, so the app passes its own values; these are common defaults.
5
+ */
6
+ export declare const chartFrameDefaults: {
7
+ gridLines: number;
8
+ xTicks: number;
9
+ };
10
+ /** Evenly spaced positions from 0 to 1 for at least two marks (grid lines or ticks). */
11
+ export declare function chartFrameStops(count: number): number[];
12
+ /** A tick label centres on its tick, except at the ends where it stays inside the plot (percent of its width). */
13
+ export declare function chartTickShift(stop: number): 0 | -100 | -50;
14
+ /** Grid lines in a 0 0 100 100 viewBox, drawn with non-scaling strokes over the plot area. */
15
+ export declare const chartFrameViewBox = "0 0 100 100";
16
+ export declare function chartFramePath(gridLines: number): string;
5
17
  /** Upper bound for matrix rows and columns, so counts derived from data never render an unbounded grid. */
6
18
  export declare const chartSkeletonMaxCount = 100;
7
19
  /** Matrix rows and columns: finite values floor into 1–100; anything else is 1. */
@@ -1,7 +1,19 @@
1
1
  export type KjunChartSkeletonKind = "frame" | "donut" | "matrix";
2
- /** Axes plus three horizontal grid lines in the frame's 600×240 viewBox. */
3
- export declare const chartFrameViewBox = "0 0 600 240";
4
- export declare const chartFramePath = "M20 10V220H590 M20 65H590 M20 120H590 M20 175H590";
2
+ /**
3
+ * The frame follows the app's chart layout: horizontal grid lines, x-axis ticks and the y-axis label width.
4
+ * KJUN cannot know where the real chart puts them, so the app passes its own values; these are common defaults.
5
+ */
6
+ export declare const chartFrameDefaults: {
7
+ gridLines: number;
8
+ xTicks: number;
9
+ };
10
+ /** Evenly spaced positions from 0 to 1 for at least two marks (grid lines or ticks). */
11
+ export declare function chartFrameStops(count: number): number[];
12
+ /** A tick label centres on its tick, except at the ends where it stays inside the plot (percent of its width). */
13
+ export declare function chartTickShift(stop: number): 0 | -100 | -50;
14
+ /** Grid lines in a 0 0 100 100 viewBox, drawn with non-scaling strokes over the plot area. */
15
+ export declare const chartFrameViewBox = "0 0 100 100";
16
+ export declare function chartFramePath(gridLines: number): string;
5
17
  /** Upper bound for matrix rows and columns, so counts derived from data never render an unbounded grid. */
6
18
  export declare const chartSkeletonMaxCount = 100;
7
19
  /** Matrix rows and columns: finite values floor into 1–100; anything else is 1. */
@@ -35,8 +35,7 @@ export declare function keyboardEvents(os: string): {
35
35
  export declare function keyboardOverlap(rootHeight: number, keyboardScreenY: number): number;
36
36
  export declare function drawerFrame({ position, windowHeight, safeAreaTop, safeAreaBottom, gap, keyboard, maxHeight }: DrawerFrameInput): DrawerFrame;
37
37
  /** Web overlay variables read by the drawer CSS (tokens controls.css). */
38
- export declare function drawerOverlayVars({ safeAreaTop, safeAreaBottom, maxHeight }: {
39
- safeAreaTop?: number;
40
- safeAreaBottom?: number;
38
+ export declare function drawerOverlayVars({ safeArea, maxHeight }: {
39
+ safeArea?: boolean;
41
40
  maxHeight?: number;
42
41
  }): Record<string, string>;
@@ -35,8 +35,7 @@ export declare function keyboardEvents(os: string): {
35
35
  export declare function keyboardOverlap(rootHeight: number, keyboardScreenY: number): number;
36
36
  export declare function drawerFrame({ position, windowHeight, safeAreaTop, safeAreaBottom, gap, keyboard, maxHeight }: DrawerFrameInput): DrawerFrame;
37
37
  /** Web overlay variables read by the drawer CSS (tokens controls.css). */
38
- export declare function drawerOverlayVars({ safeAreaTop, safeAreaBottom, maxHeight }: {
39
- safeAreaTop?: number;
40
- safeAreaBottom?: number;
38
+ export declare function drawerOverlayVars({ safeArea, maxHeight }: {
39
+ safeArea?: boolean;
41
40
  maxHeight?: number;
42
41
  }): Record<string, string>;
@@ -1,11 +1,12 @@
1
1
  import { type KjunMessages } from "./messages/index.cjs";
2
2
  import type { createFeedbackController, ConfirmOptions, FeedbackRequest, PromptOptions } from "@kjun-ui/tokens";
3
3
  export declare function useFeedbackDialog(controller: ReturnType<typeof createFeedbackController>, request: FeedbackRequest, messages?: KjunMessages): {
4
- options: PromptOptions & ConfirmOptions;
4
+ ready: boolean;
5
+ edit: (next: string) => void;
6
+ cancel: () => void;
7
+ submit: () => Promise<void>;
5
8
  value: string;
6
9
  error: string;
7
10
  busy: boolean;
8
- edit(next: string): void;
9
- cancel(): void;
10
- submit(): Promise<void>;
11
+ options: PromptOptions & Omit<ConfirmOptions, "onConfirm">;
11
12
  };
@@ -1,11 +1,12 @@
1
1
  import { type KjunMessages } from "./messages/index.js";
2
2
  import type { createFeedbackController, ConfirmOptions, FeedbackRequest, PromptOptions } from "@kjun-ui/tokens";
3
3
  export declare function useFeedbackDialog(controller: ReturnType<typeof createFeedbackController>, request: FeedbackRequest, messages?: KjunMessages): {
4
- options: PromptOptions & ConfirmOptions;
4
+ ready: boolean;
5
+ edit: (next: string) => void;
6
+ cancel: () => void;
7
+ submit: () => Promise<void>;
5
8
  value: string;
6
9
  error: string;
7
10
  busy: boolean;
8
- edit(next: string): void;
9
- cancel(): void;
10
- submit(): Promise<void>;
11
+ options: PromptOptions & Omit<ConfirmOptions, "onConfirm">;
11
12
  };
@@ -1,9 +1,6 @@
1
1
  import type { FeedbackRequest, ToastItem } from "@kjun-ui/tokens";
2
- export interface PresentedToast {
3
- toast: ToastItem;
4
- exiting: boolean;
5
- born: number;
6
- }
2
+ import { type PresentedToast } from "./toast-presence.cjs";
3
+ export type { PresentedToast };
7
4
  export declare function usePresentedToasts(toasts: ToastItem[], reduced: boolean): PresentedToast[];
8
5
  export declare function usePresentedRequest(current: FeedbackRequest | null, reduced: boolean): {
9
6
  request: FeedbackRequest | null;
@@ -1,9 +1,6 @@
1
1
  import type { FeedbackRequest, ToastItem } from "@kjun-ui/tokens";
2
- export interface PresentedToast {
3
- toast: ToastItem;
4
- exiting: boolean;
5
- born: number;
6
- }
2
+ import { type PresentedToast } from "./toast-presence.js";
3
+ export type { PresentedToast };
7
4
  export declare function usePresentedToasts(toasts: ToastItem[], reduced: boolean): PresentedToast[];
8
5
  export declare function usePresentedRequest(current: FeedbackRequest | null, reduced: boolean): {
9
6
  request: FeedbackRequest | null;
@@ -0,0 +1,58 @@
1
+ import type { KjunMessages } from "./messages/index.cjs";
2
+ /** The text a prompt shows when its onConfirm throws: the error's message, or the generic invalid-input copy. */
3
+ export declare function feedbackErrorText(reason: unknown, messages: KjunMessages): string;
4
+ /** Splits a label around the value it quotes, so the value can be set in bold ("Type <b>name</b> to confirm"). */
5
+ export declare function splitAround(text: string, part: string): [
6
+ string,
7
+ string,
8
+ string
9
+ ];
10
+ /** How long typing must pause before a prompt with validateOn: "change" checks its value. */
11
+ export declare const promptValidateDelay = 400;
12
+ /** Typed text and the expected text match regardless of surrounding spaces or how Hangul was composed (NFC/NFD). */
13
+ export declare const sameText: (a: string, b: string) => boolean;
14
+ /** User-perceived characters, so an emoji or a composed sequence counts once. */
15
+ export declare function graphemeCount(text: string): number;
16
+ export interface FeedbackDialogState {
17
+ value: string;
18
+ error: string;
19
+ busy: boolean;
20
+ }
21
+ type Settle = (value: string | boolean | null, reason?: unknown, id?: number) => void;
22
+ interface SessionController {
23
+ getSnapshot(): {
24
+ current?: {
25
+ id: number;
26
+ } | null;
27
+ };
28
+ settle: Settle;
29
+ }
30
+ interface SessionOptions {
31
+ kind: "confirm" | "prompt";
32
+ id: number;
33
+ options: Record<string, unknown> & {
34
+ validator?: (value: string) => boolean | string | Promise<boolean | string>;
35
+ onConfirm?: (value?: string) => unknown;
36
+ requiredValue?: string;
37
+ allowEmpty?: boolean;
38
+ validateOn?: "submit" | "change";
39
+ };
40
+ controller: SessionController;
41
+ messages: KjunMessages;
42
+ get: () => FeedbackDialogState;
43
+ set: (patch: Partial<FeedbackDialogState>) => void;
44
+ }
45
+ /**
46
+ * The confirm/prompt dialog's behaviour without a framework: React, Native and Vue keep the state and call these.
47
+ * Failures from onConfirm stay in the dialog (field error for prompts, a message line for confirms) so the user can
48
+ * retry or cancel; only Cancel, Escape or a success settle the request.
49
+ */
50
+ export declare function createFeedbackSession({ kind, id, options, controller, messages, get, set }: SessionOptions): {
51
+ /** Confirm turns on once a required value matches, a prompt is not empty (unless allowed) and no live error shows. */
52
+ ready(state: FeedbackDialogState): boolean;
53
+ edit(next: string): void;
54
+ cancel(): void;
55
+ submit(): Promise<void>;
56
+ dispose(): void;
57
+ };
58
+ export {};
@@ -0,0 +1,58 @@
1
+ import type { KjunMessages } from "./messages/index.js";
2
+ /** The text a prompt shows when its onConfirm throws: the error's message, or the generic invalid-input copy. */
3
+ export declare function feedbackErrorText(reason: unknown, messages: KjunMessages): string;
4
+ /** Splits a label around the value it quotes, so the value can be set in bold ("Type <b>name</b> to confirm"). */
5
+ export declare function splitAround(text: string, part: string): [
6
+ string,
7
+ string,
8
+ string
9
+ ];
10
+ /** How long typing must pause before a prompt with validateOn: "change" checks its value. */
11
+ export declare const promptValidateDelay = 400;
12
+ /** Typed text and the expected text match regardless of surrounding spaces or how Hangul was composed (NFC/NFD). */
13
+ export declare const sameText: (a: string, b: string) => boolean;
14
+ /** User-perceived characters, so an emoji or a composed sequence counts once. */
15
+ export declare function graphemeCount(text: string): number;
16
+ export interface FeedbackDialogState {
17
+ value: string;
18
+ error: string;
19
+ busy: boolean;
20
+ }
21
+ type Settle = (value: string | boolean | null, reason?: unknown, id?: number) => void;
22
+ interface SessionController {
23
+ getSnapshot(): {
24
+ current?: {
25
+ id: number;
26
+ } | null;
27
+ };
28
+ settle: Settle;
29
+ }
30
+ interface SessionOptions {
31
+ kind: "confirm" | "prompt";
32
+ id: number;
33
+ options: Record<string, unknown> & {
34
+ validator?: (value: string) => boolean | string | Promise<boolean | string>;
35
+ onConfirm?: (value?: string) => unknown;
36
+ requiredValue?: string;
37
+ allowEmpty?: boolean;
38
+ validateOn?: "submit" | "change";
39
+ };
40
+ controller: SessionController;
41
+ messages: KjunMessages;
42
+ get: () => FeedbackDialogState;
43
+ set: (patch: Partial<FeedbackDialogState>) => void;
44
+ }
45
+ /**
46
+ * The confirm/prompt dialog's behaviour without a framework: React, Native and Vue keep the state and call these.
47
+ * Failures from onConfirm stay in the dialog (field error for prompts, a message line for confirms) so the user can
48
+ * retry or cancel; only Cancel, Escape or a success settle the request.
49
+ */
50
+ export declare function createFeedbackSession({ kind, id, options, controller, messages, get, set }: SessionOptions): {
51
+ /** Confirm turns on once a required value matches, a prompt is not empty (unless allowed) and no live error shows. */
52
+ ready(state: FeedbackDialogState): boolean;
53
+ edit(next: string): void;
54
+ cancel(): void;
55
+ submit(): Promise<void>;
56
+ dispose(): void;
57
+ };
58
+ export {};
@@ -14,7 +14,6 @@ export declare const marketGeometry: {
14
14
  readonly sparklineWidth: 72;
15
15
  readonly sparklineHeight: 22;
16
16
  readonly valueSkeletonWidth: 56;
17
- readonly valueSkeletonHeight: 16;
18
17
  readonly actionSkeletonWidth: 32;
19
18
  readonly headerSkeletonHeight: 14;
20
19
  };
@@ -14,7 +14,6 @@ export declare const marketGeometry: {
14
14
  readonly sparklineWidth: 72;
15
15
  readonly sparklineHeight: 22;
16
16
  readonly valueSkeletonWidth: 56;
17
- readonly valueSkeletonHeight: 16;
18
17
  readonly actionSkeletonWidth: 32;
19
18
  readonly headerSkeletonHeight: 14;
20
19
  };
@@ -4,9 +4,14 @@ export declare const kjunMessagesKo: {
4
4
  save: string;
5
5
  close: string;
6
6
  closeNotification: string;
7
+ notifications: string;
8
+ moreNotifications: (count: number) => string;
9
+ showNotifications: string;
10
+ collapseNotifications: string;
7
11
  confirmTitle: string;
8
12
  promptTitle: string;
9
13
  invalidInput: string;
14
+ typeToConfirm: (value: string) => string;
10
15
  dialog: string;
11
16
  panel: string;
12
17
  details: string;
@@ -101,6 +106,8 @@ export declare const kjunMessagesKo: {
101
106
  collapse: string;
102
107
  showDetails: string;
103
108
  ascending: string;
109
+ sortBy: string;
110
+ defaultOrder: string;
104
111
  descending: string;
105
112
  tabs: string;
106
113
  showPath: string;
@@ -4,9 +4,14 @@ export declare const kjunMessagesKo: {
4
4
  save: string;
5
5
  close: string;
6
6
  closeNotification: string;
7
+ notifications: string;
8
+ moreNotifications: (count: number) => string;
9
+ showNotifications: string;
10
+ collapseNotifications: string;
7
11
  confirmTitle: string;
8
12
  promptTitle: string;
9
13
  invalidInput: string;
14
+ typeToConfirm: (value: string) => string;
10
15
  dialog: string;
11
16
  panel: string;
12
17
  details: string;
@@ -101,6 +106,8 @@ export declare const kjunMessagesKo: {
101
106
  collapse: string;
102
107
  showDetails: string;
103
108
  ascending: string;
109
+ sortBy: string;
110
+ defaultOrder: string;
104
111
  descending: string;
105
112
  tabs: string;
106
113
  showPath: string;
@@ -13,9 +13,14 @@ export declare const useKjunMessages: () => {
13
13
  save: string;
14
14
  close: string;
15
15
  closeNotification: string;
16
+ notifications: string;
17
+ moreNotifications: (count: number) => string;
18
+ showNotifications: string;
19
+ collapseNotifications: string;
16
20
  confirmTitle: string;
17
21
  promptTitle: string;
18
22
  invalidInput: string;
23
+ typeToConfirm: (value: string) => string;
19
24
  dialog: string;
20
25
  panel: string;
21
26
  details: string;
@@ -110,6 +115,8 @@ export declare const useKjunMessages: () => {
110
115
  collapse: string;
111
116
  showDetails: string;
112
117
  ascending: string;
118
+ sortBy: string;
119
+ defaultOrder: string;
113
120
  descending: string;
114
121
  tabs: string;
115
122
  showPath: string;