@swisspost/design-system-components 2.0.1 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/dist/cjs/attribute-observer-10f08c04.js +27 -0
  2. package/dist/cjs/index.cjs.js +13 -12
  3. package/dist/cjs/{package-0645dd08.js → package-628f6e9c.js} +1 -1
  4. package/dist/cjs/{post-accordion-64aa88cf.js → post-accordion-da546aa2.js} +1 -1
  5. package/dist/cjs/{post-accordion-item-51df1dfa.js → post-accordion-item-33d5593a.js} +3 -3
  6. package/dist/cjs/post-accordion-item.cjs.entry.js +2 -2
  7. package/dist/cjs/post-accordion.cjs.entry.js +2 -2
  8. package/dist/cjs/post-alert-26c1bcda.js +98 -0
  9. package/dist/cjs/post-alert.cjs.entry.js +2 -2
  10. package/dist/cjs/{post-collapsible-84416953.js → post-collapsible-278b2a71.js} +1 -1
  11. package/dist/cjs/post-collapsible.cjs.entry.js +2 -2
  12. package/dist/cjs/{post-icon-5fc20211.js → post-icon-fd09bc54.js} +2 -2
  13. package/dist/cjs/post-icon.cjs.entry.js +2 -2
  14. package/dist/cjs/post-popover-1e454296.js +104 -0
  15. package/dist/cjs/post-popover.cjs.entry.js +3 -2
  16. package/dist/cjs/{post-popovercontainer-cc5fa030.js → post-popovercontainer-5e355de3.js} +26 -11
  17. package/dist/cjs/post-popovercontainer.cjs.entry.js +2 -2
  18. package/dist/cjs/post-tab-header-5c8b9a0d.js +32 -0
  19. package/dist/cjs/post-tab-header.cjs.entry.js +2 -2
  20. package/dist/cjs/{post-tab-panel-1143ea40.js → post-tab-panel-67ba226d.js} +1 -1
  21. package/dist/cjs/post-tab-panel.cjs.entry.js +2 -2
  22. package/dist/cjs/{post-tabs-7ef36ff6.js → post-tabs-71510ced.js} +1 -1
  23. package/dist/cjs/post-tabs.cjs.entry.js +2 -2
  24. package/dist/cjs/{post-tooltip-45784e17.js → post-tooltip-b6bbb3e4.js} +124 -42
  25. package/dist/cjs/post-tooltip.cjs.entry.js +3 -2
  26. package/dist/collection/components/post-accordion-item/post-accordion-item.css +1 -1
  27. package/dist/collection/components/post-accordion-item/post-accordion-item.js +1 -1
  28. package/dist/collection/components/post-alert/post-alert.css +5 -5
  29. package/dist/collection/components/post-icon/post-icon.css +1 -1
  30. package/dist/collection/components/post-popover/post-popover.css +1 -1
  31. package/dist/collection/components/post-popover/post-popover.js +47 -63
  32. package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -1
  33. package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +25 -10
  34. package/dist/collection/components/post-tab-header/post-tab-header.css +1 -1
  35. package/dist/collection/components/post-tooltip/post-tooltip.css +1 -1
  36. package/dist/collection/components/post-tooltip/post-tooltip.js +120 -42
  37. package/dist/collection/utils/attribute-observer.js +23 -0
  38. package/dist/components/attribute-observer.js +25 -0
  39. package/dist/components/package.js +1 -1
  40. package/dist/components/post-accordion-item2.js +2 -2
  41. package/dist/components/post-alert2.js +1 -1
  42. package/dist/components/post-icon2.js +1 -1
  43. package/dist/components/post-popover2.js +51 -64
  44. package/dist/components/post-popovercontainer2.js +25 -10
  45. package/dist/components/post-tab-header2.js +1 -1
  46. package/dist/components/post-tooltip2.js +123 -41
  47. package/dist/docs.json +5 -25
  48. package/dist/esm/attribute-observer-37fa950a.js +25 -0
  49. package/dist/esm/index.js +13 -12
  50. package/dist/esm/{package-37a68f71.js → package-15929f57.js} +1 -1
  51. package/dist/esm/{post-accordion-8872dc1b.js → post-accordion-be080240.js} +1 -1
  52. package/dist/esm/{post-accordion-item-02b9f01c.js → post-accordion-item-7b3c726b.js} +3 -3
  53. package/dist/esm/post-accordion-item.entry.js +2 -2
  54. package/dist/esm/post-accordion.entry.js +2 -2
  55. package/dist/esm/post-alert-37f853eb.js +96 -0
  56. package/dist/esm/post-alert.entry.js +2 -2
  57. package/dist/esm/{post-collapsible-1f23fe7d.js → post-collapsible-967bb191.js} +1 -1
  58. package/dist/esm/post-collapsible.entry.js +2 -2
  59. package/dist/esm/{post-icon-2ec2127e.js → post-icon-ba163099.js} +2 -2
  60. package/dist/esm/post-icon.entry.js +2 -2
  61. package/dist/esm/post-popover-69694fa6.js +102 -0
  62. package/dist/esm/post-popover.entry.js +3 -2
  63. package/dist/esm/{post-popovercontainer-4a48161f.js → post-popovercontainer-da870ff0.js} +26 -11
  64. package/dist/esm/post-popovercontainer.entry.js +2 -2
  65. package/dist/esm/post-tab-header-14ed99cd.js +30 -0
  66. package/dist/esm/post-tab-header.entry.js +2 -2
  67. package/dist/esm/{post-tab-panel-da24046f.js → post-tab-panel-d89c4c50.js} +1 -1
  68. package/dist/esm/post-tab-panel.entry.js +2 -2
  69. package/dist/esm/{post-tabs-21a5dfeb.js → post-tabs-e995886a.js} +1 -1
  70. package/dist/esm/post-tabs.entry.js +2 -2
  71. package/dist/esm/{post-tooltip-4f4f87b4.js → post-tooltip-0ec6a388.js} +124 -42
  72. package/dist/esm/post-tooltip.entry.js +3 -2
  73. package/dist/post-components/index.esm.js +1 -1
  74. package/dist/post-components/p-00ab91d9.entry.js +1 -0
  75. package/dist/post-components/p-04f47e54.entry.js +1 -0
  76. package/dist/post-components/{p-e836df41.js → p-1f284e66.js} +1 -1
  77. package/dist/post-components/p-209e33a5.js +1 -0
  78. package/dist/post-components/p-282e21c2.entry.js +1 -0
  79. package/dist/post-components/p-34a772e3.entry.js +1 -0
  80. package/dist/post-components/p-46c47aa4.entry.js +1 -0
  81. package/dist/post-components/{p-73a7d4f9.js → p-51fe19e0.js} +1 -1
  82. package/dist/post-components/p-557f0f10.entry.js +1 -0
  83. package/dist/post-components/p-5ecceba0.js +1 -0
  84. package/dist/post-components/p-61d98756.js +1 -0
  85. package/dist/post-components/p-6adeaa6c.js +1 -0
  86. package/dist/post-components/{p-aee1750c.js → p-6b3ba10a.js} +1 -1
  87. package/dist/post-components/p-82f4f464.entry.js +1 -0
  88. package/dist/post-components/p-94256868.js +15 -0
  89. package/dist/post-components/p-98cb0bbd.entry.js +1 -0
  90. package/dist/post-components/p-9ee95668.entry.js +1 -0
  91. package/dist/post-components/p-a0d342e4.entry.js +1 -0
  92. package/dist/post-components/{p-c1c8f2ec.js → p-a9d59b04.js} +1 -1
  93. package/dist/post-components/p-ac7b779e.js +1 -0
  94. package/dist/post-components/p-d9c9ed63.js +1 -0
  95. package/dist/post-components/p-e1bf894f.entry.js +1 -0
  96. package/dist/post-components/p-e8d17225.js +1 -0
  97. package/dist/post-components/p-f47b0207.js +1 -0
  98. package/dist/post-components/post-components.esm.js +1 -1
  99. package/dist/types/components/post-popover/post-popover.d.ts +3 -17
  100. package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +1 -0
  101. package/dist/types/components/post-tooltip/post-tooltip.d.ts +14 -9
  102. package/dist/types/utils/attribute-observer.d.ts +1 -0
  103. package/package.json +4 -3
  104. package/dist/cjs/post-alert-ac59385a.js +0 -98
  105. package/dist/cjs/post-popover-be868244.js +0 -117
  106. package/dist/cjs/post-tab-header-5a7070e9.js +0 -32
  107. package/dist/esm/post-alert-1a766c15.js +0 -96
  108. package/dist/esm/post-popover-f6029c96.js +0 -115
  109. package/dist/esm/post-tab-header-63676360.js +0 -30
  110. package/dist/post-components/p-0b46c9ba.entry.js +0 -1
  111. package/dist/post-components/p-21557c34.js +0 -15
  112. package/dist/post-components/p-2b67b933.js +0 -1
  113. package/dist/post-components/p-47fd6eb0.js +0 -1
  114. package/dist/post-components/p-548ee455.entry.js +0 -1
  115. package/dist/post-components/p-63b6c589.entry.js +0 -1
  116. package/dist/post-components/p-66f346fb.entry.js +0 -1
  117. package/dist/post-components/p-7973e3e4.js +0 -1
  118. package/dist/post-components/p-829f9eaf.entry.js +0 -1
  119. package/dist/post-components/p-82facb04.js +0 -1
  120. package/dist/post-components/p-8aa01298.js +0 -1
  121. package/dist/post-components/p-9170d84d.entry.js +0 -1
  122. package/dist/post-components/p-959f83c0.entry.js +0 -1
  123. package/dist/post-components/p-9bc7ed9e.entry.js +0 -1
  124. package/dist/post-components/p-a3fc7eaf.js +0 -1
  125. package/dist/post-components/p-a762b512.entry.js +0 -1
  126. package/dist/post-components/p-ccd827a1.js +0 -1
  127. package/dist/post-components/p-d25e401c.entry.js +0 -1
  128. package/dist/post-components/p-f655856d.entry.js +0 -1
@@ -26,10 +26,10 @@
26
26
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
27
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
28
28
  * THE SOFTWARE.
