@primer/view-components 0.1.7-rc.b2a7d2ac → 0.1.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/view-components",
3
- "version": "0.1.7-rc.b2a7d2ac",
3
+ "version": "0.1.7",
4
4
  "description": "ViewComponents for the Primer Design System",
5
5
  "main": "app/assets/javascripts/primer_view_components.js",
6
6
  "module": "app/components/primer/primer.js",
@@ -43,6 +43,12 @@
43
43
  "default": "`:none`",
44
44
  "description": "How items may be selected in the list. One of `:multiple`, `:multiple_checkbox`, `:none`, or `:single`."
45
45
  },
46
+ {
47
+ "name": "form_arguments",
48
+ "type": "Hash",
49
+ "default": "`{}`",
50
+ "description": "Allows an `ActionList` to act as a select list in multi- and single-select modes. Pass the `builder:` and `name:` options to this hash. `builder:` should be an instance of `ActionView::Helpers::FormBuilder`, which are created by the standard Rails `#form_with` and `#form_for` helpers. The `name:` option is the desired name of the field that will be included in the params sent to the server on form submission. *NOTE*: Consider using an [ActionMenu](/components/alpha/actionmenu) instead of using this feature directly."
51
+ },
46
52
  {
47
53
  "name": "system_arguments",
48
54
  "type": "Hash",
@@ -73,6 +79,17 @@
73
79
  }
74
80
  ]
75
81
  },
82
+ {
83
+ "component": "ActionList::FormWrapper",
84
+ "status": "alpha",
85
+ "a11y_reviewed": false,
86
+ "short_name": "ActionListFormWrapper",
87
+ "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_list/form_wrapper.rb",
88
+ "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_list/form_wrapper/default/",
89
+ "parameters": [
90
+
91
+ ]
92
+ },
76
93
  {
77
94
  "component": "ActionList::Heading",
78
95
  "status": "alpha",
@@ -169,6 +186,12 @@
169
186
  "default": "`{}`",
170
187
  "description": "[System arguments](/system-arguments) used to construct the item's anchor or button tag."
171
188
  },
189
+ {
190
+ "name": "form_arguments",
191
+ "type": "Hash",
192
+ "default": "`{}`",
193
+ "description": "Allows the item to submit a form on click. The URL passed in the `href:` option will be used as the form action. Pass the `method:` option to this hash to control what kind of request is made, One of `:delete`, `:get`, `:head`, `:patch`, `:post`, or `:put`. The `name:` option is required and specifies the desired name of the field that will be included in the params sent to the server on form submission. Specify the `value:` option to send a custom value to the server; otherwise the value of `name:` is sent."
194
+ },
172
195
  {
173
196
  "name": "truncate_label",
174
197
  "type": "Boolean",
@@ -297,7 +320,13 @@
297
320
  "name": "select_variant",
298
321
  "type": "Symbol",
299
322
  "default": "`:none`",
300
- "description": ". One of `:multiple`, `:none`, or `:single`.."
323
+ "description": "One of `:multiple`, `:none`, or `:single`."
324
+ },
325
+ {
326
+ "name": "form_arguments",
327
+ "type": "Hash",
328
+ "default": "`{}`",
329
+ "description": "Allows an `ActionMenu` to act as a select list in multi- and single-select modes. Pass the `builder:` and `name:` options to this hash. `builder:` should be an instance of `ActionView::Helpers::FormBuilder`, which are created by the standard Rails `#form_with` and `#form_for` helpers. The `name:` option is the desired name of the field that will be included in the params sent to the server on form submission."
301
330
  },
302
331
  {
303
332
  "name": "system_arguments",
@@ -325,7 +354,7 @@
325
354
  "name": "system_arguments",
326
355
  "type": "Hash",
327
356
  "default": "N/A",
328
- "description": "[System arguments](/system-arguments)"
357
+ "description": "The arguments accepted by [ActionList](/components/alpha/actionlist)"
329
358
  }
330
359
  ]
331
360
  },
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "Primer::Alpha::ActionList": "",
3
3
  "Primer::Alpha::ActionList::Divider": "",
4
+ "Primer::Alpha::ActionList::FormWrapper": "",
4
5
  "Primer::Alpha::ActionList::Heading": "",
5
6
  "Primer::Alpha::ActionList::Item": "",
6
7
  "Primer::Alpha::ActionMenu": "",
@@ -5,6 +5,7 @@
5
5
  "DEFAULT_SCHEME": "full",
6
6
  "DEFAULT_SELECT_VARIANT": "none",
7
7
  "Divider": "Primer::Alpha::ActionList::Divider",
8
+ "FormWrapper": "Primer::Alpha::ActionList::FormWrapper",
8
9
  "Heading": "Primer::Alpha::ActionList::Heading",
9
10
  "Item": "Primer::Alpha::ActionList::Item",
10
11
  "MENU_ROLE": "menu",
@@ -39,6 +40,17 @@
39
40
  "filled"
40
41
  ]
41
42
  },
