@haiilo/catalyst 1.2.2 → 1.2.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.
Files changed (59) hide show
  1. package/dist/catalyst/catalyst.css +1 -1
  2. package/dist/catalyst/catalyst.esm.js +1 -1
  3. package/dist/catalyst/catalyst.esm.js.map +1 -1
  4. package/dist/catalyst/p-394f6b20.entry.js +2 -0
  5. package/dist/catalyst/p-394f6b20.entry.js.map +1 -0
  6. package/dist/catalyst/p-60a20ebe.js +10 -0
  7. package/dist/catalyst/p-60a20ebe.js.map +1 -0
  8. package/dist/catalyst/p-bc57ca12.entry.js +2 -0
  9. package/dist/catalyst/p-bc57ca12.entry.js.map +1 -0
  10. package/dist/cjs/{cat-alert_23.cjs.entry.js → cat-alert_22.cjs.entry.js} +40 -1374
  11. package/dist/cjs/cat-alert_22.cjs.entry.js.map +1 -0
  12. package/dist/cjs/cat-modal.cjs.entry.js +74 -0
  13. package/dist/cjs/cat-modal.cjs.entry.js.map +1 -0
  14. package/dist/cjs/catalyst.cjs.js +1 -1
  15. package/dist/cjs/first-tabbable-7966cf1c.js +1288 -0
  16. package/dist/cjs/first-tabbable-7966cf1c.js.map +1 -0
  17. package/dist/cjs/loader.cjs.js +1 -1
  18. package/dist/collection/components/cat-button/cat-button.css +9 -2
  19. package/dist/collection/components/cat-checkbox/cat-checkbox.css +6 -1
  20. package/dist/collection/components/cat-input/cat-input.css +4 -4
  21. package/dist/collection/components/cat-menu/cat-menu.js +26 -15
  22. package/dist/collection/components/cat-menu/cat-menu.js.map +1 -1
  23. package/dist/collection/components/cat-radio/cat-radio.css +3 -3
  24. package/dist/collection/components/cat-select/cat-select.css +3 -2
  25. package/dist/collection/components/cat-tabs/cat-tabs.css +1 -1
  26. package/dist/collection/components/cat-textarea/cat-textarea.css +2 -2
  27. package/dist/collection/components/cat-toggle/cat-toggle.css +4 -1
  28. package/dist/components/cat-button2.js +1 -1
  29. package/dist/components/cat-button2.js.map +1 -1
  30. package/dist/components/cat-checkbox2.js +1 -1
  31. package/dist/components/cat-checkbox2.js.map +1 -1
  32. package/dist/components/cat-input.js +1 -1
  33. package/dist/components/cat-input.js.map +1 -1
  34. package/dist/components/cat-menu.js +27 -16
  35. package/dist/components/cat-menu.js.map +1 -1
  36. package/dist/components/cat-radio.js +1 -1
  37. package/dist/components/cat-radio.js.map +1 -1
  38. package/dist/components/cat-select2.js +1 -1
  39. package/dist/components/cat-select2.js.map +1 -1
  40. package/dist/components/cat-tabs.js +1 -1
  41. package/dist/components/cat-tabs.js.map +1 -1
  42. package/dist/components/cat-textarea.js +1 -1
  43. package/dist/components/cat-textarea.js.map +1 -1
  44. package/dist/components/cat-toggle.js +1 -1
  45. package/dist/components/cat-toggle.js.map +1 -1
  46. package/dist/esm/{cat-alert_23.entry.js → cat-alert_22.entry.js} +36 -1369
  47. package/dist/esm/cat-alert_22.entry.js.map +1 -0
  48. package/dist/esm/cat-modal.entry.js +70 -0
  49. package/dist/esm/cat-modal.entry.js.map +1 -0
  50. package/dist/esm/catalyst.js +1 -1
  51. package/dist/esm/first-tabbable-4a00de61.js +1284 -0
  52. package/dist/esm/first-tabbable-4a00de61.js.map +1 -0
  53. package/dist/esm/loader.js +1 -1
  54. package/dist/types/components/cat-menu/cat-menu.d.ts +1 -0
  55. package/package.json +2 -2
  56. package/dist/catalyst/p-c1cab319.entry.js +0 -10
  57. package/dist/catalyst/p-c1cab319.entry.js.map +0 -1
  58. package/dist/cjs/cat-alert_23.cjs.entry.js.map +0 -1
  59. package/dist/esm/cat-alert_23.entry.js.map +0 -1
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-8ab22379.js');
6
6
  const catNotification = require('./cat-notification-bcb9fb86.js');
7
+ const firstTabbable = require('./first-tabbable-7966cf1c.js');
7
8
 
