@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.
@@ -33,7 +33,6 @@
33
33
  'input.clear': 'Clear',
34
34
  'input.optional': 'Optional',
35
35
  'input.required': 'Required',
36
- 'input.today': 'Today',
37
36
  'notification.dismiss': 'Dismiss',
38
37
  'pagination.prev': 'Previous',
39
38
  'pagination.page': 'Go to page {{page}}',
@@ -103,10 +103,6 @@ small,
103
103
  text-decoration: line-through;
104
104
  }
105
105
 
106
- .cat-muted {
107
- color: cat-token('color.ui.font.muted');
108
- }
109
-
110
106
  // ----- lists
111
107
 
112
108
  ol,
@@ -1,7 +1,7 @@
1
1
  @use 'fonts.mixins.lato' as *;
2
2
 
3
3
  @mixin cat-fonts($path) {
4
- @include cat-font-lato($path, 300, 400, 500, 700) {
4
+ @include cat-font-lato($path, 300, 400, 500, 600, 700) {
5
5
  font-display: fallback;
6
6
  }
7
7
  }
@@ -7,7 +7,7 @@ import { a as autoUpdate, c as computePosition, o as offset, f as flip, s as siz
7
7
  const timeTransitionS = 125;
8
8
 
9
9
  /*!
10
- * tabbable 6.1.2
10
+ * tabbable 6.2.0
11
11
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
12
12
  */
13
13
  // NOTE: separate `:not()` selectors has broader browser support than the newer
@@ -187,7 +187,27 @@ var getCandidatesIteratively = function getCandidatesIteratively(elements, inclu
187
187
  }
188
188
  return candidates;
189
189
  };
190
- var getTabindex = function getTabindex(node, isScope) {
190
+
191
+ /**
192
+ * @private
193
+ * Determines if the node has an explicitly specified `tabindex` attribute.
194
+ * @param {HTMLElement} node
195
+ * @returns {boolean} True if so; false if not.
196
+ */
197
+ var hasTabIndex = function hasTabIndex(node) {
198
+ return !isNaN(parseInt(node.getAttribute('tabindex'), 10));
199
+ };
200
+
201
+ /**
202
+ * Determine the tab index of a given node.
203
+ * @param {HTMLElement} node
204
+ * @returns {number} Tab order (negative, 0, or positive number).
205
+ * @throws {Error} If `node` is falsy.
206
+ */
207
+ var getTabIndex = function getTabIndex(node) {
208
+ if (!node) {
209
+ throw new Error('No node provided');
210
+ }
191
211
  if (node.tabIndex < 0) {
192
212
  // in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default
193
213
  // `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,
@@ -196,16 +216,28 @@ var getTabindex = function getTabindex(node, isScope) {
196
216
  // order, consider their tab index to be 0.
197
217
  // Also browsers do not return `tabIndex` correctly for contentEditable nodes;
198
218
  // so if they don't have a tabindex attribute specifically set, assume it's 0.
199
- //
200
- // isScope is positive for custom element with shadow root or slot that by default
201
- // have tabIndex -1, but need to be sorted by document order in order for their
202
- // content to be inserted in the correct position
203
- if ((isScope || /^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || isContentEditable(node)) && isNaN(parseInt(node.getAttribute('tabindex'), 10))) {
219
+ if ((/^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || isContentEditable(node)) && !hasTabIndex(node)) {
204
220
  return 0;
205
221
  }
206
222
  }
207
223
  return node.tabIndex;
208
224
  };
225
+
226
+ /**
227
+ * Determine the tab index of a given node __for sort order purposes__.
228
+ * @param {HTMLElement} node
229
+ * @param {boolean} [isScope] True for a custom element with shadow root or slot that, by default,
230
+ * has tabIndex -1, but needs to be sorted by document order in order for its content to be
231
+ * inserted into the correct sort position.
232
+ * @returns {number} Tab order (negative, 0, or positive number).
233
+ */
234
+ var getSortOrderTabIndex = function getSortOrderTabIndex(node, isScope) {
235
+ var tabIndex = getTabIndex(node);
236
+ if (tabIndex < 0 && isScope && !hasTabIndex(node)) {
237
+ return 0;
238
+ }
239
+ return tabIndex;
240
+ };
209
241
  var sortOrderedTabbables = function sortOrderedTabbables(a, b) {
210
242
  return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;
211
243
  };
@@ -448,7 +480,7 @@ var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable(o
448
480
  return true;
449
481
  };
450
482
  var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable(options, node) {
451
- if (isNonTabbableRadio(node) || getTabindex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) {
483
+ if (isNonTabbableRadio(node) || getTabIndex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) {
452
484
  return false;
453
485
  }
454
486
  return true;
@@ -473,7 +505,7 @@ var sortByOrder = function sortByOrder(candidates) {
473
505
  candidates.forEach(function (item, i) {
474
506
  var isScope = !!item.scopeParent;
475
507
  var element = isScope ? item.scopeParent : item;
476
- var candidateTabindex = getTabindex(element, isScope);
508
+ var candidateTabindex = getSortOrderTabIndex(element, isScope);
477
509
  var elements = isScope ? sortByOrder(item.candidates) : element;
478
510
  if (candidateTabindex === 0) {
479
511
  isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element);
@@ -492,32 +524,32 @@ var sortByOrder = function sortByOrder(candidates) {
492
524
  return acc;
493
525
  }, []).concat(regularTabbables);
494
526
  };
495
- var tabbable = function tabbable(el, options) {
527
+ var tabbable = function tabbable(container, options) {
496
528
  options = options || {};
497
529
  var candidates;
498
530
  if (options.getShadowRoot) {
499
- candidates = getCandidatesIteratively([el], options.includeContainer, {
531
+ candidates = getCandidatesIteratively([container], options.includeContainer, {
500
532
  filter: isNodeMatchingSelectorTabbable.bind(null, options),
501
533
  flatten: false,
502
534
  getShadowRoot: options.getShadowRoot,
503
535
  shadowRootFilter: isValidShadowRootTabbable
504
536
  });
505
537
  } else {
506
- candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));
538
+ candidates = getCandidates(container, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));
507
539
  }
508
540
  return sortByOrder(candidates);
509
541
  };
510
- var focusable = function focusable(el, options) {
542
+ var focusable = function focusable(container, options) {
511
543
  options = options || {};
512
544
  var candidates;
513
545
  if (options.getShadowRoot) {
514
- candidates = getCandidatesIteratively([el], options.includeContainer, {
546
+ candidates = getCandidatesIteratively([container], options.includeContainer, {
515
547
  filter: isNodeMatchingSelectorFocusable.bind(null, options),
516
548
  flatten: true,
517
549
  getShadowRoot: options.getShadowRoot
518
550
  });
519
551
  } else {
520
- candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options));
552
+ candidates = getCandidates(container, options.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options));
521
553
  }
522
554
  return candidates;
523
555
  };