@haiilo/catalyst 6.3.1 → 6.3.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 (83) hide show
  1. package/dist/catalyst/catalyst.esm.js +1 -1
  2. package/dist/catalyst/catalyst.esm.js.map +1 -1
  3. package/dist/catalyst/p-2ecedf97.entry.js +10 -0
  4. package/dist/catalyst/p-2ecedf97.entry.js.map +1 -0
  5. package/dist/catalyst/scss/_snippets/_form-label.scss +12 -4
  6. package/dist/catalyst/scss/fonts/_fonts.mixins.lato.scss +36 -18
  7. package/dist/catalyst/scss/utils/_color.scss +3 -1
  8. package/dist/catalyst/scss/utils/_typography.mixins.scss +10 -2
  9. package/dist/catalyst/scss/vendor/_flatpickr.scss +5 -2
  10. package/dist/cjs/cat-alert_26.cjs.entry.js +540 -267
  11. package/dist/cjs/cat-alert_26.cjs.entry.js.map +1 -1
  12. package/dist/cjs/catalyst.cjs.js +1 -1
  13. package/dist/cjs/loader.cjs.js +1 -1
  14. package/dist/collection/components/cat-button/cat-button.css +0 -1
  15. package/dist/collection/components/cat-datepicker/cat-datepicker.config.js +6 -0
  16. package/dist/collection/components/cat-datepicker/cat-datepicker.config.js.map +1 -1
  17. package/dist/collection/components/cat-datepicker/cat-datepicker.js +21 -0
  18. package/dist/collection/components/cat-datepicker/cat-datepicker.js.map +1 -1
  19. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.js +17 -0
  20. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.js.map +1 -1
  21. package/dist/collection/components/cat-dropdown/cat-dropdown.js +23 -18
  22. package/dist/collection/components/cat-dropdown/cat-dropdown.js.map +1 -1
  23. package/dist/collection/components/cat-input/cat-input.css +24 -8
  24. package/dist/collection/components/cat-input/cat-input.js +2 -2
  25. package/dist/collection/components/cat-input/cat-input.js.map +1 -1
  26. package/dist/collection/components/cat-select/cat-select.css +24 -8
  27. package/dist/collection/components/cat-select/cat-select.js +25 -17
  28. package/dist/collection/components/cat-select/cat-select.js.map +1 -1
  29. package/dist/collection/components/cat-select/cat-select.spec.js +1 -1
  30. package/dist/collection/components/cat-select/cat-select.spec.js.map +1 -1
  31. package/dist/collection/components/cat-select-demo/cat-select-demo.js +1 -1
  32. package/dist/collection/components/cat-select-demo/cat-select-demo.js.map +1 -1
  33. package/dist/collection/components/cat-tabs/cat-tabs.css +7 -1
  34. package/dist/collection/components/cat-tabs/cat-tabs.js +1 -1
  35. package/dist/collection/components/cat-tabs/cat-tabs.js.map +1 -1
  36. package/dist/collection/components/cat-textarea/cat-textarea.css +24 -8
  37. package/dist/collection/components/cat-textarea/cat-textarea.js +1 -1
  38. package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -1
  39. package/dist/collection/components/cat-tooltip/cat-tooltip.js +1 -1
  40. package/dist/collection/scss/_snippets/_form-label.scss +12 -4
  41. package/dist/collection/scss/fonts/_fonts.mixins.lato.scss +36 -18
  42. package/dist/collection/scss/utils/_color.scss +3 -1
  43. package/dist/collection/scss/utils/_typography.mixins.scss +10 -2
  44. package/dist/collection/scss/vendor/_flatpickr.scss +5 -2
  45. package/dist/collection/utils/find-closest.js +13 -0
  46. package/dist/collection/utils/find-closest.js.map +1 -0
  47. package/dist/components/cat-button2.js +1 -1
  48. package/dist/components/cat-button2.js.map +1 -1
  49. package/dist/components/cat-checkbox2.js.map +1 -1
  50. package/dist/components/cat-datepicker-inline.js +4 -1
  51. package/dist/components/cat-datepicker-inline.js.map +1 -1
  52. package/dist/components/cat-datepicker.js +19 -0
  53. package/dist/components/cat-datepicker.js.map +1 -1
  54. package/dist/components/cat-datepicker.locale.js +6 -0
  55. package/dist/components/cat-datepicker.locale.js.map +1 -1
  56. package/dist/components/cat-dropdown2.js +265 -112
  57. package/dist/components/cat-dropdown2.js.map +1 -1
  58. package/dist/components/cat-input2.js +3 -3
  59. package/dist/components/cat-input2.js.map +1 -1
  60. package/dist/components/cat-select-demo.js +1 -1
  61. package/dist/components/cat-select-demo.js.map +1 -1
  62. package/dist/components/cat-select2.js +25 -17
  63. package/dist/components/cat-select2.js.map +1 -1
  64. package/dist/components/cat-tabs.js +2 -2
  65. package/dist/components/cat-tabs.js.map +1 -1
  66. package/dist/components/cat-textarea.js +2 -2
  67. package/dist/components/cat-textarea.js.map +1 -1
  68. package/dist/components/cat-tooltip.js.map +1 -1
  69. package/dist/components/floating-ui.dom.esm.js +215 -129
  70. package/dist/components/floating-ui.dom.esm.js.map +1 -1
  71. package/dist/esm/cat-alert_26.entry.js +540 -267
  72. package/dist/esm/cat-alert_26.entry.js.map +1 -1
  73. package/dist/esm/catalyst.js +1 -1
  74. package/dist/esm/loader.js +1 -1
  75. package/dist/types/components/cat-datepicker/cat-datepicker.config.d.ts +3 -0
  76. package/dist/types/components/cat-datepicker/cat-datepicker.d.ts +6 -0
  77. package/dist/types/components/cat-datepicker-inline/cat-datepicker-inline.d.ts +6 -0
  78. package/dist/types/components/cat-dropdown/cat-dropdown.d.ts +1 -0
  79. package/dist/types/components.d.ts +16 -0
  80. package/dist/types/utils/find-closest.d.ts +5 -0
  81. package/package.json +11 -11
  82. package/dist/catalyst/p-dfc7c716.entry.js +0 -10
  83. package/dist/catalyst/p-dfc7c716.entry.js.map +0 -1
@@ -1035,7 +1035,7 @@ function createEmptyStyleRule(query) {
1035
1035
  }
1036
1036
  }
1037
1037
 
