@getflip/swirl-components 0.95.0 → 0.95.2

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 (41) hide show
  1. package/components.json +1 -1
  2. package/dist/cjs/swirl-action-list_3.cjs.entry.js +10 -20
  3. package/dist/cjs/swirl-app-layout_7.cjs.entry.js +20 -9
  4. package/dist/cjs/swirl-autocomplete.cjs.entry.js +10 -2
  5. package/dist/cjs/swirl-modal.cjs.entry.js +1 -1
  6. package/dist/cjs/swirl-option-list_2.cjs.entry.js +5 -3
  7. package/dist/cjs/swirl-select.cjs.entry.js +4 -2
  8. package/dist/collection/assets/pdfjs/pdf.worker.min.js +22 -0
  9. package/dist/collection/components/swirl-action-list/swirl-action-list.js +10 -20
  10. package/dist/collection/components/swirl-autocomplete/swirl-autocomplete.js +10 -2
  11. package/dist/collection/components/swirl-modal/swirl-modal.css +1 -0
  12. package/dist/collection/components/swirl-option-list/swirl-option-list.js +5 -3
  13. package/dist/collection/components/swirl-resource-list/swirl-resource-list.js +20 -9
  14. package/dist/collection/components/swirl-resource-list/swirl-resource-list.spec.js +8 -9
  15. package/dist/collection/components/swirl-select/swirl-select.js +4 -2
  16. package/dist/components/assets/pdfjs/pdf.worker.min.js +22 -0
  17. package/dist/components/swirl-action-list2.js +10 -20
  18. package/dist/components/swirl-autocomplete.js +10 -2
  19. package/dist/components/swirl-modal.js +1 -1
  20. package/dist/components/swirl-option-list2.js +5 -3
  21. package/dist/components/swirl-resource-list2.js +20 -9
  22. package/dist/components/swirl-select.js +4 -2
  23. package/dist/esm/swirl-action-list_3.entry.js +10 -20
  24. package/dist/esm/swirl-app-layout_7.entry.js +20 -9
  25. package/dist/esm/swirl-autocomplete.entry.js +10 -2
  26. package/dist/esm/swirl-modal.entry.js +1 -1
  27. package/dist/esm/swirl-option-list_2.entry.js +5 -3
  28. package/dist/esm/swirl-select.entry.js +4 -2
  29. package/dist/swirl-components/{p-89898ac6.entry.js → p-057b650a.entry.js} +1 -1
  30. package/dist/swirl-components/p-0e6c2f2b.entry.js +1 -0
  31. package/dist/swirl-components/{p-789efdba.entry.js → p-0fc0cd2c.entry.js} +1 -1
  32. package/dist/swirl-components/p-59408f77.entry.js +1 -0
  33. package/dist/swirl-components/p-6f07c958.entry.js +1 -0
  34. package/dist/swirl-components/{p-1d1edae3.entry.js → p-8a00faee.entry.js} +1 -1
  35. package/dist/swirl-components/swirl-components.esm.js +1 -1
  36. package/dist/types/components/swirl-action-list/swirl-action-list.d.ts +1 -6
  37. package/dist/types/components/swirl-select/swirl-select.d.ts +2 -0
  38. package/package.json +1 -1
  39. package/dist/swirl-components/p-0067f11b.entry.js +0 -1
  40. package/dist/swirl-components/p-56fa872b.entry.js +0 -1
  41. package/dist/swirl-components/p-bf258885.entry.js +0 -1
package/components.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2023-09-20T09:52:00",
2
+ "timestamp": "2023-09-26T06:56:00",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "3.3.1",
@@ -22,35 +22,25 @@ const SwirlActionList = class {
22
22
  }
23
23
  };
24
24
  }
