@primer/view-components 0.9.0 → 0.10.0-rc.2cc9199d

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.
@@ -18,7 +18,8 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
18
18
  var _ActionMenuElement_instances, _ActionMenuElement_abortController, _ActionMenuElement_originalLabel, _ActionMenuElement_inputName, _ActionMenuElement_setDynamicLabel, _ActionMenuElement_updateInput, _ActionMenuElement_isActivationKeydown, _ActionMenuElement_firstItem_get;
19
19
  import { controller, target } from '@github/catalyst';
20
20
  import '@oddbird/popover-polyfill';
21
- const menuItemSelectors = ['[role="menuitem"]', '[role="menuitemcheckbox"]', '[role="menuitemradio"]'];
21
+ const validSelectors = ['[role="menuitem"]', '[role="menuitemcheckbox"]', '[role="menuitemradio"]'];
22
+ const menuItemSelectors = validSelectors.map(selector => `:not([hidden]) > ${selector}`);
22
23
  let ActionMenuElement = class ActionMenuElement extends HTMLElement {
23
24
  constructor() {
24
25
  super(...arguments);
@@ -1 +1 @@
1
- anchored-position[popover]{border-width:0;inset:auto;min-width:192px;overflow:visible;padding:0;position:absolute}.Overlay{display:flex}anchored-position[popover]:not(.\:popover-open){display:none}anchored-position.not-anchored::-webkit-backdrop{background-color:var(--overlay-backdrop-bgColor,var(--color-neutral-muted))}anchored-position.not-anchored::backdrop{background-color:var(--overlay-backdrop-bgColor,var(--color-neutral-muted))}@supports selector(:popover-open){anchored-position[popover]:not(.\:popover-open){display:revert}}@supports selector(:open){anchored-position[popover]:not(.\:popover-open){display:revert}}
1
+ anchored-position[popover]{background:none;border-width:0;inset:auto;min-width:192px;overflow:visible;padding:0;position:absolute}.Overlay{display:flex}anchored-position[popover]:not(.\:popover-open){display:none}anchored-position.not-anchored::-webkit-backdrop{background-color:var(--overlay-backdrop-bgColor,var(--color-neutral-muted))}anchored-position.not-anchored::backdrop{background-color:var(--overlay-backdrop-bgColor,var(--color-neutral-muted))}@supports selector(:popover-open){anchored-position[popover]:not(.\:popover-open){display:revert}}@supports selector(:open){anchored-position[popover]:not(.\:popover-open){display:revert}}
@@ -11,7 +11,8 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
11
11
  };
12
12
  var _FocusGroupElement_instances, _FocusGroupElement_abortController, _FocusGroupElement_items_get;
13
13
  import '@oddbird/popover-polyfill';
14
- const menuItemSelector = '[role="menuitem"],[role="menuitemcheckbox"],[role="menuitemradio"]';
14
+ const validSelectors = ['[role="menuitem"]', '[role="menuitemcheckbox"]', '[role="menuitemradio"]'];
15
+ const menuItemSelector = validSelectors.map(selector => `:not([hidden]) > ${selector}`).join(', ');
15
16
  const getMnemonicFor = (item) => { var _a; return (_a = item.textContent) === null || _a === void 0 ? void 0 : _a.trim()[0].toLowerCase(); };
16
17
  const printable = /^\S$/;
17
18
  export default class FocusGroupElement extends HTMLElement {
@@ -6,7 +6,7 @@ import './anchored_position';
6
6
  import './focus_group';
7
7
  import './alpha/image_crop';
8
8
  import './alpha/modal_dialog';
9
- import './alpha/nav_list';
9
+ import './beta/nav_list';
10
10
  import './alpha/segmented_control';
11
11
  import './alpha/toggle_switch';
12
12
  import './alpha/tool_tip';
@@ -6,7 +6,7 @@ import './anchored_position';
6
6
  import './focus_group';
7
7
  import './alpha/image_crop';
8
8
  import './alpha/modal_dialog';
9
- import './alpha/nav_list';
9
+ import './beta/nav_list';
10
10
  import './alpha/segmented_control';
11
11
  import './alpha/toggle_switch';
12
12
  import './alpha/tool_tip';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/view-components",
3
- "version": "0.9.0",
3
+ "version": "0.10.0-rc.2cc9199d",
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",
@@ -772,6 +772,18 @@
772
772
  "default": "N/A",
773
773
  "description": "A string describing the field and what sorts of input it expects. Displayed below the group."
774
774
  },
775
+ {
776
+ "name": "invalid",
777
+ "type": "Boolean",
778
+ "default": "N/A",
779
+ "description": "If set to `true`, the input will be marked as invalid. Implied if `validation_message` is truthy. This option is set to `true` automatically if the model object associated with the form reports that the input is invalid via Rails validations. It is provided for cases where the form does not have an associated model. If the input is invalid as determined by Rails validations, setting `invalid` to `false` will have no effect."
780
+ },
781
+ {
782
+ "name": "validation_message",
783
+ "type": "String",
784
+ "default": "N/A",
785
+ "description": "A string displayed between the caption and the input indicating the input's contents are invalid. This option is, by default, set to the first Rails validation message for the input (assuming the form is associated with a model object). Use `validation_message` to override the default or to provide a validation message in case there is no associated model object."
786
+ },
775
787
  {
776
788
  "name": "label_arguments",
777
789
  "type": "Hash",
@@ -1420,7 +1432,7 @@
1420
1432
  },
1421
1433
  {
1422
1434
  "component": "NavList",
1423
- "status": "alpha",
1435
+ "status": "deprecated",
1424
1436
  "a11y_reviewed": true,
1425
1437
  "short_name": "NavList",
1426
1438
  "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/nav_list.rb",
@@ -1442,7 +1454,7 @@
1442
1454
  },
1443
1455
  {
1444
1456
  "component": "NavList::Divider",
1445
- "status": "alpha",
1457
+ "status": "deprecated",
1446
1458
  "a11y_reviewed": false,
1447
1459
  "short_name": "NavListDivider",
1448
1460
  "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/nav_list/divider.rb",
@@ -1464,7 +1476,7 @@
1464
1476
  },
1465
1477
  {
1466
1478
  "component": "NavList::Group",
1467
- "status": "alpha",
1479
+ "status": "deprecated",
1468
1480
  "a11y_reviewed": true,
1469
1481
  "short_name": "NavListGroup",
1470
1482
  "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/nav_list/group.rb",
@@ -1486,7 +1498,7 @@
1486
1498
  },
1487
1499
  {
1488
1500
  "component": "NavList::Heading",
1489
- "status": "alpha",
1501
+ "status": "deprecated",
1490
1502
  "a11y_reviewed": false,
1491
1503
  "short_name": "NavListHeading",
1492
1504
  "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/nav_list/heading.rb",
@@ -1520,7 +1532,7 @@
1520
1532
  },
1521
1533
  {
1522
1534
  "component": "NavList::Item",
1523
- "status": "alpha",
1535
+ "status": "deprecated",
1524
1536
  "a11y_reviewed": false,
1525
1537
  "short_name": "NavListItem",
1526
1538
  "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/nav_list/item.rb",
@@ -1966,6 +1978,18 @@
1966
1978
  "default": "N/A",
1967
1979
  "description": "A string describing the field and what sorts of input it expects. Displayed below the group."
1968
1980
  },
1981
+ {
1982
+ "name": "invalid",
1983
+ "type": "Boolean",
1984
+ "default": "N/A",
1985
+ "description": "If set to `true`, the input will be marked as invalid. Implied if `validation_message` is truthy. This option is set to `true` automatically if the model object associated with the form reports that the input is invalid via Rails validations. It is provided for cases where the form does not have an associated model. If the input is invalid as determined by Rails validations, setting `invalid` to `false` will have no effect."
1986
+ },
1987
+ {
1988
+ "name": "validation_message",
1989
+ "type": "String",
1990
+ "default": "N/A",
1991
+ "description": "A string displayed between the caption and the input indicating the input's contents are invalid. This option is, by default, set to the first Rails validation message for the input (assuming the form is associated with a model object). Use `validation_message` to override the default or to provide a validation message in case there is no associated model object."
1992
+ },
1969
1993
  {
1970
1994
  "name": "label_arguments",
1971
1995
  "type": "Hash",
@@ -3680,6 +3704,146 @@
3680
3704
  }
3681
3705
  ]
