@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,196 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { v as version } from './package.js';
|
|
3
|
-
import { f as fadeOut, a as fadeIn } from './fade.js';
|
|
4
|
-
import './breakpoints.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Invoke the `componentOnReady` method if it is available, simulate it otherwise
|
|
8
|
-
* @see https://stenciljs.com/docs/api#componentonready
|
|
9
|
-
*/
|
|
10
|
-
function componentOnReady(el) {
|
|
11
|
-
if (typeof el.componentOnReady === 'function') {
|
|
12
|
-
return el.componentOnReady();
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
return new Promise(resolve => customOnReady(() => {
|
|
16
|
-
resolve(el);
|
|
17
|
-
}));
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
function customOnReady(callback) {
|
|
21
|
-
if (typeof requestAnimationFrame === 'function') {
|
|
22
|
-
return requestAnimationFrame(callback);
|
|
23
|
-
}
|
|
24
|
-
return setTimeout(callback);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const postTabsCss = ".tabs-wrapper{position:relative;padding-top:1rem;border:0;background-color:rgba(0,0,0,.02)}.tabs-wrapper::after{content:\"\";position:absolute;bottom:0;width:100%;height:1px;background-color:#ccc}.tabs-wrapper .tabs{background-color:rgba(0,0,0,0) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.tabs-wrapper::after{background-color:ButtonBorder}}.tabs{display:flex;flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;white-space:nowrap;margin-block:0;padding-inline-start:0;list-style:none}.tabs::after{content:\"\";display:block;flex:1 0 auto;width:1rem}.tab-content{padding-top:1rem}:host{display:block}:host([full-width=true]) .tabs-wrapper{margin-inline:calc(-1*var(--post-container-offset))}:host([full-width=true]) .tabs-wrapper .tabs{padding-inline:var(--post-container-offset)}";
|
|
28
|
-
|
|
29
|
-
const PostTabs$1 = /*@__PURE__*/ proxyCustomElement(class PostTabs extends HTMLElement {
|
|
30
|
-
constructor() {
|
|
31
|
-
super();
|
|
32
|
-
this.__registerHost();
|
|
33
|
-
this.__attachShadow();
|
|
34
|
-
this.postChange = createEvent(this, "postChange", 7);
|
|
35
|
-
this.isLoaded = false;
|
|
36
|
-
/**
|
|
37
|
-
* When set to true, this property allows the tabs container to span the
|
|
38
|
-
* full width of the screen, from edge to edge.
|
|
39
|
-
*/
|
|
40
|
-
this.fullWidth = false;
|
|
41
|
-
}
|
|
42
|
-
get tabs() {
|
|
43
|
-
return Array.from(this.host.querySelectorAll('post-tab-header')).filter(tab => tab.closest('post-tabs') === this.host);
|
|
44
|
-
}
|
|
45
|
-
componentDidLoad() {
|
|
46
|
-
this.moveMisplacedTabs();
|
|
47
|
-
this.enableTabs();
|
|
48
|
-
const initiallyActivePanel = this.activePanel || this.tabs[0]?.panel;
|
|
49
|
-
void this.show(initiallyActivePanel);
|
|
50
|
-
this.isLoaded = true;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Shows the panel with the given name and selects its associated tab.
|
|
54
|
-
* Any other panel that was previously shown becomes hidden and its associated tab is unselected.
|
|
55
|
-
*/
|
|
56
|
-
async show(panelName) {
|
|
57
|
-
// do nothing if the tab is already active
|
|
58
|
-
if (panelName === this.activeTab?.panel) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
const previousTab = this.activeTab;
|
|
62
|
-
const newTab = this.host.querySelector(`post-tab-header[panel=${panelName}]`);
|
|
63
|
-
this.activateTab(newTab);
|
|
64
|
-
// if a panel is currently being displayed, remove it from the view and complete the associated animation
|
|
65
|
-
if (this.showing) {
|
|
66
|
-
this.showing.effect['target'].style.display = 'none';
|
|
67
|
-
this.showing.finish();
|
|
68
|
-
}
|
|
69
|
-
// hide the currently visible panel only if no other animation is running
|
|
70
|
-
if (previousTab && !this.showing && !this.hiding)
|
|
71
|
-
this.hidePanel(previousTab.panel);
|
|
72
|
-
// wait for any hiding animation to complete before showing the selected tab
|
|
73
|
-
if (this.hiding)
|
|
74
|
-
await this.hiding.finished;
|
|
75
|
-
this.showSelectedPanel();
|
|
76
|
-
// wait for any display animation to complete for the returned promise to fully resolve
|
|
77
|
-
if (this.showing)
|
|
78
|
-
await this.showing.finished;
|
|
79
|
-
if (this.isLoaded)
|
|
80
|
-
this.postChange.emit(this.activeTab.panel);
|
|
81
|
-
}
|
|
82
|
-
moveMisplacedTabs() {
|
|
83
|
-
if (!this.tabs)
|
|
84
|
-
return;
|
|
85
|
-
this.tabs.forEach(tab => {
|
|
86
|
-
if (tab.getAttribute('slot') === 'tabs')
|
|
87
|
-
return;
|
|
88
|
-
tab.setAttribute('slot', 'tabs');
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
enableTabs() {
|
|
92
|
-
if (!this.tabs)
|
|
93
|
-
return;
|
|
94
|
-
this.tabs.forEach(async (tab) => {
|
|
95
|
-
await componentOnReady(tab);
|
|
96
|
-
// if the tab has an "aria-controls" attribute it was already linked to its panel: do nothing
|
|
97
|
-
if (tab.getAttribute('aria-controls'))
|
|
98
|
-
return;
|
|
99
|
-
const tabPanel = this.getPanel(tab.panel);
|
|
100
|
-
tab.setAttribute('aria-controls', tabPanel.id);
|
|
101
|
-
tabPanel.setAttribute('aria-labelledby', tab.id);
|
|
102
|
-
tab.addEventListener('click', () => {
|
|
103
|
-
void this.show(tab.panel);
|
|
104
|
-
});
|
|
105
|
-
tab.addEventListener('keydown', (e) => {
|
|
106
|
-
if (e.key === 'Enter' || e.key === ' ') {
|
|
107
|
-
e.preventDefault();
|
|
108
|
-
void this.show(tab.panel);
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
tab.addEventListener('keydown', (e) => {
|
|
112
|
-
if (e.key === 'ArrowRight' || e.key === 'ArrowLeft')
|
|
113
|
-
this.navigateTabs(tab, e.key);
|
|
114
|
-
});
|
|
115
|
-
});
|
|
116
|
-
// if the currently active tab was removed from the DOM then select the first one
|
|
117
|
-
if (this.activeTab && !this.activeTab.isConnected) {
|
|
118
|
-
void this.show(this.tabs[0]?.panel);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
activateTab(tab) {
|
|
122
|
-
if (this.activeTab) {
|
|
123
|
-
this.activeTab.setAttribute('aria-selected', 'false');
|
|
124
|
-
this.activeTab.setAttribute('tabindex', '-1');
|
|
125
|
-
this.activeTab.classList.remove('active');
|
|
126
|
-
}
|
|
127
|
-
tab.setAttribute('aria-selected', 'true');
|
|
128
|
-
tab.setAttribute('tabindex', '0');
|
|
129
|
-
tab.classList.add('active');
|
|
130
|
-
this.activeTab = tab;
|
|
131
|
-
}
|
|
132
|
-
hidePanel(panelName) {
|
|
133
|
-
const previousPanel = this.getPanel(panelName);
|
|
134
|
-
if (!previousPanel)
|
|
135
|
-
return;
|
|
136
|
-
this.hiding = fadeOut(previousPanel);
|
|
137
|
-
this.hiding.onfinish = () => {
|
|
138
|
-
previousPanel.style.display = 'none';
|
|
139
|
-
this.hiding = null;
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
showSelectedPanel() {
|
|
143
|
-
const panel = this.getPanel(this.activeTab.panel);
|
|
144
|
-
panel.style.display = 'block';
|
|
145
|
-
// prevent the initially selected panel from fading in
|
|
146
|
-
if (!this.isLoaded)
|
|
147
|
-
return;
|
|
148
|
-
this.showing = fadeIn(panel);
|
|
149
|
-
this.showing.onfinish = () => {
|
|
150
|
-
this.showing = null;
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
getPanel(name) {
|
|
154
|
-
return this.host.querySelector(`post-tab-panel[name=${name}]`);
|
|
155
|
-
}
|
|
156
|
-
navigateTabs(tab, key) {
|
|
157
|
-
const activeTabIndex = Array.from(this.tabs).indexOf(tab);
|
|
158
|
-
let nextTab;
|
|
159
|
-
if (key === 'ArrowRight') {
|
|
160
|
-
nextTab = this.tabs[activeTabIndex + 1] || this.tabs[0];
|
|
161
|
-
}
|
|
162
|
-
else {
|
|
163
|
-
nextTab = this.tabs[activeTabIndex - 1] || this.tabs[this.tabs.length - 1];
|
|
164
|
-
}
|
|
165
|
-
if (!nextTab)
|
|
166
|
-
return;
|
|
167
|
-
nextTab.focus();
|
|
168
|
-
}
|
|
169
|
-
render() {
|
|
170
|
-
return (h(Host, { key: 'f3534a3b05c379ce1cb311d4c5ea950c8eba87d0', "data-version": version }, h("div", { key: 'd812db6b2a895504fce8ac9dae2663821b9dd759', class: "tabs-wrapper", part: "tabs" }, h("div", { key: '9abd0ee00204a085ceaebce5e11fcff527273605', class: "tabs", role: "tablist" }, h("slot", { key: '89f09f443ca740dc9af66fedb1367cdb4885074d', name: "tabs", onSlotchange: () => this.enableTabs() }))), h("div", { key: '4a94a19fd67814482934bd31bb219470bea8dec6', class: "tab-content", part: "content" }, h("slot", { key: '44db446865edacb1b1c0fc20ef391adfa189e8cb', onSlotchange: () => this.moveMisplacedTabs() }))));
|
|
171
|
-
}
|
|
172
|
-
get host() { return this; }
|
|
173
|
-
static get style() { return postTabsCss; }
|
|
174
|
-
}, [1, "post-tabs", {
|
|
175
|
-
"activePanel": [1, "active-panel"],
|
|
176
|
-
"fullWidth": [516, "full-width"],
|
|
177
|
-
"show": [64]
|
|
178
|
-
}]);
|
|
179
|
-
function defineCustomElement$1() {
|
|
180
|
-
if (typeof customElements === "undefined") {
|
|
181
|
-
return;
|
|
182
|
-
}
|
|
183
|
-
const components = ["post-tabs"];
|
|
184
|
-
components.forEach(tagName => { switch (tagName) {
|
|
185
|
-
case "post-tabs":
|
|
186
|
-
if (!customElements.get(tagName)) {
|
|
187
|
-
customElements.define(tagName, PostTabs$1);
|
|
188
|
-
}
|
|
189
|
-
break;
|
|
190
|
-
} });
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
const PostTabs = PostTabs$1;
|
|
194
|
-
const defineCustomElement = defineCustomElement$1;
|
|
195
|
-
|
|
196
|
-
export { PostTabs, defineCustomElement };
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as s,createEvent as i,h as e,Host as a,transformTag as n}from"@stencil/core/internal/client";import{v as o}from"./package.js";import{f as h}from"./fade.js";import{c as r}from"./breakpoints.js";const l=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.postChange=i(this,"postChange",7),this.isLoaded=!1,this.isNavigationMode=!1,this.fullWidth=!1}get tabs(){return Array.from(this.host.querySelectorAll("post-tab-item")).filter((t=>t.closest("post-tabs")===this.host))}get panels(){return Array.from(this.host.querySelectorAll("post-tab-panel")).filter((t=>t.closest("post-tabs")===this.host))}validateLabel(){this.isNavigationMode&&r(this,"label","string")}componentWillRender(){this.detectMode()}componentDidLoad(){if(this.moveMisplacedTabs(),this.moveMisplacedPanels(),this.enableTabs(),this.setupContentObserver(),this.validateLabel(),this.isNavigationMode){const t=this.findActiveNavigationTab();t&&this.activateTab(t)}else{const t=this.activeTab||this.tabs[0]?.name;t&&this.show(t)}}disconnectedCallback(){this.showing&&(this.showing.cancel(),this.showing=null),this.hiding&&(this.hiding.cancel(),this.hiding=null),this.contentObserver&&this.contentObserver.disconnect()}setupContentObserver(){this.contentObserver=new MutationObserver(this.handleContentChange.bind(this)),this.contentObserver.observe(this.host,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-navigation-mode","aria-current"]})}handleContentChange(t){const s=this.shouldRedetectMode(t);this.hasAriaCurrentChanged(t)&&this.isNavigationMode&&this.updateActiveNavigationTab(),s&&this.handleModeChange()}shouldRedetectMode(t){return t.some((t=>"childList"===t.type?t.addedNodes.length>0||t.removedNodes.length>0:"attributes"===t.type&&"data-navigation-mode"===t.attributeName))}hasAriaCurrentChanged(t){return t.some((t=>"attributes"===t.type&&"aria-current"===t.attributeName))}updateActiveNavigationTab(){const t=this.findActiveNavigationTab();t&&t!==this.currentActiveTab&&this.activateTab(t)}handleModeChange(){const t=this.isNavigationMode;this.detectMode(),t!==this.isNavigationMode&&(this.enableTabs(),this.initializeActiveTab())}initializeActiveTab(){if(this.isNavigationMode){const t=this.findActiveNavigationTab();t&&this.activateTab(t)}else{const t=this.activeTab||this.tabs[0]?.name;t&&this.show(t)}}detectMode(){const t=this.tabs.some((t=>{const s=null!==t.querySelector("a"),i="true"===t.getAttribute("data-navigation-mode");return s||i}));if(t&&this.panels.length>0)throw Error("PostTabs: Mixed mode detected. Cannot use both navigation mode (anchor elements) and panel mode (post-tab-panel elements) at the same time.");this.isNavigationMode=t}findActiveNavigationTab(){return this.tabs.find((t=>null!==t.querySelector('a[aria-current="page"]')))||null}async show(t){if(t===this.currentActiveTab?.name)return;const s=this.currentActiveTab,i=this.host.querySelector(`post-tab-item[name=${t}]`);this.activateTab(i),this.showing&&(this.showing.finish(),this.showing=null),!s||this.showing||this.hiding||this.hidePanel(s.name),this.hiding&&await this.hiding.finished,this.showSelectedPanel(),this.showing&&await this.showing.finished,this.isLoaded&&this.postChange.emit(this.currentActiveTab.name)}moveMisplacedTabs(){this.tabs&&this.tabs.forEach((t=>{t.getAttribute("slot")&&t.removeAttribute("slot")}))}moveMisplacedPanels(){this.panels&&this.panels.forEach((t=>{"panels"!==t.getAttribute("slot")&&t.setAttribute("slot","panels")}))}enableTabs(){this.tabs&&(this.tabs.forEach((async t=>{if(await function(t){return"function"==typeof t.componentOnReady?t.componentOnReady():new Promise((s=>function(t){return"function"==typeof requestAnimationFrame?requestAnimationFrame(t):setTimeout(t)}((()=>{s(t)}))))}(t),this.isNavigationMode)return;if(t.getAttribute("aria-controls"))return;const s=this.getPanel(t.name);s&&(t.setAttribute("aria-controls",s.id),s.setAttribute("aria-labelledby",t.id)),t.addEventListener("click",(()=>{this.show(t.name)})),t.addEventListener("keydown",(s=>{"Enter"!==s.key&&" "!==s.key||(s.preventDefault(),this.show(t.name))})),t.addEventListener("keydown",(s=>{"ArrowRight"!==s.key&&"ArrowLeft"!==s.key||this.navigateTabs(t,s.key)}))})),this.currentActiveTab&&!this.currentActiveTab.isConnected&&this.show(this.tabs[0]?.name))}activateTab(t){this.currentActiveTab&&(this.currentActiveTab.classList.remove("active"),this.isNavigationMode||(this.currentActiveTab.setAttribute("aria-selected","false"),this.currentActiveTab.setAttribute("tabindex","-1"))),t.classList.add("active"),this.isNavigationMode||(t.setAttribute("aria-selected","true"),t.setAttribute("tabindex","0")),this.currentActiveTab=t}hidePanel(t){const s=this.getPanel(t);s&&(this.hiding=h(s,"out"),this.hiding.onfinish=()=>{s.style.display="none",this.hiding=null})}showSelectedPanel(){const t=this.getPanel(this.currentActiveTab.name);t&&(t.style.display="block",this.isLoaded&&(this.showing=h(t,"in"),this.showing.onfinish=()=>{this.showing=null}))}getPanel(t){return this.host.querySelector(`post-tab-panel[for=${t}]`)}navigateTabs(t,s){const i=Array.from(this.tabs).indexOf(t);let e;e="ArrowRight"===s?this.tabs[i+1]||this.tabs[0]:this.tabs[i-1]||this.tabs[this.tabs.length-1],e&&(e.focus(),this.show(e.name))}render(){return e(a,{key:"89edc2a79734ee9cd60c9db0f01e2f05f2849071","data-version":o},e("div",{key:"d85aa2320cef490831bf59117b54dc7c4edd9d65",class:"tabs-wrapper",part:"post-tabs"},e(this.isNavigationMode?"nav":"div",{key:"e4aa70db5e2d0f3391d8ebfaab6374c1966d6678",class:"tabs",role:this.isNavigationMode?void 0:"tablist","aria-label":this.isNavigationMode?this.label:void 0},e("slot",{key:"7ab6f1e7bbe24ef642d5917b810b62e362ae2dc1",onSlotchange:()=>{this.moveMisplacedTabs(),this.enableTabs()}}))),!this.isNavigationMode&&e("div",{key:"354eafcea40f6aa9bbb206a93bc2155eac725bb4",class:"tab-content",part:"post-tabs-content"},e("slot",{key:"a133b48cea08eade14a954933062380edf112523",name:"panels",onSlotchange:()=>this.moveMisplacedPanels()})))}get host(){return this}static get watchers(){return{label:[{validateLabel:0}]}}static get style(){return'.tabs-wrapper{position:relative;padding-top:1rem;border:0;background-color:rgba(0,0,0,.02)}.tabs-wrapper::after{content:"";position:absolute;bottom:0;width:100%;height:1px;background-color:#ccc}.tabs-wrapper .tabs{background-color:rgba(0,0,0,0) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.tabs-wrapper::after{background-color:ButtonBorder}}.tabs{display:flex;flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;white-space:nowrap;margin-block:0;padding-inline-start:0;list-style:none}.tabs::after{content:"";display:block;flex:1 0 auto;width:1rem}.tab-content{padding-top:1rem}:host{display:block}:host([full-width=true]) .tabs-wrapper{margin-inline:calc(-1*var(--post-container-offset))}:host([full-width=true]) .tabs-wrapper .tabs{padding-inline:var(--post-container-offset)}'}},[257,"post-tabs",{activeTab:[1,"active-tab"],fullWidth:[516,"full-width"],label:[513],isNavigationMode:[32],show:[64]},void 0,{label:[{validateLabel:0}]}]),c=l,d=function(){"undefined"!=typeof customElements&&["post-tabs"].forEach((t=>{"post-tabs"===t&&(customElements.get(n(t))||customElements.define(n(t),l))}))};export{c as PostTabs,d as defineCustomElement}
|
|
@@ -1,56 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { v as version } from './package.js';
|
|
3
|
-
|
|
4
|
-
const postTogglebuttonCss = ":host{cursor:pointer;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}:host(:focus-visible){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host(:focus-visible){outline-color:Highlight !important}}:host([aria-pressed=true]) ::slotted([data-showwhen=untoggled]){display:none}:host([aria-pressed=false]) ::slotted([data-showwhen=toggled]){display:none}";
|
|
5
|
-
|
|
6
|
-
const PostTogglebutton$1 = /*@__PURE__*/ proxyCustomElement(class PostTogglebutton extends HTMLElement {
|
|
7
|
-
constructor() {
|
|
8
|
-
super();
|
|
9
|
-
this.__registerHost();
|
|
10
|
-
this.__attachShadow();
|
|
11
|
-
/**
|
|
12
|
-
* If `true`, the button is in the "on" state, otherwise it is in the "off" state.
|
|
13
|
-
*/
|
|
14
|
-
this.toggled = false;
|
|
15
|
-
this.handleClick = () => {
|
|
16
|
-
this.toggled = !this.toggled;
|
|
17
|
-
};
|
|
18
|
-
this.handleKeydown = (event) => {
|
|
19
|
-
// perform a click when enter or spaced are pressed to mimic the button behavior
|
|
20
|
-
if (event.key === 'Enter' || event.key === ' ') {
|
|
21
|
-
event.preventDefault(); // prevents the page from scrolling when space is pressed
|
|
22
|
-
this.host.click();
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
componentWillLoad() {
|
|
27
|
-
// add event listener to not override listener that might be set on the host
|
|
28
|
-
this.host.addEventListener('click', () => this.handleClick());
|
|
29
|
-
this.host.addEventListener('keydown', (e) => this.handleKeydown(e));
|
|
30
|
-
}
|
|
31
|
-
render() {
|
|
32
|
-
return (h(Host, { key: 'ecd5772b09be8842e5c6fc3bf34932b27d90c533', "data-version": version, role: "button", tabindex: "0", "aria-pressed": this.toggled.toString() }, h("slot", { key: '3bb32b33155e71ced9375afb5a26d1d4e63a83c8' })));
|
|
33
|
-
}
|
|
34
|
-
get host() { return this; }
|
|
35
|
-
static get style() { return postTogglebuttonCss; }
|
|
36
|
-
}, [1, "post-togglebutton", {
|
|
37
|
-
"toggled": [1028]
|
|
38
|
-
}]);
|
|
39
|
-
function defineCustomElement$1() {
|
|
40
|
-
if (typeof customElements === "undefined") {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
const components = ["post-togglebutton"];
|
|
44
|
-
components.forEach(tagName => { switch (tagName) {
|
|
45
|
-
case "post-togglebutton":
|
|
46
|
-
if (!customElements.get(tagName)) {
|
|
47
|
-
customElements.define(tagName, PostTogglebutton$1);
|
|
48
|
-
}
|
|
49
|
-
break;
|
|
50
|
-
} });
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const PostTogglebutton = PostTogglebutton$1;
|
|
54
|
-
const defineCustomElement = defineCustomElement$1;
|
|
55
|
-
|
|
56
|
-
export { PostTogglebutton, defineCustomElement };
|
|
1
|
+
import{P as o,d as t}from"./post-togglebutton2.js";const s=o,p=t;export{s as PostTogglebutton,p as defineCustomElement}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as e,h as o,Host as s,transformTag as i}from"@stencil/core/internal/client";import{v as n}from"./package.js";const r=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.toggled=!1,this.handleClick=()=>{this.toggled=!this.toggled},this.handleKeydown=t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.host.click())}}componentWillLoad(){this.host.addEventListener("click",(()=>this.handleClick())),this.host.addEventListener("keydown",(t=>this.handleKeydown(t)))}render(){return o(s,{key:"e0708bda008257aeab8e9ad82c33c66eff4aedb6","data-version":n,role:"button",tabindex:"0","aria-pressed":this.toggled.toString()},o("slot",{key:"a10862573155edbef1a88bd8a1f9f8abf9dbe4c0"}))}get host(){return this}static get style(){return":host{cursor:pointer;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}:host(:focus-visible){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host(:focus-visible){outline-color:Highlight !important}}:host([aria-pressed=true]) ::slotted([data-showwhen=untoggled]){display:none}:host([aria-pressed=false]) ::slotted([data-showwhen=toggled]){display:none}"}},[257,"post-togglebutton",{toggled:[1028]}]);function a(){"undefined"!=typeof customElements&&["post-togglebutton"].forEach((t=>{"post-togglebutton"===t&&(customElements.get(i(t))||customElements.define(i(t),r))}))}export{r as P,a as d}
|
|
@@ -1,206 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { I as IS_BROWSER } from './breakpoints.js';
|
|
3
|
-
import { e as checkEmptyOrType } from './index2.js';
|
|
4
|
-
import { v as version } from './package.js';
|
|
5
|
-
import { i as isFocusable } from './focusable.js';
|
|
6
|
-
|
|
7
|
-
const postTooltipTriggerCss = "post-tooltip-trigger{vertical-align:top}:host{cursor:pointer}";
|
|
8
|
-
|
|
9
|
-
const TRIGGER_EVENTS = ['pointerenter', 'pointerleave', 'focusin', 'focusout', 'long-press'];
|
|
10
|
-
if (IS_BROWSER) {
|
|
11
|
-
(async () => {
|
|
12
|
-
await import('./long-press-event.js');
|
|
13
|
-
})();
|
|
14
|
-
}
|
|
15
|
-
const PostTooltipTrigger$1 = /*@__PURE__*/ proxyCustomElement(class PostTooltipTrigger extends HTMLElement {
|
|
16
|
-
constructor() {
|
|
17
|
-
super();
|
|
18
|
-
this.__registerHost();
|
|
19
|
-
this.__attachShadow();
|
|
20
|
-
/**
|
|
21
|
-
* Delay (in milliseconds) before the tooltip is shown.
|
|
22
|
-
*/
|
|
23
|
-
this.delay = 0;
|
|
24
|
-
/**
|
|
25
|
-
* Reference to the element inside the host that will act as the trigger.
|
|
26
|
-
*/
|
|
27
|
-
this.trigger = null;
|
|
28
|
-
/**
|
|
29
|
-
* Timeout ID for the delay.
|
|
30
|
-
*/
|
|
31
|
-
this.delayTimeout = null;
|
|
32
|
-
this.boundTriggerHandler = this.handleTriggerEvent.bind(this);
|
|
33
|
-
this.boundTooltipHandler = this.handleTooltipEvent.bind(this);
|
|
34
|
-
}
|
|
35
|
-
validateControlFor() {
|
|
36
|
-
checkEmptyOrType(this, 'for', 'string');
|
|
37
|
-
}
|
|
38
|
-
get tooltip() {
|
|
39
|
-
if (!IS_BROWSER)
|
|
40
|
-
return null;
|
|
41
|
-
const ref = document.getElementById(this.for);
|
|
42
|
-
return ref?.localName === 'post-tooltip' ? ref : null;
|
|
43
|
-
}
|
|
44
|
-
componentDidLoad() {
|
|
45
|
-
this.setupTrigger();
|
|
46
|
-
this.attachListeners();
|
|
47
|
-
this.attachTooltipListeners();
|
|
48
|
-
}
|
|
49
|
-
disconnectedCallback() {
|
|
50
|
-
this.removeListeners();
|
|
51
|
-
this.removeTooltipListeners();
|
|
52
|
-
this.cleanupTrigger();
|
|
53
|
-
if (this.delayTimeout) {
|
|
54
|
-
clearTimeout(this.delayTimeout);
|
|
55
|
-
this.delayTimeout = null;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
handleSlotChange() {
|
|
59
|
-
this.cleanupTrigger();
|
|
60
|
-
this.setupTrigger();
|
|
61
|
-
}
|
|
62
|
-
cleanupTrigger() {
|
|
63
|
-
if (this.trigger) {
|
|
64
|
-
const describedBy = this.trigger.getAttribute('aria-describedby') || '';
|
|
65
|
-
if (describedBy.includes(this.for)) {
|
|
66
|
-
const newDescribedBy = describedBy
|
|
67
|
-
.split(' ')
|
|
68
|
-
.filter(id => id !== this.for)
|
|
69
|
-
.join(' ');
|
|
70
|
-
if (newDescribedBy) {
|
|
71
|
-
this.trigger.setAttribute('aria-describedby', newDescribedBy);
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
this.trigger.removeAttribute('aria-describedby');
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
this.trigger = null;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
setupTrigger() {
|
|
81
|
-
this.trigger = this.host.querySelector('*');
|
|
82
|
-
if (this.trigger) {
|
|
83
|
-
if (!isFocusable(this.trigger)) {
|
|
84
|
-
this.trigger.setAttribute('tabindex', '0');
|
|
85
|
-
}
|
|
86
|
-
const describedBy = this.trigger.getAttribute('aria-describedby') || '';
|
|
87
|
-
if (!describedBy.includes(this.for)) {
|
|
88
|
-
this.trigger.setAttribute('aria-describedby', `${describedBy} ${this.for}`.trim());
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
console.warn('No content found in the post-tooltip-trigger slot. Please insert a focusable element or content that can receive focus.');
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
attachListeners() {
|
|
96
|
-
TRIGGER_EVENTS.forEach(event => {
|
|
97
|
-
this.host.addEventListener(event, this.boundTriggerHandler);
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
removeListeners() {
|
|
101
|
-
TRIGGER_EVENTS.forEach(event => {
|
|
102
|
-
this.host.removeEventListener(event, this.boundTriggerHandler);
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
attachTooltipListeners() {
|
|
106
|
-
if (this.tooltip) {
|
|
107
|
-
this.tooltip.addEventListener('pointerenter', this.boundTooltipHandler);
|
|
108
|
-
this.tooltip.addEventListener('pointerleave', this.boundTooltipHandler);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
removeTooltipListeners() {
|
|
112
|
-
if (this.tooltip) {
|
|
113
|
-
this.tooltip.removeEventListener('pointerenter', this.boundTooltipHandler);
|
|
114
|
-
this.tooltip.removeEventListener('pointerleave', this.boundTooltipHandler);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
handleTriggerEvent(event) {
|
|
118
|
-
switch (event.type) {
|
|
119
|
-
case 'pointerenter':
|
|
120
|
-
case 'focusin':
|
|
121
|
-
case 'long-press':
|
|
122
|
-
this.handleEnter();
|
|
123
|
-
break;
|
|
124
|
-
case 'pointerleave':
|
|
125
|
-
case 'focusout':
|
|
126
|
-
this.handleLeave(event);
|
|
127
|
-
break;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
handleTooltipEvent(event) {
|
|
131
|
-
switch (event.type) {
|
|
132
|
-
case 'pointerenter':
|
|
133
|
-
this.handleEnter();
|
|
134
|
-
break;
|
|
135
|
-
case 'pointerleave':
|
|
136
|
-
this.handleLeave(event);
|
|
137
|
-
break;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
handleEnter() {
|
|
141
|
-
if (this.delayTimeout) {
|
|
142
|
-
clearTimeout(this.delayTimeout);
|
|
143
|
-
this.delayTimeout = null;
|
|
144
|
-
}
|
|
145
|
-
this.interestHandler();
|
|
146
|
-
}
|
|
147
|
-
handleLeave(event) {
|
|
148
|
-
const newTarget = event.relatedTarget;
|
|
149
|
-
if ((this.tooltip && newTarget && this.tooltip.contains(newTarget)) ||
|
|
150
|
-
newTarget === this.trigger) {
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
this.interestLostHandler();
|
|
154
|
-
}
|
|
155
|
-
interestHandler() {
|
|
156
|
-
if (this.trigger) {
|
|
157
|
-
if (this.delay > 0) {
|
|
158
|
-
this.delayTimeout = window.setTimeout(() => {
|
|
159
|
-
this.tooltip?.show(this.trigger);
|
|
160
|
-
this.delayTimeout = null;
|
|
161
|
-
}, this.delay);
|
|
162
|
-
}
|
|
163
|
-
else {
|
|
164
|
-
this.tooltip?.show(this.trigger);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
interestLostHandler() {
|
|
169
|
-
if (this.delayTimeout) {
|
|
170
|
-
clearTimeout(this.delayTimeout);
|
|
171
|
-
this.delayTimeout = null;
|
|
172
|
-
}
|
|
173
|
-
this.tooltip?.hide();
|
|
174
|
-
}
|
|
175
|
-
render() {
|
|
176
|
-
return (h(Host, { key: '48246523aabaf1851e05d0273346d3e26e7ad866', "data-version": version }, h("slot", { key: '0442aeadddd59642c317b6f10c93008adf3e6585', onSlotchange: () => this.handleSlotChange() })));
|
|
177
|
-
}
|
|
178
|
-
get host() { return this; }
|
|
179
|
-
static get watchers() { return {
|
|
180
|
-
"for": ["validateControlFor"]
|
|
181
|
-
}; }
|
|
182
|
-
static get style() { return postTooltipTriggerCss; }
|
|
183
|
-
}, [1, "post-tooltip-trigger", {
|
|
184
|
-
"for": [513],
|
|
185
|
-
"delay": [2]
|
|
186
|
-
}, undefined, {
|
|
187
|
-
"for": ["validateControlFor"]
|
|
188
|
-
}]);
|
|
189
|
-
function defineCustomElement$1() {
|
|
190
|
-
if (typeof customElements === "undefined") {
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
193
|
-
const components = ["post-tooltip-trigger"];
|
|
194
|
-
components.forEach(tagName => { switch (tagName) {
|
|
195
|
-
case "post-tooltip-trigger":
|
|
196
|
-
if (!customElements.get(tagName)) {
|
|
197
|
-
customElements.define(tagName, PostTooltipTrigger$1);
|
|
198
|
-
}
|
|
199
|
-
break;
|
|
200
|
-
} });
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
const PostTooltipTrigger = PostTooltipTrigger$1;
|
|
204
|
-
const defineCustomElement = defineCustomElement$1;
|
|
205
|
-
|
|
206
|
-
export { PostTooltipTrigger, defineCustomElement };
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as e,h as s,Host as i,transformTag as o}from"@stencil/core/internal/client";import{I as r}from"./environment.js";import{e as n}from"./breakpoints.js";import{v as h}from"./package.js";import{i as a}from"./focusable.js";const l=["pointerenter","pointerleave","focusin","focusout","long-press"];r&&(async()=>{await import("./long-press-event.js")})();const c=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.delay=0,this.trigger=null,this.delayTimeout=null,this.boundTriggerHandler=this.handleTriggerEvent.bind(this),this.boundTooltipHandler=this.handleTooltipEvent.bind(this)}validateControlFor(){n(this,"for","string")}get tooltip(){if(!r)return null;const t=document.getElementById(this.for);return"post-tooltip"===t?.localName?t:null}componentDidLoad(){this.setupTrigger(),this.attachListeners(),this.attachTooltipListeners()}disconnectedCallback(){this.removeListeners(),this.removeTooltipListeners(),this.cleanupTrigger(),this.delayTimeout&&(clearTimeout(this.delayTimeout),this.delayTimeout=null)}handleSlotChange(){this.cleanupTrigger(),this.setupTrigger()}cleanupTrigger(){if(this.trigger){const t=this.trigger.getAttribute("aria-describedby")||"";if(t.includes(this.for)){const e=t.split(" ").filter((t=>t!==this.for)).join(" ");e?this.trigger.setAttribute("aria-describedby",e):this.trigger.removeAttribute("aria-describedby")}this.trigger=null}}setupTrigger(){if(this.trigger=this.host.querySelector("*"),this.trigger){a(this.trigger)||this.trigger.setAttribute("tabindex","0");const t=this.trigger.getAttribute("aria-describedby")||"";t.includes(this.for)||this.trigger.setAttribute("aria-describedby",`${t} ${this.for}`.trim())}else console.warn("No content found in the post-tooltip-trigger slot. Please insert a focusable element or content that can receive focus.")}attachListeners(){l.forEach((t=>{this.host.addEventListener(t,this.boundTriggerHandler)}))}removeListeners(){l.forEach((t=>{this.host.removeEventListener(t,this.boundTriggerHandler)}))}attachTooltipListeners(){this.tooltip&&(this.tooltip.addEventListener("pointerenter",this.boundTooltipHandler),this.tooltip.addEventListener("pointerleave",this.boundTooltipHandler))}removeTooltipListeners(){this.tooltip&&(this.tooltip.removeEventListener("pointerenter",this.boundTooltipHandler),this.tooltip.removeEventListener("pointerleave",this.boundTooltipHandler))}handleTriggerEvent(t){switch(t.type){case"pointerenter":case"focusin":case"long-press":this.handleEnter();break;case"pointerleave":case"focusout":this.handleLeave(t)}}handleTooltipEvent(t){switch(t.type){case"pointerenter":this.handleEnter();break;case"pointerleave":this.handleLeave(t)}}handleEnter(){this.delayTimeout&&(clearTimeout(this.delayTimeout),this.delayTimeout=null),this.interestHandler()}handleLeave(t){const e=t.relatedTarget;this.tooltip&&e&&this.tooltip.contains(e)||e===this.trigger||this.interestLostHandler()}interestHandler(){this.trigger&&(this.delay>0?this.delayTimeout=window.setTimeout((()=>{this.tooltip?.show(this.trigger),this.delayTimeout=null}),this.delay):this.tooltip?.show(this.trigger))}interestLostHandler(){this.delayTimeout&&(clearTimeout(this.delayTimeout),this.delayTimeout=null),this.tooltip?.hide()}render(){return s(i,{key:"4f6165e23284794b677748c495401ed7c110d134","data-version":h},s("slot",{key:"87a8d412ed0e3fb145853aebb9426dfe13677853",onSlotchange:()=>this.handleSlotChange()}))}get host(){return this}static get watchers(){return{for:[{validateControlFor:0}]}}static get style(){return"post-tooltip-trigger{vertical-align:top}:host{cursor:pointer}"}},[257,"post-tooltip-trigger",{for:[513],delay:[2]},void 0,{for:[{validateControlFor:0}]}]),p=c,d=function(){"undefined"!=typeof customElements&&["post-tooltip-trigger"].forEach((t=>{"post-tooltip-trigger"===t&&(customElements.get(o(t))||customElements.define(o(t),c))}))};export{p as PostTooltipTrigger,d as defineCustomElement}
|
|
@@ -1,114 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { v as version } from './package.js';
|
|
3
|
-
import { d as checkEmptyOrOneOf } from './index2.js';
|
|
4
|
-
import './breakpoints.js';
|
|
5
|
-
import { a as PLACEMENT_TYPES, d as defineCustomElement$2 } from './post-popovercontainer2.js';
|
|
6
|
-
|
|
7
|
-
const postTooltipCss = ":host{display:none}:host([open]){display:contents}post-popovercontainer[arrow]::after{position:absolute;content:\"\";inset:-13px;z-index:-1}post-popovercontainer>div{color:var(--post-current-fg);background-color:var(--post-current-bg);padding:var(--post-core-dimension-4) var(--post-core-dimension-8);max-width:var(--post-tooltip-max-width, 280px);width:inherit;min-height:32px;word-wrap:break-word;white-space:normal}";
|
|
8
|
-
|
|
9
|
-
const PostTooltip$1 = /*@__PURE__*/ proxyCustomElement(class PostTooltip extends HTMLElement {
|
|
10
|
-
constructor() {
|
|
11
|
-
super();
|
|
12
|
-
this.__registerHost();
|
|
13
|
-
this.__attachShadow();
|
|
14
|
-
/**
|
|
15
|
-
* Defines the position of the tooltip relative to its trigger.
|
|
16
|
-
* Tooltips are automatically flipped to the opposite side if there is not enough available space and are shifted towards the viewport if they would overlap edge boundaries.
|
|
17
|
-
* For supported values and behavior details, see the [Floating UI placement documentation](https://floating-ui.com/docs/computePosition#placement).
|
|
18
|
-
*/
|
|
19
|
-
this.placement = 'top';
|
|
20
|
-
/**
|
|
21
|
-
* Whether or not to display a little pointer arrow
|
|
22
|
-
*/
|
|
23
|
-
this.arrow = false;
|
|
24
|
-
/**
|
|
25
|
-
* Indicates the open state of the tooltip
|
|
26
|
-
*/
|
|
27
|
-
this.open = false;
|
|
28
|
-
}
|
|
29
|
-
validatePlacement() {
|
|
30
|
-
checkEmptyOrOneOf(this, 'placement', PLACEMENT_TYPES);
|
|
31
|
-
}
|
|
32
|
-
componentWillLoad() {
|
|
33
|
-
this.validatePlacement();
|
|
34
|
-
}
|
|
35
|
-
componentDidLoad() {
|
|
36
|
-
if (!this.host.id) {
|
|
37
|
-
console.error(
|
|
38
|
-
/*prettier-ignore*/
|
|
39
|
-
'No id set: <post-tooltip> must have an id, linking it to it\'s target element with a <post-tooltip-trigger> element.');
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Programmatically display the tooltip.
|
|
44
|
-
* @param target An element where the tooltip should be shown
|
|
45
|
-
*/
|
|
46
|
-
async show(target) {
|
|
47
|
-
if (this.open)
|
|
48
|
-
return;
|
|
49
|
-
this.popoverRef.show(target);
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Programmatically hide this tooltip.
|
|
53
|
-
*/
|
|
54
|
-
async hide() {
|
|
55
|
-
this.popoverRef.hide();
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Toggle tooltip display.
|
|
59
|
-
* @param target An element where the tooltip should be shown
|
|
60
|
-
* @param [force] Pass true to always show or false to always hide
|
|
61
|
-
*/
|
|
62
|
-
async toggle(target, force) {
|
|
63
|
-
this.popoverRef.toggle(target, force);
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Set the open state based on the toggle event.
|
|
67
|
-
* @param e Popovercontainer toggle event
|
|
68
|
-
*/
|
|
69
|
-
handleToggle(e) {
|
|
70
|
-
this.open = e.detail.isOpen;
|
|
71
|
-
}
|
|
72
|
-
render() {
|
|
73
|
-
const popoverClass = `${this.arrow ? 'has-arrow' : ''}`;
|
|
74
|
-
return (h(Host, { key: 'ebc25bd8a9615a13be82d58f246b5a5d42113cf2', "data-version": version }, h("post-popovercontainer", { key: 'dba7a96c1f354752475a6f1d9116b0097dddf320', safeSpace: "trapezoid", class: popoverClass, role: "tooltip", arrow: this.arrow, animation: this.animation, placement: this.placement, onPostToggle: e => this.handleToggle(e), ref: (el) => (this.popoverRef = el) }, h("slot", { key: '537370b88912d323a72ee074767b4cf2b4bc1b57' }))));
|
|
75
|
-
}
|
|
76
|
-
get host() { return this; }
|
|
77
|
-
static get watchers() { return {
|
|
78
|
-
"placement": ["validatePlacement"]
|
|
79
|
-
}; }
|
|
80
|
-
static get style() { return postTooltipCss; }
|
|
81
|
-
}, [1, "post-tooltip", {
|
|
82
|
-
"placement": [1],
|
|
83
|
-
"arrow": [4],
|
|
84
|
-
"animation": [1],
|
|
85
|
-
"open": [1540],
|
|
86
|
-
"show": [64],
|
|
87
|
-
"hide": [64],
|
|
88
|
-
"toggle": [64]
|
|
89
|
-
}, undefined, {
|
|
90
|
-
"placement": ["validatePlacement"]
|
|
91
|
-
}]);
|
|
92
|
-
function defineCustomElement$1() {
|
|
93
|
-
if (typeof customElements === "undefined") {
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
const components = ["post-tooltip", "post-popovercontainer"];
|
|
97
|
-
components.forEach(tagName => { switch (tagName) {
|
|
98
|
-
case "post-tooltip":
|
|
99
|
-
if (!customElements.get(tagName)) {
|
|
100
|
-
customElements.define(tagName, PostTooltip$1);
|
|
101
|
-
}
|
|
102
|
-
break;
|
|
103
|
-
case "post-popovercontainer":
|
|
104
|
-
if (!customElements.get(tagName)) {
|
|
105
|
-
defineCustomElement$2();
|
|
106
|
-
}
|
|
107
|
-
break;
|
|
108
|
-
} });
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
const PostTooltip = PostTooltip$1;
|
|
112
|
-
const defineCustomElement = defineCustomElement$1;
|
|
113
|
-
|
|
114
|
-
export { PostTooltip, defineCustomElement };
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as e,h as o,Host as s,transformTag as i}from"@stencil/core/internal/client";import{v as a}from"./package.js";import{d as n}from"./breakpoints.js";import{a as r,d as p}from"./post-popovercontainer2.js";const c=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.placement="top",this.arrow=!1,this.open=!1}validatePlacement(){n(this,"placement",r)}componentWillLoad(){this.validatePlacement()}componentDidLoad(){this.host.id||console.error("No id set: <post-tooltip> must have an id, linking it to it's target element with a <post-tooltip-trigger> element.")}async show(t){this.open||await this.popoverRef.show(t)}async hide(){this.popoverRef.hide()}async toggle(t,e){this.popoverRef.toggle(t,e)}handleBeforeToggle(t){this.open=t.detail.willOpen}render(){return o(s,{key:"5de53c10c2556ddb974a65ba06e27ccc99311762","data-version":a},o("post-popovercontainer",{key:"ae3a26fc69d983884eb5aee2b024e74d91983c73",safeSpace:"trapezoid",class:this.arrow?"has-arrow":"",role:"tooltip",arrow:this.arrow,placement:this.placement,onPostBeforeToggle:t=>this.handleBeforeToggle(t),ref:t=>this.popoverRef=t},o("slot",{key:"1fd537504554e094894f8549de5c29c515322866"})))}get host(){return this}static get watchers(){return{placement:[{validatePlacement:0}]}}static get style(){return':host{display:none}:host([open]){display:contents}post-popovercontainer[arrow]::after{position:absolute;content:"";inset:-13px;z-index:-1}post-popovercontainer>div{color:var(--post-current-fg);background-color:var(--post-current-bg);padding:var(--post-core-dimension-4) var(--post-core-dimension-8);max-width:var(--post-tooltip-max-width, 280px);width:inherit;min-height:32px;word-wrap:break-word;white-space:normal}'}},[257,"post-tooltip",{placement:[1],arrow:[4],open:[1540],show:[64],hide:[64],toggle:[64]},void 0,{placement:[{validatePlacement:0}]}]),l=c,d=function(){"undefined"!=typeof customElements&&["post-tooltip","post-popovercontainer"].forEach((t=>{switch(t){case"post-tooltip":customElements.get(i(t))||customElements.define(i(t),c);break;case"post-popovercontainer":customElements.get(i(t))||p()}}))};export{l as PostTooltip,d as defineCustomElement}
|
|
@@ -31,3 +31,5 @@ export interface SetPlatformOptions {
|
|
|
31
31
|
rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
32
32
|
}
|
|
33
33
|
export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
|
|
34
|
+
|
|
35
|
+
export * from '../../types';
|