@swisspost/design-system-components 10.0.0-next.65 → 10.0.0-next.67
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-B81j4H4_.js → breakpoints-BTxzC_Qv.js} +4 -7
- package/dist/cjs/{get-focusable-children-SdEe5tt7.js → get-focusable-children-CL2gimr1.js} +4 -4
- package/dist/cjs/{get-root-CUAv4k4C.js → get-root-BIh00Adr.js} +2 -2
- package/dist/cjs/{index-CmbtQEJ0.js → index-Byyrsgop.js} +19 -11
- package/dist/cjs/{index-ChzLnSU8.js → index-qCzRmwgB.js} +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{package-DJFRMOUR.js → package-BMq-R5Xi.js} +1 -1
- package/dist/cjs/post-accordion_2.cjs.entry.js +9 -10
- package/dist/cjs/post-autocomplete.cjs.entry.js +181 -0
- package/dist/cjs/post-avatar.cjs.entry.js +6 -7
- package/dist/cjs/post-back-to-top.cjs.entry.js +8 -9
- package/dist/cjs/post-banner.cjs.entry.js +5 -6
- package/dist/cjs/{post-breadcrumb-item_2.cjs.entry.js → post-breadcrumb-item.cjs.entry.js} +7 -22
- package/dist/cjs/post-breadcrumbs.cjs.entry.js +7 -8
- package/dist/cjs/{post-closebutton_13.cjs.entry.js → post-closebutton_14.cjs.entry.js} +88 -68
- package/dist/cjs/post-collapsible_2.cjs.entry.js +11 -12
- package/dist/cjs/post-components.cjs.js +2 -2
- package/dist/cjs/post-date-picker.cjs.entry.js +4619 -0
- package/dist/cjs/post-footer.cjs.entry.js +8 -9
- package/dist/cjs/post-linkarea.cjs.entry.js +3 -3
- package/dist/cjs/post-listbox-option.cjs.entry.js +26 -0
- package/dist/cjs/post-listbox.cjs.entry.js +151 -0
- package/dist/cjs/post-number-input.cjs.entry.js +20 -14
- package/dist/cjs/post-pagination.cjs.entry.js +10 -11
- package/dist/cjs/post-popover-trigger.cjs.entry.js +5 -6
- package/dist/cjs/post-popover.cjs.entry.js +7 -8
- package/dist/cjs/post-rating.cjs.entry.js +5 -6
- package/dist/cjs/post-stepper-item.cjs.entry.js +4 -4
- package/dist/cjs/post-stepper.cjs.entry.js +34 -14
- package/dist/cjs/post-tab-item.cjs.entry.js +5 -6
- package/dist/cjs/post-tab-panel.cjs.entry.js +5 -6
- package/dist/cjs/post-tabs.cjs.entry.js +8 -9
- package/dist/cjs/post-tooltip-trigger.cjs.entry.js +7 -10
- package/dist/cjs/post-tooltip.cjs.entry.js +5 -6
- package/dist/collection/animations/collapse.js +3 -2
- package/dist/collection/collection-manifest.json +5 -3
- package/dist/collection/components/post-accordion/post-accordion.js +3 -3
- package/dist/collection/components/post-accordion-item/post-accordion-item.css +1 -1
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +3 -3
- package/dist/collection/components/post-autocomplete/post-autocomplete.css +1 -0
- package/dist/collection/components/post-autocomplete/post-autocomplete.js +271 -0
- package/dist/collection/components/post-avatar/post-avatar.js +2 -2
- package/dist/collection/components/post-back-to-top/post-back-to-top.js +4 -4
- package/dist/collection/components/post-banner/post-banner.js +1 -1
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +3 -3
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.js +3 -3
- package/dist/collection/components/post-closebutton/post-closebutton.js +1 -1
- package/dist/collection/components/post-collapsible/post-collapsible.css +1 -1
- package/dist/collection/components/post-collapsible/post-collapsible.js +4 -4
- package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +1 -1
- package/dist/collection/components/post-date-picker/post-date-picker.css +5 -0
- package/dist/collection/components/{post-datepicker/post-datepicker.js → post-date-picker/post-date-picker.js} +139 -101
- package/dist/collection/components/post-footer/post-footer.css +1 -1
- package/dist/collection/components/post-footer/post-footer.js +3 -3
- package/dist/collection/components/post-header/post-header.js +13 -13
- package/dist/collection/components/post-icon/post-icon.js +16 -13
- package/dist/collection/components/post-language-menu/post-language-menu.css +1 -1
- package/dist/collection/components/post-language-menu/post-language-menu.js +1 -1
- package/dist/collection/components/post-language-menu-item/post-language-menu-item.css +1 -1
- package/dist/collection/components/post-language-menu-item/post-language-menu-item.js +2 -1
- package/dist/collection/components/post-linkarea/post-linkarea.js +1 -1
- package/dist/collection/components/post-listbox/post-listbox.css +1 -0
- package/dist/collection/components/post-listbox/post-listbox.js +293 -0
- package/dist/collection/components/post-listbox-option/post-listbox-option.css +1 -0
- package/dist/collection/components/post-listbox-option/post-listbox-option.js +109 -0
- 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.js +5 -5
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +1 -1
- package/dist/collection/components/post-menu/post-menu.js +2 -2
- package/dist/collection/components/post-menu-item/post-menu-item.js +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 +4 -1
- package/dist/collection/components/post-number-input/post-number-input.js +12 -3
- package/dist/collection/components/post-pagination/post-pagination.js +6 -6
- package/dist/collection/components/post-popover/post-popover.js +1 -1
- package/dist/collection/components/post-popover-trigger/post-popover-trigger.js +1 -1
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +45 -19
- package/dist/collection/components/post-rating/post-rating.js +1 -1
- package/dist/collection/components/post-stepper/post-stepper.js +50 -10
- package/dist/collection/components/post-stepper-item/post-stepper-item.css +1 -7
- package/dist/collection/components/post-stepper-item/post-stepper-item.js +1 -1
- package/dist/collection/components/post-tab-item/post-tab-item.js +1 -1
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +1 -1
- package/dist/collection/components/post-tabs/post-tabs.js +4 -4
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +1 -1
- package/dist/collection/components/post-tooltip/post-tooltip.js +1 -1
- package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +6 -6
- package/dist/collection/utils/attribute-observer.js +2 -2
- package/dist/collection/utils/breakpoints.js +6 -5
- package/dist/collection/utils/get-focusable-children.js +3 -3
- package/dist/collection/utils/get-root.js +2 -2
- package/dist/collection/utils/index.js +1 -1
- package/dist/collection/utils/is-iso-date.js +14 -0
- package/dist/collection/utils/is-motion-reduced.js +2 -2
- package/dist/collection/utils/property-checkers/check-date.js +1 -1
- package/dist/collection/utils/property-checkers/check-iso-date.js +9 -0
- package/dist/collection/utils/property-checkers/constants.js +1 -1
- package/dist/collection/utils/property-checkers/index.js +1 -0
- package/dist/collection/utils/repeat-on-long-press.js +6 -6
- package/dist/collection/utils/sass-export.js +1 -1
- package/dist/collection/utils/tests/helpers/mock-match-media.js +11 -0
- package/dist/collection/utils/tests/helpers/mock-stencil-constants.js +12 -0
- package/dist/component-names.json +4 -1
- package/dist/components/breakpoints.js +1 -1
- package/dist/components/get-focusable-children.js +1 -1
- package/dist/components/get-root.js +1 -1
- package/dist/components/index.d.ts +8 -4
- 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.d.ts +11 -0
- package/dist/components/post-autocomplete.js +1 -0
- 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-item2.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-datepicker.d.ts → post-date-picker.d.ts} +4 -4
- package/dist/components/post-date-picker.js +1 -0
- 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.d.ts +11 -0
- package/dist/components/post-listbox-option.js +1 -0
- package/dist/components/{post-env-test.d.ts → post-listbox.d.ts} +4 -4
- package/dist/components/post-listbox.js +1 -0
- 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-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-2xbmulgT.js → p-6dWji_Xt.js} +1 -1
- package/dist/components/react/p-BIQP_u-p.js +1 -0
- package/dist/components/react/p-BlBcIJe_.js +1 -0
- package/dist/components/react/{p-CVpHTlhD.js → p-Bq6Ye6Uc.js} +1 -1
- package/dist/components/react/p-BvY9Yl0A.js +1 -0
- package/dist/components/react/p-ByHBwvly.js +1 -0
- package/dist/components/react/{p-cien1JLp.js → p-C7drBbGl.js} +1 -1
- package/dist/components/react/p-CKkmf4_w.js +1 -0
- package/dist/components/react/p-CS77r1AS.js +1 -0
- package/dist/components/react/p-CY-_ZlW3.js +1 -0
- package/dist/components/react/p-D3Tx-0vM.js +1 -0
- package/dist/components/react/p-DVY9jsO7.js +1 -0
- package/dist/components/react/p-Djnfi-_S.js +1 -0
- package/dist/components/react/p-DlHbGhvD.js +1 -0
- package/dist/components/react/p-DxJ0OgPJ.js +1 -0
- package/dist/components/react/{p-NbS_MQaD.js → p-RpVuZS9R.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.d.ts +11 -0
- package/dist/components/react/post-autocomplete.js +1 -0
- 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-datepicker.d.ts → post-date-picker.d.ts} +4 -4
- package/dist/components/react/post-date-picker.js +1 -0
- 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.d.ts +11 -0
- package/dist/components/react/post-listbox-option.js +1 -0
- package/dist/components/react/{post-env-test.d.ts → post-listbox.d.ts} +4 -4
- package/dist/components/react/post-listbox.js +1 -0
- 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-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/docs.json +591 -111
- package/dist/esm/{breakpoints-_gmb7vUy.js → breakpoints-CZuqK5QS.js} +4 -7
- package/dist/esm/{get-focusable-children-CFWKPWu9.js → get-focusable-children-CckqSLu_.js} +4 -4
- package/dist/esm/{get-root-CXfAA093.js → get-root-gmtbd8C-.js} +2 -2
- package/dist/esm/{index-RRcOB_Q4.js → index-8Vx4ywJ4.js} +19 -11
- package/dist/esm/{index-CCMeku7U.js → index-D9bU2pIE.js} +3 -3
- package/dist/esm/loader.js +3 -3
- package/dist/esm/package-DVY9jsO7.js +3 -0
- package/dist/esm/post-accordion_2.entry.js +9 -10
- package/dist/esm/post-autocomplete.entry.js +179 -0
- package/dist/esm/post-avatar.entry.js +6 -7
- package/dist/esm/post-back-to-top.entry.js +8 -9
- package/dist/esm/post-banner.entry.js +5 -6
- package/dist/esm/{post-breadcrumb-item_2.entry.js → post-breadcrumb-item.entry.js} +8 -22
- package/dist/esm/post-breadcrumbs.entry.js +7 -8
- package/dist/esm/{post-closebutton_13.entry.js → post-closebutton_14.entry.js} +88 -69
- package/dist/esm/post-collapsible_2.entry.js +11 -12
- package/dist/esm/post-components.js +3 -3
- package/dist/esm/post-date-picker.entry.js +4617 -0
- package/dist/esm/post-footer.entry.js +8 -9
- package/dist/esm/post-linkarea.entry.js +3 -3
- package/dist/esm/post-listbox-option.entry.js +24 -0
- package/dist/esm/post-listbox.entry.js +149 -0
- package/dist/esm/post-number-input.entry.js +20 -14
- package/dist/esm/post-pagination.entry.js +10 -11
- package/dist/esm/post-popover-trigger.entry.js +5 -6
- package/dist/esm/post-popover.entry.js +7 -8
- package/dist/esm/post-rating.entry.js +5 -6
- package/dist/esm/post-stepper-item.entry.js +4 -4
- package/dist/esm/post-stepper.entry.js +34 -14
- package/dist/esm/post-tab-item.entry.js +5 -6
- package/dist/esm/post-tab-panel.entry.js +5 -6
- package/dist/esm/post-tabs.entry.js +8 -9
- package/dist/esm/post-tooltip-trigger.entry.js +7 -10
- package/dist/esm/post-tooltip.entry.js +5 -6
- package/dist/post-components/p-0962f02e.entry.js +1 -0
- package/dist/post-components/p-0c22b6cb.entry.js +1 -0
- package/dist/post-components/p-11dfed23.entry.js +1 -0
- package/dist/post-components/p-136052d8.entry.js +1 -0
- package/dist/post-components/p-15d519e6.entry.js +1 -0
- package/dist/post-components/p-16573e00.entry.js +1 -0
- package/dist/post-components/p-29859921.entry.js +1 -0
- package/dist/post-components/p-3a294f1a.entry.js +1 -0
- package/dist/post-components/p-44481053.entry.js +1 -0
- package/dist/post-components/p-61d99723.entry.js +1 -0
- package/dist/post-components/p-68196501.entry.js +1 -0
- package/dist/post-components/p-6badcfb3.entry.js +1 -0
- package/dist/post-components/p-6c2558a3.entry.js +1 -0
- package/dist/post-components/p-6debd1d3.entry.js +1 -0
- package/dist/post-components/p-7b44e7e5.entry.js +1 -0
- package/dist/post-components/p-81aca7ec.entry.js +1 -0
- package/dist/post-components/p-85af10b8.entry.js +1 -0
- package/dist/post-components/p-8Vx4ywJ4.js +2 -0
- package/dist/post-components/p-951b3be6.entry.js +1 -0
- package/dist/post-components/{p-71380a03.entry.js → p-9a3d4f38.entry.js} +1 -1
- package/dist/post-components/p-D81ozKs6.js +1 -0
- package/dist/post-components/p-D9bU2pIE.js +1 -0
- package/dist/post-components/p-DVY9jsO7.js +1 -0
- package/dist/post-components/p-DkA4Ai8j.js +1 -0
- package/dist/post-components/p-a4dd6a67.entry.js +1 -0
- package/dist/post-components/p-aFKnsRj1.js +1 -0
- package/dist/post-components/p-b13742e1.entry.js +1 -0
- package/dist/post-components/p-c5717005.entry.js +1 -0
- package/dist/post-components/p-ca7796c7.entry.js +1 -0
- package/dist/post-components/p-ce7bfb11.entry.js +1 -0
- package/dist/post-components/p-e14f0dd1.entry.js +1 -0
- package/dist/post-components/p-e5a2d0c3.entry.js +1 -0
- package/dist/post-components/post-components.css +6 -1
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/components/post-autocomplete/post-autocomplete.d.ts +34 -0
- package/dist/types/components/{post-datepicker/post-datepicker.d.ts → post-date-picker/post-date-picker.d.ts} +24 -14
- package/dist/types/components/post-listbox/post-listbox.d.ts +37 -0
- package/dist/types/components/post-listbox-option/post-listbox-option.d.ts +13 -0
- package/dist/types/components/post-number-input/post-number-input.d.ts +2 -0
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +6 -0
- package/dist/types/components/post-stepper/post-stepper.d.ts +8 -1
- package/dist/types/components.d.ts +223 -45
- package/dist/types/utils/breakpoints.d.ts +1 -0
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/is-iso-date.d.ts +1 -0
- package/dist/types/utils/property-checkers/check-iso-date.d.ts +3 -0
- package/dist/types/utils/property-checkers/index.d.ts +1 -0
- package/dist/types/utils/tests/helpers/mock-match-media.d.ts +4 -0
- package/dist/types/utils/tests/helpers/mock-stencil-constants.d.ts +0 -0
- package/hydrate/index.js +744 -1425
- package/hydrate/index.mjs +744 -1425
- package/package.json +8 -6
- package/dist/cjs/environment-BQE9Unf_.js +0 -52
- package/dist/cjs/post-datepicker.cjs.entry.js +0 -4542
- package/dist/cjs/post-env-test.cjs.entry.js +0 -15
- package/dist/collection/components/post-datepicker/post-datepicker.css +0 -34
- package/dist/collection/utils/environment.js +0 -47
- package/dist/collection/utils/tests/environment/hydrate-app-helper.js +0 -16
- package/dist/collection/utils/tests/environment/post-env-test.js +0 -9
- package/dist/components/environment.js +0 -1
- package/dist/components/post-datepicker.js +0 -1
- package/dist/components/post-env-test.js +0 -1
- package/dist/components/react/p-BVGcVycs.js +0 -1
- package/dist/components/react/p-Bb0ejJa3.js +0 -1
- package/dist/components/react/p-CBB38gAg.js +0 -1
- package/dist/components/react/p-CEwsBpAR.js +0 -1
- package/dist/components/react/p-CL77OyqD.js +0 -1
- package/dist/components/react/p-CVM28gRr.js +0 -1
- package/dist/components/react/p-Cuxk8xu_.js +0 -1
- package/dist/components/react/p-D0kTIc3Y.js +0 -1
- package/dist/components/react/p-Dh2cMk5v.js +0 -1
- package/dist/components/react/p-Dl1nklBg.js +0 -1
- package/dist/components/react/p-DvTtC-0j.js +0 -1
- package/dist/components/react/p-Dw48xy24.js +0 -1
- package/dist/components/react/p-FxUVQ4Tx.js +0 -1
- package/dist/components/react/post-datepicker.js +0 -1
- package/dist/components/react/post-env-test.js +0 -1
- package/dist/esm/environment-CEmnRoA6.js +0 -49
- package/dist/esm/package-CBB38gAg.js +0 -3
- package/dist/esm/post-datepicker.entry.js +0 -4540
- package/dist/esm/post-env-test.entry.js +0 -13
- package/dist/post-components/p-04151002.entry.js +0 -1
- package/dist/post-components/p-07c80628.entry.js +0 -1
- package/dist/post-components/p-0e0e0009.entry.js +0 -1
- package/dist/post-components/p-241aa7cc.entry.js +0 -1
- package/dist/post-components/p-350a19e3.entry.js +0 -1
- package/dist/post-components/p-3a6ff125.entry.js +0 -1
- package/dist/post-components/p-4a257010.entry.js +0 -1
- package/dist/post-components/p-590f8dbc.entry.js +0 -1
- package/dist/post-components/p-5ef8eff1.entry.js +0 -1
- package/dist/post-components/p-62ac0e47.entry.js +0 -1
- package/dist/post-components/p-67f19828.entry.js +0 -1
- package/dist/post-components/p-821d479c.entry.js +0 -1
- package/dist/post-components/p-961e7f6b.entry.js +0 -1
- package/dist/post-components/p-96c560dd.entry.js +0 -1
- package/dist/post-components/p-CBB38gAg.js +0 -1
- package/dist/post-components/p-CCMeku7U.js +0 -1
- package/dist/post-components/p-CEmnRoA6.js +0 -1
- package/dist/post-components/p-DI-h_mEL.js +0 -1
- package/dist/post-components/p-DppMBmK1.js +0 -1
- package/dist/post-components/p-RRcOB_Q4.js +0 -2
- package/dist/post-components/p-Rr097A6n.js +0 -1
- package/dist/post-components/p-b09e2162.entry.js +0 -1
- package/dist/post-components/p-b8da1422.entry.js +0 -1
- package/dist/post-components/p-ba84aa42.entry.js +0 -1
- package/dist/post-components/p-c32285b8.entry.js +0 -1
- package/dist/post-components/p-cabfcd45.entry.js +0 -1
- package/dist/post-components/p-d7c5001b.entry.js +0 -1
- package/dist/post-components/p-da6a34db.entry.js +0 -1
- package/dist/post-components/p-e0558b08.entry.js +0 -1
- package/dist/post-components/p-f34600d5.entry.js +0 -1
- package/dist/types/utils/environment.d.ts +0 -26
- package/dist/types/utils/tests/environment/hydrate-app-helper.d.ts +0 -5
- package/dist/types/utils/tests/environment/post-env-test.d.ts +0 -3
- /package/dist/collection/components/{post-datepicker → post-date-picker}/locales.js +0 -0
- /package/dist/types/components/{post-datepicker → post-date-picker}/locales.d.ts +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Host, h } from "@stencil/core";
|
|
2
|
-
import {
|
|
1
|
+
import { Host, h, Build } from "@stencil/core";
|
|
2
|
+
import { checkEmptyOrType, checkRequiredAndType, checkEmptyOrOneOf } from "../../utils/index";
|
|
3
3
|
import { version } from "../../../../package";
|
|
4
4
|
import { ANIMATION_KEYS } from "../../types/icon-animations";
|
|
5
5
|
const CDN_URL = `https://unpkg.com/@swisspost/design-system-icons@${version}/public/post-icons/`;
|
|
@@ -45,7 +45,11 @@ export class PostIcon {
|
|
|
45
45
|
**/
|
|
46
46
|
getUrl() {
|
|
47
47
|
const fileName = `${this.name}.svg`;
|
|
48
|
-
|
|
48
|
+
// Prioritize only data:image URLs
|
|
49
|
+
if (this.url?.startsWith('data:image/')) {
|
|
50
|
+
return this.url;
|
|
51
|
+
}
|
|
52
|
+
if (Build.isServer && !this.base) {
|
|
49
53
|
return `${CDN_URL}${fileName}`;
|
|
50
54
|
}
|
|
51
55
|
if (this.url) {
|
|
@@ -53,13 +57,13 @@ export class PostIcon {
|
|
|
53
57
|
}
|
|
54
58
|
const isAbsolute = (url) => /^https?:\/\//.test(url);
|
|
55
59
|
const normalizeUrl = (url) => (url && !url.endsWith('/') ? `${url}/` : url);
|
|
56
|
-
const cleanUrl = (url) => url.
|
|
57
|
-
const currentDomain =
|
|
58
|
-
const baseHref =
|
|
60
|
+
const cleanUrl = (url) => url.replaceAll(/([^:])\/\//g, '$1/');
|
|
61
|
+
const currentDomain = Build.isBrowser ? globalThis.location.origin : '';
|
|
62
|
+
const baseHref = Build.isBrowser
|
|
59
63
|
? document.querySelector('base[href]')?.getAttribute('href') || ''
|
|
60
64
|
: '';
|
|
61
65
|
let metaIconBase = '';
|
|
62
|
-
if (
|
|
66
|
+
if (Build.isBrowser) {
|
|
63
67
|
const metaTag = document.querySelector('meta[name="design-system-settings"]');
|
|
64
68
|
metaIconBase = metaTag?.getAttribute('data-post-icon-base') || '';
|
|
65
69
|
}
|
|
@@ -92,14 +96,13 @@ export class PostIcon {
|
|
|
92
96
|
}
|
|
93
97
|
getStyles() {
|
|
94
98
|
const url = this.getUrl();
|
|
95
|
-
return Object.entries({
|
|
99
|
+
return Object.fromEntries(Object.entries({
|
|
96
100
|
'-webkit-mask-image': `url(${url})`,
|
|
97
101
|
'mask-image': `url('${url}')`,
|
|
98
|
-
'transform': (this.scale && !isNaN(Number(this.scale)) ? 'scale(' + this.scale + ')' : '') +
|
|
99
|
-
(this.rotate && !isNaN(Number(this.rotate)) ? ' rotate(' + this.rotate + 'deg)' : ''),
|
|
102
|
+
'transform': (this.scale && !Number.isNaN(Number(this.scale)) ? 'scale(' + this.scale + ')' : '') +
|
|
103
|
+
(this.rotate && !Number.isNaN(Number(this.rotate)) ? ' rotate(' + this.rotate + 'deg)' : ''),
|
|
100
104
|
})
|
|
101
|
-
.filter(([_key, value]) => value !== null)
|
|
102
|
-
.reduce((styles, [key, value]) => Object.assign(styles, { [key]: value }), {});
|
|
105
|
+
.filter(([_key, value]) => value !== null));
|
|
103
106
|
}
|
|
104
107
|
componentDidLoad() {
|
|
105
108
|
this.validateBase();
|
|
@@ -109,7 +112,7 @@ export class PostIcon {
|
|
|
109
112
|
this.validateAnimation();
|
|
110
113
|
}
|
|
111
114
|
render() {
|
|
112
|
-
return (h(Host, { key: '
|
|
115
|
+
return (h(Host, { key: '53aca4224876ae30f8a022c5cb80ee5755b26251', "data-version": version }, h("span", { key: '8e024aa2df513f3b75d61d15284c77883b622776', style: this.getStyles() })));
|
|
113
116
|
}
|
|
114
117
|
static get is() { return "post-icon"; }
|
|
115
118
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:host{display:flex}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}.post-language-menu-dropdown-container{display:flex;flex-direction:column}.post-language-menu-trigger{display:inline-flex;position:relative;align-items:center;justify-content:center;max-width:100%;overflow:hidden;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;border-width:var(--post-device-border-width-default);border-style:solid;border-radius:var(--post-device-border-radius-round);background-color:rgba(0,0,0,0);box-shadow:none;font-family:inherit;font-weight:var(--post-device-font-weight-bold);text-decoration:none;white-space:nowrap;cursor:pointer;border:unset;font-weight:unset;display:flex;padding:.25rem .625rem;gap:.375rem;font-size:1rem;border-color:var(--post-scheme-color-interactive-button-tertiary-enabled-stroke);background-color:var(--post-scheme-color-interactive-button-tertiary-enabled-bg);color:var(--post-scheme-color-interactive-button-tertiary-enabled-fg);text-transform:uppercase;cursor:pointer}.post-language-menu-trigger:hover{text-decoration:none}.post-language-menu-trigger:disabled{border-style:var(--post-core-border-style-dash)}.post-language-menu-trigger{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}.post-language-menu-trigger: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){.post-language-menu-trigger:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.post-language-menu-trigger: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){.post-language-menu-trigger: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){.post-language-menu-trigger:is(a){color:LinkText;border:unset}.post-language-menu-trigger:is(button){background-color:ButtonFace !important;border:1px solid ButtonBorder !important}.post-language-menu-trigger:not(:disabled,.disabled):is(button):hover{background-color:Highlight !important}.post-language-menu-trigger:not(:disabled,.disabled):is(button):hover>post-icon{color:HighlightText !important}}.post-language-menu-trigger:hover{border-color:var(--post-scheme-color-interactive-button-tertiary-hover-stroke);background-color:var(--post-scheme-color-interactive-button-tertiary-hover-bg);color:var(--post-scheme-color-interactive-button-tertiary-hover-fg)}.post-language-menu-trigger:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active){box-shadow:var(--post-device-elevation-100);border-color:var(--post-scheme-color-interactive-button-primary-enabled-stroke);background-color:var(--post-scheme-color-interactive-button-primary-enabled-bg);color:var(--post-scheme-color-interactive-button-primary-enabled-fg)}.post-language-menu-trigger:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active):hover{border-color:var(--post-scheme-color-interactive-button-primary-hover-stroke);background-color:var(--post-scheme-color-interactive-button-primary-hover-bg);color:var(--post-scheme-color-interactive-button-primary-hover-fg)}.post-language-menu-trigger post-icon{transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1)}.post-language-menu-trigger:is([aria-current],[aria-pressed=true],[aria-expanded=true]) post-icon{transform:rotate(180deg)}
|
|
1
|
+
:host{display:flex}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}.post-language-menu-dropdown-container{display:flex;flex-direction:column}.post-language-menu-trigger{display:inline-flex;position:relative;align-items:center;justify-content:center;max-width:100%;overflow:hidden;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;border-width:var(--post-device-border-width-default);border-style:solid;border-radius:var(--post-device-border-radius-round);background-color:rgba(0,0,0,0);box-shadow:none;font-family:inherit;font-weight:var(--post-device-font-weight-bold);text-decoration:none;white-space:nowrap;cursor:pointer;border:unset;font-weight:unset;display:flex;padding:.25rem .625rem;gap:.375rem;font-size:1rem;border-color:var(--post-scheme-color-interactive-button-tertiary-enabled-stroke);background-color:var(--post-scheme-color-interactive-button-tertiary-enabled-bg);color:var(--post-scheme-color-interactive-button-tertiary-enabled-fg);text-transform:uppercase;cursor:pointer}.post-language-menu-trigger:hover{text-decoration:none}.post-language-menu-trigger:disabled{border-style:var(--post-core-border-style-dash)}.post-language-menu-trigger{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}.post-language-menu-trigger: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){.post-language-menu-trigger:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.post-language-menu-trigger: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){.post-language-menu-trigger: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){.post-language-menu-trigger:is(a){color:LinkText;border:unset}.post-language-menu-trigger:is(button){background-color:ButtonFace !important;border:1px solid ButtonBorder !important}.post-language-menu-trigger:not(:disabled,.disabled):is(button):hover{background-color:Highlight !important}.post-language-menu-trigger:not(:disabled,.disabled):is(button):hover>post-icon{color:HighlightText !important}}.post-language-menu-trigger:hover{border-color:var(--post-scheme-color-interactive-button-tertiary-hover-stroke);background-color:var(--post-scheme-color-interactive-button-tertiary-hover-bg);color:var(--post-scheme-color-interactive-button-tertiary-hover-fg)}.post-language-menu-trigger:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active){box-shadow:var(--post-device-elevation-100);border-color:var(--post-scheme-color-interactive-button-primary-enabled-stroke);background-color:var(--post-scheme-color-interactive-button-primary-enabled-bg);color:var(--post-scheme-color-interactive-button-primary-enabled-fg)}.post-language-menu-trigger:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active):hover{border-color:var(--post-scheme-color-interactive-button-primary-hover-stroke);background-color:var(--post-scheme-color-interactive-button-primary-hover-bg);color:var(--post-scheme-color-interactive-button-primary-hover-fg)}.post-language-menu-trigger post-icon{transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1)}.post-language-menu-trigger:is([aria-current],[aria-pressed=true],[aria-expanded=true]) post-icon{transform:rotate(180deg)}.post-language-menu-list{margin-top:1rem}
|
|
@@ -40,7 +40,7 @@ export class PostLanguageMenu {
|
|
|
40
40
|
const activeLanguage = this.activeLang &&
|
|
41
41
|
document.querySelector(`post-language-menu-item[code="${this.activeLang}"]`);
|
|
42
42
|
return activeLanguage
|
|
43
|
-
? this.textCurrentLanguage.
|
|
43
|
+
? this.textCurrentLanguage.replaceAll('#name', activeLanguage.name)
|
|
44
44
|
: undefined;
|
|
45
45
|
}
|
|
46
46
|
componentDidLoad() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
post-language-menu-item{
|
|
1
|
+
post-language-menu-item :is(a,button){text-transform:uppercase}post-language-menu-item:where([variant=menu]){min-width:72px}post-language-menu-item:where([variant=list]) button{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-language-menu-item:where([variant=list]) button{background-color:ButtonFace !important}post-language-menu-item:where([variant=list]) button:hover{background-color:Highlight !important}}post-language-menu-item:where([variant=list]) a{text-decoration:none;display:inline-flex;align-items:center;justify-content:center}post-language-menu-item:where([variant=list]) :is(a,button){width:40px;height:40px;border-radius:2px;border-color:var(--post-scheme-color-interactive-button-tertiary-enabled-stroke);background-color:var(--post-scheme-color-interactive-button-tertiary-enabled-bg);color:var(--post-scheme-color-interactive-button-tertiary-enabled-fg)}post-language-menu-item:where([variant=list]) :is(a,button):hover{border-color:var(--post-scheme-color-interactive-button-tertiary-hover-stroke);background-color:var(--post-scheme-color-interactive-button-tertiary-hover-bg);color:var(--post-scheme-color-interactive-button-tertiary-hover-fg)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-language-menu-item:where([variant=list]) :is(a,button){border:1px solid ButtonBorder;color:ButtonText}}post-language-menu-item[active]:not([active=false]):where([variant=menu]){display:none}post-language-menu-item[active]:not([active=false]):where([variant=list]) :is(a,button){border-color:var(--post-scheme-color-interactive-button-primary-enabled-stroke);background-color:var(--post-scheme-color-interactive-button-primary-enabled-bg);color:var(--post-scheme-color-interactive-button-primary-enabled-fg);cursor:default}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-language-menu-item[active]:not([active=false]):where([variant=list]) :is(a,button){background-color:Highlight !important;color:HighlightText}}post-language-menu-item .visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}
|
|
@@ -49,7 +49,8 @@ export class PostLanguageMenuItem {
|
|
|
49
49
|
this.emitChange();
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
|
-
|
|
52
|
+
const interactiveElement = this.url ? (h("a", { "aria-current": this.active ? 'page' : undefined, href: this.url, hrefLang: lang, lang: lang, onClick: () => this.emitChange(), onKeyDown: emitOnKeyDown }, h("slot", null), h("span", { class: "visually-hidden" }, this.name))) : (h("button", { "aria-current": this.active ? 'true' : undefined, lang: lang, onClick: () => this.emitChange(), onKeyDown: emitOnKeyDown }, h("slot", null), h("span", { class: "visually-hidden" }, this.name)));
|
|
53
|
+
return this.variant === 'list' ? (h(Host, { "data-version": version, role: "listitem" }, interactiveElement)) : (h(Host, { "data-version": version }, h("post-menu-item", null, interactiveElement)));
|
|
53
54
|
}
|
|
54
55
|
static get is() { return "post-language-menu-item"; }
|
|
55
56
|
static get originalStyleUrls() {
|
|
@@ -55,7 +55,7 @@ export class PostLinkarea {
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
render() {
|
|
58
|
-
return (h(Host, { key: '
|
|
58
|
+
return (h(Host, { key: 'cb2563465ebe024e8e98539c27c7a8d7084229d3', "data-version": version, onClick: (e) => this.dispatchClick(e) }, h("slot", { key: '68fc1468da418e4ed38e89cbf7ef932f819993dd' })));
|
|
59
59
|
}
|
|
60
60
|
static get is() { return "post-linkarea"; }
|
|
61
61
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
post-popovercontainer{border-radius:4px;overflow:hidden;box-shadow:var(--post-device-elevation-300)}div[role=listbox]{max-height:384px;overflow:auto;display:flex;flex-direction:column}::slotted([slot=blank-slate]){display:block;padding:.75rem;color:#666}
|
|
@@ -0,0 +1,293 @@
|
|
|
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 { h, Host } from "@stencil/core";
|
|
12
|
+
import { version } from "../../../../package";
|
|
13
|
+
import { EventFrom } from "../../utils/index";
|
|
14
|
+
export class PostListbox {
|
|
15
|
+
constructor() {
|
|
16
|
+
this.highlightedIndex = -1;
|
|
17
|
+
this.visibleOptions = [];
|
|
18
|
+
this.diacriticPattern = /[\u0300-\u036F]/u;
|
|
19
|
+
this.registerOptions = () => {
|
|
20
|
+
this.visibleOptions = this.options;
|
|
21
|
+
};
|
|
22
|
+
this.updateSelection = (value) => {
|
|
23
|
+
this.options.forEach(option => {
|
|
24
|
+
option.selected = option.value === value;
|
|
25
|
+
option.highlighted = false;
|
|
26
|
+
});
|
|
27
|
+
this.highlightedIndex = -1;
|
|
28
|
+
this.filter('');
|
|
29
|
+
};
|
|
30
|
+
this.clearActive = () => {
|
|
31
|
+
this.highlightedIndex = -1;
|
|
32
|
+
this.postOptionActive.emit(null);
|
|
33
|
+
};
|
|
34
|
+
this.normalizeText = (text) => {
|
|
35
|
+
return text.trim().normalize('NFD').replace(this.diacriticPattern, '').toLocaleLowerCase();
|
|
36
|
+
};
|
|
37
|
+
this.resetFilter = () => {
|
|
38
|
+
this.visibleOptions = this.options;
|
|
39
|
+
this.options.forEach(option => {
|
|
40
|
+
option.hidden = false;
|
|
41
|
+
option.highlighted = false;
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
get options() {
|
|
46
|
+
return Array.from(this.host.querySelectorAll('post-listbox-option'));
|
|
47
|
+
}
|
|
48
|
+
get inputElement() {
|
|
49
|
+
let autocomplete = this.host.closest('post-autocomplete');
|
|
50
|
+
if (!autocomplete) {
|
|
51
|
+
autocomplete = document.querySelector(`post-autocomplete[listbox="${this.host.id}"]`);
|
|
52
|
+
}
|
|
53
|
+
return autocomplete?.querySelector('input');
|
|
54
|
+
}
|
|
55
|
+
componentWillLoad() {
|
|
56
|
+
this.registerOptions();
|
|
57
|
+
}
|
|
58
|
+
/** Opens the listbox */
|
|
59
|
+
async show() {
|
|
60
|
+
const input = this.inputElement;
|
|
61
|
+
if (input) {
|
|
62
|
+
this.popoverContainer?.show(input);
|
|
63
|
+
this.host.role = 'listbox';
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/** Closes the listbox */
|
|
67
|
+
async hide() {
|
|
68
|
+
this.host.removeAttribute('role');
|
|
69
|
+
this.popoverContainer?.hide();
|
|
70
|
+
}
|
|
71
|
+
/** Uses the internal default filtering mode to filter the list of options.
|
|
72
|
+
* An empty string resets the filter to it's original state. */
|
|
73
|
+
async filter(query) {
|
|
74
|
+
const normalizedQuery = this.normalizeText(query);
|
|
75
|
+
if (normalizedQuery) {
|
|
76
|
+
this.visibleOptions = this.options.filter(option => {
|
|
77
|
+
const normalizedText = this.normalizeText(option.textContent);
|
|
78
|
+
const normalizedValue = this.normalizeText(option.value);
|
|
79
|
+
const isVisible = normalizedValue.includes(normalizedQuery) || normalizedText.includes(normalizedQuery);
|
|
80
|
+
option.hidden = !isVisible;
|
|
81
|
+
return isVisible;
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
this.resetFilter();
|
|
86
|
+
}
|
|
87
|
+
this.clearActive();
|
|
88
|
+
}
|
|
89
|
+
/** Clears the currently selected option */
|
|
90
|
+
async clearSelection() {
|
|
91
|
+
this.updateSelection();
|
|
92
|
+
}
|
|
93
|
+
/** Navigates the listbox options in the specified direction and scrolls the active option into view.*/
|
|
94
|
+
async navigate(direction) {
|
|
95
|
+
if (this.visibleOptions.length === 0)
|
|
96
|
+
return;
|
|
97
|
+
if (this.highlightedIndex >= 0) {
|
|
98
|
+
this.visibleOptions[this.highlightedIndex].highlighted = false;
|
|
99
|
+
}
|
|
100
|
+
switch (direction) {
|
|
101
|
+
case 'first':
|
|
102
|
+
this.highlightedIndex = 0;
|
|
103
|
+
break;
|
|
104
|
+
case 'last':
|
|
105
|
+
this.highlightedIndex = this.visibleOptions.length - 1;
|
|
106
|
+
break;
|
|
107
|
+
case 'up':
|
|
108
|
+
this.highlightedIndex =
|
|
109
|
+
(this.highlightedIndex - 1 + this.visibleOptions.length) % this.visibleOptions.length;
|
|
110
|
+
break;
|
|
111
|
+
case 'down':
|
|
112
|
+
this.highlightedIndex = (this.highlightedIndex + 1) % this.visibleOptions.length;
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
const activeOption = this.visibleOptions[this.highlightedIndex];
|
|
116
|
+
activeOption.scrollIntoView({ behavior: 'smooth', block: 'end' });
|
|
117
|
+
activeOption.highlighted = true;
|
|
118
|
+
this.postOptionActive.emit(activeOption.id);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Selects the currently highlighted option in the listbox and scrolls it into view.
|
|
122
|
+
*/
|
|
123
|
+
async selectActive() {
|
|
124
|
+
if (this.highlightedIndex >= 0) {
|
|
125
|
+
const activeOption = this.visibleOptions[this.highlightedIndex];
|
|
126
|
+
this.updateSelection(activeOption.value);
|
|
127
|
+
this.host.dispatchEvent(new CustomEvent('postOptionSelected', { bubbles: true, detail: activeOption.value }));
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
optionClicked(event) {
|
|
131
|
+
this.updateSelection(event.detail);
|
|
132
|
+
}
|
|
133
|
+
render() {
|
|
134
|
+
return (h(Host, { key: 'a69ea3f635246ef33f482f3bdf5f40e3cd167846', "data-version": version }, h("post-popovercontainer", { key: '20a8d8721127c0d51d320f650ec92e4f72c9d50c', placement: "bottom-start", ref: el => (this.popoverContainer = el) }, this.visibleOptions.length === 0 ? h("slot", { name: "blank-slate" }) : h("slot", null))));
|
|
135
|
+
}
|
|
136
|
+
static get is() { return "post-listbox"; }
|
|
137
|
+
static get encapsulation() { return "shadow"; }
|
|
138
|
+
static get originalStyleUrls() {
|
|
139
|
+
return {
|
|
140
|
+
"$": ["post-listbox.scss"]
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
static get styleUrls() {
|
|
144
|
+
return {
|
|
145
|
+
"$": ["post-listbox.css"]
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
static get events() {
|
|
149
|
+
return [{
|
|
150
|
+
"method": "postOptionActive",
|
|
151
|
+
"name": "postOptionActive",
|
|
152
|
+
"bubbles": true,
|
|
153
|
+
"cancelable": true,
|
|
154
|
+
"composed": true,
|
|
155
|
+
"docs": {
|
|
156
|
+
"tags": [],
|
|
157
|
+
"text": "Emitted option id for the active option"
|
|
158
|
+
},
|
|
159
|
+
"complexType": {
|
|
160
|
+
"original": "string | null",
|
|
161
|
+
"resolved": "string",
|
|
162
|
+
"references": {}
|
|
163
|
+
}
|
|
164
|
+
}];
|
|
165
|
+
}
|
|
166
|
+
static get methods() {
|
|
167
|
+
return {
|
|
168
|
+
"show": {
|
|
169
|
+
"complexType": {
|
|
170
|
+
"signature": "() => Promise<void>",
|
|
171
|
+
"parameters": [],
|
|
172
|
+
"references": {
|
|
173
|
+
"Promise": {
|
|
174
|
+
"location": "global",
|
|
175
|
+
"id": "global::Promise"
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
"return": "Promise<void>"
|
|
179
|
+
},
|
|
180
|
+
"docs": {
|
|
181
|
+
"text": "Opens the listbox",
|
|
182
|
+
"tags": []
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
"hide": {
|
|
186
|
+
"complexType": {
|
|
187
|
+
"signature": "() => Promise<void>",
|
|
188
|
+
"parameters": [],
|
|
189
|
+
"references": {
|
|
190
|
+
"Promise": {
|
|
191
|
+
"location": "global",
|
|
192
|
+
"id": "global::Promise"
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
"return": "Promise<void>"
|
|
196
|
+
},
|
|
197
|
+
"docs": {
|
|
198
|
+
"text": "Closes the listbox",
|
|
199
|
+
"tags": []
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
"filter": {
|
|
203
|
+
"complexType": {
|
|
204
|
+
"signature": "(query: string) => Promise<void>",
|
|
205
|
+
"parameters": [{
|
|
206
|
+
"name": "query",
|
|
207
|
+
"type": "string",
|
|
208
|
+
"docs": ""
|
|
209
|
+
}],
|
|
210
|
+
"references": {
|
|
211
|
+
"Promise": {
|
|
212
|
+
"location": "global",
|
|
213
|
+
"id": "global::Promise"
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
"return": "Promise<void>"
|
|
217
|
+
},
|
|
218
|
+
"docs": {
|
|
219
|
+
"text": "Uses the internal default filtering mode to filter the list of options.\nAn empty string resets the filter to it's original state.",
|
|
220
|
+
"tags": []
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
"clearSelection": {
|
|
224
|
+
"complexType": {
|
|
225
|
+
"signature": "() => Promise<void>",
|
|
226
|
+
"parameters": [],
|
|
227
|
+
"references": {
|
|
228
|
+
"Promise": {
|
|
229
|
+
"location": "global",
|
|
230
|
+
"id": "global::Promise"
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
"return": "Promise<void>"
|
|
234
|
+
},
|
|
235
|
+
"docs": {
|
|
236
|
+
"text": "Clears the currently selected option",
|
|
237
|
+
"tags": []
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
"navigate": {
|
|
241
|
+
"complexType": {
|
|
242
|
+
"signature": "(direction: \"up\" | \"down\" | \"first\" | \"last\") => Promise<void>",
|
|
243
|
+
"parameters": [{
|
|
244
|
+
"name": "direction",
|
|
245
|
+
"type": "\"up\" | \"down\" | \"first\" | \"last\"",
|
|
246
|
+
"docs": ""
|
|
247
|
+
}],
|
|
248
|
+
"references": {
|
|
249
|
+
"Promise": {
|
|
250
|
+
"location": "global",
|
|
251
|
+
"id": "global::Promise"
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
"return": "Promise<void>"
|
|
255
|
+
},
|
|
256
|
+
"docs": {
|
|
257
|
+
"text": "Navigates the listbox options in the specified direction and scrolls the active option into view.",
|
|
258
|
+
"tags": []
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
"selectActive": {
|
|
262
|
+
"complexType": {
|
|
263
|
+
"signature": "() => Promise<void>",
|
|
264
|
+
"parameters": [],
|
|
265
|
+
"references": {
|
|
266
|
+
"Promise": {
|
|
267
|
+
"location": "global",
|
|
268
|
+
"id": "global::Promise"
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
"return": "Promise<void>"
|
|
272
|
+
},
|
|
273
|
+
"docs": {
|
|
274
|
+
"text": "Selects the currently highlighted option in the listbox and scrolls it into view.",
|
|
275
|
+
"tags": []
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
static get elementRef() { return "host"; }
|
|
281
|
+
static get listeners() {
|
|
282
|
+
return [{
|
|
283
|
+
"name": "postOptionSelected",
|
|
284
|
+
"method": "optionClicked",
|
|
285
|
+
"target": undefined,
|
|
286
|
+
"capture": false,
|
|
287
|
+
"passive": false
|
|
288
|
+
}];
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
__decorate([
|
|
292
|
+
EventFrom('post-listbox-option')
|
|
293
|
+
], PostListbox.prototype, "optionClicked", null);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:host{padding:12px 12px 9px 16px;background-color:#fff;cursor:pointer;user-select:none;display:flex;align-items:center;gap:8px;justify-content:space-between}:host(:hover){background-color:#f0efed}:host([data-active=true]){outline:2px solid #000;outline-offset:-4px}:host([hidden]){display:none}:host(:focus-visible){outline:2px solid #050400;outline-offset:2px}.option-content{display:flex;flex-direction:column;min-width:0}.option-description{display:none;font-size:.85em;color:#666}:host(:not(:empty)) .option-description{display:block}post-icon{width:24px;height:24px}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
import { version } from "../../../../package";
|
|
3
|
+
export class PostListboxOption {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.optionId = crypto.randomUUID();
|
|
6
|
+
/** Represents option is selected . */
|
|
7
|
+
this.selected = false;
|
|
8
|
+
/** Represents option is highlighted . */
|
|
9
|
+
this.highlighted = false;
|
|
10
|
+
}
|
|
11
|
+
render() {
|
|
12
|
+
return (h(Host, { key: 'ff0e773f8a89f9df3996a83cd2be6247c1ab5475', "data-version": version, role: "option", "aria-selected": `${this.selected}`, "data-active": this.highlighted ? 'true' : null,
|
|
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: 'cb43e8bec5f262ae25ddfdcae1b7f9979bdd6858', class: "option-content" }, this.value, h("span", { key: '5b314c41073a357185613a04a07d2020e4eab300', class: "option-description" }, h("slot", { key: 'ac1ed1be98f9a348952c0169d7ec89f8aaa99474' }))), this.selected && h("post-icon", { key: '7691085df732c0c2c5db9824587d54047017adf5', "aria-hidden": "true", name: "checkmark" })));
|
|
15
|
+
}
|
|
16
|
+
static get is() { return "post-listbox-option"; }
|
|
17
|
+
static get encapsulation() { return "shadow"; }
|
|
18
|
+
static get originalStyleUrls() {
|
|
19
|
+
return {
|
|
20
|
+
"$": ["post-listbox-option.scss"]
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
static get styleUrls() {
|
|
24
|
+
return {
|
|
25
|
+
"$": ["post-listbox-option.css"]
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
static get properties() {
|
|
29
|
+
return {
|
|
30
|
+
"value": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"mutable": false,
|
|
33
|
+
"complexType": {
|
|
34
|
+
"original": "string",
|
|
35
|
+
"resolved": "string",
|
|
36
|
+
"references": {}
|
|
37
|
+
},
|
|
38
|
+
"required": true,
|
|
39
|
+
"optional": false,
|
|
40
|
+
"docs": {
|
|
41
|
+
"tags": [],
|
|
42
|
+
"text": "A value string, similar to <option value=\"Value 1\">Value 1 description</option>"
|
|
43
|
+
},
|
|
44
|
+
"getter": false,
|
|
45
|
+
"setter": false,
|
|
46
|
+
"reflect": true,
|
|
47
|
+
"attribute": "value"
|
|
48
|
+
},
|
|
49
|
+
"selected": {
|
|
50
|
+
"type": "boolean",
|
|
51
|
+
"mutable": false,
|
|
52
|
+
"complexType": {
|
|
53
|
+
"original": "boolean",
|
|
54
|
+
"resolved": "boolean",
|
|
55
|
+
"references": {}
|
|
56
|
+
},
|
|
57
|
+
"required": false,
|
|
58
|
+
"optional": false,
|
|
59
|
+
"docs": {
|
|
60
|
+
"tags": [],
|
|
61
|
+
"text": "Represents option is selected ."
|
|
62
|
+
},
|
|
63
|
+
"getter": false,
|
|
64
|
+
"setter": false,
|
|
65
|
+
"reflect": true,
|
|
66
|
+
"attribute": "selected",
|
|
67
|
+
"defaultValue": "false"
|
|
68
|
+
},
|
|
69
|
+
"highlighted": {
|
|
70
|
+
"type": "boolean",
|
|
71
|
+
"mutable": false,
|
|
72
|
+
"complexType": {
|
|
73
|
+
"original": "boolean",
|
|
74
|
+
"resolved": "boolean",
|
|
75
|
+
"references": {}
|
|
76
|
+
},
|
|
77
|
+
"required": false,
|
|
78
|
+
"optional": false,
|
|
79
|
+
"docs": {
|
|
80
|
+
"tags": [],
|
|
81
|
+
"text": "Represents option is highlighted ."
|
|
82
|
+
},
|
|
83
|
+
"getter": false,
|
|
84
|
+
"setter": false,
|
|
85
|
+
"reflect": true,
|
|
86
|
+
"attribute": "highlighted",
|
|
87
|
+
"defaultValue": "false"
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
static get events() {
|
|
92
|
+
return [{
|
|
93
|
+
"method": "postOptionSelected",
|
|
94
|
+
"name": "postOptionSelected",
|
|
95
|
+
"bubbles": true,
|
|
96
|
+
"cancelable": true,
|
|
97
|
+
"composed": true,
|
|
98
|
+
"docs": {
|
|
99
|
+
"tags": [],
|
|
100
|
+
"text": "Fires when this option was selected. Bubbles up."
|
|
101
|
+
},
|
|
102
|
+
"complexType": {
|
|
103
|
+
"original": "string",
|
|
104
|
+
"resolved": "string",
|
|
105
|
+
"references": {}
|
|
106
|
+
}
|
|
107
|
+
}];
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -20,7 +20,7 @@ export class PostLogo {
|
|
|
20
20
|
render() {
|
|
21
21
|
const logoLink = this.url && (typeof this.url === 'string' ? this.url : this.url.href);
|
|
22
22
|
const LogoTag = logoLink ? 'a' : 'span';
|
|
23
|
-
return (h(Host, { key: '
|
|
23
|
+
return (h(Host, { key: '4c2a5854fc2499198b289181136cbd0a2fd9c1e1', "data-version": version }, h(LogoTag, { key: '4696e7329e8821e010f8cf0de367551f9fec448c', class: `logo ${logoLink ? 'logo-link' : ''}`, ...(logoLink ? { href: logoLink } : {}) }, h("span", { key: 'd4bec68539d393a5eced24f0b0ab521f40b13b4b', class: "description" }, h("slot", { key: '43b6f18561aec0b83cde540b4a6370fda2717cc2', onSlotchange: () => this.checkDescription() })), h("svg", { key: '9ee91a5dc0e1553bd54eb90bce0036f59f7ee62a', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 72 72", "aria-hidden": "true" }, h("g", { key: '6accd8ec83c793b4b5ae0412b21ea97c4db1a05f', id: "Logo" }, h("rect", { key: '5eee4130c5c766f46769b3fe00bab45f2c4a0a51', fill: "#ffcc00", x: "0", y: "0", width: "72", height: "72" }), h("polygon", { key: '4f33978c01fe70f6b4b9ede345624378ec488b25', fill: "#ff0000", points: "34,32.3 34,19 19.7,19 19.7,29.1 10,29.1 10,42.9 19.7,42.9 19.7,53 34,53 34,39.7 30.6,39.7 30.6,49.8 23.1,49.8 23.1,39.7 13.4,39.7 13.4,32.3 23.1,32.3 23.1,22.2 30.6,22.2 30.6,32.3" }), h("path", { key: 'c680032facb04b9869778712dcb50b0bb166922c', d: "M53.56234,31.10526c0,2.41272-1.99154,4.29475-4.51723,4.29475H45.2v-8.3h3.84511C51.66802,27.1,53.56234,28.78889,53.56234,31.10526z M50.69666,19H36v34h9.2V42.9h5.49666c6.75131,0,11.9971-5.15137,11.9971-11.8057C62.69376,24.39136,57.35099,19,50.69666,19z" }))))));
|
|
24
24
|
}
|
|
25
25
|
static get is() { return "post-logo"; }
|
|
26
26
|
static get encapsulation() { return "shadow"; }
|
|
@@ -123,7 +123,7 @@ export class PostMainnavigation {
|
|
|
123
123
|
}, NAVBAR_DISABLE_DURATION);
|
|
124
124
|
}
|
|
125
125
|
render() {
|
|
126
|
-
return (h(Host, { key: '
|
|
126
|
+
return (h(Host, { key: '7bdd80e16b223324417ffbacdcadcb842c559d26', version: version, class: this.canScroll ? 'scrollable' : '' }, h("div", { key: '087cfbe84c8970ab26b394b6e96298cbc0df71ec', "aria-hidden": "true", class: { 'scroll-control scroll-left': true, 'd-none': !this.canScrollLeft }, onMouseDown: e => this.handleScrollButtonClick(e, 'left') }, h("post-icon", { key: '6d4cbd054346c8ac28ad54ad00887d042e41f78d', "aria-hidden": "true", name: "chevronleft" })), h("nav", { key: 'db4cb2f45e19d458cede13f9b62dbcb5836f6127', ref: el => (this.navbar = el), "aria-label": this.textMain }, h("slot", { key: '00fbab4d3e498a0943c9298801dd9629e34a0eea' })), h("div", { key: '678872aef2d26f52f8b838e47ef7a631e71cb7a6', "aria-hidden": "true", class: { 'scroll-control scroll-right': true, 'd-none': !this.canScrollRight }, onMouseDown: e => this.handleScrollButtonClick(e, 'right') }, h("post-icon", { key: '233bebc886e69c27651ebaf2a678fa6d64f1f7cf', "aria-hidden": "true", name: "chevronright" }))));
|
|
127
127
|
}
|
|
128
128
|
static get is() { return "post-mainnavigation"; }
|
|
129
129
|
static get encapsulation() { return "shadow"; }
|
|
@@ -61,7 +61,7 @@ export class PostMegadropdown {
|
|
|
61
61
|
this.handleClickOutside = this.handleClickOutside.bind(this);
|
|
62
62
|
}
|
|
63
63
|
connectedCallback() {
|
|
64
|
-
|
|
64
|
+
globalThis.addEventListener('postBreakpoint:device', this.breakpointChange.bind(this));
|
|
65
65
|
}
|
|
66
66
|
componentDidRender() {
|
|
67
67
|
this.getFocusableElements();
|
|
@@ -74,7 +74,7 @@ export class PostMegadropdown {
|
|
|
74
74
|
this.handleAriaCurrentChange([]);
|
|
75
75
|
}
|
|
76
76
|
disconnectedCallback() {
|
|
77
|
-
|
|
77
|
+
globalThis.removeEventListener('postBreakpoint:device', this.breakpointChange.bind(this));
|
|
78
78
|
if (PostMegadropdown.activeDropdown === this)
|
|
79
79
|
PostMegadropdown.activeDropdown = null;
|
|
80
80
|
this.removeListeners();
|
|
@@ -222,7 +222,7 @@ export class PostMegadropdown {
|
|
|
222
222
|
...getFocusableChildren(this.host.shadowRoot),
|
|
223
223
|
];
|
|
224
224
|
this.firstFocusableEl = focusableElements[0];
|
|
225
|
-
this.lastFocusableEl = focusableElements
|
|
225
|
+
this.lastFocusableEl = focusableElements.at(-1);
|
|
226
226
|
}
|
|
227
227
|
// Loop through the focusable children
|
|
228
228
|
keyboardHandler(e) {
|
|
@@ -277,7 +277,7 @@ export class PostMegadropdown {
|
|
|
277
277
|
* and sets the trigger as active accordingly.
|
|
278
278
|
*/
|
|
279
279
|
handleAriaCurrentChange(mutations) {
|
|
280
|
-
if (
|
|
280
|
+
if (mutations.length === 0)
|
|
281
281
|
return;
|
|
282
282
|
const hasCurrentPage = mutations.some(m => m.target instanceof HTMLElement && m.target.getAttribute('aria-current') === 'page');
|
|
283
283
|
this.setTriggerActive(hasCurrentPage);
|
|
@@ -293,7 +293,7 @@ export class PostMegadropdown {
|
|
|
293
293
|
}
|
|
294
294
|
render() {
|
|
295
295
|
const containerStyle = this.isVisible ? {} : { display: 'none' };
|
|
296
|
-
return (h(Host, { key: '
|
|
296
|
+
return (h(Host, { key: 'f3794c85cf7972c3a30145726e07675d88875ad8', version: version }, h("div", { key: '078a4489e17db573136caa9212a0bf1010c328ef', ref: el => (this.animatedContainer = el), class: "megadropdown", style: containerStyle }, h("div", { key: 'fb51ea5e7a38a546ac54d73e7a0804c9e2f3db79', class: "section" }, this.device !== 'desktop' && this.megadropdownTitle && (h("p", { key: 'cdc95d1af137074d8f117b7ab44ae58c20804d31', class: "megadropdown-title" }, this.megadropdownTitle)), h("div", { key: '4f205271deab921c732c10f59f951e0d1559cafb', class: "megadropdown-content" }, h("slot", { key: '218f174cfefef460dcd2f4a4be35107e0a5cd95e' })), this.device === 'desktop' ? (h("post-closebutton", { onClick: () => this.hide(true), class: "close-button", size: "small", placement: "manual" }, this.textClose)) : (h("button", { onClick: () => this.hide(true), class: "back-button" }, h("post-icon", { name: "arrowleft" }), this.textBack))))));
|
|
297
297
|
}
|
|
298
298
|
static get is() { return "post-megadropdown"; }
|
|
299
299
|
static get encapsulation() { return "shadow"; }
|
|
@@ -77,7 +77,7 @@ export class PostMegadropdownTrigger {
|
|
|
77
77
|
this.megadropdown.toggle();
|
|
78
78
|
}
|
|
79
79
|
render() {
|
|
80
|
-
return (h(Host, { key: '
|
|
80
|
+
return (h(Host, { key: '3ff98d284d7ffcf3605e9fbfa44dda294ae02eb9', "data-version": version }, h("button", { key: 'e87d23a68473518e41199a253b3aa23dfc5fe6ca', ref: el => (this.interactiveButton = el), type: "button", "aria-haspopup": "menu", "aria-expanded": this.isMegadropdownExpanded.toString(), onClick: this.onClick.bind(this), onKeyDown: this.onKeyDown.bind(this), class: { active: this.active } }, h("span", { key: 'b0c478e81171df7534255dcfedcc2c1401d59d7e' }, h("span", { key: 'aa226c2f92b49aeefcf61ab8ce75b72a1a731850', innerHTML: this.slottedContent }), h("span", { key: '2e30aff042547cecc77c34d3f78a58fb0ca2e2bb', "aria-hidden": "true" }, h("slot", { key: 'b285e45d776f2cbf17e2f01f400a01d3bbb6f588' }))), h("post-icon", { key: 'f65a12ebf1e5261633a7cd83f3273f157bcdc6ef', name: "chevrondown" }))));
|
|
81
81
|
}
|
|
82
82
|
static get is() { return "post-megadropdown-trigger"; }
|
|
83
83
|
static get encapsulation() { return "shadow"; }
|