29
- */.alert-primary,.alert-success,.alert-danger,.alert-warning,.alert-info,.alert-gray,.alert-notification,.alert-error{background-color:rgb(var(--post-bg-rgb)) !important;color:var(--post-contrast-color) !important}.alert-warning,.alert-info,.alert-gray{--post-contrast-color: #000;--post-contrast-color-inverted: #fff;--post-gray-10: hsl(0, 0%, 90%);--post-gray-20: hsl(0, 0%, 80%);--post-gray-40: hsl(0, 0%, 60%);--post-gray-60: hsl(0, 0%, 40%);--post-gray-80: hsl(0, 0%, 20%);--post-yellow: #fc0;--post-light: #faf9f8;--post-gray: #f4f3f1;--post-dark: hsl(0, 0%, 20%);--post-primary: hsl(0, 0%, 20%);--post-white: #fff;--post-black: #000;--post-info: #cce4ee;--post-success: #2c911c;--post-warning: #f49e00;--post-danger: #a51728;--post-nightblue: #004976;--post-nightblue-bright: #0076a8;--post-petrol: #006d68;--post-petrol-bright: #00968f;--post-coral: #9e2a2f;--post-coral-bright: #e03c31;--post-olive: #716135;--post-olive-bright: #aa9d2e;--post-purple: #80276c;--post-purple-bright: #c5299b;--post-aubergine: #523178;--post-aubergine-bright: #7566a0;--post-success-green: #2c871d;--post-error-red: #a51728;--post-warning-orange: #f49e00;--post-success-background: #c0debb;--post-error-background: #ffdade;--post-warning-background: #fce2b2;--post-contrast-color-rgb: 0, 0, 0;--post-contrast-color-inverted-rgb: 255, 255, 255;--post-gray-10-rgb: 230, 230, 230;--post-gray-20-rgb: 204, 204, 204;--post-gray-40-rgb: 153, 153, 153;--post-gray-60-rgb: 102, 102, 102;--post-gray-80-rgb: 51, 51, 51;--post-yellow-rgb: 255, 204, 0;--post-light-rgb: 250, 249, 248;--post-gray-rgb: 244, 243, 241;--post-dark-rgb: 51, 51, 51;--post-primary-rgb: 51, 51, 51;--post-white-rgb: 255, 255, 255;--post-black-rgb: 0, 0, 0;--post-info-rgb: 204, 228, 238;--post-success-rgb: 44, 145, 28;--post-warning-rgb: 244, 158, 0;--post-danger-rgb: 165, 23, 40;--post-nightblue-rgb: 0, 73, 118;--post-nightblue-bright-rgb: 0, 118, 168;--post-petrol-rgb: 0, 109, 104;--post-petrol-bright-rgb: 0, 150, 143;--post-coral-rgb: 158, 42, 47;--post-coral-bright-rgb: 224, 60, 49;--post-olive-rgb: 113, 97, 53;--post-olive-bright-rgb: 170, 157, 46;--post-purple-rgb: 128, 39, 108;--post-purple-bright-rgb: 197, 41, 155;--post-aubergine-rgb: 82, 49, 120;--post-aubergine-bright-rgb: 117, 102, 160;--post-success-green-rgb: 44, 135, 29;--post-error-red-rgb: 165, 23, 40;--post-warning-orange-rgb: 244, 158, 0;--post-success-background-rgb: 192, 222, 187;--post-error-background-rgb: 255, 218, 222;--post-warning-background-rgb: 252, 226, 178}.alert-primary,.alert-success,.alert-danger,.alert-notification,.alert-error{--post-contrast-color: #fff;--post-contrast-color-inverted: #000;--post-dark: #faf9f8;--post-light: hsl(0, 0%, 20%);--post-gray-80: hsl(0, 0%, 90%);--post-gray-60: hsl(0, 0%, 80%);--post-gray-40: hsl(0, 0%, 60%);--post-gray-20: hsl(0, 0%, 40%);--post-gray-10: hsl(0, 0%, 20%);--post-contrast-color-rgb: 255, 255, 255;--post-contrast-color-inverted-rgb: 0, 0, 0;--post-dark-rgb: 250, 249, 248;--post-light-rgb: 51, 51, 51;--post-gray-80-rgb: 230, 230, 230;--post-gray-60-rgb: 204, 204, 204;--post-gray-40-rgb: 153, 153, 153;--post-gray-20-rgb: 102, 102, 102;--post-gray-10-rgb: 51, 51, 51}.alert{position:relative;box-sizing:border-box;min-height:5rem;box-shadow:0 2px 4px 0 rgba(0,0,0,.2);border-radius:4px;padding:1rem 1.25rem;padding-inline-start:5.5rem;margin-block-end:1rem;font-size:1rem;font-weight:300}.alert.no-icon{min-height:3.5rem;padding-inline-start:1.25rem}.alert[class^=pi-],.alert[class*=" pi-"]{background-size:3rem;background-position:1.25rem 1rem;background-repeat:no-repeat}.alert[class^=pi-].no-icon,.alert[class*=" pi-"].no-icon{background-image:none}.alert::before{content:"";display:block}.alert::before,.alert>post-icon{position:absolute;height:3rem;width:3rem;left:1.25rem;top:1rem}.alert.no-icon::before,.alert[class^=pi-]::before,.alert[class*=" pi-"]::before{content:unset}.alert.no-icon>post-icon,.alert[class^=pi-]>post-icon,.alert[class*=" pi-"]>post-icon{display:none}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.alert{filter:none !important;background-color:rgba(0,0,0,0) !important;border:2px solid WindowText}}.alert:not(.alert-action){display:flex;flex-direction:column;justify-content:center;gap:.25rem}.alert:not(.alert-action) a{font-weight:400}.alert:not(.alert-action) hr{margin-block:.5rem .75rem !important}.alert:not(.alert-action)>:only-child,.alert:not(.alert-action)>post-icon:first-child+:last-child{font-size:1.0625rem;font-weight:700}.alert:not(.alert-action)>*{margin:0}.alert-heading{font-size:1.0625rem;font-weight:700}.alert-dismissible{pointer-events:auto;position:relative;padding-inline-end:4rem}.alert-dismissible>.btn-close{position:absolute;inset-block-start:1rem;inset-inline-end:1.25rem}.alert-dismissible>.btn-close:first-child+:last-child{font-size:1.0625rem;font-weight:700}.alert-action{display:flex;flex-direction:row;align-items:center;gap:1.25rem}.alert-action>.alert-content{flex:1 1 auto;display:flex;flex-direction:column;justify-content:center;gap:.25rem}.alert-action>.alert-content a{font-weight:400}.alert-action>.alert-content hr{margin-block:.5rem .75rem !important}.alert-action>.alert-content>:only-child,.alert-action>.alert-content>post-icon:first-child+:last-child{font-size:1.0625rem;font-weight:700}.alert-action>.alert-content>*{margin:0}.alert-action>.alert-buttons{flex:0 0 auto;display:flex;align-items:center;gap:.5rem}@media(min-width: 780px){.alert-action.alert-dismissible>.btn-close{inset-block-start:calc(50% - 0.75rem)}}@media(max-width: 779.98px){.alert-action{flex-direction:column;align-items:stretch;padding-inline:1.25rem}.alert-action>.alert-content{padding-inline-start:4.25rem;padding-inline-end:2.75rem}.alert-action>.alert-buttons{display:flex}.alert-action>.alert-buttons>.btn{flex:1 0 0;width:100%}.alert-action>.alert-buttons>.btn:first-child{margin-inline-start:0}}.alert-fixed-bottom{position:fixed;inset-block-end:0;inset-inline-start:0;inset-inline-end:0;margin-bottom:0;border-radius:0;z-index:1030}@media(min-width: 1441px){.alert-fixed-bottom{padding-inline-end:calc((100% - 1440px) / 2 + 120px + 1.25rem);padding-inline-start:calc(
30
- (100% - 1440px) / 2 + 120px + 1.25rem + 3rem + 1.25rem
31
- );background-position-x:calc((100% - 1440px) / 2 + 120px + 1.25rem + 1.5rem)}.alert-fixed-bottom::before{left:calc((100% - 1440px) / 2 + 120px + 1.25rem)}.alert-fixed-bottom.no-icon{padding-inline-start:calc((100% - 1440px) / 2 + 120px + 1.25rem)}.alert-fixed-bottom.alert-dismissible{padding-inline-end:calc(
32
- (100% - 1440px) / 2 + 120px + 1.25rem + 1.25rem + 1.5rem
33
- )}.alert-fixed-bottom.alert-dismissible>.btn-close{inset-inline-end:calc((100% - 1440px) / 2 + 120px + 1.25rem)}}.alert-primary{--post-bg-rgb: 51, 51, 51}.alert-primary:not(.no-icon,[class^=pi-],[class*=" pi-"])::before{-webkit-mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M30.533 26.933c-3.333-4.8-5.867-12.667-5.867-18.267 0-4.8-3.867-8.667-8.667-8.667S7.332 3.866 7.332 8.666c0 5.6-2.533 13.467-5.867 18.267L1.998 28h11.333v4h5.333v-4h11.333l.533-1.067zm-13.2 3.734h-2.667V28h2.667zm-14.133-4c3.2-5.067 5.467-12.533 5.467-18 0-4 3.333-7.333 7.333-7.333s7.333 3.333 7.333 7.333c0 5.467 2.267 12.933 5.467 18z'/%3E%3C/g%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M30.533 26.933c-3.333-4.8-5.867-12.667-5.867-18.267 0-4.8-3.867-8.667-8.667-8.667S7.332 3.866 7.332 8.666c0 5.6-2.533 13.467-5.867 18.267L1.998 28h11.333v4h5.333v-4h11.333l.533-1.067zm-13.2 3.734h-2.667V28h2.667zm-14.133-4c3.2-5.067 5.467-12.533 5.467-18 0-4 3.333-7.333 7.333-7.333s7.333 3.333 7.333 7.333c0 5.467 2.267 12.933 5.467 18z'/%3E%3C/g%3E%3C/svg%3E");background-color:currentColor}.alert-primary:has(>post-icon)::before{content:none}.alert-primary>post-icon{background-color:#333}.alert-success{--post-bg-rgb: 44, 145, 28}.alert-success:not(.no-icon,[class^=pi-],[class*=" pi-"])::before{-webkit-mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='m12.667 24.533-7.6-7.6 1.867-1.867 5.733 5.733 12.4-12.4 1.867 1.867z'/%3E%3C/g%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='m12.667 24.533-7.6-7.6 1.867-1.867 5.733 5.733 12.4-12.4 1.867 1.867z'/%3E%3C/g%3E%3C/svg%3E");background-color:currentColor}.alert-success:has(>post-icon)::before{content:none}.alert-success>post-icon{background-color:#2c911c}.alert-danger{--post-bg-rgb: 165, 23, 40}.alert-danger:not(.no-icon,[class^=pi-],[class*=" pi-"])::before{-webkit-mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M14.667 4h2.667v18.667h-2.667zm0 21.333h2.667V28h-2.667z'/%3E%3C/g%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M14.667 4h2.667v18.667h-2.667zm0 21.333h2.667V28h-2.667z'/%3E%3C/g%3E%3C/svg%3E");background-color:currentColor}.alert-danger:has(>post-icon)::before{content:none}.alert-danger>post-icon{background-color:#a51728}.alert-warning{--post-bg-rgb: 244, 158, 0}.alert-warning:not(.no-icon,[class^=pi-],[class*=" pi-"])::before{-webkit-mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M14.667 4h2.667v18.667h-2.667zm0 21.333h2.667V28h-2.667z'/%3E%3C/g%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M14.667 4h2.667v18.667h-2.667zm0 21.333h2.667V28h-2.667z'/%3E%3C/g%3E%3C/svg%3E");background-color:currentColor}.alert-warning:has(>post-icon)::before{content:none}.alert-warning>post-icon{background-color:#f49e00}.alert-info{--post-bg-rgb: 204, 228, 238}.alert-info:not(.no-icon,[class^=pi-],[class*=" pi-"])::before{-webkit-mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M17.333 25.333v-16h-4.667V12h2v13.333h-2V28h6.667v-2.667zM14.667 4h2.667v2.667h-2.667z'/%3E%3C/g%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M17.333 25.333v-16h-4.667V12h2v13.333h-2V28h6.667v-2.667zM14.667 4h2.667v2.667h-2.667z'/%3E%3C/g%3E%3C/svg%3E");background-color:currentColor}.alert-info:has(>post-icon)::before{content:none}.alert-info>post-icon{background-color:#cce4ee}.alert-gray{--post-bg-rgb: 244, 243, 241}.alert-gray:not(.no-icon,[class^=pi-],[class*=" pi-"])::before{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xml:space='preserve' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M31.986 15.73c-.503.16-1.03.27-1.586.27a5.24 5.24 0 0 1-4.43-2.448c-.73.382-1.547.62-2.427.62a5.257 5.257 0 0 1-5.257-5.258c0-.88.237-1.698.62-2.427a5.24 5.24 0 0 1-2.449-4.43c0-.714.145-1.393.403-2.014C16.574.028 16.29 0 16 0 7.163 0 0 7.163 0 16s7.163 16 16 16 16-7.163 16-16c0-.091-.012-.18-.014-.27M16 30.667c-8.087 0-14.667-6.58-14.667-14.667 0-7.806 6.13-14.207 13.828-14.643a6.54 6.54 0 0 0 2.116 5.56 6.3 6.3 0 0 0-.325 1.997 6.6 6.6 0 0 0 6.59 6.59c.677 0 1.346-.108 1.998-.324a6.54 6.54 0 0 0 5.067 2.15C29.933 24.796 23.639 30.667 16 30.667M11.352 14.17a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0c0-.735.599-1.333 1.334-1.333s1.333.598 1.333 1.333-.598 1.334-1.333 1.334-1.334-.598-1.334-1.334m13.981 8.496a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0a1.335 1.335 0 0 1 2.667 0c0 .735-.598 1.333-1.333 1.333a1.335 1.335 0 0 1-1.334-1.333m-7.276-1.829a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.667a.667.667 0 1 1 .002-1.335.667.667 0 0 1-.002 1.335m7.772-6a2 2 0 1 0-4 0 2 2 0 0 0 4 0m-2 .666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M11.505 5.505a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M28.93 18.548a13.2 13.2 0 0 1-4.335 7.357.663.663 0 0 1-.94-.073.666.666 0 0 1 .073-.94 11.84 11.84 0 0 0 3.894-6.61.668.668 0 0 1 1.307.266m-6.668 8.212a.667.667 0 0 1-.295.896c-.837.423-1.722.757-2.63.99a.665.665 0 1 1-.33-1.292 11.7 11.7 0 0 0 2.359-.888.67.67 0 0 1 .896.294M4 15.921a.666.666 0 1 1-1.333 0 13.13 13.13 0 0 1 4.597-9.984.666.666 0 1 1 .867 1.013A11.8 11.8 0 0 0 4 15.92'/%3E%3C/g%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xml:space='preserve' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M31.986 15.73c-.503.16-1.03.27-1.586.27a5.24 5.24 0 0 1-4.43-2.448c-.73.382-1.547.62-2.427.62a5.257 5.257 0 0 1-5.257-5.258c0-.88.237-1.698.62-2.427a5.24 5.24 0 0 1-2.449-4.43c0-.714.145-1.393.403-2.014C16.574.028 16.29 0 16 0 7.163 0 0 7.163 0 16s7.163 16 16 16 16-7.163 16-16c0-.091-.012-.18-.014-.27M16 30.667c-8.087 0-14.667-6.58-14.667-14.667 0-7.806 6.13-14.207 13.828-14.643a6.54 6.54 0 0 0 2.116 5.56 6.3 6.3 0 0 0-.325 1.997 6.6 6.6 0 0 0 6.59 6.59c.677 0 1.346-.108 1.998-.324a6.54 6.54 0 0 0 5.067 2.15C29.933 24.796 23.639 30.667 16 30.667M11.352 14.17a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0c0-.735.599-1.333 1.334-1.333s1.333.598 1.333 1.333-.598 1.334-1.333 1.334-1.334-.598-1.334-1.334m13.981 8.496a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0a1.335 1.335 0 0 1 2.667 0c0 .735-.598 1.333-1.333 1.333a1.335 1.335 0 0 1-1.334-1.333m-7.276-1.829a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.667a.667.667 0 1 1 .002-1.335.667.667 0 0 1-.002 1.335m7.772-6a2 2 0 1 0-4 0 2 2 0 0 0 4 0m-2 .666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M11.505 5.505a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M28.93 18.548a13.2 13.2 0 0 1-4.335 7.357.663.663 0 0 1-.94-.073.666.666 0 0 1 .073-.94 11.84 11.84 0 0 0 3.894-6.61.668.668 0 0 1 1.307.266m-6.668 8.212a.667.667 0 0 1-.295.896c-.837.423-1.722.757-2.63.99a.665.665 0 1 1-.33-1.292 11.7 11.7 0 0 0 2.359-.888.67.67 0 0 1 .896.294M4 15.921a.666.666 0 1 1-1.333 0 13.13 13.13 0 0 1 4.597-9.984.666.666 0 1 1 .867 1.013A11.8 11.8 0 0 0 4 15.92'/%3E%3C/g%3E%3C/svg%3E");background-color:currentColor}.alert-gray:has(>post-icon)::before{content:none}.alert-gray>post-icon{background-color:#f4f3f1}.alert-notification{--post-bg-rgb: 51, 51, 51}.alert-notification:not(.no-icon,[class^=pi-],[class*=" pi-"])::before{-webkit-mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M30.533 26.933c-3.333-4.8-5.867-12.667-5.867-18.267 0-4.8-3.867-8.667-8.667-8.667S7.332 3.866 7.332 8.666c0 5.6-2.533 13.467-5.867 18.267L1.998 28h11.333v4h5.333v-4h11.333l.533-1.067zm-13.2 3.734h-2.667V28h2.667zm-14.133-4c3.2-5.067 5.467-12.533 5.467-18 0-4 3.333-7.333 7.333-7.333s7.333 3.333 7.333 7.333c0 5.467 2.267 12.933 5.467 18z'/%3E%3C/g%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M30.533 26.933c-3.333-4.8-5.867-12.667-5.867-18.267 0-4.8-3.867-8.667-8.667-8.667S7.332 3.866 7.332 8.666c0 5.6-2.533 13.467-5.867 18.267L1.998 28h11.333v4h5.333v-4h11.333l.533-1.067zm-13.2 3.734h-2.667V28h2.667zm-14.133-4c3.2-5.067 5.467-12.533 5.467-18 0-4 3.333-7.333 7.333-7.333s7.333 3.333 7.333 7.333c0 5.467 2.267 12.933 5.467 18z'/%3E%3C/g%3E%3C/svg%3E");background-color:currentColor}.alert-notification:has(>post-icon)::before{content:none}.alert-notification>post-icon{background-color:#333}.alert-error{--post-bg-rgb: 165, 23, 40}.alert-error:not(.no-icon,[class^=pi-],[class*=" pi-"])::before{-webkit-mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M14.667 4h2.667v18.667h-2.667zm0 21.333h2.667V28h-2.667z'/%3E%3C/g%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M14.667 4h2.667v18.667h-2.667zm0 21.333h2.667V28h-2.667z'/%3E%3C/g%3E%3C/svg%3E");background-color:currentColor}.alert-error:has(>post-icon)::before{content:none}.alert-error>post-icon{background-color:#a51728}.btn-close{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;-webkit-appearance:button;appearance:button;outline:none;outline-offset:2px;border-radius:4px;color:var(--post-gray-80);transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;cursor:pointer}.btn-close:is(:focus-visible,:focus-within,.pretend-focus){outline:2px solid var(--post-contrast-color)}.btn-close::before{-webkit-mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='m16.267 16.667 6.667-6.533-.933-1.067-6.667 6.667-6.667-6.667-.933 1.067 6.667 6.533-6.667 6.667 1.067.933 6.533-6.667 6.667 6.667.933-1.067z'/%3E%3C/g%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='m16.267 16.667 6.667-6.533-.933-1.067-6.667 6.667-6.667-6.667-.933 1.067 6.667 6.533-6.667 6.667 1.067.933 6.533-6.667 6.667 6.667.933-1.067z'/%3E%3C/g%3E%3C/svg%3E");background-color:currentColor;content:"";display:block;height:1.5rem;width:1.5rem}.btn-close:focus,.btn-close:not(:disabled):hover,.pretend-hover.btn-close{color:var(--post-contrast-color)}.btn-close:disabled{color:var(--post-gray-40)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close{color:CanvasText;forced-color-adjust:none}}.btn-close-white{color:#e6e6e6}.btn-close-white:focus,.btn-close-white:not(:disabled):hover,.btn-close-white.pretend-hover{color:#fff}.btn-close-white:disabled{color:#999}/*!
29
+ */.alert-primary,.alert-success,.alert-danger,.alert-warning,.alert-info,.alert-gray,.alert-notification,.alert-error{background-color:rgb(var(--post-bg-rgb)) !important;color:var(--post-contrast-color) !important}.alert-warning,.alert-info,.alert-gray{--post-contrast-color: #000;--post-contrast-color-inverted: #fff;--post-gray-10: hsl(0, 0%, 90%);--post-gray-20: hsl(0, 0%, 80%);--post-gray-40: hsl(0, 0%, 60%);--post-gray-60: hsl(0, 0%, 40%);--post-gray-80: hsl(0, 0%, 20%);--post-yellow: #fc0;--post-light: #faf9f8;--post-gray: #f4f3f1;--post-dark: hsl(0, 0%, 20%);--post-primary: hsl(0, 0%, 20%);--post-white: #fff;--post-black: #000;--post-info: #cce4ee;--post-success: #2c911c;--post-warning: #f49e00;--post-danger: #a51728;--post-nightblue: #004976;--post-nightblue-bright: #0076a8;--post-petrol: #006d68;--post-petrol-bright: #00968f;--post-coral: #9e2a2f;--post-coral-bright: #e03c31;--post-olive: #716135;--post-olive-bright: #aa9d2e;--post-purple: #80276c;--post-purple-bright: #c5299b;--post-aubergine: #523178;--post-aubergine-bright: #7566a0;--post-success-green: #2c871d;--post-error-red: #a51728;--post-warning-orange: #f49e00;--post-success-background: #c0debb;--post-error-background: #ffdade;--post-warning-background: #fce2b2;--post-contrast-color-rgb: 0, 0, 0;--post-contrast-color-inverted-rgb: 255, 255, 255;--post-gray-10-rgb: 230, 230, 230;--post-gray-20-rgb: 204, 204, 204;--post-gray-40-rgb: 153, 153, 153;--post-gray-60-rgb: 102, 102, 102;--post-gray-80-rgb: 51, 51, 51;--post-yellow-rgb: 255, 204, 0;--post-light-rgb: 250, 249, 248;--post-gray-rgb: 244, 243, 241;--post-dark-rgb: 51, 51, 51;--post-primary-rgb: 51, 51, 51;--post-white-rgb: 255, 255, 255;--post-black-rgb: 0, 0, 0;--post-info-rgb: 204, 228, 238;--post-success-rgb: 44, 145, 28;--post-warning-rgb: 244, 158, 0;--post-danger-rgb: 165, 23, 40;--post-nightblue-rgb: 0, 73, 118;--post-nightblue-bright-rgb: 0, 118, 168;--post-petrol-rgb: 0, 109, 104;--post-petrol-bright-rgb: 0, 150, 143;--post-coral-rgb: 158, 42, 47;--post-coral-bright-rgb: 224, 60, 49;--post-olive-rgb: 113, 97, 53;--post-olive-bright-rgb: 170, 157, 46;--post-purple-rgb: 128, 39, 108;--post-purple-bright-rgb: 197, 41, 155;--post-aubergine-rgb: 82, 49, 120;--post-aubergine-bright-rgb: 117, 102, 160;--post-success-green-rgb: 44, 135, 29;--post-error-red-rgb: 165, 23, 40;--post-warning-orange-rgb: 244, 158, 0;--post-success-background-rgb: 192, 222, 187;--post-error-background-rgb: 255, 218, 222;--post-warning-background-rgb: 252, 226, 178}.alert-primary,.alert-success,.alert-danger,.alert-notification,.alert-error{--post-contrast-color: #fff;--post-contrast-color-inverted: #000;--post-dark: #faf9f8;--post-light: hsl(0, 0%, 20%);--post-gray-80: hsl(0, 0%, 90%);--post-gray-60: hsl(0, 0%, 80%);--post-gray-40: hsl(0, 0%, 60%);--post-gray-20: hsl(0, 0%, 40%);--post-gray-10: hsl(0, 0%, 20%);--post-contrast-color-rgb: 255, 255, 255;--post-contrast-color-inverted-rgb: 0, 0, 0;--post-dark-rgb: 250, 249, 248;--post-light-rgb: 51, 51, 51;--post-gray-80-rgb: 230, 230, 230;--post-gray-60-rgb: 204, 204, 204;--post-gray-40-rgb: 153, 153, 153;--post-gray-20-rgb: 102, 102, 102;--post-gray-10-rgb: 51, 51, 51}.alert{position:relative;box-sizing:border-box;min-height:5rem;box-shadow:0 2px 4px 0 rgba(0,0,0,.2);border-radius:4px;padding:1rem 1.25rem;padding-inline-start:5.5rem;margin-block-end:1rem;font-size:1rem;font-weight:300}.alert.no-icon{min-height:3.5rem;padding-inline-start:1.25rem}.alert[class^=pi-],.alert[class*=" pi-"]{background-size:3rem;background-position:1.25rem 1rem;background-repeat:no-repeat}.alert[class^=pi-].no-icon,.alert[class*=" pi-"].no-icon{background-image:none}.alert::before{content:"";display:block}.alert::before,.alert>post-icon{position:absolute;height:3rem;width:3rem;left:1.25rem;top:1rem}.alert.no-icon::before,.alert[class^=pi-]::before,.alert[class*=" pi-"]::before{content:unset}.alert.no-icon>post-icon,.alert[class^=pi-]>post-icon,.alert[class*=" pi-"]>post-icon{display:none}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.alert{filter:none !important;border:2px solid CanvasText}}.alert:not(.alert-action){display:flex;flex-direction:column;justify-content:center;gap:.25rem}.alert:not(.alert-action) a{font-weight:400}.alert:not(.alert-action) hr{margin-block:.5rem .75rem !important}.alert:not(.alert-action)>:only-child,.alert:not(.alert-action)>post-icon:first-child+:last-child{font-size:1.0625rem;font-weight:700}.alert:not(.alert-action)>*{margin:0}.alert-heading{font-size:1.0625rem;font-weight:700}.alert-dismissible{pointer-events:auto;position:relative;padding-inline-end:4rem}.alert-dismissible>.btn-close{position:absolute;inset-block-start:1rem;inset-inline-end:1.25rem}.alert-dismissible>.btn-close:first-child+:last-child{font-size:1.0625rem;font-weight:700}.alert-action{display:flex;flex-direction:row;align-items:center;gap:1.25rem}.alert-action>.alert-content{flex:1 1 auto;display:flex;flex-direction:column;justify-content:center;gap:.25rem}.alert-action>.alert-content a{font-weight:400}.alert-action>.alert-content hr{margin-block:.5rem .75rem !important}.alert-action>.alert-content>:only-child,.alert-action>.alert-content>post-icon:first-child+:last-child{font-size:1.0625rem;font-weight:700}.alert-action>.alert-content>*{margin:0}.alert-action>.alert-buttons{flex:0 0 auto;display:flex;align-items:center;gap:.5rem}@media(min-width: 780px){.alert-action.alert-dismissible>.btn-close{inset-block-start:calc(50% - 0.75rem)}}@media(max-width: 779.98px){.alert-action{flex-direction:column;align-items:stretch;padding-inline:1.25rem}.alert-action>.alert-content{padding-inline-start:4.25rem;padding-inline-end:2.75rem}.alert-action>.alert-buttons{display:flex}.alert-action>.alert-buttons>.btn{flex:1 0 0;width:100%}.alert-action>.alert-buttons>.btn:first-child{margin-inline-start:0}}.alert-fixed-bottom{position:fixed;inset-block-end:0;inset-inline-start:0;inset-inline-end:0;margin-bottom:0;border-radius:0;z-index:1030}@media(min-width: 1440px){.alert-fixed-bottom{padding-inline-end:calc((100% - 1439px) / 2 + 120px + 1.25rem);padding-inline-start:calc(
30
+ (100% - 1439px) / 2 + 120px + 1.25rem + 3rem + 1.25rem
31
+ );background-position-x:calc((100% - 1439px) / 2 + 120px + 1.25rem + 1.5rem)}.alert-fixed-bottom::before{left:calc((100% - 1439px) / 2 + 120px + 1.25rem)}.alert-fixed-bottom.no-icon{padding-inline-start:calc((100% - 1439px) / 2 + 120px + 1.25rem)}.alert-fixed-bottom.alert-dismissible{padding-inline-end:calc(
32
+ (100% - 1439px) / 2 + 120px + 1.25rem + 1.25rem + 1.5rem
33
+ )}.alert-fixed-bottom.alert-dismissible>.btn-close{inset-inline-end:calc((100% - 1439px) / 2 + 120px + 1.25rem)}}.alert-primary{--post-bg-rgb: 51, 51, 51}.alert-primary:not(.no-icon,[class^=pi-],[class*=" pi-"])::before{-webkit-mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M30.533 26.933c-3.333-4.8-5.867-12.667-5.867-18.267 0-4.8-3.867-8.667-8.667-8.667S7.332 3.866 7.332 8.666c0 5.6-2.533 13.467-5.867 18.267L1.998 28h11.333v4h5.333v-4h11.333l.533-1.067zm-13.2 3.734h-2.667V28h2.667zm-14.133-4c3.2-5.067 5.467-12.533 5.467-18 0-4 3.333-7.333 7.333-7.333s7.333 3.333 7.333 7.333c0 5.467 2.267 12.933 5.467 18z'/%3E%3C/g%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M30.533 26.933c-3.333-4.8-5.867-12.667-5.867-18.267 0-4.8-3.867-8.667-8.667-8.667S7.332 3.866 7.332 8.666c0 5.6-2.533 13.467-5.867 18.267L1.998 28h11.333v4h5.333v-4h11.333l.533-1.067zm-13.2 3.734h-2.667V28h2.667zm-14.133-4c3.2-5.067 5.467-12.533 5.467-18 0-4 3.333-7.333 7.333-7.333s7.333 3.333 7.333 7.333c0 5.467 2.267 12.933 5.467 18z'/%3E%3C/g%3E%3C/svg%3E");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color}.alert-primary:has(>post-icon)::before{content:none}.alert-primary>post-icon{background-color:#333}.alert-success{--post-bg-rgb: 44, 135, 29}.alert-success:not(.no-icon,[class^=pi-],[class*=" pi-"])::before{-webkit-mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='m12.667 24.533-7.6-7.6 1.867-1.867 5.733 5.733 12.4-12.4 1.867 1.867z'/%3E%3C/g%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='m12.667 24.533-7.6-7.6 1.867-1.867 5.733 5.733 12.4-12.4 1.867 1.867z'/%3E%3C/g%3E%3C/svg%3E");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color}.alert-success:has(>post-icon)::before{content:none}.alert-success>post-icon{background-color:#2c871d}.alert-danger{--post-bg-rgb: 165, 23, 40}.alert-danger:not(.no-icon,[class^=pi-],[class*=" pi-"])::before{-webkit-mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M14.667 4h2.667v18.667h-2.667zm0 21.333h2.667V28h-2.667z'/%3E%3C/g%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M14.667 4h2.667v18.667h-2.667zm0 21.333h2.667V28h-2.667z'/%3E%3C/g%3E%3C/svg%3E");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color}.alert-danger:has(>post-icon)::before{content:none}.alert-danger>post-icon{background-color:#a51728}.alert-warning{--post-bg-rgb: 244, 158, 0}.alert-warning:not(.no-icon,[class^=pi-],[class*=" pi-"])::before{-webkit-mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M14.667 4h2.667v18.667h-2.667zm0 21.333h2.667V28h-2.667z'/%3E%3C/g%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M14.667 4h2.667v18.667h-2.667zm0 21.333h2.667V28h-2.667z'/%3E%3C/g%3E%3C/svg%3E");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color}.alert-warning:has(>post-icon)::before{content:none}.alert-warning>post-icon{background-color:#f49e00}.alert-info{--post-bg-rgb: 204, 228, 238}.alert-info:not(.no-icon,[class^=pi-],[class*=" pi-"])::before{-webkit-mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M17.333 25.333v-16h-4.667V12h2v13.333h-2V28h6.667v-2.667zM14.667 4h2.667v2.667h-2.667z'/%3E%3C/g%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M17.333 25.333v-16h-4.667V12h2v13.333h-2V28h6.667v-2.667zM14.667 4h2.667v2.667h-2.667z'/%3E%3C/g%3E%3C/svg%3E");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color}.alert-info:has(>post-icon)::before{content:none}.alert-info>post-icon{background-color:#cce4ee}.alert-gray{--post-bg-rgb: 244, 243, 241}.alert-gray:not(.no-icon,[class^=pi-],[class*=" pi-"])::before{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xml:space='preserve' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M31.986 15.73c-.503.16-1.03.27-1.586.27a5.24 5.24 0 0 1-4.43-2.448c-.73.382-1.547.62-2.427.62a5.257 5.257 0 0 1-5.257-5.258c0-.88.237-1.698.62-2.427a5.24 5.24 0 0 1-2.449-4.43c0-.714.145-1.393.403-2.014C16.574.028 16.29 0 16 0 7.163 0 0 7.163 0 16s7.163 16 16 16 16-7.163 16-16c0-.091-.012-.18-.014-.27M16 30.667c-8.087 0-14.667-6.58-14.667-14.667 0-7.806 6.13-14.207 13.828-14.643a6.54 6.54 0 0 0 2.116 5.56 6.3 6.3 0 0 0-.325 1.997 6.6 6.6 0 0 0 6.59 6.59c.677 0 1.346-.108 1.998-.324a6.54 6.54 0 0 0 5.067 2.15C29.933 24.796 23.639 30.667 16 30.667M11.352 14.17a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0c0-.735.599-1.333 1.334-1.333s1.333.598 1.333 1.333-.598 1.334-1.333 1.334-1.334-.598-1.334-1.334m13.981 8.496a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0a1.335 1.335 0 0 1 2.667 0c0 .735-.598 1.333-1.333 1.333a1.335 1.335 0 0 1-1.334-1.333m-7.276-1.829a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.667a.667.667 0 1 1 .002-1.335.667.667 0 0 1-.002 1.335m7.772-6a2 2 0 1 0-4 0 2 2 0 0 0 4 0m-2 .666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M11.505 5.505a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M28.93 18.548a13.2 13.2 0 0 1-4.335 7.357.663.663 0 0 1-.94-.073.666.666 0 0 1 .073-.94 11.84 11.84 0 0 0 3.894-6.61.668.668 0 0 1 1.307.266m-6.668 8.212a.667.667 0 0 1-.295.896c-.837.423-1.722.757-2.63.99a.665.665 0 1 1-.33-1.292 11.7 11.7 0 0 0 2.359-.888.67.67 0 0 1 .896.294M4 15.921a.666.666 0 1 1-1.333 0 13.13 13.13 0 0 1 4.597-9.984.666.666 0 1 1 .867 1.013A11.8 11.8 0 0 0 4 15.92'/%3E%3C/g%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xml:space='preserve' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M31.986 15.73c-.503.16-1.03.27-1.586.27a5.24 5.24 0 0 1-4.43-2.448c-.73.382-1.547.62-2.427.62a5.257 5.257 0 0 1-5.257-5.258c0-.88.237-1.698.62-2.427a5.24 5.24 0 0 1-2.449-4.43c0-.714.145-1.393.403-2.014C16.574.028 16.29 0 16 0 7.163 0 0 7.163 0 16s7.163 16 16 16 16-7.163 16-16c0-.091-.012-.18-.014-.27M16 30.667c-8.087 0-14.667-6.58-14.667-14.667 0-7.806 6.13-14.207 13.828-14.643a6.54 6.54 0 0 0 2.116 5.56 6.3 6.3 0 0 0-.325 1.997 6.6 6.6 0 0 0 6.59 6.59c.677 0 1.346-.108 1.998-.324a6.54 6.54 0 0 0 5.067 2.15C29.933 24.796 23.639 30.667 16 30.667M11.352 14.17a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0c0-.735.599-1.333 1.334-1.333s1.333.598 1.333 1.333-.598 1.334-1.333 1.334-1.334-.598-1.334-1.334m13.981 8.496a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0a1.335 1.335 0 0 1 2.667 0c0 .735-.598 1.333-1.333 1.333a1.335 1.335 0 0 1-1.334-1.333m-7.276-1.829a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.667a.667.667 0 1 1 .002-1.335.667.667 0 0 1-.002 1.335m7.772-6a2 2 0 1 0-4 0 2 2 0 0 0 4 0m-2 .666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M11.505 5.505a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M28.93 18.548a13.2 13.2 0 0 1-4.335 7.357.663.663 0 0 1-.94-.073.666.666 0 0 1 .073-.94 11.84 11.84 0 0 0 3.894-6.61.668.668 0 0 1 1.307.266m-6.668 8.212a.667.667 0 0 1-.295.896c-.837.423-1.722.757-2.63.99a.665.665 0 1 1-.33-1.292 11.7 11.7 0 0 0 2.359-.888.67.67 0 0 1 .896.294M4 15.921a.666.666 0 1 1-1.333 0 13.13 13.13 0 0 1 4.597-9.984.666.666 0 1 1 .867 1.013A11.8 11.8 0 0 0 4 15.92'/%3E%3C/g%3E%3C/svg%3E");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color}.alert-gray:has(>post-icon)::before{content:none}.alert-gray>post-icon{background-color:#f4f3f1}.alert-notification{--post-bg-rgb: 51, 51, 51}.alert-notification:not(.no-icon,[class^=pi-],[class*=" pi-"])::before{-webkit-mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M30.533 26.933c-3.333-4.8-5.867-12.667-5.867-18.267 0-4.8-3.867-8.667-8.667-8.667S7.332 3.866 7.332 8.666c0 5.6-2.533 13.467-5.867 18.267L1.998 28h11.333v4h5.333v-4h11.333l.533-1.067zm-13.2 3.734h-2.667V28h2.667zm-14.133-4c3.2-5.067 5.467-12.533 5.467-18 0-4 3.333-7.333 7.333-7.333s7.333 3.333 7.333 7.333c0 5.467 2.267 12.933 5.467 18z'/%3E%3C/g%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M30.533 26.933c-3.333-4.8-5.867-12.667-5.867-18.267 0-4.8-3.867-8.667-8.667-8.667S7.332 3.866 7.332 8.666c0 5.6-2.533 13.467-5.867 18.267L1.998 28h11.333v4h5.333v-4h11.333l.533-1.067zm-13.2 3.734h-2.667V28h2.667zm-14.133-4c3.2-5.067 5.467-12.533 5.467-18 0-4 3.333-7.333 7.333-7.333s7.333 3.333 7.333 7.333c0 5.467 2.267 12.933 5.467 18z'/%3E%3C/g%3E%3C/svg%3E");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color}.alert-notification:has(>post-icon)::before{content:none}.alert-notification>post-icon{background-color:#333}.alert-error{--post-bg-rgb: 165, 23, 40}.alert-error:not(.no-icon,[class^=pi-],[class*=" pi-"])::before{-webkit-mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M14.667 4h2.667v18.667h-2.667zm0 21.333h2.667V28h-2.667z'/%3E%3C/g%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='M14.667 4h2.667v18.667h-2.667zm0 21.333h2.667V28h-2.667z'/%3E%3C/g%3E%3C/svg%3E");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color}.alert-error:has(>post-icon)::before{content:none}.alert-error>post-icon{background-color:#a51728}.btn-close{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;-webkit-appearance:button;appearance:button;outline:none;outline-offset:2px;border-radius:4px;color:var(--post-gray-80);transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;cursor:pointer}.btn-close:is(:focus-visible,:focus-within,.pretend-focus){outline:2px solid var(--post-contrast-color)}.btn-close::before{-webkit-mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='m16.267 16.667 6.667-6.533-.933-1.067-6.667 6.667-6.667-6.667-.933 1.067 6.667 6.533-6.667 6.667 1.067.933 6.533-6.667 6.667 6.667.933-1.067z'/%3E%3C/g%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='m16.267 16.667 6.667-6.533-.933-1.067-6.667 6.667-6.667-6.667-.933 1.067 6.667 6.533-6.667 6.667 1.067.933 6.533-6.667 6.667 6.667.933-1.067z'/%3E%3C/g%3E%3C/svg%3E");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;content:"";display:block;height:1.5rem;width:1.5rem}.btn-close:focus,.btn-close:not(:disabled):hover,.pretend-hover.btn-close{color:var(--post-contrast-color)}.btn-close:disabled{color:var(--post-gray-40)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close{color:CanvasText;forced-color-adjust:none}.btn-close:focus,.btn-close:not(:disabled):hover,.pretend-hover.btn-close{color:Highlight}}.btn-close-white{color:#e6e6e6}.btn-close-white:focus,.btn-close-white:not(:disabled):hover,.btn-close-white.pretend-hover{color:#fff}.btn-close-white:disabled{color:#999}/*!
34
34
  * Copyright 2021 by Swiss Post, Information Technology
35
35
  */:host{display:block}:host ::slotted(*){margin:0 !important}.visually-hidden{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}.visually-hidden:not(caption){position:absolute !important}.alert-heading>::slotted(h1){font-size:inherit !important;font-weight:inherit !important}.alert-heading>::slotted(h2){font-size:inherit !important;font-weight:inherit !important}.alert-heading>::slotted(h3){font-size:inherit !important;font-weight:inherit !important}.alert-heading>::slotted(h4){font-size:inherit !important;font-weight:inherit !important}.alert-heading>::slotted(h5){font-size:inherit !important;font-weight:inherit !important}.alert-heading>::slotted(h6){font-size:inherit !important;font-weight:inherit !important}
@@ -1 +1 @@
1
- :host{display:inline-block;width:1em;height:1em;vertical-align:-0.15em}span{display:block;width:100%;height:100%;fill:currentColor;background-color:currentColor;-webkit-mask-position:center center;mask-position:center center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100%;mask-size:100%}:host([flip-h]:not([flip-h=false])){scale:-1 1}:host([flip-v]:not([flip-v=false])){scale:1 -1}:host([flip-h][flip-v]:not([flip-h=false],[flip-v=false])){scale:-1}:host([animation]){transform-origin:center}:host([animation=cylon]){animation:icon-animation-cylon .75s ease-in-out infinite alternate}:host([animation=cylon-vertical]){animation:icon-animation-cylon-vertical .75s ease-in-out infinite alternate}:host([animation=spin]){animation:icon-animation-spin 2s linear infinite normal}:host([animation=spin-reverse]){animation:icon-animation-spin 2s linear infinite reverse}:host([animation=fade]){animation:icon-animation-fade .75s ease-in-out infinite alternate}:host([animation=throb]){animation:icon-animation-throb .75s ease-in-out infinite alternate}@keyframes icon-animation-cylon{from{transform:translateX(-25%)}to{transform:translateX(25%)}}@keyframes icon-animation-cylon-vertical{from{transform:translateY(25%)}to{transform:translateY(-25%)}}@keyframes icon-animation-fade{from{opacity:.1}to{opacity:1}}@keyframes icon-animation-spin{from{transform:rotate(0deg)}to{transform:rotate(359deg)}}@keyframes icon-animation-throb{from{opacity:.5;transform:scale(0.5)}to{opacity:1;transform:scale(1)}}
1
+ :host{display:inline-block;width:1em;height:1em;vertical-align:-0.15em}span{display:block;width:100%;height:100%;fill:currentColor;forced-color-adjust:preserve-parent-color;background-color:currentColor;-webkit-mask-position:center center;mask-position:center center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100%;mask-size:100%}:host([flip-h]:not([flip-h=false])){scale:-1 1}:host([flip-v]:not([flip-v=false])){scale:1 -1}:host([flip-h][flip-v]:not([flip-h=false],[flip-v=false])){scale:-1}:host([animation]){transform-origin:center}:host([animation=cylon]){animation:icon-animation-cylon .75s ease-in-out infinite alternate}:host([animation=cylon-vertical]){animation:icon-animation-cylon-vertical .75s ease-in-out infinite alternate}:host([animation=spin]){animation:icon-animation-spin 2s linear infinite normal}:host([animation=spin-reverse]){animation:icon-animation-spin 2s linear infinite reverse}:host([animation=fade]){animation:icon-animation-fade .75s ease-in-out infinite alternate}:host([animation=throb]){animation:icon-animation-throb .75s ease-in-out infinite alternate}@keyframes icon-animation-cylon{from{transform:translateX(-25%)}to{transform:translateX(25%)}}@keyframes icon-animation-cylon-vertical{from{transform:translateY(25%)}to{transform:translateY(-25%)}}@keyframes icon-animation-fade{from{opacity:.1}to{opacity:1}}@keyframes icon-animation-spin{from{transform:rotate(0deg)}to{transform:rotate(359deg)}}@keyframes icon-animation-throb{from{opacity:.5;transform:scale(0.5)}to{opacity:1;transform:scale(1)}}
@@ -1,3 +1,3 @@
1
1
  /*!
2
2
  * Copyright 2021 by Swiss Post, Information Technology
3
- */.btn-close{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;-webkit-appearance:button;appearance:button;outline:none;outline-offset:2px;border-radius:4px;color:var(--post-gray-80);transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;cursor:pointer}.btn-close:is(:focus-visible,:focus-within,.pretend-focus){outline:2px solid var(--post-contrast-color)}.btn-close::before{-webkit-mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='m16.267 16.667 6.667-6.533-.933-1.067-6.667 6.667-6.667-6.667-.933 1.067 6.667 6.533-6.667 6.667 1.067.933 6.533-6.667 6.667 6.667.933-1.067z'/%3E%3C/g%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='m16.267 16.667 6.667-6.533-.933-1.067-6.667 6.667-6.667-6.667-.933 1.067 6.667 6.533-6.667 6.667 1.067.933 6.533-6.667 6.667 6.667.933-1.067z'/%3E%3C/g%3E%3C/svg%3E");background-color:currentColor;content:"";display:block;height:1.5rem;width:1.5rem}.btn-close:focus,.btn-close:not(:disabled):hover,.pretend-hover.btn-close{color:var(--post-contrast-color)}.btn-close:disabled{color:var(--post-gray-40)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close{color:CanvasText;forced-color-adjust:none}}.btn-close-white{color:#e6e6e6}.btn-close-white:focus,.btn-close-white:not(:disabled):hover,.btn-close-white.pretend-hover{color:#fff}.btn-close-white:disabled{color:#999}*{box-sizing:border-box}:host{--post-contrast-color: #fff;--post-bg-rgb: 51, 51, 51;display:block}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}.popover-container{display:flex;align-items:self-start;padding:.5em;max-width:min(66vw,60rem)}@media(max-width: 599.98px){.popover-container{max-width:100%}}.popover-content{padding:.5em}
3
+ */.btn-close{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;-webkit-appearance:button;appearance:button;outline:none;outline-offset:2px;border-radius:4px;color:var(--post-gray-80);transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;cursor:pointer}.btn-close:is(:focus-visible,:focus-within,.pretend-focus){outline:2px solid var(--post-contrast-color)}.btn-close::before{-webkit-mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='m16.267 16.667 6.667-6.533-.933-1.067-6.667 6.667-6.667-6.667-.933 1.067 6.667 6.533-6.667 6.667 1.067.933 6.533-6.667 6.667 6.667.933-1.067z'/%3E%3C/g%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='m16.267 16.667 6.667-6.533-.933-1.067-6.667 6.667-6.667-6.667-.933 1.067 6.667 6.533-6.667 6.667 1.067.933 6.533-6.667 6.667 6.667.933-1.067z'/%3E%3C/g%3E%3C/svg%3E");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;content:"";display:block;height:1.5rem;width:1.5rem}.btn-close:focus,.btn-close:not(:disabled):hover,.pretend-hover.btn-close{color:var(--post-contrast-color)}.btn-close:disabled{color:var(--post-gray-40)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close{color:CanvasText;forced-color-adjust:none}.btn-close:focus,.btn-close:not(:disabled):hover,.pretend-hover.btn-close{color:Highlight}}.btn-close-white{color:#e6e6e6}.btn-close-white:focus,.btn-close-white:not(:disabled):hover,.btn-close-white.pretend-hover{color:#fff}.btn-close-white:disabled{color:#999}*{box-sizing:border-box}:host{--post-contrast-color: #fff;--post-bg-rgb: 51, 51, 51;display:block}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}.popover-container{display:flex;align-items:self-start;padding:.5em;max-width:min(66vw,60rem)}@media(max-width: 599.98px){.popover-container{max-width:100%}}.popover-content{padding:.5em}
@@ -1,54 +1,66 @@
1
1
  import { h, Host } from "@stencil/core";
2
2
  import { version } from "../../../package.json";
3
+ import { getAttributeObserver } from "../../utils/attribute-observer";
3
4
  /**
4
5
  * @slot default - Slot for placing content inside the popover.
5
6
  */
7
+ let popoverInstances = 0;
8
+ const popoverTargetAttribute = 'data-popover-target';
9
+ const globalToggleHandler = (e) => {
10
+ const target = e.target;
11
+ if (!target || !('getAttribute' in target))
12
+ return;
13
+ const popoverTarget = target.getAttribute(popoverTargetAttribute);
14
+ if (!popoverTarget || ('key' in e && e.key !== 'Enter'))
15
+ return;
16
+ const popover = document.getElementById(popoverTarget);
17
+ popover === null || popover === void 0 ? void 0 : popover.toggle(target);
18
+ };
19
+ // Initialize a mutation observer for patching accessibility features
20
+ const triggerObserver = getAttributeObserver(popoverTargetAttribute, trigger => {
21
+ const force = trigger.hasAttribute(popoverTargetAttribute);
22
+ trigger.setAttribute('aria-expanded', force ? 'false' : null);
23
+ });
6
24
  export class PostPopover {
7
25
  constructor() {
8
26
  this.placement = 'top';
9
27
  this.closeButtonCaption = undefined;
10
28
  this.arrow = true;
11
- this.localTogglePopover = e => this.toggle(e.target);
12
- this.localEnterTogglePopover = e => {
13
- if (e.key === 'Enter')
14
- this.toggle(e.target);
15
- };
16
- this.localTouchTogglePopover = e => {
17
- e.preventDefault();
18
- this.toggle(e.target);
19
- };
29
+ this.localBeforeToggleHandler = this.beforeToggleHandler.bind(this);
20
30
  }
21
31
  connectedCallback() {
22
- if (!this.triggers) {
23
- throw new Error(`No trigger found for <post-popover popover-id="${this.host.id}`);
32
+ // Set up accessibility patcher and event listeners for the first component
33
+ if (popoverInstances === 0) {
34
+ window.addEventListener('pointerup', globalToggleHandler);
35
+ window.addEventListener('keydown', globalToggleHandler);
36
+ triggerObserver.observe(document.body, {
37
+ subtree: true,
38
+ childList: true,
39
+ attributeFilter: [popoverTargetAttribute],
40
+ });
24
41
  }
25
- // As long as cross-shadow-boundary [popovertarget] and button.popoverTargetElement are not working
26
- // we're left with listening to trigger events ourselves
27
- // https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/popoverTargetElement
28
- // https://github.com/whatwg/html/issues/9109#issuecomment-1494030465 (does not seem to work for now)
29
- // https://stackoverflow.com/questions/77324143/popovertargetelement-does-not-cross-shadow-boundaries?noredirect=1#comment136318281_77324143
30
- this.triggers.forEach(trigger => {
31
- // See this.onToggle for one time mouse event listener
32
- trigger.addEventListener('mouseup', this.localTogglePopover, { once: true });
33
- trigger.addEventListener('keypress', this.localEnterTogglePopover);
34
- trigger.addEventListener('touch', this.localTouchTogglePopover, { once: true });
35
- trigger.setAttribute('aria-expanded', 'false');
36
- });
42
+ popoverInstances++;
43
+ this.triggers.forEach(trigger => trigger.setAttribute('aria-expanded', 'false'));
44
+ }
45
+ componentDidLoad() {
46
+ this.popoverRef.addEventListener('beforetoggle', this.localBeforeToggleHandler);
37
47
  }
38
48
  disconnectedCallback() {
39
- this.triggers.forEach(trigger => {
40
- trigger.removeEventListener('mouseup', this.localTogglePopover);
41
- trigger.removeEventListener('keypress', this.localEnterTogglePopover);
42
- trigger.removeEventListener('touch', this.localTouchTogglePopover);
43
- trigger.removeAttribute('aria-expanded');
44
- });
49
+ popoverInstances--;
50
+ // Remove listeners and observer after the last popover has been destructed
51
+ if (popoverInstances === 0) {
52
+ window.removeEventListener('click', globalToggleHandler);
53
+ window.removeEventListener('keydown', globalToggleHandler);
54
+ triggerObserver.disconnect();
55
+ }
56
+ this.popoverRef.removeEventListener('beforetoggle', this.localBeforeToggleHandler);
57
+ this.triggers.forEach(trigger => trigger.removeAttribute('aria-expanded'));
45
58
  }
46
59
  /**
47
60
  * Programmatically display the popover
48
61
  * @param target An element with [data-popover-target="id"] where the popover should be shown
49
62
  */
50
63
  async show(target) {
51
- this.currentTarget = target;
52
64
  this.popoverRef.show(target);
53
65
  target.setAttribute('aria-expanded', 'true');
54
66
  }
@@ -65,46 +77,18 @@ export class PostPopover {
65
77
  * @param force Pass true to always show or false to always hide
66
78
  */
67
79
  async toggle(target, force) {
68
- this.currentTarget = target;
69
80
  const newState = await this.popoverRef.toggle(target, force);
81
+ this.triggers.forEach(trigger => trigger.setAttribute('aria-expanded', 'false'));
70
82
  target.setAttribute('aria-expanded', `${newState}`);
71
83
  }
72
84
  get triggers() {
73
- return document.querySelectorAll(`[data-popover-target="${this.host.id}"]`);
85
+ return document.querySelectorAll(`[${popoverTargetAttribute}="${this.host.id}"]`);
74
86
  }
75
- /**
76
- * One time event handler for click events
77
- * A permanent event listener would prevent a toggle button from working properly:
78
- * A click opens the popover, a second click first closes it (due to light dismiss), then directly
79
- * opens it again because of the click listener on the button. Registering a new
80
- * one time listener after a small timeout solves this issue.
81
- * @param e toggle event from post-popovercontainer
82
- */
83
- onToggle(e) {
84
- if (this.currentTarget) {
85
- this.currentTarget.setAttribute('aria-expanded', `${e.detail}`);
86
- }
87
- if (!e.detail) {
88
- window.requestAnimationFrame(() => {
89
- this.triggers.forEach(trigger => {
90
- trigger.addEventListener('mouseup', this.localTogglePopover, { once: true });
91
- trigger.addEventListener('touch', this.localTouchTogglePopover, { once: true });
92
- });
93
- });
94
- // Handle missing re-focusing logic after close. Can be removed as soon as popovertarget works correctly
95
- if (this.currentTarget) {
96
- this.currentTarget.focus();
97
- this.currentTarget = null;
98
- }
99
- }
100
- }
101
- // Fix for firefox to prevent the following lines from triggering
102
- // https://github.com/oddbird/popover-polyfill/blob/main/src/popover.ts#L338
103
- stopImmediatePropagation(e) {
104
- e.stopImmediatePropagation();
87
+ beforeToggleHandler() {
88
+ this.triggers.forEach(trigger => trigger.setAttribute('aria-expanded', 'false'));
105
89
  }
106
90
  render() {
107
- return (h(Host, { key: 'f1580a33b1a6398ce0f32ce76365a1cebe68ceeb', "data-version": version }, h("post-popovercontainer", { key: '3fbf43896d0cb2c4d35b18302a66097499aa31c0', arrow: this.arrow, placement: this.placement, ref: e => (this.popoverRef = e), onPostPopoverToggled: e => this.onToggle(e) }, h("div", { key: '3b698cdc50d72e59238a1dbc48aced03c0c7dc43', class: "popover-container", onPointerDown: e => this.stopImmediatePropagation(e), onPointerUp: e => this.stopImmediatePropagation(e) }, h("div", { key: '1e9f888bba7c54fa4ba956553e7668f3f37daa67', class: "popover-content" }, h("slot", { key: '433e2b5d75f7bf7b07ba2895c97fc362a98b653f' })), h("button", { key: 'ee88604aabea87068e5653a0d14111064c6e8829', class: "btn-close", onClick: () => this.hide() }, h("span", { key: 'f9fbd6ab73a99c293281c5a80e4c583fe5ca8f37', class: "visually-hidden" }, this.closeButtonCaption))))));
91
+ return (h(Host, { key: '90cd97eedfdecb6666c5825cd09bb323cf857cbb', "data-version": version }, h("post-popovercontainer", { key: 'fe555322454124f4b9a618c634f2ae504ec89c07', arrow: this.arrow, placement: this.placement, ref: e => (this.popoverRef = e) }, h("div", { key: 'd6e30229dd8d38c95e165d1fc55b1c7af5c7b5e2', class: "popover-container" }, h("div", { key: 'c43c1347bb6bfe3532387693b1761b53533584ec', class: "popover-content" }, h("slot", { key: '24a4aa1df86497a4fe4b72adaac76f6e69db9d9e' })), h("button", { key: '3a5e52f480ddd1ef41d068e476d2a8c5f7d77c4a', class: "btn-close", onClick: () => this.hide() }, h("span", { key: '493310100d3f76dfe5bf6cf1d64250b7551be43c', class: "visually-hidden" }, this.closeButtonCaption))))));
108
92
  }
109
93
  static get is() { return "post-popover"; }
110
94
  static get encapsulation() { return "shadow"; }
@@ -1 +1 @@
1
- @layer polyfill{@supports not selector(:popover-open){[popover]:not(.\:popover-open){display:none}}}.popover{box-shadow:.5px 3px 4px rgba(0,0,0,.1),2px 4px 10px 4px rgba(0,0,0,.12);position:fixed;z-index:1060;width:max-content;margin:0;padding:0;box-sizing:border-box;color:var(--post-contrast-color);background-color:rgb(var(--post-bg-rgb));border:1px solid rgba(0,0,0,0);border-radius:4px;overflow:visible}.arrow{position:absolute;width:.7071067812rem;height:.7071067812rem;background-color:inherit;rotate:45deg;pointer-events:none;z-index:-1;border-right:2px solid rgba(0,0,0,0);border-bottom:2px solid rgba(0,0,0,0)}
1
+ @layer polyfill{@supports not selector(:popover-open){[popover]:not(.\:popover-open){display:none}}}.popover{box-shadow:.5px 3px 4px rgba(0,0,0,.1),2px 4px 10px 4px rgba(0,0,0,.12);position:fixed;z-index:1060;width:max-content;margin:0;padding:0;box-sizing:border-box;color:var(--post-contrast-color);background-color:rgb(var(--post-bg-rgb));border:2px solid rgba(0,0,0,0);border-radius:4px;overflow:visible}.arrow{position:absolute;width:.7071067812rem;height:.7071067812rem;background-color:inherit;rotate:45deg;pointer-events:none;z-index:-1}.arrow.top{border-left:2px solid rgba(0,0,0,0);border-top:2px solid rgba(0,0,0,0)}.arrow.right{border-right:2px solid rgba(0,0,0,0);border-top:2px solid rgba(0,0,0,0)}.arrow.left{border-left:2px solid rgba(0,0,0,0);border-bottom:2px solid rgba(0,0,0,0)}.arrow.bottom{border-right:2px solid rgba(0,0,0,0);border-bottom:2px solid rgba(0,0,0,0)}
@@ -1,5 +1,5 @@
1
1
  import { h, Host } from "@stencil/core";
2
- import { arrow, autoUpdate, computePosition, flip, inline, offset, shift, limitShift, size, } from "@floating-ui/dom";
2
+ import { arrow, autoUpdate, computePosition, flip, inline, limitShift, offset, shift, size, } from "@floating-ui/dom";
3
3
  // Polyfill for popovers, can be removed when https://caniuse.com/?search=popover is green
4
4
  import "@oddbird/popover-polyfill";
5
5
  import { version } from "../../../package.json";
@@ -32,15 +32,20 @@ export class PostPopovercontainer {
32
32
  * @param target An element with [data-tooltip-target="id"] where the tooltip should be shown
33
33
  */
34
34
  async show(target) {
35
- this.eventTarget = target;
36
- this.popoverRef.showPopover();
35
+ if (!this.toggleTimeoutId) {
36
+ this.eventTarget = target;
37
+ this.calculatePosition();
38
+ this.popoverRef.showPopover();
39
+ }
37
40
  }
38
41
  /**
39
42
  * Programmatically hide this tooltip
40
43
  */
41
44
  async hide() {
42
- this.eventTarget = null;
43
- this.popoverRef.hidePopover();
45
+ if (!this.toggleTimeoutId) {
46
+ this.eventTarget = null;
47
+ this.popoverRef.hidePopover();
48
+ }
44
49
  }
45
50
  /**
46
51
  * Toggle tooltip display
@@ -48,8 +53,13 @@ export class PostPopovercontainer {
48
53
  * @param force Pass true to always show or false to always hide
49
54
  */
50
55
  async toggle(target, force) {
51
- this.eventTarget = target;
52
- this.popoverRef.togglePopover(force);
56
+ // Prevent instant double toggle
57
+ if (!this.toggleTimeoutId) {
58
+ this.eventTarget = target;
59
+ this.calculatePosition();
60
+ this.popoverRef.togglePopover(force);
61
+ this.toggleTimeoutId = null;
62
+ }
53
63
  return this.popoverRef.matches(':popover-open');
54
64
  }
55
65
  /**
@@ -59,6 +69,7 @@ export class PostPopovercontainer {
59
69
  * @param e ToggleEvent
60
70
  */
61
71
  handleToggle(e) {
72
+ this.toggleTimeoutId = window.setTimeout(() => (this.toggleTimeoutId = null), 10);
62
73
  const isOpen = e.newState === 'open';
63
74
  if (isOpen) {
64
75
  this.startAutoupdates();
@@ -114,17 +125,21 @@ export class PostPopovercontainer {
114
125
  const side = currentPlacement.split('-')[0];
115
126
  const { x: arrowX, y: arrowY } = middlewareData.arrow;
116
127
  const staticSide = SIDE_MAP[side];
128
+ const offsetBorderLineJoin = 2;
117
129
  Object.assign(this.arrowRef.style, {
118
130
  top: arrowY ? `${arrowY}px` : '',
119
131
  left: arrowX ? `${arrowX}px` : '',
120
- [staticSide]: `${-this.arrowRef.offsetWidth / 2}px`,
132
+ [staticSide]: `${-this.arrowRef.offsetWidth / 2 - offsetBorderLineJoin}px`,
121
133
  });
134
+ // Add position as a class to be able to style arrow for HCM
135
+ this.arrowRef.classList.remove(...Object.values(SIDE_MAP));
136
+ this.arrowRef.classList.add(staticSide);
122
137
  }
123
138
  }
124
139
  render() {
125
- return (h(Host, { key: 'e6eef7a0f4d801645e0f73d94796cdd8b6ae86ea', "data-version": version }, h("div", { key: 'cd520cc35be33aeb99158559132c187229aeefe4', class: "popover", part: "popover", ref: (el) => (this.popoverRef = el) }, this.arrow && (h("span", { class: "arrow", ref: el => {
140
+ return (h(Host, { key: '8049387a5ba6eefb3165e84c098ba4ae5b8f443f', "data-version": version }, h("div", { key: '63d3095a7992baf46fbc74b5c595654cbdeaba66', class: "popover", part: "popover", ref: (el) => (this.popoverRef = el) }, this.arrow && (h("span", { class: "arrow", ref: el => {
126
141
  this.arrowRef = el;
127
- } })), h("slot", { key: '78875aa9bcae3d3c1e0d9a49304e18fd09b50f41' }))));
142
+ } })), h("slot", { key: '74b1746bf48f8aa915c443721c1c2af1c1a3df5d' }))));
128
143
  }
129
144
  static get is() { return "post-popovercontainer"; }
130
145
  static get encapsulation() { return "shadow"; }
@@ -1,3 +1,3 @@
1
- .tab-title[role=tab]{display:inline-block;position:relative;box-sizing:border-box;padding:1rem;transition:background-color 100ms;border-right:1px solid rgba(0,0,0,0);border-left:1px solid rgba(0,0,0,0);outline-color:currentColor;opacity:.7;color:var(--post-contrast-color);text-decoration:none}.tab-title[role=tab]:focus{background-color:unset;color:var(--post-contrast-color)}.tab-title[role=tab]:hover{opacity:1;background-color:#fff;color:var(--post-contrast-color)}.tab-title[role=tab]:focus-visible{outline:rgba(0,0,0,0);opacity:1;background-color:#fff;color:var(--post-contrast-color);box-shadow:none}.tab-title[role=tab]:focus-visible::after{content:"";display:block;position:absolute;top:2px;right:1px;bottom:0;left:1px;box-shadow:0 0 0 1px #fff,0 0 0 2px #333}.tab-title[role=tab].active{z-index:1;border-right-color:#ccc;border-left-color:#ccc;opacity:1;background-color:#fff;color:var(--post-contrast-color);font-weight:700}.tab-title[role=tab].active::before{content:"";display:block;position:absolute;top:0;right:-1px;left:-1px;height:.25rem;background-color:#fc0}:is(.bg-dark,.bg-primary,.bg-black,.bg-success,.bg-danger,.bg-nightblue,.bg-nightblue-bright,.bg-petrol,.bg-coral,.bg-olive,.bg-purple,.bg-purple-bright,.bg-aubergine,.bg-aubergine-bright,.bg-error-red) .tab-title[role=tab]:hover{background-color:rgba(255,255,255,.2)}:is(.bg-dark,.bg-primary,.bg-black,.bg-success,.bg-danger,.bg-nightblue,.bg-nightblue-bright,.bg-petrol,.bg-coral,.bg-olive,.bg-purple,.bg-purple-bright,.bg-aubergine,.bg-aubergine-bright,.bg-error-red) .tab-title[role=tab]:focus-visible{background-color:rgba(255,255,255,.2)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.tab-title[role=tab]{opacity:1;border-left-color:Canvas;border-right-color:Canvas;color:LinkText}.tab-title[role=tab]:hover,.tab-title[role=tab]:focus,.tab-title[role=tab]:focus-within,.tab-title[role=tab]:focus-visible{outline:2px solid Highlight;outline-offset:-0.25rem}.tab-title[role=tab].active{border-left-color:ButtonText;border-right-color:ButtonText;color:Highlight}.tab-title[role=tab].active::before{background-color:Highlight}}.bg-yellow .tab-title{background-color:#fc0}.bg-yellow .tab-title.active{background-color:#fc0}.bg-yellow .nav-item{background-color:#fc0}.bg-light .tab-title{background-color:#faf9f8}.bg-light .tab-title.active{background-color:#faf9f8}.bg-light .nav-item{background-color:#faf9f8}.bg-gray .tab-title{background-color:#f4f3f1}.bg-gray .tab-title.active{background-color:#f4f3f1}.bg-gray .nav-item{background-color:#f4f3f1}.bg-dark .tab-title{background-color:#333}.bg-dark .tab-title.active{background-color:#333}.bg-dark .nav-item{background-color:#333}.bg-primary .tab-title{background-color:#333}.bg-primary .tab-title.active{background-color:#333}.bg-primary .nav-item{background-color:#333}.bg-white .tab-title{background-color:#fff}.bg-white .tab-title.active{background-color:#fff}.bg-white .nav-item{background-color:#fff}.bg-black .tab-title{background-color:#000}.bg-black .tab-title.active{background-color:#000}.bg-black .nav-item{background-color:#000}.bg-info .tab-title{background-color:#cce4ee}.bg-info .tab-title.active{background-color:#cce4ee}.bg-info .nav-item{background-color:#cce4ee}.bg-success .tab-title{background-color:#2c911c}.bg-success .tab-title.active{background-color:#2c911c}.bg-success .nav-item{background-color:#2c911c}.bg-warning .tab-title{background-color:#f49e00}.bg-warning .tab-title.active{background-color:#f49e00}.bg-warning .nav-item{background-color:#f49e00}.bg-danger .tab-title{background-color:#a51728}.bg-danger .tab-title.active{background-color:#a51728}.bg-danger .nav-item{background-color:#a51728}.bg-nightblue .tab-title{background-color:#004976}.bg-nightblue .tab-title.active{background-color:#004976}.bg-nightblue .nav-item{background-color:#004976}.bg-nightblue-bright .tab-title{background-color:#0076a8}.bg-nightblue-bright .tab-title.active{background-color:#0076a8}.bg-nightblue-bright .nav-item{background-color:#0076a8}.bg-petrol .tab-title{background-color:#006d68}.bg-petrol .tab-title.active{background-color:#006d68}.bg-petrol .nav-item{background-color:#006d68}.bg-petrol-bright .tab-title{background-color:#00968f}.bg-petrol-bright .tab-title.active{background-color:#00968f}.bg-petrol-bright .nav-item{background-color:#00968f}.bg-coral .tab-title{background-color:#9e2a2f}.bg-coral .tab-title.active{background-color:#9e2a2f}.bg-coral .nav-item{background-color:#9e2a2f}.bg-coral-bright .tab-title{background-color:#e03c31}.bg-coral-bright .tab-title.active{background-color:#e03c31}.bg-coral-bright .nav-item{background-color:#e03c31}.bg-olive .tab-title{background-color:#716135}.bg-olive .tab-title.active{background-color:#716135}.bg-olive .nav-item{background-color:#716135}.bg-olive-bright .tab-title{background-color:#aa9d2e}.bg-olive-bright .tab-title.active{background-color:#aa9d2e}.bg-olive-bright .nav-item{background-color:#aa9d2e}.bg-purple .tab-title{background-color:#80276c}.bg-purple .tab-title.active{background-color:#80276c}.bg-purple .nav-item{background-color:#80276c}.bg-purple-bright .tab-title{background-color:#c5299b}.bg-purple-bright .tab-title.active{background-color:#c5299b}.bg-purple-bright .nav-item{background-color:#c5299b}.bg-aubergine .tab-title{background-color:#523178}.bg-aubergine .tab-title.active{background-color:#523178}.bg-aubergine .nav-item{background-color:#523178}.bg-aubergine-bright .tab-title{background-color:#7566a0}.bg-aubergine-bright .tab-title.active{background-color:#7566a0}.bg-aubergine-bright .nav-item{background-color:#7566a0}.bg-success-green .tab-title{background-color:#2c871d}.bg-success-green .tab-title.active{background-color:#2c871d}.bg-success-green .nav-item{background-color:#2c871d}.bg-error-red .tab-title{background-color:#a51728}.bg-error-red .tab-title.active{background-color:#a51728}.bg-error-red .nav-item{background-color:#a51728}.bg-warning-orange .tab-title{background-color:#f49e00}.bg-warning-orange .tab-title.active{background-color:#f49e00}.bg-warning-orange .nav-item{background-color:#f49e00}.bg-success-background .tab-title{background-color:#c0debb}.bg-success-background .tab-title.active{background-color:#c0debb}.bg-success-background .nav-item{background-color:#c0debb}.bg-error-background .tab-title{background-color:#ffdade}.bg-error-background .tab-title.active{background-color:#ffdade}.bg-error-background .nav-item{background-color:#ffdade}.bg-warning-background .tab-title{background-color:#fce2b2}.bg-warning-background .tab-title.active{background-color:#fce2b2}.bg-warning-background .nav-item{background-color:#fce2b2}[class*=bg-] .tab-title.active:focus::after{background-color:rgba(255,255,255,.2)}@supports selector(*:focus-visible){[class*=bg-] .tab-title.active:focus::after{background-color:unset}[class*=bg-] .tab-title.active:focus-visible::after{background-color:rgba(255,255,255,.2)}}/*!
1
+ .tab-title[role=tab]{display:inline-block;position:relative;box-sizing:border-box;padding:1rem;transition:background-color 100ms;border-right:1px solid rgba(0,0,0,0);border-left:1px solid rgba(0,0,0,0);outline-color:currentColor;opacity:.7;color:var(--post-contrast-color);text-decoration:none}.tab-title[role=tab]:focus{background-color:unset;color:var(--post-contrast-color)}.tab-title[role=tab]:hover{opacity:1;background-color:#fff;color:var(--post-contrast-color)}.tab-title[role=tab]:focus-visible{outline:rgba(0,0,0,0);opacity:1;background-color:#fff;color:var(--post-contrast-color);box-shadow:none}.tab-title[role=tab]:focus-visible::after{content:"";display:block;position:absolute;top:2px;right:1px;bottom:0;left:1px;box-shadow:0 0 0 1px #fff,0 0 0 2px #333}.tab-title[role=tab].active{z-index:1;border-right-color:#ccc;border-left-color:#ccc;opacity:1;background-color:#fff;color:var(--post-contrast-color);font-weight:700}.tab-title[role=tab].active::before{content:"";display:block;position:absolute;top:0;right:-1px;left:-1px;height:.25rem;background-color:#fc0}:is(.bg-dark,.bg-primary,.bg-black,.bg-danger,.bg-nightblue,.bg-nightblue-bright,.bg-petrol,.bg-coral,.bg-olive,.bg-purple,.bg-purple-bright,.bg-aubergine,.bg-aubergine-bright,.bg-success-green,.bg-error-red) .tab-title[role=tab]:hover{background-color:rgba(255,255,255,.2)}:is(.bg-dark,.bg-primary,.bg-black,.bg-danger,.bg-nightblue,.bg-nightblue-bright,.bg-petrol,.bg-coral,.bg-olive,.bg-purple,.bg-purple-bright,.bg-aubergine,.bg-aubergine-bright,.bg-success-green,.bg-error-red) .tab-title[role=tab]:focus-visible{background-color:rgba(255,255,255,.2)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.tab-title[role=tab]{opacity:1;border-left-color:Canvas;border-right-color:Canvas;color:LinkText}.tab-title[role=tab]:hover,.tab-title[role=tab]:focus,.tab-title[role=tab]:focus-within,.tab-title[role=tab]:focus-visible{outline:2px solid Highlight;outline-offset:-0.25rem}.tab-title[role=tab].active{border-left-color:ButtonText;border-right-color:ButtonText;color:Highlight}.tab-title[role=tab].active::before{background-color:Highlight}}.bg-yellow .tab-title{background-color:#fc0}.bg-yellow .tab-title.active{background-color:#fc0}.bg-yellow .nav-item{background-color:#fc0}.bg-light .tab-title{background-color:#faf9f8}.bg-light .tab-title.active{background-color:#faf9f8}.bg-light .nav-item{background-color:#faf9f8}.bg-gray .tab-title{background-color:#f4f3f1}.bg-gray .tab-title.active{background-color:#f4f3f1}.bg-gray .nav-item{background-color:#f4f3f1}.bg-dark .tab-title{background-color:#333}.bg-dark .tab-title.active{background-color:#333}.bg-dark .nav-item{background-color:#333}.bg-primary .tab-title{background-color:#333}.bg-primary .tab-title.active{background-color:#333}.bg-primary .nav-item{background-color:#333}.bg-white .tab-title{background-color:#fff}.bg-white .tab-title.active{background-color:#fff}.bg-white .nav-item{background-color:#fff}.bg-black .tab-title{background-color:#000}.bg-black .tab-title.active{background-color:#000}.bg-black .nav-item{background-color:#000}.bg-info .tab-title{background-color:#cce4ee}.bg-info .tab-title.active{background-color:#cce4ee}.bg-info .nav-item{background-color:#cce4ee}.bg-success .tab-title{background-color:#2c911c}.bg-success .tab-title.active{background-color:#2c911c}.bg-success .nav-item{background-color:#2c911c}.bg-warning .tab-title{background-color:#f49e00}.bg-warning .tab-title.active{background-color:#f49e00}.bg-warning .nav-item{background-color:#f49e00}.bg-danger .tab-title{background-color:#a51728}.bg-danger .tab-title.active{background-color:#a51728}.bg-danger .nav-item{background-color:#a51728}.bg-nightblue .tab-title{background-color:#004976}.bg-nightblue .tab-title.active{background-color:#004976}.bg-nightblue .nav-item{background-color:#004976}.bg-nightblue-bright .tab-title{background-color:#0076a8}.bg-nightblue-bright .tab-title.active{background-color:#0076a8}.bg-nightblue-bright .nav-item{background-color:#0076a8}.bg-petrol .tab-title{background-color:#006d68}.bg-petrol .tab-title.active{background-color:#006d68}.bg-petrol .nav-item{background-color:#006d68}.bg-petrol-bright .tab-title{background-color:#00968f}.bg-petrol-bright .tab-title.active{background-color:#00968f}.bg-petrol-bright .nav-item{background-color:#00968f}.bg-coral .tab-title{background-color:#9e2a2f}.bg-coral .tab-title.active{background-color:#9e2a2f}.bg-coral .nav-item{background-color:#9e2a2f}.bg-coral-bright .tab-title{background-color:#e03c31}.bg-coral-bright .tab-title.active{background-color:#e03c31}.bg-coral-bright .nav-item{background-color:#e03c31}.bg-olive .tab-title{background-color:#716135}.bg-olive .tab-title.active{background-color:#716135}.bg-olive .nav-item{background-color:#716135}.bg-olive-bright .tab-title{background-color:#aa9d2e}.bg-olive-bright .tab-title.active{background-color:#aa9d2e}.bg-olive-bright .nav-item{background-color:#aa9d2e}.bg-purple .tab-title{background-color:#80276c}.bg-purple .tab-title.active{background-color:#80276c}.bg-purple .nav-item{background-color:#80276c}.bg-purple-bright .tab-title{background-color:#c5299b}.bg-purple-bright .tab-title.active{background-color:#c5299b}.bg-purple-bright .nav-item{background-color:#c5299b}.bg-aubergine .tab-title{background-color:#523178}.bg-aubergine .tab-title.active{background-color:#523178}.bg-aubergine .nav-item{background-color:#523178}.bg-aubergine-bright .tab-title{background-color:#7566a0}.bg-aubergine-bright .tab-title.active{background-color:#7566a0}.bg-aubergine-bright .nav-item{background-color:#7566a0}.bg-success-green .tab-title{background-color:#2c871d}.bg-success-green .tab-title.active{background-color:#2c871d}.bg-success-green .nav-item{background-color:#2c871d}.bg-error-red .tab-title{background-color:#a51728}.bg-error-red .tab-title.active{background-color:#a51728}.bg-error-red .nav-item{background-color:#a51728}.bg-warning-orange .tab-title{background-color:#f49e00}.bg-warning-orange .tab-title.active{background-color:#f49e00}.bg-warning-orange .nav-item{background-color:#f49e00}.bg-success-background .tab-title{background-color:#c0debb}.bg-success-background .tab-title.active{background-color:#c0debb}.bg-success-background .nav-item{background-color:#c0debb}.bg-error-background .tab-title{background-color:#ffdade}.bg-error-background .tab-title.active{background-color:#ffdade}.bg-error-background .nav-item{background-color:#ffdade}.bg-warning-background .tab-title{background-color:#fce2b2}.bg-warning-background .tab-title.active{background-color:#fce2b2}.bg-warning-background .nav-item{background-color:#fce2b2}[class*=bg-] .tab-title.active:focus::after{background-color:rgba(255,255,255,.2)}@supports selector(*:focus-visible){[class*=bg-] .tab-title.active:focus::after{background-color:unset}[class*=bg-] .tab-title.active:focus-visible::after{background-color:rgba(255,255,255,.2)}}/*!
2
2
  * Copyright 2021 by Swiss Post, Information Technology
3
3
  */:host{display:block}.tab-title{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;-webkit-appearance:button;appearance:button}
@@ -1 +1 @@
1
- :host{--post-contrast-color: #fff;--post-bg-rgb: 51, 51, 51}post-popovercontainer::part(popover){padding:.25rem .5rem;max-width:13.5rem;min-height:1rem}
1
+ :host{--post-contrast-color: #fff;--post-bg-rgb: 51, 51, 51}post-popovercontainer::part(popover){padding:.25rem .5rem;max-width:13.5rem;min-height:1rem}post-popovercontainer.has-arrow::part(popover)::after{position:absolute;content:"";inset:-13px;z-index:-1}
@@ -1,19 +1,85 @@
1
1
  import { h, Host } from "@stencil/core";
2
+ import { version } from "../../../package.json";
2
3
  import isFocusable from "ally.js/is/focusable";
3
- // Patch for long press on touch devices
4
4
  import "long-press-event";
5
- import { version } from "../../../package.json";
5
+ import { getAttributeObserver } from "../../utils/attribute-observer";
6
6
  /**
7
7
  * @slot default - Slot for the content of the tooltip.
8
8
  */
9
+ /**
10
+ * Track how many instances remain on the page. Used for removing global event listeners
11
+ */
12
+ let tooltipInstances = 0;
13
+ let hideTooltipTimeout = null;
14
+ const tooltipTargetAttribute = 'data-tooltip-target';
15
+ /**
16
+ * Global event listener to show tooltips. This is globalized so that triggers that are rendered
17
+ * async will still work without the need to set listeners on the element itself
18
+ * @param e Event
19
+ * @returns
20
+ */
21
+ const globalInterestHandler = (e) => {
22
+ const target = e.target;
23
+ if (!target || !('getAttribute' in target))
24
+ return;
25
+ const tooltipTarget = target.getAttribute(tooltipTargetAttribute);
26
+ if (!tooltipTarget || tooltipTarget === '')
27
+ return;
28
+ const tooltip = document.getElementById(tooltipTarget);
29
+ tooltip === null || tooltip === void 0 ? void 0 : tooltip.show(target);
30
+ if (hideTooltipTimeout) {
31
+ window.clearTimeout(hideTooltipTimeout);
32
+ hideTooltipTimeout = null;
33
+ }
34
+ };
35
+ /**
36
+ * Global event listener to hide tooltips. This is globalized so that triggers that are rendered
37
+ * async will still work without the need to set listeners on the element itself
38
+ * @param e Event
39
+ * @returns
40
+ */
41
+ const globalInterestLostHandler = (e) => {
42
+ const target = e.target;
43
+ const tooltipTarget = target.getAttribute(tooltipTargetAttribute);
44
+ if (!tooltipTarget || tooltipTarget === '')
45
+ return;
46
+ const tooltip = document.getElementById(tooltipTarget);
47
+ globalHideTooltip(tooltip);
48
+ };
49
+ /**
50
+ * Start the hiding process through a timeout to give other interest events a chance to
51
+ * intervene and cancel the hide event.
52
+ * @param {HTMLPostTooltipElement} tooltip
53
+ */
54
+ const globalHideTooltip = (tooltip) => {
55
+ hideTooltipTimeout = window.setTimeout(() => {
56
+ tooltip.hide();
57
+ hideTooltipTimeout = null;
58
+ }, 42);
59
+ };
60
+ /**
61
+ * Patch some accessibility features that are hard to remember or understand
62
+ * @param {HTMLElement} trigger
63
+ */
64
+ const patchAccessibilityFeatures = (trigger) => {
65
+ const describedBy = trigger.getAttribute('aria-describedby');
66
+ const id = trigger.getAttribute(tooltipTargetAttribute);
67
+ // Add tooltip to aria-describedby
68
+ if (!(describedBy === null || describedBy === void 0 ? void 0 : describedBy.includes(id))) {
69
+ const newDescribedBy = describedBy ? `${describedBy} ${id}` : id;
70
+ trigger.setAttribute('aria-describedby', newDescribedBy);
71
+ }
72
+ // Make element focusable
73
+ if (!isFocusable(trigger)) {
74
+ trigger.setAttribute('tabindex', '0');
75
+ }
76
+ };
77
+ // Initialize a mutation observer for patching accessibility features
78
+ const triggerObserver = getAttributeObserver(tooltipTargetAttribute, patchAccessibilityFeatures);
9
79
  export class PostTooltip {
10
80
  constructor() {
11
81
  this.placement = 'top';
12
82
  this.arrow = true;
13
- // Create local versions of event handlers for de-registration
14
- // https://stackoverflow.com/questions/33859113/javascript-removeeventlistener-not-working-inside-a-class
15
- this.localShowTooltip = e => this.show(e.target);
16
- this.localHideTooltip = this.hide.bind(this);
17
83
  }
18
84
  connectedCallback() {
19
85
  if (!this.host.id) {
@@ -21,29 +87,45 @@ export class PostTooltip {
21
87
  /*prettier-ignore*/
22
88
  'No id set: <post-tooltip> must have an id, linking it to it\'s target element using the data-tooltip-target attribute.');
23
89
  }
24
- if (!this.triggers) {
25
- throw new Error(`No trigger found for <post-tooltip id="${this.host.id}">, please add the 'data-tooltip-target="${this.host.id}" attribute to the trigger element.`);
90
+ }
91
+ /**
92
+ * Add interest event listeners, but only once, and start
93
+ * the accessibility patcher
94
+ */
95
+ componentWillLoad() {
96
+ if (tooltipInstances === 0) {
97
+ // This is the first tooltip on the page, add event listeners
98
+ document.addEventListener('pointerover', globalInterestHandler);
99
+ document.addEventListener('pointerout', globalInterestLostHandler);
100
+ document.addEventListener('focusin', globalInterestHandler);
101
+ document.addEventListener('focusout', globalInterestLostHandler);
102
+ document.addEventListener('long-press', globalInterestHandler);
103
+ // Initially run the accessibility patcher on all triggers
104
+ document.querySelectorAll('[data-tooltip-target]').forEach(patchAccessibilityFeatures);
105
+ // Start watching for future triggers
106
+ triggerObserver.observe(document.body, {
107
+ subtree: true,
108
+ childList: true,
109
+ attributeFilter: [tooltipTargetAttribute],
110
+ });
26
111
  }
27
- // Patch popovertargetaction="interest" until it's implemented
28
- // https://github.com/openui/open-ui/issues/767#issuecomment-1654177227
29
- this.triggers.forEach(trigger => this.patchPopoverTargetActionInterest(trigger));
112
+ tooltipInstances++;
30
113
  }
31
114
  /**
32
115
  * Remove a bunch of event listeners if the tooltip gets removed from the DOM
116
+ * and disconnect the accessibility patcher
33
117
  */
34
118
  disconnectedCallback() {
35
- this.triggers.forEach(trigger => {
36
- trigger.removeEventListener('mouseenter', this.localShowTooltip);
37
- trigger.removeEventListener('mouseleave', this.localHideTooltip);
38
- trigger.removeEventListener('focus', this.localShowTooltip);
39
- trigger.removeEventListener('blur', this.localHideTooltip);
40
- trigger.removeEventListener('long-press', this.localShowTooltip);
41
- });
42
- }
43
- componentWillLoad() {
44
- // Append tooltip host to the end of the body to get around overflow: hidden restrictions
45
- // for browsers that don't support popover yet
46
- document.body.appendChild(this.host);
119
+ tooltipInstances--;
120
+ if (tooltipInstances <= 0) {
121
+ // The last tooltip has been removed, stop listening for these kind of events
122
+ document.removeEventListener('pointerover', globalInterestHandler);
123
+ document.removeEventListener('pointerout', globalInterestLostHandler);
124
+ document.removeEventListener('focusin', globalInterestHandler);
125
+ document.removeEventListener('focusout', globalInterestLostHandler);
126
+ document.removeEventListener('long-press', globalInterestHandler);
127
+ triggerObserver.disconnect();
128
+ }
47
129
  }
48
130
  /**
49
131
  * Programmatically display the tooltip
@@ -66,28 +148,24 @@ export class PostTooltip {
66
148
  async toggle(target, force) {
67
149
  this.popoverRef.toggle(target, force);
68
150
  }
69
- get triggers() {
70
- return document.querySelectorAll(`[data-tooltip-target="${this.host.id}"]`);
71
- }
72
- patchPopoverTargetActionInterest(trigger) {
73
- trigger.addEventListener('mouseenter', this.localShowTooltip);
74
- trigger.addEventListener('mouseleave', this.localHideTooltip);
75
- trigger.addEventListener('focus', this.localShowTooltip);
76
- trigger.addEventListener('blur', this.localHideTooltip);
77
- trigger.addEventListener('long-press', this.localShowTooltip);
78
- // Patch missing aria-describedby attribute on the trigger without overriding existing values
79
- const describedBy = trigger.getAttribute('aria-describedby');
80
- if (!(describedBy === null || describedBy === void 0 ? void 0 : describedBy.includes(this.host.id))) {
81
- const newDescribedBy = describedBy ? `${describedBy} ${this.host.id}` : this.host.id;
82
- trigger.setAttribute('aria-describedby', newDescribedBy);
83
- }
84
- // Patch missing focus ability on the trigger element
85
- if (!isFocusable(trigger)) {
86
- trigger.setAttribute('tabindex', '0');
151
+ /**
152
+ * Pointer or focus is on the tooltip, stop the tooltip from disappearing
153
+ */
154
+ handleInterest() {
155
+ if (hideTooltipTimeout) {
156
+ window.clearTimeout(hideTooltipTimeout);
157
+ hideTooltipTimeout = null;
87
158
  }
88
159
  }
160
+ /**
161
+ * Pointer or focus left the tooltip, initiate the hiding process
162
+ */
163
+ handleInterestLost() {
164
+ globalHideTooltip(this);
165
+ }
89
166
  render() {
90
- return (h(Host, { key: 'e4a9dcb08b0e468e83bc6655d1cbece256a5299c', "data-version": version }, h("post-popovercontainer", { key: '819cafc2521bc4d9a69fda5a30a24f1e6c158272', role: "tooltip", tabindex: "-1", arrow: this.arrow, placement: this.placement, ref: (el) => (this.popoverRef = el) }, h("slot", { key: '1432f96849a598a2be823acc7e96d70ab539df0c' }))));
167
+ const popoverClass = `${this.arrow ? ' has-arrow' : ''}`;
168
+ return (h(Host, { key: 'cf89d38b05fbb49ecfcfd339baf325a4fb850f3a', "data-version": version, role: "tooltip", onPointerOver: this.handleInterest, onPointerOut: this.handleInterestLost, onFocusIn: this.handleInterest, onFocusOut: this.handleInterestLost }, h("post-popovercontainer", { key: '2f6f473007ae8d4fc7ef3bcec38a8f19222eaf5d', class: popoverClass, arrow: this.arrow, placement: this.placement, ref: (el) => (this.popoverRef = el) }, h("slot", { key: '84bfd25818068ce1fb644b3b0e6858f9cb1bd605' }))));
91
169
  }
92
170
  static get is() { return "post-tooltip"; }
93
171
  static get encapsulation() { return "shadow"; }