25
- componentDidLoad() {
26
- this.updateItems();
27
- this.observeSlotChanges();
28
- }
29
- disconnectedCallback() {
30
- this.observer?.disconnect();
31
- }
32
- observeSlotChanges() {
33
- this.observer = new MutationObserver(() => {
34
- this.updateItems();
35
- });
36
- this.observer.observe(this.el, { childList: true });
37
- }
38
- updateItems() {
39
- this.items = utils.querySelectorAllDeep(this.el, '[role="menuitem"]');
25
+ getItems() {
26
+ return utils.querySelectorAllDeep(this.el, '[role="menuitem"]');
40
27
  }
41
28
  focusNextItem() {
29
+ const items = this.getItems();
42
30
  const activeItemIndex = this.getActiveItemIndex();
43
- const newIndex = (activeItemIndex + 1) % this.items.length;
44
- this.items[newIndex].focus();
31
+ const newIndex = (activeItemIndex + 1) % items.length;
32
+ items[newIndex].focus();
45
33
  }
46
34
  focusPreviousItem() {
35
+ const items = this.getItems();
47
36
  const activeItemIndex = this.getActiveItemIndex();
48
- const newIndex = activeItemIndex === 0 ? this.items.length - 1 : activeItemIndex - 1;
49
- this.items[newIndex]?.focus();
37
+ const newIndex = activeItemIndex === 0 ? items.length - 1 : activeItemIndex - 1;
38
+ items[newIndex]?.focus();
50
39
  }
51
40
  getActiveItemIndex() {
41
+ const items = this.getItems();
52
42
  const activeElement = utils.getActiveElement();
53
- return this.items.findIndex((item) => item === activeElement ||
43
+ return items.findIndex((item) => item === activeElement ||
54
44
  item === activeElement?.querySelector('[role="menuitem"]'));
55
45
  }
56
46
  render() {
@@ -315,7 +315,7 @@ const SwirlResourceList = class {
315
315
  this.draggingStartIndex = undefined;
316
316
  };
317
317
  this.onKeyDown = (event) => {
318
- if (event.key === "ArrowDown") {
318
+ if (event.code === "ArrowDown") {
319
319
  event.preventDefault();
320
320
  if (!Boolean(this.dragging)) {
321
321
  this.focusItemAtIndex((this.focusedIndex + 1) % this.items.length);
@@ -324,7 +324,7 @@ const SwirlResourceList = class {
324
324
  this.moveDraggedItemDown();
325
325
  }
326
326
  }
327
- else if (event.key === "ArrowUp") {
327
+ else if (event.code === "ArrowUp") {
328
328
  event.preventDefault();
329
329
  if (!Boolean(this.dragging)) {
330
330
  const prevIndex = this.focusedIndex === 0
@@ -336,7 +336,7 @@ const SwirlResourceList = class {
336
336
  this.moveDraggedItemUp();
337
337
  }
338
338
  }
339
- else if (event.key === "Space" || event.key === "Enter") {
339
+ else if (event.code === "Space" || event.code === "Enter") {
340
340
  const target = event.composedPath()[0];
341
341
  if (Boolean(this.dragging) &&
342
342
  !target?.classList.contains("resource-list-item__drag-handle")) {
@@ -344,11 +344,11 @@ const SwirlResourceList = class {
344
344
  this.stopDrag(this.dragging);
345
345
  }
346
346
  }
347
- else if (event.key === "Home") {
347
+ else if (event.code === "Home") {
348
348
  event.preventDefault();
349
349
  this.focusItemAtIndex(0);
350
350
  }
351
- else if (event.key === "End") {
351
+ else if (event.code === "End") {
352
352
  event.preventDefault();
353
353
  this.focusItemAtIndex(this.items.length - 1);
354
354
  }
@@ -376,7 +376,11 @@ const SwirlResourceList = class {
376
376
  this.setItemAllowDragState();
377
377
  this.setupDragDrop();
378
378
  });
379
- this.observer.observe(this.el, { childList: true });
379
+ this.observer.observe(this.el, {
380
+ childList: true,
381
+ characterData: true,
382
+ subtree: true,
383
+ });
380
384
  }
381
385
  watchAllowDrag() {
382
386
  this.setItemAllowDragState();
@@ -391,9 +395,12 @@ const SwirlResourceList = class {
391
395
  return this.items.map((i) => i).findIndex((i) => i === item);
392
396
  }
393
397
  removeItemsFromTabOrder() {
394
- this.items.forEach((item) => item
395
- ?.querySelector(".resource-list-item__content, .resource-list-file-item")
396
- ?.setAttribute("tabIndex", "-1"));
398
+ this.items.forEach((item) => {
399
+ const focusableEl = item?.querySelector(".resource-list-item__content, .resource-list-file-item");
400
+ const dragHandle = item?.querySelector(".resource-list-item__drag-handle");
401
+ focusableEl?.setAttribute("tabIndex", "-1");
402
+ dragHandle?.setAttribute("tabIndex", "-1");
403
+ });
397
404
  }
398
405
  setItemAllowDragState() {
399
406
  if (this.allowDrag) {
@@ -434,6 +441,10 @@ const SwirlResourceList = class {
434
441
  return;
435
442
  }
436
443
  const interactiveElement = item.querySelector(".resource-list-item__content, .resource-list-file-item");
444
+ const dragHandle = item.querySelector(".resource-list-item__drag-handle");
445
+ if (Boolean(dragHandle)) {
446
+ dragHandle.setAttribute("tabIndex", "0");
447
+ }
437
448
  if (!Boolean(interactiveElement)) {
438
449
  return;
439
450
  }
@@ -41,8 +41,16 @@ const SwirlAutocomplete = class {
41
41
  !this.value.some((item) => item.id === suggestion.id)),
42
42
  ];
43
43
  this.valueChange.emit(this.value);
44
- this.inputEl.querySelector("input")?.focus();
45
- await this.updateSuggestions(this.inputEl.querySelector("input").value);
44
+ this.inputEl.value = "";
45
+ const input = this.inputEl.querySelector("input");
46
+ if (Boolean(input)) {
47
+ input.value = "";
48
+ queueMicrotask(() => {
49
+ input.focus();
50
+ this.close();
51
+ });
52
+ this.updateSuggestions(input.value);
53
+ }
46
54
  }
47
55
  else {
48
56
  if (Boolean(event.detail[0])) {
@@ -1148,7 +1148,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
1148
1148
  return trap;
1149
1149
  };
1150
1150
 
1151
- const swirlModalCss = ":host{display:block}:host *{box-sizing:border-box}.modal{--swirl-ghost-button-background-default:var(--s-surface-overlay-default);--swirl-ghost-button-background-hovered:var(--s-surface-overlay-hovered);--swirl-ghost-button-background-pressed:var(--s-surface-overlay-pressed);--swirl-resource-list-item-background-default:var(\n --s-surface-overlay-default\n );--swirl-resource-list-item-background-hovered:var(\n --s-surface-overlay-hovered\n );--swirl-resource-list-item-background-pressed:var(\n --s-surface-overlay-pressed\n );--swirl-modal-height:auto;--swirl-modal-max-height:90vh;position:fixed;z-index:var(--s-z-40);display:flex;justify-content:center;align-items:center;inset:0}.modal[aria-hidden=\"true\"]{display:none}.modal--variant-default.modal--closing{animation:0.15s modal-fade-out;animation-fill-mode:forwards}@media (prefers-reduced-motion){.modal--variant-default.modal--closing{animation:none}}.modal--variant-default:not(.modal--closing) .modal__backdrop{animation:0.15s modal-backdrop-fade-in}@media (prefers-reduced-motion){.modal--variant-default:not(.modal--closing) .modal__backdrop{animation:none}}.modal--variant-default:not(.modal--closing) .modal__body{animation:0.15s modal-scale-in}@media (prefers-reduced-motion){.modal--variant-default:not(.modal--closing) .modal__body{animation:none}}.modal--variant-drawer{justify-content:end;align-items:stretch}.modal--variant-drawer.modal--closing{animation:0.15s modal-drawer-slide-out;animation-fill-mode:forwards}@media (prefers-reduced-motion){.modal--variant-drawer.modal--closing{animation:none}}@media (min-width: 768px){.modal--variant-drawer.modal--hide-label .modal__header-bar{height:auto;padding-top:var(--s-space-4);padding-bottom:var(--s-space-4)}}.modal--variant-drawer .modal__backdrop{background-color:transparent;animation:none}.modal--variant-drawer .modal__body{height:100%;max-height:none;border-radius:0;animation:0.15s modal-drawer-slide-in;box-shadow:var(--s-shadow-level-3)}@media (prefers-reduced-motion){.modal--variant-drawer .modal__body{animation:none}}.modal--variant-drawer .modal__header-bar{background-color:var(--s-surface-overlay-default)}.modal--variant-drawer .modal__header-bar .modal__close-button{margin-left:calc(-1 * var(--s-space-8))}@media (min-width: 768px){.modal--variant-drawer .modal__header-bar{flex-direction:row}}@media (min-width: 768px){.modal--variant-drawer.modal--padded .modal__content{padding-top:var(--s-space-8)}}.modal--padded .modal__content{padding-top:var(--s-space-24);padding-right:var(--s-space-16);padding-bottom:var(--s-space-24);padding-left:var(--s-space-16)}@media (min-width: 768px){.modal--padded .modal__content{padding-top:0;padding-right:var(--s-space-24);padding-bottom:var(--s-space-16);padding-left:var(--s-space-24)}}@media (min-width: 768px){.modal--scrollable .modal__content{padding-bottom:0}}.modal--scrollable:not(.modal--scrolled-down).modal--has-custom-footer .modal__custom-footer{border-top:var(--s-border-width-default) solid var(--s-border-default)}.modal--scrollable:not(.modal--scrolled-down):not(.modal--has-custom-footer) .modal__controls{border-top:var(--s-border-width-default) solid var(--s-border-default)}.modal--has-custom-header .modal__content{padding-top:var(--s-space-16)}.modal--has-custom-footer .modal__custom-footer{padding-top:var(--s-space-16);padding-right:var(--s-space-24);padding-bottom:var(--s-space-16);padding-left:var(--s-space-24)}.modal--has-header-tools .modal__header{border-bottom-color:transparent}.modal--has-header-tools .modal__header-tools{display:block}.modal--has-secondary-content .modal__body{max-width:64rem}.modal--has-secondary-content:not(.modal--has-header-tools) .modal__header{border-bottom-color:var(--s-border-default)}.modal--has-secondary-content.modal--has-header-tools .modal__header-tools{border-bottom-color:var(--s-border-default)}.modal--has-secondary-content.modal--has-custom-footer .modal__custom-footer{border-top:var(--s-border-width-default) solid var(--s-border-default)}.modal--has-secondary-content:not(.modal--has-custom-footer) .modal__controls{border-top:var(--s-border-width-default) solid var(--s-border-default)}@media (min-width: 992px){.modal--has-secondary-content .modal__header-tools,.modal--has-secondary-content .modal__content{padding-right:0}}.modal--has-secondary-content .modal__primary-content{overflow:visible;max-height:60%;flex-basis:auto}@media (min-width: 992px){.modal--has-secondary-content .modal__primary-content{max-height:none;flex-basis:calc(100% - 24rem)}}.modal--has-secondary-content .modal__secondary-content{display:block}@media (min-width: 768px){.modal--scrolled:not(.modal--has-header-tools) .modal__header{border-bottom-color:var(--s-border-default)}.modal--scrolled.modal--has-header-tools .modal__header-tools{border-bottom-color:var(--s-border-default)}}.modal__backdrop{position:fixed;background-color:rgba(0, 0, 0, 0.2);inset:0}.modal__body{position:relative;z-index:var(--s-z-40);display:flex;overflow:hidden;width:100vw;max-width:40rem;height:100vh;background-color:var(--s-surface-overlay-default);flex-direction:column}@media (min-width: 768px){.modal__body{width:90vw;max-height:var(--swirl-modal-max-height);border-radius:var(--s-border-radius-base);box-shadow:var(--s-shadow-level-3)}}@media (min-width: 992px){.modal__body{height:var(--swirl-modal-height)}}.modal__header{border-bottom:var(--s-border-width-default) solid var(--s-border-default)}@media (min-width: 768px){.modal__header{border-bottom:var(--s-border-width-default) solid transparent}}.modal__header-bar{display:flex;height:3.5rem;padding-top:var(--s-space-8);padding-right:var(--s-space-16);padding-bottom:var(--s-space-8);padding-left:var(--s-space-16);flex-shrink:0;align-items:center;gap:var(--s-space-8)}@media (min-width: 768px){.modal__header-bar{height:4.125rem;padding-top:var(--s-space-24);padding-right:var(--s-space-24);padding-bottom:var(--s-space-16);padding-left:var(--s-space-24);flex-direction:row-reverse;gap:var(--s-space-16)}}.modal__header-tools{display:none;padding-right:var(--s-space-16);padding-left:var(--s-space-16);border-bottom:var(--s-border-width-default) solid var(--s-border-default)}@media (min-width: 768px){.modal__header-tools{padding-right:var(--s-space-24);padding-left:var(--s-space-24);border-bottom-color:transparent}}.modal__custom-header{flex-shrink:0;border-bottom:var(--s-border-width-default) solid var(--s-border-default)}.modal__heading{overflow:hidden}.modal__heading .heading{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.modal__content-container{display:flex;overflow:hidden;flex-grow:1;flex-direction:column;gap:var(--s-space-24)}@media (min-width: 992px){.modal__content-container{flex-direction:row}}.modal__primary-content{display:flex;overflow:hidden;flex-basis:100%;flex-direction:column}.modal__content{overflow-x:hidden;overflow-y:auto}.modal__content ::slotted(*){margin:0}.modal__secondary-content{display:none;overflow:visible;overflow-x:hidden;overflow-y:auto;max-width:none;max-height:40%;padding-right:var(--s-space-16);padding-left:var(--s-space-16)}@media (min-width: 768px){.modal__secondary-content{padding-left:var(--s-space-24)}}@media (min-width: 992px){.modal__secondary-content{overflow-x:hidden;overflow-y:auto;max-width:24rem;max-height:none;padding-right:var(--s-space-24);padding-bottom:var(--s-space-16);padding-left:0;flex-basis:50%}}.modal__custom-footer{flex-shrink:0}.modal__controls{display:flex;padding-top:var(--s-space-16);padding-right:var(--s-space-24);padding-bottom:var(--s-space-16);padding-left:var(--s-space-24);flex-shrink:0;justify-content:flex-end}@keyframes modal-scale-in{from{transform:scale(0)}to{transform:scale(1)}}@keyframes modal-backdrop-fade-in{from{opacity:0}to{opacity:1}}@keyframes modal-fade-out{from{opacity:1}to{opacity:0}}@keyframes modal-drawer-slide-in{from{transform:translate3d(100%, 0, 0)}to{transform:translate3d(0, 0, 0)}}@keyframes modal-drawer-slide-out{from{transform:translate3d(0, 0, 0)}to{transform:translate3d(100%, 0, 0)}}";
1151
+ const swirlModalCss = ":host{display:block}:host *{box-sizing:border-box}.modal{--swirl-ghost-button-background-default:var(--s-surface-overlay-default);--swirl-ghost-button-background-hovered:var(--s-surface-overlay-hovered);--swirl-ghost-button-background-pressed:var(--s-surface-overlay-pressed);--swirl-resource-list-item-background-default:var(\n --s-surface-overlay-default\n );--swirl-resource-list-item-background-hovered:var(\n --s-surface-overlay-hovered\n );--swirl-resource-list-item-background-pressed:var(\n --s-surface-overlay-pressed\n );--swirl-modal-height:auto;--swirl-modal-max-height:90vh;position:fixed;z-index:var(--s-z-40);display:flex;justify-content:center;align-items:center;inset:0}.modal[aria-hidden=\"true\"]{display:none}.modal--variant-default.modal--closing{animation:0.15s modal-fade-out;animation-fill-mode:forwards}@media (prefers-reduced-motion){.modal--variant-default.modal--closing{animation:none}}.modal--variant-default:not(.modal--closing) .modal__backdrop{animation:0.15s modal-backdrop-fade-in}@media (prefers-reduced-motion){.modal--variant-default:not(.modal--closing) .modal__backdrop{animation:none}}.modal--variant-default:not(.modal--closing) .modal__body{animation:0.15s modal-scale-in}@media (prefers-reduced-motion){.modal--variant-default:not(.modal--closing) .modal__body{animation:none}}.modal--variant-drawer{justify-content:end;align-items:stretch}.modal--variant-drawer.modal--closing{animation:0.15s modal-drawer-slide-out;animation-fill-mode:forwards}@media (prefers-reduced-motion){.modal--variant-drawer.modal--closing{animation:none}}@media (min-width: 768px){.modal--variant-drawer.modal--hide-label .modal__header-bar{height:auto;padding-top:var(--s-space-4);padding-bottom:var(--s-space-4)}}.modal--variant-drawer .modal__backdrop{background-color:transparent;animation:none}.modal--variant-drawer .modal__body{height:100%;max-height:none;border-radius:0;animation:0.15s modal-drawer-slide-in;box-shadow:var(--s-shadow-level-3)}@media (prefers-reduced-motion){.modal--variant-drawer .modal__body{animation:none}}.modal--variant-drawer .modal__header-bar{background-color:var(--s-surface-overlay-default)}.modal--variant-drawer .modal__header-bar .modal__close-button{margin-left:calc(-1 * var(--s-space-8))}@media (min-width: 768px){.modal--variant-drawer .modal__header-bar{flex-direction:row}}@media (min-width: 768px){.modal--variant-drawer.modal--padded .modal__content{padding-top:var(--s-space-8)}}.modal--padded .modal__content{padding-top:var(--s-space-24);padding-right:var(--s-space-16);padding-bottom:var(--s-space-24);padding-left:var(--s-space-16)}@media (min-width: 768px){.modal--padded .modal__content{padding-top:0;padding-right:var(--s-space-24);padding-bottom:var(--s-space-16);padding-left:var(--s-space-24)}}@media (min-width: 768px){.modal--scrollable .modal__content{padding-bottom:0}}.modal--scrollable:not(.modal--scrolled-down).modal--has-custom-footer .modal__custom-footer{border-top:var(--s-border-width-default) solid var(--s-border-default)}.modal--scrollable:not(.modal--scrolled-down):not(.modal--has-custom-footer) .modal__controls{border-top:var(--s-border-width-default) solid var(--s-border-default)}.modal--has-custom-header .modal__content{padding-top:var(--s-space-16)}.modal--has-custom-footer .modal__custom-footer{padding-top:var(--s-space-16);padding-right:var(--s-space-24);padding-bottom:var(--s-space-16);padding-left:var(--s-space-24)}.modal--has-header-tools .modal__header{border-bottom-color:transparent}.modal--has-header-tools .modal__header-tools{display:block}.modal--has-secondary-content .modal__body{max-width:64rem}.modal--has-secondary-content:not(.modal--has-header-tools) .modal__header{border-bottom-color:var(--s-border-default)}.modal--has-secondary-content.modal--has-header-tools .modal__header-tools{border-bottom-color:var(--s-border-default)}.modal--has-secondary-content.modal--has-custom-footer .modal__custom-footer{border-top:var(--s-border-width-default) solid var(--s-border-default)}.modal--has-secondary-content:not(.modal--has-custom-footer) .modal__controls{border-top:var(--s-border-width-default) solid var(--s-border-default)}@media (min-width: 992px){.modal--has-secondary-content .modal__header-tools,.modal--has-secondary-content .modal__content{padding-right:0}}.modal--has-secondary-content .modal__primary-content{overflow:visible;max-height:60%;flex-basis:auto}@media (min-width: 992px){.modal--has-secondary-content .modal__primary-content{max-width:calc(100% - 24rem);max-height:none;flex-basis:calc(100% - 24rem)}}.modal--has-secondary-content .modal__secondary-content{display:block}@media (min-width: 768px){.modal--scrolled:not(.modal--has-header-tools) .modal__header{border-bottom-color:var(--s-border-default)}.modal--scrolled.modal--has-header-tools .modal__header-tools{border-bottom-color:var(--s-border-default)}}.modal__backdrop{position:fixed;background-color:rgba(0, 0, 0, 0.2);inset:0}.modal__body{position:relative;z-index:var(--s-z-40);display:flex;overflow:hidden;width:100vw;max-width:40rem;height:100vh;background-color:var(--s-surface-overlay-default);flex-direction:column}@media (min-width: 768px){.modal__body{width:90vw;max-height:var(--swirl-modal-max-height);border-radius:var(--s-border-radius-base);box-shadow:var(--s-shadow-level-3)}}@media (min-width: 992px){.modal__body{height:var(--swirl-modal-height)}}.modal__header{border-bottom:var(--s-border-width-default) solid var(--s-border-default)}@media (min-width: 768px){.modal__header{border-bottom:var(--s-border-width-default) solid transparent}}.modal__header-bar{display:flex;height:3.5rem;padding-top:var(--s-space-8);padding-right:var(--s-space-16);padding-bottom:var(--s-space-8);padding-left:var(--s-space-16);flex-shrink:0;align-items:center;gap:var(--s-space-8)}@media (min-width: 768px){.modal__header-bar{height:4.125rem;padding-top:var(--s-space-24);padding-right:var(--s-space-24);padding-bottom:var(--s-space-16);padding-left:var(--s-space-24);flex-direction:row-reverse;gap:var(--s-space-16)}}.modal__header-tools{display:none;padding-right:var(--s-space-16);padding-left:var(--s-space-16);border-bottom:var(--s-border-width-default) solid var(--s-border-default)}@media (min-width: 768px){.modal__header-tools{padding-right:var(--s-space-24);padding-left:var(--s-space-24);border-bottom-color:transparent}}.modal__custom-header{flex-shrink:0;border-bottom:var(--s-border-width-default) solid var(--s-border-default)}.modal__heading{overflow:hidden}.modal__heading .heading{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.modal__content-container{display:flex;overflow:hidden;flex-grow:1;flex-direction:column;gap:var(--s-space-24)}@media (min-width: 992px){.modal__content-container{flex-direction:row}}.modal__primary-content{display:flex;overflow:hidden;flex-basis:100%;flex-direction:column}.modal__content{overflow-x:hidden;overflow-y:auto}.modal__content ::slotted(*){margin:0}.modal__secondary-content{display:none;overflow:visible;overflow-x:hidden;overflow-y:auto;max-width:none;max-height:40%;padding-right:var(--s-space-16);padding-left:var(--s-space-16)}@media (min-width: 768px){.modal__secondary-content{padding-left:var(--s-space-24)}}@media (min-width: 992px){.modal__secondary-content{overflow-x:hidden;overflow-y:auto;max-width:24rem;max-height:none;padding-right:var(--s-space-24);padding-bottom:var(--s-space-16);padding-left:0;flex-basis:50%}}.modal__custom-footer{flex-shrink:0}.modal__controls{display:flex;padding-top:var(--s-space-16);padding-right:var(--s-space-24);padding-bottom:var(--s-space-16);padding-left:var(--s-space-24);flex-shrink:0;justify-content:flex-end}@keyframes modal-scale-in{from{transform:scale(0)}to{transform:scale(1)}}@keyframes modal-backdrop-fade-in{from{opacity:0}to{opacity:1}}@keyframes modal-fade-out{from{opacity:1}to{opacity:0}}@keyframes modal-drawer-slide-in{from{transform:translate3d(100%, 0, 0)}to{transform:translate3d(0, 0, 0)}}@keyframes modal-drawer-slide-out{from{transform:translate3d(0, 0, 0)}to{transform:translate3d(100%, 0, 0)}}";
1152
1152
 
1153
1153
  const SwirlModal = class {
1154
1154
  constructor(hostRef) {
@@ -305,9 +305,11 @@ const SwirlOptionList = class {
305
305
  this.focusItem(newIndex);
306
306
  }
307
307
  getActiveItemIndex() {
308
- return this.items
309
- .map((item) => item.querySelector('[role="option"]'))
310
- .findIndex((item) => item === this.focusedItem);
308
+ return Boolean(this.focusedItem)
309
+ ? this.items
310
+ .map((item) => item.querySelector('[role="option"]'))
311
+ .findIndex((item) => item === this.focusedItem)
312
+ : 0;
311
313
  }
312
314
  getItemIndex(item) {
313
315
  return this.items.map((i) => i).findIndex((i) => i === item);
@@ -32,9 +32,11 @@ const SwirlSelect = class {
32
32
  this.onOpen = (event) => {
33
33
  this.placement = event.detail.position?.placement;
34
34
  this.open = true;
35
+ this.optionList.querySelector('[tabIndex="0"]')?.focus();
35
36
  };
36
37
  this.onClose = () => {
37
38
  this.open = false;
39
+ this.input.focus();
38
40
  };
39
41
  this.onKeyDown = (event) => {
40
42
  if (event.code === "Space" || event.code === "Enter") {
@@ -87,11 +89,11 @@ const SwirlSelect = class {
87
89
  "select--inline": this.inline,
88
90
  "select--multi": this.multiSelect,
89
91
  });
90
- return (index.h(index.Host, { onKeyDown: this.onKeyDown }, index.h("div", { class: className }, index.h("swirl-popover-trigger", { popover: this.popover, setAriaAttributes: false }, index.h("input", { "aria-describedby": this.swirlAriaDescribedby, "aria-disabled": this.disabled ? "true" : undefined, "aria-invalid": ariaInvalid, class: "select__input", disabled: this.disabled, readOnly: true, type: "text", value: label })), index.h("span", { class: "select__multi-select-values" }, this.value
92
+ return (index.h(index.Host, { onKeyDown: this.onKeyDown }, index.h("div", { class: className }, index.h("swirl-popover-trigger", { popover: this.popover, setAriaAttributes: false }, index.h("input", { "aria-describedby": this.swirlAriaDescribedby, "aria-disabled": this.disabled ? "true" : undefined, "aria-invalid": ariaInvalid, class: "select__input", disabled: this.disabled, readOnly: true, ref: (el) => (this.input = el), type: "text", value: label })), index.h("span", { class: "select__multi-select-values" }, this.value
91
93
  ?.map((value) => this.options.find((option) => option.value === value))
92
94
  ?.map((option) => (index.h("swirl-tag", { "aria-hidden": "true", label: option?.label,
93
95
  // eslint-disable-next-line react/jsx-no-bind
94
- onRemove: () => this.unselectOption(option?.value), removable: !this.disabled && this.allowDeselect })))), index.h("span", { class: "select__indicator" }, this.open ? (index.h("swirl-icon-expand-less", null)) : (index.h("swirl-icon-expand-more", null))), index.h("swirl-popover", { animation: "scale-in-y", class: "select__popover", id: `select-options-${this.selectId}`, label: this.label, offset: [0, offset], onPopoverClose: this.onClose, onPopoverOpen: this.onOpen, ref: (el) => (this.popover = el), useContainerWidth: "swirl-form-control" }, index.h("swirl-option-list", { allowDeselect: this.allowDeselect, onValueChange: this.select, multiSelect: this.multiSelect, value: this.value }, index.h("slot", { onSlotchange: this.onSlotChange }))))));
96
+ onRemove: () => this.unselectOption(option?.value), removable: !this.disabled && this.allowDeselect })))), index.h("span", { class: "select__indicator" }, this.open ? (index.h("swirl-icon-expand-less", null)) : (index.h("swirl-icon-expand-more", null))), index.h("swirl-popover", { animation: "scale-in-y", class: "select__popover", id: `select-options-${this.selectId}`, label: this.label, offset: [0, offset], onPopoverClose: this.onClose, onPopoverOpen: this.onOpen, ref: (el) => (this.popover = el), useContainerWidth: "swirl-form-control" }, index.h("swirl-option-list", { allowDeselect: this.allowDeselect, onValueChange: this.select, multiSelect: this.multiSelect, ref: (el) => (this.optionList = el), value: this.value }, index.h("slot", { onSlotchange: this.onSlotChange }))))));
95
97
  }
96
98
  get el() { return index.getElement(this); }
97
99
  };