prime-ui-kit 0.9.1 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/README.md +22 -8
  2. package/dist/chunks/{chunk-KCQFOORX.js → chunk-IQELQNMR.js} +1 -1
  3. package/dist/chunks/{chunk-DB2Y3XXA.js → chunk-LXGRKN34.js} +2323 -1500
  4. package/dist/chunks/{chunk-NHOWNIAR.js → chunk-ZEFCDEEQ.js} +790 -536
  5. package/dist/color-picker.js +2 -2
  6. package/dist/components/data-table/DataTable.d.ts +6 -1
  7. package/dist/components/data-table/types.d.ts +5 -0
  8. package/dist/components/dnd/Dnd.d.ts +1 -1
  9. package/dist/components/dnd/dragSession.d.ts +9 -0
  10. package/dist/components/dnd/useDropTarget.d.ts +5 -0
  11. package/dist/components/dnd/useFlipList.d.ts +3 -3
  12. package/dist/components/drawer/Drawer.d.ts +8 -5
  13. package/dist/components/dropdown/Dropdown.d.ts +17 -0
  14. package/dist/components/index.d.ts +5 -1
  15. package/dist/components/kanban/Kanban.d.ts +129 -0
  16. package/dist/components/modal/Modal.d.ts +5 -2
  17. package/dist/components/page-toolbar/PageToolbar.d.ts +53 -0
  18. package/dist/components/segmented-control/SegmentedControl.d.ts +5 -2
  19. package/dist/components/tabs/Tabs.d.ts +5 -2
  20. package/dist/hooks/useEdgeOverflow.d.ts +12 -0
  21. package/dist/hooks/useMediaQuery.d.ts +7 -0
  22. package/dist/hooks/useSwipeDismiss.d.ts +34 -0
  23. package/dist/index.css +2271 -1163
  24. package/dist/index.js +10 -2
  25. package/dist/internal/overlay/FloatingPanel.d.ts +3 -1
  26. package/dist/internal/overlay/useFloatingLayer.d.ts +11 -1
  27. package/dist/internal/touchTarget.d.ts +4 -0
  28. package/dist/layout/app-header/AppHeader.d.ts +110 -0
  29. package/dist/layout/app-shell/AppShell.d.ts +14 -9
  30. package/dist/layout/bottom-nav/BottomNav.d.ts +80 -0
  31. package/dist/layout/index.d.ts +5 -1
  32. package/dist/tokens/primitives.d.ts +4 -0
  33. package/dist/tokens/semantic.d.ts +56 -0
  34. package/dist/tokens/themes/dark.d.ts +4 -0
  35. package/package.json +3 -2
  36. package/src/components/accordion/COMPONENT.md +1 -1
  37. package/src/components/badge/COMPONENT.md +2 -2
  38. package/src/components/banner/COMPONENT.md +1 -1
  39. package/src/components/checkbox/examples/examples.module.css +4 -2
  40. package/src/components/crossfade/COMPONENT.md +1 -1
  41. package/src/components/data-table/COMPONENT.md +19 -6
  42. package/src/components/data-table/examples/columns-visibility.tsx +167 -0
  43. package/src/components/digit-input/COMPONENT.md +10 -10
  44. package/src/components/digit-input/examples/examples.module.css +8 -0
  45. package/src/components/digit-input/examples/in-form.tsx +2 -5
  46. package/src/components/digit-input/examples/sizes.tsx +1 -1
  47. package/src/components/divider/COMPONENT.md +1 -1
  48. package/src/components/dnd/COMPONENT.md +3 -3
  49. package/src/components/drawer/COMPONENT.md +17 -9
  50. package/src/components/drawer/examples/date-sheet.tsx +41 -0
  51. package/src/components/drawer/examples/examples.module.css +5 -0
  52. package/src/components/drawer/examples/placement.tsx +4 -2
  53. package/src/components/dropdown/COMPONENT.md +19 -5
  54. package/src/components/dropdown/examples/checkbox-items.tsx +48 -0
  55. package/src/components/empty-page/COMPONENT.md +1 -1
  56. package/src/components/kanban/COMPONENT.md +181 -0
  57. package/src/components/kanban/examples/controlled.tsx +78 -0
  58. package/src/components/kanban/examples/examples.module.css +31 -0
  59. package/src/components/kanban/examples/limits.tsx +58 -0
  60. package/src/components/kanban/examples/narrow.tsx +76 -0
  61. package/src/components/kanban/examples/overview.tsx +130 -0
  62. package/src/components/kanban/examples/states.tsx +75 -0
  63. package/src/components/kanban/examples/structure.tsx +76 -0
  64. package/src/components/login-form/COMPONENT.md +1 -1
  65. package/src/components/modal/COMPONENT.md +9 -6
  66. package/src/components/notification/COMPONENT.md +2 -2
  67. package/src/components/page-content/COMPONENT.md +1 -1
  68. package/src/components/page-toolbar/COMPONENT.md +142 -0
  69. package/src/components/page-toolbar/examples/examples.module.css +16 -0
  70. package/src/components/page-toolbar/examples/narrow.tsx +103 -0
  71. package/src/components/page-toolbar/examples/overview.tsx +113 -0
  72. package/src/components/page-toolbar/examples/save-changes.tsx +40 -0
  73. package/src/components/page-toolbar/examples/without-search.tsx +60 -0
  74. package/src/components/popover/COMPONENT.md +4 -3
  75. package/src/components/progress-bar/COMPONENT.md +1 -1
  76. package/src/components/progress-circle/COMPONENT.md +1 -1
  77. package/src/components/scroll-container/COMPONENT.md +1 -1
  78. package/src/components/segmented-control/COMPONENT.md +8 -8
  79. package/src/components/segmented-control/examples/full-width.tsx +1 -1
  80. package/src/components/select/COMPONENT.md +2 -1
  81. package/src/components/skeleton/COMPONENT.md +1 -1
  82. package/src/components/smart-filter/COMPONENT.md +2 -0
  83. package/src/components/spinner/COMPONENT.md +1 -1
  84. package/src/components/tabs/COMPONENT.md +11 -8
  85. package/src/components/tabs/examples/closable.tsx +1 -1
  86. package/src/layout/app-header/COMPONENT.md +178 -0
  87. package/src/layout/app-header/examples/breadcrumbs.tsx +36 -0
  88. package/src/layout/app-header/examples/examples.module.css +47 -0
  89. package/src/layout/app-header/examples/in-app-shell.tsx +70 -0
  90. package/src/layout/app-header/examples/narrow.tsx +29 -0
  91. package/src/layout/app-header/examples/overview.tsx +36 -0
  92. package/src/layout/app-shell/COMPONENT.md +27 -21
  93. package/src/layout/app-shell/examples/examples.module.css +15 -0
  94. package/src/layout/app-shell/examples/footer.tsx +59 -0
  95. package/src/layout/app-shell/examples/overview.tsx +19 -8
  96. package/src/layout/bottom-nav/COMPONENT.md +153 -0
  97. package/src/layout/bottom-nav/examples/examples.module.css +39 -0
  98. package/src/layout/bottom-nav/examples/floating.tsx +89 -0
  99. package/src/layout/bottom-nav/examples/icon-only.tsx +41 -0
  100. package/src/layout/bottom-nav/examples/in-app-shell.tsx +64 -0
  101. package/src/layout/bottom-nav/examples/overview.tsx +44 -0
  102. package/src/layout/bottom-nav/examples/router.tsx +31 -0
  103. package/src/layout/bottom-nav/examples/structure.tsx +47 -0
  104. package/src/layout/sidebar/COMPONENT.md +11 -10
  105. package/src/styles/theme-dark.css +3 -0
  106. package/src/styles/theme-light.css +24 -0
  107. package/src/styles/tokens.css +2 -0
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  ColorPicker,
3
3
  parseColor
