@swisspost/design-system-components 10.0.0-next.55 → 10.0.0-next.57
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/{components/react/p-CJ80BZ06.js → cjs/breakpoints-Df03Ct7n.js} +103 -5
- package/dist/cjs/debounce-BsIBi_-2.js +13 -0
- package/dist/cjs/environment-BQE9Unf_.js +52 -0
- package/dist/cjs/{event-from-CLvtSUKf.js → event-from-CwMw19f8.js} +2 -2
- package/dist/cjs/fade-CPQhl1fP.js +26 -0
- package/dist/cjs/fade-slide-dPhQa-I1.js +38 -0
- package/dist/cjs/{get-focusable-children-Bx63XUQg.js → get-focusable-children-ChETM1wK.js} +29 -21
- package/dist/cjs/{get-root-CyMf3Vsd.js → get-root-CUAv4k4C.js} +2 -2
- package/dist/cjs/{index-B4gYpuJF.js → index-B4rc1pqu.js} +2150 -292
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{package-DkJrv93P.js → package-uQ5oiSiN.js} +1 -1
- package/dist/cjs/post-accordion_2.cjs.entry.js +19 -15
- package/dist/cjs/post-avatar.cjs.entry.js +27 -17
- package/dist/cjs/post-back-to-top.cjs.entry.js +23 -43
- package/dist/cjs/post-banner.cjs.entry.js +15 -12
- package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +14 -12
- package/dist/cjs/post-breadcrumbs.cjs.entry.js +33 -34
- package/dist/cjs/post-card-control.cjs.entry.js +42 -26
- package/dist/cjs/{post-closebutton_15.cjs.entry.js → post-closebutton_13.cjs.entry.js} +618 -531
- package/dist/cjs/post-collapsible_2.cjs.entry.js +41 -37
- package/dist/cjs/post-components.cjs.js +3 -3
- package/dist/cjs/post-env-test.cjs.entry.js +15 -0
- package/dist/cjs/post-footer.cjs.entry.js +24 -20
- package/dist/cjs/post-linkarea.cjs.entry.js +5 -5
- package/dist/cjs/post-pagination.cjs.entry.js +615 -0
- package/dist/cjs/post-popover-trigger.cjs.entry.js +54 -34
- package/dist/cjs/post-popover.cjs.entry.js +26 -17
- package/dist/cjs/post-rating.cjs.entry.js +24 -18
- package/dist/cjs/post-stepper-item.cjs.entry.js +5 -5
- package/dist/cjs/post-stepper.cjs.entry.js +40 -29
- package/dist/cjs/post-tab-item.cjs.entry.js +51 -0
- package/dist/cjs/post-tab-panel.cjs.entry.js +13 -11
- package/dist/cjs/post-tabs.cjs.entry.js +195 -40
- package/dist/cjs/post-tooltip-trigger.cjs.entry.js +13 -11
- package/dist/cjs/post-tooltip.cjs.entry.js +14 -12
- package/dist/cjs/utils-s05L2ulk.js +26 -0
- package/dist/collection/animations/collapse.js +3 -3
- package/dist/collection/animations/fade-slide.js +33 -0
- package/dist/collection/animations/fade.js +19 -7
- package/dist/collection/animations/index.js +2 -0
- package/dist/collection/animations/slide.js +25 -21
- package/dist/collection/animations/types.js +14 -0
- package/dist/collection/animations/utils.js +8 -0
- package/dist/collection/collection-manifest.json +8 -8
- package/dist/collection/components/post-accordion/post-accordion.css +1 -1
- package/dist/collection/components/post-accordion/post-accordion.js +5 -4
- package/dist/collection/components/post-accordion-item/post-accordion-item.css +1 -1
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +9 -8
- package/dist/collection/components/post-avatar/post-avatar.js +11 -11
- package/dist/collection/components/post-back-to-top/post-back-to-top.js +15 -15
- package/dist/collection/components/post-banner/post-banner.css +4 -1
- package/dist/collection/components/post-banner/post-banner.js +6 -5
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +3 -3
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.js +29 -29
- package/dist/collection/components/post-card-control/post-card-control.js +18 -18
- package/dist/collection/components/post-closebutton/post-closebutton.css +1 -1
- package/dist/collection/components/post-closebutton/post-closebutton.js +4 -3
- package/dist/collection/components/post-collapsible/post-collapsible.js +28 -28
- package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +3 -3
- package/dist/collection/components/post-footer/post-footer.css +1 -1
- package/dist/collection/components/post-footer/post-footer.js +18 -16
- package/dist/collection/components/post-header/post-header.css +1 -1
- package/dist/collection/components/post-header/post-header.js +144 -82
- package/dist/collection/components/post-icon/post-icon.js +18 -16
- package/dist/collection/components/post-language-menu/post-language-menu.css +1 -0
- package/dist/collection/components/{post-language-switch/post-language-switch.js → post-language-menu/post-language-menu.js} +45 -36
- package/dist/collection/components/post-language-menu-item/post-language-menu-item.css +1 -0
- package/dist/collection/components/{post-language-option/post-language-option.js → post-language-menu-item/post-language-menu-item.js} +24 -23
- package/dist/collection/components/post-linkarea/post-linkarea.js +1 -1
- package/dist/collection/components/post-logo/post-logo.css +3 -1
- package/dist/collection/components/post-logo/post-logo.js +3 -3
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +1 -1
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +41 -29
- package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.js +183 -74
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.css +3 -1
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +81 -75
- package/dist/collection/components/post-menu/post-menu.css +1 -1
- package/dist/collection/components/post-menu/post-menu.js +39 -38
- package/dist/collection/components/post-menu-item/post-menu-item.js +1 -1
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +3 -3
- package/dist/collection/components/post-pagination/post-pagination.css +1 -0
- package/dist/collection/components/post-pagination/post-pagination.js +838 -0
- package/dist/collection/components/post-popover/post-popover.js +22 -16
- package/dist/collection/components/post-popover-trigger/post-popover-trigger.js +45 -29
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -1
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +82 -131
- package/dist/collection/components/post-rating/post-rating.js +7 -7
- package/dist/collection/components/post-stepper/post-stepper.js +38 -35
- package/dist/collection/components/post-stepper-item/post-stepper-item.css +2 -2
- package/dist/collection/components/post-stepper-item/post-stepper-item.js +1 -1
- package/dist/collection/components/post-tab-item/post-tab-item.css +1 -0
- package/dist/collection/components/post-tab-item/post-tab-item.js +86 -0
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +10 -10
- package/dist/collection/components/post-tabs/post-tabs.js +232 -59
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +2 -2
- package/dist/collection/components/post-tooltip/post-tooltip.js +9 -27
- package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +4 -4
- package/dist/collection/utils/environment.js +47 -2
- package/dist/collection/utils/event-from.js +2 -2
- package/dist/collection/utils/get-focusable-children.js +29 -21
- package/dist/collection/utils/is-motion-reduced.js +1 -1
- package/dist/collection/utils/tests/environment/hydrate-app-helper.js +16 -0
- package/dist/collection/utils/tests/environment/post-env-test.js +9 -0
- package/dist/component-names.json +4 -5
- package/dist/components/breakpoints.js +1 -178
- package/dist/components/debounce.js +1 -0
- package/dist/components/environment.js +1 -0
- package/dist/components/event-from.js +1 -119
- package/dist/components/fade-slide.js +1 -0
- package/dist/components/fade.js +1 -11
- package/dist/components/focusable.js +1 -5018
- package/dist/components/get-focusable-children.js +1 -64
- package/dist/components/get-root.js +1 -15
- package/dist/components/heading-levels.js +1 -3
- package/dist/components/index.browser.js +1 -14
- package/dist/components/index.d.ts +11 -10
- package/dist/components/index.js +1 -39
- package/dist/components/long-press-event.js +1 -257
- package/dist/components/package.js +1 -3
- package/dist/components/post-accordion-item.js +1 -6
- package/dist/components/post-accordion-item2.js +1 -113
- package/dist/components/post-accordion.js +1 -6
- package/dist/components/post-accordion2.js +1 -138
- package/dist/components/post-avatar.js +1 -217
- package/dist/components/post-back-to-top.js +1 -144
- package/dist/components/post-banner.js +1 -98
- package/dist/components/post-breadcrumb-item.js +1 -6
- package/dist/components/post-breadcrumb-item2.js +1 -79
- package/dist/components/post-breadcrumbs.js +1 -196
- package/dist/components/post-card-control.js +1 -326
- package/dist/components/post-closebutton.js +1 -6
- package/dist/components/post-closebutton2.js +1 -77
- package/dist/components/post-collapsible-trigger.js +1 -6
- package/dist/components/post-collapsible-trigger2.js +1 -136
- package/dist/components/post-collapsible.js +1 -6
- package/dist/components/post-collapsible2.js +1 -110
- package/dist/components/{post-list.d.ts → post-env-test.d.ts} +4 -4
- package/dist/components/post-env-test.js +1 -0
- package/dist/components/post-footer.js +1 -116
- package/dist/components/post-header.js +1 -372
- package/dist/components/post-icon.js +1 -6
- package/dist/components/post-icon2.js +1 -159
- package/dist/components/post-language-menu-item.d.ts +11 -0
- package/dist/components/post-language-menu-item.js +1 -0
- package/dist/components/{post-language-switch.d.ts → post-language-menu.d.ts} +4 -4
- package/dist/components/post-language-menu.js +1 -0
- package/dist/components/post-linkarea.js +1 -58
- package/dist/components/post-logo.js +1 -58
- package/dist/components/post-mainnavigation.js +1 -180
- package/dist/components/post-megadropdown-trigger.js +1 -136
- package/dist/components/post-megadropdown.js +1 -267
- package/dist/components/post-menu-item.js +1 -6
- package/dist/components/post-menu-item2.js +1 -30
- package/dist/components/post-menu-trigger.js +1 -6
- package/dist/components/post-menu-trigger2.js +1 -110
- package/dist/components/post-menu.js +1 -6
- package/dist/components/post-menu2.js +1 -242
- package/dist/components/{post-tab-header.d.ts → post-pagination.d.ts} +4 -4
- package/dist/components/post-pagination.js +1 -0
- package/dist/components/post-popover-trigger.js +1 -132
- package/dist/components/post-popover.js +1 -118
- package/dist/components/post-popovercontainer.js +1 -6
- package/dist/components/post-popovercontainer2.js +1 -3127
- package/dist/components/post-rating.js +1 -148
- package/dist/components/post-stepper-item.js +1 -33
- package/dist/components/post-stepper.js +1 -134
- package/dist/components/{post-list-item.d.ts → post-tab-item.d.ts} +4 -4
- package/dist/components/post-tab-item.js +1 -0
- package/dist/components/post-tab-panel.js +1 -54
- package/dist/components/post-tabs.js +1 -196
- package/dist/components/post-togglebutton.js +1 -56
- package/dist/components/post-togglebutton2.js +1 -0
- package/dist/components/post-tooltip-trigger.js +1 -206
- package/dist/components/post-tooltip.js +1 -114
- package/dist/components/react/index.d.ts +2 -0
- package/dist/components/react/index.js +1 -2315
- package/dist/components/react/p-B8YiQ3mz.js +1 -0
- package/dist/components/react/p-BC5nlBvn.js +1 -0
- package/dist/components/react/p-BLchVpF6.js +1 -14
- package/dist/components/react/p-BVCjnh6Q.js +1 -0
- package/dist/{post-components/p-CBFgkSgY.js → components/react/p-BVGcVycs.js} +1 -1
- package/dist/components/react/p-B_XPj2c8.js +1 -0
- package/dist/components/react/p-BllOMLDs.js +1 -0
- package/dist/components/react/p-BmRNjQUZ.js +1 -0
- package/dist/components/react/p-ByFh05IW.js +1 -0
- package/dist/components/react/p-C9hMpmsD.js +1 -0
- package/dist/components/react/p-CJ13r5fi.js +1 -0
- package/dist/components/react/p-CZvbetqX.js +1 -0
- package/dist/components/react/p-C_2k3G1c.js +1 -257
- package/dist/components/react/p-CoDiS_Ik.js +1 -0
- package/dist/components/react/p-Cou17ld8.js +1 -0
- package/dist/components/react/p-D5knoiyy.js +1 -0
- package/dist/components/react/p-D9DDtvFM.js +1 -0
- package/dist/components/react/p-DY2U5CQt.js +1 -0
- package/dist/components/react/p-DjIHLduJ.js +1 -3
- package/dist/components/react/p-DpATRD2W.js +1 -0
- package/dist/components/react/p-FxUVQ4Tx.js +1 -0
- package/dist/components/react/p-HygIVKXC.js +1 -5018
- package/dist/components/react/p-YR7U0Z_g.js +1 -0
- package/dist/components/react/p-ZeKXASQs.js +1 -0
- package/dist/components/react/p-r4txK0AC.js +1 -3
- package/dist/components/react/p-sSn0kXFi.js +1 -0
- package/dist/components/react/post-accordion-item.js +1 -6
- package/dist/components/react/post-accordion.js +1 -6
- package/dist/components/react/post-avatar.js +1 -218
- package/dist/components/react/post-back-to-top.js +1 -145
- package/dist/components/react/post-banner.js +1 -99
- package/dist/components/react/post-breadcrumb-item.js +1 -6
- package/dist/components/react/post-breadcrumbs.js +1 -197
- package/dist/components/react/post-card-control.js +1 -327
- package/dist/components/react/post-closebutton.js +1 -6
- package/dist/components/react/post-collapsible-trigger.js +1 -6
- package/dist/components/react/post-collapsible.js +1 -6
- package/dist/components/react/{post-list.d.ts → post-env-test.d.ts} +4 -4
- package/dist/components/react/post-env-test.js +1 -0
- package/dist/components/react/post-footer.js +1 -117
- package/dist/components/react/post-header.js +1 -373
- package/dist/components/react/post-icon.js +1 -6
- package/dist/components/react/post-language-menu-item.d.ts +11 -0
- package/dist/components/react/post-language-menu-item.js +1 -0
- package/dist/components/react/{post-language-option.d.ts → post-language-menu.d.ts} +4 -4
- package/dist/components/react/post-language-menu.js +1 -0
- package/dist/components/react/post-linkarea.js +1 -59
- package/dist/components/react/post-logo.js +1 -59
- package/dist/components/react/post-mainnavigation.js +1 -181
- package/dist/components/react/post-megadropdown-trigger.js +1 -137
- package/dist/components/react/post-megadropdown.js +1 -268
- package/dist/components/react/post-menu-item.js +1 -6
- package/dist/components/react/post-menu-trigger.js +1 -6
- package/dist/components/react/post-menu.js +1 -6
- package/dist/components/react/{post-tab-header.d.ts → post-pagination.d.ts} +4 -4
- package/dist/components/react/post-pagination.js +1 -0
- package/dist/components/react/post-popover-trigger.js +1 -133
- package/dist/components/react/post-popover.js +1 -119
- package/dist/components/react/post-popovercontainer.js +1 -6
- package/dist/components/react/post-rating.js +1 -149
- package/dist/components/react/post-stepper-item.js +1 -34
- package/dist/components/react/post-stepper.js +1 -135
- package/dist/components/react/{post-list-item.d.ts → post-tab-item.d.ts} +4 -4
- package/dist/components/react/post-tab-item.js +1 -0
- package/dist/components/react/post-tab-panel.js +1 -55
- package/dist/components/react/post-tabs.js +1 -197
- package/dist/components/react/post-togglebutton.js +1 -57
- package/dist/components/react/post-tooltip-trigger.js +1 -207
- package/dist/components/react/post-tooltip.js +1 -115
- package/dist/components/switch-variants.js +1 -3
- package/dist/components/utils.js +1 -0
- package/dist/docs.d.ts +11 -0
- package/dist/docs.json +873 -631
- package/dist/{cjs/breakpoints-CEkeixld.js → esm/breakpoints-DYoSKGHO.js} +89 -6
- package/dist/esm/debounce-C9hMpmsD.js +11 -0
- package/dist/esm/environment-CEmnRoA6.js +49 -0
- package/dist/{components/react/p-CzIKqBrS.js → esm/event-from-rEfV4v4a.js} +2 -2
- package/dist/esm/fade-DsgPYmAa.js +24 -0
- package/dist/esm/fade-slide-CvOvauo9.js +36 -0
- package/dist/esm/{get-focusable-children-D9ZHp2FP.js → get-focusable-children-BXNs2_sw.js} +29 -21
- package/dist/{components/react/p-CBFgkSgY.js → esm/get-root-CXfAA093.js} +1 -1
- package/dist/esm/{index-wEFJ-c34.js → index-CDZBzSdV.js} +2150 -292
- package/dist/esm/loader.js +3 -3
- package/dist/esm/package-CZvbetqX.js +3 -0
- package/dist/esm/post-accordion_2.entry.js +17 -13
- package/dist/esm/post-avatar.entry.js +22 -12
- package/dist/esm/post-back-to-top.entry.js +23 -43
- package/dist/esm/post-banner.entry.js +14 -11
- package/dist/esm/post-breadcrumb-item_2.entry.js +13 -11
- package/dist/esm/post-breadcrumbs.entry.js +31 -32
- package/dist/esm/post-card-control.entry.js +32 -16
- package/dist/esm/{post-closebutton_15.entry.js → post-closebutton_13.entry.js} +599 -510
- package/dist/esm/post-collapsible_2.entry.js +38 -34
- package/dist/esm/post-components.js +4 -4
- package/dist/esm/post-env-test.entry.js +13 -0
- package/dist/esm/post-footer.entry.js +21 -17
- package/dist/esm/post-linkarea.entry.js +5 -5
- package/dist/esm/post-pagination.entry.js +613 -0
- package/dist/esm/post-popover-trigger.entry.js +52 -32
- package/dist/esm/post-popover.entry.js +25 -16
- package/dist/esm/post-rating.entry.js +16 -10
- package/dist/esm/post-stepper-item.entry.js +5 -5
- package/dist/esm/post-stepper.entry.js +39 -28
- package/dist/esm/post-tab-item.entry.js +49 -0
- package/dist/esm/post-tab-panel.entry.js +13 -11
- package/dist/esm/post-tabs.entry.js +195 -40
- package/dist/esm/post-tooltip-trigger.entry.js +10 -8
- package/dist/esm/post-tooltip.entry.js +13 -11
- package/dist/esm/utils-CoDiS_Ik.js +24 -0
- package/dist/post-components/p-09ba7cf9.entry.js +1 -0
- package/dist/post-components/p-0c091898.entry.js +1 -0
- package/dist/post-components/{p-cd03e6f2.entry.js → p-0e97fcfd.entry.js} +1 -1
- package/dist/post-components/p-296f1dd5.entry.js +1 -0
- package/dist/post-components/p-32ad2b21.entry.js +1 -0
- package/dist/post-components/p-366c28cb.entry.js +1 -0
- package/dist/post-components/p-41ae68d5.entry.js +1 -0
- package/dist/post-components/p-448e7265.entry.js +1 -0
- package/dist/post-components/p-554da188.entry.js +1 -0
- package/dist/post-components/p-5912f8f1.entry.js +1 -0
- package/dist/post-components/p-790f300d.entry.js +1 -0
- package/dist/post-components/p-7ed5a493.entry.js +1 -0
- package/dist/post-components/p-85bea1b6.entry.js +1 -0
- package/dist/post-components/p-8bcff4d2.entry.js +1 -0
- package/dist/post-components/p-9dc9c245.entry.js +1 -0
- package/dist/post-components/p-B7ebLhHc.js +1 -0
- package/dist/post-components/p-BVCjnh6Q.js +1 -0
- package/dist/post-components/p-BXNs2_sw.js +1 -0
- package/dist/post-components/p-C9hMpmsD.js +1 -0
- package/dist/post-components/p-CDZBzSdV.js +2 -0
- package/dist/post-components/p-CEmnRoA6.js +1 -0
- package/dist/post-components/p-CZvbetqX.js +1 -0
- package/dist/post-components/p-CoDiS_Ik.js +1 -0
- package/dist/post-components/p-D5knoiyy.js +1 -0
- package/dist/post-components/p-DI-h_mEL.js +1 -0
- package/dist/post-components/p-a06f9695.entry.js +1 -0
- package/dist/post-components/p-a191f1df.entry.js +1 -0
- package/dist/post-components/p-c5d19d62.entry.js +1 -0
- package/dist/post-components/{p-24dc54d1.entry.js → p-c8c4d05b.entry.js} +1 -1
- package/dist/post-components/{p-57288cb2.entry.js → p-d1a5c980.entry.js} +1 -1
- package/dist/post-components/p-d4e2c556.entry.js +1 -0
- package/dist/post-components/p-f96a310c.entry.js +1 -0
- package/dist/post-components/p-fab2327d.entry.js +1 -0
- package/dist/post-components/p-rEfV4v4a.js +1 -0
- package/dist/post-components/post-components.css +1 -1
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/prebuild.js +46 -0
- package/dist/types/animations/collapse.d.ts +1 -0
- package/dist/types/animations/fade-slide.d.ts +11 -0
- package/dist/types/animations/fade.d.ts +2 -2
- package/dist/types/animations/index.d.ts +2 -0
- package/dist/types/animations/slide.d.ts +9 -2
- package/dist/types/animations/types.d.ts +13 -0
- package/dist/types/animations/utils.d.ts +2 -0
- package/dist/types/components/post-accordion-item/heading-levels.d.ts +1 -1
- package/dist/types/components/post-accordion-item/post-accordion-item.d.ts +2 -2
- package/dist/types/components/post-back-to-top/post-back-to-top.d.ts +2 -2
- package/dist/types/components/post-breadcrumbs/post-breadcrumbs.d.ts +6 -6
- package/dist/types/components/post-collapsible/post-collapsible.d.ts +4 -5
- package/dist/types/components/post-footer/post-footer.d.ts +4 -4
- package/dist/types/components/post-header/post-header.d.ts +23 -13
- package/dist/types/components/{post-language-switch/post-language-switch.d.ts → post-language-menu/post-language-menu.d.ts} +12 -11
- package/dist/types/components/{post-language-option/post-language-option.d.ts → post-language-menu-item/post-language-menu-item.d.ts} +5 -5
- package/dist/types/components/post-mainnavigation/post-mainnavigation.d.ts +6 -5
- package/dist/types/components/post-megadropdown/post-megadropdown.d.ts +20 -2
- package/dist/types/components/post-megadropdown-trigger/post-megadropdown-trigger.d.ts +17 -23
- package/dist/types/components/post-menu/post-menu.d.ts +4 -4
- package/dist/types/components/post-pagination/post-pagination.d.ts +224 -0
- package/dist/types/components/post-popover/post-popover.d.ts +4 -3
- package/dist/types/components/post-popover-trigger/post-popover-trigger.d.ts +2 -1
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +23 -21
- package/dist/types/components/post-rating/post-rating.d.ts +1 -1
- package/dist/types/components/post-stepper/post-stepper.d.ts +9 -8
- package/dist/types/components/post-tab-item/post-tab-item.d.ts +19 -0
- package/dist/types/components/post-tab-panel/post-tab-panel.d.ts +3 -3
- package/dist/types/components/post-tabs/post-tabs.d.ts +33 -12
- package/dist/types/components/post-tooltip/post-tooltip.d.ts +1 -5
- package/dist/types/components.d.ts +322 -219
- package/dist/types/home/runner/work/design-system/design-system/packages/components/.stencil/prebuild.d.ts +9 -0
- package/dist/types/stencil-public-runtime.d.ts +147 -10
- package/dist/types/types/heading-levels.d.ts +1 -1
- package/dist/types/utils/environment.d.ts +25 -1
- package/dist/types/utils/get-focusable-children.d.ts +2 -2
- package/dist/types/utils/tests/environment/hydrate-app-helper.d.ts +5 -0
- package/dist/types/utils/tests/environment/post-env-test.d.ts +3 -0
- package/hydrate/index.d.ts +14 -0
- package/hydrate/index.js +7494 -2714
- package/hydrate/index.mjs +7493 -2715
- package/package.json +7 -8
- package/dist/cjs/fade-nS5zzDQS.js +0 -14
- package/dist/cjs/index-UFKR6Ok0.js +0 -98
- package/dist/cjs/post-tab-header.cjs.entry.js +0 -31
- package/dist/collection/animations/slide-and-fade.js +0 -25
- package/dist/collection/components/post-language-option/post-language-option.css +0 -1
- package/dist/collection/components/post-language-switch/post-language-switch.css +0 -1
- package/dist/collection/components/post-list/post-list.css +0 -1
- package/dist/collection/components/post-list/post-list.js +0 -97
- package/dist/collection/components/post-list-item/post-list-item.css +0 -1
- package/dist/collection/components/post-list-item/post-list-item.js +0 -26
- package/dist/collection/components/post-tab-header/post-tab-header.css +0 -1
- package/dist/collection/components/post-tab-header/post-tab-header.js +0 -65
- package/dist/components/index2.js +0 -89
- package/dist/components/post-language-option.d.ts +0 -11
- package/dist/components/post-language-option.js +0 -99
- package/dist/components/post-language-switch.js +0 -157
- package/dist/components/post-list-item.js +0 -38
- package/dist/components/post-list.js +0 -61
- package/dist/components/post-tab-header.js +0 -52
- package/dist/components/react/p-BVXiQdHq.js +0 -64
- package/dist/components/react/p-BhxZzOEC.js +0 -3
- package/dist/components/react/p-CSAMO7iJ.js +0 -243
- package/dist/components/react/p-CYkf_7Y5.js +0 -89
- package/dist/components/react/p-Ccrl2AQn.js +0 -111
- package/dist/components/react/p-CewRvBtg.js +0 -139
- package/dist/components/react/p-Cwiv86_f.js +0 -111
- package/dist/components/react/p-D2waO0Zc.js +0 -31
- package/dist/components/react/p-DBPOV12C.js +0 -160
- package/dist/components/react/p-DVGEExot.js +0 -3128
- package/dist/components/react/p-Djvj8fd2.js +0 -80
- package/dist/components/react/p-LtiDhYis.js +0 -137
- package/dist/components/react/p-SbIC4aZX.js +0 -11
- package/dist/components/react/p-XrZzCOKT.js +0 -78
- package/dist/components/react/p-v3pOrMNQ.js +0 -114
- package/dist/components/react/post-language-option.js +0 -100
- package/dist/components/react/post-language-switch.d.ts +0 -11
- package/dist/components/react/post-language-switch.js +0 -158
- package/dist/components/react/post-list-item.js +0 -39
- package/dist/components/react/post-list.js +0 -62
- package/dist/components/react/post-tab-header.js +0 -53
- package/dist/esm/breakpoints-CJ80BZ06.js +0 -178
- package/dist/esm/event-from-CzIKqBrS.js +0 -119
- package/dist/esm/fade-SbIC4aZX.js +0 -11
- package/dist/esm/get-root-BkQ3CrLq.js +0 -15
- package/dist/esm/index-Beaz8wEe.js +0 -89
- package/dist/esm/package-BhxZzOEC.js +0 -3
- package/dist/esm/post-tab-header.entry.js +0 -29
- package/dist/post-components/p-01e678c9.entry.js +0 -1
- package/dist/post-components/p-034a453f.entry.js +0 -1
- package/dist/post-components/p-15a4cdbf.entry.js +0 -1
- package/dist/post-components/p-2a2030bf.entry.js +0 -1
- package/dist/post-components/p-2ed84cc3.entry.js +0 -1
- package/dist/post-components/p-3228968f.entry.js +0 -1
- package/dist/post-components/p-3c01ddfe.entry.js +0 -1
- package/dist/post-components/p-748b1f01.entry.js +0 -1
- package/dist/post-components/p-7745e46e.entry.js +0 -1
- package/dist/post-components/p-7f635728.entry.js +0 -1
- package/dist/post-components/p-82c178a3.entry.js +0 -1
- package/dist/post-components/p-9b5f8319.entry.js +0 -1
- package/dist/post-components/p-Beaz8wEe.js +0 -1
- package/dist/post-components/p-BhxZzOEC.js +0 -1
- package/dist/post-components/p-CJ80BZ06.js +0 -1
- package/dist/post-components/p-D9ZHp2FP.js +0 -1
- package/dist/post-components/p-SbIC4aZX.js +0 -1
- package/dist/post-components/p-a9644e54.entry.js +0 -1
- package/dist/post-components/p-af030a3a.entry.js +0 -1
- package/dist/post-components/p-b8ba8139.entry.js +0 -1
- package/dist/post-components/p-db935e8e.entry.js +0 -1
- package/dist/post-components/p-e62e1f57.entry.js +0 -1
- package/dist/post-components/p-fb4b1641.entry.js +0 -1
- package/dist/post-components/p-wEFJ-c34.js +0 -2
- package/dist/types/animations/slide-and-fade.d.ts +0 -2
- package/dist/types/components/post-list/post-list.d.ts +0 -24
- package/dist/types/components/post-list-item/post-list-item.d.ts +0 -8
- package/dist/types/components/post-tab-header/post-tab-header.d.ts +0 -14
- /package/dist/collection/components/{post-language-switch → post-language-menu}/switch-variants.js +0 -0
- /package/dist/{post-components/p-CzIKqBrS.js → components/react/p-rEfV4v4a.js} +0 -0
- /package/dist/types/components/{post-language-switch → post-language-menu}/switch-variants.d.ts +0 -0
|
@@ -58,7 +58,7 @@ export function EventFrom(tag, option) {
|
|
|
58
58
|
// Create hidden storage for original method
|
|
59
59
|
Object.defineProperty(target, privateKey, {
|
|
60
60
|
writable: true,
|
|
61
|
-
configurable: true
|
|
61
|
+
configurable: true,
|
|
62
62
|
});
|
|
63
63
|
// Replace property with getter/setter
|
|
64
64
|
Object.defineProperty(target, propertyKey, {
|
|
@@ -82,7 +82,7 @@ export function EventFrom(tag, option) {
|
|
|
82
82
|
}
|
|
83
83
|
},
|
|
84
84
|
configurable: true,
|
|
85
|
-
enumerable: true
|
|
85
|
+
enumerable: true,
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
88
|
};
|
|
@@ -27,32 +27,40 @@ export function getFocusableChildren(element) {
|
|
|
27
27
|
const focusableChildren = element.querySelectorAll(`${focusableSelector}:not(${focusDisablingSelector})`);
|
|
28
28
|
return Array.from(focusableChildren).filter(isVisible);
|
|
29
29
|
}
|
|
30
|
-
// Searches deeper
|
|
31
|
-
export function getDeepFocusableChildren(
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
// Searches deeper across shadow DOM
|
|
31
|
+
export function getDeepFocusableChildren(el, filter, visited = new Set()) {
|
|
32
|
+
if (visited.has(el))
|
|
33
|
+
return [];
|
|
34
|
+
visited.add(el);
|
|
35
|
+
let nodes = [];
|
|
36
|
+
// SLOT
|
|
37
|
+
if (el instanceof HTMLSlotElement) {
|
|
38
|
+
const assigned = el.assignedElements({ flatten: true });
|
|
39
|
+
nodes = assigned.length ? assigned : Array.from(el.children);
|
|
40
|
+
}
|
|
41
|
+
// SHADOW ROOT
|
|
42
|
+
else if (el instanceof HTMLElement && el.shadowRoot) {
|
|
43
|
+
nodes = Array.from(el.shadowRoot.children);
|
|
44
|
+
}
|
|
45
|
+
// NORMAL ELEMENT
|
|
46
|
+
else if (el instanceof Element) {
|
|
47
|
+
nodes = Array.from(el.children);
|
|
48
|
+
}
|
|
49
|
+
if (filter) {
|
|
50
|
+
nodes = nodes.filter(filter);
|
|
51
|
+
}
|
|
52
|
+
const focusableElements = [];
|
|
53
|
+
for (const node of nodes) {
|
|
34
54
|
if (isElementFocusable(node)) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (node instanceof HTMLElement && node.shadowRoot) {
|
|
38
|
-
traverse(node.shadowRoot);
|
|
39
|
-
}
|
|
40
|
-
for (const child of Array.from(node.children)) {
|
|
41
|
-
traverse(child);
|
|
42
|
-
}
|
|
43
|
-
if (node instanceof HTMLElement) {
|
|
44
|
-
for (const slot of Array.from(node.querySelectorAll('slot'))) {
|
|
45
|
-
for (const el of slot.assignedElements({ flatten: true })) {
|
|
46
|
-
traverse(el);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
55
|
+
focusableElements.push(node);
|
|
56
|
+
continue;
|
|
49
57
|
}
|
|
58
|
+
focusableElements.push(...getDeepFocusableChildren(node, filter, visited));
|
|
50
59
|
}
|
|
51
|
-
|
|
52
|
-
return results;
|
|
60
|
+
return focusableElements;
|
|
53
61
|
}
|
|
54
62
|
function isVisible(el) {
|
|
55
|
-
const style = window.getComputedStyle(el
|
|
63
|
+
const style = window.getComputedStyle(el);
|
|
56
64
|
return style.display !== 'none' && style.visibility !== 'hidden';
|
|
57
65
|
}
|
|
58
66
|
function isElementFocusable(node) {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export async function getAppEnv() {
|
|
2
|
+
global.IS_HYDRATEAPP_SERVERTEST = true;
|
|
3
|
+
// keep this, to have runtime-only import (otherwise the build fails)
|
|
4
|
+
const HYDRATE_ID = '@swisspost/design-system-components/hydrate';
|
|
5
|
+
const hydrateApp = await import(HYDRATE_ID);
|
|
6
|
+
const results = await hydrateApp.renderToString('<post-env-test></post-env-test>');
|
|
7
|
+
const IS_BROWSER = /data-browser="(true|false)"/.exec(results.html)?.[1] === 'true';
|
|
8
|
+
const IS_SERVER = /data-server="(true|false)"/.exec(results.html)?.[1] === 'true';
|
|
9
|
+
return {
|
|
10
|
+
IS_BROWSER,
|
|
11
|
+
IS_SERVER,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export function afterTestCleanup() {
|
|
15
|
+
delete global.IS_HYDRATEAPP_SERVERTEST;
|
|
16
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { IS_BROWSER, IS_SERVER } from "../../environment";
|
|
3
|
+
export class PostEnvTest {
|
|
4
|
+
render() {
|
|
5
|
+
return h("div", { key: 'db3a159881c2c955d8e64b8fcc3a0a220cd20d66', "data-browser": String(IS_BROWSER), "data-server": String(IS_SERVER) });
|
|
6
|
+
}
|
|
7
|
+
static get is() { return "post-env-test"; }
|
|
8
|
+
static get encapsulation() { return "shadow"; }
|
|
9
|
+
}
|
|
@@ -14,11 +14,9 @@
|
|
|
14
14
|
"post-footer",
|
|
15
15
|
"post-header",
|
|
16
16
|
"post-icon",
|
|
17
|
-
"post-language-
|
|
18
|
-
"post-language-
|
|
17
|
+
"post-language-menu",
|
|
18
|
+
"post-language-menu-item",
|
|
19
19
|
"post-linkarea",
|
|
20
|
-
"post-list",
|
|
21
|
-
"post-list-item",
|
|
22
20
|
"post-logo",
|
|
23
21
|
"post-mainnavigation",
|
|
24
22
|
"post-megadropdown",
|
|
@@ -26,13 +24,14 @@
|
|
|
26
24
|
"post-menu",
|
|
27
25
|
"post-menu-item",
|
|
28
26
|
"post-menu-trigger",
|
|
27
|
+
"post-pagination",
|
|
29
28
|
"post-popover",
|
|
30
29
|
"post-popover-trigger",
|
|
31
30
|
"post-popovercontainer",
|
|
32
31
|
"post-rating",
|
|
33
32
|
"post-stepper",
|
|
34
33
|
"post-stepper-item",
|
|
35
|
-
"post-tab-
|
|
34
|
+
"post-tab-item",
|
|
36
35
|
"post-tab-panel",
|
|
37
36
|
"post-tabs",
|
|
38
37
|
"post-togglebutton",
|
|
@@ -1,178 +1 @@
|
|
|
1
|
-
const
|
|
2
|
-
const IS_BROWSER = !IS_SERVER;
|
|
3
|
-
|
|
4
|
-
/* eslint-disable no-undefined,no-param-reassign,no-shadow */
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Throttle execution of a function. Especially useful for rate limiting
|
|
8
|
-
* execution of handlers on events like resize and scroll.
|
|
9
|
-
*
|
|
10
|
-
* @param {number} delay - A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher)
|
|
11
|
-
* are most useful.
|
|
12
|
-
* @param {Function} callback - A function to be executed after delay milliseconds. The `this` context and all arguments are passed through,
|
|
13
|
-
* as-is, to `callback` when the throttled-function is executed.
|
|
14
|
-
* @param {object} [options] - An object to configure options.
|
|
15
|
-
* @param {boolean} [options.noTrailing] - Optional, defaults to false. If noTrailing is true, callback will only execute every `delay` milliseconds
|
|
16
|
-
* while the throttled-function is being called. If noTrailing is false or unspecified, callback will be executed
|
|
17
|
-
* one final time after the last throttled-function call. (After the throttled-function has not been called for
|
|
18
|
-
* `delay` milliseconds, the internal counter is reset).
|
|
19
|
-
* @param {boolean} [options.noLeading] - Optional, defaults to false. If noLeading is false, the first throttled-function call will execute callback
|
|
20
|
-
* immediately. If noLeading is true, the first the callback execution will be skipped. It should be noted that
|
|
21
|
-
* callback will never executed if both noLeading = true and noTrailing = true.
|
|
22
|
-
* @param {boolean} [options.debounceMode] - If `debounceMode` is true (at begin), schedule `clear` to execute after `delay` ms. If `debounceMode` is
|
|
23
|
-
* false (at end), schedule `callback` to execute after `delay` ms.
|
|
24
|
-
*
|
|
25
|
-
* @returns {Function} A new, throttled, function.
|
|
26
|
-
*/
|
|
27
|
-
function throttle (delay, callback, options) {
|
|
28
|
-
var _ref = {},
|
|
29
|
-
_ref$noTrailing = _ref.noTrailing,
|
|
30
|
-
noTrailing = _ref$noTrailing === void 0 ? false : _ref$noTrailing,
|
|
31
|
-
_ref$noLeading = _ref.noLeading,
|
|
32
|
-
noLeading = _ref$noLeading === void 0 ? false : _ref$noLeading,
|
|
33
|
-
_ref$debounceMode = _ref.debounceMode,
|
|
34
|
-
debounceMode = _ref$debounceMode === void 0 ? undefined : _ref$debounceMode;
|
|
35
|
-
/*
|
|
36
|
-
* After wrapper has stopped being called, this timeout ensures that
|
|
37
|
-
* `callback` is executed at the proper times in `throttle` and `end`
|
|
38
|
-
* debounce modes.
|
|
39
|
-
*/
|
|
40
|
-
var timeoutID;
|
|
41
|
-
var cancelled = false;
|
|
42
|
-
|
|
43
|
-
// Keep track of the last time `callback` was executed.
|
|
44
|
-
var lastExec = 0;
|
|
45
|
-
|
|
46
|
-
// Function to clear existing timeout
|
|
47
|
-
function clearExistingTimeout() {
|
|
48
|
-
if (timeoutID) {
|
|
49
|
-
clearTimeout(timeoutID);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// Function to cancel next exec
|
|
54
|
-
function cancel(options) {
|
|
55
|
-
var _ref2 = options || {},
|
|
56
|
-
_ref2$upcomingOnly = _ref2.upcomingOnly,
|
|
57
|
-
upcomingOnly = _ref2$upcomingOnly === void 0 ? false : _ref2$upcomingOnly;
|
|
58
|
-
clearExistingTimeout();
|
|
59
|
-
cancelled = !upcomingOnly;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/*
|
|
63
|
-
* The `wrapper` function encapsulates all of the throttling / debouncing
|
|
64
|
-
* functionality and when executed will limit the rate at which `callback`
|
|
65
|
-
* is executed.
|
|
66
|
-
*/
|
|
67
|
-
function wrapper() {
|
|
68
|
-
for (var _len = arguments.length, arguments_ = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
69
|
-
arguments_[_key] = arguments[_key];
|
|
70
|
-
}
|
|
71
|
-
var self = this;
|
|
72
|
-
var elapsed = Date.now() - lastExec;
|
|
73
|
-
if (cancelled) {
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// Execute `callback` and update the `lastExec` timestamp.
|
|
78
|
-
function exec() {
|
|
79
|
-
lastExec = Date.now();
|
|
80
|
-
callback.apply(self, arguments_);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/*
|
|
84
|
-
* If `debounceMode` is true (at begin) this is used to clear the flag
|
|
85
|
-
* to allow future `callback` executions.
|
|
86
|
-
*/
|
|
87
|
-
function clear() {
|
|
88
|
-
timeoutID = undefined;
|
|
89
|
-
}
|
|
90
|
-
if (!noLeading && debounceMode && !timeoutID) {
|
|
91
|
-
/*
|
|
92
|
-
* Since `wrapper` is being called for the first time and
|
|
93
|
-
* `debounceMode` is true (at begin), execute `callback`
|
|
94
|
-
* and noLeading != true.
|
|
95
|
-
*/
|
|
96
|
-
exec();
|
|
97
|
-
}
|
|
98
|
-
clearExistingTimeout();
|
|
99
|
-
if (debounceMode === undefined && elapsed > delay) {
|
|
100
|
-
if (noLeading) {
|
|
101
|
-
/*
|
|
102
|
-
* In throttle mode with noLeading, if `delay` time has
|
|
103
|
-
* been exceeded, update `lastExec` and schedule `callback`
|
|
104
|
-
* to execute after `delay` ms.
|
|
105
|
-
*/
|
|
106
|
-
lastExec = Date.now();
|
|
107
|
-
if (!noTrailing) {
|
|
108
|
-
timeoutID = setTimeout(debounceMode ? clear : exec, delay);
|
|
109
|
-
}
|
|
110
|
-
} else {
|
|
111
|
-
/*
|
|
112
|
-
* In throttle mode without noLeading, if `delay` time has been exceeded, execute
|
|
113
|
-
* `callback`.
|
|
114
|
-
*/
|
|
115
|
-
exec();
|
|
116
|
-
}
|
|
117
|
-
} else if (noTrailing !== true) {
|
|
118
|
-
/*
|
|
119
|
-
* In trailing throttle mode, since `delay` time has not been
|
|
120
|
-
* exceeded, schedule `callback` to execute `delay` ms after most
|
|
121
|
-
* recent execution.
|
|
122
|
-
*
|
|
123
|
-
* If `debounceMode` is true (at begin), schedule `clear` to execute
|
|
124
|
-
* after `delay` ms.
|
|
125
|
-
*
|
|
126
|
-
* If `debounceMode` is false (at end), schedule `callback` to
|
|
127
|
-
* execute after `delay` ms.
|
|
128
|
-
*/
|
|
129
|
-
timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
wrapper.cancel = cancel;
|
|
133
|
-
|
|
134
|
-
// Return the wrapper function.
|
|
135
|
-
return wrapper;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
class Breakpoint {
|
|
139
|
-
constructor() {
|
|
140
|
-
this.breakpoints = [
|
|
141
|
-
{ key: 'xl', device: 'desktop', minWidth: 1280 },
|
|
142
|
-
{ key: 'lg', device: 'desktop', minWidth: 1024 },
|
|
143
|
-
{ key: 'md', device: 'tablet', minWidth: 780 },
|
|
144
|
-
{ key: 'sm', device: 'tablet', minWidth: 600 },
|
|
145
|
-
{ key: 'xs', device: 'mobile', minWidth: 0 },
|
|
146
|
-
];
|
|
147
|
-
this.updateCurrentBreakpoint = throttle(50, (options = { emitEvents: true }) => {
|
|
148
|
-
const previousBreakpoint = this.currentBreakpoint;
|
|
149
|
-
const newBreakpoint = this.breakpoints.find(breakpoint => {
|
|
150
|
-
return breakpoint.minWidth <= innerWidth;
|
|
151
|
-
});
|
|
152
|
-
if (!newBreakpoint)
|
|
153
|
-
return;
|
|
154
|
-
this.currentBreakpoint = newBreakpoint;
|
|
155
|
-
if (!options.emitEvents)
|
|
156
|
-
return;
|
|
157
|
-
Object.keys(this.currentBreakpoint)
|
|
158
|
-
.filter(key => !previousBreakpoint || this.currentBreakpoint[key] !== previousBreakpoint[key])
|
|
159
|
-
.forEach((key) => this.dispatchEvent(key));
|
|
160
|
-
});
|
|
161
|
-
if (IS_SERVER)
|
|
162
|
-
return;
|
|
163
|
-
this.updateCurrentBreakpoint({ emitEvents: false });
|
|
164
|
-
window.addEventListener('resize', () => this.updateCurrentBreakpoint(), { passive: true });
|
|
165
|
-
}
|
|
166
|
-
dispatchEvent(property) {
|
|
167
|
-
if (IS_SERVER)
|
|
168
|
-
return;
|
|
169
|
-
window.dispatchEvent(new CustomEvent(`postBreakpoint:${property}`, { detail: this.currentBreakpoint[property] }));
|
|
170
|
-
}
|
|
171
|
-
get(property) {
|
|
172
|
-
this.updateCurrentBreakpoint({ emitEvents: false });
|
|
173
|
-
return this.currentBreakpoint[property];
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
const breakpoint = new Breakpoint();
|
|
177
|
-
|
|
178
|
-
export { IS_BROWSER as I, breakpoint as b, throttle as t };
|
|
1
|
+
import{a as t}from"./environment.js";const o=[void 0,null,"",NaN];function e(t){return o.some((o=>o===t))}function n(t){return(o,n,...i)=>{const s=o.host.localName,c=o[n],r=`The prop \`${String(n)}\` of the \`${s}\` component is not defined.`;if(e(c))throw new Error(r);t(o,n,...i)}}function i(t,o,e){const n=t.host.localName,i=t[o],s=`The prop \`${String(o)}\` of the \`${n}\` component must be one of the following values: ${e.join(", ")}.`;e.includes(i)||console.error(s)}function s(t,o,e){const n=t.host.localName,i=t[o],s=`The prop \`${String(o)}\` of the \`${n}\` component must follow the format \`${e}\`.`;"string"==typeof i&&e.test(i)||console.error(s)}function c(t,o,e){const n=t.host.localName,i=t[o],s="array"===e,c=Array.isArray(i),r=`The prop \`${String(o)}\` of the \`${n}\` component must be of type \`${e}\`.`;s||c?c!==s&&console.error(r):typeof i!==e&&console.error(r)}function r(t,o){const e=t.host.localName,n=t[o],i=`The prop \`${String(o)}\` of the \`${e}\` component is invalid.`;if("string"==typeof n||n instanceof URL)try{new URL(n,"https://www.post.ch")}catch{console.error(i)}else console.error(i)}function a(t){return(o,n,...i)=>{e(o[n])||t(o,n,...i)}}const h=a(i),f=a(s),d=a(c),p=a(r),u=n(i),m=n(s),v=n(c),l=n(r);function w(t,o){var e,n={},i=n.noTrailing,s=void 0!==i&&i,c=n.noLeading,r=void 0!==c&&c,a=n.debounceMode,h=void 0===a?void 0:a,f=!1,d=0;function p(){e&&clearTimeout(e)}function u(){for(var n=arguments.length,i=new Array(n),c=0;c<n;c++)i[c]=arguments[c];var a=this,u=Date.now()-d;function m(){d=Date.now(),o.apply(a,i)}function v(){e=void 0}f||(r||!h||e||m(),p(),void 0===h&&u>t?r?(d=Date.now(),s||(e=setTimeout(h?v:m,t))):m():!0!==s&&(e=setTimeout(h?v:m,void 0===h?t-u:t)))}return u.cancel=function(t){var o=(t||{}).upcomingOnly,e=void 0!==o&&o;p(),f=!e},u}const $=new class{constructor(){this.breakpoints=[{key:"xl",device:"desktop",minWidth:1280},{key:"lg",device:"desktop",minWidth:1024},{key:"md",device:"tablet",minWidth:780},{key:"sm",device:"tablet",minWidth:600},{key:"xs",device:"mobile",minWidth:0}],this.updateCurrentBreakpoint=w(50,((t={emitEvents:!0})=>{const o=this.currentBreakpoint,e=this.breakpoints.find((t=>t.minWidth<=innerWidth));e&&(this.currentBreakpoint=e,t.emitEvents&&Object.keys(this.currentBreakpoint).filter((t=>!o||this.currentBreakpoint[t]!==o[t])).forEach((t=>this.dispatchEvent(t))))})),t||(this.updateCurrentBreakpoint({emitEvents:!1}),window.addEventListener("resize",(()=>this.updateCurrentBreakpoint()),{passive:!0}))}dispatchEvent(o){t||window.dispatchEvent(new CustomEvent(`postBreakpoint:${o}`,{detail:this.currentBreakpoint[o]}))}get(t){return this.updateCurrentBreakpoint({emitEvents:!1}),this.currentBreakpoint[t]}};export{p as a,u as b,v as c,h as d,d as e,l as f,$ as g,m as h,f as i,w as t}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t=200){let o;return(...r)=>{o&&clearTimeout(o),o=setTimeout(e,t,...r)}}export{e as d}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o="undefined"!=typeof global,n="undefined"!=typeof window,d=n&&"MockNavigator"===window.navigator.userAgent,e=n&&"http://mockdoc.stenciljs.com"===window.location.origin,t=o&&d&&global.IS_HYDRATEAPP_SERVERTEST,a=n&&!(o&&d&&e||t),i=!a;export{a as I,i as a}
|
|
@@ -1,119 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Validates if an event should be processed based on target and nesting criteria
|
|
3
|
-
* @param event - The event to validate
|
|
4
|
-
* @param tag - The expected local name of the event target
|
|
5
|
-
* @param host - The host element for nested component checking
|
|
6
|
-
* @param ignoreNestedComponents - Whether to ignore events from nested components
|
|
7
|
-
* @returns true if the event should be processed, false otherwise
|
|
8
|
-
*/
|
|
9
|
-
function shouldProcessEvent(event, tag, host, ignoreNestedComponents, allowDescendants = false) {
|
|
10
|
-
if (!(event instanceof Event && event.target instanceof HTMLElement))
|
|
11
|
-
return false;
|
|
12
|
-
const eventTarget = event.target;
|
|
13
|
-
if (allowDescendants) {
|
|
14
|
-
// Accept event if target or any ancestor matches tag
|
|
15
|
-
if (!eventTarget.closest(tag))
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
// Only accept event if target exactly matches tag
|
|
20
|
-
if (eventTarget.localName !== tag)
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
if (ignoreNestedComponents) {
|
|
24
|
-
// Find the closest parent with the same tag as the host
|
|
25
|
-
const closestParentWithSameTag = findClosestParentWithTag(eventTarget, host.localName);
|
|
26
|
-
if (closestParentWithSameTag !== host)
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
return true;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Decorator that guards event handlers to only execute when the event meets certain criteria.
|
|
33
|
-
* @param tag - The local name of the element that should be the target of the event
|
|
34
|
-
* @param option - Configuration options for the event guard
|
|
35
|
-
* @param option.ignoreNestedComponents - Whether to ignore events from nested components
|
|
36
|
-
*/
|
|
37
|
-
function EventFrom(tag, option) {
|
|
38
|
-
// Set default values here
|
|
39
|
-
const opts = {
|
|
40
|
-
ignoreNestedComponents: true,
|
|
41
|
-
allowDescendants: false,
|
|
42
|
-
...option,
|
|
43
|
-
};
|
|
44
|
-
return function (target, propertyKey, descriptor) {
|
|
45
|
-
if (descriptor) {
|
|
46
|
-
const originalMethod = descriptor.value;
|
|
47
|
-
descriptor.value = function (event) {
|
|
48
|
-
if (!shouldProcessEvent(event, tag, this.host, opts.ignoreNestedComponents, opts.allowDescendants)) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
return originalMethod.call(this, event);
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
// Creates a hidden storage property for the original method using a
|
|
56
|
-
// modified key format (__[property]_original) to avoid naming conflicts
|
|
57
|
-
const privateKey = `__${propertyKey}_original`;
|
|
58
|
-
// Create hidden storage for original method
|
|
59
|
-
Object.defineProperty(target, privateKey, {
|
|
60
|
-
writable: true,
|
|
61
|
-
configurable: true
|
|
62
|
-
});
|
|
63
|
-
// Replace property with getter/setter
|
|
64
|
-
Object.defineProperty(target, propertyKey, {
|
|
65
|
-
// Getter returns original method
|
|
66
|
-
get() {
|
|
67
|
-
return this[privateKey];
|
|
68
|
-
},
|
|
69
|
-
// Setter wraps original method with extra code
|
|
70
|
-
set(originalFunction) {
|
|
71
|
-
if (typeof originalFunction === 'function') {
|
|
72
|
-
// Store original and add new behavior
|
|
73
|
-
this[privateKey] = (event) => {
|
|
74
|
-
if (!shouldProcessEvent(event, tag, this.host, opts.ignoreNestedComponents)) {
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
return originalFunction.call(this, event);
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
this[privateKey] = originalFunction;
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
configurable: true,
|
|
85
|
-
enumerable: true
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Traverses up the DOM (including crossing shadow DOM boundaries) to find the closest ancestor
|
|
92
|
-
* that matches the specified tag name.
|
|
93
|
-
* @param element - The starting element
|
|
94
|
-
* @param tagName - The tag name to match (e.g., 'post-accordion')
|
|
95
|
-
* @returns The closest matching ancestor or null if none found
|
|
96
|
-
*/
|
|
97
|
-
function findClosestParentWithTag(element, tagName) {
|
|
98
|
-
let current = element;
|
|
99
|
-
while (current) {
|
|
100
|
-
if (current.localName === tagName) {
|
|
101
|
-
return current;
|
|
102
|
-
}
|
|
103
|
-
// Check regular parent first
|
|
104
|
-
if (current.parentElement) {
|
|
105
|
-
current = current.parentElement;
|
|
106
|
-
}
|
|
107
|
-
// If no parentElement, check if we're in a shadow root
|
|
108
|
-
else if (current.parentNode instanceof ShadowRoot) {
|
|
109
|
-
current = current.parentNode.host;
|
|
110
|
-
}
|
|
111
|
-
// No more parents to check
|
|
112
|
-
else {
|
|
113
|
-
current = null;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
return null;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export { EventFrom as E };
|
|
1
|
+
function n(n,t,e,i,r=!1){if(!(n instanceof Event&&n.target instanceof HTMLElement))return!1;const o=n.target;if(r){if(!o.closest(t))return!1}else if(o.localName!==t)return!1;return!i||function(n,t){let e=n;for(;e;){if(e.localName===t)return e;e=e.parentElement?e.parentElement:e.parentNode instanceof ShadowRoot?e.parentNode.host:null}return null}(o,e.localName)===e}function t(t,e){const i={ignoreNestedComponents:!0,allowDescendants:!1,...e};return function(e,r,o){if(o){const e=o.value;o.value=function(r){if(n(r,t,this.host,i.ignoreNestedComponents,i.allowDescendants))return e.call(this,r)}}else{const o=`__${r}_original`;Object.defineProperty(e,o,{writable:!0,configurable:!0}),Object.defineProperty(e,r,{get(){return this[o]},set(e){this[o]="function"==typeof e?r=>{if(n(r,t,this.host,i.ignoreNestedComponents))return e.call(this,r)}:e},configurable:!0,enumerable:!0})}}}export{t as E}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t}from"./utils.js";const n={duration:500,easing:"ease",fill:"none",translate:-100};function a(a,r,i){if(!a)return;const s=i,{translate:o}=s,e=[{opacity:"0",transform:`translateY(${o}px)`},{opacity:"1",transform:"translateY(0px)"}];return function(a,r,i){const{duration:s,easing:o,fill:e}={...n,...i};return a.animate(r,{duration:s,easing:t(o),fill:e})}(a,"in"===r?e:[...e].reverse(),i)}export{a as f}
|
package/dist/components/fade.js
CHANGED
|
@@ -1,11 +1 @@
|
|
|
1
|
-
const
|
|
2
|
-
const fadedOutKeyframe = { opacity: '0' };
|
|
3
|
-
const fadedInKeyframe = { opacity: '1' };
|
|
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
|
-
}
|
|
10
|
-
|
|
11
|
-
export { fadeIn as a, fadeOut as f };
|
|
1
|
+
import{r as i}from"./utils.js";const n={duration:200,easing:"linear",fill:"forwards"};function r(r,t,o={}){if(!r)return;const a=[{opacity:"0"},{opacity:"1"}];return function(r,t,o={}){const{duration:a,easing:s,fill:f}={...n,...o};return r.animate(t,{duration:a,easing:i(s),fill:f})}(r,"in"===t?a:[...a].reverse(),o)}export{r as f}
|