@alulore/kumiko 0.18.2 → 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.
- package/dist/dialog/ask.d.ts +7 -0
- package/dist/dialog/ask.js +8 -0
- package/dist/dialog/dialog-content.d.ts +23 -0
- package/dist/dialog/dialog-content.js +15 -0
- package/dist/dialog/dialog-entry.d.ts +14 -0
- package/dist/dialog/dialog-entry.js +111 -0
- package/dist/dialog/dialog-labels.d.ts +23 -0
- package/dist/dialog/dialog-labels.js +16 -0
- package/dist/dialog/dialog-store.d.ts +139 -0
- package/dist/dialog/dialog-store.js +296 -0
- package/dist/dialog/dialog.css +39 -1
- package/dist/dialog/dialog.d.ts +0 -3
- package/dist/dialog/dialog.js +0 -6
- package/dist/dialog/index.d.ts +8 -2
- package/dist/dialog/index.js +7 -2
- package/dist/dialog/leave-guard.d.ts +24 -0
- package/dist/dialog/leave-guard.js +98 -0
- package/dist/dialog/nest.d.ts +14 -0
- package/dist/dialog/nest.js +26 -0
- package/dist/dialog/open-dialog.d.ts +16 -0
- package/dist/dialog/open-dialog.js +13 -0
- package/dist/dialog/overlay-host.d.ts +27 -0
- package/dist/dialog/overlay-host.js +47 -0
- package/dist/dialog/question-dialog.d.ts +21 -0
- package/dist/dialog/question-dialog.js +78 -0
- package/dist/drawer/drawer.css +18 -16
- package/dist/menu/menu.css +21 -17
- package/dist/otp-input/otp-input.css +38 -37
- package/dist/page/index.d.ts +8 -0
- package/dist/page/index.js +8 -0
- package/dist/page/page-action.d.ts +26 -0
- package/dist/page/page-action.js +23 -0
- package/dist/page/page-actions.d.ts +10 -0
- package/dist/page/page-actions.js +66 -0
- package/dist/page/page-back.d.ts +11 -0
- package/dist/page/page-back.js +17 -0
- package/dist/page/page-breadcrumbs.d.ts +21 -0
- package/dist/page/page-breadcrumbs.js +60 -0
- package/dist/page/page-context.d.ts +5 -0
- package/dist/page/page-context.js +13 -0
- package/dist/page/page-fit.d.ts +26 -0
- package/dist/page/page-fit.js +36 -0
- package/dist/page/page-header.d.ts +26 -0
- package/dist/page/page-header.js +16 -0
- package/dist/page/page-icons.d.ts +4 -0
- package/dist/page/page-icons.js +13 -0
- package/dist/page/page-labels.d.ts +12 -0
- package/dist/page/page-labels.js +6 -0
- package/dist/page/page-section.d.ts +14 -0
- package/dist/page/page-section.js +9 -0
- package/dist/page/page.css +422 -0
- package/dist/page/page.d.ts +16 -0
- package/dist/page/page.js +12 -0
- package/dist/page/use-measured-fit.d.ts +22 -0
- package/dist/page/use-measured-fit.js +75 -0
- package/dist/page/use-stuck.d.ts +7 -0
- package/dist/page/use-stuck.js +31 -0
- package/dist/pagination/index.d.ts +3 -0
- package/dist/pagination/index.js +3 -0
- package/dist/pagination/pagination-extras.d.ts +28 -0
- package/dist/pagination/pagination-extras.js +42 -0
- package/dist/pagination/pagination-fit.d.ts +15 -0
- package/dist/pagination/pagination-fit.js +52 -0
- package/dist/pagination/pagination-icons.d.ts +4 -0
- package/dist/pagination/pagination-icons.js +16 -0
- package/dist/pagination/pagination-labels.d.ts +23 -0
- package/dist/pagination/pagination-labels.js +14 -0
- package/dist/pagination/pagination-math.d.ts +7 -0
- package/dist/pagination/pagination-math.js +24 -0
- package/dist/pagination/pagination-motion.d.ts +6 -0
- package/dist/pagination/pagination-motion.js +71 -0
- package/dist/pagination/pagination.css +455 -0
- package/dist/pagination/pagination.d.ts +59 -0
- package/dist/pagination/pagination.js +77 -0
- package/dist/select/select.css +6 -10
- package/dist/server-render.test.js +49 -0
- package/dist/sidebar/app-shell.d.ts +54 -0
- package/dist/sidebar/app-shell.js +28 -0
- package/dist/sidebar/index.d.ts +9 -0
- package/dist/sidebar/index.js +8 -0
- package/dist/sidebar/shell-context.d.ts +30 -0
- package/dist/sidebar/shell-context.js +20 -0
- package/dist/sidebar/shell-sheet.d.ts +7 -0
- package/dist/sidebar/shell-sheet.js +12 -0
- package/dist/sidebar/shell-top-bar.d.ts +8 -0
- package/dist/sidebar/shell-top-bar.js +25 -0
- package/dist/sidebar/sidebar-body.d.ts +5 -0
- package/dist/sidebar/sidebar-body.js +37 -0
- package/dist/sidebar/sidebar-icons.d.ts +4 -0
- package/dist/sidebar/sidebar-icons.js +13 -0
- package/dist/sidebar/sidebar-item.d.ts +26 -0
- package/dist/sidebar/sidebar-item.js +68 -0
- package/dist/sidebar/sidebar-labels.d.ts +14 -0
- package/dist/sidebar/sidebar-labels.js +7 -0
- package/dist/sidebar/sidebar-marker.d.ts +12 -0
- package/dist/sidebar/sidebar-marker.js +77 -0
- package/dist/sidebar/sidebar-storage.d.ts +18 -0
- package/dist/sidebar/sidebar-storage.js +27 -0
- package/dist/sidebar/sidebar-toggle.d.ts +7 -0
- package/dist/sidebar/sidebar-toggle.js +18 -0
- package/dist/sidebar/sidebar.css +587 -0
- package/dist/sidebar/sidebar.d.ts +19 -0
- package/dist/sidebar/sidebar.js +31 -0
- package/dist/sidebar/use-collapsed.d.ts +13 -0
- package/dist/sidebar/use-collapsed.js +20 -0
- package/dist/sidebar/use-narrow.d.ts +4 -0
- package/dist/sidebar/use-narrow.js +18 -0
- package/dist/sidebar/use-shell-focus.d.ts +8 -0
- package/dist/sidebar/use-shell-focus.js +30 -0
- package/dist/sidebar/use-shell-shortcut.d.ts +4 -0
- package/dist/sidebar/use-shell-shortcut.js +32 -0
- package/dist/sidebar/use-shell-state.d.ts +18 -0
- package/dist/sidebar/use-shell-state.js +47 -0
- package/dist/slider/slider.css +9 -6
- package/dist/smooth-caret/caret-geometry.js +10 -4
- package/dist/table/data-table-props.d.ts +96 -0
- package/dist/table/data-table-props.js +1 -0
- package/dist/table/data-table.d.ts +7 -0
- package/dist/table/data-table.js +59 -0
- package/dist/table/index.d.ts +7 -0
- package/dist/table/index.js +5 -0
- package/dist/table/table-actions.d.ts +9 -0
- package/dist/table/table-actions.js +24 -0
- package/dist/table/table-builder.d.ts +60 -0
- package/dist/table/table-builder.js +99 -0
- package/dist/table/table-cells.d.ts +19 -0
- package/dist/table/table-cells.js +67 -0
- package/dist/table/table-columns.d.ts +38 -0
- package/dist/table/table-columns.js +119 -0
- package/dist/table/table-icons.d.ts +3 -0
- package/dist/table/table-icons.js +8 -0
- package/dist/table/table-labels.d.ts +24 -0
- package/dist/table/table-labels.js +17 -0
- package/dist/table/table-model.d.ts +28 -0
- package/dist/table/table-model.js +69 -0
- package/dist/table/table-sections.d.ts +25 -0
- package/dist/table/table-sections.js +79 -0
- package/dist/table/table-state.d.ts +42 -0
- package/dist/table/table-state.js +81 -0
- package/dist/table/table-types.d.ts +86 -0
- package/dist/table/table-types.js +1 -0
- package/dist/table/table.css +919 -0
- package/dist/table/use-table-view.d.ts +30 -0
- package/dist/table/use-table-view.js +147 -0
- package/dist/toast/index.d.ts +1 -2
- package/dist/toast/index.js +1 -2
- package/package.json +44 -1
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from "react";
|
|
2
|
+
import type { TableLabels } from "./table-labels";
|
|
3
|
+
export type TableAlign = "start" | "center" | "end";
|
|
4
|
+
/** A `low` column hides on narrow screens, in either narrow layout. */
|
|
5
|
+
export type ColumnPriority = "high" | "low";
|
|
6
|
+
/** What a sort compares: text by the locale's collation, numbers and dates by value. A missing value sorts last. */
|
|
7
|
+
export type SortValue = string | number | Date | null | undefined;
|
|
8
|
+
export interface SortRule {
|
|
9
|
+
id: string;
|
|
10
|
+
desc: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** Everything a person changes about the table, in one value. `page` starts at 1. */
|
|
13
|
+
export interface TableState {
|
|
14
|
+
sort: SortRule[];
|
|
15
|
+
search: string;
|
|
16
|
+
page: number;
|
|
17
|
+
pageSize: number;
|
|
18
|
+
/** The ids of the selected rows, kept across pages. */
|
|
19
|
+
selected: string[];
|
|
20
|
+
}
|
|
21
|
+
/** What changed, so a server-side app knows whether to fetch. */
|
|
22
|
+
export type TableChange = "sort" | "search" | "page" | "pageSize" | "select";
|
|
23
|
+
/** What a cell renderer gets besides its value: the locale and words the table uses. */
|
|
24
|
+
export interface CellContext {
|
|
25
|
+
locale: string | undefined;
|
|
26
|
+
labels: TableLabels;
|
|
27
|
+
}
|
|
28
|
+
export interface ColumnOptions<Row, Value> {
|
|
29
|
+
/** @defaultValue false */
|
|
30
|
+
sortable?: boolean;
|
|
31
|
+
/** What sorting compares. @defaultValue the value, when it is text, a number or a date */
|
|
32
|
+
sortValue?: (value: Value, row: Row) => SortValue;
|
|
33
|
+
/** Draws the cell. @defaultValue the value as text, or the missing word */
|
|
34
|
+
cell?: (value: Value, row: Row, context: CellContext) => ReactNode;
|
|
35
|
+
/** The text search looks in. @defaultValue the value, when it is text or a number; nothing otherwise */
|
|
36
|
+
searchText?: (value: Value, row: Row) => string | null | undefined;
|
|
37
|
+
/** @defaultValue "start" */
|
|
38
|
+
align?: TableAlign;
|
|
39
|
+
/** @defaultValue "high" */
|
|
40
|
+
priority?: ColumnPriority;
|
|
41
|
+
/** A CSS width, like `"16rem"`. */
|
|
42
|
+
width?: string;
|
|
43
|
+
/** Shows the column's label beside its value in the cards layout. @defaultValue true */
|
|
44
|
+
cardLabel?: boolean;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* A column, built by `column`, `numberColumn`, `dateColumn` or `actionsColumn`. Its value's type stays inside
|
|
48
|
+
* the functions it holds, so a table of mixed columns needs no casts.
|
|
49
|
+
*/
|
|
50
|
+
export interface TableColumn<Row> {
|
|
51
|
+
id: string;
|
|
52
|
+
label: string;
|
|
53
|
+
kind: "data" | "actions";
|
|
54
|
+
sortable: boolean;
|
|
55
|
+
align: TableAlign;
|
|
56
|
+
priority: ColumnPriority;
|
|
57
|
+
width: string | undefined;
|
|
58
|
+
cardLabel: boolean;
|
|
59
|
+
render: (row: Row, context: CellContext) => ReactNode;
|
|
60
|
+
/** The plain text of the cell, for search and for naming a row. Null when the column has none. */
|
|
61
|
+
text: (row: Row) => string | null;
|
|
62
|
+
sortValue: (row: Row) => SortValue;
|
|
63
|
+
}
|
|
64
|
+
export type ActionTone = "neutral" | "danger";
|
|
65
|
+
export interface TableAction {
|
|
66
|
+
id: string;
|
|
67
|
+
label: string;
|
|
68
|
+
icon?: ReactNode;
|
|
69
|
+
/** @defaultValue "neutral" */
|
|
70
|
+
tone?: ActionTone;
|
|
71
|
+
/** Leaves the action out for this row. @defaultValue false */
|
|
72
|
+
hidden?: boolean;
|
|
73
|
+
disabled?: boolean;
|
|
74
|
+
onPress: () => void;
|
|
75
|
+
}
|
|
76
|
+
/** Inline draws each action as an icon button with a tooltip; menu puts them behind one "Actions" button. */
|
|
77
|
+
export type ActionsLook = "inline" | "menu";
|
|
78
|
+
/** Renders the app's own link around a row's content, such as a router link, given the row. */
|
|
79
|
+
export type RowLink<Row> = (row: Row, content: ReactNode) => ReactElement;
|
|
80
|
+
export type TableLook = "lines" | "striped" | "framed" | "plain";
|
|
81
|
+
export type TableDensity = "comfortable" | "compact";
|
|
82
|
+
/** Below `narrowAt`: scroll sideways with the first column pinned, or turn each row into a card. */
|
|
83
|
+
export type TableNarrow = "scroll" | "cards";
|
|
84
|
+
export type TableBreakpoint = "sm" | "md" | "lg";
|
|
85
|
+
/** The table's body, worked out in one place from what it has. */
|
|
86
|
+
export type TableBody = "loading" | "empty" | "no-results" | "rows";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|