4
- } from "./chunks/chunk-KCQFOORX.js";
5
- import "./chunks/chunk-NHOWNIAR.js";
4
+ } from "./chunks/chunk-IQELQNMR.js";
5
+ import "./chunks/chunk-ZEFCDEEQ.js";
6
6
  export {
7
7
  ColorPicker,
8
8
  parseColor
@@ -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;
@@ -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
  };
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { type DragItem, type DragOutcome } from "./dragSession";
3
- import type { Point, Rect } from "./geometry";
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-standard`), read at animation time so theme and app overrides apply;
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 type * as React from "react";
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
- /** Panel width: `s` 360 · `m` 480 · `l` 640 · `xl` 800. Full width below 640px of viewport. */
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;
@@ -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,8 @@ 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 type { KanbanColumn, KanbanItemBadgesProps, KanbanItemCountProps, KanbanItemDescriptionProps, KanbanItemFooterProps, KanbanItemProps, KanbanItemTitleProps, KanbanLabels, KanbanMove, KanbanRootProps, KanbanValue, } from "./kanban/Kanban";
57
+ export { Kanban } from "./kanban/Kanban";
56
58
  export type { KbdProps } from "./kbd/Kbd";
57
59
  export { Kbd } from "./kbd/Kbd";
58
60
  export type { LabelDescriptionProps, LabelIconProps, LabelLabels, LabelRootProps, } from "./label/Label";
@@ -71,6 +73,8 @@ export type { NotificationProviderProps } from "./notification/NotificationStore
71
73
  export { NotificationProvider, useNotifications, } from "./notification/NotificationStore";
72
74
  export type { PageContentActionsProps, PageContentBodyProps, PageContentDescriptionMeasure, PageContentDescriptionProps, PageContentHeaderProps, PageContentMaxWidth, PageContentRootProps, PageContentSectionProps, PageContentTitleProps, } from "./page-content/PageContent";
73
75
  export { PageContent } from "./page-content/PageContent";
76
+ export type { PageToolbarActionsProps, PageToolbarChipsProps, PageToolbarRootProps, PageToolbarSectionsProps, PageToolbarToolsProps, PageToolbarViewProps, } from "./page-toolbar/PageToolbar";
77
+ export { PageToolbar } from "./page-toolbar/PageToolbar";
74
78
  export type { PaginationLabels, PaginationProps } from "./pagination/Pagination";
75
79
  export { Pagination } from "./pagination/Pagination";
76
80
  export type { PopoverActionsProps, PopoverAnchorProps, PopoverCloseProps, PopoverContentProps, PopoverDescriptionProps, PopoverHeaderProps, PopoverRootProps, PopoverTitleProps, PopoverTriggerProps, } from "./popover/Popover";
@@ -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
- /** A click on the scrim closes the dialog. Default `true`; turn it off for destructive confirms. */
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`. */
@@ -0,0 +1,53 @@
1
+ import * as React from "react";
2
+ type DivProps = React.HTMLAttributes<HTMLDivElement> & {
3
+ ref?: React.Ref<HTMLDivElement>;
4
+ };
5
+ export type PageToolbarRootProps = DivProps;
6
+ /**
7
+ * The panel at the top of a page: sections, tools, view options and the primary action. It lays
8
+ * itself out from its own width — one row when wide, exactly two rows when narrow — so the slots
9
+ * keep fixed places at any width. Parts may be left out; the JSX order is the Tab order.
10
+ */
11
+ declare function PageToolbarRoot({ className, children, ref, ...rest }: PageToolbarRootProps): import("react/jsx-runtime").JSX.Element;
12
+ declare namespace PageToolbarRoot {
13
+ var displayName: string;
14
+ }
15
+ export type PageToolbarSectionsProps = DivProps;
16
+ /** Sections of the page — a `fullWidth` SegmentedControl; top row, stretches when narrow. */
17
+ declare function PageToolbarSections({ className, ...rest }: PageToolbarSectionsProps): import("react/jsx-runtime").JSX.Element;
18
+ declare namespace PageToolbarSections {
19
+ var displayName: string;
20
+ }
21
+ export type PageToolbarToolsProps = DivProps;
22
+ /** Filter button and search (`SmartFilter.Toolbar`): takes the free space of its row. */
23
+ declare function PageToolbarTools({ className, ...rest }: PageToolbarToolsProps): import("react/jsx-runtime").JSX.Element;
24
+ declare namespace PageToolbarTools {
25
+ var displayName: string;
26
+ }
27
+ export type PageToolbarViewProps = DivProps;
28
+ /** How the data is shown: period, table / cards, columns. Sized by content; alone in a row, its controls share the row. */
29
+ declare function PageToolbarView({ className, ...rest }: PageToolbarViewProps): import("react/jsx-runtime").JSX.Element;
30
+ declare namespace PageToolbarView {
31
+ var displayName: string;
32
+ }
33
+ export type PageToolbarActionsProps = DivProps;
34
+ /** The primary action of the page: the top row's end at every width, never wraps down. */
35
+ declare function PageToolbarActions({ className, ...rest }: PageToolbarActionsProps): import("react/jsx-runtime").JSX.Element;
36
+ declare namespace PageToolbarActions {
37
+ var displayName: string;
38
+ }
39
+ export type PageToolbarChipsProps = DivProps;
40
+ /** Active filters (`SmartFilter.Chips`) in their own row under the panel; the row disappears when empty. */
41
+ declare function PageToolbarChips({ className, ...rest }: PageToolbarChipsProps): import("react/jsx-runtime").JSX.Element;
42
+ declare namespace PageToolbarChips {
43
+ var displayName: string;
44
+ }
45
+ export declare const PageToolbar: {
46
+ Root: typeof PageToolbarRoot;
47
+ Sections: typeof PageToolbarSections;
48
+ Tools: typeof PageToolbarTools;
49
+ View: typeof PageToolbarView;
50
+ Actions: typeof PageToolbarActions;
51
+ Chips: typeof PageToolbarChips;
52
+ };
53
+ export {};
@@ -6,7 +6,10 @@ export type SegmentedControlRootProps = Omit<React.HTMLAttributes<HTMLDivElement
6
6
  onValueChange?: (value: string) => void;
