@swisspost/design-system-components 9.0.0-next.2 → 9.0.0-next.21
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/.config/bindings.angular.js +4 -0
- package/dist/cjs/{attribute-observer-10f08c04.js → attribute-observer-6d8b886b.js} +4 -4
- package/dist/cjs/check-non-empty-bd99d236.js +15 -0
- package/dist/cjs/check-one-of-75d270b5.js +13 -0
- package/dist/cjs/check-type-cdbf6d29.js +21 -0
- package/dist/cjs/check-url-220a286c.js +19 -0
- package/dist/cjs/debounce-158fd76f.js +13 -0
- package/dist/cjs/fade-72d5ef55.js +14 -0
- package/dist/cjs/get-root-7a3498ef.js +11 -0
- package/dist/cjs/index-23e36ff7.js +37 -0
- package/dist/cjs/{index-c15bd800.js → index-5acef487.js} +54 -17
- package/dist/cjs/index.browser-2f65f583.js +15 -0
- package/dist/cjs/index.cjs.js +56 -27
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{package-a7150f64.js → package-c6bc9e82.js} +1 -1
- package/dist/cjs/{post-accordion-62d2fd79.js → post-accordion-d1345784.js} +9 -8
- package/dist/cjs/post-accordion-item-a796d803.js +64 -0
- package/dist/cjs/post-accordion-item.cjs.entry.js +8 -5
- package/dist/cjs/post-accordion.cjs.entry.js +4 -4
- package/dist/cjs/post-avatar-b4e96354.js +144 -0
- package/dist/cjs/post-avatar.cjs.entry.js +13 -0
- package/dist/cjs/post-back-to-top-fc541c6b.js +76 -0
- package/dist/cjs/post-back-to-top.cjs.entry.js +15 -0
- package/dist/cjs/post-banner-46522b4f.js +96 -0
- package/dist/cjs/post-banner.cjs.entry.js +19 -0
- package/dist/cjs/post-breadcrumb-799d34da.js +112 -0
- package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +17 -0
- package/dist/cjs/post-breadcrumb.cjs.entry.js +13 -0
- package/dist/cjs/post-card-control-7bf7d3f2.js +283 -0
- package/dist/cjs/post-card-control.cjs.entry.js +5 -5
- package/dist/cjs/post-closebutton_15.cjs.entry.js +34 -0
- package/dist/cjs/{post-collapsible-trigger-9dca8493.js → post-collapsible-trigger-0568e3ec.js} +50 -56
- package/dist/cjs/post-collapsible_2.cjs.entry.js +10 -6
- package/dist/cjs/post-components.cjs.js +2 -2
- package/dist/cjs/post-footer-f87a556b.js +88 -0
- package/dist/cjs/post-footer.cjs.entry.js +11 -0
- package/dist/cjs/post-linkarea-0ccf93fc.js +30 -0
- package/dist/cjs/post-linkarea.cjs.entry.js +11 -0
- package/dist/cjs/post-menu-item-eba24c40.js +68 -0
- package/dist/cjs/post-popover-35f679f6.js +106 -0
- package/dist/cjs/post-popover.cjs.entry.js +4 -4
- package/dist/cjs/{post-rating-db5a397a.js → post-rating-d12fa214.js} +16 -6
- package/dist/cjs/post-rating.cjs.entry.js +3 -3
- package/dist/cjs/post-tab-header-89dca04b.js +33 -0
- package/dist/cjs/post-tab-header.cjs.entry.js +5 -4
- package/dist/cjs/{post-tab-panel-d59cf1ec.js → post-tab-panel-ad1ab180.js} +6 -5
- package/dist/cjs/post-tab-panel.cjs.entry.js +4 -3
- package/dist/cjs/{post-tabs-7afae61a.js → post-tabs-0db75745.js} +23 -16
- package/dist/cjs/post-tabs.cjs.entry.js +4 -4
- package/dist/cjs/post-tag-396a46c9.js +47 -0
- package/dist/cjs/post-tag.cjs.entry.js +3 -3
- package/dist/cjs/post-togglebutton-69983699.js +3861 -0
- package/dist/cjs/{post-tooltip-432852c7.js → post-tooltip-7174ea97.js} +38 -25
- package/dist/cjs/post-tooltip.cjs.entry.js +8 -6
- package/dist/cjs/slide-8ae17ee4.js +28 -0
- package/dist/collection/animations/collapse.js +5 -5
- package/dist/collection/animations/fade.js +6 -2
- package/dist/collection/animations/slide.js +23 -0
- package/dist/collection/collection-manifest.json +22 -3
- package/dist/collection/components/post-accordion/post-accordion.css +1 -1
- package/dist/collection/components/post-accordion/post-accordion.js +5 -3
- package/dist/collection/components/post-accordion-item/post-accordion-item.css +1 -1
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +29 -11
- package/dist/collection/components/post-avatar/post-avatar.css +3 -0
- package/dist/collection/components/post-avatar/post-avatar.js +234 -0
- package/dist/collection/components/post-back-to-top/post-back-to-top.css +1 -0
- package/dist/collection/components/post-back-to-top/post-back-to-top.js +109 -0
- package/dist/collection/components/post-banner/banner-types.js +1 -0
- package/dist/collection/components/post-banner/post-banner.css +3 -0
- package/dist/collection/components/{post-alert/post-alert.js → post-banner/post-banner.js} +51 -73
- package/dist/collection/components/post-breadcrumb/post-breadcrumb.css +3 -0
- package/dist/collection/components/post-breadcrumb/post-breadcrumb.js +163 -0
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.css +1 -0
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +98 -0
- package/dist/collection/components/post-card-control/post-card-control.css +1 -1
- package/dist/collection/components/post-card-control/post-card-control.js +55 -43
- package/dist/collection/components/post-closebutton/post-closebutton.js +13 -0
- package/dist/collection/components/post-collapsible/post-collapsible.css +1 -1
- package/dist/collection/components/post-collapsible/post-collapsible.js +15 -6
- package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +21 -20
- package/dist/collection/components/post-footer/post-footer.css +1 -0
- package/dist/collection/components/post-footer/post-footer.js +76 -0
- package/dist/collection/components/post-header/post-header.css +1 -0
- package/dist/collection/components/post-header/post-header.js +267 -0
- package/dist/collection/components/post-icon/post-icon.js +80 -47
- package/dist/collection/components/post-language-option/post-language-option.css +3 -0
- package/dist/collection/components/post-language-option/post-language-option.js +224 -0
- package/dist/collection/components/post-language-switch/post-language-switch.css +1 -0
- package/dist/collection/components/post-language-switch/post-language-switch.js +164 -0
- package/dist/collection/components/post-language-switch/switch-variants.js +1 -0
- package/dist/collection/components/post-linkarea/post-linkarea.css +1 -0
- package/dist/collection/components/post-linkarea/post-linkarea.js +30 -0
- package/dist/collection/components/post-list/post-list.css +3 -0
- package/dist/collection/components/post-list/post-list.js +90 -0
- package/dist/collection/components/post-list-item/post-list-item.css +1 -0
- package/dist/collection/components/post-list-item/post-list-item.js +26 -0
- package/dist/collection/components/post-logo/post-logo.css +1 -1
- package/dist/collection/components/post-logo/post-logo.js +4 -3
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +1 -0
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +255 -0
- package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -0
- package/dist/collection/components/post-megadropdown/post-megadropdown.js +268 -0
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.css +1 -0
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +127 -0
- package/dist/collection/components/post-menu/post-menu.css +3 -0
- package/dist/collection/components/post-menu/post-menu.js +297 -0
- package/dist/collection/components/post-menu-item/post-menu-item.js +8 -0
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.css +1 -0
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +122 -0
- package/dist/collection/components/post-popover/post-popover.css +1 -1
- package/dist/collection/components/post-popover/post-popover.js +6 -3
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -1
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +193 -38
- package/dist/collection/components/post-rating/post-rating.css +1 -1
- package/dist/collection/components/post-rating/post-rating.js +13 -2
- package/dist/collection/components/post-tab-header/post-tab-header.css +2 -2
- package/dist/collection/components/post-tab-header/post-tab-header.js +6 -4
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +4 -2
- package/dist/collection/components/post-tabs/post-tabs.css +1 -1
- package/dist/collection/components/post-tabs/post-tabs.js +17 -14
- package/dist/collection/components/post-tag/post-tag.css +1 -1
- package/dist/collection/components/post-tag/post-tag.js +3 -2
- package/dist/collection/components/post-togglebutton/post-togglebutton.css +1 -0
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +75 -0
- package/dist/collection/components/post-tooltip/post-tooltip.css +1 -1
- package/dist/collection/components/post-tooltip/post-tooltip.js +35 -17
- package/dist/collection/index.js +21 -2
- package/dist/collection/utils/attribute-observer.js +4 -4
- package/dist/collection/utils/breakpoints.js +50 -0
- package/dist/collection/utils/component-on-ready.js +4 -4
- package/dist/collection/utils/debounce.js +2 -1
- package/dist/collection/utils/get-focusable-children.js +33 -0
- package/dist/collection/utils/property-checkers/check-non-empty.js +6 -2
- package/dist/collection/utils/property-checkers/check-one-of.js +8 -3
- package/dist/collection/utils/property-checkers/check-pattern.js +8 -3
- package/dist/collection/utils/property-checkers/check-type.js +11 -6
- package/dist/collection/utils/property-checkers/check-url.js +11 -6
- package/dist/collection/utils/property-checkers/empty-or.js +5 -2
- package/dist/collection/utils/sass-export.js +8 -5
- package/dist/components/attribute-observer.js +4 -4
- package/dist/components/check-non-empty.js +6 -2
- package/dist/components/check-one-of.js +8 -3
- package/dist/components/check-type.js +11 -6
- package/dist/components/debounce.js +11 -0
- package/dist/components/fade.js +6 -2
- package/dist/components/get-focusable-children.js +35 -0
- package/dist/components/get-root.js +9 -0
- package/dist/components/index.browser.js +13 -0
- package/dist/components/index.js +21 -2
- package/dist/components/index2.js +25 -12
- package/dist/components/index3.js +135 -0
- package/dist/components/package.js +1 -1
- package/dist/components/post-accordion-item2.js +36 -16
- package/dist/components/post-accordion2.js +6 -5
- package/dist/components/post-avatar.d.ts +11 -0
- package/dist/components/post-avatar.js +6 -0
- package/dist/components/post-avatar2.js +169 -0
- package/dist/components/post-back-to-top.d.ts +11 -0
- package/dist/components/post-back-to-top.js +6 -0
- package/dist/components/post-back-to-top2.js +101 -0
- package/dist/components/post-banner.d.ts +11 -0
- package/dist/components/post-banner.js +6 -0
- package/dist/components/post-banner2.js +131 -0
- package/dist/components/post-breadcrumb-item.d.ts +11 -0
- package/dist/components/post-breadcrumb-item.js +6 -0
- package/dist/components/post-breadcrumb-item2.js +82 -0
- package/dist/components/post-breadcrumb.d.ts +11 -0
- package/dist/components/post-breadcrumb.js +6 -0
- package/dist/components/post-breadcrumb2.js +169 -0
- package/dist/components/post-card-control2.js +50 -39
- package/dist/components/post-closebutton.d.ts +11 -0
- package/dist/components/post-closebutton.js +6 -0
- package/dist/components/post-closebutton2.js +34 -0
- package/dist/components/post-collapsible-trigger2.js +23 -38
- package/dist/components/post-collapsible2.js +22 -14
- package/dist/components/post-footer.d.ts +11 -0
- package/dist/components/post-footer.js +6 -0
- package/dist/components/post-footer2.js +128 -0
- package/dist/components/post-header.d.ts +11 -0
- package/dist/components/post-header.js +6 -0
- package/dist/components/post-header2.js +217 -0
- package/dist/components/post-icon2.js +82 -46
- package/dist/components/post-language-option.d.ts +11 -0
- package/dist/components/post-language-option.js +6 -0
- package/dist/components/post-language-option2.js +102 -0
- package/dist/components/post-language-switch.d.ts +11 -0
- package/dist/components/post-language-switch.js +6 -0
- package/dist/components/post-language-switch2.js +135 -0
- package/dist/components/post-linkarea.d.ts +11 -0
- package/dist/components/post-linkarea.js +6 -0
- package/dist/components/post-linkarea2.js +42 -0
- package/dist/components/post-list-item.d.ts +11 -0
- package/dist/components/post-list-item.js +6 -0
- package/dist/components/post-list-item2.js +35 -0
- package/dist/components/{post-alert.d.ts → post-list.d.ts} +4 -4
- package/dist/components/post-list.js +6 -0
- package/dist/components/post-list2.js +55 -0
- package/dist/components/post-logo2.js +5 -5
- package/dist/components/post-mainnavigation.d.ts +11 -0
- package/dist/components/post-mainnavigation.js +6 -0
- package/dist/components/post-mainnavigation2.js +258 -0
- package/dist/components/post-megadropdown-trigger.d.ts +11 -0
- package/dist/components/post-megadropdown-trigger.js +6 -0
- package/dist/components/post-megadropdown-trigger2.js +113 -0
- package/dist/components/post-megadropdown.d.ts +11 -0
- package/dist/components/post-megadropdown.js +6 -0
- package/dist/components/post-megadropdown2.js +186 -0
- package/dist/components/post-menu-item.d.ts +11 -0
- package/dist/components/post-menu-item.js +6 -0
- package/dist/components/post-menu-item2.js +27 -0
- package/dist/components/post-menu-trigger.d.ts +11 -0
- package/dist/components/post-menu-trigger.js +6 -0
- package/dist/components/post-menu-trigger2.js +109 -0
- package/dist/components/post-menu.d.ts +11 -0
- package/dist/components/post-menu.js +6 -0
- package/dist/components/post-menu2.js +193 -0
- package/dist/components/post-popover2.js +6 -4
- package/dist/components/post-popovercontainer2.js +227 -59
- package/dist/components/post-rating2.js +14 -4
- package/dist/components/post-tab-header2.js +7 -6
- package/dist/components/post-tab-panel2.js +4 -3
- package/dist/components/post-tabs2.js +20 -13
- package/dist/components/post-tag2.js +3 -3
- package/dist/components/post-togglebutton.d.ts +11 -0
- package/dist/components/post-togglebutton.js +6 -0
- package/dist/components/post-togglebutton2.js +61 -0
- package/dist/components/post-tooltip2.js +35 -22
- package/dist/components/slide.js +25 -0
- package/dist/docs.json +1956 -270
- package/dist/esm/{attribute-observer-37fa950a.js → attribute-observer-2f203993.js} +4 -4
- package/dist/esm/check-non-empty-258a56b3.js +13 -0
- package/dist/esm/check-one-of-0bee20f5.js +11 -0
- package/dist/esm/check-type-37d5d307.js +19 -0
- package/dist/esm/check-url-17962bc8.js +17 -0
- package/dist/esm/debounce-e54c7131.js +11 -0
- package/dist/esm/fade-1f3cacf4.js +11 -0
- package/dist/esm/get-root-7af2e0d1.js +9 -0
- package/dist/esm/{index-0b56fc28.js → index-40846676.js} +54 -17
- package/dist/esm/index-8f8fe5b0.js +32 -0
- package/dist/esm/index.browser-51485f85.js +13 -0
- package/dist/esm/index.js +32 -22
- package/dist/esm/loader.js +3 -3
- package/dist/esm/package-5614c98b.js +3 -0
- package/dist/esm/{post-accordion-6f4d2b9a.js → post-accordion-f6d1834d.js} +9 -8
- package/dist/esm/post-accordion-item-7cb93300.js +62 -0
- package/dist/esm/post-accordion-item.entry.js +8 -5
- package/dist/esm/post-accordion.entry.js +4 -4
- package/dist/esm/post-avatar-96108967.js +142 -0
- package/dist/esm/post-avatar.entry.js +5 -0
- package/dist/esm/post-back-to-top-7f8a61c8.js +74 -0
- package/dist/esm/post-back-to-top.entry.js +7 -0
- package/dist/esm/post-banner-bb69bce8.js +94 -0
- package/dist/esm/post-banner.entry.js +11 -0
- package/dist/esm/post-breadcrumb-9d9efa4e.js +110 -0
- package/dist/esm/post-breadcrumb-item_2.entry.js +8 -0
- package/dist/esm/post-breadcrumb.entry.js +5 -0
- package/dist/esm/post-card-control-fdced7d5.js +281 -0
- package/dist/esm/post-card-control.entry.js +5 -5
- package/dist/esm/post-closebutton_15.entry.js +12 -0
- package/dist/esm/{post-collapsible-trigger-85c2064a.js → post-collapsible-trigger-17b2f067.js} +49 -55
- package/dist/esm/post-collapsible_2.entry.js +10 -6
- package/dist/esm/post-components.js +3 -3
- package/dist/esm/post-footer-2dcd8159.js +86 -0
- package/dist/esm/post-footer.entry.js +3 -0
- package/dist/esm/post-linkarea-06c5144d.js +28 -0
- package/dist/esm/post-linkarea.entry.js +3 -0
- package/dist/esm/post-menu-item-e917bf99.js +65 -0
- package/dist/esm/post-popover-67a3cbf2.js +104 -0
- package/dist/esm/post-popover.entry.js +4 -4
- package/dist/esm/{post-rating-d9fc0b40.js → post-rating-9613bee8.js} +16 -6
- package/dist/esm/post-rating.entry.js +3 -3
- package/dist/esm/post-tab-header-dff3a025.js +31 -0
- package/dist/esm/post-tab-header.entry.js +5 -4
- package/dist/esm/{post-tab-panel-926439f4.js → post-tab-panel-2b3f82a8.js} +6 -5
- package/dist/esm/post-tab-panel.entry.js +4 -3
- package/dist/esm/{post-tabs-13b2d9a6.js → post-tabs-46d1165f.js} +23 -16
- package/dist/esm/post-tabs.entry.js +4 -4
- package/dist/esm/post-tag-4176268e.js +45 -0
- package/dist/esm/post-tag.entry.js +3 -3
- package/dist/esm/post-togglebutton-5892c5bd.js +3845 -0
- package/dist/esm/{post-tooltip-3cde6b53.js → post-tooltip-5a45a569.js} +38 -25
- package/dist/esm/post-tooltip.entry.js +8 -6
- package/dist/esm/slide-62768431.js +25 -0
- package/dist/post-components/index.esm.js +1 -1
- package/dist/post-components/p-017dc6c7.js +1 -0
- package/dist/post-components/p-0227b899.js +1 -0
- package/dist/post-components/p-04895a54.js +1 -0
- package/dist/post-components/p-04c38bfe.entry.js +1 -0
- package/dist/post-components/p-07a0a626.js +1 -0
- package/dist/post-components/p-12573893.js +1 -0
- package/dist/post-components/p-1289b0a7.entry.js +1 -0
- package/dist/post-components/p-12a11565.js +1 -0
- package/dist/post-components/p-1542a80e.entry.js +1 -0
- package/dist/post-components/p-181c73d5.js +1 -0
- package/dist/post-components/p-254a9bd2.entry.js +1 -0
- package/dist/post-components/p-28500934.entry.js +1 -0
- package/dist/post-components/p-2b1281af.js +1 -0
- package/dist/post-components/p-2c69e7f2.entry.js +1 -0
- package/dist/post-components/p-30132b19.entry.js +1 -0
- package/dist/post-components/p-30af1d48.js +1 -0
- package/dist/post-components/p-3bdeb686.entry.js +1 -0
- package/dist/post-components/p-47cb31dd.js +1 -0
- package/dist/post-components/p-4af6dbed.js +1 -0
- package/dist/post-components/p-4f41f63e.js +1 -0
- package/dist/post-components/p-52790b8b.js +1 -0
- package/dist/post-components/p-5959f2bd.js +1 -0
- package/dist/post-components/{p-82dcf8c6.js → p-59ca0a13.js} +3 -3
- package/dist/post-components/p-5aaa5703.entry.js +1 -0
- package/dist/post-components/p-64e3de38.js +1 -0
- package/dist/post-components/p-67a45f16.js +1 -0
- package/dist/post-components/p-6d8ac9bd.entry.js +1 -0
- package/dist/post-components/p-7709c14a.js +1 -0
- package/dist/post-components/p-77cc2a5e.entry.js +1 -0
- package/dist/post-components/p-79c552fb.js +1 -0
- package/dist/post-components/p-7dd05e6d.entry.js +1 -0
- package/dist/post-components/p-803b7598.js +1 -0
- package/dist/post-components/p-85fdc2d3.js +1 -0
- package/dist/post-components/p-9748a355.js +1 -0
- package/dist/post-components/p-98fcf90b.entry.js +1 -0
- package/dist/post-components/p-994fae4c.entry.js +1 -0
- package/dist/post-components/p-a805515a.entry.js +1 -0
- package/dist/post-components/p-b5b48f66.entry.js +1 -0
- package/dist/post-components/p-b9bf5a5f.js +1 -0
- package/dist/post-components/p-c6b3a926.js +1 -0
- package/dist/post-components/p-c9dd3cdb.entry.js +1 -0
- package/dist/post-components/p-cb5e4a06.js +1 -0
- package/dist/post-components/p-d45df336.js +1 -0
- package/dist/post-components/p-dd4a5c0a.entry.js +1 -0
- package/dist/post-components/p-e1baac59.js +1 -0
- package/dist/post-components/p-e585c6fe.js +1 -0
- package/dist/post-components/p-e6d54838.entry.js +1 -0
- package/dist/post-components/p-f4b0cc7d.js +1 -0
- package/dist/post-components/p-fc91cbc2.js +1 -0
- package/dist/post-components/p-fe8c300c.js +1 -0
- package/dist/post-components/p-ff95dcd3.js +2 -0
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/animations/collapse.d.ts +2 -2
- package/dist/types/animations/fade.d.ts +2 -2
- package/dist/types/animations/slide.d.ts +2 -0
- package/dist/types/components/post-accordion-item/post-accordion-item.d.ts +8 -2
- package/dist/types/components/post-avatar/post-avatar.d.ts +51 -0
- package/dist/types/components/post-back-to-top/post-back-to-top.d.ts +19 -0
- package/dist/types/components/post-banner/banner-types.d.ts +2 -0
- package/dist/types/components/post-banner/post-banner.d.ts +49 -0
- package/dist/types/components/post-breadcrumb/post-breadcrumb.d.ts +30 -0
- package/dist/types/components/post-breadcrumb-item/post-breadcrumb-item.d.ts +20 -0
- package/dist/types/components/post-card-control/post-card-control.d.ts +9 -9
- package/dist/types/components/post-closebutton/post-closebutton.d.ts +7 -0
- package/dist/types/components/post-footer/post-footer.d.ts +23 -0
- package/dist/types/components/post-header/post-header.d.ts +45 -0
- package/dist/types/components/post-icon/post-icon.d.ts +14 -12
- package/dist/types/components/post-language-option/post-language-option.d.ts +45 -0
- package/dist/types/components/post-language-switch/post-language-switch.d.ts +31 -0
- package/dist/types/components/post-language-switch/switch-variants.d.ts +2 -0
- package/dist/types/components/post-linkarea/post-linkarea.d.ts +5 -0
- package/dist/types/components/post-list/post-list.d.ts +24 -0
- package/dist/types/components/post-list-item/post-list-item.d.ts +8 -0
- package/dist/types/components/post-logo/post-logo.d.ts +1 -1
- package/dist/types/components/post-mainnavigation/post-mainnavigation.d.ts +70 -0
- package/dist/types/components/post-megadropdown/post-megadropdown.d.ts +57 -0
- package/dist/types/components/post-megadropdown-trigger/post-megadropdown-trigger.d.ts +31 -0
- package/dist/types/components/post-menu/post-menu.d.ts +48 -0
- package/dist/types/components/post-menu-item/post-menu-item.d.ts +3 -0
- package/dist/types/components/post-menu-trigger/post-menu-trigger.d.ts +28 -0
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +23 -1
- package/dist/types/components/post-tab-header/post-tab-header.d.ts +1 -1
- package/dist/types/components/post-tabs/post-tabs.d.ts +1 -1
- package/dist/types/components/post-tag/post-tag.d.ts +1 -1
- package/dist/types/components/post-togglebutton/post-togglebutton.d.ts +15 -0
- package/dist/types/components.d.ts +609 -48
- package/dist/types/home/runner/work/design-system/design-system/packages/components/.stencil/.config/bindings.angular.d.ts +2 -0
- package/dist/types/index.d.ts +22 -3
- package/dist/types/utils/attribute-observer.d.ts +1 -1
- package/dist/types/utils/breakpoints.d.ts +12 -0
- package/dist/types/utils/component-on-ready.d.ts +1 -1
- package/dist/types/utils/get-focusable-children.d.ts +1 -0
- package/dist/types/utils/get-root.d.ts +1 -1
- package/dist/types/utils/property-checkers/check-non-empty.d.ts +3 -1
- package/dist/types/utils/property-checkers/check-one-of.d.ts +3 -1
- package/dist/types/utils/property-checkers/check-pattern.d.ts +3 -1
- package/dist/types/utils/property-checkers/check-type.d.ts +3 -1
- package/dist/types/utils/property-checkers/check-url.d.ts +3 -1
- package/dist/types/utils/property-checkers/index.d.ts +12 -4
- package/dist/types/utils/sass-export.d.ts +5 -1
- package/loaders/attribute-observer.js +4 -4
- package/loaders/check-non-empty.js +6 -2
- package/loaders/check-one-of.js +8 -3
- package/loaders/check-type.js +11 -6
- package/loaders/debounce.js +11 -0
- package/loaders/fade.js +6 -2
- package/loaders/get-focusable-children.js +35 -0
- package/loaders/get-root.js +9 -0
- package/loaders/index.browser.js +13 -0
- package/loaders/index.d.ts +40 -2
- package/loaders/index.js +21 -2
- package/loaders/index2.js +25 -12
- package/loaders/index3.js +135 -0
- package/loaders/package.js +1 -1
- package/loaders/post-accordion-item.js +1 -81
- package/loaders/post-accordion-item2.js +103 -0
- package/loaders/post-accordion.js +6 -5
- package/loaders/post-avatar.d.ts +11 -0
- package/loaders/post-avatar.js +172 -0
- package/loaders/post-back-to-top.d.ts +11 -0
- package/loaders/post-back-to-top.js +104 -0
- package/loaders/post-banner.d.ts +11 -0
- package/loaders/post-banner.js +134 -0
- package/loaders/post-breadcrumb-item.d.ts +11 -0
- package/loaders/post-breadcrumb-item.js +6 -0
- package/loaders/post-breadcrumb-item2.js +82 -0
- package/loaders/post-breadcrumb.d.ts +11 -0
- package/loaders/post-breadcrumb.js +172 -0
- package/loaders/post-card-control.js +50 -39
- package/loaders/post-closebutton.d.ts +11 -0
- package/loaders/post-closebutton.js +37 -0
- package/loaders/post-collapsible-trigger2.js +23 -38
- package/loaders/post-collapsible2.js +21 -13
- package/loaders/post-footer.d.ts +11 -0
- package/loaders/post-footer.js +131 -0
- package/loaders/post-header.d.ts +11 -0
- package/loaders/post-header.js +220 -0
- package/loaders/post-icon2.js +82 -46
- package/loaders/post-language-option.d.ts +11 -0
- package/loaders/post-language-option.js +105 -0
- package/loaders/post-language-switch.d.ts +11 -0
- package/loaders/post-language-switch.js +138 -0
- package/loaders/post-linkarea.d.ts +11 -0
- package/loaders/post-linkarea.js +45 -0
- package/loaders/post-list-item.d.ts +11 -0
- package/loaders/post-list-item.js +38 -0
- package/loaders/{post-alert.d.ts → post-list.d.ts} +4 -4
- package/loaders/post-list.js +58 -0
- package/loaders/post-logo.js +6 -6
- package/loaders/post-mainnavigation.d.ts +11 -0
- package/loaders/post-mainnavigation.js +261 -0
- package/loaders/post-megadropdown-trigger.d.ts +11 -0
- package/loaders/post-megadropdown-trigger.js +116 -0
- package/loaders/post-megadropdown.d.ts +11 -0
- package/loaders/post-megadropdown.js +189 -0
- package/loaders/post-menu-item.d.ts +11 -0
- package/loaders/post-menu-item.js +6 -0
- package/loaders/post-menu-item2.js +27 -0
- package/loaders/post-menu-trigger.d.ts +11 -0
- package/loaders/post-menu-trigger.js +6 -0
- package/loaders/post-menu-trigger2.js +109 -0
- package/loaders/post-menu.d.ts +11 -0
- package/loaders/post-menu.js +6 -0
- package/loaders/post-menu2.js +193 -0
- package/loaders/post-popover.js +6 -4
- package/loaders/post-popovercontainer2.js +227 -59
- package/loaders/post-rating.js +14 -4
- package/loaders/post-tab-header.js +7 -6
- package/loaders/post-tab-panel.js +4 -3
- package/loaders/post-tabs.js +20 -13
- package/loaders/post-tag.js +3 -3
- package/loaders/post-togglebutton.d.ts +11 -0
- package/loaders/post-togglebutton.js +64 -0
- package/loaders/post-tooltip.js +34 -21
- package/loaders/slide.js +25 -0
- package/package.json +26 -20
- package/dist/cjs/check-non-empty-eeaa8f77.js +0 -11
- package/dist/cjs/check-one-of-f4f5d0c0.js +0 -8
- package/dist/cjs/fade-35a3633a.js +0 -10
- package/dist/cjs/index-01f30442.js +0 -52
- package/dist/cjs/post-accordion-item-7b348fa5.js +0 -51
- package/dist/cjs/post-alert-fca3a4a3.js +0 -98
- package/dist/cjs/post-alert.cjs.entry.js +0 -16
- package/dist/cjs/post-card-control-b4e4b4d5.js +0 -272
- package/dist/cjs/post-icon-3934be0b.js +0 -104
- package/dist/cjs/post-icon.cjs.entry.js +0 -15
- package/dist/cjs/post-logo-c3603fc7.js +0 -39
- package/dist/cjs/post-logo.cjs.entry.js +0 -14
- package/dist/cjs/post-popover-15f9620a.js +0 -104
- package/dist/cjs/post-popovercontainer-7d536276.js +0 -2186
- package/dist/cjs/post-popovercontainer.cjs.entry.js +0 -11
- package/dist/cjs/post-tab-header-29b8d4e1.js +0 -32
- package/dist/cjs/post-tag-b7d0bbff.js +0 -47
- package/dist/collection/components/post-alert/alert-types.js +0 -1
- package/dist/collection/components/post-alert/post-alert.css +0 -7
- package/dist/components/post-alert.js +0 -6
- package/dist/components/post-alert2.js +0 -136
- package/dist/esm/check-non-empty-58bd6b17.js +0 -9
- package/dist/esm/check-one-of-6b3ef8eb.js +0 -6
- package/dist/esm/fade-7fd71785.js +0 -7
- package/dist/esm/index-f41b763f.js +0 -46
- package/dist/esm/package-3d758f77.js +0 -3
- package/dist/esm/post-accordion-item-6b5a65ad.js +0 -49
- package/dist/esm/post-alert-f19db551.js +0 -96
- package/dist/esm/post-alert.entry.js +0 -8
- package/dist/esm/post-card-control-1b5df6cb.js +0 -270
- package/dist/esm/post-icon-40929043.js +0 -102
- package/dist/esm/post-icon.entry.js +0 -7
- package/dist/esm/post-logo-c6351ba8.js +0 -37
- package/dist/esm/post-logo.entry.js +0 -6
- package/dist/esm/post-popover-58149de7.js +0 -102
- package/dist/esm/post-popovercontainer-8bde9fc3.js +0 -2184
- package/dist/esm/post-popovercontainer.entry.js +0 -3
- package/dist/esm/post-tab-header-ae8feb19.js +0 -30
- package/dist/esm/post-tag-887d5fbe.js +0 -45
- package/dist/post-components/p-0b71bf5a.js +0 -1
- package/dist/post-components/p-0e09dc41.js +0 -1
- package/dist/post-components/p-19e54be9.js +0 -1
- package/dist/post-components/p-1e8f0f36.js +0 -1
- package/dist/post-components/p-22257eff.entry.js +0 -1
- package/dist/post-components/p-249ac168.entry.js +0 -1
- package/dist/post-components/p-2737eaf5.js +0 -1
- package/dist/post-components/p-2b10e265.js +0 -1
- package/dist/post-components/p-3325086e.js +0 -1
- package/dist/post-components/p-3b823fee.entry.js +0 -1
- package/dist/post-components/p-45f4c803.entry.js +0 -1
- package/dist/post-components/p-47935dbb.js +0 -1
- package/dist/post-components/p-486fbbce.entry.js +0 -1
- package/dist/post-components/p-4a7fb0f3.entry.js +0 -1
- package/dist/post-components/p-5f231c2c.js +0 -1
- package/dist/post-components/p-611b3c41.js +0 -1
- package/dist/post-components/p-6a28f8b9.js +0 -1
- package/dist/post-components/p-6adeaa6c.js +0 -1
- package/dist/post-components/p-6ed3497a.entry.js +0 -1
- package/dist/post-components/p-820c5c19.entry.js +0 -1
- package/dist/post-components/p-8aeb549f.entry.js +0 -1
- package/dist/post-components/p-92aeec3c.js +0 -1
- package/dist/post-components/p-9a99cfc7.js +0 -1
- package/dist/post-components/p-aa8a08dc.entry.js +0 -1
- package/dist/post-components/p-b095519d.js +0 -1
- package/dist/post-components/p-b99fdec3.js +0 -1
- package/dist/post-components/p-ba40b28a.entry.js +0 -1
- package/dist/post-components/p-c62de925.js +0 -1
- package/dist/post-components/p-d2101b8a.entry.js +0 -1
- package/dist/post-components/p-d2f9de94.js +0 -2
- package/dist/post-components/p-d7a44f45.js +0 -1
- package/dist/post-components/p-db4b8ea1.entry.js +0 -1
- package/dist/post-components/p-deb4131c.js +0 -1
- package/dist/post-components/p-eedc6ae8.entry.js +0 -1
- package/dist/post-components/p-f217f420.js +0 -1
- package/dist/post-components/p-f707d163.entry.js +0 -1
- package/dist/types/components/post-alert/alert-types.d.ts +0 -2
- package/dist/types/components/post-alert/post-alert.d.ts +0 -54
- package/loaders/post-alert.js +0 -139
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { v as version } from './package.js';
|
|
3
|
+
import { c as checkNonEmpty } from './check-non-empty.js';
|
|
4
|
+
|
|
5
|
+
const postAvatarCss = "/*!\n * Copyright 2021 by Swiss Post, Information Technology\n */:host{--post-avatar-bg:var(--post-scheme-color-interactive-primary-enabled-bg2);--post-avatar-fg:var(--post-scheme-color-interactive-primary-enabled-fg3);display:inline-flex;position:relative;width:var(--post-device-sizing-interactive-icon-size3);height:var(--post-device-sizing-interactive-icon-size3);background-color:var(--post-scheme-color-interactive-primary-enabled-stroke3);border:var(--post-device-border-width-default) solid var(--post-scheme-color-interactive-primary-enabled-stroke3);border-radius:var(--post-device-border-radius-round);font-size:var(--post-device-font-size-8);vertical-align:top;line-height:1}:host::after{display:block;content:\"\";position:absolute;inset:0;z-index:1;border-radius:inherit}*,*::before,*::after{box-sizing:border-box}slot,img,::slotted(img){display:block;width:100%;height:100%}img,::slotted(img){border-radius:var(--post-device-border-radius-round)}::slotted(:not(img)){display:none !important}.initials{display:flex;justify-content:center;align-items:center;position:relative;z-index:2;width:100%;height:100%;background-color:var(--post-avatar-bg);border-radius:var(--post-device-border-radius-round);color:var(--post-avatar-fg);text-transform:uppercase}.initials span{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}.initials span:not(caption){position:absolute !important}";
|
|
6
|
+
const PostAvatarStyle0 = postAvatarCss;
|
|
7
|
+
|
|
8
|
+
// https://docs.gravatar.com/api/avatars/images/
|
|
9
|
+
const GRAVATAR_DEFAULT = '404';
|
|
10
|
+
const GRAVATAR_RATING = 'g';
|
|
11
|
+
const GRAVATAR_SIZE = 80;
|
|
12
|
+
const GRAVATAR_BASE_URL = `https://www.gravatar.com/avatar/{email}?s=${GRAVATAR_SIZE}&d=${GRAVATAR_DEFAULT}&r=${GRAVATAR_RATING}`;
|
|
13
|
+
var AvatarType;
|
|
14
|
+
(function (AvatarType) {
|
|
15
|
+
AvatarType["Slotted"] = "slotted";
|
|
16
|
+
AvatarType["Image"] = "image";
|
|
17
|
+
AvatarType["Initials"] = "initials";
|
|
18
|
+
AvatarType[AvatarType["Null"] = null] = "Null";
|
|
19
|
+
})(AvatarType || (AvatarType = {}));
|
|
20
|
+
const PostAvatar = /*@__PURE__*/ proxyCustomElement(class PostAvatar extends HTMLElement {
|
|
21
|
+
constructor() {
|
|
22
|
+
super();
|
|
23
|
+
this.__registerHost();
|
|
24
|
+
this.__attachShadow();
|
|
25
|
+
this.firstname = undefined;
|
|
26
|
+
this.lastname = undefined;
|
|
27
|
+
this.userid = undefined;
|
|
28
|
+
this.email = undefined;
|
|
29
|
+
this.slottedImage = undefined;
|
|
30
|
+
this.avatarType = null;
|
|
31
|
+
this.imageUrl = '';
|
|
32
|
+
this.imageAlt = '';
|
|
33
|
+
this.initials = '';
|
|
34
|
+
}
|
|
35
|
+
static INTERNAL_USERID_IMAGE_SRC = 'https://web.post.ch/UserProfileImage/{userid}.png';
|
|
36
|
+
get host() { return this; }
|
|
37
|
+
validateFirstname() {
|
|
38
|
+
checkNonEmpty(this, 'firstname');
|
|
39
|
+
}
|
|
40
|
+
async getAvatar() {
|
|
41
|
+
if (this.slottedImage !== null) {
|
|
42
|
+
this.avatarType = AvatarType.Slotted;
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
let imageLoaded = false;
|
|
46
|
+
if (!imageLoaded && this.userid)
|
|
47
|
+
imageLoaded = await this.getImageByProp(this.userid, this.fetchImageByUserId.bind(this));
|
|
48
|
+
if (!imageLoaded && this.email)
|
|
49
|
+
imageLoaded = await this.getImageByProp(this.email, this.fetchImageByEmail.bind(this));
|
|
50
|
+
if (!imageLoaded)
|
|
51
|
+
this.getAvatarByInitials();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
async getImageByProp(prop, fetchImage) {
|
|
55
|
+
if (!prop)
|
|
56
|
+
return false;
|
|
57
|
+
const imageResponse = (await this.getStorageItem(prop)) ?? { ok: false, url: '' };
|
|
58
|
+
if (!imageResponse.ok) {
|
|
59
|
+
try {
|
|
60
|
+
const r = await fetchImage();
|
|
61
|
+
imageResponse.ok = r.ok;
|
|
62
|
+
imageResponse.url = r.url;
|
|
63
|
+
this.imageUrl = imageResponse.url;
|
|
64
|
+
this.imageAlt = `${this.firstname} ${this.lastname} avatar`;
|
|
65
|
+
this.avatarType = AvatarType.Image;
|
|
66
|
+
this.setStorageItem(this.userid, JSON.stringify(imageResponse));
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
this.removeStorageItem(prop);
|
|
70
|
+
console.info(`Loading avatar by type "${AvatarType.Image}" failed.`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return imageResponse.ok;
|
|
74
|
+
}
|
|
75
|
+
async fetchImageByUserId() {
|
|
76
|
+
return await fetch(PostAvatar.INTERNAL_USERID_IMAGE_SRC.replace('{userid}', encodeURIComponent(this.userid)));
|
|
77
|
+
}
|
|
78
|
+
async fetchImageByEmail() {
|
|
79
|
+
const email = await this.cryptify(this.email);
|
|
80
|
+
const imageUrl = GRAVATAR_BASE_URL.replace('{email}', email);
|
|
81
|
+
return await fetch(imageUrl);
|
|
82
|
+
}
|
|
83
|
+
getAvatarByInitials() {
|
|
84
|
+
this.initials = this.getInitials();
|
|
85
|
+
this.avatarType = AvatarType.Initials;
|
|
86
|
+
}
|
|
87
|
+
getNames() {
|
|
88
|
+
return [this.firstname, this.lastname].filter(n => n);
|
|
89
|
+
}
|
|
90
|
+
getInitials() {
|
|
91
|
+
return this.getNames()
|
|
92
|
+
.map(n => n.charAt(0))
|
|
93
|
+
.join('')
|
|
94
|
+
.trim();
|
|
95
|
+
}
|
|
96
|
+
async getStorageItem(keyToken) {
|
|
97
|
+
const key = await this.cryptify(keyToken);
|
|
98
|
+
const value = window?.sessionStorage?.getItem(key);
|
|
99
|
+
return value ? JSON.parse(value) : null;
|
|
100
|
+
}
|
|
101
|
+
async setStorageItem(keyToken, value) {
|
|
102
|
+
const key = await this.cryptify(keyToken);
|
|
103
|
+
window?.sessionStorage?.setItem(key, value);
|
|
104
|
+
}
|
|
105
|
+
async removeStorageItem(keyToken) {
|
|
106
|
+
const key = await this.cryptify(keyToken);
|
|
107
|
+
window?.sessionStorage?.removeItem(key);
|
|
108
|
+
}
|
|
109
|
+
async cryptify(key) {
|
|
110
|
+
return await crypto.subtle.digest('SHA-256', new TextEncoder().encode(key)).then(buffer => {
|
|
111
|
+
return Array.from(new Uint8Array(buffer))
|
|
112
|
+
.map(bytes => bytes.toString(16).padStart(2, '0'))
|
|
113
|
+
.join('');
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
onSlotDefaultChange() {
|
|
117
|
+
this.slottedImage = this.host.querySelector('img');
|
|
118
|
+
this.getAvatar();
|
|
119
|
+
}
|
|
120
|
+
componentWillRender() {
|
|
121
|
+
this.slottedImage = this.host.querySelector('img');
|
|
122
|
+
this.getAvatar();
|
|
123
|
+
}
|
|
124
|
+
componentDidLoad() {
|
|
125
|
+
this.validateFirstname();
|
|
126
|
+
}
|
|
127
|
+
render() {
|
|
128
|
+
const initials = this.getNames().reduce((acc, n, i) => {
|
|
129
|
+
if (i > 0)
|
|
130
|
+
acc.push(h("span", null, " "));
|
|
131
|
+
acc.push(n.charAt(0));
|
|
132
|
+
acc.push(h("span", null, n.slice(1)));
|
|
133
|
+
// eslint-disable-next-line @stencil-community/render-returns-host
|
|
134
|
+
return acc;
|
|
135
|
+
}, []);
|
|
136
|
+
return (h(Host, { "data-version": version }, h("slot", { onSlotchange: this.onSlotDefaultChange.bind(this) }, this.avatarType === 'image' && h("img", { src: this.imageUrl, alt: this.imageAlt }), this.avatarType === 'initials' && h("div", { class: "initials" }, initials))));
|
|
137
|
+
}
|
|
138
|
+
static get watchers() { return {
|
|
139
|
+
"firstname": ["validateFirstname"]
|
|
140
|
+
}; }
|
|
141
|
+
static get style() { return PostAvatarStyle0; }
|
|
142
|
+
}, [1, "post-avatar", {
|
|
143
|
+
"firstname": [1],
|
|
144
|
+
"lastname": [1],
|
|
145
|
+
"userid": [1],
|
|
146
|
+
"email": [1],
|
|
147
|
+
"slottedImage": [32],
|
|
148
|
+
"avatarType": [32],
|
|
149
|
+
"imageUrl": [32],
|
|
150
|
+
"imageAlt": [32],
|
|
151
|
+
"initials": [32]
|
|
152
|
+
}, undefined, {
|
|
153
|
+
"firstname": ["validateFirstname"]
|
|
154
|
+
}]);
|
|
155
|
+
function defineCustomElement() {
|
|
156
|
+
if (typeof customElements === "undefined") {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
const components = ["post-avatar"];
|
|
160
|
+
components.forEach(tagName => { switch (tagName) {
|
|
161
|
+
case "post-avatar":
|
|
162
|
+
if (!customElements.get(tagName)) {
|
|
163
|
+
customElements.define(tagName, PostAvatar);
|
|
164
|
+
}
|
|
165
|
+
break;
|
|
166
|
+
} });
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export { PostAvatar as P, defineCustomElement as d };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface PostBackToTop extends Components.PostBackToTop, HTMLElement {}
|
|
4
|
+
export const PostBackToTop: {
|
|
5
|
+
prototype: PostBackToTop;
|
|
6
|
+
new (): PostBackToTop;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { s as slideUp, a as slideDown } from './slide.js';
|
|
3
|
+
import { v as version } from './package.js';
|
|
4
|
+
import { c as checkType } from './check-type.js';
|
|
5
|
+
import { c as checkNonEmpty } from './check-non-empty.js';
|
|
6
|
+
import { d as defineCustomElement$1 } from './post-icon2.js';
|
|
7
|
+
|
|
8
|
+
const postBackToTopCss = ":host{--post-floating-button-translate-y:calc(-1 * var(--post-core-dimension-112));position:fixed;top:var(--post-device-position-1);right:var(--post-device-position-1)}:host .back-to-top{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;box-shadow:var(--post-device-elevation-300);cursor:pointer;border-radius:var(--post-device-border-radius-round);width:var(--post-device-sizing-interactive-button-height-2);height:var(--post-device-sizing-interactive-button-height-2);border:var(--post-device-border-width-default) solid var(--post-scheme-color-interactive-button-secondary-enabled-stroke);color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);background-color:var(--post-scheme-color-interactive-button-secondary-enabled-bg);display:flex;align-items:center;justify-content:center}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .back-to-top{background-color:ButtonFace !important}:host .back-to-top:hover{background-color:Highlight !important}}:host .back-to-top{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}:host .back-to-top:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .back-to-top:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){:host .back-to-top:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .back-to-top:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}:host .back-to-top:hover{border-color:var(--post-scheme-color-interactive-button-secondary-hover-stroke);color:var(--post-scheme-color-interactive-button-secondary-hover-fg);background-color:var(--post-scheme-color-interactive-button-secondary-hover-bg)}:host .back-to-top post-icon{height:var(--post-device-sizing-interactive-button-icon-3);width:var(--post-device-sizing-interactive-button-icon-3)}:host .visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}";
|
|
9
|
+
const PostBackToTopStyle0 = postBackToTopCss;
|
|
10
|
+
|
|
11
|
+
const PostBackToTop = /*@__PURE__*/ proxyCustomElement(class PostBackToTop extends HTMLElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
this.__registerHost();
|
|
15
|
+
this.__attachShadow();
|
|
16
|
+
this.label = undefined;
|
|
17
|
+
this.belowFold = false;
|
|
18
|
+
}
|
|
19
|
+
get host() { return this; }
|
|
20
|
+
translateY;
|
|
21
|
+
isBelowFold() {
|
|
22
|
+
return window.scrollY > window.innerHeight;
|
|
23
|
+
}
|
|
24
|
+
handleScroll = () => {
|
|
25
|
+
this.belowFold = this.isBelowFold();
|
|
26
|
+
};
|
|
27
|
+
// Watch for changes in belowFold
|
|
28
|
+
watchBelowFold(newValue) {
|
|
29
|
+
if (newValue) {
|
|
30
|
+
slideUp(this.host, this.translateY);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
slideDown(this.host, this.translateY);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
scrollToTop() {
|
|
37
|
+
window.scrollTo({
|
|
38
|
+
top: 0,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
// Validate the label
|
|
42
|
+
validateLabel() {
|
|
43
|
+
checkType(this, 'label', 'string');
|
|
44
|
+
checkNonEmpty(this, 'label');
|
|
45
|
+
}
|
|
46
|
+
// Set the initial state
|
|
47
|
+
componentWillLoad() {
|
|
48
|
+
this.belowFold = this.isBelowFold();
|
|
49
|
+
}
|
|
50
|
+
componentDidLoad() {
|
|
51
|
+
window.addEventListener('scroll', this.handleScroll, false);
|
|
52
|
+
this.translateY = window
|
|
53
|
+
.getComputedStyle(this.host)
|
|
54
|
+
.getPropertyValue('--post-floating-button-translate-y');
|
|
55
|
+
if (!this.belowFold) {
|
|
56
|
+
this.host.style.transform = `translateY(${this.translateY})`;
|
|
57
|
+
}
|
|
58
|
+
// Initial load
|
|
59
|
+
if (this.belowFold) {
|
|
60
|
+
slideUp(this.host, this.translateY);
|
|
61
|
+
}
|
|
62
|
+
this.validateLabel();
|
|
63
|
+
}
|
|
64
|
+
disconnectedCallback() {
|
|
65
|
+
window.removeEventListener('scroll', this.handleScroll);
|
|
66
|
+
}
|
|
67
|
+
render() {
|
|
68
|
+
return (h(Host, { key: '4d8c4e05ebcdd088c924ac0329b2238eb1d3c6ca', "data-version": version }, h("button", { key: 'fc37aff8558d7eb4b27a870f11133fc6984f4e11', class: "back-to-top", "aria-hidden": this.belowFold ? 'false' : 'true', tabindex: this.belowFold ? '0' : '-1', onClick: this.scrollToTop }, h("post-icon", { key: '4b978c44982ec0b02798ce75766b2acdd8497412', "aria-hidden": "true", name: "3026" }), h("span", { key: '4a899be348a6c8721696c634970773cd77f685d9', class: "visually-hidden" }, this.label))));
|
|
69
|
+
}
|
|
70
|
+
static get watchers() { return {
|
|
71
|
+
"belowFold": ["watchBelowFold"],
|
|
72
|
+
"label": ["validateLabel"]
|
|
73
|
+
}; }
|
|
74
|
+
static get style() { return PostBackToTopStyle0; }
|
|
75
|
+
}, [1, "post-back-to-top", {
|
|
76
|
+
"label": [1],
|
|
77
|
+
"belowFold": [32]
|
|
78
|
+
}, undefined, {
|
|
79
|
+
"belowFold": ["watchBelowFold"],
|
|
80
|
+
"label": ["validateLabel"]
|
|
81
|
+
}]);
|
|
82
|
+
function defineCustomElement() {
|
|
83
|
+
if (typeof customElements === "undefined") {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const components = ["post-back-to-top", "post-icon"];
|
|
87
|
+
components.forEach(tagName => { switch (tagName) {
|
|
88
|
+
case "post-back-to-top":
|
|
89
|
+
if (!customElements.get(tagName)) {
|
|
90
|
+
customElements.define(tagName, PostBackToTop);
|
|
91
|
+
}
|
|
92
|
+
break;
|
|
93
|
+
case "post-icon":
|
|
94
|
+
if (!customElements.get(tagName)) {
|
|
95
|
+
defineCustomElement$1();
|
|
96
|
+
}
|
|
97
|
+
break;
|
|
98
|
+
} });
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export { PostBackToTop as P, defineCustomElement as d };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface PostBanner extends Components.PostBanner, HTMLElement {}
|
|
4
|
+
export const PostBanner: {
|
|
5
|
+
prototype: PostBanner;
|
|
6
|
+
new (): PostBanner;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { v as version } from './package.js';
|
|
3
|
+
import { f as fadeOut } from './fade.js';
|
|
4
|
+
import { a as checkEmptyOrPattern, c as checkEmptyOrOneOf } from './index2.js';
|
|
5
|
+
import { n as nanoid } from './index.browser.js';
|
|
6
|
+
import { d as defineCustomElement$1 } from './post-icon2.js';
|
|
7
|
+
import { c as checkType } from './check-type.js';
|
|
8
|
+
import { c as checkNonEmpty } from './check-non-empty.js';
|
|
9
|
+
|
|
10
|
+
const BANNER_TYPES = ['neutral', 'success', 'warning', 'danger', 'info'];
|
|
11
|
+
|
|
12
|
+
const postBannerCss = ".banner,.alert{min-height:calc(var(--post-device-sizing-notification-icon-2) + (2 * var(--post-device-spacing-padding-10)));box-sizing:border-box;box-shadow:var(--post-device-elevation-100);border-radius:var(--post-device-border-radius-2);padding:var(--post-device-spacing-padding-10) var(--post-device-spacing-padding-10);padding-inline-start:calc(var(--post-device-spacing-padding-10) + var(--post-device-sizing-notification-icon-2) + var(--post-device-spacing-gap-inline-6));font-weight:var(--post-core-font-weight-400);border-style:var(--post-core-border-style-solid);border-width:var(--post-device-border-width-default);position:relative;color:var(--post-scheme-color-surface-default-fg);background-color:var(--post-scheme-color-signal-neutral);border-color:var(--post-scheme-color-signal-neutral-dark);color-scheme:var(--post-core-bg-scheme-light)}.banner:not(.no-icon)::before,.alert:not(.no-icon)::before{mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%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 0a1.335 1.335 0 1 1 1.334 1.334 1.336 1.336 0 0 1-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/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;color:var(--post-scheme-color-signal-neutral-dark)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.banner:not(.no-icon)::before,.alert:not(.no-icon)::before{color:CanvasText}}.banner:has(>post-icon)::before,.alert:has(>post-icon)::before{content:none}.banner>post-icon,.alert>post-icon{background-color:var(--post-scheme-color-signal-neutral);color:var(--post-scheme-color-signal-neutral-dark)}.banner::before,.alert::before{content:\"\";display:block}.banner::before,.banner>post-icon,.alert::before,.alert>post-icon{position:absolute;height:var(--post-device-sizing-notification-icon-2);width:var(--post-device-sizing-notification-icon-2);left:var(--post-device-spacing-padding-10);top:var(--post-device-spacing-padding-10)}.banner.no-icon,.alert.no-icon{min-height:calc(2*var(--post-device-spacing-padding-10) + var(--post-core-dimension-24));padding-inline-start:var(--post-device-spacing-padding-10)}.banner.no-icon::before,.alert.no-icon::before{content:unset}.banner.no-icon>post-icon,.alert.no-icon>post-icon{display:none}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.banner,.alert{filter:none !important;border:2px solid CanvasText}}.banner:not(.banner-action):not(.alert-action),.alert:not(.banner-action):not(.alert-action){display:flex;flex-direction:column;justify-content:center;gap:var(--post-core-dimension-4)}.banner:not(.banner-action):not(.alert-action) a,.alert:not(.banner-action):not(.alert-action) a{font-weight:var(--post-core-font-weight-400)}.banner:not(.banner-action):not(.alert-action) hr,.alert:not(.banner-action):not(.alert-action) hr{margin-block:var(--post-core-dimension-8) var(--post-core-dimension-12) !important}.banner:not(.banner-action):not(.alert-action)>*,.alert:not(.banner-action):not(.alert-action)>*{margin:0}.banner-container{border:unset;background-color:rgba(0,0,0,0)}.banner-dismissible,.alert-dismissible{pointer-events:auto;position:relative}.banner-dismissible:not(.banner-action):not(.alert-action),.alert-dismissible:not(.banner-action):not(.alert-action){padding-inline-end:calc(var(--post-device-spacing-padding-10) + var(--post-device-spacing-gap-inline-6) + var(--post-core-dimension-24))}.banner-dismissible>.btn-close,.alert-dismissible>.btn-close{position:absolute;inset-block-start:1rem;inset-inline-end:var(--post-device-spacing-padding-10)}.banner-buttons,.alert-buttons{display:flex;align-items:center;justify-content:flex-start;flex-direction:row-reverse;margin-block-start:var(--post-device-spacing-padding-block-10);gap:var(--post-device-spacing-gap-1)}@media (max-width: 779.98px){.banner-buttons,.alert-buttons{flex-direction:column}}.banner-action>.banner-content,.banner-action>.alert-content,.alert-action>.banner-content,.alert-action>.alert-content{display:flex;flex-direction:column;justify-content:center;gap:var(--post-core-dimension-4)}.banner-action>.banner-content a,.banner-action>.alert-content a,.alert-action>.banner-content a,.alert-action>.alert-content a{font-weight:var(--post-core-font-weight-400)}.banner-action>.banner-content hr,.banner-action>.alert-content hr,.alert-action>.banner-content hr,.alert-action>.alert-content hr{margin-block:var(--post-core-dimension-8) var(--post-core-dimension-12) !important}.banner-action>.banner-content>*,.banner-action>.alert-content>*,.alert-action>.banner-content>*,.alert-action>.alert-content>*{margin:0}@media (max-width: 779.98px){.banner-action,.alert-action{flex-direction:column;align-items:stretch}.banner-action>.banner-content,.banner-action>.alert-content,.alert-action>.banner-content,.alert-action>.alert-content{padding-inline-start:var(--post-device-spacing-gap-inline-6)var(--post-device-sizing-notification-icon-2);padding-inline-end:var(--post-device-spacing-gap-inline-6)var(--post-core-dimension-24)}.banner-action.no-icon>.banner-content,.banner-action.no-icon>.alert-content,.alert-action.no-icon>.banner-content,.alert-action.no-icon>.alert-content{padding-inline-start:0}.banner-action>.banner-buttons,.banner-action>.alert-buttons,.alert-action>.banner-buttons,.alert-action>.alert-buttons{display:flex}.banner-action>.banner-buttons>.btn,.banner-action>.banner-buttons>::slotted(.btn),.banner-action>.alert-buttons>.btn,.banner-action>.alert-buttons>::slotted(.btn),.alert-action>.banner-buttons>.btn,.alert-action>.banner-buttons>::slotted(.btn),.alert-action>.alert-buttons>.btn,.alert-action>.alert-buttons>::slotted(.btn){flex:1 0 0;width:100%}.banner-action>.banner-buttons>.btn:first-child,.banner-action>.banner-buttons>::slotted(.btn:first-child),.banner-action>.alert-buttons>.btn:first-child,.banner-action>.alert-buttons>::slotted(.btn:first-child),.alert-action>.banner-buttons>.btn:first-child,.alert-action>.banner-buttons>::slotted(.btn:first-child),.alert-action>.alert-buttons>.btn:first-child,.alert-action>.alert-buttons>::slotted(.btn:first-child){margin-inline-start:0}}.banner-neutral,.alert-neutral{background-color:var(--post-scheme-color-signal-neutral);border-color:var(--post-scheme-color-signal-neutral-dark);color-scheme:var(--post-core-bg-scheme-light)}.banner-neutral:not(.no-icon)::before,.alert-neutral:not(.no-icon)::before{mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%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 0a1.335 1.335 0 1 1 1.334 1.334 1.336 1.336 0 0 1-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/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;color:var(--post-scheme-color-signal-neutral-dark)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.banner-neutral:not(.no-icon)::before,.alert-neutral:not(.no-icon)::before{color:CanvasText}}.banner-neutral:has(>post-icon)::before,.alert-neutral:has(>post-icon)::before{content:none}.banner-neutral>post-icon,.alert-neutral>post-icon{background-color:var(--post-scheme-color-signal-neutral);color:var(--post-scheme-color-signal-neutral-dark)}.banner-success,.alert-success{background-color:var(--post-scheme-color-interactive-notification-success-bg);border-color:var(--post-scheme-color-interactive-notification-success-stroke);color-scheme:var(--post-core-bg-scheme-light)}.banner-success:not(.no-icon)::before,.alert-success:not(.no-icon)::before{mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%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/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;color:var(--post-scheme-color-interactive-notification-success-icon)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.banner-success:not(.no-icon)::before,.alert-success:not(.no-icon)::before{color:CanvasText}}.banner-success:has(>post-icon)::before,.alert-success:has(>post-icon)::before{content:none}.banner-success>post-icon,.alert-success>post-icon{background-color:var(--post-scheme-color-interactive-notification-success-bg);color:var(--post-scheme-color-interactive-notification-success-icon)}.banner-warning,.alert-warning{background-color:var(--post-scheme-color-interactive-notification-warning-bg);border-color:var(--post-scheme-color-interactive-notification-warning-stroke);color-scheme:var(--post-core-bg-scheme-light)}.banner-warning:not(.no-icon)::before,.alert-warning:not(.no-icon)::before{mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.67 4h2.67v18.67h-2.67zm0 21.33h2.67V28h-2.67z'/%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;color:var(--post-scheme-color-interactive-notification-warning-icon)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.banner-warning:not(.no-icon)::before,.alert-warning:not(.no-icon)::before{color:CanvasText}}.banner-warning:has(>post-icon)::before,.alert-warning:has(>post-icon)::before{content:none}.banner-warning>post-icon,.alert-warning>post-icon{background-color:var(--post-scheme-color-interactive-notification-warning-bg);color:var(--post-scheme-color-interactive-notification-warning-icon)}.banner-error,.alert-error{background-color:var(--post-scheme-color-interactive-notification-error-bg);border-color:var(--post-scheme-color-interactive-notification-error-stroke);color-scheme:var(--post-core-bg-scheme-light)}.banner-error:not(.no-icon)::before,.alert-error:not(.no-icon)::before{mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.67 4h2.67v18.67h-2.67zm0 21.33h2.67V28h-2.67z'/%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;color:var(--post-scheme-color-interactive-notification-error-icon)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.banner-error:not(.no-icon)::before,.alert-error:not(.no-icon)::before{color:CanvasText}}.banner-error:has(>post-icon)::before,.alert-error:has(>post-icon)::before{content:none}.banner-error>post-icon,.alert-error>post-icon{background-color:var(--post-scheme-color-interactive-notification-error-bg);color:var(--post-scheme-color-interactive-notification-error-icon)}.banner-info,.alert-info{background-color:var(--post-scheme-color-interactive-notification-info-bg);border-color:var(--post-scheme-color-interactive-notification-info-stroke);color-scheme:var(--post-core-bg-scheme-light)}.banner-info:not(.no-icon)::before,.alert-info:not(.no-icon)::before{mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M17.33 25.33v-16h-4.67V12h2v13.33h-2V28h6.67v-2.67zM14.67 4h2.67v2.67h-2.67z'/%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;color:var(--post-scheme-color-interactive-notification-info-icon)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.banner-info:not(.no-icon)::before,.alert-info:not(.no-icon)::before{color:CanvasText}}.banner-info:has(>post-icon)::before,.alert-info:has(>post-icon)::before{content:none}.banner-info>post-icon,.alert-info>post-icon{background-color:var(--post-scheme-color-interactive-notification-info-bg);color:var(--post-scheme-color-interactive-notification-info-icon)}.banner-danger,.alert-danger{background-color:var(--post-scheme-color-interactive-notification-error-bg);border-color:var(--post-scheme-color-interactive-notification-error-stroke);color-scheme:var(--post-core-bg-scheme-light)}.banner-danger:not(.no-icon)::before,.alert-danger:not(.no-icon)::before{mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.67 4h2.67v18.67h-2.67zm0 21.33h2.67V28h-2.67z'/%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;color:var(--post-scheme-color-interactive-notification-error-icon)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.banner-danger:not(.no-icon)::before,.alert-danger:not(.no-icon)::before{color:CanvasText}}.banner-danger:has(>post-icon)::before,.alert-danger:has(>post-icon)::before{content:none}.banner-danger>post-icon,.alert-danger>post-icon{background-color:var(--post-scheme-color-interactive-notification-error-bg);color:var(--post-scheme-color-interactive-notification-error-icon)}.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}/*!\n * Copyright 2021 by Swiss Post, Information Technology\n */: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}";
|
|
13
|
+
const PostBannerStyle0 = postBannerCss;
|
|
14
|
+
|
|
15
|
+
const PostBanner = /*@__PURE__*/ proxyCustomElement(class PostBanner extends HTMLElement {
|
|
16
|
+
constructor() {
|
|
17
|
+
super();
|
|
18
|
+
this.__registerHost();
|
|
19
|
+
this.__attachShadow();
|
|
20
|
+
this.postDismissed = createEvent(this, "postDismissed", 7);
|
|
21
|
+
this.bannerId = `p${nanoid(6)}`;
|
|
22
|
+
this.classes = undefined;
|
|
23
|
+
this.hasActions = undefined;
|
|
24
|
+
this.hasHeading = undefined;
|
|
25
|
+
this.onDismissButtonClick = () => this.dismiss();
|
|
26
|
+
this.dismissible = false;
|
|
27
|
+
this.dismissLabel = undefined;
|
|
28
|
+
this.icon = undefined;
|
|
29
|
+
this.type = 'neutral';
|
|
30
|
+
}
|
|
31
|
+
get host() { return this; }
|
|
32
|
+
validateDismissible() {
|
|
33
|
+
checkType(this, 'dismissible', 'boolean');
|
|
34
|
+
setTimeout(() => this.validateDismissLabel());
|
|
35
|
+
}
|
|
36
|
+
validateDismissLabel() {
|
|
37
|
+
if (this.dismissible) {
|
|
38
|
+
checkNonEmpty(this, 'dismissLabel', 'Dismissible post-banner\'s require a "dismiss-label" prop.');
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
validateIcon() {
|
|
42
|
+
checkEmptyOrPattern(this, 'icon', /\d{4}|none/, 'The post-banner "icon" prop should be a 4-digit string.');
|
|
43
|
+
}
|
|
44
|
+
validateType() {
|
|
45
|
+
checkEmptyOrOneOf(this, 'type', BANNER_TYPES);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* An event emitted when the banner element is dismissed, after the transition.
|
|
49
|
+
* It has no payload and only relevant for dismissible banners.
|
|
50
|
+
*/
|
|
51
|
+
postDismissed;
|
|
52
|
+
componentDidLoad() {
|
|
53
|
+
this.validateDismissible();
|
|
54
|
+
this.validateIcon();
|
|
55
|
+
this.validateType();
|
|
56
|
+
}
|
|
57
|
+
componentWillRender() {
|
|
58
|
+
this.hasHeading = this.host.querySelectorAll('[slot=heading]').length > 0;
|
|
59
|
+
this.hasActions = this.host.querySelectorAll('[slot=actions]').length > 0;
|
|
60
|
+
this.classes = `banner ${this.type ? 'banner-' + this.type : ''}`;
|
|
61
|
+
if (this.dismissible)
|
|
62
|
+
this.classes += ' banner-dismissible';
|
|
63
|
+
if (this.hasActions)
|
|
64
|
+
this.classes += ' banner-action';
|
|
65
|
+
if (this.icon === 'none')
|
|
66
|
+
this.classes += ' no-icon';
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Triggers banner dismissal programmatically (same as clicking on the close button (×)).
|
|
70
|
+
*/
|
|
71
|
+
async dismiss() {
|
|
72
|
+
const dismissal = fadeOut(this.host);
|
|
73
|
+
await dismissal.finished;
|
|
74
|
+
this.host.remove();
|
|
75
|
+
this.postDismissed.emit();
|
|
76
|
+
}
|
|
77
|
+
render() {
|
|
78
|
+
const defaultBannerContent = [
|
|
79
|
+
this.hasHeading && (h("div", { key: `${this.bannerId}-heading`, class: "banner-heading" }, h("slot", { key: 'd4b29e3591f026b880c4b859a47bcbc3e3b11ced', name: "heading" }))),
|
|
80
|
+
h("slot", { key: `${this.bannerId}-message` }),
|
|
81
|
+
];
|
|
82
|
+
const actionBannerContent = [
|
|
83
|
+
h("div", { key: `${this.bannerId}-content`, class: "banner-content" }, defaultBannerContent),
|
|
84
|
+
h("div", { key: `${this.bannerId}-buttons`, class: "banner-buttons" }, h("slot", { key: '2f1461a2374d736cb3b72641aa150bc611082f56', name: "actions" })),
|
|
85
|
+
];
|
|
86
|
+
return (h(Host, { key: 'ec72012fa82e03b0dca2368025449e1942731c21', "data-version": version }, h("div", { key: 'acae7ac34af951ca9176769ab4bcdc388d769931', role: "alert", class: this.classes, part: this.classes }, this.dismissible && (h("button", { key: '23cc4d77c2825bc76cedcdc321b80b9b0f333e71', class: "btn-close", onClick: this.onDismissButtonClick }, h("span", { key: '2f0753d49fc86f19df743f33a086c14b2a0686f7', class: "visually-hidden" }, this.dismissLabel))), this.icon && this.icon !== 'none' && (h("post-icon", { key: `${this.bannerId}-icon`, name: this.icon })), this.hasActions ? actionBannerContent : defaultBannerContent)));
|
|
87
|
+
}
|
|
88
|
+
static get watchers() { return {
|
|
89
|
+
"dismissible": ["validateDismissible"],
|
|
90
|
+
"dismissLabel": ["validateDismissLabel"],
|
|
91
|
+
"icon": ["validateIcon"],
|
|
92
|
+
"type": ["validateType"]
|
|
93
|
+
}; }
|
|
94
|
+
static get style() { return PostBannerStyle0; }
|
|
95
|
+
}, [1, "post-banner", {
|
|
96
|
+
"dismissible": [4],
|
|
97
|
+
"dismissLabel": [1, "dismiss-label"],
|
|
98
|
+
"icon": [1],
|
|
99
|
+
"type": [1],
|
|
100
|
+
"bannerId": [32],
|
|
101
|
+
"classes": [32],
|
|
102
|
+
"hasActions": [32],
|
|
103
|
+
"hasHeading": [32],
|
|
104
|
+
"onDismissButtonClick": [32],
|
|
105
|
+
"dismiss": [64]
|
|
106
|
+
}, undefined, {
|
|
107
|
+
"dismissible": ["validateDismissible"],
|
|
108
|
+
"dismissLabel": ["validateDismissLabel"],
|
|
109
|
+
"icon": ["validateIcon"],
|
|
110
|
+
"type": ["validateType"]
|
|
111
|
+
}]);
|
|
112
|
+
function defineCustomElement() {
|
|
113
|
+
if (typeof customElements === "undefined") {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const components = ["post-banner", "post-icon"];
|
|
117
|
+
components.forEach(tagName => { switch (tagName) {
|
|
118
|
+
case "post-banner":
|
|
119
|
+
if (!customElements.get(tagName)) {
|
|
120
|
+
customElements.define(tagName, PostBanner);
|
|
121
|
+
}
|
|
122
|
+
break;
|
|
123
|
+
case "post-icon":
|
|
124
|
+
if (!customElements.get(tagName)) {
|
|
125
|
+
defineCustomElement$1();
|
|
126
|
+
}
|
|
127
|
+
break;
|
|
128
|
+
} });
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export { PostBanner as P, defineCustomElement as d };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface PostBreadcrumbItem extends Components.PostBreadcrumbItem, HTMLElement {}
|
|
4
|
+
export const PostBreadcrumbItem: {
|
|
5
|
+
prototype: PostBreadcrumbItem;
|
|
6
|
+
new (): PostBreadcrumbItem;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { v as version } from './package.js';
|
|
3
|
+
import { d as checkEmptyOrUrl } from './index2.js';
|
|
4
|
+
import { d as defineCustomElement$1 } from './post-icon2.js';
|
|
5
|
+
|
|
6
|
+
const postBreadcrumbItemCss = ":host{display:flex;align-items:center;justify-content:start;gap:var(--post-device-spacing-gap-inline-5)}:host post-icon{box-sizing:border-box;height:var(--post-core-dimension-24);width:var(--post-core-dimension-24);padding-block:var(--post-core-dimension-4);padding-inline:var(--post-core-dimension-4)}.breadcrumb-item{white-space:nowrap;line-height:150%;padding-block:var(--post-device-spacing-padding-block-7);color:var(--post-scheme-color-interactive-primary-enabled-fg1);text-decoration:var(--post-core-text-decoration-none)}.breadcrumb-item{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}.breadcrumb-item:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.breadcrumb-item:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.breadcrumb-item:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.breadcrumb-item:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.breadcrumb-item:hover{color:var(--post-scheme-color-interactive-primary-hover-fg1);text-decoration:var(--post-core-text-decoration-underline)}.breadcrumb-item:focus-visible{border-radius:var(--post-device-border-radius-focus)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.breadcrumb-item,.breadcrumb-item:focus,.breadcrumb-item:hover{color:LinkText !important}.breadcrumb-item:visited{color:VisitedText !important}}";
|
|
7
|
+
const PostBreadcrumbItemStyle0 = postBreadcrumbItemCss;
|
|
8
|
+
|
|
9
|
+
const PostBreadcrumbItem = /*@__PURE__*/ proxyCustomElement(class PostBreadcrumbItem extends HTMLElement {
|
|
10
|
+
constructor() {
|
|
11
|
+
super();
|
|
12
|
+
this.__registerHost();
|
|
13
|
+
this.__attachShadow();
|
|
14
|
+
this.url = undefined;
|
|
15
|
+
this.fullUrl = undefined;
|
|
16
|
+
}
|
|
17
|
+
get host() { return this; }
|
|
18
|
+
validUrl;
|
|
19
|
+
validateUrl() {
|
|
20
|
+
try {
|
|
21
|
+
this.validUrl = this.constructUrl(this.url);
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
this.validUrl = undefined;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
// Helper to construct a valid URL string or return undefined
|
|
28
|
+
constructUrl(value) {
|
|
29
|
+
const hasBaseURL = /^https?:\/\//.test(String(this.url));
|
|
30
|
+
if (typeof value === 'string') {
|
|
31
|
+
this.fullUrl = hasBaseURL ? value : `${window.location.origin}${value}`;
|
|
32
|
+
checkEmptyOrUrl(this, 'fullUrl');
|
|
33
|
+
return this.fullUrl;
|
|
34
|
+
}
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
connectedCallback() {
|
|
38
|
+
this.validateUrl();
|
|
39
|
+
}
|
|
40
|
+
handleKeyDown(event) {
|
|
41
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
42
|
+
const linkElement = this.host.shadowRoot?.querySelector('a');
|
|
43
|
+
if (linkElement) {
|
|
44
|
+
event.preventDefault();
|
|
45
|
+
linkElement.click();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
render() {
|
|
50
|
+
const BreadcrumbTag = this.validUrl ? 'a' : 'span';
|
|
51
|
+
return (h(Host, { key: 'd0444118aa031f4cf6f5161d7aa21900e9768348', "data-version": version }, h("post-icon", { key: '719a76e6e86bbb02526c4610acefb3ad253454af', name: "2111", class: "breadcrumb-item-icon" }), h(BreadcrumbTag, { key: '3f5ffb9c77567dba35efa7938029cd519de55474', class: "breadcrumb-item", ...(this.validUrl ? { href: this.validUrl } : {}), onKeyDown: event => this.handleKeyDown(event) }, h("slot", { key: 'bb1be29905c1533f2238a47a346fb35d6a7645fd' }))));
|
|
52
|
+
}
|
|
53
|
+
static get watchers() { return {
|
|
54
|
+
"url": ["validateUrl"]
|
|
55
|
+
}; }
|
|
56
|
+
static get style() { return PostBreadcrumbItemStyle0; }
|
|
57
|
+
}, [1, "post-breadcrumb-item", {
|
|
58
|
+
"url": [1],
|
|
59
|
+
"fullUrl": [32]
|
|
60
|
+
}, undefined, {
|
|
61
|
+
"url": ["validateUrl"]
|
|
62
|
+
}]);
|
|
63
|
+
function defineCustomElement() {
|
|
64
|
+
if (typeof customElements === "undefined") {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const components = ["post-breadcrumb-item", "post-icon"];
|
|
68
|
+
components.forEach(tagName => { switch (tagName) {
|
|
69
|
+
case "post-breadcrumb-item":
|
|
70
|
+
if (!customElements.get(tagName)) {
|
|
71
|
+
customElements.define(tagName, PostBreadcrumbItem);
|
|
72
|
+
}
|
|
73
|
+
break;
|
|
74
|
+
case "post-icon":
|
|
75
|
+
if (!customElements.get(tagName)) {
|
|
76
|
+
defineCustomElement$1();
|
|
77
|
+
}
|
|
78
|
+
break;
|
|
79
|
+
} });
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export { PostBreadcrumbItem as P, defineCustomElement as d };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface PostBreadcrumb extends Components.PostBreadcrumb, HTMLElement {}
|
|
4
|
+
export const PostBreadcrumb: {
|
|
5
|
+
prototype: PostBreadcrumb;
|
|
6
|
+
new (): PostBreadcrumb;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|