43
+ "Primer::Alpha::ActionList::FormWrapper": {
44
+ "DEFAULT_HTTP_METHOD": "get",
45
+ "HTTP_METHOD_OPTIONS": [
46
+ "get",
47
+ "post",
48
+ "patch",
49
+ "put",
50
+ "delete",
51
+ "head"
52
+ ]
53
+ },
42
54
  "Primer::Alpha::ActionList::Heading": {
43
55
  "DEFAULT_SCHEME": "subtle",
44
56
  "HEADING_LEVELS": [
@@ -45,6 +45,12 @@
45
45
  "default": "`:none`",
46
46
  "description": "How items may be selected in the list. One of `:multiple`, `:multiple_checkbox`, `:none`, or `:single`."
47
47
  },
48
+ {
49
+ "name": "form_arguments",
50
+ "type": "Hash",
51
+ "default": "`{}`",
52
+ "description": "Allows an `ActionList` to act as a select list in multi- and single-select modes. Pass the `builder:` and `name:` options to this hash. `builder:` should be an instance of `ActionView::Helpers::FormBuilder`, which are created by the standard Rails `#form_with` and `#form_for` helpers. The `name:` option is the desired name of the field that will be included in the params sent to the server on form submission. *NOTE*: Consider using an {{#link_to_component}}Primer::Alpha::ActionMenu{{/link_to_component}} instead of using this feature directly."
53
+ },
48
54
  {
49
55
  "name": "system_arguments",
50
56
  "type": "Hash",
@@ -260,6 +266,12 @@
260
266
  "default": "`{}`",
261
267
  "description": "{{link_to_system_arguments_docs}} used to construct the item's anchor or button tag."
262
268
  },
269
+ {
270
+ "name": "form_arguments",
271
+ "type": "Hash",
272
+ "default": "`{}`",
273
+ "description": "Allows the item to submit a form on click. The URL passed in the `href:` option will be used as the form action. Pass the `method:` option to this hash to control what kind of request is made, One of `:delete`, `:get`, `:head`, `:patch`, `:post`, or `:put`. The `name:` option is required and specifies the desired name of the field that will be included in the params sent to the server on form submission. Specify the `value:` option to send a custom value to the server; otherwise the value of `name:` is sent."
274
+ },
263
275
  {
264
276
  "name": "truncate_label",
265
277
  "type": "Boolean",
@@ -517,6 +529,31 @@
517
529
 
518
530
  ]
519
531
  },
532
+ {
533
+ "fully_qualified_name": "Primer::Alpha::ActionList::FormWrapper",
534
+ "description": "Utility component for wrapping ActionLists or individual ActionList::Items in forms.",
535
+ "component": "ActionList::FormWrapper",
536
+ "status": "alpha",
537
+ "a11y_reviewed": false,
538
+ "short_name": "ActionListFormWrapper",
539
+ "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_list/form_wrapper.rb",
540
+ "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_list/form_wrapper/default/",
541
+ "parameters": [
542
+
543
+ ],
544
+ "slots": [
545
+
546
+ ],
547
+ "methods": [
548
+
549
+ ],
550
+ "previews": [
551
+
552
+ ],
553
+ "subcomponents": [
554
+
555
+ ]
556
+ },
520
557
  {
521
558
  "fully_qualified_name": "Primer::Alpha::ActionList::Divider",
522
559
  "description": "Group heading rendered above the group contents.",
@@ -557,7 +594,7 @@
557
594
  },
558
595
  {
559
596
  "fully_qualified_name": "Primer::Alpha::ActionMenu",
560
- "description": "The ActionMenu should be used when a user can select a single option triggering an action from a list of items. Primer will automatically nest an `Item` within a presentational `<li>` tag.\n\nThe only allowed elements for the `Item` components are: `:a`, `:button`, and `:clipboard-copy`. If one isn't selected, a fallback `:span` will be used. To add functionality, use a `.js` class to create the functionality, or an `onclick` handler.",
597
+ "description": "ActionMenu is used for actions, navigation, to display secondary options, or single/multi select lists. They appear when users interact with buttons, actions, or other controls.\n\nThe only allowed elements for the `Item` components are: `:a`, `:button`, and `:clipboard-copy`. The default is `:button`.",
561
598
  "component": "ActionMenu",
562
599
  "status": "alpha",
563
600
  "a11y_reviewed": false,
@@ -617,7 +654,13 @@
617
654
  "name": "select_variant",
618
655
  "type": "Symbol",
619
656
  "default": "`:none`",
620
- "description": ". One of `:multiple`, `:none`, or `:single`.."
657
+ "description": "One of `:multiple`, `:none`, or `:single`."
658
+ },
659
+ {
660
+ "name": "form_arguments",
661
+ "type": "Hash",
662
+ "default": "`{}`",
663
+ "description": "Allows an `ActionMenu` to act as a select list in multi- and single-select modes. Pass the `builder:` and `name:` options to this hash. `builder:` should be an instance of `ActionView::Helpers::FormBuilder`, which are created by the standard Rails `#form_with` and `#form_for` helpers. The `name:` option is the desired name of the field that will be included in the params sent to the server on form submission."
621
664
  },
