@haiilo/catalyst 5.2.3 → 5.3.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.
Files changed (70) hide show
  1. package/dist/catalyst/catalyst.esm.js +1 -1
  2. package/dist/catalyst/catalyst.esm.js.map +1 -1
  3. package/dist/catalyst/p-ba081831.entry.js +10 -0
  4. package/dist/catalyst/p-ba081831.entry.js.map +1 -0
  5. package/dist/catalyst/scss/_snippets/_form-label.scss +2 -1
  6. package/dist/cjs/{cat-alert_24.cjs.entry.js → cat-alert_25.cjs.entry.js} +170 -28
  7. package/dist/cjs/cat-alert_25.cjs.entry.js.map +1 -0
  8. package/dist/cjs/catalyst.cjs.js +1 -1
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/collection/collection-manifest.json +1 -0
  11. package/dist/collection/components/cat-button/cat-button.css +20 -2
  12. package/dist/collection/components/cat-button/cat-button.js +21 -1
  13. package/dist/collection/components/cat-button/cat-button.js.map +1 -1
  14. package/dist/collection/components/cat-button-group/cat-button-group.css +15 -0
  15. package/dist/collection/components/cat-button-group/cat-button-group.js +51 -0
  16. package/dist/collection/components/cat-button-group/cat-button-group.js.map +1 -0
  17. package/dist/collection/components/cat-dropdown/cat-dropdown.js +14 -2
  18. package/dist/collection/components/cat-dropdown/cat-dropdown.js.map +1 -1
  19. package/dist/collection/components/cat-form-group/cat-form-group.js +28 -0
  20. package/dist/collection/components/cat-form-group/cat-form-group.js.map +1 -1
  21. package/dist/collection/components/cat-input/cat-input.css +8 -4
  22. package/dist/collection/components/cat-label/cat-label.js +19 -0
  23. package/dist/collection/components/cat-label/cat-label.js.map +1 -1
  24. package/dist/collection/components/cat-select/cat-select.css +90 -0
  25. package/dist/collection/components/cat-select/cat-select.js +31 -6
  26. package/dist/collection/components/cat-select/cat-select.js.map +1 -1
  27. package/dist/collection/components/cat-textarea/cat-textarea.css +8 -4
  28. package/dist/collection/components/cat-tooltip/cat-tooltip.css +0 -7
  29. package/dist/collection/components/cat-tooltip/cat-tooltip.js +22 -18
  30. package/dist/collection/components/cat-tooltip/cat-tooltip.js.map +1 -1
  31. package/dist/collection/scss/_snippets/_form-label.scss +2 -1
  32. package/dist/components/cat-button-group.d.ts +11 -0
  33. package/dist/components/cat-button-group.js +46 -0
  34. package/dist/components/cat-button-group.js.map +1 -0
  35. package/dist/components/cat-button2.js +6 -2
  36. package/dist/components/cat-button2.js.map +1 -1
  37. package/dist/components/cat-dropdown2.js +475 -3
  38. package/dist/components/cat-dropdown2.js.map +1 -1
  39. package/dist/components/cat-form-group.js +10 -1
  40. package/dist/components/cat-form-group.js.map +1 -1
  41. package/dist/components/cat-input.js +1 -1
  42. package/dist/components/cat-input.js.map +1 -1
  43. package/dist/components/cat-label.js +2 -0
  44. package/dist/components/cat-label.js.map +1 -1
  45. package/dist/components/cat-select2.js +11 -3
  46. package/dist/components/cat-select2.js.map +1 -1
  47. package/dist/components/cat-textarea.js +1 -1
  48. package/dist/components/cat-textarea.js.map +1 -1
  49. package/dist/components/cat-tooltip.js +24 -20
  50. package/dist/components/cat-tooltip.js.map +1 -1
  51. package/dist/components/floating-ui.dom.esm.js +85 -1
  52. package/dist/components/floating-ui.dom.esm.js.map +1 -1
  53. package/dist/esm/{cat-alert_24.entry.js → cat-alert_25.entry.js} +170 -29
  54. package/dist/esm/cat-alert_25.entry.js.map +1 -0
  55. package/dist/esm/catalyst.js +1 -1
  56. package/dist/esm/loader.js +1 -1
  57. package/dist/types/components/cat-button/cat-button.d.ts +4 -0
  58. package/dist/types/components/cat-button-group/cat-button-group.d.ts +11 -0
  59. package/dist/types/components/cat-form-group/cat-form-group.d.ts +5 -0
  60. package/dist/types/components/cat-label/cat-label.d.ts +4 -0
  61. package/dist/types/components/cat-select/cat-select.d.ts +4 -0
  62. package/dist/types/components/cat-tooltip/cat-tooltip.d.ts +2 -2
  63. package/dist/types/components.d.ts +53 -0
  64. package/package.json +2 -2
  65. package/dist/catalyst/p-d135d677.entry.js +0 -10
  66. package/dist/catalyst/p-d135d677.entry.js.map +0 -1
  67. package/dist/cjs/cat-alert_24.cjs.entry.js.map +0 -1
  68. package/dist/components/first-tabbable.js +0 -464
  69. package/dist/components/first-tabbable.js.map +0 -1
  70. package/dist/esm/cat-alert_24.entry.js.map +0 -1
