@rise-x/apps-sdk 0.16.4 → 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.
Files changed (37) hide show
  1. package/README.md +123 -1
  2. package/build/breadcrumb.d.ts +49 -0
  3. package/build/breadcrumb.js +58 -0
  4. package/build/index.d.ts +1 -0
  5. package/build/index.js +4 -1
  6. package/build/ui/classes.json +42 -42
  7. package/build/ui/components/ai.d.ts +68 -4
  8. package/build/ui/components/alert-dialog.d.ts +4 -4
  9. package/build/ui/components/app-frame.d.ts +47 -7
  10. package/build/ui/components/asset-pill.d.ts +8 -0
  11. package/build/ui/components/badge.d.ts +35 -2
  12. package/build/ui/components/button.d.ts +4 -4
  13. package/build/ui/components/calendar.d.ts +2 -2
  14. package/build/ui/components/chat-input.d.ts +4 -4
  15. package/build/ui/components/data-table.d.ts +128 -13
  16. package/build/ui/components/data-view.d.ts +94 -0
  17. package/build/ui/components/date-picker.d.ts +23 -1
  18. package/build/ui/components/file-upload.d.ts +9 -1
  19. package/build/ui/components/filter-bar.d.ts +89 -0
  20. package/build/ui/components/floating-panel.d.ts +53 -0
  21. package/build/ui/components/item.d.ts +1 -1
  22. package/build/ui/components/journey.d.ts +165 -0
  23. package/build/ui/components/nav.d.ts +52 -2
  24. package/build/ui/components/page-header.d.ts +8 -8
  25. package/build/ui/components/person.d.ts +14 -0
  26. package/build/ui/components/record-summary.d.ts +17 -0
  27. package/build/ui/components/search-dialog.d.ts +56 -0
  28. package/build/ui/components/statistic.d.ts +2 -1
  29. package/build/ui/components/table.d.ts +10 -3
  30. package/build/ui/components/toggle.d.ts +1 -1
  31. package/build/ui/demo.html +45921 -25459
  32. package/build/ui/index.d.ts +8 -0
  33. package/build/ui/standalone.js +984 -69
  34. package/build/ui/styles.css +1 -1
  35. package/build/ui/theme.css +2 -1
  36. package/package.json +4 -2
  37. package/template/src/App.tsx +4 -1
@@ -3,17 +3,57 @@ type MobileNav = 'strip' | 'tabs';
3
3
  declare function AppFrame({ className, mobileNav, children, ...props }: React.ComponentProps<'div'> & {
4
4
  mobileNav?: MobileNav;
5
5
  }): React.JSX.Element;
6
- /** Fixed left rail from the frame's `2xl` container width up (180px, the Nav
7
- * convention; override via className) — long rails scroll themselves, the
8
- * page never scrolls them away. Narrow, it renders as the shape `mobileNav`
9
- * asked for. */
10
- declare function AppRail({ className, children, moreLabel, ...props }: React.ComponentProps<'aside'> & {
6
+ interface AppRailProps extends React.ComponentProps<'aside'> {
11
7
  moreLabel?: string;
12
- }): React.JSX.Element;
8
+ /** Controlled collapsed state; leave it out and the rail keeps its own. */
9
+ collapsed?: boolean;
10
+ defaultCollapsed?: boolean;
11
+ onCollapsedChange?: (collapsed: boolean) => void;
12
+ /** Controlled expanded width in px. */
13
+ width?: number;
14
+ defaultWidth?: number;
15
+ onWidthChange?: (width: number) => void;
16
+ minWidth?: number;
17
+ maxWidth?: number;
18
+ collapsedWidth?: number;
19
+ /** Released under this width, the rail collapses. */
20
+ snap?: number;
21
+ /** Width and collapsed state are remembered per key, in this browser —
22
+ * `rail.width.<key>` and `rail.collapsed.<key>`. Pass the app's id: every
23
+ * app runs on the host's origin, so apps left on the default `'app'` share
24
+ * one rail state, and collapsing it in one collapses it in all. */
25
+ storageKey?: string;
26
+ /** ⌘. / Ctrl+. toggles the rail. Turn it off when several rails share a page. */
27
+ shortcut?: boolean;
28
+ collapseLabel?: string;
29
+ expandLabel?: string;
30
+ }
31
+ /**
32
+ * The left rail. From the frame's `2xl` container width up it is a column the
33
+ * user sizes: 248px by default, dragged anywhere between 200 and 420, or
34
+ * collapsed to 52px of icons — by its edge, by clicking that edge, or ⌘. The
35
+ * size is the user's alone: it is remembered, and nothing — navigating,
36
+ * opening a chat, opening a canvas — ever changes it.
37
+ *
38
+ * THE EDGE IS ONE PLACE FOR THE WHOLE INTERACTION. At rest nothing shows.
39
+ * Over the rail, a 6×48 line appears on its right edge; over the line it grows
40
+ * into a tab with a chevron and a tooltip naming the shortcut. Click toggles,
41
+ * drag resizes (the layout follows live: under the snap width it already
42
+ * shows the collapsed form, so nothing jumps on release). The edge is a
43
+ * focusable separator: Enter or Space toggles, ← collapses, → expands.
44
+ *
45
+ * Narrow, it renders as the shape `mobileNav` asked for and neither collapses
46
+ * nor resizes.
47
+ */
48
+ declare function AppRail({ className, children, style, moreLabel, collapsed: collapsedProp, defaultCollapsed, onCollapsedChange, width: widthProp, defaultWidth, onWidthChange, minWidth, maxWidth, collapsedWidth, snap, storageKey, shortcut, collapseLabel, expandLabel, ...props }: AppRailProps): React.JSX.Element;
13
49
  /** The scrolling content column. From the frame's `2xl` container width up it
14
50
  * spans under the shell top bar — the top padding keeps resting content below
15
51
  * it, so only scrolled content passes behind. Narrow, it clears the top bar
16
52
  * and, in tabs mode, the bar at the bottom. */
