@kjun-ui/native 0.0.0-stage → 0.3.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/README.md +44 -2
- package/dist/LICENSE +21 -0
- package/dist/Tabler-LICENSE +21 -0
- package/dist/index.cjs +9679 -0
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +9814 -0
- package/dist/index.web.cjs +9934 -0
- package/dist/index.web.js +10069 -0
- package/dist/styles.css +7695 -0
- package/dist/types/packages/native/src/a11y.d.cts +7 -0
- package/dist/types/packages/native/src/a11y.d.ts +7 -0
- package/dist/types/packages/native/src/actions.d.cts +58 -0
- package/dist/types/packages/native/src/actions.d.ts +58 -0
- package/dist/types/packages/native/src/alert-actions-context.d.cts +1 -0
- package/dist/types/packages/native/src/alert-actions-context.d.ts +1 -0
- package/dist/types/packages/native/src/app-navigation.d.cts +36 -0
- package/dist/types/packages/native/src/app-navigation.d.ts +36 -0
- package/dist/types/packages/native/src/bottom-action-bar-context.d.cts +1 -0
- package/dist/types/packages/native/src/bottom-action-bar-context.d.ts +1 -0
- package/dist/types/packages/native/src/button-group-motion.d.cts +17 -0
- package/dist/types/packages/native/src/button-group-motion.d.ts +17 -0
- package/dist/types/packages/native/src/button.d.cts +25 -0
- package/dist/types/packages/native/src/button.d.ts +25 -0
- package/dist/types/packages/native/src/card-actions-context.d.cts +1 -0
- package/dist/types/packages/native/src/card-actions-context.d.ts +1 -0
- package/dist/types/packages/native/src/card.d.cts +21 -0
- package/dist/types/packages/native/src/card.d.ts +21 -0
- package/dist/types/packages/native/src/chip.d.cts +10 -0
- package/dist/types/packages/native/src/chip.d.ts +10 -0
- package/dist/types/packages/native/src/choice-accessibility.d.cts +4 -0
- package/dist/types/packages/native/src/choice-accessibility.d.ts +4 -0
- package/dist/types/packages/native/src/choice-controls.d.cts +60 -0
- package/dist/types/packages/native/src/choice-controls.d.ts +60 -0
- package/dist/types/packages/native/src/collapse.d.cts +5 -0
- package/dist/types/packages/native/src/collapse.d.ts +5 -0
- package/dist/types/packages/native/src/combobox.d.cts +48 -0
- package/dist/types/packages/native/src/combobox.d.ts +48 -0
- package/dist/types/packages/native/src/compound-control.d.cts +14 -0
- package/dist/types/packages/native/src/compound-control.d.ts +14 -0
- package/dist/types/packages/native/src/controls.d.cts +6 -0
- package/dist/types/packages/native/src/controls.d.ts +6 -0
- package/dist/types/packages/native/src/data-state-context.d.cts +1 -0
- package/dist/types/packages/native/src/data-state-context.d.ts +1 -0
- package/dist/types/packages/native/src/data-state.d.cts +53 -0
- package/dist/types/packages/native/src/data-state.d.ts +53 -0
- package/dist/types/packages/native/src/date-picker.d.cts +14 -0
- package/dist/types/packages/native/src/date-picker.d.ts +14 -0
- package/dist/types/packages/native/src/display-primitives.d.cts +50 -0
- package/dist/types/packages/native/src/display-primitives.d.ts +50 -0
- package/dist/types/packages/native/src/display.d.cts +6 -0
- package/dist/types/packages/native/src/display.d.ts +6 -0
- package/dist/types/packages/native/src/drawer.d.cts +18 -0
- package/dist/types/packages/native/src/drawer.d.ts +18 -0
- package/dist/types/packages/native/src/dropdown.d.cts +39 -0
- package/dist/types/packages/native/src/dropdown.d.ts +39 -0
- package/dist/types/packages/native/src/feedback-context.d.cts +3 -0
- package/dist/types/packages/native/src/feedback-context.d.ts +3 -0
- package/dist/types/packages/native/src/feedback.d.cts +7 -0
- package/dist/types/packages/native/src/feedback.d.ts +7 -0
- package/dist/types/packages/native/src/field-clear.d.cts +8 -0
- package/dist/types/packages/native/src/field-clear.d.ts +8 -0
- package/dist/types/packages/native/src/field-surface.d.cts +86 -0
- package/dist/types/packages/native/src/field-surface.d.ts +86 -0
- package/dist/types/packages/native/src/financial-display.d.cts +87 -0
- package/dist/types/packages/native/src/financial-display.d.ts +87 -0
- package/dist/types/packages/native/src/financial.d.cts +4 -0
- package/dist/types/packages/native/src/financial.d.ts +4 -0
- package/dist/types/packages/native/src/floating-panel.d.cts +31 -0
- package/dist/types/packages/native/src/floating-panel.d.ts +31 -0
- package/dist/types/packages/native/src/form-actions-context.d.cts +3 -0
- package/dist/types/packages/native/src/form-actions-context.d.ts +3 -0
- package/dist/types/packages/native/src/index.d.cts +39 -0
- package/dist/types/packages/native/src/index.d.ts +39 -0
- package/dist/types/packages/native/src/input.d.cts +44 -0
- package/dist/types/packages/native/src/input.d.ts +44 -0
- package/dist/types/packages/native/src/internal.d.cts +7 -0
- package/dist/types/packages/native/src/internal.d.ts +7 -0
- package/dist/types/packages/native/src/kpi-hero.d.cts +35 -0
- package/dist/types/packages/native/src/kpi-hero.d.ts +35 -0
- package/dist/types/packages/native/src/kpi-number-line.d.cts +12 -0
- package/dist/types/packages/native/src/kpi-number-line.d.ts +12 -0
- package/dist/types/packages/native/src/kpi-row.d.cts +32 -0
- package/dist/types/packages/native/src/kpi-row.d.ts +32 -0
- package/dist/types/packages/native/src/kpi.d.cts +4 -0
- package/dist/types/packages/native/src/kpi.d.ts +4 -0
- package/dist/types/packages/native/src/layer-backdrop.d.cts +6 -0
- package/dist/types/packages/native/src/layer-backdrop.d.ts +6 -0
- package/dist/types/packages/native/src/layers.d.cts +8 -0
- package/dist/types/packages/native/src/layers.d.ts +8 -0
- package/dist/types/packages/native/src/list.d.cts +21 -0
- package/dist/types/packages/native/src/list.d.ts +21 -0
- package/dist/types/packages/native/src/market-cards.d.cts +2 -0
- package/dist/types/packages/native/src/market-cards.d.ts +2 -0
- package/dist/types/packages/native/src/market-layout.d.cts +10 -0
- package/dist/types/packages/native/src/market-layout.d.ts +10 -0
- package/dist/types/packages/native/src/market-list.d.cts +2 -0
- package/dist/types/packages/native/src/market-list.d.ts +2 -0
- package/dist/types/packages/native/src/market-model.d.cts +109 -0
- package/dist/types/packages/native/src/market-model.d.ts +109 -0
- package/dist/types/packages/native/src/market-panel.d.cts +5 -0
- package/dist/types/packages/native/src/market-panel.d.ts +5 -0
- package/dist/types/packages/native/src/market-parts.d.cts +10 -0
- package/dist/types/packages/native/src/market-parts.d.ts +10 -0
- package/dist/types/packages/native/src/market-skeleton.d.cts +11 -0
- package/dist/types/packages/native/src/market-skeleton.d.ts +11 -0
- package/dist/types/packages/native/src/market-table.d.cts +2 -0
- package/dist/types/packages/native/src/market-table.d.ts +2 -0
- package/dist/types/packages/native/src/market.d.cts +7 -0
- package/dist/types/packages/native/src/market.d.ts +7 -0
- package/dist/types/packages/native/src/media.d.cts +27 -0
- package/dist/types/packages/native/src/media.d.ts +27 -0
- package/dist/types/packages/native/src/modal-window.d.cts +5 -0
- package/dist/types/packages/native/src/modal-window.d.ts +5 -0
- package/dist/types/packages/native/src/modal.d.cts +46 -0
- package/dist/types/packages/native/src/modal.d.ts +46 -0
- package/dist/types/packages/native/src/motion.d.cts +18 -0
- package/dist/types/packages/native/src/motion.d.ts +18 -0
- package/dist/types/packages/native/src/navigation.d.cts +45 -0
- package/dist/types/packages/native/src/navigation.d.ts +45 -0
- package/dist/types/packages/native/src/number-display.d.cts +49 -0
- package/dist/types/packages/native/src/number-display.d.ts +49 -0
- package/dist/types/packages/native/src/overlay-host.d.cts +9 -0
- package/dist/types/packages/native/src/overlay-host.d.ts +9 -0
- package/dist/types/packages/native/src/popover.d.cts +24 -0
- package/dist/types/packages/native/src/popover.d.ts +24 -0
- package/dist/types/packages/native/src/provider.d.cts +20 -0
- package/dist/types/packages/native/src/provider.d.ts +20 -0
- package/dist/types/packages/native/src/quantity-stepper.d.cts +18 -0
- package/dist/types/packages/native/src/quantity-stepper.d.ts +18 -0
- package/dist/types/packages/native/src/range-input.d.cts +31 -0
- package/dist/types/packages/native/src/range-input.d.ts +31 -0
- package/dist/types/packages/native/src/search-input.d.cts +21 -0
- package/dist/types/packages/native/src/search-input.d.ts +21 -0
- package/dist/types/packages/native/src/select-control.d.cts +30 -0
- package/dist/types/packages/native/src/select-control.d.ts +30 -0
- package/dist/types/packages/native/src/select-options.d.cts +13 -0
- package/dist/types/packages/native/src/select-options.d.ts +13 -0
- package/dist/types/packages/native/src/select.d.cts +10 -0
- package/dist/types/packages/native/src/select.d.ts +10 -0
- package/dist/types/packages/native/src/selection-groups.d.cts +22 -0
- package/dist/types/packages/native/src/selection-groups.d.ts +22 -0
- package/dist/types/packages/native/src/skeleton-base.d.cts +11 -0
- package/dist/types/packages/native/src/skeleton-base.d.ts +11 -0
- package/dist/types/packages/native/src/skeletons.d.cts +28 -0
- package/dist/types/packages/native/src/skeletons.d.ts +28 -0
- package/dist/types/packages/native/src/table-cards.d.cts +2 -0
- package/dist/types/packages/native/src/table-cards.d.ts +2 -0
- package/dist/types/packages/native/src/table-grid.d.cts +2 -0
- package/dist/types/packages/native/src/table-grid.d.ts +2 -0
- package/dist/types/packages/native/src/table-model.d.cts +20 -0
- package/dist/types/packages/native/src/table-model.d.ts +20 -0
- package/dist/types/packages/native/src/table-toolbar.d.cts +2 -0
- package/dist/types/packages/native/src/table-toolbar.d.ts +2 -0
- package/dist/types/packages/native/src/table-view.d.cts +2 -0
- package/dist/types/packages/native/src/table-view.d.ts +2 -0
- package/dist/types/packages/native/src/table.d.cts +3 -0
- package/dist/types/packages/native/src/table.d.ts +3 -0
- package/dist/types/packages/native/src/tabs-accessibility.d.cts +4 -0
- package/dist/types/packages/native/src/tabs-accessibility.d.ts +4 -0
- package/dist/types/packages/native/src/tabs.d.cts +31 -0
- package/dist/types/packages/native/src/tabs.d.ts +31 -0
- package/dist/types/packages/native/src/textarea.d.cts +12 -0
- package/dist/types/packages/native/src/textarea.d.ts +12 -0
- package/dist/types/packages/native/src/time-picker.d.cts +17 -0
- package/dist/types/packages/native/src/time-picker.d.ts +17 -0
- package/dist/types/packages/native/src/toast-reflow.d.cts +3 -0
- package/dist/types/packages/native/src/toast-reflow.d.ts +3 -0
- package/dist/types/packages/native/src/toast-stack.d.cts +6 -0
- package/dist/types/packages/native/src/toast-stack.d.ts +6 -0
- package/dist/types/packages/native/src/toast.d.cts +5 -0
- package/dist/types/packages/native/src/toast.d.ts +5 -0
- package/dist/types/packages/native/src/top-navigation-context.d.cts +5 -0
- package/dist/types/packages/native/src/top-navigation-context.d.ts +5 -0
- package/dist/types/packages/native/src/typography.d.cts +20 -0
- package/dist/types/packages/native/src/typography.d.ts +20 -0
- package/dist/types/shared/package-runtime/action-size.d.cts +9 -0
- package/dist/types/shared/package-runtime/action-size.d.ts +9 -0
- package/dist/types/shared/package-runtime/combobox.d.cts +21 -0
- package/dist/types/shared/package-runtime/combobox.d.ts +21 -0
- package/dist/types/shared/package-runtime/component-icons.d.cts +2 -0
- package/dist/types/shared/package-runtime/component-icons.d.ts +2 -0
- package/dist/types/shared/package-runtime/content-presence.d.cts +3 -0
- package/dist/types/shared/package-runtime/content-presence.d.ts +3 -0
- package/dist/types/shared/package-runtime/elevation.d.cts +10 -0
- package/dist/types/shared/package-runtime/elevation.d.ts +10 -0
- package/dist/types/shared/package-runtime/feedback-dialog.d.cts +10 -0
- package/dist/types/shared/package-runtime/feedback-dialog.d.ts +10 -0
- package/dist/types/shared/package-runtime/feedback-motion.d.cts +11 -0
- package/dist/types/shared/package-runtime/feedback-motion.d.ts +11 -0
- package/dist/types/shared/package-runtime/form-actions.d.cts +3 -0
- package/dist/types/shared/package-runtime/form-actions.d.ts +3 -0
- package/dist/types/shared/package-runtime/icon-context.d.cts +14 -0
- package/dist/types/shared/package-runtime/icon-context.d.ts +14 -0
- package/dist/types/shared/package-runtime/icon-registry.d.cts +10 -0
- package/dist/types/shared/package-runtime/icon-registry.d.ts +10 -0
- package/dist/types/shared/package-runtime/layer-keyboard.d.cts +3 -0
- package/dist/types/shared/package-runtime/layer-keyboard.d.ts +3 -0
- package/dist/types/shared/package-runtime/layer-state.d.cts +40 -0
- package/dist/types/shared/package-runtime/layer-state.d.ts +40 -0
- package/dist/types/shared/package-runtime/market-cards.d.cts +44 -0
- package/dist/types/shared/package-runtime/market-cards.d.ts +44 -0
- package/dist/types/shared/package-runtime/market-layout.d.cts +40 -0
- package/dist/types/shared/package-runtime/market-layout.d.ts +40 -0
- package/dist/types/shared/package-runtime/navigation.d.cts +6 -0
- package/dist/types/shared/package-runtime/navigation.d.ts +6 -0
- package/dist/types/shared/package-runtime/number-motion.d.cts +4 -0
- package/dist/types/shared/package-runtime/number-motion.d.ts +4 -0
- package/dist/types/shared/package-runtime/options.d.cts +34 -0
- package/dist/types/shared/package-runtime/options.d.ts +34 -0
- package/dist/types/shared/package-runtime/relative-time.d.cts +1 -0
- package/dist/types/shared/package-runtime/relative-time.d.ts +1 -0
- package/dist/types/shared/package-runtime/search-input.d.cts +20 -0
- package/dist/types/shared/package-runtime/search-input.d.ts +20 -0
- package/dist/types/shared/package-runtime/select.d.cts +10 -0
- package/dist/types/shared/package-runtime/select.d.ts +10 -0
- package/dist/types/shared/package-runtime/table-presentation.d.cts +56 -0
- package/dist/types/shared/package-runtime/table-presentation.d.ts +56 -0
- package/dist/types/shared/package-runtime/table.d.cts +96 -0
- package/dist/types/shared/package-runtime/table.d.ts +96 -0
- package/dist/types/shared/package-runtime/use-layer.d.cts +64 -0
- package/dist/types/shared/package-runtime/use-layer.d.ts +64 -0
- package/dist/types/shared/package-runtime/use-number-motion.d.cts +1 -0
- package/dist/types/shared/package-runtime/use-number-motion.d.ts +1 -0
- package/package.json +62 -4
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { type TableSort, type QueryDisplayProps } from "@kjun-ui/tokens";
|
|
2
|
+
export type { TableSort } from "@kjun-ui/tokens";
|
|
3
|
+
import { type ReactNode } from "react";
|
|
4
|
+
export interface TableColumn<Row extends object = Record<string, unknown>> {
|
|
5
|
+
key: string;
|
|
6
|
+
label: string;
|
|
7
|
+
sortable?: boolean;
|
|
8
|
+
width?: number | string;
|
|
9
|
+
align?: "left" | "center" | "right";
|
|
10
|
+
type?: "number" | "date" | "datetime" | "text";
|
|
11
|
+
format?: (value: unknown, row: Row) => ReactNode;
|
|
12
|
+
render?: (value: unknown, row: Row, index: number) => ReactNode;
|
|
13
|
+
pill?: boolean;
|
|
14
|
+
badge?: boolean;
|
|
15
|
+
inlineInCard?: boolean;
|
|
16
|
+
hideInCard?: boolean;
|
|
17
|
+
hideEmptyInCard?: boolean;
|
|
18
|
+
fullWidthInCard?: boolean;
|
|
19
|
+
secondary?: boolean;
|
|
20
|
+
className?: string;
|
|
21
|
+
headerClass?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface TableCardSection {
|
|
24
|
+
key?: string;
|
|
25
|
+
label?: string;
|
|
26
|
+
labelAlign?: "left" | "right";
|
|
27
|
+
layout?: "stack" | "grid" | "metrics";
|
|
28
|
+
columns: string[];
|
|
29
|
+
}
|
|
30
|
+
export interface TablePagination {
|
|
31
|
+
page: number;
|
|
32
|
+
total: number;
|
|
33
|
+
pageSize?: number;
|
|
34
|
+
}
|
|
35
|
+
export interface TableProps<Row extends object = Record<string, unknown>, MaxHeight = number> extends QueryDisplayProps {
|
|
36
|
+
columns: TableColumn<Row>[];
|
|
37
|
+
data?: Row[];
|
|
38
|
+
rowKey?: string;
|
|
39
|
+
skeletonRows?: number;
|
|
40
|
+
emptyText?: string;
|
|
41
|
+
sortable?: boolean;
|
|
42
|
+
sort?: TableSort | null;
|
|
43
|
+
sortMode?: "client" | "server";
|
|
44
|
+
hoverable?: boolean;
|
|
45
|
+
searchable?: boolean;
|
|
46
|
+
searchPlaceholder?: string;
|
|
47
|
+
stickyHeader?: boolean;
|
|
48
|
+
maxHeight?: MaxHeight;
|
|
49
|
+
pagination?: TablePagination | null;
|
|
50
|
+
compact?: boolean;
|
|
51
|
+
striped?: boolean;
|
|
52
|
+
ariaLabel?: string;
|
|
53
|
+
responsive?: "card" | "compact" | "none" | null;
|
|
54
|
+
mobileColumns?: string[];
|
|
55
|
+
cardTitle?: string | null;
|
|
56
|
+
cardSubtitle?: string | null;
|
|
57
|
+
cardSections?: TableCardSection[];
|
|
58
|
+
expandable?: boolean;
|
|
59
|
+
expandedRows?: (string | number)[];
|
|
60
|
+
expandSingle?: boolean;
|
|
61
|
+
rowClass?: string | ((row: Row, index: number) => string);
|
|
62
|
+
selectable?: boolean;
|
|
63
|
+
selected?: Row[];
|
|
64
|
+
toolbar?: ReactNode;
|
|
65
|
+
emptyContent?: ReactNode;
|
|
66
|
+
renderCell?: (value: unknown, column: TableColumn<Row>, row: Row, index: number) => ReactNode;
|
|
67
|
+
formatValue?: (value: unknown, column: TableColumn<Row>, row: Row) => ReactNode;
|
|
68
|
+
renderExpand?: (row: Row, index: number) => ReactNode;
|
|
69
|
+
renderSelectionToolbar?: (selected: Row[]) => ReactNode;
|
|
70
|
+
onSortChange?: (value: {
|
|
71
|
+
key: string;
|
|
72
|
+
order: "asc" | "desc";
|
|
73
|
+
}) => void;
|
|
74
|
+
onSelectionChange?: (selected: Row[]) => void;
|
|
75
|
+
onExpandedRowsChange?: (keys: (string | number)[]) => void;
|
|
76
|
+
onPageChange?: (page: number) => void;
|
|
77
|
+
onRowClick?: (row: Row, index: number) => void;
|
|
78
|
+
onSearch?: (query: string) => void;
|
|
79
|
+
onRetry?: () => void;
|
|
80
|
+
}
|
|
81
|
+
export declare function getValue(row: object, key: string): unknown;
|
|
82
|
+
export declare function useTableModel<Row extends object>(props: TableProps<Row, unknown>): {
|
|
83
|
+
rows: Row[];
|
|
84
|
+
key: (row: Row, index?: number) => string | number;
|
|
85
|
+
sort: TableSort;
|
|
86
|
+
search: string;
|
|
87
|
+
all: boolean;
|
|
88
|
+
some: boolean;
|
|
89
|
+
selectedRow: (row: Row) => boolean;
|
|
90
|
+
expanded: (string | number)[];
|
|
91
|
+
searchChange: (q: string) => void;
|
|
92
|
+
sortColumn: (col: TableColumn<Row>) => void;
|
|
93
|
+
toggleRow: (row: Row) => void | undefined;
|
|
94
|
+
toggleAll: () => void | undefined;
|
|
95
|
+
toggleExpand: (row: Row, index: number) => void;
|
|
96
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type FocusTarget, type LayerKind } from "./layer-state.cjs";
|
|
3
|
+
export declare const LayerScope: import("react").Context<string | undefined>;
|
|
4
|
+
export declare function LayerProvider({ children, escapeKeyUpFallback }: {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
escapeKeyUpFallback?: boolean;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function useLayerState(): {
|
|
9
|
+
entries: Map<string, import("./layer-state.cjs").LayerEntry>;
|
|
10
|
+
topWindow: () => import("./layer-state.cjs").LayerEntry | undefined;
|
|
11
|
+
top: () => import("./layer-state.cjs").LayerEntry | undefined;
|
|
12
|
+
windowOf: (id?: string) => string | undefined;
|
|
13
|
+
isRestoredFocus(target?: FocusTarget | null): boolean;
|
|
14
|
+
clearRestoredFocus(target?: FocusTarget | null): void;
|
|
15
|
+
markClosing(id: string): void;
|
|
16
|
+
subscribe(listener: () => void): () => void;
|
|
17
|
+
snapshot: () => number;
|
|
18
|
+
open(id: string, kind: LayerKind, parent: string | undefined, dismissCallback: () => void, returnTarget?: FocusTarget | null): import("./layer-state.cjs").LayerEntry;
|
|
19
|
+
remove(id: string, focused?: FocusTarget | null): FocusTarget | null | undefined;
|
|
20
|
+
requestClose(id: string): void;
|
|
21
|
+
isActive(id: string): boolean;
|
|
22
|
+
isBlocked(id: string): boolean;
|
|
23
|
+
zIndex(id?: string, role?: "backdrop" | "content" | "popup" | "tooltip" | "toast"): number;
|
|
24
|
+
};
|
|
25
|
+
/** The requested state can remain true while a new window suppresses its popup. */
|
|
26
|
+
export declare function usePopupExpanded(open: boolean, trigger: {
|
|
27
|
+
current: FocusTarget | null;
|
|
28
|
+
}): boolean;
|
|
29
|
+
export declare function usePopupFocusGuard(trigger: {
|
|
30
|
+
current: FocusTarget | null;
|
|
31
|
+
}): {
|
|
32
|
+
canOpen: () => boolean;
|
|
33
|
+
clear: () => void;
|
|
34
|
+
};
|
|
35
|
+
export declare function useActiveLayerScope(): boolean;
|
|
36
|
+
export declare function focusTrigger(target: FocusTarget | null | undefined): FocusTarget | HTMLElement | null | undefined;
|
|
37
|
+
export declare function useLayer(open: boolean, present: boolean, kind: LayerKind, close: () => void, trigger?: {
|
|
38
|
+
current: FocusTarget | null;
|
|
39
|
+
}): {
|
|
40
|
+
id: string;
|
|
41
|
+
state: {
|
|
42
|
+
entries: Map<string, import("./layer-state.cjs").LayerEntry>;
|
|
43
|
+
topWindow: () => import("./layer-state.cjs").LayerEntry | undefined;
|
|
44
|
+
top: () => import("./layer-state.cjs").LayerEntry | undefined;
|
|
45
|
+
windowOf: (id?: string) => string | undefined;
|
|
46
|
+
isRestoredFocus(target?: FocusTarget | null): boolean;
|
|
47
|
+
clearRestoredFocus(target?: FocusTarget | null): void;
|
|
48
|
+
markClosing(id: string): void;
|
|
49
|
+
subscribe(listener: () => void): () => void;
|
|
50
|
+
snapshot: () => number;
|
|
51
|
+
open(id: string, kind: LayerKind, parent: string | undefined, dismissCallback: () => void, returnTarget?: FocusTarget | null): import("./layer-state.cjs").LayerEntry;
|
|
52
|
+
remove(id: string, focused?: FocusTarget | null): FocusTarget | null | undefined;
|
|
53
|
+
requestClose(id: string): void;
|
|
54
|
+
isActive(id: string): boolean;
|
|
55
|
+
isBlocked(id: string): boolean;
|
|
56
|
+
zIndex(id?: string, role?: "backdrop" | "content" | "popup" | "tooltip" | "toast"): number;
|
|
57
|
+
};
|
|
58
|
+
keyboardManaged: boolean;
|
|
59
|
+
scopeActive: boolean;
|
|
60
|
+
blocked: boolean;
|
|
61
|
+
active: boolean;
|
|
62
|
+
zIndex: number;
|
|
63
|
+
close: () => void;
|
|
64
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type FocusTarget, type LayerKind } from "./layer-state.js";
|
|
3
|
+
export declare const LayerScope: import("react").Context<string | undefined>;
|
|
4
|
+
export declare function LayerProvider({ children, escapeKeyUpFallback }: {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
escapeKeyUpFallback?: boolean;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function useLayerState(): {
|
|
9
|
+
entries: Map<string, import("./layer-state.js").LayerEntry>;
|
|
10
|
+
topWindow: () => import("./layer-state.js").LayerEntry | undefined;
|
|
11
|
+
top: () => import("./layer-state.js").LayerEntry | undefined;
|
|
12
|
+
windowOf: (id?: string) => string | undefined;
|
|
13
|
+
isRestoredFocus(target?: FocusTarget | null): boolean;
|
|
14
|
+
clearRestoredFocus(target?: FocusTarget | null): void;
|
|
15
|
+
markClosing(id: string): void;
|
|
16
|
+
subscribe(listener: () => void): () => void;
|
|
17
|
+
snapshot: () => number;
|
|
18
|
+
open(id: string, kind: LayerKind, parent: string | undefined, dismissCallback: () => void, returnTarget?: FocusTarget | null): import("./layer-state.js").LayerEntry;
|
|
19
|
+
remove(id: string, focused?: FocusTarget | null): FocusTarget | null | undefined;
|
|
20
|
+
requestClose(id: string): void;
|
|
21
|
+
isActive(id: string): boolean;
|
|
22
|
+
isBlocked(id: string): boolean;
|
|
23
|
+
zIndex(id?: string, role?: "backdrop" | "content" | "popup" | "tooltip" | "toast"): number;
|
|
24
|
+
};
|
|
25
|
+
/** The requested state can remain true while a new window suppresses its popup. */
|
|
26
|
+
export declare function usePopupExpanded(open: boolean, trigger: {
|
|
27
|
+
current: FocusTarget | null;
|
|
28
|
+
}): boolean;
|
|
29
|
+
export declare function usePopupFocusGuard(trigger: {
|
|
30
|
+
current: FocusTarget | null;
|
|
31
|
+
}): {
|
|
32
|
+
canOpen: () => boolean;
|
|
33
|
+
clear: () => void;
|
|
34
|
+
};
|
|
35
|
+
export declare function useActiveLayerScope(): boolean;
|
|
36
|
+
export declare function focusTrigger(target: FocusTarget | null | undefined): FocusTarget | HTMLElement | null | undefined;
|
|
37
|
+
export declare function useLayer(open: boolean, present: boolean, kind: LayerKind, close: () => void, trigger?: {
|
|
38
|
+
current: FocusTarget | null;
|
|
39
|
+
}): {
|
|
40
|
+
id: string;
|
|
41
|
+
state: {
|
|
42
|
+
entries: Map<string, import("./layer-state.js").LayerEntry>;
|
|
43
|
+
topWindow: () => import("./layer-state.js").LayerEntry | undefined;
|
|
44
|
+
top: () => import("./layer-state.js").LayerEntry | undefined;
|
|
45
|
+
windowOf: (id?: string) => string | undefined;
|
|
46
|
+
isRestoredFocus(target?: FocusTarget | null): boolean;
|
|
47
|
+
clearRestoredFocus(target?: FocusTarget | null): void;
|
|
48
|
+
markClosing(id: string): void;
|
|
49
|
+
subscribe(listener: () => void): () => void;
|
|
50
|
+
snapshot: () => number;
|
|
51
|
+
open(id: string, kind: LayerKind, parent: string | undefined, dismissCallback: () => void, returnTarget?: FocusTarget | null): import("./layer-state.js").LayerEntry;
|
|
52
|
+
remove(id: string, focused?: FocusTarget | null): FocusTarget | null | undefined;
|
|
53
|
+
requestClose(id: string): void;
|
|
54
|
+
isActive(id: string): boolean;
|
|
55
|
+
isBlocked(id: string): boolean;
|
|
56
|
+
zIndex(id?: string, role?: "backdrop" | "content" | "popup" | "tooltip" | "toast"): number;
|
|
57
|
+
};
|
|
58
|
+
keyboardManaged: boolean;
|
|
59
|
+
scopeActive: boolean;
|
|
60
|
+
blocked: boolean;
|
|
61
|
+
active: boolean;
|
|
62
|
+
zIndex: number;
|
|
63
|
+
close: () => void;
|
|
64
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useNumberMotion(value: number | string, animated: boolean, fromPrevious: boolean, reduced: boolean): string | number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useNumberMotion(value: number | string, animated: boolean, fromPrevious: boolean, reduced: boolean): string | number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,64 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kjun-ui/native",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"homepage": "https://ui.kjun.dev",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/kjun-studio/kjun-ui.git",
|
|
9
|
+
"directory": "packages/native"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/kjun-studio/kjun-ui/issues"
|
|
13
|
+
},
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"access": "public"
|
|
16
|
+
},
|
|
17
|
+
"description": "KJUN UI components for React Native with shared geometry and interaction contracts.",
|
|
18
|
+
"type": "module",
|
|
19
|
+
"main": "./dist/index.cjs",
|
|
20
|
+
"module": "./dist/index.js",
|
|
21
|
+
"browser": "./dist/index.web.js",
|
|
22
|
+
"react-native": "./dist/index.js",
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"files": [
|
|
25
|
+
"dist",
|
|
26
|
+
"README.md"
|
|
27
|
+
],
|
|
28
|
+
"sideEffects": [
|
|
29
|
+
"**/*.css"
|
|
30
|
+
],
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"import": {
|
|
34
|
+
"types": "./dist/index.d.ts",
|
|
35
|
+
"react-native": "./dist/index.js",
|
|
36
|
+
"browser": "./dist/index.web.js",
|
|
37
|
+
"default": "./dist/index.js"
|
|
38
|
+
},
|
|
39
|
+
"require": {
|
|
40
|
+
"types": "./dist/index.d.cts",
|
|
41
|
+
"react-native": "./dist/index.cjs",
|
|
42
|
+
"browser": "./dist/index.web.cjs",
|
|
43
|
+
"default": "./dist/index.cjs"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"./styles.css": "./dist/styles.css",
|
|
47
|
+
"./package.json": "./package.json"
|
|
48
|
+
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"@kjun-ui/tokens": "0.3.0",
|
|
51
|
+
"@kjun-ui/icons": "0.3.0"
|
|
52
|
+
},
|
|
53
|
+
"peerDependencies": {
|
|
54
|
+
"react": "^19.2.3",
|
|
55
|
+
"react-dom": "^19.2.3",
|
|
56
|
+
"react-native": "^0.86.3",
|
|
57
|
+
"react-native-svg": "^15.15.5"
|
|
58
|
+
},
|
|
59
|
+
"peerDependenciesMeta": {
|
|
60
|
+
"react-dom": {
|
|
61
|
+
"optional": true
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|