8
9
  function setAttributeDefault(host, attr, value) {
9
10
  if (!host.hostElement.hasAttribute(attr) && value != null) {
@@ -292,7 +293,7 @@ function createEmptyStyleRule(query) {
292
293
  }
293
294
  }
294
295
 
295
- const catButtonCss = ":host{display:inline-block;max-width:100%;vertical-align:middle;-webkit-user-select:none;-ms-user-select:none;user-select:none;}:host([hidden]){display:none}.cat-button{position:relative;font:inherit;display:flex;align-items:center;justify-content:center;border:none;border-radius:var(--cat-border-radius-m, 0.25rem);text-decoration:none;width:100%;box-sizing:border-box;cursor:pointer;transition:color 0.13s linear, border-color 0.13s linear, background-color 0.13s linear, box-shadow 0.13s linear}.cat-button:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.cat-button-content{word-wrap:break-word;word-break:break-word}.cat-button-ellipsed .cat-button-content{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.cat-button-disabled{cursor:not-allowed;opacity:var(--cat-opacity-disabled, 0.65)}.cat-button-round{border-radius:10rem}.cat-button-loading{cursor:default}.cat-button-loading cat-spinner{position:absolute}.cat-button-loading>*:not(cat-spinner){visibility:hidden}.cat-button-filled{background-color:rgb(var(--bg));color:rgb(var(--fill));font-weight:600;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:greyscale}.cat-button-filled.cat-button-disabled{--bg:235, 236, 240;--fill:var(--cat-font-color-muted, 105, 118, 135)}.cat-button-outlined{background-color:white;box-shadow:inset 0 0 0 1px rgba(var(--base), 0.2);color:rgb(var(--text))}.cat-button-outlined.cat-button-disabled{--base:var(--cat-font-color-muted, 105, 118, 135);--text:var(--cat-font-color-muted, 105, 118, 135)}.cat-button-outlined:hover:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-outlined.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.05)}.cat-button-outlined:active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-text{background-color:transparent;color:rgb(var(--text));text-decoration:none}.cat-button-text.cat-button-disabled{--text:var(--cat-font-color-muted, 105, 118, 135)}.cat-button-text:hover:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-text.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:none;background-color:rgba(var(--base), 0.05)}.cat-button-primary{--bg:var(--cat-primary-bg, 0, 129, 148);--fill:var(--cat-primary-fill, 255, 255, 255);--text:var(--cat-primary-text, 0, 129, 148);--base:var(--cat-primary-text, 0, 129, 148)}.cat-button-primary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-hover, 1, 115, 132);--fill:var(--cat-primary-fill-hover, 255, 255, 255);--text:var(--cat-primary-text-hover, 1, 115, 132)}.cat-button-primary.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-primary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-active, 2, 83, 113);--fill:var(--cat-primary-fill-active, 255, 255, 255);--text:var(--cat-primary-text-active, 2, 83, 113)}.cat-button-secondary{--bg:var(--cat-secondary-bg, 105, 118, 135);--fill:var(--cat-secondary-fill, 255, 255, 255);--text:var(--cat-secondary-text, 0, 0, 0);--base:var(--cat-secondary-bg, 105, 118, 135)}.cat-button-secondary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-secondary-bg-hover, 105, 118, 135);--fill:var(--cat-secondary-fill-hover, 255, 255, 255);--text:var(--cat-secondary-text-hover, 0, 0, 0)}.cat-button-secondary.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-secondary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-secondary-bg-active, 105, 118, 135);--fill:var(--cat-secondary-fill-active, 255, 255, 255);--text:var(--cat-catsecondary-text-active, 0, 0, 0)}.cat-button-success{--bg:var(--cat-success-bg-, 0, 132, 88);--fill:var(--cat-success-fill, 255, 255, 255);--text:var(--cat-success-text, 0, 132, 88);--base:var(--cat-success-text, 0, 132, 88)}.cat-button-success:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-success-bg-hover, 0, 117, 78);--fill:var(--cat-success-fill-hover, 255, 255, 255);--text:var(--cat-success-text-hover, 0, 117, 78)}.cat-button-success.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-success:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-success-bg-active, 0, 105, 70);--fill:var(--cat-success-fill-active, 255, 255, 255);--text:var(--cat-success-text-active, 0, 105, 70)}.cat-button-warning{--bg:var(--cat-warning-bg, 255, 206, 128);--fill:var(--cat-warning-fill, 0, 0, 0);--text:var(--cat-warning-text, 159, 97, 0);--base:var(--cat-warning-text, 159, 97, 0)}.cat-button-warning:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-warning-bg-hover, 255, 214, 148);--fill:var(--cat-warning-fill-hover, 0, 0, 0);--text:var(--cat-warning-text-hover, 159, 97, 0)}.cat-button-warning.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-warning:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-warning-bg-active, 255, 222, 168);--fill:var(--cat-warning-fill-active, 0, 0, 0);--text:var(--cat-warning-text-active, 159, 97, 0)}.cat-button-danger{--bg:var(--cat-danger-bg, 217, 52, 13);--fill:var(--cat-danger-fill, 255, 255, 255);--text:var(--cat-danger-text, 217, 52, 13);--base:var(--cat-danger-text, 217, 52, 13)}.cat-button-danger:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-danger-bg-hover, 194, 46, 11);--fill:var(--cat-danger-fill-hover, 255, 255, 255);--text:var(--cat-danger-text-hover, 194, 46, 11)}.cat-button-danger.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-danger:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-danger-bg-active, 174, 42, 10);--fill:var(--cat-danger-fill-active, 255, 255, 255);--text:var(--cat-catdanger-text-active, 174, 42, 10)}:host(.cat-button-pull:not([size])){margin:-0.625rem -0.75rem}:host(.cat-button-pull-h:not([size])){margin-left:-0.75rem;margin-right:-0.75rem}:host(.cat-button-pull-v:not([size])){margin-top:-0.625rem;margin-bottom:-0.625rem}:host(.cat-button-pull-t:not([size])){margin-top:-0.625rem}:host(.cat-button-pull-l:not([size])){margin-left:-0.75rem}:host(.cat-button-pull-b:not([size])){margin-bottom:-0.625rem}:host(.cat-button-pull-r:not([size])){margin-right:-0.75rem}.cat-button-xs{min-width:1.5rem;padding:0.25rem 0.25rem;font-size:0.875rem;line-height:1rem}.cat-button-xs .cat-button-prefix{margin-right:0.25rem}.cat-button-xs .cat-button-suffix{margin-left:0.25rem}.cat-button-xs.cat-button-icon{width:1.5rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-xs{padding-left:1.25rem;padding-right:1.25rem}:host(.cat-button-pull[size=xs]){margin:-0.25rem -0.25rem}:host(.cat-button-pull-h[size=xs]){margin-left:-0.25rem;margin-right:-0.25rem}:host(.cat-button-pull-v[size=xs]){margin-top:-0.25rem;margin-bottom:-0.25rem}:host(.cat-button-pull-t[size=xs]){margin-top:-0.25rem}:host(.cat-button-pull-l[size=xs]){margin-left:-0.25rem}:host(.cat-button-pull-b[size=xs]){margin-bottom:-0.25rem}:host(.cat-button-pull-r[size=xs]){margin-right:-0.25rem}.cat-button-s{min-width:2rem;padding:0.375rem 0.5rem;font-size:0.9375rem;line-height:1.25rem}.cat-button-s .cat-button-prefix{margin-right:0.25rem}.cat-button-s .cat-button-suffix{margin-left:0.25rem}.cat-button-s cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-s.cat-button-icon{width:2rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-s{padding-left:1.25rem;padding-right:1.25rem}:host(.cat-button-pull[size=s]){margin:-0.375rem -0.5rem}:host(.cat-button-pull-h[size=s]){margin-left:-0.5rem;margin-right:-0.5rem}:host(.cat-button-pull-v[size=s]){margin-top:-0.375rem;margin-bottom:-0.375rem}:host(.cat-button-pull-t[size=s]){margin-top:-0.375rem}:host(.cat-button-pull-l[size=s]){margin-left:-0.5rem}:host(.cat-button-pull-b[size=s]){margin-bottom:-0.375rem}:host(.cat-button-pull-r[size=s]){margin-right:-0.5rem}.cat-button-m{min-width:2.5rem;padding:0.625rem 0.75rem;font-size:0.9375rem;line-height:1.25rem}.cat-button-m .cat-button-prefix{margin-right:0.25rem}.cat-button-m .cat-button-suffix{margin-left:0.25rem}.cat-button-m cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-m.cat-button-icon{width:2.5rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-m{padding-left:1.25rem;padding-right:1.25rem}:host(.cat-button-pull[size=m]){margin:-0.625rem -0.75rem}:host(.cat-button-pull-h[size=m]){margin-left:-0.75rem;margin-right:-0.75rem}:host(.cat-button-pull-v[size=m]){margin-top:-0.625rem;margin-bottom:-0.625rem}:host(.cat-button-pull-t[size=m]){margin-top:-0.625rem}:host(.cat-button-pull-l[size=m]){margin-left:-0.75rem}:host(.cat-button-pull-b[size=m]){margin-bottom:-0.625rem}:host(.cat-button-pull-r[size=m]){margin-right:-0.75rem}.cat-button-l{min-width:3rem;padding:0.875rem 1rem;font-size:0.9375rem;line-height:1.25rem}.cat-button-l .cat-button-prefix{margin-right:0.25rem}.cat-button-l .cat-button-suffix{margin-left:0.25rem}.cat-button-l cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-l.cat-button-icon{width:3rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-l{padding-left:1.25rem;padding-right:1.25rem}:host(.cat-button-pull[size=l]){margin:-0.875rem -1rem}:host(.cat-button-pull-h[size=l]){margin-left:-1rem;margin-right:-1rem}:host(.cat-button-pull-v[size=l]){margin-top:-0.875rem;margin-bottom:-0.875rem}:host(.cat-button-pull-t[size=l]){margin-top:-0.875rem}:host(.cat-button-pull-l[size=l]){margin-left:-1rem}:host(.cat-button-pull-b[size=l]){margin-bottom:-0.875rem}:host(.cat-button-pull-r[size=l]){margin-right:-1rem}.cat-button-xl{min-width:3.5rem;padding:1rem 1.25rem;font-size:1.125rem;line-height:1.5rem}.cat-button-xl .cat-button-prefix{margin-right:0.25rem}.cat-button-xl .cat-button-suffix{margin-left:0.25rem}.cat-button-xl.cat-button-icon{width:3.5rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-xl{padding-left:1.25rem;padding-right:1.25rem}:host(.cat-button-pull[size=xl]){margin:-1rem -1.25rem}:host(.cat-button-pull-h[size=xl]){margin-left:-1.25rem;margin-right:-1.25rem}:host(.cat-button-pull-v[size=xl]){margin-top:-1rem;margin-bottom:-1rem}:host(.cat-button-pull-t[size=xl]){margin-top:-1rem}:host(.cat-button-pull-l[size=xl]){margin-left:-1.25rem}:host(.cat-button-pull-b[size=xl]){margin-bottom:-1rem}:host(.cat-button-pull-r[size=xl]){margin-right:-1.25rem}:host-context(nav){width:100%}:host-context(nav) .cat-button{box-shadow:none;border-radius:0;justify-content:left}:host-context(nav) .cat-button:focus-visible{outline-offset:-2px}:host(.cat-text-left) .cat-button{justify-content:left}:host(.cat-text-right) .cat-button{justify-content:right}";
296
+ const catButtonCss = ":host{display:inline-block;max-width:100%;vertical-align:middle;-webkit-user-select:none;-ms-user-select:none;user-select:none;}:host([hidden]){display:none}.cat-button{position:relative;font:inherit;display:flex;align-items:center;justify-content:center;border:none;border-radius:var(--cat-border-radius-m, 0.25rem);text-decoration:none;width:100%;box-sizing:border-box;cursor:pointer;transition:color 0.13s linear, border-color 0.13s linear, background-color 0.13s linear, box-shadow 0.13s linear}.cat-button:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.cat-button-content{word-wrap:break-word;word-break:break-word}.cat-button-ellipsed .cat-button-content{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.cat-button-disabled{cursor:not-allowed;opacity:var(--cat-opacity-disabled, 0.65)}.cat-button-round{border-radius:10rem}.cat-button-loading{cursor:default}.cat-button-loading cat-spinner{position:absolute}.cat-button-loading>*:not(cat-spinner){visibility:hidden}.cat-button-filled{background-color:rgb(var(--bg));color:rgb(var(--fill));font-weight:600;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:greyscale}.cat-button-filled.cat-button-disabled{--bg:235, 236, 240;--fill:var(--cat-font-color-muted, 105, 118, 135)}.cat-button-outlined{background-color:white;box-shadow:inset 0 0 0 1px rgba(var(--base), 0.2);color:rgb(var(--text))}.cat-button-outlined.cat-button-disabled{--base:var(--cat-font-color-muted, 105, 118, 135);--text:var(--cat-font-color-muted, 105, 118, 135)}.cat-button-outlined:hover:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.05)}.cat-button-outlined.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-outlined:active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-text{background-color:transparent;color:rgb(var(--text));text-decoration:none}.cat-button-text.cat-button-disabled{--text:var(--cat-font-color-muted, 105, 118, 135)}.cat-button-text:hover:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:none;background-color:rgba(var(--base), 0.05)}.cat-button-text.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:none;background-color:rgba(var(--base), 0.1)}.cat-button-primary{--bg:var(--cat-primary-bg, 0, 129, 148);--fill:var(--cat-primary-fill, 255, 255, 255);--text:var(--cat-primary-text, 0, 129, 148);--base:var(--cat-primary-text, 0, 129, 148)}.cat-button-primary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-hover, 1, 115, 132);--fill:var(--cat-primary-fill-hover, 255, 255, 255);--text:var(--cat-primary-text-hover, 1, 115, 132)}.cat-button-primary.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-primary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-active, 2, 83, 113);--fill:var(--cat-primary-fill-active, 255, 255, 255);--text:var(--cat-primary-text-active, 2, 83, 113)}.cat-button-secondary{--bg:var(--cat-secondary-bg, 105, 118, 135);--fill:var(--cat-secondary-fill, 255, 255, 255);--text:var(--cat-secondary-text, 0, 0, 0);--base:var(--cat-secondary-bg, 105, 118, 135)}.cat-button-secondary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-secondary-bg-hover, 105, 118, 135);--fill:var(--cat-secondary-fill-hover, 255, 255, 255);--text:var(--cat-secondary-text-hover, 0, 0, 0)}.cat-button-secondary.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-secondary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-secondary-bg-active, 105, 118, 135);--fill:var(--cat-secondary-fill-active, 255, 255, 255);--text:var(--cat-catsecondary-text-active, 0, 0, 0)}.cat-button-success{--bg:var(--cat-success-bg-, 0, 132, 88);--fill:var(--cat-success-fill, 255, 255, 255);--text:var(--cat-success-text, 0, 132, 88);--base:var(--cat-success-text, 0, 132, 88)}.cat-button-success:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-success-bg-hover, 0, 117, 78);--fill:var(--cat-success-fill-hover, 255, 255, 255);--text:var(--cat-success-text-hover, 0, 117, 78)}.cat-button-success.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-success:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-success-bg-active, 0, 105, 70);--fill:var(--cat-success-fill-active, 255, 255, 255);--text:var(--cat-success-text-active, 0, 105, 70)}.cat-button-warning{--bg:var(--cat-warning-bg, 255, 206, 128);--fill:var(--cat-warning-fill, 0, 0, 0);--text:var(--cat-warning-text, 159, 97, 0);--base:var(--cat-warning-text, 159, 97, 0)}.cat-button-warning:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-warning-bg-hover, 255, 214, 148);--fill:var(--cat-warning-fill-hover, 0, 0, 0);--text:var(--cat-warning-text-hover, 159, 97, 0)}.cat-button-warning.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-warning:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-warning-bg-active, 255, 222, 168);--fill:var(--cat-warning-fill-active, 0, 0, 0);--text:var(--cat-warning-text-active, 159, 97, 0)}.cat-button-danger{--bg:var(--cat-danger-bg, 217, 52, 13);--fill:var(--cat-danger-fill, 255, 255, 255);--text:var(--cat-danger-text, 217, 52, 13);--base:var(--cat-danger-text, 217, 52, 13)}.cat-button-danger:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-danger-bg-hover, 194, 46, 11);--fill:var(--cat-danger-fill-hover, 255, 255, 255);--text:var(--cat-danger-text-hover, 194, 46, 11)}.cat-button-danger.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading),.cat-button-danger:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-danger-bg-active, 174, 42, 10);--fill:var(--cat-danger-fill-active, 255, 255, 255);--text:var(--cat-catdanger-text-active, 174, 42, 10)}:host(.cat-button-pull:not([size])){margin:-0.625rem -0.75rem}:host(.cat-button-pull-h:not([size])){margin-left:-0.75rem;margin-right:-0.75rem}:host(.cat-button-pull-v:not([size])){margin-top:-0.625rem;margin-bottom:-0.625rem}:host(.cat-button-pull-t:not([size])){margin-top:-0.625rem}:host(.cat-button-pull-l:not([size])){margin-left:-0.75rem}:host(.cat-button-pull-b:not([size])){margin-bottom:-0.625rem}:host(.cat-button-pull-r:not([size])){margin-right:-0.75rem}.cat-button-xs{min-width:1.5rem;padding:0.25rem 0.25rem;font-size:0.875rem;line-height:1rem}.cat-button-xs .cat-button-prefix{margin-right:0.25rem}.cat-button-xs .cat-button-suffix{margin-left:0.25rem}.cat-button-xs.cat-button-icon{width:1.5rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-xs{padding-left:1.25rem;padding-right:1.25rem}:host(.cat-button-pull[size=xs]){margin:-0.25rem -0.25rem}:host(.cat-button-pull-h[size=xs]){margin-left:-0.25rem;margin-right:-0.25rem}:host(.cat-button-pull-v[size=xs]){margin-top:-0.25rem;margin-bottom:-0.25rem}:host(.cat-button-pull-t[size=xs]){margin-top:-0.25rem}:host(.cat-button-pull-l[size=xs]){margin-left:-0.25rem}:host(.cat-button-pull-b[size=xs]){margin-bottom:-0.25rem}:host(.cat-button-pull-r[size=xs]){margin-right:-0.25rem}.cat-button-s{min-width:2rem;padding:0.375rem 0.5rem;font-size:0.9375rem;line-height:1.25rem}.cat-button-s .cat-button-prefix{margin-right:0.25rem}.cat-button-s .cat-button-suffix{margin-left:0.25rem}.cat-button-s cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-s.cat-button-icon{width:2rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-s{padding-left:1.25rem;padding-right:1.25rem}:host(.cat-button-pull[size=s]){margin:-0.375rem -0.5rem}:host(.cat-button-pull-h[size=s]){margin-left:-0.5rem;margin-right:-0.5rem}:host(.cat-button-pull-v[size=s]){margin-top:-0.375rem;margin-bottom:-0.375rem}:host(.cat-button-pull-t[size=s]){margin-top:-0.375rem}:host(.cat-button-pull-l[size=s]){margin-left:-0.5rem}:host(.cat-button-pull-b[size=s]){margin-bottom:-0.375rem}:host(.cat-button-pull-r[size=s]){margin-right:-0.5rem}.cat-button-m{min-width:2.5rem;padding:0.625rem 0.75rem;font-size:0.9375rem;line-height:1.25rem}.cat-button-m .cat-button-prefix{margin-right:0.25rem}.cat-button-m .cat-button-suffix{margin-left:0.25rem}.cat-button-m cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-m.cat-button-icon{width:2.5rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-m{padding-left:1.25rem;padding-right:1.25rem}:host(.cat-button-pull[size=m]){margin:-0.625rem -0.75rem}:host(.cat-button-pull-h[size=m]){margin-left:-0.75rem;margin-right:-0.75rem}:host(.cat-button-pull-v[size=m]){margin-top:-0.625rem;margin-bottom:-0.625rem}:host(.cat-button-pull-t[size=m]){margin-top:-0.625rem}:host(.cat-button-pull-l[size=m]){margin-left:-0.75rem}:host(.cat-button-pull-b[size=m]){margin-bottom:-0.625rem}:host(.cat-button-pull-r[size=m]){margin-right:-0.75rem}.cat-button-l{min-width:3rem;padding:0.875rem 1rem;font-size:0.9375rem;line-height:1.25rem}.cat-button-l .cat-button-prefix{margin-right:0.25rem}.cat-button-l .cat-button-suffix{margin-left:0.25rem}.cat-button-l cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-l.cat-button-icon{width:3rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-l{padding-left:1.25rem;padding-right:1.25rem}:host(.cat-button-pull[size=l]){margin:-0.875rem -1rem}:host(.cat-button-pull-h[size=l]){margin-left:-1rem;margin-right:-1rem}:host(.cat-button-pull-v[size=l]){margin-top:-0.875rem;margin-bottom:-0.875rem}:host(.cat-button-pull-t[size=l]){margin-top:-0.875rem}:host(.cat-button-pull-l[size=l]){margin-left:-1rem}:host(.cat-button-pull-b[size=l]){margin-bottom:-0.875rem}:host(.cat-button-pull-r[size=l]){margin-right:-1rem}.cat-button-xl{min-width:3.5rem;padding:1rem 1.25rem;font-size:1.125rem;line-height:1.5rem}.cat-button-xl .cat-button-prefix{margin-right:0.25rem}.cat-button-xl .cat-button-suffix{margin-left:0.25rem}.cat-button-xl.cat-button-icon{width:3.5rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-xl{padding-left:1.25rem;padding-right:1.25rem}:host(.cat-button-pull[size=xl]){margin:-1rem -1.25rem}:host(.cat-button-pull-h[size=xl]){margin-left:-1.25rem;margin-right:-1.25rem}:host(.cat-button-pull-v[size=xl]){margin-top:-1rem;margin-bottom:-1rem}:host(.cat-button-pull-t[size=xl]){margin-top:-1rem}:host(.cat-button-pull-l[size=xl]){margin-left:-1.25rem}:host(.cat-button-pull-b[size=xl]){margin-bottom:-1rem}:host(.cat-button-pull-r[size=xl]){margin-right:-1.25rem}:host-context(nav){width:100%}:host-context(nav) .cat-button{box-shadow:none;border-radius:0;justify-content:left}:host-context(nav) .cat-button:focus-visible{outline-offset:-2px}:host(.cat-text-left) .cat-button{justify-content:left}:host(.cat-text-right) .cat-button{justify-content:right}";
296
297
 
297
298
  const CatButton = class {
298
299
  constructor(hostRef) {
@@ -496,7 +497,7 @@ const CatFormHint = props => {
496
497
  ]));
497
498
  };
498
499
 
