@swisspost/design-system-components 9.0.0-next.33 → 9.0.0-next.35
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-6d8b886b.js → attribute-observer-c3a805b2.js} +3 -1
- package/dist/cjs/{breakpoints-c6247c71.js → breakpoints-cdf1b747.js} +12 -7
- package/dist/cjs/get-root-8102fecd.js +17 -0
- package/dist/cjs/{index-d6bf2c66.js → index-b60129c4.js} +4 -4
- package/dist/cjs/index.cjs.js +25 -26
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/long-press-event-6e62d113.js +266 -0
- package/dist/cjs/{package-3562c265.js → package-19b74b08.js} +1 -1
- package/dist/cjs/{post-accordion-6c5681ba.js → post-accordion-785f602b.js} +5 -5
- package/dist/cjs/{post-accordion-item-05a78451.js → post-accordion-item-8e1c9bdb.js} +5 -5
- package/dist/cjs/post-accordion-item.cjs.entry.js +5 -4
- package/dist/cjs/post-accordion.cjs.entry.js +4 -3
- package/dist/cjs/{post-avatar-6710a77a.js → post-avatar-eecfd222.js} +6 -5
- package/dist/cjs/post-avatar.cjs.entry.js +4 -3
- package/dist/cjs/{post-back-to-top-d0662842.js → post-back-to-top-49a3abcb.js} +9 -9
- package/dist/cjs/post-back-to-top.cjs.entry.js +4 -3
- package/dist/cjs/{post-banner-bd97db9c.js → post-banner-249ec2ff.js} +5 -9
- package/dist/cjs/post-banner.cjs.entry.js +4 -3
- package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +4 -3
- package/dist/cjs/{post-breadcrumb-36ab841c.js → post-breadcrumbs-f51590d1.js} +39 -31
- package/dist/cjs/post-breadcrumbs.cjs.entry.js +13 -0
- package/dist/cjs/post-card-control-d0a47015.js +269 -0
- package/dist/cjs/post-card-control.cjs.entry.js +4 -3
- package/dist/cjs/post-closebutton_15.cjs.entry.js +5 -5
- package/dist/cjs/{post-collapsible-trigger-6601c554.js → post-collapsible-trigger-4784edb2.js} +24 -41
- package/dist/cjs/post-collapsible_2.cjs.entry.js +5 -5
- package/dist/cjs/post-components.cjs.js +2 -2
- package/dist/cjs/{post-footer-23699aef.js → post-footer-9d078cb1.js} +11 -11
- package/dist/cjs/post-footer.cjs.entry.js +4 -4
- package/dist/cjs/{post-linkarea-8e5e1a9f.js → post-linkarea-e4ce3960.js} +5 -5
- package/dist/cjs/post-linkarea.cjs.entry.js +3 -3
- package/dist/cjs/{post-menu-item-8dd94792.js → post-menu-item-e9ebd27a.js} +4 -4
- package/dist/cjs/post-popover-5db53ead.js +112 -0
- package/dist/cjs/post-popover.cjs.entry.js +5 -4
- package/dist/cjs/{post-rating-ef592484.js → post-rating-98a06828.js} +5 -15
- package/dist/cjs/post-rating.cjs.entry.js +3 -3
- package/dist/cjs/{post-tab-header-d785e7fc.js → post-tab-header-c8e92f77.js} +6 -5
- package/dist/cjs/post-tab-header.cjs.entry.js +4 -3
- package/dist/cjs/{post-tab-panel-41ea371e.js → post-tab-panel-d966ee38.js} +4 -4
- package/dist/cjs/post-tab-panel.cjs.entry.js +3 -3
- package/dist/cjs/{post-tabs-c6f00130.js → post-tabs-83d99b69.js} +5 -12
- package/dist/cjs/post-tabs.cjs.entry.js +4 -3
- package/dist/cjs/post-tag-a1d78e75.js +47 -0
- package/dist/cjs/post-tag.cjs.entry.js +3 -3
- package/dist/cjs/{post-togglebutton-02c56b7b.js → post-togglebutton-e4651aad.js} +939 -464
- package/dist/cjs/{post-tooltip-3176e280.js → post-tooltip-bb862241.js} +39 -296
- package/dist/cjs/post-tooltip.cjs.entry.js +5 -4
- package/dist/collection/animations/collapse.js +3 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/post-accordion/post-accordion.js +1 -3
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +0 -2
- package/dist/collection/components/post-avatar/post-avatar.css +1 -3
- package/dist/collection/components/post-avatar/post-avatar.js +3 -4
- package/dist/collection/components/post-back-to-top/post-back-to-top.js +6 -8
- package/dist/collection/components/post-banner/post-banner.css +1 -3
- package/dist/collection/components/post-banner/post-banner.js +0 -6
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +0 -2
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.css +1 -0
- package/dist/collection/components/{post-breadcrumb/post-breadcrumb.js → post-breadcrumbs/post-breadcrumbs.js} +24 -27
- package/dist/collection/components/post-card-control/post-card-control.css +1 -3
- package/dist/collection/components/post-card-control/post-card-control.js +24 -40
- package/dist/collection/components/post-closebutton/post-closebutton.css +1 -0
- package/dist/collection/components/post-closebutton/post-closebutton.js +12 -2
- package/dist/collection/components/post-collapsible/post-collapsible.js +4 -10
- package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +15 -28
- package/dist/collection/components/post-footer/post-footer.js +8 -9
- package/dist/collection/components/post-header/post-header.css +1 -1
- package/dist/collection/components/post-header/post-header.js +13 -22
- package/dist/collection/components/post-icon/post-icon.js +4 -6
- package/dist/collection/components/post-language-option/post-language-option.css +1 -3
- package/dist/collection/components/post-language-option/post-language-option.js +1 -10
- package/dist/collection/components/post-language-switch/post-language-switch.js +7 -19
- package/dist/collection/components/post-linkarea/post-linkarea.css +1 -1
- package/dist/collection/components/post-linkarea/post-linkarea.js +2 -2
- package/dist/collection/components/post-list/post-list.css +1 -3
- package/dist/collection/components/post-list/post-list.js +1 -3
- package/dist/collection/components/post-list-item/post-list-item.js +1 -2
- package/dist/collection/components/post-logo/post-logo.js +1 -2
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +1 -1
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +98 -182
- package/dist/collection/components/post-megadropdown/post-megadropdown.js +20 -30
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +36 -37
- package/dist/collection/components/post-menu/post-menu.css +1 -3
- package/dist/collection/components/post-menu/post-menu.js +47 -55
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +13 -15
- package/dist/collection/components/post-popover/post-popover.css +1 -3
- package/dist/collection/components/post-popover/post-popover.js +13 -13
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +30 -33
- package/dist/collection/components/post-rating/post-rating.css +1 -3
- package/dist/collection/components/post-rating/post-rating.js +1 -12
- package/dist/collection/components/post-tab-header/post-tab-header.css +1 -3
- package/dist/collection/components/post-tab-header/post-tab-header.js +2 -3
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +2 -3
- package/dist/collection/components/post-tabs/post-tabs.js +1 -10
- package/dist/collection/components/post-tag/post-tag.css +1 -3
- package/dist/collection/components/post-tag/post-tag.js +1 -2
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +10 -11
- package/dist/collection/components/post-tooltip/post-tooltip.js +37 -33
- package/dist/collection/index.js +1 -1
- package/dist/collection/utils/attribute-observer.js +2 -1
- package/dist/collection/utils/breakpoints.js +9 -7
- package/dist/collection/utils/environment.js +2 -0
- package/dist/collection/utils/get-root.js +6 -1
- package/dist/collection/utils/index.js +5 -0
- package/dist/collection/utils/is-motion-reduced.js +2 -1
- package/dist/components/attribute-observer.js +3 -1
- package/dist/components/breakpoints.js +12 -8
- package/dist/components/get-root.js +7 -1
- package/dist/components/index.js +1 -1
- package/dist/components/long-press-event.js +264 -0
- package/dist/components/package.js +1 -1
- package/dist/components/post-accordion-item2.js +3 -3
- package/dist/components/post-accordion2.js +3 -3
- package/dist/components/post-avatar2.js +5 -4
- package/dist/components/post-back-to-top2.js +8 -8
- package/dist/components/post-banner2.js +3 -7
- package/dist/components/post-breadcrumb-item2.js +2 -2
- package/dist/components/{post-breadcrumb.d.ts → post-breadcrumbs.d.ts} +4 -4
- package/dist/components/post-breadcrumbs.js +6 -0
- package/dist/components/{post-breadcrumb2.js → post-breadcrumbs2.js} +41 -33
- package/dist/components/post-card-control2.js +26 -40
- package/dist/components/post-closebutton2.js +8 -3
- package/dist/components/post-collapsible-trigger2.js +19 -31
- package/dist/components/post-collapsible2.js +9 -12
- package/dist/components/post-footer2.js +8 -8
- package/dist/components/post-header2.js +15 -23
- package/dist/components/post-icon2.js +5 -5
- package/dist/components/post-language-option2.js +4 -11
- package/dist/components/post-language-switch2.js +9 -18
- package/dist/components/post-linkarea2.js +5 -4
- package/dist/components/post-list-item2.js +2 -2
- package/dist/components/post-list2.js +3 -4
- package/dist/components/post-logo2.js +3 -2
- package/dist/components/post-mainnavigation2.js +94 -182
- package/dist/components/post-megadropdown-trigger2.js +38 -37
- package/dist/components/post-megadropdown2.js +21 -30
- package/dist/components/post-menu-trigger2.js +15 -15
- package/dist/components/post-menu2.js +50 -56
- package/dist/components/post-popover2.js +15 -13
- package/dist/components/post-popovercontainer2.js +638 -36
- package/dist/components/post-rating2.js +3 -13
- package/dist/components/post-tab-header2.js +5 -4
- package/dist/components/post-tab-panel2.js +3 -3
- package/dist/components/post-tabs2.js +3 -10
- package/dist/components/post-tag2.js +2 -2
- package/dist/components/post-togglebutton2.js +12 -11
- package/dist/components/post-tooltip2.js +37 -294
- package/dist/docs.json +107 -101
- package/dist/esm/{attribute-observer-2f203993.js → attribute-observer-009deee5.js} +3 -1
- package/dist/esm/{breakpoints-bbe0c54e.js → breakpoints-7812702e.js} +12 -8
- package/dist/esm/get-root-1b1af46f.js +15 -0
- package/dist/esm/{index-3419e46d.js → index-f4d19816.js} +4 -4
- package/dist/esm/index.js +24 -25
- package/dist/esm/loader.js +3 -3
- package/dist/esm/long-press-event-04d24397.js +264 -0
- package/dist/esm/package-791f9257.js +3 -0
- package/dist/esm/{post-accordion-024451fa.js → post-accordion-4de9963b.js} +5 -5
- package/dist/esm/{post-accordion-item-19b996d1.js → post-accordion-item-2cbb32f9.js} +5 -5
- package/dist/esm/post-accordion-item.entry.js +5 -4
- package/dist/esm/post-accordion.entry.js +4 -3
- package/dist/esm/{post-avatar-33aed045.js → post-avatar-0aaefe87.js} +6 -5
- package/dist/esm/post-avatar.entry.js +4 -3
- package/dist/esm/{post-back-to-top-7dd43c3b.js → post-back-to-top-24eef0a0.js} +9 -9
- package/dist/esm/post-back-to-top.entry.js +4 -3
- package/dist/esm/{post-banner-28d18721.js → post-banner-1f37f9f0.js} +5 -9
- package/dist/esm/post-banner.entry.js +4 -3
- package/dist/esm/post-breadcrumb-item_2.entry.js +4 -3
- package/dist/esm/{post-breadcrumb-d86fae7b.js → post-breadcrumbs-2fcccf9f.js} +39 -31
- package/dist/esm/post-breadcrumbs.entry.js +5 -0
- package/dist/esm/post-card-control-75e8d336.js +267 -0
- package/dist/esm/post-card-control.entry.js +4 -3
- package/dist/esm/post-closebutton_15.entry.js +5 -5
- package/dist/esm/{post-collapsible-trigger-b1612866.js → post-collapsible-trigger-08b79162.js} +24 -41
- package/dist/esm/post-collapsible_2.entry.js +5 -5
- package/dist/esm/post-components.js +3 -3
- package/dist/esm/{post-footer-2ed5e520.js → post-footer-01677010.js} +11 -11
- package/dist/esm/post-footer.entry.js +4 -4
- package/dist/esm/{post-linkarea-802bf774.js → post-linkarea-4a178d51.js} +5 -5
- package/dist/esm/post-linkarea.entry.js +3 -3
- package/dist/esm/{post-menu-item-d97611d8.js → post-menu-item-199477fd.js} +4 -4
- package/dist/esm/post-popover-2a6a13d8.js +110 -0
- package/dist/esm/post-popover.entry.js +5 -4
- package/dist/esm/{post-rating-e1ac47ce.js → post-rating-fcf24658.js} +5 -15
- package/dist/esm/post-rating.entry.js +3 -3
- package/dist/esm/{post-tab-header-06dcbf7f.js → post-tab-header-aaa2f0b8.js} +6 -5
- package/dist/esm/post-tab-header.entry.js +4 -3
- package/dist/esm/{post-tab-panel-75932601.js → post-tab-panel-91f35995.js} +4 -4
- package/dist/esm/post-tab-panel.entry.js +3 -3
- package/dist/esm/{post-tabs-3ef2ea23.js → post-tabs-8657f2d6.js} +5 -12
- package/dist/esm/post-tabs.entry.js +4 -3
- package/dist/esm/post-tag-19141551.js +45 -0
- package/dist/esm/post-tag.entry.js +3 -3
- package/dist/esm/{post-togglebutton-db251030.js → post-togglebutton-40cac8c2.js} +939 -464
- package/dist/esm/{post-tooltip-c256d714.js → post-tooltip-165eb353.js} +39 -296
- package/dist/esm/post-tooltip.entry.js +5 -4
- package/dist/post-components/index.esm.js +1 -1
- package/dist/post-components/p-01544069.js +1 -0
- package/dist/post-components/p-02d0c370.js +1 -0
- package/dist/post-components/p-03169497.js +1 -0
- package/dist/post-components/p-06bf6b81.entry.js +1 -0
- package/dist/post-components/p-0ca39161.entry.js +1 -0
- package/dist/post-components/p-0f398677.js +1 -0
- package/dist/post-components/p-10f9d25e.js +1 -0
- package/dist/post-components/p-15da2cf9.js +1 -0
- package/dist/post-components/p-1622ed8c.js +1 -0
- package/dist/post-components/p-1d5e275b.js +1 -0
- package/dist/post-components/p-2a90f66c.js +1 -0
- package/dist/post-components/p-32aa68ac.entry.js +1 -0
- package/dist/post-components/p-3d30acad.entry.js +1 -0
- package/dist/post-components/p-48cd3157.js +1 -0
- package/dist/post-components/p-56da2097.entry.js +1 -0
- package/dist/post-components/p-65824049.entry.js +1 -0
- package/dist/post-components/p-6b31a76a.js +1 -0
- package/dist/post-components/p-722ffaae.js +1 -0
- package/dist/post-components/p-7c6f4c29.js +1 -0
- package/dist/post-components/p-817effd4.js +1 -0
- package/dist/post-components/p-8579ac14.js +8 -0
- package/dist/post-components/p-86859a7b.entry.js +1 -0
- package/dist/post-components/p-8db32dab.js +8 -0
- package/dist/post-components/p-936682bc.entry.js +1 -0
- package/dist/post-components/p-9597127a.js +1 -0
- package/dist/post-components/p-9818ad52.entry.js +1 -0
- package/dist/post-components/{p-5c758f41.js → p-9e461613.js} +1 -1
- package/dist/post-components/p-9ec20111.js +1 -0
- package/dist/post-components/p-a1a39a27.js +1 -0
- package/dist/post-components/p-a1bae666.entry.js +1 -0
- package/dist/post-components/p-a27907cc.js +1 -0
- package/dist/post-components/p-a77a6729.entry.js +1 -0
- package/dist/post-components/p-ab3ab29b.js +1 -0
- package/dist/post-components/p-ad9ffd61.entry.js +1 -0
- package/dist/post-components/p-b8241188.js +1 -0
- package/dist/post-components/p-bece917c.js +1 -0
- package/dist/post-components/p-bf3c80a3.entry.js +1 -0
- package/dist/post-components/p-cd8aef45.entry.js +1 -0
- package/dist/post-components/p-cdd3a06a.entry.js +1 -0
- package/dist/post-components/p-dc702c39.entry.js +1 -0
- package/dist/post-components/p-e077239a.entry.js +1 -0
- package/dist/post-components/p-e653daec.entry.js +1 -0
- package/dist/post-components/p-e8861c07.entry.js +1 -0
- package/dist/post-components/p-f2478a7d.js +1 -0
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/components/post-avatar/post-avatar.d.ts +1 -1
- package/dist/types/components/{post-breadcrumb/post-breadcrumb.d.ts → post-breadcrumbs/post-breadcrumbs.d.ts} +4 -4
- package/dist/types/components/post-card-control/post-card-control.d.ts +1 -1
- package/dist/types/components/post-collapsible-trigger/post-collapsible-trigger.d.ts +4 -14
- package/dist/types/components/post-footer/post-footer.d.ts +2 -2
- package/dist/types/components/post-header/post-header.d.ts +1 -0
- package/dist/types/components/post-icon/post-icon.d.ts +0 -1
- package/dist/types/components/post-language-switch/post-language-switch.d.ts +2 -5
- package/dist/types/components/post-mainnavigation/post-mainnavigation.d.ts +14 -39
- package/dist/types/components/post-menu/post-menu.d.ts +3 -3
- package/dist/types/components/post-menu-trigger/post-menu-trigger.d.ts +1 -1
- package/dist/types/components/post-popover/post-popover.d.ts +6 -4
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +1 -1
- package/dist/types/components/post-tag/post-tag.d.ts +1 -1
- package/dist/types/components/post-tooltip/post-tooltip.d.ts +9 -4
- package/dist/types/components.d.ts +35 -35
- package/dist/types/index.d.ts +1 -1
- package/dist/types/popover-fn.d.ts +11 -0
- package/dist/types/utils/environment.d.ts +2 -0
- package/dist/types/utils/get-root.d.ts +4 -0
- package/dist/types/utils/index.d.ts +5 -0
- package/loaders/attribute-observer.js +3 -1
- package/loaders/breakpoints.js +12 -8
- package/loaders/get-root.js +7 -1
- package/loaders/index.d.ts +2 -2
- package/loaders/index.js +4 -4
- package/loaders/long-press-event.js +264 -0
- package/loaders/package.js +1 -1
- package/loaders/post-accordion-item2.js +3 -3
- package/loaders/post-accordion.js +3 -3
- package/loaders/post-avatar.js +5 -4
- package/loaders/post-back-to-top.js +8 -8
- package/loaders/post-banner.js +3 -7
- package/loaders/post-breadcrumb-item2.js +2 -2
- package/loaders/{post-breadcrumb.d.ts → post-breadcrumbs.d.ts} +4 -4
- package/loaders/{post-breadcrumb.js → post-breadcrumbs.js} +42 -34
- package/loaders/post-card-control.js +26 -40
- package/loaders/post-closebutton.js +8 -3
- package/loaders/post-collapsible-trigger2.js +19 -31
- package/loaders/post-collapsible2.js +9 -12
- package/loaders/post-footer.js +8 -8
- package/loaders/post-header.js +15 -23
- package/loaders/post-icon2.js +5 -5
- package/loaders/post-language-option.js +4 -11
- package/loaders/post-language-switch.js +9 -18
- package/loaders/post-linkarea.js +5 -4
- package/loaders/post-list-item.js +2 -2
- package/loaders/post-list.js +3 -4
- package/loaders/post-logo.js +3 -2
- package/loaders/post-mainnavigation.js +94 -182
- package/loaders/post-megadropdown-trigger.js +38 -37
- package/loaders/post-megadropdown.js +21 -30
- package/loaders/post-menu-trigger2.js +15 -15
- package/loaders/post-menu2.js +50 -56
- package/loaders/post-popover.js +15 -13
- package/loaders/post-popovercontainer2.js +638 -36
- package/loaders/post-rating.js +3 -13
- package/loaders/post-tab-header.js +5 -4
- package/loaders/post-tab-panel.js +3 -3
- package/loaders/post-tabs.js +3 -10
- package/loaders/post-tag.js +2 -2
- package/loaders/post-togglebutton.js +12 -11
- package/loaders/post-tooltip.js +37 -294
- package/package.json +20 -15
- package/dist/cjs/debounce-158fd76f.js +0 -13
- package/dist/cjs/get-root-7a3498ef.js +0 -11
- package/dist/cjs/post-breadcrumb.cjs.entry.js +0 -13
- package/dist/cjs/post-card-control-155fb433.js +0 -283
- package/dist/cjs/post-popover-858cbd12.js +0 -110
- package/dist/cjs/post-tag-d1a1176c.js +0 -47
- package/dist/collection/components/post-breadcrumb/post-breadcrumb.css +0 -3
- package/dist/components/debounce.js +0 -11
- package/dist/components/post-breadcrumb.js +0 -6
- package/dist/esm/debounce-e54c7131.js +0 -11
- package/dist/esm/get-root-7af2e0d1.js +0 -9
- package/dist/esm/package-da68ab5a.js +0 -3
- package/dist/esm/post-breadcrumb.entry.js +0 -5
- package/dist/esm/post-card-control-aa043898.js +0 -281
- package/dist/esm/post-popover-e51a7a18.js +0 -108
- package/dist/esm/post-tag-a3b989e0.js +0 -45
- package/dist/post-components/p-1376c653.js +0 -1
- package/dist/post-components/p-13835969.js +0 -1
- package/dist/post-components/p-13fdbaf6.entry.js +0 -1
- package/dist/post-components/p-1e2169ae.entry.js +0 -1
- package/dist/post-components/p-23e4c270.entry.js +0 -1
- package/dist/post-components/p-2641e06b.js +0 -1
- package/dist/post-components/p-2d3b16c7.js +0 -1
- package/dist/post-components/p-33c35e15.js +0 -1
- package/dist/post-components/p-3b247d71.entry.js +0 -1
- package/dist/post-components/p-42a5fdf8.js +0 -1
- package/dist/post-components/p-4ed7bab6.js +0 -1
- package/dist/post-components/p-5aeb3656.js +0 -1
- package/dist/post-components/p-5c518421.js +0 -1
- package/dist/post-components/p-6db1a2e0.entry.js +0 -1
- package/dist/post-components/p-6fe98184.entry.js +0 -1
- package/dist/post-components/p-7d731077.entry.js +0 -1
- package/dist/post-components/p-7ee47334.entry.js +0 -1
- package/dist/post-components/p-8223e97b.js +0 -1
- package/dist/post-components/p-8a8376d0.js +0 -1
- package/dist/post-components/p-8bb828cf.entry.js +0 -1
- package/dist/post-components/p-8e55ddd2.js +0 -1
- package/dist/post-components/p-9681efce.js +0 -1
- package/dist/post-components/p-96a59372.entry.js +0 -1
- package/dist/post-components/p-9748a355.js +0 -1
- package/dist/post-components/p-99c8fd43.entry.js +0 -1
- package/dist/post-components/p-ac042f7a.entry.js +0 -1
- package/dist/post-components/p-c34cacb7.js +0 -1
- package/dist/post-components/p-c3a970c5.js +0 -1
- package/dist/post-components/p-c4651d32.entry.js +0 -1
- package/dist/post-components/p-c9b61d31.entry.js +0 -1
- package/dist/post-components/p-d16dd7f9.js +0 -1
- package/dist/post-components/p-d81c5908.entry.js +0 -1
- package/dist/post-components/p-dbe31632.js +0 -1
- package/dist/post-components/p-e1baac59.js +0 -1
- package/dist/post-components/p-e2294014.js +0 -15
- package/dist/post-components/p-e8ff8122.js +0 -1
- package/dist/post-components/p-ed78d04a.entry.js +0 -1
- package/dist/post-components/p-f1c0924a.js +0 -1
- package/dist/post-components/p-f1db96d0.entry.js +0 -1
- package/dist/post-components/p-f7aa917f.entry.js +0 -1
- package/dist/post-components/p-f96b80cc.entry.js +0 -1
- package/dist/post-components/p-fc91cbc2.js +0 -1
- package/dist/post-components/p-fd78716d.js +0 -1
- package/loaders/debounce.js +0 -11
|
@@ -5,28 +5,54 @@ import { getRoot } from "../../utils/index";
|
|
|
5
5
|
import { eventGuard } from "../../utils/event-gua";
|
|
6
6
|
export class PostMenu {
|
|
7
7
|
constructor() {
|
|
8
|
+
this.lastFocusedElement = null;
|
|
9
|
+
this.KEYCODES = {
|
|
10
|
+
SPACE: ' ',
|
|
11
|
+
ENTER: 'Enter',
|
|
12
|
+
UP: 'ArrowUp',
|
|
13
|
+
DOWN: 'ArrowDown',
|
|
14
|
+
TAB: 'Tab',
|
|
15
|
+
HOME: 'Home',
|
|
16
|
+
END: 'End',
|
|
17
|
+
ESCAPE: 'Escape',
|
|
18
|
+
};
|
|
19
|
+
this.handleKeyDown = (e) => {
|
|
20
|
+
e.stopPropagation();
|
|
21
|
+
if (e.key === this.KEYCODES.ESCAPE) {
|
|
22
|
+
this.toggle(this.host);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (Object.values(this.KEYCODES).includes(e.key)) {
|
|
26
|
+
this.controlKeyDownHandler(e);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
this.handlePostToggle = (event) => {
|
|
30
|
+
eventGuard(this.host, event, { targetLocalName: 'post-popovercontainer', delegatorSelector: 'post-menu' }, () => {
|
|
31
|
+
this.isVisible = event.detail;
|
|
32
|
+
this.toggleMenu.emit(this.isVisible);
|
|
33
|
+
requestAnimationFrame(() => {
|
|
34
|
+
if (this.isVisible) {
|
|
35
|
+
this.lastFocusedElement = this.root?.activeElement;
|
|
36
|
+
const menuItems = this.getSlottedItems();
|
|
37
|
+
if (menuItems.length > 0) {
|
|
38
|
+
menuItems[0].focus();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
else if (this.lastFocusedElement) {
|
|
42
|
+
this.lastFocusedElement.focus();
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
this.handleClick = (e) => {
|
|
48
|
+
const target = e.target;
|
|
49
|
+
if (['BUTTON', 'A', 'INPUT', 'SELECT', 'TEXTAREA'].includes(target.tagName)) {
|
|
50
|
+
this.toggle(this.host);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
8
53
|
this.placement = 'bottom';
|
|
9
54
|
this.isVisible = false;
|
|
10
55
|
}
|
|
11
|
-
popoverRef;
|
|
12
|
-
lastFocusedElement = null;
|
|
13
|
-
KEYCODES = {
|
|
14
|
-
SPACE: ' ',
|
|
15
|
-
ENTER: 'Enter',
|
|
16
|
-
UP: 'ArrowUp',
|
|
17
|
-
DOWN: 'ArrowDown',
|
|
18
|
-
TAB: 'Tab',
|
|
19
|
-
HOME: 'Home',
|
|
20
|
-
END: 'End',
|
|
21
|
-
ESCAPE: 'Escape',
|
|
22
|
-
};
|
|
23
|
-
host;
|
|
24
|
-
/**
|
|
25
|
-
* Emits when the menu is shown or hidden.
|
|
26
|
-
* The event payload is a boolean: `true` when the menu was opened, `false` when it was closed.
|
|
27
|
-
**/
|
|
28
|
-
toggleMenu;
|
|
29
|
-
root;
|
|
30
56
|
connectedCallback() {
|
|
31
57
|
this.root = getRoot(this.host);
|
|
32
58
|
this.host.addEventListener('keydown', this.handleKeyDown);
|
|
@@ -77,40 +103,6 @@ export class PostMenu {
|
|
|
77
103
|
console.error('hide: popoverRef is null or undefined');
|
|
78
104
|
}
|
|
79
105
|
}
|
|
80
|
-
handleKeyDown = (e) => {
|
|
81
|
-
e.stopPropagation();
|
|
82
|
-
if (e.key === this.KEYCODES.ESCAPE) {
|
|
83
|
-
this.toggle(this.host);
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
if (Object.values(this.KEYCODES).includes(e.key)) {
|
|
87
|
-
this.controlKeyDownHandler(e);
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
handlePostToggle = (event) => {
|
|
91
|
-
eventGuard(this.host, event, { targetLocalName: 'post-popovercontainer', delegatorSelector: 'post-menu' }, () => {
|
|
92
|
-
this.isVisible = event.detail;
|
|
93
|
-
this.toggleMenu.emit(this.isVisible);
|
|
94
|
-
requestAnimationFrame(() => {
|
|
95
|
-
if (this.isVisible) {
|
|
96
|
-
this.lastFocusedElement = this.root?.activeElement;
|
|
97
|
-
const menuItems = this.getSlottedItems();
|
|
98
|
-
if (menuItems.length > 0) {
|
|
99
|
-
menuItems[0].focus();
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
else if (this.lastFocusedElement) {
|
|
103
|
-
this.lastFocusedElement.focus();
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
});
|
|
107
|
-
};
|
|
108
|
-
handleClick = (e) => {
|
|
109
|
-
const target = e.target;
|
|
110
|
-
if (['BUTTON', 'A', 'INPUT', 'SELECT', 'TEXTAREA'].includes(target.tagName)) {
|
|
111
|
-
this.toggle(this.host);
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
106
|
controlKeyDownHandler(e) {
|
|
115
107
|
const menuItems = this.getSlottedItems();
|
|
116
108
|
if (!menuItems.length) {
|
|
@@ -159,7 +151,7 @@ export class PostMenu {
|
|
|
159
151
|
.flatMap(el => Array.from(getFocusableChildren(el))));
|
|
160
152
|
}
|
|
161
153
|
render() {
|
|
162
|
-
return (h(Host, { key: '
|
|
154
|
+
return (h(Host, { key: 'dd3bbcbf568e529588bcf5c90b8c2d4d07d454fb', "data-version": version, role: "menu" }, h("post-popovercontainer", { key: '17a24933ef087cc8699b00f7165fff33756da9a8', placement: this.placement, ref: e => (this.popoverRef = e) }, h("div", { key: '9ff3d687146c88cf153ea745abcaf7a3267be620', class: "popover-container", part: "popover-container" }, h("slot", { key: 'aff50800748410f6e2583690620c12e47b4c7a22' })))));
|
|
163
155
|
}
|
|
164
156
|
static get is() { return "post-menu"; }
|
|
165
157
|
static get encapsulation() { return "shadow"; }
|
|
@@ -193,7 +185,7 @@ export class PostMenu {
|
|
|
193
185
|
"optional": true,
|
|
194
186
|
"docs": {
|
|
195
187
|
"tags": [],
|
|
196
|
-
"text": "Defines the
|
|
188
|
+
"text": "Defines the position of the menu relative to its trigger.\nMenus are automatically flipped to the opposite side if there is not enough available space and are shifted towards the viewport if they would overlap edge boundaries.\nFor supported values and behavior details, see the [Floating UI placement documentation](https://floating-ui.com/docs/computePosition#placement)."
|
|
197
189
|
},
|
|
198
190
|
"attribute": "placement",
|
|
199
191
|
"reflect": false,
|
|
@@ -3,16 +3,20 @@ import { version } from "../../../../package";
|
|
|
3
3
|
import { checkType, getRoot } from "../../utils/index";
|
|
4
4
|
export class PostMenuTrigger {
|
|
5
5
|
constructor() {
|
|
6
|
+
/**
|
|
7
|
+
* Reference to the slotted button within the trigger, if present.
|
|
8
|
+
* Used to manage click and key events for menu control.
|
|
9
|
+
*/
|
|
10
|
+
this.slottedButton = null;
|
|
11
|
+
this.handleKeyDown = (e) => {
|
|
12
|
+
if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {
|
|
13
|
+
e.preventDefault();
|
|
14
|
+
this.handleToggle();
|
|
15
|
+
}
|
|
16
|
+
};
|
|
6
17
|
this.for = undefined;
|
|
7
18
|
this.ariaExpanded = false;
|
|
8
19
|
}
|
|
9
|
-
host;
|
|
10
|
-
/**
|
|
11
|
-
* Reference to the slotted button within the trigger, if present.
|
|
12
|
-
* Used to manage click and key events for menu control.
|
|
13
|
-
*/
|
|
14
|
-
slottedButton = null;
|
|
15
|
-
root;
|
|
16
20
|
/**
|
|
17
21
|
* Watch for changes to the `for` property to validate its type and ensure it is a string.
|
|
18
22
|
* @param forValue - The new value of the `for` property.
|
|
@@ -32,12 +36,6 @@ export class PostMenuTrigger {
|
|
|
32
36
|
console.warn(`No post-menu found with ID: ${this.for}`);
|
|
33
37
|
}
|
|
34
38
|
}
|
|
35
|
-
handleKeyDown = (e) => {
|
|
36
|
-
if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {
|
|
37
|
-
e.preventDefault();
|
|
38
|
-
this.handleToggle();
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
39
|
connectedCallback() {
|
|
42
40
|
this.root = getRoot(this.host);
|
|
43
41
|
}
|
|
@@ -73,7 +71,7 @@ export class PostMenuTrigger {
|
|
|
73
71
|
}
|
|
74
72
|
}
|
|
75
73
|
render() {
|
|
76
|
-
return (h(Host, { key: '
|
|
74
|
+
return (h(Host, { key: '1b9589febc2976d17eed3363d91b4321473b7b5e', "data-version": version, "tab-index": "-1" }, h("slot", { key: 'bec55f97274084ab4721dc085dc9e1c3a216c0a3' })));
|
|
77
75
|
}
|
|
78
76
|
static get is() { return "post-menu-trigger"; }
|
|
79
77
|
static get originalStyleUrls() {
|
|
@@ -103,7 +101,7 @@ export class PostMenuTrigger {
|
|
|
103
101
|
"text": "ID of the menu element that this trigger is linked to. Used to open and close the specified menu."
|
|
104
102
|
},
|
|
105
103
|
"attribute": "for",
|
|
106
|
-
"reflect":
|
|
104
|
+
"reflect": true
|
|
107
105
|
}
|
|
108
106
|
};
|
|
109
107
|
}
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Copyright 2021 by Swiss Post, Information Technology
|
|
3
|
-
*/.btn-close{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button;border-radius:var(--post-device-border-radius-round);color:#000;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;cursor:pointer}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close{background-color:ButtonFace !important}.btn-close:hover{background-color:Highlight !important}}.btn-close{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}.btn-close:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;border-radius:4px}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.btn-close:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;border-radius:4px}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.btn-close::before{mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%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/svg%3E");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;content:"";display:block;height:var(--post-core-dimension-24);width:var(--post-core-dimension-24)}.btn-close:focus,.btn-close:not(:disabled):hover,.pretend-hover.btn-close{color:#000}.btn-close:disabled{color:#999}@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{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;min-width:160px;max-width:min(var(--post-popover-max-width, 280px),100vw)}.popover-content{padding:.5em;flex-grow:1}.btn-close{color:var(--post-scheme-color-surface-default-fg)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close:hover{color:HighlightText !important}}
|
|
1
|
+
.btn-close{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button;border-radius:var(--post-device-border-radius-round);color:#000;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;cursor:pointer}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close{background-color:ButtonFace !important}.btn-close:hover{background-color:Highlight !important}}.btn-close{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}.btn-close:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;border-radius:4px}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.btn-close:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;border-radius:4px}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.btn-close::before{mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%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/svg%3E");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;content:"";display:block;height:var(--post-core-dimension-24);width:var(--post-core-dimension-24)}.btn-close:focus,.btn-close:not(:disabled):hover,.pretend-hover.btn-close{color:#000}.btn-close:disabled{color:#999}@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{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;min-width:160px;max-width:min(var(--post-popover-max-width, 280px),100vw)}.popover-content{padding:.5em;flex-grow:1}.btn-close{color:var(--post-scheme-color-surface-default-fg)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close:hover{color:HighlightText !important}}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
|
+
import { IS_BROWSER, getAttributeObserver } from "../../utils/index";
|
|
2
3
|
import { version } from "../../../../package";
|
|
3
|
-
import { getAttributeObserver } from "../../utils/attribute-observer";
|
|
4
4
|
/**
|
|
5
5
|
* @slot default - Slot for placing content inside the popover.
|
|
6
6
|
*/
|
|
@@ -20,16 +20,12 @@ const globalToggleHandler = (e) => {
|
|
|
20
20
|
const popover = document.getElementById(popoverTarget);
|
|
21
21
|
popover?.toggle(currentElement);
|
|
22
22
|
};
|
|
23
|
-
// Initialize a mutation observer for patching accessibility features
|
|
24
|
-
const triggerObserver = getAttributeObserver(popoverTargetAttribute, trigger => {
|
|
25
|
-
const force = trigger.hasAttribute(popoverTargetAttribute);
|
|
26
|
-
trigger.setAttribute('aria-expanded', force ? 'false' : null);
|
|
27
|
-
});
|
|
28
23
|
export class PostPopover {
|
|
29
|
-
popoverRef;
|
|
30
|
-
localBeforeToggleHandler;
|
|
31
|
-
host;
|
|
32
24
|
constructor() {
|
|
25
|
+
// Initialize a mutation observer for patching accessibility features
|
|
26
|
+
this.triggerObserver = IS_BROWSER
|
|
27
|
+
? getAttributeObserver(popoverTargetAttribute, this.patchAccessibilityFeatures)
|
|
28
|
+
: null;
|
|
33
29
|
this.placement = 'top';
|
|
34
30
|
this.closeButtonCaption = undefined;
|
|
35
31
|
this.arrow = true;
|
|
@@ -40,7 +36,7 @@ export class PostPopover {
|
|
|
40
36
|
if (popoverInstances === 0) {
|
|
41
37
|
window.addEventListener('pointerup', globalToggleHandler);
|
|
42
38
|
window.addEventListener('keydown', globalToggleHandler);
|
|
43
|
-
triggerObserver
|
|
39
|
+
this.triggerObserver?.observe(document.body, {
|
|
44
40
|
subtree: true,
|
|
45
41
|
childList: true,
|
|
46
42
|
attributeFilter: [popoverTargetAttribute],
|
|
@@ -58,7 +54,7 @@ export class PostPopover {
|
|
|
58
54
|
if (popoverInstances === 0) {
|
|
59
55
|
window.removeEventListener('click', globalToggleHandler);
|
|
60
56
|
window.removeEventListener('keydown', globalToggleHandler);
|
|
61
|
-
triggerObserver
|
|
57
|
+
this.triggerObserver?.disconnect();
|
|
62
58
|
}
|
|
63
59
|
this.popoverRef.removeEventListener('beforetoggle', this.localBeforeToggleHandler);
|
|
64
60
|
this.triggers.forEach(trigger => trigger.removeAttribute('aria-expanded'));
|
|
@@ -94,8 +90,12 @@ export class PostPopover {
|
|
|
94
90
|
beforeToggleHandler() {
|
|
95
91
|
this.triggers.forEach(trigger => trigger.setAttribute('aria-expanded', 'false'));
|
|
96
92
|
}
|
|
93
|
+
patchAccessibilityFeatures(trigger) {
|
|
94
|
+
const force = trigger.hasAttribute(popoverTargetAttribute);
|
|
95
|
+
trigger.setAttribute('aria-expanded', force ? 'false' : null);
|
|
96
|
+
}
|
|
97
97
|
render() {
|
|
98
|
-
return (h(Host, { key: '
|
|
98
|
+
return (h(Host, { key: '56056367e3d917d7a2b9f81073fb9be4966d6bf6', "data-version": version }, h("post-popovercontainer", { key: '303164b40db9d7568304b354ff065a564506221f', arrow: this.arrow, placement: this.placement, ref: e => (this.popoverRef = e) }, h("div", { key: 'e9d93ab370c3915e61d955823a0ce5674b5a39ae', class: "popover-container" }, h("div", { key: '108db792f093ac81356eda9389dc2b0b0da363e2', class: "popover-content" }, h("slot", { key: '88694578a319978f747cfa7904294199d06edb21' })), h("button", { key: '3cf65346d57b9985bfe97d8e0cd46dc68951168b', class: "btn-close", onClick: () => this.hide() }, h("span", { key: '6b2d660aa046935c16bad96c640dae6a77713383', class: "visually-hidden" }, this.closeButtonCaption))))));
|
|
99
99
|
}
|
|
100
100
|
static get is() { return "post-popover"; }
|
|
101
101
|
static get encapsulation() { return "shadow"; }
|
|
@@ -129,7 +129,7 @@ export class PostPopover {
|
|
|
129
129
|
"optional": true,
|
|
130
130
|
"docs": {
|
|
131
131
|
"tags": [],
|
|
132
|
-
"text": "Defines the
|
|
132
|
+
"text": "Defines the position of the popover relative to its trigger.\nPopovers are automatically flipped to the opposite side if there is not enough available space and are shifted towards the viewport if they would overlap edge boundaries.\nFor supported values and behavior details, see the [Floating UI placement documentation](https://floating-ui.com/docs/computePosition#placement)."
|
|
133
133
|
},
|
|
134
134
|
"attribute": "placement",
|
|
135
135
|
"reflect": false,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { IS_BROWSER } from "../../utils/index";
|
|
3
|
+
import { version } from "../../../../package";
|
|
2
4
|
import { arrow, autoUpdate, computePosition, flip, inline, limitShift, offset, shift, size, } from "@floating-ui/dom";
|
|
3
5
|
// Polyfill for popovers, can be removed when https://caniuse.com/?search=popover is green
|
|
4
|
-
import "@oddbird/popover-polyfill";
|
|
5
|
-
import { version } from "../../../../package";
|
|
6
|
+
import { apply, isSupported } from "@oddbird/popover-polyfill/dist/popover-fn.js";
|
|
6
7
|
/**
|
|
7
8
|
* @slot - Default slot for placing content inside the popovercontainer.
|
|
8
9
|
*/
|
|
@@ -14,35 +15,6 @@ export class PostPopovercontainer {
|
|
|
14
15
|
this.arrow = false;
|
|
15
16
|
this.safeSpace = undefined;
|
|
16
17
|
}
|
|
17
|
-
static STATIC_SIDES = {
|
|
18
|
-
top: 'bottom',
|
|
19
|
-
right: 'left',
|
|
20
|
-
bottom: 'top',
|
|
21
|
-
left: 'right',
|
|
22
|
-
};
|
|
23
|
-
static PROPERTIES_TO_CLEAR = [
|
|
24
|
-
'--safe-space-popover-x',
|
|
25
|
-
'--safe-space-popover-y',
|
|
26
|
-
'--safe-space-popover-x-start',
|
|
27
|
-
'--safe-space-popover-x-end',
|
|
28
|
-
'--safe-space-popover-y-start',
|
|
29
|
-
'--safe-space-popover-y-end',
|
|
30
|
-
'--safe-space-trigger-x',
|
|
31
|
-
'--safe-space-trigger-y',
|
|
32
|
-
'--safe-space-trigger-x-start',
|
|
33
|
-
'--safe-space-trigger-x-end',
|
|
34
|
-
'--safe-space-trigger-y-start',
|
|
35
|
-
'--safe-space-trigger-y-end',
|
|
36
|
-
];
|
|
37
|
-
host;
|
|
38
|
-
arrowRef;
|
|
39
|
-
eventTarget;
|
|
40
|
-
clearAutoUpdate;
|
|
41
|
-
toggleTimeoutId;
|
|
42
|
-
/**
|
|
43
|
-
* Fires whenever the popover gets shown or hidden, passing the new state in event.details as a boolean
|
|
44
|
-
*/
|
|
45
|
-
postToggle;
|
|
46
18
|
/**
|
|
47
19
|
* Updates cursor position for safe space feature when popover is open.
|
|
48
20
|
* Sets CSS custom properties for dynamic styling of safe area.
|
|
@@ -52,6 +24,11 @@ export class PostPopovercontainer {
|
|
|
52
24
|
this.host.style.setProperty('--safe-space-cursor-x', `${event.clientX}px`);
|
|
53
25
|
this.host.style.setProperty('--safe-space-cursor-y', `${event.clientY}px`);
|
|
54
26
|
}
|
|
27
|
+
connectedCallback() {
|
|
28
|
+
if (IS_BROWSER && !isSupported()) {
|
|
29
|
+
apply();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
55
32
|
componentDidLoad() {
|
|
56
33
|
this.host.addEventListener('beforetoggle', this.handleToggle.bind(this));
|
|
57
34
|
}
|
|
@@ -246,9 +223,9 @@ export class PostPopovercontainer {
|
|
|
246
223
|
}
|
|
247
224
|
}
|
|
248
225
|
render() {
|
|
249
|
-
return (h(Host, { key: '
|
|
226
|
+
return (h(Host, { key: 'bbd430fbda9344c351d59f3d59cf84049992709b', "data-version": version, popover: this.manualClose ? 'manual' : 'auto' }, h("div", { key: 'e359cac588d1dd1359c88f8e472828be845fdad7' }, this.arrow && (h("span", { key: '45329ae23722e93410132746e4e39e88e86cd310', class: "arrow", ref: el => {
|
|
250
227
|
this.arrowRef = el;
|
|
251
|
-
} })), h("slot", { key: '
|
|
228
|
+
} })), h("slot", { key: 'bb9b4b3d8e7c36f024883d02bd34766bf2e9de88' }))));
|
|
252
229
|
}
|
|
253
230
|
static get is() { return "post-popovercontainer"; }
|
|
254
231
|
static get originalStyleUrls() {
|
|
@@ -464,3 +441,23 @@ export class PostPopovercontainer {
|
|
|
464
441
|
}
|
|
465
442
|
static get elementRef() { return "host"; }
|
|
466
443
|
}
|
|
444
|
+
PostPopovercontainer.STATIC_SIDES = {
|
|
445
|
+
top: 'bottom',
|
|
446
|
+
right: 'left',
|
|
447
|
+
bottom: 'top',
|
|
448
|
+
left: 'right',
|
|
449
|
+
};
|
|
450
|
+
PostPopovercontainer.PROPERTIES_TO_CLEAR = [
|
|
451
|
+
'--safe-space-popover-x',
|
|
452
|
+
'--safe-space-popover-y',
|
|
453
|
+
'--safe-space-popover-x-start',
|
|
454
|
+
'--safe-space-popover-x-end',
|
|
455
|
+
'--safe-space-popover-y-start',
|
|
456
|
+
'--safe-space-popover-y-end',
|
|
457
|
+
'--safe-space-trigger-x',
|
|
458
|
+
'--safe-space-trigger-y',
|
|
459
|
+
'--safe-space-trigger-x-start',
|
|
460
|
+
'--safe-space-trigger-x-end',
|
|
461
|
+
'--safe-space-trigger-y-start',
|
|
462
|
+
'--safe-space-trigger-y-end',
|
|
463
|
+
];
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Copyright 2021 by Swiss Post, Information Technology
|
|
3
|
-
*/:host{display:inline-block}.rating{display:flex;flex-wrap:wrap;overflow:hidden;margin:0 calc(var(--post-core-dimension-4)*-1);border-radius:4px}.rating .star{--post-rating-star-stroke: hsl(0, 0%, 40%);--post-rating-star-fill: #fff;position:relative;width:2rem;height:2rem;cursor:pointer}.rating .star .stroke,.rating .star .fill{display:block;width:100%;height:100%;transition:all ease 100ms}.rating .star .stroke{position:absolute;inset:auto;z-index:1;color:var(--post-rating-star-stroke)}.rating .star .fill{margin:1px;width:calc(100% - 2px);height:calc(100% - 2px);color:var(--post-rating-star-fill)}.rating .star.before-hover{--post-rating-star-stroke: hsl(0, 0%, 40%);--post-rating-star-fill: #fc0}.rating .star.active{--post-rating-star-stroke: hsl(0, 0%, 20%);--post-rating-star-fill: #fc0}.rating .star.hover{--post-rating-star-stroke: hsl(0, 0%, 40%);--post-rating-star-fill: #fc0}.rating .star.after-active{--post-rating-star-stroke: hsl(0, 0%, 40%);--post-rating-star-fill: hsl(0, 0%, 80%)}.rating :focus{outline:none}.rating:focus-visible{outline-offset:var(--post-core-dimension-2);outline:var(--post-core-dimension-2) solid #1976c8}.rating[aria-readonly=true] .star,.rating[aria-disabled=true] .star{cursor:default}.rating[aria-disabled=true] .star{--post-rating-star-stroke: hsl(0, 0%, 60%);--post-rating-star-fill: #fff}.rating[aria-disabled=true] .star.active{cursor:default;--post-rating-star-stroke: hsl(0, 0%, 60%);--post-rating-star-fill: hsl(0, 0%, 90%)}
|
|
1
|
+
:host{display:inline-block}.rating{display:flex;flex-wrap:wrap;overflow:hidden;margin:0 calc(var(--post-core-dimension-4)*-1);border-radius:4px}.rating .star{--post-rating-star-stroke: hsl(0, 0%, 40%);--post-rating-star-fill: #fff;position:relative;width:2rem;height:2rem;cursor:pointer}.rating .star .stroke,.rating .star .fill{display:block;width:100%;height:100%;transition:all ease 100ms}.rating .star .stroke{position:absolute;inset:auto;z-index:1;color:var(--post-rating-star-stroke)}.rating .star .fill{margin:1px;width:calc(100% - 2px);height:calc(100% - 2px);color:var(--post-rating-star-fill)}.rating .star.before-hover{--post-rating-star-stroke: hsl(0, 0%, 40%);--post-rating-star-fill: #fc0}.rating .star.active{--post-rating-star-stroke: hsl(0, 0%, 20%);--post-rating-star-fill: #fc0}.rating .star.hover{--post-rating-star-stroke: hsl(0, 0%, 40%);--post-rating-star-fill: #fc0}.rating .star.after-active{--post-rating-star-stroke: hsl(0, 0%, 40%);--post-rating-star-fill: hsl(0, 0%, 80%)}.rating :focus{outline:none}.rating:focus-visible{outline-offset:var(--post-core-dimension-2);outline:var(--post-core-dimension-2) solid #1976c8}.rating[aria-readonly=true] .star,.rating[aria-disabled=true] .star{cursor:default}.rating[aria-disabled=true] .star{--post-rating-star-stroke: hsl(0, 0%, 60%);--post-rating-star-fill: #fff}.rating[aria-disabled=true] .star.active{cursor:default;--post-rating-star-stroke: hsl(0, 0%, 60%);--post-rating-star-fill: hsl(0, 0%, 90%)}
|
|
@@ -1,19 +1,8 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
import { version } from "../../../../package";
|
|
3
3
|
export class PostRating {
|
|
4
|
-
hasChanged = false;
|
|
5
|
-
host;
|
|
6
|
-
/**
|
|
7
|
-
* An event emitted whenever the component's value has changed (on input).
|
|
8
|
-
* The event payload can be used like so: `event.detail.value`.
|
|
9
|
-
*/
|
|
10
|
-
postInput;
|
|
11
|
-
/**
|
|
12
|
-
* An event emitted whenever the component's value has changed (on blur).
|
|
13
|
-
* The event payload can be used like so: `event.detail.value`.
|
|
14
|
-
*/
|
|
15
|
-
postChange;
|
|
16
4
|
constructor() {
|
|
5
|
+
this.hasChanged = false;
|
|
17
6
|
this.hoveredIndex = undefined;
|
|
18
7
|
this.label = 'Rating';
|
|
19
8
|
this.stars = 5;
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
.tab-title[role=tab]{display:inline-block;cursor:pointer;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:#000;text-decoration:none;background-color:rgba(0,0,0,0)}.tab-title[role=tab]:focus{background-color:unset;color:#000}.tab-title[role=tab]:hover{opacity:1;background-color:rgba(0,0,0,.6);color:#fff}.tab-title[role=tab]:focus-visible{outline:rgba(0,0,0,0);opacity:1;background-color:rgba(0,0,0,.6);color:#fff;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:#000;font-weight:700}.tab-title[role=tab].active::before{content:"";display:block;position:absolute;top:0;right:-1px;left:-1px;height:var(--post-core-dimension-4);background-color:#fc0}:where(.bg-dark,.bg-black,.bg-primary,.bg-secondary,.bg-success,.bg-error) .tab-title[role=tab]:hover{background-color:rgba(255,255,255,.2)}:where(.bg-dark,.bg-black,.bg-primary,.bg-secondary,.bg-success,.bg-error) .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:var(--post-core-dimension-2) solid Highlight;outline-offset:calc(var(--post-core-dimension-4)*-1)}.tab-title[role=tab].active{border-left-color:ButtonText;border-right-color:ButtonText;color:Highlight}.tab-title[role=tab].active::before{background-color:Highlight}}
|
|
2
|
-
* Copyright 2021 by Swiss Post, Information Technology
|
|
3
|
-
*/:host{display:block}.tab-title{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.tab-title{background-color:ButtonFace !important}.tab-title:hover{background-color:Highlight !important}}
|
|
1
|
+
.tab-title[role=tab]{display:inline-block;cursor:pointer;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:#000;text-decoration:none;background-color:rgba(0,0,0,0)}.tab-title[role=tab]:focus{background-color:unset;color:#000}.tab-title[role=tab]:hover{opacity:1;background-color:rgba(0,0,0,.6);color:#fff}.tab-title[role=tab]:focus-visible{outline:rgba(0,0,0,0);opacity:1;background-color:rgba(0,0,0,.6);color:#fff;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:#000;font-weight:700}.tab-title[role=tab].active::before{content:"";display:block;position:absolute;top:0;right:-1px;left:-1px;height:var(--post-core-dimension-4);background-color:#fc0}:where(.bg-dark,.bg-black,.bg-primary,.bg-secondary,.bg-success,.bg-error) .tab-title[role=tab]:hover{background-color:rgba(255,255,255,.2)}:where(.bg-dark,.bg-black,.bg-primary,.bg-secondary,.bg-success,.bg-error) .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:var(--post-core-dimension-2) solid Highlight;outline-offset:calc(var(--post-core-dimension-4)*-1)}.tab-title[role=tab].active{border-left-color:ButtonText;border-right-color:ButtonText;color:Highlight}.tab-title[role=tab].active::before{background-color:Highlight}}:host{display:block}.tab-title{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.tab-title{background-color:ButtonFace !important}.tab-title:hover{background-color:Highlight !important}}
|
|
@@ -10,7 +10,6 @@ export class PostTabHeader {
|
|
|
10
10
|
this.tabId = undefined;
|
|
11
11
|
this.panel = undefined;
|
|
12
12
|
}
|
|
13
|
-
host;
|
|
14
13
|
validateFor() {
|
|
15
14
|
checkNonEmpty(this, 'panel');
|
|
16
15
|
}
|
|
@@ -18,7 +17,7 @@ export class PostTabHeader {
|
|
|
18
17
|
this.tabId = `tab-${this.host.id || nanoid(6)}`;
|
|
19
18
|
}
|
|
20
19
|
render() {
|
|
21
|
-
return (h(Host, { key: '
|
|
20
|
+
return (h(Host, { key: '5046c46fa27fd6586c694420abf197b227b56520', id: this.tabId, role: "tab", "data-version": version, "aria-selected": "false", tabindex: "-1", class: "tab-title", slot: "tabs" }, h("slot", { key: '78c2f660e4f2307ca95a63f4cfd90d08cc6942df' })));
|
|
22
21
|
}
|
|
23
22
|
static get is() { return "post-tab-header"; }
|
|
24
23
|
static get encapsulation() { return "shadow"; }
|
|
@@ -54,7 +53,7 @@ export class PostTabHeader {
|
|
|
54
53
|
"text": "The name of the panel controlled by the tab header."
|
|
55
54
|
},
|
|
56
55
|
"attribute": "panel",
|
|
57
|
-
"reflect":
|
|
56
|
+
"reflect": true
|
|
58
57
|
}
|
|
59
58
|
};
|
|
60
59
|
}
|
|
@@ -9,13 +9,12 @@ export class PostTabPanel {
|
|
|
9
9
|
this.panelId = undefined;
|
|
10
10
|
this.name = undefined;
|
|
11
11
|
}
|
|
12
|
-
host;
|
|
13
12
|
componentWillLoad() {
|
|
14
13
|
// get the id set on the host element or use a random id by default
|
|
15
14
|
this.panelId = `panel-${this.host.id || nanoid(6)}`;
|
|
16
15
|
}
|
|
17
16
|
render() {
|
|
18
|
-
return (h(Host, { key: '
|
|
17
|
+
return (h(Host, { key: '98427b35c6637af65930b69b75ea56facf044000', "data-version": version, id: this.panelId, role: "tabpanel" }, h("slot", { key: '4fa02667e8ff088c10122e010cfd7efe8ff3af57' })));
|
|
19
18
|
}
|
|
20
19
|
static get is() { return "post-tab-panel"; }
|
|
21
20
|
static get encapsulation() { return "shadow"; }
|
|
@@ -46,7 +45,7 @@ export class PostTabPanel {
|
|
|
46
45
|
"text": "The name of the panel, used to associate it with a tab header."
|
|
47
46
|
},
|
|
48
47
|
"attribute": "name",
|
|
49
|
-
"reflect":
|
|
48
|
+
"reflect": true
|
|
50
49
|
}
|
|
51
50
|
};
|
|
52
51
|
}
|
|
@@ -10,21 +10,12 @@ import { componentOnReady } from "../../utils/index";
|
|
|
10
10
|
*/
|
|
11
11
|
export class PostTabs {
|
|
12
12
|
constructor() {
|
|
13
|
+
this.isLoaded = false;
|
|
13
14
|
this.activePanel = undefined;
|
|
14
15
|
}
|
|
15
|
-
activeTab;
|
|
16
|
-
showing;
|
|
17
|
-
hiding;
|
|
18
|
-
isLoaded = false;
|
|
19
16
|
get tabs() {
|
|
20
17
|
return Array.from(this.host.querySelectorAll('post-tab-header')).filter(tab => tab.closest('post-tabs') === this.host);
|
|
21
18
|
}
|
|
22
|
-
host;
|
|
23
|
-
/**
|
|
24
|
-
* An event emitted after the active tab changes, when the fade in transition of its associated panel is finished.
|
|
25
|
-
* The payload is the name of the newly shown panel.
|
|
26
|
-
*/
|
|
27
|
-
postChange;
|
|
28
19
|
componentDidLoad() {
|
|
29
20
|
this.moveMisplacedTabs();
|
|
30
21
|
this.enableTabs();
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Copyright 2021 by Swiss Post, Information Technology
|
|
3
|
-
*/.tag,.tag:where(:has(:not(pre))){--post-tag-bg: hsl(0, 0%, 90%);--post-tag-fg: #000;display:inline-flex;align-items:center;gap:var(--post-core-dimension-4);padding:0 var(--post-core-dimension-8);max-width:100%;background-color:var(--post-tag-bg);border:var(--post-core-dimension-1) solid rgba(0,0,0,0);border-radius:var(--post-core-dimension-4);font-size:1rem;line-height:calc(var(--post-core-dimension-32) - var(--post-core-dimension-1)*2);white-space:nowrap;color:var(--post-tag-fg)}.tag post-icon,.tag:where(:has(:not(pre))) post-icon{flex:0 0 auto;width:1.25rem;height:1.25rem}.tag .tag-text,.tag:where(:has(:not(pre))) .tag-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tag .tag-text svg,.tag .tag-text img,.tag:where(:has(:not(pre))) .tag-text svg,.tag:where(:has(:not(pre))) .tag-text img{display:inline-block;height:1.25rem !important;vertical-align:text-top}.tag.tag-sm,.tag:where(:has(:not(pre))).tag-sm{line-height:var(--post-core-dimension-24)}.tag.tag-sm .tag-icon,.tag:where(:has(:not(pre))).tag-sm .tag-icon{width:1rem;height:1rem}.tag.tag-white,.tag:where(:has(:not(pre))).tag-white{--post-tag-bg: #fff;--post-tag-fg: #000}.tag.tag-yellow,.tag:where(:has(:not(pre))).tag-yellow{--post-tag-bg: #fc0;--post-tag-fg: #000}.tag.tag-success,.tag:where(:has(:not(pre))).tag-success{--post-tag-bg: #2c871d;--post-tag-fg: #fff}.tag.tag-warning,.tag:where(:has(:not(pre))).tag-warning{--post-tag-bg: #f49e00;--post-tag-fg: #000}.tag.tag-danger,.tag:where(:has(:not(pre))).tag-danger{--post-tag-bg: #a51728;--post-tag-fg: #fff}.tag.tag-info,.tag:where(:has(:not(pre))).tag-info{--post-tag-bg: #cce4ee;--post-tag-fg: #000}.tag.tag-white,.tag:where(:has(:not(pre))).tag-white{border-color:#000}pre .tag,pre .tag:where(:has(:not(pre))){display:inline;padding:initial;max-width:initial;background:initial;border:initial;border-radius:initial;font-size:inherit;line-height:inherit;white-space:unset}*,*:before,*:after{box-sizing:border-box}.tag-text ::slotted(svg),.tag-text ::slotted(img){display:inline-block !important;height:1.25rem !important;vertical-align:text-top !important}
|
|
1
|
+
.tag,.tag:where(:has(:not(pre))){--post-tag-bg: hsl(0, 0%, 90%);--post-tag-fg: #000;display:inline-flex;align-items:center;gap:var(--post-core-dimension-4);padding:0 var(--post-core-dimension-8);max-width:100%;background-color:var(--post-tag-bg);border:var(--post-core-dimension-1) solid rgba(0,0,0,0);border-radius:var(--post-core-dimension-4);font-size:1rem;line-height:calc(var(--post-core-dimension-32) - var(--post-core-dimension-1)*2);white-space:nowrap;color:var(--post-tag-fg)}.tag post-icon,.tag:where(:has(:not(pre))) post-icon{flex:0 0 auto;width:1.25rem;height:1.25rem}.tag .tag-text,.tag:where(:has(:not(pre))) .tag-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tag .tag-text svg,.tag .tag-text img,.tag:where(:has(:not(pre))) .tag-text svg,.tag:where(:has(:not(pre))) .tag-text img{display:inline-block;height:1.25rem !important;vertical-align:text-top}.tag.tag-sm,.tag:where(:has(:not(pre))).tag-sm{line-height:var(--post-core-dimension-24)}.tag.tag-sm .tag-icon,.tag:where(:has(:not(pre))).tag-sm .tag-icon{width:1rem;height:1rem}.tag.tag-white,.tag:where(:has(:not(pre))).tag-white{--post-tag-bg: #fff;--post-tag-fg: #000}.tag.tag-yellow,.tag:where(:has(:not(pre))).tag-yellow{--post-tag-bg: #fc0;--post-tag-fg: #000}.tag.tag-success,.tag:where(:has(:not(pre))).tag-success{--post-tag-bg: #2c871d;--post-tag-fg: #fff}.tag.tag-warning,.tag:where(:has(:not(pre))).tag-warning{--post-tag-bg: #f49e00;--post-tag-fg: #000}.tag.tag-danger,.tag:where(:has(:not(pre))).tag-danger{--post-tag-bg: #a51728;--post-tag-fg: #fff}.tag.tag-info,.tag:where(:has(:not(pre))).tag-info{--post-tag-bg: #cce4ee;--post-tag-fg: #000}.tag.tag-white,.tag:where(:has(:not(pre))).tag-white{border-color:#000}pre .tag,pre .tag:where(:has(:not(pre))){display:inline;padding:initial;max-width:initial;background:initial;border:initial;border-radius:initial;font-size:inherit;line-height:inherit;white-space:unset}*,*:before,*:after{box-sizing:border-box}.tag-text ::slotted(svg),.tag-text ::slotted(img){display:inline-block !important;height:1.25rem !important;vertical-align:text-top !important}
|
|
@@ -4,7 +4,6 @@ import { version } from "../../../../package";
|
|
|
4
4
|
* @slot default - Content to place in the `default` slot.<p>Markup accepted: <a href="https://developer.mozilla.org/en-US/docs/Glossary/Inline-level_content">inline content</a>.</p>
|
|
5
5
|
*/
|
|
6
6
|
export class PostTag {
|
|
7
|
-
host;
|
|
8
7
|
constructor() {
|
|
9
8
|
this.classes = undefined;
|
|
10
9
|
this.variant = undefined;
|
|
@@ -94,7 +93,7 @@ export class PostTag {
|
|
|
94
93
|
"optional": false,
|
|
95
94
|
"docs": {
|
|
96
95
|
"tags": [],
|
|
97
|
-
"text": "Defines the icon `name` inside of the component.\n<span className=\"banner banner-sm banner-info\">If not set the icon will not show up.</span>\nTo learn which icons are available, please visit our <a href=\"/?path=/docs/
|
|
96
|
+
"text": "Defines the icon `name` inside of the component.\n<span className=\"banner banner-sm banner-info\">If not set the icon will not show up.</span>\nTo learn which icons are available, please visit our <a href=\"/?path=/docs/0dcfe3c0-bfc0-4107-b43b-7e9d825b805f--docs\">icon library</a>."
|
|
98
97
|
},
|
|
99
98
|
"attribute": "icon",
|
|
100
99
|
"reflect": false,
|
|
@@ -6,9 +6,18 @@ import { checkType } from "../../utils/index";
|
|
|
6
6
|
*/
|
|
7
7
|
export class PostTogglebutton {
|
|
8
8
|
constructor() {
|
|
9
|
+
this.handleClick = () => {
|
|
10
|
+
this.toggled = !this.toggled;
|
|
11
|
+
};
|
|
12
|
+
this.handleKeydown = (event) => {
|
|
13
|
+
// perform a click when enter or spaced are pressed to mimic the button behavior
|
|
14
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
15
|
+
event.preventDefault(); // prevents the page from scrolling when space is pressed
|
|
16
|
+
this.host.click();
|
|
17
|
+
}
|
|
18
|
+
};
|
|
9
19
|
this.toggled = false;
|
|
10
20
|
}
|
|
11
|
-
host;
|
|
12
21
|
validateToggled() {
|
|
13
22
|
checkType(this, 'toggled', 'boolean');
|
|
14
23
|
}
|
|
@@ -18,16 +27,6 @@ export class PostTogglebutton {
|
|
|
18
27
|
this.host.addEventListener('click', () => this.handleClick());
|
|
19
28
|
this.host.addEventListener('keydown', (e) => this.handleKeydown(e));
|
|
20
29
|
}
|
|
21
|
-
handleClick = () => {
|
|
22
|
-
this.toggled = !this.toggled;
|
|
23
|
-
};
|
|
24
|
-
handleKeydown = (event) => {
|
|
25
|
-
// perform a click when enter or spaced are pressed to mimic the button behavior
|
|
26
|
-
if (event.key === 'Enter' || event.key === ' ') {
|
|
27
|
-
event.preventDefault(); // prevents the page from scrolling when space is pressed
|
|
28
|
-
this.host.click();
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
30
|
render() {
|
|
32
31
|
return (h(Host, { key: '3a1429a9b67b8cfafae184fe0d060ee3a04974e0', "data-version": version, role: "button", tabindex: "0", "aria-pressed": this.toggled.toString() }, h("slot", { key: '9ab1537574423740fc335fde732c699698acac25' })));
|
|
33
32
|
}
|