@haiilo/catalyst 6.0.2 → 6.0.3

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.
@@ -4725,7 +4725,7 @@ const computePosition = (reference, floating, options) => {
4725
4725
  const timeTransitionS = 125;
4726
4726
 
4727
4727
  /*!
4728
- * tabbable 6.1.2
4728
+ * tabbable 6.2.0
4729
4729
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
4730
4730
  */
4731
4731
  // NOTE: separate `:not()` selectors has broader browser support than the newer
@@ -4905,7 +4905,27 @@ var getCandidatesIteratively = function getCandidatesIteratively(elements, inclu
4905
4905
  }
4906
4906
  return candidates;
4907
4907
  };
4908
- var getTabindex = function getTabindex(node, isScope) {
4908
+
4909
+ /**
4910
+ * @private
4911
+ * Determines if the node has an explicitly specified `tabindex` attribute.
4912
+ * @param {HTMLElement} node
4913
+ * @returns {boolean} True if so; false if not.
4914
+ */
4915
+ var hasTabIndex = function hasTabIndex(node) {
4916
+ return !isNaN(parseInt(node.getAttribute('tabindex'), 10));
4917
+ };
4918
+
4919
+ /**
4920
+ * Determine the tab index of a given node.
4921
+ * @param {HTMLElement} node
4922
+ * @returns {number} Tab order (negative, 0, or positive number).
4923
+ * @throws {Error} If `node` is falsy.
4924
+ */
4925
+ var getTabIndex = function getTabIndex(node) {
4926
+ if (!node) {
4927
+ throw new Error('No node provided');
4928
+ }
4909
4929
  if (node.tabIndex < 0) {
4910
4930
  // in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default
4911
4931
  // `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,
@@ -4914,16 +4934,28 @@ var getTabindex = function getTabindex(node, isScope) {
4914
4934
  // order, consider their tab index to be 0.
4915
4935
  // Also browsers do not return `tabIndex` correctly for contentEditable nodes;
4916
4936
  // so if they don't have a tabindex attribute specifically set, assume it's 0.
4917
- //
4918
- // isScope is positive for custom element with shadow root or slot that by default
4919
- // have tabIndex -1, but need to be sorted by document order in order for their
4920
- // content to be inserted in the correct position
4921
- if ((isScope || /^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || isContentEditable(node)) && isNaN(parseInt(node.getAttribute('tabindex'), 10))) {
4937
+ if ((/^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || isContentEditable(node)) && !hasTabIndex(node)) {
4922
4938
  return 0;
4923
4939
  }
4924
4940
  }
4925
4941
  return node.tabIndex;
4926
4942
  };
4943
+
4944
+ /**
4945
+ * Determine the tab index of a given node __for sort order purposes__.
4946
+ * @param {HTMLElement} node
4947
+ * @param {boolean} [isScope] True for a custom element with shadow root or slot that, by default,
4948
+ * has tabIndex -1, but needs to be sorted by document order in order for its content to be
4949
+ * inserted into the correct sort position.
4950
+ * @returns {number} Tab order (negative, 0, or positive number).
4951
+ */
4952
+ var getSortOrderTabIndex = function getSortOrderTabIndex(node, isScope) {
4953
+ var tabIndex = getTabIndex(node);
4954
+ if (tabIndex < 0 && isScope && !hasTabIndex(node)) {
4955
+ return 0;
4956
+ }
4957
+ return tabIndex;
4958
+ };
4927
4959
  var sortOrderedTabbables = function sortOrderedTabbables(a, b) {
4928
4960
  return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;
4929
4961
  };
@@ -5166,7 +5198,7 @@ var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable(o
5166
5198
  return true;
5167
5199
  };
5168
5200
  var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable(options, node) {
5169
- if (isNonTabbableRadio(node) || getTabindex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) {
5201
+ if (isNonTabbableRadio(node) || getTabIndex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) {
5170
5202
  return false;
5171
5203
  }
5172
5204
  return true;
@@ -5191,7 +5223,7 @@ var sortByOrder = function sortByOrder(candidates) {
5191
5223
  candidates.forEach(function (item, i) {
5192
5224
  var isScope = !!item.scopeParent;
5193
5225
  var element = isScope ? item.scopeParent : item;
5194
- var candidateTabindex = getTabindex(element, isScope);
5226
+ var candidateTabindex = getSortOrderTabIndex(element, isScope);
5195
5227
  var elements = isScope ? sortByOrder(item.candidates) : element;
5196
5228
  if (candidateTabindex === 0) {
5197
5229
  isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element);
@@ -5210,32 +5242,32 @@ var sortByOrder = function sortByOrder(candidates) {
5210
5242
  return acc;
5211
5243
  }, []).concat(regularTabbables);
5212
5244
  };
5213
- var tabbable = function tabbable(el, options) {
5245
+ var tabbable = function tabbable(container, options) {
5214
5246
  options = options || {};
5215
5247
  var candidates;
5216
5248
  if (options.getShadowRoot) {
5217
- candidates = getCandidatesIteratively([el], options.includeContainer, {
5249
+ candidates = getCandidatesIteratively([container], options.includeContainer, {
5218
5250
  filter: isNodeMatchingSelectorTabbable.bind(null, options),
5219
5251
  flatten: false,
5220
5252
  getShadowRoot: options.getShadowRoot,
5221
5253
  shadowRootFilter: isValidShadowRootTabbable
5222
5254
  });
5223
5255
  } else {
5224
- candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));
5256
+ candidates = getCandidates(container, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));
5225
5257
  }
5226
5258
  return sortByOrder(candidates);
5227
5259
  };
5228
- var focusable = function focusable(el, options) {
5260
+ var focusable = function focusable(container, options) {
5229
5261
  options = options || {};
5230
5262
  var candidates;
5231
5263
  if (options.getShadowRoot) {
5232
- candidates = getCandidatesIteratively([el], options.includeContainer, {
5264
+ candidates = getCandidatesIteratively([container], options.includeContainer, {
5233
5265
  filter: isNodeMatchingSelectorFocusable.bind(null, options),
5234
5266
  flatten: true,
5235
5267
  getShadowRoot: options.getShadowRoot
5236
5268
  });
5237
5269
  } else {
5238
- candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options));
5270
+ candidates = getCandidates(container, options.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options));
5239
5271
  }
5240
5272
  return candidates;
5241
5273
  };
@@ -7559,7 +7591,12 @@ function __asyncValues(o) {
7559
7591
  return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
7560
7592
  function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
7561
7593
  function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
7562
- }
7594
+ }
7595
+
7596
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
7597
+ var e = new Error(message);
7598
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
7599
+ };
7563
7600
 
7564
7601
  const isArrayLike = ((x) => x && typeof x.length === 'number' && typeof x !== 'function');
7565
7602