@grampro/kit 2.4.4 → 2.5.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 (72) hide show
  1. package/CHANGELOG.md +169 -0
  2. package/index.cjs +39 -4
  3. package/package.json +1 -1
  4. package/source/components/accordion/passport.json +11 -7
  5. package/source/components/accordion/react/Accordion.tsx +5 -0
  6. package/source/components/alert/passport.json +3 -3
  7. package/source/components/avatar/passport.json +8 -6
  8. package/source/components/avatar/react/Avatar.tsx +4 -0
  9. package/source/components/badge/passport.json +8 -6
  10. package/source/components/badge/react/Badge.tsx +1 -0
  11. package/source/components/badge/react/Tag.tsx +1 -0
  12. package/source/components/breadcrumb/passport.json +8 -6
  13. package/source/components/breadcrumb/react/Breadcrumb.tsx +1 -0
  14. package/source/components/button/passport.json +8 -6
  15. package/source/components/button/react/Button.tsx +1 -0
  16. package/source/components/card/passport.json +17 -9
  17. package/source/components/card/react/Card.tsx +5 -0
  18. package/source/components/card/react/Stat.tsx +5 -0
  19. package/source/components/checkbox/passport.json +32 -14
  20. package/source/components/checkbox/react/Checkbox.tsx +17 -0
  21. package/source/components/checkbox/react/CheckboxGroup.tsx +6 -0
  22. package/source/components/combobox/passport.json +36 -16
  23. package/source/components/combobox/react/Select.tsx +6 -1
  24. package/source/components/combobox/react/props.ts +23 -0
  25. package/source/components/data-grid/core/types.ts +53 -0
  26. package/source/components/data-grid/passport.json +82 -30
  27. package/source/components/data-grid/react/AskGrid.tsx +10 -0
  28. package/source/components/data-grid/react/DataGrid.tsx +16 -0
  29. package/source/components/date-picker/passport.json +30 -14
  30. package/source/components/date-picker/react/DatePicker.tsx +5 -0
  31. package/source/components/date-picker/react/props.ts +13 -1
  32. package/source/components/dialog/core/types.ts +14 -0
  33. package/source/components/dialog/passport.json +26 -12
  34. package/source/components/dialog/react/Dialog.tsx +4 -0
  35. package/source/components/file-uploader/passport.json +44 -18
  36. package/source/components/file-uploader/react/FileUploader.tsx +39 -0
  37. package/source/components/input/passport.json +14 -8
  38. package/source/components/input/react/Input.tsx +3 -0
  39. package/source/components/menu/passport.json +29 -13
  40. package/source/components/menu/react/Menu.tsx +7 -0
  41. package/source/components/menu/react/items.tsx +4 -0
  42. package/source/components/modal/passport.json +14 -8
  43. package/source/components/modal/react/Modal.tsx +6 -0
  44. package/source/components/number-input/passport.json +23 -11
  45. package/source/components/number-input/react/NumberInput.tsx +13 -0
  46. package/source/components/popover/passport.json +17 -9
  47. package/source/components/popover/react/Popover.tsx +7 -0
  48. package/source/components/progress/passport.json +3 -3
  49. package/source/components/radio-group/passport.json +32 -14
  50. package/source/components/radio-group/react/Radio.tsx +17 -0
  51. package/source/components/radio-group/react/RadioGroup.tsx +13 -0
  52. package/source/components/skeleton/passport.json +8 -6
  53. package/source/components/skeleton/react/Skeleton.tsx +5 -0
  54. package/source/components/spinner/passport.json +3 -3
  55. package/source/components/switch/passport.json +23 -11
  56. package/source/components/switch/react/Switch.tsx +14 -0
  57. package/source/components/tabs/passport.json +11 -7
  58. package/source/components/tabs/react/Tabs.tsx +2 -0
  59. package/source/components/textarea/passport.json +14 -8
  60. package/source/components/textarea/react/Textarea.tsx +3 -0
  61. package/source/components/toaster/passport.json +8 -6
  62. package/source/components/toaster/react/Toaster.tsx +4 -0
  63. package/source/components/tooltip/passport.json +3 -3
  64. package/tools/mcp/README.md +126 -34
  65. package/tools/mcp/figma.cjs +84 -27
  66. package/tools/mcp/install.cjs +270 -0
  67. package/tools/mcp/secret-cli.cjs +174 -0
  68. package/tools/mcp/secret.cjs +289 -0
  69. package/tools/mcp/server.cjs +53 -14
  70. package/tools/passport/cli.cjs +8 -1
  71. package/tools/passport/extract.cjs +7 -3
  72. package/tools/passport/merge.cjs +24 -4
