@swisspost/design-system-components 10.0.0-next.54 → 10.0.0-next.56
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-Cb8CTrOz.js → index-CKNxhb0S.js} +29 -13
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{package-CvZxvdTJ.js → package-CY7IOoiw.js} +1 -1
- package/dist/cjs/post-accordion_2.cjs.entry.js +12 -12
- package/dist/cjs/post-avatar.cjs.entry.js +11 -11
- package/dist/cjs/post-back-to-top.cjs.entry.js +16 -40
- package/dist/cjs/post-banner.cjs.entry.js +11 -10
- package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +7 -7
- package/dist/cjs/post-breadcrumbs.cjs.entry.js +22 -31
- package/dist/cjs/post-card-control.cjs.entry.js +16 -16
- package/dist/cjs/{post-closebutton_15.cjs.entry.js → post-closebutton_13.cjs.entry.js} +537 -507
- package/dist/cjs/post-collapsible_2.cjs.entry.js +39 -38
- package/dist/cjs/post-components.cjs.js +2 -2
- package/dist/cjs/post-env-test.cjs.entry.js +15 -0
- package/dist/cjs/post-footer.cjs.entry.js +21 -19
- package/dist/cjs/post-linkarea.cjs.entry.js +3 -3
- package/dist/cjs/post-pagination.cjs.entry.js +589 -0
- package/dist/cjs/post-popover-trigger.cjs.entry.js +46 -30
- package/dist/cjs/post-popover.cjs.entry.js +12 -12
- package/dist/cjs/post-rating.cjs.entry.js +13 -13
- package/dist/cjs/post-stepper-item.cjs.entry.js +18 -0
- package/dist/cjs/post-stepper.cjs.entry.js +109 -0
- package/dist/cjs/post-tab-item.cjs.entry.js +49 -0
- package/dist/cjs/post-tab-panel.cjs.entry.js +9 -9
- package/dist/cjs/post-tabs.cjs.entry.js +191 -38
- package/dist/cjs/post-tooltip-trigger.cjs.entry.js +8 -8
- package/dist/cjs/post-tooltip.cjs.entry.js +7 -7
- 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 -6
- package/dist/collection/components/post-accordion/post-accordion.css +1 -1
- package/dist/collection/components/post-accordion/post-accordion.js +2 -2
- package/dist/collection/components/post-accordion-item/post-accordion-item.css +1 -1
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +4 -4
- package/dist/collection/components/post-avatar/post-avatar.css +1 -1
- package/dist/collection/components/post-avatar/post-avatar.js +1 -1
- package/dist/collection/components/post-back-to-top/post-back-to-top.js +14 -14
- package/dist/collection/components/post-banner/post-banner.css +4 -1
- package/dist/collection/components/post-banner/post-banner.js +3 -3
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +1 -1
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.js +28 -28
- package/dist/collection/components/post-card-control/post-card-control.js +3 -3
- package/dist/collection/components/post-closebutton/post-closebutton.css +1 -1
- package/dist/collection/components/post-closebutton/post-closebutton.js +1 -1
- package/dist/collection/components/post-collapsible/post-collapsible.js +27 -27
- package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +6 -5
- 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 +186 -105
- package/dist/collection/components/post-icon/post-icon.js +6 -4
- 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} +25 -25
- 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} +14 -14
- 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 +1 -1
- 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 +184 -75
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.css +3 -1
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +80 -74
- package/dist/collection/components/post-menu/post-menu.css +1 -1
- package/dist/collection/components/post-menu/post-menu.js +35 -35
- package/dist/collection/components/post-menu-item/post-menu-item.js +1 -1
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +1 -1
- 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.css +1 -1
- package/dist/collection/components/post-popover/post-popover.js +10 -10
- package/dist/collection/components/post-popover-trigger/post-popover-trigger.js +43 -27
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -1
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +45 -92
- package/dist/collection/components/post-rating/post-rating.js +3 -3
- package/dist/collection/components/post-stepper/post-stepper.css +1 -0
- package/dist/collection/components/post-stepper/post-stepper.js +207 -0
- package/dist/collection/components/post-stepper-item/post-stepper-item.css +7 -0
- package/dist/collection/components/post-stepper-item/post-stepper-item.js +18 -0
- 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 +9 -9
- package/dist/collection/components/post-tabs/post-tabs.js +230 -57
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +1 -1
- package/dist/collection/components/post-tooltip/post-tooltip.css +1 -1
- package/dist/collection/components/post-tooltip/post-tooltip.js +1 -1
- package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +1 -1
- 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 +6 -5
- package/dist/components/breakpoints.js +90 -3
- package/dist/components/debounce.js +11 -0
- package/dist/components/environment.js +49 -0
- package/dist/components/event-from.js +2 -2
- package/dist/components/fade-slide.js +36 -0
- package/dist/components/fade.js +21 -8
- package/dist/components/get-focusable-children.js +29 -21
- package/dist/components/get-root.js +1 -1
- package/dist/components/index.d.ts +14 -10
- package/dist/components/index.js +7 -5
- package/dist/components/package.js +1 -1
- package/dist/components/post-accordion-item2.js +4 -5
- package/dist/components/post-accordion2.js +4 -5
- package/dist/components/post-avatar.js +3 -4
- package/dist/components/post-back-to-top.js +14 -40
- package/dist/components/post-banner.js +5 -6
- package/dist/components/post-breadcrumb-item2.js +2 -3
- package/dist/components/post-breadcrumbs.js +24 -34
- package/dist/components/post-card-control.js +4 -5
- package/dist/components/post-closebutton2.js +3 -4
- package/dist/components/post-collapsible-trigger2.js +10 -10
- package/dist/components/post-collapsible2.js +25 -25
- package/dist/components/{post-list.d.ts → post-env-test.d.ts} +4 -4
- package/dist/components/post-env-test.js +31 -0
- package/dist/components/post-footer.js +17 -16
- package/dist/components/post-header.js +156 -119
- package/dist/components/post-icon2.js +8 -6
- package/dist/components/post-language-menu-item.d.ts +11 -0
- package/dist/components/post-language-menu-item.js +98 -0
- package/dist/components/{post-language-switch.d.ts → post-language-menu.d.ts} +4 -4
- package/dist/components/post-language-menu.js +156 -0
- package/dist/components/post-linkarea.js +1 -1
- package/dist/components/post-logo.js +3 -4
- package/dist/components/post-mainnavigation.js +21 -32
- package/dist/components/post-megadropdown-trigger.js +72 -79
- package/dist/components/post-megadropdown.js +183 -78
- package/dist/components/post-menu-item2.js +1 -1
- package/dist/components/post-menu-trigger2.js +2 -3
- package/dist/components/post-menu2.js +35 -36
- package/dist/components/post-pagination.d.ts +11 -0
- package/dist/components/post-pagination.js +635 -0
- package/dist/components/post-popover-trigger.js +41 -26
- package/dist/components/post-popover.js +9 -10
- package/dist/components/post-popovercontainer2.js +44 -40
- package/dist/components/post-rating.js +3 -4
- package/dist/components/post-stepper-item.d.ts +11 -0
- package/dist/components/post-stepper-item.js +33 -0
- package/dist/components/{post-list-item.d.ts → post-stepper.d.ts} +4 -4
- package/dist/components/post-stepper.js +136 -0
- package/dist/components/{post-tab-header.d.ts → post-tab-item.d.ts} +4 -4
- package/dist/components/post-tab-item.js +70 -0
- package/dist/components/post-tab-panel.js +8 -9
- package/dist/components/post-tabs.js +192 -37
- package/dist/components/post-togglebutton.js +1 -51
- package/dist/components/post-togglebutton2.js +53 -0
- package/dist/components/post-tooltip-trigger.js +3 -3
- package/dist/components/post-tooltip.js +3 -4
- package/dist/components/react/index.js +1 -1
- package/dist/{cjs/breakpoints-CEkeixld.js → components/react/p-B8YiQ3mz.js} +89 -6
- package/dist/components/react/{p-2U_BGLjc.js → p-BOLlAY91.js} +9 -7
- package/dist/components/react/p-BVCjnh6Q.js +36 -0
- package/dist/components/react/{p-CBFgkSgY.js → p-BVGcVycs.js} +1 -1
- package/dist/components/react/{p-D4NSCxrX.js → p-BYCGzO-t.js} +13 -13
- package/dist/components/react/p-C9hMpmsD.js +11 -0
- package/dist/components/react/{p-BVXiQdHq.js → p-CJ13r5fi.js} +29 -21
- package/dist/components/react/{p-nSFSgY-P.js → p-CnZWXrbA.js} +40 -41
- package/dist/components/react/p-CoDiS_Ik.js +24 -0
- package/dist/components/react/p-CyniMNY-.js +54 -0
- package/dist/components/react/p-D5knoiyy.js +24 -0
- package/dist/components/react/{p-Ccgu_WOx.js → p-DBO6FfHt.js} +4 -5
- package/dist/components/react/{p-BfLuYwf7.js → p-DRfa3MOV.js} +26 -26
- package/dist/components/react/{p-BUxAs8N5.js → p-DYImHx0e.js} +4 -5
- package/dist/components/react/p-DZ5m2Ttg.js +3 -0
- package/dist/components/react/p-FxUVQ4Tx.js +49 -0
- package/dist/components/react/{p-BK474oMI.js → p-L36-yvgK.js} +2 -2
- package/dist/components/react/{p-DVxZMuPW.js → p-NCAcc7ZZ.js} +6 -7
- package/dist/components/react/{p-mENtrn2l.js → p-QNPIvxLq.js} +45 -41
- package/dist/components/react/{p-D3CFjhAf.js → p-_pLhqTys.js} +5 -6
- package/dist/components/react/p-c6yNOQwn.js +113 -0
- package/dist/components/react/{p-CzIKqBrS.js → p-rEfV4v4a.js} +2 -2
- package/dist/components/react/post-accordion-item.js +1 -1
- package/dist/components/react/post-accordion.js +1 -1
- package/dist/components/react/post-avatar.js +4 -5
- package/dist/components/react/post-back-to-top.js +16 -42
- package/dist/components/react/post-banner.js +7 -8
- package/dist/components/react/post-breadcrumb-item.js +1 -1
- package/dist/components/react/post-breadcrumbs.js +31 -41
- package/dist/components/react/post-card-control.js +6 -7
- package/dist/components/react/post-closebutton.js +1 -1
- package/dist/components/react/post-collapsible-trigger.js +1 -1
- package/dist/components/react/post-collapsible.js +1 -1
- package/dist/components/react/{post-list.d.ts → post-env-test.d.ts} +4 -4
- package/dist/components/react/post-env-test.js +32 -0
- package/dist/components/react/post-footer.js +23 -22
- package/dist/components/react/post-header.js +158 -121
- package/dist/components/react/post-icon.js +1 -1
- package/dist/components/react/post-language-menu-item.d.ts +11 -0
- package/dist/components/react/post-language-menu-item.js +99 -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 +157 -0
- package/dist/components/react/post-linkarea.js +2 -2
- package/dist/components/react/post-logo.js +4 -5
- package/dist/components/react/post-mainnavigation.js +23 -34
- package/dist/components/react/post-megadropdown-trigger.js +74 -81
- package/dist/components/react/post-megadropdown.js +185 -80
- package/dist/components/react/post-menu-item.js +1 -1
- package/dist/components/react/post-menu-trigger.js +1 -1
- package/dist/components/react/post-menu.js +1 -1
- package/dist/components/react/post-pagination.d.ts +11 -0
- package/dist/components/react/post-pagination.js +636 -0
- package/dist/components/react/post-popover-trigger.js +42 -27
- package/dist/components/react/post-popover.js +14 -15
- package/dist/components/react/post-popovercontainer.js +1 -1
- package/dist/components/react/post-rating.js +5 -6
- package/dist/components/react/post-stepper-item.d.ts +11 -0
- package/dist/components/react/post-stepper-item.js +34 -0
- package/dist/components/react/{post-list-item.d.ts → post-stepper.d.ts} +4 -4
- package/dist/components/react/post-stepper.js +137 -0
- package/dist/components/react/{post-tab-header.d.ts → post-tab-item.d.ts} +4 -4
- package/dist/components/react/post-tab-item.js +71 -0
- package/dist/components/react/post-tab-panel.js +9 -10
- package/dist/components/react/post-tabs.js +193 -38
- package/dist/components/react/post-togglebutton.js +1 -52
- package/dist/components/react/post-tooltip-trigger.js +4 -4
- package/dist/components/react/post-tooltip.js +5 -6
- package/dist/components/utils.js +24 -0
- package/dist/docs.json +968 -563
- package/dist/esm/{breakpoints-CJ80BZ06.js → breakpoints-DYoSKGHO.js} +90 -3
- package/dist/esm/debounce-C9hMpmsD.js +11 -0
- package/dist/esm/environment-CEmnRoA6.js +49 -0
- package/dist/esm/{event-from-CzIKqBrS.js → 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/esm/{get-root-BkQ3CrLq.js → get-root-CXfAA093.js} +1 -1
- package/dist/esm/{index-CFNKgUjL.js → index-1ReqxAnI.js} +29 -13
- package/dist/esm/loader.js +3 -3
- package/dist/esm/package-DZ5m2Ttg.js +3 -0
- package/dist/esm/post-accordion_2.entry.js +10 -10
- package/dist/esm/post-avatar.entry.js +6 -6
- package/dist/esm/post-back-to-top.entry.js +16 -40
- package/dist/esm/post-banner.entry.js +10 -9
- package/dist/esm/post-breadcrumb-item_2.entry.js +6 -6
- package/dist/esm/post-breadcrumbs.entry.js +20 -29
- package/dist/esm/post-card-control.entry.js +6 -6
- package/dist/esm/{post-closebutton_15.entry.js → post-closebutton_13.entry.js} +518 -486
- package/dist/esm/post-collapsible_2.entry.js +36 -35
- package/dist/esm/post-components.js +3 -3
- package/dist/esm/post-env-test.entry.js +13 -0
- package/dist/esm/post-footer.entry.js +18 -16
- package/dist/esm/post-linkarea.entry.js +3 -3
- package/dist/esm/post-pagination.entry.js +587 -0
- package/dist/esm/post-popover-trigger.entry.js +44 -28
- package/dist/esm/post-popover.entry.js +11 -11
- package/dist/esm/post-rating.entry.js +5 -5
- package/dist/esm/post-stepper-item.entry.js +16 -0
- package/dist/esm/post-stepper.entry.js +107 -0
- package/dist/esm/post-tab-item.entry.js +47 -0
- package/dist/esm/post-tab-panel.entry.js +9 -9
- package/dist/esm/post-tabs.entry.js +191 -38
- package/dist/esm/post-tooltip-trigger.entry.js +5 -5
- package/dist/esm/post-tooltip.entry.js +6 -6
- package/dist/esm/utils-CoDiS_Ik.js +24 -0
- package/dist/post-components/{p-8f0fc02a.entry.js → p-130eb074.entry.js} +1 -1
- package/dist/post-components/p-13d018fe.entry.js +1 -0
- package/dist/post-components/p-143e5a84.entry.js +1 -0
- package/dist/post-components/p-1ReqxAnI.js +2 -0
- package/dist/post-components/p-2b220851.entry.js +1 -0
- package/dist/post-components/{p-96750e25.entry.js → p-390f111f.entry.js} +1 -1
- package/dist/post-components/p-3cf09fbd.entry.js +1 -0
- package/dist/post-components/p-52e584ca.entry.js +1 -0
- package/dist/post-components/p-56a4040c.entry.js +1 -0
- package/dist/post-components/p-675dab57.entry.js +1 -0
- package/dist/post-components/p-6857fd9d.entry.js +1 -0
- package/dist/post-components/p-7cd00e3e.entry.js +1 -0
- package/dist/post-components/p-7f5d2487.entry.js +1 -0
- package/dist/post-components/{p-bf41fe56.entry.js → p-88201353.entry.js} +1 -1
- package/dist/post-components/p-89360cd1.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-CEmnRoA6.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-DZ5m2Ttg.js +1 -0
- package/dist/post-components/p-a740eaed.entry.js +1 -0
- package/dist/post-components/{p-261b1452.entry.js → p-a79590f5.entry.js} +1 -1
- package/dist/post-components/p-b708d96a.entry.js +1 -0
- package/dist/post-components/p-bcf5786f.entry.js +1 -0
- package/dist/post-components/p-c92512f5.entry.js +1 -0
- package/dist/post-components/{p-658b1ccc.entry.js → p-d7cb3a61.entry.js} +1 -1
- package/dist/post-components/p-d7f33813.entry.js +1 -0
- package/dist/post-components/p-da97ee21.entry.js +1 -0
- package/dist/post-components/{p-11c204e0.entry.js → p-ed4db774.entry.js} +1 -1
- 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-collapsible-trigger/post-collapsible-trigger.d.ts +1 -0
- package/dist/types/components/post-footer/post-footer.d.ts +4 -4
- package/dist/types/components/post-header/post-header.d.ts +28 -19
- package/dist/types/components/{post-language-switch/post-language-switch.d.ts → post-language-menu/post-language-menu.d.ts} +6 -6
- 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 +3 -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 +13 -16
- package/dist/types/components/post-rating/post-rating.d.ts +1 -1
- package/dist/types/components/post-stepper/post-stepper.d.ts +39 -0
- package/dist/types/components/post-stepper-item/post-stepper-item.d.ts +3 -0
- 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.d.ts +357 -186
- package/dist/types/home/runner/work/design-system/design-system/packages/components/.stencil/prebuild.d.ts +9 -0
- 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.js +1882 -833
- package/hydrate/index.mjs +1882 -833
- package/package.json +9 -11
- package/dist/cjs/fade-nS5zzDQS.js +0 -14
- package/dist/cjs/index-DtvYdwe1.js +0 -96
- 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 -88
- 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-BXRsHuTS.js +0 -3
- package/dist/components/react/p-CV7fm1rW.js +0 -88
- package/dist/components/react/p-Dj7qWba5.js +0 -114
- package/dist/components/react/p-SbIC4aZX.js +0 -11
- 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/fade-SbIC4aZX.js +0 -11
- package/dist/esm/index-VmK3ABCB.js +0 -88
- package/dist/esm/package-BXRsHuTS.js +0 -3
- package/dist/esm/post-tab-header.entry.js +0 -29
- package/dist/post-components/p-02ea3ec5.entry.js +0 -1
- package/dist/post-components/p-0e92dbef.entry.js +0 -1
- package/dist/post-components/p-0ec2bdd7.entry.js +0 -1
- package/dist/post-components/p-197a0f25.entry.js +0 -1
- package/dist/post-components/p-3274ab81.entry.js +0 -1
- package/dist/post-components/p-77e43032.entry.js +0 -1
- package/dist/post-components/p-BXRsHuTS.js +0 -1
- package/dist/post-components/p-CBFgkSgY.js +0 -1
- package/dist/post-components/p-CFNKgUjL.js +0 -2
- 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-VmK3ABCB.js +0 -1
- package/dist/post-components/p-b5b5e4b9.entry.js +0 -1
- package/dist/post-components/p-b8059ba1.entry.js +0 -1
- package/dist/post-components/p-d6134e24.entry.js +0 -1
- package/dist/post-components/p-e7029b9e.entry.js +0 -1
- package/dist/post-components/p-e90688ab.entry.js +0 -1
- package/dist/post-components/p-ea5da614.entry.js +0 -1
- package/dist/post-components/p-f1b815b6.entry.js +0 -1
- 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 → p-rEfV4v4a.js} +0 -0
- /package/dist/types/components/{post-language-switch → post-language-menu}/switch-variants.d.ts +0 -0
|
@@ -1,34 +1,13 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { t as throttle,
|
|
2
|
+
import { c as checkRequiredAndType, t as throttle, g as breakpoint } from './breakpoints.js';
|
|
3
3
|
import { v as version } from './package.js';
|
|
4
|
-
import {
|
|
4
|
+
import { f as fade } from './fade.js';
|
|
5
|
+
import { a as getDeepFocusableChildren } from './get-focusable-children.js';
|
|
5
6
|
import { E as EventFrom } from './event-from.js';
|
|
7
|
+
import { d as defineCustomElement$3 } from './post-icon2.js';
|
|
8
|
+
import { d as defineCustomElement$2 } from './post-togglebutton2.js';
|
|
6
9
|
|
|
7
|
-
const
|
|
8
|
-
const duration = 500;
|
|
9
|
-
const fill = 'forwards';
|
|
10
|
-
function slideUp(el, translateSize = '-100%') {
|
|
11
|
-
return el.animate([
|
|
12
|
-
{ transform: 'translateY(0)' }, // Starting position (no translation)
|
|
13
|
-
{ transform: `translateY(${translateSize})` }, // End position
|
|
14
|
-
], {
|
|
15
|
-
duration: duration,
|
|
16
|
-
easing,
|
|
17
|
-
fill,
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
function slideDown(el, translateSize = '-100%') {
|
|
21
|
-
return el.animate([
|
|
22
|
-
{ transform: `translateY(${translateSize})` }, // Starting position (no translation)
|
|
23
|
-
{ transform: 'translateY(0)' }, // End position
|
|
24
|
-
], {
|
|
25
|
-
duration: duration,
|
|
26
|
-
easing,
|
|
27
|
-
fill,
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const postHeaderCss = "*,::before,::after{box-sizing:border-box}:host{z-index:1020;position:relative;--post-logo-height:calc(var(--post-global-header-expanded-height) - var(--post-header-scroll-top, 0px));--post-global-header-top:calc( var(--post-global-header-reduced-height) - var(--post-global-header-expanded-height) );--post-local-header-top:calc( var(--post-global-header-reduced-height) + var(--post-local-header-reduced-height) - var(--post-local-header-expanded-height) );--post-global-controls-top:clamp( 1000 * var(--post-global-header-top), calc(-1 * min(var(--post-header-scroll-top, 0px) / 4, var(--post-global-header-reduced-height))), 0px )}@media screen and (min-width: 1024px){:host:has(.global-sub>*:not(.logo):focus-within),:host:has(.local-sub:focus-within){--post-global-header-top:0;--post-local-header-top:var(--post-global-header-expanded-height);--post-logo-height:var(--post-global-header-expanded-height);--post-global-controls-top:0}}.d-flex{display:flex}.space-between{justify-content:space-between}.global-header{background-color:#fc0;display:flex;justify-content:space-between;position:sticky;padding-inline:4px;height:var(--post-global-header-expanded-height)}@media screen and (max-width: 1023.98px){.global-header{z-index:4;inset-block-start:0}}@media screen and (min-width: 1024px){.global-header{z-index:5;padding-inline-end:8px;inset-block-start:var(--post-global-header-top);transition:inset-block-start .2s ease-in-out}}.global-header:has(+.local-header.no-navigation.no-title){box-shadow:var(--post-device-elevation-300)}.global-sub{display:flex;align-items:center;gap:4px}@media screen and (min-width: 1024px){.global-sub:not(:has(.logo)){position:relative;transition:inset-block-start .2s ease-in-out;inset-block-start:var(--post-global-controls-top)}.global-sub:not(:last-child):not(:first-child){flex-grow:1}}.align-end{align-items:flex-end}.logo{flex:1 0 auto;height:var(--post-global-header-expanded-height);width:var(--post-global-header-expanded-height);min-height:var(--post-global-header-reduced-height);align-self:flex-end}@media screen and (min-width: 1024px){.logo{transition:height .2 ease-in-out;height:var(--post-logo-height)}}::slotted(ul){margin-block:0 !important;list-style:none;display:flex;padding-inline-start:0;gap:1rem;flex-shrink:0 !important}.local-header{display:flex;position:sticky;inset-block-start:var(--post-local-header-top);flex-wrap:wrap;align-items:center;justify-content:space-between;gap:4px;min-height:var(--post-local-header-expanded-min-height);background:#fff;transition:box-shadow .2s ease-in-out}.local-header::after{content:\"\";position:absolute;width:100%;height:1px;background-color:#e1e0dc;inset-block-end:-1px;z-index:1}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.local-header::after{background-color:Highlight}}@media screen and (min-width: 1024px){.local-header{z-index:3;box-shadow:var(--post-device-elevation-300);transition:box-shadow .2s ease-in-out,inset-block-start .2s ease-in-out}.local-header:not(.no-title){padding-block-start:18px}}@media screen and (max-width: 1023.98px){.local-header{z-index:3;padding-block:8px;flex-wrap:wrap;gap:12px}.local-header.local-header-mobile-extended::after{inset-block-end:0}.local-header:not(.local-header-mobile-extended){box-shadow:var(--post-device-elevation-300)}}.local-header.no-navigation{padding-block:0}.local-header.no-navigation .navigation{display:none}.local-header.no-navigation.no-title{display:none}.local-sub{margin-inline-end:16px}@media screen and (max-width: 1023.98px){.local-sub{margin-inline-end:4px}}::slotted(.list-inline){margin:0 !important;z-index:3 !important;position:relative !important}@media screen and (min-width: 1024px){.mobile-toggle{display:none}}.navigation{width:100%}@media screen and (min-width: 1024px){.navigation{display:flex;align-items:center;justify-content:space-between;inset-block-start:var(--post-global-header-reduced-height)}.navigation::before{display:block;content:\"\";position:absolute;inset:0;z-index:2;background:#fff}}@media screen and (max-width: 1023.98px){.navigation{position:sticky;z-index:2;inset-inline:0;inset-block-start:var(--post-header-height)}.mobile-menu{background-color:#fafafa}::slotted(post-mainnavigation),.navigation-footer{padding-block:16px 24px;padding-inline:40px}.navigation-header,::slotted(post-mainnavigation),.navigation-footer{display:none;flex-direction:column}.navigation.extended .navigation-header,.navigation.extended ::slotted(post-mainnavigation),.navigation.extended .navigation-footer{display:flex}::slotted(post-mainnavigation){padding-block:24px}.navigation.extended>div{display:flex;flex-direction:column;overflow-y:auto;overflow-x:hidden;height:calc(min(var(--post-header-scroll-parent-height, 100dvh),100dvh) - var(--post-header-height))}.navigation.extended.megadropdown-open>div{overflow-y:hidden}.navigation.extended ::slotted(post-mainnavigation){flex-grow:1 !important}.navigation-footer{background-color:#f0efed;gap:24px}.navigation-footer ::slotted(post-language-switch){margin-top:16px}}@media screen and (max-width: 1023.98px)and (max-width: 599.98px){.navigation-footer{gap:16px}}@media screen and (max-width: 599.98px){::slotted(post-mainnavigation),.navigation-footer{padding-inline:16px}}";
|
|
10
|
+
const postHeaderCss = ":host{--post-global-header-top:calc( var(--post-global-header-reduced-height) - var(--post-global-header-expanded-height) );--post-header-top:calc(var(--post-header-reduced-height) - var(--post-header-expanded-height));--post-logo-height:calc( var(--post-global-header-expanded-height) - var(--post-header-scroll-top, 0px) );--post-global-controls-top:clamp( 1000 * (var(--post-global-header-reduced-height) - var(--post-global-header-expanded-height)), calc( -1 * min(var(--post-header-scroll-top, 0px) / 4, var(--post-global-header-reduced-height)) ), 0px )}@media screen and (min-width: 1024px){:host{--post-header-gap:0.25rem;--post-global-header-padding-inline-start:0.25rem;--post-global-header-padding-inline-end:0.5rem;--post-local-header-padding-inline-start:0.75rem;--post-local-header-padding-inline-end:0.5rem}}@media screen and (min-width: 600px)and (max-width: 1023.98px){:host{--post-header-gap:0.75rem 0.25rem;--post-global-header-padding-inline-start:0.25rem;--post-global-header-padding-inline-end:0.25rem;--post-local-header-padding-inline-start:0.75rem;--post-local-header-padding-inline-end:0.25rem;--post-local-header-padding-block:0rem;--post-burger-menu-padding-inline:2.5rem;--post-burger-menu-body-gap:2rem;--post-burger-menu-footer-gap:1.5rem}}@media screen and (min-width: 600px)and (max-width: 779.98px){:host{--post-burger-menu-padding-inline:1rem}}@media screen and (min-width: 0)and (max-width: 599.98px){:host{--post-header-gap:0.75rem 0.25rem;--post-global-header-padding-inline-start:0rem;--post-global-header-padding-inline-end:0.5rem;--post-local-header-padding-inline-start:0.5rem;--post-local-header-padding-inline-end:0.5rem;--post-local-header-padding-block:0rem;--post-burger-menu-padding-inline:1rem;--post-burger-menu-body-gap:1.5rem;--post-burger-menu-footer-gap:1rem}}:host([data-expanded]),:host([data-menu-extended]){--post-header-top:0;--post-global-header-top:-0.001px;--post-global-controls-top:0;--post-logo-height:var(--post-global-header-expanded-height)}*,::before,::after{box-sizing:border-box}:host,header,.global-header,.local-header{transition:inset-block-start 150ms cubic-bezier(0.4, 0, 0.2, 1)}.global-header,.local-header,.burger-menu{box-shadow:var(--post-device-elevation-300)}.global-header,.sliding-controls,.local-header,.navigation{display:flex;align-items:center;justify-content:space-between;gap:var(--post-header-gap)}:host{container-type:inline-size;display:block;position:sticky;inset-block-start:var(--post-header-top);z-index:1020}:host post-togglebutton{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)}:host post-togglebutton:hover{text-decoration:none}:host post-togglebutton:disabled{border-style:var(--post-core-border-style-dash)}:host post-togglebutton{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}:host post-togglebutton:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host post-togglebutton:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){:host post-togglebutton:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host post-togglebutton: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){:host post-togglebutton:is(a){color:LinkText;border:unset}:host post-togglebutton:is(button){background-color:ButtonFace !important;border:1px solid ButtonBorder !important}:host post-togglebutton:not(:disabled,.disabled):is(button):hover{background-color:Highlight !important}:host post-togglebutton:not(:disabled,.disabled):is(button):hover>post-icon{color:HighlightText !important}}:host post-togglebutton: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)}:host post-togglebutton: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)}:host post-togglebutton: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)}@media screen and (min-width: 0)and (max-width: 599.98px){:host post-togglebutton{padding:.625rem}:host post-togglebutton>:not(post-icon){display:none}:host post-togglebutton>post-icon{font-size:1.5rem}}.global-header{z-index:2;position:sticky;inset-block-start:var(--post-global-header-top);background-color:#fc0;height:var(--post-global-header-expanded-height);padding-inline-start:var(--post-global-header-padding-inline-start);padding-inline-end:var(--post-global-header-padding-inline-end)}.global-header:has(~.local-header:not(.no-title.no-navigation)),.global-header:has(~.burger-menu.extended){box-shadow:none}.global-header .logo{align-self:flex-end;width:var(--post-global-header-expanded-height);height:var(--post-logo-height);min-height:var(--post-global-header-reduced-height);max-height:100%;margin-inline-end:calc(1.25rem - var(--post-header-gap))}.global-header .sliding-controls{flex-grow:1;justify-content:flex-end;position:relative;inset-block-start:var(--post-global-controls-top)}.global-header .audience{margin-inline-end:auto}.global-header.no-audience .audience{display:none}.local-header{position:relative;flex-wrap:wrap;background-color:#fff;min-height:var(--post-local-header-expanded-min-height);padding-inline-start:var(--post-local-header-padding-inline-start);padding-inline-end:var(--post-local-header-padding-inline-end);padding-block:var(--post-local-header-padding-block)}.local-header:not(.no-title,.no-navigation){padding-block-start:1.125rem}.local-header.no-title.no-navigation{display:none}.local-header:has(.navigation.megadropdown-open),.local-header:has(~.burger-menu.extended){box-shadow:none}.local-header:has(.navigation.megadropdown-open)::after,.local-header:has(~.burger-menu.extended)::after{content:\"\";display:block;position:absolute;inset-inline:0;inset-block-end:0;height:1px;background-color:#e1e0dc}.local-header .navigation{flex:1 0 100%;height:var(--post-main-navigation-height);margin-inline-start:calc(-1*var(--post-local-header-padding-inline-start));max-width:100cqw}.local-header.no-navigation .navigation{display:none}.local-header .local-nav{flex:0 0 auto}.local-header.no-local-nav .navigation{margin-inline-end:calc(-1*var(--post-local-header-padding-inline-end))}.local-header.no-local-nav .local-nav{display:none}.burger-menu{z-index:-1;position:absolute;inset-inline:0;inset-block-start:100%;height:calc(min(var(--post-header-scroll-parent-height, 100dvh),100dvh) - var(--post-header-height));overflow:hidden auto;display:flex;flex-direction:column;background-color:#fafafa}.burger-menu.extended.megadropdown-open{overflow:hidden}.burger-menu:not(.extended){transform:translateY(-100%);display:none}.burger-menu:not(.extended)>*{display:none}.burger-menu .burger-menu-body,.burger-menu .burger-menu-footer{display:flex;flex-direction:column;padding-inline:var(--post-burger-menu-padding-inline)}.burger-menu .burger-menu-body{flex-grow:1;padding-block:1.5rem;gap:var(--post-burger-menu-body-gap)}.burger-menu .burger-menu-footer{background-color:#f0efed;padding-block:1rem 1.5rem;gap:var(--post-burger-menu-footer-gap)}.burger-menu .local-nav{min-height:3.5rem;display:flex;align-items:center;justify-content:flex-end;padding-inline:.25rem}.burger-menu.no-local-nav .local-nav{display:none}";
|
|
32
11
|
|
|
33
12
|
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
34
13
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -41,7 +20,7 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
|
|
|
41
20
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
42
21
|
};
|
|
43
22
|
const PostHeader$1 = /*@__PURE__*/ proxyCustomElement(class PostHeader extends HTMLElement {
|
|
44
|
-
get
|
|
23
|
+
get hasBurgerMenu() {
|
|
45
24
|
return this.device !== 'desktop' && this.hasNavigation;
|
|
46
25
|
}
|
|
47
26
|
get scrollParent() {
|
|
@@ -58,10 +37,13 @@ const PostHeader$1 = /*@__PURE__*/ proxyCustomElement(class PostHeader extends H
|
|
|
58
37
|
}
|
|
59
38
|
return document.body;
|
|
60
39
|
}
|
|
40
|
+
validateTextMenu() {
|
|
41
|
+
checkRequiredAndType(this, 'textMenu', 'string');
|
|
42
|
+
}
|
|
61
43
|
lockBody(newValue, _oldValue, propName) {
|
|
62
44
|
const scrollParent = this.scrollParent;
|
|
63
|
-
const
|
|
64
|
-
if (this.device !== 'desktop' &&
|
|
45
|
+
const burgerMenuExtended = propName === 'burgerMenuExtended' ? newValue : this.burgerMenuExtended;
|
|
46
|
+
if (this.device !== 'desktop' && burgerMenuExtended) {
|
|
65
47
|
scrollParent.setAttribute('data-post-scroll-locked', '');
|
|
66
48
|
this.host.addEventListener('keydown', this.keyboardHandler);
|
|
67
49
|
}
|
|
@@ -75,16 +57,22 @@ const PostHeader$1 = /*@__PURE__*/ proxyCustomElement(class PostHeader extends H
|
|
|
75
57
|
this.__registerHost();
|
|
76
58
|
this.__attachShadow();
|
|
77
59
|
this.throttledResize = throttle(50, () => this.updateLocalHeaderHeight());
|
|
60
|
+
this.animationOptions = {
|
|
61
|
+
duration: 350,
|
|
62
|
+
easing: 'headerEase',
|
|
63
|
+
};
|
|
78
64
|
this.device = breakpoint.get('device');
|
|
79
65
|
this.hasNavigation = false;
|
|
66
|
+
this.hasLocalNav = false;
|
|
67
|
+
this.hasAudience = false;
|
|
80
68
|
this.hasTitle = false;
|
|
81
|
-
this.
|
|
69
|
+
this.burgerMenuExtended = false;
|
|
82
70
|
this.megadropdownOpen = false;
|
|
83
71
|
this.breakpointChange = (e) => {
|
|
84
72
|
this.device = e.detail;
|
|
85
73
|
this.switchLanguageSwitchMode();
|
|
86
|
-
if (this.device === 'desktop' && this.
|
|
87
|
-
this.
|
|
74
|
+
if (this.device === 'desktop' && this.burgerMenuExtended) {
|
|
75
|
+
this.closeBurgerMenu();
|
|
88
76
|
}
|
|
89
77
|
if (this.device !== 'desktop') {
|
|
90
78
|
Array.from(this.host.querySelectorAll('post-megadropdown')).forEach(dropdown => {
|
|
@@ -93,14 +81,14 @@ const PostHeader$1 = /*@__PURE__*/ proxyCustomElement(class PostHeader extends H
|
|
|
93
81
|
this.megadropdownOpen = false;
|
|
94
82
|
}
|
|
95
83
|
};
|
|
96
|
-
this.megadropdownStateHandler = (event) => {
|
|
97
|
-
this.megadropdownOpen = event.detail.isVisible;
|
|
98
|
-
};
|
|
99
84
|
this.handleScrollEvent = this.handleScrollEvent.bind(this);
|
|
100
85
|
this.updateScrollParentHeight = this.updateScrollParentHeight.bind(this);
|
|
101
86
|
this.updateLocalHeaderHeight = this.updateLocalHeaderHeight.bind(this);
|
|
102
87
|
this.keyboardHandler = this.keyboardHandler.bind(this);
|
|
103
88
|
this.handleLinkClick = this.handleLinkClick.bind(this);
|
|
89
|
+
this.megadropdownStateHandler = this.megadropdownStateHandler.bind(this);
|
|
90
|
+
this.checkSlottedContent = this.checkSlottedContent.bind(this);
|
|
91
|
+
this.megadropdownStateHandler = this.megadropdownStateHandler.bind(this);
|
|
104
92
|
}
|
|
105
93
|
connectedCallback() {
|
|
106
94
|
window.addEventListener('resize', this.throttledResize, { passive: true });
|
|
@@ -111,23 +99,23 @@ const PostHeader$1 = /*@__PURE__*/ proxyCustomElement(class PostHeader extends H
|
|
|
111
99
|
passive: true,
|
|
112
100
|
});
|
|
113
101
|
document.addEventListener('postToggleMegadropdown', this.megadropdownStateHandler);
|
|
114
|
-
this.host.addEventListener('click', this.handleLinkClick);
|
|
115
102
|
window.addEventListener('postBreakpoint:device', this.breakpointChange);
|
|
116
|
-
this.checkNavigationExistence();
|
|
117
|
-
this.checkTitleExistence();
|
|
118
|
-
this.switchLanguageSwitchMode();
|
|
119
103
|
this.handleScrollParentResize();
|
|
120
|
-
this.lockBody(false, this.
|
|
104
|
+
this.lockBody(false, this.burgerMenuExtended, 'burgerMenuExtended');
|
|
121
105
|
}
|
|
122
106
|
componentWillRender() {
|
|
123
107
|
this.handleScrollEvent();
|
|
108
|
+
this.handleSlottedContentChanges();
|
|
109
|
+
this.switchLanguageSwitchMode();
|
|
124
110
|
}
|
|
125
111
|
componentDidRender() {
|
|
112
|
+
this.validateTextMenu();
|
|
126
113
|
this.getFocusableElements();
|
|
127
114
|
this.handleLocalHeaderResize();
|
|
128
115
|
}
|
|
129
116
|
componentDidLoad() {
|
|
130
117
|
this.updateLocalHeaderHeight();
|
|
118
|
+
this.host.shadowRoot.addEventListener('click', this.handleLinkClick);
|
|
131
119
|
}
|
|
132
120
|
// Clean up possible side effects when post-header is disconnected
|
|
133
121
|
disconnectedCallback() {
|
|
@@ -139,7 +127,9 @@ const PostHeader$1 = /*@__PURE__*/ proxyCustomElement(class PostHeader extends H
|
|
|
139
127
|
scrollParent.removeEventListener('scroll', this.handleScrollEvent);
|
|
140
128
|
document.removeEventListener('postToggleMegadropdown', this.megadropdownStateHandler);
|
|
141
129
|
this.host.removeEventListener('keydown', this.keyboardHandler);
|
|
142
|
-
this.host.
|
|
130
|
+
if (this.host.shadowRoot) {
|
|
131
|
+
this.host.shadowRoot.removeEventListener('click', this.handleLinkClick);
|
|
132
|
+
}
|
|
143
133
|
if (this.scrollParentResizeObserver) {
|
|
144
134
|
this.scrollParentResizeObserver.disconnect();
|
|
145
135
|
this.scrollParentResizeObserver = null;
|
|
@@ -148,81 +138,72 @@ const PostHeader$1 = /*@__PURE__*/ proxyCustomElement(class PostHeader extends H
|
|
|
148
138
|
this.localHeaderResizeObserver.disconnect();
|
|
149
139
|
this.localHeaderResizeObserver = null;
|
|
150
140
|
}
|
|
151
|
-
this.
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
this.hasNavigation = this.host.querySelectorAll('post-mainnavigation').length > 0;
|
|
155
|
-
}
|
|
156
|
-
checkTitleExistence() {
|
|
157
|
-
this.hasTitle = this.host.querySelectorAll('[slot="title"]').length > 0;
|
|
158
|
-
}
|
|
159
|
-
async closeMobileMenu() {
|
|
160
|
-
this.mobileMenuAnimation.finish();
|
|
161
|
-
const menuButton = this.getMenuButton();
|
|
162
|
-
if (menuButton) {
|
|
163
|
-
menuButton.toggled = false;
|
|
141
|
+
if (this.slottedContentObserver) {
|
|
142
|
+
this.slottedContentObserver.disconnect();
|
|
143
|
+
this.slottedContentObserver = null;
|
|
164
144
|
}
|
|
165
|
-
this.
|
|
145
|
+
this.burgerMenuExtended = false;
|
|
146
|
+
}
|
|
147
|
+
async closeBurgerMenu() {
|
|
148
|
+
this.burgerMenuAnimation?.finish();
|
|
149
|
+
if (this.burgerMenuButton)
|
|
150
|
+
this.burgerMenuButton.toggled = false;
|
|
151
|
+
this.burgerMenuExtended = false;
|
|
166
152
|
}
|
|
167
153
|
/**
|
|
168
|
-
* Toggles the
|
|
154
|
+
* Toggles the burger navigation menu.
|
|
169
155
|
*/
|
|
170
|
-
async
|
|
156
|
+
async toggleBurgerMenu(force) {
|
|
171
157
|
if (this.device === 'desktop')
|
|
172
158
|
return;
|
|
173
|
-
this.
|
|
174
|
-
?
|
|
175
|
-
:
|
|
159
|
+
this.burgerMenuAnimation = this.burgerMenuExtended
|
|
160
|
+
? fade(this.burgerMenu, 'out', this.animationOptions)
|
|
161
|
+
: fade(this.burgerMenu, 'in', this.animationOptions);
|
|
176
162
|
// Update the state of the toggle button
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
if (this.
|
|
163
|
+
if (this.burgerMenuButton)
|
|
164
|
+
this.burgerMenuButton.toggled = force ?? !this.burgerMenuExtended;
|
|
165
|
+
if (this.burgerMenuExtended) {
|
|
180
166
|
// Wait for the close animation to finish before hiding megadropdowns
|
|
181
|
-
await this.
|
|
182
|
-
this.
|
|
183
|
-
if (this.
|
|
167
|
+
await this.burgerMenuAnimation.finished;
|
|
168
|
+
this.burgerMenuExtended = force ?? !this.burgerMenuExtended;
|
|
169
|
+
if (this.burgerMenuExtended === false) {
|
|
184
170
|
this.closeAllMegadropdowns();
|
|
171
|
+
this.burgerMenu.scrollTop = 0;
|
|
185
172
|
}
|
|
186
173
|
}
|
|
187
174
|
else {
|
|
188
|
-
this.
|
|
175
|
+
this.burgerMenuExtended = force ?? !this.burgerMenuExtended;
|
|
189
176
|
// If opening, close any open megadropdowns immediately
|
|
190
177
|
if (this.megadropdownOpen) {
|
|
191
178
|
this.closeAllMegadropdowns();
|
|
192
179
|
}
|
|
193
180
|
}
|
|
194
181
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
// Get elements in the correct order (different as the DOM order)
|
|
198
|
-
const focusableEls = [
|
|
199
|
-
...Array.from(this.host.querySelectorAll('.list-inline:not([slot="meta-navigation"]) > li')),
|
|
200
|
-
...Array.from(this.host.querySelectorAll('nav > post-list > div > post-list-item, post-megadropdown-trigger')),
|
|
201
|
-
...Array.from(this.host.querySelectorAll('.list-inline[slot="meta-navigation"] > li, post-language-option')),
|
|
202
|
-
];
|
|
203
|
-
// Add the main toggle menu button to the list of focusable children
|
|
204
|
-
const focusableChildren = [
|
|
205
|
-
this.host.querySelector('post-togglebutton'),
|
|
206
|
-
...focusableEls.flatMap(el => Array.from(getFocusableChildren(el))),
|
|
207
|
-
];
|
|
208
|
-
this.firstFocusableEl = focusableChildren[0];
|
|
209
|
-
this.lastFocusableEl = focusableChildren[focusableChildren.length - 1];
|
|
182
|
+
megadropdownStateHandler(event) {
|
|
183
|
+
this.megadropdownOpen = event.detail.isVisible;
|
|
210
184
|
}
|
|
211
|
-
|
|
212
|
-
|
|
185
|
+
// Get all the focusable elements in the post-header burger menu
|
|
186
|
+
getFocusableElements() {
|
|
187
|
+
if (!this.burgerMenu)
|
|
188
|
+
return;
|
|
189
|
+
const focusableElements = [this.burgerMenuButton];
|
|
190
|
+
focusableElements.push(...getDeepFocusableChildren(this.localHeader, el => !el.matches('post-megadropdown')), ...getDeepFocusableChildren(this.burgerMenu, el => !el.matches('post-megadropdown')));
|
|
191
|
+
this.firstFocusableEl = focusableElements[0];
|
|
192
|
+
this.lastFocusableEl = focusableElements[focusableElements.length - 1];
|
|
213
193
|
}
|
|
214
194
|
keyboardHandler(e) {
|
|
215
|
-
if (e.key
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
195
|
+
if (e.key !== 'Tab' || !this.burgerMenuExtended)
|
|
196
|
+
return;
|
|
197
|
+
const activeElement = this.host.shadowRoot.activeElement || document.activeElement;
|
|
198
|
+
if (e.shiftKey && activeElement === this.firstFocusableEl) {
|
|
199
|
+
// If back tab (Tab + Shift) and first element is focused, focus goes to the last element of the megadropdown
|
|
200
|
+
e.preventDefault();
|
|
201
|
+
this.lastFocusableEl.focus();
|
|
202
|
+
}
|
|
203
|
+
else if (!e.shiftKey && activeElement === this.lastFocusableEl) {
|
|
204
|
+
// If Tab and last element is focused, focus goes back to the first element of the megadropdown
|
|
205
|
+
e.preventDefault();
|
|
206
|
+
this.firstFocusableEl.focus();
|
|
226
207
|
}
|
|
227
208
|
}
|
|
228
209
|
closeAllMegadropdowns() {
|
|
@@ -233,7 +214,7 @@ const PostHeader$1 = /*@__PURE__*/ proxyCustomElement(class PostHeader extends H
|
|
|
233
214
|
}
|
|
234
215
|
handleScrollEvent() {
|
|
235
216
|
const scrollTop = this.scrollParent === document.body ? window.scrollY : this.scrollParent.scrollTop;
|
|
236
|
-
document.documentElement.style.setProperty('--post-header-scroll-top', `${scrollTop}px`);
|
|
217
|
+
document.documentElement.style.setProperty('--post-header-scroll-top', `${Math.max(scrollTop, 0)}px`);
|
|
237
218
|
}
|
|
238
219
|
updateLocalHeaderHeight() {
|
|
239
220
|
const localHeaderElement = this.host.shadowRoot.querySelector('.local-header');
|
|
@@ -251,8 +232,8 @@ const PostHeader$1 = /*@__PURE__*/ proxyCustomElement(class PostHeader extends H
|
|
|
251
232
|
if (!isLinkInMainNav && !isLinkInMegadropdown) {
|
|
252
233
|
return;
|
|
253
234
|
}
|
|
254
|
-
if (this.
|
|
255
|
-
this.
|
|
235
|
+
if (this.burgerMenuExtended && (isLinkInMainNav || isLinkInMegadropdown)) {
|
|
236
|
+
this.toggleBurgerMenu(false);
|
|
256
237
|
}
|
|
257
238
|
if (this.device === 'desktop' && isLinkInMegadropdown) {
|
|
258
239
|
const megadropdownLink = target.closest('post-megadropdown a');
|
|
@@ -274,60 +255,116 @@ const PostHeader$1 = /*@__PURE__*/ proxyCustomElement(class PostHeader extends H
|
|
|
274
255
|
this.localHeaderResizeObserver.observe(localHeader);
|
|
275
256
|
}
|
|
276
257
|
}
|
|
258
|
+
handleSlottedContentChanges() {
|
|
259
|
+
if (!this.slottedContentObserver) {
|
|
260
|
+
this.checkSlottedContent();
|
|
261
|
+
this.slottedContentObserver = new MutationObserver(this.checkSlottedContent);
|
|
262
|
+
this.slottedContentObserver.observe(this.host, { childList: true });
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
checkSlottedContent() {
|
|
266
|
+
this.hasNavigation = !!this.host.querySelector('[slot="main-nav"]');
|
|
267
|
+
this.hasLocalNav = !!this.host.querySelector('[slot="local-nav"]');
|
|
268
|
+
this.hasAudience = !!this.host.querySelector('[slot="audience"]');
|
|
269
|
+
this.hasTitle = !!this.host.querySelector('[slot="title"]');
|
|
270
|
+
}
|
|
277
271
|
switchLanguageSwitchMode() {
|
|
278
|
-
const variant = this.
|
|
279
|
-
Array.from(this.host.querySelectorAll('post-language-
|
|
272
|
+
const variant = this.hasBurgerMenu ? 'list' : 'menu';
|
|
273
|
+
Array.from(this.host.querySelectorAll('post-language-menu')).forEach(languageSwitch => {
|
|
280
274
|
languageSwitch?.setAttribute('variant', variant);
|
|
281
275
|
});
|
|
282
276
|
}
|
|
277
|
+
onFocusChange(e) {
|
|
278
|
+
const alwaysVisibleElements = this.device === 'desktop'
|
|
279
|
+
? '.navigation' // logo isn’t included since it would be too small to focus on effectively.
|
|
280
|
+
: '.global-header, .burger-menu';
|
|
281
|
+
const isHeaderExpanded =
|
|
282
|
+
// ensure the expanded state stays accurate during focus changes,
|
|
283
|
+
// e.g., when the focused element is removed from the DOM
|
|
284
|
+
// during a window resize
|
|
285
|
+
e.target === document.activeElement &&
|
|
286
|
+
this.host.matches(':focus-within') &&
|
|
287
|
+
!this.host.shadowRoot.querySelector(`:where(${alwaysVisibleElements}):focus-within`);
|
|
288
|
+
if (isHeaderExpanded) {
|
|
289
|
+
this.host.setAttribute('data-expanded', '');
|
|
290
|
+
}
|
|
291
|
+
else {
|
|
292
|
+
this.host.removeAttribute('data-expanded');
|
|
293
|
+
}
|
|
294
|
+
}
|
|
283
295
|
renderNavigation() {
|
|
284
|
-
const
|
|
296
|
+
const localNav = !this.hasTitle && (h("div", { class: "local-nav" }, h("slot", { name: "local-nav" })));
|
|
285
297
|
if (this.device === 'desktop') {
|
|
286
|
-
return (h("div", { class: { 'navigation': true, 'megadropdown-open': this.megadropdownOpen } },
|
|
298
|
+
return (h("div", { class: { 'navigation': true, 'megadropdown-open': this.megadropdownOpen } }, h("slot", { name: "main-nav" }), localNav));
|
|
287
299
|
}
|
|
288
|
-
return (h("div", { class: {
|
|
300
|
+
return (h("div", { class: {
|
|
301
|
+
'burger-menu': true,
|
|
302
|
+
'extended': this.burgerMenuExtended,
|
|
303
|
+
'no-local-nav': !this.hasLocalNav,
|
|
304
|
+
'megadropdown-open': this.megadropdownOpen,
|
|
305
|
+
}, style: { '--post-header-navigation-current-inset': `${this.burgerMenu?.scrollTop ?? 0}px` }, ref: el => (this.burgerMenu = el) }, localNav, h("div", { class: "burger-menu-body" }, h("slot", { name: "audience" }), h("slot", { name: "main-nav" })), h("div", { class: "burger-menu-footer" }, h("slot", { name: "global-nav-secondary" }), h("slot", { name: "language-menu" }))));
|
|
289
306
|
}
|
|
290
307
|
render() {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
308
|
+
return (h(Host, { key: '15de1ff6ccac94813df10fc0b41a518de68dee94', "data-version": version, "data-color-scheme": "light", "data-burger-menu": this.hasBurgerMenu, "data-menu-extended": this.burgerMenuExtended }, h("header", { key: '0af40c8b8944c7ffcf2bf0fe704671f4012ae8c8' }, h("div", { key: 'cd4564c5c375c015c673df195ba04fe4d89ff1c2', class: {
|
|
309
|
+
'global-header': true,
|
|
310
|
+
'no-audience': !this.hasAudience,
|
|
311
|
+
} }, h("div", { key: 'c4ad8a22fed57e54266c6584548f5203a499b63c', class: "logo" }, h("slot", { key: 'bf86f7ccf2e46263365023f287f18305160cede6', name: "post-logo" })), h("div", { key: 'e89c405cf97ddb08850d3b15ab8977e7e484ba73', class: "sliding-controls" }, this.device === 'desktop' && (h("div", { key: 'c3e9f49a105894d0df44a3d2654065b452292154', class: "audience" }, h("slot", { key: '20effc0592ca8665de464cc5d45d11ef02894acb', name: "audience" }))), h("slot", { key: 'f0ca8a59134520ccbb38907e32bedd4c05800d36', name: "global-nav-primary" }), !this.hasBurgerMenu && [
|
|
312
|
+
h("slot", { key: '7e2b2982403f491f083fc9f32cee46cbaeca7c50', name: "global-nav-secondary" }),
|
|
313
|
+
h("slot", { key: '3e7b5f6cb16b2cf2bc64b9b11c70f8b363e80134', name: "language-menu" }),
|
|
314
|
+
], h("slot", { key: 'd91059cc4dd4529040aa6436db46f66f2db84e71', name: "post-login" }), this.hasNavigation && this.device !== 'desktop' && (h("div", { key: 'f97161e09b27c11c6f85d112e85a59ddf2925aec', onClick: () => this.toggleBurgerMenu(), class: "burger-menu-toggle" }, h("slot", { key: '18304b858fa2173b63e842ba4d0512bd438a89b0', name: "post-togglebutton" }))), this.hasNavigation && this.device !== 'desktop' && (h("post-togglebutton", { key: '0599e4d106262b7be6557b476becacaf9f5656ba', ref: el => (this.burgerMenuButton = el), onClick: () => this.toggleBurgerMenu() }, h("span", { key: '3f3578f6172a9d87c531b5bef6a201b255042511' }, this.textMenu), h("post-icon", { key: '7a92cec5793716225cf9dc4646ccff585e02723b', "aria-hidden": "true", name: "burger", "data-showwhen": "untoggled" }), h("post-icon", { key: '9170844d117e8f0bf7f35049debe973ff391158e', "aria-hidden": "true", name: "closex", "data-showwhen": "toggled" }))))), h("div", { key: 'db13d084905b4633595bb1d4d83cc88c82c3c679', ref: el => (this.localHeader = el), class: {
|
|
315
|
+
'local-header': true,
|
|
316
|
+
'no-title': !this.hasTitle,
|
|
317
|
+
'no-audience': !this.hasAudience,
|
|
318
|
+
'no-navigation': this.device !== 'desktop' || !this.hasNavigation,
|
|
319
|
+
'no-local-nav': !this.hasLocalNav,
|
|
320
|
+
} }, h("slot", { key: 'f6fb25aef128bf1712995427014c5ff62c3710d0', name: "title" }), this.hasTitle && h("slot", { key: '8cba1c7b544d950140d59336baaf7398a4fb23d8', name: "local-nav" }), this.device === 'desktop' && this.renderNavigation()), this.device !== 'desktop' && this.renderNavigation())));
|
|
299
321
|
}
|
|
300
322
|
get host() { return this; }
|
|
301
323
|
static get watchers() { return {
|
|
324
|
+
"textMenu": ["validateTextMenu"],
|
|
302
325
|
"device": ["lockBody"],
|
|
303
|
-
"
|
|
326
|
+
"burgerMenuExtended": ["lockBody"]
|
|
304
327
|
}; }
|
|
305
328
|
static get style() { return postHeaderCss; }
|
|
306
329
|
}, [1, "post-header", {
|
|
330
|
+
"textMenu": [513, "text-menu"],
|
|
307
331
|
"device": [32],
|
|
308
332
|
"hasNavigation": [32],
|
|
333
|
+
"hasLocalNav": [32],
|
|
334
|
+
"hasAudience": [32],
|
|
309
335
|
"hasTitle": [32],
|
|
310
|
-
"
|
|
336
|
+
"burgerMenuExtended": [32],
|
|
311
337
|
"megadropdownOpen": [32],
|
|
312
|
-
"
|
|
313
|
-
},
|
|
338
|
+
"toggleBurgerMenu": [64]
|
|
339
|
+
}, [[0, "focusin", "onFocusChange"], [0, "focusout", "onFocusChange"]], {
|
|
340
|
+
"textMenu": ["validateTextMenu"],
|
|
314
341
|
"device": ["lockBody"],
|
|
315
|
-
"
|
|
342
|
+
"burgerMenuExtended": ["lockBody"]
|
|
316
343
|
}]);
|
|
317
344
|
__decorate([
|
|
318
345
|
EventFrom('post-megadropdown')
|
|
319
|
-
], PostHeader$1.prototype, "megadropdownStateHandler",
|
|
346
|
+
], PostHeader$1.prototype, "megadropdownStateHandler", null);
|
|
320
347
|
function defineCustomElement$1() {
|
|
321
348
|
if (typeof customElements === "undefined") {
|
|
322
349
|
return;
|
|
323
350
|
}
|
|
324
|
-
const components = ["post-header"];
|
|
351
|
+
const components = ["post-header", "post-icon", "post-togglebutton"];
|
|
325
352
|
components.forEach(tagName => { switch (tagName) {
|
|
326
353
|
case "post-header":
|
|
327
354
|
if (!customElements.get(tagName)) {
|
|
328
355
|
customElements.define(tagName, PostHeader$1);
|
|
329
356
|
}
|
|
330
357
|
break;
|
|
358
|
+
case "post-icon":
|
|
359
|
+
if (!customElements.get(tagName)) {
|
|
360
|
+
defineCustomElement$3();
|
|
361
|
+
}
|
|
362
|
+
break;
|
|
363
|
+
case "post-togglebutton":
|
|
364
|
+
if (!customElements.get(tagName)) {
|
|
365
|
+
defineCustomElement$2();
|
|
366
|
+
}
|
|
367
|
+
break;
|
|
331
368
|
} });
|
|
332
369
|
}
|
|
333
370
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { I as IS_BROWSER } from './
|
|
3
|
-
import { d as checkEmptyOrOneOf, e as checkEmptyOrType, c as checkRequiredAndType } from './
|
|
2
|
+
import { I as IS_BROWSER } from './environment.js';
|
|
3
|
+
import { d as checkEmptyOrOneOf, e as checkEmptyOrType, c as checkRequiredAndType } from './breakpoints.js';
|
|
4
4
|
import { v as version } from './package.js';
|
|
5
5
|
|
|
6
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)}}";
|
|
@@ -67,9 +67,11 @@ const PostIcon = /*@__PURE__*/ proxyCustomElement(class PostIcon extends HTMLEle
|
|
|
67
67
|
const baseHref = IS_BROWSER
|
|
68
68
|
? document.querySelector('base[href]')?.getAttribute('href') || ''
|
|
69
69
|
: '';
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
let metaIconBase = '';
|
|
71
|
+
if (IS_BROWSER) {
|
|
72
|
+
const metaTag = document.querySelector('meta[name="design-system-settings"]');
|
|
73
|
+
metaIconBase = metaTag?.getAttribute('data-post-icon-base') || '';
|
|
74
|
+
}
|
|
73
75
|
// Function to build the first part of the URL when 'this.base' or 'metaIconBase' are relative
|
|
74
76
|
const buildUrlWithBase = (relativeUrl) => {
|
|
75
77
|
const normalizedHref = normalizeUrl(baseHref);
|
|
@@ -116,7 +118,7 @@ const PostIcon = /*@__PURE__*/ proxyCustomElement(class PostIcon extends HTMLEle
|
|
|
116
118
|
this.validateAnimation();
|
|
117
119
|
}
|
|
118
120
|
render() {
|
|
119
|
-
return (h(Host, { key: '
|
|
121
|
+
return (h(Host, { key: '6469b748f2792c383593dacd1d9f1f17daf9cde0', "data-version": version }, h("span", { key: '9f4d9766dc97a07a2562dbc3bb0931de29fe9757', style: this.getStyles() })));
|
|
120
122
|
}
|
|
121
123
|
get host() { return this; }
|
|
122
124
|
static get watchers() { return {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface PostLanguageMenuItem extends Components.PostLanguageMenuItem, HTMLElement {}
|
|
4
|
+
export const PostLanguageMenuItem: {
|
|
5
|
+
prototype: PostLanguageMenuItem;
|
|
6
|
+
new (): PostLanguageMenuItem;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { c as checkRequiredAndType, d as checkEmptyOrOneOf, e as checkEmptyOrType, a as checkEmptyOrUrl } from './breakpoints.js';
|
|
3
|
+
import { v as version } from './package.js';
|
|
4
|
+
import { S as SWITCH_VARIANTS } from './switch-variants.js';
|
|
5
|
+
|
|
6
|
+
const postLanguageMenuItemCss = "post-language-menu-item{display:inline-block}post-language-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-language-menu-item button{background-color:ButtonFace !important}post-language-menu-item button:hover{background-color:Highlight !important}}post-language-menu-item button .visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}post-language-menu-item a{color:var(--post-current-fg);text-decoration:none}post-language-menu-item :is(a,button){cursor:pointer;display:flex;align-items:center;justify-content:center;width:100%;height:100%;text-transform:uppercase}post-language-menu-item :is(a,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}post-language-menu-item :is(a,button):is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;border-radius:4px}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-language-menu-item :is(a,button):is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){post-language-menu-item :is(a,button):is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;border-radius:4px}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-language-menu-item :is(a,button):is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}post-language-menu-item:where([variant=list]) :is(a,button){padding-inline:0;width:40px;height:40px;border-radius:2px}post-language-menu-item:where([variant=list]) :is(a,button):hover{color:#504f4b}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-language-menu-item:where([variant=list]) :is(a,button){border:1px solid ButtonBorder;color:ButtonText}}post-language-menu-item:where([variant=list])[active]:not([active=false]) :is(a,button){background-color:#050400 !important;color:#fff;pointer-events:none}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-language-menu-item:where([variant=list])[active]:not([active=false]) :is(a,button){background-color:Highlight !important;color:HighlightText}}post-language-menu-item:where([variant=menu]){min-width:72px}post-language-menu-item:where([variant=menu])[active]:not([active=false]){display:none}post-language-menu-item:where([variant=menu]) :is(a,button){padding-block:13px;padding-inline:16px;box-sizing:border-box;justify-content:flex-start;position:relative;border-radius:0}post-language-menu-item:where([variant=menu]) :is(a,button):hover{color:#fff;background-color:#504f4b}post-language-menu-item:where([variant=menu]):first-child :is(a,button){border-start-start-radius:4px;border-start-end-radius:4px}post-language-menu-item:where([variant=menu]):last-child :is(a,button){border-end-start-radius:4px;border-end-end-radius:4px}";
|
|
7
|
+
|
|
8
|
+
const PostLanguageMenuItem$1 = /*@__PURE__*/ proxyCustomElement(class PostLanguageMenuItem extends HTMLElement {
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
this.__registerHost();
|
|
12
|
+
this.postChange = createEvent(this, "postChange", 7);
|
|
13
|
+
this.postLanguageMenuItemInitiallyActive = createEvent(this, "postLanguageMenuItemInitiallyActive", 7);
|
|
14
|
+
}
|
|
15
|
+
validateCode() {
|
|
16
|
+
checkRequiredAndType(this, 'code', 'string');
|
|
17
|
+
}
|
|
18
|
+
validateVariant() {
|
|
19
|
+
checkEmptyOrOneOf(this, 'variant', SWITCH_VARIANTS);
|
|
20
|
+
}
|
|
21
|
+
validateName() {
|
|
22
|
+
checkEmptyOrType(this, 'name', 'string');
|
|
23
|
+
}
|
|
24
|
+
validateUrl() {
|
|
25
|
+
checkEmptyOrUrl(this, 'url');
|
|
26
|
+
}
|
|
27
|
+
componentDidLoad() {
|
|
28
|
+
this.validateCode();
|
|
29
|
+
this.validateName();
|
|
30
|
+
this.validateUrl();
|
|
31
|
+
if (!this.name && this.isNameRequired()) {
|
|
32
|
+
throw new Error('The "name" property of the post-language-menu-item component is required when the full language name is not displayed.');
|
|
33
|
+
}
|
|
34
|
+
if (this.active) {
|
|
35
|
+
this.postLanguageMenuItemInitiallyActive.emit(this.code);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Selects the language option programmatically.
|
|
40
|
+
*/
|
|
41
|
+
async select() {
|
|
42
|
+
this.active = true;
|
|
43
|
+
this.emitChange();
|
|
44
|
+
}
|
|
45
|
+
emitChange() {
|
|
46
|
+
this.postChange.emit(this.code);
|
|
47
|
+
}
|
|
48
|
+
isNameRequired() {
|
|
49
|
+
return this.host.textContent.toLowerCase() === this.code.toLowerCase();
|
|
50
|
+
}
|
|
51
|
+
render() {
|
|
52
|
+
const lang = this.code.toLowerCase();
|
|
53
|
+
const emitOnKeyDown = (e) => {
|
|
54
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
55
|
+
this.emitChange();
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
return (h(Host, { key: '0a0f6a2e04d61991696e86fa9a20b34d154e89ac', "data-version": version, role: this.variant === 'list' ? 'listitem' : undefined }, this.url ? (h("a", { "aria-current": this.active ? 'page' : undefined, href: this.url, hrefLang: lang, lang: lang, onClick: () => this.emitChange(), onKeyDown: emitOnKeyDown }, h("slot", null), h("span", { class: "visually-hidden" }, this.name))) : (h("button", { "aria-current": this.active ? 'true' : undefined, lang: lang, onClick: () => this.emitChange(), onKeyDown: emitOnKeyDown }, h("slot", null), h("span", { class: "visually-hidden" }, this.name)))));
|
|
59
|
+
}
|
|
60
|
+
get host() { return this; }
|
|
61
|
+
static get watchers() { return {
|
|
62
|
+
"code": ["validateCode"],
|
|
63
|
+
"variant": ["validateVariant"],
|
|
64
|
+
"name": ["validateName"],
|
|
65
|
+
"url": ["validateUrl"]
|
|
66
|
+
}; }
|
|
67
|
+
static get style() { return postLanguageMenuItemCss; }
|
|
68
|
+
}, [4, "post-language-menu-item", {
|
|
69
|
+
"code": [513],
|
|
70
|
+
"active": [1540],
|
|
71
|
+
"variant": [1],
|
|
72
|
+
"name": [1],
|
|
73
|
+
"url": [1],
|
|
74
|
+
"select": [64]
|
|
75
|
+
}, undefined, {
|
|
76
|
+
"code": ["validateCode"],
|
|
77
|
+
"variant": ["validateVariant"],
|
|
78
|
+
"name": ["validateName"],
|
|
79
|
+
"url": ["validateUrl"]
|
|
80
|
+
}]);
|
|
81
|
+
function defineCustomElement$1() {
|
|
82
|
+
if (typeof customElements === "undefined") {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const components = ["post-language-menu-item"];
|
|
86
|
+
components.forEach(tagName => { switch (tagName) {
|
|
87
|
+
case "post-language-menu-item":
|
|
88
|
+
if (!customElements.get(tagName)) {
|
|
89
|
+
customElements.define(tagName, PostLanguageMenuItem$1);
|
|
90
|
+
}
|
|
91
|
+
break;
|
|
92
|
+
} });
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const PostLanguageMenuItem = PostLanguageMenuItem$1;
|
|
96
|
+
const defineCustomElement = defineCustomElement$1;
|
|
97
|
+
|
|
98
|
+
export { PostLanguageMenuItem, defineCustomElement };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Components, JSX } from "../types/components";
|
|
2
2
|
|
|
3
|
-
interface
|
|
4
|
-
export const
|
|
5
|
-
prototype:
|
|
6
|
-
new ():
|
|
3
|
+
interface PostLanguageMenu extends Components.PostLanguageMenu, HTMLElement {}
|
|
4
|
+
export const PostLanguageMenu: {
|
|
5
|
+
prototype: PostLanguageMenu;
|
|
6
|
+
new (): PostLanguageMenu;
|
|
7
7
|
};
|
|
8
8
|
/**
|
|
9
9
|
* Used to define this component and all nested components recursively.
|