@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
@@ -34,14 +34,20 @@ type Renderable = ReactNode | ((props: ModalRenderProps) => ReactNode);
34
34
  export interface ModalProps {
35
35
  /** Controlled open state. */
36
36
  open?: boolean;
37
+ /** Open to begin with, when you are not controlling `open`. */
37
38
  defaultOpen?: boolean;
38
39
  /** `reason` says what closed it; it is undefined when opening. */
39
40
  onOpenChange?(open: boolean, reason?: CloseReason): void;
40
41
  title?: ReactNode;
42
+ /** A line under the title, linked as the dialog's description. */
41
43
  description?: ReactNode;
42
44
  /** Accessible name when there is no `title`. */
43
45
  "aria-label"?: string;
44
46
  children?: Renderable;
47
+ /**
48
+ * The actions row, pinned below the scrolling content so it stays
49
+ * reachable however long the body is.
50
+ */
45
51
  footer?: Renderable;
46
52
  /** Width for dialogs; for drawers, the width (left/right) or height (bottom). Default `md`. */
47
53
  size?: ModalSize;
@@ -8,7 +8,7 @@
8
8
  ]
9
9
  },
10
10
  "source": {
11
- "libraryVersion": "2.4.4",
11
+ "libraryVersion": "2.5.0",
12
12
  "files": [
13
13
  "core/format.ts",
14
14
  "core/index.ts",
@@ -21,7 +21,7 @@
21
21
  "react/locale.ts",
22
22
  "react/props.ts"
23
23
  ],
24
- "sourceHash": "sha256:45120dc11be8aafca638f8f6248f83deeb9f98c809140f80fd8c2d2610306371"
24
+ "sourceHash": "sha256:0cb6347602f25bd7c77b8738d9d1ac5216ee1a6ef50b5bf54f34deeb2d914f7b"
25
25
  },
