@grampro/kit 2.4.3 → 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.
- package/CHANGELOG.md +169 -0
- package/README.md +12 -0
- package/index.cjs +44 -2
- package/package.json +1 -1
- package/source/components/accordion/passport.json +11 -7
- package/source/components/accordion/react/Accordion.tsx +5 -0
- package/source/components/alert/passport.json +3 -3
- package/source/components/avatar/passport.json +8 -6
- package/source/components/avatar/react/Avatar.tsx +4 -0
- package/source/components/badge/passport.json +8 -6
- package/source/components/badge/react/Badge.tsx +1 -0
- package/source/components/badge/react/Tag.tsx +1 -0
- package/source/components/breadcrumb/passport.json +8 -6
- package/source/components/breadcrumb/react/Breadcrumb.tsx +1 -0
- package/source/components/button/passport.json +8 -6
- package/source/components/button/react/Button.tsx +1 -0
- package/source/components/card/passport.json +17 -9
- package/source/components/card/react/Card.tsx +5 -0
- package/source/components/card/react/Stat.tsx +5 -0
- package/source/components/checkbox/passport.json +32 -14
- package/source/components/checkbox/react/Checkbox.tsx +17 -0
- package/source/components/checkbox/react/CheckboxGroup.tsx +6 -0
- package/source/components/combobox/passport.json +36 -16
- package/source/components/combobox/react/Select.tsx +6 -1
- package/source/components/combobox/react/props.ts +23 -0
- package/source/components/data-grid/core/types.ts +53 -0
- package/source/components/data-grid/passport.json +82 -30
- package/source/components/data-grid/react/AskGrid.tsx +10 -0
- package/source/components/data-grid/react/DataGrid.tsx +16 -0
- package/source/components/date-picker/passport.json +30 -14
- package/source/components/date-picker/react/DatePicker.tsx +5 -0
- package/source/components/date-picker/react/props.ts +13 -1
- package/source/components/dialog/core/types.ts +14 -0
- package/source/components/dialog/passport.json +26 -12
- package/source/components/dialog/react/Dialog.tsx +4 -0
- package/source/components/file-uploader/passport.json +44 -18
- package/source/components/file-uploader/react/FileUploader.tsx +39 -0
- package/source/components/input/passport.json +14 -8
- package/source/components/input/react/Input.tsx +3 -0
- package/source/components/menu/passport.json +29 -13
- package/source/components/menu/react/Menu.tsx +7 -0
- package/source/components/menu/react/items.tsx +4 -0
- package/source/components/modal/passport.json +14 -8
- package/source/components/modal/react/Modal.tsx +6 -0
- package/source/components/number-input/passport.json +23 -11
- package/source/components/number-input/react/NumberInput.tsx +13 -0
- package/source/components/popover/passport.json +17 -9
- package/source/components/popover/react/Popover.tsx +7 -0
- package/source/components/progress/passport.json +3 -3
- package/source/components/radio-group/passport.json +32 -14
- package/source/components/radio-group/react/Radio.tsx +17 -0
- package/source/components/radio-group/react/RadioGroup.tsx +13 -0
- package/source/components/skeleton/passport.json +8 -6
- package/source/components/skeleton/react/Skeleton.tsx +5 -0
- package/source/components/spinner/passport.json +3 -3
- package/source/components/switch/passport.json +23 -11
- package/source/components/switch/react/Switch.tsx +14 -0
- package/source/components/tabs/passport.json +11 -7
- package/source/components/tabs/react/Tabs.tsx +2 -0
- package/source/components/textarea/passport.json +14 -8
- package/source/components/textarea/react/Textarea.tsx +3 -0
- package/source/components/toaster/passport.json +8 -6
- package/source/components/toaster/react/Toaster.tsx +4 -0
- package/source/components/tooltip/passport.json +3 -3
- package/tools/mcp/README.md +224 -0
- package/tools/mcp/figma.cjs +445 -0
- package/tools/mcp/install.cjs +270 -0
- package/tools/mcp/secret-cli.cjs +174 -0
- package/tools/mcp/secret.cjs +289 -0
- package/tools/mcp/server.cjs +497 -0
- package/tools/passport/cli.cjs +8 -1
- package/tools/passport/extract.cjs +7 -3
- package/tools/passport/merge.cjs +24 -4
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
]
|
|
15
15
|
},
|
|
16
16
|
"source": {
|
|
17
|
-
"libraryVersion": "2.
|
|
17
|
+
"libraryVersion": "2.5.0",
|
|
18
18
|
"files": [
|
|
19
19
|
"agent/coerce.ts",
|
|
20
20
|
"agent/contract.ts",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"react/keyboard.ts",
|
|
65
65
|
"react/locale.ts"
|
|
66
66
|
],
|
|
67
|
-
"sourceHash": "sha256:
|
|
67
|
+
"sourceHash": "sha256:b3fa605b7c7ae2fbb4d9ccd3900b69472665508c0c92b5a218767d4c387d20a3"
|
|
68
68
|
},
|
|
69
69
|
"purpose": "Display and operate on tabular data. Virtualized; holds its own sort, filter, search, selection, column and pagination state in an external store exposed through GridApi.",
|
|
70
70
|
"props": [
|
|
@@ -73,7 +73,9 @@
|
|
|
73
73
|
"type": "other",
|
|
74
74
|
"typeText": "GridAgent<T> | null",
|
|
75
75
|
"required": true,
|
|
76
|
-
"origin": "derived"
|
|
76
|
+
"origin": "derived",
|
|
77
|
+
"description": "The agent that turns a sentence into grid operations, from\n`useGridAgent`. `null` while none is in scope, and the box renders\nnothing rather than offering something that cannot answer.",
|
|
78
|
+
"descriptionOrigin": "jsdoc"
|
|
77
79
|
},
|
|
78
80
|
{
|
|
79
81
|
"name": "agentPolicy",
|
|
@@ -131,21 +133,27 @@
|
|
|
131
133
|
"type": "other",
|
|
132
134
|
"typeText": "readonly ColumnDef<T, unknown>[]",
|
|
133
135
|
"required": true,
|
|
134
|
-
"origin": "derived"
|
|
136
|
+
"origin": "derived",
|
|
137
|
+
"description": "One definition per column, and the order here is the initial column order.\nA definition says where a column's value comes from and how to render it;\neverything else about the grid is driven from these.",
|
|
138
|
+
"descriptionOrigin": "jsdoc"
|
|
135
139
|
},
|
|
136
140
|
{
|
|
137
141
|
"name": "data",
|
|
138
142
|
"type": "other",
|
|
139
143
|
"typeText": "readonly T[]",
|
|
140
144
|
"required": true,
|
|
141
|
-
"origin": "derived"
|
|
145
|
+
"origin": "derived",
|
|
146
|
+
"description": "The rows to show. One object per row, in whatever shape your data already\nhas — columns reach into it rather than the other way round. In `server`\nmode this is the current page, not the whole set.",
|
|
147
|
+
"descriptionOrigin": "jsdoc"
|
|
142
148
|
},
|
|
143
149
|
{
|
|
144
150
|
"name": "emptyState",
|
|
145
151
|
"type": "other",
|
|
146
152
|
"typeText": "ReactNode",
|
|
147
153
|
"required": false,
|
|
148
|
-
"origin": "derived"
|
|
154
|
+
"origin": "derived",
|
|
155
|
+
"description": "Shown in place of rows when there are none. Worth distinguishing \"nothing\r\nhere yet\" from \"nothing matched your filters\", which the default does not.",
|
|
156
|
+
"descriptionOrigin": "jsdoc"
|
|
149
157
|
},
|
|
150
158
|
{
|
|
151
159
|
"name": "enableColumnHiding",
|
|
@@ -153,7 +161,9 @@
|
|
|
153
161
|
"typeText": "boolean | undefined",
|
|
154
162
|
"required": false,
|
|
155
163
|
"default": true,
|
|
156
|
-
"origin": "derived"
|
|
164
|
+
"origin": "derived",
|
|
165
|
+
"description": "Let columns be shown and hidden from the toolbar. Default `true`.",
|
|
166
|
+
"descriptionOrigin": "jsdoc"
|
|
157
167
|
},
|
|
158
168
|
{
|
|
159
169
|
"name": "enableColumnPinning",
|
|
@@ -161,7 +171,9 @@
|
|
|
161
171
|
"typeText": "boolean | undefined",
|
|
162
172
|
"required": false,
|
|
163
173
|
"default": true,
|
|
164
|
-
"origin": "derived"
|
|
174
|
+
"origin": "derived",
|
|
175
|
+
"description": "Let a column be pinned to the left or right edge. Default `true`.",
|
|
176
|
+
"descriptionOrigin": "jsdoc"
|
|
165
177
|
},
|
|
166
178
|
{
|
|
167
179
|
"name": "enableColumnReordering",
|
|
@@ -169,7 +181,9 @@
|
|
|
169
181
|
"typeText": "boolean | undefined",
|
|
170
182
|
"required": false,
|
|
171
183
|
"default": true,
|
|
172
|
-
"origin": "derived"
|
|
184
|
+
"origin": "derived",
|
|
185
|
+
"description": "Let a header be dragged to move the column. Default `true`.",
|
|
186
|
+
"descriptionOrigin": "jsdoc"
|
|
173
187
|
},
|
|
174
188
|
{
|
|
175
189
|
"name": "enableColumnResizing",
|
|
@@ -177,7 +191,9 @@
|
|
|
177
191
|
"typeText": "boolean | undefined",
|
|
178
192
|
"required": false,
|
|
179
193
|
"default": true,
|
|
180
|
-
"origin": "derived"
|
|
194
|
+
"origin": "derived",
|
|
195
|
+
"description": "Let a header edge be dragged to resize. Default `true`.",
|
|
196
|
+
"descriptionOrigin": "jsdoc"
|
|
181
197
|
},
|
|
182
198
|
{
|
|
183
199
|
"name": "enableFiltering",
|
|
@@ -185,14 +201,18 @@
|
|
|
185
201
|
"typeText": "boolean | undefined",
|
|
186
202
|
"required": false,
|
|
187
203
|
"default": true,
|
|
188
|
-
"origin": "derived"
|
|
204
|
+
"origin": "derived",
|
|
205
|
+
"description": "Per-column filters and the toolbar's search box. Default `true`.",
|
|
206
|
+
"descriptionOrigin": "jsdoc"
|
|
189
207
|
},
|
|
190
208
|
{
|
|
191
209
|
"name": "enableMultiSort",
|
|
192
210
|
"type": "boolean",
|
|
193
211
|
"typeText": "boolean | undefined",
|
|
194
212
|
"required": false,
|
|
195
|
-
"origin": "derived"
|
|
213
|
+
"origin": "derived",
|
|
214
|
+
"description": "Let a shift-click add a column to the sort rather than replacing it.\nDefault `true`, and inert while `enableSorting` is off.",
|
|
215
|
+
"descriptionOrigin": "jsdoc"
|
|
196
216
|
},
|
|
197
217
|
{
|
|
198
218
|
"name": "enablePagination",
|
|
@@ -200,7 +220,9 @@
|
|
|
200
220
|
"typeText": "boolean | undefined",
|
|
201
221
|
"required": false,
|
|
202
222
|
"default": true,
|
|
203
|
-
"origin": "derived"
|
|
223
|
+
"origin": "derived",
|
|
224
|
+
"description": "Page the rows instead of scrolling the whole set. Default `true`.",
|
|
225
|
+
"descriptionOrigin": "jsdoc"
|
|
204
226
|
},
|
|
205
227
|
{
|
|
206
228
|
"name": "enableRowSelection",
|
|
@@ -208,7 +230,9 @@
|
|
|
208
230
|
"typeText": "boolean | ((row: T) => boolean) | undefined",
|
|
209
231
|
"required": false,
|
|
210
232
|
"default": false,
|
|
211
|
-
"origin": "derived"
|
|
233
|
+
"origin": "derived",
|
|
234
|
+
"description": "Add the selection column. Default `false`. A function selects per row —\nreturn `false` and that row's checkbox is disabled, which is how to stop\nsomeone picking a record their role does not cover.",
|
|
235
|
+
"descriptionOrigin": "jsdoc"
|
|
212
236
|
},
|
|
213
237
|
{
|
|
214
238
|
"name": "enableSorting",
|
|
@@ -216,21 +240,27 @@
|
|
|
216
240
|
"typeText": "boolean | undefined",
|
|
217
241
|
"required": false,
|
|
218
242
|
"default": true,
|
|
219
|
-
"origin": "derived"
|
|
243
|
+
"origin": "derived",
|
|
244
|
+
"description": "Let a header click sort the column. Default `true`.",
|
|
245
|
+
"descriptionOrigin": "jsdoc"
|
|
220
246
|
},
|
|
221
247
|
{
|
|
222
248
|
"name": "exportFileName",
|
|
223
249
|
"type": "string",
|
|
224
250
|
"typeText": "string | undefined",
|
|
225
251
|
"required": false,
|
|
226
|
-
"origin": "derived"
|
|
252
|
+
"origin": "derived",
|
|
253
|
+
"description": "Base name for an exported file, without the extension.",
|
|
254
|
+
"descriptionOrigin": "jsdoc"
|
|
227
255
|
},
|
|
228
256
|
{
|
|
229
257
|
"name": "getRowClassName",
|
|
230
258
|
"type": "function",
|
|
231
259
|
"signature": "((row: T, rowIndex: number) => string | undefined) | undefined",
|
|
232
260
|
"required": false,
|
|
233
|
-
"origin": "derived"
|
|
261
|
+
"origin": "derived",
|
|
262
|
+
"description": "A class per row, for status colouring. Return undefined for no class.",
|
|
263
|
+
"descriptionOrigin": "jsdoc"
|
|
234
264
|
},
|
|
235
265
|
{
|
|
236
266
|
"name": "getRowId",
|
|
@@ -246,7 +276,9 @@
|
|
|
246
276
|
"type": "number",
|
|
247
277
|
"typeText": "number | undefined",
|
|
248
278
|
"required": false,
|
|
249
|
-
"origin": "derived"
|
|
279
|
+
"origin": "derived",
|
|
280
|
+
"description": "Fixed header height in px. Defaults to the density's row height.",
|
|
281
|
+
"descriptionOrigin": "jsdoc"
|
|
250
282
|
},
|
|
251
283
|
{
|
|
252
284
|
"name": "height",
|
|
@@ -263,7 +295,9 @@
|
|
|
263
295
|
"type": "other",
|
|
264
296
|
"typeText": "Partial<GridState> | undefined",
|
|
265
297
|
"required": false,
|
|
266
|
-
"origin": "derived"
|
|
298
|
+
"origin": "derived",
|
|
299
|
+
"description": "Where the grid starts — a default sort, a page size, hidden columns. Read\nonce on mount and then owned by the grid, so later changes are ignored.",
|
|
300
|
+
"descriptionOrigin": "jsdoc"
|
|
267
301
|
},
|
|
268
302
|
{
|
|
269
303
|
"name": "loading",
|
|
@@ -271,7 +305,9 @@
|
|
|
271
305
|
"typeText": "boolean | undefined",
|
|
272
306
|
"required": false,
|
|
273
307
|
"default": false,
|
|
274
|
-
"origin": "derived"
|
|
308
|
+
"origin": "derived",
|
|
309
|
+
"description": "Show the loading treatment over the grid. The existing rows stay in place\r\nunderneath, so a refresh does not empty the screen.",
|
|
310
|
+
"descriptionOrigin": "jsdoc"
|
|
275
311
|
},
|
|
276
312
|
{
|
|
277
313
|
"name": "locale",
|
|
@@ -309,7 +345,9 @@
|
|
|
309
345
|
"type": "function",
|
|
310
346
|
"signature": "((event: CellEditEvent<T>) => void | Promise<void>) | undefined",
|
|
311
347
|
"required": false,
|
|
312
|
-
"origin": "derived"
|
|
348
|
+
"origin": "derived",
|
|
349
|
+
"description": "A cell was edited. Fires only when the value actually changed.\n\nReturn a promise to make the edit optimistic: the new value shows while\nit is in flight, and if the promise rejects the cell reverts to the\nunderlying data and shows the rejection's message as the cell's error.\nSo reject with the reason you want the user to read.",
|
|
350
|
+
"descriptionOrigin": "jsdoc"
|
|
313
351
|
},
|
|
314
352
|
{
|
|
315
353
|
"name": "onQueryChange",
|
|
@@ -334,14 +372,18 @@
|
|
|
334
372
|
"type": "function",
|
|
335
373
|
"signature": "((row: T, event: MouseEvent<HTMLElement>) => void) | undefined",
|
|
336
374
|
"required": false,
|
|
337
|
-
"origin": "derived"
|
|
375
|
+
"origin": "derived",
|
|
376
|
+
"description": "Same exclusions as `onRowClick`: interactive content does not reach it.",
|
|
377
|
+
"descriptionOrigin": "jsdoc"
|
|
338
378
|
},
|
|
339
379
|
{
|
|
340
380
|
"name": "onStateChange",
|
|
341
381
|
"type": "function",
|
|
342
382
|
"signature": "((next: GridState, prev: GridState) => void) | undefined",
|
|
343
383
|
"required": false,
|
|
344
|
-
"origin": "derived"
|
|
384
|
+
"origin": "derived",
|
|
385
|
+
"description": "Every change to sorting, filters, search, pagination, selection, column\nlayout or density, with the state before it for comparison. This is the\nhook for persisting a user's view.",
|
|
386
|
+
"descriptionOrigin": "jsdoc"
|
|
345
387
|
},
|
|
346
388
|
{
|
|
347
389
|
"name": "pageSizeOptions",
|
|
@@ -349,7 +391,9 @@
|
|
|
349
391
|
"typeText": "number[] | undefined",
|
|
350
392
|
"required": false,
|
|
351
393
|
"default": "DEFAULT_PAGE_SIZES",
|
|
352
|
-
"origin": "derived"
|
|
394
|
+
"origin": "derived",
|
|
395
|
+
"description": "Page sizes offered in the pager. Default `[25, 50, 100, 250]`.",
|
|
396
|
+
"descriptionOrigin": "jsdoc"
|
|
353
397
|
},
|
|
354
398
|
{
|
|
355
399
|
"name": "placeholder",
|
|
@@ -393,7 +437,9 @@
|
|
|
393
437
|
"typeText": "'multiple' | 'single' | undefined",
|
|
394
438
|
"required": false,
|
|
395
439
|
"default": "multiple",
|
|
396
|
-
"origin": "derived"
|
|
440
|
+
"origin": "derived",
|
|
441
|
+
"description": "`single` leaves one row selected at a time. Default `multiple`.",
|
|
442
|
+
"descriptionOrigin": "jsdoc"
|
|
397
443
|
},
|
|
398
444
|
{
|
|
399
445
|
"name": "semantics",
|
|
@@ -410,6 +456,8 @@
|
|
|
410
456
|
"typeText": "Partial<GridState> | undefined",
|
|
411
457
|
"required": false,
|
|
412
458
|
"origin": "derived",
|
|
459
|
+
"description": "Drive the grid from outside. Whatever you pass here the grid obeys rather\nthan deciding for itself, so pair it with `onStateChange` or the grid\nstops responding. Pass only the slices you want to own; the rest stay\ninternal. For a starting point you do not intend to control, use\n`initialState`.",
|
|
460
|
+
"descriptionOrigin": "jsdoc",
|
|
413
461
|
"note": "Makes the grid controlled. Prefer `initialState` unless the host genuinely owns the state."
|
|
414
462
|
},
|
|
415
463
|
{
|
|
@@ -424,7 +472,9 @@
|
|
|
424
472
|
"type": "other",
|
|
425
473
|
"typeText": "readonly string[] | undefined",
|
|
426
474
|
"required": false,
|
|
427
|
-
"origin": "derived"
|
|
475
|
+
"origin": "derived",
|
|
476
|
+
"description": "Example questions offered before anyone types. Worth setting to the\nphrasings this data actually supports — they teach the shape of a good\nquestion faster than placeholder text does.",
|
|
477
|
+
"descriptionOrigin": "jsdoc"
|
|
428
478
|
},
|
|
429
479
|
{
|
|
430
480
|
"name": "toolbar",
|
|
@@ -432,7 +482,9 @@
|
|
|
432
482
|
"typeText": "boolean | ToolbarOptions | undefined",
|
|
433
483
|
"required": false,
|
|
434
484
|
"default": true,
|
|
435
|
-
"origin": "derived"
|
|
485
|
+
"origin": "derived",
|
|
486
|
+
"description": "The toolbar above the grid. `true` for all of it, `false` for none, or an\r\nobject to choose parts — `{ search: true, export: false }` — and to put\r\nyour own controls at its `start` or `end`.",
|
|
487
|
+
"descriptionOrigin": "jsdoc"
|
|
436
488
|
}
|
|
437
489
|
],
|
|
438
490
|
"events": [
|
|
@@ -1029,9 +1081,9 @@
|
|
|
1029
1081
|
},
|
|
1030
1082
|
"examples": [],
|
|
1031
1083
|
"coverage": {
|
|
1032
|
-
"propsTotal":
|
|
1033
|
-
"propsDescribed":
|
|
1034
|
-
"describedPct":
|
|
1084
|
+
"propsTotal": 40,
|
|
1085
|
+
"propsDescribed": 38,
|
|
1086
|
+
"describedPct": 95,
|
|
1035
1087
|
"authoredSections": [
|
|
1036
1088
|
"accessibility",
|
|
1037
1089
|
"composition",
|
|
@@ -20,8 +20,18 @@ import type { GridAgent } from "../agent/engine";
|
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
22
|
export interface AskGridProps<T> {
|
|
23
|
+
/**
|
|
24
|
+
* The agent that turns a sentence into grid operations, from
|
|
25
|
+
* `useGridAgent`. `null` while none is in scope, and the box renders
|
|
26
|
+
* nothing rather than offering something that cannot answer.
|
|
27
|
+
*/
|
|
23
28
|
agent: GridAgent<T> | null;
|
|
24
29
|
placeholder?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Example questions offered before anyone types. Worth setting to the
|
|
32
|
+
* phrasings this data actually supports — they teach the shape of a good
|
|
33
|
+
* question faster than placeholder text does.
|
|
34
|
+
*/
|
|
25
35
|
suggestions?: readonly string[];
|
|
26
36
|
className?: string;
|
|
27
37
|
"aria-label"?: string;
|
|
@@ -38,11 +38,27 @@ export interface DataGridProps<T> extends GridOptions<T> {
|
|
|
38
38
|
autoHeight?: boolean;
|
|
39
39
|
/** Fixed row height in px. Defaults to the density's height. */
|
|
40
40
|
rowHeight?: number;
|
|
41
|
+
/** Fixed header height in px. Defaults to the density's row height. */
|
|
41
42
|
headerHeight?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Show the loading treatment over the grid. The existing rows stay in place
|
|
45
|
+
* underneath, so a refresh does not empty the screen.
|
|
46
|
+
*/
|
|
42
47
|
loading?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* The toolbar above the grid. `true` for all of it, `false` for none, or an
|
|
50
|
+
* object to choose parts — `{ search: true, export: false }` — and to put
|
|
51
|
+
* your own controls at its `start` or `end`.
|
|
52
|
+
*/
|
|
43
53
|
toolbar?: boolean | ToolbarOptions;
|
|
54
|
+
/** Page sizes offered in the pager. Default `[25, 50, 100, 250]`. */
|
|
44
55
|
pageSizeOptions?: number[];
|
|
56
|
+
/**
|
|
57
|
+
* Shown in place of rows when there are none. Worth distinguishing "nothing
|
|
58
|
+
* here yet" from "nothing matched your filters", which the default does not.
|
|
59
|
+
*/
|
|
45
60
|
emptyState?: ReactNode;
|
|
61
|
+
/** A class per row, for status colouring. Return undefined for no class. */
|
|
46
62
|
getRowClassName?(row: T, rowIndex: number): string | undefined;
|
|
47
63
|
classNames?: Partial<Record<GridSlot, string>>;
|
|
48
64
|
className?: string;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
]
|
|
11
11
|
},
|
|
12
12
|
"source": {
|
|
13
|
-
"libraryVersion": "2.
|
|
13
|
+
"libraryVersion": "2.5.0",
|
|
14
14
|
"files": [
|
|
15
15
|
"core/calendar.ts",
|
|
16
16
|
"core/format.ts",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"react/props.ts",
|
|
30
30
|
"react/useDatePicker.ts"
|
|
31
31
|
],
|
|
32
|
-
"sourceHash": "sha256:
|
|
32
|
+
"sourceHash": "sha256:2370299b9b495fd18671fb31106c1ba88e834227e3b9632207c048da66982370"
|
|
33
33
|
},
|
|
34
34
|
"props": [
|
|
35
35
|
{
|
|
@@ -88,7 +88,9 @@
|
|
|
88
88
|
"type": "other",
|
|
89
89
|
"typeText": "ReactNode",
|
|
90
90
|
"required": false,
|
|
91
|
-
"origin": "derived"
|
|
91
|
+
"origin": "derived",
|
|
92
|
+
"description": "A hint under the label, linked as the control's description.",
|
|
93
|
+
"descriptionOrigin": "jsdoc"
|
|
92
94
|
},
|
|
93
95
|
{
|
|
94
96
|
"name": "disabled",
|
|
@@ -122,7 +124,9 @@
|
|
|
122
124
|
"type": "other",
|
|
123
125
|
"typeText": "DateFormat | undefined",
|
|
124
126
|
"required": false,
|
|
125
|
-
"origin": "derived"
|
|
127
|
+
"origin": "derived",
|
|
128
|
+
"description": "How the chosen date is displayed. `Intl.DateTimeFormatOptions` for the\nusual cases, or a function for a shape Intl cannot express. Left out,\nthe locale's own date format is used - which is the right default far\nmore often than a hand-written one.",
|
|
129
|
+
"descriptionOrigin": "jsdoc"
|
|
126
130
|
},
|
|
127
131
|
{
|
|
128
132
|
"name": "id",
|
|
@@ -145,7 +149,9 @@
|
|
|
145
149
|
"type": "other",
|
|
146
150
|
"typeText": "ReactNode",
|
|
147
151
|
"required": false,
|
|
148
|
-
"origin": "derived"
|
|
152
|
+
"origin": "derived",
|
|
153
|
+
"description": "The control's name, shown above it and linked to it.",
|
|
154
|
+
"descriptionOrigin": "jsdoc"
|
|
149
155
|
},
|
|
150
156
|
{
|
|
151
157
|
"name": "locale",
|
|
@@ -168,7 +174,9 @@
|
|
|
168
174
|
"type": "other",
|
|
169
175
|
"typeText": "DateInput | null | undefined",
|
|
170
176
|
"required": false,
|
|
171
|
-
"origin": "derived"
|
|
177
|
+
"origin": "derived",
|
|
178
|
+
"description": "Latest selectable day. Later days are shown but cannot be picked.",
|
|
179
|
+
"descriptionOrigin": "jsdoc"
|
|
172
180
|
},
|
|
173
181
|
{
|
|
174
182
|
"name": "min",
|
|
@@ -176,7 +184,7 @@
|
|
|
176
184
|
"typeText": "DateInput | null | undefined",
|
|
177
185
|
"required": false,
|
|
178
186
|
"origin": "derived",
|
|
179
|
-
"description": "Earliest
|
|
187
|
+
"description": "Earliest selectable day. Earlier days are shown but cannot be picked.",
|
|
180
188
|
"descriptionOrigin": "jsdoc"
|
|
181
189
|
},
|
|
182
190
|
{
|
|
@@ -203,14 +211,18 @@
|
|
|
203
211
|
"type": "function",
|
|
204
212
|
"signature": "((date: Date | null) => void) | undefined",
|
|
205
213
|
"required": false,
|
|
206
|
-
"origin": "derived"
|
|
214
|
+
"origin": "derived",
|
|
215
|
+
"description": "The chosen day as a `Date` at local midnight, or `null` once cleared.\r\nAccepts a string or a number in `value`, but always hands back a\r\n`Date`.",
|
|
216
|
+
"descriptionOrigin": "jsdoc"
|
|
207
217
|
},
|
|
208
218
|
{
|
|
209
219
|
"name": "onOpenChange",
|
|
210
220
|
"type": "function",
|
|
211
221
|
"signature": "((open: boolean) => void) | undefined",
|
|
212
222
|
"required": false,
|
|
213
|
-
"origin": "derived"
|
|
223
|
+
"origin": "derived",
|
|
224
|
+
"description": "The calendar opened or closed.",
|
|
225
|
+
"descriptionOrigin": "jsdoc"
|
|
214
226
|
},
|
|
215
227
|
{
|
|
216
228
|
"name": "placeholder",
|
|
@@ -269,7 +281,9 @@
|
|
|
269
281
|
"typeText": "boolean | undefined",
|
|
270
282
|
"required": false,
|
|
271
283
|
"default": false,
|
|
272
|
-
"origin": "derived"
|
|
284
|
+
"origin": "derived",
|
|
285
|
+
"description": "Number each week down the left of the calendar. Default false.",
|
|
286
|
+
"descriptionOrigin": "jsdoc"
|
|
273
287
|
},
|
|
274
288
|
{
|
|
275
289
|
"name": "size",
|
|
@@ -282,7 +296,9 @@
|
|
|
282
296
|
"typeText": "DatePickerSize | undefined",
|
|
283
297
|
"required": false,
|
|
284
298
|
"default": "md",
|
|
285
|
-
"origin": "derived"
|
|
299
|
+
"origin": "derived",
|
|
300
|
+
"description": "Default `md`.",
|
|
301
|
+
"descriptionOrigin": "jsdoc"
|
|
286
302
|
},
|
|
287
303
|
{
|
|
288
304
|
"name": "style",
|
|
@@ -397,9 +413,9 @@
|
|
|
397
413
|
"safeMutations": {},
|
|
398
414
|
"examples": [],
|
|
399
415
|
"coverage": {
|
|
400
|
-
"propsTotal":
|
|
401
|
-
"propsDescribed":
|
|
402
|
-
"describedPct":
|
|
416
|
+
"propsTotal": 28,
|
|
417
|
+
"propsDescribed": 22,
|
|
418
|
+
"describedPct": 79,
|
|
403
419
|
"authoredSections": [
|
|
404
420
|
"accessibility"
|
|
405
421
|
]
|
|
@@ -23,6 +23,11 @@ import { useDatePicker } from "./useDatePicker";
|
|
|
23
23
|
export interface DatePickerProps extends DatePickerSharedProps {
|
|
24
24
|
value?: DateInput | null;
|
|
25
25
|
defaultValue?: DateInput | null;
|
|
26
|
+
/**
|
|
27
|
+
* The chosen day as a `Date` at local midnight, or `null` once cleared.
|
|
28
|
+
* Accepts a string or a number in `value`, but always hands back a
|
|
29
|
+
* `Date`.
|
|
30
|
+
*/
|
|
26
31
|
onChange?(date: Date | null): void;
|
|
27
32
|
/** Close the calendar after choosing a date. Default true. */
|
|
28
33
|
closeOnSelect?: boolean;
|
|
@@ -27,8 +27,9 @@ export type DateFormat =
|
|
|
27
27
|
| ((date: Date, locale: string | undefined) => string);
|
|
28
28
|
|
|
29
29
|
export interface DatePickerSharedProps {
|
|
30
|
-
/** Earliest
|
|
30
|
+
/** Earliest selectable day. Earlier days are shown but cannot be picked. */
|
|
31
31
|
min?: DateInput | null;
|
|
32
|
+
/** Latest selectable day. Later days are shown but cannot be picked. */
|
|
32
33
|
max?: DateInput | null;
|
|
33
34
|
/** Called for every rendered day; return true to block it (weekends, holidays). */
|
|
34
35
|
isDateDisabled?(date: Date): boolean;
|
|
@@ -40,9 +41,16 @@ export interface DatePickerSharedProps {
|
|
|
40
41
|
locale?: string;
|
|
41
42
|
/** 0 = Sunday. Defaults to the locale's first day of the week. */
|
|
42
43
|
weekStartsOn?: number;
|
|
44
|
+
/**
|
|
45
|
+
* How the chosen date is displayed. `Intl.DateTimeFormatOptions` for the
|
|
46
|
+
* usual cases, or a function for a shape Intl cannot express. Left out,
|
|
47
|
+
* the locale's own date format is used - which is the right default far
|
|
48
|
+
* more often than a hand-written one.
|
|
49
|
+
*/
|
|
43
50
|
format?: DateFormat;
|
|
44
51
|
/** Months shown side by side. Default 1, or 2 for the range picker. */
|
|
45
52
|
numberOfMonths?: number;
|
|
53
|
+
/** Number each week down the left of the calendar. Default false. */
|
|
46
54
|
showWeekNumbers?: boolean;
|
|
47
55
|
/** Show the "Today" shortcut in the footer. Default true. */
|
|
48
56
|
showToday?: boolean;
|
|
@@ -50,7 +58,9 @@ export interface DatePickerSharedProps {
|
|
|
50
58
|
allowInput?: boolean;
|
|
51
59
|
/** Always six week rows, so the popover never changes height. Default true. */
|
|
52
60
|
fixedWeeks?: boolean;
|
|
61
|
+
/** The control's name, shown above it and linked to it. */
|
|
53
62
|
label?: ReactNode;
|
|
63
|
+
/** A hint under the label, linked as the control's description. */
|
|
54
64
|
description?: ReactNode;
|
|
55
65
|
/** Message shown below the control; also marks the control invalid. */
|
|
56
66
|
error?: ReactNode;
|
|
@@ -61,6 +71,7 @@ export interface DatePickerSharedProps {
|
|
|
61
71
|
readOnly?: boolean;
|
|
62
72
|
/** Show the clear button. Default true. */
|
|
63
73
|
clearable?: boolean;
|
|
74
|
+
/** Default `md`. */
|
|
64
75
|
size?: DatePickerSize;
|
|
65
76
|
/** Posts the value as `yyyy-mm-dd` in a hidden input. */
|
|
66
77
|
name?: string;
|
|
@@ -69,6 +80,7 @@ export interface DatePickerSharedProps {
|
|
|
69
80
|
classNames?: Partial<Record<DatePickerSlot, string>>;
|
|
70
81
|
style?: CSSProperties;
|
|
71
82
|
localeText?: Partial<DatePickerLocaleText>;
|
|
83
|
+
/** The calendar opened or closed. */
|
|
72
84
|
onOpenChange?(open: boolean): void;
|
|
73
85
|
}
|
|
74
86
|
|
|
@@ -6,14 +6,21 @@ export type DialogSize = "sm" | "md";
|
|
|
6
6
|
|
|
7
7
|
export interface DialogBaseOptions {
|
|
8
8
|
title: ReactNode;
|
|
9
|
+
/** The detail under the title - what is about to happen, and to what. */
|
|
9
10
|
description?: ReactNode;
|
|
10
11
|
/** Sets the icon and the confirm button's color. `danger` also focuses Cancel first. */
|
|
11
12
|
intent?: DialogIntent;
|
|
12
13
|
/** Replaces the intent's icon; `null` hides it. */
|
|
13
14
|
icon?: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* The confirming button's text. Defaults to OK for an alert and Confirm
|
|
17
|
+
* otherwise; naming the action ("Delete project") reads better than
|
|
18
|
+
* either.
|
|
19
|
+
*/
|
|
14
20
|
confirmLabel?: ReactNode;
|
|
15
21
|
/** Escape and a backdrop click count as Cancel. Default true. */
|
|
16
22
|
dismissible?: boolean;
|
|
23
|
+
/** Default `md`. */
|
|
17
24
|
size?: DialogSize;
|
|
18
25
|
}
|
|
19
26
|
|
|
@@ -23,16 +30,23 @@ export interface AlertOptions extends DialogBaseOptions {
|
|
|
23
30
|
}
|
|
24
31
|
|
|
25
32
|
export interface ConfirmOptions extends DialogBaseOptions {
|
|
33
|
+
/** The dismissing button's text. Defaults to Cancel. */
|
|
26
34
|
cancelLabel?: ReactNode;
|
|
27
35
|
/** Runs on Confirm. The dialog waits while it runs and shows its error if it throws. */
|
|
28
36
|
onConfirm?(): void | Promise<void>;
|
|
29
37
|
}
|
|
30
38
|
|
|
31
39
|
export interface PromptOptions extends DialogBaseOptions {
|
|
40
|
+
/** The dismissing button's text. Defaults to Cancel. */
|
|
32
41
|
cancelLabel?: ReactNode;
|
|
33
42
|
defaultValue?: string;
|
|
34
43
|
placeholder?: string;
|
|
44
|
+
/** Names the text field. Without it the field is named by the title. */
|
|
35
45
|
inputLabel?: ReactNode;
|
|
46
|
+
/**
|
|
47
|
+
* The field's input type, which picks the on-screen keyboard on a phone.
|
|
48
|
+
* Default `text`. The value still arrives as a string.
|
|
49
|
+
*/
|
|
36
50
|
inputType?: "text" | "email" | "password" | "number" | "url" | "tel";
|
|
37
51
|
required?: boolean;
|
|
38
52
|
/** Return a message to block confirming. */
|