@handamade/psi-react 0.25.0 → 0.27.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/README.md +23 -1
- package/dist/Checkbox/Checkbox.d.ts +11 -2
- package/dist/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/Dialog/Dialog.d.ts +17 -3
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Field/Field.d.ts +3 -0
- package/dist/Field/Field.d.ts.map +1 -1
- package/dist/Menu/Menu.d.ts +11 -2
- package/dist/Menu/Menu.d.ts.map +1 -1
- package/dist/Menu/useMenuKeyboard.d.ts +5 -1
- package/dist/Menu/useMenuKeyboard.d.ts.map +1 -1
- package/dist/RadioGroup/Radio.d.ts +17 -0
- package/dist/RadioGroup/Radio.d.ts.map +1 -0
- package/dist/RadioGroup/RadioGroup.d.ts +40 -0
- package/dist/RadioGroup/RadioGroup.d.ts.map +1 -0
- package/dist/Stack/Stack.d.ts +19 -0
- package/dist/Stack/Stack.d.ts.map +1 -0
- package/dist/Table/TableSelectionCell.d.ts.map +1 -1
- package/dist/Text/Text.d.ts +24 -0
- package/dist/Text/Text.d.ts.map +1 -0
- package/dist/Textarea/Textarea.d.ts +25 -0
- package/dist/Textarea/Textarea.d.ts.map +1 -0
- package/dist/Tooltip/Tooltip.d.ts +1 -1
- package/dist/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/a11y-meta.d.ts.map +1 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1393 -1188
- package/dist/manifest.json +345 -5
- package/dist/patterns.json +153 -6
- package/dist/styles.css +1 -1
- package/docs/Checkbox.md +2 -1
- package/docs/Dialog.md +5 -2
- package/docs/Menu.md +4 -1
- package/docs/Radio.md +40 -0
- package/docs/RadioGroup.md +46 -0
- package/docs/Stack.md +40 -0
- package/docs/Text.md +42 -0
- package/docs/Textarea.md +43 -0
- package/docs/Tooltip.md +1 -1
- package/llms.txt +12 -5
- package/package.json +2 -2
package/dist/manifest.json
CHANGED
|
@@ -231,6 +231,118 @@
|
|
|
231
231
|
}
|
|
232
232
|
]
|
|
233
233
|
},
|
|
234
|
+
{
|
|
235
|
+
"name": "Stack",
|
|
236
|
+
"description": "A column with a gap from the space scale (D109): Toolbar's vertical counterpart, minus the wrap. A plain <div> with no role. It gives a pattern tree a layout context, which Panel and the psi-gap-* utilities do not.",
|
|
237
|
+
"slots": [
|
|
238
|
+
{
|
|
239
|
+
"name": "body",
|
|
240
|
+
"accepts": {},
|
|
241
|
+
"cardinality": "0..*",
|
|
242
|
+
"order": 1
|
|
243
|
+
}
|
|
244
|
+
],
|
|
245
|
+
"props": [
|
|
246
|
+
{
|
|
247
|
+
"name": "children",
|
|
248
|
+
"type": "ReactNode",
|
|
249
|
+
"required": false,
|
|
250
|
+
"default": null,
|
|
251
|
+
"description": "Stack contents, laid out top to bottom."
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"name": "gap",
|
|
255
|
+
"type": "4 | 8 | 12 | 16 | 24 | 32",
|
|
256
|
+
"required": false,
|
|
257
|
+
"default": 16,
|
|
258
|
+
"description": "Space between children in px, from the space scale."
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
"name": "align",
|
|
262
|
+
"type": "\"stretch\" | \"start\" | \"center\" | \"end\"",
|
|
263
|
+
"required": false,
|
|
264
|
+
"default": "stretch",
|
|
265
|
+
"description": "Cross-axis alignment. `stretch` (the default) makes each child full\nwidth; `start` keeps a Button or a short line at its own width."
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"name": "ref",
|
|
269
|
+
"type": "Ref<HTMLDivElement>",
|
|
270
|
+
"required": false,
|
|
271
|
+
"default": null,
|
|
272
|
+
"description": "Forwarded ref to the root element."
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"name": "className",
|
|
276
|
+
"type": "string",
|
|
277
|
+
"required": false,
|
|
278
|
+
"default": null,
|
|
279
|
+
"description": "Additional CSS class name(s) merged onto the component's root element."
|
|
280
|
+
}
|
|
281
|
+
]
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"name": "Text",
|
|
285
|
+
"description": "A line or paragraph of text at one of Psi's text styles (D109). It gives a pattern tree an element per line, so a headline and its explanation do not run together. Margin 0: a Stack's gap does the spacing.",
|
|
286
|
+
"slots": [
|
|
287
|
+
{
|
|
288
|
+
"name": "body",
|
|
289
|
+
"accepts": {},
|
|
290
|
+
"cardinality": "0..*",
|
|
291
|
+
"order": 1
|
|
292
|
+
}
|
|
293
|
+
],
|
|
294
|
+
"props": [
|
|
295
|
+
{
|
|
296
|
+
"name": "children",
|
|
297
|
+
"type": "ReactNode",
|
|
298
|
+
"required": false,
|
|
299
|
+
"default": null,
|
|
300
|
+
"description": "The text."
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
"name": "as",
|
|
304
|
+
"type": "\"p\" | \"span\" | \"div\" | \"h2\" | \"h3\" | \"h4\"",
|
|
305
|
+
"required": false,
|
|
306
|
+
"default": "p",
|
|
307
|
+
"description": "The element. A heading's level follows the document outline, its size\nthe design, so `as` and `size` are separate."
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
"name": "size",
|
|
311
|
+
"type": "12 | 14 | 16 | 18",
|
|
312
|
+
"required": false,
|
|
313
|
+
"default": 14,
|
|
314
|
+
"description": "Font size in px; each size carries its own line height."
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"name": "weight",
|
|
318
|
+
"type": "\"regular\" | \"medium\"",
|
|
319
|
+
"required": false,
|
|
320
|
+
"default": "regular",
|
|
321
|
+
"description": ""
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
"name": "tone",
|
|
325
|
+
"type": "\"primary\" | \"secondary\"",
|
|
326
|
+
"required": false,
|
|
327
|
+
"default": "primary",
|
|
328
|
+
"description": "`secondary` for supporting text."
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
"name": "ref",
|
|
332
|
+
"type": "Ref<HTMLElement>",
|
|
333
|
+
"required": false,
|
|
334
|
+
"default": null,
|
|
335
|
+
"description": "Forwarded ref to the element."
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"name": "className",
|
|
339
|
+
"type": "string",
|
|
340
|
+
"required": false,
|
|
341
|
+
"default": null,
|
|
342
|
+
"description": "Additional CSS class name(s) merged onto the component's root element."
|
|
343
|
+
}
|
|
344
|
+
]
|
|
345
|
+
},
|
|
234
346
|
{
|
|
235
347
|
"name": "DescriptionList",
|
|
236
348
|
"description": "Key/value display (D70): a `<dl>` of term/value pairs, the body `detail-drawer` has always described and never had a component for. No `size` prop — this is type, and the type scale is already expressed by --psi-text-*. Consumers restyle via the token family, not a prop.",
|
|
@@ -602,7 +714,28 @@
|
|
|
602
714
|
"type": "boolean",
|
|
603
715
|
"required": false,
|
|
604
716
|
"default": true,
|
|
605
|
-
"description": "false = no close button, Esc and backdrop swallowed — footer is the only exit."
|
|
717
|
+
"description": "false = no close button, Esc and backdrop swallowed — footer is the only exit.\n`closeOnEscape` can give Escape back on its own (D101)."
|
|
718
|
+
},
|
|
719
|
+
{
|
|
720
|
+
"name": "closeOnEscape",
|
|
721
|
+
"type": "boolean",
|
|
722
|
+
"required": false,
|
|
723
|
+
"default": "dismissible",
|
|
724
|
+
"description": "Whether Escape reports onClose(\"esc\"), separately from the close button\nand the backdrop (D101). A consequential confirmation is\n`dismissible={false} closeOnEscape`: no close button, no backdrop\ndismissal, and Escape cancels."
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
"name": "initialFocus",
|
|
728
|
+
"type": "RefObject<HTMLElement | null>",
|
|
729
|
+
"required": false,
|
|
730
|
+
"default": null,
|
|
731
|
+
"description": "The element to focus each time the dialog opens, after the platform's own\nfocusing (D101), e.g. a ref to the footer's Cancel button. Without it, the\nplatform focuses the first focusable control, as before."
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
"name": "closeLabel",
|
|
735
|
+
"type": "string",
|
|
736
|
+
"required": false,
|
|
737
|
+
"default": null,
|
|
738
|
+
"description": "Visible text for the close button (D101). When set, the close button is a\nghost Button with this text instead of the icon-only \"Close dialog\"\nbutton."
|
|
606
739
|
},
|
|
607
740
|
{
|
|
608
741
|
"name": "ref",
|
|
@@ -622,7 +755,7 @@
|
|
|
622
755
|
},
|
|
623
756
|
{
|
|
624
757
|
"name": "Checkbox",
|
|
625
|
-
"description": "Native checkbox with a built-in label; for independent binary choices.",
|
|
758
|
+
"description": "Native checkbox with a built-in label; for independent binary choices. In an invalid group Field it is aria-invalid, and an unchecked box marked aria-invalid outlines in the error colour (D108).",
|
|
626
759
|
"slots": [],
|
|
627
760
|
"props": [
|
|
628
761
|
{
|
|
@@ -639,6 +772,13 @@
|
|
|
639
772
|
"default": null,
|
|
640
773
|
"description": "Accessible name when there is no visible label — a table's row-selection\ncheckbox, say. Optional, unlike IconButton's required form (D60): a\nlabelled checkbox is still the common case."
|
|
641
774
|
},
|
|
775
|
+
{
|
|
776
|
+
"name": "indeterminate",
|
|
777
|
+
"type": "boolean",
|
|
778
|
+
"required": false,
|
|
779
|
+
"default": null,
|
|
780
|
+
"description": "The mixed state, e.g. a \"select all\" over a partial selection (D103).\nSets the input's DOM property, which the platform exposes as\naria-checked=\"mixed\", and draws a dash. Re-applied on every render,\nbecause a click clears the property before the consumer re-renders.\nWhen absent, the property is left alone, so a state set through the ref\nsurvives."
|
|
781
|
+
},
|
|
642
782
|
{
|
|
643
783
|
"name": "ref",
|
|
644
784
|
"type": "Ref<HTMLInputElement>",
|
|
@@ -683,6 +823,199 @@
|
|
|
683
823
|
}
|
|
684
824
|
]
|
|
685
825
|
},
|
|
826
|
+
{
|
|
827
|
+
"name": "Textarea",
|
|
828
|
+
"description": "Multi-line text input (D104): the Input recipe on a native `<textarea>`. Inside a Field, id/aria-describedby/aria-invalid/required are wired as for Input (D49). `minLength` and `maxLength` are the native attributes. With `maxLength`, a counter under the control shows the length; it is not a live region (a count spoken on every keystroke is noise) and joins aria-describedby, so it is read with the field on focus.",
|
|
829
|
+
"slots": [],
|
|
830
|
+
"props": [
|
|
831
|
+
{
|
|
832
|
+
"name": "rows",
|
|
833
|
+
"type": "number",
|
|
834
|
+
"required": false,
|
|
835
|
+
"default": 3,
|
|
836
|
+
"description": "Visible rows. A textarea's height is its rows; there is no `size`."
|
|
837
|
+
},
|
|
838
|
+
{
|
|
839
|
+
"name": "minLength",
|
|
840
|
+
"type": "number",
|
|
841
|
+
"required": false,
|
|
842
|
+
"default": null,
|
|
843
|
+
"description": "Native minimum length, reported by constraint validation."
|
|
844
|
+
},
|
|
845
|
+
{
|
|
846
|
+
"name": "maxLength",
|
|
847
|
+
"type": "number",
|
|
848
|
+
"required": false,
|
|
849
|
+
"default": null,
|
|
850
|
+
"description": "Native maximum length, enforced while typing. With it, the counter shows\n`{length} / {maxLength}` unless `showCounter={false}`."
|
|
851
|
+
},
|
|
852
|
+
{
|
|
853
|
+
"name": "error",
|
|
854
|
+
"type": "boolean",
|
|
855
|
+
"required": false,
|
|
856
|
+
"default": false,
|
|
857
|
+
"description": "Show error styling. Inside a Field, the Field's error also lights this."
|
|
858
|
+
},
|
|
859
|
+
{
|
|
860
|
+
"name": "showCounter",
|
|
861
|
+
"type": "boolean",
|
|
862
|
+
"required": false,
|
|
863
|
+
"default": true,
|
|
864
|
+
"description": "With `maxLength`, show the `{length} / {maxLength}` counter under the\ncontrol. It is not a live region; it describes the textarea."
|
|
865
|
+
},
|
|
866
|
+
{
|
|
867
|
+
"name": "ref",
|
|
868
|
+
"type": "Ref<HTMLTextAreaElement>",
|
|
869
|
+
"required": false,
|
|
870
|
+
"default": null,
|
|
871
|
+
"description": "Forwarded ref to the underlying `<textarea>` element."
|
|
872
|
+
},
|
|
873
|
+
{
|
|
874
|
+
"name": "placeholder",
|
|
875
|
+
"type": "string",
|
|
876
|
+
"required": false,
|
|
877
|
+
"default": null,
|
|
878
|
+
"description": "Native placeholder text shown while the field is empty (only on components whose host element supports it)."
|
|
879
|
+
},
|
|
880
|
+
{
|
|
881
|
+
"name": "className",
|
|
882
|
+
"type": "string",
|
|
883
|
+
"required": false,
|
|
884
|
+
"default": null,
|
|
885
|
+
"description": "Additional CSS class name(s) merged onto the component's root element."
|
|
886
|
+
}
|
|
887
|
+
]
|
|
888
|
+
},
|
|
889
|
+
{
|
|
890
|
+
"name": "RadioGroup",
|
|
891
|
+
"description": "A set of native radios sharing one name (D104). The browser supplies the keyboard: Tab enters on the checked radio, and the arrows move and select. Inside `Field group` the fieldset and legend form and name the group, so this adds no role; standalone it is `role=\"radiogroup\"` and needs `aria-label` or `aria-labelledby`. A required or invalid Field makes every radio `required` and `aria-invalid`.",
|
|
892
|
+
"slots": [
|
|
893
|
+
{
|
|
894
|
+
"name": "body",
|
|
895
|
+
"accepts": {
|
|
896
|
+
"components": [
|
|
897
|
+
"Radio"
|
|
898
|
+
]
|
|
899
|
+
},
|
|
900
|
+
"cardinality": "1..*",
|
|
901
|
+
"order": 1
|
|
902
|
+
}
|
|
903
|
+
],
|
|
904
|
+
"props": [
|
|
905
|
+
{
|
|
906
|
+
"name": "children",
|
|
907
|
+
"type": "ReactNode",
|
|
908
|
+
"required": false,
|
|
909
|
+
"default": null,
|
|
910
|
+
"description": "`Radio` children."
|
|
911
|
+
},
|
|
912
|
+
{
|
|
913
|
+
"name": "name",
|
|
914
|
+
"type": "string",
|
|
915
|
+
"required": false,
|
|
916
|
+
"default": null,
|
|
917
|
+
"description": "The radios' shared `name`. Generated when absent."
|
|
918
|
+
},
|
|
919
|
+
{
|
|
920
|
+
"name": "value",
|
|
921
|
+
"type": "string",
|
|
922
|
+
"required": false,
|
|
923
|
+
"default": null,
|
|
924
|
+
"description": "The selected value (controlled)."
|
|
925
|
+
},
|
|
926
|
+
{
|
|
927
|
+
"name": "defaultValue",
|
|
928
|
+
"type": "string",
|
|
929
|
+
"required": false,
|
|
930
|
+
"default": null,
|
|
931
|
+
"description": "The initially selected value (uncontrolled)."
|
|
932
|
+
},
|
|
933
|
+
{
|
|
934
|
+
"name": "onValueChange",
|
|
935
|
+
"type": "((value: string) => void)",
|
|
936
|
+
"required": false,
|
|
937
|
+
"default": null,
|
|
938
|
+
"description": "Called with the value of the radio the user selects."
|
|
939
|
+
},
|
|
940
|
+
{
|
|
941
|
+
"name": "disabled",
|
|
942
|
+
"type": "boolean",
|
|
943
|
+
"required": false,
|
|
944
|
+
"default": false,
|
|
945
|
+
"description": "Disables every radio in the group."
|
|
946
|
+
},
|
|
947
|
+
{
|
|
948
|
+
"name": "orientation",
|
|
949
|
+
"type": "\"vertical\" | \"horizontal\"",
|
|
950
|
+
"required": false,
|
|
951
|
+
"default": "vertical",
|
|
952
|
+
"description": "Stack the radios, or lay them in a row."
|
|
953
|
+
},
|
|
954
|
+
{
|
|
955
|
+
"name": "aria-label",
|
|
956
|
+
"type": "string",
|
|
957
|
+
"required": false,
|
|
958
|
+
"default": null,
|
|
959
|
+
"description": "Accessible name when the group stands alone. Inside `Field group` the\nlegend names the group instead."
|
|
960
|
+
},
|
|
961
|
+
{
|
|
962
|
+
"name": "ref",
|
|
963
|
+
"type": "Ref<HTMLDivElement>",
|
|
964
|
+
"required": false,
|
|
965
|
+
"default": null,
|
|
966
|
+
"description": "Forwarded ref to the root element."
|
|
967
|
+
},
|
|
968
|
+
{
|
|
969
|
+
"name": "className",
|
|
970
|
+
"type": "string",
|
|
971
|
+
"required": false,
|
|
972
|
+
"default": null,
|
|
973
|
+
"description": "Additional CSS class name(s) merged onto the component's root element."
|
|
974
|
+
}
|
|
975
|
+
]
|
|
976
|
+
},
|
|
977
|
+
{
|
|
978
|
+
"name": "Radio",
|
|
979
|
+
"description": "One choice in a RadioGroup (D104): a native radio with a built-in label, drawn like Checkbox on a circle. Takes its name, checked state, required and aria-invalid from the group.",
|
|
980
|
+
"slots": [],
|
|
981
|
+
"props": [
|
|
982
|
+
{
|
|
983
|
+
"name": "value",
|
|
984
|
+
"type": "string",
|
|
985
|
+
"required": true,
|
|
986
|
+
"default": null,
|
|
987
|
+
"description": "The value this radio selects."
|
|
988
|
+
},
|
|
989
|
+
{
|
|
990
|
+
"name": "children",
|
|
991
|
+
"type": "ReactNode",
|
|
992
|
+
"required": false,
|
|
993
|
+
"default": null,
|
|
994
|
+
"description": "Label text."
|
|
995
|
+
},
|
|
996
|
+
{
|
|
997
|
+
"name": "disabled",
|
|
998
|
+
"type": "boolean",
|
|
999
|
+
"required": false,
|
|
1000
|
+
"default": null,
|
|
1001
|
+
"description": "Disables this radio; a disabled RadioGroup disables all of them."
|
|
1002
|
+
},
|
|
1003
|
+
{
|
|
1004
|
+
"name": "className",
|
|
1005
|
+
"type": "string",
|
|
1006
|
+
"required": false,
|
|
1007
|
+
"default": null,
|
|
1008
|
+
"description": "Additional CSS class name(s) merged onto the component's root element."
|
|
1009
|
+
},
|
|
1010
|
+
{
|
|
1011
|
+
"name": "ref",
|
|
1012
|
+
"type": "Ref<HTMLInputElement>",
|
|
1013
|
+
"required": false,
|
|
1014
|
+
"default": null,
|
|
1015
|
+
"description": "Forwarded ref to the underlying `<input type=\"radio\">` element."
|
|
1016
|
+
}
|
|
1017
|
+
]
|
|
1018
|
+
},
|
|
686
1019
|
{
|
|
687
1020
|
"name": "Tag",
|
|
688
1021
|
"description": "Compact label for status or category; semantic variants, optional subtle tint and dismiss button.",
|
|
@@ -805,7 +1138,7 @@
|
|
|
805
1138
|
"type": "ReactElement<Record<string, unknown>, string | JSXElementConstructor<any>>",
|
|
806
1139
|
"required": true,
|
|
807
1140
|
"default": null,
|
|
808
|
-
"description": "The trigger element (must accept
|
|
1141
|
+
"description": "The trigger element (must accept onFocus/Blur)."
|
|
809
1142
|
},
|
|
810
1143
|
{
|
|
811
1144
|
"name": "placement",
|
|
@@ -1243,10 +1576,10 @@
|
|
|
1243
1576
|
},
|
|
1244
1577
|
{
|
|
1245
1578
|
"name": "onClose",
|
|
1246
|
-
"type": "(reason:
|
|
1579
|
+
"type": "(reason: MenuCloseReason) => void",
|
|
1247
1580
|
"required": true,
|
|
1248
1581
|
"default": null,
|
|
1249
|
-
"description": "Called when a dismissal is *requested*; the consumer flips `open`.\n\nMenu never closes itself on `\"esc\"` or `\"item-select\"` — the popover stays\nopen until `open` becomes false (D50). `\"outside\"` is the one exception:\nlight dismiss is performed by the browser before it tells us, so by the\ntime that reason is reported the popover is already closed. Flipping\n`open` to false is still required, to keep React's state in step.\n\nInvariant (D58): a dismissal is only ever reported for a menu that is\ncurrently open according to its own `open` prop. The platform can close\nan auto popover before the consumer's state catches up — clicking another\nmenu's trigger light-dismisses this one before the consumer's click\nhandler runs — and a report for an already-closed menu would clear a\nselection that has since moved on."
|
|
1582
|
+
"description": "Called when a dismissal is *requested*; the consumer flips `open`.\n\nMenu never closes itself on `\"esc\"` or `\"item-select\"` — the popover stays\nopen until `open` becomes false (D50). `\"outside\"` is the one exception:\nlight dismiss is performed by the browser before it tells us, so by the\ntime that reason is reported the popover is already closed. Flipping\n`open` to false is still required, to keep React's state in step.\n\nInvariant (D58): a dismissal is only ever reported for a menu that is\ncurrently open according to its own `open` prop. The platform can close\nan auto popover before the consumer's state catches up — clicking another\nmenu's trigger light-dismisses this one before the consumer's click\nhandler runs — and a report for an already-closed menu would clear a\nselection that has since moved on.\n\n`\"tab\"` (D102): Tab or Shift Tab inside the open menu. Focus moves on to\nthe next control as the browser moves it; the consumer flips `open`."
|
|
1250
1583
|
},
|
|
1251
1584
|
{
|
|
1252
1585
|
"name": "trigger",
|
|
@@ -1262,6 +1595,13 @@
|
|
|
1262
1595
|
"default": "bottom-start",
|
|
1263
1596
|
"description": "Placement relative to the trigger."
|
|
1264
1597
|
},
|
|
1598
|
+
{
|
|
1599
|
+
"name": "id",
|
|
1600
|
+
"type": "string",
|
|
1601
|
+
"required": false,
|
|
1602
|
+
"default": null,
|
|
1603
|
+
"description": "The menu element's id, which the trigger's `aria-controls` names (D102).\nGenerated when absent."
|
|
1604
|
+
},
|
|
1265
1605
|
{
|
|
1266
1606
|
"name": "aria-label",
|
|
1267
1607
|
"type": "string",
|
package/dist/patterns.json
CHANGED
|
@@ -846,14 +846,39 @@
|
|
|
846
846
|
},
|
|
847
847
|
"slots": {
|
|
848
848
|
"body": [
|
|
849
|
-
"{content:headline}",
|
|
850
|
-
"{content:explanation}",
|
|
851
849
|
{
|
|
852
|
-
"component": "
|
|
850
|
+
"component": "Stack",
|
|
853
851
|
"props": {
|
|
854
|
-
"
|
|
852
|
+
"gap": 8,
|
|
853
|
+
"align": "start"
|
|
855
854
|
},
|
|
856
|
-
"
|
|
855
|
+
"slots": {
|
|
856
|
+
"body": [
|
|
857
|
+
{
|
|
858
|
+
"component": "Text",
|
|
859
|
+
"props": {
|
|
860
|
+
"as": "h3",
|
|
861
|
+
"size": 16,
|
|
862
|
+
"weight": "medium"
|
|
863
|
+
},
|
|
864
|
+
"content": "headline"
|
|
865
|
+
},
|
|
866
|
+
{
|
|
867
|
+
"component": "Text",
|
|
868
|
+
"props": {
|
|
869
|
+
"tone": "secondary"
|
|
870
|
+
},
|
|
871
|
+
"content": "explanation"
|
|
872
|
+
},
|
|
873
|
+
{
|
|
874
|
+
"component": "Button",
|
|
875
|
+
"props": {
|
|
876
|
+
"variant": "neutral"
|
|
877
|
+
},
|
|
878
|
+
"content": "reset-label"
|
|
879
|
+
}
|
|
880
|
+
]
|
|
881
|
+
}
|
|
857
882
|
}
|
|
858
883
|
]
|
|
859
884
|
}
|
|
@@ -866,7 +891,129 @@
|
|
|
866
891
|
},
|
|
867
892
|
"gaps": [],
|
|
868
893
|
"blocked": false,
|
|
869
|
-
"preset": "<Panel\n padding={24}\n>\n [nothing matches these filters]\
|
|
894
|
+
"preset": "<Panel\n padding={24}\n>\n <Stack\n align=\"start\"\n gap={8}\n >\n <Text as=\"h3\" size={16} weight=\"medium\">[nothing matches these filters]</Text>\n <Text tone=\"secondary\">[say whether the dataset is empty or the filters are too narrow]</Text>\n <Button variant=\"neutral\">Clear filters</Button>\n </Stack>\n</Panel>\n"
|
|
895
|
+
},
|
|
896
|
+
{
|
|
897
|
+
"id": "feedback-form",
|
|
898
|
+
"intent": "A short report form: a required choice of category as radios, a bounded description with a length counter, and a submit button",
|
|
899
|
+
"match": [
|
|
900
|
+
"feedback form",
|
|
901
|
+
"report a problem",
|
|
902
|
+
"radio buttons",
|
|
903
|
+
"text area",
|
|
904
|
+
"character counter"
|
|
905
|
+
],
|
|
906
|
+
"compose": {
|
|
907
|
+
"component": "Panel",
|
|
908
|
+
"props": {
|
|
909
|
+
"padding": 24
|
|
910
|
+
},
|
|
911
|
+
"slots": {
|
|
912
|
+
"body": [
|
|
913
|
+
{
|
|
914
|
+
"component": "Stack",
|
|
915
|
+
"props": {
|
|
916
|
+
"gap": 24
|
|
917
|
+
},
|
|
918
|
+
"slots": {
|
|
919
|
+
"body": [
|
|
920
|
+
{
|
|
921
|
+
"component": "Field",
|
|
922
|
+
"props": {
|
|
923
|
+
"group": true,
|
|
924
|
+
"required": true,
|
|
925
|
+
"requiredText": "(Required)"
|
|
926
|
+
},
|
|
927
|
+
"slots": {
|
|
928
|
+
"label": [
|
|
929
|
+
"{content:category-label}"
|
|
930
|
+
],
|
|
931
|
+
"body": [
|
|
932
|
+
{
|
|
933
|
+
"component": "RadioGroup",
|
|
934
|
+
"slots": {
|
|
935
|
+
"body": [
|
|
936
|
+
{
|
|
937
|
+
"component": "Radio",
|
|
938
|
+
"props": {
|
|
939
|
+
"value": "problem"
|
|
940
|
+
},
|
|
941
|
+
"content": "first-option"
|
|
942
|
+
},
|
|
943
|
+
{
|
|
944
|
+
"component": "Radio",
|
|
945
|
+
"props": {
|
|
946
|
+
"value": "idea"
|
|
947
|
+
},
|
|
948
|
+
"content": "second-option"
|
|
949
|
+
},
|
|
950
|
+
{
|
|
951
|
+
"component": "Radio",
|
|
952
|
+
"props": {
|
|
953
|
+
"value": "other"
|
|
954
|
+
},
|
|
955
|
+
"content": "third-option"
|
|
956
|
+
}
|
|
957
|
+
]
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
]
|
|
961
|
+
}
|
|
962
|
+
},
|
|
963
|
+
{
|
|
964
|
+
"component": "Field",
|
|
965
|
+
"slots": {
|
|
966
|
+
"label": [
|
|
967
|
+
"{content:description-label}"
|
|
968
|
+
],
|
|
969
|
+
"body": [
|
|
970
|
+
{
|
|
971
|
+
"component": "Textarea",
|
|
972
|
+
"props": {
|
|
973
|
+
"maxLength": 500,
|
|
974
|
+
"rows": 4
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
],
|
|
978
|
+
"description": [
|
|
979
|
+
"{content:description-help}"
|
|
980
|
+
]
|
|
981
|
+
}
|
|
982
|
+
},
|
|
983
|
+
{
|
|
984
|
+
"component": "Toolbar",
|
|
985
|
+
"slots": {
|
|
986
|
+
"body": [
|
|
987
|
+
{
|
|
988
|
+
"component": "Button",
|
|
989
|
+
"props": {
|
|
990
|
+
"type": "submit",
|
|
991
|
+
"variant": "accent"
|
|
992
|
+
},
|
|
993
|
+
"content": "submit-label"
|
|
994
|
+
}
|
|
995
|
+
]
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
]
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
]
|
|
1002
|
+
}
|
|
1003
|
+
},
|
|
1004
|
+
"parameters": [],
|
|
1005
|
+
"content": {
|
|
1006
|
+
"category-label": "Category",
|
|
1007
|
+
"first-option": "Something is broken",
|
|
1008
|
+
"second-option": "An idea",
|
|
1009
|
+
"third-option": "Something else",
|
|
1010
|
+
"description-label": "Description",
|
|
1011
|
+
"description-help": "[what happened, and what you expected]",
|
|
1012
|
+
"submit-label": "Send"
|
|
1013
|
+
},
|
|
1014
|
+
"gaps": [],
|
|
1015
|
+
"blocked": false,
|
|
1016
|
+
"preset": "<Panel\n padding={24}\n>\n <Stack\n gap={24}\n >\n <Field\n group={true}\n label=\"Category\"\n required={true}\n requiredText=\"(Required)\"\n >\n <RadioGroup>\n <Radio value=\"problem\">Something is broken</Radio>\n <Radio value=\"idea\">An idea</Radio>\n <Radio value=\"other\">Something else</Radio>\n </RadioGroup>\n </Field>\n <Field\n description=\"[what happened, and what you expected]\"\n label=\"Description\"\n >\n <Textarea maxLength={500} rows={4} />\n </Field>\n <Toolbar>\n <Button type=\"submit\" variant=\"accent\">Send</Button>\n </Toolbar>\n </Stack>\n</Panel>\n"
|
|
870
1017
|
},
|
|
871
1018
|
{
|
|
872
1019
|
"id": "filter-form",
|