@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
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
const EMPTY_VALUES = [undefined, null, '', NaN];
|
|
2
|
-
|
|
3
|
-
function isValueEmpty(value) {
|
|
4
|
-
return EMPTY_VALUES.some(v => v === value);
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
function requiredAnd(check) {
|
|
8
|
-
return (component, prop, ...extraArgs) => {
|
|
9
|
-
const componentName = component.host.localName;
|
|
10
|
-
const value = component[prop];
|
|
11
|
-
const message = `The prop \`${String(prop)}\` of the \`${componentName}\` component is not defined.`;
|
|
12
|
-
if (isValueEmpty(value)) {
|
|
13
|
-
throw new Error(message);
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
check(component, prop, ...extraArgs);
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function checkOneOf(component, prop, possibleValues) {
|
|
22
|
-
const componentName = component.host.localName;
|
|
23
|
-
const value = component[prop];
|
|
24
|
-
const message = `The prop \`${String(prop)}\` of the \`${componentName}\` component must be one of the following values: ${possibleValues.join(', ')}.`;
|
|
25
|
-
if (!possibleValues.includes(value)) {
|
|
26
|
-
console.error(message);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function checkPattern(component, prop, pattern) {
|
|
31
|
-
const componentName = component.host.localName;
|
|
32
|
-
const value = component[prop];
|
|
33
|
-
const message = `The prop \`${String(prop)}\` of the \`${componentName}\` component must follow the format \`${pattern}\`.`;
|
|
34
|
-
if (typeof value !== 'string' || !pattern.test(value)) {
|
|
35
|
-
console.error(message);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function checkType(component, prop, type) {
|
|
40
|
-
const componentName = component.host.localName;
|
|
41
|
-
const value = component[prop];
|
|
42
|
-
const typeIsArray = type === 'array';
|
|
43
|
-
const valueIsArray = Array.isArray(value);
|
|
44
|
-
const message = `The prop \`${String(prop)}\` of the \`${componentName}\` component must be of type \`${type}\`.`;
|
|
45
|
-
if (typeIsArray || valueIsArray) {
|
|
46
|
-
if (valueIsArray !== typeIsArray) {
|
|
47
|
-
console.error(message);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
else if (typeof value !== type) {
|
|
51
|
-
console.error(message);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function checkUrl(component, prop) {
|
|
56
|
-
const componentName = component.host.localName;
|
|
57
|
-
const value = component[prop];
|
|
58
|
-
const message = `The prop \`${String(prop)}\` of the \`${componentName}\` component is invalid.`;
|
|
59
|
-
if (typeof value !== 'string' && !(value instanceof URL)) {
|
|
60
|
-
console.error(message);
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
try {
|
|
64
|
-
new URL(value, 'https://www.post.ch');
|
|
65
|
-
}
|
|
66
|
-
catch {
|
|
67
|
-
console.error(message);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
function emptyOr(check) {
|
|
72
|
-
return (component, prop, ...extraArgs) => {
|
|
73
|
-
const value = component[prop];
|
|
74
|
-
if (!isValueEmpty(value)) {
|
|
75
|
-
check(component, prop, ...extraArgs);
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
const checkEmptyOrOneOf = emptyOr(checkOneOf);
|
|
81
|
-
const checkEmptyOrPattern = emptyOr(checkPattern);
|
|
82
|
-
const checkEmptyOrType = emptyOr(checkType);
|
|
83
|
-
const checkEmptyOrUrl = emptyOr(checkUrl);
|
|
84
|
-
const checkRequiredAndOneOf = requiredAnd(checkOneOf);
|
|
85
|
-
const checkRequiredAndPattern = requiredAnd(checkPattern);
|
|
86
|
-
const checkRequiredAndType = requiredAnd(checkType);
|
|
87
|
-
const checkRequiredAndUrl = requiredAnd(checkUrl);
|
|
88
|
-
|
|
89
|
-
export { checkEmptyOrUrl as a, checkRequiredAndOneOf as b, checkRequiredAndType as c, checkEmptyOrOneOf as d, checkEmptyOrType as e, checkRequiredAndPattern as f, checkEmptyOrPattern as g, checkRequiredAndUrl as h };
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, c as createEvent, h, a as Host } from './index.js';
|
|
2
|
-
import { v as version } from './p-BhxZzOEC.js';
|
|
3
|
-
import { I as IS_BROWSER } from './p-CJ80BZ06.js';
|
|
4
|
-
import { e as checkEmptyOrType } from './p-CYkf_7Y5.js';
|
|
5
|
-
|
|
6
|
-
function isMotionReduced() {
|
|
7
|
-
return IS_BROWSER ? window.matchMedia('(prefers-reduced-motion: reduce)').matches : false;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const collapseDuration = 350;
|
|
11
|
-
const collapseEasing = 'ease';
|
|
12
|
-
const collapsedKeyframe = { height: '0', overflow: 'hidden' };
|
|
13
|
-
const animationOptions = {
|
|
14
|
-
duration: collapseDuration,
|
|
15
|
-
easing: collapseEasing,
|
|
16
|
-
fill: 'forwards',
|
|
17
|
-
};
|
|
18
|
-
function collapse(el) {
|
|
19
|
-
const elHeight = IS_BROWSER ? window.getComputedStyle(el).height : `${el.scrollHeight}px`;
|
|
20
|
-
const expandedKeyframe = { height: elHeight };
|
|
21
|
-
return el.animate([expandedKeyframe, collapsedKeyframe], animationOptions);
|
|
22
|
-
}
|
|
23
|
-
function expand(el) {
|
|
24
|
-
const expandedKeyframe = { height: `${el.scrollHeight}px`, offset: 1 };
|
|
25
|
-
const finalKeyframe = { height: 'auto', overflow: 'visible' };
|
|
26
|
-
return el.animate([collapsedKeyframe, expandedKeyframe, finalKeyframe], animationOptions);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const postCollapsibleCss = ":host{display:block;position:relative;overflow:hidden}";
|
|
30
|
-
|
|
31
|
-
const PostCollapsible = /*@__PURE__*/ proxyCustomElement(class PostCollapsible extends H {
|
|
32
|
-
constructor() {
|
|
33
|
-
super();
|
|
34
|
-
this.__registerHost();
|
|
35
|
-
this.__attachShadow();
|
|
36
|
-
this.postToggle = createEvent(this, "postToggle");
|
|
37
|
-
this.isLoaded = false;
|
|
38
|
-
this.isOpen = true;
|
|
39
|
-
/**
|
|
40
|
-
* If `true`, the element is collapsed otherwise it is displayed.
|
|
41
|
-
*/
|
|
42
|
-
this.collapsed = false;
|
|
43
|
-
}
|
|
44
|
-
collapsedChange() {
|
|
45
|
-
checkEmptyOrType(this, 'collapsed', 'boolean');
|
|
46
|
-
void this.toggle(!this.collapsed);
|
|
47
|
-
}
|
|
48
|
-
componentDidLoad() {
|
|
49
|
-
this.collapsedChange();
|
|
50
|
-
this.isLoaded = true;
|
|
51
|
-
this.updateTriggers();
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Triggers the collapse programmatically.
|
|
55
|
-
*
|
|
56
|
-
* If there is a collapsing transition running already, it will be reversed.
|
|
57
|
-
*/
|
|
58
|
-
async toggle(open = !this.isOpen) {
|
|
59
|
-
if (open === this.isOpen)
|
|
60
|
-
return open;
|
|
61
|
-
this.isOpen = open;
|
|
62
|
-
this.collapsed = !open;
|
|
63
|
-
if (this.isLoaded)
|
|
64
|
-
this.postToggle.emit(open);
|
|
65
|
-
const animation = open ? expand(this.host) : collapse(this.host);
|
|
66
|
-
if (!this.isLoaded || isMotionReduced())
|
|
67
|
-
animation.finish();
|
|
68
|
-
await animation.finished;
|
|
69
|
-
const isHostRendered = this.host.offsetParent;
|
|
70
|
-
if (isHostRendered)
|
|
71
|
-
animation.commitStyles();
|
|
72
|
-
this.updateTriggers();
|
|
73
|
-
return open;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Update all post-collapsible-trigger elements referring to the collapsible
|
|
77
|
-
*/
|
|
78
|
-
updateTriggers() {
|
|
79
|
-
const triggers = document.querySelectorAll(`post-collapsible-trigger[for="${this.host.id}"]`);
|
|
80
|
-
triggers.forEach(trigger => trigger.update());
|
|
81
|
-
}
|
|
82
|
-
render() {
|
|
83
|
-
return (h(Host, { key: '3a11f1a60c536544881def998bcdf81f6d248837', "data-version": version, tabindex: this.collapsed ? -1 : undefined }, h("slot", { key: '6ea66375cdffefd02c8293aa1542c4cbfce905a4' })));
|
|
84
|
-
}
|
|
85
|
-
get host() { return this; }
|
|
86
|
-
static get watchers() { return {
|
|
87
|
-
"collapsed": ["collapsedChange"]
|
|
88
|
-
}; }
|
|
89
|
-
static get style() { return postCollapsibleCss; }
|
|
90
|
-
}, [1, "post-collapsible", {
|
|
91
|
-
"collapsed": [1028],
|
|
92
|
-
"toggle": [64]
|
|
93
|
-
}, undefined, {
|
|
94
|
-
"collapsed": ["collapsedChange"]
|
|
95
|
-
}]);
|
|
96
|
-
function defineCustomElement() {
|
|
97
|
-
if (typeof customElements === "undefined") {
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
const components = ["post-collapsible"];
|
|
101
|
-
components.forEach(tagName => { switch (tagName) {
|
|
102
|
-
case "post-collapsible":
|
|
103
|
-
if (!customElements.get(tagName)) {
|
|
104
|
-
customElements.define(tagName, PostCollapsible);
|
|
105
|
-
}
|
|
106
|
-
break;
|
|
107
|
-
} });
|
|
108
|
-
}
|
|
109
|
-
defineCustomElement();
|
|
110
|
-
|
|
111
|
-
export { PostCollapsible as P, defineCustomElement as d };
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, h, a as Host } from './index.js';
|
|
2
|
-
import { v as version } from './p-BhxZzOEC.js';
|
|
3
|
-
import { H as HEADING_LEVELS } from './p-r4txK0AC.js';
|
|
4
|
-
import { b as checkRequiredAndOneOf } from './p-CYkf_7Y5.js';
|
|
5
|
-
import './p-CJ80BZ06.js';
|
|
6
|
-
import { E as EventFrom } from './p-CzIKqBrS.js';
|
|
7
|
-
|
|
8
|
-
const postAccordionCss = ":host{display:block}::slotted(post-accordion-item){display:block}::slotted(post-accordion-item:not(:only-of-type:first-of-type)){margin-block-start:calc(var(--post-device-border-width-default)*-1)}";
|
|
9
|
-
|
|
10
|
-
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
11
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
12
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
13
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
14
|
-
else
|
|
15
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
16
|
-
if (d = decorators[i])
|
|
17
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
18
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
19
|
-
};
|
|
20
|
-
const PostAccordion = /*@__PURE__*/ proxyCustomElement(class PostAccordion extends H {
|
|
21
|
-
constructor() {
|
|
22
|
-
super();
|
|
23
|
-
this.__registerHost();
|
|
24
|
-
this.__attachShadow();
|
|
25
|
-
this.expandedItems = new Set();
|
|
26
|
-
/**
|
|
27
|
-
* If `true`, multiple `post-accordion-item` can be open at the same time.
|
|
28
|
-
*/
|
|
29
|
-
this.multiple = false;
|
|
30
|
-
}
|
|
31
|
-
validateHeadingLevel() {
|
|
32
|
-
checkRequiredAndOneOf(this, 'headingLevel', HEADING_LEVELS);
|
|
33
|
-
this.accordionItems.forEach(item => {
|
|
34
|
-
item.setAttribute('heading-level', String(this.headingLevel));
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
componentWillLoad() {
|
|
38
|
-
this.registerAccordionItems();
|
|
39
|
-
}
|
|
40
|
-
componentDidLoad() {
|
|
41
|
-
this.validateHeadingLevel();
|
|
42
|
-
}
|
|
43
|
-
collapseToggleHandler(event) {
|
|
44
|
-
const toggledAccordionItem = event.target;
|
|
45
|
-
const isClosing = this.expandedItems.has(toggledAccordionItem);
|
|
46
|
-
if (isClosing) {
|
|
47
|
-
this.expandedItems.delete(toggledAccordionItem);
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
this.expandedItems.add(toggledAccordionItem);
|
|
51
|
-
}
|
|
52
|
-
if (this.multiple || isClosing)
|
|
53
|
-
return;
|
|
54
|
-
// Close other open accordion items to ensure only one is open at a time
|
|
55
|
-
Array.from(this.expandedItems.values())
|
|
56
|
-
.filter(item => item !== toggledAccordionItem)
|
|
57
|
-
.forEach(item => {
|
|
58
|
-
item.toggle(false);
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Toggles the `post-accordion-item` with the given id.
|
|
63
|
-
*/
|
|
64
|
-
async toggle(id) {
|
|
65
|
-
const itemToToggle = this.accordionItems.find(item => item.id === id);
|
|
66
|
-
if (!itemToToggle)
|
|
67
|
-
throw new Error(`No post-accordion-item found with id #${id}.`);
|
|
68
|
-
await itemToToggle.toggle();
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Expands all `post-accordion-item`.
|
|
72
|
-
*
|
|
73
|
-
* If `multiple="true"` is not set and all items are closed, it will open the first one.
|
|
74
|
-
* Otherwise, it will keep the opened one.
|
|
75
|
-
*/
|
|
76
|
-
async expandAll() {
|
|
77
|
-
if (this.multiple) {
|
|
78
|
-
await Promise.all(this.accordionItems.map(item => item.toggle(true)));
|
|
79
|
-
}
|
|
80
|
-
else if (!this.expandedItems.size) {
|
|
81
|
-
await this.accordionItems[0].toggle(true);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Collapses all `post-accordion-item`.
|
|
86
|
-
*/
|
|
87
|
-
async collapseAll() {
|
|
88
|
-
await Promise.all(this.accordionItems.map(item => item.toggle(false)));
|
|
89
|
-
}
|
|
90
|
-
registerAccordionItems() {
|
|
91
|
-
this.accordionItems = Array.from(this.host.querySelectorAll('post-accordion-item'));
|
|
92
|
-
this.accordionItems
|
|
93
|
-
.filter(item => {
|
|
94
|
-
return !item.collapsed || this.expandedItems.has(item);
|
|
95
|
-
})
|
|
96
|
-
.forEach((item, index) => {
|
|
97
|
-
if (!this.multiple && index !== 0) {
|
|
98
|
-
item.setAttribute('collapsed', '');
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
this.expandedItems.add(item);
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
render() {
|
|
105
|
-
return (h(Host, { key: '470d8a7646796044df8f9cf1ebfc113e5c8db960', "data-version": version }, h("div", { key: '360ad1fe885dbb3c61a5c026ea253e7fba81ef9e', class: "accordion" }, h("slot", { key: '9e14d7906cba560a848986787159f56c961c78db', onSlotchange: () => this.registerAccordionItems() }))));
|
|
106
|
-
}
|
|
107
|
-
get host() { return this; }
|
|
108
|
-
static get watchers() { return {
|
|
109
|
-
"headingLevel": ["validateHeadingLevel"]
|
|
110
|
-
}; }
|
|
111
|
-
static get style() { return postAccordionCss; }
|
|
112
|
-
}, [1, "post-accordion", {
|
|
113
|
-
"headingLevel": [514, "heading-level"],
|
|
114
|
-
"multiple": [4],
|
|
115
|
-
"toggle": [64],
|
|
116
|
-
"expandAll": [64],
|
|
117
|
-
"collapseAll": [64]
|
|
118
|
-
}, [[0, "postToggle", "collapseToggleHandler"]], {
|
|
119
|
-
"headingLevel": ["validateHeadingLevel"]
|
|
120
|
-
}]);
|
|
121
|
-
__decorate([
|
|
122
|
-
EventFrom('post-accordion-item')
|
|
123
|
-
], PostAccordion.prototype, "collapseToggleHandler", null);
|
|
124
|
-
function defineCustomElement() {
|
|
125
|
-
if (typeof customElements === "undefined") {
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
const components = ["post-accordion"];
|
|
129
|
-
components.forEach(tagName => { switch (tagName) {
|
|
130
|
-
case "post-accordion":
|
|
131
|
-
if (!customElements.get(tagName)) {
|
|
132
|
-
customElements.define(tagName, PostAccordion);
|
|
133
|
-
}
|
|
134
|
-
break;
|
|
135
|
-
} });
|
|
136
|
-
}
|
|
137
|
-
defineCustomElement();
|
|
138
|
-
|
|
139
|
-
export { PostAccordion as P, defineCustomElement as d };
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, h, a as Host } from './index.js';
|
|
2
|
-
import { v as version } from './p-BhxZzOEC.js';
|
|
3
|
-
import { c as checkRequiredAndType } from './p-CYkf_7Y5.js';
|
|
4
|
-
import './p-CJ80BZ06.js';
|
|
5
|
-
import { g as getRoot } from './p-CBFgkSgY.js';
|
|
6
|
-
|
|
7
|
-
const postMenuTriggerCss = ":host{display:inline-block}";
|
|
8
|
-
|
|
9
|
-
const PostMenuTrigger = /*@__PURE__*/ proxyCustomElement(class PostMenuTrigger extends H {
|
|
10
|
-
constructor() {
|
|
11
|
-
super();
|
|
12
|
-
this.__registerHost();
|
|
13
|
-
/**
|
|
14
|
-
* Manages the accessibility attribute `aria-expanded` to indicate whether the associated menu is expanded or collapsed.
|
|
15
|
-
*/
|
|
16
|
-
this.ariaExpanded = false;
|
|
17
|
-
/**
|
|
18
|
-
* Reference to the slotted button within the trigger, if present.
|
|
19
|
-
* Used to manage click and key events for menu control.
|
|
20
|
-
*/
|
|
21
|
-
this.slottedButton = null;
|
|
22
|
-
this.handleKeyDown = (e) => {
|
|
23
|
-
if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {
|
|
24
|
-
e.preventDefault();
|
|
25
|
-
this.handleToggle();
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Watch for changes to the `for` property to validate its type and ensure it is a string.
|
|
31
|
-
* @param forValue - The new value of the `for` property.
|
|
32
|
-
*/
|
|
33
|
-
validateControlFor() {
|
|
34
|
-
checkRequiredAndType(this, 'for', 'string');
|
|
35
|
-
}
|
|
36
|
-
get menu() {
|
|
37
|
-
const ref = this.root.getElementById(this.for);
|
|
38
|
-
return ref && ref.localName === 'post-menu' ? ref : null;
|
|
39
|
-
}
|
|
40
|
-
handleToggle() {
|
|
41
|
-
if (this.menu) {
|
|
42
|
-
this.menu.toggle(this.host);
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
console.warn(`No post-menu found with ID: ${this.for}`);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
connectedCallback() {
|
|
49
|
-
this.root = getRoot(this.host);
|
|
50
|
-
}
|
|
51
|
-
componentDidLoad() {
|
|
52
|
-
this.validateControlFor();
|
|
53
|
-
this.slottedButton = this.host.querySelector('button');
|
|
54
|
-
// Check if the slottedButton is within a web component
|
|
55
|
-
if (!this.slottedButton) {
|
|
56
|
-
const webComponent = this.host.querySelector('.menu-trigger-webc');
|
|
57
|
-
if (webComponent?.shadowRoot) {
|
|
58
|
-
const slottedButton = webComponent.shadowRoot.querySelector('button');
|
|
59
|
-
if (slottedButton) {
|
|
60
|
-
this.slottedButton = slottedButton;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
if (this.slottedButton) {
|
|
65
|
-
this.slottedButton.setAttribute('aria-haspopup', 'menu');
|
|
66
|
-
// Listen to the `toggleMenu` event emitted by the `post-menu` component
|
|
67
|
-
if (this.menu && this.slottedButton) {
|
|
68
|
-
this.menu.addEventListener('toggleMenu', (event) => {
|
|
69
|
-
this.ariaExpanded = event.detail;
|
|
70
|
-
this.slottedButton.setAttribute('aria-expanded', this.ariaExpanded.toString());
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
this.slottedButton.addEventListener('click', () => {
|
|
74
|
-
this.handleToggle();
|
|
75
|
-
});
|
|
76
|
-
this.slottedButton.addEventListener('keydown', this.handleKeyDown);
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
console.warn('No button found within post-menu-trigger');
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
render() {
|
|
83
|
-
return (h(Host, { key: '14592f9564fdb09b2e809374d5794bf71f576dbb', "data-version": version, "tab-index": "-1" }, h("slot", { key: 'a0f463000420df39035cc5a48369d230394b5e04' })));
|
|
84
|
-
}
|
|
85
|
-
get host() { return this; }
|
|
86
|
-
static get watchers() { return {
|
|
87
|
-
"for": ["validateControlFor"]
|
|
88
|
-
}; }
|
|
89
|
-
static get style() { return postMenuTriggerCss; }
|
|
90
|
-
}, [4, "post-menu-trigger", {
|
|
91
|
-
"for": [513],
|
|
92
|
-
"ariaExpanded": [32]
|
|
93
|
-
}, undefined, {
|
|
94
|
-
"for": ["validateControlFor"]
|
|
95
|
-
}]);
|
|
96
|
-
function defineCustomElement() {
|
|
97
|
-
if (typeof customElements === "undefined") {
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
const components = ["post-menu-trigger"];
|
|
101
|
-
components.forEach(tagName => { switch (tagName) {
|
|
102
|
-
case "post-menu-trigger":
|
|
103
|
-
if (!customElements.get(tagName)) {
|
|
104
|
-
customElements.define(tagName, PostMenuTrigger);
|
|
105
|
-
}
|
|
106
|
-
break;
|
|
107
|
-
} });
|
|
108
|
-
}
|
|
109
|
-
defineCustomElement();
|
|
110
|
-
|
|
111
|
-
export { PostMenuTrigger as P, defineCustomElement as d };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, h, a as Host } from './index.js';
|
|
2
|
-
import { v as version } from './p-BhxZzOEC.js';
|
|
3
|
-
|
|
4
|
-
const postMenuItemCss = "post-menu-item button{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-menu-item button{background-color:ButtonFace !important}post-menu-item button:hover{background-color:Highlight !important}}post-menu-item a{text-decoration:none}post-menu-item button,post-menu-item a{position:relative;display:flex;width:100%;align-items:center;padding:.5rem .75rem .5rem 1rem;gap:.75rem;font-size:.875rem;color:#050400;border-radius:0}post-menu-item button post-icon,post-menu-item a post-icon{width:1rem;height:1rem;margin-block:.25rem}@media screen and (min-width: 780px){post-menu-item button,post-menu-item a{font-size:1rem;padding-block:.75rem;gap:1rem}post-menu-item button post-icon,post-menu-item a post-icon{width:1.5rem;height:1.5rem;margin:0}}@media screen and (min-width: 1024px){post-menu-item button,post-menu-item a{font-size:1.25rem;padding-block:.8125rem}}post-menu-item button:focus-visible,post-menu-item a:focus-visible{outline-offset:2px !important;border-radius:4px}post-menu-item button:hover,post-menu-item a:hover{background-color:#504f4b;color:#fff}";
|
|
5
|
-
|
|
6
|
-
const PostMenuItem = /*@__PURE__*/ proxyCustomElement(class PostMenuItem extends H {
|
|
7
|
-
constructor() {
|
|
8
|
-
super();
|
|
9
|
-
this.__registerHost();
|
|
10
|
-
}
|
|
11
|
-
render() {
|
|
12
|
-
return (h(Host, { key: '9d6015291b82728739de4263a62a59ad4a99c94d', "data-version": version }, h("slot", { key: '51f5ff356cddffc806639cc343437500f898065e' })));
|
|
13
|
-
}
|
|
14
|
-
static get style() { return postMenuItemCss; }
|
|
15
|
-
}, [4, "post-menu-item"]);
|
|
16
|
-
function defineCustomElement() {
|
|
17
|
-
if (typeof customElements === "undefined") {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
const components = ["post-menu-item"];
|
|
21
|
-
components.forEach(tagName => { switch (tagName) {
|
|
22
|
-
case "post-menu-item":
|
|
23
|
-
if (!customElements.get(tagName)) {
|
|
24
|
-
customElements.define(tagName, PostMenuItem);
|
|
25
|
-
}
|
|
26
|
-
break;
|
|
27
|
-
} });
|
|
28
|
-
}
|
|
29
|
-
defineCustomElement();
|
|
30
|
-
|
|
31
|
-
export { PostMenuItem as P, defineCustomElement as d };
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, h, a as Host } from './index.js';
|
|
2
|
-
import { I as IS_BROWSER } from './p-CJ80BZ06.js';
|
|
3
|
-
import { d as checkEmptyOrOneOf, e as checkEmptyOrType, c as checkRequiredAndType } from './p-CYkf_7Y5.js';
|
|
4
|
-
import { v as version } from './p-BhxZzOEC.js';
|
|
5
|
-
|
|
6
|
-
const postIconCss = ":host{display:inline-block;width:1em;height:1em;vertical-align:-0.15em}span{display:block;width:100%;height:100%;fill:currentColor;forced-color-adjust:preserve-parent-color;background-color:currentColor;-webkit-mask-position:center center;mask-position:center center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100%;mask-size:100%}:host([flip-h]:not([flip-h=false])){scale:-1 1}:host([flip-v]:not([flip-v=false])){scale:1 -1}:host([flip-h][flip-v]:not([flip-h=false],[flip-v=false])){scale:-1}:host([animation]){transform-origin:center}:host([animation=cylon]){animation:icon-animation-cylon .75s ease-in-out infinite alternate}:host([animation=cylon-vertical]){animation:icon-animation-cylon-vertical .75s ease-in-out infinite alternate}:host([animation=spin]){animation:icon-animation-spin 2s linear infinite normal}:host([animation=spin-reverse]){animation:icon-animation-spin 2s linear infinite reverse}:host([animation=fade]){animation:icon-animation-fade .75s ease-in-out infinite alternate}:host([animation=throb]){animation:icon-animation-throb .75s ease-in-out infinite alternate}@keyframes icon-animation-cylon{from{transform:translateX(-25%)}to{transform:translateX(25%)}}@keyframes icon-animation-cylon-vertical{from{transform:translateY(25%)}to{transform:translateY(-25%)}}@keyframes icon-animation-fade{from{opacity:.1}to{opacity:1}}@keyframes icon-animation-spin{from{transform:rotate(0deg)}to{transform:rotate(359deg)}}@keyframes icon-animation-throb{from{opacity:.5;transform:scale(0.5)}to{opacity:1;transform:scale(1)}}";
|
|
7
|
-
|
|
8
|
-
const CDN_URL = `https://unpkg.com/@swisspost/design-system-icons@${version}/public/post-icons/`;
|
|
9
|
-
const ANIMATION_NAMES = [
|
|
10
|
-
'cylon',
|
|
11
|
-
'cylon-vertical',
|
|
12
|
-
'spin',
|
|
13
|
-
'spin-reverse',
|
|
14
|
-
'fade',
|
|
15
|
-
'throb',
|
|
16
|
-
];
|
|
17
|
-
const ANIMATION_KEYS = [...ANIMATION_NAMES];
|
|
18
|
-
const PostIcon = /*@__PURE__*/ proxyCustomElement(class PostIcon extends H {
|
|
19
|
-
constructor() {
|
|
20
|
-
super();
|
|
21
|
-
this.__registerHost();
|
|
22
|
-
this.__attachShadow();
|
|
23
|
-
/**
|
|
24
|
-
* When set to `true`, the icon will be flipped horizontally.
|
|
25
|
-
*/
|
|
26
|
-
this.flipH = false;
|
|
27
|
-
/**
|
|
28
|
-
* When set to `true`, the icon will be flipped vertically.
|
|
29
|
-
*/
|
|
30
|
-
this.flipV = false;
|
|
31
|
-
}
|
|
32
|
-
validateAnimation() {
|
|
33
|
-
checkEmptyOrOneOf(this, 'animation', ANIMATION_KEYS);
|
|
34
|
-
}
|
|
35
|
-
validateBase() {
|
|
36
|
-
checkEmptyOrType(this, 'base', 'string');
|
|
37
|
-
}
|
|
38
|
-
validateName() {
|
|
39
|
-
checkRequiredAndType(this, 'name', 'string');
|
|
40
|
-
}
|
|
41
|
-
validateRotate() {
|
|
42
|
-
checkEmptyOrType(this, 'rotate', 'number');
|
|
43
|
-
}
|
|
44
|
-
validateScale() {
|
|
45
|
-
checkEmptyOrType(this, 'scale', 'number');
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Construct the icon URL according to the following rules:
|
|
49
|
-
* 1. `@base` (absolute URL) → use directly.
|
|
50
|
-
* 2. `@base` (relative URL) → resolve with `base href` and/or `origin`
|
|
51
|
-
* - If `base href` is absolute → use just that.
|
|
52
|
-
* - If `base href` is relative → prepend with `origin`.
|
|
53
|
-
* - If `base href` does not exist → use only `origin`.
|
|
54
|
-
* 3. `@meta` (absolute URL) → use directly.
|
|
55
|
-
* 4. `@meta` (relative URL) → resolve with `base href` and/or `origin`. (same as above)
|
|
56
|
-
* 5. `CDN_URL` fallback → `https://unpkg.com/...`.
|
|
57
|
-
**/
|
|
58
|
-
getUrl() {
|
|
59
|
-
const fileName = `${this.name}.svg`;
|
|
60
|
-
if (!IS_BROWSER && !this.base) {
|
|
61
|
-
return `${CDN_URL}${fileName}`;
|
|
62
|
-
}
|
|
63
|
-
const isAbsolute = (url) => /^https?:\/\//.test(url);
|
|
64
|
-
const normalizeUrl = (url) => (url && !url.endsWith('/') ? `${url}/` : url);
|
|
65
|
-
const cleanUrl = (url) => url.replace(/([^:])\/\//g, '$1/');
|
|
66
|
-
const currentDomain = IS_BROWSER ? window.location.origin : '';
|
|
67
|
-
const baseHref = IS_BROWSER
|
|
68
|
-
? document.querySelector('base[href]')?.getAttribute('href') || ''
|
|
69
|
-
: '';
|
|
70
|
-
const metaIconBase = IS_BROWSER
|
|
71
|
-
? document.querySelector('meta[name="design-system-settings"]')?.getAttribute('data-post-icon-base') || ''
|
|
72
|
-
: '';
|
|
73
|
-
// Function to build the first part of the URL when 'this.base' or 'metaIconBase' are relative
|
|
74
|
-
const buildUrlWithBase = (relativeUrl) => {
|
|
75
|
-
const normalizedHref = normalizeUrl(baseHref);
|
|
76
|
-
const normalizedRelative = normalizeUrl(relativeUrl);
|
|
77
|
-
if (isAbsolute(normalizedHref)) {
|
|
78
|
-
return `${normalizedHref}${normalizedRelative}`;
|
|
79
|
-
}
|
|
80
|
-
return `${currentDomain}${normalizedHref}${normalizedRelative}`;
|
|
81
|
-
};
|
|
82
|
-
let url;
|
|
83
|
-
// Highest Priority is this.base
|
|
84
|
-
if (this.base) {
|
|
85
|
-
url = isAbsolute(this.base)
|
|
86
|
-
? `${normalizeUrl(this.base)}${fileName}`
|
|
87
|
-
: `${buildUrlWithBase(this.base)}${fileName}`;
|
|
88
|
-
return cleanUrl(url);
|
|
89
|
-
}
|
|
90
|
-
// Second Priority is metaIconBase
|
|
91
|
-
if (metaIconBase) {
|
|
92
|
-
url = isAbsolute(metaIconBase)
|
|
93
|
-
? `${normalizeUrl(metaIconBase)}${fileName}`
|
|
94
|
-
: `${buildUrlWithBase(metaIconBase)}${fileName}`;
|
|
95
|
-
return cleanUrl(url);
|
|
96
|
-
}
|
|
97
|
-
// Fallback to CDN
|
|
98
|
-
return cleanUrl(`${CDN_URL}${fileName}`);
|
|
99
|
-
}
|
|
100
|
-
getStyles() {
|
|
101
|
-
const url = this.getUrl();
|
|
102
|
-
return Object.entries({
|
|
103
|
-
'-webkit-mask-image': `url(${url})`,
|
|
104
|
-
'mask-image': `url('${url}')`,
|
|
105
|
-
'transform': (this.scale && !isNaN(Number(this.scale)) ? 'scale(' + this.scale + ')' : '') +
|
|
106
|
-
(this.rotate && !isNaN(Number(this.rotate)) ? ' rotate(' + this.rotate + 'deg)' : ''),
|
|
107
|
-
})
|
|
108
|
-
.filter(([_key, value]) => value !== null)
|
|
109
|
-
.reduce((styles, [key, value]) => Object.assign(styles, { [key]: value }), {});
|
|
110
|
-
}
|
|
111
|
-
componentDidLoad() {
|
|
112
|
-
this.validateBase();
|
|
113
|
-
this.validateName();
|
|
114
|
-
this.validateScale();
|
|
115
|
-
this.validateRotate();
|
|
116
|
-
this.validateAnimation();
|
|
117
|
-
}
|
|
118
|
-
render() {
|
|
119
|
-
return (h(Host, { key: '7ce1f627f621201c0f4d6e90ee3d8d6d3c32798a', "data-version": version }, h("span", { key: '987ecd266b8bd68bdbb06cdb500a746b913e79b1', style: this.getStyles() })));
|
|
120
|
-
}
|
|
121
|
-
get host() { return this; }
|
|
122
|
-
static get watchers() { return {
|
|
123
|
-
"animation": ["validateAnimation"],
|
|
124
|
-
"base": ["validateBase"],
|
|
125
|
-
"name": ["validateName"],
|
|
126
|
-
"rotate": ["validateRotate"],
|
|
127
|
-
"scale": ["validateScale"]
|
|
128
|
-
}; }
|
|
129
|
-
static get style() { return postIconCss; }
|
|
130
|
-
}, [1, "post-icon", {
|
|
131
|
-
"animation": [1],
|
|
132
|
-
"base": [1],
|
|
133
|
-
"flipH": [4, "flip-h"],
|
|
134
|
-
"flipV": [4, "flip-v"],
|
|
135
|
-
"name": [513],
|
|
136
|
-
"rotate": [2],
|
|
137
|
-
"scale": [2]
|
|
138
|
-
}, undefined, {
|
|
139
|
-
"animation": ["validateAnimation"],
|
|
140
|
-
"base": ["validateBase"],
|
|
141
|
-
"name": ["validateName"],
|
|
142
|
-
"rotate": ["validateRotate"],
|
|
143
|
-
"scale": ["validateScale"]
|
|
144
|
-
}]);
|
|
145
|
-
function defineCustomElement() {
|
|
146
|
-
if (typeof customElements === "undefined") {
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
const components = ["post-icon"];
|
|
150
|
-
components.forEach(tagName => { switch (tagName) {
|
|
151
|
-
case "post-icon":
|
|
152
|
-
if (!customElements.get(tagName)) {
|
|
153
|
-
customElements.define(tagName, PostIcon);
|
|
154
|
-
}
|
|
155
|
-
break;
|
|
156
|
-
} });
|
|
157
|
-
}
|
|
158
|
-
defineCustomElement();
|
|
159
|
-
|
|
160
|
-
export { PostIcon as P, defineCustomElement as d };
|