@swisspost/design-system-components 10.0.0-next.55 → 10.0.0-next.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{components/react/p-CJ80BZ06.js → cjs/breakpoints-Df03Ct7n.js} +103 -5
- package/dist/cjs/debounce-BsIBi_-2.js +13 -0
- package/dist/cjs/environment-BQE9Unf_.js +52 -0
- package/dist/cjs/{event-from-CLvtSUKf.js → event-from-CwMw19f8.js} +2 -2
- package/dist/cjs/fade-CPQhl1fP.js +26 -0
- package/dist/cjs/fade-slide-dPhQa-I1.js +38 -0
- package/dist/cjs/{get-focusable-children-Bx63XUQg.js → get-focusable-children-ChETM1wK.js} +29 -21
- package/dist/cjs/{get-root-CyMf3Vsd.js → get-root-CUAv4k4C.js} +2 -2
- package/dist/cjs/{index-B4gYpuJF.js → index-B4rc1pqu.js} +2150 -292
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{package-DkJrv93P.js → package-uQ5oiSiN.js} +1 -1
- package/dist/cjs/post-accordion_2.cjs.entry.js +19 -15
- package/dist/cjs/post-avatar.cjs.entry.js +27 -17
- package/dist/cjs/post-back-to-top.cjs.entry.js +23 -43
- package/dist/cjs/post-banner.cjs.entry.js +15 -12
- package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +14 -12
- package/dist/cjs/post-breadcrumbs.cjs.entry.js +33 -34
- package/dist/cjs/post-card-control.cjs.entry.js +42 -26
- package/dist/cjs/{post-closebutton_15.cjs.entry.js → post-closebutton_13.cjs.entry.js} +618 -531
- package/dist/cjs/post-collapsible_2.cjs.entry.js +41 -37
- package/dist/cjs/post-components.cjs.js +3 -3
- package/dist/cjs/post-env-test.cjs.entry.js +15 -0
- package/dist/cjs/post-footer.cjs.entry.js +24 -20
- package/dist/cjs/post-linkarea.cjs.entry.js +5 -5
- package/dist/cjs/post-pagination.cjs.entry.js +615 -0
- package/dist/cjs/post-popover-trigger.cjs.entry.js +54 -34
- package/dist/cjs/post-popover.cjs.entry.js +26 -17
- package/dist/cjs/post-rating.cjs.entry.js +24 -18
- package/dist/cjs/post-stepper-item.cjs.entry.js +5 -5
- package/dist/cjs/post-stepper.cjs.entry.js +40 -29
- package/dist/cjs/post-tab-item.cjs.entry.js +51 -0
- package/dist/cjs/post-tab-panel.cjs.entry.js +13 -11
- package/dist/cjs/post-tabs.cjs.entry.js +195 -40
- package/dist/cjs/post-tooltip-trigger.cjs.entry.js +13 -11
- package/dist/cjs/post-tooltip.cjs.entry.js +14 -12
- package/dist/cjs/utils-s05L2ulk.js +26 -0
- package/dist/collection/animations/collapse.js +3 -3
- package/dist/collection/animations/fade-slide.js +33 -0
- package/dist/collection/animations/fade.js +19 -7
- package/dist/collection/animations/index.js +2 -0
- package/dist/collection/animations/slide.js +25 -21
- package/dist/collection/animations/types.js +14 -0
- package/dist/collection/animations/utils.js +8 -0
- package/dist/collection/collection-manifest.json +8 -8
- package/dist/collection/components/post-accordion/post-accordion.css +1 -1
- package/dist/collection/components/post-accordion/post-accordion.js +5 -4
- package/dist/collection/components/post-accordion-item/post-accordion-item.css +1 -1
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +9 -8
- package/dist/collection/components/post-avatar/post-avatar.js +11 -11
- package/dist/collection/components/post-back-to-top/post-back-to-top.js +15 -15
- package/dist/collection/components/post-banner/post-banner.css +4 -1
- package/dist/collection/components/post-banner/post-banner.js +6 -5
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +3 -3
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.js +29 -29
- package/dist/collection/components/post-card-control/post-card-control.js +18 -18
- package/dist/collection/components/post-closebutton/post-closebutton.css +1 -1
- package/dist/collection/components/post-closebutton/post-closebutton.js +4 -3
- package/dist/collection/components/post-collapsible/post-collapsible.js +28 -28
- package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +3 -3
- package/dist/collection/components/post-footer/post-footer.css +1 -1
- package/dist/collection/components/post-footer/post-footer.js +18 -16
- package/dist/collection/components/post-header/post-header.css +1 -1
- package/dist/collection/components/post-header/post-header.js +144 -82
- package/dist/collection/components/post-icon/post-icon.js +18 -16
- package/dist/collection/components/post-language-menu/post-language-menu.css +1 -0
- package/dist/collection/components/{post-language-switch/post-language-switch.js → post-language-menu/post-language-menu.js} +45 -36
- package/dist/collection/components/post-language-menu-item/post-language-menu-item.css +1 -0
- package/dist/collection/components/{post-language-option/post-language-option.js → post-language-menu-item/post-language-menu-item.js} +24 -23
- package/dist/collection/components/post-linkarea/post-linkarea.js +1 -1
- package/dist/collection/components/post-logo/post-logo.css +3 -1
- package/dist/collection/components/post-logo/post-logo.js +3 -3
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +1 -1
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +41 -29
- package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.js +183 -74
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.css +3 -1
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +81 -75
- package/dist/collection/components/post-menu/post-menu.css +1 -1
- package/dist/collection/components/post-menu/post-menu.js +39 -38
- package/dist/collection/components/post-menu-item/post-menu-item.js +1 -1
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +3 -3
- package/dist/collection/components/post-pagination/post-pagination.css +1 -0
- package/dist/collection/components/post-pagination/post-pagination.js +838 -0
- package/dist/collection/components/post-popover/post-popover.js +22 -16
- package/dist/collection/components/post-popover-trigger/post-popover-trigger.js +45 -29
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -1
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +82 -131
- package/dist/collection/components/post-rating/post-rating.js +7 -7
- package/dist/collection/components/post-stepper/post-stepper.js +38 -35
- package/dist/collection/components/post-stepper-item/post-stepper-item.css +2 -2
- package/dist/collection/components/post-stepper-item/post-stepper-item.js +1 -1
- package/dist/collection/components/post-tab-item/post-tab-item.css +1 -0
- package/dist/collection/components/post-tab-item/post-tab-item.js +86 -0
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +10 -10
- package/dist/collection/components/post-tabs/post-tabs.js +232 -59
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +2 -2
- package/dist/collection/components/post-tooltip/post-tooltip.js +9 -27
- package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +4 -4
- package/dist/collection/utils/environment.js +47 -2
- package/dist/collection/utils/event-from.js +2 -2
- package/dist/collection/utils/get-focusable-children.js +29 -21
- package/dist/collection/utils/is-motion-reduced.js +1 -1
- package/dist/collection/utils/tests/environment/hydrate-app-helper.js +16 -0
- package/dist/collection/utils/tests/environment/post-env-test.js +9 -0
- package/dist/component-names.json +4 -5
- package/dist/components/breakpoints.js +1 -178
- package/dist/components/debounce.js +1 -0
- package/dist/components/environment.js +1 -0
- package/dist/components/event-from.js +1 -119
- package/dist/components/fade-slide.js +1 -0
- package/dist/components/fade.js +1 -11
- package/dist/components/focusable.js +1 -5018
- package/dist/components/get-focusable-children.js +1 -64
- package/dist/components/get-root.js +1 -15
- package/dist/components/heading-levels.js +1 -3
- package/dist/components/index.browser.js +1 -14
- package/dist/components/index.d.ts +11 -10
- package/dist/components/index.js +1 -39
- package/dist/components/long-press-event.js +1 -257
- package/dist/components/package.js +1 -3
- package/dist/components/post-accordion-item.js +1 -6
- package/dist/components/post-accordion-item2.js +1 -113
- package/dist/components/post-accordion.js +1 -6
- package/dist/components/post-accordion2.js +1 -138
- package/dist/components/post-avatar.js +1 -217
- package/dist/components/post-back-to-top.js +1 -144
- package/dist/components/post-banner.js +1 -98
- package/dist/components/post-breadcrumb-item.js +1 -6
- package/dist/components/post-breadcrumb-item2.js +1 -79
- package/dist/components/post-breadcrumbs.js +1 -196
- package/dist/components/post-card-control.js +1 -326
- package/dist/components/post-closebutton.js +1 -6
- package/dist/components/post-closebutton2.js +1 -77
- package/dist/components/post-collapsible-trigger.js +1 -6
- package/dist/components/post-collapsible-trigger2.js +1 -136
- package/dist/components/post-collapsible.js +1 -6
- package/dist/components/post-collapsible2.js +1 -110
- package/dist/components/{post-list.d.ts → post-env-test.d.ts} +4 -4
- package/dist/components/post-env-test.js +1 -0
- package/dist/components/post-footer.js +1 -116
- package/dist/components/post-header.js +1 -372
- package/dist/components/post-icon.js +1 -6
- package/dist/components/post-icon2.js +1 -159
- package/dist/components/post-language-menu-item.d.ts +11 -0
- package/dist/components/post-language-menu-item.js +1 -0
- package/dist/components/{post-language-switch.d.ts → post-language-menu.d.ts} +4 -4
- package/dist/components/post-language-menu.js +1 -0
- package/dist/components/post-linkarea.js +1 -58
- package/dist/components/post-logo.js +1 -58
- package/dist/components/post-mainnavigation.js +1 -180
- package/dist/components/post-megadropdown-trigger.js +1 -136
- package/dist/components/post-megadropdown.js +1 -267
- package/dist/components/post-menu-item.js +1 -6
- package/dist/components/post-menu-item2.js +1 -30
- package/dist/components/post-menu-trigger.js +1 -6
- package/dist/components/post-menu-trigger2.js +1 -110
- package/dist/components/post-menu.js +1 -6
- package/dist/components/post-menu2.js +1 -242
- package/dist/components/{post-tab-header.d.ts → post-pagination.d.ts} +4 -4
- package/dist/components/post-pagination.js +1 -0
- package/dist/components/post-popover-trigger.js +1 -132
- package/dist/components/post-popover.js +1 -118
- package/dist/components/post-popovercontainer.js +1 -6
- package/dist/components/post-popovercontainer2.js +1 -3127
- package/dist/components/post-rating.js +1 -148
- package/dist/components/post-stepper-item.js +1 -33
- package/dist/components/post-stepper.js +1 -134
- package/dist/components/{post-list-item.d.ts → post-tab-item.d.ts} +4 -4
- package/dist/components/post-tab-item.js +1 -0
- package/dist/components/post-tab-panel.js +1 -54
- package/dist/components/post-tabs.js +1 -196
- package/dist/components/post-togglebutton.js +1 -56
- package/dist/components/post-togglebutton2.js +1 -0
- package/dist/components/post-tooltip-trigger.js +1 -206
- package/dist/components/post-tooltip.js +1 -114
- package/dist/components/react/index.d.ts +2 -0
- package/dist/components/react/index.js +1 -2315
- package/dist/components/react/p-B8YiQ3mz.js +1 -0
- package/dist/components/react/p-BC5nlBvn.js +1 -0
- package/dist/components/react/p-BLchVpF6.js +1 -14
- package/dist/components/react/p-BVCjnh6Q.js +1 -0
- package/dist/{post-components/p-CBFgkSgY.js → components/react/p-BVGcVycs.js} +1 -1
- package/dist/components/react/p-B_XPj2c8.js +1 -0
- package/dist/components/react/p-BllOMLDs.js +1 -0
- package/dist/components/react/p-BmRNjQUZ.js +1 -0
- package/dist/components/react/p-ByFh05IW.js +1 -0
- package/dist/components/react/p-C9hMpmsD.js +1 -0
- package/dist/components/react/p-CJ13r5fi.js +1 -0
- package/dist/components/react/p-CZvbetqX.js +1 -0
- package/dist/components/react/p-C_2k3G1c.js +1 -257
- package/dist/components/react/p-CoDiS_Ik.js +1 -0
- package/dist/components/react/p-Cou17ld8.js +1 -0
- package/dist/components/react/p-D5knoiyy.js +1 -0
- package/dist/components/react/p-D9DDtvFM.js +1 -0
- package/dist/components/react/p-DY2U5CQt.js +1 -0
- package/dist/components/react/p-DjIHLduJ.js +1 -3
- package/dist/components/react/p-DpATRD2W.js +1 -0
- package/dist/components/react/p-FxUVQ4Tx.js +1 -0
- package/dist/components/react/p-HygIVKXC.js +1 -5018
- package/dist/components/react/p-YR7U0Z_g.js +1 -0
- package/dist/components/react/p-ZeKXASQs.js +1 -0
- package/dist/components/react/p-r4txK0AC.js +1 -3
- package/dist/components/react/p-sSn0kXFi.js +1 -0
- package/dist/components/react/post-accordion-item.js +1 -6
- package/dist/components/react/post-accordion.js +1 -6
- package/dist/components/react/post-avatar.js +1 -218
- package/dist/components/react/post-back-to-top.js +1 -145
- package/dist/components/react/post-banner.js +1 -99
- package/dist/components/react/post-breadcrumb-item.js +1 -6
- package/dist/components/react/post-breadcrumbs.js +1 -197
- package/dist/components/react/post-card-control.js +1 -327
- package/dist/components/react/post-closebutton.js +1 -6
- package/dist/components/react/post-collapsible-trigger.js +1 -6
- package/dist/components/react/post-collapsible.js +1 -6
- package/dist/components/react/{post-list.d.ts → post-env-test.d.ts} +4 -4
- package/dist/components/react/post-env-test.js +1 -0
- package/dist/components/react/post-footer.js +1 -117
- package/dist/components/react/post-header.js +1 -373
- package/dist/components/react/post-icon.js +1 -6
- package/dist/components/react/post-language-menu-item.d.ts +11 -0
- package/dist/components/react/post-language-menu-item.js +1 -0
- package/dist/components/react/{post-language-option.d.ts → post-language-menu.d.ts} +4 -4
- package/dist/components/react/post-language-menu.js +1 -0
- package/dist/components/react/post-linkarea.js +1 -59
- package/dist/components/react/post-logo.js +1 -59
- package/dist/components/react/post-mainnavigation.js +1 -181
- package/dist/components/react/post-megadropdown-trigger.js +1 -137
- package/dist/components/react/post-megadropdown.js +1 -268
- package/dist/components/react/post-menu-item.js +1 -6
- package/dist/components/react/post-menu-trigger.js +1 -6
- package/dist/components/react/post-menu.js +1 -6
- package/dist/components/react/{post-tab-header.d.ts → post-pagination.d.ts} +4 -4
- package/dist/components/react/post-pagination.js +1 -0
- package/dist/components/react/post-popover-trigger.js +1 -133
- package/dist/components/react/post-popover.js +1 -119
- package/dist/components/react/post-popovercontainer.js +1 -6
- package/dist/components/react/post-rating.js +1 -149
- package/dist/components/react/post-stepper-item.js +1 -34
- package/dist/components/react/post-stepper.js +1 -135
- package/dist/components/react/{post-list-item.d.ts → post-tab-item.d.ts} +4 -4
- package/dist/components/react/post-tab-item.js +1 -0
- package/dist/components/react/post-tab-panel.js +1 -55
- package/dist/components/react/post-tabs.js +1 -197
- package/dist/components/react/post-togglebutton.js +1 -57
- package/dist/components/react/post-tooltip-trigger.js +1 -207
- package/dist/components/react/post-tooltip.js +1 -115
- package/dist/components/switch-variants.js +1 -3
- package/dist/components/utils.js +1 -0
- package/dist/docs.d.ts +11 -0
- package/dist/docs.json +873 -631
- package/dist/{cjs/breakpoints-CEkeixld.js → esm/breakpoints-DYoSKGHO.js} +89 -6
- package/dist/esm/debounce-C9hMpmsD.js +11 -0
- package/dist/esm/environment-CEmnRoA6.js +49 -0
- package/dist/{components/react/p-CzIKqBrS.js → esm/event-from-rEfV4v4a.js} +2 -2
- package/dist/esm/fade-DsgPYmAa.js +24 -0
- package/dist/esm/fade-slide-CvOvauo9.js +36 -0
- package/dist/esm/{get-focusable-children-D9ZHp2FP.js → get-focusable-children-BXNs2_sw.js} +29 -21
- package/dist/{components/react/p-CBFgkSgY.js → esm/get-root-CXfAA093.js} +1 -1
- package/dist/esm/{index-wEFJ-c34.js → index-CDZBzSdV.js} +2150 -292
- package/dist/esm/loader.js +3 -3
- package/dist/esm/package-CZvbetqX.js +3 -0
- package/dist/esm/post-accordion_2.entry.js +17 -13
- package/dist/esm/post-avatar.entry.js +22 -12
- package/dist/esm/post-back-to-top.entry.js +23 -43
- package/dist/esm/post-banner.entry.js +14 -11
- package/dist/esm/post-breadcrumb-item_2.entry.js +13 -11
- package/dist/esm/post-breadcrumbs.entry.js +31 -32
- package/dist/esm/post-card-control.entry.js +32 -16
- package/dist/esm/{post-closebutton_15.entry.js → post-closebutton_13.entry.js} +599 -510
- package/dist/esm/post-collapsible_2.entry.js +38 -34
- package/dist/esm/post-components.js +4 -4
- package/dist/esm/post-env-test.entry.js +13 -0
- package/dist/esm/post-footer.entry.js +21 -17
- package/dist/esm/post-linkarea.entry.js +5 -5
- package/dist/esm/post-pagination.entry.js +613 -0
- package/dist/esm/post-popover-trigger.entry.js +52 -32
- package/dist/esm/post-popover.entry.js +25 -16
- package/dist/esm/post-rating.entry.js +16 -10
- package/dist/esm/post-stepper-item.entry.js +5 -5
- package/dist/esm/post-stepper.entry.js +39 -28
- package/dist/esm/post-tab-item.entry.js +49 -0
- package/dist/esm/post-tab-panel.entry.js +13 -11
- package/dist/esm/post-tabs.entry.js +195 -40
- package/dist/esm/post-tooltip-trigger.entry.js +10 -8
- package/dist/esm/post-tooltip.entry.js +13 -11
- package/dist/esm/utils-CoDiS_Ik.js +24 -0
- package/dist/post-components/p-09ba7cf9.entry.js +1 -0
- package/dist/post-components/p-0c091898.entry.js +1 -0
- package/dist/post-components/{p-cd03e6f2.entry.js → p-0e97fcfd.entry.js} +1 -1
- package/dist/post-components/p-296f1dd5.entry.js +1 -0
- package/dist/post-components/p-32ad2b21.entry.js +1 -0
- package/dist/post-components/p-366c28cb.entry.js +1 -0
- package/dist/post-components/p-41ae68d5.entry.js +1 -0
- package/dist/post-components/p-448e7265.entry.js +1 -0
- package/dist/post-components/p-554da188.entry.js +1 -0
- package/dist/post-components/p-5912f8f1.entry.js +1 -0
- package/dist/post-components/p-790f300d.entry.js +1 -0
- package/dist/post-components/p-7ed5a493.entry.js +1 -0
- package/dist/post-components/p-85bea1b6.entry.js +1 -0
- package/dist/post-components/p-8bcff4d2.entry.js +1 -0
- package/dist/post-components/p-9dc9c245.entry.js +1 -0
- package/dist/post-components/p-B7ebLhHc.js +1 -0
- package/dist/post-components/p-BVCjnh6Q.js +1 -0
- package/dist/post-components/p-BXNs2_sw.js +1 -0
- package/dist/post-components/p-C9hMpmsD.js +1 -0
- package/dist/post-components/p-CDZBzSdV.js +2 -0
- package/dist/post-components/p-CEmnRoA6.js +1 -0
- package/dist/post-components/p-CZvbetqX.js +1 -0
- package/dist/post-components/p-CoDiS_Ik.js +1 -0
- package/dist/post-components/p-D5knoiyy.js +1 -0
- package/dist/post-components/p-DI-h_mEL.js +1 -0
- package/dist/post-components/p-a06f9695.entry.js +1 -0
- package/dist/post-components/p-a191f1df.entry.js +1 -0
- package/dist/post-components/p-c5d19d62.entry.js +1 -0
- package/dist/post-components/{p-24dc54d1.entry.js → p-c8c4d05b.entry.js} +1 -1
- package/dist/post-components/{p-57288cb2.entry.js → p-d1a5c980.entry.js} +1 -1
- package/dist/post-components/p-d4e2c556.entry.js +1 -0
- package/dist/post-components/p-f96a310c.entry.js +1 -0
- package/dist/post-components/p-fab2327d.entry.js +1 -0
- package/dist/post-components/p-rEfV4v4a.js +1 -0
- package/dist/post-components/post-components.css +1 -1
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/prebuild.js +46 -0
- package/dist/types/animations/collapse.d.ts +1 -0
- package/dist/types/animations/fade-slide.d.ts +11 -0
- package/dist/types/animations/fade.d.ts +2 -2
- package/dist/types/animations/index.d.ts +2 -0
- package/dist/types/animations/slide.d.ts +9 -2
- package/dist/types/animations/types.d.ts +13 -0
- package/dist/types/animations/utils.d.ts +2 -0
- package/dist/types/components/post-accordion-item/heading-levels.d.ts +1 -1
- package/dist/types/components/post-accordion-item/post-accordion-item.d.ts +2 -2
- package/dist/types/components/post-back-to-top/post-back-to-top.d.ts +2 -2
- package/dist/types/components/post-breadcrumbs/post-breadcrumbs.d.ts +6 -6
- package/dist/types/components/post-collapsible/post-collapsible.d.ts +4 -5
- package/dist/types/components/post-footer/post-footer.d.ts +4 -4
- package/dist/types/components/post-header/post-header.d.ts +23 -13
- package/dist/types/components/{post-language-switch/post-language-switch.d.ts → post-language-menu/post-language-menu.d.ts} +12 -11
- package/dist/types/components/{post-language-option/post-language-option.d.ts → post-language-menu-item/post-language-menu-item.d.ts} +5 -5
- package/dist/types/components/post-mainnavigation/post-mainnavigation.d.ts +6 -5
- package/dist/types/components/post-megadropdown/post-megadropdown.d.ts +20 -2
- package/dist/types/components/post-megadropdown-trigger/post-megadropdown-trigger.d.ts +17 -23
- package/dist/types/components/post-menu/post-menu.d.ts +4 -4
- package/dist/types/components/post-pagination/post-pagination.d.ts +224 -0
- package/dist/types/components/post-popover/post-popover.d.ts +4 -3
- package/dist/types/components/post-popover-trigger/post-popover-trigger.d.ts +2 -1
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +23 -21
- package/dist/types/components/post-rating/post-rating.d.ts +1 -1
- package/dist/types/components/post-stepper/post-stepper.d.ts +9 -8
- package/dist/types/components/post-tab-item/post-tab-item.d.ts +19 -0
- package/dist/types/components/post-tab-panel/post-tab-panel.d.ts +3 -3
- package/dist/types/components/post-tabs/post-tabs.d.ts +33 -12
- package/dist/types/components/post-tooltip/post-tooltip.d.ts +1 -5
- package/dist/types/components.d.ts +322 -219
- package/dist/types/home/runner/work/design-system/design-system/packages/components/.stencil/prebuild.d.ts +9 -0
- package/dist/types/stencil-public-runtime.d.ts +147 -10
- package/dist/types/types/heading-levels.d.ts +1 -1
- package/dist/types/utils/environment.d.ts +25 -1
- package/dist/types/utils/get-focusable-children.d.ts +2 -2
- package/dist/types/utils/tests/environment/hydrate-app-helper.d.ts +5 -0
- package/dist/types/utils/tests/environment/post-env-test.d.ts +3 -0
- package/hydrate/index.d.ts +14 -0
- package/hydrate/index.js +7494 -2714
- package/hydrate/index.mjs +7493 -2715
- package/package.json +7 -8
- package/dist/cjs/fade-nS5zzDQS.js +0 -14
- package/dist/cjs/index-UFKR6Ok0.js +0 -98
- package/dist/cjs/post-tab-header.cjs.entry.js +0 -31
- package/dist/collection/animations/slide-and-fade.js +0 -25
- package/dist/collection/components/post-language-option/post-language-option.css +0 -1
- package/dist/collection/components/post-language-switch/post-language-switch.css +0 -1
- package/dist/collection/components/post-list/post-list.css +0 -1
- package/dist/collection/components/post-list/post-list.js +0 -97
- package/dist/collection/components/post-list-item/post-list-item.css +0 -1
- package/dist/collection/components/post-list-item/post-list-item.js +0 -26
- package/dist/collection/components/post-tab-header/post-tab-header.css +0 -1
- package/dist/collection/components/post-tab-header/post-tab-header.js +0 -65
- package/dist/components/index2.js +0 -89
- package/dist/components/post-language-option.d.ts +0 -11
- package/dist/components/post-language-option.js +0 -99
- package/dist/components/post-language-switch.js +0 -157
- package/dist/components/post-list-item.js +0 -38
- package/dist/components/post-list.js +0 -61
- package/dist/components/post-tab-header.js +0 -52
- package/dist/components/react/p-BVXiQdHq.js +0 -64
- package/dist/components/react/p-BhxZzOEC.js +0 -3
- package/dist/components/react/p-CSAMO7iJ.js +0 -243
- package/dist/components/react/p-CYkf_7Y5.js +0 -89
- package/dist/components/react/p-Ccrl2AQn.js +0 -111
- package/dist/components/react/p-CewRvBtg.js +0 -139
- package/dist/components/react/p-Cwiv86_f.js +0 -111
- package/dist/components/react/p-D2waO0Zc.js +0 -31
- package/dist/components/react/p-DBPOV12C.js +0 -160
- package/dist/components/react/p-DVGEExot.js +0 -3128
- package/dist/components/react/p-Djvj8fd2.js +0 -80
- package/dist/components/react/p-LtiDhYis.js +0 -137
- package/dist/components/react/p-SbIC4aZX.js +0 -11
- package/dist/components/react/p-XrZzCOKT.js +0 -78
- package/dist/components/react/p-v3pOrMNQ.js +0 -114
- package/dist/components/react/post-language-option.js +0 -100
- package/dist/components/react/post-language-switch.d.ts +0 -11
- package/dist/components/react/post-language-switch.js +0 -158
- package/dist/components/react/post-list-item.js +0 -39
- package/dist/components/react/post-list.js +0 -62
- package/dist/components/react/post-tab-header.js +0 -53
- package/dist/esm/breakpoints-CJ80BZ06.js +0 -178
- package/dist/esm/event-from-CzIKqBrS.js +0 -119
- package/dist/esm/fade-SbIC4aZX.js +0 -11
- package/dist/esm/get-root-BkQ3CrLq.js +0 -15
- package/dist/esm/index-Beaz8wEe.js +0 -89
- package/dist/esm/package-BhxZzOEC.js +0 -3
- package/dist/esm/post-tab-header.entry.js +0 -29
- package/dist/post-components/p-01e678c9.entry.js +0 -1
- package/dist/post-components/p-034a453f.entry.js +0 -1
- package/dist/post-components/p-15a4cdbf.entry.js +0 -1
- package/dist/post-components/p-2a2030bf.entry.js +0 -1
- package/dist/post-components/p-2ed84cc3.entry.js +0 -1
- package/dist/post-components/p-3228968f.entry.js +0 -1
- package/dist/post-components/p-3c01ddfe.entry.js +0 -1
- package/dist/post-components/p-748b1f01.entry.js +0 -1
- package/dist/post-components/p-7745e46e.entry.js +0 -1
- package/dist/post-components/p-7f635728.entry.js +0 -1
- package/dist/post-components/p-82c178a3.entry.js +0 -1
- package/dist/post-components/p-9b5f8319.entry.js +0 -1
- package/dist/post-components/p-Beaz8wEe.js +0 -1
- package/dist/post-components/p-BhxZzOEC.js +0 -1
- package/dist/post-components/p-CJ80BZ06.js +0 -1
- package/dist/post-components/p-D9ZHp2FP.js +0 -1
- package/dist/post-components/p-SbIC4aZX.js +0 -1
- package/dist/post-components/p-a9644e54.entry.js +0 -1
- package/dist/post-components/p-af030a3a.entry.js +0 -1
- package/dist/post-components/p-b8ba8139.entry.js +0 -1
- package/dist/post-components/p-db935e8e.entry.js +0 -1
- package/dist/post-components/p-e62e1f57.entry.js +0 -1
- package/dist/post-components/p-fb4b1641.entry.js +0 -1
- package/dist/post-components/p-wEFJ-c34.js +0 -2
- package/dist/types/animations/slide-and-fade.d.ts +0 -2
- package/dist/types/components/post-list/post-list.d.ts +0 -24
- package/dist/types/components/post-list-item/post-list-item.d.ts +0 -8
- package/dist/types/components/post-tab-header/post-tab-header.d.ts +0 -14
- /package/dist/collection/components/{post-language-switch → post-language-menu}/switch-variants.js +0 -0
- /package/dist/{post-components/p-CzIKqBrS.js → components/react/p-rEfV4v4a.js} +0 -0
- /package/dist/types/components/{post-language-switch → post-language-menu}/switch-variants.d.ts +0 -0
|
@@ -1,267 +1 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { g as getFocusableChildren } from './get-focusable-children.js';
|
|
3
|
-
import { v as version } from './package.js';
|
|
4
|
-
import { b as breakpoint } from './breakpoints.js';
|
|
5
|
-
|
|
6
|
-
const postMegadropdownCss = "@keyframes slide-in{0%{transform:translateX(100%)}100%{transform:translateX(0%)}}@keyframes slide-out{from{transform:translateX(0%)}to{transform:translateX(100%)}}@keyframes slide-down{from{transform:translateY(-100%)}to{transform:translateY(0%)}}@keyframes slide-up{0%{transform:translateY(0%)}100%{transform:translateY(-100%)}}*,::before,::after{box-sizing:border-box}.megadropdown-container{box-shadow:0 8px 6px rgba(0,0,0,.16);position:absolute;background-color:#fafafa;border:none;width:100%;inset-block-start:100%;inset-inline-start:0;border-radius:0}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.megadropdown-container{border-block-end:1px solid CanvasText}}.megadropdown-container.slide-in{animation:slide-down 350ms forwards}.megadropdown-container.slide-out{animation:slide-up 350ms forwards}@media screen and (max-width: 1023.98px){.megadropdown-container{z-index:1;position:absolute;inset-block-start:var(--post-header-navigation-current-inset);inset-inline:0;height:calc(min(var(--post-header-scroll-parent-height, 100dvh),100dvh) - var(--post-header-height));border-block-start:unset;overflow-y:auto;overscroll-behavior:contain}.megadropdown-container.slide-in{animation:slide-in 350ms forwards}.megadropdown-container.slide-out{animation:slide-out 350ms forwards}}@media screen and (min-width: 1024px){.megadropdown-container{z-index:-1;max-height:calc(100vh - var(--post-header-height) - 48px);overflow-y:auto}}.megadropdown{padding:31px 40px 40px;background-color:#fafafa}@media screen and (max-width: 1023.98px){.megadropdown{display:flex;flex-direction:column;width:inherit;padding:16px 32px 24px}}@media screen and (max-width: 599.98px){.megadropdown{padding-inline:16px}}.megadropdown [slot=megadropdown-overview-link]{text-decoration:none;border-radius:0;padding-block:13px 12px;margin-block-end:16px;display:flex;align-items:center;min-height:56px;width:100%;min-width:100%;height:48px;padding-inline:8px 12px;gap:16px;font-weight:400;position:relative;height:unset}.megadropdown [slot=megadropdown-overview-link]:focus-visible{border-radius:4px}.megadropdown [slot=megadropdown-overview-link]::before{content:\"\";background-color:#050400;bottom:0;width:100%;height:1px;position:absolute;left:0}.megadropdown [slot=megadropdown-overview-link].active,.megadropdown [slot=megadropdown-overview-link][aria-current=page],.megadropdown [slot=megadropdown-overview-link][aria-expanded=true]{background-color:#050400;color:#fff}.megadropdown [slot=megadropdown-overview-link]:hover{background-color:#504f4b;color:#fff}.megadropdown [slot=megadropdown-overview-link]:hover::before{background-color:#504f4b}@media screen and (max-width: 1023.98px){.megadropdown [slot=megadropdown-overview-link]{padding-block:12px 11px;min-height:unset}}@media screen and (max-width: 599.98px){.megadropdown [slot=megadropdown-overview-link]{padding-block:10px 9px}}.megadropdown .megadropdown-content{gap:1.5rem;display:grid;grid-template-columns:repeat(auto-fit, minmax(min(15vw, 100%), 1fr));grid-auto-rows:1fr auto;grid-auto-flow:dense}@media screen and (max-width: 1023.98px){.megadropdown .megadropdown-content{grid-template-columns:repeat(auto-fit, minmax(min(35vw, 100%), 1fr))}}@media screen and (max-width: 599.98px){.megadropdown .megadropdown-content{grid-template-columns:1fr}}.megadropdown h2{display:none;margin-block:0 8px;font-weight:900}.megadropdown h2 a{text-decoration:none;display:none;font-weight:inherit;border-block:0}@media screen and (max-width: 1023.98px){.megadropdown h2{display:block;font-size:1.25rem}}@media screen and (max-width: 599.98px){.megadropdown h2{font-size:1.125rem}}.megadropdown post-list{display:grid;grid-row:span 2;grid-template-rows:subgrid;row-gap:0px}.megadropdown post-list>[role=list]{flex-direction:unset;display:unset}.megadropdown post-list>*{width:100%}.megadropdown post-list .list-title{display:flex;flex-direction:column-reverse;height:100%}.megadropdown post-list .list-title h3{font-size:20px;display:block;font-weight:900}.megadropdown post-list .list-title h3:not(:has(a)),.megadropdown post-list .list-title h3 a{padding:16px 12px 14px 8px}.megadropdown post-list .list-title h3:not(:has(a)){position:relative}.megadropdown post-list .list-title h3:not(:has(a))::before{content:\"\";background-color:#050400;inset-block-end:0;inset-inline-start:0;width:100%;height:2px;position:absolute}.megadropdown post-list .list-title h3 a{border-radius:4px;text-decoration:none;font-size:inherit;display:flex;align-items:center;justify-content:space-between;min-height:53px;width:100%;min-width:100%;height:48px;padding-inline:8px 12px;gap:16px;font-weight:400;position:relative;height:unset;font-weight:900}.megadropdown post-list .list-title h3 a::before{content:\"\";background-color:#050400;bottom:0;width:100%;height:1px;position:absolute;left:0}.megadropdown post-list .list-title h3 a.active,.megadropdown post-list .list-title h3 a[aria-current=page],.megadropdown post-list .list-title h3 a[aria-expanded=true]{background-color:#050400;color:#fff}.megadropdown post-list .list-title h3 a:hover{background-color:#504f4b;color:#fff}.megadropdown post-list .list-title h3 a:hover::before{background-color:#504f4b}.megadropdown post-list .list-title h3 a::before{height:2px}@media screen and (max-width: 1023.98px){.megadropdown post-list .list-title h3{font-size:1rem}.megadropdown post-list .list-title h3:not(:has(a)),.megadropdown post-list .list-title h3 a{padding:14px 12px 12px 8px}}@media screen and (max-width: 599.98px){.megadropdown post-list .list-title h3{font-size:.875rem}}.megadropdown post-list-item>a{padding-block:13px 12px;padding-inline-start:8px;display:flex;text-decoration:none;width:100%;min-width:100%;height:auto;min-height:48px;white-space:normal;word-break:break-word}.megadropdown post-list-item>a:hover{border-block-width:0}@media screen and (min-width: 1024px){.megadropdown post-list-item>a{font-size:1.25rem}}@media screen and (max-width: 1023.98px){.megadropdown post-list-item>a{padding-block:12px 11px}}@media screen and (max-width: 599.98px){.megadropdown post-list-item>a{font-size:.875rem}}.megadropdown .back-button{display:none;margin-block-end:2rem}.megadropdown .back-button .btn{width:auto}@media screen and (max-width: 1023.98px){.megadropdown .back-button{order:-1;display:block}}.megadropdown .close-button{position:absolute;inset-block-start:1rem;inset-inline-end:1rem}@media screen and (max-width: 1023.98px){.megadropdown .close-button{display:none}}";
|
|
7
|
-
|
|
8
|
-
const PostMegadropdown$1 = /*@__PURE__*/ proxyCustomElement(class PostMegadropdown extends HTMLElement {
|
|
9
|
-
constructor() {
|
|
10
|
-
super();
|
|
11
|
-
this.__registerHost();
|
|
12
|
-
this.postToggleMegadropdown = createEvent(this, "postToggleMegadropdown", 7);
|
|
13
|
-
this.device = breakpoint.get('device');
|
|
14
|
-
/**
|
|
15
|
-
* Holds the current visibility state of the dropdown.
|
|
16
|
-
* This state is internally managed to track whether the dropdown is open (`true`) or closed (`false`),
|
|
17
|
-
* and updates automatically when the dropdown is toggled.
|
|
18
|
-
*/
|
|
19
|
-
this.isVisible = false;
|
|
20
|
-
this.trigger = false;
|
|
21
|
-
/** Holds the current animation class. */
|
|
22
|
-
this.animationClass = null;
|
|
23
|
-
this.handleClickOutside = (event) => {
|
|
24
|
-
if (this.device !== 'desktop')
|
|
25
|
-
return;
|
|
26
|
-
const target = event.target;
|
|
27
|
-
if (this.host.contains(target)) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
if (target instanceof HTMLElement) {
|
|
31
|
-
const trigger = target.closest('post-megadropdown-trigger');
|
|
32
|
-
if (trigger) {
|
|
33
|
-
const targetDropdownId = trigger.getAttribute('for');
|
|
34
|
-
if (targetDropdownId !== this.host.id) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
this.hide(false);
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
get megadropdownTrigger() {
|
|
43
|
-
const hostId = this.host.getAttribute('id');
|
|
44
|
-
return hostId
|
|
45
|
-
? document.querySelector(`post-megadropdown-trigger[for="${hostId}"] > button`)
|
|
46
|
-
: null;
|
|
47
|
-
}
|
|
48
|
-
connectedCallback() {
|
|
49
|
-
window.addEventListener('postBreakpoint:device', this.breakpointChange.bind(this));
|
|
50
|
-
}
|
|
51
|
-
componentDidRender() {
|
|
52
|
-
this.getFocusableElements();
|
|
53
|
-
}
|
|
54
|
-
componentDidLoad() {
|
|
55
|
-
this.checkInitialAriaCurrent();
|
|
56
|
-
this.setupObserver();
|
|
57
|
-
this.handleAriaCurrentChange([]);
|
|
58
|
-
}
|
|
59
|
-
disconnectedCallback() {
|
|
60
|
-
this.removeListeners();
|
|
61
|
-
window.removeEventListener('postBreakpoint:device', this.breakpointChange.bind(this));
|
|
62
|
-
if (PostMegadropdown.activeDropdown === this) {
|
|
63
|
-
PostMegadropdown.activeDropdown = null;
|
|
64
|
-
}
|
|
65
|
-
if (this.defaultSlotObserver) {
|
|
66
|
-
this.defaultSlotObserver.disconnect();
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Toggles the dropdown visibility based on its current state.
|
|
71
|
-
*/
|
|
72
|
-
async toggle() {
|
|
73
|
-
if (this.isVisible) {
|
|
74
|
-
this.hide();
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
await this.show();
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Displays the dropdown.
|
|
82
|
-
*/
|
|
83
|
-
async show() {
|
|
84
|
-
if (PostMegadropdown.activeDropdown && PostMegadropdown.activeDropdown !== this) {
|
|
85
|
-
// Close the previously active dropdown without animation
|
|
86
|
-
PostMegadropdown.activeDropdown.forceClose();
|
|
87
|
-
}
|
|
88
|
-
this.animationClass = 'slide-in';
|
|
89
|
-
this.isVisible = true;
|
|
90
|
-
PostMegadropdown.activeDropdown = this;
|
|
91
|
-
this.postToggleMegadropdown.emit({ isVisible: this.isVisible });
|
|
92
|
-
if (this.firstFocusableEl &&
|
|
93
|
-
window.getComputedStyle(this.firstFocusableEl).display !== 'none') {
|
|
94
|
-
this.firstFocusableEl.focus();
|
|
95
|
-
}
|
|
96
|
-
this.addListeners();
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Hides the dropdown with an animation.
|
|
100
|
-
*/
|
|
101
|
-
async hide(focusParent = true, forceClose = false) {
|
|
102
|
-
this.postToggleMegadropdown.emit({ isVisible: false, focusParent: focusParent });
|
|
103
|
-
if (forceClose) {
|
|
104
|
-
this.forceClose();
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
this.animationClass = 'slide-out';
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Sets focus to the first focusable element within the component.
|
|
112
|
-
*/
|
|
113
|
-
async focusFirst() {
|
|
114
|
-
this.firstFocusableEl?.focus();
|
|
115
|
-
}
|
|
116
|
-
breakpointChange(e) {
|
|
117
|
-
this.device = e.detail;
|
|
118
|
-
if (this.device === 'desktop' && this.isVisible) {
|
|
119
|
-
this.animationClass = null;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Forces the dropdown to close without animation.
|
|
124
|
-
*/
|
|
125
|
-
forceClose() {
|
|
126
|
-
this.isVisible = false;
|
|
127
|
-
this.animationClass = null;
|
|
128
|
-
this.postToggleMegadropdown.emit({ isVisible: this.isVisible, focusParent: false });
|
|
129
|
-
this.removeListeners();
|
|
130
|
-
}
|
|
131
|
-
handleAnimationEnd() {
|
|
132
|
-
if (this.animationClass === 'slide-out') {
|
|
133
|
-
this.isVisible = false;
|
|
134
|
-
this.animationClass = null;
|
|
135
|
-
PostMegadropdown.activeDropdown = null;
|
|
136
|
-
this.removeListeners();
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
addListeners() {
|
|
140
|
-
this.host.addEventListener('keydown', e => this.keyboardHandler(e));
|
|
141
|
-
document.addEventListener('keyup', e => this.handleTabOutside(e));
|
|
142
|
-
document.addEventListener('mousedown', this.handleClickOutside);
|
|
143
|
-
}
|
|
144
|
-
removeListeners() {
|
|
145
|
-
this.host.removeEventListener('keydown', e => this.keyboardHandler(e));
|
|
146
|
-
document.removeEventListener('keyup', e => this.handleTabOutside(e));
|
|
147
|
-
document.removeEventListener('mousedown', this.handleClickOutside);
|
|
148
|
-
}
|
|
149
|
-
getFocusableElements() {
|
|
150
|
-
const focusableEls = Array.from(this.host.querySelectorAll('post-list-item, h3, .back-button'));
|
|
151
|
-
const focusableChildren = focusableEls.flatMap(el => Array.from(getFocusableChildren(el)));
|
|
152
|
-
// Check for an overview link
|
|
153
|
-
const overviewLink = this.host.querySelector('a[slot="megadropdown-overview-link"]');
|
|
154
|
-
if (overviewLink) {
|
|
155
|
-
focusableChildren.unshift(overviewLink);
|
|
156
|
-
}
|
|
157
|
-
this.firstFocusableEl = focusableChildren[0];
|
|
158
|
-
this.lastFocusableEl = focusableChildren[focusableChildren.length - 1];
|
|
159
|
-
}
|
|
160
|
-
// Loop through the focusable children
|
|
161
|
-
keyboardHandler(e) {
|
|
162
|
-
if (e.key === 'Tab' && this.device !== 'desktop') {
|
|
163
|
-
if (e.shiftKey && document.activeElement === this.firstFocusableEl) {
|
|
164
|
-
// If back tab (TAB + Shift) and first element is focused, focus goes to the last element of the megadropdown
|
|
165
|
-
e.preventDefault();
|
|
166
|
-
this.lastFocusableEl.focus();
|
|
167
|
-
}
|
|
168
|
-
else if (!e.shiftKey && document.activeElement === this.lastFocusableEl) {
|
|
169
|
-
// If TAB and last element is focused, focus goes back to the first element of the megadropdown
|
|
170
|
-
e.preventDefault();
|
|
171
|
-
this.firstFocusableEl.focus();
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
handleTabOutside(e) {
|
|
176
|
-
if (e.key === 'Tab' && this.device === 'desktop') {
|
|
177
|
-
if (this.isVisible && !this.host.contains(e.target)) {
|
|
178
|
-
this.hide(false);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Sets up a MutationObserver on the host to watch for changes
|
|
184
|
-
* in `aria-current` attributes.
|
|
185
|
-
*/
|
|
186
|
-
setupObserver() {
|
|
187
|
-
const config = {
|
|
188
|
-
subtree: true,
|
|
189
|
-
attributes: true,
|
|
190
|
-
attributeFilter: ['aria-current'],
|
|
191
|
-
};
|
|
192
|
-
this.defaultSlotObserver = new MutationObserver(this.handleAriaCurrentChange.bind(this));
|
|
193
|
-
this.defaultSlotObserver.observe(this.host, config);
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Adds or removes the 'active' class on the megadropdown trigger button
|
|
197
|
-
* based on the active state.
|
|
198
|
-
*
|
|
199
|
-
* @param isActive - Whether the trigger should appear active
|
|
200
|
-
*/
|
|
201
|
-
setTriggerActive(isActive) {
|
|
202
|
-
const trigger = this.megadropdownTrigger;
|
|
203
|
-
if (!trigger)
|
|
204
|
-
return;
|
|
205
|
-
if (isActive) {
|
|
206
|
-
trigger.classList.add('active');
|
|
207
|
-
}
|
|
208
|
-
else {
|
|
209
|
-
trigger.classList.remove('active');
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
/**
|
|
213
|
-
* Updates the megadropdown trigger state when the megadropdown content changes.
|
|
214
|
-
* Checks if any element inside the megadropdown has `aria-current="page"`
|
|
215
|
-
* and sets the trigger as active accordingly.
|
|
216
|
-
*/
|
|
217
|
-
handleAriaCurrentChange(mutations) {
|
|
218
|
-
if (!mutations.length)
|
|
219
|
-
return;
|
|
220
|
-
const hasCurrentPage = mutations.some(m => m.target instanceof HTMLElement && m.target.getAttribute('aria-current') === 'page');
|
|
221
|
-
this.setTriggerActive(hasCurrentPage);
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* Checks on initialization if any element inside the megadropdown
|
|
225
|
-
* has `aria-current="page"` and sets the trigger as active if so.
|
|
226
|
-
*/
|
|
227
|
-
checkInitialAriaCurrent() {
|
|
228
|
-
const hasCurrentPage = this.host.querySelector('[aria-current="page"]');
|
|
229
|
-
if (hasCurrentPage)
|
|
230
|
-
this.setTriggerActive(true);
|
|
231
|
-
}
|
|
232
|
-
render() {
|
|
233
|
-
const containerStyle = this.isVisible ? {} : { display: 'none' };
|
|
234
|
-
return (h(Host, { key: 'd189f35bb1b66459d6f50bd3326495fe79429be2', version: version }, h("div", { key: 'a9d7d8e25af433b18548a40be4e724c1a3a57374', class: `megadropdown-container ${this.animationClass || ''}`, style: containerStyle, onAnimationEnd: () => this.handleAnimationEnd() }, h("div", { key: 'a9886e9c1797eb11c6988e2b17bb73097ca9fb24', class: "megadropdown" }, h("slot", { key: 'e93c659a3ba85dbecebfaa2b2ed435d05cfc4ecc', name: "megadropdown-title" }), h("slot", { key: 'c6d4952fd218d2c31399b31ebea905a19892461d', name: "megadropdown-overview-link" }), h("div", { key: '82a157f8c6225ccec231d660d55b49abf456ba60', class: "megadropdown-content" }, h("slot", { key: '0c2ad616e2e999bb30cc9e9593fcfa4e4b8d71f0' })), h("div", { key: 'b501280cb3c05bb0210e5fe2380d5c338416df90', onClick: () => this.hide(true), class: "back-button" }, h("slot", { key: '2b60695fac34563724f09b1e6c51b4b386606f17', name: "back-button" })), h("div", { key: '1554073e2476baf7416937f54203e2e404805360', onClick: () => this.hide(true), class: "close-button" }, h("slot", { key: '29e8f43ddadfa66c405c6ad0ffbf43237fae97ec', name: "close-button" }))))));
|
|
235
|
-
}
|
|
236
|
-
get host() { return this; }
|
|
237
|
-
static get style() { return postMegadropdownCss; }
|
|
238
|
-
}, [4, "post-megadropdown", {
|
|
239
|
-
"device": [32],
|
|
240
|
-
"isVisible": [32],
|
|
241
|
-
"trigger": [32],
|
|
242
|
-
"animationClass": [32],
|
|
243
|
-
"toggle": [64],
|
|
244
|
-
"show": [64],
|
|
245
|
-
"hide": [64],
|
|
246
|
-
"focusFirst": [64]
|
|
247
|
-
}]);
|
|
248
|
-
/** Tracks the currently active dropdown instance. */
|
|
249
|
-
PostMegadropdown$1.activeDropdown = null;
|
|
250
|
-
function defineCustomElement$1() {
|
|
251
|
-
if (typeof customElements === "undefined") {
|
|
252
|
-
return;
|
|
253
|
-
}
|
|
254
|
-
const components = ["post-megadropdown"];
|
|
255
|
-
components.forEach(tagName => { switch (tagName) {
|
|
256
|
-
case "post-megadropdown":
|
|
257
|
-
if (!customElements.get(tagName)) {
|
|
258
|
-
customElements.define(tagName, PostMegadropdown$1);
|
|
259
|
-
}
|
|
260
|
-
break;
|
|
261
|
-
} });
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
const PostMegadropdown = PostMegadropdown$1;
|
|
265
|
-
const defineCustomElement = defineCustomElement$1;
|
|
266
|
-
|
|
267
|
-
export { PostMegadropdown, defineCustomElement };
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as e,createEvent as i,h as s,Host as o,transformTag as n}from"@stencil/core/internal/client";import{g as a}from"./get-focusable-children.js";import{v as r}from"./package.js";import{c,g as d}from"./breakpoints.js";import{r as h}from"./utils.js";import{f as l}from"./fade-slide.js";import{d as b}from"./post-closebutton2.js";import{d as u}from"./post-icon2.js";const p={translate:100,duration:500,easing:"ease",fill:"none"};const m=t(class t extends e{validateTextClose(){c(this,"textClose","string")}validateTextBack(){c(this,"textBack","string")}get megadropdownTrigger(){const t=this.host.getAttribute("id");return t?document.querySelector(`post-megadropdown-trigger[for="${t}"]`):null}constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.postToggleMegadropdown=i(this,"postToggleMegadropdown",7),this.currentAnimation=null,this.isAnimating=!1,this.fsAnimationOptions={translate:-10,duration:350,easing:"headerEase"},this.device=d.get("device"),this.isVisible=!1,this.trigger=!1,this.animationClass=null,this.handleClickOutside=async t=>{if("desktop"!==this.device)return;const i=t.target;if(!this.host.contains(i)&&!this.megadropdownTrigger.contains(i)){if(i instanceof e){const t=i.closest("post-megadropdown-trigger");if(t&&t.getAttribute("for")!==this.host.id)return}await this.hide(!1)}},this.keyboardHandler=this.keyboardHandler.bind(this),this.handleTabOutside=this.handleTabOutside.bind(this),this.handleClickOutside=this.handleClickOutside.bind(this)}connectedCallback(){window.addEventListener("postBreakpoint:device",this.breakpointChange.bind(this))}componentDidRender(){this.getFocusableElements()}componentDidLoad(){this.validateTextClose(),this.validateTextBack(),this.checkInitialAriaCurrent(),this.setupObserver(),this.handleAriaCurrentChange([])}disconnectedCallback(){window.removeEventListener("postBreakpoint:device",this.breakpointChange.bind(this)),t.activeDropdown===this&&(t.activeDropdown=null),this.removeListeners(),this.defaultSlotObserver&&this.defaultSlotObserver.disconnect()}async toggle(){return this.isAnimating?this.isVisible?this.show():this.hide():this.isVisible?this.hide():this.show()}async show(){if("desktop"!==this.device){const t=this.megadropdownTrigger;t&&(this.megadropdownTitle=t.innerHTML)}t.activeDropdown&&t.activeDropdown!==this&&t.activeDropdown.forceClose(),this.cancelAnimation(),this.isVisible=!0,t.activeDropdown=this,this.postToggleMegadropdown.emit({isVisible:!0});try{await this.animate("in"),this.focusFirst(),this.addListeners()}catch{this.removeListeners(),this.isVisible=!1,t.activeDropdown===this&&(t.activeDropdown=null),this.postToggleMegadropdown.emit({isVisible:!1,focusParent:!0})}}async hide(e=!0,i=!1){if(i)this.forceClose();else{this.postToggleMegadropdown.emit({isVisible:!1,focusParent:e});try{await this.animate("out"),this.isVisible=!1,this.removeListeners(),t.activeDropdown===this&&(t.activeDropdown=null)}catch{t.activeDropdown=this,this.addListeners(),this.isVisible=!0,this.postToggleMegadropdown.emit({isVisible:!0,focusParent:!1})}}}async focusFirst(){this.firstFocusableEl?.focus()}forceClose(){this.removeListeners(),this.postToggleMegadropdown.emit({isVisible:!1,focusParent:!1}),this.isVisible=!1}createAnimation(t){return"desktop"===this.device?l(this.animatedContainer,t,this.fsAnimationOptions):function(t,e,i={}){const s={...p,...i},{translate:o}=s,n=[{transform:`translateX(${o}%)`},{transform:"translateX(0)"}];return function(t,e,i){const{duration:s,easing:o,fill:n}={...p,...i};return t.animate(e,{duration:s,easing:h(o),fill:n})}(t,"in"===e?n:[...n].reverse(),i)}(this.animatedContainer,t,{translate:100,duration:350,easing:"in"===t?"ease-in":"ease-out"})}async animate(t){this.cancelAnimation(),this.currentAnimation=this.createAnimation(t),this.isAnimating=!0,await this.currentAnimation.finished,this.isAnimating=!1,this.currentAnimation=null}cancelAnimation(){this.currentAnimation?.cancel(),this.currentAnimation=null}breakpointChange(t){this.device=t.detail,this.cancelAnimation()}addListeners(){this.host.addEventListener("keydown",this.keyboardHandler),document.addEventListener("keyup",this.handleTabOutside),document.addEventListener("mousedown",this.handleClickOutside)}removeListeners(){this.host.removeEventListener("keydown",this.keyboardHandler),document.removeEventListener("keyup",this.handleTabOutside),document.removeEventListener("mousedown",this.handleClickOutside)}getFocusableElements(){const t=[...a(this.host),...a(this.host.shadowRoot)];this.firstFocusableEl=t[0],this.lastFocusableEl=t[t.length-1]}keyboardHandler(t){if("Tab"!==t.key||"desktop"===this.device)return;const e=this.host.shadowRoot.activeElement||document.activeElement;t.shiftKey&&e===this.firstFocusableEl?(t.preventDefault(),this.lastFocusableEl.focus()):t.shiftKey||e!==this.lastFocusableEl||(t.preventDefault(),this.firstFocusableEl.focus())}handleTabOutside(t){"Tab"===t.key&&"desktop"===this.device&&this.isVisible&&!this.host.contains(t.target)&&this.hide(!1)}setupObserver(){this.defaultSlotObserver=new MutationObserver(this.handleAriaCurrentChange.bind(this)),this.defaultSlotObserver.observe(this.host,{subtree:!0,attributes:!0,attributeFilter:["aria-current"]})}setTriggerActive(t){const e=this.megadropdownTrigger;e&&e.setAttribute("active",""+t)}handleAriaCurrentChange(t){if(!t.length)return;const i=t.some((t=>t.target instanceof e&&"page"===t.target.getAttribute("aria-current")));this.setTriggerActive(i)}checkInitialAriaCurrent(){this.host.querySelector('[aria-current="page"]')&&this.setTriggerActive(!0)}render(){return s(o,{key:"02194ee3593dd471e2fc3aadb1d69041d613ce0a",version:r},s("div",{key:"77ab3faeb3705ac0d97ab0d72cc3fbf12c19badc",ref:t=>this.animatedContainer=t,class:"megadropdown",style:this.isVisible?{}:{display:"none"}},s("div",{key:"5d8b3ef651c3eb19f08e3ccd6c9356e01463a2e0",class:"section"},"desktop"!==this.device&&this.megadropdownTitle&&s("p",{key:"e99a5751ea896f3ab55dc9bf58635f7b2fef2a1c",class:"megadropdown-title"},this.megadropdownTitle),s("div",{key:"a0a1bfa04de139d48c825df8fdb24f93e031ea66",class:"megadropdown-content"},s("slot",{key:"68e44ce30fec1efed2855490b5d9af56ba41e004"})),"desktop"===this.device?s("post-closebutton",{onClick:()=>this.hide(!0),class:"close-button"},this.textClose):s("button",{onClick:()=>this.hide(!0),class:"back-button"},s("post-icon",{name:"arrowleft"}),this.textBack))))}get host(){return this}static get watchers(){return{textClose:[{validateTextClose:0}],textBack:[{validateTextBack:0}]}}static get style(){return"*,::before,::after{box-sizing:border-box}.megadropdown{position:absolute;inset-inline:0;overflow-y:auto;background-color:#fafafa;box-shadow:var(--post-device-elevation-300)}@media screen and (min-width: 1024px){.megadropdown{z-index:-1;inset-block-start:100%}.megadropdown.slide-in{animation:slide-down 350ms forwards}.megadropdown.slide-out{animation:slide-up 350ms forwards}}@media screen and (max-width: 1023.98px){.megadropdown{z-index:1;inset-block-start:var(--post-header-navigation-current-inset);overscroll-behavior:contain}}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.megadropdown{border-block-end:1px solid CanvasText}}.section{width:100%;max-width:var(--post-header-content-max-width);margin-inline:auto;position:relative}@media screen and (min-width: 1024px){.section{max-height:calc(100vh - var(--post-header-height) - 3rem);padding:2rem 2.5rem 2.5rem}}@media screen and (max-width: 1023.98px){.section{display:flex;flex-direction:column;height:calc(min(var(--post-header-scroll-parent-height, 100dvh),100dvh) - var(--post-header-height));padding-inline:var(--post-burger-menu-padding-inline);padding-block:1.5rem}}.megadropdown-title{margin-block:0 1rem;font-weight:950}@media screen and (min-width: 600px)and (max-width: 1023.98px){.megadropdown-title{font-size:1.25rem}}@media screen and (min-width: 0)and (max-width: 599.98px){.megadropdown-title{font-size:1.125rem}}.back-button{display:inline-flex;position:relative;align-items:center;justify-content:center;max-width:100%;overflow:hidden;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;border-width:var(--post-device-border-width-default);border-style:solid;border-radius:var(--post-device-border-radius-round);background-color:rgba(0,0,0,0);box-shadow:none;font-family:inherit;font-weight:var(--post-device-font-weight-bold);text-decoration:none;white-space:nowrap;cursor:pointer;min-height:var(--post-device-sizing-interactive-button-height-4);gap:var(--post-device-spacing-gap-inline-11);padding:0 var(--post-device-spacing-padding-inline-7);border-color:var(--post-scheme-color-interactive-button-tertiary-enabled-stroke);background-color:var(--post-scheme-color-interactive-button-tertiary-enabled-bg);color:var(--post-scheme-color-interactive-button-tertiary-enabled-fg);order:-1;width:fit-content;padding-inline:0}.back-button:hover{text-decoration:none}.back-button:disabled{border-style:var(--post-core-border-style-dash)}.back-button{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}.back-button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.back-button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.back-button:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.back-button:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.back-button:is(a){color:LinkText;border:unset}.back-button:is(button){background-color:ButtonFace !important;border:1px solid ButtonBorder !important}.back-button:not(:disabled,.disabled):is(button):hover{background-color:Highlight !important}.back-button:not(:disabled,.disabled):is(button):hover>post-icon{color:HighlightText !important}}.back-button>post-icon{width:var(--post-device-sizing-interactive-button-icon-5);height:var(--post-device-sizing-interactive-button-icon-5)}.back-button:hover{border-color:var(--post-scheme-color-interactive-button-tertiary-hover-stroke);background-color:var(--post-scheme-color-interactive-button-tertiary-hover-bg);color:var(--post-scheme-color-interactive-button-tertiary-hover-fg)}@media screen and (min-width: 600px)and (max-width: 1023.98px){.back-button{margin-block-end:2rem}}@media screen and (min-width: 0)and (max-width: 599.98px){.back-button{margin-block-end:1.5rem}}.close-button{position:absolute;inset-block-start:1rem;inset-inline-end:1rem}@media screen and (max-width: 1023.98px){.close-button{display:none}}"}},[257,"post-megadropdown",{textClose:[513,"text-close"],textBack:[513,"text-back"],device:[32],isVisible:[32],trigger:[32],megadropdownTitle:[32],animationClass:[32],toggle:[64],show:[64],hide:[64],focusFirst:[64]},void 0,{textClose:[{validateTextClose:0}],textBack:[{validateTextBack:0}]}]);m.activeDropdown=null;const g=m,f=function(){"undefined"!=typeof customElements&&["post-megadropdown","post-closebutton","post-icon"].forEach((t=>{switch(t){case"post-megadropdown":customElements.get(n(t))||customElements.define(n(t),m);break;case"post-closebutton":customElements.get(n(t))||b();break;case"post-icon":customElements.get(n(t))||u()}}))};export{g as PostMegadropdown,f as defineCustomElement}
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
const PostMenuItem = PostMenuItem$1;
|
|
4
|
-
const defineCustomElement = defineCustomElement$1;
|
|
5
|
-
|
|
6
|
-
export { PostMenuItem, defineCustomElement };
|
|
1
|
+
import{P as o,d as s}from"./post-menu-item2.js";const t=o,m=s;export{t as PostMenuItem,m as defineCustomElement}
|
|
@@ -1,30 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { v as version } from './package.js';
|
|
3
|
-
|
|
4
|
-
const postMenuItemCss = "post-menu-item button{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-menu-item button{background-color:ButtonFace !important}post-menu-item button:hover{background-color:Highlight !important}}post-menu-item a{text-decoration:none}post-menu-item button,post-menu-item a{position:relative;display:flex;width:100%;align-items:center;padding:.5rem .75rem .5rem 1rem;gap:.75rem;font-size:.875rem;color:#050400;border-radius:0}post-menu-item button post-icon,post-menu-item a post-icon{width:1rem;height:1rem;margin-block:.25rem}@media screen and (min-width: 780px){post-menu-item button,post-menu-item a{font-size:1rem;padding-block:.75rem;gap:1rem}post-menu-item button post-icon,post-menu-item a post-icon{width:1.5rem;height:1.5rem;margin:0}}@media screen and (min-width: 1024px){post-menu-item button,post-menu-item a{font-size:1.25rem;padding-block:.8125rem}}post-menu-item button:focus-visible,post-menu-item a:focus-visible{outline-offset:2px !important;border-radius:4px}post-menu-item button:hover,post-menu-item a:hover{background-color:#504f4b;color:#fff}";
|
|
5
|
-
|
|
6
|
-
const PostMenuItem = /*@__PURE__*/ proxyCustomElement(class PostMenuItem extends HTMLElement {
|
|
7
|
-
constructor() {
|
|
8
|
-
super();
|
|
9
|
-
this.__registerHost();
|
|
10
|
-
}
|
|
11
|
-
render() {
|
|
12
|
-
return (h(Host, { key: '9d6015291b82728739de4263a62a59ad4a99c94d', "data-version": version }, h("slot", { key: '51f5ff356cddffc806639cc343437500f898065e' })));
|
|
13
|
-
}
|
|
14
|
-
static get style() { return postMenuItemCss; }
|
|
15
|
-
}, [4, "post-menu-item"]);
|
|
16
|
-
function defineCustomElement() {
|
|
17
|
-
if (typeof customElements === "undefined") {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
const components = ["post-menu-item"];
|
|
21
|
-
components.forEach(tagName => { switch (tagName) {
|
|
22
|
-
case "post-menu-item":
|
|
23
|
-
if (!customElements.get(tagName)) {
|
|
24
|
-
customElements.define(tagName, PostMenuItem);
|
|
25
|
-
}
|
|
26
|
-
break;
|
|
27
|
-
} });
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export { PostMenuItem as P, defineCustomElement as d };
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as t,h as o,Host as n,transformTag as i}from"@stencil/core/internal/client";import{v as m}from"./package.js";const r=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost()}render(){return o(n,{key:"d7958ea4788b9bc5fb635f1ebbeb8201ee4f8bbe","data-version":m},o("slot",{key:"1dc07d2f88142186ec9bef36ee10ed723e500292"}))}static get style(){return"post-menu-item button{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-menu-item button{background-color:ButtonFace !important}post-menu-item button:hover{background-color:Highlight !important}}post-menu-item a{text-decoration:none}post-menu-item button,post-menu-item a{position:relative;display:flex;width:100%;align-items:center;padding:.5rem .75rem .5rem 1rem;gap:.75rem;font-size:.875rem;color:#050400;border-radius:0}post-menu-item button post-icon,post-menu-item a post-icon{width:1rem;height:1rem;margin-block:.25rem}@media screen and (min-width: 780px){post-menu-item button,post-menu-item a{font-size:1rem;padding-block:.75rem;gap:1rem}post-menu-item button post-icon,post-menu-item a post-icon{width:1.5rem;height:1.5rem;margin:0}}@media screen and (min-width: 1024px){post-menu-item button,post-menu-item a{font-size:1.25rem;padding-block:.8125rem}}post-menu-item button:focus-visible,post-menu-item a:focus-visible{outline-offset:2px !important;border-radius:4px}post-menu-item button:hover,post-menu-item a:hover{background-color:#504f4b;color:#fff}"}},[260,"post-menu-item"]);function s(){"undefined"!=typeof customElements&&["post-menu-item"].forEach((e=>{"post-menu-item"===e&&(customElements.get(i(e))||customElements.define(i(e),r))}))}export{r as P,s as d}
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
const PostMenuTrigger = PostMenuTrigger$1;
|
|
4
|
-
const defineCustomElement = defineCustomElement$1;
|
|
5
|
-
|
|
6
|
-
export { PostMenuTrigger, defineCustomElement };
|
|
1
|
+
import{P as o,d as r}from"./post-menu-trigger2.js";const s=o,t=r;export{s as PostMenuTrigger,t as defineCustomElement}
|
|
@@ -1,110 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { v as version } from './package.js';
|
|
3
|
-
import { c as checkRequiredAndType } from './index2.js';
|
|
4
|
-
import './breakpoints.js';
|
|
5
|
-
import { g as getRoot } from './get-root.js';
|
|
6
|
-
|
|
7
|
-
const postMenuTriggerCss = ":host{display:inline-block}";
|
|
8
|
-
|
|
9
|
-
const PostMenuTrigger = /*@__PURE__*/ proxyCustomElement(class PostMenuTrigger extends HTMLElement {
|
|
10
|
-
constructor() {
|
|
11
|
-
super();
|
|
12
|
-
this.__registerHost();
|
|
13
|
-
/**
|
|
14
|
-
* Manages the accessibility attribute `aria-expanded` to indicate whether the associated menu is expanded or collapsed.
|
|
15
|
-
*/
|
|
16
|
-
this.ariaExpanded = false;
|
|
17
|
-
/**
|
|
18
|
-
* Reference to the slotted button within the trigger, if present.
|
|
19
|
-
* Used to manage click and key events for menu control.
|
|
20
|
-
*/
|
|
21
|
-
this.slottedButton = null;
|
|
22
|
-
this.handleKeyDown = (e) => {
|
|
23
|
-
if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {
|
|
24
|
-
e.preventDefault();
|
|
25
|
-
this.handleToggle();
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Watch for changes to the `for` property to validate its type and ensure it is a string.
|
|
31
|
-
* @param forValue - The new value of the `for` property.
|
|
32
|
-
*/
|
|
33
|
-
validateControlFor() {
|
|
34
|
-
checkRequiredAndType(this, 'for', 'string');
|
|
35
|
-
}
|
|
36
|
-
get menu() {
|
|
37
|
-
const ref = this.root.getElementById(this.for);
|
|
38
|
-
return ref && ref.localName === 'post-menu' ? ref : null;
|
|
39
|
-
}
|
|
40
|
-
handleToggle() {
|
|
41
|
-
if (this.menu) {
|
|
42
|
-
this.menu.toggle(this.host);
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
console.warn(`No post-menu found with ID: ${this.for}`);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
connectedCallback() {
|
|
49
|
-
this.root = getRoot(this.host);
|
|
50
|
-
}
|
|
51
|
-
componentDidLoad() {
|
|
52
|
-
this.validateControlFor();
|
|
53
|
-
this.slottedButton = this.host.querySelector('button');
|
|
54
|
-
// Check if the slottedButton is within a web component
|
|
55
|
-
if (!this.slottedButton) {
|
|
56
|
-
const webComponent = this.host.querySelector('.menu-trigger-webc');
|
|
57
|
-
if (webComponent?.shadowRoot) {
|
|
58
|
-
const slottedButton = webComponent.shadowRoot.querySelector('button');
|
|
59
|
-
if (slottedButton) {
|
|
60
|
-
this.slottedButton = slottedButton;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
if (this.slottedButton) {
|
|
65
|
-
this.slottedButton.setAttribute('aria-haspopup', 'menu');
|
|
66
|
-
// Listen to the `toggleMenu` event emitted by the `post-menu` component
|
|
67
|
-
if (this.menu && this.slottedButton) {
|
|
68
|
-
this.menu.addEventListener('toggleMenu', (event) => {
|
|
69
|
-
this.ariaExpanded = event.detail;
|
|
70
|
-
this.slottedButton.setAttribute('aria-expanded', this.ariaExpanded.toString());
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
this.slottedButton.addEventListener('click', () => {
|
|
74
|
-
this.handleToggle();
|
|
75
|
-
});
|
|
76
|
-
this.slottedButton.addEventListener('keydown', this.handleKeyDown);
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
console.warn('No button found within post-menu-trigger');
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
render() {
|
|
83
|
-
return (h(Host, { key: '14592f9564fdb09b2e809374d5794bf71f576dbb', "data-version": version, "tab-index": "-1" }, h("slot", { key: 'a0f463000420df39035cc5a48369d230394b5e04' })));
|
|
84
|
-
}
|
|
85
|
-
get host() { return this; }
|
|
86
|
-
static get watchers() { return {
|
|
87
|
-
"for": ["validateControlFor"]
|
|
88
|
-
}; }
|
|
89
|
-
static get style() { return postMenuTriggerCss; }
|
|
90
|
-
}, [4, "post-menu-trigger", {
|
|
91
|
-
"for": [513],
|
|
92
|
-
"ariaExpanded": [32]
|
|
93
|
-
}, undefined, {
|
|
94
|
-
"for": ["validateControlFor"]
|
|
95
|
-
}]);
|
|
96
|
-
function defineCustomElement() {
|
|
97
|
-
if (typeof customElements === "undefined") {
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
const components = ["post-menu-trigger"];
|
|
101
|
-
components.forEach(tagName => { switch (tagName) {
|
|
102
|
-
case "post-menu-trigger":
|
|
103
|
-
if (!customElements.get(tagName)) {
|
|
104
|
-
customElements.define(tagName, PostMenuTrigger);
|
|
105
|
-
}
|
|
106
|
-
break;
|
|
107
|
-
} });
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export { PostMenuTrigger as P, defineCustomElement as d };
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as s,h as e,Host as o,transformTag as i}from"@stencil/core/internal/client";import{v as n}from"./package.js";import{c as r}from"./breakpoints.js";import{g as a}from"./get-root.js";const h=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.ariaExpanded=!1,this.slottedButton=null,this.handleKeyDown=t=>{"ArrowUp"!==t.key&&"ArrowDown"!==t.key||(t.preventDefault(),this.handleToggle())}}validateControlFor(){r(this,"for","string")}get menu(){const t=this.root.getElementById(this.for);return t&&"post-menu"===t.localName?t:null}handleToggle(){this.menu?this.menu.toggle(this.host):console.warn(`No post-menu found with ID: ${this.for}`)}connectedCallback(){this.root=a(this.host)}componentDidLoad(){if(this.validateControlFor(),this.slottedButton=this.host.querySelector("button"),!this.slottedButton){const t=this.host.querySelector(".menu-trigger-webc");if(t?.shadowRoot){const s=t.shadowRoot.querySelector("button");s&&(this.slottedButton=s)}}this.slottedButton?(this.slottedButton.setAttribute("aria-haspopup","menu"),this.menu&&this.slottedButton&&this.menu.addEventListener("toggleMenu",(t=>{this.ariaExpanded=t.detail,this.slottedButton.setAttribute("aria-expanded",this.ariaExpanded.toString())})),this.slottedButton.addEventListener("click",(()=>{this.handleToggle()})),this.slottedButton.addEventListener("keydown",this.handleKeyDown)):console.warn("No button found within post-menu-trigger")}render(){return e(o,{key:"13701a50f739c2252ab296e13c657e1d4c51444b","data-version":n,"tab-index":"-1"},e("slot",{key:"dc5fd68d917d3cfe2a9703553b1fba4047770260"}))}get host(){return this}static get watchers(){return{for:[{validateControlFor:0}]}}static get style(){return":host{display:inline-block}"}},[260,"post-menu-trigger",{for:[513],ariaExpanded:[32]},void 0,{for:[{validateControlFor:0}]}]);function c(){"undefined"!=typeof customElements&&["post-menu-trigger"].forEach((t=>{"post-menu-trigger"===t&&(customElements.get(i(t))||customElements.define(i(t),h))}))}export{h as P,c as d}
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
const PostMenu = PostMenu$1;
|
|
4
|
-
const defineCustomElement = defineCustomElement$1;
|
|
5
|
-
|
|
6
|
-
export { PostMenu, defineCustomElement };
|
|
1
|
+
import{P as o,d as s}from"./post-menu2.js";const t=o,m=s;export{t as PostMenu,m as defineCustomElement}
|