@swisspost/design-system-components 10.0.0-next.55 → 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/{esm/breakpoints-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-CKNxhb0S.js} +21 -13
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{package-DkJrv93P.js → package-CY7IOoiw.js} +1 -1
- package/dist/cjs/post-accordion_2.cjs.entry.js +11 -11
- package/dist/cjs/post-avatar.cjs.entry.js +10 -10
- 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} +481 -484
- package/dist/cjs/post-collapsible_2.cjs.entry.js +33 -33
- 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 +11 -11
- package/dist/cjs/post-rating.cjs.entry.js +13 -13
- package/dist/cjs/post-stepper-item.cjs.entry.js +4 -4
- package/dist/cjs/post-stepper.cjs.entry.js +29 -26
- 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 +6 -6
- 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 +6 -6
- package/dist/collection/components/post-accordion/post-accordion.css +1 -1
- 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.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 +24 -24
- package/dist/collection/components/post-card-control/post-card-control.js +2 -2
- 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 +1 -1
- package/dist/collection/components/post-footer/post-footer.css +1 -1
- package/dist/collection/components/post-footer/post-footer.js +17 -15
- package/dist/collection/components/post-header/post-header.css +1 -1
- package/dist/collection/components/post-header/post-header.js +113 -82
- 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} +23 -23
- 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} +13 -13
- 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 +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 +79 -73
- package/dist/collection/components/post-menu/post-menu.css +1 -1
- package/dist/collection/components/post-menu/post-menu.js +34 -34
- 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.js +9 -9
- 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 +2 -2
- package/dist/collection/components/post-stepper/post-stepper.js +34 -31
- 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 +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.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 +4 -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 +10 -10
- package/dist/components/index.js +5 -5
- package/dist/components/package.js +1 -1
- package/dist/components/post-accordion-item2.js +4 -5
- package/dist/components/post-accordion2.js +2 -3
- package/dist/components/post-avatar.js +2 -3
- 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 +23 -33
- package/dist/components/post-card-control.js +3 -4
- package/dist/components/post-closebutton2.js +3 -4
- package/dist/components/post-collapsible-trigger2.js +2 -3
- 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 +97 -95
- 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 +71 -78
- package/dist/components/post-megadropdown.js +182 -77
- package/dist/components/post-menu-item2.js +1 -1
- package/dist/components/post-menu-trigger2.js +2 -3
- package/dist/components/post-menu2.js +34 -35
- package/dist/components/{post-tab-header.d.ts → post-pagination.d.ts} +4 -4
- package/dist/components/post-pagination.js +635 -0
- package/dist/components/post-popover-trigger.js +41 -26
- package/dist/components/post-popover.js +8 -9
- package/dist/components/post-popovercontainer2.js +44 -40
- package/dist/components/post-rating.js +2 -3
- package/dist/components/post-stepper-item.js +2 -2
- package/dist/components/post-stepper.js +31 -29
- package/dist/components/{post-list-item.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 +2 -3
- 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-DBPOV12C.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-LtiDhYis.js → p-BYCGzO-t.js} +5 -6
- 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-CSAMO7iJ.js → p-CnZWXrbA.js} +39 -40
- 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-Djvj8fd2.js → p-DBO6FfHt.js} +4 -5
- package/dist/components/react/{p-Ccrl2AQn.js → p-DRfa3MOV.js} +26 -26
- package/dist/components/react/{p-Cwiv86_f.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-D2waO0Zc.js → p-L36-yvgK.js} +2 -2
- package/dist/components/react/{p-CewRvBtg.js → p-NCAcc7ZZ.js} +4 -5
- package/dist/components/react/{p-DVGEExot.js → p-QNPIvxLq.js} +45 -41
- package/dist/components/react/{p-XrZzCOKT.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 +3 -4
- 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 +30 -40
- package/dist/components/react/post-card-control.js +5 -6
- 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 +99 -97
- 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 +73 -80
- package/dist/components/react/post-megadropdown.js +184 -79
- 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-tab-header.d.ts → post-pagination.d.ts} +4 -4
- 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 +13 -14
- package/dist/components/react/post-popovercontainer.js +1 -1
- package/dist/components/react/post-rating.js +4 -5
- package/dist/components/react/post-stepper-item.js +3 -3
- package/dist/components/react/post-stepper.js +32 -30
- package/dist/components/react/{post-list-item.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 +4 -5
- package/dist/components/utils.js +24 -0
- package/dist/docs.json +854 -597
- package/dist/{components/react/p-CJ80BZ06.js → esm/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-wEFJ-c34.js → index-1ReqxAnI.js} +21 -13
- package/dist/esm/loader.js +3 -3
- package/dist/esm/package-DZ5m2Ttg.js +3 -0
- package/dist/esm/post-accordion_2.entry.js +9 -9
- package/dist/esm/post-avatar.entry.js +5 -5
- 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} +462 -463
- package/dist/esm/post-collapsible_2.entry.js +30 -30
- 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 +10 -10
- package/dist/esm/post-rating.entry.js +5 -5
- package/dist/esm/post-stepper-item.entry.js +4 -4
- package/dist/esm/post-stepper.entry.js +28 -25
- 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 +5 -5
- package/dist/esm/utils-CoDiS_Ik.js +24 -0
- package/dist/post-components/{p-7f635728.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-a9644e54.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-cd03e6f2.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-57288cb2.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-af030a3a.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-e62e1f57.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-footer/post-footer.d.ts +4 -4
- package/dist/types/components/post-header/post-header.d.ts +18 -13
- 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 +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.d.ts +311 -200
- 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 +1740 -863
- package/hydrate/index.mjs +1740 -863
- package/package.json +6 -7
- 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-BhxZzOEC.js +0 -3
- package/dist/components/react/p-CYkf_7Y5.js +0 -89
- package/dist/components/react/p-SbIC4aZX.js +0 -11
- 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/fade-SbIC4aZX.js +0 -11
- 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-24dc54d1.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-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-CBFgkSgY.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-b8ba8139.entry.js +0 -1
- package/dist/post-components/p-db935e8e.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 → p-rEfV4v4a.js} +0 -0
- /package/dist/types/components/{post-language-switch → post-language-menu}/switch-variants.d.ts +0 -0
|
@@ -1,15 +1,64 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { g as getFocusableChildren } from './get-focusable-children.js';
|
|
3
3
|
import { v as version } from './package.js';
|
|
4
|
-
import {
|
|
4
|
+
import { c as checkRequiredAndType, g as breakpoint } from './breakpoints.js';
|
|
5
|
+
import { r as resolveEasing } from './utils.js';
|
|
6
|
+
import { f as fadeSlide } from './fade-slide.js';
|
|
7
|
+
import { d as defineCustomElement$3 } from './post-closebutton2.js';
|
|
8
|
+
import { d as defineCustomElement$2 } from './post-icon2.js';
|
|
5
9
|
|
|
6
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Used by PostMegadropdown (burger menu)
|
|
12
|
+
*/
|
|
13
|
+
const defaultOptions = {
|
|
14
|
+
translate: 100,
|
|
15
|
+
duration: 500,
|
|
16
|
+
easing: 'ease',
|
|
17
|
+
fill: 'none',
|
|
18
|
+
};
|
|
19
|
+
function animateSlide(el, keyframes, options) {
|
|
20
|
+
const { duration, easing, fill } = { ...defaultOptions, ...options };
|
|
21
|
+
return el.animate(keyframes, { duration, easing: resolveEasing(easing), fill });
|
|
22
|
+
}
|
|
23
|
+
function slide(el, direction, options = {}) {
|
|
24
|
+
const mergedOptions = {
|
|
25
|
+
...defaultOptions,
|
|
26
|
+
...options,
|
|
27
|
+
};
|
|
28
|
+
const { translate } = mergedOptions;
|
|
29
|
+
const baseKeyframes = [
|
|
30
|
+
{ transform: `translateX(${translate}%)` },
|
|
31
|
+
{ transform: 'translateX(0)' },
|
|
32
|
+
];
|
|
33
|
+
const keyframes = direction === 'in' ? baseKeyframes : [...baseKeyframes].reverse();
|
|
34
|
+
return animateSlide(el, keyframes, options);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const postMegadropdownCss = "*,::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%;max-height:calc(100vh - var(--post-header-height) - 3rem);padding:2rem 2.5rem 2.5rem}.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;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;display:flex;flex-direction:column}}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.megadropdown{border-block-end:1px solid CanvasText}}.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}}";
|
|
7
38
|
|
|
8
39
|
const PostMegadropdown$1 = /*@__PURE__*/ proxyCustomElement(class PostMegadropdown extends HTMLElement {
|
|
40
|
+
validateTextClose() {
|
|
41
|
+
checkRequiredAndType(this, 'textClose', 'string');
|
|
42
|
+
}
|
|
43
|
+
validateTextBack() {
|
|
44
|
+
checkRequiredAndType(this, 'textBack', 'string');
|
|
45
|
+
}
|
|
46
|
+
get megadropdownTrigger() {
|
|
47
|
+
const hostId = this.host.getAttribute('id');
|
|
48
|
+
return hostId ? document.querySelector(`post-megadropdown-trigger[for="${hostId}"]`) : null;
|
|
49
|
+
}
|
|
9
50
|
constructor() {
|
|
10
51
|
super();
|
|
11
52
|
this.__registerHost();
|
|
53
|
+
this.__attachShadow();
|
|
12
54
|
this.postToggleMegadropdown = createEvent(this, "postToggleMegadropdown", 7);
|
|
55
|
+
this.currentAnimation = null;
|
|
56
|
+
this.isAnimating = false;
|
|
57
|
+
this.fsAnimationOptions = {
|
|
58
|
+
translate: -10,
|
|
59
|
+
duration: 350,
|
|
60
|
+
easing: 'headerEase',
|
|
61
|
+
};
|
|
13
62
|
this.device = breakpoint.get('device');
|
|
14
63
|
/**
|
|
15
64
|
* Holds the current visibility state of the dropdown.
|
|
@@ -20,13 +69,17 @@ const PostMegadropdown$1 = /*@__PURE__*/ proxyCustomElement(class PostMegadropdo
|
|
|
20
69
|
this.trigger = false;
|
|
21
70
|
/** Holds the current animation class. */
|
|
22
71
|
this.animationClass = null;
|
|
23
|
-
this.handleClickOutside = (event) => {
|
|
72
|
+
this.handleClickOutside = async (event) => {
|
|
24
73
|
if (this.device !== 'desktop')
|
|
25
74
|
return;
|
|
26
75
|
const target = event.target;
|
|
27
76
|
if (this.host.contains(target)) {
|
|
28
77
|
return;
|
|
29
78
|
}
|
|
79
|
+
// Ignore clicks on the trigger or its contents to prevent running hide() twice
|
|
80
|
+
if (this.megadropdownTrigger.contains(target)) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
30
83
|
if (target instanceof HTMLElement) {
|
|
31
84
|
const trigger = target.closest('post-megadropdown-trigger');
|
|
32
85
|
if (trigger) {
|
|
@@ -36,14 +89,11 @@ const PostMegadropdown$1 = /*@__PURE__*/ proxyCustomElement(class PostMegadropdo
|
|
|
36
89
|
}
|
|
37
90
|
}
|
|
38
91
|
}
|
|
39
|
-
this.hide(false);
|
|
92
|
+
await this.hide(false);
|
|
40
93
|
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return hostId
|
|
45
|
-
? document.querySelector(`post-megadropdown-trigger[for="${hostId}"] > button`)
|
|
46
|
-
: null;
|
|
94
|
+
this.keyboardHandler = this.keyboardHandler.bind(this);
|
|
95
|
+
this.handleTabOutside = this.handleTabOutside.bind(this);
|
|
96
|
+
this.handleClickOutside = this.handleClickOutside.bind(this);
|
|
47
97
|
}
|
|
48
98
|
connectedCallback() {
|
|
49
99
|
window.addEventListener('postBreakpoint:device', this.breakpointChange.bind(this));
|
|
@@ -52,16 +102,17 @@ const PostMegadropdown$1 = /*@__PURE__*/ proxyCustomElement(class PostMegadropdo
|
|
|
52
102
|
this.getFocusableElements();
|
|
53
103
|
}
|
|
54
104
|
componentDidLoad() {
|
|
105
|
+
this.validateTextClose();
|
|
106
|
+
this.validateTextBack();
|
|
55
107
|
this.checkInitialAriaCurrent();
|
|
56
108
|
this.setupObserver();
|
|
57
109
|
this.handleAriaCurrentChange([]);
|
|
58
110
|
}
|
|
59
111
|
disconnectedCallback() {
|
|
60
|
-
this.removeListeners();
|
|
61
112
|
window.removeEventListener('postBreakpoint:device', this.breakpointChange.bind(this));
|
|
62
|
-
if (PostMegadropdown.activeDropdown === this)
|
|
113
|
+
if (PostMegadropdown.activeDropdown === this)
|
|
63
114
|
PostMegadropdown.activeDropdown = null;
|
|
64
|
-
|
|
115
|
+
this.removeListeners();
|
|
65
116
|
if (this.defaultSlotObserver) {
|
|
66
117
|
this.defaultSlotObserver.disconnect();
|
|
67
118
|
}
|
|
@@ -70,41 +121,70 @@ const PostMegadropdown$1 = /*@__PURE__*/ proxyCustomElement(class PostMegadropdo
|
|
|
70
121
|
* Toggles the dropdown visibility based on its current state.
|
|
71
122
|
*/
|
|
72
123
|
async toggle() {
|
|
73
|
-
if (this.
|
|
74
|
-
this
|
|
75
|
-
|
|
76
|
-
else {
|
|
77
|
-
await this.show();
|
|
124
|
+
if (this.isAnimating) {
|
|
125
|
+
// If this is already animating towards a future state -> reverse intent
|
|
126
|
+
return this.isVisible ? this.show() : this.hide();
|
|
78
127
|
}
|
|
128
|
+
return this.isVisible ? this.hide() : this.show();
|
|
79
129
|
}
|
|
80
130
|
/**
|
|
81
131
|
* Displays the dropdown.
|
|
82
132
|
*/
|
|
83
133
|
async show() {
|
|
134
|
+
if (this.device !== 'desktop') {
|
|
135
|
+
const trigger = this.megadropdownTrigger;
|
|
136
|
+
if (trigger)
|
|
137
|
+
this.megadropdownTitle = trigger.innerHTML;
|
|
138
|
+
}
|
|
84
139
|
if (PostMegadropdown.activeDropdown && PostMegadropdown.activeDropdown !== this) {
|
|
85
140
|
// Close the previously active dropdown without animation
|
|
86
141
|
PostMegadropdown.activeDropdown.forceClose();
|
|
87
142
|
}
|
|
88
|
-
this.
|
|
143
|
+
this.cancelAnimation();
|
|
144
|
+
// Set the megadropdown visible and mark it as the active dropdown
|
|
89
145
|
this.isVisible = true;
|
|
90
146
|
PostMegadropdown.activeDropdown = this;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
this.
|
|
147
|
+
// Update trigger state
|
|
148
|
+
this.postToggleMegadropdown.emit({ isVisible: true });
|
|
149
|
+
try {
|
|
150
|
+
await this.animate('in');
|
|
151
|
+
this.focusFirst();
|
|
152
|
+
// After the megadropdown has finished entry animation
|
|
153
|
+
this.addListeners();
|
|
154
|
+
}
|
|
155
|
+
catch {
|
|
156
|
+
// Open animation was cancelled - reset state
|
|
157
|
+
this.removeListeners();
|
|
158
|
+
this.isVisible = false;
|
|
159
|
+
if (PostMegadropdown.activeDropdown === this)
|
|
160
|
+
PostMegadropdown.activeDropdown = null;
|
|
161
|
+
this.postToggleMegadropdown.emit({ isVisible: false, focusParent: true });
|
|
95
162
|
}
|
|
96
|
-
this.addListeners();
|
|
97
163
|
}
|
|
98
164
|
/**
|
|
99
165
|
* Hides the dropdown with an animation.
|
|
100
166
|
*/
|
|
101
167
|
async hide(focusParent = true, forceClose = false) {
|
|
102
|
-
this.postToggleMegadropdown.emit({ isVisible: false, focusParent: focusParent });
|
|
103
168
|
if (forceClose) {
|
|
104
169
|
this.forceClose();
|
|
170
|
+
return;
|
|
105
171
|
}
|
|
106
|
-
|
|
107
|
-
|
|
172
|
+
// Update trigger state
|
|
173
|
+
this.postToggleMegadropdown.emit({ isVisible: false, focusParent: focusParent });
|
|
174
|
+
try {
|
|
175
|
+
await this.animate('out');
|
|
176
|
+
// After the closing animation finishes set the megadropdown as non visible
|
|
177
|
+
this.isVisible = false;
|
|
178
|
+
this.removeListeners();
|
|
179
|
+
if (PostMegadropdown.activeDropdown === this)
|
|
180
|
+
PostMegadropdown.activeDropdown = null;
|
|
181
|
+
}
|
|
182
|
+
catch {
|
|
183
|
+
// Closing animation was cancelled - reset state
|
|
184
|
+
PostMegadropdown.activeDropdown = this;
|
|
185
|
+
this.addListeners();
|
|
186
|
+
this.isVisible = true;
|
|
187
|
+
this.postToggleMegadropdown.emit({ isVisible: true, focusParent: false });
|
|
108
188
|
}
|
|
109
189
|
}
|
|
110
190
|
/**
|
|
@@ -113,63 +193,74 @@ const PostMegadropdown$1 = /*@__PURE__*/ proxyCustomElement(class PostMegadropdo
|
|
|
113
193
|
async focusFirst() {
|
|
114
194
|
this.firstFocusableEl?.focus();
|
|
115
195
|
}
|
|
116
|
-
breakpointChange(e) {
|
|
117
|
-
this.device = e.detail;
|
|
118
|
-
if (this.device === 'desktop' && this.isVisible) {
|
|
119
|
-
this.animationClass = null;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
196
|
/**
|
|
123
197
|
* Forces the dropdown to close without animation.
|
|
124
198
|
*/
|
|
125
199
|
forceClose() {
|
|
126
|
-
this.isVisible = false;
|
|
127
|
-
this.animationClass = null;
|
|
128
|
-
this.postToggleMegadropdown.emit({ isVisible: this.isVisible, focusParent: false });
|
|
129
200
|
this.removeListeners();
|
|
201
|
+
this.postToggleMegadropdown.emit({ isVisible: false, focusParent: false });
|
|
202
|
+
this.isVisible = false;
|
|
130
203
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
this.
|
|
135
|
-
PostMegadropdown.activeDropdown = null;
|
|
136
|
-
this.removeListeners();
|
|
204
|
+
// Run the respective animation
|
|
205
|
+
createAnimation(direction) {
|
|
206
|
+
if (this.device === 'desktop') {
|
|
207
|
+
return fadeSlide(this.animatedContainer, direction, this.fsAnimationOptions);
|
|
137
208
|
}
|
|
209
|
+
return slide(this.animatedContainer, direction, {
|
|
210
|
+
translate: 100,
|
|
211
|
+
duration: 350,
|
|
212
|
+
easing: direction === 'in' ? 'ease-in' : 'ease-out',
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
async animate(direction) {
|
|
216
|
+
this.cancelAnimation();
|
|
217
|
+
this.currentAnimation = this.createAnimation(direction);
|
|
218
|
+
// Flag isAnimating used to avoid toggle() de-sync
|
|
219
|
+
this.isAnimating = true;
|
|
220
|
+
await this.currentAnimation.finished;
|
|
221
|
+
this.isAnimating = false;
|
|
222
|
+
this.currentAnimation = null;
|
|
223
|
+
}
|
|
224
|
+
cancelAnimation() {
|
|
225
|
+
this.currentAnimation?.cancel();
|
|
226
|
+
this.currentAnimation = null;
|
|
227
|
+
}
|
|
228
|
+
breakpointChange(e) {
|
|
229
|
+
this.device = e.detail;
|
|
230
|
+
this.cancelAnimation();
|
|
138
231
|
}
|
|
139
232
|
addListeners() {
|
|
140
|
-
this.host.addEventListener('keydown',
|
|
141
|
-
document.addEventListener('keyup',
|
|
233
|
+
this.host.addEventListener('keydown', this.keyboardHandler);
|
|
234
|
+
document.addEventListener('keyup', this.handleTabOutside);
|
|
142
235
|
document.addEventListener('mousedown', this.handleClickOutside);
|
|
143
236
|
}
|
|
144
237
|
removeListeners() {
|
|
145
|
-
this.host.removeEventListener('keydown',
|
|
146
|
-
document.removeEventListener('keyup',
|
|
238
|
+
this.host.removeEventListener('keydown', this.keyboardHandler);
|
|
239
|
+
document.removeEventListener('keyup', this.handleTabOutside);
|
|
147
240
|
document.removeEventListener('mousedown', this.handleClickOutside);
|
|
148
241
|
}
|
|
149
242
|
getFocusableElements() {
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
this.firstFocusableEl = focusableChildren[0];
|
|
158
|
-
this.lastFocusableEl = focusableChildren[focusableChildren.length - 1];
|
|
243
|
+
const focusableElements = [
|
|
244
|
+
...getFocusableChildren(this.host),
|
|
245
|
+
...getFocusableChildren(this.host.shadowRoot),
|
|
246
|
+
];
|
|
247
|
+
this.firstFocusableEl = focusableElements[0];
|
|
248
|
+
this.lastFocusableEl = focusableElements[focusableElements.length - 1];
|
|
159
249
|
}
|
|
160
250
|
// Loop through the focusable children
|
|
161
251
|
keyboardHandler(e) {
|
|
162
|
-
if (e.key
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
252
|
+
if (e.key !== 'Tab' || this.device === 'desktop')
|
|
253
|
+
return;
|
|
254
|
+
const activeElement = this.host.shadowRoot.activeElement || document.activeElement;
|
|
255
|
+
if (e.shiftKey && activeElement === this.firstFocusableEl) {
|
|
256
|
+
// If back tab (TAB + Shift) and first element is focused, focus goes to the last element of the megadropdown
|
|
257
|
+
e.preventDefault();
|
|
258
|
+
this.lastFocusableEl.focus();
|
|
259
|
+
}
|
|
260
|
+
else if (!e.shiftKey && activeElement === this.lastFocusableEl) {
|
|
261
|
+
// If TAB and last element is focused, focus goes back to the first element of the megadropdown
|
|
262
|
+
e.preventDefault();
|
|
263
|
+
this.firstFocusableEl.focus();
|
|
173
264
|
}
|
|
174
265
|
}
|
|
175
266
|
handleTabOutside(e) {
|
|
@@ -200,14 +291,8 @@ const PostMegadropdown$1 = /*@__PURE__*/ proxyCustomElement(class PostMegadropdo
|
|
|
200
291
|
*/
|
|
201
292
|
setTriggerActive(isActive) {
|
|
202
293
|
const trigger = this.megadropdownTrigger;
|
|
203
|
-
if (
|
|
204
|
-
|
|
205
|
-
if (isActive) {
|
|
206
|
-
trigger.classList.add('active');
|
|
207
|
-
}
|
|
208
|
-
else {
|
|
209
|
-
trigger.classList.remove('active');
|
|
210
|
-
}
|
|
294
|
+
if (trigger)
|
|
295
|
+
trigger.setAttribute('active', isActive.toString());
|
|
211
296
|
}
|
|
212
297
|
/**
|
|
213
298
|
* Updates the megadropdown trigger state when the megadropdown content changes.
|
|
@@ -231,19 +316,29 @@ const PostMegadropdown$1 = /*@__PURE__*/ proxyCustomElement(class PostMegadropdo
|
|
|
231
316
|
}
|
|
232
317
|
render() {
|
|
233
318
|
const containerStyle = this.isVisible ? {} : { display: 'none' };
|
|
234
|
-
return (h(Host, { key: '
|
|
319
|
+
return (h(Host, { key: 'f099891f24c60ca48ddceeadf754debdf3d8bff1', version: version }, h("div", { key: 'd964a72ec31632a6061f8c656fcc171bc584b764', ref: el => (this.animatedContainer = el), class: "megadropdown", style: containerStyle }, this.device !== 'desktop' && this.megadropdownTitle && (h("p", { key: 'b04d8fb83e5658365a1d722572d82237a7bf4eba', class: "megadropdown-title" }, this.megadropdownTitle)), h("div", { key: 'b7e654a69375c4e8f3af2e8ff65f0a5b7b2ee2cd', class: "megadropdown-content" }, h("slot", { key: '9608aa8b0d9458b593917e66e3fd4db9c447cac2' })), 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)))));
|
|
235
320
|
}
|
|
236
321
|
get host() { return this; }
|
|
322
|
+
static get watchers() { return {
|
|
323
|
+
"textClose": ["validateTextClose"],
|
|
324
|
+
"textBack": ["validateTextBack"]
|
|
325
|
+
}; }
|
|
237
326
|
static get style() { return postMegadropdownCss; }
|
|
238
|
-
}, [
|
|
327
|
+
}, [1, "post-megadropdown", {
|
|
328
|
+
"textClose": [513, "text-close"],
|
|
329
|
+
"textBack": [513, "text-back"],
|
|
239
330
|
"device": [32],
|
|
240
331
|
"isVisible": [32],
|
|
241
332
|
"trigger": [32],
|
|
333
|
+
"megadropdownTitle": [32],
|
|
242
334
|
"animationClass": [32],
|
|
243
335
|
"toggle": [64],
|
|
244
336
|
"show": [64],
|
|
245
337
|
"hide": [64],
|
|
246
338
|
"focusFirst": [64]
|
|
339
|
+
}, undefined, {
|
|
340
|
+
"textClose": ["validateTextClose"],
|
|
341
|
+
"textBack": ["validateTextBack"]
|
|
247
342
|
}]);
|
|
248
343
|
/** Tracks the currently active dropdown instance. */
|
|
249
344
|
PostMegadropdown$1.activeDropdown = null;
|
|
@@ -251,13 +346,23 @@ function defineCustomElement$1() {
|
|
|
251
346
|
if (typeof customElements === "undefined") {
|
|
252
347
|
return;
|
|
253
348
|
}
|
|
254
|
-
const components = ["post-megadropdown"];
|
|
349
|
+
const components = ["post-megadropdown", "post-closebutton", "post-icon"];
|
|
255
350
|
components.forEach(tagName => { switch (tagName) {
|
|
256
351
|
case "post-megadropdown":
|
|
257
352
|
if (!customElements.get(tagName)) {
|
|
258
353
|
customElements.define(tagName, PostMegadropdown$1);
|
|
259
354
|
}
|
|
260
355
|
break;
|
|
356
|
+
case "post-closebutton":
|
|
357
|
+
if (!customElements.get(tagName)) {
|
|
358
|
+
defineCustomElement$3();
|
|
359
|
+
}
|
|
360
|
+
break;
|
|
361
|
+
case "post-icon":
|
|
362
|
+
if (!customElements.get(tagName)) {
|
|
363
|
+
defineCustomElement$2();
|
|
364
|
+
}
|
|
365
|
+
break;
|
|
261
366
|
} });
|
|
262
367
|
}
|
|
263
368
|
|
|
@@ -9,7 +9,7 @@ const PostMenuItem = /*@__PURE__*/ proxyCustomElement(class PostMenuItem extends
|
|
|
9
9
|
this.__registerHost();
|
|
10
10
|
}
|
|
11
11
|
render() {
|
|
12
|
-
return (h(Host, { key: '
|
|
12
|
+
return (h(Host, { key: 'ae55d1dca73916188cb269cd7f4c808ee3302288', "data-version": version }, h("slot", { key: 'fabc1b7b4b99d7881bea64593114b6cd4fc606c4' })));
|
|
13
13
|
}
|
|
14
14
|
static get style() { return postMenuItemCss; }
|
|
15
15
|
}, [4, "post-menu-item"]);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { v as version } from './package.js';
|
|
3
|
-
import { c as checkRequiredAndType } from './
|
|
4
|
-
import './breakpoints.js';
|
|
3
|
+
import { c as checkRequiredAndType } from './breakpoints.js';
|
|
5
4
|
import { g as getRoot } from './get-root.js';
|
|
6
5
|
|
|
7
6
|
const postMenuTriggerCss = ":host{display:inline-block}";
|
|
@@ -80,7 +79,7 @@ const PostMenuTrigger = /*@__PURE__*/ proxyCustomElement(class PostMenuTrigger e
|
|
|
80
79
|
}
|
|
81
80
|
}
|
|
82
81
|
render() {
|
|
83
|
-
return (h(Host, { key: '
|
|
82
|
+
return (h(Host, { key: '3ef7e372c9c655bf1da5d5a7d4bca6925a010f65', "data-version": version, "tab-index": "-1" }, h("slot", { key: '771db943ad5aa639c325f055ba6f9d763bf4256d' })));
|
|
84
83
|
}
|
|
85
84
|
get host() { return this; }
|
|
86
85
|
static get watchers() { return {
|
|
@@ -2,12 +2,11 @@ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/
|
|
|
2
2
|
import { a as PLACEMENT_TYPES, d as defineCustomElement$1 } from './post-popovercontainer2.js';
|
|
3
3
|
import { v as version } from './package.js';
|
|
4
4
|
import { g as getFocusableChildren } from './get-focusable-children.js';
|
|
5
|
-
import { d as checkEmptyOrOneOf, c as checkRequiredAndType } from './
|
|
6
|
-
import './breakpoints.js';
|
|
5
|
+
import { d as checkEmptyOrOneOf, c as checkRequiredAndType } from './breakpoints.js';
|
|
7
6
|
import { E as EventFrom } from './event-from.js';
|
|
8
7
|
import { g as getRoot } from './get-root.js';
|
|
9
8
|
|
|
10
|
-
const postMenuCss = ":host{display:block}:where([part=menu]){display:flex;flex-direction:column;padding-block:.5rem}::slotted([slot=header]){margin-top:-0.5rem;padding:1rem;display:flex;align-items:center;gap:.5rem;border-block-end:1px solid #050400;font-weight:700}@media screen and (max-width: 1023.98px){::slotted([slot=header]){padding:.75rem 1rem}}@media screen and (max-width: 779.98px){::slotted([slot=header]){padding:.5rem 1rem}}";
|
|
9
|
+
const postMenuCss = ":host{display:block}:where([part=post-menu]){display:flex;flex-direction:column;padding-block:.5rem}::slotted([slot=header]){margin-top:-0.5rem;padding:1rem;display:flex;align-items:center;gap:.5rem;border-block-end:1px solid #050400;font-weight:700}@media screen and (max-width: 1023.98px){::slotted([slot=header]){padding:.75rem 1rem}}@media screen and (max-width: 779.98px){::slotted([slot=header]){padding:.5rem 1rem}}";
|
|
11
10
|
|
|
12
11
|
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
13
12
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -58,35 +57,6 @@ const PostMenu = /*@__PURE__*/ proxyCustomElement(class PostMenu extends HTMLEle
|
|
|
58
57
|
this.controlKeyDownHandler(e);
|
|
59
58
|
}
|
|
60
59
|
};
|
|
61
|
-
this.handlePostShown = (event) => {
|
|
62
|
-
// Only for the first open
|
|
63
|
-
if (event.detail.first) {
|
|
64
|
-
// Add "menu" and "menuitem" aria roles and aria-label
|
|
65
|
-
this.host.setAttribute('role', 'menu');
|
|
66
|
-
const menuItems = this.getSlottedItems();
|
|
67
|
-
for (const item of menuItems) {
|
|
68
|
-
item.setAttribute('role', 'menuitem');
|
|
69
|
-
}
|
|
70
|
-
if (this.label)
|
|
71
|
-
this.host.setAttribute('aria-label', this.label);
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
this.handlePostToggled = (event) => {
|
|
75
|
-
this.isVisible = event.detail.isOpen;
|
|
76
|
-
this.toggleMenu.emit(this.isVisible);
|
|
77
|
-
if (this.isVisible) {
|
|
78
|
-
this.lastFocusedElement = this.root?.activeElement;
|
|
79
|
-
requestAnimationFrame(() => {
|
|
80
|
-
const menuItems = this.getSlottedItems();
|
|
81
|
-
if (menuItems.length > 0) {
|
|
82
|
-
menuItems[0].focus();
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
else if (this.lastFocusedElement) {
|
|
87
|
-
this.lastFocusedElement.focus();
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
60
|
this.handleClick = (e) => {
|
|
91
61
|
const target = e.target;
|
|
92
62
|
if (['BUTTON', 'A', 'INPUT', 'SELECT', 'TEXTAREA'].includes(target.tagName)) {
|
|
@@ -148,6 +118,35 @@ const PostMenu = /*@__PURE__*/ proxyCustomElement(class PostMenu extends HTMLEle
|
|
|
148
118
|
console.error('hide: popoverRef is null or undefined');
|
|
149
119
|
}
|
|
150
120
|
}
|
|
121
|
+
handlePostShown(event) {
|
|
122
|
+
// Only for the first open
|
|
123
|
+
if (event.detail.first) {
|
|
124
|
+
// Add "menu" and "menuitem" aria roles and aria-label
|
|
125
|
+
this.host.setAttribute('role', 'menu');
|
|
126
|
+
const menuItems = this.getSlottedItems();
|
|
127
|
+
for (const item of menuItems) {
|
|
128
|
+
item.setAttribute('role', 'menuitem');
|
|
129
|
+
}
|
|
130
|
+
if (this.label)
|
|
131
|
+
this.host.setAttribute('aria-label', this.label);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
handlePostToggled(event) {
|
|
135
|
+
this.isVisible = event.detail.isOpen;
|
|
136
|
+
this.toggleMenu.emit(this.isVisible);
|
|
137
|
+
if (this.isVisible) {
|
|
138
|
+
this.lastFocusedElement = this.root?.activeElement;
|
|
139
|
+
requestAnimationFrame(() => {
|
|
140
|
+
const menuItems = this.getSlottedItems();
|
|
141
|
+
if (menuItems.length > 0) {
|
|
142
|
+
menuItems[0].focus();
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
else if (this.lastFocusedElement) {
|
|
147
|
+
this.lastFocusedElement.focus();
|
|
148
|
+
}
|
|
149
|
+
}
|
|
151
150
|
controlKeyDownHandler(e) {
|
|
152
151
|
const menuItems = this.getSlottedItems();
|
|
153
152
|
if (!menuItems.length) {
|
|
@@ -195,7 +194,7 @@ const PostMenu = /*@__PURE__*/ proxyCustomElement(class PostMenu extends HTMLEle
|
|
|
195
194
|
.flatMap(el => Array.from(getFocusableChildren(el))));
|
|
196
195
|
}
|
|
197
196
|
render() {
|
|
198
|
-
return (h(Host, { key: '
|
|
197
|
+
return (h(Host, { key: '08285b17608e5bc3133a3da6015a5a0d4de6ec29', "data-version": version }, h("post-popovercontainer", { key: '17e45869b5e76cdd9bd43ca77b2f0b3876462014', onPostShow: this.handlePostShown.bind(this), onPostToggle: this.handlePostToggled.bind(this), placement: this.placement, ref: e => (this.popoverRef = e) }, h("div", { key: 'e2486aa099ffc8ac59885a0971ebb13649a49a35', part: "post-menu" }, h("slot", { key: '9f0e05f211fe18cf5beed8e1b33bde26d4974e24', name: "header" }), h("slot", { key: '971ac8ad433467a2ebe2429574cb10dbdadbcf25' })))));
|
|
199
198
|
}
|
|
200
199
|
get host() { return this; }
|
|
201
200
|
static get watchers() { return {
|
|
@@ -216,10 +215,10 @@ const PostMenu = /*@__PURE__*/ proxyCustomElement(class PostMenu extends HTMLEle
|
|
|
216
215
|
}]);
|
|
217
216
|
__decorate([
|
|
218
217
|
EventFrom('post-popovercontainer')
|
|
219
|
-
], PostMenu.prototype, "handlePostShown",
|
|
218
|
+
], PostMenu.prototype, "handlePostShown", null);
|
|
220
219
|
__decorate([
|
|
221
220
|
EventFrom('post-popovercontainer')
|
|
222
|
-
], PostMenu.prototype, "handlePostToggled",
|
|
221
|
+
], PostMenu.prototype, "handlePostToggled", null);
|
|
223
222
|
function defineCustomElement() {
|
|
224
223
|
if (typeof customElements === "undefined") {
|
|
225
224
|
return;
|
|
@@ -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 PostPagination extends Components.PostPagination, HTMLElement {}
|
|
4
|
+
export const PostPagination: {
|
|
5
|
+
prototype: PostPagination;
|
|
6
|
+
new (): PostPagination;
|
|
7
7
|
};
|
|
8
8
|
/**
|
|
9
9
|
* Used to define this component and all nested components recursively.
|