1038
- 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 125ms linear, border-color 125ms linear, background-color 125ms linear, box-shadow 125ms linear}.cat-button:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.cat-button-content{display:flex;flex-direction:column;min-width:0}.cat-button-content-inner{word-wrap:break-word;word-break:break-word}.cat-button-ellipsed .cat-button-content-inner{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.cat-button-disabled{cursor:not-allowed}.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-group-button-first{border-top-right-radius:0;border-bottom-right-radius:0}.cat-group-button-middle{border-radius:0}.cat-group-button-last{border-top-left-radius:0;border-bottom-left-radius:0}.cat-group-button:hover{z-index:1}.cat-group-button:focus-visible{z-index:2}.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:242, 244, 247;--fill:var(--cat-font-color-muted, 81, 92, 108)}.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, 81, 92, 108);--text:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-outlined:hover:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.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:var(--cat-link-button-decoration, none)}.cat-button-text.cat-button-disabled{--text:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-text:hover:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:var(--cat-link-button-decoration-hover, none);background-color:rgba(var(--base), 0.1)}.cat-button-text.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:var(--cat-link-button-decoration-hover, 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, 99, 113);--fill:var(--cat-primary-fill-active, 255, 255, 255);--text:var(--cat-primary-text-active, 2, 99, 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-secondary-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-danger-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.1875rem 0.25rem;font-size:0.875rem;line-height:1.125rem;gap:0.25rem}.cat-button-xs.cat-button-icon{width:1.5rem;padding-left:0;padding-right:0}:host(.cat-button-pull[size=xs]){margin:-0.1875rem -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.1875rem;margin-bottom:-0.1875rem}:host(.cat-button-pull-t[size=xs]){margin-top:-0.1875rem}:host(.cat-button-pull-l[size=xs]){margin-left:-0.25rem}:host(.cat-button-pull-b[size=xs]){margin-bottom:-0.1875rem}: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;gap: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(.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;gap: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(.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;gap: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(.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;gap:0.25rem}.cat-button-xl.cat-button-icon{width:3.5rem;padding-left:0;padding-right:0}: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(.cat-tab)::part(button){padding:1.125rem 0.75rem;--cat-primary-text:transparent;--cat-secondary-bg:transparent}:host(.cat-tab)::part(content)::before{content:attr(data-text);content:attr(data-text)/\"\";height:0;visibility:hidden;overflow:hidden;-webkit-user-select:none;user-select:none;pointer-events:none;font-weight:700}:host(.cat-text-left) .cat-button{justify-content:left}:host(.cat-text-right) .cat-button{justify-content:right}:host(.cat-nav-item){width:100%}:host(.cat-nav-item) .cat-button{box-shadow:none;justify-content:left;gap:0.5rem}:host(.cat-nav-item) .cat-button:focus-visible{outline-offset:-2px}";
1038
+ 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 125ms linear, border-color 125ms linear, background-color 125ms linear, box-shadow 125ms linear}.cat-button:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.cat-button-content{display:flex;flex-direction:column;min-width:0}.cat-button-content-inner{word-wrap:break-word;word-break:break-word}.cat-button-ellipsed .cat-button-content-inner{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.cat-button-disabled{cursor:not-allowed}.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-group-button-first{border-top-right-radius:0;border-bottom-right-radius:0}.cat-group-button-middle{border-radius:0}.cat-group-button-last{border-top-left-radius:0;border-bottom-left-radius:0}.cat-group-button:hover{z-index:1}.cat-group-button:focus-visible{z-index:2}.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:242, 244, 247;--fill:var(--cat-font-color-muted, 81, 92, 108)}.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, 81, 92, 108);--text:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-outlined:hover:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.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:var(--cat-link-button-decoration, none)}.cat-button-text.cat-button-disabled{--text:var(--cat-font-color-muted, 81, 92, 108)}.cat-button-text:hover:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:var(--cat-link-button-decoration-hover, none);background-color:rgba(var(--base), 0.1)}.cat-button-text.cat-button-active:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:var(--cat-link-button-decoration-hover, 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, 99, 113);--fill:var(--cat-primary-fill-active, 255, 255, 255);--text:var(--cat-primary-text-active, 2, 99, 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-secondary-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-danger-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.1875rem 0.25rem;font-size:0.875rem;line-height:1.125rem;gap:0.25rem}.cat-button-xs.cat-button-icon{width:1.5rem;padding-left:0;padding-right:0}:host(.cat-button-pull[size=xs]){margin:-0.1875rem -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.1875rem;margin-bottom:-0.1875rem}:host(.cat-button-pull-t[size=xs]){margin-top:-0.1875rem}:host(.cat-button-pull-l[size=xs]){margin-left:-0.25rem}:host(.cat-button-pull-b[size=xs]){margin-bottom:-0.1875rem}: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;gap: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(.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;gap: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(.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;gap: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(.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;gap:0.25rem}.cat-button-xl.cat-button-icon{width:3.5rem;padding-left:0;padding-right:0}: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(.cat-tab)::part(button){padding:1.125rem 0.75rem;--cat-primary-text:transparent;--cat-secondary-bg:transparent}:host(.cat-tab)::part(content)::before{content:attr(data-text);content:attr(data-text)/\"\";height:0;visibility:hidden;overflow:hidden;user-select:none;pointer-events:none;font-weight:700}:host(.cat-text-left) .cat-button{justify-content:left}:host(.cat-text-right) .cat-button{justify-content:right}:host(.cat-nav-item){width:100%}:host(.cat-nav-item) .cat-button{box-shadow:none;justify-content:left;gap:0.5rem}:host(.cat-nav-item) .cat-button:focus-visible{outline-offset:-2px}";
1039
1039
 
1040
1040
  const CatButton = class {
1041
1041
  constructor(hostRef) {
@@ -3880,6 +3880,19 @@ if (typeof window !== "undefined") {
3880
3880
  window.flatpickr = flatpickr;
3881
3881
  }
3882
3882
 
3883
+ /**
3884
+ * Find the closest parent element matching the given selector while traversing
3885
+ * up the DOM tree (including Shadow DOM).
3886
+ */
3887
+ function findClosest(selector, element) {
3888
+ if (element instanceof Element && element.matches(selector)) {
3889
+ return element;
3890
+ }
3891
+ // Search in parent element or Shadow DOM host
3892
+ const nextElement = element instanceof ShadowRoot ? element.host : element.parentElement || element.getRootNode().host;
3893
+ return nextElement ? findClosest(selector, nextElement) : null;
3894
+ }
3895
+
3883
3896
  var weekSelect = createCommonjsModule(function (module, exports) {
3884
3897
  (function (global, factory) {
3885
3898
  module.exports = factory() ;
@@ -4000,6 +4013,12 @@ function getConfig(options, more = {}) {
4000
4013
  weekNumbers: true,
4001
4014
  minuteIncrement: options.step,
4002
4015
  clickOpens: !options.disabled && !options.readonly,
4016
+ onReady: (_dates, _dateStr, flatpickr) => {
4017
+ for (const key in options.nativePickerAttributes) {
4018
+ const value = options.nativePickerAttributes[key];
4019
+ flatpickr.calendarContainer.setAttribute(key, value);
4020
+ }
4021
+ },
4003
4022
  onChange: (dates, dateStr, flatpickr) => {
4004
4023
  let value = dateStr || undefined;
4005
4024
  if (options.mode === 'week') {
@@ -4126,6 +4145,7 @@ const CatDatepickerFlat = class {
4126
4145
  this.errors = undefined;
4127
4146
  this.errorUpdate = 0;
4128
4147
  this.nativeAttributes = undefined;
4148
+ this.nativePickerAttributes = undefined;
4129
4149
  }
4130
4150
  get input() {
4131
4151
  return this._input?.shadowRoot?.querySelector('input') ?? undefined;
@@ -4184,6 +4204,9 @@ const CatDatepickerFlat = class {
4184
4204
  if (this.disabled || this.readonly || !input) {
4185
4205
  return;
4186
4206
  }
4207
+ // avoid dropdown closing if datepicker is part of a dropdown
4208
+ const withinDropdown = !!findClosest('cat-dropdown', input);
4209
+ const nativePickerAttributes = withinDropdown ? { 'data-dropdown-no-close': '' } : {};
4187
4210
  return flatpickr(input, getConfig({
4188
4211
  locale: getLocale(catI18nRegistry.getLocale()),
4189
4212
  format: getFormat(catI18nRegistry.getLocale(), this.mode),
@@ -4193,6 +4216,7 @@ const CatDatepickerFlat = class {
4193
4216
  step: this.step,
4194
4217
  disabled: this.disabled,
4195
4218
  readonly: this.readonly,
4219
+ nativePickerAttributes: { ...nativePickerAttributes, ...this.nativePickerAttributes },
4196
4220
  applyChange: value => (this.value = value)
4197
4221
  }));
4198
4222
  }
@@ -4217,6 +4241,7 @@ const CatDatepickerInline = class {
4217
4241
  this.readonly = false;
4218
4242
  this.step = 5;
4219
4243
  this.value = undefined;
4244
+ this.nativePickerAttributes = undefined;
4220
4245
  }
4221
4246
  onValueChanged(value) {
4222
4247
  if (value) {
@@ -4259,6 +4284,7 @@ const CatDatepickerInline = class {
4259
4284
  step: this.step,
4260
4285
  disabled: this.disabled,
4261
4286
  readonly: this.readonly,
4287
+ nativePickerAttributes: this.nativePickerAttributes ?? {},
4262
4288
  applyChange: value => (this.value = value)
4263
4289
  }, {
4264
4290
  ...(this.disabled ? { enable: [] } : {}),
@@ -4951,7 +4977,7 @@ const size = function (options) {
4951
4977
 
4952
4978
  function getWindow(node) {
4953
4979
  var _node$ownerDocument;
4954
- return ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
4980
+ return (node == null ? void 0 : (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
4955
4981
  }
4956
4982
 
4957
4983
  function getComputedStyle$1(element) {
@@ -4962,22 +4988,24 @@ function isNode(value) {
4962
4988
  return value instanceof getWindow(value).Node;
4963
4989
  }
4964
4990
  function getNodeName(node) {
4965
- return isNode(node) ? (node.nodeName || '').toLowerCase() : '';
4991
+ if (isNode(node)) {
4992
+ return (node.nodeName || '').toLowerCase();
4993
+ }
4994
+ // Mocked nodes in testing environments may not be instances of Node. By
4995
+ // returning `#document` an infinite loop won't occur.
4996
+ // https://github.com/floating-ui/floating-ui/issues/2317
4997
+ return '#document';
4966
4998
  }
4967
4999
 
4968
5000
  function isHTMLElement(value) {
4969
- return value instanceof getWindow(value).HTMLElement;
4970
- }
4971
- function isElement(value) {
4972
- return value instanceof getWindow(value).Element;
5001
+ return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
4973
5002
  }
4974
5003
  function isShadowRoot(node) {
4975
5004
  // Browsers without `ShadowRoot` support.
4976
5005
  if (typeof ShadowRoot === 'undefined') {
4977
5006
  return false;
4978
5007
  }
4979
- const OwnElement = getWindow(node).ShadowRoot;
4980
- return node instanceof OwnElement || node instanceof ShadowRoot;
5008
+ return node instanceof getWindow(node).ShadowRoot || node instanceof ShadowRoot;
4981
5009
  }
4982
5010
  function isOverflowElement(element) {
4983
5011
  const {
@@ -4996,7 +5024,7 @@ function isContainingBlock(element) {
4996
5024
  const css = getComputedStyle$1(element);
4997
5025
 
4998
5026
  // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
4999
- return css.transform !== 'none' || css.perspective !== 'none' || !safari && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !safari && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
5027
+ return css.transform !== 'none' || css.perspective !== 'none' || (css.containerType ? css.containerType !== 'normal' : false) || !safari && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !safari && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
5000
5028
  }
5001
5029
  function isSafari() {
5002
5030
  if (typeof CSS === 'undefined' || !CSS.supports) return false;
@@ -5009,6 +5037,11 @@ function isLastTraversableNode(node) {
5009
5037
  const min = Math.min;
5010
5038
  const max = Math.max;
5011
5039
  const round = Math.round;
5040
+ const floor = Math.floor;
5041
+ const createCoords = v => ({
5042
+ x: v,
5043
+ y: v
5044
+ });
5012
5045
 
5013
5046
  function getCssDimensions(element) {
5014
5047
  const css = getComputedStyle$1(element);
@@ -5027,31 +5060,31 @@ function getCssDimensions(element) {
5027
5060
  return {
5028
5061
  width,
5029
5062
  height,
5030
- fallback: shouldFallback
5063
+ $: shouldFallback
5031
5064
  };
5032
5065
  }
5033
5066
 
5067
+ function isElement(value) {
5068
+ return value instanceof Element || value instanceof getWindow(value).Element;
5069
+ }
5070
+
5034
5071
  function unwrapElement(element) {
5035
5072
  return !isElement(element) ? element.contextElement : element;
5036
5073
  }
5037
5074
 
5038
- const FALLBACK_SCALE = {
5039
- x: 1,
5040
- y: 1
5041
- };
5042
5075
  function getScale(element) {
5043
5076
  const domElement = unwrapElement(element);
5044
5077
  if (!isHTMLElement(domElement)) {
5045
- return FALLBACK_SCALE;
5078
+ return createCoords(1);
5046
5079
  }
5047
5080
  const rect = domElement.getBoundingClientRect();
5048
5081
  const {
5049
5082
  width,
5050
5083
  height,
5051
- fallback
5084
+ $
5052
5085
  } = getCssDimensions(domElement);
5053
- let x = (fallback ? round(rect.width) : rect.width) / width;
5054
- let y = (fallback ? round(rect.height) : rect.height) / height;
5086
+ let x = ($ ? round(rect.width) : rect.width) / width;
5087
+ let y = ($ ? round(rect.height) : rect.height) / height;
5055
5088
 
5056
5089
  // 0, NaN, or Infinity should always fallback to 1.
5057
5090
 
@@ -5067,27 +5100,26 @@ function getScale(element) {
5067
5100
  };
5068
5101
  }
5069
5102
 
5070
- const noOffsets = {
5071
- x: 0,
5072
- y: 0
5073
- };
5074
- function getVisualOffsets(element, isFixed, floatingOffsetParent) {
5075
- var _win$visualViewport, _win$visualViewport2;
5076
- if (isFixed === void 0) {
5077
- isFixed = true;
5078
- }
5079
- if (!isSafari()) {
5080
- return noOffsets;
5081
- }
5082
- const win = element ? getWindow(element) : window;
5083
- if (!floatingOffsetParent || isFixed && floatingOffsetParent !== win) {
5103
+ const noOffsets = /*#__PURE__*/createCoords(0);
5104
+ function getVisualOffsets(element) {
5105
+ const win = getWindow(element);
5106
+ if (!isSafari() || !win.visualViewport) {
5084
5107
  return noOffsets;
5085
5108
  }
5086
5109
  return {
5087
- x: ((_win$visualViewport = win.visualViewport) == null ? void 0 : _win$visualViewport.offsetLeft) || 0,
5088
- y: ((_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) || 0
5110
+ x: win.visualViewport.offsetLeft,
5111
+ y: win.visualViewport.offsetTop
5089
5112
  };
5090
5113
  }
5114
+ function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
5115
+ if (isFixed === void 0) {
5116
+ isFixed = false;
5117
+ }
5118
+ if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
5119
+ return false;
5120
+ }
5121
+ return isFixed;
5122
+ }
5091
5123
 
5092
5124
  function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
5093
5125
  if (includeScale === void 0) {
@@ -5098,7 +5130,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
5098
5130
  }
5099
5131
  const clientRect = element.getBoundingClientRect();
5100
5132
  const domElement = unwrapElement(element);
5101
- let scale = FALLBACK_SCALE;
5133
+ let scale = createCoords(1);
5102
5134
  if (includeScale) {
5103
5135
  if (offsetParent) {
5104
5136
  if (isElement(offsetParent)) {
@@ -5108,7 +5140,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
5108
5140
  scale = getScale(element);
5109
5141
  }
5110
5142
  }
5111
- const visualOffsets = getVisualOffsets(domElement, isFixedStrategy, offsetParent);
5143
+ const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
5112
5144
  let x = (clientRect.left + visualOffsets.x) / scale.x;
5113
5145
  let y = (clientRect.top + visualOffsets.y) / scale.y;
5114
5146
  let width = clientRect.width / scale.x;
@@ -5121,14 +5153,14 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
5121
5153
  const iframeScale = getScale(currentIFrame);
5122
5154
  const iframeRect = currentIFrame.getBoundingClientRect();
5123
5155
  const css = getComputedStyle(currentIFrame);
5124
- iframeRect.x += (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
5125
- iframeRect.y += (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
5156
+ const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
5157
+ const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
5126
5158
  x *= iframeScale.x;
5127
5159
  y *= iframeScale.y;
5128
5160
  width *= iframeScale.x;
5129
5161
  height *= iframeScale.y;
5130
- x += iframeRect.x;
5131
- y += iframeRect.y;
5162
+ x += left;
5163
+ y += top;
5132
5164
  currentIFrame = getWindow(currentIFrame).frameElement;
5133
5165
  }
5134
5166
  }
@@ -5140,10 +5172,6 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
5140
5172
  });
5141
5173
  }
5142
5174
 
5143
- function getDocumentElement(node) {
5144
- return ((isNode(node) ? node.ownerDocument : node.document) || window.document).documentElement;
5145
- }
5146
-
5147
5175
  function getNodeScroll(element) {
5148
5176
  if (isElement(element)) {
5149
5177
  return {
@@ -5157,6 +5185,11 @@ function getNodeScroll(element) {
5157
5185
  };
5158
5186
  }
5159
5187
 
5188
+ function getDocumentElement(node) {
5189
+ var _ref;
5190
+ return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
5191
+ }
5192
+
5160
5193
  function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
5161
5194
  let {
5162
5195
  rect,
@@ -5172,14 +5205,8 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
5172
5205
  scrollLeft: 0,
5173
5206
  scrollTop: 0
5174
5207
  };
5175
- let scale = {
5176
- x: 1,
5177
- y: 1
5178
- };
5179
- const offsets = {
5180
- x: 0,
5181
- y: 0
5182
- };
5208
+ let scale = createCoords(1);
5209
+ const offsets = createCoords(0);
5183
5210
  if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
5184
5211
  if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
5185
5212
  scroll = getNodeScroll(offsetParent);
@@ -5199,6 +5226,10 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
5199
5226
  };
5200
5227
  }
5201
5228
 
5229
+ function getClientRects(element) {
5230
+ return Array.from(element.getClientRects());
5231
+ }
5232
+
5202
5233
  function getWindowScrollBarX(element) {
5203
5234
  // If <html> has a CSS width greater than the viewport, then this will be
5204
5235
  // incorrect for RTL.
@@ -5245,9 +5276,7 @@ function getParentNode(node) {
5245
5276
  function getNearestOverflowAncestor(node) {
5246
5277
  const parentNode = getParentNode(node);
5247
5278
  if (isLastTraversableNode(parentNode)) {
5248
- // `getParentNode` will never return a `Document` due to the fallback
5249
- // check, so it's either the <html> or <body> element.
5250
- return parentNode.ownerDocument.body;
5279
+ return node.ownerDocument ? node.ownerDocument.body : node.body;
5251
5280
  }
5252
5281
  if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
5253
5282
  return parentNode;
@@ -5299,10 +5328,7 @@ function getInnerBoundingClientRect(element, strategy) {
5299
5328
  const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
5300
5329
  const top = clientRect.top + element.clientTop;
5301
5330
  const left = clientRect.left + element.clientLeft;
5302
- const scale = isHTMLElement(element) ? getScale(element) : {
5303
- x: 1,
5304
- y: 1
5305
- };
5331
+ const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
5306
5332
  const width = element.clientWidth * scale.x;
5307
5333
  const height = element.clientHeight * scale.y;
5308
5334
  const x = left * scale.x;
@@ -5406,6 +5432,36 @@ function getDimensions(element) {
5406
5432
  return getCssDimensions(element);
5407
5433
  }
5408
5434
 
5435
+ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
5436
+ const isOffsetParentAnElement = isHTMLElement(offsetParent);
5437
+ const documentElement = getDocumentElement(offsetParent);
5438
+ const isFixed = strategy === 'fixed';
5439
+ const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
5440
+ let scroll = {
5441
+ scrollLeft: 0,
5442
+ scrollTop: 0
5443
+ };
5444
+ const offsets = createCoords(0);
5445
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
5446
+ if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
5447
+ scroll = getNodeScroll(offsetParent);
5448
+ }
5449
+ if (isHTMLElement(offsetParent)) {
5450
+ const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
5451
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
5452
+ offsets.y = offsetRect.y + offsetParent.clientTop;
5453
+ } else if (documentElement) {
5454
+ offsets.x = getWindowScrollBarX(documentElement);
5455
+ }
5456
+ }
5457
+ return {
5458
+ x: rect.left + scroll.scrollLeft - offsets.x,
5459
+ y: rect.top + scroll.scrollTop - offsets.y,
5460
+ width: rect.width,
5461
+ height: rect.height
5462
+ };
5463
+ }
5464
+
5409
5465
  function getTrueOffsetParent(element, polyfill) {
5410
5466
  if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
5411
5467
  return null;
@@ -5444,68 +5500,115 @@ function getOffsetParent(element, polyfill) {
5444
5500
  return offsetParent || getContainingBlock(element) || window;
5445
5501
  }
5446
5502
 
5447
- function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
5448
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
5449
- const documentElement = getDocumentElement(offsetParent);
5450
- const isFixed = strategy === 'fixed';
5451
- const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
5452
- let scroll = {
5453
- scrollLeft: 0,
5454
- scrollTop: 0
5455
- };
5456
- const offsets = {
5457
- x: 0,
5458
- y: 0
5459
- };
5460
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
5461
- if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
5462
- scroll = getNodeScroll(offsetParent);
5463
- }
5464
- if (isHTMLElement(offsetParent)) {
5465
- const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
5466
- offsets.x = offsetRect.x + offsetParent.clientLeft;
5467
- offsets.y = offsetRect.y + offsetParent.clientTop;
5468
- } else if (documentElement) {
5469
- offsets.x = getWindowScrollBarX(documentElement);
5470
- }
5471
- }
5503
+ const getElementRects = async function (_ref) {
5504
+ let {
5505
+ reference,
5506
+ floating,
5507
+ strategy
5508
+ } = _ref;
5509
+ const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
5510
+ const getDimensionsFn = this.getDimensions;
5472
5511
  return {
5473
- x: rect.left + scroll.scrollLeft - offsets.x,
5474
- y: rect.top + scroll.scrollTop - offsets.y,
5475
- width: rect.width,
5476
- height: rect.height
5512
+ reference: getRectRelativeToOffsetParent(reference, await getOffsetParentFn(floating), strategy),
5513
+ floating: {
5514
+ x: 0,
5515
+ y: 0,
5516
+ ...(await getDimensionsFn(floating))
5517
+ }
5477
5518
  };
5519
+ };
5520
+
5521
+ function isRTL(element) {
5522
+ return getComputedStyle(element).direction === 'rtl';
5478
5523
  }
5479
5524
 
5480
5525
  const platform = {
5481
- getClippingRect,
5482
5526
  convertOffsetParentRelativeRectToViewportRelativeRect,
5483
- isElement,
5484
- getDimensions,
5485
- getOffsetParent,
5486
5527
  getDocumentElement,
5528
+ getClippingRect,
5529
+ getOffsetParent,
5530
+ getElementRects,
5531
+ getClientRects,
5532
+ getDimensions,
5487
5533
  getScale,
5488
- async getElementRects(_ref) {
5489
- let {
5490
- reference,
5491
- floating,
5492
- strategy
5493
- } = _ref;
5494
- const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
5495
- const getDimensionsFn = this.getDimensions;
5496
- return {
5497
- reference: getRectRelativeToOffsetParent(reference, await getOffsetParentFn(floating), strategy),
5498
- floating: {
5499
- x: 0,
5500
- y: 0,
5501
- ...(await getDimensionsFn(floating))
5502
- }
5503
- };
5504
- },
5505
- getClientRects: element => Array.from(element.getClientRects()),
5506
- isRTL: element => getComputedStyle$1(element).direction === 'rtl'
5534
+ isElement,
5535
+ isRTL
5507
5536
  };
5508
5537
 
5538
+ // https://samthor.au/2021/observing-dom/
5539
+ function observeMove(element, onMove) {
5540
+ let io = null;
5541
+ let timeoutId;
5542
+ const root = getDocumentElement(element);
5543
+ function cleanup() {
5544
+ clearTimeout(timeoutId);
5545
+ io && io.disconnect();
5546
+ io = null;
5547
+ }
5548
+ function refresh(skip, threshold) {
5549
+ if (skip === void 0) {
5550
+ skip = false;
5551
+ }
5552
+ if (threshold === void 0) {
5553
+ threshold = 1;
5554
+ }
5555
+ cleanup();
5556
+ const {
5557
+ left,
5558
+ top,
5559
+ width,
5560
+ height
5561
+ } = element.getBoundingClientRect();
5562
+ if (!skip) {
5563
+ onMove();
5564
+ }
5565
+ if (!width || !height) {
5566
+ return;
5567
+ }
5568
+ const insetTop = floor(top);
5569
+ const insetRight = floor(root.clientWidth - (left + width));
5570
+ const insetBottom = floor(root.clientHeight - (top + height));
5571
+ const insetLeft = floor(left);
5572
+ const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
5573
+ const options = {
5574
+ rootMargin,
5575
+ threshold: max(0, min(1, threshold)) || 1
5576
+ };
5577
+ let isFirstUpdate = true;
5578
+ function handleObserve(entries) {
5579
+ const ratio = entries[0].intersectionRatio;
5580
+ if (ratio !== threshold) {
5581
+ if (!isFirstUpdate) {
5582
+ return refresh();
5583
+ }
5584
+ if (!ratio) {
5585
+ timeoutId = setTimeout(() => {
5586
+ refresh(false, 1e-7);
5587
+ }, 100);
5588
+ } else {
5589
+ refresh(false, ratio);
5590
+ }
5591
+ }
5592
+ isFirstUpdate = false;
5593
+ }
5594
+
5595
+ // Older browsers don't support a `document` as the root and will throw an
5596
+ // error.
5597
+ try {
5598
+ io = new IntersectionObserver(handleObserve, {
5599
+ ...options,
5600
+ // Handle <iframe>s
5601
+ root: root.ownerDocument
5602
+ });
5603
+ } catch (e) {
5604
+ io = new IntersectionObserver(handleObserve, options);
5605
+ }
5606
+ io.observe(element);
5607
+ }
5608
+ refresh(true);
5609
+ return cleanup;
5610
+ }
5611
+
5509
5612
  /**
5510
5613
  * Automatically updates the position of the floating element when necessary.
5511
5614
  * Should only be called when the floating element is mounted on the DOM or
@@ -5521,30 +5624,39 @@ function autoUpdate(reference, floating, update, options) {
5521
5624
  const {
5522
5625
  ancestorScroll = true,
5523
5626
  ancestorResize = true,
5524
- elementResize = true,
5627
+ elementResize = typeof ResizeObserver === 'function',
5628
+ layoutShift = typeof IntersectionObserver === 'function',
5525
5629
  animationFrame = false
5526
5630
  } = options;
5527
- const ancestors = ancestorScroll || ancestorResize ? [...(isElement(reference) ? getOverflowAncestors(reference) : reference.contextElement ? getOverflowAncestors(reference.contextElement) : []), ...getOverflowAncestors(floating)] : [];
5631
+ const referenceEl = unwrapElement(reference);
5632
+ const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];
5528
5633
  ancestors.forEach(ancestor => {
5529
- // ignores Window, checks for [object VisualViewport]
5530
- const isVisualViewport = !isElement(ancestor) && ancestor.toString().includes('V');
5531
- if (ancestorScroll && (animationFrame ? isVisualViewport : true)) {
5532
- ancestor.addEventListener('scroll', update, {
5533
- passive: true
5534
- });
5535
- }
5634
+ ancestorScroll && ancestor.addEventListener('scroll', update, {
5635
+ passive: true
5636
+ });
5536
5637
  ancestorResize && ancestor.addEventListener('resize', update);
5537
5638
  });
5538
- let observer = null;
5639
+ const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
5640
+ let reobserveFrame = -1;
5641
+ let resizeObserver = null;
5539
5642
  if (elementResize) {
5540
- observer = new ResizeObserver(() => {
5643
+ resizeObserver = new ResizeObserver(_ref => {
5644
+ let [firstEntry] = _ref;
5645
+ if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
5646
+ // Prevent update loops when using the `size` middleware.
5647
+ // https://github.com/floating-ui/floating-ui/issues/1740
5648
+ resizeObserver.unobserve(floating);
5649
+ cancelAnimationFrame(reobserveFrame);
5650
+ reobserveFrame = requestAnimationFrame(() => {
5651
+ resizeObserver && resizeObserver.observe(floating);
5652
+ });
5653
+ }
5541
5654
  update();
5542
5655
  });
5543
- isElement(reference) && !animationFrame && observer.observe(reference);
5544
- if (!isElement(reference) && reference.contextElement && !animationFrame) {
5545
- observer.observe(reference.contextElement);
5656
+ if (referenceEl && !animationFrame) {
5657
+ resizeObserver.observe(referenceEl);
5546
5658
  }
5547
- observer.observe(floating);
5659
+ resizeObserver.observe(floating);
5548
5660
  }
5549
5661
  let frameId;
5550
5662
  let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
@@ -5561,13 +5673,13 @@ function autoUpdate(reference, floating, update, options) {
5561
5673
  }
5562
5674
  update();
5563
5675
  return () => {
5564
- var _observer;
5565
5676
  ancestors.forEach(ancestor => {
5566
5677
  ancestorScroll && ancestor.removeEventListener('scroll', update);
5567
5678
  ancestorResize && ancestor.removeEventListener('resize', update);
5568
5679
  });
5569
- (_observer = observer) == null ? void 0 : _observer.disconnect();
5570
- observer = null;
5680
+ cleanupIo && cleanupIo();
5681
+ resizeObserver && resizeObserver.disconnect();
5682
+ resizeObserver = null;
5571
5683
  if (animationFrame) {
5572
5684
  cancelAnimationFrame(frameId);
5573
5685
  }
@@ -6173,7 +6285,7 @@ var isFocusable = function isFocusable(node, options) {
6173
6285
  };
6174
6286
 
6175
6287
  /*!
6176
- * focus-trap 7.4.3
6288
+ * focus-trap 7.5.2
6177
6289
  * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
6178
6290
  */
6179
6291
 
@@ -6258,10 +6370,10 @@ var isSelectableInput = function isSelectableInput(node) {
6258
6370
  return node.tagName && node.tagName.toLowerCase() === 'input' && typeof node.select === 'function';
6259
6371
  };
6260
6372
  var isEscapeEvent = function isEscapeEvent(e) {
6261
- return e.key === 'Escape' || e.key === 'Esc' || e.keyCode === 27;
6373
+ return (e === null || e === void 0 ? void 0 : e.key) === 'Escape' || (e === null || e === void 0 ? void 0 : e.key) === 'Esc' || (e === null || e === void 0 ? void 0 : e.keyCode) === 27;
6262
6374
  };
6263
6375
  var isTabEvent = function isTabEvent(e) {
6264
- return e.key === 'Tab' || e.keyCode === 9;
6376
+ return (e === null || e === void 0 ? void 0 : e.key) === 'Tab' || (e === null || e === void 0 ? void 0 : e.keyCode) === 9;
6265
6377
  };
6266
6378
 
6267
6379
  // checks for TAB by default
@@ -6345,8 +6457,11 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
6345
6457
  // container: HTMLElement,
6346
6458
  // tabbableNodes: Array<HTMLElement>, // empty if none
6347
6459
  // focusableNodes: Array<HTMLElement>, // empty if none
6348
- // firstTabbableNode: HTMLElement|null,
6349
- // lastTabbableNode: HTMLElement|null,
6460
+ // posTabIndexesFound: boolean,
6461
+ // firstTabbableNode: HTMLElement|undefined,
6462
+ // lastTabbableNode: HTMLElement|undefined,
6463
+ // firstDomTabbableNode: HTMLElement|undefined,
6464
+ // lastDomTabbableNode: HTMLElement|undefined,
6350
6465
  // nextTabbableNode: (node: HTMLElement, forward: boolean) => HTMLElement|undefined
6351
6466
  // }>}
6352
6467
  containerGroups: [],
@@ -6363,7 +6478,9 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
6363
6478
  paused: false,
6364
6479
  // timer ID for when delayInitialFocus is true and initial focus in this trap
6365
6480
  // has been delayed during activation
6366
- delayInitialFocusTimer: undefined
6481
+ delayInitialFocusTimer: undefined,
6482
+ // the most recent KeyboardEvent for the configured nav key (typically [SHIFT+]TAB), if any
6483
+ recentNavEvent: undefined
6367
6484
  };
6368
6485
  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
6369
6486
 
@@ -6382,7 +6499,9 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
6382
6499
  /**
6383
6500
  * Finds the index of the container that contains the element.
6384
6501
  * @param {HTMLElement} element
6385
- * @param {Event} [event]
6502
+ * @param {Event} [event] If available, and `element` isn't directly found in any container,
6503
+ * the event's composed path is used to see if includes any known trap containers in the
6504
+ * case where the element is inside a Shadow DOM.
6386
6505
  * @returns {number} Index of the container in either `state.containers` or
6387
6506
  * `state.containerGroups` (the order/length of these lists are the same); -1
6388
6507
  * if the element isn't found.
@@ -6477,14 +6596,41 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
6477
6596
  var tabbableNodes = tabbable(container, config.tabbableOptions);
6478
6597
 
6479
6598
  // NOTE: if we have tabbable nodes, we must have focusable nodes; focusable nodes
6480
- // are a superset of tabbable nodes
6599
+ // are a superset of tabbable nodes since nodes with negative `tabindex` attributes
6600
+ // are focusable but not tabbable
6481
6601
  var focusableNodes = focusable(container, config.tabbableOptions);
6602
+ var firstTabbableNode = tabbableNodes.length > 0 ? tabbableNodes[0] : undefined;
6603
+ var lastTabbableNode = tabbableNodes.length > 0 ? tabbableNodes[tabbableNodes.length - 1] : undefined;
6604
+ var firstDomTabbableNode = focusableNodes.find(function (node) {
6605
+ return isTabbable(node);
6606
+ });
6607
+ var lastDomTabbableNode = focusableNodes.slice().reverse().find(function (node) {
6608
+ return isTabbable(node);
6609
+ });
6610
+ var posTabIndexesFound = !!tabbableNodes.find(function (node) {
6611
+ return getTabIndex(node) > 0;
6612
+ });
6482
6613
  return {
6483
6614
  container: container,
6484
6615
  tabbableNodes: tabbableNodes,
6485
6616
  focusableNodes: focusableNodes,
6486
- firstTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[0] : null,
6487
- lastTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[tabbableNodes.length - 1] : null,
6617
+ /** True if at least one node with positive `tabindex` was found in this container. */
6618
+ posTabIndexesFound: posTabIndexesFound,
6619
+ /** First tabbable node in container, __tabindex__ order; `undefined` if none. */
6620
+ firstTabbableNode: firstTabbableNode,
6621
+ /** Last tabbable node in container, __tabindex__ order; `undefined` if none. */
6622
+ lastTabbableNode: lastTabbableNode,
6623
+ // NOTE: DOM order is NOT NECESSARILY "document position" order, but figuring that out
6624
+ // would require more than just https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition
6625
+ // because that API doesn't work with Shadow DOM as well as it should (@see
6626
+ // https://github.com/whatwg/dom/issues/320) and since this first/last is only needed, so far,
6627
+ // to address an edge case related to positive tabindex support, this seems like a much easier,
6628
+ // "close enough most of the time" alternative for positive tabindexes which should generally
6629
+ // be avoided anyway...
6630
+ /** First tabbable node in container, __DOM__ order; `undefined` if none. */
6631
+ firstDomTabbableNode: firstDomTabbableNode,
6632
+ /** Last tabbable node in container, __DOM__ order; `undefined` if none. */
6633
+ lastDomTabbableNode: lastDomTabbableNode,
6488
6634
  /**
6489
6635
  * Finds the __tabbable__ node that follows the given node in the specified direction,
6490
6636
  * in this container, if any.
@@ -6495,30 +6641,24 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
6495
6641
  */
6496
6642
  nextTabbableNode: function nextTabbableNode(node) {
6497
6643
  var forward = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
6498
- // NOTE: If tabindex is positive (in order to manipulate the tab order separate
6499
- // from the DOM order), this __will not work__ because the list of focusableNodes,
6500
- // while it contains tabbable nodes, does not sort its nodes in any order other
6501
- // than DOM order, because it can't: Where would you place focusable (but not
6502
- // tabbable) nodes in that order? They have no order, because they aren't tabbale...
6503
- // Support for positive tabindex is already broken and hard to manage (possibly
6504
- // not supportable, TBD), so this isn't going to make things worse than they
6505
- // already are, and at least makes things better for the majority of cases where
6506
- // tabindex is either 0/unset or negative.
6507
- // FYI, positive tabindex issue: https://github.com/focus-trap/focus-trap/issues/375
6508
- var nodeIdx = focusableNodes.findIndex(function (n) {
6509
- return n === node;
6510
- });
6644
+ var nodeIdx = tabbableNodes.indexOf(node);
6511
6645
  if (nodeIdx < 0) {
6512
- return undefined;
6513
- }
6514
- if (forward) {
6515
- return focusableNodes.slice(nodeIdx + 1).find(function (n) {
6516
- return isTabbable(n, config.tabbableOptions);
6646
+ // either not tabbable nor focusable, or was focused but not tabbable (negative tabindex):
6647
+ // since `node` should at least have been focusable, we assume that's the case and mimic
6648
+ // what browsers do, which is set focus to the next node in __document position order__,
6649
+ // regardless of positive tabindexes, if any -- and for reasons explained in the NOTE
6650
+ // above related to `firstDomTabbable` and `lastDomTabbable` properties, we fall back to
6651
+ // basic DOM order
6652
+ if (forward) {
6653
+ return focusableNodes.slice(focusableNodes.indexOf(node) + 1).find(function (el) {
6654
+ return isTabbable(el);
6655
+ });
6656
+ }
6657
+ return focusableNodes.slice(0, focusableNodes.indexOf(node)).reverse().find(function (el) {
6658
+ return isTabbable(el);
6517
6659
  });
6518
6660
  }
6519
- return focusableNodes.slice(0, nodeIdx).reverse().find(function (n) {
6520
- return isTabbable(n, config.tabbableOptions);
6521
- });
6661
+ return tabbableNodes[nodeIdx + (forward ? 1 : -1)];
6522
6662
  }
6523
6663
  };
6524
6664
  });
@@ -6531,6 +6671,19 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
6531
6671
  ) {
6532
6672
  throw new Error('Your focus-trap must have at least one container with at least one tabbable node in it at all times');
6533
6673
  }
6674
+
6675
+ // NOTE: Positive tabindexes are only properly supported in single-container traps because
6676
+ // doing it across multiple containers where tabindexes could be all over the place
6677
+ // would require Tabbable to support multiple containers, would require additional
6678
+ // specialized Shadow DOM support, and would require Tabbable's multi-container support
6679
+ // to look at those containers in document position order rather than user-provided
6680
+ // order (as they are treated in Focus-trap, for legacy reasons). See discussion on
6681
+ // https://github.com/focus-trap/focus-trap/issues/375 for more details.
6682
+ if (state.containerGroups.find(function (g) {
6683
+ return g.posTabIndexesFound;
6684
+ }) && state.containerGroups.length > 1) {
6685
+ throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.");
6686
+ }
6534
6687
  };
6535
6688
  var tryFocus = function tryFocus(node) {
6536
6689
  if (node === false) {
@@ -6546,6 +6699,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
6546
6699
  node.focus({
6547
6700
  preventScroll: !!config.preventScroll
6548
6701
  });
6702
+ // NOTE: focus() API does not trigger focusIn event so set MRU node manually
6549
6703
  state.mostRecentlyFocusedNode = node;
6550
6704
  if (isSelectableInput(node)) {
6551
6705
  node.select();
@@ -6556,64 +6710,23 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
6556
6710
  return node ? node : node === false ? false : previousActiveElement;
6557
6711
  };
6558
6712
 
6559
- // This needs to be done on mousedown and touchstart instead of click
6560
- // so that it precedes the focus event.
6561
- var checkPointerDown = function checkPointerDown(e) {
6562
- var target = getActualTarget(e);
6563
- if (findContainerIndex(target, e) >= 0) {
6564
- // allow the click since it ocurred inside the trap
6565
- return;
6566
- }
6567
- if (valueOrHandler(config.clickOutsideDeactivates, e)) {
6568
- // immediately deactivate the trap
6569
- trap.deactivate({
6570
- // NOTE: by setting `returnFocus: false`, deactivate() will do nothing,
6571
- // which will result in the outside click setting focus to the node
6572
- // that was clicked (and if not focusable, to "nothing"); by setting
6573
- // `returnFocus: true`, we'll attempt to re-focus the node originally-focused
6574
- // on activation (or the configured `setReturnFocus` node), whether the
6575
- // outside click was on a focusable node or not
6576
- returnFocus: config.returnFocusOnDeactivate
6577
- });
6578
- return;
6579
- }
6580
-
6581
- // This is needed for mobile devices.
6582
- // (If we'll only let `click` events through,
6583
- // then on mobile they will be blocked anyways if `touchstart` is blocked.)
6584
- if (valueOrHandler(config.allowOutsideClick, e)) {
6585
- // allow the click outside the trap to take place
6586
- return;
6587
- }
6588
-
6589
- // otherwise, prevent the click
6590
- e.preventDefault();
6591
- };
6592
-
6593
- // In case focus escapes the trap for some strange reason, pull it back in.
6594
- var checkFocusIn = function checkFocusIn(e) {
6595
- var target = getActualTarget(e);
6596
- var targetContained = findContainerIndex(target, e) >= 0;
6597
-
6598
- // In Firefox when you Tab out of an iframe the Document is briefly focused.
6599
- if (targetContained || target instanceof Document) {
6600
- if (targetContained) {
6601
- state.mostRecentlyFocusedNode = target;
6602
- }
6603
- } else {
6604
- // escaped! pull it back in to where it just left
6605
- e.stopImmediatePropagation();
6606
- tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());
6607
- }
6608
- };
6609
-
6610
- // Hijack key nav events on the first and last focusable nodes of the trap,
6611
- // in order to prevent focus from escaping. If it escapes for even a
6612
- // moment it can end up scrolling the page and causing confusion so we
6613
- // kind of need to capture the action at the keydown phase.
6614
- var checkKeyNav = function checkKeyNav(event) {
6615
- var isBackward = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
6616
- var target = getActualTarget(event);
6713
+ /**
6714
+ * Finds the next node (in either direction) where focus should move according to a
6715
+ * keyboard focus-in event.
6716
+ * @param {Object} params
6717
+ * @param {Node} [params.target] Known target __from which__ to navigate, if any.
6718
+ * @param {KeyboardEvent|FocusEvent} [params.event] Event to use if `target` isn't known (event
6719
+ * will be used to determine the `target`). Ignored if `target` is specified.
6720
+ * @param {boolean} [params.isBackward] True if focus should move backward.
6721
+ * @returns {Node|undefined} The next node, or `undefined` if a next node couldn't be
6722
+ * determined given the current state of the trap.
6723
+ */
6724
+ var findNextNavNode = function findNextNavNode(_ref2) {
6725
+ var target = _ref2.target,
6726
+ event = _ref2.event,
6727
+ _ref2$isBackward = _ref2.isBackward,
6728
+ isBackward = _ref2$isBackward === void 0 ? false : _ref2$isBackward;
6729
+ target = target || getActualTarget(event);
6617
6730
  updateTabbableNodes();
6618
6731
  var destinationNode = null;
6619
6732
  if (state.tabbableGroups.length > 0) {
@@ -6636,8 +6749,8 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
6636
6749
  // REVERSE
6637
6750
 
6638
6751
  // is the target the first tabbable node in a group?
6639
- var startOfGroupIndex = findIndex(state.tabbableGroups, function (_ref2) {
6640
- var firstTabbableNode = _ref2.firstTabbableNode;
6752
+ var startOfGroupIndex = findIndex(state.tabbableGroups, function (_ref3) {
6753
+ var firstTabbableNode = _ref3.firstTabbableNode;
6641
6754
  return target === firstTabbableNode;
6642
6755
  });
6643
6756
  if (startOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config.tabbableOptions) && !isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target, false))) {
@@ -6655,7 +6768,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
6655
6768
  // the LAST group if it's the first tabbable node of the FIRST group)
6656
6769
  var destinationGroupIndex = startOfGroupIndex === 0 ? state.tabbableGroups.length - 1 : startOfGroupIndex - 1;
6657
6770
  var destinationGroup = state.tabbableGroups[destinationGroupIndex];
6658
- destinationNode = destinationGroup.lastTabbableNode;
6771
+ destinationNode = getTabIndex(target) >= 0 ? destinationGroup.lastTabbableNode : destinationGroup.lastDomTabbableNode;
6659
6772
  } else if (!isTabEvent(event)) {
6660
6773
  // user must have customized the nav keys so we have to move focus manually _within_
6661
6774
  // the active group: do this based on the order determined by tabbable()
@@ -6665,8 +6778,8 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
6665
6778
  // FORWARD
6666
6779
 
6667
6780
  // is the target the last tabbable node in a group?
6668
- var lastOfGroupIndex = findIndex(state.tabbableGroups, function (_ref3) {
6669
- var lastTabbableNode = _ref3.lastTabbableNode;
6781
+ var lastOfGroupIndex = findIndex(state.tabbableGroups, function (_ref4) {
6782
+ var lastTabbableNode = _ref4.lastTabbableNode;
6670
6783
  return target === lastTabbableNode;
6671
6784
  });
6672
6785
  if (lastOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config.tabbableOptions) && !isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target))) {
@@ -6684,7 +6797,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
6684
6797
  // group if it's the last tabbable node of the LAST group)
6685
6798
  var _destinationGroupIndex = lastOfGroupIndex === state.tabbableGroups.length - 1 ? 0 : lastOfGroupIndex + 1;
6686
6799
  var _destinationGroup = state.tabbableGroups[_destinationGroupIndex];
6687
- destinationNode = _destinationGroup.firstTabbableNode;
6800
+ destinationNode = getTabIndex(target) >= 0 ? _destinationGroup.firstTabbableNode : _destinationGroup.firstDomTabbableNode;
6688
6801
  } else if (!isTabEvent(event)) {
6689
6802
  // user must have customized the nav keys so we have to move focus manually _within_
6690
6803
  // the active group: do this based on the order determined by tabbable()
@@ -6696,6 +6809,153 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
6696
6809
  // NOTE: the fallbackFocus option does not support returning false to opt-out
6697
6810
  destinationNode = getNodeForOption('fallbackFocus');
6698
6811
  }
6812
+ return destinationNode;
6813
+ };
6814
+
6815
+ // This needs to be done on mousedown and touchstart instead of click
6816
+ // so that it precedes the focus event.
6817
+ var checkPointerDown = function checkPointerDown(e) {
6818
+ var target = getActualTarget(e);
6819
+ if (findContainerIndex(target, e) >= 0) {
6820
+ // allow the click since it ocurred inside the trap
6821
+ return;
6822
+ }
6823
+ if (valueOrHandler(config.clickOutsideDeactivates, e)) {
6824
+ // immediately deactivate the trap
6825
+ trap.deactivate({
6826
+ // NOTE: by setting `returnFocus: false`, deactivate() will do nothing,
6827
+ // which will result in the outside click setting focus to the node
6828
+ // that was clicked (and if not focusable, to "nothing"); by setting
6829
+ // `returnFocus: true`, we'll attempt to re-focus the node originally-focused
6830
+ // on activation (or the configured `setReturnFocus` node), whether the
6831
+ // outside click was on a focusable node or not
6832
+ returnFocus: config.returnFocusOnDeactivate
6833
+ });
6834
+ return;
6835
+ }
6836
+
6837
+ // This is needed for mobile devices.
6838
+ // (If we'll only let `click` events through,
6839
+ // then on mobile they will be blocked anyways if `touchstart` is blocked.)
6840
+ if (valueOrHandler(config.allowOutsideClick, e)) {
6841
+ // allow the click outside the trap to take place
6842
+ return;
6843
+ }
6844
+
6845
+ // otherwise, prevent the click
6846
+ e.preventDefault();
6847
+ };
6848
+
6849
+ // In case focus escapes the trap for some strange reason, pull it back in.
6850
+ // NOTE: the focusIn event is NOT cancelable, so if focus escapes, it may cause unexpected
6851
+ // scrolling if the node that got focused was out of view; there's nothing we can do to
6852
+ // prevent that from happening by the time we discover that focus escaped
6853
+ var checkFocusIn = function checkFocusIn(event) {
6854
+ var target = getActualTarget(event);
6855
+ var targetContained = findContainerIndex(target, event) >= 0;
6856
+
6857
+ // In Firefox when you Tab out of an iframe the Document is briefly focused.
6858
+ if (targetContained || target instanceof Document) {
6859
+ if (targetContained) {
6860
+ state.mostRecentlyFocusedNode = target;
6861
+ }
6862
+ } else {
6863
+ // escaped! pull it back in to where it just left
6864
+ event.stopImmediatePropagation();
6865
+
6866
+ // focus will escape if the MRU node had a positive tab index and user tried to nav forward;
6867
+ // it will also escape if the MRU node had a 0 tab index and user tried to nav backward
6868
+ // toward a node with a positive tab index
6869
+ var nextNode; // next node to focus, if we find one
6870
+ var navAcrossContainers = true;
6871
+ if (state.mostRecentlyFocusedNode) {
6872
+ if (getTabIndex(state.mostRecentlyFocusedNode) > 0) {
6873
+ // MRU container index must be >=0 otherwise we wouldn't have it as an MRU node...
6874
+ var mruContainerIdx = findContainerIndex(state.mostRecentlyFocusedNode);
6875
+ // there MAY not be any tabbable nodes in the container if there are at least 2 containers
6876
+ // and the MRU node is focusable but not tabbable (focus-trap requires at least 1 container
6877
+ // with at least one tabbable node in order to function, so this could be the other container
6878
+ // with nothing tabbable in it)
6879
+ var tabbableNodes = state.containerGroups[mruContainerIdx].tabbableNodes;
6880
+ if (tabbableNodes.length > 0) {
6881
+ // MRU tab index MAY not be found if the MRU node is focusable but not tabbable
6882
+ var mruTabIdx = tabbableNodes.findIndex(function (node) {
6883
+ return node === state.mostRecentlyFocusedNode;
6884
+ });
6885
+ if (mruTabIdx >= 0) {
6886
+ if (config.isKeyForward(state.recentNavEvent)) {
6887
+ if (mruTabIdx + 1 < tabbableNodes.length) {
6888
+ nextNode = tabbableNodes[mruTabIdx + 1];
6889
+ navAcrossContainers = false;
6890
+ }
6891
+ // else, don't wrap within the container as focus should move to next/previous
6892
+ // container
6893
+ } else {
6894
+ if (mruTabIdx - 1 >= 0) {
6895
+ nextNode = tabbableNodes[mruTabIdx - 1];
6896
+ navAcrossContainers = false;
6897
+ }
6898
+ // else, don't wrap within the container as focus should move to next/previous
6899
+ // container
6900
+ }
6901
+ // else, don't find in container order without considering direction too
6902
+ }
6903
+ }
6904
+ // else, no tabbable nodes in that container (which means we must have at least one other
6905
+ // container with at least one tabbable node in it, otherwise focus-trap would've thrown
6906
+ // an error the last time updateTabbableNodes() was run): find next node among all known
6907
+ // containers
6908
+ } else {
6909
+ // check to see if there's at least one tabbable node with a positive tab index inside
6910
+ // the trap because focus seems to escape when navigating backward from a tabbable node
6911
+ // with tabindex=0 when this is the case (instead of wrapping to the tabbable node with
6912
+ // the greatest positive tab index like it should)
6913
+ if (!state.containerGroups.some(function (g) {
6914
+ return g.tabbableNodes.some(function (n) {
6915
+ return getTabIndex(n) > 0;
6916
+ });
6917
+ })) {
6918
+ // no containers with tabbable nodes with positive tab indexes which means the focus
6919
+ // escaped for some other reason and we should just execute the fallback to the
6920
+ // MRU node or initial focus node, if any
6921
+ navAcrossContainers = false;
6922
+ }
6923
+ }
6924
+ } else {
6925
+ // no MRU node means we're likely in some initial condition when the trap has just
6926
+ // been activated and initial focus hasn't been given yet, in which case we should
6927
+ // fall through to trying to focus the initial focus node, which is what should
6928
+ // happen below at this point in the logic
6929
+ navAcrossContainers = false;
6930
+ }
6931
+ if (navAcrossContainers) {
6932
+ nextNode = findNextNavNode({
6933
+ // move FROM the MRU node, not event-related node (which will be the node that is
6934
+ // outside the trap causing the focus escape we're trying to fix)
6935
+ target: state.mostRecentlyFocusedNode,
6936
+ isBackward: config.isKeyBackward(state.recentNavEvent)
6937
+ });
6938
+ }
6939
+ if (nextNode) {
6940
+ tryFocus(nextNode);
6941
+ } else {
6942
+ tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());
6943
+ }
6944
+ }
6945
+ state.recentNavEvent = undefined; // clear
6946
+ };
6947
+
6948
+ // Hijack key nav events on the first and last focusable nodes of the trap,
6949
+ // in order to prevent focus from escaping. If it escapes for even a
6950
+ // moment it can end up scrolling the page and causing confusion so we
6951
+ // kind of need to capture the action at the keydown phase.
6952
+ var checkKeyNav = function checkKeyNav(event) {
6953
+ var isBackward = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
6954
+ state.recentNavEvent = event;
6955
+ var destinationNode = findNextNavNode({
6956
+ event: event,
6957
+ isBackward: isBackward
6958
+ });
6699
6959
  if (destinationNode) {
6700
6960
  if (isTabEvent(event)) {
6701
6961
  // since tab natively moves focus, we wouldn't have a destination node unless we
@@ -6959,16 +7219,22 @@ const CatDropdown = class {
6959
7219
  this.overflow = false;
6960
7220
  }
6961
7221
  clickHandler(event) {
6962
- // we need to delay the initialization of the trigger until first,
7222
+ // we need to delay the initialization of the trigger until first
6963
7223
  // interaction because the element might still be hidden (and thus not
6964
7224
  // tabbable) if contained in another Stencil web component
6965
7225
  if (!this.trigger) {
6966
7226
  this.initTrigger();
6967
7227
  this.toggle();
6968
7228
  }
6969
- const button = event.target;
6970
- // hide dropdown on button click
6971
- if (!this.noAutoClose && event.composedPath().includes(this.content) && button.slot !== 'trigger') {
7229
+ // hide dropdown on button clicks inside the dropdown content
7230
+ const path = event.composedPath();
7231
+ if (!this.noAutoClose &&
7232
+ // check if click was inside of the dropdown content
7233
+ path.includes(this.content) &&
7234
+ // check if click was not on a trigger for a sub-dropdown
7235
+ event.target?.slot !== 'trigger' &&
7236
+ // check if click was not an element marked with data-dropdown-no-close
7237
+ !path.slice(0, path.indexOf(this.content)).find(el => this.hasAttribute(el, 'data-dropdown-no-close'))) {
6972
7238
  this.close();
6973
7239
  }
6974
7240
  }
@@ -6982,8 +7248,8 @@ const CatDropdown = class {
6982
7248
  * Opens the dropdown.
6983
7249
  */
6984
7250
  async open() {
6985
- if (this.isOpen === null) {
6986
- return; // busy
7251
+ if (this.isOpen === null || this.isOpen) {
7252
+ return; // busy or open
6987
7253
  }
6988
7254
  this.isOpen = null;
6989
7255
  this.content.style.display = 'block';
@@ -7000,15 +7266,11 @@ const CatDropdown = class {
7000
7266
  getShadowRoot: true
7001
7267
  },
7002
7268
  allowOutsideClick: true,
7003
- clickOutsideDeactivates: event => {
7004
- const shouldClose = !this.noAutoClose &&
7005
- !event.composedPath().includes(this.content) &&
7006
- (!this.trigger || !event.composedPath().includes(this.trigger));
7007
- if (shouldClose) {
7008
- this.close();
7009
- }
7010
- return shouldClose;
7011
- },
7269
+ clickOutsideDeactivates: event => !this.noAutoClose &&
7270
+ // check if click was outside of the dropdown content
7271
+ !event.composedPath().includes(this.content) &&
7272
+ // check if click was not on an element marked with data-dropdown-no-close
7273
+ !event.composedPath().find(el => this.hasAttribute(el, 'data-dropdown-no-close')),
7012
7274
  onPostDeactivate: () => this.close()
7013
7275
  });
7014
7276
  this.trap.activate();
@@ -7018,8 +7280,8 @@ const CatDropdown = class {
7018
7280
  * Closes the dropdown.
7019
7281
  */
7020
7282
  async close() {
7021
- if (this.isOpen === null || !this.isOpen) {
7022
- return; // busy
7283
+ if (!this.isOpen) {
7284
+ return; // busy or closed
7023
7285
  }
7024
7286
  this.isOpen = null;
7025
7287
  this.content.classList.remove('show');
@@ -7110,6 +7372,9 @@ const CatDropdown = class {
7110
7372
  });
7111
7373
  }
7112
7374
  }
7375
+ hasAttribute(elem, attr) {
7376
+ return elem instanceof HTMLElement && elem.hasAttribute(attr);
7377
+ }
7113
7378
  };
7114
7379
  CatDropdown.OFFSET = 4;
7115
7380
  CatDropdown.style = catDropdownCss;
@@ -7184,7 +7449,7 @@ function isNumberValue(value) {
7184
7449
  return !isNaN(parseFloat(value)) && !isNaN(Number(value));
7185
7450
  }
7186
7451
 
7187
- const catInputCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column;color:rgb(var(--cat-hint-color, inherit))}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1.125rem;font-weight:var(--cat-font-weight-body, 400);margin:0 !important}.cat-bg-primary{background-color:rgb(var(--cat-primary-bg, 0, 129, 148)) !important;color:rgb(var(--cat-primary-fill, 255, 255, 255)) !important}.cat-bg-primary-hover{transition:background-color 125ms, color 125ms}.cat-bg-primary-hover:hover{background-color:rgb(var(--cat-primary-bg-hover, 1, 115, 132)) !important;color:rgb(var(--cat-primary-fill-hover, 255, 255, 255)) !important}.cat-text-primary,.cat-link-primary{color:rgb(var(--cat-primary-text, 0, 129, 148)) !important}.cat-link-primary,.cat-text-primary-hover{transition:color 125ms}.cat-link-primary:hover,.cat-text-primary-hover:hover{color:rgb(var(--cat-primary-text-hover, 1, 115, 132)) !important}.cat-link-primary:active,.cat-text-primary-hover:active{color:rgb(var(--cat-primary-text-active, 2, 99, 113)) !important}.cat-bg-primaryInverted{background-color:#93b4f2 !important;color:black !important}.cat-bg-primaryInverted-hover{transition:background-color 125ms, color 125ms}.cat-bg-primaryInverted-hover:hover{background-color:#93b4f2 !important;color:black !important}.cat-text-primaryInverted,.cat-link-primaryInverted{color:#93b4f2 !important}.cat-link-primaryInverted,.cat-text-primaryInverted-hover{transition:color 125ms}.cat-link-primaryInverted:hover,.cat-text-primaryInverted-hover:hover{color:#93b4f2 !important}.cat-link-primaryInverted:active,.cat-text-primaryInverted-hover:active{color:#93b4f2 !important}.cat-bg-secondary{background-color:rgb(var(--cat-secondary-bg, 105, 118, 135)) !important;color:rgb(var(--cat-secondary-fill, 255, 255, 255)) !important}.cat-bg-secondary-hover{transition:background-color 125ms, color 125ms}.cat-bg-secondary-hover:hover{background-color:rgb(var(--cat-secondary-bg-hover, 105, 118, 135)) !important;color:rgb(var(--cat-secondary-fill-hover, 255, 255, 255)) !important}.cat-text-secondary,.cat-link-secondary{color:rgb(var(--cat-secondary-text, 0, 0, 0)) !important}.cat-link-secondary,.cat-text-secondary-hover{transition:color 125ms}.cat-link-secondary:hover,.cat-text-secondary-hover:hover{color:rgb(var(--cat-secondary-text-hover, 0, 0, 0)) !important}.cat-link-secondary:active,.cat-text-secondary-hover:active{color:rgb(var(--cat-secondary-text-active, 0, 0, 0)) !important}.cat-bg-secondaryInverted{background-color:#697687 !important;color:black !important}.cat-bg-secondaryInverted-hover{transition:background-color 125ms, color 125ms}.cat-bg-secondaryInverted-hover:hover{background-color:#697687 !important;color:black !important}.cat-text-secondaryInverted,.cat-link-secondaryInverted{color:white !important}.cat-link-secondaryInverted,.cat-text-secondaryInverted-hover{transition:color 125ms}.cat-link-secondaryInverted:hover,.cat-text-secondaryInverted-hover:hover{color:white !important}.cat-link-secondaryInverted:active,.cat-text-secondaryInverted-hover:active{color:white !important}.cat-bg-success{background-color:rgb(var(--cat-success-bg, 0, 132, 88)) !important;color:rgb(var(--cat-success-fill, 255, 255, 255)) !important}.cat-bg-success-hover{transition:background-color 125ms, color 125ms}.cat-bg-success-hover:hover{background-color:rgb(var(--cat-success-bg-hover, 0, 117, 78)) !important;color:rgb(var(--cat-success-fill-hover, 255, 255, 255)) !important}.cat-text-success,.cat-link-success{color:rgb(var(--cat-success-text, 0, 132, 88)) !important}.cat-link-success,.cat-text-success-hover{transition:color 125ms}.cat-link-success:hover,.cat-text-success-hover:hover{color:rgb(var(--cat-success-text-hover, 0, 117, 78)) !important}.cat-link-success:active,.cat-text-success-hover:active{color:rgb(var(--cat-success-text-active, 0, 105, 70)) !important}.cat-bg-warning{background-color:rgb(var(--cat-warning-bg, 255, 206, 128)) !important;color:rgb(var(--cat-warning-fill, 0, 0, 0)) !important}.cat-bg-warning-hover{transition:background-color 125ms, color 125ms}.cat-bg-warning-hover:hover{background-color:rgb(var(--cat-warning-bg-hover, 255, 214, 148)) !important;color:rgb(var(--cat-warning-fill-hover, 0, 0, 0)) !important}.cat-text-warning,.cat-link-warning{color:rgb(var(--cat-warning-text, 159, 97, 0)) !important}.cat-link-warning,.cat-text-warning-hover{transition:color 125ms}.cat-link-warning:hover,.cat-text-warning-hover:hover{color:rgb(var(--cat-warning-text-hover, 159, 97, 0)) !important}.cat-link-warning:active,.cat-text-warning-hover:active{color:rgb(var(--cat-warning-text-active, 159, 97, 0)) !important}.cat-bg-danger{background-color:rgb(var(--cat-danger-bg, 217, 52, 13)) !important;color:rgb(var(--cat-danger-fill, 255, 255, 255)) !important}.cat-bg-danger-hover{transition:background-color 125ms, color 125ms}.cat-bg-danger-hover:hover{background-color:rgb(var(--cat-danger-bg-hover, 194, 46, 11)) !important;color:rgb(var(--cat-danger-fill-hover, 255, 255, 255)) !important}.cat-text-danger,.cat-link-danger{color:rgb(var(--cat-danger-text, 217, 52, 13)) !important}.cat-link-danger,.cat-text-danger-hover{transition:color 125ms}.cat-link-danger:hover,.cat-text-danger-hover:hover{color:rgb(var(--cat-danger-text-hover, 194, 46, 11)) !important}.cat-link-danger:active,.cat-text-danger-hover:active{color:rgb(var(--cat-danger-text-active, 174, 42, 10)) !important}.cat-active{color:rgb(var(--cat-primary-text, 0, 129, 148)) !important}.cat-muted{color:rgb(var(--cat-font-color-muted, 81, 92, 108)) !important}.cat-text-reset{color:inherit !important}.cat-link-reset{color:inherit !important;text-decoration:inherit !important}.label{overflow:hidden;word-wrap:break-word;word-break:break-word}.label-container{flex-basis:var(--label-size, 33.33%)}.label-container .label-wrapper{display:flex;gap:0.25rem}.label-container .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}.label-metadata{display:flex;flex-shrink:0;flex-grow:1;justify-content:space-between;gap:0.25rem}.label-optional{display:flex;align-items:center;max-height:1.25rem;font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 81, 92, 108))}.label-character-count{display:flex;align-items:center;margin-left:auto;max-height:1.25rem;font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 81, 92, 108))}.input-horizontal .label-wrapper,.textarea-horizontal .label-wrapper,.select-horizontal .label-wrapper{flex-direction:column}.input-horizontal label,.textarea-horizontal label,.select-horizontal label{min-height:2.5rem;display:inline-flex;align-items:center}.input-horizontal .label-metadata,.textarea-horizontal .label-metadata,.select-horizontal .label-metadata{justify-content:flex-start}.input-horizontal .label-metadata .label-character-count,.textarea-horizontal .label-metadata .label-character-count,.select-horizontal .label-metadata .label-character-count{margin-left:0}:host{display:flex;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);margin-bottom:1rem}:host([hidden]){display:none}.input-field,.input-container{display:flex;flex-direction:column;gap:0.5rem;flex:1 1 auto}.input-field.input-horizontal{flex-direction:row;gap:1rem}.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:inset 0 0 0 1px rgb(var(--border-color));transition:box-shadow 125ms linear;--border-color:var(--cat-border-color-dark, 215, 219, 224);}.input-wrapper.input-round{border-radius:10rem}.input-wrapper.input-readonly{pointer-events:none}.input-wrapper.input-disabled{background:#f2f4f7;cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 81, 92, 108))}.input-wrapper:not(.input-disabled):hover{box-shadow:inset 0 0 0 1px rgb(var(--border-color)), 0 0 0 1px rgb(var(--border-color))}.input-wrapper:focus-within{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:-1px}.input-wrapper.input-invalid{--border-color:var(--cat-danger-bg, 217, 52, 13), 0.2}.input-wrapper:has(input:-webkit-autofill),.input-wrapper:has(input:-webkit-autofill):hover,.input-wrapper:has(input:-webkit-autofill):focus{background-color:#e8f0fe}.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;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.input-disabled input{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 81, 92, 108))}input.has-clearable{padding-right:1.5rem}input::placeholder{color:rgb(var(--cat-font-color-muted, 81, 92, 108))}input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus{-webkit-box-shadow:0 0 0 9999px #e8f0fe inset}.clearable{position:absolute;top:calc(50% - 1rem);right:-0.5rem}";
7452
+ const catInputCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column;color:rgb(var(--cat-hint-color, inherit))}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1.125rem;font-weight:var(--cat-font-weight-body, 400);margin:0 !important}.cat-bg-primary{background-color:rgb(var(--cat-primary-bg, 0, 129, 148)) !important;color:rgb(var(--cat-primary-fill, 255, 255, 255)) !important}.cat-bg-primary-hover{transition:background-color 125ms, color 125ms}.cat-bg-primary-hover:hover{background-color:rgb(var(--cat-primary-bg-hover, 1, 115, 132)) !important;color:rgb(var(--cat-primary-fill-hover, 255, 255, 255)) !important}.cat-text-primary,.cat-link-primary{color:rgb(var(--cat-primary-text, 0, 129, 148)) !important}.cat-link-primary,.cat-text-primary-hover{transition:color 125ms}.cat-link-primary:hover,.cat-text-primary-hover:hover{color:rgb(var(--cat-primary-text-hover, 1, 115, 132)) !important}.cat-link-primary:active,.cat-text-primary-hover:active{color:rgb(var(--cat-primary-text-active, 2, 99, 113)) !important}.cat-bg-primaryInverted{background-color:#93b4f2 !important;color:black !important}.cat-bg-primaryInverted-hover{transition:background-color 125ms, color 125ms}.cat-bg-primaryInverted-hover:hover{background-color:#93b4f2 !important;color:black !important}.cat-text-primaryInverted,.cat-link-primaryInverted{color:#93b4f2 !important}.cat-link-primaryInverted,.cat-text-primaryInverted-hover{transition:color 125ms}.cat-link-primaryInverted:hover,.cat-text-primaryInverted-hover:hover{color:#93b4f2 !important}.cat-link-primaryInverted:active,.cat-text-primaryInverted-hover:active{color:#93b4f2 !important}.cat-bg-secondary{background-color:rgb(var(--cat-secondary-bg, 105, 118, 135)) !important;color:rgb(var(--cat-secondary-fill, 255, 255, 255)) !important}.cat-bg-secondary-hover{transition:background-color 125ms, color 125ms}.cat-bg-secondary-hover:hover{background-color:rgb(var(--cat-secondary-bg-hover, 105, 118, 135)) !important;color:rgb(var(--cat-secondary-fill-hover, 255, 255, 255)) !important}.cat-text-secondary,.cat-link-secondary{color:rgb(var(--cat-secondary-text, 0, 0, 0)) !important}.cat-link-secondary,.cat-text-secondary-hover{transition:color 125ms}.cat-link-secondary:hover,.cat-text-secondary-hover:hover{color:rgb(var(--cat-secondary-text-hover, 0, 0, 0)) !important}.cat-link-secondary:active,.cat-text-secondary-hover:active{color:rgb(var(--cat-secondary-text-active, 0, 0, 0)) !important}.cat-bg-secondaryInverted{background-color:#697687 !important;color:black !important}.cat-bg-secondaryInverted-hover{transition:background-color 125ms, color 125ms}.cat-bg-secondaryInverted-hover:hover{background-color:#697687 !important;color:black !important}.cat-text-secondaryInverted,.cat-link-secondaryInverted{color:white !important}.cat-link-secondaryInverted,.cat-text-secondaryInverted-hover{transition:color 125ms}.cat-link-secondaryInverted:hover,.cat-text-secondaryInverted-hover:hover{color:white !important}.cat-link-secondaryInverted:active,.cat-text-secondaryInverted-hover:active{color:white !important}.cat-bg-success{background-color:rgb(var(--cat-success-bg, 0, 132, 88)) !important;color:rgb(var(--cat-success-fill, 255, 255, 255)) !important}.cat-bg-success-hover{transition:background-color 125ms, color 125ms}.cat-bg-success-hover:hover{background-color:rgb(var(--cat-success-bg-hover, 0, 117, 78)) !important;color:rgb(var(--cat-success-fill-hover, 255, 255, 255)) !important}.cat-text-success,.cat-link-success{color:rgb(var(--cat-success-text, 0, 132, 88)) !important}.cat-link-success,.cat-text-success-hover{transition:color 125ms}.cat-link-success:hover,.cat-text-success-hover:hover{color:rgb(var(--cat-success-text-hover, 0, 117, 78)) !important}.cat-link-success:active,.cat-text-success-hover:active{color:rgb(var(--cat-success-text-active, 0, 105, 70)) !important}.cat-bg-warning{background-color:rgb(var(--cat-warning-bg, 255, 206, 128)) !important;color:rgb(var(--cat-warning-fill, 0, 0, 0)) !important}.cat-bg-warning-hover{transition:background-color 125ms, color 125ms}.cat-bg-warning-hover:hover{background-color:rgb(var(--cat-warning-bg-hover, 255, 214, 148)) !important;color:rgb(var(--cat-warning-fill-hover, 0, 0, 0)) !important}.cat-text-warning,.cat-link-warning{color:rgb(var(--cat-warning-text, 159, 97, 0)) !important}.cat-link-warning,.cat-text-warning-hover{transition:color 125ms}.cat-link-warning:hover,.cat-text-warning-hover:hover{color:rgb(var(--cat-warning-text-hover, 159, 97, 0)) !important}.cat-link-warning:active,.cat-text-warning-hover:active{color:rgb(var(--cat-warning-text-active, 159, 97, 0)) !important}.cat-bg-danger{background-color:rgb(var(--cat-danger-bg, 217, 52, 13)) !important;color:rgb(var(--cat-danger-fill, 255, 255, 255)) !important}.cat-bg-danger-hover{transition:background-color 125ms, color 125ms}.cat-bg-danger-hover:hover{background-color:rgb(var(--cat-danger-bg-hover, 194, 46, 11)) !important;color:rgb(var(--cat-danger-fill-hover, 255, 255, 255)) !important}.cat-text-danger,.cat-link-danger{color:rgb(var(--cat-danger-text, 217, 52, 13)) !important}.cat-link-danger,.cat-text-danger-hover{transition:color 125ms}.cat-link-danger:hover,.cat-text-danger-hover:hover{color:rgb(var(--cat-danger-text-hover, 194, 46, 11)) !important}.cat-link-danger:active,.cat-text-danger-hover:active{color:rgb(var(--cat-danger-text-active, 174, 42, 10)) !important}.cat-active{color:rgb(var(--cat-primary-text, 0, 129, 148)) !important}.cat-muted{color:rgb(var(--cat-font-color-muted, 81, 92, 108)) !important}.cat-text-reset{color:inherit !important}.cat-link-reset{color:inherit !important;text-decoration:inherit !important}.label{overflow:hidden;word-wrap:break-word;word-break:break-word}.input-field:not(.input-horizontal) .label-container.hidden,.textarea-field:not(.textarea-horizontal) .label-container.hidden,.select-field:not(.select-horizontal) .label-container.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}.label-container{flex-basis:var(--label-size, 33.33%)}.label-container .label-wrapper{display:flex;gap:0.25rem}.label-metadata{display:flex;flex-shrink:0;flex-grow:1;justify-content:space-between;gap:0.25rem}.label-optional{display:flex;align-items:center;max-height:1.25rem;font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 81, 92, 108))}.label-character-count{display:flex;align-items:center;margin-left:auto;max-height:1.25rem;font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 81, 92, 108))}.input-horizontal .label-container.hidden label,.textarea-horizontal .label-container.hidden label,.select-horizontal .label-container.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}.input-horizontal .label-wrapper,.textarea-horizontal .label-wrapper,.select-horizontal .label-wrapper{flex-direction:column}.input-horizontal label,.textarea-horizontal label,.select-horizontal label{min-height:2.5rem;display:inline-flex;align-items:center}.input-horizontal .label-metadata,.textarea-horizontal .label-metadata,.select-horizontal .label-metadata{justify-content:flex-start}.input-horizontal .label-metadata .label-character-count,.textarea-horizontal .label-metadata .label-character-count,.select-horizontal .label-metadata .label-character-count{margin-left:0}:host{display:flex;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);margin-bottom:1rem}:host([hidden]){display:none}.input-field,.input-container{display:flex;flex-direction:column;gap:0.5rem;flex:1 1 auto}.input-field.input-horizontal{flex-direction:row;gap:1rem}.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:inset 0 0 0 1px rgb(var(--border-color));transition:box-shadow 125ms linear;--border-color:var(--cat-border-color-dark, 215, 219, 224);}.input-wrapper.input-round{border-radius:10rem}.input-wrapper.input-readonly{pointer-events:none}.input-wrapper.input-disabled{background:#f2f4f7;cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 81, 92, 108))}.input-wrapper:not(.input-disabled):hover{box-shadow:inset 0 0 0 1px rgb(var(--border-color)), 0 0 0 1px rgb(var(--border-color))}.input-wrapper:focus-within{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:-1px}.input-wrapper.input-invalid{--border-color:var(--cat-danger-bg, 217, 52, 13), 0.2}.input-wrapper:has(input:-webkit-autofill),.input-wrapper:has(input:-webkit-autofill):hover,.input-wrapper:has(input:-webkit-autofill):focus{background-color:#e8f0fe}.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;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.input-disabled input{cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 81, 92, 108))}input.has-clearable{padding-right:1.5rem}input::placeholder{color:rgb(var(--cat-font-color-muted, 81, 92, 108))}input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus{-webkit-box-shadow:0 0 0 9999px #e8f0fe inset}.clearable{position:absolute;top:calc(50% - 1rem);right:-0.5rem}";
7188
7453
 
7189
7454
  let nextUniqueId$6 = 0;
7190
7455
  const CatInput = class {
@@ -7277,7 +7542,7 @@ const CatInput = class {
7277
7542
  return (h("div", { class: {
7278
7543
  'input-field': true,
7279
7544
  'input-horizontal': this.horizontal
7280
- } }, h("div", { class: "label-container" }, (this.hasSlottedLabel || this.label) && (h("label", { htmlFor: this.id, class: { hidden: this.labelHidden } }, h("span", { class: "label-wrapper", part: "label" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label, h("div", { class: "label-metadata" }, !this.required && this.requiredMarker.startsWith('optional') && (h("span", { class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker.startsWith('required') && (h("span", { class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.required'), ")")), this.maxLength && (h("div", { class: "label-character-count", "aria-hidden": "true" }, this.value?.toString().length ?? 0, "/", this.maxLength))))))), h("div", { class: "input-container" }, h("div", { class: {
7545
+ } }, h("div", { class: { 'label-container': true, hidden: this.labelHidden } }, (this.hasSlottedLabel || this.label) && (h("label", { htmlFor: this.id }, h("span", { class: "label-wrapper", part: "label" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label, h("div", { class: "label-metadata" }, !this.required && this.requiredMarker.startsWith('optional') && (h("span", { class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker.startsWith('required') && (h("span", { class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.required'), ")")), this.maxLength && (h("div", { class: "label-character-count", "aria-hidden": "true" }, this.value?.toString().length ?? 0, "/", this.maxLength))))))), h("div", { class: "input-container" }, h("div", { class: {
7281
7546
  'input-wrapper': true,
7282
7547
  'input-round': this.round,
7283
7548
  'input-readonly': this.readonly,
@@ -7285,7 +7550,7 @@ const CatInput = class {
7285
7550
  'input-invalid': this.invalid
7286
7551
  }, onClick: () => this.input.focus() }, this.textPrefix && (h("span", { class: "text-prefix", part: "prefix" }, this.textPrefix)), this.icon && !this.iconRight && h("cat-icon", { icon: this.icon, class: "icon-prefix", size: "l" }), h("div", { class: "input-inner-wrapper" }, h("input", { ...this.nativeAttributes, ref: el => (this.input = el), id: this.id, class: {
7287
7552
  'has-clearable': this.clearable && !this.disabled && !this.readonly
7288
- }, autocomplete: this.autoComplete, disabled: this.disabled, max: this.max, maxlength: this.maxLength, min: this.min, minlength: this.minLength, name: this.name, placeholder: this.placeholder, readonly: this.readonly, required: this.required, type: this.type, value: this.value, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.hint?.length ? this.id + '-hint' : undefined }), this.clearable && !this.disabled && !this.readonly && this.value && (h("cat-button", { class: "clearable", icon: "$cat:input-close", "icon-only": "true", size: "s", variant: "text", "a11y-label": catI18nRegistry.t('input.clear'), onClick: this.clear.bind(this) }))), !this.invalid && this.icon && this.iconRight && (h("cat-icon", { icon: this.icon, class: "icon-suffix", size: "l" })), this.invalid && h("cat-icon", { icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l" }), this.textSuffix && (h("span", { class: "text-suffix", part: "suffix" }, this.textSuffix))), (this.hint || this.hasSlottedHint || !!Object.keys(this.errorMap || {}).length) && (h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }), errorMap: this.errorMap })))));
7553
+ }, autocomplete: this.autoComplete, disabled: this.disabled, max: this.max, maxlength: this.maxLength, min: this.min, minlength: this.minLength, name: this.name, placeholder: this.placeholder, readonly: this.readonly, required: this.required, type: this.type, value: this.value, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.hint?.length ? this.id + '-hint' : undefined }), this.clearable && !this.disabled && !this.readonly && this.value && (h("cat-button", { class: "clearable", icon: "$cat:input-close", "icon-only": "true", size: "s", variant: "text", "a11y-label": catI18nRegistry.t('input.clear'), onClick: this.clear.bind(this), "data-dropdown-no-close": true }))), !this.invalid && this.icon && this.iconRight && (h("cat-icon", { icon: this.icon, class: "icon-suffix", size: "l" })), this.invalid && h("cat-icon", { icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l" }), this.textSuffix && (h("span", { class: "text-suffix", part: "suffix" }, this.textSuffix))), (this.hint || this.hasSlottedHint || !!Object.keys(this.errorMap || {}).length) && (h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }), errorMap: this.errorMap })))));
7289
7554
  }
7290
7555
  get invalid() {
7291
7556
  return !!this.errorMap;
@@ -7748,7 +8013,7 @@ var autosizeInput = function (element, options) {
7748
8013
  }
7749
8014
  };
7750
8015
 
7751
- const catSelectCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column;color:rgb(var(--cat-hint-color, inherit))}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1.125rem;font-weight:var(--cat-font-weight-body, 400);margin:0 !important}.cat-bg-primary{background-color:rgb(var(--cat-primary-bg, 0, 129, 148)) !important;color:rgb(var(--cat-primary-fill, 255, 255, 255)) !important}.cat-bg-primary-hover{transition:background-color 125ms, color 125ms}.cat-bg-primary-hover:hover{background-color:rgb(var(--cat-primary-bg-hover, 1, 115, 132)) !important;color:rgb(var(--cat-primary-fill-hover, 255, 255, 255)) !important}.cat-text-primary,.cat-link-primary{color:rgb(var(--cat-primary-text, 0, 129, 148)) !important}.cat-link-primary,.cat-text-primary-hover{transition:color 125ms}.cat-link-primary:hover,.cat-text-primary-hover:hover{color:rgb(var(--cat-primary-text-hover, 1, 115, 132)) !important}.cat-link-primary:active,.cat-text-primary-hover:active{color:rgb(var(--cat-primary-text-active, 2, 99, 113)) !important}.cat-bg-primaryInverted{background-color:#93b4f2 !important;color:black !important}.cat-bg-primaryInverted-hover{transition:background-color 125ms, color 125ms}.cat-bg-primaryInverted-hover:hover{background-color:#93b4f2 !important;color:black !important}.cat-text-primaryInverted,.cat-link-primaryInverted{color:#93b4f2 !important}.cat-link-primaryInverted,.cat-text-primaryInverted-hover{transition:color 125ms}.cat-link-primaryInverted:hover,.cat-text-primaryInverted-hover:hover{color:#93b4f2 !important}.cat-link-primaryInverted:active,.cat-text-primaryInverted-hover:active{color:#93b4f2 !important}.cat-bg-secondary{background-color:rgb(var(--cat-secondary-bg, 105, 118, 135)) !important;color:rgb(var(--cat-secondary-fill, 255, 255, 255)) !important}.cat-bg-secondary-hover{transition:background-color 125ms, color 125ms}.cat-bg-secondary-hover:hover{background-color:rgb(var(--cat-secondary-bg-hover, 105, 118, 135)) !important;color:rgb(var(--cat-secondary-fill-hover, 255, 255, 255)) !important}.cat-text-secondary,.cat-link-secondary{color:rgb(var(--cat-secondary-text, 0, 0, 0)) !important}.cat-link-secondary,.cat-text-secondary-hover{transition:color 125ms}.cat-link-secondary:hover,.cat-text-secondary-hover:hover{color:rgb(var(--cat-secondary-text-hover, 0, 0, 0)) !important}.cat-link-secondary:active,.cat-text-secondary-hover:active{color:rgb(var(--cat-secondary-text-active, 0, 0, 0)) !important}.cat-bg-secondaryInverted{background-color:#697687 !important;color:black !important}.cat-bg-secondaryInverted-hover{transition:background-color 125ms, color 125ms}.cat-bg-secondaryInverted-hover:hover{background-color:#697687 !important;color:black !important}.cat-text-secondaryInverted,.cat-link-secondaryInverted{color:white !important}.cat-link-secondaryInverted,.cat-text-secondaryInverted-hover{transition:color 125ms}.cat-link-secondaryInverted:hover,.cat-text-secondaryInverted-hover:hover{color:white !important}.cat-link-secondaryInverted:active,.cat-text-secondaryInverted-hover:active{color:white !important}.cat-bg-success{background-color:rgb(var(--cat-success-bg, 0, 132, 88)) !important;color:rgb(var(--cat-success-fill, 255, 255, 255)) !important}.cat-bg-success-hover{transition:background-color 125ms, color 125ms}.cat-bg-success-hover:hover{background-color:rgb(var(--cat-success-bg-hover, 0, 117, 78)) !important;color:rgb(var(--cat-success-fill-hover, 255, 255, 255)) !important}.cat-text-success,.cat-link-success{color:rgb(var(--cat-success-text, 0, 132, 88)) !important}.cat-link-success,.cat-text-success-hover{transition:color 125ms}.cat-link-success:hover,.cat-text-success-hover:hover{color:rgb(var(--cat-success-text-hover, 0, 117, 78)) !important}.cat-link-success:active,.cat-text-success-hover:active{color:rgb(var(--cat-success-text-active, 0, 105, 70)) !important}.cat-bg-warning{background-color:rgb(var(--cat-warning-bg, 255, 206, 128)) !important;color:rgb(var(--cat-warning-fill, 0, 0, 0)) !important}.cat-bg-warning-hover{transition:background-color 125ms, color 125ms}.cat-bg-warning-hover:hover{background-color:rgb(var(--cat-warning-bg-hover, 255, 214, 148)) !important;color:rgb(var(--cat-warning-fill-hover, 0, 0, 0)) !important}.cat-text-warning,.cat-link-warning{color:rgb(var(--cat-warning-text, 159, 97, 0)) !important}.cat-link-warning,.cat-text-warning-hover{transition:color 125ms}.cat-link-warning:hover,.cat-text-warning-hover:hover{color:rgb(var(--cat-warning-text-hover, 159, 97, 0)) !important}.cat-link-warning:active,.cat-text-warning-hover:active{color:rgb(var(--cat-warning-text-active, 159, 97, 0)) !important}.cat-bg-danger{background-color:rgb(var(--cat-danger-bg, 217, 52, 13)) !important;color:rgb(var(--cat-danger-fill, 255, 255, 255)) !important}.cat-bg-danger-hover{transition:background-color 125ms, color 125ms}.cat-bg-danger-hover:hover{background-color:rgb(var(--cat-danger-bg-hover, 194, 46, 11)) !important;color:rgb(var(--cat-danger-fill-hover, 255, 255, 255)) !important}.cat-text-danger,.cat-link-danger{color:rgb(var(--cat-danger-text, 217, 52, 13)) !important}.cat-link-danger,.cat-text-danger-hover{transition:color 125ms}.cat-link-danger:hover,.cat-text-danger-hover:hover{color:rgb(var(--cat-danger-text-hover, 194, 46, 11)) !important}.cat-link-danger:active,.cat-text-danger-hover:active{color:rgb(var(--cat-danger-text-active, 174, 42, 10)) !important}.cat-active{color:rgb(var(--cat-primary-text, 0, 129, 148)) !important}.cat-muted{color:rgb(var(--cat-font-color-muted, 81, 92, 108)) !important}.cat-text-reset{color:inherit !important}.cat-link-reset{color:inherit !important;text-decoration:inherit !important}.label{overflow:hidden;word-wrap:break-word;word-break:break-word}.label-container{flex-basis:var(--label-size, 33.33%)}.label-container .label-wrapper{display:flex;gap:0.25rem}.label-container .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}.label-metadata{display:flex;flex-shrink:0;flex-grow:1;justify-content:space-between;gap:0.25rem}.label-optional{display:flex;align-items:center;max-height:1.25rem;font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 81, 92, 108))}.label-character-count{display:flex;align-items:center;margin-left:auto;max-height:1.25rem;font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 81, 92, 108))}.input-horizontal .label-wrapper,.textarea-horizontal .label-wrapper,.select-horizontal .label-wrapper{flex-direction:column}.input-horizontal label,.textarea-horizontal label,.select-horizontal label{min-height:2.5rem;display:inline-flex;align-items:center}.input-horizontal .label-metadata,.textarea-horizontal .label-metadata,.select-horizontal .label-metadata{justify-content:flex-start}.input-horizontal .label-metadata .label-character-count,.textarea-horizontal .label-metadata .label-character-count,.select-horizontal .label-metadata .label-character-count{margin-left:0}:host{display:flex;flex-direction:column;gap:0.5rem;line-height:1.25rem;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}.select-field,.select-container{display:flex;flex-direction:column;gap:0.5rem;flex:1 1 auto}.select-field.select-horizontal{flex-direction:row;gap:1rem}.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, 81, 92, 108))}.select-wrapper{display:flex;align-items:flex-start;background:white;border-radius:var(--cat-border-radius-m, 0.25rem);box-shadow:inset 0 0 0 1px rgb(var(--border-color));transition:box-shadow 125ms linear;padding:0.25rem;--border-color:var(--cat-border-color-dark, 215, 219, 224);}.select-wrapper:not(.select-disabled):hover{box-shadow:inset 0 0 0 1px rgb(var(--border-color)), 0 0 0 1px rgb(var(--border-color))}.select-wrapper:focus-within{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:-1px}.select-wrapper.select-invalid{--border-color:var(--cat-danger-bg, 217, 52, 13), 0.2}.select-wrapper:has(input:-webkit-autofill),.select-wrapper:has(input:-webkit-autofill):hover,.select-wrapper:has(input:-webkit-autofill):focus{background-color:#e8f0fe}: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:#f2f4f7;cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 81, 92, 108));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{display:inline-block;padding-left:0.5rem}.select-wrapper-inner>cat-avatar+.select-input{padding-left:0.25rem}.select-wrapper-inner cat-avatar{--cat-avatar-size:1.25rem;--cat-avatar-font-size:0.5rem}.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 125ms linear}.select-btn::part(button){outline:none}cat-spinner{padding:0.375rem}.icon-suffix{padding:0.25rem}.select-btn-open{transform:rotate(180deg)}.select-dropdown{position:fixed;right:0;background:white;display:none;overflow:auto;box-shadow:0 4px 6px -2px rgba(27, 31, 38, 0.03), 0 12px 16px -4px rgba(27, 31, 38, 0.08);border-radius:var(--cat-border-radius-m, 0.25rem);border:1px solid rgb(var(--cat-border-color, 235, 236, 240));z-index:calc(var(--cat-z-index, 1000) + 100);width:max-content;top:0;left:0}.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}.select-option-inner cat-avatar{--cat-avatar-size:1.25rem;--cat-avatar-font-size:0.5rem}.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;word-wrap:break-word;word-break:break-word}.select-option-description{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;color:rgb(var(--cat-font-color-muted, 81, 92, 108))}";
8016
+ const catSelectCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column;color:rgb(var(--cat-hint-color, inherit))}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1.125rem;font-weight:var(--cat-font-weight-body, 400);margin:0 !important}.cat-bg-primary{background-color:rgb(var(--cat-primary-bg, 0, 129, 148)) !important;color:rgb(var(--cat-primary-fill, 255, 255, 255)) !important}.cat-bg-primary-hover{transition:background-color 125ms, color 125ms}.cat-bg-primary-hover:hover{background-color:rgb(var(--cat-primary-bg-hover, 1, 115, 132)) !important;color:rgb(var(--cat-primary-fill-hover, 255, 255, 255)) !important}.cat-text-primary,.cat-link-primary{color:rgb(var(--cat-primary-text, 0, 129, 148)) !important}.cat-link-primary,.cat-text-primary-hover{transition:color 125ms}.cat-link-primary:hover,.cat-text-primary-hover:hover{color:rgb(var(--cat-primary-text-hover, 1, 115, 132)) !important}.cat-link-primary:active,.cat-text-primary-hover:active{color:rgb(var(--cat-primary-text-active, 2, 99, 113)) !important}.cat-bg-primaryInverted{background-color:#93b4f2 !important;color:black !important}.cat-bg-primaryInverted-hover{transition:background-color 125ms, color 125ms}.cat-bg-primaryInverted-hover:hover{background-color:#93b4f2 !important;color:black !important}.cat-text-primaryInverted,.cat-link-primaryInverted{color:#93b4f2 !important}.cat-link-primaryInverted,.cat-text-primaryInverted-hover{transition:color 125ms}.cat-link-primaryInverted:hover,.cat-text-primaryInverted-hover:hover{color:#93b4f2 !important}.cat-link-primaryInverted:active,.cat-text-primaryInverted-hover:active{color:#93b4f2 !important}.cat-bg-secondary{background-color:rgb(var(--cat-secondary-bg, 105, 118, 135)) !important;color:rgb(var(--cat-secondary-fill, 255, 255, 255)) !important}.cat-bg-secondary-hover{transition:background-color 125ms, color 125ms}.cat-bg-secondary-hover:hover{background-color:rgb(var(--cat-secondary-bg-hover, 105, 118, 135)) !important;color:rgb(var(--cat-secondary-fill-hover, 255, 255, 255)) !important}.cat-text-secondary,.cat-link-secondary{color:rgb(var(--cat-secondary-text, 0, 0, 0)) !important}.cat-link-secondary,.cat-text-secondary-hover{transition:color 125ms}.cat-link-secondary:hover,.cat-text-secondary-hover:hover{color:rgb(var(--cat-secondary-text-hover, 0, 0, 0)) !important}.cat-link-secondary:active,.cat-text-secondary-hover:active{color:rgb(var(--cat-secondary-text-active, 0, 0, 0)) !important}.cat-bg-secondaryInverted{background-color:#697687 !important;color:black !important}.cat-bg-secondaryInverted-hover{transition:background-color 125ms, color 125ms}.cat-bg-secondaryInverted-hover:hover{background-color:#697687 !important;color:black !important}.cat-text-secondaryInverted,.cat-link-secondaryInverted{color:white !important}.cat-link-secondaryInverted,.cat-text-secondaryInverted-hover{transition:color 125ms}.cat-link-secondaryInverted:hover,.cat-text-secondaryInverted-hover:hover{color:white !important}.cat-link-secondaryInverted:active,.cat-text-secondaryInverted-hover:active{color:white !important}.cat-bg-success{background-color:rgb(var(--cat-success-bg, 0, 132, 88)) !important;color:rgb(var(--cat-success-fill, 255, 255, 255)) !important}.cat-bg-success-hover{transition:background-color 125ms, color 125ms}.cat-bg-success-hover:hover{background-color:rgb(var(--cat-success-bg-hover, 0, 117, 78)) !important;color:rgb(var(--cat-success-fill-hover, 255, 255, 255)) !important}.cat-text-success,.cat-link-success{color:rgb(var(--cat-success-text, 0, 132, 88)) !important}.cat-link-success,.cat-text-success-hover{transition:color 125ms}.cat-link-success:hover,.cat-text-success-hover:hover{color:rgb(var(--cat-success-text-hover, 0, 117, 78)) !important}.cat-link-success:active,.cat-text-success-hover:active{color:rgb(var(--cat-success-text-active, 0, 105, 70)) !important}.cat-bg-warning{background-color:rgb(var(--cat-warning-bg, 255, 206, 128)) !important;color:rgb(var(--cat-warning-fill, 0, 0, 0)) !important}.cat-bg-warning-hover{transition:background-color 125ms, color 125ms}.cat-bg-warning-hover:hover{background-color:rgb(var(--cat-warning-bg-hover, 255, 214, 148)) !important;color:rgb(var(--cat-warning-fill-hover, 0, 0, 0)) !important}.cat-text-warning,.cat-link-warning{color:rgb(var(--cat-warning-text, 159, 97, 0)) !important}.cat-link-warning,.cat-text-warning-hover{transition:color 125ms}.cat-link-warning:hover,.cat-text-warning-hover:hover{color:rgb(var(--cat-warning-text-hover, 159, 97, 0)) !important}.cat-link-warning:active,.cat-text-warning-hover:active{color:rgb(var(--cat-warning-text-active, 159, 97, 0)) !important}.cat-bg-danger{background-color:rgb(var(--cat-danger-bg, 217, 52, 13)) !important;color:rgb(var(--cat-danger-fill, 255, 255, 255)) !important}.cat-bg-danger-hover{transition:background-color 125ms, color 125ms}.cat-bg-danger-hover:hover{background-color:rgb(var(--cat-danger-bg-hover, 194, 46, 11)) !important;color:rgb(var(--cat-danger-fill-hover, 255, 255, 255)) !important}.cat-text-danger,.cat-link-danger{color:rgb(var(--cat-danger-text, 217, 52, 13)) !important}.cat-link-danger,.cat-text-danger-hover{transition:color 125ms}.cat-link-danger:hover,.cat-text-danger-hover:hover{color:rgb(var(--cat-danger-text-hover, 194, 46, 11)) !important}.cat-link-danger:active,.cat-text-danger-hover:active{color:rgb(var(--cat-danger-text-active, 174, 42, 10)) !important}.cat-active{color:rgb(var(--cat-primary-text, 0, 129, 148)) !important}.cat-muted{color:rgb(var(--cat-font-color-muted, 81, 92, 108)) !important}.cat-text-reset{color:inherit !important}.cat-link-reset{color:inherit !important;text-decoration:inherit !important}.label{overflow:hidden;word-wrap:break-word;word-break:break-word}.input-field:not(.input-horizontal) .label-container.hidden,.textarea-field:not(.textarea-horizontal) .label-container.hidden,.select-field:not(.select-horizontal) .label-container.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}.label-container{flex-basis:var(--label-size, 33.33%)}.label-container .label-wrapper{display:flex;gap:0.25rem}.label-metadata{display:flex;flex-shrink:0;flex-grow:1;justify-content:space-between;gap:0.25rem}.label-optional{display:flex;align-items:center;max-height:1.25rem;font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 81, 92, 108))}.label-character-count{display:flex;align-items:center;margin-left:auto;max-height:1.25rem;font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 81, 92, 108))}.input-horizontal .label-container.hidden label,.textarea-horizontal .label-container.hidden label,.select-horizontal .label-container.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}.input-horizontal .label-wrapper,.textarea-horizontal .label-wrapper,.select-horizontal .label-wrapper{flex-direction:column}.input-horizontal label,.textarea-horizontal label,.select-horizontal label{min-height:2.5rem;display:inline-flex;align-items:center}.input-horizontal .label-metadata,.textarea-horizontal .label-metadata,.select-horizontal .label-metadata{justify-content:flex-start}.input-horizontal .label-metadata .label-character-count,.textarea-horizontal .label-metadata .label-character-count,.select-horizontal .label-metadata .label-character-count{margin-left:0}:host{display:flex;flex-direction:column;gap:0.5rem;line-height:1.25rem;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}.select-field,.select-container{display:flex;flex-direction:column;gap:0.5rem;flex:1 1 auto}.select-field.select-horizontal{flex-direction:row;gap:1rem}.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, 81, 92, 108))}.select-wrapper{display:flex;align-items:flex-start;background:white;border-radius:var(--cat-border-radius-m, 0.25rem);box-shadow:inset 0 0 0 1px rgb(var(--border-color));transition:box-shadow 125ms linear;padding:0.25rem;--border-color:var(--cat-border-color-dark, 215, 219, 224);}.select-wrapper:not(.select-disabled):hover{box-shadow:inset 0 0 0 1px rgb(var(--border-color)), 0 0 0 1px rgb(var(--border-color))}.select-wrapper:focus-within{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:-1px}.select-wrapper.select-invalid{--border-color:var(--cat-danger-bg, 217, 52, 13), 0.2}.select-wrapper:has(input:-webkit-autofill),.select-wrapper:has(input:-webkit-autofill):hover,.select-wrapper:has(input:-webkit-autofill):focus{background-color:#e8f0fe}: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:#f2f4f7;cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 81, 92, 108));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{display:inline-block;padding-left:0.5rem}.select-wrapper-inner>cat-avatar+.select-input{padding-left:0.25rem}.select-wrapper-inner cat-avatar{--cat-avatar-size:1.25rem;--cat-avatar-font-size:0.5rem}.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 125ms linear}.select-btn::part(button){outline:none}cat-spinner{padding:0.375rem}.icon-suffix{padding:0.25rem}.select-btn-open{transform:rotate(180deg)}.select-dropdown{position:fixed;right:0;background:white;display:none;overflow:auto;box-shadow:0 4px 6px -2px rgba(27, 31, 38, 0.03), 0 12px 16px -4px rgba(27, 31, 38, 0.08);border-radius:var(--cat-border-radius-m, 0.25rem);border:1px solid rgb(var(--cat-border-color, 235, 236, 240));z-index:calc(var(--cat-z-index, 1000) + 100);width:max-content;top:0;left:0}.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}.select-option-inner cat-avatar{--cat-avatar-size:1.25rem;--cat-avatar-font-size:0.5rem}.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;word-wrap:break-word;word-break:break-word}.select-option-description{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;color:rgb(var(--cat-font-color-muted, 81, 92, 108))}";
7752
8017
 
7753
8018
  const INIT_STATE = {
7754
8019
  term: '',
@@ -7895,14 +8160,25 @@ const CatSelect = class {
7895
8160
  }
7896
8161
  this.hide();
7897
8162
  // Conditionally remove selection if the option was not manually selected through click or enter key press
7898
- if (!this.multiple && (!this.tags || !this.state.selection?.length) && this.state.tempSelection?.length) {
7899
- this.patchState({
7900
- activeSelectionIndex: -1,
7901
- selection: this.state.tempSelection,
7902
- tempSelection: [],
7903
- options: [],
7904
- term: this.state.tempSelection[0].render.label
7905
- });
8163
+ if (!this.multiple && (!this.tags || !this.state.selection?.length)) {
8164
+ if (this.state.tempSelection?.length) {
8165
+ this.patchState({
8166
+ activeSelectionIndex: -1,
8167
+ selection: this.state.tempSelection,
8168
+ tempSelection: [],
8169
+ options: [],
8170
+ term: this.state.tempSelection[0].render.label
8171
+ });
8172
+ }
8173
+ else if (!this.state.selection?.length) {
8174
+ this.patchState({
8175
+ activeSelectionIndex: -1,
8176
+ selection: [],
8177
+ tempSelection: [],
8178
+ options: [],
8179
+ term: ''
8180
+ });
8181
+ }
7906
8182
  }
7907
8183
  else {
7908
8184
  this.patchState({ activeSelectionIndex: -1 });
@@ -8032,17 +8308,14 @@ const CatSelect = class {
8032
8308
  return (h(Host, null, h("div", { class: {
8033
8309
  'select-field': true,
8034
8310
  'select-horizontal': this.horizontal
8035
- } }, h("div", { class: "label-container" }, (this.hasSlottedLabel || this.label) && (h("label", { htmlFor: this.id, class: { hidden: this.labelHidden } }, h("span", { class: "label-wrapper", part: "label" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label, h("div", { class: "label-metadata" }, !this.required && this.requiredMarker.startsWith('optional') && (h("span", { class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker.startsWith('required') && (h("span", { class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.required'), ")"))))))), h("div", { class: "select-container" }, h("div", { class: { 'select-wrapper': true, 'select-disabled': this.disabled, 'select-invalid': this.invalid }, ref: el => (this.trigger = el), id: this.id, role: "combobox", "aria-expanded": this.state.isOpen || this.isPillboxActive(), "aria-controls": this.isPillboxActive() ? `select-pillbox-${this.id}` : `select-listbox-${this.id}`, "aria-required": this.required ? 'true' : false, "aria-activedescendant": this.activeDescendant, onClick: e => this.onClick(e) }, h("div", { class: "select-wrapper-inner" }, this.multiple && this.state.selection.length ? (h("div", { id: `select-pillbox-${this.id}`, role: "listbox", "aria-orientation": "horizontal", class: "select-pills" }, this.state.selection.map((item, i) => (h("span", { class: {
8311
+ } }, h("div", { class: { 'label-container': true, hidden: this.labelHidden } }, (this.hasSlottedLabel || this.label) && (h("label", { htmlFor: this.id }, h("span", { class: "label-wrapper", part: "label" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label, h("div", { class: "label-metadata" }, !this.required && this.requiredMarker.startsWith('optional') && (h("span", { class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker.startsWith('required') && (h("span", { class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.required'), ")"))))))), h("div", { class: "select-container" }, h("div", { class: { 'select-wrapper': true, 'select-disabled': this.disabled, 'select-invalid': this.invalid }, ref: el => (this.trigger = el), id: this.id, role: "combobox", "aria-expanded": this.state.isOpen || this.isPillboxActive(), "aria-controls": this.isPillboxActive() ? `select-pillbox-${this.id}` : `select-listbox-${this.id}`, "aria-required": this.required ? 'true' : false, "aria-activedescendant": this.activeDescendant, onClick: e => this.onClick(e) }, h("div", { class: "select-wrapper-inner" }, this.multiple && this.state.selection.length ? (h("div", { id: `select-pillbox-${this.id}`, role: "listbox", "aria-orientation": "horizontal", class: "select-pills" }, this.state.selection.map((item, i) => (h("span", { class: {
8036
8312
  pill: true,
8037
8313
  'select-no-open': true,
8038
8314
  'select-option-active': this.state.activeSelectionIndex === i
8039
- }, role: "option", "aria-selected": "true", id: `select-${this.id}-selection-${i}` }, item.render.avatar ? (h("cat-avatar", { label: item.render.label, round: item.render.avatar.round, src: item.render.avatar.src, icon: item.render.avatar.icon, initials: item.render.avatar.initials ?? '' })) : null, h("span", null, item.render.label), !this.disabled && (h("cat-button", { size: "xs", variant: "text", icon: "$cat:select-clear", iconOnly: true, a11yLabel: catI18nRegistry.t('select.deselect'), onClick: () => this.deselect(item.item.id), tabIndex: -1, onCatClick: event => event.stopPropagation() }))))))) : this.state.selection.length && this.state.selection[0].render.avatar ? (h("cat-avatar", { label: this.state.selection[0].render.label, round: this.state.selection[0].render.avatar.round, src: this.state.selection[0].render.avatar.src, icon: this.state.selection[0].render.avatar.icon, initials: this.state.selection[0].render.avatar.initials ?? '' })) : null, h("input", { ...this.nativeAttributes, class: "select-input", ref: el => (this.input = el), "aria-controls": this.isPillboxActive() ? `select-pillbox-${this.id}` : `select-listbox-${this.id}`, "aria-activedescendant": this.activeDescendant, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.hint?.length ? this.id + '-hint' : undefined, onInput: this.onInput.bind(this), value: !this.multiple ? this.state.term : undefined, placeholder: this.placeholder, disabled: this.disabled || this.state.isResolving })), this.state.isResolving && h("cat-spinner", null), this.invalid && (h("cat-icon", { icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l" })), (this.state.selection.length || this.state.term.length) &&
8315
+ }, role: "option", "aria-selected": "true", id: `select-${this.id}-selection-${i}` }, item.render.avatar ? (h("cat-avatar", { label: item.render.label, round: item.render.avatar.round, src: item.render.avatar.src, icon: item.render.avatar.icon, initials: item.render.avatar.initials ?? '' })) : null, h("span", null, item.render.label), !this.disabled && (h("cat-button", { size: "xs", variant: "text", icon: "$cat:select-clear", iconOnly: true, a11yLabel: catI18nRegistry.t('select.deselect'), onClick: () => this.deselect(item.item.id), tabIndex: -1, "data-dropdown-no-close": true }))))))) : this.state.selection.length && this.state.selection[0].render.avatar ? (h("cat-avatar", { label: this.state.selection[0].render.label, round: this.state.selection[0].render.avatar.round, src: this.state.selection[0].render.avatar.src, icon: this.state.selection[0].render.avatar.icon, initials: this.state.selection[0].render.avatar.initials ?? '' })) : null, h("input", { ...this.nativeAttributes, class: "select-input", ref: el => (this.input = el), "aria-controls": this.isPillboxActive() ? `select-pillbox-${this.id}` : `select-listbox-${this.id}`, "aria-activedescendant": this.activeDescendant, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.hint?.length ? this.id + '-hint' : undefined, onInput: this.onInput.bind(this), value: !this.multiple ? this.state.term : undefined, placeholder: this.placeholder, disabled: this.disabled || this.state.isResolving })), this.state.isResolving && h("cat-spinner", null), this.invalid && (h("cat-icon", { icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l" })), (this.state.selection.length || this.state.term.length) &&
8040
8316
  !this.disabled &&
8041
8317
  !this.state.isResolving &&
8042
- this.clearable ? (h("cat-button", { id: `select-clear-btn-${this.id}`, iconOnly: true, icon: "$cat:input-close", variant: "text", size: "s", a11yLabel: catI18nRegistry.t('input.clear'), onCatClick: event => {
8043
- event.stopPropagation();
8044
- this.clear();
8045
- } })) : null, !this.state.isResolving && (h("cat-button", { iconOnly: true, icon: "$cat:select-open", class: { 'select-btn': true, 'select-btn-open': this.state.isOpen }, variant: "text", size: "s", a11yLabel: this.state.isOpen ? catI18nRegistry.t('select.close') : catI18nRegistry.t('select.open'), "aria-controls": `select-listbox-${this.id}`, "aria-expanded": this.state.isOpen, tabIndex: -1, disabled: this.disabled || this.state.isResolving, onCatClick: event => event.stopPropagation() }))), (this.hint || this.hasSlottedHint || !!Object.keys(this.errorMap || {}).length) && (h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }), errorMap: this.errorMap })))), h("div", { class: "select-dropdown", ref: el => (this.dropdown = el), style: { display: this.state.isOpen ? 'block' : undefined } }, this.state.isOpen && (h("cat-scrollable", { class: "select-options-wrapper", scrolledBuffer: 56, noOverflowX: true, noOverscroll: true, noScrolledInit: true, onScrolledBottom: () => this.more$.next() }, h("ul", { class: "select-options", role: "listbox", "aria-multiselectable": this.multiple, "aria-setsize": this.state.totalElements, id: `select-listbox-${this.id}` }, this.optionsList, this.state.isLoading
8318
+ this.clearable ? (h("cat-button", { id: `select-clear-btn-${this.id}`, iconOnly: true, icon: "$cat:input-close", variant: "text", size: "s", a11yLabel: catI18nRegistry.t('input.clear'), onCatClick: () => this.clear(), "data-dropdown-no-close": true })) : null, !this.state.isResolving && (h("cat-button", { iconOnly: true, icon: "$cat:select-open", class: { 'select-btn': true, 'select-btn-open': this.state.isOpen }, variant: "text", size: "s", a11yLabel: this.state.isOpen ? catI18nRegistry.t('select.close') : catI18nRegistry.t('select.open'), "aria-controls": `select-listbox-${this.id}`, "aria-expanded": this.state.isOpen, tabIndex: -1, disabled: this.disabled || this.state.isResolving, "data-dropdown-no-close": true }))), (this.hint || this.hasSlottedHint || !!Object.keys(this.errorMap || {}).length) && (h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }), errorMap: this.errorMap })))), h("div", { class: "select-dropdown", ref: el => (this.dropdown = el), style: { display: this.state.isOpen ? 'block' : undefined } }, this.state.isOpen && (h("cat-scrollable", { class: "select-options-wrapper", scrolledBuffer: 56, noOverflowX: true, noOverscroll: true, noScrolledInit: true, onScrolledBottom: () => this.more$.next() }, h("ul", { class: "select-options", role: "listbox", "aria-multiselectable": this.multiple, "aria-setsize": this.state.totalElements, id: `select-listbox-${this.id}` }, this.optionsList, this.state.isLoading
8046
8319
  ? Array.from(Array(CatSelect.SKELETON_COUNT)).map(() => (h("li", { class: "select-option-loading" }, h("cat-skeleton", { variant: "body", lines: 1 }), h("cat-skeleton", { variant: "body", lines: 1 }))))
8047
8320
  : !this.state.options.length &&
8048
8321
  !this.tags && (h("li", { class: "select-option-empty" }, this.noItems ? this.noItems : catI18nRegistry.t('select.empty')))))))));
@@ -8136,7 +8409,7 @@ const CatSelect = class {
8136
8409
  newSelection = [item];
8137
8410
  this.search(item.render.label);
8138
8411
  }
8139
- this.patchState({ selection: newSelection });
8412
+ this.patchState({ selection: newSelection, tempSelection: [] });
8140
8413
  if (this.multiple && this.state.term.trim() && this.input) {
8141
8414
  this.patchState({ term: '', activeOptionIndex: -1 });
8142
8415
  this.term$.next('');
@@ -8162,7 +8435,7 @@ const CatSelect = class {
8162
8435
  }
8163
8436
  clear() {
8164
8437
  if (this.input && this.state.term) {
8165
- this.patchState({ selection: [], options: [], term: '', activeOptionIndex: -1, tempSelection: [] });
8438
+ this.patchState({ selection: [], term: '', activeOptionIndex: -1, tempSelection: [] });
8166
8439
  this.term$.next('');
8167
8440
  this.input.value = '';
8168
8441
  }
@@ -8528,7 +8801,7 @@ const CatSelectTest = class {
8528
8801
  setTimeout(() => this.multipleSelect && (this.multipleSelect.value = []), 5000);
8529
8802
  }
8530
8803
  render() {
8531
- return (h(Host, { style: { display: 'flex', flexDirection: 'column' } }, h("cat-select", { label: "Multiple Select", hint: "This is a hint!", ref: el => (this.multipleSelect = el), value: ['1'], placeholder: "Hello World", onCatChange: () => console.log('Multiple change', this.multipleSelect?.value), onCatBlur: e => console.log('Multiple blur', e), multiple: true, noItems: "No results", clearable: true, errorUpdate: false }, h("span", { slot: "hint" }, "Searching for \"no\" -", '>', " no options are returned!")), h("cat-select", { label: "Multiple with img", ref: el => (this.multipleSelectAvatar = el), value: ['1'], placeholder: "Hello World", multiple: true, clearable: true, errorUpdate: false }), h("cat-select", { label: "Multiple with initials", ref: el => (this.multipleSelectAvatarInitials = el), value: ['1'], placeholder: "Hello World", multiple: true, clearable: true, errorUpdate: false }), h("cat-select", { label: "Multiple with tagging support", hint: "This is a hint!", ref: el => (this.multipleSelectTagging = el), value: { ids: ['1'], tags: ['Test', 'Albania', 'Algeria'] }, placeholder: "Select country", onCatChange: () => console.log('Multiple tagging change', this.multipleSelectTagging?.value), multiple: true, tags: true, clearable: true, errorUpdate: false }), h("cat-select", { label: "Single Select", hint: "This is a hint!", ref: el => (this.singleSelect = el), placeholder: "Search for a country or capital", onCatBlur: e => console.log('Single blur', e), clearable: true, errorUpdate: false }), h("cat-select", { label: "Single with img", ref: el => (this.singleSelectAvatar = el), value: '1', placeholder: "Search for a country or capital", clearable: true, errorUpdate: false }), h("cat-select", { label: "Single with initials", ref: el => (this.singleSelectAvatarInitials = el), placeholder: "Hello World", clearable: true, errorUpdate: false }), h("cat-dropdown", { overflow: true, noAutoClose: true }, h("cat-button", { slot: "trigger", style: { width: '50%' } }, "Open select"), h("div", { slot: "content", style: { width: '400px' } }, h("cat-select", { label: "Single with tagging support", ref: el => (this.singleSelectTagging = el), value: { id: '', tag: 'Albania' }, placeholder: "Search for a country or capital", onCatChange: () => console.log('Single change', this.singleSelectTagging?.value), tagHint: "new country", tags: true, clearable: true, errorUpdate: false, style: { width: '90%' } })))));
8804
+ return (h(Host, { style: { display: 'flex', flexDirection: 'column' } }, h("cat-select", { label: "Multiple Select", hint: "This is a hint!", ref: el => (this.multipleSelect = el), value: ['1'], placeholder: "Hello World", onCatChange: () => console.log('Multiple change', this.multipleSelect?.value), onCatBlur: e => console.log('Multiple blur', e), multiple: true, noItems: "No results", clearable: true, errorUpdate: false }, h("span", { slot: "hint" }, "Searching for \"no\" -", '>', " no options are returned!")), h("cat-select", { label: "Multiple with img", ref: el => (this.multipleSelectAvatar = el), value: ['1'], placeholder: "Hello World", multiple: true, clearable: true, errorUpdate: false }), h("cat-select", { label: "Multiple with initials", ref: el => (this.multipleSelectAvatarInitials = el), value: ['1'], placeholder: "Hello World", multiple: true, clearable: true, errorUpdate: false }), h("cat-select", { label: "Multiple with tagging support", hint: "This is a hint!", ref: el => (this.multipleSelectTagging = el), value: { ids: ['1'], tags: ['Test', 'Albania', 'Algeria'] }, placeholder: "Select country", onCatChange: () => console.log('Multiple tagging change', this.multipleSelectTagging?.value), multiple: true, tags: true, clearable: true, errorUpdate: false }), h("cat-select", { label: "Single Select", hint: "This is a hint!", ref: el => (this.singleSelect = el), placeholder: "Search for a country or capital", onCatBlur: e => console.log('Single blur', e), clearable: true, errorUpdate: false }), h("cat-select", { label: "Single with img", ref: el => (this.singleSelectAvatar = el), value: '1', placeholder: "Search for a country or capital", clearable: true, errorUpdate: false }), h("cat-select", { label: "Single with initials", ref: el => (this.singleSelectAvatarInitials = el), placeholder: "Hello World", clearable: true, errorUpdate: false }), h("cat-dropdown", { overflow: true }, h("cat-button", { slot: "trigger", style: { width: '50%' } }, "Open select"), h("div", { slot: "content", style: { width: '400px' } }, h("cat-select", { label: "Single with tagging support", ref: el => (this.singleSelectTagging = el), value: { id: '', tag: 'Albania' }, placeholder: "Search for a country or capital", onCatChange: () => console.log('Single change', this.singleSelectTagging?.value), tagHint: "new country", tags: true, clearable: true, errorUpdate: false, style: { width: '90%' } })))));
8532
8805
  }
8533
8806
  get countryConnector() {
8534
8807
  return {
@@ -9860,7 +10133,7 @@ const CatTab = class {
9860
10133
  };
9861
10134
  CatTab.style = catTabCss;
9862
10135
 
9863
- 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}.cat-tab{display:inline-flex;flex-direction:column;align-items:center;justify-content:space-between;position:relative;transition:none}.cat-tab::after{opacity:0;content:\"\";position:absolute;background:currentColor;left:0.75rem;right:0.75rem;bottom:0;height:2px}.cat-tab:hover::after{opacity:0.25}.cat-tab.cat-tab-active{font-weight:700;color:rgb(var(--cat-primary-text-active, 2, 99, 113))}.cat-tab.cat-tab-active::after{opacity:1}";
10136
+ const catTabsCss = ":host{display:flex;flex-direction:row;box-shadow:inset 0 -1px 0 0 rgb(var(--cat-border-color, 235, 236, 240))}: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}.cat-tab{display:inline-flex;flex-direction:column;align-items:center;justify-content:space-between;position:relative;transition:none}.cat-tab:first-of-type{margin-left:-0.75rem}.cat-tab:last-of-type{margin-right:-0.75rem}.cat-tab::after{opacity:0;content:\"\";position:absolute;background:currentColor;left:0.75rem;right:0.75rem;bottom:0;height:2px}.cat-tab:hover::after{opacity:0.25}.cat-tab.cat-tab-active{font-weight:700;color:rgb(var(--cat-primary-text-active, 2, 99, 113))}.cat-tab.cat-tab-active::after{opacity:1}";
9864
10137
 
9865
10138
  const CatTabs = class {
9866
10139
  constructor(hostRef) {
@@ -9908,7 +10181,7 @@ const CatTabs = class {
9908
10181
  return (h("cat-button", { ref: el => el && this.updateButtonsRef(el), buttonId: tab.id, role: "tab", part: "tab", class: {
9909
10182
  'cat-tab': true,
9910
10183
  'cat-tab-active': Boolean(this.activeTabId && tab.id === this.activeTabId)
9911
- }, active: Boolean(this.activeTabId && tab.id === this.activeTabId), color: this.activeTabId && tab.id === this.activeTabId ? 'primary' : 'secondary', variant: "text", icon: tab.icon, iconOnly: tab.iconOnly, iconRight: tab.iconRight, url: tab.url, disabled: tab.deactivated, urlTarget: tab.urlTarget, onCatClick: () => (this.activeTabId = tab.id), nativeAttributes: { ...tab.nativeAttributes }, nativeContentAttributes: { 'data-text': tab.label } }, tab.label));
10184
+ }, active: Boolean(this.activeTabId && tab.id === this.activeTabId), color: this.activeTabId && tab.id === this.activeTabId ? 'primary' : 'secondary', variant: "text", icon: tab.icon, iconOnly: tab.iconOnly, iconRight: tab.iconRight, url: tab.url, disabled: tab.deactivated, urlTarget: tab.urlTarget, onCatClick: () => (this.activeTabId = tab.id), nativeAttributes: { ...tab.nativeAttributes }, nativeContentAttributes: { 'data-text': tab.label }, "data-dropdown-no-close": true }, tab.label));
9912
10185
  })));
9913
10186
  }
9914
10187
  updateButtonsRef(button) {
@@ -9932,7 +10205,7 @@ CatTabs.style = catTabsCss;
9932
10205
 
9933
10206
  var e=new Map;function t(t){var o=e.get(t);o&&o.destroy();}function o(t){var o=e.get(t);o&&o.update();}var r=null;"undefined"==typeof window?((r=function(e){return e}).destroy=function(e){return e},r.update=function(e){return e}):((r=function(t,o){return t&&Array.prototype.forEach.call(t.length?t:[t],function(t){return function(t){if(t&&t.nodeName&&"TEXTAREA"===t.nodeName&&!e.has(t)){var o,r=null,n=window.getComputedStyle(t),i=(o=t.value,function(){a({testForHeightReduction:""===o||!t.value.startsWith(o),restoreTextAlign:null}),o=t.value;}),l=function(o){t.removeEventListener("autosize:destroy",l),t.removeEventListener("autosize:update",s),t.removeEventListener("input",i),window.removeEventListener("resize",s),Object.keys(o).forEach(function(e){return t.style[e]=o[e]}),e.delete(t);}.bind(t,{height:t.style.height,resize:t.style.resize,textAlign:t.style.textAlign,overflowY:t.style.overflowY,overflowX:t.style.overflowX,wordWrap:t.style.wordWrap});t.addEventListener("autosize:destroy",l),t.addEventListener("autosize:update",s),t.addEventListener("input",i),window.addEventListener("resize",s),t.style.overflowX="hidden",t.style.wordWrap="break-word",e.set(t,{destroy:l,update:s}),s();}function a(e){var o,i,l=e.restoreTextAlign,s=void 0===l?null:l,d=e.testForHeightReduction,u=void 0===d||d,c=n.overflowY;if(0!==t.scrollHeight&&("vertical"===n.resize?t.style.resize="none":"both"===n.resize&&(t.style.resize="horizontal"),u&&(o=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push([e.parentNode,e.parentNode.scrollTop]),e=e.parentNode;return function(){return t.forEach(function(e){var t=e[0],o=e[1];t.style.scrollBehavior="auto",t.scrollTop=o,t.style.scrollBehavior=null;})}}(t),t.style.height=""),i="content-box"===n.boxSizing?t.scrollHeight-(parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)):t.scrollHeight+parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth),"none"!==n.maxHeight&&i>parseFloat(n.maxHeight)?("hidden"===n.overflowY&&(t.style.overflow="scroll"),i=parseFloat(n.maxHeight)):"hidden"!==n.overflowY&&(t.style.overflow="hidden"),t.style.height=i+"px",s&&(t.style.textAlign=s),o&&o(),r!==i&&(t.dispatchEvent(new Event("autosize:resized",{bubbles:!0})),r=i),c!==n.overflow&&!s)){var v=n.textAlign;"hidden"===n.overflow&&(t.style.textAlign="start"===v?"end":"start"),a({restoreTextAlign:v,testForHeightReduction:!0});}}function s(){a({testForHeightReduction:!0,restoreTextAlign:null});}}(t)}),t}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],t),e},r.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],o),e});var n=r;
9934
10207
 
9935
- const catTextareaCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column;color:rgb(var(--cat-hint-color, inherit))}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1.125rem;font-weight:var(--cat-font-weight-body, 400);margin:0 !important}.cat-bg-primary{background-color:rgb(var(--cat-primary-bg, 0, 129, 148)) !important;color:rgb(var(--cat-primary-fill, 255, 255, 255)) !important}.cat-bg-primary-hover{transition:background-color 125ms, color 125ms}.cat-bg-primary-hover:hover{background-color:rgb(var(--cat-primary-bg-hover, 1, 115, 132)) !important;color:rgb(var(--cat-primary-fill-hover, 255, 255, 255)) !important}.cat-text-primary,.cat-link-primary{color:rgb(var(--cat-primary-text, 0, 129, 148)) !important}.cat-link-primary,.cat-text-primary-hover{transition:color 125ms}.cat-link-primary:hover,.cat-text-primary-hover:hover{color:rgb(var(--cat-primary-text-hover, 1, 115, 132)) !important}.cat-link-primary:active,.cat-text-primary-hover:active{color:rgb(var(--cat-primary-text-active, 2, 99, 113)) !important}.cat-bg-primaryInverted{background-color:#93b4f2 !important;color:black !important}.cat-bg-primaryInverted-hover{transition:background-color 125ms, color 125ms}.cat-bg-primaryInverted-hover:hover{background-color:#93b4f2 !important;color:black !important}.cat-text-primaryInverted,.cat-link-primaryInverted{color:#93b4f2 !important}.cat-link-primaryInverted,.cat-text-primaryInverted-hover{transition:color 125ms}.cat-link-primaryInverted:hover,.cat-text-primaryInverted-hover:hover{color:#93b4f2 !important}.cat-link-primaryInverted:active,.cat-text-primaryInverted-hover:active{color:#93b4f2 !important}.cat-bg-secondary{background-color:rgb(var(--cat-secondary-bg, 105, 118, 135)) !important;color:rgb(var(--cat-secondary-fill, 255, 255, 255)) !important}.cat-bg-secondary-hover{transition:background-color 125ms, color 125ms}.cat-bg-secondary-hover:hover{background-color:rgb(var(--cat-secondary-bg-hover, 105, 118, 135)) !important;color:rgb(var(--cat-secondary-fill-hover, 255, 255, 255)) !important}.cat-text-secondary,.cat-link-secondary{color:rgb(var(--cat-secondary-text, 0, 0, 0)) !important}.cat-link-secondary,.cat-text-secondary-hover{transition:color 125ms}.cat-link-secondary:hover,.cat-text-secondary-hover:hover{color:rgb(var(--cat-secondary-text-hover, 0, 0, 0)) !important}.cat-link-secondary:active,.cat-text-secondary-hover:active{color:rgb(var(--cat-secondary-text-active, 0, 0, 0)) !important}.cat-bg-secondaryInverted{background-color:#697687 !important;color:black !important}.cat-bg-secondaryInverted-hover{transition:background-color 125ms, color 125ms}.cat-bg-secondaryInverted-hover:hover{background-color:#697687 !important;color:black !important}.cat-text-secondaryInverted,.cat-link-secondaryInverted{color:white !important}.cat-link-secondaryInverted,.cat-text-secondaryInverted-hover{transition:color 125ms}.cat-link-secondaryInverted:hover,.cat-text-secondaryInverted-hover:hover{color:white !important}.cat-link-secondaryInverted:active,.cat-text-secondaryInverted-hover:active{color:white !important}.cat-bg-success{background-color:rgb(var(--cat-success-bg, 0, 132, 88)) !important;color:rgb(var(--cat-success-fill, 255, 255, 255)) !important}.cat-bg-success-hover{transition:background-color 125ms, color 125ms}.cat-bg-success-hover:hover{background-color:rgb(var(--cat-success-bg-hover, 0, 117, 78)) !important;color:rgb(var(--cat-success-fill-hover, 255, 255, 255)) !important}.cat-text-success,.cat-link-success{color:rgb(var(--cat-success-text, 0, 132, 88)) !important}.cat-link-success,.cat-text-success-hover{transition:color 125ms}.cat-link-success:hover,.cat-text-success-hover:hover{color:rgb(var(--cat-success-text-hover, 0, 117, 78)) !important}.cat-link-success:active,.cat-text-success-hover:active{color:rgb(var(--cat-success-text-active, 0, 105, 70)) !important}.cat-bg-warning{background-color:rgb(var(--cat-warning-bg, 255, 206, 128)) !important;color:rgb(var(--cat-warning-fill, 0, 0, 0)) !important}.cat-bg-warning-hover{transition:background-color 125ms, color 125ms}.cat-bg-warning-hover:hover{background-color:rgb(var(--cat-warning-bg-hover, 255, 214, 148)) !important;color:rgb(var(--cat-warning-fill-hover, 0, 0, 0)) !important}.cat-text-warning,.cat-link-warning{color:rgb(var(--cat-warning-text, 159, 97, 0)) !important}.cat-link-warning,.cat-text-warning-hover{transition:color 125ms}.cat-link-warning:hover,.cat-text-warning-hover:hover{color:rgb(var(--cat-warning-text-hover, 159, 97, 0)) !important}.cat-link-warning:active,.cat-text-warning-hover:active{color:rgb(var(--cat-warning-text-active, 159, 97, 0)) !important}.cat-bg-danger{background-color:rgb(var(--cat-danger-bg, 217, 52, 13)) !important;color:rgb(var(--cat-danger-fill, 255, 255, 255)) !important}.cat-bg-danger-hover{transition:background-color 125ms, color 125ms}.cat-bg-danger-hover:hover{background-color:rgb(var(--cat-danger-bg-hover, 194, 46, 11)) !important;color:rgb(var(--cat-danger-fill-hover, 255, 255, 255)) !important}.cat-text-danger,.cat-link-danger{color:rgb(var(--cat-danger-text, 217, 52, 13)) !important}.cat-link-danger,.cat-text-danger-hover{transition:color 125ms}.cat-link-danger:hover,.cat-text-danger-hover:hover{color:rgb(var(--cat-danger-text-hover, 194, 46, 11)) !important}.cat-link-danger:active,.cat-text-danger-hover:active{color:rgb(var(--cat-danger-text-active, 174, 42, 10)) !important}.cat-active{color:rgb(var(--cat-primary-text, 0, 129, 148)) !important}.cat-muted{color:rgb(var(--cat-font-color-muted, 81, 92, 108)) !important}.cat-text-reset{color:inherit !important}.cat-link-reset{color:inherit !important;text-decoration:inherit !important}.label{overflow:hidden;word-wrap:break-word;word-break:break-word}.label-container{flex-basis:var(--label-size, 33.33%)}.label-container .label-wrapper{display:flex;gap:0.25rem}.label-container .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}.label-metadata{display:flex;flex-shrink:0;flex-grow:1;justify-content:space-between;gap:0.25rem}.label-optional{display:flex;align-items:center;max-height:1.25rem;font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 81, 92, 108))}.label-character-count{display:flex;align-items:center;margin-left:auto;max-height:1.25rem;font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 81, 92, 108))}.input-horizontal .label-wrapper,.textarea-horizontal .label-wrapper,.select-horizontal .label-wrapper{flex-direction:column}.input-horizontal label,.textarea-horizontal label,.select-horizontal label{min-height:2.5rem;display:inline-flex;align-items:center}.input-horizontal .label-metadata,.textarea-horizontal .label-metadata,.select-horizontal .label-metadata{justify-content:flex-start}.input-horizontal .label-metadata .label-character-count,.textarea-horizontal .label-metadata .label-character-count,.select-horizontal .label-metadata .label-character-count{margin-left:0}: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}.textarea-field,.textarea-container{display:flex;flex-direction:column;gap:0.5rem;flex:1 1 auto}.textarea-field.textarea-horizontal{flex-direction:row;gap:1rem}.textarea-readonly{pointer-events:none}.textarea-wrapper{position:relative;display:flex;flex-direction:column}.icon-suffix{position:absolute;top:calc(0.625rem - 2px);right:0.75rem;background:rgba(255, 255, 255, 0.75);border-radius:100rem}.textarea-disabled .icon-suffix{background:rgba(242, 244, 247, 0.75)}textarea{margin:0;padding:0.625rem 0.75rem;box-sizing:border-box;min-height:2.5rem;font:inherit;background:white;border-radius:var(--cat-border-radius-m, 0.25rem);border:none;box-shadow:inset 0 0 0 1px rgb(var(--border-color));transition:box-shadow 125ms linear;resize:vertical;--border-color:var(--cat-border-color-dark, 215, 219, 224);}textarea:disabled{background:#f2f4f7;cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 81, 92, 108));resize:none}textarea:not(:disabled):hover{box-shadow:inset 0 0 0 1px rgb(var(--border-color)), 0 0 0 1px rgb(var(--border-color))}textarea:focus{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:-1px}.textarea-invalid textarea{--border-color:var(--cat-danger-bg, 217, 52, 13), 0.2}textarea::placeholder{color:rgb(var(--cat-font-color-muted, 81, 92, 108))}textarea:-webkit-autofill,textarea:-webkit-autofill:hover,textarea:-webkit-autofill:focus{-webkit-box-shadow:0 0 0 9999px #e8f0fe inset}";
10208
+ const catTextareaCss = ".hint-section{display:flex;gap:0.5rem;flex-direction:column;color:rgb(var(--cat-hint-color, inherit))}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1.125rem;font-weight:var(--cat-font-weight-body, 400);margin:0 !important}.cat-bg-primary{background-color:rgb(var(--cat-primary-bg, 0, 129, 148)) !important;color:rgb(var(--cat-primary-fill, 255, 255, 255)) !important}.cat-bg-primary-hover{transition:background-color 125ms, color 125ms}.cat-bg-primary-hover:hover{background-color:rgb(var(--cat-primary-bg-hover, 1, 115, 132)) !important;color:rgb(var(--cat-primary-fill-hover, 255, 255, 255)) !important}.cat-text-primary,.cat-link-primary{color:rgb(var(--cat-primary-text, 0, 129, 148)) !important}.cat-link-primary,.cat-text-primary-hover{transition:color 125ms}.cat-link-primary:hover,.cat-text-primary-hover:hover{color:rgb(var(--cat-primary-text-hover, 1, 115, 132)) !important}.cat-link-primary:active,.cat-text-primary-hover:active{color:rgb(var(--cat-primary-text-active, 2, 99, 113)) !important}.cat-bg-primaryInverted{background-color:#93b4f2 !important;color:black !important}.cat-bg-primaryInverted-hover{transition:background-color 125ms, color 125ms}.cat-bg-primaryInverted-hover:hover{background-color:#93b4f2 !important;color:black !important}.cat-text-primaryInverted,.cat-link-primaryInverted{color:#93b4f2 !important}.cat-link-primaryInverted,.cat-text-primaryInverted-hover{transition:color 125ms}.cat-link-primaryInverted:hover,.cat-text-primaryInverted-hover:hover{color:#93b4f2 !important}.cat-link-primaryInverted:active,.cat-text-primaryInverted-hover:active{color:#93b4f2 !important}.cat-bg-secondary{background-color:rgb(var(--cat-secondary-bg, 105, 118, 135)) !important;color:rgb(var(--cat-secondary-fill, 255, 255, 255)) !important}.cat-bg-secondary-hover{transition:background-color 125ms, color 125ms}.cat-bg-secondary-hover:hover{background-color:rgb(var(--cat-secondary-bg-hover, 105, 118, 135)) !important;color:rgb(var(--cat-secondary-fill-hover, 255, 255, 255)) !important}.cat-text-secondary,.cat-link-secondary{color:rgb(var(--cat-secondary-text, 0, 0, 0)) !important}.cat-link-secondary,.cat-text-secondary-hover{transition:color 125ms}.cat-link-secondary:hover,.cat-text-secondary-hover:hover{color:rgb(var(--cat-secondary-text-hover, 0, 0, 0)) !important}.cat-link-secondary:active,.cat-text-secondary-hover:active{color:rgb(var(--cat-secondary-text-active, 0, 0, 0)) !important}.cat-bg-secondaryInverted{background-color:#697687 !important;color:black !important}.cat-bg-secondaryInverted-hover{transition:background-color 125ms, color 125ms}.cat-bg-secondaryInverted-hover:hover{background-color:#697687 !important;color:black !important}.cat-text-secondaryInverted,.cat-link-secondaryInverted{color:white !important}.cat-link-secondaryInverted,.cat-text-secondaryInverted-hover{transition:color 125ms}.cat-link-secondaryInverted:hover,.cat-text-secondaryInverted-hover:hover{color:white !important}.cat-link-secondaryInverted:active,.cat-text-secondaryInverted-hover:active{color:white !important}.cat-bg-success{background-color:rgb(var(--cat-success-bg, 0, 132, 88)) !important;color:rgb(var(--cat-success-fill, 255, 255, 255)) !important}.cat-bg-success-hover{transition:background-color 125ms, color 125ms}.cat-bg-success-hover:hover{background-color:rgb(var(--cat-success-bg-hover, 0, 117, 78)) !important;color:rgb(var(--cat-success-fill-hover, 255, 255, 255)) !important}.cat-text-success,.cat-link-success{color:rgb(var(--cat-success-text, 0, 132, 88)) !important}.cat-link-success,.cat-text-success-hover{transition:color 125ms}.cat-link-success:hover,.cat-text-success-hover:hover{color:rgb(var(--cat-success-text-hover, 0, 117, 78)) !important}.cat-link-success:active,.cat-text-success-hover:active{color:rgb(var(--cat-success-text-active, 0, 105, 70)) !important}.cat-bg-warning{background-color:rgb(var(--cat-warning-bg, 255, 206, 128)) !important;color:rgb(var(--cat-warning-fill, 0, 0, 0)) !important}.cat-bg-warning-hover{transition:background-color 125ms, color 125ms}.cat-bg-warning-hover:hover{background-color:rgb(var(--cat-warning-bg-hover, 255, 214, 148)) !important;color:rgb(var(--cat-warning-fill-hover, 0, 0, 0)) !important}.cat-text-warning,.cat-link-warning{color:rgb(var(--cat-warning-text, 159, 97, 0)) !important}.cat-link-warning,.cat-text-warning-hover{transition:color 125ms}.cat-link-warning:hover,.cat-text-warning-hover:hover{color:rgb(var(--cat-warning-text-hover, 159, 97, 0)) !important}.cat-link-warning:active,.cat-text-warning-hover:active{color:rgb(var(--cat-warning-text-active, 159, 97, 0)) !important}.cat-bg-danger{background-color:rgb(var(--cat-danger-bg, 217, 52, 13)) !important;color:rgb(var(--cat-danger-fill, 255, 255, 255)) !important}.cat-bg-danger-hover{transition:background-color 125ms, color 125ms}.cat-bg-danger-hover:hover{background-color:rgb(var(--cat-danger-bg-hover, 194, 46, 11)) !important;color:rgb(var(--cat-danger-fill-hover, 255, 255, 255)) !important}.cat-text-danger,.cat-link-danger{color:rgb(var(--cat-danger-text, 217, 52, 13)) !important}.cat-link-danger,.cat-text-danger-hover{transition:color 125ms}.cat-link-danger:hover,.cat-text-danger-hover:hover{color:rgb(var(--cat-danger-text-hover, 194, 46, 11)) !important}.cat-link-danger:active,.cat-text-danger-hover:active{color:rgb(var(--cat-danger-text-active, 174, 42, 10)) !important}.cat-active{color:rgb(var(--cat-primary-text, 0, 129, 148)) !important}.cat-muted{color:rgb(var(--cat-font-color-muted, 81, 92, 108)) !important}.cat-text-reset{color:inherit !important}.cat-link-reset{color:inherit !important;text-decoration:inherit !important}.label{overflow:hidden;word-wrap:break-word;word-break:break-word}.input-field:not(.input-horizontal) .label-container.hidden,.textarea-field:not(.textarea-horizontal) .label-container.hidden,.select-field:not(.select-horizontal) .label-container.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}.label-container{flex-basis:var(--label-size, 33.33%)}.label-container .label-wrapper{display:flex;gap:0.25rem}.label-metadata{display:flex;flex-shrink:0;flex-grow:1;justify-content:space-between;gap:0.25rem}.label-optional{display:flex;align-items:center;max-height:1.25rem;font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 81, 92, 108))}.label-character-count{display:flex;align-items:center;margin-left:auto;max-height:1.25rem;font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 81, 92, 108))}.input-horizontal .label-container.hidden label,.textarea-horizontal .label-container.hidden label,.select-horizontal .label-container.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}.input-horizontal .label-wrapper,.textarea-horizontal .label-wrapper,.select-horizontal .label-wrapper{flex-direction:column}.input-horizontal label,.textarea-horizontal label,.select-horizontal label{min-height:2.5rem;display:inline-flex;align-items:center}.input-horizontal .label-metadata,.textarea-horizontal .label-metadata,.select-horizontal .label-metadata{justify-content:flex-start}.input-horizontal .label-metadata .label-character-count,.textarea-horizontal .label-metadata .label-character-count,.select-horizontal .label-metadata .label-character-count{margin-left:0}: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}.textarea-field,.textarea-container{display:flex;flex-direction:column;gap:0.5rem;flex:1 1 auto}.textarea-field.textarea-horizontal{flex-direction:row;gap:1rem}.textarea-readonly{pointer-events:none}.textarea-wrapper{position:relative;display:flex;flex-direction:column}.icon-suffix{position:absolute;top:calc(0.625rem - 2px);right:0.75rem;background:rgba(255, 255, 255, 0.75);border-radius:100rem}.textarea-disabled .icon-suffix{background:rgba(242, 244, 247, 0.75)}textarea{margin:0;padding:0.625rem 0.75rem;box-sizing:border-box;min-height:2.5rem;font:inherit;background:white;border-radius:var(--cat-border-radius-m, 0.25rem);border:none;box-shadow:inset 0 0 0 1px rgb(var(--border-color));transition:box-shadow 125ms linear;resize:vertical;--border-color:var(--cat-border-color-dark, 215, 219, 224);}textarea:disabled{background:#f2f4f7;cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 81, 92, 108));resize:none}textarea:not(:disabled):hover{box-shadow:inset 0 0 0 1px rgb(var(--border-color)), 0 0 0 1px rgb(var(--border-color))}textarea:focus{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:-1px}.textarea-invalid textarea{--border-color:var(--cat-danger-bg, 217, 52, 13), 0.2}textarea::placeholder{color:rgb(var(--cat-font-color-muted, 81, 92, 108))}textarea:-webkit-autofill,textarea:-webkit-autofill:hover,textarea:-webkit-autofill:focus{-webkit-box-shadow:0 0 0 9999px #e8f0fe inset}";
9936
10209
 
9937
10210
  let nextUniqueId$2 = 0;
9938
10211
  const CatTextarea = class {
@@ -10019,7 +10292,7 @@ const CatTextarea = class {
10019
10292
  return (h(Host, null, h("div", { class: {
10020
10293
  'textarea-field': true,
10021
10294
  'textarea-horizontal': this.horizontal
10022
- } }, h("div", { class: "label-container" }, (this.hasSlottedLabel || this.label) && (h("label", { htmlFor: this.id, class: { hidden: this.labelHidden } }, h("span", { class: "label-wrapper", part: "label" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label, h("div", { class: "label-metadata" }, !this.required && this.requiredMarker.startsWith('optional') && (h("span", { class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker.startsWith('required') && (h("span", { class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.required'), ")")), this.maxLength && (h("div", { class: "label-character-count", "aria-hidden": "true" }, this.value?.length ?? 0, "/", this.maxLength))))))), h("div", { class: "textarea-container" }, h("div", { class: {
10295
+ } }, h("div", { class: { 'label-container': true, hidden: this.labelHidden } }, (this.hasSlottedLabel || this.label) && (h("label", { htmlFor: this.id }, h("span", { class: "label-wrapper", part: "label" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label, h("div", { class: "label-metadata" }, !this.required && this.requiredMarker.startsWith('optional') && (h("span", { class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker.startsWith('required') && (h("span", { class: "label-optional", "aria-hidden": "true" }, "(", catI18nRegistry.t('input.required'), ")")), this.maxLength && (h("div", { class: "label-character-count", "aria-hidden": "true" }, this.value?.length ?? 0, "/", this.maxLength))))))), h("div", { class: "textarea-container" }, h("div", { class: {
10023
10296
  'textarea-wrapper': true,
10024
10297
  'textarea-readonly': this.readonly,
10025
10298
  'textarea-disabled': this.disabled,