@@ -10,7 +10,7 @@
10
10
  ]
11
11
  },
12
12
  "source": {
13
- "libraryVersion": "2.4.4",
13
+ "libraryVersion": "2.5.0",
14
14
  "files": [
15
15
  "core/group.ts",
16
16
  "core/index.ts",
@@ -22,7 +22,7 @@
22
22
  "react/locale.ts",
23
23
  "react/props.ts"
24
24
  ],
25
- "sourceHash": "sha256:5b132e0d372a16b0536b1e8a6fb8809dbcbfb00e1282d406a0a474090f4a72f5"
25
+ "sourceHash": "sha256:ddf0907b2b6377c5d134ed140d8a4f47b0dc5ef39ec984c21ec33370c6d9815f"
26
26
  },
27
27
  "props": [
28
28
  {
@@ -96,21 +96,27 @@
96
96
  "typeText": "CheckedState | undefined",
97
97
  "required": false,
98
98
  "default": false,
99
- "origin": "derived"
99
+ "origin": "derived",
100
+ "description": "The starting state when you are not controlling `checked`.",
101
+ "descriptionOrigin": "jsdoc"
100
102
  },
101
103
  {
102
104
  "name": "defaultValue",
103
105
  "type": "other",
104
106
  "typeText": "string[] | undefined",
105
107
  "required": false,
106
- "origin": "derived"
108
+ "origin": "derived",
109
+ "description": "The values checked to begin with, when you are not controlling `value`.",
110
+ "descriptionOrigin": "jsdoc"
107
111
  },
108
112
  {
109
113
  "name": "description",
110
114
  "type": "other",
111
115
  "typeText": "ReactNode",
112
116
  "required": false,
113
- "origin": "derived"
117
+ "origin": "derived",
118
+ "description": "A hint under the label, linked as the box's description.",
119
+ "descriptionOrigin": "jsdoc"
114
120
  },
115
121
  {
116
122
  "name": "disabled",
@@ -125,7 +131,9 @@
125
131
  "type": "other",
126
132
  "typeText": "ReactNode",
127
133
  "required": false,
128
- "origin": "derived"
134
+ "origin": "derived",
135
+ "description": "The validation message. Setting it is enough on its own: the box reads as\r\ninvalid to assistive technology and the message is announced, so no extra\r\n`aria-invalid` is needed.",
136
+ "descriptionOrigin": "jsdoc"
129
137
  },
130
138
  {
131
139
  "name": "form",
@@ -170,7 +178,9 @@
170
178
  "type": "other",
171
179
  "typeText": "ReactNode",
172
180
  "required": false,
173
- "origin": "derived"
181
+ "origin": "derived",
182
+ "description": "The text beside the box. Clicking it toggles the box.",
183
+ "descriptionOrigin": "jsdoc"
174
184
  },
175
185
  {
176
186
  "name": "localeText",
@@ -221,21 +231,27 @@
221
231
  "type": "function",
222
232
  "signature": "ChangeEventHandler<HTMLInputElement> | undefined",
223
233
  "required": false,
224
- "origin": "derived"
234
+ "origin": "derived",
235
+ "description": "The underlying DOM event, for form libraries that want the native\r\nhandler. For reading the new state, `onCheckedChange` is simpler.",
236
+ "descriptionOrigin": "jsdoc"
225
237
  },
226
238
  {
227
239
  "name": "onCheckedChange",
228
240
  "type": "function",
229
241
  "signature": "((checked: boolean) => void) | undefined",
230
242
  "required": false,
231
- "origin": "derived"
243
+ "origin": "derived",
244
+ "description": "The state after a change, as a plain boolean — the handler to reach for.\r\nNever fires with `\"indeterminate\"`: clicking a mixed box resolves it.",
245
+ "descriptionOrigin": "jsdoc"
232
246
  },
233
247
  {
234
248
  "name": "onValueChange",
235
249
  "type": "function",
236
250
  "signature": "((values: string[]) => void) | undefined",
237
251
  "required": false,
238
- "origin": "derived"
252
+ "origin": "derived",
253
+ "description": "The checked values after a change. They accumulate in the order they were\nchecked, not the order the options are declared, so sort before comparing\ntwo selections for equality.",
254
+ "descriptionOrigin": "jsdoc"
239
255
  },
240
256
  {
241
257
  "name": "options",
@@ -324,7 +340,9 @@
324
340
  ],
325
341
  "typeText": "CheckboxSize | undefined",
326
342
  "required": false,
327
- "origin": "derived"
343
+ "origin": "derived",
344
+ "description": "Default `md`, or the size of the CheckboxGroup it sits in.",
345
+ "descriptionOrigin": "jsdoc"
328
346
  },