499
- const catCheckboxCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);margin:0 !important}:host-context(.cat-error) .hint-section{color:rgb(var(--cat-danger-text, 217, 52, 13))}:host{display:flex;flex-direction:column;gap:0.5rem;margin-bottom:1rem}:host([hidden]){display:none}label{flex:0 1 auto;display:flex;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);-webkit-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;position:relative}.label-left{flex-direction:row-reverse}.label-left input{right:1px;left:unset}input{position:absolute;width:1.25rem;height:1.25rem;margin:0;opacity:0;cursor:inherit;left:1px;top:0.5px}.box{flex:0 0 auto;display:flex;position:relative;height:1.25rem;width:1.25rem;background-color:white;border:1px solid rgb(var(--cat-border-color-focus, 215, 219, 224));border-radius:var(--cat-border-radius-s, 0.125rem);transition:background-color 0.13s ease, border-color 0.13s ease;pointer-events:none}.box svg{fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:16px;stroke-dashoffset:16px;transition:all 0.13s ease;width:50%;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%) scale(0.99)}:checked+.box{background-color:rgb(var(--cat-primary-bg, 0, 129, 148));border-color:rgb(var(--cat-primary-bg, 0, 129, 148));stroke:rgb(var(--cat-primary-fill, 255, 255, 255))}:checked+.box .check{stroke-dashoffset:0}:indeterminate+.box{background-color:rgb(var(--cat-primary-bg, 0, 129, 148));border-color:rgb(var(--cat-primary-bg, 0, 129, 148));stroke:rgb(var(--cat-primary-fill, 255, 255, 255))}:indeterminate+.box .dash{stroke-dashoffset:0}:focus-visible+.box{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}:host(.cat-error) .box{border:1px solid rgb(var(--cat-danger-bg, 217, 52, 13))}:host(.cat-error) :checked+.box,:host(.cat-error) :indeterminate+.box{background-color:rgb(var(--cat-danger-bg, 217, 52, 13));border-color:rgb(var(--cat-danger-bg, 217, 52, 13));stroke:rgb(var(--cat-danger-fill, 255, 255, 255))}.label{flex:1 1 auto;min-width:0}.is-hidden .label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.is-disabled{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135))}";
500
+ const catCheckboxCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);margin:0 !important}:host-context(.cat-error) .hint-section{color:rgb(var(--cat-danger-text, 217, 52, 13))}:host{display:flex;flex-direction:column;gap:0.5rem;margin-bottom:1rem}:host([hidden]){display:none}label{flex:0 1 auto;display:flex;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);-webkit-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;position:relative}.label-left{flex-direction:row-reverse}.label-left input{right:1px;left:unset}input{position:absolute;width:1.25rem;height:1.25rem;margin:0;opacity:0;cursor:inherit;left:1px;top:0.5px}.box{flex:0 0 auto;display:flex;position:relative;height:1.25rem;width:1.25rem;background-color:white;border:1px solid rgb(var(--cat-border-color-dark, 215, 219, 224));border-radius:var(--cat-border-radius-s, 0.125rem);transition:background-color 0.13s ease, border-color 0.13s ease;pointer-events:none}.box svg{fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:16px;stroke-dashoffset:16px;transition:all 0.13s ease;width:50%;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%) scale(0.99)}:checked+.box{background-color:rgb(var(--cat-primary-bg, 0, 129, 148));border-color:rgb(var(--cat-primary-bg, 0, 129, 148));stroke:rgb(var(--cat-primary-fill, 255, 255, 255))}:checked+.box .check{stroke-dashoffset:0}:indeterminate+.box{background-color:rgb(var(--cat-primary-bg, 0, 129, 148));border-color:rgb(var(--cat-primary-bg, 0, 129, 148));stroke:rgb(var(--cat-primary-fill, 255, 255, 255))}:indeterminate+.box .dash{stroke-dashoffset:0}:focus-visible+.box{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.is-disabled .box{background-color:#f8f8fb;border-color:rgb(var(--cat-border-color-dark, 215, 219, 224));stroke:rgb(var(--cat-font-color-muted, 105, 118, 135))}:host(.cat-error) .box{border:1px solid rgb(var(--cat-danger-bg, 217, 52, 13))}:host(.cat-error) :checked+.box,:host(.cat-error) :indeterminate+.box{background-color:rgb(var(--cat-danger-bg, 217, 52, 13));border-color:rgb(var(--cat-danger-bg, 217, 52, 13));stroke:rgb(var(--cat-danger-fill, 255, 255, 255))}.label{flex:1 1 auto;min-width:0}.is-hidden .label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.is-disabled{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135))}";
500
501
 
501
502
  let nextUniqueId$8 = 0;
502
503
  const CatCheckbox = class {
@@ -604,7 +605,7 @@ const CatIcon = class {
604
605
  };
605
606
  CatIcon.style = catIconCss;
606
607
 
607
- const catInputCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);margin:0 !important}:host-context(.cat-error) .hint-section{color:rgb(var(--cat-danger-text, 217, 52, 13))}:host{display:flex;flex-direction:column;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);margin-bottom:1rem}:host([hidden]){display:none}.input-wrapper{display:flex;align-items:stretch;gap:0.75rem;padding:0 0.75rem;height:2.5rem;overflow:hidden;background:white;border-radius:var(--cat-border-radius-m, 0.25rem);box-shadow:0 0 0 1px rgb(var(--cat-border-color-focus, 215, 219, 224));transition:box-shadow 0.13s linear}.input-wrapper.input-round{border-radius:10rem}.input-wrapper.input-disabled{background:#f8f8fb;cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135))}.input-wrapper:not(.input-disabled):hover{box-shadow:0 0 0 2px rgb(var(--cat-border-color-focus, 215, 219, 224))}.input-wrapper:not(.input-disabled):focus-within{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255))}:host(.cat-error) .input-wrapper{box-shadow:0 0 0 1px rgb(var(--cat-danger-bg, 217, 52, 13))}:host(.cat-error) .input-wrapper:not(.input-disabled):hover{box-shadow:0 0 0 2px rgb(var(--cat-danger-bg, 217, 52, 13))}label{align-self:flex-start}label.hidden{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.input-optional{margin-left:0.25rem;font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 105, 118, 135))}.text-prefix,.text-suffix{display:inline-flex;align-items:center;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.text-prefix{border-right:1px solid rgb(var(--cat-border-color-focus, 215, 219, 224));padding-right:0.75rem}.text-suffix{border-left:1px solid rgb(var(--cat-border-color-focus, 215, 219, 224));padding-left:0.75rem}.icon-prefix,.icon-suffix{align-self:center}.input-inner-wrapper{display:flex;align-items:center;position:relative;flex:1 1 auto}input{font:inherit;margin:0;padding:0;width:100%;min-width:0;border:none;outline:none;background:none}.input-disabled input{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135))}input.has-clearable{padding-right:1.5rem}input::placeholder{color:rgb(var(--cat-font-color-muted, 105, 118, 135))}.clearable{position:absolute;top:calc(50% - 1rem);right:-0.5rem}";
608
+ const catInputCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);margin:0 !important}:host-context(.cat-error) .hint-section{color:rgb(var(--cat-danger-text, 217, 52, 13))}:host{display:flex;flex-direction:column;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);margin-bottom:1rem}:host([hidden]){display:none}.input-wrapper{display:flex;align-items:stretch;gap:0.75rem;padding:0 0.75rem;height:2.5rem;overflow:hidden;background:white;border-radius:var(--cat-border-radius-m, 0.25rem);box-shadow:0 0 0 1px rgb(var(--cat-border-color-dark, 215, 219, 224));transition:box-shadow 0.13s linear}.input-wrapper.input-round{border-radius:10rem}.input-wrapper.input-disabled{background:#f8f8fb;cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135))}.input-wrapper:not(.input-disabled):hover{box-shadow:0 0 0 2px rgb(var(--cat-border-color-dark, 215, 219, 224))}.input-wrapper:not(.input-disabled):focus-within{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255))}:host(.cat-error) .input-wrapper{box-shadow:0 0 0 1px rgb(var(--cat-danger-bg, 217, 52, 13))}:host(.cat-error) .input-wrapper:not(.input-disabled):hover{box-shadow:0 0 0 2px rgb(var(--cat-danger-bg, 217, 52, 13))}label{align-self:flex-start}label.hidden{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.input-optional{margin-left:0.25rem;font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 105, 118, 135))}.text-prefix,.text-suffix{display:inline-flex;align-items:center;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.text-prefix{border-right:1px solid rgb(var(--cat-border-color-dark, 215, 219, 224));padding-right:0.75rem}.text-suffix{border-left:1px solid rgb(var(--cat-border-color-dark, 215, 219, 224));padding-left:0.75rem}.icon-prefix,.icon-suffix{align-self:center}.input-inner-wrapper{display:flex;align-items:center;position:relative;flex:1 1 auto}input{font:inherit;margin:0;padding:0;width:100%;min-width:0;border:none;outline:none;background:none}.input-disabled input{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135))}input.has-clearable{padding-right:1.5rem}input::placeholder{color:rgb(var(--cat-font-color-muted, 105, 118, 135))}.clearable{position:absolute;top:calc(50% - 1rem);right:-0.5rem}";
608
609
 
609
610
  let nextUniqueId$7 = 0;
610
611
  const CatInput = class {
@@ -1772,1287 +1773,6 @@ const computePosition = (reference, floating, options) => computePosition$1(refe
1772
1773
  ...options
1773
1774
  });
1774
1775
 
1775
- /*!
1776
- * tabbable 6.0.0
1777
- * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
1778
- */
1779
- 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'];
1780
- var candidateSelector = /* #__PURE__ */candidateSelectors.join(',');
1781
- var NoElement = typeof Element === 'undefined';
1782
- var matches = NoElement ? function () {} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
1783
- var getRootNode = !NoElement && Element.prototype.getRootNode ? function (element) {
1784
- return element.getRootNode();
1785
- } : function (element) {
1786
- return element.ownerDocument;
1787
- };
1788
- /**
1789
- * @param {Element} el container to check in
1790
- * @param {boolean} includeContainer add container to check
1791
- * @param {(node: Element) => boolean} filter filter candidates
1792
- * @returns {Element[]}
1793
- */
1794
-
1795
- var getCandidates = function getCandidates(el, includeContainer, filter) {
1796
- var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));
1797
-
1798
- if (includeContainer && matches.call(el, candidateSelector)) {
1799
- candidates.unshift(el);
1800
- }
1801
-
1802
- candidates = candidates.filter(filter);
1803
- return candidates;
1804
- };
1805
- /**
1806
- * @callback GetShadowRoot
1807
- * @param {Element} element to check for shadow root
1808
- * @returns {ShadowRoot|boolean} ShadowRoot if available or boolean indicating if a shadowRoot is attached but not available.
1809
- */
1810
-
1811
- /**
1812
- * @callback ShadowRootFilter
1813
- * @param {Element} shadowHostNode the element which contains shadow content
1814
- * @returns {boolean} true if a shadow root could potentially contain valid candidates.
1815
- */
1816
-
1817
- /**
1818
- * @typedef {Object} CandidatesScope
1819
- * @property {Element} scope contains inner candidates
1820
- * @property {Element[]} candidates
1821
- */
1822
-
1823
- /**
1824
- * @typedef {Object} IterativeOptions
1825
- * @property {GetShadowRoot|boolean} getShadowRoot true if shadow support is enabled; falsy if not;
1826
- * if a function, implies shadow support is enabled and either returns the shadow root of an element
1827
- * or a boolean stating if it has an undisclosed shadow root
1828
- * @property {(node: Element) => boolean} filter filter candidates
1829
- * @property {boolean} flatten if true then result will flatten any CandidatesScope into the returned list
1830
- * @property {ShadowRootFilter} shadowRootFilter filter shadow roots;
1831
- */
1832
-
1833
- /**
1834
- * @param {Element[]} elements list of element containers to match candidates from
1835
- * @param {boolean} includeContainer add container list to check
1836
- * @param {IterativeOptions} options
1837
- * @returns {Array.<Element|CandidatesScope>}
1838
- */
1839
-
1840
-
1841
- var getCandidatesIteratively = function getCandidatesIteratively(elements, includeContainer, options) {
1842
- var candidates = [];
1843
- var elementsToCheck = Array.from(elements);
1844
-
1845
- while (elementsToCheck.length) {
1846
- var element = elementsToCheck.shift();
1847
-
1848
- if (element.tagName === 'SLOT') {
1849
- // add shadow dom slot scope (slot itself cannot be focusable)
1850
- var assigned = element.assignedElements();
1851
- var content = assigned.length ? assigned : element.children;
1852
- var nestedCandidates = getCandidatesIteratively(content, true, options);
1853
-
1854
- if (options.flatten) {
1855
- candidates.push.apply(candidates, nestedCandidates);
1856
- } else {
1857
- candidates.push({
1858
- scope: element,
1859
- candidates: nestedCandidates
1860
- });
1861
- }
1862
- } else {
1863
- // check candidate element
1864
- var validCandidate = matches.call(element, candidateSelector);
1865
-
1866
- if (validCandidate && options.filter(element) && (includeContainer || !elements.includes(element))) {
1867
- candidates.push(element);
1868
- } // iterate over shadow content if possible
1869
-
1870
-
1871
- var shadowRoot = element.shadowRoot || // check for an undisclosed shadow
1872
- typeof options.getShadowRoot === 'function' && options.getShadowRoot(element);
1873
- var validShadowRoot = !options.shadowRootFilter || options.shadowRootFilter(element);
1874
-
1875
- if (shadowRoot && validShadowRoot) {
1876
- // add shadow dom scope IIF a shadow root node was given; otherwise, an undisclosed
1877
- // shadow exists, so look at light dom children as fallback BUT create a scope for any
1878
- // child candidates found because they're likely slotted elements (elements that are
1879
- // children of the web component element (which has the shadow), in the light dom, but
1880
- // slotted somewhere _inside_ the undisclosed shadow) -- the scope is created below,
1881
- // _after_ we return from this recursive call
1882
- var _nestedCandidates = getCandidatesIteratively(shadowRoot === true ? element.children : shadowRoot.children, true, options);
1883
-
1884
- if (options.flatten) {
1885
- candidates.push.apply(candidates, _nestedCandidates);
1886
- } else {
1887
- candidates.push({
1888
- scope: element,
1889
- candidates: _nestedCandidates
1890
- });
1891
- }
1892
- } else {
1893
- // there's not shadow so just dig into the element's (light dom) children
1894
- // __without__ giving the element special scope treatment
1895
- elementsToCheck.unshift.apply(elementsToCheck, element.children);
1896
- }
1897
- }
1898
- }
1899
-
1900
- return candidates;
1901
- };
1902
-
1903
- var getTabindex = function getTabindex(node, isScope) {
1904
- if (node.tabIndex < 0) {
1905
- // in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default
1906
- // `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,
1907
- // yet they are still part of the regular tab order; in FF, they get a default
1908
- // `tabIndex` of 0; since Chrome still puts those elements in the regular tab
1909
- // order, consider their tab index to be 0.
1910
- // Also browsers do not return `tabIndex` correctly for contentEditable nodes;
1911
- // so if they don't have a tabindex attribute specifically set, assume it's 0.
1912
- //
1913
- // isScope is positive for custom element with shadow root or slot that by default
1914
- // have tabIndex -1, but need to be sorted by document order in order for their
1915
- // content to be inserted in the correct position
1916
- if ((isScope || /^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || node.isContentEditable) && isNaN(parseInt(node.getAttribute('tabindex'), 10))) {
1917
- return 0;
1918
- }
1919
- }
1920
-
1921
- return node.tabIndex;
1922
- };
1923
-
1924
- var sortOrderedTabbables = function sortOrderedTabbables(a, b) {
1925
- return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;
1926
- };
1927
-
1928
- var isInput = function isInput(node) {
1929
- return node.tagName === 'INPUT';
1930
- };
1931
-
1932
- var isHiddenInput = function isHiddenInput(node) {
1933
- return isInput(node) && node.type === 'hidden';
1934
- };
1935
-
1936
- var isDetailsWithSummary = function isDetailsWithSummary(node) {
1937
- var r = node.tagName === 'DETAILS' && Array.prototype.slice.apply(node.children).some(function (child) {
1938
- return child.tagName === 'SUMMARY';
1939
- });
1940
- return r;
1941
- };
1942
-
1943
- var getCheckedRadio = function getCheckedRadio(nodes, form) {
1944
- for (var i = 0; i < nodes.length; i++) {
1945
- if (nodes[i].checked && nodes[i].form === form) {
1946
- return nodes[i];
1947
- }
1948
- }
1949
- };
1950
-
1951
- var isTabbableRadio = function isTabbableRadio(node) {
1952
- if (!node.name) {
1953
- return true;
1954
- }
1955
-
1956
- var radioScope = node.form || getRootNode(node);
1957
-
1958
- var queryRadios = function queryRadios(name) {
1959
- return radioScope.querySelectorAll('input[type="radio"][name="' + name + '"]');
1960
- };
1961
-
1962
- var radioSet;
1963
-
1964
- if (typeof window !== 'undefined' && typeof window.CSS !== 'undefined' && typeof window.CSS.escape === 'function') {
1965
- radioSet = queryRadios(window.CSS.escape(node.name));
1966
- } else {
1967
- try {
1968
- radioSet = queryRadios(node.name);
1969
- } catch (err) {
1970
- // eslint-disable-next-line no-console
1971
- 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);
1972
- return false;
1973
- }
1974
- }
1975
-
1976
- var checked = getCheckedRadio(radioSet, node.form);
1977
- return !checked || checked === node;
1978
- };
1979
-
1980
- var isRadio = function isRadio(node) {
1981
- return isInput(node) && node.type === 'radio';
1982
- };
1983
-
1984
- var isNonTabbableRadio = function isNonTabbableRadio(node) {
1985
- return isRadio(node) && !isTabbableRadio(node);
1986
- }; // determines if a node is ultimately attached to the window's document
1987
-
1988
-
1989
- var isNodeAttached = function isNodeAttached(node) {
1990
- var _nodeRootHost;
1991
-
1992
- // The root node is the shadow root if the node is in a shadow DOM; some document otherwise
1993
- // (but NOT _the_ document; see second 'If' comment below for more).
1994
- // If rootNode is shadow root, it'll have a host, which is the element to which the shadow
1995
- // is attached, and the one we need to check if it's in the document or not (because the
1996
- // shadow, and all nodes it contains, is never considered in the document since shadows
1997
- // behave like self-contained DOMs; but if the shadow's HOST, which is part of the document,
1998
- // is hidden, or is not in the document itself but is detached, it will affect the shadow's
1999
- // visibility, including all the nodes it contains). The host could be any normal node,
2000
- // or a custom element (i.e. web component). Either way, that's the one that is considered
2001
- // part of the document, not the shadow root, nor any of its children (i.e. the node being
2002
- // tested).
2003
- // To further complicate things, we have to look all the way up until we find a shadow HOST
2004
- // that is attached (or find none) because the node might be in nested shadows...
2005
- // If rootNode is not a shadow root, it won't have a host, and so rootNode should be the
2006
- // document (per the docs) and while it's a Document-type object, that document does not
2007
- // appear to be the same as the node's `ownerDocument` for some reason, so it's safer
2008
- // to ignore the rootNode at this point, and use `node.ownerDocument`. Otherwise,
2009
- // using `rootNode.contains(node)` will _always_ be true we'll get false-positives when
2010
- // node is actually detached.
2011
- var nodeRootHost = getRootNode(node).host;
2012
- var attached = !!((_nodeRootHost = nodeRootHost) !== null && _nodeRootHost !== void 0 && _nodeRootHost.ownerDocument.contains(nodeRootHost) || node.ownerDocument.contains(node));
2013
-
2014
- while (!attached && nodeRootHost) {
2015
- var _nodeRootHost2;
2016
-
2017
- // since it's not attached and we have a root host, the node MUST be in a nested shadow DOM,
2018
- // which means we need to get the host's host and check if that parent host is contained
2019
- // in (i.e. attached to) the document
2020
- nodeRootHost = getRootNode(nodeRootHost).host;
2021
- attached = !!((_nodeRootHost2 = nodeRootHost) !== null && _nodeRootHost2 !== void 0 && _nodeRootHost2.ownerDocument.contains(nodeRootHost));
2022
- }
2023
-
2024
- return attached;
2025
- };
2026
-
2027
- var isZeroArea = function isZeroArea(node) {
2028
- var _node$getBoundingClie = node.getBoundingClientRect(),
2029
- width = _node$getBoundingClie.width,
2030
- height = _node$getBoundingClie.height;
2031
-
2032
- return width === 0 && height === 0;
2033
- };
2034
-
2035
- var isHidden = function isHidden(node, _ref) {
2036
- var displayCheck = _ref.displayCheck,
2037
- getShadowRoot = _ref.getShadowRoot;
2038
-
2039
- // NOTE: visibility will be `undefined` if node is detached from the document
2040
- // (see notes about this further down), which means we will consider it visible
2041
- // (this is legacy behavior from a very long way back)
2042
- // NOTE: we check this regardless of `displayCheck="none"` because this is a
2043
- // _visibility_ check, not a _display_ check
2044
- if (getComputedStyle(node).visibility === 'hidden') {
2045
- return true;
2046
- }
2047
-
2048
- var isDirectSummary = matches.call(node, 'details>summary:first-of-type');
2049
- var nodeUnderDetails = isDirectSummary ? node.parentElement : node;
2050
-
2051
- if (matches.call(nodeUnderDetails, 'details:not([open]) *')) {
2052
- return true;
2053
- }
2054
-
2055
- if (!displayCheck || displayCheck === 'full' || displayCheck === 'legacy-full') {
2056
- if (typeof getShadowRoot === 'function') {
2057
- // figure out if we should consider the node to be in an undisclosed shadow and use the
2058
- // 'non-zero-area' fallback
2059
- var originalNode = node;
2060
-
2061
- while (node) {
2062
- var parentElement = node.parentElement;
2063
- var rootNode = getRootNode(node);
2064
-
2065
- if (parentElement && !parentElement.shadowRoot && getShadowRoot(parentElement) === true // check if there's an undisclosed shadow
2066
- ) {
2067
- // node has an undisclosed shadow which means we can only treat it as a black box, so we
2068
- // fall back to a non-zero-area test
2069
- return isZeroArea(node);
2070
- } else if (node.assignedSlot) {
2071
- // iterate up slot
2072
- node = node.assignedSlot;
2073
- } else if (!parentElement && rootNode !== node.ownerDocument) {
2074
- // cross shadow boundary
2075
- node = rootNode.host;
2076
- } else {
2077
- // iterate up normal dom
2078
- node = parentElement;
2079
- }
2080
- }
2081
-
2082
- node = originalNode;
2083
- } // else, `getShadowRoot` might be true, but all that does is enable shadow DOM support
2084
- // (i.e. it does not also presume that all nodes might have undisclosed shadows); or
2085
- // it might be a falsy value, which means shadow DOM support is disabled
2086
- // Since we didn't find it sitting in an undisclosed shadow (or shadows are disabled)
2087
- // now we can just test to see if it would normally be visible or not, provided it's
2088
- // attached to the main document.
2089
- // NOTE: We must consider case where node is inside a shadow DOM and given directly to
2090
- // `isTabbable()` or `isFocusable()` -- regardless of `getShadowRoot` option setting.
2091
-
2092
-
2093
- if (isNodeAttached(node)) {
2094
- // this works wherever the node is: if there's at least one client rect, it's
2095
- // somehow displayed; it also covers the CSS 'display: contents' case where the
2096
- // node itself is hidden in place of its contents; and there's no need to search
2097
- // up the hierarchy either
2098
- return !node.getClientRects().length;
2099
- } // Else, the node isn't attached to the document, which means the `getClientRects()`
2100
- // API will __always__ return zero rects (this can happen, for example, if React
2101
- // is used to render nodes onto a detached tree, as confirmed in this thread:
2102
- // https://github.com/facebook/react/issues/9117#issuecomment-284228870)
2103
- //
2104
- // It also means that even window.getComputedStyle(node).display will return `undefined`
2105
- // because styles are only computed for nodes that are in the document.
2106
- //
2107
- // NOTE: THIS HAS BEEN THE CASE FOR YEARS. It is not new, nor is it caused by tabbable
2108
- // somehow. Though it was never stated officially, anyone who has ever used tabbable
2109
- // APIs on nodes in detached containers has actually implicitly used tabbable in what
2110
- // was later (as of v5.2.0 on Apr 9, 2021) called `displayCheck="none"` mode -- essentially
2111
- // considering __everything__ to be visible because of the innability to determine styles.
2112
- //
2113
- // v6.0.0: As of this major release, the default 'full' option __no longer treats detached
2114
- // nodes as visible with the 'none' fallback.__
2115
-
2116
-
2117
- if (displayCheck !== 'legacy-full') {
2118
- return true; // hidden
2119
- } // else, fallback to 'none' mode and consider the node visible
2120
-
2121
- } else if (displayCheck === 'non-zero-area') {
2122
- // NOTE: Even though this tests that the node's client rect is non-zero to determine
2123
- // whether it's displayed, and that a detached node will __always__ have a zero-area
2124
- // client rect, we don't special-case for whether the node is attached or not. In
2125
- // this mode, we do want to consider nodes that have a zero area to be hidden at all
2126
- // times, and that includes attached or not.
2127
- return isZeroArea(node);
2128
- } // visible, as far as we can tell, or per current `displayCheck=none` mode, we assume
2129
- // it's visible
2130
-
2131
-
2132
- return false;
2133
- }; // form fields (nested) inside a disabled fieldset are not focusable/tabbable
2134
- // unless they are in the _first_ <legend> element of the top-most disabled
2135
- // fieldset
2136
-
2137
-
2138
- var isDisabledFromFieldset = function isDisabledFromFieldset(node) {
2139
- if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) {
2140
- var parentNode = node.parentElement; // check if `node` is contained in a disabled <fieldset>
2141
-
2142
- while (parentNode) {
2143
- if (parentNode.tagName === 'FIELDSET' && parentNode.disabled) {
2144
- // look for the first <legend> among the children of the disabled <fieldset>
2145
- for (var i = 0; i < parentNode.children.length; i++) {
2146
- var child = parentNode.children.item(i); // when the first <legend> (in document order) is found
2147
-
2148
- if (child.tagName === 'LEGEND') {
2149
- // if its parent <fieldset> is not nested in another disabled <fieldset>,
2150
- // return whether `node` is a descendant of its first <legend>
2151
- return matches.call(parentNode, 'fieldset[disabled] *') ? true : !child.contains(node);
2152
- }
2153
- } // the disabled <fieldset> containing `node` has no <legend>
2154
-
2155
-
2156
- return true;
2157
- }
2158
-
2159
- parentNode = parentNode.parentElement;
2160
- }
2161
- } // else, node's tabbable/focusable state should not be affected by a fieldset's
2162
- // enabled/disabled state
2163
-
2164
-
2165
- return false;
2166
- };
2167
-
2168
- var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable(options, node) {
2169
- if (node.disabled || isHiddenInput(node) || isHidden(node, options) || // For a details element with a summary, the summary element gets the focus
2170
- isDetailsWithSummary(node) || isDisabledFromFieldset(node)) {
2171
- return false;
2172
- }
2173
-
2174
- return true;
2175
- };
2176
-
2177
- var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable(options, node) {
2178
- if (isNonTabbableRadio(node) || getTabindex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) {
2179
- return false;
2180
- }
2181
-
2182
- return true;
2183
- };
2184
-
2185
- var isValidShadowRootTabbable = function isValidShadowRootTabbable(shadowHostNode) {
2186
- var tabIndex = parseInt(shadowHostNode.getAttribute('tabindex'), 10);
2187
-
2188
- if (isNaN(tabIndex) || tabIndex >= 0) {
2189
- return true;
2190
- } // If a custom element has an explicit negative tabindex,
2191
- // browsers will not allow tab targeting said element's children.
2192
-
2193
-
2194
- return false;
2195
- };
2196
- /**
2197
- * @param {Array.<Element|CandidatesScope>} candidates
2198
- * @returns Element[]
2199
- */
2200
-
2201
-
2202
- var sortByOrder = function sortByOrder(candidates) {
2203
- var regularTabbables = [];
2204
- var orderedTabbables = [];
2205
- candidates.forEach(function (item, i) {
2206
- var isScope = !!item.scope;
2207
- var element = isScope ? item.scope : item;
2208
- var candidateTabindex = getTabindex(element, isScope);
2209
- var elements = isScope ? sortByOrder(item.candidates) : element;
2210
-
2211
- if (candidateTabindex === 0) {
2212
- isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element);
2213
- } else {
2214
- orderedTabbables.push({
2215
- documentOrder: i,
2216
- tabIndex: candidateTabindex,
2217
- item: item,
2218
- isScope: isScope,
2219
- content: elements
2220
- });
2221
- }
2222
- });
2223
- return orderedTabbables.sort(sortOrderedTabbables).reduce(function (acc, sortable) {
2224
- sortable.isScope ? acc.push.apply(acc, sortable.content) : acc.push(sortable.content);
2225
- return acc;
2226
- }, []).concat(regularTabbables);
2227
- };
2228
-
2229
- var tabbable = function tabbable(el, options) {
2230
- options = options || {};
2231
- var candidates;
2232
-
2233
- if (options.getShadowRoot) {
2234
- candidates = getCandidatesIteratively([el], options.includeContainer, {
2235
- filter: isNodeMatchingSelectorTabbable.bind(null, options),
2236
- flatten: false,
2237
- getShadowRoot: options.getShadowRoot,
2238
- shadowRootFilter: isValidShadowRootTabbable
2239
- });
2240
- } else {
2241
- candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));
2242
- }
2243
-
2244
- return sortByOrder(candidates);
2245
- };
2246
-
2247
- var focusable = function focusable(el, options) {
2248
- options = options || {};
2249
- var candidates;
2250
-
2251
- if (options.getShadowRoot) {
2252
- candidates = getCandidatesIteratively([el], options.includeContainer, {
2253
- filter: isNodeMatchingSelectorFocusable.bind(null, options),
2254
- flatten: true,
2255
- getShadowRoot: options.getShadowRoot
2256
- });
2257
- } else {
2258
- candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options));
2259
- }
2260
-
2261
- return candidates;
2262
- };
2263
-
2264
- var isTabbable = function isTabbable(node, options) {
2265
- options = options || {};
2266
-
2267
- if (!node) {
2268
- throw new Error('No node provided');
2269
- }
2270
-
2271
- if (matches.call(node, candidateSelector) === false) {
2272
- return false;
2273
- }
2274
-
2275
- return isNodeMatchingSelectorTabbable(options, node);
2276
- };
2277
-
2278
- var focusableCandidateSelector = /* #__PURE__ */candidateSelectors.concat('iframe').join(',');
2279
-
2280
- var isFocusable = function isFocusable(node, options) {
2281
- options = options || {};
2282
-
2283
- if (!node) {
2284
- throw new Error('No node provided');
2285
- }
2286
-
2287
- if (matches.call(node, focusableCandidateSelector) === false) {
2288
- return false;
2289
- }
2290
-
2291
- return isNodeMatchingSelectorFocusable(options, node);
2292
- };
2293
-
2294
- /*!
2295
- * focus-trap 7.0.0
2296
- * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
2297
- */
2298
-
2299
- function ownKeys(object, enumerableOnly) {
2300
- var keys = Object.keys(object);
2301
-
2302
- if (Object.getOwnPropertySymbols) {
2303
- var symbols = Object.getOwnPropertySymbols(object);
2304
- enumerableOnly && (symbols = symbols.filter(function (sym) {
2305
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
2306
- })), keys.push.apply(keys, symbols);
2307
- }
2308
-
2309
- return keys;
2310
- }
2311
-
2312
- function _objectSpread2(target) {
2313
- for (var i = 1; i < arguments.length; i++) {
2314
- var source = null != arguments[i] ? arguments[i] : {};
2315
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
2316
- _defineProperty(target, key, source[key]);
2317
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
2318
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
2319
- });
2320
- }
2321
-
2322
- return target;
2323
- }
2324
-
2325
- function _defineProperty(obj, key, value) {
2326
- if (key in obj) {
2327
- Object.defineProperty(obj, key, {
2328
- value: value,
2329
- enumerable: true,
2330
- configurable: true,
2331
- writable: true
2332
- });
2333
- } else {
2334
- obj[key] = value;
2335
- }
2336
-
2337
- return obj;
2338
- }
2339
-
2340
- var activeFocusTraps = function () {
2341
- var trapQueue = [];
2342
- return {
2343
- activateTrap: function activateTrap(trap) {
2344
- if (trapQueue.length > 0) {
2345
- var activeTrap = trapQueue[trapQueue.length - 1];
2346
-
2347
- if (activeTrap !== trap) {
2348
- activeTrap.pause();
2349
- }
2350
- }
2351
-
2352
- var trapIndex = trapQueue.indexOf(trap);
2353
-
2354
- if (trapIndex === -1) {
2355
- trapQueue.push(trap);
2356
- } else {
2357
- // move this existing trap to the front of the queue
2358
- trapQueue.splice(trapIndex, 1);
2359
- trapQueue.push(trap);
2360
- }
2361
- },
2362
- deactivateTrap: function deactivateTrap(trap) {
2363
- var trapIndex = trapQueue.indexOf(trap);
2364
-
2365
- if (trapIndex !== -1) {
2366
- trapQueue.splice(trapIndex, 1);
2367
- }
2368
-
2369
- if (trapQueue.length > 0) {
2370
- trapQueue[trapQueue.length - 1].unpause();
2371
- }
2372
- }
2373
- };
2374
- }();
2375
-
2376
- var isSelectableInput = function isSelectableInput(node) {
2377
- return node.tagName && node.tagName.toLowerCase() === 'input' && typeof node.select === 'function';
2378
- };
2379
-
2380
- var isEscapeEvent = function isEscapeEvent(e) {
2381
- return e.key === 'Escape' || e.key === 'Esc' || e.keyCode === 27;
2382
- };
2383
-
2384
- var isTabEvent = function isTabEvent(e) {
2385
- return e.key === 'Tab' || e.keyCode === 9;
2386
- };
2387
-
2388
- var delay$1 = function delay(fn) {
2389
- return setTimeout(fn, 0);
2390
- }; // Array.find/findIndex() are not supported on IE; this replicates enough
2391
- // of Array.findIndex() for our needs
2392
-
2393
-
2394
- var findIndex = function findIndex(arr, fn) {
2395
- var idx = -1;
2396
- arr.every(function (value, i) {
2397
- if (fn(value)) {
2398
- idx = i;
2399
- return false; // break
2400
- }
2401
-
2402
- return true; // next
2403
- });
2404
- return idx;
2405
- };
2406
- /**
2407
- * Get an option's value when it could be a plain value, or a handler that provides
2408
- * the value.
2409
- * @param {*} value Option's value to check.
2410
- * @param {...*} [params] Any parameters to pass to the handler, if `value` is a function.
2411
- * @returns {*} The `value`, or the handler's returned value.
2412
- */
2413
-
2414
-
2415
- var valueOrHandler = function valueOrHandler(value) {
2416
- for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
2417
- params[_key - 1] = arguments[_key];
2418
- }
2419
-
2420
- return typeof value === 'function' ? value.apply(void 0, params) : value;
2421
- };
2422
-
2423
- var getActualTarget = function getActualTarget(event) {
2424
- // NOTE: If the trap is _inside_ a shadow DOM, event.target will always be the
2425
- // shadow host. However, event.target.composedPath() will be an array of
2426
- // nodes "clicked" from inner-most (the actual element inside the shadow) to
2427
- // outer-most (the host HTML document). If we have access to composedPath(),
2428
- // then use its first element; otherwise, fall back to event.target (and
2429
- // this only works for an _open_ shadow DOM; otherwise,
2430
- // composedPath()[0] === event.target always).
2431
- return event.target.shadowRoot && typeof event.composedPath === 'function' ? event.composedPath()[0] : event.target;
2432
- };
2433
-
2434
- var createFocusTrap = function createFocusTrap(elements, userOptions) {
2435
- // SSR: a live trap shouldn't be created in this type of environment so this
2436
- // should be safe code to execute if the `document` option isn't specified
2437
- var doc = (userOptions === null || userOptions === void 0 ? void 0 : userOptions.document) || document;
2438
-
2439
- var config = _objectSpread2({
2440
- returnFocusOnDeactivate: true,
2441
- escapeDeactivates: true,
2442
- delayInitialFocus: true
2443
- }, userOptions);
2444
-
2445
- var state = {
2446
- // containers given to createFocusTrap()
2447
- // @type {Array<HTMLElement>}
2448
- containers: [],
2449
- // list of objects identifying tabbable nodes in `containers` in the trap
2450
- // NOTE: it's possible that a group has no tabbable nodes if nodes get removed while the trap
2451
- // is active, but the trap should never get to a state where there isn't at least one group
2452
- // with at least one tabbable node in it (that would lead to an error condition that would
2453
- // result in an error being thrown)
2454
- // @type {Array<{
2455
- // container: HTMLElement,
2456
- // tabbableNodes: Array<HTMLElement>, // empty if none
2457
- // focusableNodes: Array<HTMLElement>, // empty if none
2458
- // firstTabbableNode: HTMLElement|null,
2459
- // lastTabbableNode: HTMLElement|null,
2460
- // nextTabbableNode: (node: HTMLElement, forward: boolean) => HTMLElement|undefined
2461
- // }>}
2462
- containerGroups: [],
2463
- // same order/length as `containers` list
2464
- // references to objects in `containerGroups`, but only those that actually have
2465
- // tabbable nodes in them
2466
- // NOTE: same order as `containers` and `containerGroups`, but __not necessarily__
2467
- // the same length
2468
- tabbableGroups: [],
2469
- nodeFocusedBeforeActivation: null,
2470
- mostRecentlyFocusedNode: null,
2471
- active: false,
2472
- paused: false,
2473
- // timer ID for when delayInitialFocus is true and initial focus in this trap
2474
- // has been delayed during activation
2475
- delayInitialFocusTimer: undefined
2476
- };
2477
- var trap; // eslint-disable-line prefer-const -- some private functions reference it, and its methods reference private functions, so we must declare here and define later
2478
-
2479
- /**
2480
- * Gets a configuration option value.
2481
- * @param {Object|undefined} configOverrideOptions If true, and option is defined in this set,
2482
- * value will be taken from this object. Otherwise, value will be taken from base configuration.
2483
- * @param {string} optionName Name of the option whose value is sought.
2484
- * @param {string|undefined} [configOptionName] Name of option to use __instead of__ `optionName`
2485
- * IIF `configOverrideOptions` is not defined. Otherwise, `optionName` is used.
2486
- */
2487
-
2488
- var getOption = function getOption(configOverrideOptions, optionName, configOptionName) {
2489
- return configOverrideOptions && configOverrideOptions[optionName] !== undefined ? configOverrideOptions[optionName] : config[configOptionName || optionName];
2490
- };
2491
- /**
2492
- * Finds the index of the container that contains the element.
2493
- * @param {HTMLElement} element
2494
- * @returns {number} Index of the container in either `state.containers` or
2495
- * `state.containerGroups` (the order/length of these lists are the same); -1
2496
- * if the element isn't found.
2497
- */
2498
-
2499
-
2500
- var findContainerIndex = function findContainerIndex(element) {
2501
- // NOTE: search `containerGroups` because it's possible a group contains no tabbable
2502
- // nodes, but still contains focusable nodes (e.g. if they all have `tabindex=-1`)
2503
- // and we still need to find the element in there
2504
- return state.containerGroups.findIndex(function (_ref) {
2505
- var container = _ref.container,
2506
- tabbableNodes = _ref.tabbableNodes;
2507
- return container.contains(element) || // fall back to explicit tabbable search which will take into consideration any
2508
- // web components if the `tabbableOptions.getShadowRoot` option was used for
2509
- // the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't
2510
- // look inside web components even if open)
2511
- tabbableNodes.find(function (node) {
2512
- return node === element;
2513
- });
2514
- });
2515
- };
2516
- /**
2517
- * Gets the node for the given option, which is expected to be an option that
2518
- * can be either a DOM node, a string that is a selector to get a node, `false`
2519
- * (if a node is explicitly NOT given), or a function that returns any of these
2520
- * values.
2521
- * @param {string} optionName
2522
- * @returns {undefined | false | HTMLElement | SVGElement} Returns
2523
- * `undefined` if the option is not specified; `false` if the option
2524
- * resolved to `false` (node explicitly not given); otherwise, the resolved
2525
- * DOM node.
2526
- * @throws {Error} If the option is set, not `false`, and is not, or does not
2527
- * resolve to a node.
2528
- */
2529
-
2530
-
2531
- var getNodeForOption = function getNodeForOption(optionName) {
2532
- var optionValue = config[optionName];
2533
-
2534
- if (typeof optionValue === 'function') {
2535
- for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
2536
- params[_key2 - 1] = arguments[_key2];
2537
- }
2538
-
2539
- optionValue = optionValue.apply(void 0, params);
2540
- }
2541
-
2542
- if (optionValue === true) {
2543
- optionValue = undefined; // use default value
2544
- }
2545
-
2546
- if (!optionValue) {
2547
- if (optionValue === undefined || optionValue === false) {
2548
- return optionValue;
2549
- } // else, empty string (invalid), null (invalid), 0 (invalid)
2550
-
2551
-
2552
- throw new Error("`".concat(optionName, "` was specified but was not a node, or did not return a node"));
2553
- }
2554
-
2555
- var node = optionValue; // could be HTMLElement, SVGElement, or non-empty string at this point
2556
-
2557
- if (typeof optionValue === 'string') {
2558
- node = doc.querySelector(optionValue); // resolve to node, or null if fails
2559
-
2560
- if (!node) {
2561
- throw new Error("`".concat(optionName, "` as selector refers to no known node"));
2562
- }
2563
- }
2564
-
2565
- return node;
2566
- };
2567
-
2568
- var getInitialFocusNode = function getInitialFocusNode() {
2569
- var node = getNodeForOption('initialFocus'); // false explicitly indicates we want no initialFocus at all
2570
-
2571
- if (node === false) {
2572
- return false;
2573
- }
2574
-
2575
- if (node === undefined) {
2576
- // option not specified: use fallback options
2577
- if (findContainerIndex(doc.activeElement) >= 0) {
2578
- node = doc.activeElement;
2579
- } else {
2580
- var firstTabbableGroup = state.tabbableGroups[0];
2581
- var firstTabbableNode = firstTabbableGroup && firstTabbableGroup.firstTabbableNode; // NOTE: `fallbackFocus` option function cannot return `false` (not supported)
2582
-
2583
- node = firstTabbableNode || getNodeForOption('fallbackFocus');
2584
- }
2585
- }
2586
-
2587
- if (!node) {
2588
- throw new Error('Your focus-trap needs to have at least one focusable element');
2589
- }
2590
-
2591
- return node;
2592
- };
2593
-
2594
- var updateTabbableNodes = function updateTabbableNodes() {
2595
- state.containerGroups = state.containers.map(function (container) {
2596
- var tabbableNodes = tabbable(container, config.tabbableOptions); // NOTE: if we have tabbable nodes, we must have focusable nodes; focusable nodes
2597
- // are a superset of tabbable nodes
2598
-
2599
- var focusableNodes = focusable(container, config.tabbableOptions);
2600
- return {
2601
- container: container,
2602
- tabbableNodes: tabbableNodes,
2603
- focusableNodes: focusableNodes,
2604
- firstTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[0] : null,
2605
- lastTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[tabbableNodes.length - 1] : null,
2606
-
2607
- /**
2608
- * Finds the __tabbable__ node that follows the given node in the specified direction,
2609
- * in this container, if any.
2610
- * @param {HTMLElement} node
2611
- * @param {boolean} [forward] True if going in forward tab order; false if going
2612
- * in reverse.
2613
- * @returns {HTMLElement|undefined} The next tabbable node, if any.
2614
- */
2615
- nextTabbableNode: function nextTabbableNode(node) {
2616
- var forward = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
2617
- // NOTE: If tabindex is positive (in order to manipulate the tab order separate
2618
- // from the DOM order), this __will not work__ because the list of focusableNodes,
2619
- // while it contains tabbable nodes, does not sort its nodes in any order other
2620
- // than DOM order, because it can't: Where would you place focusable (but not
2621
- // tabbable) nodes in that order? They have no order, because they aren't tabbale...
2622
- // Support for positive tabindex is already broken and hard to manage (possibly
2623
- // not supportable, TBD), so this isn't going to make things worse than they
2624
- // already are, and at least makes things better for the majority of cases where
2625
- // tabindex is either 0/unset or negative.
2626
- // FYI, positive tabindex issue: https://github.com/focus-trap/focus-trap/issues/375
2627
- var nodeIdx = focusableNodes.findIndex(function (n) {
2628
- return n === node;
2629
- });
2630
-
2631
- if (nodeIdx < 0) {
2632
- return undefined;
2633
- }
2634
-
2635
- if (forward) {
2636
- return focusableNodes.slice(nodeIdx + 1).find(function (n) {
2637
- return isTabbable(n, config.tabbableOptions);
2638
- });
2639
- }
2640
-
2641
- return focusableNodes.slice(0, nodeIdx).reverse().find(function (n) {
2642
- return isTabbable(n, config.tabbableOptions);
2643
- });
2644
- }
2645
- };
2646
- });
2647
- state.tabbableGroups = state.containerGroups.filter(function (group) {
2648
- return group.tabbableNodes.length > 0;
2649
- }); // throw if no groups have tabbable nodes and we don't have a fallback focus node either
2650
-
2651
- if (state.tabbableGroups.length <= 0 && !getNodeForOption('fallbackFocus') // returning false not supported for this option
2652
- ) {
2653
- throw new Error('Your focus-trap must have at least one container with at least one tabbable node in it at all times');
2654
- }
2655
- };
2656
-
2657
- var tryFocus = function tryFocus(node) {
2658
- if (node === false) {
2659
- return;
2660
- }
2661
-
2662
- if (node === doc.activeElement) {
2663
- return;
2664
- }
2665
-
2666
- if (!node || !node.focus) {
2667
- tryFocus(getInitialFocusNode());
2668
- return;
2669
- }
2670
-
2671
- node.focus({
2672
- preventScroll: !!config.preventScroll
2673
- });
2674
- state.mostRecentlyFocusedNode = node;
2675
-
2676
- if (isSelectableInput(node)) {
2677
- node.select();
2678
- }
2679
- };
2680
-
2681
- var getReturnFocusNode = function getReturnFocusNode(previousActiveElement) {
2682
- var node = getNodeForOption('setReturnFocus', previousActiveElement);
2683
- return node ? node : node === false ? false : previousActiveElement;
2684
- }; // This needs to be done on mousedown and touchstart instead of click
2685
- // so that it precedes the focus event.
2686
-
2687
-
2688
- var checkPointerDown = function checkPointerDown(e) {
2689
- var target = getActualTarget(e);
2690
-
2691
- if (findContainerIndex(target) >= 0) {
2692
- // allow the click since it ocurred inside the trap
2693
- return;
2694
- }
2695
-
2696
- if (valueOrHandler(config.clickOutsideDeactivates, e)) {
2697
- // immediately deactivate the trap
2698
- trap.deactivate({
2699
- // if, on deactivation, we should return focus to the node originally-focused
2700
- // when the trap was activated (or the configured `setReturnFocus` node),
2701
- // then assume it's also OK to return focus to the outside node that was
2702
- // just clicked, causing deactivation, as long as that node is focusable;
2703
- // if it isn't focusable, then return focus to the original node focused
2704
- // on activation (or the configured `setReturnFocus` node)
2705
- // NOTE: by setting `returnFocus: false`, deactivate() will do nothing,
2706
- // which will result in the outside click setting focus to the node
2707
- // that was clicked, whether it's focusable or not; by setting
2708
- // `returnFocus: true`, we'll attempt to re-focus the node originally-focused
2709
- // on activation (or the configured `setReturnFocus` node)
2710
- returnFocus: config.returnFocusOnDeactivate && !isFocusable(target, config.tabbableOptions)
2711
- });
2712
- return;
2713
- } // This is needed for mobile devices.
2714
- // (If we'll only let `click` events through,
2715
- // then on mobile they will be blocked anyways if `touchstart` is blocked.)
2716
-
2717
-
2718
- if (valueOrHandler(config.allowOutsideClick, e)) {
2719
- // allow the click outside the trap to take place
2720
- return;
2721
- } // otherwise, prevent the click
2722
-
2723
-
2724
- e.preventDefault();
2725
- }; // In case focus escapes the trap for some strange reason, pull it back in.
2726
-
2727
-
2728
- var checkFocusIn = function checkFocusIn(e) {
2729
- var target = getActualTarget(e);
2730
- var targetContained = findContainerIndex(target) >= 0; // In Firefox when you Tab out of an iframe the Document is briefly focused.
2731
-
2732
- if (targetContained || target instanceof Document) {
2733
- if (targetContained) {
2734
- state.mostRecentlyFocusedNode = target;
2735
- }
2736
- } else {
2737
- // escaped! pull it back in to where it just left
2738
- e.stopImmediatePropagation();
2739
- tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());
2740
- }
2741
- }; // Hijack Tab events on the first and last focusable nodes of the trap,
2742
- // in order to prevent focus from escaping. If it escapes for even a
2743
- // moment it can end up scrolling the page and causing confusion so we
2744
- // kind of need to capture the action at the keydown phase.
2745
-
2746
-
2747
- var checkTab = function checkTab(e) {
2748
- var target = getActualTarget(e);
2749
- updateTabbableNodes();
2750
- var destinationNode = null;
2751
-
2752
- if (state.tabbableGroups.length > 0) {
2753
- // make sure the target is actually contained in a group
2754
- // NOTE: the target may also be the container itself if it's focusable
2755
- // with tabIndex='-1' and was given initial focus
2756
- var containerIndex = findContainerIndex(target);
2757
- var containerGroup = containerIndex >= 0 ? state.containerGroups[containerIndex] : undefined;
2758
-
2759
- if (containerIndex < 0) {
2760
- // target not found in any group: quite possible focus has escaped the trap,
2761
- // so bring it back in to...
2762
- if (e.shiftKey) {
2763
- // ...the last node in the last group
2764
- destinationNode = state.tabbableGroups[state.tabbableGroups.length - 1].lastTabbableNode;
2765
- } else {
2766
- // ...the first node in the first group
2767
- destinationNode = state.tabbableGroups[0].firstTabbableNode;
2768
- }
2769
- } else if (e.shiftKey) {
2770
- // REVERSE
2771
- // is the target the first tabbable node in a group?
2772
- var startOfGroupIndex = findIndex(state.tabbableGroups, function (_ref2) {
2773
- var firstTabbableNode = _ref2.firstTabbableNode;
2774
- return target === firstTabbableNode;
2775
- });
2776
-
2777
- if (startOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config.tabbableOptions) && !isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target, false))) {
2778
- // an exception case where the target is either the container itself, or
2779
- // a non-tabbable node that was given focus (i.e. tabindex is negative
2780
- // and user clicked on it or node was programmatically given focus)
2781
- // and is not followed by any other tabbable node, in which
2782
- // case, we should handle shift+tab as if focus were on the container's
2783
- // first tabbable node, and go to the last tabbable node of the LAST group
2784
- startOfGroupIndex = containerIndex;
2785
- }
2786
-
2787
- if (startOfGroupIndex >= 0) {
2788
- // YES: then shift+tab should go to the last tabbable node in the
2789
- // previous group (and wrap around to the last tabbable node of
2790
- // the LAST group if it's the first tabbable node of the FIRST group)
2791
- var destinationGroupIndex = startOfGroupIndex === 0 ? state.tabbableGroups.length - 1 : startOfGroupIndex - 1;
2792
- var destinationGroup = state.tabbableGroups[destinationGroupIndex];
2793
- destinationNode = destinationGroup.lastTabbableNode;
2794
- }
2795
- } else {
2796
- // FORWARD
2797
- // is the target the last tabbable node in a group?
2798
- var lastOfGroupIndex = findIndex(state.tabbableGroups, function (_ref3) {
2799
- var lastTabbableNode = _ref3.lastTabbableNode;
2800
- return target === lastTabbableNode;
2801
- });
2802
-
2803
- if (lastOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config.tabbableOptions) && !isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target))) {
2804
- // an exception case where the target is the container itself, or
2805
- // a non-tabbable node that was given focus (i.e. tabindex is negative
2806
- // and user clicked on it or node was programmatically given focus)
2807
- // and is not followed by any other tabbable node, in which
2808
- // case, we should handle tab as if focus were on the container's
2809
- // last tabbable node, and go to the first tabbable node of the FIRST group
2810
- lastOfGroupIndex = containerIndex;
2811
- }
2812
-
2813
- if (lastOfGroupIndex >= 0) {
2814
- // YES: then tab should go to the first tabbable node in the next
2815
- // group (and wrap around to the first tabbable node of the FIRST
2816
- // group if it's the last tabbable node of the LAST group)
2817
- var _destinationGroupIndex = lastOfGroupIndex === state.tabbableGroups.length - 1 ? 0 : lastOfGroupIndex + 1;
2818
-
2819
- var _destinationGroup = state.tabbableGroups[_destinationGroupIndex];
2820
- destinationNode = _destinationGroup.firstTabbableNode;
2821
- }
2822
- }
2823
- } else {
2824
- // NOTE: the fallbackFocus option does not support returning false to opt-out
2825
- destinationNode = getNodeForOption('fallbackFocus');
2826
- }
2827
-
2828
- if (destinationNode) {
2829
- e.preventDefault();
2830
- tryFocus(destinationNode);
2831
- } // else, let the browser take care of [shift+]tab and move the focus
2832
-
2833
- };
2834
-
2835
- var checkKey = function checkKey(e) {
2836
- if (isEscapeEvent(e) && valueOrHandler(config.escapeDeactivates, e) !== false) {
2837
- e.preventDefault();
2838
- trap.deactivate();
2839
- return;
2840
- }
2841
-
2842
- if (isTabEvent(e)) {
2843
- checkTab(e);
2844
- return;
2845
- }
2846
- };
2847
-
2848
- var checkClick = function checkClick(e) {
2849
- var target = getActualTarget(e);
2850
-
2851
- if (findContainerIndex(target) >= 0) {
2852
- return;
2853
- }
2854
-
2855
- if (valueOrHandler(config.clickOutsideDeactivates, e)) {
2856
- return;
2857
- }
2858
-
2859
- if (valueOrHandler(config.allowOutsideClick, e)) {
2860
- return;
2861
- }
2862
-
2863
- e.preventDefault();
2864
- e.stopImmediatePropagation();
2865
- }; //
2866
- // EVENT LISTENERS
2867
- //
2868
-
2869
-
2870
- var addListeners = function addListeners() {
2871
- if (!state.active) {
2872
- return;
2873
- } // There can be only one listening focus trap at a time
2874
-
2875
-
2876
- activeFocusTraps.activateTrap(trap); // Delay ensures that the focused element doesn't capture the event
2877
- // that caused the focus trap activation.
2878
-
2879
- state.delayInitialFocusTimer = config.delayInitialFocus ? delay$1(function () {
2880
- tryFocus(getInitialFocusNode());
2881
- }) : tryFocus(getInitialFocusNode());
2882
- doc.addEventListener('focusin', checkFocusIn, true);
2883
- doc.addEventListener('mousedown', checkPointerDown, {
2884
- capture: true,
2885
- passive: false
2886
- });
2887
- doc.addEventListener('touchstart', checkPointerDown, {
2888
- capture: true,
2889
- passive: false
2890
- });
2891
- doc.addEventListener('click', checkClick, {
2892
- capture: true,
2893
- passive: false
2894
- });
2895
- doc.addEventListener('keydown', checkKey, {
2896
- capture: true,
2897
- passive: false
2898
- });
2899
- return trap;
2900
- };
2901
-
2902
- var removeListeners = function removeListeners() {
2903
- if (!state.active) {
2904
- return;
2905
- }
2906
-
2907
- doc.removeEventListener('focusin', checkFocusIn, true);
2908
- doc.removeEventListener('mousedown', checkPointerDown, true);
2909
- doc.removeEventListener('touchstart', checkPointerDown, true);
2910
- doc.removeEventListener('click', checkClick, true);
2911
- doc.removeEventListener('keydown', checkKey, true);
2912
- return trap;
2913
- }; //
2914
- // TRAP DEFINITION
2915
- //
2916
-
2917
-
2918
- trap = {
2919
- get active() {
2920
- return state.active;
2921
- },
2922
-
2923
- get paused() {
2924
- return state.paused;
2925
- },
2926
-
2927
- activate: function activate(activateOptions) {
2928
- if (state.active) {
2929
- return this;
2930
- }
2931
-
2932
- var onActivate = getOption(activateOptions, 'onActivate');
2933
- var onPostActivate = getOption(activateOptions, 'onPostActivate');
2934
- var checkCanFocusTrap = getOption(activateOptions, 'checkCanFocusTrap');
2935
-
2936
- if (!checkCanFocusTrap) {
2937
- updateTabbableNodes();
2938
- }
2939
-
2940
- state.active = true;
2941
- state.paused = false;
2942
- state.nodeFocusedBeforeActivation = doc.activeElement;
2943
-
2944
- if (onActivate) {
2945
- onActivate();
2946
- }
2947
-
2948
- var finishActivation = function finishActivation() {
2949
- if (checkCanFocusTrap) {
2950
- updateTabbableNodes();
2951
- }
2952
-
2953
- addListeners();
2954
-
2955
- if (onPostActivate) {
2956
- onPostActivate();
2957
- }
2958
- };
2959
-
2960
- if (checkCanFocusTrap) {
2961
- checkCanFocusTrap(state.containers.concat()).then(finishActivation, finishActivation);
2962
- return this;
2963
- }
2964
-
2965
- finishActivation();
2966
- return this;
2967
- },
2968
- deactivate: function deactivate(deactivateOptions) {
2969
- if (!state.active) {
2970
- return this;
2971
- }
2972
-
2973
- var options = _objectSpread2({
2974
- onDeactivate: config.onDeactivate,
2975
- onPostDeactivate: config.onPostDeactivate,
2976
- checkCanReturnFocus: config.checkCanReturnFocus
2977
- }, deactivateOptions);
2978
-
2979
- clearTimeout(state.delayInitialFocusTimer); // noop if undefined
2980
-
2981
- state.delayInitialFocusTimer = undefined;
2982
- removeListeners();
2983
- state.active = false;
2984
- state.paused = false;
2985
- activeFocusTraps.deactivateTrap(trap);
2986
- var onDeactivate = getOption(options, 'onDeactivate');
2987
- var onPostDeactivate = getOption(options, 'onPostDeactivate');
2988
- var checkCanReturnFocus = getOption(options, 'checkCanReturnFocus');
2989
- var returnFocus = getOption(options, 'returnFocus', 'returnFocusOnDeactivate');
2990
-
2991
- if (onDeactivate) {
2992
- onDeactivate();
2993
- }
2994
-
2995
- var finishDeactivation = function finishDeactivation() {
2996
- delay$1(function () {
2997
- if (returnFocus) {
2998
- tryFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation));
2999
- }
3000
-
3001
- if (onPostDeactivate) {
3002
- onPostDeactivate();
3003
- }
3004
- });
3005
- };
3006
-
3007
- if (returnFocus && checkCanReturnFocus) {
3008
- checkCanReturnFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation)).then(finishDeactivation, finishDeactivation);
3009
- return this;
3010
- }
3011
-
3012
- finishDeactivation();
3013
- return this;
3014
- },
3015
- pause: function pause() {
3016
- if (state.paused || !state.active) {
3017
- return this;
3018
- }
3019
-
3020
- state.paused = true;
3021
- removeListeners();
3022
- return this;
3023
- },
3024
- unpause: function unpause() {
3025
- if (!state.paused || !state.active) {
3026
- return this;
3027
- }
3028
-
3029
- state.paused = false;
3030
- updateTabbableNodes();
3031
- addListeners();
3032
- return this;
3033
- },
3034
- updateContainerElements: function updateContainerElements(containerElements) {
3035
- var elementsAsArray = [].concat(containerElements).filter(Boolean);
3036
- state.containers = elementsAsArray.map(function (element) {
3037
- return typeof element === 'string' ? doc.querySelector(element) : element;
3038
- });
3039
-
3040
- if (state.active) {
3041
- updateTabbableNodes();
3042
- }
3043
-
3044
- return this;
3045
- }
3046
- }; // initialize container elements
3047
-
3048
- trap.updateContainerElements(elements);
3049
- return trap;
3050
- };
3051
-
3052
- const firstTabbable = (container) => {
3053
- return (container ? tabbable(container, { includeContainer: true, getShadowRoot: true }) : []).shift();
3054
- };
3055
-
3056
1776
  const catMenuCss = ":host{display:contents}:host([hidden]){display:none}::slotted(nav){padding-top:0.5rem;padding-bottom:0.5rem;min-width:8rem;max-width:16rem}.content{position:absolute;background:white;display:none;overflow:auto;-webkit-overflow-scrolling:touch;min-height:2rem;max-height:calc(100vh - 48px);box-shadow:0 1px 4px 0 rgba(16, 29, 48, 0.2);border-radius:var(--cat-border-radius-m, 0.25rem);z-index:100}";
