@tailor-platform/app-shell 1.9.0 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app-shell-core.css +1 -1
- package/dist/app-shell.d.ts +272 -18
- package/dist/app-shell.js +5472 -4294
- package/dist/themes/bloom.css +2 -1
- package/dist/themes/cream.css +2 -1
- package/package.json +1 -1
- package/skills/app-shell-patterns/references/fundamental/components.md +15 -2
- package/skills/app-shell-patterns/references/patterns/list-dense-scan.md +2 -1
package/dist/app-shell.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { AutocompleteRootProps } from '@base-ui/react/autocomplete';
|
|
|
4
4
|
import { Avatar as Avatar_2 } from '@base-ui/react/avatar';
|
|
5
5
|
import { CalendarDate } from '@internationalized/date';
|
|
6
6
|
import { CalendarDateTime } from '@internationalized/date';
|
|
7
|
+
import { Checkbox as Checkbox_2 } from '@base-ui/react/checkbox';
|
|
7
8
|
import { ClassProp } from 'class-variance-authority/types';
|
|
8
9
|
import { Combobox as Combobox_2 } from '@base-ui/react/combobox';
|
|
9
10
|
import { CSSProperties } from 'react';
|
|
@@ -256,6 +257,18 @@ declare type Anchor = "start" | "center" | "end";
|
|
|
256
257
|
*/
|
|
257
258
|
export declare function AppearanceSwitcher(): JSX.Element;
|
|
258
259
|
|
|
260
|
+
export declare type AppInfo = {
|
|
261
|
+
/** Additional app-defined rows shown on the built-in "/__appinfo" page. */
|
|
262
|
+
metadata?: readonly AppInfoEntry[];
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
export declare type AppInfoEntry = {
|
|
266
|
+
/** Display label shown on the built-in "/__appinfo" page. */
|
|
267
|
+
label: string;
|
|
268
|
+
/** Primitive value rendered as text. Format complex values before passing them in. */
|
|
269
|
+
value: string | number | boolean | null | undefined;
|
|
270
|
+
};
|
|
271
|
+
|
|
259
272
|
export declare const AppShell: {
|
|
260
273
|
(props: AppShellProps): JSX.Element | null;
|
|
261
274
|
WithPages(pages: PageEntry[]): FC<AppShellProps>;
|
|
@@ -269,6 +282,7 @@ declare type AppShellConfigContextType = {
|
|
|
269
282
|
title?: string;
|
|
270
283
|
icon?: ReactNode;
|
|
271
284
|
favicon?: string;
|
|
285
|
+
appInfo?: AppInfo;
|
|
272
286
|
configurations: RootConfiguration;
|
|
273
287
|
};
|
|
274
288
|
|
|
@@ -426,10 +440,12 @@ declare type AsyncFetcher<T> = AsyncFetcherFn<T> | {
|
|
|
426
440
|
* this one — pass it through to `fetch()` so the browser cancels the
|
|
427
441
|
* in-flight HTTP request automatically.
|
|
428
442
|
*
|
|
429
|
-
* **Error handling:**
|
|
430
|
-
*
|
|
431
|
-
*
|
|
432
|
-
*
|
|
443
|
+
* **Error handling:** If the fetcher throws or rejects, the component renders
|
|
444
|
+
* a built-in inline error state (with a Retry affordance) in place of the
|
|
445
|
+
* empty state — the failure is no longer silently swallowed. Aborted/superseded
|
|
446
|
+
* requests are ignored. To run a side effect on failure (logging, error
|
|
447
|
+
* tracking, a toast), pass `onFetchError`; it fires once per outage rather
|
|
448
|
+
* than once per failed keystroke.
|
|
433
449
|
*
|
|
434
450
|
* The `query` parameter is `null` when the user has not typed anything
|
|
435
451
|
* (e.g. the dropdown was just opened). Return initial / default items
|
|
@@ -586,6 +602,20 @@ declare interface AutocompleteAsyncStandaloneProps<T> extends AutocompletePropsB
|
|
|
586
602
|
fetcher: AutocompleteAsyncFetcher<T>;
|
|
587
603
|
/** Text shown while loading. @default "Loading..." */
|
|
588
604
|
loadingText?: string;
|
|
605
|
+
/**
|
|
606
|
+
* Message shown in the popover when the fetcher fails, alongside a Retry
|
|
607
|
+
* affordance. Replaces the misleading empty state.
|
|
608
|
+
* @default "Couldn't load results."
|
|
609
|
+
*/
|
|
610
|
+
errorText?: string;
|
|
611
|
+
/** Label for the retry button in the error state. @default "Retry" */
|
|
612
|
+
retryText?: string;
|
|
613
|
+
/**
|
|
614
|
+
* Called when a fetch fails. Fires once per outage (not per failed keystroke)
|
|
615
|
+
* and re-arms after the next success. Use for logging or error tracking — the
|
|
616
|
+
* inline error state is shown regardless.
|
|
617
|
+
*/
|
|
618
|
+
onFetchError?: (error: unknown) => void;
|
|
589
619
|
}
|
|
590
620
|
|
|
591
621
|
declare function AutocompleteClear({ className, children, ...props }: React_2.ComponentProps<typeof Autocomplete_2.Clear>): JSX.Element;
|
|
@@ -779,6 +809,8 @@ declare interface AutocompleteUseAsyncReturn<T> {
|
|
|
779
809
|
value: string;
|
|
780
810
|
/** The error thrown by the last fetch, if any */
|
|
781
811
|
error: unknown;
|
|
812
|
+
/** Re-runs the most recent fetch immediately (no debounce). Use for a Retry affordance. */
|
|
813
|
+
retry: () => void;
|
|
782
814
|
/** Value change handler — pass to the Root `onValueChange` prop. */
|
|
783
815
|
onValueChange: (value: string) => void;
|
|
784
816
|
}
|
|
@@ -962,6 +994,60 @@ declare type CellProps = React_2.ComponentProps<"td"> & {
|
|
|
962
994
|
align?: CellAlign;
|
|
963
995
|
};
|
|
964
996
|
|
|
997
|
+
/**
|
|
998
|
+
* A styled checkbox for boolean form fields.
|
|
999
|
+
*
|
|
1000
|
+
* Wraps Base UI's `Checkbox`, so it works with `Field` and React Hook Form the
|
|
1001
|
+
* same way `Input`, `Select`, and `Combobox` do — placed inside a `Field.Root`
|
|
1002
|
+
* it inherits label association, `aria-describedby`, `disabled`, and the
|
|
1003
|
+
* `data-invalid` error state automatically (no `error` prop of its own).
|
|
1004
|
+
*
|
|
1005
|
+
* Supports controlled (`checked`) and uncontrolled (`defaultChecked`) use, plus
|
|
1006
|
+
* an `indeterminate` "partially selected" state.
|
|
1007
|
+
*
|
|
1008
|
+
* @example
|
|
1009
|
+
* ### Standalone with an inline label
|
|
1010
|
+
* ```tsx
|
|
1011
|
+
* const [checked, setChecked] = React.useState(false);
|
|
1012
|
+
*
|
|
1013
|
+
* <Checkbox label="Subscribe to updates" checked={checked} onCheckedChange={setChecked} />
|
|
1014
|
+
* ```
|
|
1015
|
+
*
|
|
1016
|
+
* @example
|
|
1017
|
+
* ### Inside a Field with React Hook Form
|
|
1018
|
+
* ```tsx
|
|
1019
|
+
* <Controller
|
|
1020
|
+
* name="acceptTerms"
|
|
1021
|
+
* control={control}
|
|
1022
|
+
* rules={{ required: "You must accept the terms." }}
|
|
1023
|
+
* render={({ field, fieldState }) => (
|
|
1024
|
+
* <Field.Root name={field.name} {...fieldState}>
|
|
1025
|
+
* <Checkbox
|
|
1026
|
+
* label="I accept the terms and conditions"
|
|
1027
|
+
* checked={field.value}
|
|
1028
|
+
* onCheckedChange={field.onChange}
|
|
1029
|
+
* onBlur={field.onBlur}
|
|
1030
|
+
* inputRef={field.ref}
|
|
1031
|
+
* />
|
|
1032
|
+
* <Field.Error />
|
|
1033
|
+
* </Field.Root>
|
|
1034
|
+
* )}
|
|
1035
|
+
* />
|
|
1036
|
+
* ```
|
|
1037
|
+
*
|
|
1038
|
+
* @example
|
|
1039
|
+
* ### Indeterminate ("select all")
|
|
1040
|
+
* ```tsx
|
|
1041
|
+
* <Checkbox
|
|
1042
|
+
* aria-label="Select all rows"
|
|
1043
|
+
* checked={allSelected}
|
|
1044
|
+
* indeterminate={someSelected && !allSelected}
|
|
1045
|
+
* onCheckedChange={(checked) => (checked ? selectAll() : clearAll())}
|
|
1046
|
+
* />
|
|
1047
|
+
* ```
|
|
1048
|
+
*/
|
|
1049
|
+
export declare function Checkbox({ className, label, ...props }: CheckboxProps): JSX.Element;
|
|
1050
|
+
|
|
965
1051
|
/** A menu item that toggles a setting on or off. */
|
|
966
1052
|
declare function CheckboxItem({ className, ...props }: React_2.ComponentProps<typeof Menu_2.CheckboxItem>): JSX.Element;
|
|
967
1053
|
|
|
@@ -976,6 +1062,16 @@ declare namespace CheckboxItemIndicator {
|
|
|
976
1062
|
var displayName: string;
|
|
977
1063
|
}
|
|
978
1064
|
|
|
1065
|
+
export declare type CheckboxProps = Omit<React_2.ComponentProps<typeof Checkbox_2.Root>, "children" | "render"> & {
|
|
1066
|
+
/**
|
|
1067
|
+
* Optional inline label rendered next to the box. When provided, the box and
|
|
1068
|
+
* text are wrapped in an enclosing `<label>` so clicking the text toggles the
|
|
1069
|
+
* checkbox. Omit it to render the bare box (e.g. a row-select cell with an
|
|
1070
|
+
* `aria-label`, or a `Field.Label` sibling for the stacked form layout).
|
|
1071
|
+
*/
|
|
1072
|
+
label?: React_2.ReactNode;
|
|
1073
|
+
};
|
|
1074
|
+
|
|
979
1075
|
/** A button that closes the dialog. */
|
|
980
1076
|
declare function Close({ ...props }: React_2.ComponentProps<typeof Dialog_2.Close>): JSX.Element;
|
|
981
1077
|
|
|
@@ -1146,7 +1242,10 @@ declare type ColumnArea = "left" | "main" | "right";
|
|
|
1146
1242
|
* column types (e.g. `type MoneyColumn<TRow> = ColumnBase<TRow> & { type: "money"; … }`).
|
|
1147
1243
|
*/
|
|
1148
1244
|
declare interface ColumnBase<TRow extends Record<string, unknown>> {
|
|
1149
|
-
/**
|
|
1245
|
+
/**
|
|
1246
|
+
* Column header text. Used as the default header content and passed to
|
|
1247
|
+
* custom `header` renderers.
|
|
1248
|
+
*/
|
|
1150
1249
|
label?: string;
|
|
1151
1250
|
/**
|
|
1152
1251
|
* Renders the cell content for a given row. Optional — when omitted, the
|
|
@@ -1158,6 +1257,16 @@ declare interface ColumnBase<TRow extends Record<string, unknown>> {
|
|
|
1158
1257
|
* across spread-then-override patterns like `column({ ...inferred, render })`.
|
|
1159
1258
|
*/
|
|
1160
1259
|
render?: (row: TRow) => ReactNode;
|
|
1260
|
+
/**
|
|
1261
|
+
* Custom header renderer.
|
|
1262
|
+
*
|
|
1263
|
+
* When omitted, the built-in header renders `label` and, for sortable
|
|
1264
|
+
* columns, owns the sort button and indicator. When provided, the return
|
|
1265
|
+
* value replaces the built-in header entirely. Sortable custom headers
|
|
1266
|
+
* receive `sortDirection` and `activateSort()` and must render their own
|
|
1267
|
+
* click surface and sort indicator.
|
|
1268
|
+
*/
|
|
1269
|
+
header?: (ctx: HeaderRenderContext) => ReactNode;
|
|
1161
1270
|
/**
|
|
1162
1271
|
* Stable identifier used for column visibility toggling and as the React key.
|
|
1163
1272
|
* Falls back to `label` when omitted. Set this explicitly when `label` is
|
|
@@ -1166,6 +1275,17 @@ declare interface ColumnBase<TRow extends Record<string, unknown>> {
|
|
|
1166
1275
|
id?: string;
|
|
1167
1276
|
/** Fixed column width in pixels. When omitted the column sizes naturally. */
|
|
1168
1277
|
width?: number;
|
|
1278
|
+
/**
|
|
1279
|
+
* Freeze this column to the left or right edge so it stays visible while the
|
|
1280
|
+
* table scrolls horizontally. This is the **default** pin; the user can
|
|
1281
|
+
* override it at runtime via the toolbar's `columnSettings` control (persisted when
|
|
1282
|
+
* `tableId` is set).
|
|
1283
|
+
*
|
|
1284
|
+
* Sticky offsets for stacked pinned columns are measured from the rendered
|
|
1285
|
+
* layout, so a `width` is not required — but setting `width` on pinned columns
|
|
1286
|
+
* is recommended so their size stays stable as row content changes.
|
|
1287
|
+
*/
|
|
1288
|
+
pin?: "left" | "right";
|
|
1169
1289
|
/**
|
|
1170
1290
|
* Horizontal alignment for the header and body cell. When omitted, numeric
|
|
1171
1291
|
* `type` values (`"number"` and `"money"`) default to `"right"` so digits
|
|
@@ -1342,6 +1462,20 @@ declare interface ComboboxAsyncOwnProps<T> {
|
|
|
1342
1462
|
fetcher: ComboboxAsyncFetcher<T>;
|
|
1343
1463
|
/** Text shown while loading. @default "Loading..." */
|
|
1344
1464
|
loadingText?: string;
|
|
1465
|
+
/**
|
|
1466
|
+
* Message shown in the popover when the fetcher fails, alongside a Retry
|
|
1467
|
+
* affordance. Replaces the misleading empty state.
|
|
1468
|
+
* @default "Couldn't load results."
|
|
1469
|
+
*/
|
|
1470
|
+
errorText?: string;
|
|
1471
|
+
/** Label for the retry button in the error state. @default "Retry" */
|
|
1472
|
+
retryText?: string;
|
|
1473
|
+
/**
|
|
1474
|
+
* Called when a fetch fails. Fires once per outage (not per failed keystroke)
|
|
1475
|
+
* and re-arms after the next success. Use for logging or error tracking — the
|
|
1476
|
+
* inline error state is shown regardless.
|
|
1477
|
+
*/
|
|
1478
|
+
onFetchError?: (error: unknown) => void;
|
|
1345
1479
|
}
|
|
1346
1480
|
|
|
1347
1481
|
declare type ComboboxAsyncPlainProps<T> = (ComboboxAsyncOwnProps<T> & ComboboxPropsSingle<T>) | (ComboboxAsyncOwnProps<T> & ComboboxPropsMultiple<T>);
|
|
@@ -1979,8 +2113,9 @@ export declare const DataTable: {
|
|
|
1979
2113
|
*/
|
|
1980
2114
|
readonly Root: typeof DataTableRoot;
|
|
1981
2115
|
/**
|
|
1982
|
-
* Container for toolbar content (
|
|
1983
|
-
*
|
|
2116
|
+
* Container for toolbar content (filters, search, etc.). Place inside
|
|
2117
|
+
* `DataTable.Root`, before `DataTable.Table`. Pass `columnSettings` to render
|
|
2118
|
+
* the built-in "Columns" control (show/hide, reorder, pin) at the top-right.
|
|
1984
2119
|
*/
|
|
1985
2120
|
readonly Toolbar: typeof DataTableToolbar;
|
|
1986
2121
|
/**
|
|
@@ -2057,6 +2192,11 @@ export declare interface DataTableContextValue<TRow extends Record<string, unkno
|
|
|
2057
2192
|
showAllColumns: () => void;
|
|
2058
2193
|
hideAllColumns: () => void;
|
|
2059
2194
|
isColumnVisible: (fieldOrId: string) => boolean;
|
|
2195
|
+
columnOrder: string[];
|
|
2196
|
+
moveColumn: (key: string, toIndex: number) => void;
|
|
2197
|
+
setColumnOrder: (keys: string[]) => void;
|
|
2198
|
+
pinnedColumns: Record<string, "left" | "right" | "none">;
|
|
2199
|
+
setPin: (key: string, side: "left" | "right" | "none" | null) => void;
|
|
2060
2200
|
onClickRow?: (row: TRow) => void;
|
|
2061
2201
|
rowActions?: RowAction<TRow>[];
|
|
2062
2202
|
selectedIds: string[];
|
|
@@ -2082,8 +2222,20 @@ export declare interface DataTableData<TRow> {
|
|
|
2082
2222
|
}
|
|
2083
2223
|
|
|
2084
2224
|
/** Use `DataTable.Filters` instead of calling this directly. */
|
|
2085
|
-
declare function DataTableFilters({ className }: {
|
|
2225
|
+
declare function DataTableFilters({ className, slot, addIconOnly, }: {
|
|
2086
2226
|
className?: string;
|
|
2227
|
+
/**
|
|
2228
|
+
* Which part to render, for custom toolbar layouts:
|
|
2229
|
+
* - `"all"` (default) — active filter chips plus the **Add filter** trigger.
|
|
2230
|
+
* - `"chips"` — only the active filter chips (renders nothing when there are none).
|
|
2231
|
+
* - `"add"` — only the **Add filter** trigger.
|
|
2232
|
+
*
|
|
2233
|
+
* Render `"add"` and `"chips"` separately to place the trigger and the chips on
|
|
2234
|
+
* different rows (e.g. the trigger in a header row, chips on the row below).
|
|
2235
|
+
*/
|
|
2236
|
+
slot?: "all" | "chips" | "add";
|
|
2237
|
+
/** Render the **Add filter** trigger as an icon-only button (label → `aria-label`). */
|
|
2238
|
+
addIconOnly?: boolean;
|
|
2087
2239
|
}): JSX.Element | null;
|
|
2088
2240
|
|
|
2089
2241
|
declare namespace DataTableFilters {
|
|
@@ -2138,8 +2290,15 @@ declare namespace DataTableTable {
|
|
|
2138
2290
|
}
|
|
2139
2291
|
|
|
2140
2292
|
/** Use `DataTable.Toolbar` instead of calling this directly. */
|
|
2141
|
-
declare function DataTableToolbar({ children, className }: {
|
|
2142
|
-
children
|
|
2293
|
+
declare function DataTableToolbar({ children, columnSettings, className, }: {
|
|
2294
|
+
children?: ReactNode;
|
|
2295
|
+
/**
|
|
2296
|
+
* Render the built-in column-settings control (a "Columns" button that opens
|
|
2297
|
+
* the show/hide + reorder + pin popover) anchored to the top-right of the
|
|
2298
|
+
* toolbar. The button always lives in the same place, so it's a prop rather
|
|
2299
|
+
* than a separately-composed sub-component.
|
|
2300
|
+
*/
|
|
2301
|
+
columnSettings?: boolean;
|
|
2143
2302
|
className?: string;
|
|
2144
2303
|
}): JSX.Element;
|
|
2145
2304
|
|
|
@@ -3418,6 +3577,11 @@ declare type HeaderProps = Omit<React_2.ComponentProps<"div">, "title"> & {
|
|
|
3418
3577
|
description?: React_2.ReactNode;
|
|
3419
3578
|
};
|
|
3420
3579
|
|
|
3580
|
+
/**
|
|
3581
|
+
* Context passed to custom `header` renderers.
|
|
3582
|
+
*/
|
|
3583
|
+
export declare type HeaderRenderContext = NonSortableHeaderRenderContext | SortableHeaderRenderContext;
|
|
3584
|
+
|
|
3421
3585
|
declare type HeadProps = React_2.ComponentProps<"th"> & {
|
|
3422
3586
|
align?: CellAlign;
|
|
3423
3587
|
};
|
|
@@ -3873,6 +4037,14 @@ export declare type NodeType<T extends {
|
|
|
3873
4037
|
}[];
|
|
3874
4038
|
} | null | undefined> = NonNullable<T>["edges"][number]["node"];
|
|
3875
4039
|
|
|
4040
|
+
/**
|
|
4041
|
+
* Header render context for non-sortable columns.
|
|
4042
|
+
*/
|
|
4043
|
+
declare interface NonSortableHeaderRenderContext {
|
|
4044
|
+
label?: string;
|
|
4045
|
+
sortable: false;
|
|
4046
|
+
}
|
|
4047
|
+
|
|
3876
4048
|
/** Options for `type: "number"` cells. */
|
|
3877
4049
|
declare interface NumberCellOptions {
|
|
3878
4050
|
/** Minimum decimal places. Default: `0`. */
|
|
@@ -4262,7 +4434,7 @@ declare namespace Root_3 {
|
|
|
4262
4434
|
* </Table.Root>
|
|
4263
4435
|
* ```
|
|
4264
4436
|
*/
|
|
4265
|
-
declare function Root_4({ className, containerClassName, ...props }: RootProps_2): JSX.Element;
|
|
4437
|
+
declare function Root_4({ className, containerClassName, containerRef, ...props }: RootProps_2): JSX.Element;
|
|
4266
4438
|
|
|
4267
4439
|
declare namespace Root_4 {
|
|
4268
4440
|
var displayName: string;
|
|
@@ -4404,6 +4576,8 @@ declare type RootProps = React_2.ComponentProps<"div"> & VariantProps<typeof ale
|
|
|
4404
4576
|
declare type RootProps_2 = React_2.ComponentProps<"table"> & {
|
|
4405
4577
|
/** Additional CSS classes for the outer scrollable `<div>` container. Use this to control height, overflow, or container-level layout. */
|
|
4406
4578
|
containerClassName?: string;
|
|
4579
|
+
/** Ref to the outer scrollable `<div>` container (e.g. to attach a scroll listener). */
|
|
4580
|
+
containerRef?: React_2.Ref<HTMLDivElement>;
|
|
4407
4581
|
};
|
|
4408
4582
|
|
|
4409
4583
|
declare type RootProps_3 = Pick<React_2.ComponentProps<typeof Tabs_2.Root>, "defaultValue" | "value" | "onValueChange"> & {
|
|
@@ -4514,10 +4688,10 @@ export declare const Select: SelectComponent;
|
|
|
4514
4688
|
* If caching or deduplication is needed, implement it in the fetcher
|
|
4515
4689
|
* (e.g. via a query library or a simple cache layer).
|
|
4516
4690
|
*
|
|
4517
|
-
* **Error handling:**
|
|
4518
|
-
*
|
|
4519
|
-
* item list —
|
|
4520
|
-
*
|
|
4691
|
+
* **Error handling:** If the fetcher throws or rejects, the component renders
|
|
4692
|
+
* a built-in inline error state (with a Retry affordance) in place of the
|
|
4693
|
+
* empty item list — the failure is no longer silently swallowed. To run a side
|
|
4694
|
+
* effect on failure (logging, error tracking, a toast), pass `onFetchError`.
|
|
4521
4695
|
*/
|
|
4522
4696
|
export declare type SelectAsyncFetcher<T> = (options: {
|
|
4523
4697
|
signal: AbortSignal;
|
|
@@ -4528,6 +4702,20 @@ declare interface SelectAsyncOwnProps<T> {
|
|
|
4528
4702
|
fetcher: SelectAsyncFetcher<T>;
|
|
4529
4703
|
/** Text shown while loading. @default "Loading..." */
|
|
4530
4704
|
loadingText?: string;
|
|
4705
|
+
/**
|
|
4706
|
+
* Message shown in the dropdown when the fetcher fails, alongside a Retry
|
|
4707
|
+
* affordance. Replaces the misleading empty state.
|
|
4708
|
+
* @default "Couldn't load results."
|
|
4709
|
+
*/
|
|
4710
|
+
errorText?: string;
|
|
4711
|
+
/** Label for the retry button in the error state. @default "Retry" */
|
|
4712
|
+
retryText?: string;
|
|
4713
|
+
/**
|
|
4714
|
+
* Called when a fetch fails. Fires once per outage (not on every re-open
|
|
4715
|
+
* while broken) and re-arms after the next success. Use for logging or error
|
|
4716
|
+
* tracking — the inline error state is shown regardless.
|
|
4717
|
+
*/
|
|
4718
|
+
onFetchError?: (error: unknown) => void;
|
|
4531
4719
|
/**
|
|
4532
4720
|
* Whether the select behaves as a modal (traps focus).
|
|
4533
4721
|
* Set to `true` when rendering inside a Dialog or Sheet to preserve focus-trap.
|
|
@@ -4730,6 +4918,13 @@ declare type SharedAppShellProps = React.PropsWithChildren<{
|
|
|
4730
4918
|
* `<link rel="icon">` in `index.html`.
|
|
4731
4919
|
*/
|
|
4732
4920
|
favicon?: string;
|
|
4921
|
+
/**
|
|
4922
|
+
* Additional application metadata shown on the built-in `/__appinfo` page.
|
|
4923
|
+
*
|
|
4924
|
+
* AppShell always includes its own version there; use this prop to append
|
|
4925
|
+
* app-defined rows such as environment, release, or commit.
|
|
4926
|
+
*/
|
|
4927
|
+
appInfo?: AppInfo;
|
|
4733
4928
|
/**
|
|
4734
4929
|
* Base path for the app shell
|
|
4735
4930
|
*/
|
|
@@ -5133,6 +5328,16 @@ export declare const SidebarSeparator: () => JSX.Element;
|
|
|
5133
5328
|
|
|
5134
5329
|
declare type Size = "sm" | "md" | "lg" | "xl" | "full";
|
|
5135
5330
|
|
|
5331
|
+
/**
|
|
5332
|
+
* Header render context for sortable columns.
|
|
5333
|
+
*/
|
|
5334
|
+
declare interface SortableHeaderRenderContext {
|
|
5335
|
+
label?: string;
|
|
5336
|
+
sortable: true;
|
|
5337
|
+
sortDirection: "Asc" | "Desc" | undefined;
|
|
5338
|
+
activateSort: () => void;
|
|
5339
|
+
}
|
|
5340
|
+
|
|
5136
5341
|
/**
|
|
5137
5342
|
* Sort configuration for a column.
|
|
5138
5343
|
* The `type` determines how values are compared when sorting.
|
|
@@ -5735,6 +5940,7 @@ export declare const useAppShell: () => {
|
|
|
5735
5940
|
title?: string;
|
|
5736
5941
|
icon?: ReactNode;
|
|
5737
5942
|
favicon?: string;
|
|
5943
|
+
appInfo?: AppInfo;
|
|
5738
5944
|
configurations: RootConfiguration;
|
|
5739
5945
|
};
|
|
5740
5946
|
|
|
@@ -5818,7 +6024,7 @@ export declare function useAppShellScrollContainer(): RefObject<HTMLElement | nu
|
|
|
5818
6024
|
* </Select.Parts.Root>
|
|
5819
6025
|
* ```
|
|
5820
6026
|
*/
|
|
5821
|
-
declare function useAsync<T>({ fetcher }: UseSelectAsyncOptions<T>): UseSelectAsyncReturn<T>;
|
|
6027
|
+
declare function useAsync<T>({ fetcher, onFetchError }: UseSelectAsyncOptions<T>): UseSelectAsyncReturn<T>;
|
|
5822
6028
|
|
|
5823
6029
|
/**
|
|
5824
6030
|
* Hook that encapsulates the async combobox pattern — debounced fetching,
|
|
@@ -5855,7 +6061,11 @@ declare function useAsync<T>({ fetcher }: UseSelectAsyncOptions<T>): UseSelectAs
|
|
|
5855
6061
|
* >
|
|
5856
6062
|
* ...
|
|
5857
6063
|
* <Combobox.Empty>
|
|
5858
|
-
* {countries.loading
|
|
6064
|
+
* {countries.loading
|
|
6065
|
+
* ? "Loading..."
|
|
6066
|
+
* : countries.error
|
|
6067
|
+
* ? <button onClick={countries.retry}>Couldn't load results. Retry</button>
|
|
6068
|
+
* : "No results."}
|
|
5859
6069
|
* </Combobox.Empty>
|
|
5860
6070
|
* </Combobox.Root>
|
|
5861
6071
|
* ```
|
|
@@ -5899,7 +6109,11 @@ declare function useAsync_2<T>(options: UseAsyncItemsOptions<T>): UseAsyncItemsR
|
|
|
5899
6109
|
* >
|
|
5900
6110
|
* ...
|
|
5901
6111
|
* <Autocomplete.Empty>
|
|
5902
|
-
* {movies.loading
|
|
6112
|
+
* {movies.loading
|
|
6113
|
+
* ? "Loading..."
|
|
6114
|
+
* : movies.error
|
|
6115
|
+
* ? <button onClick={movies.retry}>Couldn't load results. Retry</button>
|
|
6116
|
+
* : "No results."}
|
|
5903
6117
|
* </Autocomplete.Empty>
|
|
5904
6118
|
* </Autocomplete.Root>
|
|
5905
6119
|
* ```
|
|
@@ -5929,6 +6143,16 @@ declare interface UseAsyncItemsOptions<T> {
|
|
|
5929
6143
|
* ```
|
|
5930
6144
|
*/
|
|
5931
6145
|
fetcher: AsyncFetcher<T>;
|
|
6146
|
+
/**
|
|
6147
|
+
* Called when a fetch fails (the fetcher throws or rejects with something
|
|
6148
|
+
* other than an abort of a superseded request).
|
|
6149
|
+
*
|
|
6150
|
+
* Fires **once per outage** — i.e. on the transition into the error state,
|
|
6151
|
+
* not on every failed keystroke — and re-arms after the next successful
|
|
6152
|
+
* fetch. Use it for side effects like logging or error tracking; the inline
|
|
6153
|
+
* error state is rendered regardless.
|
|
6154
|
+
*/
|
|
6155
|
+
onFetchError?: (error: unknown) => void;
|
|
5932
6156
|
}
|
|
5933
6157
|
|
|
5934
6158
|
declare interface UseAsyncItemsReturn<T> {
|
|
@@ -5940,6 +6164,8 @@ declare interface UseAsyncItemsReturn<T> {
|
|
|
5940
6164
|
query: string;
|
|
5941
6165
|
/** The error thrown by the last fetch, if any */
|
|
5942
6166
|
error: unknown;
|
|
6167
|
+
/** Re-runs the most recent fetch immediately (no debounce). Use for a Retry affordance. */
|
|
6168
|
+
retry: () => void;
|
|
5943
6169
|
/** Input change handler — pass to the Root `onInputValueChange` prop */
|
|
5944
6170
|
onInputValueChange: (value: string) => void;
|
|
5945
6171
|
/** Open change handler — pass to the Root `onOpenChange` prop to fetch initial items on open */
|
|
@@ -6361,6 +6587,12 @@ export declare type UseDataTableOptions<TRow extends Record<string, unknown>, TF
|
|
|
6361
6587
|
* using `DataTable.Pagination` or `DataTable.Filters`.
|
|
6362
6588
|
*/
|
|
6363
6589
|
control?: CollectionControl<TFieldName, TFilter>;
|
|
6590
|
+
/**
|
|
6591
|
+
* Stable id used to persist per-user column layout (visibility, order, and
|
|
6592
|
+
* pinning) to `localStorage`, keyed by this id. When omitted, column layout is
|
|
6593
|
+
* in-memory only and resets on reload.
|
|
6594
|
+
*/
|
|
6595
|
+
tableId?: string;
|
|
6364
6596
|
/** Called when the user clicks a row. Adds a pointer cursor to rows. */
|
|
6365
6597
|
onClickRow?: (row: TRow) => void;
|
|
6366
6598
|
/**
|
|
@@ -6424,6 +6656,20 @@ export declare interface UseDataTableReturn<TRow extends Record<string, unknown>
|
|
|
6424
6656
|
showAllColumns: () => void;
|
|
6425
6657
|
hideAllColumns: () => void;
|
|
6426
6658
|
isColumnVisible: (fieldOrId: string) => boolean;
|
|
6659
|
+
/** Column keys in display order (visible and hidden). */
|
|
6660
|
+
columnOrder: string[];
|
|
6661
|
+
/** Move the column with `key` to `toIndex` within the ordered column list. */
|
|
6662
|
+
moveColumn: (key: string, toIndex: number) => void;
|
|
6663
|
+
/** Replace the full column order with `keys`. */
|
|
6664
|
+
setColumnOrder: (keys: string[]) => void;
|
|
6665
|
+
/** Per-user pin overrides, keyed by column key (`"none"` = explicitly unpinned). */
|
|
6666
|
+
pinnedColumns: Record<string, "left" | "right" | "none">;
|
|
6667
|
+
/**
|
|
6668
|
+
* Set the pin for the column with `key`: `"left"`/`"right"` to pin, `"none"` to
|
|
6669
|
+
* explicitly unpin (overriding a default `pin`), or `null` to clear the override
|
|
6670
|
+
* and fall back to the column's default.
|
|
6671
|
+
*/
|
|
6672
|
+
setPin: (key: string, side: "left" | "right" | "none" | null) => void;
|
|
6427
6673
|
/**
|
|
6428
6674
|
* The resolved page size derived from the collection control.
|
|
6429
6675
|
* `0` when no control (or `pageSize`) is configured.
|
|
@@ -6584,6 +6830,12 @@ export { useSearchParams }
|
|
|
6584
6830
|
declare interface UseSelectAsyncOptions<T> {
|
|
6585
6831
|
/** Fetcher for async item loading. Called each time the dropdown is opened. */
|
|
6586
6832
|
fetcher: SelectAsyncFetcher<T>;
|
|
6833
|
+
/**
|
|
6834
|
+
* Called when a fetch fails. Fires once per outage (not on every re-open
|
|
6835
|
+
* while broken) and re-arms after the next success. Use for logging or error
|
|
6836
|
+
* tracking; the inline error state is shown regardless.
|
|
6837
|
+
*/
|
|
6838
|
+
onFetchError?: (error: unknown) => void;
|
|
6587
6839
|
}
|
|
6588
6840
|
|
|
6589
6841
|
declare interface UseSelectAsyncReturn<T> {
|
|
@@ -6593,6 +6845,8 @@ declare interface UseSelectAsyncReturn<T> {
|
|
|
6593
6845
|
loading: boolean;
|
|
6594
6846
|
/** The error thrown by the last fetch, if any */
|
|
6595
6847
|
error: unknown;
|
|
6848
|
+
/** Re-runs the fetch immediately. Use for a Retry affordance. */
|
|
6849
|
+
retry: () => void;
|
|
6596
6850
|
/** Open change handler — pass to the Root `onOpenChange` prop */
|
|
6597
6851
|
onOpenChange: (open: boolean) => void;
|
|
6598
6852
|
}
|