329
347
  {
330
348
  "name": "step",
@@ -446,9 +464,9 @@
446
464
  "safeMutations": {},
447
465
  "examples": [],
448
466
  "coverage": {
449
- "propsTotal": 43,
450
- "propsDescribed": 7,
451
- "describedPct": 16,
467
+ "propsTotal": 19,
468
+ "propsDescribed": 15,
469
+ "describedPct": 79,
452
470
  "authoredSections": [
453
471
  "accessibility"
454
472
  ]
@@ -25,14 +25,31 @@ export interface CheckboxProps
25
25
  > {
26
26
  /** `true`, `false` or `"indeterminate"` (controlled). */
27
27
  checked?: CheckedState;
28
+ /** The starting state when you are not controlling `checked`. */
28
29
  defaultChecked?: CheckedState;
30
+ /**
31
+ * The state after a change, as a plain boolean — the handler to reach for.
32
+ * Never fires with `"indeterminate"`: clicking a mixed box resolves it.
33
+ */
29
34
  onCheckedChange?(checked: boolean): void;
35
+ /**
36
+ * The underlying DOM event, for form libraries that want the native
37
+ * handler. For reading the new state, `onCheckedChange` is simpler.
38
+ */
30
39
  onChange?: ChangeEventHandler<HTMLInputElement>;
31
40
  /** Posted with the form when checked. Inside a CheckboxGroup, the value this box adds. */
32
41
  value?: string;
42
+ /** The text beside the box. Clicking it toggles the box. */
33
43
  label?: ReactNode;
44
+ /** A hint under the label, linked as the box's description. */
34
45
  description?: ReactNode;
46
+ /**
47
+ * The validation message. Setting it is enough on its own: the box reads as
48
+ * invalid to assistive technology and the message is announced, so no extra
49
+ * `aria-invalid` is needed.
50
+ */
35
51
  error?: ReactNode;
52
+ /** Default `md`, or the size of the CheckboxGroup it sits in. */
36
53
  size?: CheckboxSize;
37
54
  classNames?: Partial<Record<CheckboxSlot, string>>;
38
55
  /** The `<input>` element. */
@@ -13,7 +13,13 @@ import { cx, type CheckboxGroupSlot } from "./props";
13
13
  export interface CheckboxGroupProps {
14
14
  /** Checked values (controlled). */
15
15
  value?: string[];
16
+ /** The values checked to begin with, when you are not controlling `value`. */
16
17
  defaultValue?: string[];
18
+ /**
19
+ * The checked values after a change. They accumulate in the order they were
20
+ * checked, not the order the options are declared, so sort before comparing
21
+ * two selections for equality.
22
+ */
17
23
  onValueChange?(values: string[]): void;
18
24
  /** Render these options, or pass `<Checkbox value="…">` children. */
19
25
  options?: readonly CheckboxOption[];
@@ -9,7 +9,7 @@
9
9
  ]
10
10
  },
11
11
  "source": {
12
- "libraryVersion": "2.4.4",
12
+ "libraryVersion": "2.5.0",
13
13
  "files": [
14
14
  "core/filter.ts",
15
15
  "core/index.ts",
@@ -25,7 +25,7 @@
25
25
  "react/props.ts",
26
26
  "react/useCombobox.ts"
27
27
  ],
28
- "sourceHash": "sha256:39aa629ae5088777b3a2b8e89036701d9a100c214986912d233bbb6f4fd4f72a"
28
+ "sourceHash": "sha256:9cd7b0e88a1ee4b9bd83cab6ad6d55613476a35e4d7ea70be9fc7ac9fe2a58e7"
29
29
  },
30
30
  "props": [
31
31
  {
@@ -77,7 +77,7 @@
77
77
  "required": false,
78
78
  "default": true,
79
79
  "origin": "derived",
80
- "description": "Keep the list open after choosing. Default false.",
80
+ "description": "Close the list after choosing. Default true; `false` keeps it open.",
81
81
  "descriptionOrigin": "jsdoc"
82
82
  },
83
83
  {
@@ -92,7 +92,9 @@
92
92
  "type": "other",
93
93
  "typeText": "ReactNode",
94
94
  "required": false,
95
- "origin": "derived"
95
+ "origin": "derived",
96
+ "description": "A hint under the label, linked as the control's description.",
97
+ "descriptionOrigin": "jsdoc"
96
98
  },
97
99
  {
98
100
  "name": "disabled",
@@ -107,7 +109,9 @@
107
109
  "type": "other",
108
110
  "typeText": "ReactNode",
109
111
  "required": false,
110
- "origin": "derived"
112
+ "origin": "derived",
113
+ "description": "Shown when nothing matches the search. Defaults to the locale text.",
114
+ "descriptionOrigin": "jsdoc"
111
115
  },
112
116
  {
113
117
  "name": "error",
@@ -148,7 +152,9 @@
148
152
  "type": "other",
149
153
  "typeText": "ReactNode",
150
154
  "required": false,
151
- "origin": "derived"
155
+ "origin": "derived",
156
+ "description": "The control's name, shown above it and linked to it.",
157
+ "descriptionOrigin": "jsdoc"
152
158
  },
153
159
  {
154
160
  "name": "loading",
@@ -223,28 +229,36 @@
223
229
  "type": "function",
224
230
  "signature": "((value: NoInfer<V> | null, option: ComboboxOption<NoInfer<V>> | null) => void) | undefined",
225
231
  "required": false,
226
- "origin": "derived"
232
+ "origin": "derived",
233
+ "description": "The chosen value, and the whole option beside it so the label and\r\nanything else it carries need not be looked up again. Both are\r\n`null` once the control is cleared.",
234
+ "descriptionOrigin": "jsdoc"
227
235
  },
228
236
  {
229
237
  "name": "onCreate",
230
238
  "type": "function",
231
239
  "signature": "((label: string) => void) | undefined",
232
240
  "required": false,
233
- "origin": "derived"
241
+ "origin": "derived",
242
+ "description": "The text someone typed when they chose \"Create ...\". Adding it to\n`options` and selecting it is yours to do.",
243
+ "descriptionOrigin": "jsdoc"
234
244
  },
235
245
  {
236
246
  "name": "onLoadMore",
237
247
  "type": "function",
238
248
  "signature": "(() => void) | undefined",
239
249
  "required": false,
240
- "origin": "derived"
250
+ "origin": "derived",
251
+ "description": "Fetch the next page. Called once as the list nears its end, while\n`hasMore` is true - so it must not fire again until the new options\nhave arrived.",
252
+ "descriptionOrigin": "jsdoc"
241
253
  },
242
254
  {
243
255
  "name": "onOpenChange",
244
256
  "type": "function",
245
257
  "signature": "((open: boolean) => void) | undefined",
246
258
  "required": false,
247
- "origin": "derived"
259
+ "origin": "derived",
260
+ "description": "The list opened or closed.",
261
+ "descriptionOrigin": "jsdoc"
248
262
  },
249
263
  {
250
264
  "name": "onSearchChange",
@@ -260,7 +274,9 @@
260
274
  "type": "other",
261
275
  "typeText": "readonly ComboboxOption<V>[]",
262
276
  "required": true,
263
- "origin": "derived"
277
+ "origin": "derived",
278
+ "description": "The choices. Each needs a `value` and a `label`, and may carry a\n`description`, a `group` heading, an icon or `disabled`. In `server`\nmode these are the current results rather than the whole set.",
279
+ "descriptionOrigin": "jsdoc"
264
280
  },
265
281
  {
266
282
  "name": "placeholder",
@@ -282,7 +298,9 @@
282
298
  "type": "function",
283
299
  "signature": "((option: ComboboxOption<NoInfer<V>>, state: OptionState) => ReactNode) | undefined",
284
300
  "required": false,
285
- "origin": "derived"
301
+ "origin": "derived",
302
+ "description": "Draw each row yourself. `state` carries whether the option is\nselected, active or disabled, so the row can reflect them.",
303
+ "descriptionOrigin": "jsdoc"
286
304
  },
287
305
  {
288
306
  "name": "required",
@@ -332,7 +350,9 @@
332
350
  "typeText": "ComboboxSize | undefined",
333
351
  "required": false,
334
352
  "default": "md",
335
- "origin": "derived"
353
+ "origin": "derived",
354
+ "description": "Default `md`.",
355
+ "descriptionOrigin": "jsdoc"
336
356
  },
337
357
  {
338
358
  "name": "style",
@@ -446,9 +466,9 @@
446
466
  "safeMutations": {},
447
467
  "examples": [],
448
468
  "coverage": {
449
- "propsTotal": 39,
450
- "propsDescribed": 18,
451
- "describedPct": 46,
469
+ "propsTotal": 34,
470
+ "propsDescribed": 28,
471
+ "describedPct": 82,
452
472
  "authoredSections": [
453
473
  "accessibility"
454
474
  ]
@@ -13,8 +13,13 @@ import { useCombobox } from "./useCombobox";
13
13
  export interface SelectProps<V extends OptionValue = string> extends ComboboxSharedProps<V> {
14
14
  value?: V | null;
15
15
  defaultValue?: V | null;
16
+ /**
17
+ * The chosen value, and the whole option beside it so the label and
18
+ * anything else it carries need not be looked up again. Both are
19
+ * `null` once the control is cleared.
20
+ */
16
21
  onChange?(value: NoInfer<V> | null, option: ComboboxOption<NoInfer<V>> | null): void;
17
- /** Keep the list open after choosing. Default false. */
22
+ /** Close the list after choosing. Default true; `false` keeps it open. */
18
23
  closeOnSelect?: boolean;
19
24
  ref?: Ref<ComboboxHandle<V>>;
20
25
  }
@@ -34,6 +34,11 @@ export interface OptionState {
34
34
  }
35
35
 
36
36
  export interface ComboboxSharedProps<V extends OptionValue = string> {
37
+ /**
38
+ * The choices. Each needs a `value` and a `label`, and may carry a
39
+ * `description`, a `group` heading, an icon or `disabled`. In `server`
40
+ * mode these are the current results rather than the whole set.
41
+ */
37
42
  options: readonly ComboboxOption<V>[];
38
43
  /** `client` filters `options` locally; `server` expects `options` to be the current results. */
39
44
  mode?: "client" | "server";
@@ -47,18 +52,33 @@ export interface ComboboxSharedProps<V extends OptionValue = string> {
47
52
  searchable?: boolean;
48
53
  /** More results are available; the list calls `onLoadMore` when scrolled near the end. */
49
54
  hasMore?: boolean;
55
+ /**
56
+ * Fetch the next page. Called once as the list nears its end, while
57
+ * `hasMore` is true - so it must not fire again until the new options
58
+ * have arrived.
59
+ */
50
60
  onLoadMore?(): void;
51
61
  /**
52
62
  * Replaces the built-in search matching (client mode).
53
63
  * `NoInfer` keeps the option type coming from `options` and `value` only.
54
64
  */
55
65
  filterFn?(option: ComboboxOption<NoInfer<V>>, search: string): boolean;
66
+ /**
67
+ * Draw each row yourself. `state` carries whether the option is
68
+ * selected, active or disabled, so the row can reflect them.
69
+ */
56
70
  renderOption?(option: ComboboxOption<NoInfer<V>>, state: OptionState): ReactNode;
57
71
  /** Offers "Create …" when the search matches no option. */
58
72
  allowCreate?: boolean;
73
+ /**
74
+ * The text someone typed when they chose "Create ...". Adding it to
75
+ * `options` and selecting it is yours to do.
76
+ */
59
77
  onCreate?(label: string): void;
78
+ /** The control's name, shown above it and linked to it. */
60
79
  label?: ReactNode;
61
80
  placeholder?: string;
81
+ /** A hint under the label, linked as the control's description. */
62
82
  description?: ReactNode;
63
83
  /** Message shown below the control; also marks the control invalid. */
64
84
  error?: ReactNode;
@@ -66,6 +86,7 @@ export interface ComboboxSharedProps<V extends OptionValue = string> {
66
86
  disabled?: boolean;
67
87
  /** Show the clear button. Default true. */
68
88
  clearable?: boolean;
89
+ /** Default `md`. */
69
90
  size?: ComboboxSize;
70
91
  /** Name for the hidden form input. */
71
92
  name?: string;
@@ -74,11 +95,13 @@ export interface ComboboxSharedProps<V extends OptionValue = string> {
74
95
  maxHeight?: number;
75
96
  /** `true` / `false` to force, or a count above which virtualization turns on (default 80). */
76
97
  virtualize?: boolean | number;
98
+ /** Shown when nothing matches the search. Defaults to the locale text. */
77
99
  emptyMessage?: ReactNode;
78
100
  className?: string;
79
101
  classNames?: Partial<Record<ComboboxSlot, string>>;
80
102
  style?: CSSProperties;
81
103
  localeText?: Partial<ComboboxLocaleText>;
104
+ /** The list opened or closed. */
82
105
  onOpenChange?(open: boolean): void;
83
106
  /** Names the control when there is no visible `label`. */
84
107
  "aria-label"?: string;
@@ -268,7 +268,17 @@ export interface PdfExportOptions<T> extends PrintExportOptions<T> {
268
268
  }
269
269
 
270
270
  export interface GridOptions<T> {
271
+ /**
272
+ * The rows to show. One object per row, in whatever shape your data already
273
+ * has — columns reach into it rather than the other way round. In `server`
274
+ * mode this is the current page, not the whole set.
275
+ */
271
276
  data: readonly T[];
277
+ /**
278
+ * One definition per column, and the order here is the initial column order.
279
+ * A definition says where a column's value comes from and how to render it;
280
+ * everything else about the grid is driven from these.
281
+ */
272
282
  columns: readonly ColumnDef<T>[];
273
283
  /**
274
284
  * Stable row id: a property name (recommended) or a function.
@@ -279,24 +289,67 @@ export interface GridOptions<T> {
279
289
  mode?: "client" | "server";
280
290
  /** Total rows on the server (server mode). */
281
291
  rowCount?: number;
292
+ /**
293
+ * Drive the grid from outside. Whatever you pass here the grid obeys rather
294
+ * than deciding for itself, so pair it with `onStateChange` or the grid
295
+ * stops responding. Pass only the slices you want to own; the rest stay
296
+ * internal. For a starting point you do not intend to control, use
297
+ * `initialState`.
298
+ */
282
299
  state?: Partial<GridState>;
300
+ /**
301
+ * Where the grid starts — a default sort, a page size, hidden columns. Read
302
+ * once on mount and then owned by the grid, so later changes are ignored.
303
+ */
283
304
  initialState?: Partial<GridState>;
305
+ /**
306
+ * Every change to sorting, filters, search, pagination, selection, column
307
+ * layout or density, with the state before it for comparison. This is the
308
+ * hook for persisting a user's view.
309
+ */
284
310
  onStateChange?(next: GridState, prev: GridState): void;
285
311
  /** Fires when sorting, filters, search or pagination change. */
286
312
  onQueryChange?(query: GridQuery): void;
313
+ /** Page the rows instead of scrolling the whole set. Default `true`. */
287
314
  enablePagination?: boolean;
315
+ /** Let a header click sort the column. Default `true`. */
288
316
  enableSorting?: boolean;
317
+ /**
318
+ * Let a shift-click add a column to the sort rather than replacing it.
319
+ * Default `true`, and inert while `enableSorting` is off.
320
+ */
289
321
  enableMultiSort?: boolean;
322
+ /** Per-column filters and the toolbar's search box. Default `true`. */
290
323
  enableFiltering?: boolean;
324
+ /** Let a header edge be dragged to resize. Default `true`. */
291
325
  enableColumnResizing?: boolean;
326
+ /** Let a header be dragged to move the column. Default `true`. */
292
327
  enableColumnReordering?: boolean;
328
+ /** Let a column be pinned to the left or right edge. Default `true`. */
293
329
  enableColumnPinning?: boolean;
330
+ /** Let columns be shown and hidden from the toolbar. Default `true`. */
294
331
  enableColumnHiding?: boolean;
332
+ /**
333
+ * Add the selection column. Default `false`. A function selects per row —
334
+ * return `false` and that row's checkbox is disabled, which is how to stop
335
+ * someone picking a record their role does not cover.
336
+ */
295
337
  enableRowSelection?: boolean | ((row: T) => boolean);
338
+ /** `single` leaves one row selected at a time. Default `multiple`. */
296
339
  selectionMode?: "single" | "multiple";
340
+ /**
341
+ * A cell was edited. Fires only when the value actually changed.
342
+ *
343
+ * Return a promise to make the edit optimistic: the new value shows while
344
+ * it is in flight, and if the promise rejects the cell reverts to the
345
+ * underlying data and shows the rejection's message as the cell's error.
346
+ * So reject with the reason you want the user to read.
347
+ */
297
348
  onCellEdit?(event: CellEditEvent<T>): void | Promise<void>;
298
349
  /** Not fired for clicks on interactive content (buttons, inputs, links, checkboxes). */
299
350
  onRowClick?(row: T, event: MouseEvent<HTMLElement>): void;
351
+ /** Same exclusions as `onRowClick`: interactive content does not reach it. */
300
352
  onRowDoubleClick?(row: T, event: MouseEvent<HTMLElement>): void;
353
+ /** Base name for an exported file, without the extension. */
301
354
  exportFileName?: string;
302
355
  }