@primer/view-components 0.27.0-rc.a5c9e1b2 → 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.
@@ -11,7 +11,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
11
11
  };
12
12
  var _FocusGroupElement_instances, _FocusGroupElement_retainSignal, _FocusGroupElement_abortController, _FocusGroupElement_items_get;
13
13
  import '@oddbird/popover-polyfill';
14
- const validSelectors = ['[role="menuitem"]', '[role="menuitemcheckbox"]', '[role="menuitemradio"]'];
14
+ const validSelectors = ['[role="menuitem"]', '[role="menuitemcheckbox"]', '[role="menuitemradio"]', '[role="option"]'];
15
15
  const menuItemSelector = validSelectors.map(selector => `:not([hidden]) > ${selector}`).join(', ');
16
16
  const getMnemonicFor = (item) => item.textContent?.trim()[0].toLowerCase();
17
17
  const printable = /^\S$/;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/view-components",
3
- "version": "0.27.0-rc.a5c9e1b2",
3
+ "version": "0.27.0",
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",
@@ -104,6 +104,12 @@
104
104
  "default": "`:none`",
105
105
  "description": "How items may be selected in the list. One of `:multiple`, `:multiple_checkbox`, `:none`, or `:single`."
106
106
  },
107
+ {
108
+ "name": "aria_selection_variant",
109
+ "type": "Symbol",
110
+ "default": "`:checked`",
111
+ "description": "Specifies which aria selection to use. <%= one_of(Primer::Alpha::ActionList::ARIA_SELECTION_VARIANT_OPTIONS) %?"
112
+ },
107
113
  {
108
114
  "name": "form_arguments",
109
115
  "type": "Hash",
@@ -383,6 +389,12 @@
383
389
  "default": "`{}`",
384
390
  "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."
385
391
  },
392
+ {
393
+ "name": "overlay_arguments",
394
+ "type": "Hash",
395
+ "default": "`{}`",
396
+ "description": "Arguments to pass to the underlying [Overlay](/components/alpha/overlay)"
397
+ },
386
398
  {
387
399
  "name": "system_arguments",
388
400
  "type": "Hash",
@@ -435,6 +447,12 @@
435
447
  "default": "`:none`",
436
448
  "description": "How items may be selected in the list. One of `:multiple`, `:multiple_checkbox`, `:none`, or `:single`."
437
449
  },
450
+ {
451
+ "name": "aria_selection_variant",
452
+ "type": "Symbol",
453
+ "default": "`:checked`",
454
+ "description": "Specifies which aria selection to use. <%= one_of(Primer::Alpha::ActionList::ARIA_SELECTION_VARIANT_OPTIONS) %?"
455
+ },
438
456
  {
439
457
  "name": "form_arguments",
440
458
  "type": "Hash",
@@ -19,6 +19,11 @@
19
19
  "Primer::Alpha::ActionBar::Item": {
20
20
  },
21
21
  "Primer::Alpha::ActionList": {
22
+ "ARIA_SELECTION_VARIANT_OPTIONS": [
23
+ "selected",
24
+ "checked"
25
+ ],
26
+ "DEFAULT_ARIA_SELECTION_VARIANT": "checked",
22
27
  "DEFAULT_MENU_ITEM_ROLE": "menuitem",
23
28
  "DEFAULT_ROLE": "list",
24
29
  "DEFAULT_SCHEME": "full",
@@ -27,6 +32,7 @@
27
32
  "FormWrapper": "Primer::Alpha::ActionList::FormWrapper",
28
33
  "Heading": "Primer::Alpha::ActionList::Heading",
29
34
  "Item": "Primer::Alpha::ActionList::Item",
35
+ "LIST_BOX_ITEM_ROLE": "option",
30
36
  "MENU_ROLE": "menu",
31
37
  "SCHEME_MAPPINGS": {
32
38
  "full": null,
@@ -246,6 +246,12 @@
246
246
  "default": "`:none`",
247
247
  "description": "How items may be selected in the list. One of `:multiple`, `:multiple_checkbox`, `:none`, or `:single`."
248
248
  },
249
+ {
250
+ "name": "aria_selection_variant",
251
+ "type": "Symbol",
252
+ "default": "`:checked`",
253
+ "description": "Specifies which aria selection to use. <%= one_of(Primer::Alpha::ActionList::ARIA_SELECTION_VARIANT_OPTIONS) %?"
254
+ },
249
255
  {
250
256
  "name": "form_arguments",
251
257
  "type": "Hash",
@@ -386,6 +392,13 @@
386
392
 
387
393
  ]
388
394
  },
395
+ {
396
+ "name": "aria_selection_variant",
397
+ "description": "Returns the value of attribute aria_selection_variant.",
398
+ "parameters": [
399
+
400
+ ]
401
+ },
389
402
  {
390
403
  "name": "build_item",
391
404
  "description": "Builds a new item but does not add it to the list. Use this method\ninstead of the `#with_item` slot if you need to render an item outside\nthe context of a list, eg. if rendering additional items to append to\nan existing list, perhaps via a separate HTTP request.",
@@ -798,6 +811,19 @@
798
811
  "color-contrast"
799
812
  ]
800
813
  }
814
+ },
815
+ {
816
+ "preview_path": "primer/alpha/action_list/listbox",
817
+ "name": "listbox",
818
+ "snapshot": "false",
819
+ "skip_rules": {
820
+ "wont_fix": [
821
+ "region"
822
+ ],
823
+ "will_fix": [
824
+ "color-contrast"
825
+ ]
826
+ }
801
827
  }
802
828
  ],
803
829
  "subcomponents": [
@@ -1271,6 +1297,12 @@
1271
1297
  "default": "`{}`",
1272
1298
  "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."
1273
1299
  },
1300
+ {
1301
+ "name": "overlay_arguments",
1302
+ "type": "Hash",
1303
+ "default": "`{}`",
1304
+ "description": "Arguments to pass to the underlying {{#link_to_component}}Primer::Alpha::Overlay{{/link_to_component}}"
1305
+ },
1274
1306
  {
1275
1307
  "name": "system_arguments",
1276
1308
  "type": "Hash",
@@ -1968,6 +2000,12 @@
1968
2000
  "default": "`:none`",
1969
2001
  "description": "How items may be selected in the list. One of `:multiple`, `:multiple_checkbox`, `:none`, or `:single`."
1970
2002
  },
2003
+ {
2004
+ "name": "aria_selection_variant",
2005
+ "type": "Symbol",
2006
+ "default": "`:checked`",
2007
+ "description": "Specifies which aria selection to use. <%= one_of(Primer::Alpha::ActionList::ARIA_SELECTION_VARIANT_OPTIONS) %?"
2008
+ },
1971
2009
  {
1972
2010
  "name": "form_arguments",
1973
2011
  "type": "Hash",
@@ -428,6 +428,19 @@
428
428
  "color-contrast"
429
429
  ]
430
430
  }
431
+ },
432
+ {
433
+ "preview_path": "primer/alpha/action_list/listbox",
434
+ "name": "listbox",
435
+ "snapshot": "false",
436
+ "skip_rules": {
437
+ "wont_fix": [
438
+ "region"
439
+ ],
440
+ "will_fix": [
441
+ "color-contrast"
442
+ ]
443
+ }
431
444
  }
432
445
  ]
433
446
  },