@kjun-ui/react 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,6 @@
1
1
  import { type ButtonSize, type InputSize } from "@kjun-ui/tokens";
2
- import { type KeyboardEvent, type ReactNode, type TextareaHTMLAttributes } from "react";
2
+ import { type ReactNode, type TextareaHTMLAttributes } from "react";
3
+ import { groupKeydown } from "../../../shared/package-runtime/group-keyboard.cjs";
3
4
  export type ChoiceValue = string | number | boolean | null;
4
5
  export interface ChoiceOption<T = ChoiceValue> {
5
6
  value: T;
@@ -62,7 +63,7 @@ export interface KjunTextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextA
62
63
  onValueChange?: (value: string) => void;
63
64
  }
64
65
  export declare const KjunTextarea: import("react").ForwardRefExoticComponent<KjunTextareaProps & import("react").RefAttributes<HTMLTextAreaElement>>;
65
- export declare function groupKeydown(event: KeyboardEvent<HTMLElement>): void;
66
+ export { groupKeydown };
66
67
  export interface KjunButtonGroupProps {
67
68
  value: ChoiceValue;
68
69
  options: ChoiceOption[];
@@ -1,5 +1,6 @@
1
1
  import { type ButtonSize, type InputSize } from "@kjun-ui/tokens";
2
- import { type KeyboardEvent, type ReactNode, type TextareaHTMLAttributes } from "react";
2
+ import { type ReactNode, type TextareaHTMLAttributes } from "react";
3
+ import { groupKeydown } from "../../../shared/package-runtime/group-keyboard.js";
3
4
  export type ChoiceValue = string | number | boolean | null;
4
5
  export interface ChoiceOption<T = ChoiceValue> {
5
6
  value: T;
@@ -62,7 +63,7 @@ export interface KjunTextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextA
62
63
  onValueChange?: (value: string) => void;
63
64
  }
64
65
  export declare const KjunTextarea: import("react").ForwardRefExoticComponent<KjunTextareaProps & import("react").RefAttributes<HTMLTextAreaElement>>;
65
- export declare function groupKeydown(event: KeyboardEvent<HTMLElement>): void;
66
+ export { groupKeydown };
66
67
  export interface KjunButtonGroupProps {
67
68
  value: ChoiceValue;
68
69
  options: ChoiceOption[];
@@ -1,19 +1 @@
1
- import { type ButtonSize, type InputSize, type TypographyRole, type TypographyToken } from "@kjun-ui/tokens";
2
- export declare function typeStyle(role: TypographyRole | TypographyToken): {
3
- fontSize: string;
4
- lineHeight: string;
5
- fontWeight: 700 | 400 | 600 | 500;
6
- letterSpacing: string;
7
- };
8
- export declare function selectionTypeStyle(size: ButtonSize, active: boolean): {
9
- fontWeight: 600 | 500;
10
- fontSize: string;
11
- lineHeight: string;
12
- letterSpacing: string;
13
- };
14
- export declare function inputTypeStyle(size: InputSize): {
15
- fontSize: string;
16
- lineHeight: string;
17
- letterSpacing: string;
18
- fontWeight: 700 | 400 | 600 | 500;
19
- };
1
+ export { typeStyle, selectionTypeStyle, inputTypeStyle } from "../../../shared/package-runtime/typography.cjs";
@@ -1,19 +1 @@
1
- import { type ButtonSize, type InputSize, type TypographyRole, type TypographyToken } from "@kjun-ui/tokens";
2
- export declare function typeStyle(role: TypographyRole | TypographyToken): {
3
- fontSize: string;
4
- lineHeight: string;
5
- fontWeight: 700 | 400 | 600 | 500;
6
- letterSpacing: string;
7
- };
8
- export declare function selectionTypeStyle(size: ButtonSize, active: boolean): {
9
- fontWeight: 600 | 500;
10
- fontSize: string;
11
- lineHeight: string;
12
- letterSpacing: string;
13
- };
14
- export declare function inputTypeStyle(size: InputSize): {
15
- fontSize: string;
16
- lineHeight: string;
17
- letterSpacing: string;
18
- fontWeight: 700 | 400 | 600 | 500;
19
- };
1
+ export { typeStyle, selectionTypeStyle, inputTypeStyle } from "../../../shared/package-runtime/typography.js";
@@ -0,0 +1,7 @@
1
+ /** Arrow, Home and End keys move focus between a group's enabled buttons, following text direction. */
2
+ export declare function groupKeydown(event: {
3
+ key: string;
4
+ target: EventTarget | null;
5
+ currentTarget: EventTarget | null;
6
+ preventDefault(): void;
7
+ }): void;
@@ -0,0 +1,7 @@
1
+ /** Arrow, Home and End keys move focus between a group's enabled buttons, following text direction. */
2
+ export declare function groupKeydown(event: {
3
+ key: string;
4
+ target: EventTarget | null;
5
+ currentTarget: EventTarget | null;
6
+ preventDefault(): void;
7
+ }): void;
@@ -0,0 +1,4 @@
1
+ export declare function selectionIndicator(root: HTMLElement, marker: HTMLElement, tabs?: boolean): {
2
+ update: () => void;
3
+ destroy(): void;
4
+ };
@@ -0,0 +1,4 @@
1
+ export declare function selectionIndicator(root: HTMLElement, marker: HTMLElement, tabs?: boolean): {
2
+ update: () => void;
3
+ destroy(): void;
4
+ };
@@ -0,0 +1,15 @@
1
+ import type { TableSort } from "@kjun-ui/tokens";
2
+ export declare function getValue(row: object, key: string): unknown;
3
+ export declare function sortTableRows<Row extends object>(data: readonly Row[], sort: TableSort, { sortable, sortMode }: {
4
+ sortable?: boolean;
5
+ sortMode?: "client" | "server";
6
+ }): readonly Row[];
7
+ export declare const tableRowKey: (row: object, rowKey: string, index?: number) => string | number;
8
+ export declare function tableSelection<Row extends object>(rows: readonly Row[], selected: readonly Row[], rowKey: string): {
9
+ isSelected: (row: Row) => boolean;
10
+ all: boolean;
11
+ some: boolean;
12
+ };
13
+ export declare const toggleSelectedRow: <Row extends object>(selected: readonly Row[], row: Row, rowKey: string) => Row[];
14
+ export declare const toggleAllRows: <Row extends object>(rows: readonly Row[], all: boolean) => Row[];
15
+ export declare const toggleExpandedRow: (expanded: readonly (string | number)[], id: string | number, single: boolean) => (string | number)[];
@@ -0,0 +1,15 @@
1
+ import type { TableSort } from "@kjun-ui/tokens";
2
+ export declare function getValue(row: object, key: string): unknown;
3
+ export declare function sortTableRows<Row extends object>(data: readonly Row[], sort: TableSort, { sortable, sortMode }: {
4
+ sortable?: boolean;
5
+ sortMode?: "client" | "server";
6
+ }): readonly Row[];
7
+ export declare const tableRowKey: (row: object, rowKey: string, index?: number) => string | number;
8
+ export declare function tableSelection<Row extends object>(rows: readonly Row[], selected: readonly Row[], rowKey: string): {
9
+ isSelected: (row: Row) => boolean;
10
+ all: boolean;
11
+ some: boolean;
12
+ };
13
+ export declare const toggleSelectedRow: <Row extends object>(selected: readonly Row[], row: Row, rowKey: string) => Row[];
14
+ export declare const toggleAllRows: <Row extends object>(rows: readonly Row[], all: boolean) => Row[];
15
+ export declare const toggleExpandedRow: (expanded: readonly (string | number)[], id: string | number, single: boolean) => (string | number)[];
@@ -1,5 +1,5 @@
1
1
  import type { ReactNode } from "react";
2
- import { type TableColumn, type TableCardSection, type TableProps, type useTableModel } from "./table.cjs";
2
+ import type { TableColumn, TableCardSection, TableProps, useTableModel } from "./table.cjs";
3
3
  export declare function tablePresentation<Row extends object>(props: TableProps<Row, unknown>, mobile: boolean): {
4
4
  card: boolean;
5
5
  visible: TableColumn<Row>[];
@@ -1,5 +1,5 @@
1
1
  import type { ReactNode } from "react";
2
- import { type TableColumn, type TableCardSection, type TableProps, type useTableModel } from "./table.js";
2
+ import type { TableColumn, TableCardSection, TableProps, useTableModel } from "./table.js";
3
3
  export declare function tablePresentation<Row extends object>(props: TableProps<Row, unknown>, mobile: boolean): {
4
4
  card: boolean;
5
5
  visible: TableColumn<Row>[];
@@ -1,6 +1,7 @@
1
1
  import { type TableSort, type QueryDisplayProps } from "@kjun-ui/tokens";
2
2
  export type { TableSort } from "@kjun-ui/tokens";
3
3
  import { type ReactNode } from "react";
4
+ export { getValue } from "./table-model.cjs";
4
5
  export interface TableColumn<Row extends object = Record<string, unknown>> {
5
6
  key: string;
6
7
  label: string;
@@ -78,7 +79,6 @@ export interface TableProps<Row extends object = Record<string, unknown>, MaxHei
78
79
  onSearch?: (query: string) => void;
79
80
  onRetry?: () => void;
80
81
  }
81
- export declare function getValue(row: object, key: string): unknown;
82
82
  export declare function useTableModel<Row extends object>(props: TableProps<Row, unknown>): {
83
83
  rows: Row[];
84
84
  key: (row: Row, index?: number) => string | number;
@@ -1,6 +1,7 @@
1
1
  import { type TableSort, type QueryDisplayProps } from "@kjun-ui/tokens";
2
2
  export type { TableSort } from "@kjun-ui/tokens";
3
3
  import { type ReactNode } from "react";
4
+ export { getValue } from "./table-model.js";
4
5
  export interface TableColumn<Row extends object = Record<string, unknown>> {
5
6
  key: string;
6
7
  label: string;
@@ -78,7 +79,6 @@ export interface TableProps<Row extends object = Record<string, unknown>, MaxHei
78
79
  onSearch?: (query: string) => void;
79
80
  onRetry?: () => void;
80
81
  }
81
- export declare function getValue(row: object, key: string): unknown;
82
82
  export declare function useTableModel<Row extends object>(props: TableProps<Row, unknown>): {
83
83
  rows: Row[];
84
84
  key: (row: Row, index?: number) => string | number;
@@ -0,0 +1,19 @@
1
+ import { type ButtonSize, type InputSize, type TypographyRole, type TypographyToken } from "@kjun-ui/tokens";
2
+ export declare function typeStyle(role: TypographyRole | TypographyToken): {
3
+ fontSize: string;
4
+ lineHeight: string;
5
+ fontWeight: 700 | 400 | 600 | 500;
6
+ letterSpacing: string;
7
+ };
8
+ export declare function selectionTypeStyle(size: ButtonSize, active: boolean): {
9
+ fontWeight: 600 | 500;
10
+ fontSize: string;
11
+ lineHeight: string;
12
+ letterSpacing: string;
13
+ };
14
+ export declare function inputTypeStyle(size: InputSize): {
15
+ fontSize: string;
16
+ lineHeight: string;
17
+ letterSpacing: string;
18
+ fontWeight: 700 | 400 | 600 | 500;
19
+ };
@@ -0,0 +1,19 @@
1
+ import { type ButtonSize, type InputSize, type TypographyRole, type TypographyToken } from "@kjun-ui/tokens";
2
+ export declare function typeStyle(role: TypographyRole | TypographyToken): {
3
+ fontSize: string;
4
+ lineHeight: string;
5
+ fontWeight: 700 | 400 | 600 | 500;
6
+ letterSpacing: string;
7
+ };
8
+ export declare function selectionTypeStyle(size: ButtonSize, active: boolean): {
9
+ fontWeight: 600 | 500;
10
+ fontSize: string;
11
+ lineHeight: string;
12
+ letterSpacing: string;
13
+ };
14
+ export declare function inputTypeStyle(size: InputSize): {
15
+ fontSize: string;
16
+ lineHeight: string;
17
+ letterSpacing: string;
18
+ fontWeight: 700 | 400 | 600 | 500;
19
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kjun-ui/react",
3
- "version": "0.5.0",
3
+ "version": "0.6.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.5.0",
44
+ "@kjun-ui/tokens": "0.6.0",
45
45
  "react-aria-components": "1.21.1",
46
- "@kjun-ui/icons": "0.5.0"
46
+ "@kjun-ui/icons": "0.6.0"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "react": "^19.2.3",