prime-ui-kit 0.9.1 → 0.9.3
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 +30 -12
- package/dist/chunks/{chunk-NHOWNIAR.js → chunk-6JTZOA5I.js} +1472 -671
- package/dist/chunks/{chunk-DB2Y3XXA.js → chunk-OAE4IQX2.js} +2845 -1732
- package/dist/chunks/{chunk-KCQFOORX.js → chunk-U5SR2LZR.js} +17 -4
- package/dist/color-picker.js +2 -2
- package/dist/components/button/Button.d.ts +19 -2
- package/dist/components/card/Card.d.ts +1 -1
- package/dist/components/code-block/CodeBlock.d.ts +1 -1
- package/dist/components/color-picker/ColorPicker.d.ts +1 -1
- package/dist/components/data-table/DataTable.d.ts +6 -1
- package/dist/components/data-table/Row.d.ts +3 -1
- package/dist/components/data-table/rows.d.ts +4 -0
- package/dist/components/data-table/types.d.ts +5 -0
- package/dist/components/digit-input/DigitInput.d.ts +6 -1
- package/dist/components/dnd/Dnd.d.ts +1 -1
- package/dist/components/dnd/dragSession.d.ts +9 -0
- package/dist/components/dnd/useDropTarget.d.ts +5 -0
- package/dist/components/dnd/useFlipList.d.ts +3 -3
- package/dist/components/drawer/Drawer.d.ts +8 -5
- package/dist/components/dropdown/Dropdown.d.ts +17 -0
- package/dist/components/index.d.ts +9 -2
- package/dist/components/input/Input.d.ts +16 -1
- package/dist/components/input/passwordStrength.d.ts +9 -0
- package/dist/components/kanban/Kanban.d.ts +129 -0
- package/dist/components/modal/Modal.d.ts +5 -2
- package/dist/components/page-toolbar/PageToolbar.d.ts +53 -0
- package/dist/components/progress-bar/ProgressBar.d.ts +16 -1
- package/dist/components/segmented-control/SegmentedControl.d.ts +5 -2
- package/dist/components/sparkline/Sparkline.d.ts +26 -0
- package/dist/components/tabs/Tabs.d.ts +5 -2
- package/dist/hooks/useEdgeOverflow.d.ts +16 -0
- package/dist/hooks/useMediaQuery.d.ts +7 -0
- package/dist/hooks/useSwipeDismiss.d.ts +34 -0
- package/dist/icons/registry.d.ts +2 -0
- package/dist/index.css +2977 -1306
- package/dist/index.d.ts +1 -0
- package/dist/index.js +17 -3
- package/dist/internal/CheckMark.d.ts +12 -0
- package/dist/internal/MorphText.d.ts +12 -0
- package/dist/internal/RollingNumber.d.ts +14 -0
- package/dist/internal/overlay/FloatingPanel.d.ts +3 -1
- package/dist/internal/overlay/useFloatingLayer.d.ts +11 -1
- package/dist/internal/surfaceDepth.d.ts +25 -0
- package/dist/internal/swatch.d.ts +4 -1
- package/dist/internal/touchTarget.d.ts +4 -0
- package/dist/layout/app-header/AppHeader.d.ts +110 -0
- package/dist/layout/app-shell/AppShell.d.ts +16 -11
- package/dist/layout/bottom-nav/BottomNav.d.ts +80 -0
- package/dist/layout/index.d.ts +5 -1
- package/dist/motion/celebrate.d.ts +18 -0
- package/dist/tokens/layers.d.ts +37 -0
- package/dist/tokens/naming.d.ts +1 -1
- package/dist/tokens/primitives.d.ts +4 -0
- package/dist/tokens/semantic.d.ts +122 -56
- package/dist/tokens/themes/dark.d.ts +10 -14
- package/package.json +3 -2
- package/src/components/accordion/COMPONENT.md +5 -5
- package/src/components/avatar/COMPONENT.md +1 -1
- package/src/components/badge/COMPONENT.md +2 -2
- package/src/components/banner/COMPONENT.md +1 -1
- package/src/components/button/COMPONENT.md +26 -5
- package/src/components/button/examples/download.tsx +45 -0
- package/src/components/button/examples/hold-to-confirm.tsx +23 -0
- package/src/components/button/examples/label-morph.tsx +33 -0
- package/src/components/card/COMPONENT.md +4 -2
- package/src/components/card/examples/narrow.tsx +2 -2
- package/src/components/card/examples/panel-chart.tsx +1 -1
- package/src/components/card/examples/variants.tsx +1 -1
- package/src/components/checkbox/examples/examples.module.css +5 -3
- package/src/components/code-block/COMPONENT.md +6 -6
- package/src/components/code-block/examples/overview.tsx +1 -1
- package/src/components/code-block/examples/variants.tsx +1 -1
- package/src/components/color-picker/COMPONENT.md +1 -1
- package/src/components/color-swatches/COMPONENT.md +5 -5
- package/src/components/command-menu/COMPONENT.md +1 -1
- package/src/components/crossfade/COMPONENT.md +1 -1
- package/src/components/crossfade/examples/overview.tsx +3 -3
- package/src/components/data-table/COMPONENT.md +24 -10
- package/src/components/data-table/examples/columns-visibility.tsx +167 -0
- package/src/components/digit-input/COMPONENT.md +15 -13
- package/src/components/digit-input/examples/examples.module.css +8 -0
- package/src/components/digit-input/examples/in-form.tsx +2 -5
- package/src/components/digit-input/examples/on-complete.tsx +7 -6
- package/src/components/digit-input/examples/sizes.tsx +1 -1
- package/src/components/divider/COMPONENT.md +1 -1
- package/src/components/dnd/COMPONENT.md +3 -3
- package/src/components/dnd/examples/examples.module.css +4 -4
- package/src/components/drawer/COMPONENT.md +17 -9
- package/src/components/drawer/examples/date-sheet.tsx +41 -0
- package/src/components/drawer/examples/examples.module.css +5 -0
- package/src/components/drawer/examples/placement.tsx +4 -2
- package/src/components/dropdown/COMPONENT.md +20 -6
- package/src/components/dropdown/examples/checkbox-items.tsx +48 -0
- package/src/components/dropdown/examples/examples.module.css +1 -1
- package/src/components/empty-page/COMPONENT.md +1 -1
- package/src/components/empty-page/examples/examples.module.css +1 -1
- package/src/components/example-frame/COMPONENT.md +1 -1
- package/src/components/input/COMPONENT.md +10 -1
- package/src/components/input/examples/password-strength.tsx +12 -0
- package/src/components/kanban/COMPONENT.md +181 -0
- package/src/components/kanban/examples/controlled.tsx +78 -0
- package/src/components/kanban/examples/examples.module.css +31 -0
- package/src/components/kanban/examples/limits.tsx +58 -0
- package/src/components/kanban/examples/narrow.tsx +76 -0
- package/src/components/kanban/examples/overview.tsx +130 -0
- package/src/components/kanban/examples/states.tsx +75 -0
- package/src/components/kanban/examples/structure.tsx +76 -0
- package/src/components/login-form/COMPONENT.md +5 -5
- package/src/components/login-form/examples/register.tsx +2 -2
- package/src/components/login-form/examples/reset-password.tsx +2 -2
- package/src/components/modal/COMPONENT.md +11 -8
- package/src/components/modal/examples/examples.module.css +2 -2
- package/src/components/notification/COMPONENT.md +2 -2
- package/src/components/page-content/COMPONENT.md +1 -1
- package/src/components/page-content/examples/examples.module.css +1 -1
- package/src/components/page-toolbar/COMPONENT.md +142 -0
- package/src/components/page-toolbar/examples/examples.module.css +16 -0
- package/src/components/page-toolbar/examples/narrow.tsx +103 -0
- package/src/components/page-toolbar/examples/overview.tsx +113 -0
- package/src/components/page-toolbar/examples/save-changes.tsx +40 -0
- package/src/components/page-toolbar/examples/without-search.tsx +60 -0
- package/src/components/popover/COMPONENT.md +5 -4
- package/src/components/progress-bar/COMPONENT.md +6 -2
- package/src/components/progress-bar/examples/examples.module.css +7 -0
- package/src/components/progress-bar/examples/milestone.tsx +43 -0
- package/src/components/progress-bar/examples/steps.tsx +35 -0
- package/src/components/progress-circle/COMPONENT.md +1 -1
- package/src/components/scroll-container/COMPONENT.md +1 -1
- package/src/components/segmented-control/COMPONENT.md +8 -8
- package/src/components/segmented-control/examples/full-width.tsx +1 -1
- package/src/components/select/COMPONENT.md +2 -1
- package/src/components/skeleton/COMPONENT.md +1 -1
- package/src/components/skeleton/examples/with-crossfade.tsx +3 -3
- package/src/components/smart-filter/COMPONENT.md +2 -0
- package/src/components/sparkline/COMPONENT.md +98 -0
- package/src/components/sparkline/examples/examples.module.css +13 -0
- package/src/components/sparkline/examples/overview.tsx +27 -0
- package/src/components/sparkline/examples/period.tsx +46 -0
- package/src/components/spinner/COMPONENT.md +1 -1
- package/src/components/tabs/COMPONENT.md +24 -22
- package/src/components/tabs/examples/closable.tsx +1 -1
- package/src/components/tabs/examples/examples.module.css +14 -0
- package/src/components/tabs/examples/orientation.tsx +87 -33
- package/src/components/tooltip/COMPONENT.md +8 -6
- package/src/components/tooltip/examples/examples.module.css +2 -2
- package/src/layout/app-header/COMPONENT.md +178 -0
- package/src/layout/app-header/examples/breadcrumbs.tsx +36 -0
- package/src/layout/app-header/examples/examples.module.css +47 -0
- package/src/layout/app-header/examples/in-app-shell.tsx +70 -0
- package/src/layout/app-header/examples/narrow.tsx +29 -0
- package/src/layout/app-header/examples/overview.tsx +36 -0
- package/src/layout/app-shell/COMPONENT.md +35 -29
- package/src/layout/app-shell/examples/examples.module.css +17 -2
- package/src/layout/app-shell/examples/footer.tsx +59 -0
- package/src/layout/app-shell/examples/overview.tsx +19 -8
- package/src/layout/bottom-nav/COMPONENT.md +153 -0
- package/src/layout/bottom-nav/examples/examples.module.css +39 -0
- package/src/layout/bottom-nav/examples/floating.tsx +89 -0
- package/src/layout/bottom-nav/examples/icon-only.tsx +41 -0
- package/src/layout/bottom-nav/examples/in-app-shell.tsx +64 -0
- package/src/layout/bottom-nav/examples/overview.tsx +44 -0
- package/src/layout/bottom-nav/examples/router.tsx +31 -0
- package/src/layout/bottom-nav/examples/structure.tsx +47 -0
- package/src/layout/sidebar/COMPONENT.md +14 -13
- package/src/layout/sidebar/examples/examples.module.css +5 -5
- package/src/styles/globals.css +125 -2
- package/src/styles/theme-dark.css +39 -13
- package/src/styles/theme-light.css +84 -16
- package/src/styles/tokens.css +2 -0
|
@@ -4,11 +4,12 @@ import {
|
|
|
4
4
|
Icon,
|
|
5
5
|
Input,
|
|
6
6
|
Select,
|
|
7
|
+
SurfaceDepthProvider,
|
|
7
8
|
SwatchChip,
|
|
8
9
|
createComponentContext,
|
|
9
10
|
cx,
|
|
10
11
|
fieldSurfaceClass
|
|
11
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-6JTZOA5I.js";
|
|
12
13
|
|
|
13
14
|
// src/components/color-picker/ColorPicker.tsx
|
|
14
15
|
import * as React from "react";
|
|
@@ -60,7 +61,7 @@ var COLOR_PICKER_LABELS = {
|
|
|
60
61
|
green: "\u0417\u0435\u043B\u0451\u043D\u044B\u0439, 0\u2013255",
|
|
61
62
|
blue: "\u0421\u0438\u043D\u0438\u0439, 0\u2013255"
|
|
62
63
|
};
|
|
63
|
-
var CHECKER_BG = "repeating-conic-gradient(var(--prime-color-
|
|
64
|
+
var CHECKER_BG = "repeating-conic-gradient(var(--prime-color-layer-current) 0deg 90deg, var(--prime-color-fill-strong) 90deg 180deg) 0% 0% / var(--prime-space-2) var(--prime-space-2)";
|
|
64
65
|
var [ColorPickerProvider, useColorPickerContext] = createComponentContext("ColorPicker");
|
|
65
66
|
function useColorState() {
|
|
66
67
|
const state = React.useContext(ColorPickerStateContext);
|
|
@@ -194,8 +195,20 @@ function ChannelStrip({ className, focusRing = true, ...rest }) {
|
|
|
194
195
|
}
|
|
195
196
|
);
|
|
196
197
|
}
|
|
197
|
-
function Panel({ surface = "none", className, ...rest }) {
|
|
198
|
-
|
|
198
|
+
function Panel({ surface = "none", className, children, ...rest }) {
|
|
199
|
+
if (surface === "none") {
|
|
200
|
+
return /* @__PURE__ */ jsx("div", { className: cx(ColorPicker_default.panel, className), "data-surface": surface, ...rest, children });
|
|
201
|
+
}
|
|
202
|
+
return /* @__PURE__ */ jsx(
|
|
203
|
+
"div",
|
|
204
|
+
{
|
|
205
|
+
className: cx(ColorPicker_default.panel, className),
|
|
206
|
+
"data-surface": surface,
|
|
207
|
+
"data-depth": "floating",
|
|
208
|
+
...rest,
|
|
209
|
+
children: /* @__PURE__ */ jsx(SurfaceDepthProvider, { value: "floating", children })
|
|
210
|
+
}
|
|
211
|
+
);
|
|
199
212
|
}
|
|
200
213
|
Panel.displayName = "ColorPicker.Panel";
|
|
201
214
|
function ColorPickerRoot({
|
package/dist/color-picker.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import type { ControlSize, Tone, Variant } from "@/internal/states";
|
|
3
3
|
/**
|
|
4
4
|
* `tone="inherit"` takes the host's text color (a close button on a solid Banner): fills are a
|
|
@@ -14,11 +14,28 @@ type ButtonColorProps = {
|
|
|
14
14
|
/** Takes the host's text color; for actions placed on a colored host. */
|
|
15
15
|
tone: "inherit";
|
|
16
16
|
};
|
|
17
|
+
export type ButtonLabels = {
|
|
18
|
+
/** Description of a hold-to-confirm button for assistive tech. */
|
|
19
|
+
holdHint: string;
|
|
20
|
+
};
|
|
17
21
|
export type ButtonRootProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "size"> & ButtonColorProps & {
|
|
18
22
|
/** Tier. Default: the tier of the surrounding control (a form, a panel, a field), else `m`. */
|
|
19
23
|
size?: ControlSize;
|
|
20
24
|
fullWidth?: boolean;
|
|
21
25
|
loading?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Progress of a long action started by this button, `0…1`: a fill grows inside the button and
|
|
28
|
+
* `aria-busy` is set. The label carries the number («Скачивание 42%»). Remove it when done.
|
|
29
|
+
*/
|
|
30
|
+
progress?: number;
|
|
31
|
+
/**
|
|
32
|
+
* The action needs a held press: the fill runs for 1.2 s and `onConfirm` fires at its end.
|
|
33
|
+
* Releasing earlier rolls the fill back and does nothing. Space and Enter hold too.
|
|
34
|
+
*/
|
|
35
|
+
holdToConfirm?: boolean;
|
|
36
|
+
/** Fires when a `holdToConfirm` press completes; the action goes here, not in `onClick`. */
|
|
37
|
+
onConfirm?: () => void;
|
|
38
|
+
labels?: Partial<ButtonLabels>;
|
|
22
39
|
/**
|
|
23
40
|
* Merges Button props onto its single child element instead of rendering `<button>`.
|
|
24
41
|
* `disabled` / `loading` become `aria-disabled` (a link has no native `disabled`), `type` is
|
|
@@ -27,7 +44,7 @@ export type ButtonRootProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>
|
|
|
27
44
|
asChild?: boolean;
|
|
28
45
|
ref?: React.Ref<HTMLButtonElement>;
|
|
29
46
|
};
|
|
30
|
-
declare function ButtonRoot({ children, className, variant, tone, size: sizeProp, fullWidth, type, loading, disabled, asChild, onClick, ref, ...rest }: ButtonRootProps): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
declare function ButtonRoot({ children, className, variant, tone, size: sizeProp, fullWidth, type, loading, progress, holdToConfirm, onConfirm, labels, disabled, asChild, onClick, ref, ...rest }: ButtonRootProps): import("react/jsx-runtime").JSX.Element;
|
|
31
48
|
declare namespace ButtonRoot {
|
|
32
49
|
var displayName: string;
|
|
33
50
|
}
|
|
@@ -13,7 +13,7 @@ export type CardRootProps = DivProps & {
|
|
|
13
13
|
/** No raised shadow: a flat tile on the page (dense grids where shadows add noise). */
|
|
14
14
|
flat?: boolean;
|
|
15
15
|
};
|
|
16
|
-
declare function CardRoot({ variant, flat, className, ...rest }: CardRootProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare function CardRoot({ variant, flat, className, children, ...rest }: CardRootProps): import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
declare namespace CardRoot {
|
|
18
18
|
var displayName: string;
|
|
19
19
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { Variant } from "@/internal/states";
|
|
3
3
|
export type CodeBlockColorScheme = "light" | "dark";
|
|
4
|
-
/** `soft` —
|
|
4
|
+
/** `soft` — filled panel with padding and the `code` text role; `ghost` — bare `pre` that inherits type and background from its host. */
|
|
5
5
|
export type CodeBlockVariant = Extract<Variant, "soft" | "ghost">;
|
|
6
6
|
export type CodeBlockProps = Omit<React.HTMLAttributes<HTMLPreElement>, "children" | "dangerouslySetInnerHTML"> & {
|
|
7
7
|
/** TS/TSX source; highlighted with `highlightTsxHtml`. */
|
|
@@ -80,7 +80,7 @@ export type ColorPickerPanelProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
80
80
|
ref?: React.Ref<HTMLDivElement>;
|
|
81
81
|
};
|
|
82
82
|
/** Vertical stack for picker parts with the standard gap; optional raised surface. */
|
|
83
|
-
declare function Panel({ surface, className, ...rest }: ColorPickerPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
83
|
+
declare function Panel({ surface, className, children, ...rest }: ColorPickerPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
84
84
|
declare namespace Panel {
|
|
85
85
|
var displayName: string;
|
|
86
86
|
}
|
|
@@ -29,6 +29,11 @@ export type DataTableProps<Row> = Omit<React.HTMLAttributes<HTMLDivElement>, "ch
|
|
|
29
29
|
/** The outer card-fill `<div>`. */
|
|
30
30
|
ref?: React.Ref<HTMLDivElement>;
|
|
31
31
|
columns: DataTableColumn<Row>[];
|
|
32
|
+
/**
|
|
33
|
+
* Ids of columns not rendered (head, body, skeleton, state rows). A column with
|
|
34
|
+
* `hideable: false` stays. The consumer owns the list and the control that changes it.
|
|
35
|
+
*/
|
|
36
|
+
hiddenColumns?: string[];
|
|
32
37
|
rows: Row[];
|
|
33
38
|
size?: ControlSize;
|
|
34
39
|
className?: string;
|
|
@@ -101,4 +106,4 @@ export type DataTableProps<Row> = Omit<React.HTMLAttributes<HTMLDivElement>, "ch
|
|
|
101
106
|
/** Panel above the table (search, filters, actions). Wraps on narrow widths. */
|
|
102
107
|
toolbar?: React.ReactNode;
|
|
103
108
|
};
|
|
104
|
-
export declare function DataTable<Row>({ columns, rows, size, className, showHeader, stickyHeader, stickyFirstColumn, getRowKey, onRowClick, loading, empty, labels: labelsProp, rowDividers, columnDividers, sort, defaultSort, onSortChange, paging, page, defaultPage, onPageChange, pageSize, infiniteBatchSize, hasMore, loadingMore, onLoadMore, scrollHeight, fullWidth, highlightRowOnHover, highlightColumnOnHover, striped, getRowLabel, selectable, selected, defaultSelected, onSelectedChange, getRowChildren, renderExpanded, isRowExpandable, expanded, defaultExpanded, onExpandedChange, error, loadingRows, toolbar, ref, ...rest }: DataTableProps<Row>): import("react/jsx-runtime").JSX.Element;
|
|
109
|
+
export declare function DataTable<Row>({ columns: allColumns, hiddenColumns, rows, size, className, showHeader, stickyHeader, stickyFirstColumn, getRowKey, onRowClick, loading, empty, labels: labelsProp, rowDividers, columnDividers, sort, defaultSort, onSortChange, paging, page, defaultPage, onPageChange, pageSize, infiniteBatchSize, hasMore, loadingMore, onLoadMore, scrollHeight, fullWidth, highlightRowOnHover, highlightColumnOnHover, striped, getRowLabel, selectable, selected, defaultSelected, onSelectedChange, getRowChildren, renderExpanded, isRowExpandable, expanded, defaultExpanded, onExpandedChange, error, loadingRows, toolbar, ref, ...rest }: DataTableProps<Row>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -33,13 +33,15 @@ type DataTableRowProps<Row> = {
|
|
|
33
33
|
expandable: boolean;
|
|
34
34
|
expanded: boolean;
|
|
35
35
|
animate: boolean;
|
|
36
|
+
/** A sub-row of a row that is collapsing: it folds away before it unmounts. */
|
|
37
|
+
folding?: boolean;
|
|
36
38
|
/** The detail panel opened by the latest expand: it drops in. */
|
|
37
39
|
detailAnimate: boolean;
|
|
38
40
|
selected: boolean;
|
|
39
41
|
/** Ids of the sub-rows the toggle controls (while expanded). */
|
|
40
42
|
childControls: string;
|
|
41
43
|
};
|
|
42
|
-
declare function DataTableRowImpl<Row>({ shared, row, rowKey, index, depth, expandable, expanded, animate, detailAnimate, selected, childControls, }: DataTableRowProps<Row>): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
declare function DataTableRowImpl<Row>({ shared, row, rowKey, index, depth, expandable, expanded, animate, folding, detailAnimate, selected, childControls, }: DataTableRowProps<Row>): import("react/jsx-runtime").JSX.Element;
|
|
43
45
|
/** A body row (plus its detail panel); re-renders only when its own props change. */
|
|
44
46
|
export declare const DataTableRow: typeof DataTableRowImpl;
|
|
45
47
|
type MeasureBodyProps<Row> = {
|
|
@@ -16,6 +16,8 @@ export type FlatRow<Row> = {
|
|
|
16
16
|
expanded: boolean;
|
|
17
17
|
/** Mounted by the latest expand, or newly added to `rows`: plays the enter animation. */
|
|
18
18
|
animate: boolean;
|
|
19
|
+
/** A sub-row of a row that is collapsing: still drawn while it folds away. */
|
|
20
|
+
folding: boolean;
|
|
19
21
|
};
|
|
20
22
|
export type MeasureRow<Row> = {
|
|
21
23
|
row: Row;
|
|
@@ -35,6 +37,8 @@ export type FlattenOptions<Row> = {
|
|
|
35
37
|
withDetail: boolean;
|
|
36
38
|
isRowExpandable?: (row: Row) => boolean;
|
|
37
39
|
expanded: ReadonlySet<React.Key>;
|
|
40
|
+
/** Rows collapsed a moment ago: their sub-rows stay drawn (folding) until the fold ends. */
|
|
41
|
+
closing?: ReadonlySet<React.Key>;
|
|
38
42
|
/** Top-level rows newly added to the data. */
|
|
39
43
|
arrived: ReadonlySet<React.Key>;
|
|
40
44
|
/** Row whose latest expand mounted new rows: only those animate in. */
|
|
@@ -32,4 +32,9 @@ export type DataTableColumn<Row> = {
|
|
|
32
32
|
* such a column the table fills its container instead of growing to its content width.
|
|
33
33
|
*/
|
|
34
34
|
grow?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* The column can be hidden through the table's `hiddenColumns`. Default `true`; `false` for the
|
|
37
|
+
* key column that names the row — it stays even when its id is listed.
|
|
38
|
+
*/
|
|
39
|
+
hideable?: boolean;
|
|
35
40
|
};
|
|
@@ -34,10 +34,15 @@ export type DigitInputProps = FieldRootDomProps & FieldFrameProps & {
|
|
|
34
34
|
disabled?: boolean;
|
|
35
35
|
/** Invalid state: danger ring on every cell. A non-empty `error` implies it. */
|
|
36
36
|
invalid?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* The code was accepted (after the server checked it): the cells turn success one after
|
|
39
|
+
* another. Say it in words too (`hint`), never by color alone.
|
|
40
|
+
*/
|
|
41
|
+
success?: boolean;
|
|
37
42
|
/** Id of the first cell (the label points at it); generated when omitted. */
|
|
38
43
|
id?: string;
|
|
39
44
|
"aria-describedby"?: string;
|
|
40
45
|
labels?: Partial<DigitInputLabels>;
|
|
41
46
|
};
|
|
42
47
|
/** A one-time code or PIN split into cells, with the field label, hint and error. */
|
|
43
|
-
export declare function DigitInput({ length, size: sizeProp, fullWidth, name, groupSize, mask, autoFocus, value: valueProp, defaultValue, onValueChange, onComplete, disabled, invalid, focusRing, label, required, optional, hint, error, id, "aria-describedby": ariaDescribedBy, labels: labelsProp, className, ...rest }: DigitInputProps): import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
export declare function DigitInput({ length, size: sizeProp, fullWidth, name, groupSize, mask, autoFocus, value: valueProp, defaultValue, onValueChange, onComplete, disabled, invalid, success, focusRing, label, required, optional, hint, error, id, "aria-describedby": ariaDescribedBy, labels: labelsProp, className, ...rest }: DigitInputProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { type DragItem, type DragOutcome } from "./dragSession";
|
|
3
|
-
import type
|
|
3
|
+
import { type Point, type Rect } from "./geometry";
|
|
4
4
|
import { type DndLabels } from "./labels";
|
|
5
5
|
import { type ReorderReturn } from "./useSortableList";
|
|
6
6
|
export type { DragItem, DragOutcome } from "./dragSession";
|
|
@@ -20,6 +20,11 @@ export type DragSnapshot = {
|
|
|
20
20
|
pointerKind: PointerKind | null;
|
|
21
21
|
/** The drop target the pointer is over right now, by registered id. */
|
|
22
22
|
overId: string | null;
|
|
23
|
+
/**
|
|
24
|
+
* The `holdsDrop` target the drop stays aimed at while the pointer crosses empty space: the last
|
|
25
|
+
* one it was over that would take the item. Null once the pointer is over any other target.
|
|
26
|
+
*/
|
|
27
|
+
heldId: string | null;
|
|
23
28
|
canDrop: boolean;
|
|
24
29
|
/** The rect the lifted element occupied when the drag began: the size of the gap a list opens for it. */
|
|
25
30
|
origin: Rect | null;
|
|
@@ -38,11 +43,15 @@ export type DropTargetEntry = {
|
|
|
38
43
|
id: string;
|
|
39
44
|
element: HTMLElement;
|
|
40
45
|
accepts: (item: DragItem) => boolean;
|
|
46
|
+
/** Keeps the drop while the pointer crosses empty space (the gutter between two lists). */
|
|
47
|
+
holdsDrop: boolean;
|
|
41
48
|
enter: (item: DragItem) => void;
|
|
42
49
|
/** Called on every resolved pointer position; returns whether a drop here would be accepted. */
|
|
43
50
|
over: (point: Point, item: DragItem) => boolean;
|
|
44
51
|
leave: () => void;
|
|
45
52
|
drop: (point: Point, item: DragItem) => void;
|
|
53
|
+
/** Drops where the pointer was last over this target: the release came over empty space. */
|
|
54
|
+
dropHeld: (item: DragItem) => void;
|
|
46
55
|
};
|
|
47
56
|
export type DragPreview = {
|
|
48
57
|
/** The element the gesture started on, cloned by the overlay. */
|
|
@@ -10,6 +10,11 @@ export type DropTargetOptions<TValue, TData = unknown> = {
|
|
|
10
10
|
canDrop?: ((value: TValue, item: DragItem<TData>) => boolean) | undefined;
|
|
11
11
|
onDrop: (value: TValue, item: DragItem<TData>) => void;
|
|
12
12
|
disabled?: boolean | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* The drop stays aimed here while the pointer crosses empty space after leaving (the gutter
|
|
15
|
+
* between lists), and a release there drops here at the last resolved spot.
|
|
16
|
+
*/
|
|
17
|
+
holdsDrop?: boolean | undefined;
|
|
13
18
|
onEnter?: ((item: DragItem<TData>) => void) | undefined;
|
|
14
19
|
onLeave?: (() => void) | undefined;
|
|
15
20
|
/** Flashes the target once a drop lands, so the eye can follow where the item went. */
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WAAPI timing from the motion tokens (`--prime-motion-duration-<token>`,
|
|
3
|
-
* `--prime-motion-easing
|
|
3
|
+
* `--prime-motion-easing-<curve>`), read at animation time so theme and app overrides apply;
|
|
4
4
|
* WAAPI cannot take `var()`.
|
|
5
5
|
*/
|
|
6
|
-
export declare function motionTiming(duration: "fast" | "base"): KeyframeAnimationOptions;
|
|
6
|
+
export declare function motionTiming(duration: "fast" | "base", curve?: "standard" | "enter" | "exit"): KeyframeAnimationOptions;
|
|
7
7
|
/**
|
|
8
|
-
* Animates layout changes of list items from the position currently on screen. Hit testing still uses
|
|
8
|
+
* Animates layout changes of list items (`data-dnd-item`) and of the gap (`data-dnd-gap`) from the position currently on screen. Hit testing still uses
|
|
9
9
|
* `layoutRect`, so visual easing never changes a drop decision.
|
|
10
10
|
*/
|
|
11
11
|
export declare function useFlipList(container: HTMLElement | null, layoutKey: string, selector: string, enabled: boolean): void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import { DialogBody, DialogClose, DialogDescription, DialogFooter, DialogHeader, DialogIcon, DialogTitle, DialogTrigger } from "@/components/modal/DialogParts";
|
|
3
3
|
import type { ControlSize } from "@/internal/states";
|
|
4
4
|
export type { DialogBodyProps as DrawerBodyProps, DialogCloseProps as DrawerCloseProps, DialogDescriptionProps as DrawerDescriptionProps, DialogFooterProps as DrawerFooterProps, DialogHeaderProps as DrawerHeaderProps, DialogIconProps as DrawerIconProps, DialogTitleProps as DrawerTitleProps, DialogTriggerProps as DrawerTriggerProps, } from "@/components/modal/DialogParts";
|
|
5
|
-
export type DrawerSide = "left" | "right";
|
|
5
|
+
export type DrawerSide = "left" | "right" | "bottom";
|
|
6
6
|
export type DrawerLabels = {
|
|
7
7
|
/** `aria-label` of the header close button. */
|
|
8
8
|
close: string;
|
|
@@ -13,7 +13,7 @@ export type DrawerRootProps = {
|
|
|
13
13
|
onOpenChange?: (open: boolean) => void;
|
|
14
14
|
/** Escape closes the drawer. Default `true`. */
|
|
15
15
|
closeOnEscape?: boolean;
|
|
16
|
-
/** A click on the scrim closes the drawer. Default `true`. */
|
|
16
|
+
/** A click on the scrim or a swipe toward the edge closes the drawer. Default `true`. */
|
|
17
17
|
closeOnOutsideClick?: boolean;
|
|
18
18
|
labels?: Partial<DrawerLabels>;
|
|
19
19
|
children?: React.ReactNode;
|
|
@@ -23,9 +23,12 @@ declare namespace DrawerRoot {
|
|
|
23
23
|
var displayName: string;
|
|
24
24
|
}
|
|
25
25
|
export type DrawerContentProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
26
|
-
/** Edge the panel slides from. Default `right`. */
|
|
26
|
+
/** Edge the panel slides from; `bottom` is a sheet with a grab handle. Default `right`. */
|
|
27
27
|
side?: DrawerSide;
|
|
28
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* Panel width: `s` 360 · `m` 480 · `l` 640 · `xl` 800 (a bottom sheet is centred). Full width
|
|
30
|
+
* below 640px of viewport.
|
|
31
|
+
*/
|
|
29
32
|
size?: Exclude<ControlSize, "xs">;
|
|
30
33
|
/** Class on the full-screen scrim. */
|
|
31
34
|
overlayClassName?: string;
|
|
@@ -51,6 +51,22 @@ declare function DropdownItem({ onSelect, disabled, tone, className, onClick, ..
|
|
|
51
51
|
declare namespace DropdownItem {
|
|
52
52
|
var displayName: string;
|
|
53
53
|
}
|
|
54
|
+
export type DropdownCheckboxItemProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "type" | "role" | "onSelect" | "onChange" | "defaultChecked"> & {
|
|
55
|
+
checked?: boolean;
|
|
56
|
+
defaultChecked?: boolean;
|
|
57
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
58
|
+
disabled?: boolean;
|
|
59
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* A toggle inside the menu (show a column, turn a filter on, pick a view): the label where an item
|
|
63
|
+
* has it and a check mark at the end while checked, `role="menuitemcheckbox"`. Toggling keeps the
|
|
64
|
+
* menu open, so several can be set in a row.
|
|
65
|
+
*/
|
|
66
|
+
declare function DropdownCheckboxItem({ checked: checkedProp, defaultChecked, onCheckedChange, disabled, className, onClick, children, ...rest }: DropdownCheckboxItemProps): import("react/jsx-runtime").JSX.Element;
|
|
67
|
+
declare namespace DropdownCheckboxItem {
|
|
68
|
+
var displayName: string;
|
|
69
|
+
}
|
|
54
70
|
type DivProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
55
71
|
ref?: React.Ref<HTMLDivElement>;
|
|
56
72
|
};
|
|
@@ -113,6 +129,7 @@ export declare const Dropdown: {
|
|
|
113
129
|
Description: typeof DropdownDescription;
|
|
114
130
|
Group: typeof DropdownGroup;
|
|
115
131
|
Item: typeof DropdownItem;
|
|
132
|
+
CheckboxItem: typeof DropdownCheckboxItem;
|
|
116
133
|
ItemIcon: typeof DropdownItemIcon;
|
|
117
134
|
ItemShortcut: typeof DropdownItemShortcut;
|
|
118
135
|
Separator: typeof DropdownSeparator;
|
|
@@ -11,7 +11,7 @@ export type { BannerActionsProps, BannerContentProps, BannerDescriptionProps, Ba
|
|
|
11
11
|
export { Banner } from "./banner/Banner";
|
|
12
12
|
export type { BreadcrumbEllipsisProps, BreadcrumbItemProps, BreadcrumbLabels, BreadcrumbRootProps, } from "./breadcrumb/Breadcrumb";
|
|
13
13
|
export { Breadcrumb } from "./breadcrumb/Breadcrumb";
|
|
14
|
-
export type { ButtonIconProps, ButtonRootProps } from "./button/Button";
|
|
14
|
+
export type { ButtonIconProps, ButtonLabels, ButtonRootProps } from "./button/Button";
|
|
15
15
|
export { Button } from "./button/Button";
|
|
16
16
|
export type { ButtonGroupIconProps, ButtonGroupItemProps, ButtonGroupOrientation, ButtonGroupRootProps, } from "./button-group/ButtonGroup";
|
|
17
17
|
export { ButtonGroup } from "./button-group/ButtonGroup";
|
|
@@ -41,7 +41,7 @@ export type { DndDraggableProps, DndDropZoneProps, DndHandleProps, DndLabels, Dn
|
|
|
41
41
|
export { Dnd } from "./dnd/Dnd";
|
|
42
42
|
export { moveBefore } from "./dnd/useSortableList";
|
|
43
43
|
export * from "./drawer/Drawer";
|
|
44
|
-
export type { DropdownContentProps, DropdownDescriptionProps, DropdownGroupProps, DropdownHeaderProps, DropdownItemIconProps, DropdownItemProps, DropdownItemShortcutProps, DropdownRootProps, DropdownSeparatorProps, DropdownTitleProps, DropdownTriggerProps, } from "./dropdown/Dropdown";
|
|
44
|
+
export type { DropdownCheckboxItemProps, DropdownContentProps, DropdownDescriptionProps, DropdownGroupProps, DropdownHeaderProps, DropdownItemIconProps, DropdownItemProps, DropdownItemShortcutProps, DropdownRootProps, DropdownSeparatorProps, DropdownTitleProps, DropdownTriggerProps, } from "./dropdown/Dropdown";
|
|
45
45
|
export { Dropdown } from "./dropdown/Dropdown";
|
|
46
46
|
export type { EmptyPageActionsProps, EmptyPageDescriptionProps, EmptyPageIconProps, EmptyPageRootProps, EmptyPageTitleProps, } from "./empty-page/EmptyPage";
|
|
47
47
|
export { EmptyPage } from "./empty-page/EmptyPage";
|
|
@@ -53,6 +53,9 @@ export type { HintIconProps, HintRootProps } from "./hint/Hint";
|
|
|
53
53
|
export { Hint } from "./hint/Hint";
|
|
54
54
|
export type { InputAffixProps, InputClearButtonProps, InputCounterProps, InputFieldProps, InputIconProps, InputInlineAffixProps, InputLabels, InputRootProps, InputWrapperProps, } from "./input/Input";
|
|
55
55
|
export { Input } from "./input/Input";
|
|
56
|
+
export { getPasswordStrength, type PasswordStrength } from "./input/passwordStrength";
|
|
57
|
+
export type { KanbanColumn, KanbanItemBadgesProps, KanbanItemCountProps, KanbanItemDescriptionProps, KanbanItemFooterProps, KanbanItemProps, KanbanItemTitleProps, KanbanLabels, KanbanMove, KanbanRootProps, KanbanValue, } from "./kanban/Kanban";
|
|
58
|
+
export { Kanban } from "./kanban/Kanban";
|
|
56
59
|
export type { KbdProps } from "./kbd/Kbd";
|
|
57
60
|
export { Kbd } from "./kbd/Kbd";
|
|
58
61
|
export type { LabelDescriptionProps, LabelIconProps, LabelLabels, LabelRootProps, } from "./label/Label";
|
|
@@ -71,6 +74,8 @@ export type { NotificationProviderProps } from "./notification/NotificationStore
|
|
|
71
74
|
export { NotificationProvider, useNotifications, } from "./notification/NotificationStore";
|
|
72
75
|
export type { PageContentActionsProps, PageContentBodyProps, PageContentDescriptionMeasure, PageContentDescriptionProps, PageContentHeaderProps, PageContentMaxWidth, PageContentRootProps, PageContentSectionProps, PageContentTitleProps, } from "./page-content/PageContent";
|
|
73
76
|
export { PageContent } from "./page-content/PageContent";
|
|
77
|
+
export type { PageToolbarActionsProps, PageToolbarChipsProps, PageToolbarRootProps, PageToolbarSectionsProps, PageToolbarToolsProps, PageToolbarViewProps, } from "./page-toolbar/PageToolbar";
|
|
78
|
+
export { PageToolbar } from "./page-toolbar/PageToolbar";
|
|
74
79
|
export type { PaginationLabels, PaginationProps } from "./pagination/Pagination";
|
|
75
80
|
export { Pagination } from "./pagination/Pagination";
|
|
76
81
|
export type { PopoverActionsProps, PopoverAnchorProps, PopoverCloseProps, PopoverContentProps, PopoverDescriptionProps, PopoverHeaderProps, PopoverRootProps, PopoverTitleProps, PopoverTriggerProps, } from "./popover/Popover";
|
|
@@ -93,6 +98,8 @@ export type { SliderLabels, SliderProps } from "./slider/Slider";
|
|
|
93
98
|
export { Slider } from "./slider/Slider";
|
|
94
99
|
export type { SmartFilterChipsProps, SmartFilterField, SmartFilterLabels, SmartFilterMode, SmartFilterOption, SmartFilterRootProps, SmartFilterSelection, SmartFilterToolbarProps, SmartFilterValue, } from "./smart-filter/SmartFilter";
|
|
95
100
|
export { matchesSmartFilter, resolveSmartFilterValues, SmartFilter, } from "./smart-filter/SmartFilter";
|
|
101
|
+
export type { SparklineLabels, SparklinePoint, SparklineProps, } from "./sparkline/Sparkline";
|
|
102
|
+
export { Sparkline } from "./sparkline/Sparkline";
|
|
96
103
|
export type { SpinnerLabels, SpinnerProps } from "./spinner/Spinner";
|
|
97
104
|
export { Spinner } from "./spinner/Spinner";
|
|
98
105
|
export type { StepperArrowProps, StepperContentProps, StepperDescriptionProps, StepperIndicatorProps, StepperItemProps, StepperItemStatus, StepperRootProps, StepperTitleProps, } from "./stepper/Stepper";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { type FieldRootDomProps } from "@/internal/FieldFrame";
|
|
3
3
|
import type { ControlSize } from "@/internal/states";
|
|
4
|
+
import { type PasswordStrength } from "./passwordStrength";
|
|
4
5
|
export type InputLabels = {
|
|
5
6
|
/** Muted marker after the label when `optional`. */
|
|
6
7
|
optional: string;
|
|
@@ -8,6 +9,13 @@ export type InputLabels = {
|
|
|
8
9
|
clear: string;
|
|
9
10
|
/** Screen-reader text of `Input.Counter`; `{current}` and `{max}` are replaced. */
|
|
10
11
|
counter: string;
|
|
12
|
+
/** Accessible name of the `strength` meter. */
|
|
13
|
+
strength: string;
|
|
14
|
+
/** Visible words of the four `strength` levels. */
|
|
15
|
+
strengthWeak: string;
|
|
16
|
+
strengthEasy: string;
|
|
17
|
+
strengthMedium: string;
|
|
18
|
+
strengthHard: string;
|
|
11
19
|
};
|
|
12
20
|
export type InputRootProps = FieldRootDomProps & {
|
|
13
21
|
/** Tier. Default: the tier of the surrounding control (a form, a panel), else `m`. */
|
|
@@ -34,10 +42,17 @@ export type InputRootProps = FieldRootDomProps & {
|
|
|
34
42
|
reserveSupportRow?: boolean;
|
|
35
43
|
/** Explicit id for the underlying <input>; auto-generated if omitted. */
|
|
36
44
|
id?: string;
|
|
45
|
+
/**
|
|
46
|
+
* A password strength meter under the field: four steps that fill as the value grows stronger,
|
|
47
|
+
* with the level word on the right of the support row. Use on new-password fields.
|
|
48
|
+
*/
|
|
49
|
+
strength?: boolean;
|
|
50
|
+
/** Replaces the kit's estimate (`getPasswordStrength`): return 0 (empty) … 4 (hard). */
|
|
51
|
+
getStrength?: (value: string) => PasswordStrength;
|
|
37
52
|
labels?: Partial<InputLabels>;
|
|
38
53
|
children: React.ReactNode;
|
|
39
54
|
};
|
|
40
|
-
declare function InputRoot({ size: sizeProp, invalid, focusRing, label, required, optional, hint, error, counter, reserveSupportRow, id, labels: labelsProp, children, className, ...rest }: InputRootProps): import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
declare function InputRoot({ size: sizeProp, invalid, focusRing, label, required, optional, hint, error, counter, reserveSupportRow, id, strength, getStrength, labels: labelsProp, children, className, ...rest }: InputRootProps): import("react/jsx-runtime").JSX.Element;
|
|
41
56
|
declare namespace InputRoot {
|
|
42
57
|
var displayName: string;
|
|
43
58
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** A password level: 0 — empty, 1 — weak, 2 — easy, 3 — medium, 4 — hard. */
|
|
2
|
+
export type PasswordStrength = 0 | 1 | 2 | 3 | 4;
|
|
3
|
+
/**
|
|
4
|
+
* The kit's default estimate. Every trait adds one point on its own, in any order: lowercase
|
|
5
|
+
* letters, uppercase letters, digits, symbols, 10+ characters, 14+ characters. Points 0–2 are weak,
|
|
6
|
+
* 3 easy, 4 medium, 5+ hard; a password shorter than 8 characters is at most easy. A quick hint
|
|
7
|
+
* for the person typing, not a security check — the server decides what it accepts.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getPasswordStrength(value: string): PasswordStrength;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/** A column of the board: application data, drawn in array order. */
|
|
3
|
+
export type KanbanColumn = {
|
|
4
|
+
/** Stable unique id; the key of the column in `value`. */
|
|
5
|
+
id: string;
|
|
6
|
+
/** Heading of the column. */
|
|
7
|
+
title: string;
|
|
8
|
+
/** Most cards the column holds (a WIP limit): when full it refuses cards from other columns. */
|
|
9
|
+
limit?: number;
|
|
10
|
+
};
|
|
11
|
+
/** Where every card stands: column id → card ids in their order. */
|
|
12
|
+
export type KanbanValue = Readonly<Record<string, readonly string[]>>;
|
|
13
|
+
/** One applied move: card `id` went from column `from` to column `to` (may be the same) at `index`. */
|
|
14
|
+
export type KanbanMove = {
|
|
15
|
+
id: string;
|
|
16
|
+
from: string;
|
|
17
|
+
to: string;
|
|
18
|
+
index: number;
|
|
19
|
+
};
|
|
20
|
+
/** System strings of the board. `{token}` values are substituted. */
|
|
21
|
+
export type KanbanLabels = {
|
|
22
|
+
/** Spoken name of the count badge: `{count}`. */
|
|
23
|
+
count: string;
|
|
24
|
+
/** Spoken name of the count badge of a column with a `limit`: `{count}`, `{limit}`. */
|
|
25
|
+
countLimit: string;
|
|
26
|
+
/** Text of an empty column. */
|
|
27
|
+
empty: string;
|
|
28
|
+
/** Live region: a card moved to another column from the keyboard. */
|
|
29
|
+
moved: string;
|
|
30
|
+
/** Live region: the next column refused the card (full or `canDrop`). */
|
|
31
|
+
refused: string;
|
|
32
|
+
};
|
|
33
|
+
export declare const defaultKanbanLabels: KanbanLabels;
|
|
34
|
+
export type KanbanRootProps<T> = Omit<React.HTMLAttributes<HTMLDivElement>, "children" | "defaultValue"> & {
|
|
35
|
+
/** Columns in their order. */
|
|
36
|
+
columns: readonly KanbanColumn[];
|
|
37
|
+
/** Every card the board can show; `value` decides where each one stands. */
|
|
38
|
+
items: readonly T[];
|
|
39
|
+
/** Stable unique id of a card. */
|
|
40
|
+
getId: (item: T) => string;
|
|
41
|
+
/** Spoken by the live region. Defaults to the id. */
|
|
42
|
+
getLabel?: (item: T) => string;
|
|
43
|
+
/** Card ids per column (controlled). */
|
|
44
|
+
value?: KanbanValue;
|
|
45
|
+
/** Initial card ids per column (uncontrolled). */
|
|
46
|
+
defaultValue?: KanbanValue;
|
|
47
|
+
/** A card moved: the new placement first, then what moved. */
|
|
48
|
+
onValueChange?: (value: KanbanValue, move: KanbanMove) => void;
|
|
49
|
+
/** Renders one card; return a `Kanban.Item`. */
|
|
50
|
+
renderItem: (item: T) => React.ReactNode;
|
|
51
|
+
/** Renders the trailing actions of a column header (add a card, a menu). */
|
|
52
|
+
renderColumnActions?: (column: KanbanColumn) => React.ReactNode;
|
|
53
|
+
/** Refuses a card in a column (a workflow rule); the column turns `danger` before the release. */
|
|
54
|
+
canDrop?: (id: string, columnId: string) => boolean;
|
|
55
|
+
/** Columns show skeleton cards; the cards cross-fade in when it turns off. */
|
|
56
|
+
loading?: boolean;
|
|
57
|
+
/** No drag, no keyboard moves. */
|
|
58
|
+
disabled?: boolean;
|
|
59
|
+
labels?: Partial<KanbanLabels>;
|
|
60
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* A board of columns: cards move within and between columns by pointer, touch (a hold) and
|
|
64
|
+
* keyboard (Alt + arrows). Mounts its own `Dnd.Root` unless one is already above it.
|
|
65
|
+
*/
|
|
66
|
+
declare function KanbanRoot<T>(props: KanbanRootProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
67
|
+
declare namespace KanbanRoot {
|
|
68
|
+
var displayName: string;
|
|
69
|
+
}
|
|
70
|
+
export type KanbanItemProps = Omit<React.HTMLAttributes<HTMLElement>, "id"> & {
|
|
71
|
+
/** This card cannot be dragged or moved. */
|
|
72
|
+
disabled?: boolean;
|
|
73
|
+
ref?: React.Ref<HTMLElement>;
|
|
74
|
+
};
|
|
75
|
+
/** One card: an `<li>` on a filled surface; drags by the whole card, moves with Alt + arrows. */
|
|
76
|
+
declare function KanbanItem({ disabled, className, onKeyDown, children, ...rest }: KanbanItemProps): import("react/jsx-runtime").JSX.Element;
|
|
77
|
+
declare namespace KanbanItem {
|
|
78
|
+
var displayName: string;
|
|
79
|
+
}
|
|
80
|
+
export type KanbanItemTitleProps = React.HTMLAttributes<HTMLSpanElement> & {
|
|
81
|
+
ref?: React.Ref<HTMLSpanElement>;
|
|
82
|
+
};
|
|
83
|
+
/** The card title: medium body text, wraps up to three lines. */
|
|
84
|
+
declare function KanbanItemTitle({ className, ...rest }: KanbanItemTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
85
|
+
declare namespace KanbanItemTitle {
|
|
86
|
+
var displayName: string;
|
|
87
|
+
}
|
|
88
|
+
export type KanbanItemDescriptionProps = React.HTMLAttributes<HTMLSpanElement> & {
|
|
89
|
+
ref?: React.Ref<HTMLSpanElement>;
|
|
90
|
+
};
|
|
91
|
+
/** The muted meta line: id, due date. */
|
|
92
|
+
declare function KanbanItemDescription({ className, ...rest }: KanbanItemDescriptionProps): import("react/jsx-runtime").JSX.Element;
|
|
93
|
+
declare namespace KanbanItemDescription {
|
|
94
|
+
var displayName: string;
|
|
95
|
+
}
|
|
96
|
+
export type KanbanItemBadgesProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
97
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
98
|
+
};
|
|
99
|
+
/** A wrapping row of `Badge`s: labels, priority. */
|
|
100
|
+
declare function KanbanItemBadges({ className, ...rest }: KanbanItemBadgesProps): import("react/jsx-runtime").JSX.Element;
|
|
101
|
+
declare namespace KanbanItemBadges {
|
|
102
|
+
var displayName: string;
|
|
103
|
+
}
|
|
104
|
+
export type KanbanItemFooterProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
105
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
106
|
+
};
|
|
107
|
+
/** The bottom row: `Kanban.ItemCount`s at the start, anything else (an assignee) at the end. */
|
|
108
|
+
declare function KanbanItemFooter({ className, ...rest }: KanbanItemFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
109
|
+
declare namespace KanbanItemFooter {
|
|
110
|
+
var displayName: string;
|
|
111
|
+
}
|
|
112
|
+
export type KanbanItemCountProps = React.HTMLAttributes<HTMLSpanElement> & {
|
|
113
|
+
ref?: React.Ref<HTMLSpanElement>;
|
|
114
|
+
};
|
|
115
|
+
/** A small muted counter with an icon (comments, attachments, subtasks). */
|
|
116
|
+
declare function KanbanItemCount({ className, ...rest }: KanbanItemCountProps): import("react/jsx-runtime").JSX.Element;
|
|
117
|
+
declare namespace KanbanItemCount {
|
|
118
|
+
var displayName: string;
|
|
119
|
+
}
|
|
120
|
+
export declare const Kanban: {
|
|
121
|
+
Root: typeof KanbanRoot;
|
|
122
|
+
Item: typeof KanbanItem;
|
|
123
|
+
ItemTitle: typeof KanbanItemTitle;
|
|
124
|
+
ItemDescription: typeof KanbanItemDescription;
|
|
125
|
+
ItemBadges: typeof KanbanItemBadges;
|
|
126
|
+
ItemFooter: typeof KanbanItemFooter;
|
|
127
|
+
ItemCount: typeof KanbanItemCount;
|
|
128
|
+
};
|
|
129
|
+
export {};
|
|
@@ -12,7 +12,10 @@ export type ModalRootProps = {
|
|
|
12
12
|
onOpenChange?: (open: boolean) => void;
|
|
13
13
|
/** Escape closes the dialog. Default `true`. */
|
|
14
14
|
closeOnEscape?: boolean;
|
|
15
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* A click on the scrim (or, on a narrow viewport, a swipe down) closes the dialog. Default
|
|
17
|
+
* `true`; turn it off for destructive confirms.
|
|
18
|
+
*/
|
|
16
19
|
closeOnOutsideClick?: boolean;
|
|
17
20
|
/** Enter clicks the action wrapped in `Modal.Confirm`. Default `true`. */
|
|
18
21
|
confirmOnEnter?: boolean;
|
|
@@ -28,7 +31,7 @@ declare namespace ModalRoot {
|
|
|
28
31
|
export type ModalContentProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
29
32
|
/**
|
|
30
33
|
* Dialog width: `s` 440 · `m` 560 · `l` 720 · `xl` 960. Below 640px of viewport the dialog is
|
|
31
|
-
* always a full-width bottom sheet.
|
|
34
|
+
* always a full-width bottom sheet with a grab handle.
|
|
32
35
|
*/
|
|
33
36
|
size?: Exclude<ControlSize, "xs">;
|
|
34
37
|
/** Portal target. Default `document.body`. */
|