7
7
  disabled?: boolean;
8
8
  size?: ControlSize;
9
- /** Stretch to the container width; segments share it equally and truncate their labels. */
9
+ /**
10
+ * Stretch to the container width. Single-line segments tend to equal widths but never get narrower
11
+ * than their label; when they do not fit, the row scrolls.
12
+ */
10
13
  fullWidth?: boolean;
11
14
  ref?: React.Ref<HTMLDivElement>;
12
15
  };
@@ -49,7 +52,7 @@ export type SegmentedControlLabelProps = {
49
52
  className?: string;
50
53
  ref?: React.Ref<HTMLSpanElement>;
51
54
  } & Omit<React.HTMLAttributes<HTMLSpanElement>, "children">;
52
- /** Segment title; truncates with an ellipsis. Plain text children are wrapped automatically. */
55
+ /** Segment title on one line; never truncated. Plain text children are wrapped automatically. */
53
56
  declare function SegmentedControlLabel({ children, className, ...rest }: SegmentedControlLabelProps): import("react/jsx-runtime").JSX.Element;
54
57
  declare namespace SegmentedControlLabel {
55
58
  var displayName: string;
@@ -14,9 +14,12 @@ export type TabsRootProps = Omit<React.HTMLAttributes<HTMLDivElement>, "defaultV
14
14
  size?: ControlSize;
15
15
  /** Text and icon colour of the active tab. Default `neutral`: primary text, accent icon. */
16
16
  tone?: "neutral" | "accent";
17
- /** Horizontal tabs share the list width. Default `true`; `false` sizes each tab to its content. */
17
+ /**
18
+ * Horizontal tabs fill the list and tend to equal widths, never narrower than their content.
19
+ * Default `true`; `false` sizes each tab to its content.
20
+ */
18
21
  fullWidth?: boolean;
19
- /** Narrowest a horizontal tab with a label gets before the list scrolls (px or a CSS length). */
22
+ /** Narrowest a horizontal tab with a label gets (px or a CSS length); never below its content. */
20
23
  minItemWidth?: number | string;
21
24
  /** Widest a horizontal tab gets (px or a CSS length); a longer label ends with an ellipsis. */
22
25
  maxItemWidth?: number | string;
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ export type EdgeOverflow = {
3
+ start: boolean;
4
+ end: boolean;
5
+ };
6
+ /**
7
+ * Tracks whether a scroll region hides content before / after its visible part along one axis
8
+ * (`ScrollContainer` `fade`, the DataTable edge cue). Measured at most once per frame on scroll,
9
+ * on resize of the region or any child, and when children are added. RTL-aware: the start is the
10
+ * inline start of the region.
11
+ */
12
+ export declare function useEdgeOverflow(ref: React.RefObject<HTMLElement | null>, enabled: boolean, horizontal: boolean): EdgeOverflow;
@@ -0,0 +1,7 @@
1
+ /** Viewport below the first breakpoint (foundation §9): overlays become bottom sheets. */
2
+ export declare const COMPACT_QUERY = "(max-width: 639px)";
3
+ /**
4
+ * Whether a media query matches, kept in sync with the viewport. `false` on the server, while
5
+ * `enabled` is off, and where `matchMedia` is missing.
6
+ */
7
+ export declare function useMediaQuery(query: string, enabled?: boolean): boolean;
@@ -0,0 +1,34 @@
1
+ import * as React from "react";
2
+ /** The direction a panel leaves in: toward the screen edge it came from. */
3
+ export type SwipeDirection = "down" | "left" | "right";
4
+ export type UseSwipeDismissOptions = {
5
+ enabled: boolean;
6
+ direction: SwipeDirection;
7
+ onDismiss: () => void;
8
+ /** Selector of the zones a drag starts from by any pointer: the grab handle, the header. */
9
+ handle: string;
10
+ /**
11
+ * A touch drag may also start anywhere else in the panel (side drawers, whose content scrolls
12
+ * across the swipe axis). Mouse and pen drags start from `handle` only, so text stays selectable.
13
+ */
14
+ touchAnywhere?: boolean;
15
+ /**
16
+ * How far out the panel is, 0 (at rest) … 1 (off its edge), on every move and on release (0 back,
17
+ * 1 out) — for parts that follow the drag, such as the scrim's opacity.
18
+ */
19
+ onProgress?: (progress: number) => void;
20
+ };
21
+ /** The custom property the panel CSS maps onto its own axis (`transform`). */
22
+ export declare const SWIPE_OFFSET_VAR = "--swipe-offset";
23
+ /**
24
+ * Swipe-to-close for a panel at a screen edge (Drawer, a bottom sheet). Attach `onPointerDown` to
25
+ * the panel: a drag from `handle` (or, with `touchAnywhere`, any touch) along the closing axis moves
26
+ * the panel with the pointer through `--swipe-offset` and `data-swiping`, which its CSS maps onto
27
+ * `transform`. On release the panel closes past 30% of its size or on a flick — gliding the rest of
28
+ * the way out from the release point (`data-swipe-dismissed`) — otherwise it glides back;
29
+ * `onProgress` follows along. A drag across the axis is left to scrolling. The gesture is an extra
30
+ * way out: the panel keeps its close button and Escape (WCAG 2.5.7).
31
+ */
32
+ export declare function useSwipeDismiss({ enabled, direction, onDismiss, handle, touchAnywhere, onProgress, }: UseSwipeDismissOptions): {
33
+ onPointerDown: (event: React.PointerEvent<HTMLElement>) => void;
34
+ };