3057
1777
 
3058
1778
  let nextUniqueId$6 = 0;
@@ -3082,28 +1802,20 @@ const CatMenu = class {
3082
1802
  this.hide();
3083
1803
  }
3084
1804
  componentDidLoad() {
3085
- var _a, _b, _c, _d, _e, _f, _g;
3086
- let trigger = (_b = (_a = this.triggerSlot) === null || _a === void 0 ? void 0 : _a.querySelector('[data-trigger]')) !== null && _b !== void 0 ? _b : undefined;
3087
- if (!trigger) {
3088
- trigger = firstTabbable(this.triggerSlot);
3089
- }
3090
- if (!trigger) {
3091
- catNotification.loglevel.error('Cannot find tabbable element. Use [data-trigger] to set the trigger.');
3092
- return;
3093
- }
3094
- this.trigger = firstTabbable(this.triggerSlot);
3095
- (_c = this.trigger) === null || _c === void 0 ? void 0 : _c.setAttribute('aria-haspopup', 'true');
3096
- (_d = this.trigger) === null || _d === void 0 ? void 0 : _d.setAttribute('aria-expanded', 'false');
3097
- (_e = this.trigger) === null || _e === void 0 ? void 0 : _e.setAttribute('aria-controls', this.contentId);
3098
- (_f = this.content) === null || _f === void 0 ? void 0 : _f.setAttribute('id', this.contentId);
1805
+ var _a, _b, _c, _d, _e;
1806
+ this.trigger = this.findTrigger();
1807
+ (_a = this.trigger) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-haspopup', 'true');
1808
+ (_b = this.trigger) === null || _b === void 0 ? void 0 : _b.setAttribute('aria-expanded', 'false');
1809
+ (_c = this.trigger) === null || _c === void 0 ? void 0 : _c.setAttribute('aria-controls', this.contentId);
1810
+ (_d = this.content) === null || _d === void 0 ? void 0 : _d.setAttribute('id', this.contentId);
3099
1811
  if (this.trigger && this.content) {
3100
- (_g = this.trigger) === null || _g === void 0 ? void 0 : _g.addEventListener('click', () => this.show());
1812
+ (_e = this.trigger) === null || _e === void 0 ? void 0 : _e.addEventListener('click', () => this.show());
3101
1813
  autoUpdate(this.trigger, this.content, () => this.update());
3102
1814
  }
3103
1815
  this.keyListener = event => {
3104
1816
  if (this.content && ['ArrowDown', 'ArrowUp'].includes(event.key)) {
3105
- const targetElements = tabbable(this.content, { includeContainer: false, getShadowRoot: true });
3106
- const activeElement = firstTabbable(document.activeElement);
1817
+ const targetElements = firstTabbable.tabbable(this.content, { includeContainer: false, getShadowRoot: true });
1818
+ const activeElement = firstTabbable.firstTabbable(document.activeElement);
3107
1819
  const activeIdx = activeElement ? targetElements.indexOf(activeElement) : -1;
3108
1820
  const activeOff = event.key === 'ArrowDown' ? 1 : -1;
3109
1821
  const targetIdx = activeIdx < 0 ? 0 : (activeIdx + activeOff + targetElements.length) % targetElements.length;
@@ -3132,7 +1844,7 @@ const CatMenu = class {
3132
1844
  this.catOpen.emit();
3133
1845
  this.trap = this.trap
3134
1846
  ? this.trap.updateContainerElements(this.content)
3135
- : createFocusTrap(this.content, {
1847
+ : firstTabbable.createFocusTrap(this.content, {
3136
1848
  tabbableOptions: {
3137
1849
  getShadowRoot: true
3138
1850
  },
@@ -3166,75 +1878,30 @@ const CatMenu = class {
3166
1878
  });
3167
1879
  }
3168
1880
  }
3169
- };
3170
- CatMenu.OFFSET = 4;
3171
- CatMenu.style = catMenuCss;
3172
-
3173
- const catModalCss = ":host{display:block}:host([hidden]){display:none}.modal-wrapper{position:fixed;top:0;right:0;bottom:0;left:0;background-color:rgb(rgb(var(--cat-bg-backdrop, 0, 0, 0)), var(--cat-opacity-backdrop, 0.6));z-index:2;display:flex}.modal-wrapper[aria-hidden=true]{display:none}.modal{margin:auto;z-index:2;position:relative;background-color:white;border-radius:var(--cat-border-radius-l, 0.5rem);max-width:100%;padding:32px}.modal-header{display:flex;justify-content:end;align-self:stretch}.modal-header .close-button::part(button){box-shadow:unset}.modal-content{display:flex;flex-direction:column;align-items:flex-start;align-self:stretch;margin:16px 0}.modal-s{width:400px}.modal-m{width:600px}.modal-l{width:800px}";
3174
-
3175
- const CatModal = class {
3176
- constructor(hostRef) {
3177
- index.registerInstance(this, hostRef);
3178
- this.isVisible = false;
3179
- /**
3180
- * The size of the modal.
3181
- */
3182
- this.size = 'm';
3183
- }
3184
- componentDidLoad() {
3185
- if (this.modal) {
3186
- this.trap = createFocusTrap(this.modal, {
3187
- tabbableOptions: {
3188
- getShadowRoot: true
3189
- },
3190
- initialFocus: firstTabbable(this.closeButton),
3191
- allowOutsideClick: true,
3192
- clickOutsideDeactivates: event => !this.modal || !event.composedPath().includes(this.modal),
3193
- onDeactivate: () => (this.isVisible = false),
3194
- setReturnFocus: previousActiveElement => previousActiveElement instanceof HTMLElement
3195
- ? firstTabbable(previousActiveElement)
3196
- : previousActiveElement
3197
- });
1881
+ findTrigger() {
1882
+ var _a, _b;
1883
+ let trigger;
1884
+ const elems = ((_a = this.triggerSlot) === null || _a === void 0 ? void 0 : _a.assignedElements()) || [];
1885
+ while (!trigger && elems.length) {
1886
+ const elem = elems.shift();
1887
+ trigger = (elem === null || elem === void 0 ? void 0 : elem.hasAttribute('data-trigger'))
1888
+ ? elem
1889
+ : (_b = elem === null || elem === void 0 ? void 0 : elem.querySelector('[data-trigger]')) !== null && _b !== void 0 ? _b : undefined;
3198
1890
  }
3199
- }
3200
- componentDidUpdate() {
3201
- var _a;
3202
- if (this.isVisible)
3203
- (_a = this.trap) === null || _a === void 0 ? void 0 : _a.activate();
3204
- this.updateAccessibility(this.hostElement);
3205
- }
3206
- /**
3207
- * Shows the modal.
3208
- */
3209
- async show() {
3210
- this.isVisible = true;
3211
- }
3212
- render() {
3213
- return (index.h("div", { "aria-modal": true, role: "dialog", "aria-hidden": !this.isVisible ? 'true' : 'false', class: "modal-wrapper" }, index.h("div", { ref: el => (this.modal = el), class: { modal: true, [`modal-${this.size}`]: Boolean(this.size) } }, index.h("div", { class: "modal-header" }, index.h("cat-button", { ref: el => (this.closeButton = el), icon: "cross-outlined", class: "close-button", size: "s", iconOnly: true, a11yLabel: "close", onCatClick: this.onClick.bind(this) })), index.h("div", { class: "modal-content" }, index.h("slot", null)))));
3214
- }
3215
- onClick() {
3216
- var _a;
3217
- (_a = this.trap) === null || _a === void 0 ? void 0 : _a.deactivate();
3218
- }
3219
- updateAccessibility(element) {
3220
- if (element.parentElement) {
3221
- Array.from(element.parentElement.children).forEach(elementSibling => {
3222
- if (elementSibling !== element) {
3223
- this.isVisible
3224
- ? elementSibling.setAttribute('aria-hidden', 'true')
3225
- : elementSibling.removeAttribute('aria-hidden');
3226
- }
3227
- });
3228
- if (element.parentElement !== document.body) {
3229
- this.updateAccessibility(element.parentElement);
3230
- }
1891
+ if (!trigger) {
1892
+ trigger = firstTabbable.firstTabbable(this.triggerSlot);
1893
+ }
1894
+ if (!trigger) {
1895
+ catNotification.loglevel.error('Cannot find tabbable element. Use [data-trigger] to set the trigger.');
3231
1896
  }
1897
+ console.log(trigger);
1898
+ return trigger;
3232
1899
  }
3233
- get hostElement() { return index.getElement(this); }
3234
1900
  };
3235
- CatModal.style = catModalCss;
1901
+ CatMenu.OFFSET = 4;
1902
+ CatMenu.style = catMenuCss;
3236
1903
 
3237
- const catRadioCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);margin:0 !important}:host-context(.cat-error) .hint-section{color:rgb(var(--cat-danger-text, 217, 52, 13))}:host{display:flex;flex-direction:column;gap:0.5rem;margin-bottom:1rem}:host([hidden]){display:none}label{display:flex;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);cursor:pointer}.label-left{flex-direction:row-reverse}.radio{display:flex;position:relative;align-self:flex-start}.circle{position:absolute;width:0.75rem;height:0.75rem;background-color:rgb(var(--cat-primary-bg, 0, 129, 148));border-radius:10rem;top:calc(50% - 0.375rem);left:calc(50% - 0.375rem);visibility:hidden;pointer-events:none}input{margin:0;width:1.25rem;height:1.25rem;appearance:none;background-color:white;border:1px solid rgb(var(--cat-border-color-focus, 215, 219, 224));border-radius:10rem;cursor:inherit}input:checked{border-color:rgb(var(--cat-primary-bg, 0, 129, 148))}input:checked+.circle{visibility:visible}input:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}:host(.cat-error) input{border-color:rgb(var(--cat-danger-bg, 217, 52, 13))}:host(.cat-error) .circle{background-color:rgb(var(--cat-danger-bg, 217, 52, 13))}.label{flex:1 1 auto}.is-hidden .label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.is-disabled{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135))}.is-disabled input{background-color:#f8f8fb}.is-disabled input:checked{border-color:rgb(var(--cat-border-color-focus, 215, 219, 224))}.is-disabled .circle{background-color:rgb(var(--cat-border-color-focus, 215, 219, 224))}";
1904
+ const catRadioCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);margin:0 !important}:host-context(.cat-error) .hint-section{color:rgb(var(--cat-danger-text, 217, 52, 13))}:host{display:flex;flex-direction:column;gap:0.5rem;margin-bottom:1rem}:host([hidden]){display:none}label{display:flex;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);cursor:pointer}.label-left{flex-direction:row-reverse}.radio{display:flex;position:relative;align-self:flex-start}.circle{position:absolute;width:0.75rem;height:0.75rem;background-color:rgb(var(--cat-primary-bg, 0, 129, 148));border-radius:10rem;top:calc(50% - 0.375rem);left:calc(50% - 0.375rem);visibility:hidden;pointer-events:none}input{margin:0;width:1.25rem;height:1.25rem;appearance:none;background-color:white;border:1px solid rgb(var(--cat-border-color-dark, 215, 219, 224));border-radius:10rem;cursor:inherit}input:checked{border-color:rgb(var(--cat-primary-bg, 0, 129, 148))}input:checked+.circle{visibility:visible}input:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}:host(.cat-error) input{border-color:rgb(var(--cat-danger-bg, 217, 52, 13))}:host(.cat-error) .circle{background-color:rgb(var(--cat-danger-bg, 217, 52, 13))}.label{flex:1 1 auto}.is-hidden .label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.is-disabled{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135))}.is-disabled input{background-color:#f8f8fb}.is-disabled input:checked{border-color:rgb(var(--cat-border-color-dark, 215, 219, 224))}.is-disabled .circle{background-color:rgb(var(--cat-border-color-dark, 215, 219, 224))}";
3238
1905
 
3239
1906
  let nextUniqueId$5 = 0;
3240
1907
  const CatRadio = class {
@@ -5246,7 +3913,7 @@ var autosizeInput = function (element, options) {
5246
3913
  }
5247
3914
  };
5248
3915
 
5249
- const catSelectCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);margin:0 !important}:host-context(.cat-error) .hint-section{color:rgb(var(--cat-danger-text, 217, 52, 13))}:host{display:flex;flex-direction:column;gap:0.5rem;position:relative;margin-bottom:1rem}:host([hidden]){display:none}label{align-self:flex-start}label.hidden{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.input-optional{margin-left:0.25rem;font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 105, 118, 135))}.select-wrapper{display:flex;align-items:flex-start;background:white;border-radius:var(--cat-border-radius-m, 0.25rem);box-shadow:0 0 0 1px rgb(var(--cat-border-color-focus, 215, 219, 224));transition:box-shadow 0.13s linear;padding:0.25rem}.select-wrapper:not(.select-disabled):hover{box-shadow:0 0 0 2px rgb(var(--cat-border-color-focus, 215, 219, 224))}.select-wrapper:not(.select-disabled):focus-within{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255))}:host(.cat-error) .select-wrapper{box-shadow:0 0 0 1px rgb(var(--cat-danger-bg, 217, 52, 13))}:host(.cat-error) .select-wrapper:not(.input-disabled):hover{box-shadow:0 0 0 2px rgb(var(--cat-danger-bg, 217, 52, 13))}.select-disabled{background:#f8f8fb;cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135));pointer-events:none}.select-wrapper-inner{display:flex;flex:1 1 auto;flex-wrap:wrap;align-items:center;gap:0.25rem;min-width:0}.select-wrapper-inner>cat-avatar{padding-left:0.25rem}.select-wrapper-inner cat-avatar{--cat-avatar-size:1.25rem}.select-input{font:inherit;background:none;border:none;outline:none;padding:0.375rem 0.5rem;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.select-disabled .select-input{cursor:inherit}.select-pills{display:contents}.pill{display:inline-flex;align-items:center;gap:0.5rem;padding:0.25rem 0.5rem;background:#f2f4f7;border-radius:var(--cat-border-radius-s, 0.125rem);white-space:nowrap;min-width:0}.pill>span{overflow:hidden;text-overflow:ellipsis;flex:1 1 0%}.pill>cat-button{margin-right:-0.25rem;margin-left:-0.25rem}.select-btn{transition:transform 0.13s linear}.select-btn::part(button){outline:none}cat-spinner{padding:0.375rem}.select-btn-open{transform:rotate(180deg)}.select-dropdown{position:absolute;right:0;background:white;display:none;overflow:auto;box-shadow:0 1px 4px 0 rgba(16, 29, 48, 0.2);border-radius:var(--cat-border-radius-m, 0.25rem);z-index:100}.select-options-wrapper{max-height:16rem;width:100%}.select-empty{margin:1rem 0;padding:0 1.25rem}.select-options{list-style-type:none;margin:0;padding:0.5rem 0}.select-options cat-checkbox,.select-options .select-option-single{margin:0;padding:0.5rem 1rem}.select-option-inner{display:flex;gap:0.5rem;--cat-avatar-size:1.25rem}.select-option-text{flex:1 1 0%}.select-option-single{cursor:pointer}.select-input-transparent-caret{caret-color:transparent}.select-option-empty,.select-option-loading{padding:0.5rem 1rem}.select-option:hover{background-color:rgba(var(--cat-secondary-bg, 105, 118, 135), 0.05)}.select-option-active{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:-2px}.select-option-label{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}.select-option-description{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;color:rgb(var(--cat-font-color-muted, 105, 118, 135))}";
3916
+ const catSelectCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);margin:0 !important}:host-context(.cat-error) .hint-section{color:rgb(var(--cat-danger-text, 217, 52, 13))}:host{display:flex;flex-direction:column;gap:0.5rem;position:relative;margin-bottom:1rem}:host([hidden]){display:none}label{align-self:flex-start}label.hidden{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.input-optional{margin-left:0.25rem;font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 105, 118, 135))}.select-wrapper{display:flex;align-items:flex-start;background:white;border-radius:var(--cat-border-radius-m, 0.25rem);box-shadow:0 0 0 1px rgb(var(--cat-border-color-dark, 215, 219, 224));transition:box-shadow 0.13s linear;padding:0.25rem}.select-wrapper:not(.select-disabled):hover{box-shadow:0 0 0 2px rgb(var(--cat-border-color-dark, 215, 219, 224))}.select-wrapper:not(.select-disabled):focus-within{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255))}:host(.cat-error) .select-wrapper{box-shadow:0 0 0 1px rgb(var(--cat-danger-bg, 217, 52, 13))}:host(.cat-error) .select-wrapper:not(.input-disabled):hover{box-shadow:0 0 0 2px rgb(var(--cat-danger-bg, 217, 52, 13))}.select-disabled{background:#f8f8fb;cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135));pointer-events:none}.select-wrapper-inner{display:flex;flex:1 1 auto;flex-wrap:wrap;align-items:center;gap:0.25rem;min-width:0}.select-wrapper-inner>cat-avatar{padding-left:0.25rem}.select-wrapper-inner cat-avatar{--cat-avatar-size:1.25rem}.select-input{font:inherit;background:none;border:none;outline:none;padding:0.375rem 0.5rem;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.select-disabled .select-input{cursor:inherit}.select-pills{display:contents}.pill{display:inline-flex;align-items:center;gap:0.5rem;padding:0.25rem 0.5rem;background:#f2f4f7;border-radius:var(--cat-border-radius-s, 0.125rem);white-space:nowrap;min-width:0}.pill>span{overflow:hidden;text-overflow:ellipsis;flex:1 1 0%}.pill>cat-button{margin-right:-0.25rem;margin-left:-0.25rem}.select-btn{transition:transform 0.13s linear}.select-btn::part(button){outline:none}cat-spinner{padding:0.375rem}.select-btn-open{transform:rotate(180deg)}.select-dropdown{position:absolute;right:0;background:white;display:none;overflow:auto;box-shadow:0 1px 4px 0 rgba(16, 29, 48, 0.2);border-radius:var(--cat-border-radius-m, 0.25rem);z-index:100}.select-options-wrapper{max-height:16rem;width:100%}.select-empty{margin:1rem 0;padding:0 1.25rem}.select-options{list-style-type:none;margin:0;padding:0.5rem 0}.select-options cat-checkbox,.select-options .select-option-single{margin:0;padding:0.5rem 1rem}.select-option-inner{display:flex;gap:0.5rem;--cat-avatar-size:1.25rem}.select-option-text{flex:1 1 0%;min-width:0}.select-option-single{cursor:pointer}.select-input-transparent-caret{caret-color:transparent}.select-option-empty,.select-option-loading{padding:0.5rem 1rem}.select-option:hover{background-color:rgba(var(--cat-secondary-bg, 105, 118, 135), 0.05)}.select-option-active{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:-2px}.select-option-label{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}.select-option-description{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;color:rgb(var(--cat-font-color-muted, 105, 118, 135))}";
5250
3917
 
5251
3918
  const INIT_STATE = {
5252
3919
  term: '',
@@ -7287,7 +5954,7 @@ const CatTab = class {
7287
5954
  };
7288
5955
  CatTab.style = catTabCss;
7289
5956
 
7290
- const catTabsCss = ":host{display:flex;flex-direction:row;box-shadow:inset 0 -1px 0 0 rgb(var(--cat-border-color-focus, 215, 219, 224))}:host([hidden]){display:none}:host([tabs-align=center]){justify-content:center}:host([tabs-align=right]){justify-content:end}:host([tabs-align=justify]) cat-button{flex:1 0 auto}.tab{padding:0.5rem 0}.tab.tab-active{box-shadow:inset 0 -3px 0 0 rgb(var(--cat-primary-bg, 0, 129, 148))}";
5957
+ const catTabsCss = ":host{display:flex;flex-direction:row;box-shadow:inset 0 -1px 0 0 rgb(var(--cat-border-color-dark, 215, 219, 224))}:host([hidden]){display:none}:host([tabs-align=center]){justify-content:center}:host([tabs-align=right]){justify-content:end}:host([tabs-align=justify]) cat-button{flex:1 0 auto}.tab{padding:0.5rem 0}.tab.tab-active{box-shadow:inset 0 -3px 0 0 rgb(var(--cat-primary-bg, 0, 129, 148))}";
7291
5958
 
7292
5959
  const CatTabs = class {
7293
5960
  constructor(hostRef) {
@@ -7367,7 +6034,7 @@ CatTabs.style = catTabsCss;
7367
6034
 
7368
6035
  var e,t,n="function"==typeof Map?new Map:(e=[],t=[],{has:function(t){return e.indexOf(t)>-1},get:function(n){return t[e.indexOf(n)]},set:function(n,o){-1===e.indexOf(n)&&(e.push(n),t.push(o));},delete:function(n){var o=e.indexOf(n);o>-1&&(e.splice(o,1),t.splice(o,1));}}),o=function(e){return new Event(e,{bubbles:!0})};try{new Event("test");}catch(e){o=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t};}function r(e){var t=n.get(e);t&&t.destroy();}function i(e){var t=n.get(e);t&&t.update();}var l=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((l=function(e){return e}).destroy=function(e){return e},l.update=function(e){return e}):((l=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],function(e){return function(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!n.has(e)){var t,r=null,i=null,l=null,d=function(){e.clientWidth!==i&&c();},a=function(t){window.removeEventListener("resize",d,!1),e.removeEventListener("input",c,!1),e.removeEventListener("keyup",c,!1),e.removeEventListener("autosize:destroy",a,!1),e.removeEventListener("autosize:update",c,!1),Object.keys(t).forEach(function(n){e.style[n]=t[n];}),n.delete(e);}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",a,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",c,!1),window.addEventListener("resize",d,!1),e.addEventListener("input",c,!1),e.addEventListener("autosize:update",c,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",n.set(e,{destroy:a,update:c}),"vertical"===(t=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===t.resize&&(e.style.resize="horizontal"),r="content-box"===t.boxSizing?-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),isNaN(r)&&(r=0),c();}function u(t){var n=e.style.width;e.style.width="0px",e.style.width=n,e.style.overflowY=t;}function s(){if(0!==e.scrollHeight){var t=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(e),n=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+r+"px",i=e.clientWidth,t.forEach(function(e){e.node.scrollTop=e.scrollTop;}),n&&(document.documentElement.scrollTop=n);}}function c(){s();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r<t?"hidden"===n.overflowY&&(u("scroll"),s(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(u("hidden"),s(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),l!==r){l=r;var i=o("autosize:resized");try{e.dispatchEvent(i);}catch(e){}}}}(e)}),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],r),e},l.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],i),e});var d=l;
7369
6036
 
7370
- const catTextareaCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);margin:0 !important}:host-context(.cat-error) .hint-section{color:rgb(var(--cat-danger-text, 217, 52, 13))}:host{display:flex;flex-direction:column;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);margin-bottom:1rem}:host([hidden]){display:none}label{align-self:flex-start}label.hidden{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.input-optional{margin-left:0.25rem;font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 105, 118, 135))}textarea{margin:0;padding:0.625rem 0.75rem;min-height:2.5rem;font:inherit;background:white;border-radius:var(--cat-border-radius-m, 0.25rem);border:none;box-shadow:0 0 0 1px rgb(var(--cat-border-color-focus, 215, 219, 224));transition:box-shadow 0.13s linear}textarea:disabled{background:#f8f8fb;cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135));resize:none}textarea:hover:not(:disabled){box-shadow:0 0 0 2px rgb(var(--cat-border-color-focus, 215, 219, 224))}textarea:focus{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255))}textarea::placeholder{color:rgb(var(--cat-font-color-muted, 105, 118, 135))}";
6037
+ const catTextareaCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);margin:0 !important}:host-context(.cat-error) .hint-section{color:rgb(var(--cat-danger-text, 217, 52, 13))}:host{display:flex;flex-direction:column;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);margin-bottom:1rem}:host([hidden]){display:none}label{align-self:flex-start}label.hidden{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.input-optional{margin-left:0.25rem;font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 105, 118, 135))}textarea{margin:0;padding:0.625rem 0.75rem;min-height:2.5rem;font:inherit;background:white;border-radius:var(--cat-border-radius-m, 0.25rem);border:none;box-shadow:0 0 0 1px rgb(var(--cat-border-color-dark, 215, 219, 224));transition:box-shadow 0.13s linear}textarea:disabled{background:#f8f8fb;cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135));resize:none}textarea:hover:not(:disabled){box-shadow:0 0 0 2px rgb(var(--cat-border-color-dark, 215, 219, 224))}textarea:focus{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255))}textarea::placeholder{color:rgb(var(--cat-font-color-muted, 105, 118, 135))}";
7371
6038
 
7372
6039
  let nextUniqueId$2 = 0;
7373
6040
  const CatTextarea = class {
@@ -7500,7 +6167,7 @@ const CatToastDemo = class {
7500
6167
  };
7501
6168
  CatToastDemo.style = catToastDemoCss;
7502
6169
 
7503
- const catToggleCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);margin:0 !important}:host-context(.cat-error) .hint-section{color:rgb(var(--cat-danger-text, 217, 52, 13))}:host{display:flex;flex-direction:column;gap:0.5rem;margin-bottom:1rem}:host([hidden]){display:none}label{flex:0 1 auto;display:flex;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);-webkit-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}.label-left{flex-direction:row-reverse}input{position:absolute;margin:0;width:2rem;height:1.25rem;opacity:0;cursor:inherit}.toggle{flex:0 0 auto;display:flex;align-items:center;justify-content:center;position:relative;width:2rem;height:1.25rem;border-radius:10rem;background-color:rgb(var(--cat-border-color-focus, 215, 219, 224));transition:background-color 0.13s ease;pointer-events:none}:checked+.toggle{background-color:rgb(var(--cat-primary-bg, 0, 129, 148))}:focus-visible+.toggle{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.toggle::after{content:\"\";position:absolute;width:1rem;height:1rem;background:#fff;border-radius:10rem;transform:translateX(calc(2px - 0.5rem));transition:transform 0.13s linear;box-shadow:0 1px 4px 0 rgba(16, 29, 48, 0.2)}:checked+.toggle::after{transform:translateX(calc(-2px + 0.5rem));background:rgb(var(--cat-primary-fill, 255, 255, 255))}:host(.cat-error) .toggle{background-color:rgba(var(--cat-danger-bg, 217, 52, 13), 0.2)}:host(.cat-error) :checked+.toggle{background-color:rgb(var(--cat-danger-bg, 217, 52, 13))}:host(.cat-error) :checked+.toggle::after{background:rgb(var(--cat-danger-fill, 255, 255, 255))}.label{flex:1 1 auto}.is-hidden .label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.is-disabled{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135))}";
6170
+ const catToggleCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);margin:0 !important}:host-context(.cat-error) .hint-section{color:rgb(var(--cat-danger-text, 217, 52, 13))}:host{display:flex;flex-direction:column;gap:0.5rem;margin-bottom:1rem}:host([hidden]){display:none}label{flex:0 1 auto;display:flex;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);-webkit-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}.label-left{flex-direction:row-reverse}input{position:absolute;margin:0;width:2rem;height:1.25rem;opacity:0;cursor:inherit}.toggle{flex:0 0 auto;display:flex;align-items:center;justify-content:center;position:relative;width:2rem;height:1.25rem;border-radius:10rem;background-color:rgb(var(--cat-border-color-dark, 215, 219, 224));transition:background-color 0.13s ease;pointer-events:none}:checked+.toggle{background-color:rgb(var(--cat-primary-bg, 0, 129, 148))}:focus-visible+.toggle{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.toggle::after{content:\"\";position:absolute;width:1rem;height:1rem;background:#fff;border-radius:10rem;transform:translateX(calc(2px - 0.5rem));transition:transform 0.13s linear;box-shadow:0 1px 4px 0 rgba(16, 29, 48, 0.2)}:checked+.toggle::after{transform:translateX(calc(-2px + 0.5rem));background:rgb(var(--cat-primary-fill, 255, 255, 255))}.is-disabled .toggle{background-color:rgb(var(--cat-border-color-dark, 215, 219, 224))}:host(.cat-error) .toggle{background-color:rgba(var(--cat-danger-bg, 217, 52, 13), 0.2)}:host(.cat-error) :checked+.toggle{background-color:rgb(var(--cat-danger-bg, 217, 52, 13))}:host(.cat-error) :checked+.toggle::after{background:rgb(var(--cat-danger-fill, 255, 255, 255))}.label{flex:1 1 auto}.is-hidden .label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.is-disabled{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135))}";
7504
6171
 
7505
6172
  let nextUniqueId$1 = 0;
7506
6173
  const CatToggle = class {
@@ -7623,7 +6290,7 @@ const CatTooltip = class {
7623
6290
  }
7624
6291
  componentDidLoad() {
7625
6292
  var _a, _b, _c, _d, _e, _f, _g;
7626
- this.trigger = firstTabbable(this.triggerElement) || this.triggerElement;
6293
+ this.trigger = firstTabbable.firstTabbable(this.triggerElement) || this.triggerElement;
7627
6294
  if (!this.isTabbable) {
7628
6295
  (_a = this.trigger) === null || _a === void 0 ? void 0 : _a.setAttribute('tabindex', '0');
7629
6296
  }
@@ -7664,7 +6331,7 @@ const CatTooltip = class {
7664
6331
  } }, this.content))));
7665
6332
  }
7666
6333
  get isTabbable() {
7667
- return firstTabbable(this.trigger);
6334
+ return firstTabbable.firstTabbable(this.trigger);
7668
6335
  }
7669
6336
  update() {
7670
6337
  if (this.trigger && this.tooltip) {
@@ -7724,7 +6391,6 @@ exports.cat_checkbox = CatCheckbox;
7724
6391
  exports.cat_icon = CatIcon;
7725
6392
  exports.cat_input = CatInput;
7726
6393
  exports.cat_menu = CatMenu;
7727
- exports.cat_modal = CatModal;
7728
6394
  exports.cat_radio = CatRadio;
7729
6395
  exports.cat_radio_group = CatRadioGroup;
7730
6396
  exports.cat_scrollable = CatScrollable;
@@ -7739,4 +6405,4 @@ exports.cat_toast_demo = CatToastDemo;
7739
6405
  exports.cat_toggle = CatToggle;
7740
6406
  exports.cat_tooltip = CatTooltip;
7741
6407
 
7742
- //# sourceMappingURL=cat-alert_23.cjs.entry.js.map
6408
+ //# sourceMappingURL=cat-alert_22.cjs.entry.js.map