@discuss-ds/ui 0.32.0 → 0.34.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/CHANGELOG.md +36 -0
- package/dist/index.cjs +1163 -209
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +246 -10
- package/dist/index.d.ts +246 -10
- package/dist/index.js +1206 -207
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
- package/src/styles/globals.css +1 -0
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ import { DayPickerProps } from 'react-day-picker';
|
|
|
6
6
|
import * as react_hook_form from 'react-hook-form';
|
|
7
7
|
import { FieldValues, FieldPath, ControllerProps } from 'react-hook-form';
|
|
8
8
|
import { IconProps } from '@phosphor-icons/react';
|
|
9
|
+
import * as _tanstack_react_table from '@tanstack/react-table';
|
|
10
|
+
import { RowData, ColumnDef, SortingState, RowSelectionState, ColumnVisibilityState, ColumnPinningState, ColumnOrderState, ColumnFiltersState, GroupingState, ExpandedState, RowPinningState, PaginationState, Row, CellSelectionState } from '@tanstack/react-table';
|
|
9
11
|
|
|
10
12
|
declare const buttonVariants: (props?: ({
|
|
11
13
|
variant?: "link" | "default" | "subtle" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
|
|
@@ -327,6 +329,10 @@ interface InlineEditMark {
|
|
|
327
329
|
end: number;
|
|
328
330
|
/** Corrections offered in the mark's card, best first (at most three are shown). Used with `onMarkApply`: with one the card has an Apply button; with several each is a choice applied by a click on it and there is no Apply button. An empty string offers to remove the marked text (the button reads "Remove"). */
|
|
329
331
|
suggestions?: string[];
|
|
332
|
+
/** The colour of the underline: `destructive` (default, for mistakes such as typos) or `warning` (for a recommendation, such as wording that could be clearer). */
|
|
333
|
+
tone?: 'destructive' | 'warning';
|
|
334
|
+
/** Why the words are marked, shown in the mark's card above the suggestions. Without it the card is unchanged. */
|
|
335
|
+
message?: string;
|
|
330
336
|
}
|
|
331
337
|
|
|
332
338
|
interface InlineEditProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
@@ -356,8 +362,8 @@ interface InlineEditProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'on
|
|
|
356
362
|
validate?: (value: string) => string | null | undefined;
|
|
357
363
|
/**
|
|
358
364
|
* While editing, shows the allowed length under the field (from `minLength` and `maxLength`) with a live character
|
|
359
|
-
* counter
|
|
360
|
-
* different message appears.
|
|
365
|
+
* counter, but only while the text is too short or too long (the count is an error hint, not a running total). After a
|
|
366
|
+
* refused save the same line turns into the error state (error colour and icon) instead of a different message appears.
|
|
361
367
|
*/
|
|
362
368
|
showLimits?: boolean;
|
|
363
369
|
/**
|
|
@@ -383,8 +389,9 @@ interface InlineEditProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'on
|
|
|
383
389
|
textClassName?: string;
|
|
384
390
|
/**
|
|
385
391
|
* Ranges of the saved text to underline in the destructive colour, for example misspelled words found by a spell checker. `start` is the
|
|
386
|
-
* first character and `end` the one after the last.
|
|
387
|
-
* out of bounds, empty or
|
|
392
|
+
* first character and `end` the one after the last. While the field is being edited the underlines stay (as plain lines: they take no click),
|
|
393
|
+
* moving with the text typed after them and going away when the words they mark are changed. Ranges that are out of bounds, empty or
|
|
394
|
+
* overlapping are ignored.
|
|
388
395
|
*/
|
|
389
396
|
marks?: InlineEditMark[];
|
|
390
397
|
/**
|
|
@@ -559,10 +566,10 @@ declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<Dropdo
|
|
|
559
566
|
|
|
560
567
|
type ToastVariant = 'info' | 'success' | 'warning' | 'destructive';
|
|
561
568
|
declare const toastVariants: (props?: ({
|
|
562
|
-
variant?: "destructive" | "success" | "
|
|
569
|
+
variant?: "destructive" | "success" | "warning" | "info" | null | undefined;
|
|
563
570
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
564
571
|
declare const inlineVariants: (props?: ({
|
|
565
|
-
variant?: "destructive" | "success" | "
|
|
572
|
+
variant?: "destructive" | "success" | "warning" | "info" | "neutral" | null | undefined;
|
|
566
573
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
567
574
|
type ToastInlineVariant = ToastVariant | 'neutral';
|
|
568
575
|
declare const ToastProvider: React.FC<Toast$1.ToastProviderProps>;
|
|
@@ -791,7 +798,7 @@ interface QuestionHeaderProps extends Omit<React.HTMLAttributes<HTMLDivElement>,
|
|
|
791
798
|
maxLength?: number;
|
|
792
799
|
/** Editor mode: the question is being edited — the number tag turns accent. */
|
|
793
800
|
active?: boolean;
|
|
794
|
-
/** Editor mode:
|
|
801
|
+
/** Editor mode: allow the "n/2000 characters" counter, which shows only when the title is over the maximum. Defaults to `true`. */
|
|
795
802
|
showCounter?: boolean;
|
|
796
803
|
/**
|
|
797
804
|
* Editor mode: turns the "Question N" tag into a drag handle. Spread onto the tag, so it takes anything a drag-and-drop
|
|
@@ -880,7 +887,7 @@ interface QuestionOptionEditorProps {
|
|
|
880
887
|
* Shortest label (in characters, ignoring surrounding spaces) that may be saved. With `minLength` or `maxLength` the label is
|
|
881
888
|
* guarded like an `InlineEdit`: typing only changes a draft, Enter or leaving the field saves it through `onLabelChange`, a label
|
|
882
889
|
* that is too short is not saved (the field stays open and says why), Escape reverts, and while it is being edited a line under
|
|
883
|
-
* the row shows the allowed range and the live count. An unchanged label is never refused. Without either, `onLabelChange` is
|
|
890
|
+
* the row shows the allowed range and the live count, but only while the label is too short or too long. An unchanged label is never refused. Without either, `onLabelChange` is
|
|
884
891
|
* called on every keystroke as before.
|
|
885
892
|
*/
|
|
886
893
|
minLength?: number;
|
|
@@ -979,7 +986,7 @@ interface StimulusCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, '
|
|
|
979
986
|
captionPlaceholder?: string;
|
|
980
987
|
/** Editor mode: caption length limit. Also what the counter counts against. */
|
|
981
988
|
maxLength?: number;
|
|
982
|
-
/** Editor mode:
|
|
989
|
+
/** Editor mode: allow the "n/2000 characters" counter under the caption, which shows only when the caption is over `maxLength`. Defaults to `true`; needs `maxLength`. */
|
|
983
990
|
showCounter?: boolean;
|
|
984
991
|
/** Shows the trash button. */
|
|
985
992
|
onRemove?: () => void;
|
|
@@ -1005,9 +1012,12 @@ interface TableProps extends React.TableHTMLAttributes<HTMLTableElement> {
|
|
|
1005
1012
|
striped?: boolean;
|
|
1006
1013
|
/** Class names for the bordered, rounded scroll container around the `<table>`. */
|
|
1007
1014
|
containerClassName?: string;
|
|
1015
|
+
/** Ref to the scroll container around the `<table>`, e.g. for virtualization or infinite scrolling. */
|
|
1016
|
+
containerRef?: React.Ref<HTMLDivElement>;
|
|
1008
1017
|
}
|
|
1009
1018
|
declare const Table: React.ForwardRefExoticComponent<TableProps & React.RefAttributes<HTMLTableElement>>;
|
|
1010
1019
|
declare const TableHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
1020
|
+
declare const TableFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
1011
1021
|
declare const TableBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
1012
1022
|
interface TableRowProps extends React.HTMLAttributes<HTMLTableRowElement> {
|
|
1013
1023
|
/** Highlights the row and marks it with the accent edge (Figma: State = Selected). */
|
|
@@ -1023,6 +1033,8 @@ interface TableHeadProps extends Omit<React.ThHTMLAttributes<HTMLTableCellElemen
|
|
|
1023
1033
|
onSort?: () => void;
|
|
1024
1034
|
/** Narrow centred column for a select-all checkbox. */
|
|
1025
1035
|
checkbox?: boolean;
|
|
1036
|
+
/** Drag handle rendered at the trailing edge of the header, e.g. for column resizing. Makes the cell `relative`. */
|
|
1037
|
+
resizer?: React.ReactNode;
|
|
1026
1038
|
}
|
|
1027
1039
|
declare const TableHead: React.ForwardRefExoticComponent<TableHeadProps & React.RefAttributes<HTMLTableCellElement>>;
|
|
1028
1040
|
interface TableCellProps extends Omit<React.TdHTMLAttributes<HTMLTableCellElement>, 'align'> {
|
|
@@ -1044,6 +1056,230 @@ interface TableCellTwoLinesProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
1044
1056
|
/** Primary + support text stack for a `TableCell` (Figma: Type = Two Lines / Option). Set the row/cell height to `h-14`. */
|
|
1045
1057
|
declare function TableCellTwoLines({ primary, secondary, avatar, className, ...props }: TableCellTwoLinesProps): React.JSX.Element;
|
|
1046
1058
|
|
|
1059
|
+
declare const features: {
|
|
1060
|
+
rowSortingFeature: _tanstack_react_table.TableFeature;
|
|
1061
|
+
rowPaginationFeature: _tanstack_react_table.TableFeature;
|
|
1062
|
+
rowSelectionFeature: _tanstack_react_table.TableFeature;
|
|
1063
|
+
rowExpandingFeature: _tanstack_react_table.TableFeature;
|
|
1064
|
+
rowPinningFeature: _tanstack_react_table.TableFeature;
|
|
1065
|
+
rowAggregationFeature: _tanstack_react_table.TableFeature;
|
|
1066
|
+
columnVisibilityFeature: _tanstack_react_table.TableFeature;
|
|
1067
|
+
columnOrderingFeature: _tanstack_react_table.TableFeature;
|
|
1068
|
+
columnPinningFeature: _tanstack_react_table.TableFeature;
|
|
1069
|
+
columnSizingFeature: _tanstack_react_table.TableFeature;
|
|
1070
|
+
columnResizingFeature: _tanstack_react_table.TableFeature;
|
|
1071
|
+
columnFilteringFeature: _tanstack_react_table.TableFeature;
|
|
1072
|
+
globalFilteringFeature: _tanstack_react_table.TableFeature;
|
|
1073
|
+
columnFacetingFeature: _tanstack_react_table.TableFeature;
|
|
1074
|
+
columnGroupingFeature: _tanstack_react_table.TableFeature;
|
|
1075
|
+
cellSelectionFeature: _tanstack_react_table.TableFeature;
|
|
1076
|
+
cellSpanningFeature: _tanstack_react_table.TableFeature;
|
|
1077
|
+
facetedRowModel: (table: _tanstack_react_table.Table<any, any>, columnId: string) => () => _tanstack_react_table.RowModel<any, any>;
|
|
1078
|
+
facetedUniqueValues: (table: _tanstack_react_table.Table<_tanstack_react_table.TableFeatures, any>, columnId: string) => () => Map<any, number>;
|
|
1079
|
+
facetedMinMaxValues: (table: _tanstack_react_table.Table<_tanstack_react_table.TableFeatures, any>, columnId: string) => () => undefined | [number, number];
|
|
1080
|
+
filteredRowModel: (table: _tanstack_react_table.Table<any, any>) => () => _tanstack_react_table.RowModel<any, any>;
|
|
1081
|
+
groupedRowModel: (table: _tanstack_react_table.Table<any, any>) => () => _tanstack_react_table.RowModel<any, any>;
|
|
1082
|
+
sortedRowModel: (table: _tanstack_react_table.Table<any, any>) => () => _tanstack_react_table.RowModel<any, any>;
|
|
1083
|
+
expandedRowModel: (table: _tanstack_react_table.Table<any, any>) => () => _tanstack_react_table.RowModel<any, any>;
|
|
1084
|
+
paginatedRowModel: (table: _tanstack_react_table.Table<any, any>) => () => _tanstack_react_table.RowModel<any, any>;
|
|
1085
|
+
sortFns: {
|
|
1086
|
+
alphanumeric: _tanstack_react_table.CreatedSortFn<any, any>;
|
|
1087
|
+
basic: _tanstack_react_table.CreatedSortFn<any, any>;
|
|
1088
|
+
datetime: _tanstack_react_table.CreatedSortFn<any, any>;
|
|
1089
|
+
text: _tanstack_react_table.CreatedSortFn<any, any>;
|
|
1090
|
+
};
|
|
1091
|
+
filterFns: {
|
|
1092
|
+
arrIncludesSome: _tanstack_react_table.CreatedFilterFn<any, any>;
|
|
1093
|
+
equals: _tanstack_react_table.CreatedFilterFn<any, any>;
|
|
1094
|
+
equalsString: _tanstack_react_table.CreatedFilterFn<any, any>;
|
|
1095
|
+
includesString: _tanstack_react_table.CreatedFilterFn<any, any>;
|
|
1096
|
+
inNumberRange: _tanstack_react_table.CreatedFilterFn<any, any>;
|
|
1097
|
+
};
|
|
1098
|
+
aggregationFns: {
|
|
1099
|
+
count: _tanstack_react_table.AggregationFnDef<any, any, unknown, number>;
|
|
1100
|
+
extent: _tanstack_react_table.AggregationFnDef<any, any, unknown, [(number | Date) | undefined, (number | Date) | undefined]>;
|
|
1101
|
+
max: _tanstack_react_table.AggregationFnDef<any, any, unknown, (number | Date) | undefined>;
|
|
1102
|
+
mean: _tanstack_react_table.AggregationFnDef<any, any, unknown, number | undefined>;
|
|
1103
|
+
median: _tanstack_react_table.AggregationFnDef<any, any, unknown, number | undefined>;
|
|
1104
|
+
min: _tanstack_react_table.AggregationFnDef<any, any, unknown, (number | Date) | undefined>;
|
|
1105
|
+
sum: _tanstack_react_table.AggregationFnDef<any, any, unknown, number>;
|
|
1106
|
+
unique: _tanstack_react_table.AggregationFnDef<any, any, unknown, unknown[]>;
|
|
1107
|
+
uniqueCount: _tanstack_react_table.AggregationFnDef<any, any, unknown, number>;
|
|
1108
|
+
};
|
|
1109
|
+
};
|
|
1110
|
+
/**
|
|
1111
|
+
* A column definition for `DataTable`. Built with TanStack Table's `ColumnDef`, e.g. `{ accessorKey: 'name', header: 'Name' }`.
|
|
1112
|
+
* Besides the usual options it understands `aggregationFn` / `aggregatedCell` (grouping), `spanRows` / `spanColumns`
|
|
1113
|
+
* (cell spanning), `size` / `minSize` / `maxSize` (sizing and resizing), `footer`, and the `meta` below.
|
|
1114
|
+
*/
|
|
1115
|
+
type DataTableColumnDef<TData extends RowData> = ColumnDef<typeof features, TData>;
|
|
1116
|
+
/** Optional `meta` on a column that `DataTable` understands. */
|
|
1117
|
+
interface DataTableColumnMeta {
|
|
1118
|
+
/** Right-align the header and cells, for numbers and amounts. */
|
|
1119
|
+
align?: 'left' | 'right';
|
|
1120
|
+
/** Secondary text colour for the column's cells. */
|
|
1121
|
+
muted?: boolean;
|
|
1122
|
+
/** Label shown in menus and used for accessible names. Defaults to the column id. */
|
|
1123
|
+
label?: string;
|
|
1124
|
+
/** Control shown in the filter row (`enableColumnFilters`). `select` offers the values found in the data, with counts. */
|
|
1125
|
+
filterVariant?: 'text' | 'select' | 'range';
|
|
1126
|
+
/** Render the cell as an input; pair with the table's `onCellEdit`. */
|
|
1127
|
+
editable?: boolean;
|
|
1128
|
+
/** Input type of an editable cell. */
|
|
1129
|
+
editType?: 'text' | 'number';
|
|
1130
|
+
}
|
|
1131
|
+
/** Everything `DataTable` can start with when its state is not controlled. */
|
|
1132
|
+
interface DataTableInitialState {
|
|
1133
|
+
sorting?: SortingState;
|
|
1134
|
+
rowSelection?: RowSelectionState;
|
|
1135
|
+
columnVisibility?: ColumnVisibilityState;
|
|
1136
|
+
columnPinning?: Partial<ColumnPinningState>;
|
|
1137
|
+
columnOrder?: ColumnOrderState;
|
|
1138
|
+
columnFilters?: ColumnFiltersState;
|
|
1139
|
+
globalFilter?: string;
|
|
1140
|
+
grouping?: GroupingState;
|
|
1141
|
+
expanded?: ExpandedState;
|
|
1142
|
+
rowPinning?: Partial<RowPinningState>;
|
|
1143
|
+
pagination?: PaginationState;
|
|
1144
|
+
}
|
|
1145
|
+
interface DataTableProps<TData extends RowData> extends Omit<TableProps, 'children' | 'onSelect' | 'onChange'> {
|
|
1146
|
+
/** Column definitions (TanStack `ColumnDef`). Keep the array referentially stable (module scope or `useMemo`). */
|
|
1147
|
+
columns: DataTableColumnDef<TData>[];
|
|
1148
|
+
/** Row data. Keep referentially stable between renders. */
|
|
1149
|
+
data: TData[];
|
|
1150
|
+
/** Stable row id, used for selection, pinning and expansion. Defaults to the row index. */
|
|
1151
|
+
getRowId?: (row: TData, index: number) => string;
|
|
1152
|
+
/** Starting values for state the table owns. Ignored for state you control. */
|
|
1153
|
+
initialState?: DataTableInitialState;
|
|
1154
|
+
/** Let columns be sorted by clicking their header. Opt a single column out with `enableSorting: false`. */
|
|
1155
|
+
enableSorting?: boolean;
|
|
1156
|
+
/** Add a leading checkbox column with a select-all header checkbox. */
|
|
1157
|
+
enableRowSelection?: boolean;
|
|
1158
|
+
/** Show a "Columns" menu that toggles column visibility. */
|
|
1159
|
+
enableColumnVisibility?: boolean;
|
|
1160
|
+
/** Stick columns to the start or end edge. Pin with `initialState.columnPinning` or `column.pin('start' | 'end')`. */
|
|
1161
|
+
enableColumnPinning?: boolean;
|
|
1162
|
+
/** Apply each column's `size` (and `minSize` / `maxSize`) as its width. Implied by column pinning and resizing. */
|
|
1163
|
+
enableColumnSizing?: boolean;
|
|
1164
|
+
/** Drag the header edge to resize columns. Size columns with `size`, `minSize` and `maxSize` in the column definition. */
|
|
1165
|
+
enableColumnResizing?: boolean;
|
|
1166
|
+
/** `onChange` resizes live while dragging; `onEnd` applies the new width on release. */
|
|
1167
|
+
columnResizeMode?: 'onChange' | 'onEnd';
|
|
1168
|
+
/** Reorder columns by dragging their headers, or with Alt + arrow keys on a focused header. */
|
|
1169
|
+
enableColumnOrdering?: boolean;
|
|
1170
|
+
/** Show a filter row under the header. Pick each column's control with `meta.filterVariant`. */
|
|
1171
|
+
enableColumnFilters?: boolean;
|
|
1172
|
+
/** Show a search field above the table that filters across all columns. */
|
|
1173
|
+
enableGlobalFilter?: boolean;
|
|
1174
|
+
/** Placeholder of the global search field. */
|
|
1175
|
+
globalFilterPlaceholder?: string;
|
|
1176
|
+
/** Group rows by one or more columns, with a "Group by" menu. Aggregate with each column's `aggregationFn`. */
|
|
1177
|
+
enableGrouping?: boolean;
|
|
1178
|
+
/** Add a disclosure column to expand sub-rows (`getSubRows`) or a detail panel (`renderSubComponent`). */
|
|
1179
|
+
enableExpanding?: boolean;
|
|
1180
|
+
/** Add a column with a button that pins the row to the top of the table. */
|
|
1181
|
+
enableRowPinning?: boolean;
|
|
1182
|
+
/** Spreadsheet-style selection of cell ranges: drag, Shift-click, Ctrl/Cmd-click, arrow keys, Ctrl/Cmd + A. */
|
|
1183
|
+
enableCellSelection?: boolean;
|
|
1184
|
+
/** Render a footer row from each column's `footer`. */
|
|
1185
|
+
showFooter?: boolean;
|
|
1186
|
+
/** Show the row-density toggle in the toolbar. */
|
|
1187
|
+
enableDensityToggle?: boolean;
|
|
1188
|
+
/** Row density. `compact` uses shorter rows. */
|
|
1189
|
+
density?: 'default' | 'compact';
|
|
1190
|
+
onDensityChange?: (density: 'default' | 'compact') => void;
|
|
1191
|
+
/** Sub-rows of a row, for tree data. */
|
|
1192
|
+
getSubRows?: (row: TData, index: number) => TData[] | undefined;
|
|
1193
|
+
/** Whether a row can expand. Defaults to "has sub-rows", or "always" when `renderSubComponent` is set. */
|
|
1194
|
+
getRowCanExpand?: (row: Row<typeof features, TData>) => boolean;
|
|
1195
|
+
/** Detail panel shown under an expanded row. */
|
|
1196
|
+
renderSubComponent?: (row: TData) => React.ReactNode;
|
|
1197
|
+
/** Rows per page. The pagination bar is hidden when everything fits on one page. */
|
|
1198
|
+
pageSize?: number;
|
|
1199
|
+
/**
|
|
1200
|
+
* Sorting, filtering and pagination happen on your server: pass one page of already processed `data` plus the total `rowCount`,
|
|
1201
|
+
* and read the state through the controlled props below to build the request.
|
|
1202
|
+
*/
|
|
1203
|
+
serverSide?: boolean;
|
|
1204
|
+
/** Total number of rows on the server. Required with `serverSide` for the page count. */
|
|
1205
|
+
rowCount?: number;
|
|
1206
|
+
/** Controlled sorting state. Pair with `onSortingChange`. */
|
|
1207
|
+
sorting?: SortingState;
|
|
1208
|
+
onSortingChange?: (sorting: SortingState) => void;
|
|
1209
|
+
/** Controlled selection state, keyed by row id. Pair with `onRowSelectionChange`. */
|
|
1210
|
+
rowSelection?: RowSelectionState;
|
|
1211
|
+
onRowSelectionChange?: (rowSelection: RowSelectionState) => void;
|
|
1212
|
+
/** Controlled pagination state. Pair with `onPaginationChange`. */
|
|
1213
|
+
pagination?: PaginationState;
|
|
1214
|
+
onPaginationChange?: (pagination: PaginationState) => void;
|
|
1215
|
+
/** Controlled column visibility, keyed by column id. Pair with `onColumnVisibilityChange`. */
|
|
1216
|
+
columnVisibility?: ColumnVisibilityState;
|
|
1217
|
+
onColumnVisibilityChange?: (columnVisibility: ColumnVisibilityState) => void;
|
|
1218
|
+
/** Controlled column pinning. Pair with `onColumnPinningChange`. */
|
|
1219
|
+
columnPinning?: ColumnPinningState;
|
|
1220
|
+
onColumnPinningChange?: (columnPinning: ColumnPinningState) => void;
|
|
1221
|
+
/** Controlled column order (column ids). Pair with `onColumnOrderChange`. */
|
|
1222
|
+
columnOrder?: ColumnOrderState;
|
|
1223
|
+
onColumnOrderChange?: (columnOrder: ColumnOrderState) => void;
|
|
1224
|
+
/** Controlled column filters. Pair with `onColumnFiltersChange`. */
|
|
1225
|
+
columnFilters?: ColumnFiltersState;
|
|
1226
|
+
onColumnFiltersChange?: (columnFilters: ColumnFiltersState) => void;
|
|
1227
|
+
/** Controlled global search text. Pair with `onGlobalFilterChange`. */
|
|
1228
|
+
globalFilter?: string;
|
|
1229
|
+
onGlobalFilterChange?: (globalFilter: string) => void;
|
|
1230
|
+
/** Controlled grouping (column ids). Pair with `onGroupingChange`. */
|
|
1231
|
+
grouping?: GroupingState;
|
|
1232
|
+
onGroupingChange?: (grouping: GroupingState) => void;
|
|
1233
|
+
/** Controlled expansion. Pair with `onExpandedChange`. */
|
|
1234
|
+
expanded?: ExpandedState;
|
|
1235
|
+
onExpandedChange?: (expanded: ExpandedState) => void;
|
|
1236
|
+
/** Controlled row pinning. Pair with `onRowPinningChange`. */
|
|
1237
|
+
rowPinning?: RowPinningState;
|
|
1238
|
+
onRowPinningChange?: (rowPinning: RowPinningState) => void;
|
|
1239
|
+
/** Called whenever the selected cell ranges change. */
|
|
1240
|
+
onCellSelectionChange?: (cellSelection: CellSelectionState) => void;
|
|
1241
|
+
/** Called when an editable cell (`meta.editable`) is committed with Enter or blur. Update your data in response. */
|
|
1242
|
+
onCellEdit?: (edit: {
|
|
1243
|
+
row: TData;
|
|
1244
|
+
rowId: string;
|
|
1245
|
+
columnId: string;
|
|
1246
|
+
value: string;
|
|
1247
|
+
}) => void;
|
|
1248
|
+
/** Render only the visible rows. Give the table a bounded height with `containerClassName`, e.g. `max-h-96`. */
|
|
1249
|
+
virtualized?: boolean;
|
|
1250
|
+
/** Row height in pixels used before a row has been measured. Match `h-10` (40) unless rows are taller. */
|
|
1251
|
+
estimateRowHeight?: number;
|
|
1252
|
+
/** Infinite scrolling: called when the end of the table scrolls into view and `hasMore` is true. Disables pagination. Bound the height with `containerClassName` to scroll inside the table. */
|
|
1253
|
+
onLoadMore?: () => void;
|
|
1254
|
+
/** Whether more rows can be loaded. */
|
|
1255
|
+
hasMore?: boolean;
|
|
1256
|
+
/** A page of rows is loading; shows placeholder rows at the end. */
|
|
1257
|
+
loadingMore?: boolean;
|
|
1258
|
+
/** Keep the header in view while the table scrolls. On by default with row pinning and virtualization. */
|
|
1259
|
+
stickyHeader?: boolean;
|
|
1260
|
+
/** Show placeholder rows instead of data. */
|
|
1261
|
+
loading?: boolean;
|
|
1262
|
+
/** Content of the empty state. Defaults to "No results." */
|
|
1263
|
+
emptyState?: React.ReactNode;
|
|
1264
|
+
/** Called when a row is clicked (not when its controls are). */
|
|
1265
|
+
onRowClick?: (row: TData) => void;
|
|
1266
|
+
/** Content for the left side of the toolbar, e.g. filter tabs. */
|
|
1267
|
+
toolbar?: React.ReactNode;
|
|
1268
|
+
/** Class names for the wrapper around the toolbar, table and pagination. */
|
|
1269
|
+
wrapperClassName?: string;
|
|
1270
|
+
}
|
|
1271
|
+
declare function DataTableInner<TData extends RowData>({ columns, data, getRowId, initialState, enableSorting, enableRowSelection, enableColumnVisibility, enableColumnPinning, enableColumnSizing, enableColumnResizing, columnResizeMode, enableColumnOrdering, enableColumnFilters, enableGlobalFilter, globalFilterPlaceholder, enableGrouping, enableExpanding, enableRowPinning, enableCellSelection, showFooter, enableDensityToggle, density: densityProp, onDensityChange, getSubRows, getRowCanExpand, renderSubComponent, pageSize, serverSide, rowCount, sorting: sortingProp, onSortingChange, rowSelection: rowSelectionProp, onRowSelectionChange, pagination: paginationProp, onPaginationChange, columnVisibility: columnVisibilityProp, onColumnVisibilityChange, columnPinning: columnPinningProp, onColumnPinningChange, columnOrder: columnOrderProp, onColumnOrderChange, columnFilters: columnFiltersProp, onColumnFiltersChange, globalFilter: globalFilterProp, onGlobalFilterChange, grouping: groupingProp, onGroupingChange, expanded: expandedProp, onExpandedChange, rowPinning: rowPinningProp, onRowPinningChange, onCellSelectionChange, onCellEdit, virtualized, estimateRowHeight, onLoadMore, hasMore, loadingMore, stickyHeader, loading, emptyState, onRowClick, toolbar, wrapperClassName, striped, containerClassName, containerRef, style: tableStyle, ...tableProps }: DataTableProps<TData>, ref: React.ForwardedRef<HTMLTableElement>): React.JSX.Element;
|
|
1272
|
+
/**
|
|
1273
|
+
* Data-driven table. Wraps `Table` with TanStack Table (`@tanstack/react-table`): sorting, row selection, pagination,
|
|
1274
|
+
* column visibility, pinning, sizing, resizing and ordering, column and global filtering with faceted options, grouping with
|
|
1275
|
+
* aggregation, row expansion and detail panels, row pinning, cell selection and spanning, grouped headers, footers,
|
|
1276
|
+
* inline editing, server-side data, virtualization and infinite scrolling. Every feature is off until its prop is set.
|
|
1277
|
+
* Pass `columns` and `data`; state is local unless you control it.
|
|
1278
|
+
*/
|
|
1279
|
+
declare const DataTable: <TData extends RowData>(props: DataTableProps<TData> & {
|
|
1280
|
+
ref?: React.ForwardedRef<HTMLTableElement>;
|
|
1281
|
+
}) => ReturnType<typeof DataTableInner>;
|
|
1282
|
+
|
|
1047
1283
|
declare const statCardVariants: (props?: ({
|
|
1048
1284
|
variant?: "default" | "subtle" | "destructive" | "success" | "warning" | null | undefined;
|
|
1049
1285
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
@@ -1144,4 +1380,4 @@ interface PaginationProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onCha
|
|
|
1144
1380
|
}
|
|
1145
1381
|
declare const Pagination: React.ForwardRefExoticComponent<PaginationProps & React.RefAttributes<HTMLElement>>;
|
|
1146
1382
|
|
|
1147
|
-
export { AIMiniAvatar, type AIMiniAvatarProps, AIResponseContainer, type AIResponseContainerProps, type AIStatus, type ActivitySection, type ActivityStat, ActivityStructure, type ActivityStructureProps, AskAiInput, type AskAiInputProps, AskAiToggle, type AskAiToggleProps, Badge, type BadgeProps, Button, type ButtonProps, Calendar, type CalendarProps, ChatChoices, type ChatChoicesProps, ChatInput, type ChatInputProps, ChatOption, type ChatOptionActionProps, type ChatOptionCheckboxProps, type ChatOptionProps, type ChatOptionRadioProps, Checkbox, CheckboxField, type CheckboxFieldProps, type CheckboxProps, DatePicker, type DatePickerProps, DateTimePicker, type DateTimePickerProps, Dialog, DialogBody, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, type DropdownMenuSelectableItemProps, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EditableTag, type EditableTagProps, Field, type FieldControlProps, type FieldProps, type FieldStatus, FileAttachment, type FileAttachmentProps, FileUploadItem, type FileUploadItemProps, FileUploadZone, type FileUploadZoneProps, Form, FormControl, type FormControlProps, FormDescription, type FormDescriptionProps, FormField, FormItem, type FormItemProps, FormLabel, type FormLabelProps, FormMessage, type FormMessageProps, ImagePreview, type ImagePreviewProps, ImageThumbnails, type ImageThumbnailsProps, InlineEdit, type InlineEditMark, type InlineEditProps, Input, type InputProps, InputWithAction, type InputWithActionProps, Label, type LabelProps, MediaInfo, type MediaInfoProps, NumberInput, type NumberInputProps, OpenEndAnswer, type OpenEndAnswerProps, Pagination, type PaginationItemValue, type PaginationProps, Progress, type ProgressProps, ProjectSelector, type ProjectSelectorProps, QuestionCard, type QuestionCheckboxOptionProps, QuestionEditorCard, type QuestionEditorCardProps, QuestionHeader, type QuestionHeaderProps, QuestionNavItem, type QuestionNavItemProps, QuestionOption, QuestionOptionEditor, type QuestionOptionEditorProps, type QuestionOptionProps, QuestionOtherOption, type QuestionOtherOptionProps, type QuestionRadioOptionProps, type QuestionType, QuestionTypeIcon, type QuestionTypeIconProps, RadioGroup, RadioGroupFieldItem, type RadioGroupFieldItemProps, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps, type RankItemData, RankList, type RankListProps, RatingScale, type RatingScaleProps, SearchBar, type SearchBarProps, Select, SelectContent, type SelectContentProps, SelectGroup, SelectItem, type SelectItemProps, SelectTrigger, type SelectTriggerProps, SelectValue, Slider, type SliderProps, StatCard, type StatCardProps, StatusTag, type StatusTagProps, StimulusCard, type StimulusCardProps, Switch, type SwitchProps, TabItem, type TabItemProps, TabNavigation, TabNavigationContext, type TabNavigationProps, type TabNavigationVariant, Table, TableBody, TableCell, type TableCellProps, TableCellTwoLines, type TableCellTwoLinesProps, TableHead, type TableHeadProps, TableHeader, type TableProps, TableRow, type TableRowProps, Tabs, TabsContent, Tag, type TagProps, Textarea, type TextareaProps, TimeItem, type TimeItemProps, TimePicker, type TimePickerProps, type TimeValue, Timestamp, type TimestampProps, Toast, ToastAction, ToastInline, type ToastInlineProps, type ToastInlineVariant, type ToastProps, ToastProvider, type ToastVariant, ToastViewport, Toggle, type ToggleProps, Tooltip, TooltipContent, type TooltipContentProps, TooltipProvider, TooltipTrigger, TopicActivityRow, type TopicActivityRowProps, TopicCard, TopicCardMetaItem, type TopicCardMetaItemProps, type TopicCardProps, TopicCardTag, UserMessageBubble, type UserMessageBubbleProps, VideoPlayer, type VideoPlayerProps, VolumeControl, type VolumeControlProps, fieldSurfaceClasses, formatDateTime, getPaginationItems, useFormField };
|
|
1383
|
+
export { AIMiniAvatar, type AIMiniAvatarProps, AIResponseContainer, type AIResponseContainerProps, type AIStatus, type ActivitySection, type ActivityStat, ActivityStructure, type ActivityStructureProps, AskAiInput, type AskAiInputProps, AskAiToggle, type AskAiToggleProps, Badge, type BadgeProps, Button, type ButtonProps, Calendar, type CalendarProps, ChatChoices, type ChatChoicesProps, ChatInput, type ChatInputProps, ChatOption, type ChatOptionActionProps, type ChatOptionCheckboxProps, type ChatOptionProps, type ChatOptionRadioProps, Checkbox, CheckboxField, type CheckboxFieldProps, type CheckboxProps, DataTable, type DataTableColumnDef, type DataTableColumnMeta, type DataTableInitialState, type DataTableProps, DatePicker, type DatePickerProps, DateTimePicker, type DateTimePickerProps, Dialog, DialogBody, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, type DropdownMenuSelectableItemProps, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EditableTag, type EditableTagProps, Field, type FieldControlProps, type FieldProps, type FieldStatus, FileAttachment, type FileAttachmentProps, FileUploadItem, type FileUploadItemProps, FileUploadZone, type FileUploadZoneProps, Form, FormControl, type FormControlProps, FormDescription, type FormDescriptionProps, FormField, FormItem, type FormItemProps, FormLabel, type FormLabelProps, FormMessage, type FormMessageProps, ImagePreview, type ImagePreviewProps, ImageThumbnails, type ImageThumbnailsProps, InlineEdit, type InlineEditMark, type InlineEditProps, Input, type InputProps, InputWithAction, type InputWithActionProps, Label, type LabelProps, MediaInfo, type MediaInfoProps, NumberInput, type NumberInputProps, OpenEndAnswer, type OpenEndAnswerProps, Pagination, type PaginationItemValue, type PaginationProps, Progress, type ProgressProps, ProjectSelector, type ProjectSelectorProps, QuestionCard, type QuestionCheckboxOptionProps, QuestionEditorCard, type QuestionEditorCardProps, QuestionHeader, type QuestionHeaderProps, QuestionNavItem, type QuestionNavItemProps, QuestionOption, QuestionOptionEditor, type QuestionOptionEditorProps, type QuestionOptionProps, QuestionOtherOption, type QuestionOtherOptionProps, type QuestionRadioOptionProps, type QuestionType, QuestionTypeIcon, type QuestionTypeIconProps, RadioGroup, RadioGroupFieldItem, type RadioGroupFieldItemProps, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps, type RankItemData, RankList, type RankListProps, RatingScale, type RatingScaleProps, SearchBar, type SearchBarProps, Select, SelectContent, type SelectContentProps, SelectGroup, SelectItem, type SelectItemProps, SelectTrigger, type SelectTriggerProps, SelectValue, Slider, type SliderProps, StatCard, type StatCardProps, StatusTag, type StatusTagProps, StimulusCard, type StimulusCardProps, Switch, type SwitchProps, TabItem, type TabItemProps, TabNavigation, TabNavigationContext, type TabNavigationProps, type TabNavigationVariant, Table, TableBody, TableCell, type TableCellProps, TableCellTwoLines, type TableCellTwoLinesProps, TableFooter, TableHead, type TableHeadProps, TableHeader, type TableProps, TableRow, type TableRowProps, Tabs, TabsContent, Tag, type TagProps, Textarea, type TextareaProps, TimeItem, type TimeItemProps, TimePicker, type TimePickerProps, type TimeValue, Timestamp, type TimestampProps, Toast, ToastAction, ToastInline, type ToastInlineProps, type ToastInlineVariant, type ToastProps, ToastProvider, type ToastVariant, ToastViewport, Toggle, type ToggleProps, Tooltip, TooltipContent, type TooltipContentProps, TooltipProvider, TooltipTrigger, TopicActivityRow, type TopicActivityRowProps, TopicCard, TopicCardMetaItem, type TopicCardMetaItemProps, type TopicCardProps, TopicCardTag, UserMessageBubble, type UserMessageBubbleProps, VideoPlayer, type VideoPlayerProps, VolumeControl, type VolumeControlProps, fieldSurfaceClasses, formatDateTime, getPaginationItems, useFormField };
|