@swisspost/design-system-components 10.0.0-next.72 → 10.0.0-next.76
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/cjs/{create-validator-decorator-Bnx17kwi.js → create-validator-decorator-4dRrOF30.js} +1 -1
- package/dist/cjs/{index-ngUOBQot.js → index-BqngpwGa.js} +56 -15
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{one-of-BHyX4vYq.js → one-of-D1veqtsm.js} +1 -1
- package/dist/cjs/{package-Bi-tiNRc.js → package-B0PdQ0Dm.js} +1 -1
- package/dist/cjs/{pattern-BgBx5zGQ.js → pattern-B7VKOu5m.js} +1 -1
- package/dist/cjs/post-accordion_2.cjs.entry.js +10 -12
- package/dist/cjs/post-autocomplete.cjs.entry.js +6 -6
- package/dist/cjs/post-avatar.cjs.entry.js +7 -7
- package/dist/cjs/post-back-to-top.cjs.entry.js +6 -6
- package/dist/cjs/post-banner.cjs.entry.js +6 -6
- package/dist/cjs/post-breadcrumb-item.cjs.entry.js +8 -8
- package/dist/cjs/post-breadcrumbs.cjs.entry.js +9 -11
- package/dist/cjs/post-closebutton_14.cjs.entry.js +86 -62
- package/dist/cjs/post-collapsible_2.cjs.entry.js +6 -6
- package/dist/cjs/post-components.cjs.js +2 -2
- package/dist/cjs/post-date-picker.cjs.entry.js +427 -257
- package/dist/cjs/post-footer.cjs.entry.js +6 -6
- package/dist/cjs/post-linkarea.cjs.entry.js +3 -3
- package/dist/cjs/post-listbox-option.cjs.entry.js +4 -4
- package/dist/cjs/post-listbox.cjs.entry.js +3 -3
- package/dist/cjs/post-number-input.cjs.entry.js +6 -5
- package/dist/cjs/post-pagination.cjs.entry.js +15 -10
- package/dist/cjs/post-popover-trigger.cjs.entry.js +5 -5
- package/dist/cjs/post-popover.cjs.entry.js +11 -12
- package/dist/cjs/post-progressbar.cjs.entry.js +4 -4
- package/dist/cjs/post-rating.cjs.entry.js +6 -6
- package/dist/cjs/post-side-navigation-trigger.cjs.entry.js +109 -0
- package/dist/cjs/post-side-navigation.cjs.entry.js +140 -0
- package/dist/cjs/post-stepper-item.cjs.entry.js +4 -4
- package/dist/cjs/post-stepper.cjs.entry.js +9 -7
- package/dist/cjs/post-tab-item.cjs.entry.js +15 -14
- package/dist/cjs/post-tab-panel.cjs.entry.js +6 -6
- package/dist/cjs/post-tabs.cjs.entry.js +196 -74
- package/dist/cjs/post-tooltip-trigger.cjs.entry.js +7 -9
- package/dist/cjs/post-tooltip.cjs.entry.js +9 -10
- package/dist/cjs/{required-lRDOdbd6.js → required-Bkz8MOYa.js} +1 -1
- package/dist/cjs/{type-shT641Eo.js → type-D8eD1JMd.js} +1 -1
- package/dist/cjs/{url-DRUMqVBq.js → url-C7MnIIZ_.js} +1 -1
- package/dist/collection/collection-manifest.json +3 -2
- package/dist/collection/components/post-accordion/post-accordion.js +1 -1
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +4 -36
- package/dist/collection/components/post-autocomplete/post-autocomplete.js +1 -1
- package/dist/collection/components/post-avatar/post-avatar.js +1 -1
- package/dist/collection/components/post-back-to-top/post-back-to-top.js +1 -1
- package/dist/collection/components/post-banner/post-banner.css +2 -2
- package/dist/collection/components/post-banner/post-banner.js +1 -1
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.css +1 -1
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.css +1 -1
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.js +2 -4
- package/dist/collection/components/post-closebutton/post-closebutton.css +1 -1
- package/dist/collection/components/post-closebutton/post-closebutton.js +22 -11
- package/dist/collection/components/post-closebutton/types.js +1 -1
- package/dist/collection/components/post-collapsible/post-collapsible.js +1 -1
- package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +1 -1
- package/dist/collection/components/post-date-picker/accessibility-utils.js +59 -0
- package/dist/collection/components/post-date-picker/date-utils.js +102 -0
- package/dist/collection/components/post-date-picker/native-mask-element.js +36 -0
- package/dist/collection/components/post-date-picker/post-date-picker.css +1 -1
- package/dist/collection/components/post-date-picker/post-date-picker.js +224 -301
- package/dist/collection/components/post-footer/post-footer.js +1 -1
- package/dist/collection/components/post-header/post-header.css +1 -1
- package/dist/collection/components/post-header/post-header.js +13 -11
- package/dist/collection/components/post-icon/post-icon.js +1 -1
- package/dist/collection/components/post-language-menu/post-language-menu.css +1 -1
- package/dist/collection/components/post-language-menu/post-language-menu.js +7 -5
- package/dist/collection/components/post-language-menu-item/post-language-menu-item.css +1 -1
- package/dist/collection/components/post-linkarea/post-linkarea.js +1 -1
- package/dist/collection/components/post-listbox/post-listbox.js +1 -1
- package/dist/collection/components/post-listbox-option/post-listbox-option.js +2 -2
- package/dist/collection/components/post-logo/post-logo.js +1 -1
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +1 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.js +1 -1
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.css +1 -1
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +1 -1
- package/dist/collection/components/post-menu/post-menu.css +1 -1
- package/dist/collection/components/post-menu/post-menu.js +9 -12
- package/dist/collection/components/post-menu-item/post-menu-item.css +1 -1
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +1 -1
- package/dist/collection/components/post-number-input/post-number-input.css +1 -1
- package/dist/collection/components/post-number-input/post-number-input.js +3 -2
- package/dist/collection/components/post-pagination/post-pagination.css +1 -1
- package/dist/collection/components/post-pagination/post-pagination.js +11 -5
- package/dist/collection/components/post-popover/post-popover.js +12 -22
- package/dist/collection/components/post-popover-trigger/post-popover-trigger.js +1 -1
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -1
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +17 -12
- package/dist/collection/components/post-progressbar/post-progressbar.js +1 -1
- package/dist/collection/components/post-rating/post-rating.js +1 -1
- package/dist/collection/components/post-side-navigation/post-side-navigation.css +1 -0
- package/dist/collection/components/post-side-navigation/post-side-navigation.js +267 -0
- package/dist/collection/components/post-side-navigation/side-navigation-styles.js +1 -0
- package/dist/collection/components/post-side-navigation-trigger/post-side-navigation-trigger.css +1 -0
- package/dist/collection/components/post-side-navigation-trigger/post-side-navigation-trigger.js +154 -0
- package/dist/collection/components/post-stepper/post-stepper.js +3 -1
- package/dist/collection/components/post-stepper-item/post-stepper-item.css +1 -1
- package/dist/collection/components/post-stepper-item/post-stepper-item.js +1 -1
- package/dist/collection/components/post-tab-item/post-tab-item.js +36 -19
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +3 -2
- package/dist/collection/components/post-tabs/post-tabs.css +1 -1
- package/dist/collection/components/post-tabs/post-tabs.js +255 -84
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +1 -1
- package/dist/collection/components/post-tooltip/post-tooltip.js +12 -22
- package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +2 -4
- package/dist/collection/types/element-api.js +3 -0
- package/dist/component-names.json +2 -1
- package/dist/components/index.d.ts +4 -2
- package/dist/components/index.js +1 -1
- package/dist/components/package.js +1 -1
- package/dist/components/post-accordion-item2.js +1 -1
- package/dist/components/post-accordion2.js +1 -1
- package/dist/components/post-autocomplete.js +1 -1
- package/dist/components/post-avatar.js +1 -1
- package/dist/components/post-back-to-top.js +1 -1
- package/dist/components/post-banner.js +1 -1
- package/dist/components/post-breadcrumb-item.js +1 -1
- package/dist/components/post-breadcrumbs.js +1 -1
- package/dist/components/post-closebutton2.js +1 -1
- package/dist/components/post-collapsible-trigger2.js +1 -1
- package/dist/components/post-collapsible2.js +1 -1
- package/dist/components/post-date-picker.js +1 -1
- package/dist/components/post-footer.js +1 -1
- package/dist/components/post-header.js +1 -1
- package/dist/components/post-icon2.js +1 -1
- package/dist/components/post-language-menu-item.js +1 -1
- package/dist/components/post-language-menu.js +1 -1
- package/dist/components/post-linkarea.js +1 -1
- package/dist/components/post-listbox-option.js +1 -1
- package/dist/components/post-listbox.js +1 -1
- package/dist/components/post-logo.js +1 -1
- package/dist/components/post-mainnavigation.js +1 -1
- package/dist/components/post-megadropdown-trigger.js +1 -1
- package/dist/components/post-megadropdown.js +1 -1
- package/dist/components/post-menu-item2.js +1 -1
- package/dist/components/post-menu-trigger2.js +1 -1
- package/dist/components/post-menu2.js +1 -1
- package/dist/components/post-number-input.js +1 -1
- package/dist/components/post-pagination.js +1 -1
- package/dist/components/post-popover-trigger.js +1 -1
- package/dist/components/post-popover.js +1 -1
- package/dist/components/post-popovercontainer2.js +1 -1
- package/dist/components/post-progressbar.js +1 -1
- package/dist/components/post-rating.js +1 -1
- package/dist/components/post-side-navigation-trigger.d.ts +11 -0
- package/dist/components/post-side-navigation-trigger.js +1 -0
- package/dist/components/{post-login-widget.d.ts → post-side-navigation.d.ts} +4 -4
- package/dist/components/post-side-navigation.js +1 -0
- package/dist/components/post-stepper-item.js +1 -1
- package/dist/components/post-stepper.js +1 -1
- package/dist/components/post-tab-item.js +1 -1
- package/dist/components/post-tab-panel.js +1 -1
- package/dist/components/post-tabs.js +1 -1
- package/dist/components/post-togglebutton2.js +1 -1
- package/dist/components/post-tooltip-trigger.js +1 -1
- package/dist/components/post-tooltip.js +1 -1
- package/dist/components/react/index.js +1 -1
- package/dist/components/react/{p-Bu2JeHDf.js → p-06VKKzxv.js} +1 -1
- package/dist/components/react/p-BkWqx_6U.js +1 -0
- package/dist/components/react/p-Chtl9X7o.js +1 -0
- package/dist/components/react/p-CrLBbthi.js +1 -0
- package/dist/components/react/{p-D1zw8FxT.js → p-D0kuUny7.js} +1 -1
- package/dist/components/react/{p-PM7l--ff.js → p-DKF__bJF.js} +1 -1
- package/dist/components/react/p-DkKOmXaG.js +1 -0
- package/dist/components/react/p-UdMqVxhd.js +1 -0
- package/dist/components/react/p-d02KpeUM.js +1 -0
- package/dist/components/react/{p-BZSAV0-K.js → p-gUhGka9h.js} +1 -1
- package/dist/components/react/{p-Cd1TsNm7.js → p-uQE3DVb8.js} +1 -1
- package/dist/components/react/{p-BxoRVIIr.js → p-wLn52OZT.js} +1 -1
- package/dist/components/react/post-accordion-item.js +1 -1
- package/dist/components/react/post-accordion.js +1 -1
- package/dist/components/react/post-autocomplete.js +1 -1
- package/dist/components/react/post-avatar.js +1 -1
- package/dist/components/react/post-back-to-top.js +1 -1
- package/dist/components/react/post-banner.js +1 -1
- package/dist/components/react/post-breadcrumb-item.js +1 -1
- package/dist/components/react/post-breadcrumbs.js +1 -1
- package/dist/components/react/post-closebutton.js +1 -1
- package/dist/components/react/post-collapsible-trigger.js +1 -1
- package/dist/components/react/post-collapsible.js +1 -1
- package/dist/components/react/post-date-picker.js +1 -1
- package/dist/components/react/post-footer.js +1 -1
- package/dist/components/react/post-header.js +1 -1
- package/dist/components/react/post-icon.js +1 -1
- package/dist/components/react/post-language-menu-item.js +1 -1
- package/dist/components/react/post-language-menu.js +1 -1
- package/dist/components/react/post-linkarea.js +1 -1
- package/dist/components/react/post-listbox-option.js +1 -1
- package/dist/components/react/post-listbox.js +1 -1
- package/dist/components/react/post-logo.js +1 -1
- package/dist/components/react/post-mainnavigation.js +1 -1
- package/dist/components/react/post-megadropdown-trigger.js +1 -1
- package/dist/components/react/post-megadropdown.js +1 -1
- package/dist/components/react/post-menu-item.js +1 -1
- package/dist/components/react/post-menu-trigger.js +1 -1
- package/dist/components/react/post-menu.js +1 -1
- package/dist/components/react/post-number-input.js +1 -1
- package/dist/components/react/post-pagination.js +1 -1
- package/dist/components/react/post-popover-trigger.js +1 -1
- package/dist/components/react/post-popover.js +1 -1
- package/dist/components/react/post-popovercontainer.js +1 -1
- package/dist/components/react/post-progressbar.js +1 -1
- package/dist/components/react/post-rating.js +1 -1
- package/dist/components/react/post-side-navigation-trigger.d.ts +11 -0
- package/dist/components/react/post-side-navigation-trigger.js +1 -0
- package/dist/components/react/{post-login-widget.d.ts → post-side-navigation.d.ts} +4 -4
- package/dist/components/react/post-side-navigation.js +1 -0
- package/dist/components/react/post-stepper-item.js +1 -1
- package/dist/components/react/post-stepper.js +1 -1
- package/dist/components/react/post-tab-item.js +1 -1
- package/dist/components/react/post-tab-panel.js +1 -1
- package/dist/components/react/post-tabs.js +1 -1
- package/dist/components/react/post-togglebutton.js +1 -1
- package/dist/components/react/post-tooltip-trigger.js +1 -1
- package/dist/components/react/post-tooltip.js +1 -1
- package/dist/docs.json +571 -529
- package/dist/esm/{create-validator-decorator-D8qwF5Qe.js → create-validator-decorator-CYYTw0AS.js} +1 -1
- package/dist/esm/{index-BbDawWJ5.js → index-DE1aWdqx.js} +56 -15
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{one-of-GPr3FflU.js → one-of-Ug1_Xoes.js} +1 -1
- package/dist/esm/package-d02KpeUM.js +3 -0
- package/dist/esm/{pattern-BWPRYpYv.js → pattern-WLk4tOqI.js} +1 -1
- package/dist/esm/post-accordion_2.entry.js +10 -12
- package/dist/esm/post-autocomplete.entry.js +6 -6
- package/dist/esm/post-avatar.entry.js +7 -7
- package/dist/esm/post-back-to-top.entry.js +6 -6
- package/dist/esm/post-banner.entry.js +6 -6
- package/dist/esm/post-breadcrumb-item.entry.js +8 -8
- package/dist/esm/post-breadcrumbs.entry.js +9 -11
- package/dist/esm/post-closebutton_14.entry.js +86 -62
- package/dist/esm/post-collapsible_2.entry.js +6 -6
- package/dist/esm/post-components.js +3 -3
- package/dist/esm/post-date-picker.entry.js +427 -257
- package/dist/esm/post-footer.entry.js +6 -6
- package/dist/esm/post-linkarea.entry.js +3 -3
- package/dist/esm/post-listbox-option.entry.js +4 -4
- package/dist/esm/post-listbox.entry.js +3 -3
- package/dist/esm/post-number-input.entry.js +6 -5
- package/dist/esm/post-pagination.entry.js +15 -10
- package/dist/esm/post-popover-trigger.entry.js +5 -5
- package/dist/esm/post-popover.entry.js +11 -12
- package/dist/esm/post-progressbar.entry.js +4 -4
- package/dist/esm/post-rating.entry.js +6 -6
- package/dist/esm/post-side-navigation-trigger.entry.js +107 -0
- package/dist/esm/post-side-navigation.entry.js +138 -0
- package/dist/esm/post-stepper-item.entry.js +4 -4
- package/dist/esm/post-stepper.entry.js +9 -7
- package/dist/esm/post-tab-item.entry.js +15 -14
- package/dist/esm/post-tab-panel.entry.js +6 -6
- package/dist/esm/post-tabs.entry.js +196 -74
- package/dist/esm/post-tooltip-trigger.entry.js +7 -9
- package/dist/esm/post-tooltip.entry.js +9 -10
- package/dist/esm/{required-uK-rZZjy.js → required-DeOhRbtk.js} +1 -1
- package/dist/esm/{type-obmwEgkM.js → type-S-4aPMGU.js} +1 -1
- package/dist/esm/{url-B28ByZCe.js → url-C8KSrmWc.js} +1 -1
- package/dist/post-components/{p-12047216.entry.js → p-0efb77f9.entry.js} +1 -1
- package/dist/post-components/p-1223e51d.entry.js +1 -0
- package/dist/post-components/{p-3b05e01d.entry.js → p-1878e9f8.entry.js} +1 -1
- package/dist/post-components/p-1eea2715.entry.js +1 -0
- package/dist/post-components/p-2233c37e.entry.js +1 -0
- package/dist/post-components/p-266e68a3.entry.js +1 -0
- package/dist/post-components/{p-00f55af5.entry.js → p-2a0b9ed0.entry.js} +1 -1
- package/dist/post-components/p-3c71d687.entry.js +1 -0
- package/dist/post-components/{p-IUnDBhPg.js → p-4-_BhJWV.js} +1 -1
- package/dist/post-components/{p-7f929bb9.entry.js → p-477c8c35.entry.js} +1 -1
- package/dist/post-components/{p-2c6b4e6a.entry.js → p-4b366aa0.entry.js} +1 -1
- package/dist/post-components/{p-53fd5230.entry.js → p-4c7750cd.entry.js} +1 -1
- package/dist/post-components/p-52e118e0.entry.js +1 -0
- package/dist/post-components/p-53f34806.entry.js +1 -0
- package/dist/post-components/p-621a81a7.entry.js +1 -0
- package/dist/post-components/p-85594193.entry.js +1 -0
- package/dist/post-components/p-89ea447b.entry.js +1 -0
- package/dist/post-components/p-8d8ac7ae.entry.js +1 -0
- package/dist/post-components/p-900dc8e1.entry.js +1 -0
- package/dist/post-components/p-93da9105.entry.js +1 -0
- package/dist/post-components/{p-d061773b.entry.js → p-95ad4d06.entry.js} +1 -1
- package/dist/post-components/p-9915ffee.entry.js +1 -0
- package/dist/post-components/{p-Ck2qPht6.js → p-B6uZASBE.js} +1 -1
- package/dist/post-components/{p-DSNGJB58.js → p-BDW1XHCO.js} +1 -1
- package/dist/post-components/{p-CVsNfXZd.js → p-CiOyV6Mo.js} +1 -1
- package/dist/post-components/p-DE1aWdqx.js +2 -0
- package/dist/post-components/{p-BRNqUiXj.js → p-DMiERazc.js} +1 -1
- package/dist/post-components/{p-D4F0BqBW.js → p-NPUljV0P.js} +1 -1
- package/dist/post-components/p-a08abdb2.entry.js +1 -0
- package/dist/post-components/p-a971ec25.entry.js +1 -0
- package/dist/post-components/{p-e2370e94.entry.js → p-ad69ed8c.entry.js} +1 -1
- package/dist/post-components/p-c11a8e06.entry.js +1 -0
- package/dist/post-components/p-d02KpeUM.js +1 -0
- package/dist/post-components/p-d9ce8f05.entry.js +1 -0
- package/dist/post-components/p-dcceab4e.entry.js +1 -0
- package/dist/post-components/{p-f1ca1d3f.entry.js → p-e219e22a.entry.js} +1 -1
- package/dist/post-components/{p-758fc84f.entry.js → p-f6c45fed.entry.js} +1 -1
- package/dist/post-components/post-components.css +2 -2
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/components/post-accordion-item/post-accordion-item.d.ts +0 -8
- package/dist/types/components/post-closebutton/post-closebutton.d.ts +5 -2
- package/dist/types/components/post-closebutton/types.d.ts +1 -1
- package/dist/types/components/post-date-picker/accessibility-utils.d.ts +19 -0
- package/dist/types/components/post-date-picker/date-utils.d.ts +48 -0
- package/dist/types/components/post-date-picker/native-mask-element.d.ts +12 -0
- package/dist/types/components/post-date-picker/post-date-picker.d.ts +23 -62
- package/dist/types/components/post-header/post-header.d.ts +3 -2
- package/dist/types/components/post-language-menu/post-language-menu.d.ts +2 -1
- package/dist/types/components/post-menu/post-menu.d.ts +4 -4
- package/dist/types/components/post-popover/post-popover.d.ts +4 -5
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +2 -2
- package/dist/types/components/post-side-navigation/post-side-navigation.d.ts +62 -0
- package/dist/types/components/post-side-navigation/side-navigation-styles.d.ts +2 -0
- package/dist/types/components/post-side-navigation-trigger/post-side-navigation-trigger.d.ts +33 -0
- package/dist/types/components/post-tab-item/post-tab-item.d.ts +8 -4
- package/dist/types/components/post-tab-panel/post-tab-panel.d.ts +1 -1
- package/dist/types/components/post-tabs/post-tabs.d.ts +37 -17
- package/dist/types/components/post-tooltip/post-tooltip.d.ts +4 -5
- package/dist/types/components.d.ts +181 -164
- package/dist/types/home/runner/work/design-system/design-system/packages/components/.stencil/vrt/helpers/header-variants.config.d.ts +1 -0
- package/dist/types/types/element-api.d.ts +3 -0
- package/dist/vrt/helpers/header-test-config.js +3 -2
- package/dist/vrt/helpers/header-variants.config.js +29 -2
- package/hydrate/index.js +1174 -682
- package/hydrate/index.mjs +1174 -682
- package/package.json +11 -12
- package/dist/cjs/long-press-event-Dx21Ojod.js +0 -276
- package/dist/cjs/post-login-widget.cjs.entry.js +0 -92
- package/dist/collection/components/post-accordion-item/heading-levels.js +0 -1
- package/dist/collection/components/post-login-widget/post-login-widget.css +0 -1
- package/dist/collection/components/post-login-widget/post-login-widget.js +0 -218
- package/dist/collection/components/post-tab-item/post-tab-item.css +0 -1
- package/dist/components/long-press-event.js +0 -8
- package/dist/components/post-avatar2.js +0 -1
- package/dist/components/post-login-widget.js +0 -1
- package/dist/components/react/p-85IGlhtB.js +0 -1
- package/dist/components/react/p-B9ZFuYey.js +0 -1
- package/dist/components/react/p-BNgqqRsB.js +0 -8
- package/dist/components/react/p-Bg9dtyzK.js +0 -1
- package/dist/components/react/p-Bn66acGG.js +0 -1
- package/dist/components/react/p-CkTAQJGd.js +0 -1
- package/dist/components/react/p-ClG-N42b.js +0 -1
- package/dist/components/react/p-DwuW52g5.js +0 -1
- package/dist/components/react/post-login-widget.js +0 -1
- package/dist/esm/long-press-event-BNgqqRsB.js +0 -274
- package/dist/esm/package-ClG-N42b.js +0 -3
- package/dist/esm/post-login-widget.entry.js +0 -90
- package/dist/post-components/p-0288484f.entry.js +0 -1
- package/dist/post-components/p-07cdd022.entry.js +0 -1
- package/dist/post-components/p-17df4e91.entry.js +0 -1
- package/dist/post-components/p-17e046fa.entry.js +0 -1
- package/dist/post-components/p-29bd31a0.entry.js +0 -1
- package/dist/post-components/p-5b7e6369.entry.js +0 -1
- package/dist/post-components/p-5f4ca179.entry.js +0 -1
- package/dist/post-components/p-62b6154a.entry.js +0 -1
- package/dist/post-components/p-686a6e22.entry.js +0 -1
- package/dist/post-components/p-9865f72c.entry.js +0 -1
- package/dist/post-components/p-99803d57.entry.js +0 -1
- package/dist/post-components/p-BNgqqRsB.js +0 -8
- package/dist/post-components/p-BbDawWJ5.js +0 -2
- package/dist/post-components/p-ClG-N42b.js +0 -1
- package/dist/post-components/p-a0e0a760.entry.js +0 -1
- package/dist/post-components/p-a850652d.entry.js +0 -1
- package/dist/post-components/p-aac1a8ea.entry.js +0 -1
- package/dist/post-components/p-b3f0f9a2.entry.js +0 -1
- package/dist/post-components/p-c37dba4b.entry.js +0 -1
- package/dist/post-components/p-f2e5f44e.entry.js +0 -1
- package/dist/post-components/p-ff98ada4.entry.js +0 -1
- package/dist/types/components/post-accordion-item/heading-levels.d.ts +0 -2
- package/dist/types/components/post-login-widget/post-login-widget.d.ts +0 -45
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swisspost/design-system-components",
|
|
3
|
-
"version": "10.0.0-next.
|
|
3
|
+
"version": "10.0.0-next.76",
|
|
4
4
|
"description": "A collection of web components built with Stencil JS for the Swiss Post Design System.",
|
|
5
5
|
"author": "Swiss Post <design-system@post.ch>",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"hydrate/"
|
|
23
23
|
],
|
|
24
24
|
"sideEffects": [
|
|
25
|
-
"./dist/esm
|
|
25
|
+
"./dist/esm/*.js",
|
|
26
26
|
"./dist/cjs/post-components.cjs.js",
|
|
27
|
-
"./dist/components
|
|
27
|
+
"./dist/components/*.js",
|
|
28
28
|
"./dist/loader/index.js",
|
|
29
29
|
"./dist/loader/index.cjs.js",
|
|
30
30
|
"./cypress/**",
|
|
@@ -80,12 +80,11 @@
|
|
|
80
80
|
"@floating-ui/dom": "1.7.6",
|
|
81
81
|
"@oddbird/popover-polyfill": "0.6.0",
|
|
82
82
|
"@stencil/core": "4.43.3",
|
|
83
|
-
"@swisspost/design-system-icons": "10.0.0-next.
|
|
84
|
-
"@swisspost/design-system-styles": "10.0.0-next.
|
|
83
|
+
"@swisspost/design-system-icons": "10.0.0-next.76",
|
|
84
|
+
"@swisspost/design-system-styles": "10.0.0-next.76",
|
|
85
85
|
"air-datepicker": "3.6.0",
|
|
86
86
|
"ally.js": "1.4.1",
|
|
87
|
-
"imask": "7.6.1"
|
|
88
|
-
"long-press-event": "2.5.2"
|
|
87
|
+
"imask": "7.6.1"
|
|
89
88
|
},
|
|
90
89
|
"devDependencies": {
|
|
91
90
|
"@eslint/compat": "1.2.5",
|
|
@@ -97,7 +96,7 @@
|
|
|
97
96
|
"@stencil/angular-output-target": "1.1.1",
|
|
98
97
|
"@stencil/react-output-target": "1.2.0",
|
|
99
98
|
"@stencil/sass": "3.0.12",
|
|
100
|
-
"@swisspost/design-system-eslint": "10.0.0-next.
|
|
99
|
+
"@swisspost/design-system-eslint": "10.0.0-next.76",
|
|
101
100
|
"@types/jest": "29.5.14",
|
|
102
101
|
"@types/node": "24.0.0",
|
|
103
102
|
"@typescript-eslint/parser": "7.18.0",
|
|
@@ -121,8 +120,8 @@
|
|
|
121
120
|
"throttle-debounce": "5.0.2",
|
|
122
121
|
"ts-jest": "29.4.9",
|
|
123
122
|
"ts-node": "10.9.2",
|
|
124
|
-
"typescript": "
|
|
125
|
-
"typescript-eslint": "8.
|
|
123
|
+
"typescript": "6.0.3",
|
|
124
|
+
"typescript-eslint": "8.62.0"
|
|
126
125
|
},
|
|
127
126
|
"keywords": [
|
|
128
127
|
"components",
|
|
@@ -138,7 +137,7 @@
|
|
|
138
137
|
"prebuild": "pnpm clean && pnpm prebuild:script",
|
|
139
138
|
"build": "stencil build --docs-readme",
|
|
140
139
|
"postbuild": "pnpm copy:hydrate-stub & pnpm copy:component-names & pnpm copy:styles:components-react & pnpm copy:styles:components-angular",
|
|
141
|
-
"clean": "rimraf --glob dist hydrate loader loaders www src/styles/generated src/_generated ../components-react/**/stencil-generated/ ../components-angular
|
|
140
|
+
"clean": "rimraf --glob dist hydrate loader loaders www src/styles/generated src/_generated ../components-react/**/stencil-generated/ ../components-angular/**/stencil-generated/",
|
|
142
141
|
"unit": "stencil test --spec",
|
|
143
142
|
"unit:watch": "stencil test --spec --watchAll --silent",
|
|
144
143
|
"unit:updatesnapshot": "stencil test --spec --updateSnapshot",
|
|
@@ -158,6 +157,6 @@
|
|
|
158
157
|
"copy:hydrate-stub": "copyfiles -f src/hydrate-stub/* hydrate/",
|
|
159
158
|
"copy:component-names": "copyfiles -f src/_generated/component-names.json dist/",
|
|
160
159
|
"copy:styles:components-react": "copyfiles -f www/build/post-components.css ../components-react/src/stencil-generated/",
|
|
161
|
-
"copy:styles:components-angular": "copyfiles -f www/build/post-components.css ../components-angular/
|
|
160
|
+
"copy:styles:components-angular": "copyfiles -f www/build/post-components.css ../components-angular/src/stencil-generated/"
|
|
162
161
|
}
|
|
163
162
|
}
|
|
@@ -1,276 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/*!
|
|
4
|
-
* long-press-event - v@version@
|
|
5
|
-
* Pure JavaScript long-press-event
|
|
6
|
-
* https://github.com/john-doherty/long-press-event
|
|
7
|
-
* @author John Doherty <www.johndoherty.info>
|
|
8
|
-
* @license MIT
|
|
9
|
-
*/
|
|
10
|
-
(function (window, document) {
|
|
11
|
-
|
|
12
|
-
// local timer object based on rAF
|
|
13
|
-
var timer = null;
|
|
14
|
-
|
|
15
|
-
// check if we're using a touch screen
|
|
16
|
-
var hasPointerEvents = (('PointerEvent' in window) || (window.navigator && 'msPointerEnabled' in window.navigator));
|
|
17
|
-
var isTouch = (('ontouchstart' in window) || (navigator.MaxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0));
|
|
18
|
-
|
|
19
|
-
// switch to pointer events or touch events if using a touch screen
|
|
20
|
-
var mouseDown = hasPointerEvents ? 'pointerdown' : isTouch ? 'touchstart' : 'mousedown';
|
|
21
|
-
var mouseUp = hasPointerEvents ? 'pointerup' : isTouch ? 'touchend' : 'mouseup';
|
|
22
|
-
var mouseMove = hasPointerEvents ? 'pointermove' : isTouch ? 'touchmove' : 'mousemove';
|
|
23
|
-
var mouseLeave = hasPointerEvents ? 'pointerleave' : isTouch ? 'touchleave' : 'mouseleave';
|
|
24
|
-
|
|
25
|
-
// track number of pixels the mouse moves during long press
|
|
26
|
-
var startX = 0; // mouse x position when timer started
|
|
27
|
-
var startY = 0; // mouse y position when timer started
|
|
28
|
-
var maxDiffX = 10; // max number of X pixels the mouse can move during long press before it is canceled
|
|
29
|
-
var maxDiffY = 10; // max number of Y pixels the mouse can move during long press before it is canceled
|
|
30
|
-
|
|
31
|
-
// patch CustomEvent to allow constructor creation (IE/Chrome)
|
|
32
|
-
if (typeof window.CustomEvent !== 'function') {
|
|
33
|
-
|
|
34
|
-
window.CustomEvent = function (event, params) {
|
|
35
|
-
|
|
36
|
-
params = params || { bubbles: false, cancelable: false, detail: undefined };
|
|
37
|
-
|
|
38
|
-
var evt = document.createEvent('CustomEvent');
|
|
39
|
-
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
|
|
40
|
-
return evt;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
window.CustomEvent.prototype = window.Event.prototype;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// requestAnimationFrame() shim by Paul Irish
|
|
47
|
-
window.requestAnimFrame = (function () {
|
|
48
|
-
return window.requestAnimationFrame ||
|
|
49
|
-
window.webkitRequestAnimationFrame ||
|
|
50
|
-
window.mozRequestAnimationFrame ||
|
|
51
|
-
window.oRequestAnimationFrame ||
|
|
52
|
-
window.msRequestAnimationFrame || function (callback) {
|
|
53
|
-
window.setTimeout(callback, 1000 / 60);
|
|
54
|
-
};
|
|
55
|
-
})();
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Behaves the same as setTimeout except uses requestAnimationFrame() where possible for better performance
|
|
59
|
-
* @param {function} fn The callback function
|
|
60
|
-
* @param {int} delay The delay in milliseconds
|
|
61
|
-
* @returns {object} handle to the timeout object
|
|
62
|
-
*/
|
|
63
|
-
function requestTimeout(fn, delay) {
|
|
64
|
-
|
|
65
|
-
if (!window.requestAnimationFrame && !window.webkitRequestAnimationFrame &&
|
|
66
|
-
!(window.mozRequestAnimationFrame && window.mozCancelRequestAnimationFrame) && // Firefox 5 ships without cancel support
|
|
67
|
-
!window.oRequestAnimationFrame && !window.msRequestAnimationFrame) return window.setTimeout(fn, delay);
|
|
68
|
-
|
|
69
|
-
var start = new Date().getTime();
|
|
70
|
-
var handle = {};
|
|
71
|
-
|
|
72
|
-
var loop = function () {
|
|
73
|
-
var current = new Date().getTime();
|
|
74
|
-
var delta = current - start;
|
|
75
|
-
|
|
76
|
-
if (delta >= delay) {
|
|
77
|
-
fn.call();
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
handle.value = requestAnimFrame(loop);
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
handle.value = requestAnimFrame(loop);
|
|
85
|
-
|
|
86
|
-
return handle;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Behaves the same as clearTimeout except uses cancelRequestAnimationFrame() where possible for better performance
|
|
91
|
-
* @param {object} handle The callback function
|
|
92
|
-
* @returns {void}
|
|
93
|
-
*/
|
|
94
|
-
function clearRequestTimeout(handle) {
|
|
95
|
-
if (handle) {
|
|
96
|
-
window.cancelAnimationFrame ? window.cancelAnimationFrame(handle.value) :
|
|
97
|
-
window.webkitCancelAnimationFrame ? window.webkitCancelAnimationFrame(handle.value) :
|
|
98
|
-
window.webkitCancelRequestAnimationFrame ? window.webkitCancelRequestAnimationFrame(handle.value) : /* Support for legacy API */
|
|
99
|
-
window.mozCancelRequestAnimationFrame ? window.mozCancelRequestAnimationFrame(handle.value) :
|
|
100
|
-
window.oCancelRequestAnimationFrame ? window.oCancelRequestAnimationFrame(handle.value) :
|
|
101
|
-
window.msCancelRequestAnimationFrame ? window.msCancelRequestAnimationFrame(handle.value) :
|
|
102
|
-
clearTimeout(handle);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Fires the 'long-press' event on element
|
|
108
|
-
* @param {MouseEvent|PointerEvent|TouchEvent} originalEvent The original event being fired
|
|
109
|
-
* @returns {void}
|
|
110
|
-
*/
|
|
111
|
-
function fireLongPressEvent(originalEvent) {
|
|
112
|
-
|
|
113
|
-
clearLongPressTimer();
|
|
114
|
-
|
|
115
|
-
originalEvent = unifyEvent(originalEvent);
|
|
116
|
-
|
|
117
|
-
// fire the long-press event
|
|
118
|
-
var allowClickEvent = this.dispatchEvent(new CustomEvent('long-press', {
|
|
119
|
-
bubbles: true,
|
|
120
|
-
cancelable: true,
|
|
121
|
-
|
|
122
|
-
// custom event data (legacy)
|
|
123
|
-
detail: {
|
|
124
|
-
clientX: originalEvent.clientX,
|
|
125
|
-
clientY: originalEvent.clientY,
|
|
126
|
-
offsetX: originalEvent.offsetX,
|
|
127
|
-
offsetY: originalEvent.offsetY,
|
|
128
|
-
pageX: originalEvent.pageX,
|
|
129
|
-
pageY: originalEvent.pageY
|
|
130
|
-
},
|
|
131
|
-
|
|
132
|
-
// add coordinate data that would typically acompany a touch/click event
|
|
133
|
-
clientX: originalEvent.clientX,
|
|
134
|
-
clientY: originalEvent.clientY,
|
|
135
|
-
offsetX: originalEvent.offsetX,
|
|
136
|
-
offsetY: originalEvent.offsetY,
|
|
137
|
-
pageX: originalEvent.pageX,
|
|
138
|
-
pageY: originalEvent.pageY,
|
|
139
|
-
screenX: originalEvent.screenX,
|
|
140
|
-
screenY: originalEvent.screenY
|
|
141
|
-
}));
|
|
142
|
-
|
|
143
|
-
if (!allowClickEvent) {
|
|
144
|
-
// suppress the next click event if e.preventDefault() was called in long-press handler
|
|
145
|
-
document.addEventListener('click', function suppressEvent(e) {
|
|
146
|
-
document.removeEventListener('click', suppressEvent, true);
|
|
147
|
-
cancelEvent(e);
|
|
148
|
-
}, true);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* consolidates mouse, touch, and Pointer events
|
|
154
|
-
* @param {MouseEvent|PointerEvent|TouchEvent} e The original event being fired
|
|
155
|
-
* @returns {MouseEvent|PointerEvent|Touch}
|
|
156
|
-
*/
|
|
157
|
-
function unifyEvent(e) {
|
|
158
|
-
if (e.changedTouches !== undefined) {
|
|
159
|
-
return e.changedTouches[0];
|
|
160
|
-
}
|
|
161
|
-
return e;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* method responsible for starting the long press timer
|
|
166
|
-
* @param {event} e - event object
|
|
167
|
-
* @returns {void}
|
|
168
|
-
*/
|
|
169
|
-
function startLongPressTimer(e) {
|
|
170
|
-
|
|
171
|
-
clearLongPressTimer();
|
|
172
|
-
|
|
173
|
-
var el = e.target;
|
|
174
|
-
|
|
175
|
-
// get delay from html attribute if it exists, otherwise default to 1500
|
|
176
|
-
var longPressDelayInMs = parseInt(getNearestAttribute(el, 'data-long-press-delay', '1500'), 10); // default 1500
|
|
177
|
-
|
|
178
|
-
// start the timer
|
|
179
|
-
timer = requestTimeout(fireLongPressEvent.bind(el, e), longPressDelayInMs);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* method responsible for clearing a pending long press timer
|
|
184
|
-
* @param {event} e - event object
|
|
185
|
-
* @returns {void}
|
|
186
|
-
*/
|
|
187
|
-
function clearLongPressTimer(e) {
|
|
188
|
-
clearRequestTimeout(timer);
|
|
189
|
-
timer = null;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* Cancels the current event
|
|
194
|
-
* @param {object} e - browser event object
|
|
195
|
-
* @returns {void}
|
|
196
|
-
*/
|
|
197
|
-
function cancelEvent(e) {
|
|
198
|
-
e.stopImmediatePropagation();
|
|
199
|
-
e.preventDefault();
|
|
200
|
-
e.stopPropagation();
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
* Starts the timer on mouse down and logs current position
|
|
205
|
-
* @param {object} e - browser event object
|
|
206
|
-
* @returns {void}
|
|
207
|
-
*/
|
|
208
|
-
function mouseDownHandler(e) {
|
|
209
|
-
startX = e.clientX;
|
|
210
|
-
startY = e.clientY;
|
|
211
|
-
startLongPressTimer(e);
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
* If the mouse moves n pixels during long-press, cancel the timer
|
|
216
|
-
* @param {object} e - browser event object
|
|
217
|
-
* @returns {void}
|
|
218
|
-
*/
|
|
219
|
-
function mouseMoveHandler(e) {
|
|
220
|
-
|
|
221
|
-
// calculate total number of pixels the pointer has moved
|
|
222
|
-
var diffX = Math.abs(startX - e.clientX);
|
|
223
|
-
var diffY = Math.abs(startY - e.clientY);
|
|
224
|
-
|
|
225
|
-
// if pointer has moved more than allowed, cancel the long-press timer and therefore the event
|
|
226
|
-
if (diffX >= maxDiffX || diffY >= maxDiffY) {
|
|
227
|
-
clearLongPressTimer();
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* Gets attribute off HTML element or nearest parent
|
|
233
|
-
* @param {object} el - HTML element to retrieve attribute from
|
|
234
|
-
* @param {string} attributeName - name of the attribute
|
|
235
|
-
* @param {any} defaultValue - default value to return if no match found
|
|
236
|
-
* @returns {any} attribute value or defaultValue
|
|
237
|
-
*/
|
|
238
|
-
function getNearestAttribute(el, attributeName, defaultValue) {
|
|
239
|
-
|
|
240
|
-
// walk up the dom tree looking for data-action and data-trigger
|
|
241
|
-
while (el && el !== document.documentElement) {
|
|
242
|
-
|
|
243
|
-
var attributeValue = el.getAttribute(attributeName);
|
|
244
|
-
|
|
245
|
-
if (attributeValue) {
|
|
246
|
-
return attributeValue;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
el = el.parentNode;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
return defaultValue;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
// hook events that clear a pending long press event
|
|
256
|
-
document.addEventListener(mouseUp, clearLongPressTimer, true);
|
|
257
|
-
document.addEventListener(mouseLeave, clearLongPressTimer, true);
|
|
258
|
-
document.addEventListener(mouseMove, mouseMoveHandler, true);
|
|
259
|
-
document.addEventListener('wheel', clearLongPressTimer, true);
|
|
260
|
-
document.addEventListener('scroll', clearLongPressTimer, true);
|
|
261
|
-
document.addEventListener('contextmenu', function(e) {
|
|
262
|
-
|
|
263
|
-
// on touch devices, prevent the native context menu and keep the long-press timer running
|
|
264
|
-
if (isTouch) {
|
|
265
|
-
e.preventDefault();
|
|
266
|
-
return;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
// on non-touch devices, clear timer
|
|
270
|
-
clearLongPressTimer();
|
|
271
|
-
}, true);
|
|
272
|
-
|
|
273
|
-
// hook events that can trigger a long press event
|
|
274
|
-
document.addEventListener(mouseDown, mouseDownHandler, true); // <- start
|
|
275
|
-
|
|
276
|
-
}(window, document));
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var index = require('./index-ngUOBQot.js');
|
|
4
|
-
require('./breakpoints-B0Olgvgc.js');
|
|
5
|
-
var _package = require('./package-Bi-tiNRc.js');
|
|
6
|
-
var required = require('./required-lRDOdbd6.js');
|
|
7
|
-
var type = require('./type-shT641Eo.js');
|
|
8
|
-
require('./create-validator-decorator-Bnx17kwi.js');
|
|
9
|
-
|
|
10
|
-
const postLoginWidgetCss = () => `:host post-menu-trigger button{display:inline-flex;position:relative;align-items:center;justify-content:center;max-width:100%;overflow:hidden;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;border-width:var(--post-device-border-width-default);border-style:solid;border-color:rgba(0,0,0,0);border-radius:var(--post-device-border-radius-round);background-color:rgba(0,0,0,0);box-shadow:none;font-family:inherit;font-weight:var(--post-device-font-weight-bold);text-decoration:none;white-space:nowrap;cursor:pointer;min-height:var(--post-device-sizing-interactive-button-height-1);gap:var(--post-device-spacing-gap-inline-10);padding:0 var(--post-device-spacing-padding-inline-6)}:host post-menu-trigger button:hover{text-decoration:none}:host post-menu-trigger button:disabled{border-style:var(--post-core-border-style-dash)}:host post-menu-trigger button{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}:host post-menu-trigger button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host post-menu-trigger button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){:host post-menu-trigger button:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host post-menu-trigger button:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host post-menu-trigger button:is(a){color:LinkText;border:unset}:host post-menu-trigger button:is(button){background-color:ButtonFace !important;border:1px solid ButtonBorder !important}:host post-menu-trigger button:not(:disabled,.disabled):is(button):hover{background-color:Highlight !important}:host post-menu-trigger button:not(:disabled,.disabled):is(button):hover>post-icon{color:HighlightText !important}}:host post-menu-trigger button>post-icon{width:var(--post-device-sizing-interactive-button-icon-4);height:var(--post-device-sizing-interactive-button-icon-4)}:host post-menu-trigger button{border-radius:var(--post-device-border-radius-round) !important;border:0 none;min-height:0;padding:0}:host post-menu-trigger .visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}`;
|
|
11
|
-
|
|
12
|
-
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
13
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
14
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
15
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
16
|
-
else
|
|
17
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
18
|
-
if (d = decorators[i])
|
|
19
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
20
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21
|
-
};
|
|
22
|
-
const SESSION_URL = 'https://n.account.post.ch/v1/session/subscribe';
|
|
23
|
-
const PostLoginWidget = class {
|
|
24
|
-
constructor(hostRef) {
|
|
25
|
-
index.registerInstance(this, hostRef);
|
|
26
|
-
this.postChange = index.createEvent(this, "postChange");
|
|
27
|
-
this.authenticated = null;
|
|
28
|
-
this.user = null;
|
|
29
|
-
}
|
|
30
|
-
async componentWillLoad() {
|
|
31
|
-
{
|
|
32
|
-
await this.fetchAuthState();
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Returns the current authentication state:
|
|
37
|
-
* `null` when the component is still loading, `true` when authenticated, `false` when not.
|
|
38
|
-
*/
|
|
39
|
-
async isAuthenticated() {
|
|
40
|
-
return this.authenticated;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Re-fetches the authentication state from the session API and updates
|
|
44
|
-
* the component rendering accordingly.
|
|
45
|
-
*/
|
|
46
|
-
async refresh() {
|
|
47
|
-
await this.fetchAuthState();
|
|
48
|
-
}
|
|
49
|
-
async fetchAuthState() {
|
|
50
|
-
try {
|
|
51
|
-
const response = await fetch(SESSION_URL, {
|
|
52
|
-
credentials: 'include',
|
|
53
|
-
});
|
|
54
|
-
if (!response.ok) {
|
|
55
|
-
this.setAuthState(false);
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
const json = await response.json();
|
|
59
|
-
const isAuthenticated = json?.data?.email !== undefined;
|
|
60
|
-
this.user = json?.data;
|
|
61
|
-
this.setAuthState(isAuthenticated);
|
|
62
|
-
}
|
|
63
|
-
catch {
|
|
64
|
-
this.setAuthState(false);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
setAuthState(next) {
|
|
68
|
-
if (this.authenticated === next)
|
|
69
|
-
return;
|
|
70
|
-
this.authenticated = next;
|
|
71
|
-
this.postChange.emit({ authenticated: next });
|
|
72
|
-
}
|
|
73
|
-
render() {
|
|
74
|
-
return (index.h(index.Host, { key: '4aeda818bbda67c88aa188ac3bbb8f0377a5050e', "data-version": _package.version }, this.authenticated === true ? (index.h("div", null, index.h("post-menu-trigger", { for: "user-menu-default" }, index.h("button", { class: "btn btn-link", type: "button" }, index.h("post-avatar", { firstname: this.user.name, lastname: this.user.surname, description: this.textCurrentUser.replace('{user}', `${this.user.name} ${this.user.surname}`) }), index.h("span", { class: "visually-hidden" }, this.textUserMenuTrigger))), index.h("post-menu", { label: this.textUserMenu, id: "user-menu-default" }, index.h("div", { slot: "header" }, index.h("post-avatar", { firstname: this.user.name, lastname: this.user.surname, email: this.user.email, "aria-hidden": "true" }), this.user.name, " ", this.user.surname), index.h("slot", { name: "user-links" })))) : (index.h("div", null, index.h("slot", { name: "login-link" })))));
|
|
75
|
-
}
|
|
76
|
-
get host() { return index.getElement(this); }
|
|
77
|
-
};
|
|
78
|
-
__decorate([
|
|
79
|
-
required.Required(),
|
|
80
|
-
type.Type('string')
|
|
81
|
-
], PostLoginWidget.prototype, "textCurrentUser", void 0);
|
|
82
|
-
__decorate([
|
|
83
|
-
required.Required(),
|
|
84
|
-
type.Type('string')
|
|
85
|
-
], PostLoginWidget.prototype, "textUserMenu", void 0);
|
|
86
|
-
__decorate([
|
|
87
|
-
required.Required(),
|
|
88
|
-
type.Type('string')
|
|
89
|
-
], PostLoginWidget.prototype, "textUserMenuTrigger", void 0);
|
|
90
|
-
PostLoginWidget.style = postLoginWidgetCss();
|
|
91
|
-
|
|
92
|
-
exports.post_login_widget = PostLoginWidget;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const HEADING_LEVELS = [1, 2, 3, 4, 5, 6];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
:host post-menu-trigger button{display:inline-flex;position:relative;align-items:center;justify-content:center;max-width:100%;overflow:hidden;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;border-width:var(--post-device-border-width-default);border-style:solid;border-color:rgba(0,0,0,0);border-radius:var(--post-device-border-radius-round);background-color:rgba(0,0,0,0);box-shadow:none;font-family:inherit;font-weight:var(--post-device-font-weight-bold);text-decoration:none;white-space:nowrap;cursor:pointer;min-height:var(--post-device-sizing-interactive-button-height-1);gap:var(--post-device-spacing-gap-inline-10);padding:0 var(--post-device-spacing-padding-inline-6)}:host post-menu-trigger button:hover{text-decoration:none}:host post-menu-trigger button:disabled{border-style:var(--post-core-border-style-dash)}:host post-menu-trigger button{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}:host post-menu-trigger button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host post-menu-trigger button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){:host post-menu-trigger button:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host post-menu-trigger button:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host post-menu-trigger button:is(a){color:LinkText;border:unset}:host post-menu-trigger button:is(button){background-color:ButtonFace !important;border:1px solid ButtonBorder !important}:host post-menu-trigger button:not(:disabled,.disabled):is(button):hover{background-color:Highlight !important}:host post-menu-trigger button:not(:disabled,.disabled):is(button):hover>post-icon{color:HighlightText !important}}:host post-menu-trigger button>post-icon{width:var(--post-device-sizing-interactive-button-icon-4);height:var(--post-device-sizing-interactive-button-icon-4)}:host post-menu-trigger button{border-radius:var(--post-device-border-radius-round) !important;border:0 none;min-height:0;padding:0}:host post-menu-trigger .visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}
|
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
4
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else
|
|
6
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
7
|
-
if (d = decorators[i])
|
|
8
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
9
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10
|
-
};
|
|
11
|
-
import { Required, Type } from "../../utils/index";
|
|
12
|
-
import { version } from "../../../../package";
|
|
13
|
-
import { Build, h, Host, } from "@stencil/core";
|
|
14
|
-
const SESSION_URL = 'https://n.account.post.ch/v1/session/subscribe';
|
|
15
|
-
/**
|
|
16
|
-
* @slot user-links - Links to show in the user menu when the user is authenticated.
|
|
17
|
-
* @slot login-link - Content rendered when the user is not authenticated.
|
|
18
|
-
*/
|
|
19
|
-
export class PostLoginWidget {
|
|
20
|
-
constructor() {
|
|
21
|
-
this.authenticated = null;
|
|
22
|
-
this.user = null;
|
|
23
|
-
}
|
|
24
|
-
async componentWillLoad() {
|
|
25
|
-
if (Build.isBrowser) {
|
|
26
|
-
await this.fetchAuthState();
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Returns the current authentication state:
|
|
31
|
-
* `null` when the component is still loading, `true` when authenticated, `false` when not.
|
|
32
|
-
*/
|
|
33
|
-
async isAuthenticated() {
|
|
34
|
-
return this.authenticated;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Re-fetches the authentication state from the session API and updates
|
|
38
|
-
* the component rendering accordingly.
|
|
39
|
-
*/
|
|
40
|
-
async refresh() {
|
|
41
|
-
await this.fetchAuthState();
|
|
42
|
-
}
|
|
43
|
-
async fetchAuthState() {
|
|
44
|
-
try {
|
|
45
|
-
const response = await fetch(SESSION_URL, {
|
|
46
|
-
credentials: 'include',
|
|
47
|
-
});
|
|
48
|
-
if (!response.ok) {
|
|
49
|
-
this.setAuthState(false);
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
const json = await response.json();
|
|
53
|
-
const isAuthenticated = json?.data?.email !== undefined;
|
|
54
|
-
this.user = json?.data;
|
|
55
|
-
this.setAuthState(isAuthenticated);
|
|
56
|
-
}
|
|
57
|
-
catch {
|
|
58
|
-
this.setAuthState(false);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
setAuthState(next) {
|
|
62
|
-
if (this.authenticated === next)
|
|
63
|
-
return;
|
|
64
|
-
this.authenticated = next;
|
|
65
|
-
this.postChange.emit({ authenticated: next });
|
|
66
|
-
}
|
|
67
|
-
render() {
|
|
68
|
-
return (h(Host, { key: '4aeda818bbda67c88aa188ac3bbb8f0377a5050e', "data-version": version }, this.authenticated === true ? (h("div", null, h("post-menu-trigger", { for: "user-menu-default" }, h("button", { class: "btn btn-link", type: "button" }, h("post-avatar", { firstname: this.user.name, lastname: this.user.surname, description: this.textCurrentUser.replace('{user}', `${this.user.name} ${this.user.surname}`) }), h("span", { class: "visually-hidden" }, this.textUserMenuTrigger))), h("post-menu", { label: this.textUserMenu, id: "user-menu-default" }, h("div", { slot: "header" }, h("post-avatar", { firstname: this.user.name, lastname: this.user.surname, email: this.user.email, "aria-hidden": "true" }), this.user.name, " ", this.user.surname), h("slot", { name: "user-links" })))) : (h("div", null, h("slot", { name: "login-link" })))));
|
|
69
|
-
}
|
|
70
|
-
static get is() { return "post-login-widget"; }
|
|
71
|
-
static get encapsulation() { return "shadow"; }
|
|
72
|
-
static get originalStyleUrls() {
|
|
73
|
-
return {
|
|
74
|
-
"$": ["post-login-widget.scss"]
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
static get styleUrls() {
|
|
78
|
-
return {
|
|
79
|
-
"$": ["post-login-widget.css"]
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
static get properties() {
|
|
83
|
-
return {
|
|
84
|
-
"textCurrentUser": {
|
|
85
|
-
"type": "string",
|
|
86
|
-
"mutable": false,
|
|
87
|
-
"complexType": {
|
|
88
|
-
"original": "string",
|
|
89
|
-
"resolved": "string",
|
|
90
|
-
"references": {}
|
|
91
|
-
},
|
|
92
|
-
"required": true,
|
|
93
|
-
"optional": false,
|
|
94
|
-
"docs": {
|
|
95
|
-
"tags": [],
|
|
96
|
-
"text": "Label for the \"Current user is {user}\" accessibility description.\nUse `{user}` as a placeholder \u2014 it will be replaced with the current user's name at runtime."
|
|
97
|
-
},
|
|
98
|
-
"getter": false,
|
|
99
|
-
"setter": false,
|
|
100
|
-
"reflect": true,
|
|
101
|
-
"attribute": "text-current-user"
|
|
102
|
-
},
|
|
103
|
-
"textUserMenu": {
|
|
104
|
-
"type": "string",
|
|
105
|
-
"mutable": false,
|
|
106
|
-
"complexType": {
|
|
107
|
-
"original": "string",
|
|
108
|
-
"resolved": "string",
|
|
109
|
-
"references": {}
|
|
110
|
-
},
|
|
111
|
-
"required": true,
|
|
112
|
-
"optional": false,
|
|
113
|
-
"docs": {
|
|
114
|
-
"tags": [],
|
|
115
|
-
"text": "Accessible label for the dropdown menu"
|
|
116
|
-
},
|
|
117
|
-
"getter": false,
|
|
118
|
-
"setter": false,
|
|
119
|
-
"reflect": true,
|
|
120
|
-
"attribute": "text-user-menu"
|
|
121
|
-
},
|
|
122
|
-
"textUserMenuTrigger": {
|
|
123
|
-
"type": "string",
|
|
124
|
-
"mutable": false,
|
|
125
|
-
"complexType": {
|
|
126
|
-
"original": "string",
|
|
127
|
-
"resolved": "string",
|
|
128
|
-
"references": {}
|
|
129
|
-
},
|
|
130
|
-
"required": true,
|
|
131
|
-
"optional": false,
|
|
132
|
-
"docs": {
|
|
133
|
-
"tags": [],
|
|
134
|
-
"text": "Hidden label for the user menu trigger button, for accessibility purposes. It should describe the purpose of the button (e.g. \"Access user links\")."
|
|
135
|
-
},
|
|
136
|
-
"getter": false,
|
|
137
|
-
"setter": false,
|
|
138
|
-
"reflect": true,
|
|
139
|
-
"attribute": "text-user-menu-trigger"
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
static get states() {
|
|
144
|
-
return {
|
|
145
|
-
"authenticated": {},
|
|
146
|
-
"user": {}
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
static get events() {
|
|
150
|
-
return [{
|
|
151
|
-
"method": "postChange",
|
|
152
|
-
"name": "postChange",
|
|
153
|
-
"bubbles": true,
|
|
154
|
-
"cancelable": true,
|
|
155
|
-
"composed": true,
|
|
156
|
-
"docs": {
|
|
157
|
-
"tags": [],
|
|
158
|
-
"text": "Emitted when the authentication state changes.\nThe event payload is an object with an `authenticated` property:\n`true` when the user is logged in, `false` when the user is not logged in or the API request failed."
|
|
159
|
-
},
|
|
160
|
-
"complexType": {
|
|
161
|
-
"original": "{ authenticated: boolean }",
|
|
162
|
-
"resolved": "{ authenticated: boolean; }",
|
|
163
|
-
"references": {}
|
|
164
|
-
}
|
|
165
|
-
}];
|
|
166
|
-
}
|
|
167
|
-
static get methods() {
|
|
168
|
-
return {
|
|
169
|
-
"isAuthenticated": {
|
|
170
|
-
"complexType": {
|
|
171
|
-
"signature": "() => Promise<boolean | null>",
|
|
172
|
-
"parameters": [],
|
|
173
|
-
"references": {
|
|
174
|
-
"Promise": {
|
|
175
|
-
"location": "global",
|
|
176
|
-
"id": "global::Promise"
|
|
177
|
-
}
|
|
178
|
-
},
|
|
179
|
-
"return": "Promise<boolean>"
|
|
180
|
-
},
|
|
181
|
-
"docs": {
|
|
182
|
-
"text": "Returns the current authentication state:\n`null` when the component is still loading, `true` when authenticated, `false` when not.",
|
|
183
|
-
"tags": []
|
|
184
|
-
}
|
|
185
|
-
},
|
|
186
|
-
"refresh": {
|
|
187
|
-
"complexType": {
|
|
188
|
-
"signature": "() => Promise<void>",
|
|
189
|
-
"parameters": [],
|
|
190
|
-
"references": {
|
|
191
|
-
"Promise": {
|
|
192
|
-
"location": "global",
|
|
193
|
-
"id": "global::Promise"
|
|
194
|
-
}
|
|
195
|
-
},
|
|
196
|
-
"return": "Promise<void>"
|
|
197
|
-
},
|
|
198
|
-
"docs": {
|
|
199
|
-
"text": "Re-fetches the authentication state from the session API and updates\nthe component rendering accordingly.",
|
|
200
|
-
"tags": []
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
static get elementRef() { return "host"; }
|
|
206
|
-
}
|
|
207
|
-
__decorate([
|
|
208
|
-
Required(),
|
|
209
|
-
Type('string')
|
|
210
|
-
], PostLoginWidget.prototype, "textCurrentUser", void 0);
|
|
211
|
-
__decorate([
|
|
212
|
-
Required(),
|
|
213
|
-
Type('string')
|
|
214
|
-
], PostLoginWidget.prototype, "textUserMenu", void 0);
|
|
215
|
-
__decorate([
|
|
216
|
-
Required(),
|
|
217
|
-
Type('string')
|
|
218
|
-
], PostLoginWidget.prototype, "textUserMenuTrigger", void 0);
|