3682
3706
  },
3707
+ {
3708
+ "component": "NavList",
3709
+ "status": "beta",
3710
+ "a11y_reviewed": true,
3711
+ "short_name": "NavList",
3712
+ "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/nav_list.rb",
3713
+ "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/nav_list/default/",
3714
+ "parameters": [
3715
+ {
3716
+ "name": "selected_item_id",
3717
+ "type": "Symbol",
3718
+ "default": "`nil`",
3719
+ "description": "The ID of the currently selected item. The default is `nil`, meaning no item is selected."
3720
+ },
3721
+ {
3722
+ "name": "system_arguments",
3723
+ "type": "Hash",
3724
+ "default": "N/A",
3725
+ "description": "[System arguments](/system-arguments)"
3726
+ }
3727
+ ]
3728
+ },
3729
+ {
3730
+ "component": "NavList::Divider",
3731
+ "status": "alpha",
3732
+ "a11y_reviewed": false,
3733
+ "short_name": "NavListDivider",
3734
+ "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/nav_list/divider.rb",
3735
+ "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/nav_list/divider/default/",
3736
+ "parameters": [
3737
+ {
3738
+ "name": "scheme",
3739
+ "type": "Symbol",
3740
+ "default": "`:subtle`",
3741
+ "description": "Display a background color if scheme is `filled`."
3742
+ },
3743
+ {
3744
+ "name": "system_arguments",
3745
+ "type": "Hash",
3746
+ "default": "N/A",
3747
+ "description": "[System arguments](/system-arguments)"
3748
+ }
3749
+ ]
3750
+ },
3751
+ {
3752
+ "component": "NavList::Group",
3753
+ "status": "alpha",
3754
+ "a11y_reviewed": true,
3755
+ "short_name": "NavListGroup",
3756
+ "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/nav_list/group.rb",
3757
+ "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/nav_list/group/default/",
3758
+ "parameters": [
3759
+ {
3760
+ "name": "selected_item_id",
3761
+ "type": "Symbol",
3762
+ "default": "`nil`",
3763
+ "description": "The ID of the currently selected item. Used internally."
3764
+ },
3765
+ {
3766
+ "name": "system_arguments",
3767
+ "type": "Hash",
3768
+ "default": "N/A",
3769
+ "description": "[System arguments](/system-arguments)"
3770
+ }
3771
+ ]
3772
+ },
3773
+ {
3774
+ "component": "NavList::Heading",
3775
+ "status": "alpha",
3776
+ "a11y_reviewed": false,
3777
+ "short_name": "NavListHeading",
3778
+ "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/nav_list/heading.rb",
3779
+ "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/nav_list/heading/default/",
3780
+ "parameters": [
3781
+ {
3782
+ "name": "title",
3783
+ "type": "String",
3784
+ "default": "N/A",
3785
+ "description": "The text content of the heading."
3786
+ },
3787
+ {
3788
+ "name": "id",
3789
+ "type": "String",
3790
+ "default": "`self.class.generate_id`",
3791
+ "description": "The value of the ID HTML attribute. Auto-generated by default."
3792
+ },
3793
+ {
3794
+ "name": "heading_level",
3795
+ "type": "Integer",
3796
+ "default": "`2`",
3797
+ "description": "The heading level, i.e. 2 for an `<h2>`, 3 for an `<h3>`, etc."
3798
+ },
3799
+ {
3800
+ "name": "system_arguments",
3801
+ "type": "Hash",
3802
+ "default": "N/A",
3803
+ "description": "[System arguments](/system-arguments)"
3804
+ }
3805
+ ]
3806
+ },
3807
+ {
3808
+ "component": "NavList::Item",
3809
+ "status": "alpha",
3810
+ "a11y_reviewed": false,
3811
+ "short_name": "NavListItem",
3812
+ "source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/nav_list/item.rb",
3813
+ "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/nav_list/item/default/",
3814
+ "parameters": [
3815
+ {
3816
+ "name": "selected_item_id",
3817
+ "type": "Symbol",
3818
+ "default": "`nil`",
3819
+ "description": "The ID of the currently selected list item. Used internally."
3820
+ },
3821
+ {
3822
+ "name": "selected_by_ids",
3823
+ "type": "Array<Symbol>",
3824
+ "default": "`[]`",
3825
+ "description": "The list of IDs that select this item. In other words, if the `selected_item_id` attribute on the parent `NavList` is set to one of these IDs, the item will appear selected."
3826
+ },
3827
+ {
3828
+ "name": "expanded",
3829
+ "type": "Boolean",
3830
+ "default": "`false`",
3831
+ "description": "Whether this item shows (expands) or hides (collapses) its list of sub items."
3832
+ },
3833
+ {
3834
+ "name": "sub_item",
3835
+ "type": "Boolean",
3836
+ "default": "`false`",
3837
+ "description": "Whether or not this item is nested under a parent item. Used internally."
3838
+ },
3839
+ {
3840
+ "name": "system_arguments",
3841
+ "type": "Hash",
3842
+ "default": "N/A",
3843
+ "description": "[System arguments](/system-arguments)"
3844
+ }
3845
+ ]
3846
+ },
3683
3847
  {
3684
3848
  "component": "Octicon",
3685
3849
  "status": "beta",
@@ -82,6 +82,11 @@
82
82
  "Primer::Beta::Label": "",
83
83
  "Primer::Beta::Link": "",
84
84
  "Primer::Beta::Markdown": "",
85
+ "Primer::Beta::NavList": "2023-07-10",
86
+ "Primer::Beta::NavList::Divider": "",
87
+ "Primer::Beta::NavList::Group": "2023-07-10",
88
+ "Primer::Beta::NavList::Heading": "",
89
+ "Primer::Beta::NavList::Item": "",
85
90
  "Primer::Beta::Octicon": "",
86
91
  "Primer::Beta::Popover": "",
87
92
  "Primer::Beta::ProgressBar": "",
@@ -968,6 +968,20 @@
968
968
  "td"
969
969
  ]
970
970
  },
971
+ "Primer::Beta::NavList": {
972
+ "Divider": "Primer::Beta::NavList::Divider",
973
+ "Group": "Primer::Beta::NavList::Group",
974
+ "Heading": "Primer::Beta::NavList::Heading",
975
+ "Item": "Primer::Beta::NavList::Item"
976
+ },
977
+ "Primer::Beta::NavList::Divider": {
978
+ },
979
+ "Primer::Beta::NavList::Group": {
980
+ },
981
+ "Primer::Beta::NavList::Heading": {
982
+ },
983
+ "Primer::Beta::NavList::Item": {
984
+ },
971
985
  "Primer::Beta::Octicon": {
972
986
  "SIZE_DEFAULT": "small",
973
987
  "SIZE_MAPPINGS": {