17
53
  declare function AppContent({ className, ...props }: React.ComponentProps<'main'>): React.JSX.Element;
18
- export { AppFrame, AppRail, AppContent };
54
+ /** The app's region, for portalling a surface that must stay inside the app —
55
+ * a floating panel — rather than covering the host's chrome. Null outside an
56
+ * AppFrame, so a caller can fall back to the window. */
57
+ declare function useAppFrameRegion(): HTMLDivElement | null;
58
+ export { AppFrame, AppRail, AppContent, useAppFrameRegion };
19
59
  export type { MobileNav };
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ declare function AssetPill({ icon, onOpen, className, children, onPointerDown, onKeyDown, ...props }: Omit<React.ComponentProps<'button'>, 'onClick'> & {
3
+ /** The asset type's icon. */
4
+ icon?: React.ReactNode;
5
+ /** Opens the asset's details panel. Without it the name renders as text. */
6
+ onOpen?: () => void;
7
+ }): React.JSX.Element;
8
+ export { AssetPill };
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { type VariantProps } from 'class-variance-authority';
3
3
  declare const badgeVariants: (props?: ({
4
- variant?: "link" | "warning" | "neutral" | "success" | "error" | "info" | "ai" | "default" | "outline" | "secondary" | "ghost" | "destructive" | "solid" | "count" | null | undefined;
4
+ variant?: "link" | "warning" | "neutral" | "success" | "error" | "info" | "ai" | "default" | "outline" | "secondary" | "ghost" | "destructive" | "count" | "solid" | null | undefined;
5
5
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
6
  declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & {
7
7
  asChild?: boolean;
@@ -15,5 +15,38 @@ declare const dotVariants: (props?: ({
15
15
  tone?: "warning" | "neutral" | "success" | "error" | "info" | "ai" | null | undefined;
16
16
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
17
17
  declare function StatusDot({ className, tone, ...props }: React.ComponentProps<'span'> & VariantProps<typeof dotVariants>): React.JSX.Element;
18
+ declare const STATUS_INTENTS: {
19
+ readonly attention: {
20
+ readonly variant: "warning";
21
+ readonly tone: "warning";
22
+ };
23
+ readonly waiting: {
24
+ readonly variant: "neutral";
25
+ readonly tone: "neutral";
26
+ };
27
+ readonly progress: {
28
+ readonly variant: "info";
29
+ readonly tone: "info";
30
+ };
31
+ readonly done: {
32
+ readonly variant: "success";
33
+ readonly tone: "success";
34
+ };
35
+ readonly problem: {
36
+ readonly variant: "error";
37
+ readonly tone: "error";
38
+ };
39
+ readonly closed: {
40
+ readonly variant: "neutral";
41
+ readonly tone: "neutral";
42
+ };
43
+ };
44
+ type StatusIntent = keyof typeof STATUS_INTENTS;
45
+ declare function StatusBadge({ intent, dot, className, children, ...props }: React.ComponentProps<'span'> & {
46
+ intent?: StatusIntent;
47
+ /** Leads with the status dot. Off by default. */
48
+ dot?: boolean;
49
+ }): React.JSX.Element;
18
50
  declare function StatusIndicator({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
19
- export { Badge, badgeVariants, Tag, Chip, StatusDot, StatusIndicator };
51
+ export { Badge, badgeVariants, Tag, Chip, StatusBadge, StatusDot, StatusIndicator };
52
+ export type { StatusIntent };
@@ -1,12 +1,12 @@
1
1
  import * as React from 'react';
2
2
  import { type VariantProps } from 'class-variance-authority';
3
3
  declare const buttonVariants: (props?: ({
4
- variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "tint" | "tint-brand" | "destructive" | "destructive-solid" | "brand" | "dashed" | "pill" | null | undefined;
5
- size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
4
+ variant?: "link" | "pill" | "default" | "outline" | "secondary" | "ghost" | "tint" | "tint-brand" | "destructive" | "destructive-solid" | "brand" | "dashed" | null | undefined;
5
+ size?: "sm" | "default" | "xs" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
6
6
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
7
  declare const Button: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<(props?: ({
8
- variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "tint" | "tint-brand" | "destructive" | "destructive-solid" | "brand" | "dashed" | "pill" | null | undefined;
9
- size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
8
+ variant?: "link" | "pill" | "default" | "outline" | "secondary" | "ghost" | "tint" | "tint-brand" | "destructive" | "destructive-solid" | "brand" | "dashed" | null | undefined;
9
+ size?: "sm" | "default" | "xs" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
10
10
  } & import("class-variance-authority/types").ClassProp) | undefined) => string> & {
11
11
  asChild?: boolean;
12
12
  }, "ref"> & React.RefAttributes<HTMLButtonElement>>;
@@ -4,8 +4,8 @@ export interface CalendarDay {
4
4
  /** Outside the displayed month. */
5
5
  outside?: boolean;
6
6
  today?: boolean;
7
- /** Position within a selected range. */
8
- range?: 'start' | 'in' | 'end';
7
+ /** Position within a selected range; `single` is a day selected on its own. */
8
+ range?: 'start' | 'in' | 'end' | 'single';
9
9
  }
10
10
  declare function Calendar({ className, title, days, onPrev, onNext, onSelectDay, footer, ...props }: Omit<React.ComponentProps<'div'>, 'children'> & {
11
11
  title: React.ReactNode;
@@ -7,8 +7,8 @@ declare function ChatInputActions({ className, ...props }: React.ComponentProps<
7
7
  /** The left cluster — attach, dictate, and whatever else an app adds. */
8
8
  declare function ChatInputTools({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
9
9
  declare const ChatInputTool: React.ForwardRefExoticComponent<Omit<Omit<React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & import("class-variance-authority").VariantProps<(props?: ({
10
- variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "tint" | "tint-brand" | "destructive" | "destructive-solid" | "brand" | "dashed" | "pill" | null | undefined;
11
- size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
10
+ variant?: "link" | "pill" | "default" | "outline" | "secondary" | "ghost" | "tint" | "tint-brand" | "destructive" | "destructive-solid" | "brand" | "dashed" | null | undefined;
11
+ size?: "sm" | "default" | "xs" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
12
12
  } & import("class-variance-authority/types").ClassProp) | undefined) => string> & {
13
13
  asChild?: boolean;
14
14
  }, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
@@ -20,8 +20,8 @@ declare const ChatInputTool: React.ForwardRefExoticComponent<Omit<Omit<React.Cla
20
20
  * the same reason ChatInputTool does.
21
21
  */
22
22
  declare const ChatInputSend: React.ForwardRefExoticComponent<Omit<Omit<React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & import("class-variance-authority").VariantProps<(props?: ({
23
- variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "tint" | "tint-brand" | "destructive" | "destructive-solid" | "brand" | "dashed" | "pill" | null | undefined;
24
- size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
23
+ variant?: "link" | "pill" | "default" | "outline" | "secondary" | "ghost" | "tint" | "tint-brand" | "destructive" | "destructive-solid" | "brand" | "dashed" | null | undefined;
24
+ size?: "sm" | "default" | "xs" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
25
25
  } & import("class-variance-authority/types").ClassProp) | undefined) => string> & {
26
26
  asChild?: boolean;
27
27
  }, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { type Column, type ColumnDef } from '@tanstack/react-table';
3
+ import { type FilterField, type FilterKind, type FilterRule } from './filter-bar';
3
4
  export type { ColumnDef } from '@tanstack/react-table';
4
5
  export interface DataTableFilterOption {
5
6
  label: string;
@@ -54,31 +55,71 @@ export interface DataTableFilter {
54
55
  /** Column id (accessorKey) the filter applies to. */
55
56
  columnId: string;
56
57
  title: string;
57
- options: DataTableFilterOption[];
58
+ /** Decides the operators and value editor — see FilterBar. Defaults to select. */
59
+ kind?: FilterKind;
60
+ icon?: React.ComponentType<{
61
+ className?: string;
62
+ }>;
63
+ /** The choices of a select filter; counts are added from the rows. */
64
+ options?: DataTableFilterOption[];
65
+ /** Suffix for number values. */
66
+ unit?: string;
58
67
  /** Search box above the options. Defaults to on past SEARCH_THRESHOLD. */
59
68
  searchable?: boolean;
60
69
  /** Drop options no visible row carries. */
61
70
  hideEmpty?: boolean;
62
- /** Custom option row contents — see `FacetedFilterProps.renderOption`.
63
- * Typed against the base `FacetedFilterOption`: the generic `TOption` that
64
- * lets an option carry extra fields is only available through the unbound
65
- * `FacetedFilter`, not through this descriptor. */
71
+ /** Custom option row contents in the select filter's menu — see
72
+ * `FacetedFilterProps.renderOption` (same contract: non-interactive, label
73
+ * first). Typed against the base `FacetedFilterOption`: the generic `TOption`
74
+ * that lets an option carry extra fields is only available through the
75
+ * unbound `FacetedFilter`, not through this descriptor. */
66
76
  renderOption?: FacetedFilterProps['renderOption'];
67
77
  }
68
78
  export interface DataTableProps<TData, TValue> {
69
79
  columns: ColumnDef<TData, TValue>[];
70
80
  data: TData[];
81
+ /** Shows a search field. Off by default: it searches only the rows passed
82
+ * in, so turn it on when that is what the user expects. */
83
+ searchable?: boolean;
71
84
  searchPlaceholder?: string;
72
- /** Faceted multi-select filters shown in the toolbar. */
85
+ /** The columns "Filter" offers — see FilterBar. Left out, they are
86
+ * inferred from the columns, so a table always has filters. */
73
87
  filters?: DataTableFilter[];
74
- /** Prepends a checkbox column and shows the selection count. */
75
- enableRowSelection?: boolean;
88
+ /** Prepends a checkbox column. A function decides which rows can be
89
+ * ticked — only the ones the bulk action applies to. */
90
+ enableRowSelection?: RowSelectable<TData>;
91
+ /** Names each row's record, so a tick stays on that record when the data
92
+ * refreshes or reorders. Defaults to the row's `id` field, then its
93
+ * position. Must be unique. */
94
+ getRowId?: (row: TData, index: number) => string;
95
+ /** What can be done to the ticked rows — "Approve 2". Shown in the bar that
96
+ * rises below the list, with the count and clear, while anything is
97
+ * ticked; `clear` unticks. */
98
+ bulkActions?: (rows: TData[], clear: () => void) => React.ReactNode;
76
99
  onRowClick?: (row: TData) => void;
77
100
  /** Extra toolbar content (e.g. a "New item" button), right-aligned. */
78
101
  toolbarEnd?: React.ReactNode;
79
102
  className?: string;
80
103
  }
81
- /** Sortable column header — pass via `header: ({ column }) => <DataTableColumnHeader …/>`. */
104
+ /** Selection on or off, or per row: `(row) => row.status === 'Pending'`. */
105
+ export type RowSelectable<TData> = boolean | ((row: TData) => boolean);
106
+ /** What a column can say about itself through `meta`. */
107
+ export interface DataTableColumnMeta {
108
+ /** The name in the View menu, the column menu and the filter list. */
109
+ label?: string;
110
+ /** false keeps the column out of the automatic filters. */
111
+ filter?: false;
112
+ }
113
+ interface DataTableContextValue {
114
+ canFilter: (columnId: string) => boolean;
115
+ requestFilter: (columnId: string) => void;
116
+ }
117
+ /**
118
+ * A column header with its own menu: sort either way, filter by this column,
119
+ * hide it. DataTable gives every plain-text header one automatically; pass it
120
+ * yourself only for a custom title — `header: ({ column }) =>
121
+ * <DataTableColumnHeader column={column} title="Amount" />`.
122
+ */
82
123
  export declare function DataTableColumnHeader<TData, TValue>({ column, title, className, }: {
83
124
  column: Column<TData, TValue>;
84
125
  title: string;
@@ -92,6 +133,9 @@ export declare function defaultFacetedOption(option: FacetedFilterOption, { chec
92
133
  checked: boolean;
93
134
  }): React.JSX.Element;
94
135
  /**
136
+ * SUPERSEDED by FilterBar, which DataTable now uses — kept for apps that
137
+ * placed it by hand. New toolbars use FilterBar.
138
+ *
95
139
  * Multi-select filter trigger + menu, with no table attached — for toolbars
96
140
  * that filter something other than a DataTable. State is the caller's:
97
141
  * `selected` in, `onSelect`/`onClear` out. DataTableFacetedFilter is this
@@ -108,9 +152,80 @@ export declare function DataTableFacetedFilter<TData>({ column, title, options,
108
152
  hideEmpty?: boolean;
109
153
  renderOption?: FacetedFilterProps['renderOption'];
110
154
  }): React.JSX.Element;
155
+ export interface UseDataTableOptions<TData, TValue> {
156
+ columns: ColumnDef<TData, TValue>[];
157
+ data: TData[];
158
+ filters?: DataTableFilter[];
159
+ enableRowSelection?: RowSelectable<TData>;
160
+ getRowId?: (row: TData, index: number) => string;
161
+ }
162
+ /**
163
+ * The state every view of a list shares — sorting, filters, column visibility,
164
+ * selection — so switching Table → Board → Calendar keeps what is filtered.
165
+ * DataTable and DataView are built on it; reach for it only for a view of
166
+ * your own.
167
+ */
168
+ export declare function useDataTable<TData, TValue>({ columns, data, filters, enableRowSelection, getRowId, }: UseDataTableOptions<TData, TValue>): {
169
+ table: import("@tanstack/table-core").Table<TData>;
170
+ fields: FilterField[];
171
+ rules: FilterRule[];
172
+ setRules: (next: FilterRule[]) => void;
173
+ globalFilter: string;
174
+ setGlobalFilter: React.Dispatch<React.SetStateAction<string>>;
175
+ focusField: string | null;
176
+ clearFocusField: () => void;
177
+ /** Sorted, or a column hidden: what "Reset view" undoes. Filters have their own clear. */
178
+ viewChanged: boolean;
179
+ resetView: () => void;
180
+ context: DataTableContextValue;
181
+ };
182
+ export type DataTableState<TData> = ReturnType<typeof useDataTable<TData, unknown>>;
183
+ /** Gives column headers their table — wrap whatever renders `state.table`. */
184
+ export declare function DataTableProvider<TData>({ state, children, }: {
185
+ state: DataTableState<TData>;
186
+ children: React.ReactNode;
187
+ }): React.JSX.Element;
188
+ /**
189
+ * The one toolbar of a list: the filter bar, then on the right whatever the
190
+ * app adds, the layout switch, and View (fields shown, Reset view). Ticked
191
+ * rows are acted on from DataTableBulkBar, below the list — not from here.
192
+ */
193
+ export declare function DataTableToolbar<TData>({ state, searchable, searchPlaceholder, toolbarEnd, viewSwitch, viewMenu, }: {
194
+ state: DataTableState<TData>;
195
+ searchable?: boolean;
196
+ searchPlaceholder?: string;
197
+ toolbarEnd?: React.ReactNode;
198
+ /** @deprecated Ignored: ticked rows are acted on from DataTableBulkBar, below the list. */
199
+ bulkActions?: (rows: TData[], clear: () => void) => React.ReactNode;
200
+ /** The layout switch, when the list has more than one view. */
201
+ viewSwitch?: React.ReactNode;
202
+ /** A layout's own View menu, in place of the table's columns menu. */
203
+ viewMenu?: React.ReactNode;
204
+ }): React.JSX.Element;
205
+ /** Filtered to nothing — the same state in every view. */
206
+ export declare function DataTableFilterEmpty<TData>({ state }: {
207
+ state: DataTableState<TData>;
208
+ }): React.JSX.Element;
209
+ export declare function DataTableGrid<TData>({ state, onRowClick, }: {
210
+ state: DataTableState<TData>;
211
+ onRowClick?: (row: TData) => void;
212
+ }): React.JSX.Element;
213
+ /**
214
+ * The bar for acting on ticked rows: a dark island that rises at the bottom of
215
+ * the list while any row is ticked, and stays pinned to the bottom of the view
216
+ * as a long list scrolls, so the action is in reach wherever the last tick was.
217
+ * The count, the app's actions (`bulkActions`), then clear. DataTable and
218
+ * DataView draw it; a list composed from the parts renders it after its rows.
219
+ */
220
+ export declare function DataTableBulkBar<TData>({ state, bulkActions, }: {
221
+ state: DataTableState<TData>;
222
+ bulkActions?: (rows: TData[], clear: () => void) => React.ReactNode;
223
+ }): React.JSX.Element | null;
111
224
  /**
112
- * Rise-X data table: search, faceted filters and column visibility are built
113
- * in — every table ships with the full toolbar. Sorting via
114
- * DataTableColumnHeader, optional row selection and row-click handling.
225
+ * Rise-X data table. Every table ships with the same toolbar: filters
226
+ * (inferred from the columns unless `filters` names them), View (columns
227
+ * shown, Reset view) and a menu on every column header — sort, filter by it,
228
+ * hide it. Search is opt-in (`searchable`), since it only covers the rows
229
+ * passed in. A list that also needs a board or a calendar is a DataView.
115
230
  */
116
- export declare function DataTable<TData, TValue>({ columns, data, searchPlaceholder, filters, enableRowSelection, onRowClick, toolbarEnd, className, }: DataTableProps<TData, TValue>): React.JSX.Element;
231
+ export declare function DataTable<TData, TValue>({ columns, data, searchable, searchPlaceholder, filters, enableRowSelection, getRowId, bulkActions, onRowClick, toolbarEnd, className, }: DataTableProps<TData, TValue>): React.JSX.Element;
@@ -0,0 +1,94 @@
1
+ import * as React from 'react';
2
+ import { type Row } from '@tanstack/react-table';
3
+ import { type StatusIntent } from './badge';
4
+ import { type DataTableProps } from './data-table';
5
+ export type DataViewKind = 'table' | 'board' | 'calendar';
6
+ export type DataViewRange = '3days' | 'week' | 'month';
7
+ export interface DataViewBoard {
8
+ /** The column whose value picks the lane — usually the status. */
9
+ groupBy: string;
10
+ /** The lanes, in order, even when empty. Values not listed get a lane at
11
+ * the end. Left out, lanes follow the order values first appear. */
12
+ groups?: {
13
+ value: string;
14
+ label?: string;
15
+ intent?: StatusIntent;
16
+ }[];
17
+ /** The column that titles each card. Defaults to the first one shown. */
18
+ title?: string;
19
+ }
20
+ export interface DataViewCalendar<TData = unknown> {
21
+ /** When each entry starts: a column id, or a function of the row. A Date,
22
+ * or a string Date can read. A date at midnight with no end is all day. */
23
+ date: string | ((row: TData) => unknown);
24
+ /** When it ends, the same way. Left out, a timed entry lasts an hour. */
25
+ end?: string | ((row: TData) => unknown);
26
+ /** The column whose text names each entry. Defaults to the first one. */
27
+ title?: string;
28
+ /** The range it opens on. Defaults to month. */
29
+ defaultRange?: DataViewRange;
30
+ }
31
+ export interface DataViewProps<TData, TValue> extends DataTableProps<TData, TValue> {
32
+ /** The layouts this list offers, in switch order — ask which are needed. */
33
+ views: DataViewKind[];
34
+ /** The view it opens on. Defaults to the first of `views`. */
35
+ defaultView?: DataViewKind;
36
+ /** Controlled view. */
37
+ view?: DataViewKind;
38
+ onViewChange?: (view: DataViewKind) => void;
39
+ board?: DataViewBoard;
40
+ calendar?: DataViewCalendar<TData>;
41
+ }
42
+ /** The days a range covers from `anchor`, weekends left out when hidden. */
43
+ declare function rangeDays(range: DataViewRange, anchor: Date, weekends: boolean): Date[];
44
+ /** One row on the calendar: when it starts and ends, or a whole day. */
45
+ interface CalendarEntry<TData> {
46
+ row: Row<TData>;
47
+ start: Date;
48
+ end: Date;
49
+ allDay: boolean;
50
+ }
51
+ /** A timed entry's piece of one day, placed in a lane beside the ones it overlaps. */
52
+ interface Placed<TData> {
53
+ entry: CalendarEntry<TData>;
54
+ from: number;
55
+ to: number;
56
+ lane: number;
57
+ lanes: number;
58
+ }
59
+ /**
60
+ * Lay a day's timed entries out: each cluster of overlapping entries shares
61
+ * the column width, one lane each. Past MAX_LANES, the last lane becomes
62
+ * "+N" for the rest of that cluster.
63
+ */
64
+ /** Whether an entry touches a day — the one rule every layout groups by, so a
65
+ * Monday–Wednesday entry reads the same in the grid, the month and the
66
+ * agenda. An all-day entry's end is a date, and that day is included. */
67
+ declare function onDay<TData>(entry: CalendarEntry<TData>, day: Date): boolean;
68
+ declare function layoutDay<TData>(day: Date, entries: CalendarEntry<TData>[]): {
69
+ placed: Placed<TData>[];
70
+ more: {
71
+ from: number;
72
+ to: number;
73
+ lanes: number;
74
+ entries: CalendarEntry<TData>[];
75
+ }[];
76
+ };
77
+ /**
78
+ * A list with more than one layout: Table, Board and/or Calendar behind one
79
+ * toolbar. Pass the layouts the list needs in `views` — ask which — and a
80
+ * `board` or `calendar` config for those layouts. Everything a DataTable
81
+ * takes works here too.
82
+ */
83
+ declare function DataView<TData, TValue>({ views, defaultView, view: viewProp, onViewChange, board, calendar, columns, data, filters, enableRowSelection, getRowId, bulkActions, searchable, searchPlaceholder, onRowClick, toolbarEnd, className, }: DataViewProps<TData, TValue>): React.JSX.Element;
84
+ export { DataView };
85
+ /** The calendar's date logic, exported for its tests (the kit has no runner of
86
+ * its own; the Shell's suite covers it). Not part of the kit's API: not
87
+ * re-exported from the package index, and free to change. */
88
+ export declare const calendarInternals: {
89
+ rangeDays: typeof rangeDays;
90
+ onDay: typeof onDay;
91
+ layoutDay: typeof layoutDay;
92
+ toDate: (value: unknown) => Date | null;
93
+ isMidnight: (d: Date) => boolean;
94
+ };
@@ -3,6 +3,18 @@ export interface DatePickerRange {
3
3
  from?: Date;
4
4
  to?: Date;
5
5
  }
6
+ /**
7
+ * The month grid on its own — the calendar inside DatePicker, for surfaces
8
+ * that already are a popover (a filter's value editor) and must not stack a
9
+ * second one on top. Same month arithmetic, same follow-the-selection rule.
10
+ */
11
+ declare function DateCalendar({ value, range, onValueChange, footer, className, }: {
12
+ value?: Date;
13
+ range?: DatePickerRange;
14
+ onValueChange?: (date: Date) => void;
15
+ footer?: React.ReactNode;
16
+ className?: string;
17
+ }): React.JSX.Element;
6
18
  declare const DatePicker: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "onChange" | "value"> & {
7
19
  value?: Date;
8
20
  onValueChange?: (date: Date) => void;
@@ -12,5 +24,15 @@ declare const DatePicker: React.ForwardRefExoticComponent<Omit<Omit<React.Detail
12
24
  /** Formats the trigger label. Keep it on the date's local parts. */
13
25
  format?: (date: Date) => string;
14
26
  footer?: React.ReactNode;
27
+ /**
28
+ * A date AND a time — a pickup at 07:00, a slot, a deadline to the hour.
29
+ * The calendar gets a column of times beside it (every 30 minutes, or
30
+ * `step`), the value carries hours and minutes, and the label reads
31
+ * "4 Nov 2026, 07:00". Use this, never `<input type="datetime-local">`:
32
+ * the browser draws its own picker, which no theme reaches.
33
+ */
34
+ time?: boolean | {
35
+ step?: number;
36
+ };
15
37
  }, "ref"> & React.RefAttributes<HTMLButtonElement>>;
16
- export { DatePicker };
38
+ export { DateCalendar, DatePicker };
@@ -3,11 +3,19 @@ declare function FileDrop({ className, active, ...props }: React.ComponentProps<
3
3
  active?: boolean;
4
4
  }): React.JSX.Element;
5
5
  declare function FileDropGlyph({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
6
- declare function FileCard({ className, glyph, name, meta, action, ...props }: React.ComponentProps<'div'> & {
6
+ declare function FileCard({ className, glyph, name, meta, action, onPreview, onDownload, previewLabel, downloadLabel, size, ...props }: React.ComponentProps<'div'> & {
7
7
  glyph?: React.ReactNode;
8
8
  name: React.ReactNode;
9
9
  meta?: React.ReactNode;
10
+ /** Anything beyond preview and download, after them. */
10
11
  action?: React.ReactNode;
12
+ /** Shows the eye button. */
13
+ onPreview?: () => void;
14
+ /** Shows the download button. */
15
+ onDownload?: () => void;
16
+ previewLabel?: string;
17
+ downloadLabel?: string;
18
+ size?: 'default' | 'sm';
11
19
  }): React.JSX.Element;
12
20
  declare function AttachmentList({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
13
21
  declare function MediaThumb({ className, size, ...props }: React.ComponentProps<'div'> & {
@@ -0,0 +1,89 @@
1
+ import * as React from 'react';
2
+ export type FilterKind = 'select' | 'text' | 'number' | 'date';
3
+ export type FilterOp = 'in' | 'notIn' | 'contains' | 'notContains' | 'is' | 'eq' | 'gt' | 'lt' | 'between' | 'on' | 'before' | 'after' | 'isEmpty' | 'notEmpty';
4
+ /** string[] for in/notIn, a pair for between, otherwise a string. Dates are
5
+ * `YYYY-MM-DD` (local day) or a relative token such as `@last7`. */
6
+ export type FilterValue = string | string[] | [string, string];
7
+ export interface FilterRule {
8
+ /** The FilterField `key` this rule applies to. */
9
+ field: string;
10
+ op: FilterOp;
11
+ value: FilterValue;
12
+ }
13
+ export interface FilterOption {
14
+ value: string;
15
+ label: string;
16
+ /** How many rows carry it — shown right-aligned. Omit when not counted. */
17
+ count?: number;
18
+ }
19
+ export interface FilterField {
20
+ key: string;
21
+ label: string;
22
+ icon?: React.ComponentType<{
23
+ className?: string;
24
+ }>;
25
+ /** Decides the operators and the value editor. Defaults to select. */
26
+ kind?: FilterKind;
27
+ /** The choices of a select field. */
28
+ options?: FilterOption[];
29
+ /** Search box above the options. Defaults to on past 8 options. */
30
+ searchable?: boolean;
31
+ /** Suffix for number values — "t", "USD". */
32
+ unit?: string;
33
+ /** Replaces the contents of a select option row (the tick, label, count);
34
+ * the row button stays ours. Keep it non-interactive — see FacetedFilter. */
35
+ renderOption?: (option: FilterOption, state: {
36
+ checked: boolean;
37
+ }) => React.ReactNode;
38
+ }
39
+ /** The kind a rule was built for, read off the rule alone: the one its
40
+ * operator belongs to, and where two share one (`between`), a value shaped
41
+ * like a day (`2026-07-12`, `@today`) makes it a date rather than a number.
42
+ * Lets a list keep a filter meaningful when its field's kind changes or the
43
+ * field goes away. */
44
+ export declare function kindOfRule(rule: FilterRule): FilterKind;
45
+ /** Whether a rule fits a kind: its operator is one the kind offers. */
46
+ export declare function ruleFitsKind(rule: FilterRule, kind: FilterKind): boolean;
47
+ /** A rule still waiting for its value filters nothing, rather than hiding every row. */
48
+ export declare function isFilterComplete(rule: FilterRule): boolean;
49
+ /**
50
+ * Does a row's raw value pass the rule? `raw` is the cell's value: a string or
51
+ * string[] for select, a string for text, a number (or numeric string) for
52
+ * number, a Date, epoch ms or date string for date. Incomplete rules pass.
53
+ */
54
+ export declare function matchesFilter(rule: FilterRule, kind: FilterKind, raw: unknown): boolean;
55
+ export interface FilterBarProps {
56
+ fields: FilterField[];
57
+ filters: FilterRule[];
58
+ onFiltersChange: (filters: FilterRule[]) => void;
59
+ /** Leading content — a search field, only when the list asks for one. */
60
+ children?: React.ReactNode;
61
+ /** Optional muted count while anything filters — "12 of 48". Leave it out
62
+ * unless the total matters to the task. */
63
+ summary?: React.ReactNode;
64
+ /** Pushed to the end of the row: a layout switch, Save view, column options. */
65
+ end?: React.ReactNode;
66
+ /** A field to filter by now — a column header's "Filter by" asks this way.
67
+ * The bar adds its chip (or opens the one there) and calls onFocusFieldDone. */
68
+ focusField?: string | null;
69
+ onFocusFieldDone?: () => void;
70
+ className?: string;
71
+ }
72
+ declare function FilterBar({ fields, filters, onFiltersChange, children, summary, end, focusField, onFocusFieldDone, className, }: FilterBarProps): React.JSX.Element;
73
+ export interface FilterEmptyStateProps {
74
+ fields: FilterField[];
75
+ filters: FilterRule[];
76
+ onFiltersChange: (filters: FilterRule[]) => void;
77
+ /** How many rows would show with this one rule removed. */
78
+ countWithout: (rule: FilterRule) => number;
79
+ /** Plural of what the list holds — "work items". */
80
+ noun?: string;
81
+ className?: string;
82
+ }
83
+ /**
84
+ * What a list shows when its filters match nothing. One action, and the most
85
+ * useful one: drop the filter that is costing the most rows. Only when no
86
+ * single filter is to blame does it fall back to clearing them all.
87
+ */
88
+ declare function FilterEmptyState({ fields, filters, onFiltersChange, countWithout, noun, className, }: FilterEmptyStateProps): React.JSX.Element;
89
+ export { FilterBar, FilterEmptyState };