@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,21 +1,24 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { checkRequiredAndType } from "../../utils/index";
|
|
2
3
|
import { version } from "../../../../package";
|
|
3
4
|
const SCROLL_REPEAT_INTERVAL = 100; // Interval for repeated scrolling when holding down scroll button
|
|
4
5
|
const NAVBAR_DISABLE_DURATION = 400; // Duration to temporarily disable navbar interactions during scrolling
|
|
5
6
|
export class PostMainnavigation {
|
|
7
|
+
validateTextMain() {
|
|
8
|
+
checkRequiredAndType(this, 'textMain', 'string');
|
|
9
|
+
}
|
|
6
10
|
constructor() {
|
|
7
11
|
this.canScrollLeft = false;
|
|
8
12
|
this.canScrollRight = false;
|
|
9
13
|
this.scrollRight = this.scrollRight.bind(this);
|
|
10
14
|
this.scrollLeft = this.scrollLeft.bind(this);
|
|
11
|
-
this.handleMutations = this.handleMutations.bind(this);
|
|
12
15
|
this.checkScrollability = this.checkScrollability.bind(this);
|
|
13
16
|
this.resizeObserver = new ResizeObserver(this.checkScrollability);
|
|
14
|
-
this.mutationObserver = new MutationObserver(this.
|
|
17
|
+
this.mutationObserver = new MutationObserver(this.checkScrollability);
|
|
15
18
|
}
|
|
16
19
|
componentDidLoad() {
|
|
20
|
+
this.validateTextMain();
|
|
17
21
|
setTimeout(() => {
|
|
18
|
-
this.fixLayoutShift();
|
|
19
22
|
this.checkScrollability();
|
|
20
23
|
});
|
|
21
24
|
// Observe the navbar for size changes
|
|
@@ -40,30 +43,8 @@ export class PostMainnavigation {
|
|
|
40
43
|
if (this.scrollRepeatInterval)
|
|
41
44
|
clearInterval(this.scrollRepeatInterval);
|
|
42
45
|
}
|
|
43
|
-
async handleMutations(mutations) {
|
|
44
|
-
const addedNodes = mutations.flatMap((mutation) => {
|
|
45
|
-
return Array.from(mutation.addedNodes);
|
|
46
|
-
});
|
|
47
|
-
// Wait for all elements to be hydrated
|
|
48
|
-
await Promise.all(addedNodes.map((item) => item.componentOnReady ? item.componentOnReady() : Promise.resolve(item)));
|
|
49
|
-
this.fixLayoutShift();
|
|
50
|
-
this.checkScrollability();
|
|
51
|
-
}
|
|
52
46
|
get navigationItems() {
|
|
53
|
-
return Array.from(this.
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Hack to fix the layout shift due to bold text on active elements
|
|
57
|
-
*/
|
|
58
|
-
fixLayoutShift() {
|
|
59
|
-
this.navigationItems
|
|
60
|
-
.filter(item => !item.matches(':has(.nav-el-active)'))
|
|
61
|
-
.forEach(item => {
|
|
62
|
-
item.innerHTML = `
|
|
63
|
-
<span class="nav-el-active">${item.innerHTML}</span>
|
|
64
|
-
<span class="nav-el-inactive" aria-hidden="true">${item.innerHTML}</span>
|
|
65
|
-
`;
|
|
66
|
-
});
|
|
47
|
+
return Array.from(this.host.querySelectorAll('a:not(post-megadropdown *), post-megadropdown-trigger'));
|
|
67
48
|
}
|
|
68
49
|
/**
|
|
69
50
|
* Returns whether scrolling is enabled in either the left or right direction.
|
|
@@ -102,7 +83,7 @@ export class PostMainnavigation {
|
|
|
102
83
|
}, SCROLL_REPEAT_INTERVAL);
|
|
103
84
|
}
|
|
104
85
|
scrollRight() {
|
|
105
|
-
const scrollRightLeftEdge =
|
|
86
|
+
const scrollRightLeftEdge = this.host.shadowRoot
|
|
106
87
|
.querySelector('.scroll-right')
|
|
107
88
|
.getBoundingClientRect().left;
|
|
108
89
|
for (const navigationItem of this.navigationItems) {
|
|
@@ -116,7 +97,7 @@ export class PostMainnavigation {
|
|
|
116
97
|
}
|
|
117
98
|
}
|
|
118
99
|
scrollLeft() {
|
|
119
|
-
const scrollLeftRightEdge =
|
|
100
|
+
const scrollLeftRightEdge = this.host.shadowRoot
|
|
120
101
|
.querySelector('.scroll-left')
|
|
121
102
|
.getBoundingClientRect().right;
|
|
122
103
|
for (const navigationItem of this.navigationItems.reverse()) {
|
|
@@ -142,9 +123,10 @@ export class PostMainnavigation {
|
|
|
142
123
|
}, NAVBAR_DISABLE_DURATION);
|
|
143
124
|
}
|
|
144
125
|
render() {
|
|
145
|
-
return (h(Host, { key: '
|
|
126
|
+
return (h(Host, { key: 'b6bfb6256a2a129a16737b9d97da629842c6b2d5', version: version, class: this.canScroll ? 'scrollable' : '' }, h("div", { key: '3c250f1a09bf9d1c88d4469bb820be4d2ae3dc0a', "aria-hidden": "true", class: { 'scroll-control scroll-left': true, 'd-none': !this.canScrollLeft }, onMouseDown: e => this.handleScrollButtonClick(e, 'left') }, h("post-icon", { key: '8bfdcafdb2594ef323a9cf2408f2c45158fd1632', "aria-hidden": "true", name: "chevronleft" })), h("nav", { key: 'c1d1043ec8448346414a1bbc5cd95b3fe0d0e790', ref: el => (this.navbar = el), "aria-label": this.textMain }, h("slot", { key: 'cc078e4c7d8e24c77027f94598af09be5b80498c' })), h("div", { key: '1fe3c4fae7a9b2cb8bee6677ae528b2cd11d9fa9', "aria-hidden": "true", class: { 'scroll-control scroll-right': true, 'd-none': !this.canScrollRight }, onMouseDown: e => this.handleScrollButtonClick(e, 'right') }, h("post-icon", { key: '6636d014fd1862d9cbb2116da5cd303f83c7c0f3', "aria-hidden": "true", name: "chevronright" }))));
|
|
146
127
|
}
|
|
147
128
|
static get is() { return "post-mainnavigation"; }
|
|
129
|
+
static get encapsulation() { return "shadow"; }
|
|
148
130
|
static get originalStyleUrls() {
|
|
149
131
|
return {
|
|
150
132
|
"$": ["./post-mainnavigation.scss"]
|
|
@@ -155,12 +137,42 @@ export class PostMainnavigation {
|
|
|
155
137
|
"$": ["post-mainnavigation.css"]
|
|
156
138
|
};
|
|
157
139
|
}
|
|
140
|
+
static get properties() {
|
|
141
|
+
return {
|
|
142
|
+
"textMain": {
|
|
143
|
+
"type": "string",
|
|
144
|
+
"mutable": false,
|
|
145
|
+
"complexType": {
|
|
146
|
+
"original": "string",
|
|
147
|
+
"resolved": "string",
|
|
148
|
+
"references": {}
|
|
149
|
+
},
|
|
150
|
+
"required": true,
|
|
151
|
+
"optional": false,
|
|
152
|
+
"docs": {
|
|
153
|
+
"tags": [],
|
|
154
|
+
"text": "Defines the accessible label for the navigation element. This text is used as the `aria-label` attribute to provide screen reader users with a description of the navigation's purpose."
|
|
155
|
+
},
|
|
156
|
+
"getter": false,
|
|
157
|
+
"setter": false,
|
|
158
|
+
"reflect": true,
|
|
159
|
+
"attribute": "text-main"
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
}
|
|
158
163
|
static get states() {
|
|
159
164
|
return {
|
|
160
165
|
"canScrollLeft": {},
|
|
161
166
|
"canScrollRight": {}
|
|
162
167
|
};
|
|
163
168
|
}
|
|
169
|
+
static get elementRef() { return "host"; }
|
|
170
|
+
static get watchers() {
|
|
171
|
+
return [{
|
|
172
|
+
"propName": "textMain",
|
|
173
|
+
"methodName": "validateTextMain"
|
|
174
|
+
}];
|
|
175
|
+
}
|
|
164
176
|
static get listeners() {
|
|
165
177
|
return [{
|
|
166
178
|
"name": "mouseup",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
*,::before,::after{box-sizing:border-box}.megadropdown{position:absolute;inset-inline:0;overflow-y:auto;background-color:#fafafa;box-shadow:var(--post-device-elevation-300)}@media screen and (min-width: 1024px){.megadropdown{z-index:-1;inset-block-start:100%}.megadropdown.slide-in{animation:slide-down 350ms forwards}.megadropdown.slide-out{animation:slide-up 350ms forwards}}@media screen and (max-width: 1023.98px){.megadropdown{z-index:1;inset-block-start:var(--post-header-navigation-current-inset);overscroll-behavior:contain}}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.megadropdown{border-block-end:1px solid CanvasText}}.section{width:100%;max-width:var(--post-header-content-max-width);margin-inline:auto;position:relative}@media screen and (min-width: 1024px){.section{max-height:calc(100vh - var(--post-header-height) - 3rem);padding:2rem 2.5rem 2.5rem}}@media screen and (max-width: 1023.98px){.section{display:flex;flex-direction:column;height:calc(min(var(--post-header-scroll-parent-height, 100dvh),100dvh) - var(--post-header-height));padding-inline:var(--post-burger-menu-padding-inline);padding-block:1.5rem}}.megadropdown-title{margin-block:0 1rem;font-weight:950}@media screen and (min-width: 600px)and (max-width: 1023.98px){.megadropdown-title{font-size:1.25rem}}@media screen and (min-width: 0)and (max-width: 599.98px){.megadropdown-title{font-size:1.125rem}}.back-button{display:inline-flex;position:relative;align-items:center;justify-content:center;max-width:100%;overflow:hidden;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;border-width:var(--post-device-border-width-default);border-style:solid;border-radius:var(--post-device-border-radius-round);background-color:rgba(0,0,0,0);box-shadow:none;font-family:inherit;font-weight:var(--post-device-font-weight-bold);text-decoration:none;white-space:nowrap;cursor:pointer;min-height:var(--post-device-sizing-interactive-button-height-4);gap:var(--post-device-spacing-gap-inline-11);padding:0 var(--post-device-spacing-padding-inline-7);border-color:var(--post-scheme-color-interactive-button-tertiary-enabled-stroke);background-color:var(--post-scheme-color-interactive-button-tertiary-enabled-bg);color:var(--post-scheme-color-interactive-button-tertiary-enabled-fg);order:-1;width:fit-content;padding-inline:0}.back-button:hover{text-decoration:none}.back-button:disabled{border-style:var(--post-core-border-style-dash)}.back-button{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}.back-button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.back-button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.back-button:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.back-button:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.back-button:is(a){color:LinkText;border:unset}.back-button:is(button){background-color:ButtonFace !important;border:1px solid ButtonBorder !important}.back-button:not(:disabled,.disabled):is(button):hover{background-color:Highlight !important}.back-button:not(:disabled,.disabled):is(button):hover>post-icon{color:HighlightText !important}}.back-button>post-icon{width:var(--post-device-sizing-interactive-button-icon-5);height:var(--post-device-sizing-interactive-button-icon-5)}.back-button:hover{border-color:var(--post-scheme-color-interactive-button-tertiary-hover-stroke);background-color:var(--post-scheme-color-interactive-button-tertiary-hover-bg);color:var(--post-scheme-color-interactive-button-tertiary-hover-fg)}@media screen and (min-width: 600px)and (max-width: 1023.98px){.back-button{margin-block-end:2rem}}@media screen and (min-width: 0)and (max-width: 599.98px){.back-button{margin-block-end:1.5rem}}.close-button{position:absolute;inset-block-start:1rem;inset-inline-end:1rem}@media screen and (max-width: 1023.98px){.close-button{display:none}}
|
|
@@ -1,9 +1,29 @@
|
|
|
1
1
|
import { getFocusableChildren } from "../../utils/get-focusable-children";
|
|
2
|
-
import { h, Host } from "@stencil/core";
|
|
2
|
+
import { h, Host, } from "@stencil/core";
|
|
3
3
|
import { version } from "../../../../package";
|
|
4
4
|
import { breakpoint } from "../../utils/breakpoints";
|
|
5
|
+
import { slide } from "../../animations/index";
|
|
6
|
+
import { fadeSlide } from "../../animations/fade-slide";
|
|
7
|
+
import { checkRequiredAndType } from "../../utils/index";
|
|
5
8
|
export class PostMegadropdown {
|
|
9
|
+
validateTextClose() {
|
|
10
|
+
checkRequiredAndType(this, 'textClose', 'string');
|
|
11
|
+
}
|
|
12
|
+
validateTextBack() {
|
|
13
|
+
checkRequiredAndType(this, 'textBack', 'string');
|
|
14
|
+
}
|
|
15
|
+
get megadropdownTrigger() {
|
|
16
|
+
const hostId = this.host.getAttribute('id');
|
|
17
|
+
return hostId ? document.querySelector(`post-megadropdown-trigger[for="${hostId}"]`) : null;
|
|
18
|
+
}
|
|
6
19
|
constructor() {
|
|
20
|
+
this.currentAnimation = null;
|
|
21
|
+
this.isAnimating = false;
|
|
22
|
+
this.fsAnimationOptions = {
|
|
23
|
+
translate: -10,
|
|
24
|
+
duration: 350,
|
|
25
|
+
easing: 'headerEase',
|
|
26
|
+
};
|
|
7
27
|
this.device = breakpoint.get('device');
|
|
8
28
|
/**
|
|
9
29
|
* Holds the current visibility state of the dropdown.
|
|
@@ -14,13 +34,17 @@ export class PostMegadropdown {
|
|
|
14
34
|
this.trigger = false;
|
|
15
35
|
/** Holds the current animation class. */
|
|
16
36
|
this.animationClass = null;
|
|
17
|
-
this.handleClickOutside = (event) => {
|
|
37
|
+
this.handleClickOutside = async (event) => {
|
|
18
38
|
if (this.device !== 'desktop')
|
|
19
39
|
return;
|
|
20
40
|
const target = event.target;
|
|
21
41
|
if (this.host.contains(target)) {
|
|
22
42
|
return;
|
|
23
43
|
}
|
|
44
|
+
// Ignore clicks on the trigger or its contents to prevent running hide() twice
|
|
45
|
+
if (this.megadropdownTrigger.contains(target)) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
24
48
|
if (target instanceof HTMLElement) {
|
|
25
49
|
const trigger = target.closest('post-megadropdown-trigger');
|
|
26
50
|
if (trigger) {
|
|
@@ -30,14 +54,11 @@ export class PostMegadropdown {
|
|
|
30
54
|
}
|
|
31
55
|
}
|
|
32
56
|
}
|
|
33
|
-
this.hide(false);
|
|
57
|
+
await this.hide(false);
|
|
34
58
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return hostId
|
|
39
|
-
? document.querySelector(`post-megadropdown-trigger[for="${hostId}"] > button`)
|
|
40
|
-
: null;
|
|
59
|
+
this.keyboardHandler = this.keyboardHandler.bind(this);
|
|
60
|
+
this.handleTabOutside = this.handleTabOutside.bind(this);
|
|
61
|
+
this.handleClickOutside = this.handleClickOutside.bind(this);
|
|
41
62
|
}
|
|
42
63
|
connectedCallback() {
|
|
43
64
|
window.addEventListener('postBreakpoint:device', this.breakpointChange.bind(this));
|
|
@@ -46,16 +67,17 @@ export class PostMegadropdown {
|
|
|
46
67
|
this.getFocusableElements();
|
|
47
68
|
}
|
|
48
69
|
componentDidLoad() {
|
|
70
|
+
this.validateTextClose();
|
|
71
|
+
this.validateTextBack();
|
|
49
72
|
this.checkInitialAriaCurrent();
|
|
50
73
|
this.setupObserver();
|
|
51
74
|
this.handleAriaCurrentChange([]);
|
|
52
75
|
}
|
|
53
76
|
disconnectedCallback() {
|
|
54
|
-
this.removeListeners();
|
|
55
77
|
window.removeEventListener('postBreakpoint:device', this.breakpointChange.bind(this));
|
|
56
|
-
if (PostMegadropdown.activeDropdown === this)
|
|
78
|
+
if (PostMegadropdown.activeDropdown === this)
|
|
57
79
|
PostMegadropdown.activeDropdown = null;
|
|
58
|
-
|
|
80
|
+
this.removeListeners();
|
|
59
81
|
if (this.defaultSlotObserver) {
|
|
60
82
|
this.defaultSlotObserver.disconnect();
|
|
61
83
|
}
|
|
@@ -64,41 +86,70 @@ export class PostMegadropdown {
|
|
|
64
86
|
* Toggles the dropdown visibility based on its current state.
|
|
65
87
|
*/
|
|
66
88
|
async toggle() {
|
|
67
|
-
if (this.
|
|
68
|
-
this
|
|
69
|
-
|
|
70
|
-
else {
|
|
71
|
-
await this.show();
|
|
89
|
+
if (this.isAnimating) {
|
|
90
|
+
// If this is already animating towards a future state -> reverse intent
|
|
91
|
+
return this.isVisible ? this.show() : this.hide();
|
|
72
92
|
}
|
|
93
|
+
return this.isVisible ? this.hide() : this.show();
|
|
73
94
|
}
|
|
74
95
|
/**
|
|
75
96
|
* Displays the dropdown.
|
|
76
97
|
*/
|
|
77
98
|
async show() {
|
|
99
|
+
if (this.device !== 'desktop') {
|
|
100
|
+
const trigger = this.megadropdownTrigger;
|
|
101
|
+
if (trigger)
|
|
102
|
+
this.megadropdownTitle = trigger.innerHTML;
|
|
103
|
+
}
|
|
78
104
|
if (PostMegadropdown.activeDropdown && PostMegadropdown.activeDropdown !== this) {
|
|
79
105
|
// Close the previously active dropdown without animation
|
|
80
106
|
PostMegadropdown.activeDropdown.forceClose();
|
|
81
107
|
}
|
|
82
|
-
this.
|
|
108
|
+
this.cancelAnimation();
|
|
109
|
+
// Set the megadropdown visible and mark it as the active dropdown
|
|
83
110
|
this.isVisible = true;
|
|
84
111
|
PostMegadropdown.activeDropdown = this;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
this.
|
|
112
|
+
// Update trigger state
|
|
113
|
+
this.postToggleMegadropdown.emit({ isVisible: true });
|
|
114
|
+
try {
|
|
115
|
+
await this.animate('in');
|
|
116
|
+
this.focusFirst();
|
|
117
|
+
// After the megadropdown has finished entry animation
|
|
118
|
+
this.addListeners();
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
// Open animation was cancelled - reset state
|
|
122
|
+
this.removeListeners();
|
|
123
|
+
this.isVisible = false;
|
|
124
|
+
if (PostMegadropdown.activeDropdown === this)
|
|
125
|
+
PostMegadropdown.activeDropdown = null;
|
|
126
|
+
this.postToggleMegadropdown.emit({ isVisible: false, focusParent: true });
|
|
89
127
|
}
|
|
90
|
-
this.addListeners();
|
|
91
128
|
}
|
|
92
129
|
/**
|
|
93
130
|
* Hides the dropdown with an animation.
|
|
94
131
|
*/
|
|
95
132
|
async hide(focusParent = true, forceClose = false) {
|
|
96
|
-
this.postToggleMegadropdown.emit({ isVisible: false, focusParent: focusParent });
|
|
97
133
|
if (forceClose) {
|
|
98
134
|
this.forceClose();
|
|
135
|
+
return;
|
|
99
136
|
}
|
|
100
|
-
|
|
101
|
-
|
|
137
|
+
// Update trigger state
|
|
138
|
+
this.postToggleMegadropdown.emit({ isVisible: false, focusParent: focusParent });
|
|
139
|
+
try {
|
|
140
|
+
await this.animate('out');
|
|
141
|
+
// After the closing animation finishes set the megadropdown as non visible
|
|
142
|
+
this.isVisible = false;
|
|
143
|
+
this.removeListeners();
|
|
144
|
+
if (PostMegadropdown.activeDropdown === this)
|
|
145
|
+
PostMegadropdown.activeDropdown = null;
|
|
146
|
+
}
|
|
147
|
+
catch {
|
|
148
|
+
// Closing animation was cancelled - reset state
|
|
149
|
+
PostMegadropdown.activeDropdown = this;
|
|
150
|
+
this.addListeners();
|
|
151
|
+
this.isVisible = true;
|
|
152
|
+
this.postToggleMegadropdown.emit({ isVisible: true, focusParent: false });
|
|
102
153
|
}
|
|
103
154
|
}
|
|
104
155
|
/**
|
|
@@ -107,63 +158,74 @@ export class PostMegadropdown {
|
|
|
107
158
|
async focusFirst() {
|
|
108
159
|
this.firstFocusableEl?.focus();
|
|
109
160
|
}
|
|
110
|
-
breakpointChange(e) {
|
|
111
|
-
this.device = e.detail;
|
|
112
|
-
if (this.device === 'desktop' && this.isVisible) {
|
|
113
|
-
this.animationClass = null;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
161
|
/**
|
|
117
162
|
* Forces the dropdown to close without animation.
|
|
118
163
|
*/
|
|
119
164
|
forceClose() {
|
|
120
|
-
this.isVisible = false;
|
|
121
|
-
this.animationClass = null;
|
|
122
|
-
this.postToggleMegadropdown.emit({ isVisible: this.isVisible, focusParent: false });
|
|
123
165
|
this.removeListeners();
|
|
166
|
+
this.postToggleMegadropdown.emit({ isVisible: false, focusParent: false });
|
|
167
|
+
this.isVisible = false;
|
|
124
168
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
this.
|
|
129
|
-
PostMegadropdown.activeDropdown = null;
|
|
130
|
-
this.removeListeners();
|
|
169
|
+
// Run the respective animation
|
|
170
|
+
createAnimation(direction) {
|
|
171
|
+
if (this.device === 'desktop') {
|
|
172
|
+
return fadeSlide(this.animatedContainer, direction, this.fsAnimationOptions);
|
|
131
173
|
}
|
|
174
|
+
return slide(this.animatedContainer, direction, {
|
|
175
|
+
translate: 100,
|
|
176
|
+
duration: 350,
|
|
177
|
+
easing: direction === 'in' ? 'ease-in' : 'ease-out',
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
async animate(direction) {
|
|
181
|
+
this.cancelAnimation();
|
|
182
|
+
this.currentAnimation = this.createAnimation(direction);
|
|
183
|
+
// Flag isAnimating used to avoid toggle() de-sync
|
|
184
|
+
this.isAnimating = true;
|
|
185
|
+
await this.currentAnimation.finished;
|
|
186
|
+
this.isAnimating = false;
|
|
187
|
+
this.currentAnimation = null;
|
|
188
|
+
}
|
|
189
|
+
cancelAnimation() {
|
|
190
|
+
this.currentAnimation?.cancel();
|
|
191
|
+
this.currentAnimation = null;
|
|
192
|
+
}
|
|
193
|
+
breakpointChange(e) {
|
|
194
|
+
this.device = e.detail;
|
|
195
|
+
this.cancelAnimation();
|
|
132
196
|
}
|
|
133
197
|
addListeners() {
|
|
134
|
-
this.host.addEventListener('keydown',
|
|
135
|
-
document.addEventListener('keyup',
|
|
198
|
+
this.host.addEventListener('keydown', this.keyboardHandler);
|
|
199
|
+
document.addEventListener('keyup', this.handleTabOutside);
|
|
136
200
|
document.addEventListener('mousedown', this.handleClickOutside);
|
|
137
201
|
}
|
|
138
202
|
removeListeners() {
|
|
139
|
-
this.host.removeEventListener('keydown',
|
|
140
|
-
document.removeEventListener('keyup',
|
|
203
|
+
this.host.removeEventListener('keydown', this.keyboardHandler);
|
|
204
|
+
document.removeEventListener('keyup', this.handleTabOutside);
|
|
141
205
|
document.removeEventListener('mousedown', this.handleClickOutside);
|
|
142
206
|
}
|
|
143
207
|
getFocusableElements() {
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
this.firstFocusableEl = focusableChildren[0];
|
|
152
|
-
this.lastFocusableEl = focusableChildren[focusableChildren.length - 1];
|
|
208
|
+
const focusableElements = [
|
|
209
|
+
...getFocusableChildren(this.host),
|
|
210
|
+
...getFocusableChildren(this.host.shadowRoot),
|
|
211
|
+
];
|
|
212
|
+
this.firstFocusableEl = focusableElements[0];
|
|
213
|
+
this.lastFocusableEl = focusableElements[focusableElements.length - 1];
|
|
153
214
|
}
|
|
154
215
|
// Loop through the focusable children
|
|
155
216
|
keyboardHandler(e) {
|
|
156
|
-
if (e.key
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
217
|
+
if (e.key !== 'Tab' || this.device === 'desktop')
|
|
218
|
+
return;
|
|
219
|
+
const activeElement = this.host.shadowRoot.activeElement || document.activeElement;
|
|
220
|
+
if (e.shiftKey && activeElement === this.firstFocusableEl) {
|
|
221
|
+
// If back tab (TAB + Shift) and first element is focused, focus goes to the last element of the megadropdown
|
|
222
|
+
e.preventDefault();
|
|
223
|
+
this.lastFocusableEl.focus();
|
|
224
|
+
}
|
|
225
|
+
else if (!e.shiftKey && activeElement === this.lastFocusableEl) {
|
|
226
|
+
// If TAB and last element is focused, focus goes back to the first element of the megadropdown
|
|
227
|
+
e.preventDefault();
|
|
228
|
+
this.firstFocusableEl.focus();
|
|
167
229
|
}
|
|
168
230
|
}
|
|
169
231
|
handleTabOutside(e) {
|
|
@@ -194,14 +256,8 @@ export class PostMegadropdown {
|
|
|
194
256
|
*/
|
|
195
257
|
setTriggerActive(isActive) {
|
|
196
258
|
const trigger = this.megadropdownTrigger;
|
|
197
|
-
if (
|
|
198
|
-
|
|
199
|
-
if (isActive) {
|
|
200
|
-
trigger.classList.add('active');
|
|
201
|
-
}
|
|
202
|
-
else {
|
|
203
|
-
trigger.classList.remove('active');
|
|
204
|
-
}
|
|
259
|
+
if (trigger)
|
|
260
|
+
trigger.setAttribute('active', isActive.toString());
|
|
205
261
|
}
|
|
206
262
|
/**
|
|
207
263
|
* Updates the megadropdown trigger state when the megadropdown content changes.
|
|
@@ -225,9 +281,10 @@ export class PostMegadropdown {
|
|
|
225
281
|
}
|
|
226
282
|
render() {
|
|
227
283
|
const containerStyle = this.isVisible ? {} : { display: 'none' };
|
|
228
|
-
return (h(Host, { key: '
|
|
284
|
+
return (h(Host, { key: '02194ee3593dd471e2fc3aadb1d69041d613ce0a', version: version }, h("div", { key: '77ab3faeb3705ac0d97ab0d72cc3fbf12c19badc', ref: el => (this.animatedContainer = el), class: "megadropdown", style: containerStyle }, h("div", { key: '5d8b3ef651c3eb19f08e3ccd6c9356e01463a2e0', class: "section" }, this.device !== 'desktop' && this.megadropdownTitle && (h("p", { key: 'e99a5751ea896f3ab55dc9bf58635f7b2fef2a1c', class: "megadropdown-title" }, this.megadropdownTitle)), h("div", { key: 'a0a1bfa04de139d48c825df8fdb24f93e031ea66', class: "megadropdown-content" }, h("slot", { key: '68e44ce30fec1efed2855490b5d9af56ba41e004' })), this.device === 'desktop' ? (h("post-closebutton", { onClick: () => this.hide(true), class: "close-button" }, this.textClose)) : (h("button", { onClick: () => this.hide(true), class: "back-button" }, h("post-icon", { name: "arrowleft" }), this.textBack))))));
|
|
229
285
|
}
|
|
230
286
|
static get is() { return "post-megadropdown"; }
|
|
287
|
+
static get encapsulation() { return "shadow"; }
|
|
231
288
|
static get originalStyleUrls() {
|
|
232
289
|
return {
|
|
233
290
|
"$": ["post-megadropdown.scss"]
|
|
@@ -238,11 +295,54 @@ export class PostMegadropdown {
|
|
|
238
295
|
"$": ["post-megadropdown.css"]
|
|
239
296
|
};
|
|
240
297
|
}
|
|
298
|
+
static get properties() {
|
|
299
|
+
return {
|
|
300
|
+
"textClose": {
|
|
301
|
+
"type": "string",
|
|
302
|
+
"mutable": false,
|
|
303
|
+
"complexType": {
|
|
304
|
+
"original": "string",
|
|
305
|
+
"resolved": "string",
|
|
306
|
+
"references": {}
|
|
307
|
+
},
|
|
308
|
+
"required": true,
|
|
309
|
+
"optional": false,
|
|
310
|
+
"docs": {
|
|
311
|
+
"tags": [],
|
|
312
|
+
"text": "An accessible label for the close button visible on desktop"
|
|
313
|
+
},
|
|
314
|
+
"getter": false,
|
|
315
|
+
"setter": false,
|
|
316
|
+
"reflect": true,
|
|
317
|
+
"attribute": "text-close"
|
|
318
|
+
},
|
|
319
|
+
"textBack": {
|
|
320
|
+
"type": "string",
|
|
321
|
+
"mutable": false,
|
|
322
|
+
"complexType": {
|
|
323
|
+
"original": "string",
|
|
324
|
+
"resolved": "string",
|
|
325
|
+
"references": {}
|
|
326
|
+
},
|
|
327
|
+
"required": true,
|
|
328
|
+
"optional": false,
|
|
329
|
+
"docs": {
|
|
330
|
+
"tags": [],
|
|
331
|
+
"text": "A label for the back button visible on tablet and mobile"
|
|
332
|
+
},
|
|
333
|
+
"getter": false,
|
|
334
|
+
"setter": false,
|
|
335
|
+
"reflect": true,
|
|
336
|
+
"attribute": "text-back"
|
|
337
|
+
}
|
|
338
|
+
};
|
|
339
|
+
}
|
|
241
340
|
static get states() {
|
|
242
341
|
return {
|
|
243
342
|
"device": {},
|
|
244
343
|
"isVisible": {},
|
|
245
344
|
"trigger": {},
|
|
345
|
+
"megadropdownTitle": {},
|
|
246
346
|
"animationClass": {}
|
|
247
347
|
};
|
|
248
348
|
}
|
|
@@ -345,6 +445,15 @@ export class PostMegadropdown {
|
|
|
345
445
|
};
|
|
346
446
|
}
|
|
347
447
|
static get elementRef() { return "host"; }
|
|
448
|
+
static get watchers() {
|
|
449
|
+
return [{
|
|
450
|
+
"propName": "textClose",
|
|
451
|
+
"methodName": "validateTextClose"
|
|
452
|
+
}, {
|
|
453
|
+
"propName": "textBack",
|
|
454
|
+
"methodName": "validateTextBack"
|
|
455
|
+
}];
|
|
456
|
+
}
|
|
348
457
|
}
|
|
349
458
|
/** Tracks the currently active dropdown instance. */
|
|
350
459
|
PostMegadropdown.activeDropdown = null;
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
post-
|
|
1
|
+
button{display:inline-flex;position:relative;align-items:center;justify-content:center;max-width:100%;overflow:hidden;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;border-width:var(--post-device-border-width-default);border-style:solid;border-radius:var(--post-device-border-radius-round);background-color:rgba(0,0,0,0);box-shadow:none;font-family:inherit;font-weight:var(--post-device-font-weight-bold);text-decoration:none;white-space:nowrap;cursor:pointer;border:unset;font-weight:unset;display:flex;padding:.25rem .625rem;gap:.375rem;font-size:1rem;border-color:var(--post-scheme-color-interactive-button-tertiary-enabled-stroke);background-color:var(--post-scheme-color-interactive-button-tertiary-enabled-bg);color:var(--post-scheme-color-interactive-button-tertiary-enabled-fg)}button:hover{text-decoration:none}button:disabled{border-style:var(--post-core-border-style-dash)}button{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){button:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){button:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){button:is(a){color:LinkText;border:unset}button:is(button){background-color:ButtonFace !important;border:1px solid ButtonBorder !important}button:not(:disabled,.disabled):is(button):hover{background-color:Highlight !important}button:not(:disabled,.disabled):is(button):hover>post-icon{color:HighlightText !important}}button:hover{border-color:var(--post-scheme-color-interactive-button-tertiary-hover-stroke);background-color:var(--post-scheme-color-interactive-button-tertiary-hover-bg);color:var(--post-scheme-color-interactive-button-tertiary-hover-fg)}button:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active){box-shadow:var(--post-device-elevation-100);border-color:var(--post-scheme-color-interactive-button-primary-enabled-stroke);background-color:var(--post-scheme-color-interactive-button-primary-enabled-bg);color:var(--post-scheme-color-interactive-button-primary-enabled-fg)}button:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active):hover{border-color:var(--post-scheme-color-interactive-button-primary-hover-stroke);background-color:var(--post-scheme-color-interactive-button-primary-hover-bg);color:var(--post-scheme-color-interactive-button-primary-hover-fg)}button{--post-nav-item-border-width: 1px;width:100%;justify-content:start;position:relative;padding:.75rem .75rem calc(.75rem - var(--post-nav-item-border-width)) .5rem;gap:1rem;border-radius:0;line-height:1.5;outline-color:currentColor !important;height:100%}button::before{content:"";background-color:#050400;position:absolute;inset-inline:0;inset-block-end:0;height:var(--post-nav-item-border-width)}button:hover{border-color:var(--post-scheme-color-interactive-button-primary-hover-stroke);background-color:var(--post-scheme-color-interactive-button-primary-hover-bg);color:var(--post-scheme-color-interactive-button-primary-hover-fg)}button:hover::before{background-color:rgba(0,0,0,0)}button:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active){box-shadow:none}button{outline-offset:calc(
|
|
2
|
+
-2px - var(--post-device-border-width-focus)
|
|
3
|
+
) !important}button>post-icon:where(:last-child){margin-inline-start:auto}@media screen and (min-width: 0)and (max-width: 599.98px){button{padding:calc(.5rem + 1.5px) .75rem calc(.5rem + 1.5px - var(--post-nav-item-border-width)) .5rem;gap:.5rem;font-size:.875rem}button>post-icon{font-size:1rem}}@media screen and (min-width: 600px)and (max-width: 1023.98px){button>post-icon{font-size:1.5rem}}@media screen and (min-width: 1024px){button{padding:1rem .75rem;gap:.5rem}button::before{content:unset}}:host{position:relative;display:inline-block}button post-icon{transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1)}button:is([aria-current],[aria-pressed=true],[aria-expanded=true]) post-icon{transform:rotate(180deg)}button>span{position:relative}button>span>span[aria-hidden]{font-weight:700;visibility:hidden}button>span>span:not([aria-hidden]){position:absolute;inset:0}@media screen and (min-width: 1024px){button:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active){font-weight:700}}@media screen and (max-width: 1023.98px){button post-icon{margin-inline-start:auto;transform:rotate(-90deg) !important}}
|