@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,52 +1,172 @@
|
|
|
1
|
-
import { h, Host } from "@stencil/core";
|
|
1
|
+
import { h, Host, } from "@stencil/core";
|
|
2
2
|
import { version } from "../../../../package";
|
|
3
|
-
import {
|
|
4
|
-
import { componentOnReady } from "../../utils/index";
|
|
3
|
+
import { fade } from "../../animations/index";
|
|
4
|
+
import { componentOnReady, checkRequiredAndType } from "../../utils/index";
|
|
5
5
|
/**
|
|
6
|
-
* @slot
|
|
7
|
-
* @slot
|
|
8
|
-
* @part tabs - The container element that holds the set of tabs.
|
|
9
|
-
* @part content - The container element that displays the content of the currently active tab.
|
|
6
|
+
* @slot default - Slot for placing tab items. Each tab item should be a <post-tab-item> element.
|
|
7
|
+
* @slot panels - Slot for placing tab panels. Each tab panel should be a <post-tab-panel> element.
|
|
8
|
+
* @part post-tabs - The container element that holds the set of tabs.
|
|
9
|
+
* @part post-tabs-content - The container element that displays the content of the currently active tab. Only available in panels mode.
|
|
10
10
|
*/
|
|
11
11
|
export class PostTabs {
|
|
12
12
|
constructor() {
|
|
13
13
|
this.isLoaded = false;
|
|
14
|
+
this.isNavigationMode = false;
|
|
14
15
|
/**
|
|
15
16
|
* When set to true, this property allows the tabs container to span the
|
|
17
|
+
* Changing this value after initialization has no effect.
|
|
16
18
|
* full width of the screen, from edge to edge.
|
|
17
19
|
*/
|
|
18
20
|
this.fullWidth = false;
|
|
19
21
|
}
|
|
20
22
|
get tabs() {
|
|
21
|
-
return Array.from(this.host.querySelectorAll('post-tab-
|
|
23
|
+
return Array.from(this.host.querySelectorAll('post-tab-item')).filter(tab => tab.closest('post-tabs') === this.host);
|
|
24
|
+
}
|
|
25
|
+
get panels() {
|
|
26
|
+
return Array.from(this.host.querySelectorAll('post-tab-panel')).filter(panel => panel.closest('post-tabs') === this.host);
|
|
27
|
+
}
|
|
28
|
+
validateLabel() {
|
|
29
|
+
if (this.isNavigationMode) {
|
|
30
|
+
checkRequiredAndType(this, 'label', 'string');
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
componentWillRender() {
|
|
34
|
+
this.detectMode();
|
|
22
35
|
}
|
|
23
36
|
componentDidLoad() {
|
|
24
37
|
this.moveMisplacedTabs();
|
|
38
|
+
this.moveMisplacedPanels();
|
|
25
39
|
this.enableTabs();
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
this.
|
|
40
|
+
this.setupContentObserver();
|
|
41
|
+
this.validateLabel();
|
|
42
|
+
if (this.isNavigationMode) {
|
|
43
|
+
const activeTab = this.findActiveNavigationTab();
|
|
44
|
+
if (activeTab) {
|
|
45
|
+
this.activateTab(activeTab);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
const tabToActivate = this.activeTab || this.tabs[0]?.name;
|
|
50
|
+
if (tabToActivate) {
|
|
51
|
+
void this.show(tabToActivate);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
disconnectedCallback() {
|
|
56
|
+
if (this.showing) {
|
|
57
|
+
this.showing.cancel();
|
|
58
|
+
this.showing = null;
|
|
59
|
+
}
|
|
60
|
+
if (this.hiding) {
|
|
61
|
+
this.hiding.cancel();
|
|
62
|
+
this.hiding = null;
|
|
63
|
+
}
|
|
64
|
+
if (this.contentObserver) {
|
|
65
|
+
this.contentObserver.disconnect();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
setupContentObserver() {
|
|
69
|
+
const config = {
|
|
70
|
+
childList: true,
|
|
71
|
+
subtree: true,
|
|
72
|
+
attributes: true,
|
|
73
|
+
attributeFilter: ['data-navigation-mode', 'aria-current'],
|
|
74
|
+
};
|
|
75
|
+
this.contentObserver = new MutationObserver(this.handleContentChange.bind(this));
|
|
76
|
+
this.contentObserver.observe(this.host, config);
|
|
77
|
+
}
|
|
78
|
+
handleContentChange(mutations) {
|
|
79
|
+
const shouldRedetect = this.shouldRedetectMode(mutations);
|
|
80
|
+
const ariaCurrentChanged = this.hasAriaCurrentChanged(mutations);
|
|
81
|
+
if (ariaCurrentChanged && this.isNavigationMode) {
|
|
82
|
+
this.updateActiveNavigationTab();
|
|
83
|
+
}
|
|
84
|
+
if (shouldRedetect) {
|
|
85
|
+
this.handleModeChange();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
shouldRedetectMode(mutations) {
|
|
89
|
+
return mutations.some(mutation => {
|
|
90
|
+
if (mutation.type === 'childList') {
|
|
91
|
+
return mutation.addedNodes.length > 0 || mutation.removedNodes.length > 0;
|
|
92
|
+
}
|
|
93
|
+
if (mutation.type === 'attributes' && mutation.attributeName === 'data-navigation-mode') {
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
return false;
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
hasAriaCurrentChanged(mutations) {
|
|
100
|
+
return mutations.some(mutation => mutation.type === 'attributes' && mutation.attributeName === 'aria-current');
|
|
101
|
+
}
|
|
102
|
+
updateActiveNavigationTab() {
|
|
103
|
+
const activeTab = this.findActiveNavigationTab();
|
|
104
|
+
if (activeTab && activeTab !== this.currentActiveTab) {
|
|
105
|
+
this.activateTab(activeTab);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
handleModeChange() {
|
|
109
|
+
const previousMode = this.isNavigationMode;
|
|
110
|
+
this.detectMode();
|
|
111
|
+
if (previousMode !== this.isNavigationMode) {
|
|
112
|
+
this.enableTabs();
|
|
113
|
+
this.initializeActiveTab();
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
initializeActiveTab() {
|
|
117
|
+
if (this.isNavigationMode) {
|
|
118
|
+
const activeTab = this.findActiveNavigationTab();
|
|
119
|
+
if (activeTab) {
|
|
120
|
+
this.activateTab(activeTab);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
const tabToActivate = this.activeTab || this.tabs[0]?.name;
|
|
125
|
+
if (tabToActivate) {
|
|
126
|
+
void this.show(tabToActivate);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
detectMode() {
|
|
131
|
+
// Check for navigation mode by looking for anchor elements in tabs
|
|
132
|
+
// This works even before post-tab-item sets data-navigation-mode attribute
|
|
133
|
+
const hasNavigationTabs = this.tabs.some(tab => {
|
|
134
|
+
const hasAnchor = tab.querySelector('a') !== null;
|
|
135
|
+
const navModeAttr = tab.getAttribute('data-navigation-mode') === 'true';
|
|
136
|
+
return hasAnchor || navModeAttr;
|
|
137
|
+
});
|
|
138
|
+
const hasPanels = this.panels.length > 0;
|
|
139
|
+
if (hasNavigationTabs && hasPanels) {
|
|
140
|
+
throw new Error('PostTabs: Mixed mode detected. Cannot use both navigation mode (anchor elements) and panel mode (post-tab-panel elements) at the same time.');
|
|
141
|
+
}
|
|
142
|
+
this.isNavigationMode = hasNavigationTabs;
|
|
143
|
+
}
|
|
144
|
+
findActiveNavigationTab() {
|
|
145
|
+
return (this.tabs.find(tab => {
|
|
146
|
+
const anchor = tab.querySelector('a[aria-current="page"]');
|
|
147
|
+
return anchor !== null;
|
|
148
|
+
}) || null);
|
|
29
149
|
}
|
|
30
150
|
/**
|
|
31
151
|
* Shows the panel with the given name and selects its associated tab.
|
|
32
152
|
* Any other panel that was previously shown becomes hidden and its associated tab is unselected.
|
|
33
153
|
*/
|
|
34
|
-
async show(
|
|
154
|
+
async show(tabName) {
|
|
35
155
|
// do nothing if the tab is already active
|
|
36
|
-
if (
|
|
156
|
+
if (tabName === this.currentActiveTab?.name) {
|
|
37
157
|
return;
|
|
38
158
|
}
|
|
39
|
-
const previousTab = this.
|
|
40
|
-
const newTab = this.host.querySelector(`post-tab-
|
|
159
|
+
const previousTab = this.currentActiveTab;
|
|
160
|
+
const newTab = this.host.querySelector(`post-tab-item[name=${tabName}]`);
|
|
41
161
|
this.activateTab(newTab);
|
|
42
162
|
// if a panel is currently being displayed, remove it from the view and complete the associated animation
|
|
43
163
|
if (this.showing) {
|
|
44
|
-
this.showing.effect['target'].style.display = 'none';
|
|
45
164
|
this.showing.finish();
|
|
165
|
+
this.showing = null;
|
|
46
166
|
}
|
|
47
167
|
// hide the currently visible panel only if no other animation is running
|
|
48
168
|
if (previousTab && !this.showing && !this.hiding)
|
|
49
|
-
this.hidePanel(previousTab.
|
|
169
|
+
this.hidePanel(previousTab.name);
|
|
50
170
|
// wait for any hiding animation to complete before showing the selected tab
|
|
51
171
|
if (this.hiding)
|
|
52
172
|
await this.hiding.finished;
|
|
@@ -55,15 +175,25 @@ export class PostTabs {
|
|
|
55
175
|
if (this.showing)
|
|
56
176
|
await this.showing.finished;
|
|
57
177
|
if (this.isLoaded)
|
|
58
|
-
this.postChange.emit(this.
|
|
178
|
+
this.postChange.emit(this.currentActiveTab.name);
|
|
59
179
|
}
|
|
60
180
|
moveMisplacedTabs() {
|
|
61
181
|
if (!this.tabs)
|
|
62
182
|
return;
|
|
63
183
|
this.tabs.forEach(tab => {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
184
|
+
// Tab items should go in the default slot, so remove any slot attribute
|
|
185
|
+
if (tab.getAttribute('slot')) {
|
|
186
|
+
tab.removeAttribute('slot');
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
moveMisplacedPanels() {
|
|
191
|
+
if (!this.panels)
|
|
192
|
+
return;
|
|
193
|
+
this.panels.forEach(panel => {
|
|
194
|
+
if (panel.getAttribute('slot') !== 'panels') {
|
|
195
|
+
panel.setAttribute('slot', 'panels');
|
|
196
|
+
}
|
|
67
197
|
});
|
|
68
198
|
}
|
|
69
199
|
enableTabs() {
|
|
@@ -71,19 +201,25 @@ export class PostTabs {
|
|
|
71
201
|
return;
|
|
72
202
|
this.tabs.forEach(async (tab) => {
|
|
73
203
|
await componentOnReady(tab);
|
|
74
|
-
//
|
|
204
|
+
// In navigation mode, navigation is handled by the consumer's routing
|
|
205
|
+
if (this.isNavigationMode) {
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
// Panel mode: set up ARIA relationships and event handlers
|
|
75
209
|
if (tab.getAttribute('aria-controls'))
|
|
76
210
|
return;
|
|
77
|
-
const tabPanel = this.getPanel(tab.
|
|
78
|
-
|
|
79
|
-
|
|
211
|
+
const tabPanel = this.getPanel(tab.name);
|
|
212
|
+
if (tabPanel) {
|
|
213
|
+
tab.setAttribute('aria-controls', tabPanel.id);
|
|
214
|
+
tabPanel.setAttribute('aria-labelledby', tab.id);
|
|
215
|
+
}
|
|
80
216
|
tab.addEventListener('click', () => {
|
|
81
|
-
void this.show(tab.
|
|
217
|
+
void this.show(tab.name);
|
|
82
218
|
});
|
|
83
219
|
tab.addEventListener('keydown', (e) => {
|
|
84
220
|
if (e.key === 'Enter' || e.key === ' ') {
|
|
85
221
|
e.preventDefault();
|
|
86
|
-
void this.show(tab.
|
|
222
|
+
void this.show(tab.name);
|
|
87
223
|
}
|
|
88
224
|
});
|
|
89
225
|
tab.addEventListener('keydown', (e) => {
|
|
@@ -92,44 +228,51 @@ export class PostTabs {
|
|
|
92
228
|
});
|
|
93
229
|
});
|
|
94
230
|
// if the currently active tab was removed from the DOM then select the first one
|
|
95
|
-
if (this.
|
|
96
|
-
void this.show(this.tabs[0]?.
|
|
231
|
+
if (this.currentActiveTab && !this.currentActiveTab.isConnected) {
|
|
232
|
+
void this.show(this.tabs[0]?.name);
|
|
97
233
|
}
|
|
98
234
|
}
|
|
99
235
|
activateTab(tab) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
this.
|
|
103
|
-
this.
|
|
236
|
+
// Deactivate previous tab
|
|
237
|
+
if (this.currentActiveTab) {
|
|
238
|
+
this.currentActiveTab.classList.remove('active');
|
|
239
|
+
if (!this.isNavigationMode) {
|
|
240
|
+
this.currentActiveTab.setAttribute('aria-selected', 'false');
|
|
241
|
+
this.currentActiveTab.setAttribute('tabindex', '-1');
|
|
242
|
+
}
|
|
104
243
|
}
|
|
105
|
-
tab.setAttribute('aria-selected', 'true');
|
|
106
|
-
tab.setAttribute('tabindex', '0');
|
|
107
244
|
tab.classList.add('active');
|
|
108
|
-
this.
|
|
245
|
+
if (!this.isNavigationMode) {
|
|
246
|
+
tab.setAttribute('aria-selected', 'true');
|
|
247
|
+
tab.setAttribute('tabindex', '0');
|
|
248
|
+
}
|
|
249
|
+
this.currentActiveTab = tab;
|
|
109
250
|
}
|
|
110
251
|
hidePanel(panelName) {
|
|
111
252
|
const previousPanel = this.getPanel(panelName);
|
|
112
253
|
if (!previousPanel)
|
|
113
254
|
return;
|
|
114
|
-
this.hiding =
|
|
255
|
+
this.hiding = fade(previousPanel, 'out');
|
|
115
256
|
this.hiding.onfinish = () => {
|
|
116
257
|
previousPanel.style.display = 'none';
|
|
117
258
|
this.hiding = null;
|
|
118
259
|
};
|
|
119
260
|
}
|
|
120
261
|
showSelectedPanel() {
|
|
121
|
-
const panel = this.getPanel(this.
|
|
262
|
+
const panel = this.getPanel(this.currentActiveTab.name);
|
|
263
|
+
if (!panel)
|
|
264
|
+
return;
|
|
122
265
|
panel.style.display = 'block';
|
|
123
266
|
// prevent the initially selected panel from fading in
|
|
124
267
|
if (!this.isLoaded)
|
|
125
268
|
return;
|
|
126
|
-
this.showing =
|
|
269
|
+
this.showing = fade(panel, 'in');
|
|
127
270
|
this.showing.onfinish = () => {
|
|
128
271
|
this.showing = null;
|
|
129
272
|
};
|
|
130
273
|
}
|
|
131
274
|
getPanel(name) {
|
|
132
|
-
return this.host.querySelector(`post-tab-panel[
|
|
275
|
+
return this.host.querySelector(`post-tab-panel[for=${name}]`);
|
|
133
276
|
}
|
|
134
277
|
navigateTabs(tab, key) {
|
|
135
278
|
const activeTabIndex = Array.from(this.tabs).indexOf(tab);
|
|
@@ -143,9 +286,14 @@ export class PostTabs {
|
|
|
143
286
|
if (!nextTab)
|
|
144
287
|
return;
|
|
145
288
|
nextTab.focus();
|
|
289
|
+
void this.show(nextTab.name);
|
|
146
290
|
}
|
|
147
291
|
render() {
|
|
148
|
-
|
|
292
|
+
const TabsContainer = this.isNavigationMode ? 'nav' : 'div';
|
|
293
|
+
return (h(Host, { key: '89edc2a79734ee9cd60c9db0f01e2f05f2849071', "data-version": version }, h("div", { key: 'd85aa2320cef490831bf59117b54dc7c4edd9d65', class: "tabs-wrapper", part: "post-tabs" }, h(TabsContainer, { key: 'e4aa70db5e2d0f3391d8ebfaab6374c1966d6678', class: "tabs", role: this.isNavigationMode ? undefined : 'tablist', "aria-label": this.isNavigationMode ? this.label : undefined }, h("slot", { key: '7ab6f1e7bbe24ef642d5917b810b62e362ae2dc1', onSlotchange: () => {
|
|
294
|
+
this.moveMisplacedTabs();
|
|
295
|
+
this.enableTabs();
|
|
296
|
+
} }))), !this.isNavigationMode && (h("div", { key: '354eafcea40f6aa9bbb206a93bc2155eac725bb4', class: "tab-content", part: "post-tabs-content" }, h("slot", { key: 'a133b48cea08eade14a954933062380edf112523', name: "panels", onSlotchange: () => this.moveMisplacedPanels() })))));
|
|
149
297
|
}
|
|
150
298
|
static get is() { return "post-tabs"; }
|
|
151
299
|
static get encapsulation() { return "shadow"; }
|
|
@@ -161,33 +309,27 @@ export class PostTabs {
|
|
|
161
309
|
}
|
|
162
310
|
static get properties() {
|
|
163
311
|
return {
|
|
164
|
-
"
|
|
312
|
+
"activeTab": {
|
|
165
313
|
"type": "string",
|
|
166
|
-
"attribute": "active-panel",
|
|
167
314
|
"mutable": false,
|
|
168
315
|
"complexType": {
|
|
169
|
-
"original": "
|
|
316
|
+
"original": "string",
|
|
170
317
|
"resolved": "string",
|
|
171
|
-
"references": {
|
|
172
|
-
"HTMLPostTabPanelElement": {
|
|
173
|
-
"location": "global",
|
|
174
|
-
"id": "global::HTMLPostTabPanelElement"
|
|
175
|
-
}
|
|
176
|
-
}
|
|
318
|
+
"references": {}
|
|
177
319
|
},
|
|
178
320
|
"required": false,
|
|
179
321
|
"optional": true,
|
|
180
322
|
"docs": {
|
|
181
323
|
"tags": [],
|
|
182
|
-
"text": "The name of the panel that is initially
|
|
324
|
+
"text": "The name of the tab in the panel mode that is initially active.\nChanging this value after initialization has no effect.\nIf not specified, defaults to the first tab."
|
|
183
325
|
},
|
|
184
326
|
"getter": false,
|
|
185
327
|
"setter": false,
|
|
186
|
-
"reflect": false
|
|
328
|
+
"reflect": false,
|
|
329
|
+
"attribute": "active-tab"
|
|
187
330
|
},
|
|
188
331
|
"fullWidth": {
|
|
189
332
|
"type": "boolean",
|
|
190
|
-
"attribute": "full-width",
|
|
191
333
|
"mutable": false,
|
|
192
334
|
"complexType": {
|
|
193
335
|
"original": "boolean",
|
|
@@ -198,15 +340,40 @@ export class PostTabs {
|
|
|
198
340
|
"optional": false,
|
|
199
341
|
"docs": {
|
|
200
342
|
"tags": [],
|
|
201
|
-
"text": "When set to true, this property allows the tabs container to span the\nfull width of the screen, from edge to edge."
|
|
343
|
+
"text": "When set to true, this property allows the tabs container to span the\nChanging this value after initialization has no effect.\nfull width of the screen, from edge to edge."
|
|
202
344
|
},
|
|
203
345
|
"getter": false,
|
|
204
346
|
"setter": false,
|
|
205
347
|
"reflect": true,
|
|
348
|
+
"attribute": "full-width",
|
|
206
349
|
"defaultValue": "false"
|
|
350
|
+
},
|
|
351
|
+
"label": {
|
|
352
|
+
"type": "string",
|
|
353
|
+
"mutable": false,
|
|
354
|
+
"complexType": {
|
|
355
|
+
"original": "string",
|
|
356
|
+
"resolved": "string",
|
|
357
|
+
"references": {}
|
|
358
|
+
},
|
|
359
|
+
"required": false,
|
|
360
|
+
"optional": true,
|
|
361
|
+
"docs": {
|
|
362
|
+
"tags": [],
|
|
363
|
+
"text": "The accessible label for the tabs component in navigation mode."
|
|
364
|
+
},
|
|
365
|
+
"getter": false,
|
|
366
|
+
"setter": false,
|
|
367
|
+
"reflect": true,
|
|
368
|
+
"attribute": "label"
|
|
207
369
|
}
|
|
208
370
|
};
|
|
209
371
|
}
|
|
372
|
+
static get states() {
|
|
373
|
+
return {
|
|
374
|
+
"isNavigationMode": {}
|
|
375
|
+
};
|
|
376
|
+
}
|
|
210
377
|
static get events() {
|
|
211
378
|
return [{
|
|
212
379
|
"method": "postChange",
|
|
@@ -216,7 +383,7 @@ export class PostTabs {
|
|
|
216
383
|
"composed": true,
|
|
217
384
|
"docs": {
|
|
218
385
|
"tags": [],
|
|
219
|
-
"text": "An event emitted after the active tab changes, when the fade in transition of its associated panel is finished.\nThe payload is the name of the newly
|
|
386
|
+
"text": "An event emitted after the active tab changes, when the fade in transition of its associated panel is finished.\nThe payload is the name of the newly active tab.\nOnly emitted in panel mode."
|
|
220
387
|
},
|
|
221
388
|
"complexType": {
|
|
222
389
|
"original": "string",
|
|
@@ -229,9 +396,9 @@ export class PostTabs {
|
|
|
229
396
|
return {
|
|
230
397
|
"show": {
|
|
231
398
|
"complexType": {
|
|
232
|
-
"signature": "(
|
|
399
|
+
"signature": "(tabName: string) => Promise<void>",
|
|
233
400
|
"parameters": [{
|
|
234
|
-
"name": "
|
|
401
|
+
"name": "tabName",
|
|
235
402
|
"type": "string",
|
|
236
403
|
"docs": ""
|
|
237
404
|
}],
|
|
@@ -240,9 +407,9 @@ export class PostTabs {
|
|
|
240
407
|
"location": "global",
|
|
241
408
|
"id": "global::Promise"
|
|
242
409
|
},
|
|
243
|
-
"
|
|
410
|
+
"HTMLPostTabItemElement": {
|
|
244
411
|
"location": "global",
|
|
245
|
-
"id": "global::
|
|
412
|
+
"id": "global::HTMLPostTabItemElement"
|
|
246
413
|
}
|
|
247
414
|
},
|
|
248
415
|
"return": "Promise<void>"
|
|
@@ -255,4 +422,10 @@ export class PostTabs {
|
|
|
255
422
|
};
|
|
256
423
|
}
|
|
257
424
|
static get elementRef() { return "host"; }
|
|
425
|
+
static get watchers() {
|
|
426
|
+
return [{
|
|
427
|
+
"propName": "label",
|
|
428
|
+
"methodName": "validateLabel"
|
|
429
|
+
}];
|
|
430
|
+
}
|
|
258
431
|
}
|
|
@@ -26,7 +26,7 @@ export class PostTogglebutton {
|
|
|
26
26
|
this.host.addEventListener('keydown', (e) => this.handleKeydown(e));
|
|
27
27
|
}
|
|
28
28
|
render() {
|
|
29
|
-
return (h(Host, { key: '
|
|
29
|
+
return (h(Host, { key: 'e0708bda008257aeab8e9ad82c33c66eff4aedb6', "data-version": version, role: "button", tabindex: "0", "aria-pressed": this.toggled.toString() }, h("slot", { key: 'a10862573155edbef1a88bd8a1f9f8abf9dbe4c0' })));
|
|
30
30
|
}
|
|
31
31
|
static get is() { return "post-togglebutton"; }
|
|
32
32
|
static get encapsulation() { return "shadow"; }
|
|
@@ -44,7 +44,6 @@ export class PostTogglebutton {
|
|
|
44
44
|
return {
|
|
45
45
|
"toggled": {
|
|
46
46
|
"type": "boolean",
|
|
47
|
-
"attribute": "toggled",
|
|
48
47
|
"mutable": true,
|
|
49
48
|
"complexType": {
|
|
50
49
|
"original": "boolean",
|
|
@@ -60,6 +59,7 @@ export class PostTogglebutton {
|
|
|
60
59
|
"getter": false,
|
|
61
60
|
"setter": false,
|
|
62
61
|
"reflect": false,
|
|
62
|
+
"attribute": "toggled",
|
|
63
63
|
"defaultValue": "false"
|
|
64
64
|
}
|
|
65
65
|
};
|
|
@@ -39,7 +39,7 @@ export class PostTooltip {
|
|
|
39
39
|
async show(target) {
|
|
40
40
|
if (this.open)
|
|
41
41
|
return;
|
|
42
|
-
this.popoverRef.show(target);
|
|
42
|
+
await this.popoverRef.show(target);
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
45
|
* Programmatically hide this tooltip.
|
|
@@ -59,12 +59,12 @@ export class PostTooltip {
|
|
|
59
59
|
* Set the open state based on the toggle event.
|
|
60
60
|
* @param e Popovercontainer toggle event
|
|
61
61
|
*/
|
|
62
|
-
|
|
63
|
-
this.open = e.detail.
|
|
62
|
+
handleBeforeToggle(e) {
|
|
63
|
+
this.open = e.detail.willOpen;
|
|
64
64
|
}
|
|
65
65
|
render() {
|
|
66
66
|
const popoverClass = `${this.arrow ? 'has-arrow' : ''}`;
|
|
67
|
-
return (h(Host, { key: '
|
|
67
|
+
return (h(Host, { key: '5de53c10c2556ddb974a65ba06e27ccc99311762', "data-version": version }, h("post-popovercontainer", { key: 'ae3a26fc69d983884eb5aee2b024e74d91983c73', safeSpace: "trapezoid", class: popoverClass, role: "tooltip", arrow: this.arrow, placement: this.placement, onPostBeforeToggle: e => this.handleBeforeToggle(e), ref: (el) => (this.popoverRef = el) }, h("slot", { key: '1fd537504554e094894f8549de5c29c515322866' }))));
|
|
68
68
|
}
|
|
69
69
|
static get is() { return "post-tooltip"; }
|
|
70
70
|
static get encapsulation() { return "shadow"; }
|
|
@@ -82,7 +82,6 @@ export class PostTooltip {
|
|
|
82
82
|
return {
|
|
83
83
|
"placement": {
|
|
84
84
|
"type": "string",
|
|
85
|
-
"attribute": "placement",
|
|
86
85
|
"mutable": false,
|
|
87
86
|
"complexType": {
|
|
88
87
|
"original": "Placement",
|
|
@@ -91,7 +90,8 @@ export class PostTooltip {
|
|
|
91
90
|
"Placement": {
|
|
92
91
|
"location": "import",
|
|
93
92
|
"path": "@floating-ui/dom",
|
|
94
|
-
"id": "../../node_modules/.pnpm/@floating-ui+dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.d.
|
|
93
|
+
"id": "../../node_modules/.pnpm/@floating-ui+dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.d.mts::Placement",
|
|
94
|
+
"referenceLocation": "Placement"
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
},
|
|
@@ -104,11 +104,11 @@ export class PostTooltip {
|
|
|
104
104
|
"getter": false,
|
|
105
105
|
"setter": false,
|
|
106
106
|
"reflect": false,
|
|
107
|
+
"attribute": "placement",
|
|
107
108
|
"defaultValue": "'top'"
|
|
108
109
|
},
|
|
109
110
|
"arrow": {
|
|
110
111
|
"type": "boolean",
|
|
111
|
-
"attribute": "arrow",
|
|
112
112
|
"mutable": false,
|
|
113
113
|
"complexType": {
|
|
114
114
|
"original": "boolean",
|
|
@@ -124,30 +124,11 @@ export class PostTooltip {
|
|
|
124
124
|
"getter": false,
|
|
125
125
|
"setter": false,
|
|
126
126
|
"reflect": false,
|
|
127
|
+
"attribute": "arrow",
|
|
127
128
|
"defaultValue": "false"
|
|
128
129
|
},
|
|
129
|
-
"animation": {
|
|
130
|
-
"type": "string",
|
|
131
|
-
"attribute": "animation",
|
|
132
|
-
"mutable": false,
|
|
133
|
-
"complexType": {
|
|
134
|
-
"original": "'pop-in'",
|
|
135
|
-
"resolved": "\"pop-in\"",
|
|
136
|
-
"references": {}
|
|
137
|
-
},
|
|
138
|
-
"required": false,
|
|
139
|
-
"optional": true,
|
|
140
|
-
"docs": {
|
|
141
|
-
"tags": [],
|
|
142
|
-
"text": "Choose a tooltip animation"
|
|
143
|
-
},
|
|
144
|
-
"getter": false,
|
|
145
|
-
"setter": false,
|
|
146
|
-
"reflect": false
|
|
147
|
-
},
|
|
148
130
|
"open": {
|
|
149
131
|
"type": "boolean",
|
|
150
|
-
"attribute": "open",
|
|
151
132
|
"mutable": true,
|
|
152
133
|
"complexType": {
|
|
153
134
|
"original": "boolean",
|
|
@@ -163,6 +144,7 @@ export class PostTooltip {
|
|
|
163
144
|
"getter": false,
|
|
164
145
|
"setter": false,
|
|
165
146
|
"reflect": true,
|
|
147
|
+
"attribute": "open",
|
|
166
148
|
"defaultValue": "false"
|
|
167
149
|
}
|
|
168
150
|
};
|
|
@@ -169,7 +169,7 @@ export class PostTooltipTrigger {
|
|
|
169
169
|
this.tooltip?.hide();
|
|
170
170
|
}
|
|
171
171
|
render() {
|
|
172
|
-
return (h(Host, { key: '
|
|
172
|
+
return (h(Host, { key: '4f6165e23284794b677748c495401ed7c110d134', "data-version": version }, h("slot", { key: '87a8d412ed0e3fb145853aebb9426dfe13677853', onSlotchange: () => this.handleSlotChange() })));
|
|
173
173
|
}
|
|
174
174
|
static get is() { return "post-tooltip-trigger"; }
|
|
175
175
|
static get encapsulation() { return "shadow"; }
|
|
@@ -187,7 +187,6 @@ export class PostTooltipTrigger {
|
|
|
187
187
|
return {
|
|
188
188
|
"for": {
|
|
189
189
|
"type": "string",
|
|
190
|
-
"attribute": "for",
|
|
191
190
|
"mutable": false,
|
|
192
191
|
"complexType": {
|
|
193
192
|
"original": "string",
|
|
@@ -202,11 +201,11 @@ export class PostTooltipTrigger {
|
|
|
202
201
|
},
|
|
203
202
|
"getter": false,
|
|
204
203
|
"setter": false,
|
|
205
|
-
"reflect": true
|
|
204
|
+
"reflect": true,
|
|
205
|
+
"attribute": "for"
|
|
206
206
|
},
|
|
207
207
|
"delay": {
|
|
208
208
|
"type": "number",
|
|
209
|
-
"attribute": "delay",
|
|
210
209
|
"mutable": false,
|
|
211
210
|
"complexType": {
|
|
212
211
|
"original": "number",
|
|
@@ -222,6 +221,7 @@ export class PostTooltipTrigger {
|
|
|
222
221
|
"getter": false,
|
|
223
222
|
"setter": false,
|
|
224
223
|
"reflect": false,
|
|
224
|
+
"attribute": "delay",
|
|
225
225
|
"defaultValue": "0"
|
|
226
226
|
}
|
|
227
227
|
};
|
|
@@ -1,2 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Environment detection helper
|
|
3
|
+
*
|
|
4
|
+
* Goal: Distinguish between real browser execution and Stencil's server-side
|
|
5
|
+
* hydration context. During SSR/hydration Stencil provides a mocked `window`
|
|
6
|
+
* (Domino / JSDOM–like) so naive checks (e.g. `typeof window !== 'undefined'`)
|
|
7
|
+
* incorrectly classify the environment as a browser.
|
|
8
|
+
*
|
|
9
|
+
* Detection strategy:
|
|
10
|
+
* - Stencils hydrate context uses a hardcoded user agent string ('MockNavigator')
|
|
11
|
+
* and origin ('http://mockdoc.stenciljs.com') for its mocked `window` object.
|
|
12
|
+
* We can use this to identify the hydrate context.
|
|
13
|
+
* - Stencils unit test context also uses the same hardcoded user agent string,
|
|
14
|
+
* but a differnet value for the origin.
|
|
15
|
+
* That's why comparing the origin is aboslutely mandatory.
|
|
16
|
+
* - Since we test the hydrate app in the test context, the origin is getting
|
|
17
|
+
* overwritten by the test setup, leading to a false positive in the
|
|
18
|
+
* `isHydrateApp` detection.
|
|
19
|
+
* To circumvent this, we use a global flag (`isHydrateAppTestEnv`),
|
|
20
|
+
* that we set/reset during the server test, so we can correctly identify
|
|
21
|
+
* the hydrate app in the test context.
|
|
22
|
+
* As a drawback, we can't properly test if the hydrate app is detected as
|
|
23
|
+
* expected, in a real world scenario (elsewhere than in our tests).
|
|
24
|
+
*/
|
|
25
|
+
const MOCKED_USERAGENT = 'MockNavigator';
|
|
26
|
+
const MOCKED_ORIGIN = 'http://mockdoc.stenciljs.com';
|
|
27
|
+
const isNodeEnv = typeof global !== 'undefined';
|
|
28
|
+
const hasWindow = typeof window !== 'undefined';
|
|
29
|
+
const isMockedUserAgent = hasWindow && window.navigator.userAgent === MOCKED_USERAGENT;
|
|
30
|
+
const isMockedOrigin = hasWindow && window.location.origin === MOCKED_ORIGIN;
|
|
31
|
+
/**
|
|
32
|
+
* This is the natural hydrate app environment
|
|
33
|
+
* Is `true` if the hydrate app runs on server
|
|
34
|
+
*/
|
|
35
|
+
const isHydrateAppEnv = isNodeEnv && isMockedUserAgent && isMockedOrigin;
|
|
36
|
+
/**
|
|
37
|
+
* This is the test app server test env
|
|
38
|
+
* Is `true` if the server unit test runs (`false` if the browser unit test runs)
|
|
39
|
+
*/
|
|
40
|
+
const isTestAppServerTestEnv = isNodeEnv && isMockedUserAgent && global.IS_HYDRATEAPP_SERVERTEST;
|
|
41
|
+
/**
|
|
42
|
+
* This is the final hydrate app flag
|
|
43
|
+
* if it`s `true`, IS_BROWSER equals `false` and IS_SERVER equals `true
|
|
44
|
+
*/
|
|
45
|
+
const isHydrateApp = isHydrateAppEnv || isTestAppServerTestEnv;
|
|
46
|
+
export const IS_BROWSER = hasWindow && !isHydrateApp;
|
|
47
|
+
export const IS_SERVER = !IS_BROWSER;
|