@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 +1 @@
|
|
|
1
|
-
*{box-sizing:border-box}:host{display:block}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}.popover-container{color:var(--post-current-fg);background-color:var(--post-current-bg);display:flex;align-items:self-start;padding:.5em;min-width:160px;max-width:
|
|
1
|
+
*{box-sizing:border-box}:host{display:block}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}.popover-container{color:var(--post-current-fg);background-color:var(--post-current-bg);display:flex;align-items:self-start;padding:.5em;min-width:160px;max-width:var(--post-popover-max-width, 280px)}.popover-content{padding:.5em;flex-grow:1}
|
|
@@ -22,12 +22,12 @@ export class PostPopover {
|
|
|
22
22
|
validatePlacement() {
|
|
23
23
|
checkEmptyOrOneOf(this, 'placement', PLACEMENT_TYPES);
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
checkRequiredAndType(this, '
|
|
25
|
+
validateTextClose() {
|
|
26
|
+
checkRequiredAndType(this, 'textClose', 'string');
|
|
27
27
|
}
|
|
28
28
|
componentDidLoad() {
|
|
29
29
|
this.validatePlacement();
|
|
30
|
-
this.
|
|
30
|
+
this.validateTextClose();
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
33
|
* Programmatically display the popover
|
|
@@ -57,7 +57,7 @@ export class PostPopover {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
render() {
|
|
60
|
-
return (h(Host, { key: '
|
|
60
|
+
return (h(Host, { key: 'b82e9758682173b6ed9db39765040581744e0dcc', "data-version": version }, h("post-popovercontainer", { key: 'ded5b122d2b8eada5fb9b245caa9e07af5f0f5f5', arrow: this.arrow, placement: this.placement, ref: e => (this.popoverRef = e) }, h("div", { key: '9311740aba30e3a7440d822eb8263153ff710bab', class: "popover-container" }, h("div", { key: 'a37c838a03d9e24ddeb9d9d2e268e8b3260ae757', class: "popover-content" }, h("slot", { key: '4bd852eb3da550c76a6ed4abb40f62a0769bdcf7' })), h("post-closebutton", { key: '10b09bde176da08f7571fbd5867ddee61ebf731a', onClick: () => this.hide() }, this.textClose)))));
|
|
61
61
|
}
|
|
62
62
|
static get is() { return "post-popover"; }
|
|
63
63
|
static get encapsulation() { return "shadow"; }
|
|
@@ -99,9 +99,9 @@ export class PostPopover {
|
|
|
99
99
|
"reflect": false,
|
|
100
100
|
"defaultValue": "'top'"
|
|
101
101
|
},
|
|
102
|
-
"
|
|
102
|
+
"textClose": {
|
|
103
103
|
"type": "string",
|
|
104
|
-
"attribute": "close
|
|
104
|
+
"attribute": "text-close",
|
|
105
105
|
"mutable": false,
|
|
106
106
|
"complexType": {
|
|
107
107
|
"original": "string",
|
|
@@ -112,11 +112,11 @@ export class PostPopover {
|
|
|
112
112
|
"optional": false,
|
|
113
113
|
"docs": {
|
|
114
114
|
"tags": [],
|
|
115
|
-
"text": "Define the
|
|
115
|
+
"text": "Define the text of the close button for assistive technology"
|
|
116
116
|
},
|
|
117
117
|
"getter": false,
|
|
118
118
|
"setter": false,
|
|
119
|
-
"reflect":
|
|
119
|
+
"reflect": true
|
|
120
120
|
},
|
|
121
121
|
"arrow": {
|
|
122
122
|
"type": "boolean",
|
|
@@ -230,8 +230,8 @@ export class PostPopover {
|
|
|
230
230
|
"propName": "placement",
|
|
231
231
|
"methodName": "validatePlacement"
|
|
232
232
|
}, {
|
|
233
|
-
"propName": "
|
|
234
|
-
"methodName": "
|
|
233
|
+
"propName": "textClose",
|
|
234
|
+
"methodName": "validateTextClose"
|
|
235
235
|
}];
|
|
236
236
|
}
|
|
237
237
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
import { version } from "../../../../package";
|
|
3
3
|
import isFocusable from "ally.js/is/focusable";
|
|
4
|
-
import {
|
|
4
|
+
import { checkEmptyOrType } from "../../utils/index";
|
|
5
5
|
export class PostPopoverTrigger {
|
|
6
6
|
syncAriaExpanded(newValue) {
|
|
7
7
|
this.ariaExpanded = newValue;
|
|
@@ -14,41 +14,57 @@ export class PostPopoverTrigger {
|
|
|
14
14
|
* @param forValue - The new value of the `for` property.
|
|
15
15
|
*/
|
|
16
16
|
validateFor() {
|
|
17
|
-
|
|
17
|
+
checkEmptyOrType(this, 'for', 'string');
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
hasAriaControlsElements(el) {
|
|
20
|
+
return 'ariaControlsElements' in el;
|
|
21
|
+
}
|
|
22
|
+
// Gets the associated to the trigger popover element
|
|
20
23
|
get popover() {
|
|
21
|
-
const ref = document.getElementById(this.for);
|
|
24
|
+
const ref = this.host.querySelector('post-popover') ?? document.getElementById(this.for);
|
|
25
|
+
if (!ref) {
|
|
26
|
+
const target = this.for ? `with ID: ${this.for}` : 'inside the <post-popover-trigger>';
|
|
27
|
+
console.error(`No post-popover found ${target}.`);
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
22
30
|
return ref?.localName === 'post-popover' ? ref : null;
|
|
23
31
|
}
|
|
24
32
|
setupTrigger() {
|
|
33
|
+
const popover = this.popover;
|
|
25
34
|
this.trigger = this.host.querySelector('*');
|
|
26
|
-
if (this.trigger) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
if (!this.trigger) {
|
|
36
|
+
console.error('No content found in the post-popover-trigger slot. Please insert a focusable element or content that can receive focus.');
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
// check if its not focusable and add aria role and tabindex
|
|
40
|
+
if (!isFocusable(this.trigger)) {
|
|
41
|
+
this.trigger.setAttribute('tabindex', '0');
|
|
42
|
+
this.trigger.setAttribute('role', 'button');
|
|
43
|
+
}
|
|
44
|
+
if (!popover)
|
|
45
|
+
return;
|
|
46
|
+
// Set aria attributes
|
|
47
|
+
this.trigger.setAttribute('aria-expanded', this.ariaExpanded.toString());
|
|
48
|
+
this.trigger.setAttribute('aria-haspopup', 'true');
|
|
49
|
+
// Set aria-controls depending on the popover/trigger relationship
|
|
50
|
+
if (this.for) {
|
|
35
51
|
this.trigger.setAttribute('aria-controls', this.for);
|
|
36
|
-
this.trigger.addEventListener('click', this.boundHandleToggle);
|
|
37
|
-
this.trigger.addEventListener('keydown', this.boundHandleKeyDown);
|
|
38
52
|
}
|
|
39
53
|
else {
|
|
40
|
-
|
|
54
|
+
if (this.hasAriaControlsElements(this.trigger)) {
|
|
55
|
+
this.trigger.ariaControlsElements = [popover];
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
popover.id || (popover.id = `popover-${crypto.randomUUID()}`);
|
|
59
|
+
this.trigger.setAttribute('aria-controls', popover.id);
|
|
60
|
+
}
|
|
41
61
|
}
|
|
62
|
+
this.trigger.addEventListener('click', this.boundHandleToggle);
|
|
63
|
+
this.trigger.addEventListener('keydown', this.boundHandleKeyDown);
|
|
42
64
|
}
|
|
43
65
|
handleToggle() {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
popoverEl.toggle(this.trigger);
|
|
47
|
-
this.focusTrigger();
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
console.warn(`No post-popover found with ID: ${this.for}`);
|
|
51
|
-
}
|
|
66
|
+
this.popover?.toggle(this.trigger);
|
|
67
|
+
this.focusTrigger();
|
|
52
68
|
}
|
|
53
69
|
focusTrigger() {
|
|
54
70
|
// Restores focus to the trigger
|
|
@@ -89,7 +105,7 @@ export class PostPopoverTrigger {
|
|
|
89
105
|
this.popover?.removeEventListener('postToggle', this.boundHandlePostToggle);
|
|
90
106
|
}
|
|
91
107
|
render() {
|
|
92
|
-
return (h(Host, { key: '
|
|
108
|
+
return (h(Host, { key: 'b519f15f3c613290c9fc301813b590e4f1727369', "data-version": version }, h("slot", { key: 'dbe0f26ae126f24f6d67f0e27a1a6dfa4aeb498f', onSlotchange: () => this.setupTrigger() })));
|
|
93
109
|
}
|
|
94
110
|
static get is() { return "post-popover-trigger"; }
|
|
95
111
|
static get encapsulation() { return "shadow"; }
|
|
@@ -114,8 +130,8 @@ export class PostPopoverTrigger {
|
|
|
114
130
|
"resolved": "string",
|
|
115
131
|
"references": {}
|
|
116
132
|
},
|
|
117
|
-
"required":
|
|
118
|
-
"optional":
|
|
133
|
+
"required": false,
|
|
134
|
+
"optional": true,
|
|
119
135
|
"docs": {
|
|
120
136
|
"tags": [],
|
|
121
137
|
"text": "ID of the popover element that this trigger is linked to. Used to open and close the popover."
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer polyfill{@supports not selector(:popover-open){[popover]:not(.\:popover-open){display:none}}}:where(post-popovercontainer){background-color:rgba(0,0,0,0);border:rgba(0,0,0,0);position:fixed;margin:0;padding:0;overflow:visible}:where(post-popovercontainer)>div{box-shadow:var(--post-device-elevation-300);width:max-content;max-width:100%;color:var(--post-current-fg);background-color:var(--post-current-bg);border-radius:4px}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:where(post-popovercontainer)>div{border:2px solid rgba(0,0,0,0)}}:where(post-popovercontainer)[tooltip]{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}:where(post-popovercontainer)[safe-space]::after{content:"";position:fixed;inset:0;z-index:-1;pointer-events:auto}:where(post-popovercontainer)[safe-space=triangle]::after{clip-path:polygon(var(--post-safe-space-cursor-x, 0) var(--post-safe-space-cursor-y, 0), var(--post-safe-space-popover-x-start, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-start, 0)), var(--post-safe-space-popover-x-end, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-end, 0)))}:where(post-popovercontainer)[safe-space=trapezoid]::after{clip-path:polygon(var(--post-safe-space-trigger-x-start, var(--post-safe-space-trigger-x, 0)) var(--post-safe-space-trigger-y, var(--post-safe-space-trigger-y-start, 0)), var(--post-safe-space-trigger-x-end, var(--post-safe-space-trigger-x, 0)) var(--post-safe-space-trigger-y, var(--post-safe-space-trigger-y-end, 0)), var(--post-safe-space-popover-x-end, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-end, 0)), var(--post-safe-space-popover-x-start, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-start, 0)))}:where(post-popovercontainer):not(:has(.arrow))>div{box-shadow:var(--post-device-elevation-300)}:where(post-popovercontainer):has(.arrow)>div{filter:drop-shadow(1px 2px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(2px 4px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(4px 8px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer):has(.arrow.top)>div{filter:drop-shadow(0px -2px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(0px -4px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(0px -8px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer):has(.arrow.left)>div{filter:drop-shadow(-2px 0px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(-4px 0px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(-8px 0px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer):has(.arrow.right)>div{filter:drop-shadow(2px 0px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(4px 0px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(8px 0px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer) .arrow{position:absolute;width:.5825rem;height:.5825rem;background-color:inherit;rotate:45deg;pointer-events:none;z-index:-1}:where(post-popovercontainer) .arrow.top{border-block-
|
|
1
|
+
@layer polyfill{@supports not selector(:popover-open){[popover]:not(.\:popover-open){display:none}}}:where(post-popovercontainer){background-color:rgba(0,0,0,0);border:rgba(0,0,0,0);position:fixed;margin:0;padding:0;overflow:visible}:where(post-popovercontainer)>div{box-shadow:var(--post-device-elevation-300);width:max-content;max-width:100%;color:var(--post-current-fg);background-color:var(--post-current-bg);border-radius:4px}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:where(post-popovercontainer)>div{border:2px solid rgba(0,0,0,0)}}:where(post-popovercontainer)[tooltip]{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}:where(post-popovercontainer)[safe-space]::after{content:"";position:fixed;inset:0;z-index:-1;pointer-events:auto}:where(post-popovercontainer)[safe-space=triangle]::after{clip-path:polygon(var(--post-safe-space-cursor-x, 0) var(--post-safe-space-cursor-y, 0), var(--post-safe-space-popover-x-start, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-start, 0)), var(--post-safe-space-popover-x-end, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-end, 0)))}:where(post-popovercontainer)[safe-space=trapezoid]::after{clip-path:polygon(var(--post-safe-space-trigger-x-start, var(--post-safe-space-trigger-x, 0)) var(--post-safe-space-trigger-y, var(--post-safe-space-trigger-y-start, 0)), var(--post-safe-space-trigger-x-end, var(--post-safe-space-trigger-x, 0)) var(--post-safe-space-trigger-y, var(--post-safe-space-trigger-y-end, 0)), var(--post-safe-space-popover-x-end, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-end, 0)), var(--post-safe-space-popover-x-start, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-start, 0)))}:where(post-popovercontainer):not(:has(.arrow))>div{box-shadow:var(--post-device-elevation-300)}:where(post-popovercontainer):has(.arrow)>div{filter:drop-shadow(1px 2px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(2px 4px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(4px 8px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer):has(.arrow.top)>div{filter:drop-shadow(0px -2px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(0px -4px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(0px -8px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer):has(.arrow.left)>div{filter:drop-shadow(-2px 0px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(-4px 0px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(-8px 0px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer):has(.arrow.right)>div{filter:drop-shadow(2px 0px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(4px 0px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(8px 0px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer) .arrow{--arrow-size: 0.5825rem;position:absolute;width:.5825rem;height:.5825rem;background-color:inherit;rotate:45deg;pointer-events:none;z-index:-1}:where(post-popovercontainer) .arrow[dynamic-placement=top]{border-bottom-right-radius:2px}:where(post-popovercontainer) .arrow[dynamic-placement=right]{border-bottom-left-radius:2px}:where(post-popovercontainer) .arrow[dynamic-placement=bottom]{border-top-left-radius:2px}:where(post-popovercontainer) .arrow[dynamic-placement=left]{border-top-right-radius:2px}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:where(post-popovercontainer) .arrow[dynamic-placement=top]{border-block-end:2px solid rgba(0,0,0,0);border-inline-end:2px solid rgba(0,0,0,0);bottom:-0.3796735336rem !important}:where(post-popovercontainer) .arrow[dynamic-placement=left]{border-block-start:2px solid rgba(0,0,0,0);border-inline-end:2px solid rgba(0,0,0,0);right:-0.3796735336rem !important}:where(post-popovercontainer) .arrow[dynamic-placement=right]{border-block-end:2px solid rgba(0,0,0,0);border-inline-start:2px solid rgba(0,0,0,0);left:-0.3796735336rem !important}:where(post-popovercontainer) .arrow[dynamic-placement=bottom]{border-block-start:2px solid rgba(0,0,0,0);border-inline-start:2px solid rgba(0,0,0,0);top:-0.3796735336rem !important}}
|
|
@@ -30,10 +30,6 @@ export class PostPopovercontainer {
|
|
|
30
30
|
* Whether or not to display a little pointer arrow
|
|
31
31
|
*/
|
|
32
32
|
this.arrow = false;
|
|
33
|
-
/**
|
|
34
|
-
* Whether or not the popovercontainer should close when user clicks outside of it
|
|
35
|
-
*/
|
|
36
|
-
this.manualClose = false;
|
|
37
33
|
this.currentAnimation = null;
|
|
38
34
|
}
|
|
39
35
|
validatePlacement() {
|
|
@@ -79,10 +75,35 @@ export class PostPopovercontainer {
|
|
|
79
75
|
this.calculatePosition();
|
|
80
76
|
this.host.showPopover();
|
|
81
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* Programmatically hide the popovercontainer
|
|
80
|
+
*/
|
|
81
|
+
async hide() {
|
|
82
|
+
if (!this.toggleTimeoutId) {
|
|
83
|
+
this.eventTarget = null;
|
|
84
|
+
this.host.hidePopover();
|
|
85
|
+
this.postHide.emit();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Toggle popovercontainer display
|
|
90
|
+
* @param target A focusable element inside the <post-popover-trigger> component that controls the popover
|
|
91
|
+
* @param force Pass true to always show or false to always hide
|
|
92
|
+
*/
|
|
93
|
+
async toggle(target, force) {
|
|
94
|
+
this.eventTarget = target;
|
|
95
|
+
// Prevent instant double toggle
|
|
96
|
+
if (!this.toggleTimeoutId) {
|
|
97
|
+
this.calculatePosition();
|
|
98
|
+
this.host.togglePopover(force);
|
|
99
|
+
this.toggleTimeoutId = null;
|
|
100
|
+
}
|
|
101
|
+
return this.host.matches(':where(:popover-open, .popover-open)');
|
|
102
|
+
}
|
|
82
103
|
/**
|
|
83
104
|
* Handles the popover opening process and emits related events.
|
|
84
105
|
*/
|
|
85
|
-
|
|
106
|
+
open() {
|
|
86
107
|
const content = this.host.querySelector('.popover-content');
|
|
87
108
|
this.startAutoupdates();
|
|
88
109
|
if (content) {
|
|
@@ -107,7 +128,7 @@ export class PostPopovercontainer {
|
|
|
107
128
|
/**
|
|
108
129
|
* Handles the popover closing process and emits related events.
|
|
109
130
|
*/
|
|
110
|
-
|
|
131
|
+
close() {
|
|
111
132
|
if (typeof this.clearAutoUpdate === 'function') {
|
|
112
133
|
this.clearAutoUpdate();
|
|
113
134
|
}
|
|
@@ -153,31 +174,6 @@ export class PostPopovercontainer {
|
|
|
153
174
|
}
|
|
154
175
|
}
|
|
155
176
|
}
|
|
156
|
-
/**
|
|
157
|
-
* Programmatically hide the popovercontainer
|
|
158
|
-
*/
|
|
159
|
-
async hide() {
|
|
160
|
-
if (!this.toggleTimeoutId) {
|
|
161
|
-
this.eventTarget = null;
|
|
162
|
-
this.host.hidePopover();
|
|
163
|
-
this.postHide.emit();
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* Toggle popovercontainer display
|
|
168
|
-
* @param target A focusable element inside the <post-popover-trigger> component that controls the popover
|
|
169
|
-
* @param force Pass true to always show or false to always hide
|
|
170
|
-
*/
|
|
171
|
-
async toggle(target, force) {
|
|
172
|
-
this.eventTarget = target;
|
|
173
|
-
// Prevent instant double toggle
|
|
174
|
-
if (!this.toggleTimeoutId) {
|
|
175
|
-
this.calculatePosition();
|
|
176
|
-
this.host.togglePopover(force);
|
|
177
|
-
this.toggleTimeoutId = null;
|
|
178
|
-
}
|
|
179
|
-
return this.host.matches(':where(:popover-open, .popover-open)');
|
|
180
|
-
}
|
|
181
177
|
/**
|
|
182
178
|
* Start or stop auto updates based on popovercontainer events.
|
|
183
179
|
* Popovercontainers can be closed or opened with other methods than class members,
|
|
@@ -211,6 +207,7 @@ export class PostPopovercontainer {
|
|
|
211
207
|
async calculatePosition() {
|
|
212
208
|
const { x, y, middlewareData, placement } = await this.computeMainPosition();
|
|
213
209
|
const currentPlacement = placement.split('-')[0];
|
|
210
|
+
this.dynamicPlacement = currentPlacement;
|
|
214
211
|
// Position popover
|
|
215
212
|
this.host.style.left = `${x}px`;
|
|
216
213
|
this.host.style.top = `${y}px`;
|
|
@@ -218,11 +215,20 @@ export class PostPopovercontainer {
|
|
|
218
215
|
if (this.arrow && middlewareData.arrow) {
|
|
219
216
|
const { x: arrowX, y: arrowY } = middlewareData.arrow;
|
|
220
217
|
const staticSide = PostPopovercontainer.STATIC_SIDES[currentPlacement];
|
|
218
|
+
const rootFontSize = Number.parseFloat(getComputedStyle(document.documentElement).fontSize);
|
|
219
|
+
// Calculate dynamically the half side which provides the static side offset
|
|
220
|
+
const arrowSizeValue = getComputedStyle(this.arrowRef)
|
|
221
|
+
.getPropertyValue('--arrow-size')
|
|
222
|
+
.trim();
|
|
223
|
+
const arrowSizePx = arrowSizeValue.endsWith('rem')
|
|
224
|
+
? Number.parseFloat(arrowSizeValue) * rootFontSize
|
|
225
|
+
: Number.parseFloat(arrowSizeValue);
|
|
226
|
+
const halfSide = -0.5 * arrowSizePx;
|
|
221
227
|
if (staticSide) {
|
|
222
228
|
Object.assign(this.arrowRef.style, {
|
|
223
229
|
left: arrowX ? `${arrowX}px` : '',
|
|
224
230
|
top: arrowY ? `${arrowY}px` : '',
|
|
225
|
-
[staticSide]:
|
|
231
|
+
[staticSide]: `${halfSide}px`,
|
|
226
232
|
});
|
|
227
233
|
}
|
|
228
234
|
}
|
|
@@ -323,9 +329,9 @@ export class PostPopovercontainer {
|
|
|
323
329
|
}
|
|
324
330
|
}
|
|
325
331
|
render() {
|
|
326
|
-
return (h(Host, { key: '
|
|
332
|
+
return (h(Host, { key: '0aaf70cb284e7227149f2e500aa7c72cab69d90a', "data-version": version, popover: "auto" }, h("div", { key: '9762887bdddca93acc6dfda715f2f41f4f6c98d6', class: "popover-content" }, this.arrow && (h("span", { key: 'e77f16be0b3b0cdb02886ea928aa6986d3f477e3', "dynamic-placement": this.dynamicPlacement, class: "arrow", ref: el => {
|
|
327
333
|
this.arrowRef = el;
|
|
328
|
-
} })), h("slot", { key: '
|
|
334
|
+
} })), h("slot", { key: 'e8737e5acec3a20d258d462a7d82278d303ba353' }))));
|
|
329
335
|
}
|
|
330
336
|
static get is() { return "post-popovercontainer"; }
|
|
331
337
|
static get originalStyleUrls() {
|
|
@@ -426,26 +432,6 @@ export class PostPopovercontainer {
|
|
|
426
432
|
"reflect": false,
|
|
427
433
|
"defaultValue": "false"
|
|
428
434
|
},
|
|
429
|
-
"manualClose": {
|
|
430
|
-
"type": "boolean",
|
|
431
|
-
"attribute": "manual-close",
|
|
432
|
-
"mutable": false,
|
|
433
|
-
"complexType": {
|
|
434
|
-
"original": "boolean",
|
|
435
|
-
"resolved": "boolean",
|
|
436
|
-
"references": {}
|
|
437
|
-
},
|
|
438
|
-
"required": false,
|
|
439
|
-
"optional": false,
|
|
440
|
-
"docs": {
|
|
441
|
-
"tags": [],
|
|
442
|
-
"text": "Whether or not the popovercontainer should close when user clicks outside of it"
|
|
443
|
-
},
|
|
444
|
-
"getter": false,
|
|
445
|
-
"setter": false,
|
|
446
|
-
"reflect": false,
|
|
447
|
-
"defaultValue": "false"
|
|
448
|
-
},
|
|
449
435
|
"safeSpace": {
|
|
450
436
|
"type": "string",
|
|
451
437
|
"attribute": "safe-space",
|
|
@@ -467,6 +453,11 @@ export class PostPopovercontainer {
|
|
|
467
453
|
}
|
|
468
454
|
};
|
|
469
455
|
}
|
|
456
|
+
static get states() {
|
|
457
|
+
return {
|
|
458
|
+
"dynamicPlacement": {}
|
|
459
|
+
};
|
|
460
|
+
}
|
|
470
461
|
static get events() {
|
|
471
462
|
return [{
|
|
472
463
|
"method": "postBeforeShow",
|
|
@@ -575,44 +566,6 @@ export class PostPopovercontainer {
|
|
|
575
566
|
}]
|
|
576
567
|
}
|
|
577
568
|
},
|
|
578
|
-
"open": {
|
|
579
|
-
"complexType": {
|
|
580
|
-
"signature": "() => Promise<void>",
|
|
581
|
-
"parameters": [],
|
|
582
|
-
"references": {
|
|
583
|
-
"Promise": {
|
|
584
|
-
"location": "global",
|
|
585
|
-
"id": "global::Promise"
|
|
586
|
-
},
|
|
587
|
-
"HTMLElement": {
|
|
588
|
-
"location": "global",
|
|
589
|
-
"id": "global::HTMLElement"
|
|
590
|
-
}
|
|
591
|
-
},
|
|
592
|
-
"return": "Promise<void>"
|
|
593
|
-
},
|
|
594
|
-
"docs": {
|
|
595
|
-
"text": "Handles the popover opening process and emits related events.",
|
|
596
|
-
"tags": []
|
|
597
|
-
}
|
|
598
|
-
},
|
|
599
|
-
"close": {
|
|
600
|
-
"complexType": {
|
|
601
|
-
"signature": "() => Promise<void>",
|
|
602
|
-
"parameters": [],
|
|
603
|
-
"references": {
|
|
604
|
-
"Promise": {
|
|
605
|
-
"location": "global",
|
|
606
|
-
"id": "global::Promise"
|
|
607
|
-
}
|
|
608
|
-
},
|
|
609
|
-
"return": "Promise<void>"
|
|
610
|
-
},
|
|
611
|
-
"docs": {
|
|
612
|
-
"text": "Handles the popover closing process and emits related events.",
|
|
613
|
-
"tags": []
|
|
614
|
-
}
|
|
615
|
-
},
|
|
616
569
|
"hide": {
|
|
617
570
|
"complexType": {
|
|
618
571
|
"signature": "() => Promise<void>",
|
|
@@ -87,7 +87,7 @@ export class PostRating {
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
render() {
|
|
90
|
-
return (h(Host, { key: '
|
|
90
|
+
return (h(Host, { key: '9fc30dc25747bc15a0fc802235514ed40de0ed6a', "data-version": version }, h("div", { key: 'a71f2eaee28798917b7fa96184cf4f1db2d99c82', role: "slider", class: "rating", tabindex: "0", "aria-label": this.label, "aria-valuemin": "0", "aria-valuemax": this.stars, "aria-valuenow": this.currentRating, "aria-valuetext": `${this.currentRating} / ${this.stars}`, "aria-readonly": this.readonly ? 'true' : 'false', onKeyDown: this.keydownHandler, onBlur: this.blurHandler }, Array.from({ length: this.stars }).map((v, i) => (h("div", { key: `star-${v}`, "aria-hidden": "true", class: {
|
|
91
91
|
'star': true,
|
|
92
92
|
'before-hover': i < this.hoveredIndex,
|
|
93
93
|
'active': i < Math.round(this.currentRating),
|
|
@@ -122,11 +122,11 @@ export class PostRating {
|
|
|
122
122
|
"optional": false,
|
|
123
123
|
"docs": {
|
|
124
124
|
"tags": [],
|
|
125
|
-
"text": "
|
|
125
|
+
"text": "A hidden, descriptive label that explains the role of the rating component to assistive technologies."
|
|
126
126
|
},
|
|
127
127
|
"getter": false,
|
|
128
128
|
"setter": false,
|
|
129
|
-
"reflect":
|
|
129
|
+
"reflect": true
|
|
130
130
|
},
|
|
131
131
|
"stars": {
|
|
132
132
|
"type": "number",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ol{margin-block:0;padding-inline-start:0;list-style:none;counter-reset:step-index;display:grid;position:relative;overflow:hidden;grid-template-columns:20px;grid-auto-columns:minmax(0, 1fr);padding-inline-end:20px}@media screen and (max-width: 779.98px){ol{display:flex;padding-inline-end:0}}.active-step{font-size:var(--post-device-font-size-7);font-weight:var(--post-device-font-weight-bold);color:var(--post-scheme-color-interactive-primary-enabled-fg1)}@media screen and (min-width: 780px){.active-step{display:none}}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
import { version } from "../../../../package";
|
|
3
|
+
import { checkRequiredAndPattern, checkRequiredAndType } from "../../utils/index";
|
|
4
|
+
export class PostStepper {
|
|
5
|
+
constructor() {
|
|
6
|
+
/**
|
|
7
|
+
* Defines the currently active step
|
|
8
|
+
*/
|
|
9
|
+
this.currentIndex = -1;
|
|
10
|
+
}
|
|
11
|
+
validateTextCurrentStep() {
|
|
12
|
+
checkRequiredAndType(this, 'textCurrentStep', 'string');
|
|
13
|
+
}
|
|
14
|
+
validateTextCompletedStep() {
|
|
15
|
+
checkRequiredAndType(this, 'textCompletedStep', 'string');
|
|
16
|
+
}
|
|
17
|
+
validateTextStepNumber() {
|
|
18
|
+
checkRequiredAndPattern(this, 'textStepNumber', /#number\b/);
|
|
19
|
+
this.updateActiveStepNumber();
|
|
20
|
+
}
|
|
21
|
+
validateCurrentIndex() {
|
|
22
|
+
checkRequiredAndType(this, 'currentIndex', 'number');
|
|
23
|
+
this.updateSteps();
|
|
24
|
+
}
|
|
25
|
+
connectedCallback() {
|
|
26
|
+
this.stepItems = document.querySelectorAll(null);
|
|
27
|
+
}
|
|
28
|
+
componentDidLoad() {
|
|
29
|
+
this.validateTextCompletedStep();
|
|
30
|
+
this.validateTextCurrentStep();
|
|
31
|
+
this.validateTextStepNumber();
|
|
32
|
+
// Wait for slotchange
|
|
33
|
+
setTimeout(() => {
|
|
34
|
+
this.validateCurrentIndex();
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
updateActiveStepNumber() {
|
|
38
|
+
if (this.textStepNumber) {
|
|
39
|
+
const labelTemplate = this.textStepNumber;
|
|
40
|
+
this.mobileActiveStepLabel = labelTemplate.replace(/#number/g, `${this.currentIndex + 1}`);
|
|
41
|
+
this.updateMobileActiveStepVisibility();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
updateSteps() {
|
|
45
|
+
this.stepItems = this.host.querySelectorAll('post-stepper-item');
|
|
46
|
+
if (!this.stepItems || this.stepItems.length < 3) {
|
|
47
|
+
console.error('The post-stepper component should have at least three steps.');
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
this.updateActiveStepNumber();
|
|
51
|
+
this.stepItems.forEach((el, i) => {
|
|
52
|
+
if (this.currentIndex === i) {
|
|
53
|
+
this.mobileActiveStepName = el.querySelector('.label').innerHTML;
|
|
54
|
+
}
|
|
55
|
+
// Update "post-stepper-item" classes to show correct status
|
|
56
|
+
el.classList.toggle('stepper-item-completed', this.currentIndex > i);
|
|
57
|
+
el.classList.toggle('stepper-item-current', this.currentIndex === i);
|
|
58
|
+
el.classList.toggle('stepper-item-inactive', this.currentIndex < i);
|
|
59
|
+
// Update accessibility label depending on status (Completed/Current/-)
|
|
60
|
+
const hiddenLabel = el.querySelector('.step-hidden-label');
|
|
61
|
+
if (hiddenLabel) {
|
|
62
|
+
let labelText = '';
|
|
63
|
+
if (this.currentIndex > i) {
|
|
64
|
+
labelText = `${this.textCompletedStep}:`;
|
|
65
|
+
}
|
|
66
|
+
else if (this.currentIndex === i) {
|
|
67
|
+
labelText = `${this.textCurrentStep}:`;
|
|
68
|
+
}
|
|
69
|
+
hiddenLabel.textContent = labelText;
|
|
70
|
+
}
|
|
71
|
+
// Update accessibility aria attributes
|
|
72
|
+
if (this.currentIndex === i) {
|
|
73
|
+
el.setAttribute('aria-current', 'step');
|
|
74
|
+
el.setAttribute('aria-live', 'polite');
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
el.removeAttribute('aria-current');
|
|
78
|
+
el.removeAttribute('aria-live');
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
this.updateMobileActiveStepVisibility();
|
|
82
|
+
}
|
|
83
|
+
updateMobileActiveStepVisibility() {
|
|
84
|
+
if (this.currentIndex >= this.stepItems.length || this.currentIndex < 0) {
|
|
85
|
+
this.mobileActiveStepLabel = '';
|
|
86
|
+
this.mobileActiveStepName = '';
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
render() {
|
|
90
|
+
return (h(Host, { key: 'b067a1d91483d604139bb4e5b2937b9b2ea9375a', "data-version": version }, h("ol", { key: '411439c01f0ede28038149f9dcb37d6d7e1198ea' }, h("slot", { key: '71ac965a4bb0e1650c3e0d66d9915f0efd6ee9c6', onSlotchange: () => this.updateSteps() })), h("div", { key: '7168af48d858edbf87168289cbce9059471ba176', class: "active-step", "aria-hidden": "true" }, this.mobileActiveStepLabel, h("span", { key: '93fbf92d1b5a4a17488b8a73cff8e3aea20d4389', innerHTML: this.mobileActiveStepName }))));
|
|
91
|
+
}
|
|
92
|
+
static get is() { return "post-stepper"; }
|
|
93
|
+
static get encapsulation() { return "shadow"; }
|
|
94
|
+
static get originalStyleUrls() {
|
|
95
|
+
return {
|
|
96
|
+
"$": ["post-stepper.scss"]
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
static get styleUrls() {
|
|
100
|
+
return {
|
|
101
|
+
"$": ["post-stepper.css"]
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
static get properties() {
|
|
105
|
+
return {
|
|
106
|
+
"textCurrentStep": {
|
|
107
|
+
"type": "string",
|
|
108
|
+
"attribute": "text-current-step",
|
|
109
|
+
"mutable": false,
|
|
110
|
+
"complexType": {
|
|
111
|
+
"original": "string",
|
|
112
|
+
"resolved": "string",
|
|
113
|
+
"references": {}
|
|
114
|
+
},
|
|
115
|
+
"required": true,
|
|
116
|
+
"optional": false,
|
|
117
|
+
"docs": {
|
|
118
|
+
"tags": [],
|
|
119
|
+
"text": "\"Current step\" label for accessibility"
|
|
120
|
+
},
|
|
121
|
+
"getter": false,
|
|
122
|
+
"setter": false,
|
|
123
|
+
"reflect": true
|
|
124
|
+
},
|
|
125
|
+
"textCompletedStep": {
|
|
126
|
+
"type": "string",
|
|
127
|
+
"attribute": "text-completed-step",
|
|
128
|
+
"mutable": false,
|
|
129
|
+
"complexType": {
|
|
130
|
+
"original": "string",
|
|
131
|
+
"resolved": "string",
|
|
132
|
+
"references": {}
|
|
133
|
+
},
|
|
134
|
+
"required": true,
|
|
135
|
+
"optional": false,
|
|
136
|
+
"docs": {
|
|
137
|
+
"tags": [],
|
|
138
|
+
"text": "\"Completed step\" label for accessibility"
|
|
139
|
+
},
|
|
140
|
+
"getter": false,
|
|
141
|
+
"setter": false,
|
|
142
|
+
"reflect": true
|
|
143
|
+
},
|
|
144
|
+
"textStepNumber": {
|
|
145
|
+
"type": "string",
|
|
146
|
+
"attribute": "text-step-number",
|
|
147
|
+
"mutable": false,
|
|
148
|
+
"complexType": {
|
|
149
|
+
"original": "string",
|
|
150
|
+
"resolved": "string",
|
|
151
|
+
"references": {}
|
|
152
|
+
},
|
|
153
|
+
"required": true,
|
|
154
|
+
"optional": false,
|
|
155
|
+
"docs": {
|
|
156
|
+
"tags": [],
|
|
157
|
+
"text": "Label for the \"Step N:\" indicator for mobile view.\nUse `#number` as a placeholder \u2014 it will be replaced with the current step number at runtime."
|
|
158
|
+
},
|
|
159
|
+
"getter": false,
|
|
160
|
+
"setter": false,
|
|
161
|
+
"reflect": true
|
|
162
|
+
},
|
|
163
|
+
"currentIndex": {
|
|
164
|
+
"type": "number",
|
|
165
|
+
"attribute": "current-index",
|
|
166
|
+
"mutable": false,
|
|
167
|
+
"complexType": {
|
|
168
|
+
"original": "number",
|
|
169
|
+
"resolved": "number",
|
|
170
|
+
"references": {}
|
|
171
|
+
},
|
|
172
|
+
"required": false,
|
|
173
|
+
"optional": false,
|
|
174
|
+
"docs": {
|
|
175
|
+
"tags": [],
|
|
176
|
+
"text": "Defines the currently active step"
|
|
177
|
+
},
|
|
178
|
+
"getter": false,
|
|
179
|
+
"setter": false,
|
|
180
|
+
"reflect": false,
|
|
181
|
+
"defaultValue": "-1"
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
static get states() {
|
|
186
|
+
return {
|
|
187
|
+
"mobileActiveStepLabel": {},
|
|
188
|
+
"mobileActiveStepName": {}
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
static get elementRef() { return "host"; }
|
|
192
|
+
static get watchers() {
|
|
193
|
+
return [{
|
|
194
|
+
"propName": "textCurrentStep",
|
|
195
|
+
"methodName": "validateTextCurrentStep"
|
|
196
|
+
}, {
|
|
197
|
+
"propName": "textCompletedStep",
|
|
198
|
+
"methodName": "validateTextCompletedStep"
|
|
199
|
+
}, {
|
|
200
|
+
"propName": "textStepNumber",
|
|
201
|
+
"methodName": "validateTextStepNumber"
|
|
202
|
+
}, {
|
|
203
|
+
"propName": "currentIndex",
|
|
204
|
+
"methodName": "validateCurrentIndex"
|
|
205
|
+
}];
|
|
206
|
+
}
|
|
207
|
+
}
|