@swisspost/design-system-components 10.0.0-next.55 → 10.0.0-next.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{components/react/p-CJ80BZ06.js → cjs/breakpoints-Df03Ct7n.js} +103 -5
- package/dist/cjs/debounce-BsIBi_-2.js +13 -0
- package/dist/cjs/environment-BQE9Unf_.js +52 -0
- package/dist/cjs/{event-from-CLvtSUKf.js → event-from-CwMw19f8.js} +2 -2
- package/dist/cjs/fade-CPQhl1fP.js +26 -0
- package/dist/cjs/fade-slide-dPhQa-I1.js +38 -0
- package/dist/cjs/{get-focusable-children-Bx63XUQg.js → get-focusable-children-ChETM1wK.js} +29 -21
- package/dist/cjs/{get-root-CyMf3Vsd.js → get-root-CUAv4k4C.js} +2 -2
- package/dist/cjs/{index-B4gYpuJF.js → index-B4rc1pqu.js} +2150 -292
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{package-DkJrv93P.js → package-uQ5oiSiN.js} +1 -1
- package/dist/cjs/post-accordion_2.cjs.entry.js +19 -15
- package/dist/cjs/post-avatar.cjs.entry.js +27 -17
- package/dist/cjs/post-back-to-top.cjs.entry.js +23 -43
- package/dist/cjs/post-banner.cjs.entry.js +15 -12
- package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +14 -12
- package/dist/cjs/post-breadcrumbs.cjs.entry.js +33 -34
- package/dist/cjs/post-card-control.cjs.entry.js +42 -26
- package/dist/cjs/{post-closebutton_15.cjs.entry.js → post-closebutton_13.cjs.entry.js} +618 -531
- package/dist/cjs/post-collapsible_2.cjs.entry.js +41 -37
- package/dist/cjs/post-components.cjs.js +3 -3
- package/dist/cjs/post-env-test.cjs.entry.js +15 -0
- package/dist/cjs/post-footer.cjs.entry.js +24 -20
- package/dist/cjs/post-linkarea.cjs.entry.js +5 -5
- package/dist/cjs/post-pagination.cjs.entry.js +615 -0
- package/dist/cjs/post-popover-trigger.cjs.entry.js +54 -34
- package/dist/cjs/post-popover.cjs.entry.js +26 -17
- package/dist/cjs/post-rating.cjs.entry.js +24 -18
- package/dist/cjs/post-stepper-item.cjs.entry.js +5 -5
- package/dist/cjs/post-stepper.cjs.entry.js +40 -29
- package/dist/cjs/post-tab-item.cjs.entry.js +51 -0
- package/dist/cjs/post-tab-panel.cjs.entry.js +13 -11
- package/dist/cjs/post-tabs.cjs.entry.js +195 -40
- package/dist/cjs/post-tooltip-trigger.cjs.entry.js +13 -11
- package/dist/cjs/post-tooltip.cjs.entry.js +14 -12
- package/dist/cjs/utils-s05L2ulk.js +26 -0
- package/dist/collection/animations/collapse.js +3 -3
- package/dist/collection/animations/fade-slide.js +33 -0
- package/dist/collection/animations/fade.js +19 -7
- package/dist/collection/animations/index.js +2 -0
- package/dist/collection/animations/slide.js +25 -21
- package/dist/collection/animations/types.js +14 -0
- package/dist/collection/animations/utils.js +8 -0
- package/dist/collection/collection-manifest.json +8 -8
- package/dist/collection/components/post-accordion/post-accordion.css +1 -1
- package/dist/collection/components/post-accordion/post-accordion.js +5 -4
- package/dist/collection/components/post-accordion-item/post-accordion-item.css +1 -1
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +9 -8
- package/dist/collection/components/post-avatar/post-avatar.js +11 -11
- package/dist/collection/components/post-back-to-top/post-back-to-top.js +15 -15
- package/dist/collection/components/post-banner/post-banner.css +4 -1
- package/dist/collection/components/post-banner/post-banner.js +6 -5
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +3 -3
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.js +29 -29
- package/dist/collection/components/post-card-control/post-card-control.js +18 -18
- package/dist/collection/components/post-closebutton/post-closebutton.css +1 -1
- package/dist/collection/components/post-closebutton/post-closebutton.js +4 -3
- package/dist/collection/components/post-collapsible/post-collapsible.js +28 -28
- package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +3 -3
- package/dist/collection/components/post-footer/post-footer.css +1 -1
- package/dist/collection/components/post-footer/post-footer.js +18 -16
- package/dist/collection/components/post-header/post-header.css +1 -1
- package/dist/collection/components/post-header/post-header.js +144 -82
- package/dist/collection/components/post-icon/post-icon.js +18 -16
- package/dist/collection/components/post-language-menu/post-language-menu.css +1 -0
- package/dist/collection/components/{post-language-switch/post-language-switch.js → post-language-menu/post-language-menu.js} +45 -36
- package/dist/collection/components/post-language-menu-item/post-language-menu-item.css +1 -0
- package/dist/collection/components/{post-language-option/post-language-option.js → post-language-menu-item/post-language-menu-item.js} +24 -23
- package/dist/collection/components/post-linkarea/post-linkarea.js +1 -1
- package/dist/collection/components/post-logo/post-logo.css +3 -1
- package/dist/collection/components/post-logo/post-logo.js +3 -3
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +1 -1
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +41 -29
- package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.js +183 -74
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.css +3 -1
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +81 -75
- package/dist/collection/components/post-menu/post-menu.css +1 -1
- package/dist/collection/components/post-menu/post-menu.js +39 -38
- package/dist/collection/components/post-menu-item/post-menu-item.js +1 -1
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +3 -3
- package/dist/collection/components/post-pagination/post-pagination.css +1 -0
- package/dist/collection/components/post-pagination/post-pagination.js +838 -0
- package/dist/collection/components/post-popover/post-popover.js +22 -16
- package/dist/collection/components/post-popover-trigger/post-popover-trigger.js +45 -29
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -1
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +82 -131
- package/dist/collection/components/post-rating/post-rating.js +7 -7
- package/dist/collection/components/post-stepper/post-stepper.js +38 -35
- package/dist/collection/components/post-stepper-item/post-stepper-item.css +2 -2
- package/dist/collection/components/post-stepper-item/post-stepper-item.js +1 -1
- package/dist/collection/components/post-tab-item/post-tab-item.css +1 -0
- package/dist/collection/components/post-tab-item/post-tab-item.js +86 -0
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +10 -10
- package/dist/collection/components/post-tabs/post-tabs.js +232 -59
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +2 -2
- package/dist/collection/components/post-tooltip/post-tooltip.js +9 -27
- package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +4 -4
- package/dist/collection/utils/environment.js +47 -2
- package/dist/collection/utils/event-from.js +2 -2
- package/dist/collection/utils/get-focusable-children.js +29 -21
- package/dist/collection/utils/is-motion-reduced.js +1 -1
- package/dist/collection/utils/tests/environment/hydrate-app-helper.js +16 -0
- package/dist/collection/utils/tests/environment/post-env-test.js +9 -0
- package/dist/component-names.json +4 -5
- package/dist/components/breakpoints.js +1 -178
- package/dist/components/debounce.js +1 -0
- package/dist/components/environment.js +1 -0
- package/dist/components/event-from.js +1 -119
- package/dist/components/fade-slide.js +1 -0
- package/dist/components/fade.js +1 -11
- package/dist/components/focusable.js +1 -5018
- package/dist/components/get-focusable-children.js +1 -64
- package/dist/components/get-root.js +1 -15
- package/dist/components/heading-levels.js +1 -3
- package/dist/components/index.browser.js +1 -14
- package/dist/components/index.d.ts +11 -10
- package/dist/components/index.js +1 -39
- package/dist/components/long-press-event.js +1 -257
- package/dist/components/package.js +1 -3
- package/dist/components/post-accordion-item.js +1 -6
- package/dist/components/post-accordion-item2.js +1 -113
- package/dist/components/post-accordion.js +1 -6
- package/dist/components/post-accordion2.js +1 -138
- package/dist/components/post-avatar.js +1 -217
- package/dist/components/post-back-to-top.js +1 -144
- package/dist/components/post-banner.js +1 -98
- package/dist/components/post-breadcrumb-item.js +1 -6
- package/dist/components/post-breadcrumb-item2.js +1 -79
- package/dist/components/post-breadcrumbs.js +1 -196
- package/dist/components/post-card-control.js +1 -326
- package/dist/components/post-closebutton.js +1 -6
- package/dist/components/post-closebutton2.js +1 -77
- package/dist/components/post-collapsible-trigger.js +1 -6
- package/dist/components/post-collapsible-trigger2.js +1 -136
- package/dist/components/post-collapsible.js +1 -6
- package/dist/components/post-collapsible2.js +1 -110
- package/dist/components/{post-list.d.ts → post-env-test.d.ts} +4 -4
- package/dist/components/post-env-test.js +1 -0
- package/dist/components/post-footer.js +1 -116
- package/dist/components/post-header.js +1 -372
- package/dist/components/post-icon.js +1 -6
- package/dist/components/post-icon2.js +1 -159
- package/dist/components/post-language-menu-item.d.ts +11 -0
- package/dist/components/post-language-menu-item.js +1 -0
- package/dist/components/{post-language-switch.d.ts → post-language-menu.d.ts} +4 -4
- package/dist/components/post-language-menu.js +1 -0
- package/dist/components/post-linkarea.js +1 -58
- package/dist/components/post-logo.js +1 -58
- package/dist/components/post-mainnavigation.js +1 -180
- package/dist/components/post-megadropdown-trigger.js +1 -136
- package/dist/components/post-megadropdown.js +1 -267
- package/dist/components/post-menu-item.js +1 -6
- package/dist/components/post-menu-item2.js +1 -30
- package/dist/components/post-menu-trigger.js +1 -6
- package/dist/components/post-menu-trigger2.js +1 -110
- package/dist/components/post-menu.js +1 -6
- package/dist/components/post-menu2.js +1 -242
- package/dist/components/{post-tab-header.d.ts → post-pagination.d.ts} +4 -4
- package/dist/components/post-pagination.js +1 -0
- package/dist/components/post-popover-trigger.js +1 -132
- package/dist/components/post-popover.js +1 -118
- package/dist/components/post-popovercontainer.js +1 -6
- package/dist/components/post-popovercontainer2.js +1 -3127
- package/dist/components/post-rating.js +1 -148
- package/dist/components/post-stepper-item.js +1 -33
- package/dist/components/post-stepper.js +1 -134
- package/dist/components/{post-list-item.d.ts → post-tab-item.d.ts} +4 -4
- package/dist/components/post-tab-item.js +1 -0
- package/dist/components/post-tab-panel.js +1 -54
- package/dist/components/post-tabs.js +1 -196
- package/dist/components/post-togglebutton.js +1 -56
- package/dist/components/post-togglebutton2.js +1 -0
- package/dist/components/post-tooltip-trigger.js +1 -206
- package/dist/components/post-tooltip.js +1 -114
- package/dist/components/react/index.d.ts +2 -0
- package/dist/components/react/index.js +1 -2315
- package/dist/components/react/p-B8YiQ3mz.js +1 -0
- package/dist/components/react/p-BC5nlBvn.js +1 -0
- package/dist/components/react/p-BLchVpF6.js +1 -14
- package/dist/components/react/p-BVCjnh6Q.js +1 -0
- package/dist/{post-components/p-CBFgkSgY.js → components/react/p-BVGcVycs.js} +1 -1
- package/dist/components/react/p-B_XPj2c8.js +1 -0
- package/dist/components/react/p-BllOMLDs.js +1 -0
- package/dist/components/react/p-BmRNjQUZ.js +1 -0
- package/dist/components/react/p-ByFh05IW.js +1 -0
- package/dist/components/react/p-C9hMpmsD.js +1 -0
- package/dist/components/react/p-CJ13r5fi.js +1 -0
- package/dist/components/react/p-CZvbetqX.js +1 -0
- package/dist/components/react/p-C_2k3G1c.js +1 -257
- package/dist/components/react/p-CoDiS_Ik.js +1 -0
- package/dist/components/react/p-Cou17ld8.js +1 -0
- package/dist/components/react/p-D5knoiyy.js +1 -0
- package/dist/components/react/p-D9DDtvFM.js +1 -0
- package/dist/components/react/p-DY2U5CQt.js +1 -0
- package/dist/components/react/p-DjIHLduJ.js +1 -3
- package/dist/components/react/p-DpATRD2W.js +1 -0
- package/dist/components/react/p-FxUVQ4Tx.js +1 -0
- package/dist/components/react/p-HygIVKXC.js +1 -5018
- package/dist/components/react/p-YR7U0Z_g.js +1 -0
- package/dist/components/react/p-ZeKXASQs.js +1 -0
- package/dist/components/react/p-r4txK0AC.js +1 -3
- package/dist/components/react/p-sSn0kXFi.js +1 -0
- package/dist/components/react/post-accordion-item.js +1 -6
- package/dist/components/react/post-accordion.js +1 -6
- package/dist/components/react/post-avatar.js +1 -218
- package/dist/components/react/post-back-to-top.js +1 -145
- package/dist/components/react/post-banner.js +1 -99
- package/dist/components/react/post-breadcrumb-item.js +1 -6
- package/dist/components/react/post-breadcrumbs.js +1 -197
- package/dist/components/react/post-card-control.js +1 -327
- package/dist/components/react/post-closebutton.js +1 -6
- package/dist/components/react/post-collapsible-trigger.js +1 -6
- package/dist/components/react/post-collapsible.js +1 -6
- package/dist/components/react/{post-list.d.ts → post-env-test.d.ts} +4 -4
- package/dist/components/react/post-env-test.js +1 -0
- package/dist/components/react/post-footer.js +1 -117
- package/dist/components/react/post-header.js +1 -373
- package/dist/components/react/post-icon.js +1 -6
- package/dist/components/react/post-language-menu-item.d.ts +11 -0
- package/dist/components/react/post-language-menu-item.js +1 -0
- package/dist/components/react/{post-language-option.d.ts → post-language-menu.d.ts} +4 -4
- package/dist/components/react/post-language-menu.js +1 -0
- package/dist/components/react/post-linkarea.js +1 -59
- package/dist/components/react/post-logo.js +1 -59
- package/dist/components/react/post-mainnavigation.js +1 -181
- package/dist/components/react/post-megadropdown-trigger.js +1 -137
- package/dist/components/react/post-megadropdown.js +1 -268
- package/dist/components/react/post-menu-item.js +1 -6
- package/dist/components/react/post-menu-trigger.js +1 -6
- package/dist/components/react/post-menu.js +1 -6
- package/dist/components/react/{post-tab-header.d.ts → post-pagination.d.ts} +4 -4
- package/dist/components/react/post-pagination.js +1 -0
- package/dist/components/react/post-popover-trigger.js +1 -133
- package/dist/components/react/post-popover.js +1 -119
- package/dist/components/react/post-popovercontainer.js +1 -6
- package/dist/components/react/post-rating.js +1 -149
- package/dist/components/react/post-stepper-item.js +1 -34
- package/dist/components/react/post-stepper.js +1 -135
- package/dist/components/react/{post-list-item.d.ts → post-tab-item.d.ts} +4 -4
- package/dist/components/react/post-tab-item.js +1 -0
- package/dist/components/react/post-tab-panel.js +1 -55
- package/dist/components/react/post-tabs.js +1 -197
- package/dist/components/react/post-togglebutton.js +1 -57
- package/dist/components/react/post-tooltip-trigger.js +1 -207
- package/dist/components/react/post-tooltip.js +1 -115
- package/dist/components/switch-variants.js +1 -3
- package/dist/components/utils.js +1 -0
- package/dist/docs.d.ts +11 -0
- package/dist/docs.json +873 -631
- package/dist/{cjs/breakpoints-CEkeixld.js → esm/breakpoints-DYoSKGHO.js} +89 -6
- package/dist/esm/debounce-C9hMpmsD.js +11 -0
- package/dist/esm/environment-CEmnRoA6.js +49 -0
- package/dist/{components/react/p-CzIKqBrS.js → esm/event-from-rEfV4v4a.js} +2 -2
- package/dist/esm/fade-DsgPYmAa.js +24 -0
- package/dist/esm/fade-slide-CvOvauo9.js +36 -0
- package/dist/esm/{get-focusable-children-D9ZHp2FP.js → get-focusable-children-BXNs2_sw.js} +29 -21
- package/dist/{components/react/p-CBFgkSgY.js → esm/get-root-CXfAA093.js} +1 -1
- package/dist/esm/{index-wEFJ-c34.js → index-CDZBzSdV.js} +2150 -292
- package/dist/esm/loader.js +3 -3
- package/dist/esm/package-CZvbetqX.js +3 -0
- package/dist/esm/post-accordion_2.entry.js +17 -13
- package/dist/esm/post-avatar.entry.js +22 -12
- package/dist/esm/post-back-to-top.entry.js +23 -43
- package/dist/esm/post-banner.entry.js +14 -11
- package/dist/esm/post-breadcrumb-item_2.entry.js +13 -11
- package/dist/esm/post-breadcrumbs.entry.js +31 -32
- package/dist/esm/post-card-control.entry.js +32 -16
- package/dist/esm/{post-closebutton_15.entry.js → post-closebutton_13.entry.js} +599 -510
- package/dist/esm/post-collapsible_2.entry.js +38 -34
- package/dist/esm/post-components.js +4 -4
- package/dist/esm/post-env-test.entry.js +13 -0
- package/dist/esm/post-footer.entry.js +21 -17
- package/dist/esm/post-linkarea.entry.js +5 -5
- package/dist/esm/post-pagination.entry.js +613 -0
- package/dist/esm/post-popover-trigger.entry.js +52 -32
- package/dist/esm/post-popover.entry.js +25 -16
- package/dist/esm/post-rating.entry.js +16 -10
- package/dist/esm/post-stepper-item.entry.js +5 -5
- package/dist/esm/post-stepper.entry.js +39 -28
- package/dist/esm/post-tab-item.entry.js +49 -0
- package/dist/esm/post-tab-panel.entry.js +13 -11
- package/dist/esm/post-tabs.entry.js +195 -40
- package/dist/esm/post-tooltip-trigger.entry.js +10 -8
- package/dist/esm/post-tooltip.entry.js +13 -11
- package/dist/esm/utils-CoDiS_Ik.js +24 -0
- package/dist/post-components/p-09ba7cf9.entry.js +1 -0
- package/dist/post-components/p-0c091898.entry.js +1 -0
- package/dist/post-components/{p-cd03e6f2.entry.js → p-0e97fcfd.entry.js} +1 -1
- package/dist/post-components/p-296f1dd5.entry.js +1 -0
- package/dist/post-components/p-32ad2b21.entry.js +1 -0
- package/dist/post-components/p-366c28cb.entry.js +1 -0
- package/dist/post-components/p-41ae68d5.entry.js +1 -0
- package/dist/post-components/p-448e7265.entry.js +1 -0
- package/dist/post-components/p-554da188.entry.js +1 -0
- package/dist/post-components/p-5912f8f1.entry.js +1 -0
- package/dist/post-components/p-790f300d.entry.js +1 -0
- package/dist/post-components/p-7ed5a493.entry.js +1 -0
- package/dist/post-components/p-85bea1b6.entry.js +1 -0
- package/dist/post-components/p-8bcff4d2.entry.js +1 -0
- package/dist/post-components/p-9dc9c245.entry.js +1 -0
- package/dist/post-components/p-B7ebLhHc.js +1 -0
- package/dist/post-components/p-BVCjnh6Q.js +1 -0
- package/dist/post-components/p-BXNs2_sw.js +1 -0
- package/dist/post-components/p-C9hMpmsD.js +1 -0
- package/dist/post-components/p-CDZBzSdV.js +2 -0
- package/dist/post-components/p-CEmnRoA6.js +1 -0
- package/dist/post-components/p-CZvbetqX.js +1 -0
- package/dist/post-components/p-CoDiS_Ik.js +1 -0
- package/dist/post-components/p-D5knoiyy.js +1 -0
- package/dist/post-components/p-DI-h_mEL.js +1 -0
- package/dist/post-components/p-a06f9695.entry.js +1 -0
- package/dist/post-components/p-a191f1df.entry.js +1 -0
- package/dist/post-components/p-c5d19d62.entry.js +1 -0
- package/dist/post-components/{p-24dc54d1.entry.js → p-c8c4d05b.entry.js} +1 -1
- package/dist/post-components/{p-57288cb2.entry.js → p-d1a5c980.entry.js} +1 -1
- package/dist/post-components/p-d4e2c556.entry.js +1 -0
- package/dist/post-components/p-f96a310c.entry.js +1 -0
- package/dist/post-components/p-fab2327d.entry.js +1 -0
- package/dist/post-components/p-rEfV4v4a.js +1 -0
- package/dist/post-components/post-components.css +1 -1
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/prebuild.js +46 -0
- package/dist/types/animations/collapse.d.ts +1 -0
- package/dist/types/animations/fade-slide.d.ts +11 -0
- package/dist/types/animations/fade.d.ts +2 -2
- package/dist/types/animations/index.d.ts +2 -0
- package/dist/types/animations/slide.d.ts +9 -2
- package/dist/types/animations/types.d.ts +13 -0
- package/dist/types/animations/utils.d.ts +2 -0
- package/dist/types/components/post-accordion-item/heading-levels.d.ts +1 -1
- package/dist/types/components/post-accordion-item/post-accordion-item.d.ts +2 -2
- package/dist/types/components/post-back-to-top/post-back-to-top.d.ts +2 -2
- package/dist/types/components/post-breadcrumbs/post-breadcrumbs.d.ts +6 -6
- package/dist/types/components/post-collapsible/post-collapsible.d.ts +4 -5
- package/dist/types/components/post-footer/post-footer.d.ts +4 -4
- package/dist/types/components/post-header/post-header.d.ts +23 -13
- package/dist/types/components/{post-language-switch/post-language-switch.d.ts → post-language-menu/post-language-menu.d.ts} +12 -11
- package/dist/types/components/{post-language-option/post-language-option.d.ts → post-language-menu-item/post-language-menu-item.d.ts} +5 -5
- package/dist/types/components/post-mainnavigation/post-mainnavigation.d.ts +6 -5
- package/dist/types/components/post-megadropdown/post-megadropdown.d.ts +20 -2
- package/dist/types/components/post-megadropdown-trigger/post-megadropdown-trigger.d.ts +17 -23
- package/dist/types/components/post-menu/post-menu.d.ts +4 -4
- package/dist/types/components/post-pagination/post-pagination.d.ts +224 -0
- package/dist/types/components/post-popover/post-popover.d.ts +4 -3
- package/dist/types/components/post-popover-trigger/post-popover-trigger.d.ts +2 -1
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +23 -21
- package/dist/types/components/post-rating/post-rating.d.ts +1 -1
- package/dist/types/components/post-stepper/post-stepper.d.ts +9 -8
- package/dist/types/components/post-tab-item/post-tab-item.d.ts +19 -0
- package/dist/types/components/post-tab-panel/post-tab-panel.d.ts +3 -3
- package/dist/types/components/post-tabs/post-tabs.d.ts +33 -12
- package/dist/types/components/post-tooltip/post-tooltip.d.ts +1 -5
- package/dist/types/components.d.ts +322 -219
- package/dist/types/home/runner/work/design-system/design-system/packages/components/.stencil/prebuild.d.ts +9 -0
- package/dist/types/stencil-public-runtime.d.ts +147 -10
- package/dist/types/types/heading-levels.d.ts +1 -1
- package/dist/types/utils/environment.d.ts +25 -1
- package/dist/types/utils/get-focusable-children.d.ts +2 -2
- package/dist/types/utils/tests/environment/hydrate-app-helper.d.ts +5 -0
- package/dist/types/utils/tests/environment/post-env-test.d.ts +3 -0
- package/hydrate/index.d.ts +14 -0
- package/hydrate/index.js +7494 -2714
- package/hydrate/index.mjs +7493 -2715
- package/package.json +7 -8
- package/dist/cjs/fade-nS5zzDQS.js +0 -14
- package/dist/cjs/index-UFKR6Ok0.js +0 -98
- package/dist/cjs/post-tab-header.cjs.entry.js +0 -31
- package/dist/collection/animations/slide-and-fade.js +0 -25
- package/dist/collection/components/post-language-option/post-language-option.css +0 -1
- package/dist/collection/components/post-language-switch/post-language-switch.css +0 -1
- package/dist/collection/components/post-list/post-list.css +0 -1
- package/dist/collection/components/post-list/post-list.js +0 -97
- package/dist/collection/components/post-list-item/post-list-item.css +0 -1
- package/dist/collection/components/post-list-item/post-list-item.js +0 -26
- package/dist/collection/components/post-tab-header/post-tab-header.css +0 -1
- package/dist/collection/components/post-tab-header/post-tab-header.js +0 -65
- package/dist/components/index2.js +0 -89
- package/dist/components/post-language-option.d.ts +0 -11
- package/dist/components/post-language-option.js +0 -99
- package/dist/components/post-language-switch.js +0 -157
- package/dist/components/post-list-item.js +0 -38
- package/dist/components/post-list.js +0 -61
- package/dist/components/post-tab-header.js +0 -52
- package/dist/components/react/p-BVXiQdHq.js +0 -64
- package/dist/components/react/p-BhxZzOEC.js +0 -3
- package/dist/components/react/p-CSAMO7iJ.js +0 -243
- package/dist/components/react/p-CYkf_7Y5.js +0 -89
- package/dist/components/react/p-Ccrl2AQn.js +0 -111
- package/dist/components/react/p-CewRvBtg.js +0 -139
- package/dist/components/react/p-Cwiv86_f.js +0 -111
- package/dist/components/react/p-D2waO0Zc.js +0 -31
- package/dist/components/react/p-DBPOV12C.js +0 -160
- package/dist/components/react/p-DVGEExot.js +0 -3128
- package/dist/components/react/p-Djvj8fd2.js +0 -80
- package/dist/components/react/p-LtiDhYis.js +0 -137
- package/dist/components/react/p-SbIC4aZX.js +0 -11
- package/dist/components/react/p-XrZzCOKT.js +0 -78
- package/dist/components/react/p-v3pOrMNQ.js +0 -114
- package/dist/components/react/post-language-option.js +0 -100
- package/dist/components/react/post-language-switch.d.ts +0 -11
- package/dist/components/react/post-language-switch.js +0 -158
- package/dist/components/react/post-list-item.js +0 -39
- package/dist/components/react/post-list.js +0 -62
- package/dist/components/react/post-tab-header.js +0 -53
- package/dist/esm/breakpoints-CJ80BZ06.js +0 -178
- package/dist/esm/event-from-CzIKqBrS.js +0 -119
- package/dist/esm/fade-SbIC4aZX.js +0 -11
- package/dist/esm/get-root-BkQ3CrLq.js +0 -15
- package/dist/esm/index-Beaz8wEe.js +0 -89
- package/dist/esm/package-BhxZzOEC.js +0 -3
- package/dist/esm/post-tab-header.entry.js +0 -29
- package/dist/post-components/p-01e678c9.entry.js +0 -1
- package/dist/post-components/p-034a453f.entry.js +0 -1
- package/dist/post-components/p-15a4cdbf.entry.js +0 -1
- package/dist/post-components/p-2a2030bf.entry.js +0 -1
- package/dist/post-components/p-2ed84cc3.entry.js +0 -1
- package/dist/post-components/p-3228968f.entry.js +0 -1
- package/dist/post-components/p-3c01ddfe.entry.js +0 -1
- package/dist/post-components/p-748b1f01.entry.js +0 -1
- package/dist/post-components/p-7745e46e.entry.js +0 -1
- package/dist/post-components/p-7f635728.entry.js +0 -1
- package/dist/post-components/p-82c178a3.entry.js +0 -1
- package/dist/post-components/p-9b5f8319.entry.js +0 -1
- package/dist/post-components/p-Beaz8wEe.js +0 -1
- package/dist/post-components/p-BhxZzOEC.js +0 -1
- package/dist/post-components/p-CJ80BZ06.js +0 -1
- package/dist/post-components/p-D9ZHp2FP.js +0 -1
- package/dist/post-components/p-SbIC4aZX.js +0 -1
- package/dist/post-components/p-a9644e54.entry.js +0 -1
- package/dist/post-components/p-af030a3a.entry.js +0 -1
- package/dist/post-components/p-b8ba8139.entry.js +0 -1
- package/dist/post-components/p-db935e8e.entry.js +0 -1
- package/dist/post-components/p-e62e1f57.entry.js +0 -1
- package/dist/post-components/p-fb4b1641.entry.js +0 -1
- package/dist/post-components/p-wEFJ-c34.js +0 -2
- package/dist/types/animations/slide-and-fade.d.ts +0 -2
- package/dist/types/components/post-list/post-list.d.ts +0 -24
- package/dist/types/components/post-list-item/post-list-item.d.ts +0 -8
- package/dist/types/components/post-tab-header/post-tab-header.d.ts +0 -14
- /package/dist/collection/components/{post-language-switch → post-language-menu}/switch-variants.js +0 -0
- /package/dist/{post-components/p-CzIKqBrS.js → components/react/p-rEfV4v4a.js} +0 -0
- /package/dist/types/components/{post-language-switch → post-language-menu}/switch-variants.d.ts +0 -0
|
@@ -22,19 +22,20 @@ 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
|
|
34
34
|
* @param target A focusable element inside the <post-popover-trigger> component that controls the popover
|
|
35
35
|
*/
|
|
36
36
|
async show(target) {
|
|
37
|
-
this.popoverRef.show(target);
|
|
37
|
+
await this.popoverRef.show(target);
|
|
38
|
+
this.focusFirstEl();
|
|
38
39
|
}
|
|
39
40
|
/**
|
|
40
41
|
* Programmatically hide this popover
|
|
@@ -48,16 +49,20 @@ export class PostPopover {
|
|
|
48
49
|
* @param force Pass true to always show or false to always hide
|
|
49
50
|
*/
|
|
50
51
|
async toggle(target, force) {
|
|
51
|
-
await this.popoverRef.toggle(target, force);
|
|
52
|
+
const isOpen = await this.popoverRef.toggle(target, force);
|
|
53
|
+
if (isOpen)
|
|
54
|
+
this.focusFirstEl();
|
|
55
|
+
}
|
|
56
|
+
focusFirstEl() {
|
|
52
57
|
const focusableChildren = getDeepFocusableChildren(this.host);
|
|
53
|
-
//
|
|
58
|
+
// Find first focusable element
|
|
54
59
|
const firstFocusable = focusableChildren[0];
|
|
55
60
|
if (firstFocusable) {
|
|
56
61
|
firstFocusable.focus();
|
|
57
62
|
}
|
|
58
63
|
}
|
|
59
64
|
render() {
|
|
60
|
-
return (h(Host, { key: '
|
|
65
|
+
return (h(Host, { key: 'd015a324a7c9fe1c3508ccd3e434435d92d74f85', "data-version": version }, h("post-popovercontainer", { key: '01c575c2b9370d512858e9c71a402ee08843d052', arrow: this.arrow, placement: this.placement, ref: e => (this.popoverRef = e) }, h("div", { key: '4be3ccad4885493091a9572c6bf95ea137ad66f9', class: "popover-container" }, h("div", { key: '3b9e69e7e84f7acdb2a14cb27e11d10d4aa2900b', class: "popover-content" }, h("slot", { key: 'de871fc377dfdc17f64f9bb40e5421e00a103ce0' })), h("post-closebutton", { key: 'd73a44affc7e09a3452988f63f16cc4eea83aa66', onClick: () => this.hide() }, this.textClose)))));
|
|
61
66
|
}
|
|
62
67
|
static get is() { return "post-popover"; }
|
|
63
68
|
static get encapsulation() { return "shadow"; }
|
|
@@ -75,7 +80,6 @@ export class PostPopover {
|
|
|
75
80
|
return {
|
|
76
81
|
"placement": {
|
|
77
82
|
"type": "string",
|
|
78
|
-
"attribute": "placement",
|
|
79
83
|
"mutable": false,
|
|
80
84
|
"complexType": {
|
|
81
85
|
"original": "Placement",
|
|
@@ -84,7 +88,8 @@ export class PostPopover {
|
|
|
84
88
|
"Placement": {
|
|
85
89
|
"location": "import",
|
|
86
90
|
"path": "@floating-ui/dom",
|
|
87
|
-
"id": "../../node_modules/.pnpm/@floating-ui+dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.d.
|
|
91
|
+
"id": "../../node_modules/.pnpm/@floating-ui+dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.d.mts::Placement",
|
|
92
|
+
"referenceLocation": "Placement"
|
|
88
93
|
}
|
|
89
94
|
}
|
|
90
95
|
},
|
|
@@ -97,11 +102,11 @@ export class PostPopover {
|
|
|
97
102
|
"getter": false,
|
|
98
103
|
"setter": false,
|
|
99
104
|
"reflect": false,
|
|
105
|
+
"attribute": "placement",
|
|
100
106
|
"defaultValue": "'top'"
|
|
101
107
|
},
|
|
102
|
-
"
|
|
108
|
+
"textClose": {
|
|
103
109
|
"type": "string",
|
|
104
|
-
"attribute": "close-button-caption",
|
|
105
110
|
"mutable": false,
|
|
106
111
|
"complexType": {
|
|
107
112
|
"original": "string",
|
|
@@ -112,15 +117,15 @@ export class PostPopover {
|
|
|
112
117
|
"optional": false,
|
|
113
118
|
"docs": {
|
|
114
119
|
"tags": [],
|
|
115
|
-
"text": "Define the
|
|
120
|
+
"text": "Define the text of the close button for assistive technology"
|
|
116
121
|
},
|
|
117
122
|
"getter": false,
|
|
118
123
|
"setter": false,
|
|
119
|
-
"reflect": true
|
|
124
|
+
"reflect": true,
|
|
125
|
+
"attribute": "text-close"
|
|
120
126
|
},
|
|
121
127
|
"arrow": {
|
|
122
128
|
"type": "boolean",
|
|
123
|
-
"attribute": "arrow",
|
|
124
129
|
"mutable": false,
|
|
125
130
|
"complexType": {
|
|
126
131
|
"original": "boolean",
|
|
@@ -136,6 +141,7 @@ export class PostPopover {
|
|
|
136
141
|
"getter": false,
|
|
137
142
|
"setter": false,
|
|
138
143
|
"reflect": false,
|
|
144
|
+
"attribute": "arrow",
|
|
139
145
|
"defaultValue": "true"
|
|
140
146
|
}
|
|
141
147
|
};
|
|
@@ -230,8 +236,8 @@ export class PostPopover {
|
|
|
230
236
|
"propName": "placement",
|
|
231
237
|
"methodName": "validatePlacement"
|
|
232
238
|
}, {
|
|
233
|
-
"propName": "
|
|
234
|
-
"methodName": "
|
|
239
|
+
"propName": "textClose",
|
|
240
|
+
"methodName": "validateTextClose"
|
|
235
241
|
}];
|
|
236
242
|
}
|
|
237
243
|
}
|
|
@@ -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: '8552f66f45c0cf3f772cb96b4974a447a4a2cf19', "data-version": version }, h("slot", { key: '06824853f828cc65ba7a7a2b7ae8b762f6b1eaee', onSlotchange: () => this.setupTrigger() })));
|
|
93
109
|
}
|
|
94
110
|
static get is() { return "post-popover-trigger"; }
|
|
95
111
|
static get encapsulation() { return "shadow"; }
|
|
@@ -107,22 +123,22 @@ export class PostPopoverTrigger {
|
|
|
107
123
|
return {
|
|
108
124
|
"for": {
|
|
109
125
|
"type": "string",
|
|
110
|
-
"attribute": "for",
|
|
111
126
|
"mutable": false,
|
|
112
127
|
"complexType": {
|
|
113
128
|
"original": "string",
|
|
114
129
|
"resolved": "string",
|
|
115
130
|
"references": {}
|
|
116
131
|
},
|
|
117
|
-
"required":
|
|
118
|
-
"optional":
|
|
132
|
+
"required": false,
|
|
133
|
+
"optional": true,
|
|
119
134
|
"docs": {
|
|
120
135
|
"tags": [],
|
|
121
136
|
"text": "ID of the popover element that this trigger is linked to. Used to open and close the popover."
|
|
122
137
|
},
|
|
123
138
|
"getter": false,
|
|
124
139
|
"setter": false,
|
|
125
|
-
"reflect": true
|
|
140
|
+
"reflect": true,
|
|
141
|
+
"attribute": "for"
|
|
126
142
|
}
|
|
127
143
|
};
|
|
128
144
|
}
|
|
@@ -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}}
|
|
@@ -6,6 +6,9 @@ import { PLACEMENT_TYPES } from "../../types/index";
|
|
|
6
6
|
// Polyfill for popovers, can be removed when https://caniuse.com/?search=popover is green
|
|
7
7
|
import { apply, isSupported } from "@oddbird/popover-polyfill/fn";
|
|
8
8
|
import { popIn } from "../../animations/pop-in";
|
|
9
|
+
const ANIMATIONS = {
|
|
10
|
+
'pop-in': popIn,
|
|
11
|
+
};
|
|
9
12
|
/**
|
|
10
13
|
* @slot - Default slot for placing content inside the popovercontainer.
|
|
11
14
|
*/
|
|
@@ -22,18 +25,14 @@ export class PostPopovercontainer {
|
|
|
22
25
|
* Gap between the edge of the page and the popovercontainer
|
|
23
26
|
*/
|
|
24
27
|
this.edgeGap = 8;
|
|
25
|
-
/**
|
|
26
|
-
* Animation style
|
|
27
|
-
*/
|
|
28
|
-
this.animation = null;
|
|
29
28
|
/**
|
|
30
29
|
* Whether or not to display a little pointer arrow
|
|
31
30
|
*/
|
|
32
31
|
this.arrow = false;
|
|
33
32
|
/**
|
|
34
|
-
*
|
|
33
|
+
* Animation style
|
|
35
34
|
*/
|
|
36
|
-
this.
|
|
35
|
+
this.animation = 'pop-in';
|
|
37
36
|
this.currentAnimation = null;
|
|
38
37
|
}
|
|
39
38
|
validatePlacement() {
|
|
@@ -60,6 +59,9 @@ export class PostPopovercontainer {
|
|
|
60
59
|
}
|
|
61
60
|
}
|
|
62
61
|
componentDidLoad() {
|
|
62
|
+
this.validatePlacement();
|
|
63
|
+
this.validateEdgeGap();
|
|
64
|
+
this.validateSafeSpace();
|
|
63
65
|
this.host.addEventListener('beforetoggle', this.handleToggle.bind(this));
|
|
64
66
|
}
|
|
65
67
|
disconnectedCallback() {
|
|
@@ -70,7 +72,7 @@ export class PostPopovercontainer {
|
|
|
70
72
|
}
|
|
71
73
|
/**
|
|
72
74
|
* Programmatically display the popovercontainer
|
|
73
|
-
* @param target A focusable element inside the
|
|
75
|
+
* @param target A focusable element inside the trigger component that controls the popover
|
|
74
76
|
*/
|
|
75
77
|
async show(target) {
|
|
76
78
|
if (this.toggleTimeoutId)
|
|
@@ -79,15 +81,44 @@ export class PostPopovercontainer {
|
|
|
79
81
|
this.calculatePosition();
|
|
80
82
|
this.host.showPopover();
|
|
81
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Programmatically hide the popovercontainer
|
|
86
|
+
*/
|
|
87
|
+
async hide() {
|
|
88
|
+
if (!this.toggleTimeoutId) {
|
|
89
|
+
this.eventTarget = null;
|
|
90
|
+
this.host.hidePopover();
|
|
91
|
+
this.postHide.emit();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Toggle popovercontainer display
|
|
96
|
+
* @param target A focusable element inside the <post-popover-trigger> component that controls the popover
|
|
97
|
+
* @param force Pass true to always show or false to always hide
|
|
98
|
+
*/
|
|
99
|
+
async toggle(target, force) {
|
|
100
|
+
this.eventTarget = target;
|
|
101
|
+
// Prevent instant double toggle
|
|
102
|
+
if (!this.toggleTimeoutId) {
|
|
103
|
+
this.calculatePosition();
|
|
104
|
+
this.host.togglePopover(force);
|
|
105
|
+
this.toggleTimeoutId = null;
|
|
106
|
+
}
|
|
107
|
+
return this.host.matches(':where(:popover-open, .popover-open)');
|
|
108
|
+
}
|
|
82
109
|
/**
|
|
83
110
|
* Handles the popover opening process and emits related events.
|
|
84
111
|
*/
|
|
85
|
-
|
|
112
|
+
open() {
|
|
86
113
|
const content = this.host.querySelector('.popover-content');
|
|
87
114
|
this.startAutoupdates();
|
|
88
115
|
if (content) {
|
|
89
|
-
|
|
90
|
-
|
|
116
|
+
const animationFn = ANIMATIONS[this.animation];
|
|
117
|
+
// Only run the animation if it corresponds to a valid, registered animation function
|
|
118
|
+
if (typeof animationFn === 'function') {
|
|
119
|
+
this.runOpenAnimation(animationFn, content);
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
91
122
|
// No animation case
|
|
92
123
|
this.postBeforeToggle.emit({ willOpen: true });
|
|
93
124
|
this.postBeforeShow.emit({ first: this.hasOpenedOnce });
|
|
@@ -96,9 +127,6 @@ export class PostPopovercontainer {
|
|
|
96
127
|
if (this.hasOpenedOnce)
|
|
97
128
|
this.hasOpenedOnce = false;
|
|
98
129
|
}
|
|
99
|
-
else {
|
|
100
|
-
this.runOpenAnimation(content);
|
|
101
|
-
}
|
|
102
130
|
}
|
|
103
131
|
if (this.safeSpace) {
|
|
104
132
|
window.addEventListener('mousemove', this.mouseTrackingHandler.bind(this));
|
|
@@ -107,7 +135,7 @@ export class PostPopovercontainer {
|
|
|
107
135
|
/**
|
|
108
136
|
* Handles the popover closing process and emits related events.
|
|
109
137
|
*/
|
|
110
|
-
|
|
138
|
+
close() {
|
|
111
139
|
if (typeof this.clearAutoUpdate === 'function') {
|
|
112
140
|
this.clearAutoUpdate();
|
|
113
141
|
}
|
|
@@ -115,7 +143,7 @@ export class PostPopovercontainer {
|
|
|
115
143
|
window.removeEventListener('mousemove', this.mouseTrackingHandler.bind(this));
|
|
116
144
|
}
|
|
117
145
|
// Cancel any running animation
|
|
118
|
-
if (this.
|
|
146
|
+
if (this.currentAnimation) {
|
|
119
147
|
this.currentAnimation.cancel();
|
|
120
148
|
this.currentAnimation = null;
|
|
121
149
|
}
|
|
@@ -126,10 +154,18 @@ export class PostPopovercontainer {
|
|
|
126
154
|
/**
|
|
127
155
|
* Runs the animation and emits the toggle/show/hide events in the correct timing
|
|
128
156
|
*/
|
|
129
|
-
async runOpenAnimation(element) {
|
|
157
|
+
async runOpenAnimation(animationFn, element) {
|
|
130
158
|
let animation;
|
|
131
159
|
try {
|
|
132
|
-
animation =
|
|
160
|
+
animation = animationFn(element);
|
|
161
|
+
if (!animation) {
|
|
162
|
+
// Fallback: no animation, just emit open events directly
|
|
163
|
+
this.postBeforeToggle.emit({ willOpen: true });
|
|
164
|
+
this.postBeforeShow.emit({ first: this.hasOpenedOnce });
|
|
165
|
+
this.postToggle.emit({ isOpen: true });
|
|
166
|
+
this.postShow.emit({ first: this.hasOpenedOnce });
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
133
169
|
this.currentAnimation = animation;
|
|
134
170
|
if (animation.playState === 'running') {
|
|
135
171
|
this.postBeforeToggle.emit({ willOpen: true });
|
|
@@ -153,31 +189,6 @@ export class PostPopovercontainer {
|
|
|
153
189
|
}
|
|
154
190
|
}
|
|
155
191
|
}
|
|
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
192
|
/**
|
|
182
193
|
* Start or stop auto updates based on popovercontainer events.
|
|
183
194
|
* Popovercontainers can be closed or opened with other methods than class members,
|
|
@@ -199,6 +210,8 @@ export class PostPopovercontainer {
|
|
|
199
210
|
* an influence on popovercontainer positioning
|
|
200
211
|
*/
|
|
201
212
|
startAutoupdates() {
|
|
213
|
+
if (!this.eventTarget || !this.host)
|
|
214
|
+
return;
|
|
202
215
|
this.clearAutoUpdate = autoUpdate(this.eventTarget, this.host, this.calculatePosition.bind(this));
|
|
203
216
|
}
|
|
204
217
|
/**
|
|
@@ -211,6 +224,7 @@ export class PostPopovercontainer {
|
|
|
211
224
|
async calculatePosition() {
|
|
212
225
|
const { x, y, middlewareData, placement } = await this.computeMainPosition();
|
|
213
226
|
const currentPlacement = placement.split('-')[0];
|
|
227
|
+
this.dynamicPlacement = currentPlacement;
|
|
214
228
|
// Position popover
|
|
215
229
|
this.host.style.left = `${x}px`;
|
|
216
230
|
this.host.style.top = `${y}px`;
|
|
@@ -218,11 +232,20 @@ export class PostPopovercontainer {
|
|
|
218
232
|
if (this.arrow && middlewareData.arrow) {
|
|
219
233
|
const { x: arrowX, y: arrowY } = middlewareData.arrow;
|
|
220
234
|
const staticSide = PostPopovercontainer.STATIC_SIDES[currentPlacement];
|
|
235
|
+
const rootFontSize = Number.parseFloat(getComputedStyle(document.documentElement).fontSize);
|
|
236
|
+
// Calculate dynamically the half side which provides the static side offset
|
|
237
|
+
const arrowSizeValue = getComputedStyle(this.arrowRef)
|
|
238
|
+
.getPropertyValue('--arrow-size')
|
|
239
|
+
.trim();
|
|
240
|
+
const arrowSizePx = arrowSizeValue.endsWith('rem')
|
|
241
|
+
? Number.parseFloat(arrowSizeValue) * rootFontSize
|
|
242
|
+
: Number.parseFloat(arrowSizeValue);
|
|
243
|
+
const halfSide = -0.5 * arrowSizePx;
|
|
221
244
|
if (staticSide) {
|
|
222
245
|
Object.assign(this.arrowRef.style, {
|
|
223
246
|
left: arrowX ? `${arrowX}px` : '',
|
|
224
247
|
top: arrowY ? `${arrowY}px` : '',
|
|
225
|
-
[staticSide]:
|
|
248
|
+
[staticSide]: `${halfSide}px`,
|
|
226
249
|
});
|
|
227
250
|
}
|
|
228
251
|
}
|
|
@@ -323,9 +346,9 @@ export class PostPopovercontainer {
|
|
|
323
346
|
}
|
|
324
347
|
}
|
|
325
348
|
render() {
|
|
326
|
-
return (h(Host, { key: '
|
|
349
|
+
return (h(Host, { key: 'f675b14ed97d7f2931781549df8aafd9072faa96', "data-version": version, popover: "auto" }, h("div", { key: 'f66186a7448f60b9f9dcb1b3cbe047a74a85dc7b', class: "popover-content" }, this.arrow && (h("span", { key: 'd0f8f2baa005522140ac1ef49a0bccc13be72c72', "dynamic-placement": this.dynamicPlacement, class: "arrow", ref: el => {
|
|
327
350
|
this.arrowRef = el;
|
|
328
|
-
} })), h("slot", { key: '
|
|
351
|
+
} })), h("slot", { key: '5fbdad6fa76951f4d886ef0ab57e7471ac38c59d' }))));
|
|
329
352
|
}
|
|
330
353
|
static get is() { return "post-popovercontainer"; }
|
|
331
354
|
static get originalStyleUrls() {
|
|
@@ -342,7 +365,6 @@ export class PostPopovercontainer {
|
|
|
342
365
|
return {
|
|
343
366
|
"placement": {
|
|
344
367
|
"type": "string",
|
|
345
|
-
"attribute": "placement",
|
|
346
368
|
"mutable": false,
|
|
347
369
|
"complexType": {
|
|
348
370
|
"original": "Placement",
|
|
@@ -351,7 +373,8 @@ export class PostPopovercontainer {
|
|
|
351
373
|
"Placement": {
|
|
352
374
|
"location": "import",
|
|
353
375
|
"path": "@floating-ui/dom",
|
|
354
|
-
"id": "../../node_modules/.pnpm/@floating-ui+dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.d.
|
|
376
|
+
"id": "../../node_modules/.pnpm/@floating-ui+dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.d.mts::Placement",
|
|
377
|
+
"referenceLocation": "Placement"
|
|
355
378
|
}
|
|
356
379
|
}
|
|
357
380
|
},
|
|
@@ -364,11 +387,11 @@ export class PostPopovercontainer {
|
|
|
364
387
|
"getter": false,
|
|
365
388
|
"setter": false,
|
|
366
389
|
"reflect": false,
|
|
390
|
+
"attribute": "placement",
|
|
367
391
|
"defaultValue": "'top'"
|
|
368
392
|
},
|
|
369
393
|
"edgeGap": {
|
|
370
394
|
"type": "number",
|
|
371
|
-
"attribute": "edge-gap",
|
|
372
395
|
"mutable": false,
|
|
373
396
|
"complexType": {
|
|
374
397
|
"original": "number",
|
|
@@ -384,31 +407,11 @@ export class PostPopovercontainer {
|
|
|
384
407
|
"getter": false,
|
|
385
408
|
"setter": false,
|
|
386
409
|
"reflect": false,
|
|
410
|
+
"attribute": "edge-gap",
|
|
387
411
|
"defaultValue": "8"
|
|
388
412
|
},
|
|
389
|
-
"animation": {
|
|
390
|
-
"type": "string",
|
|
391
|
-
"attribute": "animation",
|
|
392
|
-
"mutable": false,
|
|
393
|
-
"complexType": {
|
|
394
|
-
"original": "'pop-in' | null",
|
|
395
|
-
"resolved": "\"pop-in\"",
|
|
396
|
-
"references": {}
|
|
397
|
-
},
|
|
398
|
-
"required": false,
|
|
399
|
-
"optional": true,
|
|
400
|
-
"docs": {
|
|
401
|
-
"tags": [],
|
|
402
|
-
"text": "Animation style"
|
|
403
|
-
},
|
|
404
|
-
"getter": false,
|
|
405
|
-
"setter": false,
|
|
406
|
-
"reflect": false,
|
|
407
|
-
"defaultValue": "null"
|
|
408
|
-
},
|
|
409
413
|
"arrow": {
|
|
410
414
|
"type": "boolean",
|
|
411
|
-
"attribute": "arrow",
|
|
412
415
|
"mutable": false,
|
|
413
416
|
"complexType": {
|
|
414
417
|
"original": "boolean",
|
|
@@ -424,31 +427,11 @@ export class PostPopovercontainer {
|
|
|
424
427
|
"getter": false,
|
|
425
428
|
"setter": false,
|
|
426
429
|
"reflect": false,
|
|
427
|
-
"
|
|
428
|
-
},
|
|
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,
|
|
430
|
+
"attribute": "arrow",
|
|
447
431
|
"defaultValue": "false"
|
|
448
432
|
},
|
|
449
433
|
"safeSpace": {
|
|
450
434
|
"type": "string",
|
|
451
|
-
"attribute": "safe-space",
|
|
452
435
|
"mutable": false,
|
|
453
436
|
"complexType": {
|
|
454
437
|
"original": "'triangle' | 'trapezoid'",
|
|
@@ -463,10 +446,16 @@ export class PostPopovercontainer {
|
|
|
463
446
|
},
|
|
464
447
|
"getter": false,
|
|
465
448
|
"setter": false,
|
|
466
|
-
"reflect": true
|
|
449
|
+
"reflect": true,
|
|
450
|
+
"attribute": "safe-space"
|
|
467
451
|
}
|
|
468
452
|
};
|
|
469
453
|
}
|
|
454
|
+
static get states() {
|
|
455
|
+
return {
|
|
456
|
+
"dynamicPlacement": {}
|
|
457
|
+
};
|
|
458
|
+
}
|
|
470
459
|
static get events() {
|
|
471
460
|
return [{
|
|
472
461
|
"method": "postBeforeShow",
|
|
@@ -553,7 +542,7 @@ export class PostPopovercontainer {
|
|
|
553
542
|
"parameters": [{
|
|
554
543
|
"name": "target",
|
|
555
544
|
"type": "HTMLElement",
|
|
556
|
-
"docs": "A focusable element inside the
|
|
545
|
+
"docs": "A focusable element inside the trigger component that controls the popover"
|
|
557
546
|
}],
|
|
558
547
|
"references": {
|
|
559
548
|
"Promise": {
|
|
@@ -571,48 +560,10 @@ export class PostPopovercontainer {
|
|
|
571
560
|
"text": "Programmatically display the popovercontainer",
|
|
572
561
|
"tags": [{
|
|
573
562
|
"name": "param",
|
|
574
|
-
"text": "target A focusable element inside the
|
|
563
|
+
"text": "target A focusable element inside the trigger component that controls the popover"
|
|
575
564
|
}]
|
|
576
565
|
}
|
|
577
566
|
},
|
|
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
567
|
"hide": {
|
|
617
568
|
"complexType": {
|
|
618
569
|
"signature": "() => Promise<void>",
|