26
26
  "props": [
27
27
  {
@@ -143,7 +143,9 @@
143
143
  "type": "other",
144
144
  "typeText": "ReactNode",
145
145
  "required": false,
146
- "origin": "derived"
146
+ "origin": "derived",
147
+ "description": "A hint under the label, linked as the field's description.",
148
+ "descriptionOrigin": "jsdoc"
147
149
  },
148
150
  {
149
151
  "name": "disabled",
@@ -157,7 +159,9 @@
157
159
  "type": "other",
158
160
  "typeText": "ReactNode",
159
161
  "required": false,
160
- "origin": "derived"
162
+ "origin": "derived",
163
+ "description": "The validation message. Setting it is enough on its own: the field\r\nreads as invalid to assistive technology and the message is announced.",
164
+ "descriptionOrigin": "jsdoc"
161
165
  },
162
166
  {
163
167
  "name": "form",
@@ -217,7 +221,9 @@
217
221
  "type": "other",
218
222
  "typeText": "ReactNode",
219
223
  "required": false,
220
- "origin": "derived"
224
+ "origin": "derived",
225
+ "description": "The field's name, shown above it and linked to it.",
226
+ "descriptionOrigin": "jsdoc"
221
227
  },
222
228
  {
223
229
  "name": "largeStep",
@@ -259,7 +265,9 @@
259
265
  "type": "number",
260
266
  "typeText": "number | undefined",
261
267
  "required": false,
262
- "origin": "derived"
268
+ "origin": "derived",
269
+ "description": "Largest accepted value, applied the same way as `min`.",
270
+ "descriptionOrigin": "jsdoc"
263
271
  },
264
272
  {
265
273
  "name": "maxLength",
@@ -273,7 +281,9 @@
273
281
  "type": "number",
274
282
  "typeText": "number | undefined",
275
283
  "required": false,
276
- "origin": "derived"
284
+ "origin": "derived",
285
+ "description": "Smallest accepted value. By default it is applied on blur rather than on\r\neach keystroke, so the field does not fight someone mid-number — see\r\n`clampBehavior` for `strict` or `none`.",
286
+ "descriptionOrigin": "jsdoc"
277
287
  },
278
288
  {
279
289
  "name": "minLength",
@@ -356,7 +366,9 @@
356
366
  "typeText": "NumberSize | undefined",
357
367
  "required": false,
358
368
  "default": "md",
359
- "origin": "derived"
369
+ "origin": "derived",
370
+ "description": "Default `md`.",
371
+ "descriptionOrigin": "jsdoc"
360
372
  },
361
373
  {
362
374
  "name": "snapToStep",
@@ -531,9 +543,9 @@
531
543
  "safeMutations": {},
532
544
  "examples": [],
533
545
  "coverage": {
534
- "propsTotal": 50,
535
- "propsDescribed": 18,
536
- "describedPct": 36,
546
+ "propsTotal": 24,
547
+ "propsDescribed": 23,
548
+ "describedPct": 96,
537
549
  "authoredSections": [
538
550
  "accessibility"
539
551
  ]
@@ -43,7 +43,13 @@ export interface NumberInputProps
43
43
  defaultValue?: number | null;
44
44
  /** Fires with the parsed number, or `null` when the field is emptied. */
45
45
  onValueChange?(value: number | null): void;
46
+ /**
47
+ * Smallest accepted value. By default it is applied on blur rather than on
48
+ * each keystroke, so the field does not fight someone mid-number — see
49
+ * `clampBehavior` for `strict` or `none`.
50
+ */
46
51
  min?: number;
52
+ /** Largest accepted value, applied the same way as `min`. */
47
53
  max?: number;
48
54
  /** How much one arrow press or stepper button moves. Default 1. */
49
55
  step?: number;
@@ -75,9 +81,16 @@ export interface NumberInputProps
75
81
  selectOnFocus?: boolean;
76
82
  /** A button that empties the field. */
77
83
  clearable?: boolean;
84
+ /** The field's name, shown above it and linked to it. */
78
85
  label?: ReactNode;
86
+ /** A hint under the label, linked as the field's description. */
79
87
  description?: ReactNode;
88
+ /**
89
+ * The validation message. Setting it is enough on its own: the field
90
+ * reads as invalid to assistive technology and the message is announced.
91
+ */
80
92
  error?: ReactNode;
93
+ /** Default `md`. */
81
94
  size?: NumberSize;
82
95
  /** Before the number: a currency symbol, a unit. */
83
96
  leading?: ReactNode;
@@ -8,7 +8,7 @@
8
8
  ]
9
9
  },
10
10
  "source": {
11
- "libraryVersion": "2.4.4",
11
+ "libraryVersion": "2.5.0",
12
12
  "files": [
13
13
  "core/index.ts",
14
14
  "core/types.ts",
@@ -17,7 +17,7 @@
17
17
  "react/locale.ts",
18
18
  "react/props.ts"
19
19
  ],
20
- "sourceHash": "sha256:ac04de47fed41d6ef646920b241371395154173d148a5c5f9a6440ef2f589f6a"
20
+ "sourceHash": "sha256:71722134c43ba8dec7c9139a8c2c84ab4009247f7b8e1699308f6abbc634f278"
21
21
  },
22
22
  "props": [
23
23
  {
@@ -80,14 +80,18 @@
80
80
  "typeText": "boolean | undefined",
81
81
  "required": false,
82
82
  "default": false,
83
- "origin": "derived"
83
+ "origin": "derived",
84
+ "description": "Open to begin with, when you are not controlling `open`.",
85
+ "descriptionOrigin": "jsdoc"
84
86
  },
85
87
  {
86
88
  "name": "description",
87
89
  "type": "other",
88
90
  "typeText": "ReactNode",
89
91
  "required": false,
90
- "origin": "derived"
92
+ "origin": "derived",
93
+ "description": "A line under the title, linked as the panel's description.",
94
+ "descriptionOrigin": "jsdoc"
91
95
  },
92
96
  {
93
97
  "name": "gap",
@@ -118,14 +122,18 @@
118
122
  "type": "function",
119
123
  "signature": "((open: boolean, reason?: PopoverCloseReason) => void) | undefined",
120
124
  "required": false,
121
- "origin": "derived"
125
+ "origin": "derived",
126
+ "description": "`reason` says what closed it - `escape`, `outside`, `trigger` or\r\n`api` - and is undefined when opening.",
127
+ "descriptionOrigin": "jsdoc"
122
128
  },
123
129
  {
124
130
  "name": "open",
125
131
  "type": "boolean",
126
132
  "typeText": "boolean | undefined",
127
133
  "required": false,
128
- "origin": "derived"
134
+ "origin": "derived",
135
+ "description": "Controlled open state.",
136
+ "descriptionOrigin": "jsdoc"
129
137
  },
130
138
  {
131
139
  "name": "ref",
@@ -228,9 +236,9 @@
228
236
  "safeMutations": {},
229
237
  "examples": [],
230
238
  "coverage": {
231
- "propsTotal": 19,
232
- "propsDescribed": 8,
233
- "describedPct": 42,
239
+ "propsTotal": 14,
240
+ "propsDescribed": 12,
241
+ "describedPct": 86,
234
242
  "authoredSections": [
235
243
  "accessibility"
236
244
  ]
@@ -47,11 +47,18 @@ export interface PopoverProps {
47
47
  */
48
48
  trigger: ReactElement<{ ref?: Ref<HTMLElement>; [attribute: string]: unknown }>;
49
49
  children?: ReactNode | ((props: PopoverRenderProps) => ReactNode);
50
+ /** Controlled open state. */
50
51
  open?: boolean;
52
+ /** Open to begin with, when you are not controlling `open`. */
51
53
  defaultOpen?: boolean;
54
+ /**
55
+ * `reason` says what closed it - `escape`, `outside`, `trigger` or
56
+ * `api` - and is undefined when opening.
57
+ */
52
58
  onOpenChange?(open: boolean, reason?: PopoverCloseReason): void;
53
59
  /** Heading inside the panel, which also names it. */
54
60
  title?: ReactNode;
61
+ /** A line under the title, linked as the panel's description. */
55
62
  description?: ReactNode;
56
63
  /** Names the panel when there is no `title`. */
57
64
  "aria-label"?: string;
@@ -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/index.ts",
15
15
  "core/progress.ts",
@@ -260,9 +260,9 @@
260
260
  "safeMutations": {},
261
261
  "examples": [],
262
262
  "coverage": {
263
- "propsTotal": 21,
263
+ "propsTotal": 9,
264
264
  "propsDescribed": 8,
265
- "describedPct": 38,
265
+ "describedPct": 89,
266
266
  "authoredSections": [
267
267
  "accessibility"
268
268
  ]
@@ -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:cd5f36365c184346538fb461f4c4cd8014723621fd4d312cd5f00c415df20618"
25
+ "sourceHash": "sha256:7e13b8cd8a2bab1ee7a89cf691c1dc388951723939ca4a87def57d6301d8aa33"
26
26
  },
27
27
  "props": [
28
28
  {
@@ -106,21 +106,27 @@
106
106
  "typeText": "boolean | undefined",
107
107
  "required": false,
108
108
  "default": false,
109
- "origin": "derived"
109
+ "origin": "derived",
110
+ "description": "Selected to begin with, for a standalone radio you are not controlling.",
111
+ "descriptionOrigin": "jsdoc"
110
112
  },
111
113
  {
112
114
  "name": "defaultValue",
113
115
  "type": "string",
114
116
  "typeText": "string | null | undefined",
115
117
  "required": false,
116
- "origin": "derived"
118
+ "origin": "derived",
119
+ "description": "The choice selected to begin with, when you are not controlling `value`.",
120
+ "descriptionOrigin": "jsdoc"
117
121
  },
118
122
  {
119
123
  "name": "description",
120
124
  "type": "other",
121
125
  "typeText": "ReactNode",
122
126
  "required": false,
123
- "origin": "derived"
127
+ "origin": "derived",
128
+ "description": "A hint under the label, linked as this choice's description.",
129
+ "descriptionOrigin": "jsdoc"
124
130
  },
125
131
  {
126
132
  "name": "disabled",
@@ -135,7 +141,9 @@
135
141
  "type": "other",
136
142
  "typeText": "ReactNode",
137
143
  "required": false,
138
- "origin": "derived"
144
+ "origin": "derived",
145
+ "description": "The validation message for this one choice. A message that applies to the\nwhole question belongs on the RadioGroup instead.",
146
+ "descriptionOrigin": "jsdoc"
139
147
  },
140
148
  {
141
149
  "name": "form",
@@ -180,7 +188,9 @@
180
188
  "type": "other",
181
189
  "typeText": "ReactNode",
182
190
  "required": false,
183
- "origin": "derived"
191
+ "origin": "derived",
192
+ "description": "The text beside the radio. Clicking it selects this choice.",
193
+ "descriptionOrigin": "jsdoc"
184
194
  },
185
195
  {
186
196
  "name": "localeText",
@@ -231,21 +241,27 @@
231
241
  "type": "function",
232
242
  "signature": "ChangeEventHandler<HTMLInputElement> | undefined",
233
243
  "required": false,
234
- "origin": "derived"
244
+ "origin": "derived",
245
+ "description": "The underlying DOM event, for form libraries that want the native\nhandler.",
246
+ "descriptionOrigin": "jsdoc"
235
247
  },
236
248
  {
237
249
  "name": "onCheckedChange",
238
250
  "type": "function",
239
251
  "signature": "((checked: boolean) => void) | undefined",
240
252
  "required": false,
241
- "origin": "derived"
253
+ "origin": "derived",
254
+ "description": "This radio was chosen. Only ever fires with `true`, since choosing\nanother radio deselects this one rather than firing on it — to follow a\ngroup's choice, use `onValueChange` on the RadioGroup.",
255
+ "descriptionOrigin": "jsdoc"
242
256
  },
243
257
  {
244
258
  "name": "onValueChange",
245
259
  "type": "function",
246
260
  "signature": "((value: string | null) => void) | undefined",
247
261
  "required": false,
248
- "origin": "derived"
262
+ "origin": "derived",
263
+ "description": "The chosen value, or `null` when the group was emptied with `clearable`.\r\nThis is the handler to use for a group; the individual radios do not need\r\none.",
264
+ "descriptionOrigin": "jsdoc"
249
265
  },
250
266
  {
251
267
  "name": "options",
@@ -325,7 +341,9 @@
325
341
  ],
326
342
  "typeText": "RadioSize | undefined",
327
343
  "required": false,
328
- "origin": "derived"
344
+ "origin": "derived",
345
+ "description": "Default `md`, or the size of the RadioGroup it sits in.",
346
+ "descriptionOrigin": "jsdoc"
329
347
  },
330
348
  {
331
349
  "name": "step",
@@ -467,9 +485,9 @@
467
485
  "safeMutations": {},
468
486
  "examples": [],
469
487
  "coverage": {
470
- "propsTotal": 44,
471
- "propsDescribed": 8,
472
- "describedPct": 18,
488
+ "propsTotal": 20,
489
+ "propsDescribed": 16,
490
+ "describedPct": 80,
473
491
  "authoredSections": [
474
492
  "accessibility"
475
493
  ]
@@ -26,12 +26,29 @@ export interface RadioProps
26
26
  value: string;
27
27
  /** Selected (controlled). Inside a RadioGroup the group decides instead. */
28
28
  checked?: boolean;
29
+ /** Selected to begin with, for a standalone radio you are not controlling. */
29
30
  defaultChecked?: boolean;
31
+ /**
32
+ * This radio was chosen. Only ever fires with `true`, since choosing
33
+ * another radio deselects this one rather than firing on it — to follow a
34
+ * group's choice, use `onValueChange` on the RadioGroup.
35
+ */
30
36
  onCheckedChange?(checked: boolean): void;
37
+ /**
38
+ * The underlying DOM event, for form libraries that want the native
39
+ * handler.
40
+ */
31
41
  onChange?: ChangeEventHandler<HTMLInputElement>;
42
+ /** The text beside the radio. Clicking it selects this choice. */
32
43
  label?: ReactNode;
44
+ /** A hint under the label, linked as this choice's description. */
33
45
  description?: ReactNode;
46
+ /**
47
+ * The validation message for this one choice. A message that applies to the
48
+ * whole question belongs on the RadioGroup instead.
49
+ */
34
50
  error?: ReactNode;
51
+ /** Default `md`, or the size of the RadioGroup it sits in. */
35
52
  size?: RadioSize;
36
53
  classNames?: Partial<Record<RadioSlot, string>>;
37
54
  /** The `<input>` element. */
@@ -19,19 +19,32 @@ import { cx, type RadioGroupSlot } from "./props";
19
19
  export interface RadioGroupProps {
20
20
  /** The chosen value (controlled). `null` for nothing chosen. */
21
21
  value?: string | null;
22
+ /** The choice selected to begin with, when you are not controlling `value`. */
22
23
  defaultValue?: string | null;
24
+ /**
25
+ * The chosen value, or `null` when the group was emptied with `clearable`.
26
+ * This is the handler to use for a group; the individual radios do not need
27
+ * one.
28
+ */
23
29
  onValueChange?(value: string | null): void;
24
30
  /** Render these choices, or pass `<Radio value="…">` children. Plain strings work too. */
25
31
  options?: readonly (string | RadioOption)[];
26
32
  children?: ReactNode;
27
33
  /** The question the choices answer, shown as the group's legend. */
28
34
  label?: ReactNode;
35
+ /** A hint under the legend, explaining the question rather than one choice. */
29
36
  description?: ReactNode;
37
+ /**
38
+ * The validation message for the question — "choose a plan". Setting it
39
+ * marks every radio in the group invalid and announces the message, so no
40
+ * extra `aria-invalid` is needed.
41
+ */
30
42
  error?: ReactNode;
31
43
  required?: boolean;
32
44
  disabled?: boolean;
33
45
  /** Form field name shared by every radio. One is generated when it is left out. */
34
46
  name?: string;
47
+ /** Default `md`. Each radio inherits it unless it sets its own. */
35
48
  size?: RadioSize;
36
49
  /** Default `vertical`. */
37
50
  orientation?: RadioOrientation;
@@ -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/index.ts",
15
15
  "core/lines.ts",
@@ -19,7 +19,7 @@
19
19
  "react/Skeleton.tsx",
20
20
  "react/props.ts"
21
21
  ],
22
- "sourceHash": "sha256:e5c3bcb487c25092a77daec5c55f726d39ac8cf4f3628141cb6777053af6b01f"
22
+ "sourceHash": "sha256:c43f854a600cef0e2704513508c60910dbe3938df4b33ec6f2f614b8743055b3"
23
23
  },
24
24
  "props": [
25
25
  {
@@ -74,7 +74,9 @@
74
74
  "type": "other",
75
75
  "typeText": "string | number | undefined",
76
76
  "required": false,
77
- "origin": "derived"
77
+ "origin": "derived",
78
+ "description": "A number is pixels; a string is used as given. Left out, each variant\nuses its own height, which is what keeps a skeleton the size of the\nthing it stands in for.",
79
+ "descriptionOrigin": "jsdoc"
78
80
  },
79
81
  {
80
82
  "name": "icon",
@@ -241,9 +243,9 @@
241
243
  "safeMutations": {},
242
244
  "examples": [],
243
245
  "coverage": {
244
- "propsTotal": 17,
245
- "propsDescribed": 12,
246
- "describedPct": 71,
246
+ "propsTotal": 13,
247
+ "propsDescribed": 13,
248
+ "describedPct": 100,
247
249
  "authoredSections": [
248
250
  "accessibility"
249
251
  ]
@@ -14,6 +14,11 @@ export interface SkeletonProps {
14
14
  lastLineWidth?: number;
15
15
  /** A number is pixels; a string is used as given. */
16
16
  width?: number | string;
17
+ /**
18
+ * A number is pixels; a string is used as given. Left out, each variant
19
+ * uses its own height, which is what keeps a skeleton the size of the
20
+ * thing it stands in for.
21
+ */
17
22
  height?: number | string;
18
23
  /** Corner radius for `rect`. */
19
24
  radius?: number | string;
@@ -8,7 +8,7 @@
8
8
  ]
9
9
  },
10
10
  "source": {
11
- "libraryVersion": "2.4.4",
11
+ "libraryVersion": "2.5.0",
12
12
  "files": [
13
13
  "core/index.ts",
14
14
  "core/types.ts",
@@ -235,9 +235,9 @@
235
235
  "safeMutations": {},
236
236
  "examples": [],
237
237
  "coverage": {
238
- "propsTotal": 20,
238
+ "propsTotal": 8,
239
239
  "propsDescribed": 8,
240
- "describedPct": 40,
240
+ "describedPct": 100,
241
241
  "authoredSections": [
242
242
  "accessibility"
243
243
  ]
@@ -8,7 +8,7 @@
8
8
  ]
9
9
  },
10
10
  "source": {
11
- "libraryVersion": "2.4.4",
11
+ "libraryVersion": "2.5.0",
12
12
  "files": [
13
13
  "core/index.ts",
14
14
  "core/toggle.ts",
@@ -18,7 +18,7 @@
18
18
  "react/locale.ts",
19
19
  "react/props.ts"
20
20
  ],
21
- "sourceHash": "sha256:d96a8af61a18c077beccad85f49d1a25f1e20091aede0182c852f7f36ee9254a"
21
+ "sourceHash": "sha256:b2007da7ec91cbad6bd7697048cc205d22e8b94035482a9f631a75e9dabfd0e4"
22
22
  },
23
23
  "props": [
24
24
  {
@@ -85,7 +85,9 @@
85
85
  "typeText": "boolean | undefined",
86
86
  "required": false,
87
87
  "default": false,
88
- "origin": "derived"
88
+ "origin": "derived",
89
+ "description": "The starting state when you are not controlling `checked`.",
90
+ "descriptionOrigin": "jsdoc"
89
91
  },
90
92
  {
91
93
  "name": "defaultValue",
@@ -99,7 +101,9 @@
99
101
  "type": "other",
100
102
  "typeText": "ReactNode",
101
103
  "required": false,
102
- "origin": "derived"
104
+ "origin": "derived",
105
+ "description": "A hint under the label, linked as the switch's description.",
106
+ "descriptionOrigin": "jsdoc"
103
107
  },
104
108
  {
105
109
  "name": "disabled",
@@ -113,7 +117,9 @@
113
117
  "type": "other",
114
118
  "typeText": "ReactNode",
115
119
  "required": false,
116
- "origin": "derived"
120
+ "origin": "derived",
121
+ "description": "The validation message. Setting it is enough on its own: the switch reads\r\nas invalid to assistive technology and the message is announced, so no\r\nextra `aria-invalid` is needed.",
122
+ "descriptionOrigin": "jsdoc"
117
123
  },
118
124
  {
119
125
  "name": "form",
@@ -158,7 +164,9 @@
158
164
  "type": "other",
159
165
  "typeText": "ReactNode",
160
166
  "required": false,
161
- "origin": "derived"
167
+ "origin": "derived",
168
+ "description": "The text beside the track. Clicking it flips the switch.",
169
+ "descriptionOrigin": "jsdoc"
162
170
  },
163
171
  {
164
172
  "name": "labelPosition",
@@ -231,7 +239,9 @@
231
239
  "type": "function",
232
240
  "signature": "ChangeEventHandler<HTMLInputElement> | undefined",
233
241
  "required": false,
234
- "origin": "derived"
242
+ "origin": "derived",
243
+ "description": "The underlying DOM event, for form libraries that want the native\r\nhandler. For the new state, and for the async behaviour above, use\r\n`onCheckedChange`.",
244
+ "descriptionOrigin": "jsdoc"
235
245
  },
236
246
  {
237
247
  "name": "onCheckedChange",
@@ -290,7 +300,9 @@
290
300
  "typeText": "SwitchSize | undefined",
291
301
  "required": false,
292
302
  "default": "md",
293
- "origin": "derived"
303
+ "origin": "derived",
304
+ "description": "Default `md`.",
305
+ "descriptionOrigin": "jsdoc"
294
306
  },
295
307
  {
296
308
  "name": "step",
@@ -411,9 +423,9 @@
411
423
  "safeMutations": {},
412
424
  "examples": [],
413
425
  "coverage": {
414
- "propsTotal": 39,
415
- "propsDescribed": 6,
416
- "describedPct": 15,
426
+ "propsTotal": 11,
427
+ "propsDescribed": 11,
428
+ "describedPct": 100,
417
429
  "authoredSections": [
418
430
  "accessibility"
419
431
  ]
@@ -27,6 +27,7 @@ export interface SwitchProps
27
27
  > {
28
28
  /** On or off (controlled). */
29
29
  checked?: boolean;
30
+ /** The starting state when you are not controlling `checked`. */
30
31
  defaultChecked?: boolean;
31
32
  /**
32
33
  * Fires with the new state. Return a promise and the switch stays on the new
@@ -34,12 +35,25 @@ export interface SwitchProps
34
35
  * it rejects — see [Saving](#saving).
35
36
  */
36
37
  onCheckedChange?(checked: boolean): void | Promise<unknown>;
38
+ /**
39
+ * The underlying DOM event, for form libraries that want the native
40
+ * handler. For the new state, and for the async behaviour above, use
41
+ * `onCheckedChange`.
42
+ */
37
43
  onChange?: ChangeEventHandler<HTMLInputElement>;
38
44
  /** Posted with the form when the switch is on. Default `"on"`, as for a checkbox. */
39
45
  value?: string;
46
+ /** The text beside the track. Clicking it flips the switch. */
40
47
  label?: ReactNode;
48
+ /** A hint under the label, linked as the switch's description. */
41
49
  description?: ReactNode;
50
+ /**
51
+ * The validation message. Setting it is enough on its own: the switch reads
52
+ * as invalid to assistive technology and the message is announced, so no
53
+ * extra `aria-invalid` is needed.
54
+ */
42
55
  error?: ReactNode;
56
+ /** Default `md`. */
43
57
  size?: SwitchSize;
44
58
  /** Default `end`: the label after the track. `start` puts the track on the right, for settings rows. */
45
59
  labelPosition?: SwitchLabelPosition;