@@ -1,464 +0,0 @@
1
- /*!
2
- * tabbable 6.0.1
3
- * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
4
- */
5
- var candidateSelectors = ['input', 'select', 'textarea', 'a[href]', 'button', '[tabindex]:not(slot)', 'audio[controls]', 'video[controls]', '[contenteditable]:not([contenteditable="false"])', 'details>summary:first-of-type', 'details'];
6
- var candidateSelector = /* #__PURE__ */candidateSelectors.join(',');
7
- var NoElement = typeof Element === 'undefined';
8
- var matches = NoElement ? function () {} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
9
- var getRootNode = !NoElement && Element.prototype.getRootNode ? function (element) {
10
- return element.getRootNode();
11
- } : function (element) {
12
- return element.ownerDocument;
13
- };
14
-
15
- /**
16
- * @param {Element} el container to check in
17
- * @param {boolean} includeContainer add container to check
18
- * @param {(node: Element) => boolean} filter filter candidates
19
- * @returns {Element[]}
20
- */
21
- var getCandidates = function getCandidates(el, includeContainer, filter) {
22
- var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));
23
- if (includeContainer && matches.call(el, candidateSelector)) {
24
- candidates.unshift(el);
25
- }
26
- candidates = candidates.filter(filter);
27
- return candidates;
28
- };
29
-
30
- /**
31
- * @callback GetShadowRoot
32
- * @param {Element} element to check for shadow root
33
- * @returns {ShadowRoot|boolean} ShadowRoot if available or boolean indicating if a shadowRoot is attached but not available.
34
- */
35
-
36
- /**
37
- * @callback ShadowRootFilter
38
- * @param {Element} shadowHostNode the element which contains shadow content
39
- * @returns {boolean} true if a shadow root could potentially contain valid candidates.
40
- */
41
-
42
- /**
43
- * @typedef {Object} CandidateScope
44
- * @property {Element} scopeParent contains inner candidates
45
- * @property {Element[]} candidates list of candidates found in the scope parent
46
- */
47
-
48
- /**
49
- * @typedef {Object} IterativeOptions
50
- * @property {GetShadowRoot|boolean} getShadowRoot true if shadow support is enabled; falsy if not;
51
- * if a function, implies shadow support is enabled and either returns the shadow root of an element
52
- * or a boolean stating if it has an undisclosed shadow root
53
- * @property {(node: Element) => boolean} filter filter candidates
54
- * @property {boolean} flatten if true then result will flatten any CandidateScope into the returned list
55
- * @property {ShadowRootFilter} shadowRootFilter filter shadow roots;
56
- */
57
-
58
- /**
59
- * @param {Element[]} elements list of element containers to match candidates from
60
- * @param {boolean} includeContainer add container list to check
61
- * @param {IterativeOptions} options
62
- * @returns {Array.<Element|CandidateScope>}
63
- */
64
- var getCandidatesIteratively = function getCandidatesIteratively(elements, includeContainer, options) {
65
- var candidates = [];
66
- var elementsToCheck = Array.from(elements);
67
- while (elementsToCheck.length) {
68
- var element = elementsToCheck.shift();
69
- if (element.tagName === 'SLOT') {
70
- // add shadow dom slot scope (slot itself cannot be focusable)
71
- var assigned = element.assignedElements();
72
- var content = assigned.length ? assigned : element.children;
73
- var nestedCandidates = getCandidatesIteratively(content, true, options);
74
- if (options.flatten) {
75
- candidates.push.apply(candidates, nestedCandidates);
76
- } else {
77
- candidates.push({
78
- scopeParent: element,
79
- candidates: nestedCandidates
80
- });
81
- }
82
- } else {
83
- // check candidate element
84
- var validCandidate = matches.call(element, candidateSelector);
85
- if (validCandidate && options.filter(element) && (includeContainer || !elements.includes(element))) {
86
- candidates.push(element);
87
- }
88
-
89
- // iterate over shadow content if possible
90
- var shadowRoot = element.shadowRoot ||
91
- // check for an undisclosed shadow
92
- typeof options.getShadowRoot === 'function' && options.getShadowRoot(element);
93
- var validShadowRoot = !options.shadowRootFilter || options.shadowRootFilter(element);
94
- if (shadowRoot && validShadowRoot) {
95
- // add shadow dom scope IIF a shadow root node was given; otherwise, an undisclosed
96
- // shadow exists, so look at light dom children as fallback BUT create a scope for any
97
- // child candidates found because they're likely slotted elements (elements that are
98
- // children of the web component element (which has the shadow), in the light dom, but
99
- // slotted somewhere _inside_ the undisclosed shadow) -- the scope is created below,
100
- // _after_ we return from this recursive call
101
- var _nestedCandidates = getCandidatesIteratively(shadowRoot === true ? element.children : shadowRoot.children, true, options);
102
- if (options.flatten) {
103
- candidates.push.apply(candidates, _nestedCandidates);
104
- } else {
105
- candidates.push({
106
- scopeParent: element,
107
- candidates: _nestedCandidates
108
- });
109
- }
110
- } else {
111
- // there's not shadow so just dig into the element's (light dom) children
112
- // __without__ giving the element special scope treatment
113
- elementsToCheck.unshift.apply(elementsToCheck, element.children);
114
- }
115
- }
116
- }
117
- return candidates;
118
- };
119
- var getTabindex = function getTabindex(node, isScope) {
120
- if (node.tabIndex < 0) {
121
- // in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default
122
- // `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,
123
- // yet they are still part of the regular tab order; in FF, they get a default
124
- // `tabIndex` of 0; since Chrome still puts those elements in the regular tab
125
- // order, consider their tab index to be 0.
126
- // Also browsers do not return `tabIndex` correctly for contentEditable nodes;
127
- // so if they don't have a tabindex attribute specifically set, assume it's 0.
128
- //
129
- // isScope is positive for custom element with shadow root or slot that by default
130
- // have tabIndex -1, but need to be sorted by document order in order for their
131
- // content to be inserted in the correct position
132
- if ((isScope || /^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || node.isContentEditable) && isNaN(parseInt(node.getAttribute('tabindex'), 10))) {
133
- return 0;
134
- }
135
- }
136
- return node.tabIndex;
137
- };
138
- var sortOrderedTabbables = function sortOrderedTabbables(a, b) {
139
- return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;
140
- };
141
- var isInput = function isInput(node) {
142
- return node.tagName === 'INPUT';
143
- };
144
- var isHiddenInput = function isHiddenInput(node) {
145
- return isInput(node) && node.type === 'hidden';
146
- };
147
- var isDetailsWithSummary = function isDetailsWithSummary(node) {
148
- var r = node.tagName === 'DETAILS' && Array.prototype.slice.apply(node.children).some(function (child) {
149
- return child.tagName === 'SUMMARY';
150
- });
151
- return r;
152
- };
153
- var getCheckedRadio = function getCheckedRadio(nodes, form) {
154
- for (var i = 0; i < nodes.length; i++) {
155
- if (nodes[i].checked && nodes[i].form === form) {
156
- return nodes[i];
157
- }
158
- }
159
- };
160
- var isTabbableRadio = function isTabbableRadio(node) {
161
- if (!node.name) {
162
- return true;
163
- }
164
- var radioScope = node.form || getRootNode(node);
165
- var queryRadios = function queryRadios(name) {
166
- return radioScope.querySelectorAll('input[type="radio"][name="' + name + '"]');
167
- };
168
- var radioSet;
169
- if (typeof window !== 'undefined' && typeof window.CSS !== 'undefined' && typeof window.CSS.escape === 'function') {
170
- radioSet = queryRadios(window.CSS.escape(node.name));
171
- } else {
172
- try {
173
- radioSet = queryRadios(node.name);
174
- } catch (err) {
175
- // eslint-disable-next-line no-console
176
- console.error('Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s', err.message);
177
- return false;
178
- }
179
- }
180
- var checked = getCheckedRadio(radioSet, node.form);
181
- return !checked || checked === node;
182
- };
183
- var isRadio = function isRadio(node) {
184
- return isInput(node) && node.type === 'radio';
185
- };
186
- var isNonTabbableRadio = function isNonTabbableRadio(node) {
187
- return isRadio(node) && !isTabbableRadio(node);
188
- };
189
-
190
- // determines if a node is ultimately attached to the window's document
191
- var isNodeAttached = function isNodeAttached(node) {
192
- var _nodeRootHost;
193
- // The root node is the shadow root if the node is in a shadow DOM; some document otherwise
194
- // (but NOT _the_ document; see second 'If' comment below for more).
195
- // If rootNode is shadow root, it'll have a host, which is the element to which the shadow
196
- // is attached, and the one we need to check if it's in the document or not (because the
197
- // shadow, and all nodes it contains, is never considered in the document since shadows
198
- // behave like self-contained DOMs; but if the shadow's HOST, which is part of the document,
199
- // is hidden, or is not in the document itself but is detached, it will affect the shadow's
200
- // visibility, including all the nodes it contains). The host could be any normal node,
201
- // or a custom element (i.e. web component). Either way, that's the one that is considered
202
- // part of the document, not the shadow root, nor any of its children (i.e. the node being
203
- // tested).
204
- // To further complicate things, we have to look all the way up until we find a shadow HOST
205
- // that is attached (or find none) because the node might be in nested shadows...
206
- // If rootNode is not a shadow root, it won't have a host, and so rootNode should be the
207
- // document (per the docs) and while it's a Document-type object, that document does not
208
- // appear to be the same as the node's `ownerDocument` for some reason, so it's safer
209
- // to ignore the rootNode at this point, and use `node.ownerDocument`. Otherwise,
210
- // using `rootNode.contains(node)` will _always_ be true we'll get false-positives when
211
- // node is actually detached.
212
- var nodeRootHost = getRootNode(node).host;
213
- var attached = !!((_nodeRootHost = nodeRootHost) !== null && _nodeRootHost !== void 0 && _nodeRootHost.ownerDocument.contains(nodeRootHost) || node.ownerDocument.contains(node));
214
- while (!attached && nodeRootHost) {
215
- var _nodeRootHost2;
216
- // since it's not attached and we have a root host, the node MUST be in a nested shadow DOM,
217
- // which means we need to get the host's host and check if that parent host is contained
218
- // in (i.e. attached to) the document
219
- nodeRootHost = getRootNode(nodeRootHost).host;
220
- attached = !!((_nodeRootHost2 = nodeRootHost) !== null && _nodeRootHost2 !== void 0 && _nodeRootHost2.ownerDocument.contains(nodeRootHost));
221
- }
222
- return attached;
223
- };
224
- var isZeroArea = function isZeroArea(node) {
225
- var _node$getBoundingClie = node.getBoundingClientRect(),
226
- width = _node$getBoundingClie.width,
227
- height = _node$getBoundingClie.height;
228
- return width === 0 && height === 0;
229
- };
230
- var isHidden = function isHidden(node, _ref) {
231
- var displayCheck = _ref.displayCheck,
232
- getShadowRoot = _ref.getShadowRoot;
233
- // NOTE: visibility will be `undefined` if node is detached from the document
234
- // (see notes about this further down), which means we will consider it visible
235
- // (this is legacy behavior from a very long way back)
236
- // NOTE: we check this regardless of `displayCheck="none"` because this is a
237
- // _visibility_ check, not a _display_ check
238
- if (getComputedStyle(node).visibility === 'hidden') {
239
- return true;
240
- }
241
- var isDirectSummary = matches.call(node, 'details>summary:first-of-type');
242
- var nodeUnderDetails = isDirectSummary ? node.parentElement : node;
243
- if (matches.call(nodeUnderDetails, 'details:not([open]) *')) {
244
- return true;
245
- }
246
- if (!displayCheck || displayCheck === 'full' || displayCheck === 'legacy-full') {
247
- if (typeof getShadowRoot === 'function') {
248
- // figure out if we should consider the node to be in an undisclosed shadow and use the
249
- // 'non-zero-area' fallback
250
- var originalNode = node;
251
- while (node) {
252
- var parentElement = node.parentElement;
253
- var rootNode = getRootNode(node);
254
- if (parentElement && !parentElement.shadowRoot && getShadowRoot(parentElement) === true // check if there's an undisclosed shadow
255
- ) {
256
- // node has an undisclosed shadow which means we can only treat it as a black box, so we
257
- // fall back to a non-zero-area test
258
- return isZeroArea(node);
259
- } else if (node.assignedSlot) {
260
- // iterate up slot
261
- node = node.assignedSlot;
262
- } else if (!parentElement && rootNode !== node.ownerDocument) {
263
- // cross shadow boundary
264
- node = rootNode.host;
265
- } else {
266
- // iterate up normal dom
267
- node = parentElement;
268
- }
269
- }
270
- node = originalNode;
271
- }
272
- // else, `getShadowRoot` might be true, but all that does is enable shadow DOM support
273
- // (i.e. it does not also presume that all nodes might have undisclosed shadows); or
274
- // it might be a falsy value, which means shadow DOM support is disabled
275
-
276
- // Since we didn't find it sitting in an undisclosed shadow (or shadows are disabled)
277
- // now we can just test to see if it would normally be visible or not, provided it's
278
- // attached to the main document.
279
- // NOTE: We must consider case where node is inside a shadow DOM and given directly to
280
- // `isTabbable()` or `isFocusable()` -- regardless of `getShadowRoot` option setting.
281
-
282
- if (isNodeAttached(node)) {
283
- // this works wherever the node is: if there's at least one client rect, it's
284
- // somehow displayed; it also covers the CSS 'display: contents' case where the
285
- // node itself is hidden in place of its contents; and there's no need to search
286
- // up the hierarchy either
287
- return !node.getClientRects().length;
288
- }
289
-
290
- // Else, the node isn't attached to the document, which means the `getClientRects()`
291
- // API will __always__ return zero rects (this can happen, for example, if React
292
- // is used to render nodes onto a detached tree, as confirmed in this thread:
293
- // https://github.com/facebook/react/issues/9117#issuecomment-284228870)
294
- //
295
- // It also means that even window.getComputedStyle(node).display will return `undefined`
296
- // because styles are only computed for nodes that are in the document.
297
- //
298
- // NOTE: THIS HAS BEEN THE CASE FOR YEARS. It is not new, nor is it caused by tabbable
299
- // somehow. Though it was never stated officially, anyone who has ever used tabbable
300
- // APIs on nodes in detached containers has actually implicitly used tabbable in what
301
- // was later (as of v5.2.0 on Apr 9, 2021) called `displayCheck="none"` mode -- essentially
302
- // considering __everything__ to be visible because of the innability to determine styles.
303
- //
304
- // v6.0.0: As of this major release, the default 'full' option __no longer treats detached
305
- // nodes as visible with the 'none' fallback.__
306
- if (displayCheck !== 'legacy-full') {
307
- return true; // hidden
308
- }
309
- // else, fallback to 'none' mode and consider the node visible
310
- } else if (displayCheck === 'non-zero-area') {
311
- // NOTE: Even though this tests that the node's client rect is non-zero to determine
312
- // whether it's displayed, and that a detached node will __always__ have a zero-area
313
- // client rect, we don't special-case for whether the node is attached or not. In
314
- // this mode, we do want to consider nodes that have a zero area to be hidden at all
315
- // times, and that includes attached or not.
316
- return isZeroArea(node);
317
- }
318
-
319
- // visible, as far as we can tell, or per current `displayCheck=none` mode, we assume
320
- // it's visible
321
- return false;
322
- };
323
-
324
- // form fields (nested) inside a disabled fieldset are not focusable/tabbable
325
- // unless they are in the _first_ <legend> element of the top-most disabled
326
- // fieldset
327
- var isDisabledFromFieldset = function isDisabledFromFieldset(node) {
328
- if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) {
329
- var parentNode = node.parentElement;
330
- // check if `node` is contained in a disabled <fieldset>
331
- while (parentNode) {
332
- if (parentNode.tagName === 'FIELDSET' && parentNode.disabled) {
333
- // look for the first <legend> among the children of the disabled <fieldset>
334
- for (var i = 0; i < parentNode.children.length; i++) {
335
- var child = parentNode.children.item(i);
336
- // when the first <legend> (in document order) is found
337
- if (child.tagName === 'LEGEND') {
338
- // if its parent <fieldset> is not nested in another disabled <fieldset>,
339
- // return whether `node` is a descendant of its first <legend>
340
- return matches.call(parentNode, 'fieldset[disabled] *') ? true : !child.contains(node);
341
- }
342
- }
343
- // the disabled <fieldset> containing `node` has no <legend>
344
- return true;
345
- }
346
- parentNode = parentNode.parentElement;
347
- }
348
- }
349
-
350
- // else, node's tabbable/focusable state should not be affected by a fieldset's
351
- // enabled/disabled state
352
- return false;
353
- };
354
- var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable(options, node) {
355
- if (node.disabled || isHiddenInput(node) || isHidden(node, options) ||
356
- // For a details element with a summary, the summary element gets the focus
357
- isDetailsWithSummary(node) || isDisabledFromFieldset(node)) {
358
- return false;
359
- }
360
- return true;
361
- };
362
- var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable(options, node) {
363
- if (isNonTabbableRadio(node) || getTabindex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) {
364
- return false;
365
- }
366
- return true;
367
- };
368
- var isValidShadowRootTabbable = function isValidShadowRootTabbable(shadowHostNode) {
369
- var tabIndex = parseInt(shadowHostNode.getAttribute('tabindex'), 10);
370
- if (isNaN(tabIndex) || tabIndex >= 0) {
371
- return true;
372
- }
373
- // If a custom element has an explicit negative tabindex,
374
- // browsers will not allow tab targeting said element's children.
375
- return false;
376
- };
377
-
378
- /**
379
- * @param {Array.<Element|CandidateScope>} candidates
380
- * @returns Element[]
381
- */
382
- var sortByOrder = function sortByOrder(candidates) {
383
- var regularTabbables = [];
384
- var orderedTabbables = [];
385
- candidates.forEach(function (item, i) {
386
- var isScope = !!item.scopeParent;
387
- var element = isScope ? item.scopeParent : item;
388
- var candidateTabindex = getTabindex(element, isScope);
389
- var elements = isScope ? sortByOrder(item.candidates) : element;
390
- if (candidateTabindex === 0) {
391
- isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element);
392
- } else {
393
- orderedTabbables.push({
394
- documentOrder: i,
395
- tabIndex: candidateTabindex,
396
- item: item,
397
- isScope: isScope,
398
- content: elements
399
- });
400
- }
401
- });
402
- return orderedTabbables.sort(sortOrderedTabbables).reduce(function (acc, sortable) {
403
- sortable.isScope ? acc.push.apply(acc, sortable.content) : acc.push(sortable.content);
404
- return acc;
405
- }, []).concat(regularTabbables);
406
- };
407
- var tabbable = function tabbable(el, options) {
408
- options = options || {};
409
- var candidates;
410
- if (options.getShadowRoot) {
411
- candidates = getCandidatesIteratively([el], options.includeContainer, {
412
- filter: isNodeMatchingSelectorTabbable.bind(null, options),
413
- flatten: false,
414
- getShadowRoot: options.getShadowRoot,
415
- shadowRootFilter: isValidShadowRootTabbable
416
- });
417
- } else {
418
- candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));
419
- }
420
- return sortByOrder(candidates);
421
- };
422
- var focusable = function focusable(el, options) {
423
- options = options || {};
424
- var candidates;
425
- if (options.getShadowRoot) {
426
- candidates = getCandidatesIteratively([el], options.includeContainer, {
427
- filter: isNodeMatchingSelectorFocusable.bind(null, options),
428
- flatten: true,
429
- getShadowRoot: options.getShadowRoot
430
- });
431
- } else {
432
- candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options));
433
- }
434
- return candidates;
435
- };
436
- var isTabbable = function isTabbable(node, options) {
437
- options = options || {};
438
- if (!node) {
439
- throw new Error('No node provided');
440
- }
441
- if (matches.call(node, candidateSelector) === false) {
442
- return false;
443
- }
444
- return isNodeMatchingSelectorTabbable(options, node);
445
- };
446
- var focusableCandidateSelector = /* #__PURE__ */candidateSelectors.concat('iframe').join(',');
447
- var isFocusable = function isFocusable(node, options) {
448
- options = options || {};
449
- if (!node) {
450
- throw new Error('No node provided');
451
- }
452
- if (matches.call(node, focusableCandidateSelector) === false) {
453
- return false;
454
- }
455
- return isNodeMatchingSelectorFocusable(options, node);
456
- };
457
-
458
- const firstTabbable = (container) => {
459
- return (container ? tabbable(container, { includeContainer: true, getShadowRoot: true }) : []).shift();
460
- };
461
-
462
- export { isFocusable as a, firstTabbable as b, focusable as f, isTabbable as i, tabbable as t };
463
-
464
- //# sourceMappingURL=first-tabbable.js.map
@@ -1 +0,0 @@
1
- {"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EAAE;AACpD,EAAE,OAAO,GAAG,OAAO,IAAI,EAAE,CAAC;AAC1B,EAAE,IAAI,CAAC,IAAI,EAAE;AACb,IAAI,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;AACxC,GAAG;AACH,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,iBAAiB,CAAC,KAAK,KAAK,EAAE;AACvD,IAAI,OAAO,KAAK,CAAC;AACjB,GAAG;AACH,EAAE,OAAO,8BAA8B,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AACvD,EAAE;AACF,IAAI,0BAA0B,kBAAkB,kBAAkB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3F,IAAC,WAAW,GAAG,SAAS,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE;AACtD,EAAE,OAAO,GAAG,OAAO,IAAI,EAAE,CAAC;AAC1B,EAAE,IAAI,CAAC,IAAI,EAAE;AACb,IAAI,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;AACxC,GAAG;AACH,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,0BAA0B,CAAC,KAAK,KAAK,EAAE;AAChE,IAAI,OAAO,KAAK,CAAC;AACjB,GAAG;AACH,EAAE,OAAO,+BAA+B,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AACxD;;MCncM,aAAa,GAAG,CAAC,SAAqB;EAC1C,OAAO,CAAC,SAAS,GAAG,QAAQ,CAAC,SAAS,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC;AACzG;;;;","names":[],"sources":["../node_modules/tabbable/dist/index.esm.js","./src/utils/first-tabbable.ts"],"sourcesContent":["/*!\n* tabbable 6.0.1\n* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE\n*/\nvar candidateSelectors = ['input', 'select', 'textarea', 'a[href]', 'button', '[tabindex]:not(slot)', 'audio[controls]', 'video[controls]', '[contenteditable]:not([contenteditable=\"false\"])', 'details>summary:first-of-type', 'details'];\nvar candidateSelector = /* #__PURE__ */candidateSelectors.join(',');\nvar NoElement = typeof Element === 'undefined';\nvar matches = NoElement ? function () {} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\nvar getRootNode = !NoElement && Element.prototype.getRootNode ? function (element) {\n return element.getRootNode();\n} : function (element) {\n return element.ownerDocument;\n};\n\n/**\n * @param {Element} el container to check in\n * @param {boolean} includeContainer add container to check\n * @param {(node: Element) => boolean} filter filter candidates\n * @returns {Element[]}\n */\nvar getCandidates = function getCandidates(el, includeContainer, filter) {\n var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));\n if (includeContainer && matches.call(el, candidateSelector)) {\n candidates.unshift(el);\n }\n candidates = candidates.filter(filter);\n return candidates;\n};\n\n/**\n * @callback GetShadowRoot\n * @param {Element} element to check for shadow root\n * @returns {ShadowRoot|boolean} ShadowRoot if available or boolean indicating if a shadowRoot is attached but not available.\n */\n\n/**\n * @callback ShadowRootFilter\n * @param {Element} shadowHostNode the element which contains shadow content\n * @returns {boolean} true if a shadow root could potentially contain valid candidates.\n */\n\n/**\n * @typedef {Object} CandidateScope\n * @property {Element} scopeParent contains inner candidates\n * @property {Element[]} candidates list of candidates found in the scope parent\n */\n\n/**\n * @typedef {Object} IterativeOptions\n * @property {GetShadowRoot|boolean} getShadowRoot true if shadow support is enabled; falsy if not;\n * if a function, implies shadow support is enabled and either returns the shadow root of an element\n * or a boolean stating if it has an undisclosed shadow root\n * @property {(node: Element) => boolean} filter filter candidates\n * @property {boolean} flatten if true then result will flatten any CandidateScope into the returned list\n * @property {ShadowRootFilter} shadowRootFilter filter shadow roots;\n */\n\n/**\n * @param {Element[]} elements list of element containers to match candidates from\n * @param {boolean} includeContainer add container list to check\n * @param {IterativeOptions} options\n * @returns {Array.<Element|CandidateScope>}\n */\nvar getCandidatesIteratively = function getCandidatesIteratively(elements, includeContainer, options) {\n var candidates = [];\n var elementsToCheck = Array.from(elements);\n while (elementsToCheck.length) {\n var element = elementsToCheck.shift();\n if (element.tagName === 'SLOT') {\n // add shadow dom slot scope (slot itself cannot be focusable)\n var assigned = element.assignedElements();\n var content = assigned.length ? assigned : element.children;\n var nestedCandidates = getCandidatesIteratively(content, true, options);\n if (options.flatten) {\n candidates.push.apply(candidates, nestedCandidates);\n } else {\n candidates.push({\n scopeParent: element,\n candidates: nestedCandidates\n });\n }\n } else {\n // check candidate element\n var validCandidate = matches.call(element, candidateSelector);\n if (validCandidate && options.filter(element) && (includeContainer || !elements.includes(element))) {\n candidates.push(element);\n }\n\n // iterate over shadow content if possible\n var shadowRoot = element.shadowRoot ||\n // check for an undisclosed shadow\n typeof options.getShadowRoot === 'function' && options.getShadowRoot(element);\n var validShadowRoot = !options.shadowRootFilter || options.shadowRootFilter(element);\n if (shadowRoot && validShadowRoot) {\n // add shadow dom scope IIF a shadow root node was given; otherwise, an undisclosed\n // shadow exists, so look at light dom children as fallback BUT create a scope for any\n // child candidates found because they're likely slotted elements (elements that are\n // children of the web component element (which has the shadow), in the light dom, but\n // slotted somewhere _inside_ the undisclosed shadow) -- the scope is created below,\n // _after_ we return from this recursive call\n var _nestedCandidates = getCandidatesIteratively(shadowRoot === true ? element.children : shadowRoot.children, true, options);\n if (options.flatten) {\n candidates.push.apply(candidates, _nestedCandidates);\n } else {\n candidates.push({\n scopeParent: element,\n candidates: _nestedCandidates\n });\n }\n } else {\n // there's not shadow so just dig into the element's (light dom) children\n // __without__ giving the element special scope treatment\n elementsToCheck.unshift.apply(elementsToCheck, element.children);\n }\n }\n }\n return candidates;\n};\nvar getTabindex = function getTabindex(node, isScope) {\n if (node.tabIndex < 0) {\n // in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default\n // `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,\n // yet they are still part of the regular tab order; in FF, they get a default\n // `tabIndex` of 0; since Chrome still puts those elements in the regular tab\n // order, consider their tab index to be 0.\n // Also browsers do not return `tabIndex` correctly for contentEditable nodes;\n // so if they don't have a tabindex attribute specifically set, assume it's 0.\n //\n // isScope is positive for custom element with shadow root or slot that by default\n // have tabIndex -1, but need to be sorted by document order in order for their\n // content to be inserted in the correct position\n if ((isScope || /^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || node.isContentEditable) && isNaN(parseInt(node.getAttribute('tabindex'), 10))) {\n return 0;\n }\n }\n return node.tabIndex;\n};\nvar sortOrderedTabbables = function sortOrderedTabbables(a, b) {\n return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;\n};\nvar isInput = function isInput(node) {\n return node.tagName === 'INPUT';\n};\nvar isHiddenInput = function isHiddenInput(node) {\n return isInput(node) && node.type === 'hidden';\n};\nvar isDetailsWithSummary = function isDetailsWithSummary(node) {\n var r = node.tagName === 'DETAILS' && Array.prototype.slice.apply(node.children).some(function (child) {\n return child.tagName === 'SUMMARY';\n });\n return r;\n};\nvar getCheckedRadio = function getCheckedRadio(nodes, form) {\n for (var i = 0; i < nodes.length; i++) {\n if (nodes[i].checked && nodes[i].form === form) {\n return nodes[i];\n }\n }\n};\nvar isTabbableRadio = function isTabbableRadio(node) {\n if (!node.name) {\n return true;\n }\n var radioScope = node.form || getRootNode(node);\n var queryRadios = function queryRadios(name) {\n return radioScope.querySelectorAll('input[type=\"radio\"][name=\"' + name + '\"]');\n };\n var radioSet;\n if (typeof window !== 'undefined' && typeof window.CSS !== 'undefined' && typeof window.CSS.escape === 'function') {\n radioSet = queryRadios(window.CSS.escape(node.name));\n } else {\n try {\n radioSet = queryRadios(node.name);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error('Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s', err.message);\n return false;\n }\n }\n var checked = getCheckedRadio(radioSet, node.form);\n return !checked || checked === node;\n};\nvar isRadio = function isRadio(node) {\n return isInput(node) && node.type === 'radio';\n};\nvar isNonTabbableRadio = function isNonTabbableRadio(node) {\n return isRadio(node) && !isTabbableRadio(node);\n};\n\n// determines if a node is ultimately attached to the window's document\nvar isNodeAttached = function isNodeAttached(node) {\n var _nodeRootHost;\n // The root node is the shadow root if the node is in a shadow DOM; some document otherwise\n // (but NOT _the_ document; see second 'If' comment below for more).\n // If rootNode is shadow root, it'll have a host, which is the element to which the shadow\n // is attached, and the one we need to check if it's in the document or not (because the\n // shadow, and all nodes it contains, is never considered in the document since shadows\n // behave like self-contained DOMs; but if the shadow's HOST, which is part of the document,\n // is hidden, or is not in the document itself but is detached, it will affect the shadow's\n // visibility, including all the nodes it contains). The host could be any normal node,\n // or a custom element (i.e. web component). Either way, that's the one that is considered\n // part of the document, not the shadow root, nor any of its children (i.e. the node being\n // tested).\n // To further complicate things, we have to look all the way up until we find a shadow HOST\n // that is attached (or find none) because the node might be in nested shadows...\n // If rootNode is not a shadow root, it won't have a host, and so rootNode should be the\n // document (per the docs) and while it's a Document-type object, that document does not\n // appear to be the same as the node's `ownerDocument` for some reason, so it's safer\n // to ignore the rootNode at this point, and use `node.ownerDocument`. Otherwise,\n // using `rootNode.contains(node)` will _always_ be true we'll get false-positives when\n // node is actually detached.\n var nodeRootHost = getRootNode(node).host;\n var attached = !!((_nodeRootHost = nodeRootHost) !== null && _nodeRootHost !== void 0 && _nodeRootHost.ownerDocument.contains(nodeRootHost) || node.ownerDocument.contains(node));\n while (!attached && nodeRootHost) {\n var _nodeRootHost2;\n // since it's not attached and we have a root host, the node MUST be in a nested shadow DOM,\n // which means we need to get the host's host and check if that parent host is contained\n // in (i.e. attached to) the document\n nodeRootHost = getRootNode(nodeRootHost).host;\n attached = !!((_nodeRootHost2 = nodeRootHost) !== null && _nodeRootHost2 !== void 0 && _nodeRootHost2.ownerDocument.contains(nodeRootHost));\n }\n return attached;\n};\nvar isZeroArea = function isZeroArea(node) {\n var _node$getBoundingClie = node.getBoundingClientRect(),\n width = _node$getBoundingClie.width,\n height = _node$getBoundingClie.height;\n return width === 0 && height === 0;\n};\nvar isHidden = function isHidden(node, _ref) {\n var displayCheck = _ref.displayCheck,\n getShadowRoot = _ref.getShadowRoot;\n // NOTE: visibility will be `undefined` if node is detached from the document\n // (see notes about this further down), which means we will consider it visible\n // (this is legacy behavior from a very long way back)\n // NOTE: we check this regardless of `displayCheck=\"none\"` because this is a\n // _visibility_ check, not a _display_ check\n if (getComputedStyle(node).visibility === 'hidden') {\n return true;\n }\n var isDirectSummary = matches.call(node, 'details>summary:first-of-type');\n var nodeUnderDetails = isDirectSummary ? node.parentElement : node;\n if (matches.call(nodeUnderDetails, 'details:not([open]) *')) {\n return true;\n }\n if (!displayCheck || displayCheck === 'full' || displayCheck === 'legacy-full') {\n if (typeof getShadowRoot === 'function') {\n // figure out if we should consider the node to be in an undisclosed shadow and use the\n // 'non-zero-area' fallback\n var originalNode = node;\n while (node) {\n var parentElement = node.parentElement;\n var rootNode = getRootNode(node);\n if (parentElement && !parentElement.shadowRoot && getShadowRoot(parentElement) === true // check if there's an undisclosed shadow\n ) {\n // node has an undisclosed shadow which means we can only treat it as a black box, so we\n // fall back to a non-zero-area test\n return isZeroArea(node);\n } else if (node.assignedSlot) {\n // iterate up slot\n node = node.assignedSlot;\n } else if (!parentElement && rootNode !== node.ownerDocument) {\n // cross shadow boundary\n node = rootNode.host;\n } else {\n // iterate up normal dom\n node = parentElement;\n }\n }\n node = originalNode;\n }\n // else, `getShadowRoot` might be true, but all that does is enable shadow DOM support\n // (i.e. it does not also presume that all nodes might have undisclosed shadows); or\n // it might be a falsy value, which means shadow DOM support is disabled\n\n // Since we didn't find it sitting in an undisclosed shadow (or shadows are disabled)\n // now we can just test to see if it would normally be visible or not, provided it's\n // attached to the main document.\n // NOTE: We must consider case where node is inside a shadow DOM and given directly to\n // `isTabbable()` or `isFocusable()` -- regardless of `getShadowRoot` option setting.\n\n if (isNodeAttached(node)) {\n // this works wherever the node is: if there's at least one client rect, it's\n // somehow displayed; it also covers the CSS 'display: contents' case where the\n // node itself is hidden in place of its contents; and there's no need to search\n // up the hierarchy either\n return !node.getClientRects().length;\n }\n\n // Else, the node isn't attached to the document, which means the `getClientRects()`\n // API will __always__ return zero rects (this can happen, for example, if React\n // is used to render nodes onto a detached tree, as confirmed in this thread:\n // https://github.com/facebook/react/issues/9117#issuecomment-284228870)\n //\n // It also means that even window.getComputedStyle(node).display will return `undefined`\n // because styles are only computed for nodes that are in the document.\n //\n // NOTE: THIS HAS BEEN THE CASE FOR YEARS. It is not new, nor is it caused by tabbable\n // somehow. Though it was never stated officially, anyone who has ever used tabbable\n // APIs on nodes in detached containers has actually implicitly used tabbable in what\n // was later (as of v5.2.0 on Apr 9, 2021) called `displayCheck=\"none\"` mode -- essentially\n // considering __everything__ to be visible because of the innability to determine styles.\n //\n // v6.0.0: As of this major release, the default 'full' option __no longer treats detached\n // nodes as visible with the 'none' fallback.__\n if (displayCheck !== 'legacy-full') {\n return true; // hidden\n }\n // else, fallback to 'none' mode and consider the node visible\n } else if (displayCheck === 'non-zero-area') {\n // NOTE: Even though this tests that the node's client rect is non-zero to determine\n // whether it's displayed, and that a detached node will __always__ have a zero-area\n // client rect, we don't special-case for whether the node is attached or not. In\n // this mode, we do want to consider nodes that have a zero area to be hidden at all\n // times, and that includes attached or not.\n return isZeroArea(node);\n }\n\n // visible, as far as we can tell, or per current `displayCheck=none` mode, we assume\n // it's visible\n return false;\n};\n\n// form fields (nested) inside a disabled fieldset are not focusable/tabbable\n// unless they are in the _first_ <legend> element of the top-most disabled\n// fieldset\nvar isDisabledFromFieldset = function isDisabledFromFieldset(node) {\n if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) {\n var parentNode = node.parentElement;\n // check if `node` is contained in a disabled <fieldset>\n while (parentNode) {\n if (parentNode.tagName === 'FIELDSET' && parentNode.disabled) {\n // look for the first <legend> among the children of the disabled <fieldset>\n for (var i = 0; i < parentNode.children.length; i++) {\n var child = parentNode.children.item(i);\n // when the first <legend> (in document order) is found\n if (child.tagName === 'LEGEND') {\n // if its parent <fieldset> is not nested in another disabled <fieldset>,\n // return whether `node` is a descendant of its first <legend>\n return matches.call(parentNode, 'fieldset[disabled] *') ? true : !child.contains(node);\n }\n }\n // the disabled <fieldset> containing `node` has no <legend>\n return true;\n }\n parentNode = parentNode.parentElement;\n }\n }\n\n // else, node's tabbable/focusable state should not be affected by a fieldset's\n // enabled/disabled state\n return false;\n};\nvar isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable(options, node) {\n if (node.disabled || isHiddenInput(node) || isHidden(node, options) ||\n // For a details element with a summary, the summary element gets the focus\n isDetailsWithSummary(node) || isDisabledFromFieldset(node)) {\n return false;\n }\n return true;\n};\nvar isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable(options, node) {\n if (isNonTabbableRadio(node) || getTabindex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) {\n return false;\n }\n return true;\n};\nvar isValidShadowRootTabbable = function isValidShadowRootTabbable(shadowHostNode) {\n var tabIndex = parseInt(shadowHostNode.getAttribute('tabindex'), 10);\n if (isNaN(tabIndex) || tabIndex >= 0) {\n return true;\n }\n // If a custom element has an explicit negative tabindex,\n // browsers will not allow tab targeting said element's children.\n return false;\n};\n\n/**\n * @param {Array.<Element|CandidateScope>} candidates\n * @returns Element[]\n */\nvar sortByOrder = function sortByOrder(candidates) {\n var regularTabbables = [];\n var orderedTabbables = [];\n candidates.forEach(function (item, i) {\n var isScope = !!item.scopeParent;\n var element = isScope ? item.scopeParent : item;\n var candidateTabindex = getTabindex(element, isScope);\n var elements = isScope ? sortByOrder(item.candidates) : element;\n if (candidateTabindex === 0) {\n isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element);\n } else {\n orderedTabbables.push({\n documentOrder: i,\n tabIndex: candidateTabindex,\n item: item,\n isScope: isScope,\n content: elements\n });\n }\n });\n return orderedTabbables.sort(sortOrderedTabbables).reduce(function (acc, sortable) {\n sortable.isScope ? acc.push.apply(acc, sortable.content) : acc.push(sortable.content);\n return acc;\n }, []).concat(regularTabbables);\n};\nvar tabbable = function tabbable(el, options) {\n options = options || {};\n var candidates;\n if (options.getShadowRoot) {\n candidates = getCandidatesIteratively([el], options.includeContainer, {\n filter: isNodeMatchingSelectorTabbable.bind(null, options),\n flatten: false,\n getShadowRoot: options.getShadowRoot,\n shadowRootFilter: isValidShadowRootTabbable\n });\n } else {\n candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));\n }\n return sortByOrder(candidates);\n};\nvar focusable = function focusable(el, options) {\n options = options || {};\n var candidates;\n if (options.getShadowRoot) {\n candidates = getCandidatesIteratively([el], options.includeContainer, {\n filter: isNodeMatchingSelectorFocusable.bind(null, options),\n flatten: true,\n getShadowRoot: options.getShadowRoot\n });\n } else {\n candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options));\n }\n return candidates;\n};\nvar isTabbable = function isTabbable(node, options) {\n options = options || {};\n if (!node) {\n throw new Error('No node provided');\n }\n if (matches.call(node, candidateSelector) === false) {\n return false;\n }\n return isNodeMatchingSelectorTabbable(options, node);\n};\nvar focusableCandidateSelector = /* #__PURE__ */candidateSelectors.concat('iframe').join(',');\nvar isFocusable = function isFocusable(node, options) {\n options = options || {};\n if (!node) {\n throw new Error('No node provided');\n }\n if (matches.call(node, focusableCandidateSelector) === false) {\n return false;\n }\n return isNodeMatchingSelectorFocusable(options, node);\n};\n\nexport { focusable, isFocusable, isTabbable, tabbable };\n//# sourceMappingURL=index.esm.js.map\n","import { FocusableElement, tabbable } from 'tabbable';\n\ntype Container = Element | FocusableElement | null;\n\nconst firstTabbable = (container?: Container): FocusableElement | undefined => {\n return (container ? tabbable(container, { includeContainer: true, getShadowRoot: true }) : []).shift();\n};\n\nexport default firstTabbable;\n"],"version":3}