@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,75 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { version } from "../../../../package";
|
|
3
|
+
import { checkType } from "../../utils/index";
|
|
4
|
+
/**
|
|
5
|
+
* @slot default - Slot for the content of the button.
|
|
6
|
+
*/
|
|
7
|
+
export class PostTogglebutton {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.toggled = false;
|
|
10
|
+
}
|
|
11
|
+
host;
|
|
12
|
+
validateToggled() {
|
|
13
|
+
checkType(this, 'toggled', 'boolean');
|
|
14
|
+
}
|
|
15
|
+
componentWillLoad() {
|
|
16
|
+
this.validateToggled();
|
|
17
|
+
// add event listener to not override listener that might be set on the host
|
|
18
|
+
this.host.addEventListener('click', () => this.handleClick());
|
|
19
|
+
this.host.addEventListener('keydown', (e) => this.handleKeydown(e));
|
|
20
|
+
}
|
|
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
|
+
render() {
|
|
32
|
+
return (h(Host, { key: '3a1429a9b67b8cfafae184fe0d060ee3a04974e0', "data-version": version, role: "button", tabindex: "0", "aria-pressed": this.toggled.toString() }, h("slot", { key: '9ab1537574423740fc335fde732c699698acac25' })));
|
|
33
|
+
}
|
|
34
|
+
static get is() { return "post-togglebutton"; }
|
|
35
|
+
static get encapsulation() { return "shadow"; }
|
|
36
|
+
static get originalStyleUrls() {
|
|
37
|
+
return {
|
|
38
|
+
"$": ["post-togglebutton.scss"]
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
static get styleUrls() {
|
|
42
|
+
return {
|
|
43
|
+
"$": ["post-togglebutton.css"]
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
static get properties() {
|
|
47
|
+
return {
|
|
48
|
+
"toggled": {
|
|
49
|
+
"type": "boolean",
|
|
50
|
+
"mutable": true,
|
|
51
|
+
"complexType": {
|
|
52
|
+
"original": "boolean",
|
|
53
|
+
"resolved": "boolean",
|
|
54
|
+
"references": {}
|
|
55
|
+
},
|
|
56
|
+
"required": false,
|
|
57
|
+
"optional": false,
|
|
58
|
+
"docs": {
|
|
59
|
+
"tags": [],
|
|
60
|
+
"text": "If `true`, the button is in the \"on\" state, otherwise it is in the \"off\" state."
|
|
61
|
+
},
|
|
62
|
+
"attribute": "toggled",
|
|
63
|
+
"reflect": false,
|
|
64
|
+
"defaultValue": "false"
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
static get elementRef() { return "host"; }
|
|
69
|
+
static get watchers() {
|
|
70
|
+
return [{
|
|
71
|
+
"propName": "toggled",
|
|
72
|
+
"methodName": "validateToggled"
|
|
73
|
+
}];
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
post-popovercontainer[arrow]::after{position:absolute;content:"";inset:-13px;z-index:-1}post-popovercontainer>div{padding:var(--post-core-dimension-4) var(--post-core-dimension-8);max-width:calc(224px - var(--post-core-dimension-8));min-height:var(--post-core-dimension-16)}
|
|
@@ -3,7 +3,7 @@ import { version } from "../../../../package";
|
|
|
3
3
|
import isFocusable from "ally.js/is/focusable";
|
|
4
4
|
import "long-press-event";
|
|
5
5
|
import { getAttributeObserver } from "../../utils/attribute-observer";
|
|
6
|
-
import { checkEmptyOrType
|
|
6
|
+
import { checkEmptyOrType } from "../../utils/index";
|
|
7
7
|
const OPEN_DELAY = 650; // matches HTML title delay
|
|
8
8
|
/**
|
|
9
9
|
* @slot default - Slot for the content of the tooltip.
|
|
@@ -15,6 +15,8 @@ let tooltipInstances = 0;
|
|
|
15
15
|
let hideTooltipTimeout = null;
|
|
16
16
|
const tooltipTargetAttribute = 'data-tooltip-target';
|
|
17
17
|
const tooltipTargetAttributeSelector = `[${tooltipTargetAttribute}]`;
|
|
18
|
+
let globalCurrentTarget;
|
|
19
|
+
let tooltipTimeout = null;
|
|
18
20
|
/**
|
|
19
21
|
* Global event listener to show tooltips. This is globalized so that triggers that are rendered
|
|
20
22
|
* async will still work without the need to set listeners on the element itself
|
|
@@ -27,15 +29,18 @@ const tooltipTargetAttributeSelector = `[${tooltipTargetAttribute}]`;
|
|
|
27
29
|
*/
|
|
28
30
|
const globalInterestHandler = (e) => {
|
|
29
31
|
const targetElement = e.target.closest(tooltipTargetAttributeSelector);
|
|
30
|
-
|
|
32
|
+
globalCurrentTarget = targetElement;
|
|
33
|
+
if (!targetElement || !('getAttribute' in targetElement)) {
|
|
34
|
+
clearTimeout(tooltipTimeout);
|
|
31
35
|
return;
|
|
36
|
+
}
|
|
32
37
|
const tooltipTarget = targetElement.getAttribute(tooltipTargetAttribute);
|
|
33
38
|
if (!tooltipTarget || tooltipTarget === '')
|
|
34
39
|
return;
|
|
35
40
|
const tooltip = document.getElementById(tooltipTarget);
|
|
36
41
|
// Determine if the tooltip was triggered by a focus event
|
|
37
42
|
const triggeredByFocus = e.type === 'focusin';
|
|
38
|
-
void
|
|
43
|
+
void tooltip?.show(targetElement, triggeredByFocus);
|
|
39
44
|
if (hideTooltipTimeout) {
|
|
40
45
|
window.clearTimeout(hideTooltipTimeout);
|
|
41
46
|
hideTooltipTimeout = null;
|
|
@@ -76,7 +81,7 @@ const patchAccessibilityFeatures = (trigger) => {
|
|
|
76
81
|
const describedBy = trigger.getAttribute('aria-describedby');
|
|
77
82
|
const id = trigger.getAttribute(tooltipTargetAttribute);
|
|
78
83
|
// Add tooltip to aria-describedby
|
|
79
|
-
if (!
|
|
84
|
+
if (!describedBy?.includes(id)) {
|
|
80
85
|
const newDescribedBy = describedBy ? `${describedBy} ${id}` : id;
|
|
81
86
|
trigger.setAttribute('aria-describedby', newDescribedBy);
|
|
82
87
|
}
|
|
@@ -89,13 +94,15 @@ const patchAccessibilityFeatures = (trigger) => {
|
|
|
89
94
|
const triggerObserver = getAttributeObserver(tooltipTargetAttribute, patchAccessibilityFeatures);
|
|
90
95
|
export class PostTooltip {
|
|
91
96
|
constructor() {
|
|
92
|
-
this.wasOpenedByFocus = false;
|
|
93
97
|
this.placement = 'top';
|
|
94
98
|
this.arrow = true;
|
|
95
99
|
this.delayed = false;
|
|
96
100
|
}
|
|
101
|
+
popoverRef;
|
|
102
|
+
wasOpenedByFocus = false;
|
|
103
|
+
host;
|
|
97
104
|
validateDelayed() {
|
|
98
|
-
checkEmptyOrType(this
|
|
105
|
+
checkEmptyOrType(this, 'delayed', 'boolean');
|
|
99
106
|
}
|
|
100
107
|
connectedCallback() {
|
|
101
108
|
this.validateDelayed();
|
|
@@ -152,18 +159,29 @@ export class PostTooltip {
|
|
|
152
159
|
* @param triggeredByFocus A boolean indicating if the tooltip was triggered by a focus event.
|
|
153
160
|
*/
|
|
154
161
|
async show(target, triggeredByFocus = false) {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
+
const showTooltip = () => {
|
|
163
|
+
// If focus or pointer event is not on the button anymore, don't show the tooltip
|
|
164
|
+
if (globalCurrentTarget !== target)
|
|
165
|
+
return;
|
|
166
|
+
// Determine if the tooltip was opened by a focus event
|
|
167
|
+
this.wasOpenedByFocus = triggeredByFocus;
|
|
168
|
+
// Disable pointer events if triggered by focus, otherwise enable them
|
|
169
|
+
if (this.wasOpenedByFocus) {
|
|
170
|
+
this.host.style.pointerEvents = 'none';
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
this.host.style.pointerEvents = 'auto';
|
|
174
|
+
}
|
|
175
|
+
this.popoverRef.show(target);
|
|
176
|
+
};
|
|
177
|
+
if (this.delayed) {
|
|
178
|
+
tooltipTimeout = setTimeout(() => {
|
|
179
|
+
showTooltip();
|
|
180
|
+
}, OPEN_DELAY);
|
|
162
181
|
}
|
|
163
182
|
else {
|
|
164
|
-
|
|
183
|
+
showTooltip();
|
|
165
184
|
}
|
|
166
|
-
this.popoverRef.show(target);
|
|
167
185
|
}
|
|
168
186
|
/**
|
|
169
187
|
* Programmatically hide this tooltip
|
|
@@ -198,7 +216,7 @@ export class PostTooltip {
|
|
|
198
216
|
}
|
|
199
217
|
render() {
|
|
200
218
|
const popoverClass = `${this.arrow ? ' has-arrow' : ''}`;
|
|
201
|
-
return (h(Host, { key: '
|
|
219
|
+
return (h(Host, { key: '89b0e64fd5fde4c21d9c1eb624facff38b287e4a', "data-version": version, role: "tooltip", onPointerOver: this.handleInterest, onPointerOut: this.handleInterestLost, onFocusIn: this.handleInterest, onFocusOut: this.handleInterestLost }, h("post-popovercontainer", { key: '8006874c12a2eebe39682a09db677e8b315dd6bb', class: popoverClass, arrow: this.arrow, placement: this.placement, ref: (el) => (this.popoverRef = el) }, h("slot", { key: 'cf3bd12703885fe886f1703038437b59a4d79fd3' }))));
|
|
202
220
|
}
|
|
203
221
|
static get is() { return "post-tooltip"; }
|
|
204
222
|
static get encapsulation() { return "shadow"; }
|
|
@@ -224,7 +242,7 @@ export class PostTooltip {
|
|
|
224
242
|
"Placement": {
|
|
225
243
|
"location": "import",
|
|
226
244
|
"path": "@floating-ui/dom",
|
|
227
|
-
"id": "../../node_modules/.pnpm/@floating-ui+dom@1.6.
|
|
245
|
+
"id": "../../node_modules/.pnpm/@floating-ui+dom@1.6.13/node_modules/@floating-ui/dom/dist/floating-ui.dom.d.ts::Placement"
|
|
228
246
|
}
|
|
229
247
|
}
|
|
230
248
|
},
|
package/dist/collection/index.js
CHANGED
|
@@ -1,17 +1,36 @@
|
|
|
1
1
|
// Export every single component so it gets included in the dist output
|
|
2
2
|
export { PostAccordion } from './components/post-accordion/post-accordion';
|
|
3
3
|
export { PostAccordionItem } from './components/post-accordion-item/post-accordion-item';
|
|
4
|
-
export {
|
|
4
|
+
export { PostAvatar } from './components/post-avatar/post-avatar';
|
|
5
|
+
export { PostBackToTop } from './components/post-back-to-top/post-back-to-top';
|
|
6
|
+
export { PostBanner } from './components/post-banner/post-banner';
|
|
7
|
+
export { PostBreadcrumb } from './components/post-breadcrumb/post-breadcrumb';
|
|
8
|
+
export { PostBreadcrumbItem } from './components/post-breadcrumb-item/post-breadcrumb-item';
|
|
5
9
|
export { PostCardControl } from './components/post-card-control/post-card-control';
|
|
10
|
+
export { PostClosebutton } from './components/post-closebutton/post-closebutton';
|
|
6
11
|
export { PostCollapsible } from './components/post-collapsible/post-collapsible';
|
|
7
12
|
export { PostCollapsibleTrigger } from './components/post-collapsible-trigger/post-collapsible-trigger';
|
|
13
|
+
export { PostFooter } from './components/post-footer/post-footer';
|
|
14
|
+
export { PostHeader } from './components/post-header/post-header';
|
|
8
15
|
export { PostIcon } from './components/post-icon/post-icon';
|
|
16
|
+
export { PostLanguageOption } from './components/post-language-option/post-language-option';
|
|
17
|
+
export { PostLanguageSwitch } from './components/post-language-switch/post-language-switch';
|
|
18
|
+
export { PostLinkarea } from './components/post-linkarea/post-linkarea';
|
|
19
|
+
export { PostList } from './components/post-list/post-list';
|
|
20
|
+
export { PostListItem } from './components/post-list-item/post-list-item';
|
|
9
21
|
export { PostLogo } from './components/post-logo/post-logo';
|
|
22
|
+
export { PostMainnavigation } from './components/post-mainnavigation/post-mainnavigation';
|
|
23
|
+
export { PostMegadropdown } from './components/post-megadropdown/post-megadropdown';
|
|
24
|
+
export { PostMegadropdownTrigger } from './components/post-megadropdown-trigger/post-megadropdown-trigger';
|
|
25
|
+
export { PostMenu } from './components/post-menu/post-menu';
|
|
26
|
+
export { PostMenuItem } from './components/post-menu-item/post-menu-item';
|
|
27
|
+
export { PostMenuTrigger } from './components/post-menu-trigger/post-menu-trigger';
|
|
10
28
|
export { PostPopover } from './components/post-popover/post-popover';
|
|
11
29
|
export { PostPopovercontainer } from './components/post-popovercontainer/post-popovercontainer';
|
|
12
30
|
export { PostRating } from './components/post-rating/post-rating';
|
|
13
31
|
export { PostTabs } from './components/post-tabs/post-tabs';
|
|
14
32
|
export { PostTabHeader } from './components/post-tab-header/post-tab-header';
|
|
15
33
|
export { PostTabPanel } from './components/post-tab-panel/post-tab-panel';
|
|
16
|
-
export { PostTooltip } from './components/post-tooltip/post-tooltip';
|
|
17
34
|
export { PostTag } from './components/post-tag/post-tag';
|
|
35
|
+
export { PostTogglebutton } from './components/post-togglebutton/post-togglebutton';
|
|
36
|
+
export { PostTooltip } from './components/post-tooltip/post-tooltip';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export
|
|
1
|
+
export function getAttributeObserver(attribute, handler) {
|
|
2
2
|
/**
|
|
3
3
|
* Handle attribute changes and childList changes from the observer
|
|
4
4
|
* @param {MutationRecord[]} mutationList
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
function observerHandler(mutationList) {
|
|
7
7
|
mutationList.forEach(mutation => {
|
|
8
8
|
if (mutation.type === 'attributes' && mutation.attributeName === attribute) {
|
|
9
9
|
handler(mutation.target);
|
|
@@ -17,7 +17,7 @@ export const getAttributeObserver = (attribute, handler) => {
|
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
|
-
}
|
|
20
|
+
}
|
|
21
21
|
// Initialize a mutation observer for patching accessibility features
|
|
22
22
|
return new MutationObserver(observerHandler);
|
|
23
|
-
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export class Breakpoint {
|
|
2
|
+
breakpointMap;
|
|
3
|
+
current = {
|
|
4
|
+
key: '',
|
|
5
|
+
name: '',
|
|
6
|
+
};
|
|
7
|
+
constructor() {
|
|
8
|
+
if (!this.breakpointMap) {
|
|
9
|
+
const keys = this.getStyles('--post-breakpoint-keys');
|
|
10
|
+
const names = this.getStyles('--post-breakpoint-names');
|
|
11
|
+
const widths = this.getStyles('--post-breakpoint-widths');
|
|
12
|
+
this.breakpointMap = widths
|
|
13
|
+
.map((width, i) => ({
|
|
14
|
+
minWidth: Number(width),
|
|
15
|
+
key: keys[i],
|
|
16
|
+
name: names[i],
|
|
17
|
+
}))
|
|
18
|
+
.reverse();
|
|
19
|
+
window.addEventListener('resize', () => this.updateHandler(), { passive: true });
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
getStyles(propertyName) {
|
|
23
|
+
const styles = getComputedStyle(document.documentElement);
|
|
24
|
+
return (styles
|
|
25
|
+
.getPropertyValue(propertyName)
|
|
26
|
+
?.split(',')
|
|
27
|
+
.map(w => w.trim()) ?? []);
|
|
28
|
+
}
|
|
29
|
+
updateHandler(emitEvents = true) {
|
|
30
|
+
const calculated = this.breakpointMap.find(({ minWidth }) => innerWidth >= minWidth);
|
|
31
|
+
if (this.current.key !== calculated.key) {
|
|
32
|
+
this.current.key = calculated.key;
|
|
33
|
+
if (emitEvents)
|
|
34
|
+
this.dispatchEvent('key');
|
|
35
|
+
}
|
|
36
|
+
if (this.current.name !== calculated.name) {
|
|
37
|
+
this.current.name = calculated.name;
|
|
38
|
+
if (emitEvents)
|
|
39
|
+
this.dispatchEvent('name');
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
dispatchEvent(type) {
|
|
43
|
+
window.dispatchEvent(new CustomEvent(`postBreakpoint:${type}`, { detail: this.current[type] }));
|
|
44
|
+
}
|
|
45
|
+
get(type) {
|
|
46
|
+
this.updateHandler(false);
|
|
47
|
+
return this.current[type];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
export const breakpoint = new Breakpoint();
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Invoke the `componentOnReady` method if it is available, simulate it otherwise
|
|
3
3
|
* @see https://stenciljs.com/docs/api#componentonready
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export function componentOnReady(el) {
|
|
6
6
|
if (typeof el.componentOnReady === 'function') {
|
|
7
7
|
return el.componentOnReady();
|
|
8
8
|
}
|
|
@@ -11,10 +11,10 @@ export const componentOnReady = (el) => {
|
|
|
11
11
|
resolve(el);
|
|
12
12
|
}));
|
|
13
13
|
}
|
|
14
|
-
}
|
|
15
|
-
|
|
14
|
+
}
|
|
15
|
+
function customOnReady(callback) {
|
|
16
16
|
if (typeof requestAnimationFrame === 'function') {
|
|
17
17
|
return requestAnimationFrame(callback);
|
|
18
18
|
}
|
|
19
19
|
return setTimeout(callback);
|
|
20
|
-
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const focusableSelector = `:where(${[
|
|
2
|
+
'button',
|
|
3
|
+
'input:not([type="hidden"])',
|
|
4
|
+
'[tabindex]',
|
|
5
|
+
'select',
|
|
6
|
+
'textarea',
|
|
7
|
+
'[contenteditable]',
|
|
8
|
+
'a[href]',
|
|
9
|
+
'iframe',
|
|
10
|
+
'audio[controls]',
|
|
11
|
+
'video[controls]',
|
|
12
|
+
'area[href]',
|
|
13
|
+
'details > summary:first-of-type',
|
|
14
|
+
].join(',')})`;
|
|
15
|
+
const focusDisablingSelector = `:where(${[
|
|
16
|
+
'[inert]',
|
|
17
|
+
'[inert] *',
|
|
18
|
+
':disabled',
|
|
19
|
+
'dialog:not([open]) *',
|
|
20
|
+
'[popover]:not(:popover-open) *',
|
|
21
|
+
'details:not([open]) > *:not(details > summary:first-of-type)',
|
|
22
|
+
'details:not([open]) > *:not(details > summary:first-of-type) *',
|
|
23
|
+
'[tabindex^="-"]',
|
|
24
|
+
'[hidden]:not([hidden="false"])',
|
|
25
|
+
].join(',')})`;
|
|
26
|
+
export function getFocusableChildren(element) {
|
|
27
|
+
const focusableChildren = element.querySelectorAll(`${focusableSelector}:not(${focusDisablingSelector})`);
|
|
28
|
+
const visibleFocusableChildren = Array.from(focusableChildren).filter(child => {
|
|
29
|
+
const style = window.getComputedStyle(child.parentElement);
|
|
30
|
+
return style.display !== 'none' && style.visibility !== 'hidden';
|
|
31
|
+
});
|
|
32
|
+
return visibleFocusableChildren;
|
|
33
|
+
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { EMPTY_VALUES } from "./constants";
|
|
2
|
-
export function checkNonEmpty(
|
|
2
|
+
export function checkNonEmpty(component, prop, customMessage) {
|
|
3
|
+
const componentName = component.host.localName;
|
|
4
|
+
const value = component[prop];
|
|
5
|
+
const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component is required.`;
|
|
6
|
+
const message = customMessage || defaultMessage;
|
|
3
7
|
if (EMPTY_VALUES.some(v => v === value)) {
|
|
4
|
-
throw new Error(
|
|
8
|
+
throw new Error(message);
|
|
5
9
|
}
|
|
6
10
|
}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
export function checkOneOf(
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export function checkOneOf(component, prop, possibleValues, customMessage) {
|
|
2
|
+
const componentName = component.host.localName;
|
|
3
|
+
const value = component[prop];
|
|
4
|
+
const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component must be one of the following values: ${possibleValues.join(', ')}.`;
|
|
5
|
+
const message = customMessage || defaultMessage;
|
|
6
|
+
if (!possibleValues.includes(value)) {
|
|
7
|
+
throw new Error(message);
|
|
8
|
+
}
|
|
4
9
|
}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
export function checkPattern(
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export function checkPattern(component, prop, pattern, customMessage) {
|
|
2
|
+
const componentName = component.host.localName;
|
|
3
|
+
const value = component[prop];
|
|
4
|
+
const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component must be follow the format \`${pattern}\`.`;
|
|
5
|
+
const message = customMessage || defaultMessage;
|
|
6
|
+
if (typeof value !== 'string' || !pattern.test(value)) {
|
|
7
|
+
throw new Error(message);
|
|
8
|
+
}
|
|
4
9
|
}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
export function checkType(
|
|
1
|
+
export function checkType(component, prop, type, customMessage) {
|
|
2
|
+
const componentName = component.host.localName;
|
|
3
|
+
const value = component[prop];
|
|
2
4
|
const typeIsArray = type === 'array';
|
|
3
5
|
const valueIsArray = Array.isArray(value);
|
|
6
|
+
const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component must be of type \`
|
|
7
|
+
${type}\`.`;
|
|
8
|
+
const message = customMessage || defaultMessage;
|
|
4
9
|
if (typeIsArray || valueIsArray) {
|
|
5
|
-
if (valueIsArray !== typeIsArray)
|
|
6
|
-
throw new Error(
|
|
10
|
+
if (valueIsArray !== typeIsArray) {
|
|
11
|
+
throw new Error(message);
|
|
12
|
+
}
|
|
7
13
|
}
|
|
8
|
-
else {
|
|
9
|
-
|
|
10
|
-
throw new Error(error);
|
|
14
|
+
else if (typeof value !== type) {
|
|
15
|
+
throw new Error(message);
|
|
11
16
|
}
|
|
12
17
|
}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
export function checkUrl(
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export function checkUrl(component, prop, customMessage) {
|
|
2
|
+
const componentName = component.host.localName;
|
|
3
|
+
const value = component[prop];
|
|
4
|
+
const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component is invalid.`;
|
|
5
|
+
const message = customMessage || defaultMessage;
|
|
6
|
+
if (typeof value !== 'string' && !(value instanceof URL)) {
|
|
7
|
+
throw new Error(message);
|
|
8
|
+
}
|
|
4
9
|
try {
|
|
5
|
-
new URL(value);
|
|
10
|
+
new URL(value, 'https://www.post.ch');
|
|
6
11
|
}
|
|
7
|
-
catch
|
|
8
|
-
throw new Error(
|
|
12
|
+
catch {
|
|
13
|
+
throw new Error(message);
|
|
9
14
|
}
|
|
10
15
|
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { EMPTY_VALUES } from "./constants";
|
|
2
2
|
export function emptyOr(check) {
|
|
3
3
|
return (...args) => {
|
|
4
|
-
const
|
|
5
|
-
|
|
4
|
+
const component = args[0];
|
|
5
|
+
const prop = args[1];
|
|
6
|
+
const value = component[prop];
|
|
7
|
+
if (!EMPTY_VALUES.some(v => v === value)) {
|
|
6
8
|
check(...args);
|
|
9
|
+
}
|
|
7
10
|
};
|
|
8
11
|
}
|
|
@@ -2,11 +2,14 @@ export function parse(scss) {
|
|
|
2
2
|
return Object.entries(scss).reduce((object, [path, value]) => {
|
|
3
3
|
let output = object;
|
|
4
4
|
path.split('_').forEach((key, i, values) => {
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
output[
|
|
9
|
-
output =
|
|
5
|
+
const normalized = /^\[.*\]$/.test(value)
|
|
6
|
+
? JSON.parse(value)
|
|
7
|
+
: value;
|
|
8
|
+
const pathValue = i >= values.length - 1 ? normalized : output[key] || {};
|
|
9
|
+
output[key] = pathValue;
|
|
10
|
+
if (i < values.length) {
|
|
11
|
+
output = output[key];
|
|
12
|
+
}
|
|
10
13
|
});
|
|
11
14
|
return object;
|
|
12
15
|
}, {});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
function getAttributeObserver(attribute, handler) {
|
|
2
2
|
/**
|
|
3
3
|
* Handle attribute changes and childList changes from the observer
|
|
4
4
|
* @param {MutationRecord[]} mutationList
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
function observerHandler(mutationList) {
|
|
7
7
|
mutationList.forEach(mutation => {
|
|
8
8
|
if (mutation.type === 'attributes' && mutation.attributeName === attribute) {
|
|
9
9
|
handler(mutation.target);
|
|
@@ -17,9 +17,9 @@ const getAttributeObserver = (attribute, handler) => {
|
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
|
-
}
|
|
20
|
+
}
|
|
21
21
|
// Initialize a mutation observer for patching accessibility features
|
|
22
22
|
return new MutationObserver(observerHandler);
|
|
23
|
-
}
|
|
23
|
+
}
|
|
24
24
|
|
|
25
25
|
export { getAttributeObserver as g };
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { E as EMPTY_VALUES } from './constants.js';
|
|
2
2
|
|
|
3
|
-
function checkNonEmpty(
|
|
3
|
+
function checkNonEmpty(component, prop, customMessage) {
|
|
4
|
+
const componentName = component.host.localName;
|
|
5
|
+
const value = component[prop];
|
|
6
|
+
const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component is required.`;
|
|
7
|
+
const message = customMessage || defaultMessage;
|
|
4
8
|
if (EMPTY_VALUES.some(v => v === value)) {
|
|
5
|
-
throw new Error(
|
|
9
|
+
throw new Error(message);
|
|
6
10
|
}
|
|
7
11
|
}
|
|
8
12
|
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
function checkOneOf(
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
function checkOneOf(component, prop, possibleValues, customMessage) {
|
|
2
|
+
const componentName = component.host.localName;
|
|
3
|
+
const value = component[prop];
|
|
4
|
+
const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component must be one of the following values: ${possibleValues.join(', ')}.`;
|
|
5
|
+
const message = customMessage || defaultMessage;
|
|
6
|
+
if (!possibleValues.includes(value)) {
|
|
7
|
+
throw new Error(message);
|
|
8
|
+
}
|
|
4
9
|
}
|
|
5
10
|
|
|
6
11
|
export { checkOneOf as c };
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
function checkType(
|
|
1
|
+
function checkType(component, prop, type, customMessage) {
|
|
2
|
+
const componentName = component.host.localName;
|
|
3
|
+
const value = component[prop];
|
|
2
4
|
const typeIsArray = type === 'array';
|
|
3
5
|
const valueIsArray = Array.isArray(value);
|
|
6
|
+
const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component must be of type \`
|
|
7
|
+
${type}\`.`;
|
|
8
|
+
const message = customMessage || defaultMessage;
|
|
4
9
|
if (typeIsArray || valueIsArray) {
|
|
5
|
-
if (valueIsArray !== typeIsArray)
|
|
6
|
-
throw new Error(
|
|
10
|
+
if (valueIsArray !== typeIsArray) {
|
|
11
|
+
throw new Error(message);
|
|
12
|
+
}
|
|
7
13
|
}
|
|
8
|
-
else {
|
|
9
|
-
|
|
10
|
-
throw new Error(error);
|
|
14
|
+
else if (typeof value !== type) {
|
|
15
|
+
throw new Error(message);
|
|
11
16
|
}
|
|
12
17
|
}
|
|
13
18
|
|
package/dist/components/fade.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
const fadeDuration = 200;
|
|
2
2
|
const fadedOutKeyframe = { opacity: '0' };
|
|
3
3
|
const fadedInKeyframe = { opacity: '1' };
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
function fadeIn(el) {
|
|
5
|
+
return el.animate([fadedOutKeyframe, fadedInKeyframe], { duration: fadeDuration });
|
|
6
|
+
}
|
|
7
|
+
function fadeOut(el) {
|
|
8
|
+
return el.animate([fadedInKeyframe, fadedOutKeyframe], { duration: fadeDuration });
|
|
9
|
+
}
|
|
6
10
|
|
|
7
11
|
export { fadeIn as a, fadeOut as f };
|