@swisspost/design-system-components 10.0.0-next.70 → 10.0.0-next.72
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/breakpoints-B0Olgvgc.js +206 -0
- package/dist/cjs/component-on-ready-CifOTqw1.js +24 -0
- package/dist/cjs/create-validator-decorator-Bnx17kwi.js +223 -0
- package/dist/cjs/{focusable-ZqET_zrB.js → focusable-COT2uiEV.js} +25 -4
- package/dist/cjs/{index-DPdHkdGf.js → index-ngUOBQot.js} +17 -13
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/nanoid-CmjyF1Cm.js +20 -0
- package/dist/cjs/one-of-BHyX4vYq.js +27 -0
- package/dist/cjs/{package-Ds_LS1pB.js → package-Bi-tiNRc.js} +1 -1
- package/dist/cjs/pattern-BgBx5zGQ.js +27 -0
- package/dist/cjs/post-accordion_2.cjs.entry.js +18 -24
- package/dist/cjs/post-autocomplete.cjs.entry.js +27 -14
- package/dist/cjs/post-avatar.cjs.entry.js +33 -54
- package/dist/cjs/post-back-to-top.cjs.entry.js +21 -12
- package/dist/cjs/post-banner.cjs.entry.js +9 -14
- package/dist/cjs/post-breadcrumb-item.cjs.entry.js +48 -41
- package/dist/cjs/post-breadcrumbs.cjs.entry.js +106 -105
- package/dist/cjs/post-closebutton_14.cjs.entry.js +257 -288
- package/dist/cjs/post-collapsible_2.cjs.entry.js +57 -40
- package/dist/cjs/post-components.cjs.js +2 -2
- package/dist/cjs/post-date-picker.cjs.entry.js +154 -144
- package/dist/cjs/post-footer.cjs.entry.js +26 -19
- 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 +4 -6
- package/dist/cjs/post-login-widget.cjs.entry.js +35 -3
- package/dist/cjs/post-number-input.cjs.entry.js +6 -6
- package/dist/cjs/post-pagination.cjs.entry.js +53 -83
- package/dist/cjs/post-popover-trigger.cjs.entry.js +22 -19
- package/dist/cjs/post-popover.cjs.entry.js +25 -23
- package/dist/cjs/post-progressbar.cjs.entry.js +147 -0
- package/dist/cjs/post-rating.cjs.entry.js +34 -35
- package/dist/cjs/post-stepper-item.cjs.entry.js +3 -3
- package/dist/cjs/post-stepper.cjs.entry.js +49 -38
- package/dist/cjs/post-tab-item.cjs.entry.js +23 -15
- package/dist/cjs/post-tab-panel.cjs.entry.js +23 -16
- package/dist/cjs/post-tabs.cjs.entry.js +24 -30
- package/dist/cjs/post-tooltip-trigger.cjs.entry.js +34 -21
- package/dist/cjs/post-tooltip.cjs.entry.js +19 -16
- package/dist/cjs/required-lRDOdbd6.js +44 -0
- package/dist/cjs/type-shT641Eo.js +30 -0
- package/dist/cjs/url-DRUMqVBq.js +34 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/post-accordion/post-accordion.js +11 -8
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +4 -18
- package/dist/collection/components/post-autocomplete/post-autocomplete.js +23 -13
- package/dist/collection/components/post-avatar/avatar-utils.js +2 -2
- package/dist/collection/components/post-avatar/post-avatar.js +29 -72
- package/dist/collection/components/post-back-to-top/post-back-to-top.js +17 -10
- package/dist/collection/components/post-banner/post-banner.js +7 -14
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.css +1 -1
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +92 -47
- package/dist/collection/components/post-breadcrumb-item/variants.js +1 -0
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.css +1 -1
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.js +110 -114
- package/dist/collection/components/post-closebutton/post-closebutton.js +24 -27
- package/dist/collection/components/post-collapsible/post-collapsible.js +26 -16
- package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +34 -30
- package/dist/collection/components/post-date-picker/post-date-picker.css +1 -1
- package/dist/collection/components/post-date-picker/post-date-picker.js +64 -96
- package/dist/collection/components/post-footer/post-footer.js +17 -13
- package/dist/collection/components/post-header/post-header.js +18 -24
- package/dist/collection/components/post-icon/post-icon.js +36 -48
- package/dist/collection/components/post-language-menu/post-language-menu.js +16 -22
- package/dist/collection/components/post-language-menu-item/post-language-menu-item.js +28 -39
- package/dist/collection/components/post-linkarea/post-linkarea.js +2 -2
- package/dist/collection/components/post-listbox/post-listbox.js +3 -5
- package/dist/collection/components/post-listbox-option/post-listbox-option.js +3 -3
- package/dist/collection/components/post-login-widget/post-login-widget.css +1 -0
- package/dist/collection/components/post-login-widget/post-login-widget.js +103 -5
- package/dist/collection/components/post-logo/post-logo.js +16 -13
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +17 -13
- package/dist/collection/components/post-megadropdown/post-megadropdown.js +24 -23
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +7 -15
- package/dist/collection/components/post-menu/post-menu.js +14 -24
- package/dist/collection/components/post-menu-item/post-menu-item.css +1 -1
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +17 -13
- package/dist/collection/components/post-number-input/post-number-input.js +5 -5
- package/dist/collection/components/post-pagination/post-pagination.js +47 -83
- package/dist/collection/components/post-popover/post-popover.js +20 -22
- package/dist/collection/components/post-popover-trigger/post-popover-trigger.js +16 -14
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -1
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +28 -34
- package/dist/collection/components/post-progressbar/post-progressbar.css +1 -0
- package/dist/collection/components/post-progressbar/post-progressbar.js +136 -0
- package/dist/collection/components/post-rating/post-rating.js +25 -29
- package/dist/collection/components/post-stepper/post-stepper.js +44 -36
- package/dist/collection/components/post-stepper-item/post-stepper-item.js +2 -2
- package/dist/collection/components/post-tab-item/post-tab-item.js +17 -13
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +17 -14
- package/dist/collection/components/post-tabs/post-tabs.js +20 -7
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +5 -3
- package/dist/collection/components/post-tooltip/post-tooltip.js +17 -16
- package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +30 -19
- package/dist/collection/hydrate-stub/index.stub.js +5 -0
- package/dist/collection/test-setup.js +7 -0
- package/dist/collection/utils/index.js +4 -3
- package/dist/collection/utils/is-value-empty.js +1 -1
- package/dist/collection/utils/locales.js +9 -2
- package/dist/collection/utils/nanoid.js +16 -0
- package/dist/collection/utils/property-decorators/array-of.js +22 -0
- package/dist/collection/utils/property-decorators/bound.js +75 -0
- package/dist/collection/utils/property-decorators/create-validator-decorator.js +211 -0
- package/dist/collection/utils/property-decorators/date.js +21 -0
- package/dist/collection/utils/property-decorators/index.js +9 -0
- package/dist/collection/utils/property-decorators/iso-date.js +21 -0
- package/dist/collection/utils/property-decorators/one-of.js +22 -0
- package/dist/collection/utils/property-decorators/pattern.js +22 -0
- package/dist/collection/utils/property-decorators/required.js +40 -0
- package/dist/collection/utils/property-decorators/type.js +25 -0
- package/dist/collection/utils/property-decorators/url.js +29 -0
- package/dist/component-names.json +1 -0
- package/dist/components/breakpoints.js +1 -0
- package/dist/components/component-on-ready.js +1 -0
- package/dist/components/focusable.js +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +1 -1
- package/dist/components/nanoid.js +1 -0
- package/dist/components/one-of.js +1 -0
- package/dist/components/package.js +1 -1
- package/dist/components/pattern.js +1 -0
- 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-avatar2.js +1 -0
- 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-login-widget.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.d.ts +11 -0
- package/dist/components/post-progressbar.js +1 -0
- package/dist/components/post-rating.js +1 -1
- 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-4wtxqxXu.js +1 -0
- package/dist/components/react/p-85IGlhtB.js +1 -0
- package/dist/components/react/p-8LXe8Zt_.js +1 -0
- package/dist/components/react/p-B9ZFuYey.js +1 -0
- package/dist/components/react/p-BXqGI600.js +1 -0
- package/dist/components/react/p-BZSAV0-K.js +1 -0
- package/dist/components/react/p-B_WnO-QF.js +1 -0
- package/dist/components/react/p-BaB8wJvk.js +1 -0
- package/dist/components/react/p-Bg9dtyzK.js +1 -0
- package/dist/components/react/p-Bji_4dfL.js +1 -0
- package/dist/components/react/p-Bn66acGG.js +1 -0
- package/dist/components/react/p-BrY4VWTQ.js +1 -0
- package/dist/components/react/p-Bu2JeHDf.js +1 -0
- package/dist/components/react/p-BxoRVIIr.js +1 -0
- package/dist/components/react/p-CX2E_IXB.js +1 -0
- package/dist/components/react/p-Cd1TsNm7.js +1 -0
- package/dist/components/react/p-CkTAQJGd.js +1 -0
- package/dist/components/react/p-ClG-N42b.js +1 -0
- package/dist/components/react/p-D1zw8FxT.js +1 -0
- package/dist/components/react/p-DwuW52g5.js +1 -0
- package/dist/components/react/p-PM7l--ff.js +1 -0
- package/dist/components/react/p-lpWRZjJp.js +1 -0
- 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-login-widget.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.d.ts +11 -0
- package/dist/components/react/post-progressbar.js +1 -0
- package/dist/components/react/post-rating.js +1 -1
- 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/components/required.js +1 -0
- package/dist/components/type.js +1 -0
- package/dist/components/url.js +1 -0
- package/dist/docs.json +307 -72
- package/dist/esm/breakpoints-BQ3HlJPr.js +202 -0
- package/dist/esm/component-on-ready-lpWRZjJp.js +22 -0
- package/dist/esm/create-validator-decorator-D8qwF5Qe.js +218 -0
- package/dist/esm/{focusable-BD_WT2MO.js → focusable-C7afHKmo.js} +25 -5
- package/dist/esm/{index-DmAi35UF.js → index-BbDawWJ5.js} +17 -13
- package/dist/esm/loader.js +3 -3
- package/dist/esm/nanoid-8LXe8Zt_.js +18 -0
- package/dist/esm/one-of-GPr3FflU.js +25 -0
- package/dist/esm/package-ClG-N42b.js +3 -0
- package/dist/esm/pattern-BWPRYpYv.js +25 -0
- package/dist/esm/post-accordion_2.entry.js +17 -23
- package/dist/esm/post-autocomplete.entry.js +27 -14
- package/dist/esm/post-avatar.entry.js +33 -54
- package/dist/esm/post-back-to-top.entry.js +21 -12
- package/dist/esm/post-banner.entry.js +9 -14
- package/dist/esm/post-breadcrumb-item.entry.js +48 -41
- package/dist/esm/post-breadcrumbs.entry.js +106 -105
- package/dist/esm/post-closebutton_14.entry.js +252 -283
- package/dist/esm/post-collapsible_2.entry.js +57 -40
- package/dist/esm/post-components.js +3 -3
- package/dist/esm/post-date-picker.entry.js +151 -141
- package/dist/esm/post-footer.entry.js +21 -14
- 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 +4 -6
- package/dist/esm/post-login-widget.entry.js +35 -3
- package/dist/esm/post-number-input.entry.js +5 -5
- package/dist/esm/post-pagination.entry.js +52 -82
- package/dist/esm/post-popover-trigger.entry.js +20 -17
- package/dist/esm/post-popover.entry.js +25 -23
- package/dist/esm/post-progressbar.entry.js +145 -0
- package/dist/esm/post-rating.entry.js +29 -30
- package/dist/esm/post-stepper-item.entry.js +3 -3
- package/dist/esm/post-stepper.entry.js +49 -38
- package/dist/esm/post-tab-item.entry.js +22 -14
- package/dist/esm/post-tab-panel.entry.js +22 -15
- package/dist/esm/post-tabs.entry.js +23 -29
- package/dist/esm/post-tooltip-trigger.entry.js +34 -21
- package/dist/esm/post-tooltip.entry.js +19 -16
- package/dist/esm/required-uK-rZZjy.js +42 -0
- package/dist/esm/type-obmwEgkM.js +28 -0
- package/dist/esm/url-B28ByZCe.js +32 -0
- package/dist/post-components/p-00f55af5.entry.js +1 -0
- package/dist/post-components/p-0288484f.entry.js +1 -0
- package/dist/post-components/p-07cdd022.entry.js +1 -0
- package/dist/post-components/{p-c2e05ba0.entry.js → p-12047216.entry.js} +1 -1
- package/dist/post-components/p-17df4e91.entry.js +1 -0
- package/dist/post-components/p-17e046fa.entry.js +1 -0
- package/dist/post-components/p-29bd31a0.entry.js +1 -0
- package/dist/post-components/p-2c6b4e6a.entry.js +1 -0
- package/dist/post-components/p-3b05e01d.entry.js +1 -0
- package/dist/post-components/p-53fd5230.entry.js +1 -0
- package/dist/post-components/p-5b7e6369.entry.js +1 -0
- package/dist/post-components/p-5f4ca179.entry.js +1 -0
- package/dist/post-components/p-62b6154a.entry.js +1 -0
- package/dist/post-components/{p-77d5e17b.entry.js → p-686a6e22.entry.js} +1 -1
- package/dist/post-components/p-758fc84f.entry.js +1 -0
- package/dist/post-components/{p-570d64dd.entry.js → p-7f929bb9.entry.js} +1 -1
- package/dist/post-components/p-8LXe8Zt_.js +1 -0
- package/dist/post-components/p-9865f72c.entry.js +1 -0
- package/dist/post-components/p-99803d57.entry.js +1 -0
- package/dist/post-components/p-BQ3HlJPr.js +1 -0
- package/dist/post-components/p-BRNqUiXj.js +1 -0
- package/dist/post-components/p-BbDawWJ5.js +2 -0
- package/dist/post-components/p-BrY4VWTQ.js +1 -0
- package/dist/post-components/p-CVsNfXZd.js +1 -0
- package/dist/post-components/p-Ck2qPht6.js +1 -0
- package/dist/post-components/p-ClG-N42b.js +1 -0
- package/dist/post-components/p-D4F0BqBW.js +1 -0
- package/dist/post-components/p-DSNGJB58.js +1 -0
- package/dist/post-components/p-IUnDBhPg.js +1 -0
- package/dist/post-components/p-a0e0a760.entry.js +1 -0
- package/dist/post-components/p-a850652d.entry.js +1 -0
- package/dist/post-components/p-aac1a8ea.entry.js +1 -0
- package/dist/post-components/{p-092f8795.entry.js → p-b3f0f9a2.entry.js} +1 -1
- package/dist/post-components/p-c37dba4b.entry.js +1 -0
- package/dist/post-components/p-d061773b.entry.js +1 -0
- package/dist/post-components/p-e2370e94.entry.js +1 -0
- package/dist/post-components/p-f1ca1d3f.entry.js +1 -0
- package/dist/post-components/p-f2e5f44e.entry.js +1 -0
- package/dist/post-components/p-ff98ada4.entry.js +1 -0
- package/dist/post-components/p-lpWRZjJp.js +1 -0
- 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/post-accordion.d.ts +1 -1
- package/dist/types/components/post-accordion-item/post-accordion-item.d.ts +0 -2
- package/dist/types/components/post-autocomplete/post-autocomplete.d.ts +0 -1
- package/dist/types/components/post-avatar/avatar-utils.d.ts +1 -1
- package/dist/types/components/post-avatar/post-avatar.d.ts +0 -13
- package/dist/types/components/post-back-to-top/post-back-to-top.d.ts +0 -1
- package/dist/types/components/post-banner/post-banner.d.ts +0 -1
- package/dist/types/components/post-breadcrumb-item/post-breadcrumb-item.d.ts +11 -11
- package/dist/types/components/post-breadcrumb-item/variants.d.ts +2 -0
- package/dist/types/components/post-breadcrumbs/post-breadcrumbs.d.ts +20 -26
- package/dist/types/components/post-closebutton/post-closebutton.d.ts +0 -3
- package/dist/types/components/post-collapsible/post-collapsible.d.ts +1 -2
- package/dist/types/components/post-collapsible-trigger/post-collapsible-trigger.d.ts +3 -6
- package/dist/types/components/post-date-picker/post-date-picker.d.ts +0 -12
- package/dist/types/components/post-footer/post-footer.d.ts +0 -1
- package/dist/types/components/post-header/post-header.d.ts +0 -2
- package/dist/types/components/post-icon/post-icon.d.ts +0 -6
- package/dist/types/components/post-language-menu/post-language-menu.d.ts +1 -3
- package/dist/types/components/post-language-menu-item/post-language-menu-item.d.ts +0 -5
- package/dist/types/components/post-login-widget/post-login-widget.d.ts +17 -2
- package/dist/types/components/post-logo/post-logo.d.ts +0 -1
- package/dist/types/components/post-mainnavigation/post-mainnavigation.d.ts +0 -1
- package/dist/types/components/post-megadropdown/post-megadropdown.d.ts +1 -3
- package/dist/types/components/post-megadropdown-trigger/post-megadropdown-trigger.d.ts +0 -2
- package/dist/types/components/post-menu/post-menu.d.ts +1 -4
- package/dist/types/components/post-menu-trigger/post-menu-trigger.d.ts +0 -1
- package/dist/types/components/post-pagination/post-pagination.d.ts +0 -17
- package/dist/types/components/post-popover/post-popover.d.ts +0 -3
- package/dist/types/components/post-popover-trigger/post-popover-trigger.d.ts +0 -1
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +0 -3
- package/dist/types/components/post-progressbar/post-progressbar.d.ts +23 -0
- package/dist/types/components/post-rating/post-rating.d.ts +0 -4
- package/dist/types/components/post-stepper/post-stepper.d.ts +1 -4
- package/dist/types/components/post-tab-item/post-tab-item.d.ts +0 -1
- package/dist/types/components/post-tab-panel/post-tab-panel.d.ts +0 -1
- package/dist/types/components/post-tooltip/post-tooltip.d.ts +1 -3
- package/dist/types/components/post-tooltip-trigger/post-tooltip-trigger.d.ts +1 -1
- package/dist/types/components.d.ts +119 -29
- package/dist/types/modules.d.ts +2 -0
- package/dist/types/utils/index.d.ts +4 -3
- package/dist/types/utils/nanoid.d.ts +8 -0
- package/dist/types/utils/property-decorators/array-of.d.ts +9 -0
- package/dist/types/utils/property-decorators/bound.d.ts +36 -0
- package/dist/types/utils/property-decorators/create-validator-decorator.d.ts +48 -0
- package/dist/types/utils/property-decorators/date.d.ts +6 -0
- package/dist/types/utils/property-decorators/index.d.ts +9 -0
- package/dist/types/utils/property-decorators/iso-date.d.ts +6 -0
- package/dist/types/utils/property-decorators/one-of.d.ts +8 -0
- package/dist/types/utils/property-decorators/pattern.d.ts +8 -0
- package/dist/types/utils/property-decorators/required.d.ts +17 -0
- package/dist/types/utils/property-decorators/type.d.ts +9 -0
- package/dist/types/utils/property-decorators/url.d.ts +6 -0
- package/hydrate/index.js +1536 -115469
- package/hydrate/index.mjs +1536 -115469
- package/hydrate/index.stub.js +5 -0
- package/package.json +28 -18
- package/dist/cjs/index-YBj3gUJp.js +0 -114540
- package/dist/cjs/index-qCzRmwgB.js +0 -114
- package/dist/cjs/index.browser-BVb9l9T_.js +0 -16
- package/dist/collection/utils/property-checkers/check-array-of.js +0 -8
- package/dist/collection/utils/property-checkers/check-date.js +0 -13
- package/dist/collection/utils/property-checkers/check-iso-date.js +0 -9
- package/dist/collection/utils/property-checkers/check-one-of.js +0 -8
- package/dist/collection/utils/property-checkers/check-pattern.js +0 -8
- package/dist/collection/utils/property-checkers/check-type.js +0 -15
- package/dist/collection/utils/property-checkers/check-url.js +0 -15
- package/dist/collection/utils/property-checkers/constants.js +0 -1
- package/dist/collection/utils/property-checkers/empty-or.js +0 -9
- package/dist/collection/utils/property-checkers/index.js +0 -20
- package/dist/collection/utils/property-checkers/required-and.js +0 -14
- package/dist/components/heading-levels.js +0 -1
- package/dist/components/index.browser.js +0 -1
- package/dist/components/index2.js +0 -1
- package/dist/components/index3.js +0 -6
- package/dist/components/post-breadcrumb-item2.js +0 -1
- package/dist/components/react/p-B076QoO3.js +0 -1
- package/dist/components/react/p-B2BDAeHI.js +0 -1
- package/dist/components/react/p-B2iQay0-.js +0 -1
- package/dist/components/react/p-B_RL4AOE.js +0 -1
- package/dist/components/react/p-BoFDru4R.js +0 -1
- package/dist/components/react/p-BuL0WAoF.js +0 -1
- package/dist/components/react/p-C8b6-YQl.js +0 -1
- package/dist/components/react/p-CJcRbvrI.js +0 -6
- package/dist/components/react/p-Cu9RsvYK.js +0 -1
- package/dist/components/react/p-D6uA8DbL.js +0 -1
- package/dist/components/react/p-DSSN7xW4.js +0 -1
- package/dist/components/react/p-DW7sbg9f.js +0 -1
- package/dist/components/react/p-DgdnwpId.js +0 -1
- package/dist/components/react/p-Dmnnz3fB.js +0 -1
- package/dist/components/react/p-PuHMz_9_.js +0 -1
- package/dist/components/react/p-nA1BKco0.js +0 -1
- package/dist/components/react/p-r4txK0AC.js +0 -1
- package/dist/components/react/p-tpgRP2Dr.js +0 -1
- package/dist/esm/index-CJcRbvrI.js +0 -114535
- package/dist/esm/index-D9bU2pIE.js +0 -104
- package/dist/esm/index.browser-nA1BKco0.js +0 -14
- package/dist/esm/package-DW7sbg9f.js +0 -3
- package/dist/post-components/p-17ccebe6.entry.js +0 -1
- package/dist/post-components/p-1d58bec1.entry.js +0 -1
- package/dist/post-components/p-25c28493.entry.js +0 -1
- package/dist/post-components/p-29ada3d7.entry.js +0 -1
- package/dist/post-components/p-2fcca5ec.entry.js +0 -1
- package/dist/post-components/p-3cefd49e.entry.js +0 -1
- package/dist/post-components/p-3fea238c.entry.js +0 -1
- package/dist/post-components/p-5068ae7e.entry.js +0 -1
- package/dist/post-components/p-521178f5.entry.js +0 -1
- package/dist/post-components/p-534fed55.entry.js +0 -1
- package/dist/post-components/p-5f52cba3.entry.js +0 -1
- package/dist/post-components/p-86697a58.entry.js +0 -1
- package/dist/post-components/p-987bebe8.entry.js +0 -1
- package/dist/post-components/p-9ca5c297.entry.js +0 -1
- package/dist/post-components/p-9ea3066f.entry.js +0 -1
- package/dist/post-components/p-CJcRbvrI.js +0 -6
- package/dist/post-components/p-D9bU2pIE.js +0 -1
- package/dist/post-components/p-DW7sbg9f.js +0 -1
- package/dist/post-components/p-DmAi35UF.js +0 -2
- package/dist/post-components/p-PuHMz_9_.js +0 -1
- package/dist/post-components/p-a6fc33fa.entry.js +0 -1
- package/dist/post-components/p-ac853d6b.entry.js +0 -1
- package/dist/post-components/p-bd09bc20.entry.js +0 -1
- package/dist/post-components/p-c55b537b.entry.js +0 -1
- package/dist/post-components/p-dded4f13.entry.js +0 -1
- package/dist/post-components/p-e6ba44b1.entry.js +0 -1
- package/dist/post-components/p-ead1094e.entry.js +0 -1
- package/dist/post-components/p-f12e59a0.entry.js +0 -1
- package/dist/post-components/p-nA1BKco0.js +0 -1
- package/dist/types/home/runner/work/design-system/design-system/packages/components/.stencil/types/language-tags.d.ts +0 -1
- package/dist/types/utils/property-checkers/check-array-of.d.ts +0 -4
- package/dist/types/utils/property-checkers/check-date.d.ts +0 -3
- package/dist/types/utils/property-checkers/check-iso-date.d.ts +0 -3
- package/dist/types/utils/property-checkers/check-one-of.d.ts +0 -3
- package/dist/types/utils/property-checkers/check-pattern.d.ts +0 -3
- package/dist/types/utils/property-checkers/check-type.d.ts +0 -4
- package/dist/types/utils/property-checkers/check-url.d.ts +0 -3
- package/dist/types/utils/property-checkers/constants.d.ts +0 -1
- package/dist/types/utils/property-checkers/empty-or.d.ts +0 -3
- package/dist/types/utils/property-checkers/index.d.ts +0 -34
- package/dist/types/utils/property-checkers/required-and.d.ts +0 -3
- /package/dist/types/{language-tags.js → test-setup.d.ts} +0 -0
|
@@ -8,14 +8,14 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
9
9
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10
10
|
};
|
|
11
|
-
import { h, Host, Build, } from "@stencil/core";
|
|
12
|
-
import { throttle } from "throttle-debounce";
|
|
13
|
-
import { version } from "../../../../package";
|
|
14
|
-
import { breakpoint } from "../../utils/breakpoints";
|
|
15
11
|
import { fade } from "../../animations/index";
|
|
16
|
-
import {
|
|
12
|
+
import { Required, Type } from "../../utils/index";
|
|
13
|
+
import { breakpoint } from "../../utils/breakpoints";
|
|
17
14
|
import { EventFrom } from "../../utils/event-from";
|
|
18
|
-
import {
|
|
15
|
+
import { getDeepFocusableChildren } from "../../utils/get-focusable-children";
|
|
16
|
+
import { version } from "../../../../package";
|
|
17
|
+
import { Build, h, Host, } from "@stencil/core";
|
|
18
|
+
import { throttle } from "throttle-debounce";
|
|
19
19
|
/**
|
|
20
20
|
* @slot post-logo - Should be used together with the `<post-logo>` component.
|
|
21
21
|
* @slot global-nav-primary - Holds search button in the global header.
|
|
@@ -45,12 +45,6 @@ export class PostHeader {
|
|
|
45
45
|
}
|
|
46
46
|
return document.body;
|
|
47
47
|
}
|
|
48
|
-
validateFullWidth() {
|
|
49
|
-
checkRequiredAndType(this, 'fullWidth', 'boolean');
|
|
50
|
-
}
|
|
51
|
-
validateTextMenu() {
|
|
52
|
-
checkRequiredAndType(this, 'textMenu', 'string');
|
|
53
|
-
}
|
|
54
48
|
lockBody(newValue, _oldValue, propName) {
|
|
55
49
|
const scrollParent = this.scrollParent;
|
|
56
50
|
const burgerMenuExtended = propName === 'burgerMenuExtended' ? newValue : this.burgerMenuExtended;
|
|
@@ -121,8 +115,6 @@ export class PostHeader {
|
|
|
121
115
|
this.switchLanguageSwitchMode();
|
|
122
116
|
}
|
|
123
117
|
componentDidRender() {
|
|
124
|
-
this.validateTextMenu();
|
|
125
|
-
this.validateFullWidth();
|
|
126
118
|
this.getFocusableElements();
|
|
127
119
|
this.handleLocalHeaderResize();
|
|
128
120
|
// When a megadropdown is open on desktop and the user resizes to mobile, we set
|
|
@@ -317,10 +309,10 @@ export class PostHeader {
|
|
|
317
309
|
render() {
|
|
318
310
|
const onDesktop = Build.isServer || this.device === 'desktop';
|
|
319
311
|
const onTabletAndMobile = Build.isServer || this.device !== 'desktop';
|
|
320
|
-
return (h(Host, { key: '
|
|
321
|
-
h("slot", { key: '
|
|
322
|
-
h("slot", { key: '
|
|
323
|
-
], h("slot", { key: '
|
|
312
|
+
return (h(Host, { key: '78b30321492682f5ac4779eaf79fa21de3d5b1f2', "data-version": version, "data-color-scheme": "light", "data-burger-menu": this.hasBurgerMenu, "data-menu-extended": this.burgerMenuExtended }, h("header", { key: 'd34c893f18005a1a5c3e406f1eab0d821e1d5994' }, h("div", { key: '1598f8bd0ecb90662e78280d6b9a2cffaa155994', class: "global-header" }, h("div", { key: 'cca31ad38ecf9d8c42c73d346bd9f909b06b6a9c', class: "section" }, h("div", { key: 'ab28bdc152813adb481b807220a12fc549954654', class: "logo" }, h("slot", { key: '5080891fd1cec13ed4153afce6573373c9ddb559', name: "post-logo" })), h("div", { key: '4dc43239677de2779a54947b013d2379f27d4c2e', class: "sliding-controls" }, onDesktop && (h("div", { key: 'cb3fbb2a94f8d22772d8b60af7712ac5a8199ed2', class: "audience" }, h("slot", { key: '95e06819c41abef543ec2797511f22cb1b135743', name: "audience" }))), h("slot", { key: '5db1090c38c60374f57a8a1289d058d4364efc77', name: "global-nav-primary" }), (onDesktop || !this.hasMainNav) && [
|
|
313
|
+
h("slot", { key: 'db309e50b363ee2d7a13d119dca44c6ce50e3962', name: "global-nav-secondary" }),
|
|
314
|
+
h("slot", { key: 'ec86d4748ef0bd8c46935b0262ec7752d3842f38', name: "language-menu" }),
|
|
315
|
+
], h("slot", { key: 'c082e4a6c9a8dbb2090228c819577468f0f60edd', name: "post-login" }), onTabletAndMobile && this.hasMainNav && (h("post-togglebutton", { key: '2773e3cad4f2a8be60d25b82cae87fb5d813cafc', class: "burger-button", ref: el => (this.burgerMenuButton = el), onClick: () => this.toggleBurgerMenu() }, h("span", { key: 'bd1c2e048436e58f14a9d4fb205afb245f5d1af1' }, this.textMenu), h("post-icon", { key: '1885cff12454528cb981c0a2544531f89bc93b89', "aria-hidden": "true", name: "burger", "data-showwhen": "untoggled" }), h("post-icon", { key: '6ea75eecf1c124b83bb011f667eae4c6cc7df470', "aria-hidden": "true", name: "closex", "data-showwhen": "toggled" })))))), h("div", { key: '487dc3cc667a52f272cdcdcd546eb0b686fc6611', ref: el => (this.localHeader = el), class: { 'local-header': true, 'megadropdown-open': this.megadropdownOpen } }, h("div", { key: '1d4e73e20ee1cba7a26374166435a123c7b3b7de', class: "section" }, h("slot", { key: '8131591c29285ed586c86bb6ce89738df8e51d0b', name: "title" }), this.hasTitle && h("slot", { key: '0430da5a731063cd393a395fdd0c9ec11fed69f3', name: "local-nav" }), onDesktop && h("slot", { key: '07410195623dacda6e8fcadf69de55bb4fdf6067', name: "main-nav" }), onDesktop && !this.hasTitle && h("slot", { key: 'cf7b4cd88faa07d29670a7cb6e389e182581182a', name: "local-nav" }))), this.hasBurgerMenu && this.renderBurgerMenu())));
|
|
324
316
|
}
|
|
325
317
|
static get is() { return "post-header"; }
|
|
326
318
|
static get encapsulation() { return "shadow"; }
|
|
@@ -415,12 +407,6 @@ export class PostHeader {
|
|
|
415
407
|
static get elementRef() { return "host"; }
|
|
416
408
|
static get watchers() {
|
|
417
409
|
return [{
|
|
418
|
-
"propName": "fullWidth",
|
|
419
|
-
"methodName": "validateFullWidth"
|
|
420
|
-
}, {
|
|
421
|
-
"propName": "textMenu",
|
|
422
|
-
"methodName": "validateTextMenu"
|
|
423
|
-
}, {
|
|
424
410
|
"propName": "device",
|
|
425
411
|
"methodName": "lockBody"
|
|
426
412
|
}, {
|
|
@@ -444,6 +430,14 @@ export class PostHeader {
|
|
|
444
430
|
}];
|
|
445
431
|
}
|
|
446
432
|
}
|
|
433
|
+
__decorate([
|
|
434
|
+
Required(),
|
|
435
|
+
Type('boolean')
|
|
436
|
+
], PostHeader.prototype, "fullWidth", void 0);
|
|
437
|
+
__decorate([
|
|
438
|
+
Required(),
|
|
439
|
+
Type('string')
|
|
440
|
+
], PostHeader.prototype, "textMenu", void 0);
|
|
447
441
|
__decorate([
|
|
448
442
|
EventFrom('post-megadropdown')
|
|
449
443
|
], PostHeader.prototype, "megadropdownStateHandler", null);
|
|
@@ -1,7 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
+
};
|
|
4
11
|
import { ANIMATION_KEYS } from "../../types/icon-animations";
|
|
12
|
+
import { OneOf, Required, Type } from "../../utils/index";
|
|
13
|
+
import { version } from "../../../../package";
|
|
14
|
+
import { Build, h, Host } from "@stencil/core";
|
|
5
15
|
const CDN_URL = `https://unpkg.com/@swisspost/design-system-icons@${version}/public/post-icons/`;
|
|
6
16
|
/**
|
|
7
17
|
* @class PostIcon - representing a stencil component
|
|
@@ -17,21 +27,6 @@ export class PostIcon {
|
|
|
17
27
|
*/
|
|
18
28
|
this.flipV = false;
|
|
19
29
|
}
|
|
20
|
-
validateAnimation() {
|
|
21
|
-
checkEmptyOrOneOf(this, 'animation', ANIMATION_KEYS);
|
|
22
|
-
}
|
|
23
|
-
validateBase() {
|
|
24
|
-
checkEmptyOrType(this, 'base', 'string');
|
|
25
|
-
}
|
|
26
|
-
validateName() {
|
|
27
|
-
checkRequiredAndType(this, 'name', 'string');
|
|
28
|
-
}
|
|
29
|
-
validateRotate() {
|
|
30
|
-
checkEmptyOrType(this, 'rotate', 'number');
|
|
31
|
-
}
|
|
32
|
-
validateScale() {
|
|
33
|
-
checkEmptyOrType(this, 'scale', 'number');
|
|
34
|
-
}
|
|
35
30
|
/**
|
|
36
31
|
* Construct the icon URL according to the following rules:
|
|
37
32
|
* 1. `@base` (absolute URL) → use directly.
|
|
@@ -44,7 +39,8 @@ export class PostIcon {
|
|
|
44
39
|
* 5. `CDN_URL` fallback → `https://unpkg.com/...`.
|
|
45
40
|
**/
|
|
46
41
|
getUrl() {
|
|
47
|
-
const
|
|
42
|
+
const name = this.name ?? this.host.getAttribute('name');
|
|
43
|
+
const fileName = `${name}.svg`;
|
|
48
44
|
// Prioritize only data:image URLs
|
|
49
45
|
if (this.url?.startsWith('data:image/')) {
|
|
50
46
|
return this.url;
|
|
@@ -100,19 +96,13 @@ export class PostIcon {
|
|
|
100
96
|
'-webkit-mask-image': `url(${url})`,
|
|
101
97
|
'mask-image': `url('${url}')`,
|
|
102
98
|
'transform': (this.scale && !Number.isNaN(Number(this.scale)) ? 'scale(' + this.scale + ')' : '') +
|
|
103
|
-
(this.rotate && !Number.isNaN(Number(this.rotate))
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
componentDidLoad() {
|
|
108
|
-
this.validateBase();
|
|
109
|
-
this.validateName();
|
|
110
|
-
this.validateScale();
|
|
111
|
-
this.validateRotate();
|
|
112
|
-
this.validateAnimation();
|
|
99
|
+
(this.rotate && !Number.isNaN(Number(this.rotate))
|
|
100
|
+
? ' rotate(' + this.rotate + 'deg)'
|
|
101
|
+
: ''),
|
|
102
|
+
}).filter(([_key, value]) => value !== null));
|
|
113
103
|
}
|
|
114
104
|
render() {
|
|
115
|
-
return (h(Host, { key: '
|
|
105
|
+
return (h(Host, { key: 'dc20dd6be14dd0aba54231b30be89730d4a6c757', "data-version": version }, h("span", { key: '8ef361e6b2721db5f312e0e67fc7d13cb7440abf', style: this.getStyles() })));
|
|
116
106
|
}
|
|
117
107
|
static get is() { return "post-icon"; }
|
|
118
108
|
static get encapsulation() { return "shadow"; }
|
|
@@ -292,22 +282,20 @@ export class PostIcon {
|
|
|
292
282
|
};
|
|
293
283
|
}
|
|
294
284
|
static get elementRef() { return "host"; }
|
|
295
|
-
static get watchers() {
|
|
296
|
-
return [{
|
|
297
|
-
"propName": "animation",
|
|
298
|
-
"methodName": "validateAnimation"
|
|
299
|
-
}, {
|
|
300
|
-
"propName": "base",
|
|
301
|
-
"methodName": "validateBase"
|
|
302
|
-
}, {
|
|
303
|
-
"propName": "name",
|
|
304
|
-
"methodName": "validateName"
|
|
305
|
-
}, {
|
|
306
|
-
"propName": "rotate",
|
|
307
|
-
"methodName": "validateRotate"
|
|
308
|
-
}, {
|
|
309
|
-
"propName": "scale",
|
|
310
|
-
"methodName": "validateScale"
|
|
311
|
-
}];
|
|
312
|
-
}
|
|
313
285
|
}
|
|
286
|
+
__decorate([
|
|
287
|
+
OneOf(ANIMATION_KEYS)
|
|
288
|
+
], PostIcon.prototype, "animation", void 0);
|
|
289
|
+
__decorate([
|
|
290
|
+
Type('string')
|
|
291
|
+
], PostIcon.prototype, "base", void 0);
|
|
292
|
+
__decorate([
|
|
293
|
+
Required(),
|
|
294
|
+
Type('string')
|
|
295
|
+
], PostIcon.prototype, "name", void 0);
|
|
296
|
+
__decorate([
|
|
297
|
+
Type('number')
|
|
298
|
+
], PostIcon.prototype, "rotate", void 0);
|
|
299
|
+
__decorate([
|
|
300
|
+
Type('number')
|
|
301
|
+
], PostIcon.prototype, "scale", void 0);
|
|
@@ -8,11 +8,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
9
9
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10
10
|
};
|
|
11
|
-
import {
|
|
12
|
-
import { checkRequiredAndType, checkRequiredAndPattern, checkEmptyOrOneOf, EventFrom, } from "../../utils/index";
|
|
11
|
+
import { EventFrom, nanoid, OneOf, Pattern, Required, Type } from "../../utils/index";
|
|
13
12
|
import { version } from "../../../../package";
|
|
13
|
+
import { h, Host } from "@stencil/core";
|
|
14
14
|
import { SWITCH_VARIANTS } from "./switch-variants";
|
|
15
|
-
import { nanoid } from "nanoid";
|
|
16
15
|
export class PostLanguageMenu {
|
|
17
16
|
constructor() {
|
|
18
17
|
this.menuId = `p${nanoid(11)}`;
|
|
@@ -25,14 +24,7 @@ export class PostLanguageMenu {
|
|
|
25
24
|
get languageOptions() {
|
|
26
25
|
return Array.from(this.host.querySelectorAll('post-language-menu-item'));
|
|
27
26
|
}
|
|
28
|
-
|
|
29
|
-
checkRequiredAndType(this, 'textChangeLanguage', 'string');
|
|
30
|
-
}
|
|
31
|
-
validateTextCurrentLanguage() {
|
|
32
|
-
checkRequiredAndPattern(this, 'textCurrentLanguage', /#name\b/);
|
|
33
|
-
}
|
|
34
|
-
validateVariant() {
|
|
35
|
-
checkEmptyOrOneOf(this, 'variant', SWITCH_VARIANTS);
|
|
27
|
+
handleVariantChange() {
|
|
36
28
|
this.updateChildrenVariant();
|
|
37
29
|
}
|
|
38
30
|
/* The complete accessible description */
|
|
@@ -44,9 +36,6 @@ export class PostLanguageMenu {
|
|
|
44
36
|
: undefined;
|
|
45
37
|
}
|
|
46
38
|
componentDidLoad() {
|
|
47
|
-
this.validateTextChangeLanguage();
|
|
48
|
-
this.validateTextCurrentLanguage();
|
|
49
|
-
this.validateVariant();
|
|
50
39
|
// Initially set variants and active language
|
|
51
40
|
// Handles cases where the language-menu is rendered after the language-options have been rendered
|
|
52
41
|
this.updateChildrenVariant();
|
|
@@ -92,7 +81,7 @@ export class PostLanguageMenu {
|
|
|
92
81
|
return (h(Host, { "data-version": version }, h("div", { class: "post-language-menu-list", role: "list", "aria-label": this.textChangeLanguage, "aria-describedby": this.listSpanId }, h("span", { id: this.listSpanId, class: "visually-hidden" }, this.description), h("slot", null))));
|
|
93
82
|
}
|
|
94
83
|
renderDropdown() {
|
|
95
|
-
return (h(Host, { "data-version": version }, h("post-menu-trigger", { for: this.menuId }, h("button", { class: "post-language-menu-trigger" }, this.activeLang, h("span", { class: "visually-hidden" }, this.textChangeLanguage), h("span", { class: "visually-hidden" }, this.description), h("post-icon", { "aria-hidden": "true", name: "chevrondown" }))), h("post-menu", { ref: el => this.menu = el, id: this.menuId, class: "post-language-menu-dropdown-container", label: this.textChangeLanguage, placement: "bottom-end" }, h("slot", null))));
|
|
84
|
+
return (h(Host, { "data-version": version }, h("post-menu-trigger", { for: this.menuId }, h("button", { class: "post-language-menu-trigger" }, this.activeLang, h("span", { class: "visually-hidden" }, this.textChangeLanguage), h("span", { class: "visually-hidden" }, this.description), h("post-icon", { "aria-hidden": "true", name: "chevrondown" }))), h("post-menu", { ref: el => (this.menu = el), id: this.menuId, class: "post-language-menu-dropdown-container", label: this.textChangeLanguage, placement: "bottom-end" }, h("slot", null))));
|
|
96
85
|
}
|
|
97
86
|
render() {
|
|
98
87
|
return this.variant === 'list' ? this.renderList() : this.renderDropdown();
|
|
@@ -186,14 +175,8 @@ export class PostLanguageMenu {
|
|
|
186
175
|
static get elementRef() { return "host"; }
|
|
187
176
|
static get watchers() {
|
|
188
177
|
return [{
|
|
189
|
-
"propName": "textChangeLanguage",
|
|
190
|
-
"methodName": "validateTextChangeLanguage"
|
|
191
|
-
}, {
|
|
192
|
-
"propName": "textCurrentLanguage",
|
|
193
|
-
"methodName": "validateTextCurrentLanguage"
|
|
194
|
-
}, {
|
|
195
178
|
"propName": "variant",
|
|
196
|
-
"methodName": "
|
|
179
|
+
"methodName": "handleVariantChange"
|
|
197
180
|
}];
|
|
198
181
|
}
|
|
199
182
|
static get listeners() {
|
|
@@ -218,6 +201,17 @@ export class PostLanguageMenu {
|
|
|
218
201
|
}];
|
|
219
202
|
}
|
|
220
203
|
}
|
|
204
|
+
__decorate([
|
|
205
|
+
Required(),
|
|
206
|
+
Type('string')
|
|
207
|
+
], PostLanguageMenu.prototype, "textChangeLanguage", void 0);
|
|
208
|
+
__decorate([
|
|
209
|
+
Required(),
|
|
210
|
+
Pattern(/#name\b/)
|
|
211
|
+
], PostLanguageMenu.prototype, "textCurrentLanguage", void 0);
|
|
212
|
+
__decorate([
|
|
213
|
+
OneOf(SWITCH_VARIANTS)
|
|
214
|
+
], PostLanguageMenu.prototype, "variant", void 0);
|
|
221
215
|
__decorate([
|
|
222
216
|
EventFrom('post-language-menu-item')
|
|
223
217
|
], PostLanguageMenu.prototype, "handlePostChange", null);
|
|
@@ -1,31 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 { OneOf, Required, Type, Url } from "../../utils/index";
|
|
3
12
|
import { version } from "../../../../package";
|
|
13
|
+
import { h, Host } from "@stencil/core";
|
|
4
14
|
import { SWITCH_VARIANTS } from "../post-language-menu/switch-variants";
|
|
5
15
|
/**
|
|
6
16
|
* @slot default - Slot for placing the content inside the anchor or button.
|
|
7
17
|
*/
|
|
8
18
|
export class PostLanguageMenuItem {
|
|
9
|
-
validateCode() {
|
|
10
|
-
checkRequiredAndType(this, 'code', 'string');
|
|
11
|
-
}
|
|
12
|
-
validateVariant() {
|
|
13
|
-
checkEmptyOrOneOf(this, 'variant', SWITCH_VARIANTS);
|
|
14
|
-
}
|
|
15
|
-
validateName() {
|
|
16
|
-
checkEmptyOrType(this, 'name', 'string');
|
|
17
|
-
}
|
|
18
|
-
validateDescription() {
|
|
19
|
-
checkEmptyOrType(this, 'description', 'string');
|
|
20
|
-
}
|
|
21
|
-
validateUrl() {
|
|
22
|
-
checkEmptyOrUrl(this, 'url');
|
|
23
|
-
}
|
|
24
19
|
componentDidLoad() {
|
|
25
|
-
this.validateCode();
|
|
26
|
-
this.validateName();
|
|
27
|
-
this.validateDescription();
|
|
28
|
-
this.validateUrl();
|
|
29
20
|
if (!this.name && this.isNameRequired()) {
|
|
30
21
|
throw new Error('The "name" property of the post-language-menu-item component is required when the full language name is not displayed.');
|
|
31
22
|
}
|
|
@@ -247,22 +238,20 @@ export class PostLanguageMenuItem {
|
|
|
247
238
|
};
|
|
248
239
|
}
|
|
249
240
|
static get elementRef() { return "host"; }
|
|
250
|
-
static get watchers() {
|
|
251
|
-
return [{
|
|
252
|
-
"propName": "code",
|
|
253
|
-
"methodName": "validateCode"
|
|
254
|
-
}, {
|
|
255
|
-
"propName": "variant",
|
|
256
|
-
"methodName": "validateVariant"
|
|
257
|
-
}, {
|
|
258
|
-
"propName": "name",
|
|
259
|
-
"methodName": "validateName"
|
|
260
|
-
}, {
|
|
261
|
-
"propName": "description",
|
|
262
|
-
"methodName": "validateDescription"
|
|
263
|
-
}, {
|
|
264
|
-
"propName": "url",
|
|
265
|
-
"methodName": "validateUrl"
|
|
266
|
-
}];
|
|
267
|
-
}
|
|
268
241
|
}
|
|
242
|
+
__decorate([
|
|
243
|
+
Required(),
|
|
244
|
+
Type('string')
|
|
245
|
+
], PostLanguageMenuItem.prototype, "code", void 0);
|
|
246
|
+
__decorate([
|
|
247
|
+
OneOf(SWITCH_VARIANTS)
|
|
248
|
+
], PostLanguageMenuItem.prototype, "variant", void 0);
|
|
249
|
+
__decorate([
|
|
250
|
+
Type('string')
|
|
251
|
+
], PostLanguageMenuItem.prototype, "name", void 0);
|
|
252
|
+
__decorate([
|
|
253
|
+
Type('string')
|
|
254
|
+
], PostLanguageMenuItem.prototype, "description", void 0);
|
|
255
|
+
__decorate([
|
|
256
|
+
Url()
|
|
257
|
+
], PostLanguageMenuItem.prototype, "url", void 0);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h, Host } from "@stencil/core";
|
|
2
1
|
import { version } from "../../../../package";
|
|
2
|
+
import { h, Host } from "@stencil/core";
|
|
3
3
|
const INTERACTIVE_ELEMENTS = [
|
|
4
4
|
'a',
|
|
5
5
|
'label[for]',
|
|
@@ -55,7 +55,7 @@ export class PostLinkarea {
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
render() {
|
|
58
|
-
return (h(Host, { key: '
|
|
58
|
+
return (h(Host, { key: 'b79b314635a4cb302d862006d07ab5f059298382', "data-version": version, onClick: (e) => this.dispatchClick(e) }, h("slot", { key: '4e9a1ee60d499f6dd80819e68f6536b3964d3389' })));
|
|
59
59
|
}
|
|
60
60
|
static get is() { return "post-linkarea"; }
|
|
61
61
|
static get encapsulation() { return "shadow"; }
|
|
@@ -8,9 +8,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
9
9
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10
10
|
};
|
|
11
|
-
import { h, Host } from "@stencil/core";
|
|
12
|
-
import { version } from "../../../../package";
|
|
13
11
|
import { EventFrom } from "../../utils/index";
|
|
12
|
+
import { version } from "../../../../package";
|
|
13
|
+
import { h, Host } from "@stencil/core";
|
|
14
14
|
export class PostListbox {
|
|
15
15
|
constructor() {
|
|
16
16
|
this.highlightedIndex = -1;
|
|
@@ -60,12 +60,10 @@ export class PostListbox {
|
|
|
60
60
|
const input = this.inputElement;
|
|
61
61
|
if (input) {
|
|
62
62
|
this.popoverContainer?.show(input);
|
|
63
|
-
this.host.role = 'listbox';
|
|
64
63
|
}
|
|
65
64
|
}
|
|
66
65
|
/** Closes the listbox */
|
|
67
66
|
async hide() {
|
|
68
|
-
this.host.removeAttribute('role');
|
|
69
67
|
this.popoverContainer?.hide();
|
|
70
68
|
}
|
|
71
69
|
/** Uses the internal default filtering mode to filter the list of options.
|
|
@@ -131,7 +129,7 @@ export class PostListbox {
|
|
|
131
129
|
this.updateSelection(event.detail);
|
|
132
130
|
}
|
|
133
131
|
render() {
|
|
134
|
-
return (h(Host, { key: '
|
|
132
|
+
return (h(Host, { key: 'e1e88417d8b8f66fbaf7df481fcbd9a63b6189fb', "data-version": version, role: "listbox" }, h("post-popovercontainer", { key: '0fca1baeb51be6cf5f4d30c254217dce3349a377', placement: "bottom-start", ref: el => (this.popoverContainer = el) }, this.visibleOptions.length === 0 ? h("slot", { name: "blank-slate" }) : h("slot", null))));
|
|
135
133
|
}
|
|
136
134
|
static get is() { return "post-listbox"; }
|
|
137
135
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h, Host } from "@stencil/core";
|
|
2
1
|
import { version } from "../../../../package";
|
|
2
|
+
import { h, Host } from "@stencil/core";
|
|
3
3
|
export class PostListboxOption {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.optionId = crypto.randomUUID();
|
|
@@ -9,9 +9,9 @@ export class PostListboxOption {
|
|
|
9
9
|
this.highlighted = false;
|
|
10
10
|
}
|
|
11
11
|
render() {
|
|
12
|
-
return (h(Host, { key: '
|
|
12
|
+
return (h(Host, { key: 'f88a84b9004a29fb7c39ea4cbc509d940d70a52d', "data-version": version, role: "option", "aria-selected": `${this.selected}`, "data-active": this.highlighted ? 'true' : null,
|
|
13
13
|
/* Prevent focus change from triggering onblur event in post-autocomplete */
|
|
14
|
-
onPointerDown: (e) => e.preventDefault(), onClick: () => this.postOptionSelected.emit(this.value), id: `post-listbox-option-${this.optionId}` }, h("span", { key: '
|
|
14
|
+
onPointerDown: (e) => e.preventDefault(), onClick: () => this.postOptionSelected.emit(this.value), id: `post-listbox-option-${this.optionId}` }, h("span", { key: '99d154078490d171ab0e4e43b765cbffb44e721e', class: "option-content" }, this.value, h("span", { key: '609a205bb61b84d1e56e6e64282cb210f650faca', class: "option-description" }, h("slot", { key: 'd08d9dddbea69b693002a20f4127788a6a21acc1' }))), this.selected && h("post-icon", { key: '04e999451c694a0cb54e1e3ab5cd3eca29640aaf', "aria-hidden": "true", name: "checkmark" })));
|
|
15
15
|
}
|
|
16
16
|
static get is() { return "post-listbox-option"; }
|
|
17
17
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1 @@
|
|
|
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,13 +1,25 @@
|
|
|
1
|
-
|
|
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";
|
|
2
12
|
import { version } from "../../../../package";
|
|
13
|
+
import { Build, h, Host, } from "@stencil/core";
|
|
3
14
|
const SESSION_URL = 'https://n.account.post.ch/v1/session/subscribe';
|
|
4
15
|
/**
|
|
5
|
-
* @slot
|
|
6
|
-
* @slot
|
|
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.
|
|
7
18
|
*/
|
|
8
19
|
export class PostLoginWidget {
|
|
9
20
|
constructor() {
|
|
10
21
|
this.authenticated = null;
|
|
22
|
+
this.user = null;
|
|
11
23
|
}
|
|
12
24
|
async componentWillLoad() {
|
|
13
25
|
if (Build.isBrowser) {
|
|
@@ -39,6 +51,7 @@ export class PostLoginWidget {
|
|
|
39
51
|
}
|
|
40
52
|
const json = await response.json();
|
|
41
53
|
const isAuthenticated = json?.data?.email !== undefined;
|
|
54
|
+
this.user = json?.data;
|
|
42
55
|
this.setAuthState(isAuthenticated);
|
|
43
56
|
}
|
|
44
57
|
catch {
|
|
@@ -52,13 +65,85 @@ export class PostLoginWidget {
|
|
|
52
65
|
this.postChange.emit({ authenticated: next });
|
|
53
66
|
}
|
|
54
67
|
render() {
|
|
55
|
-
return (h(Host, { key: '
|
|
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" })))));
|
|
56
69
|
}
|
|
57
70
|
static get is() { return "post-login-widget"; }
|
|
58
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
|
+
}
|
|
59
143
|
static get states() {
|
|
60
144
|
return {
|
|
61
|
-
"authenticated": {}
|
|
145
|
+
"authenticated": {},
|
|
146
|
+
"user": {}
|
|
62
147
|
};
|
|
63
148
|
}
|
|
64
149
|
static get events() {
|
|
@@ -117,4 +202,17 @@ export class PostLoginWidget {
|
|
|
117
202
|
}
|
|
118
203
|
};
|
|
119
204
|
}
|
|
205
|
+
static get elementRef() { return "host"; }
|
|
120
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);
|