@primer/view-components 0.1.8 → 0.1.9-20230522231656

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,15 +11,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
11
11
  };
12
12
  var _ActionMenuElement_instances, _ActionMenuElement_abortController, _ActionMenuElement_originalLabel, _ActionMenuElement_inputName, _ActionMenuElement_setDynamicLabel, _ActionMenuElement_updateInput, _ActionMenuElement_isEnterKeydown, _ActionMenuElement_firstItem_get;
13
13
  import '@github/include-fragment-element';
14
- const popoverSelector = (() => {
15
- try {
16
- document.querySelector(':open');
17
- return ':open';
18
- }
19
- catch (_a) {
20
- return '.\\:open';
21
- }
22
- })();
23
14
  const menuItemSelectors = ['[role="menuitem"]', '[role="menuitemcheckbox"]', '[role="menuitemradio"]'];
24
15
  export class ActionMenuElement extends HTMLElement {
25
16
  constructor() {
@@ -109,7 +100,7 @@ export class ActionMenuElement extends HTMLElement {
109
100
  return;
110
101
  }
111
102
  }
112
- if (!((_b = this.popoverElement) === null || _b === void 0 ? void 0 : _b.matches(popoverSelector)))
103
+ if (!((_b = this.popoverElement) === null || _b === void 0 ? void 0 : _b.matches(':popover-open')))
113
104
  return;
114
105
  if (event.type === 'focusout' && !this.contains(event.relatedTarget)) {
115
106
  (_c = this.popoverElement) === null || _c === void 0 ? void 0 : _c.hidePopover();
@@ -1 +1 @@
1
- .Overlay[popover]{border-width:0;min-width:192px;padding:0;position:absolute}.Overlay[popover]:not(:open){display:none}anchored-position{display:block}
1
+ .Overlay[popover]{border-width:0;min-width:192px;padding:0;position:absolute}.Overlay[popover]:not(:popover-open){display:none}anchored-position{display:block}
@@ -2,7 +2,7 @@
2
2
  "name": "alpha/overlay",
3
3
  "selectors": [
4
4
  ".Overlay[popover]",
5
- ".Overlay[popover]:not(:open)",
5
+ ".Overlay[popover]:not(:popover-open)",
6
6
  "anchored-position"
7
7
  ]
8
8
  }
@@ -12,15 +12,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
12
12
  var _FocusGroupElement_instances, _FocusGroupElement_abortController, _FocusGroupElement_items_get;
13
13
  import '@oddbird/popover-polyfill';
14
14
  const menuItemSelector = '[role="menuitem"],[role="menuitemcheckbox"],[role="menuitemradio"]';
15
- const popoverSelector = (() => {
16
- try {
17
- document.querySelector(':open');
18
- return ':open';
19
- }
20
- catch (_a) {
21
- return '.\\:open';
22
- }
23
- })();
24
15
  const getMnemonicFor = (item) => { var _a; return (_a = item.textContent) === null || _a === void 0 ? void 0 : _a.trim()[0].toLowerCase(); };
25
16
  const printable = /^\S$/;
26
17
  export default class FocusGroupElement extends HTMLElement {
@@ -122,13 +113,11 @@ export default class FocusGroupElement extends HTMLElement {
122
113
  {
123
114
  let el = focusEl;
124
115
  do {
125
- el = el.closest(`[popover]:not(${popoverSelector})`);
116
+ el = el.closest(`[popover]:not(:popover-open)`);
126
117
  if ((el === null || el === void 0 ? void 0 : el.popover) === 'auto') {
127
118
  el.showPopover();
128
119
  }
129
- else {
130
- el = (el === null || el === void 0 ? void 0 : el.parentElement) || null;
131
- }
120
+ el = (el === null || el === void 0 ? void 0 : el.parentElement) || null;
132
121
  } while (el);
133
122
  }
134
123
  focusEl === null || focusEl === void 0 ? void 0 : focusEl.focus();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/view-components",
3
- "version": "0.1.8",
3
+ "version": "0.1.9-20230522231656",
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",
@@ -54,12 +54,12 @@
54
54
  "@github/mini-throttle": "^2.1.0",
55
55
  "@github/relative-time-element": "^4.0.0",
56
56
  "@github/tab-container-element": "^3.1.2",
57
- "@oddbird/popover-polyfill": "^0.1.1",
58
- "@primer/behaviors": "^1.2.0"
57
+ "@oddbird/popover-polyfill": "^0.2.1",
58
+ "@primer/behaviors": "^1.3.4"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@changesets/changelog-github": "^0.4.6",
62
- "@changesets/cli": "^2.24.1",
62
+ "@changesets/cli": "^2.26.1",
63
63
  "@github/browserslist-config": "^1.0.0",
64
64
  "@github/markdownlint-github": "^0.2.2",
65
65
  "@github/prettier-config": "0.0.4",