@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.
- package/dist/cjs/attribute-observer-10f08c04.js +27 -0
- package/dist/cjs/index.cjs.js +13 -12
- package/dist/cjs/{package-0645dd08.js → package-628f6e9c.js} +1 -1
- package/dist/cjs/{post-accordion-64aa88cf.js → post-accordion-da546aa2.js} +1 -1
- package/dist/cjs/{post-accordion-item-51df1dfa.js → post-accordion-item-33d5593a.js} +3 -3
- package/dist/cjs/post-accordion-item.cjs.entry.js +2 -2
- package/dist/cjs/post-accordion.cjs.entry.js +2 -2
- package/dist/cjs/post-alert-26c1bcda.js +98 -0
- package/dist/cjs/post-alert.cjs.entry.js +2 -2
- package/dist/cjs/{post-collapsible-84416953.js → post-collapsible-278b2a71.js} +1 -1
- package/dist/cjs/post-collapsible.cjs.entry.js +2 -2
- package/dist/cjs/{post-icon-5fc20211.js → post-icon-fd09bc54.js} +2 -2
- package/dist/cjs/post-icon.cjs.entry.js +2 -2
- package/dist/cjs/post-popover-1e454296.js +104 -0
- package/dist/cjs/post-popover.cjs.entry.js +3 -2
- package/dist/cjs/{post-popovercontainer-cc5fa030.js → post-popovercontainer-5e355de3.js} +26 -11
- package/dist/cjs/post-popovercontainer.cjs.entry.js +2 -2
- package/dist/cjs/post-tab-header-5c8b9a0d.js +32 -0
- package/dist/cjs/post-tab-header.cjs.entry.js +2 -2
- package/dist/cjs/{post-tab-panel-1143ea40.js → post-tab-panel-67ba226d.js} +1 -1
- package/dist/cjs/post-tab-panel.cjs.entry.js +2 -2
- package/dist/cjs/{post-tabs-7ef36ff6.js → post-tabs-71510ced.js} +1 -1
- package/dist/cjs/post-tabs.cjs.entry.js +2 -2
- package/dist/cjs/{post-tooltip-45784e17.js → post-tooltip-b6bbb3e4.js} +124 -42
- package/dist/cjs/post-tooltip.cjs.entry.js +3 -2
- package/dist/collection/components/post-accordion-item/post-accordion-item.css +1 -1
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +1 -1
- package/dist/collection/components/post-alert/post-alert.css +5 -5
- package/dist/collection/components/post-icon/post-icon.css +1 -1
- package/dist/collection/components/post-popover/post-popover.css +1 -1
- package/dist/collection/components/post-popover/post-popover.js +47 -63
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -1
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +25 -10
- package/dist/collection/components/post-tab-header/post-tab-header.css +1 -1
- package/dist/collection/components/post-tooltip/post-tooltip.css +1 -1
- package/dist/collection/components/post-tooltip/post-tooltip.js +120 -42
- package/dist/collection/utils/attribute-observer.js +23 -0
- package/dist/components/attribute-observer.js +25 -0
- package/dist/components/package.js +1 -1
- package/dist/components/post-accordion-item2.js +2 -2
- package/dist/components/post-alert2.js +1 -1
- package/dist/components/post-icon2.js +1 -1
- package/dist/components/post-popover2.js +51 -64
- package/dist/components/post-popovercontainer2.js +25 -10
- package/dist/components/post-tab-header2.js +1 -1
- package/dist/components/post-tooltip2.js +123 -41
- package/dist/docs.json +5 -25
- package/dist/esm/attribute-observer-37fa950a.js +25 -0
- package/dist/esm/index.js +13 -12
- package/dist/esm/{package-37a68f71.js → package-15929f57.js} +1 -1
- package/dist/esm/{post-accordion-8872dc1b.js → post-accordion-be080240.js} +1 -1
- package/dist/esm/{post-accordion-item-02b9f01c.js → post-accordion-item-7b3c726b.js} +3 -3
- package/dist/esm/post-accordion-item.entry.js +2 -2
- package/dist/esm/post-accordion.entry.js +2 -2
- package/dist/esm/post-alert-37f853eb.js +96 -0
- package/dist/esm/post-alert.entry.js +2 -2
- package/dist/esm/{post-collapsible-1f23fe7d.js → post-collapsible-967bb191.js} +1 -1
- package/dist/esm/post-collapsible.entry.js +2 -2
- package/dist/esm/{post-icon-2ec2127e.js → post-icon-ba163099.js} +2 -2
- package/dist/esm/post-icon.entry.js +2 -2
- package/dist/esm/post-popover-69694fa6.js +102 -0
- package/dist/esm/post-popover.entry.js +3 -2
- package/dist/esm/{post-popovercontainer-4a48161f.js → post-popovercontainer-da870ff0.js} +26 -11
- package/dist/esm/post-popovercontainer.entry.js +2 -2
- package/dist/esm/post-tab-header-14ed99cd.js +30 -0
- package/dist/esm/post-tab-header.entry.js +2 -2
- package/dist/esm/{post-tab-panel-da24046f.js → post-tab-panel-d89c4c50.js} +1 -1
- package/dist/esm/post-tab-panel.entry.js +2 -2
- package/dist/esm/{post-tabs-21a5dfeb.js → post-tabs-e995886a.js} +1 -1
- package/dist/esm/post-tabs.entry.js +2 -2
- package/dist/esm/{post-tooltip-4f4f87b4.js → post-tooltip-0ec6a388.js} +124 -42
- package/dist/esm/post-tooltip.entry.js +3 -2
- package/dist/post-components/index.esm.js +1 -1
- package/dist/post-components/p-00ab91d9.entry.js +1 -0
- package/dist/post-components/p-04f47e54.entry.js +1 -0
- package/dist/post-components/{p-e836df41.js → p-1f284e66.js} +1 -1
- package/dist/post-components/p-209e33a5.js +1 -0
- package/dist/post-components/p-282e21c2.entry.js +1 -0
- package/dist/post-components/p-34a772e3.entry.js +1 -0
- package/dist/post-components/p-46c47aa4.entry.js +1 -0
- package/dist/post-components/{p-73a7d4f9.js → p-51fe19e0.js} +1 -1
- package/dist/post-components/p-557f0f10.entry.js +1 -0
- package/dist/post-components/p-5ecceba0.js +1 -0
- package/dist/post-components/p-61d98756.js +1 -0
- package/dist/post-components/p-6adeaa6c.js +1 -0
- package/dist/post-components/{p-aee1750c.js → p-6b3ba10a.js} +1 -1
- package/dist/post-components/p-82f4f464.entry.js +1 -0
- package/dist/post-components/p-94256868.js +15 -0
- package/dist/post-components/p-98cb0bbd.entry.js +1 -0
- package/dist/post-components/p-9ee95668.entry.js +1 -0
- package/dist/post-components/p-a0d342e4.entry.js +1 -0
- package/dist/post-components/{p-c1c8f2ec.js → p-a9d59b04.js} +1 -1
- package/dist/post-components/p-ac7b779e.js +1 -0
- package/dist/post-components/p-d9c9ed63.js +1 -0
- package/dist/post-components/p-e1bf894f.entry.js +1 -0
- package/dist/post-components/p-e8d17225.js +1 -0
- package/dist/post-components/p-f47b0207.js +1 -0
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/components/post-popover/post-popover.d.ts +3 -17
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +1 -0
- package/dist/types/components/post-tooltip/post-tooltip.d.ts +14 -9
- package/dist/types/utils/attribute-observer.d.ts +1 -0
- package/package.json +4 -3
- package/dist/cjs/post-alert-ac59385a.js +0 -98
- package/dist/cjs/post-popover-be868244.js +0 -117
- package/dist/cjs/post-tab-header-5a7070e9.js +0 -32
- package/dist/esm/post-alert-1a766c15.js +0 -96
- package/dist/esm/post-popover-f6029c96.js +0 -115
- package/dist/esm/post-tab-header-63676360.js +0 -30
- package/dist/post-components/p-0b46c9ba.entry.js +0 -1
- package/dist/post-components/p-21557c34.js +0 -15
- package/dist/post-components/p-2b67b933.js +0 -1
- package/dist/post-components/p-47fd6eb0.js +0 -1
- package/dist/post-components/p-548ee455.entry.js +0 -1
- package/dist/post-components/p-63b6c589.entry.js +0 -1
- package/dist/post-components/p-66f346fb.entry.js +0 -1
- package/dist/post-components/p-7973e3e4.js +0 -1
- package/dist/post-components/p-829f9eaf.entry.js +0 -1
- package/dist/post-components/p-82facb04.js +0 -1
- package/dist/post-components/p-8aa01298.js +0 -1
- package/dist/post-components/p-9170d84d.entry.js +0 -1
- package/dist/post-components/p-959f83c0.entry.js +0 -1
- package/dist/post-components/p-9bc7ed9e.entry.js +0 -1
- package/dist/post-components/p-a3fc7eaf.js +0 -1
- package/dist/post-components/p-a762b512.entry.js +0 -1
- package/dist/post-components/p-ccd827a1.js +0 -1
- package/dist/post-components/p-d25e401c.entry.js +0 -1
- 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;
|
|
30
|
-
(100% -
|
|
31
|
-
);background-position-x:calc((100% -
|
|
32
|
-
(100% -
|
|
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.
|
|
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
|
-
|
|
23
|
-
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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(`[
|
|
85
|
+
return document.querySelectorAll(`[${popoverTargetAttribute}="${this.host.id}"]`);
|
|
74
86
|
}
|
|
75
|
-
|
|
76
|
-
|
|
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: '
|
|
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:
|
|
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,
|
|
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.
|
|
36
|
-
|
|
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.
|
|
43
|
-
|
|
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
|
-
|
|
52
|
-
this.
|
|
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: '
|
|
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: '
|
|
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-
|
|
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 {
|
|
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
|
-
|
|
25
|
-
|
|
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
|
-
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
-
|
|
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"; }
|