622
665
  {
623
666
  "name": "system_arguments",
@@ -627,7 +670,30 @@
627
670
  }
628
671
  ],
629
672
  "slots": [
630
-
673
+ {
674
+ "name": "show_button",
675
+ "description": "Button to activate the menu.",
676
+ "parameters": [
677
+ {
678
+ "name": "system_arguments",
679
+ "type": "Hash",
680
+ "default": "N/A",
681
+ "description": "The arguments accepted by {{#link_to_component}}Primer::Alpha::Overlay{{/link_to_component}}'s `show_button` slot."
682
+ }
683
+ ]
684
+ },
685
+ {
686
+ "name": "items",
687
+ "description": "Adds a new item to the list.",
688
+ "parameters": [
689
+ {
690
+ "name": "system_arguments",
691
+ "type": "Hash",
692
+ "default": "N/A",
693
+ "description": "The arguments accepted by {{#link_to_component}}Primer::Alpha::ActionList::Item{{/link_to_component}}."
694
+ }
695
+ ]
696
+ }
631
697
  ],
632
698
  "methods": [
633
699
  {
@@ -675,13 +741,6 @@
675
741
  }
676
742
  ]
677
743
  },
678
- {
679
- "name": "items",
680
- "description": "Retrieves the list of items.",
681
- "parameters": [
682
-
683
- ]
684
- },
685
744
  {
686
745
  "name": "with_divider",
687
746
  "description": "Adds a divider to the list.",
@@ -766,6 +825,16 @@
766
825
  "preview_path": "/lookbook/preview/primer/alpha/action_menu/with_actions",
767
826
  "name": "with_actions"
768
827
  },
828
+ {
829
+ "inspect_path": "/lookbook/inspect/primer/alpha/action_menu/single_select_form",
830
+ "preview_path": "/lookbook/preview/primer/alpha/action_menu/single_select_form",
831
+ "name": "single_select_form"
832
+ },
833
+ {
834
+ "inspect_path": "/lookbook/inspect/primer/alpha/action_menu/multiple_select_form",
835
+ "preview_path": "/lookbook/preview/primer/alpha/action_menu/multiple_select_form",
836
+ "name": "multiple_select_form"
837
+ },
769
838
  {
770
839
  "inspect_path": "/lookbook/inspect/primer/alpha/action_menu/with_disabled_items",
771
840
  "preview_path": "/lookbook/preview/primer/alpha/action_menu/with_disabled_items",
@@ -828,7 +897,7 @@
828
897
  "name": "system_arguments",
829
898
  "type": "Hash",
830
899
  "default": "N/A",
831
- "description": "{{link_to_system_arguments_docs}}"
900
+ "description": "The arguments accepted by {{#link_to_component}}Primer::Alpha::ActionList{{/link_to_component}}"
832
901
  }
833
902
  ],
834
903
  "slots": [
@@ -862,6 +931,12 @@
862
931
  "name": "with_item",
863
932
  "description": "Adds a new item to the list.",
864
933
  "parameters": [
934
+ {
935
+ "name": "data",
936
+ "type": "Hash",
937
+ "default": "`{}`",
938
+ "description": "When the menu is used as a form input (see the {{#link_to_component}}Primer::Alpha::ActionMenu{{/link_to_component}} docs), the label is submitted to the server by default. However, if the `data: { value: }` or `\"data-value\":` attribute is provided, it will be sent to the server instead."
939
+ },
865
940
  {
866
941
  "name": "system_arguments",
867
942
  "type": "Hash",
@@ -188,6 +188,16 @@
188
188
  "preview_path": "/lookbook/preview/primer/alpha/action_menu/with_actions",
189
189
  "name": "with_actions"
190
190
  },
191
+ {
192
+ "inspect_path": "/lookbook/inspect/primer/alpha/action_menu/single_select_form",
193
+ "preview_path": "/lookbook/preview/primer/alpha/action_menu/single_select_form",
194
+ "name": "single_select_form"
195
+ },
196
+ {
197
+ "inspect_path": "/lookbook/inspect/primer/alpha/action_menu/multiple_select_form",
198
+ "preview_path": "/lookbook/preview/primer/alpha/action_menu/multiple_select_form",
199
+ "name": "multiple_select_form"
200
+ },
191
201
  {
192
202
  "inspect_path": "/lookbook/inspect/primer/alpha/action_menu/with_disabled_items",
193
203
  "preview_path": "/lookbook/preview/primer/alpha/action_menu/with_disabled_items",
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "Primer::Alpha::ActionList": "alpha",
3
3
  "Primer::Alpha::ActionList::Divider": "alpha",
4
+ "Primer::Alpha::ActionList::FormWrapper": "alpha",
4
5
  "Primer::Alpha::ActionList::Heading": "alpha",
5
6
  "Primer::Alpha::ActionList::Item": "alpha",
6
7
  "Primer::Alpha::ActionMenu": "alpha",