@swisspost/design-system-components 9.0.0-next.9 → 9.0.1
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/{index-5d4e0aed.js → index-824d2b71.js} +12 -2
- package/dist/cjs/{index-010dc207.js → index-e1f32cce.js} +17 -30
- package/dist/cjs/index.cjs.js +26 -50
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{package-8e810a59.js → package-93f142ae.js} +1 -1
- package/dist/cjs/{post-accordion-b9df8522.js → post-accordion-60af96cf.js} +3 -3
- package/dist/cjs/post-accordion-item-744c881d.js +52 -0
- package/dist/cjs/post-accordion-item.cjs.entry.js +4 -5
- package/dist/cjs/post-accordion.cjs.entry.js +3 -3
- package/dist/cjs/post-alert-2a768f58.js +99 -0
- package/dist/cjs/{post-banner.cjs.entry.js → post-alert.cjs.entry.js} +5 -6
- package/dist/cjs/post-card-control-197c8e44.js +272 -0
- package/dist/cjs/post-card-control.cjs.entry.js +3 -3
- package/dist/cjs/{post-collapsible-trigger-143cf84a.js → post-collapsible-trigger-3de8fe4e.js} +24 -11
- package/dist/cjs/post-collapsible_2.cjs.entry.js +4 -7
- package/dist/cjs/post-components.cjs.js +2 -2
- package/dist/cjs/post-icon-df629079.js +139 -0
- package/dist/cjs/post-icon.cjs.entry.js +16 -0
- package/dist/cjs/post-logo-7caeb918.js +39 -0
- package/dist/cjs/post-logo.cjs.entry.js +15 -0
- package/dist/cjs/post-popover-090c3d01.js +131 -0
- package/dist/cjs/post-popover.cjs.entry.js +3 -4
- package/dist/cjs/{post-togglebutton-0984a694.js → post-popovercontainer-872681bf.js} +148 -1106
- package/dist/cjs/post-popovercontainer.cjs.entry.js +11 -0
- package/dist/cjs/post-rating-21f9c46d.js +88 -0
- package/dist/cjs/post-rating.cjs.entry.js +3 -3
- package/dist/cjs/post-tab-header-422d0f03.js +32 -0
- package/dist/cjs/post-tab-header.cjs.entry.js +3 -3
- package/dist/cjs/{post-tab-panel-60f211a5.js → post-tab-panel-dd58f425.js} +3 -3
- package/dist/cjs/post-tab-panel.cjs.entry.js +3 -3
- package/dist/cjs/{post-tabs-1f797ce4.js → post-tabs-83191b9a.js} +5 -5
- package/dist/cjs/post-tabs.cjs.entry.js +3 -3
- package/dist/cjs/post-tag-c72183f2.js +47 -0
- package/dist/cjs/post-tag.cjs.entry.js +3 -3
- package/dist/cjs/post-tooltip-782f020b.js +69 -0
- package/dist/cjs/{post-tooltip-38c839a4.js → post-tooltip-trigger-b2aeb636.js} +507 -557
- package/dist/cjs/post-tooltip-trigger.cjs.entry.js +12 -0
- package/dist/cjs/post-tooltip.cjs.entry.js +3 -8
- package/dist/collection/collection-manifest.json +4 -21
- package/dist/collection/components/post-accordion/post-accordion.css +1 -1
- package/dist/collection/components/post-accordion/post-accordion.js +2 -2
- package/dist/collection/components/post-accordion-item/post-accordion-item.css +1 -1
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +10 -24
- package/dist/collection/components/post-alert/alert-types.js +1 -0
- package/dist/collection/components/post-alert/post-alert.css +35 -0
- package/dist/collection/components/{post-banner/post-banner.js → post-alert/post-alert.js} +68 -39
- package/dist/collection/components/post-card-control/post-card-control.css +30 -2
- package/dist/collection/components/post-card-control/post-card-control.js +8 -8
- package/dist/collection/components/post-collapsible/post-collapsible.js +2 -4
- package/dist/collection/components/post-icon/post-icon.css +1 -1
- package/dist/collection/components/post-icon/post-icon.js +52 -13
- package/dist/collection/components/post-logo/post-logo.js +1 -1
- package/dist/collection/components/post-popover/post-popover.css +30 -2
- package/dist/collection/components/post-popover/post-popover.js +10 -6
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +31 -1
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +180 -52
- package/dist/collection/components/post-rating/post-rating.css +29 -1
- package/dist/collection/components/post-rating/post-rating.js +1 -1
- package/dist/collection/components/post-tab-header/post-tab-header.css +29 -1
- package/dist/collection/components/post-tab-header/post-tab-header.js +1 -1
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +1 -1
- package/dist/collection/components/post-tabs/post-tabs.css +1 -1
- package/dist/collection/components/post-tabs/post-tabs.js +2 -2
- package/dist/collection/components/post-tag/post-tag.css +29 -1
- package/dist/collection/components/post-tag/post-tag.js +2 -2
- package/dist/collection/components/post-tooltip/post-tooltip.css +1 -1
- package/dist/collection/components/post-tooltip/post-tooltip.js +60 -213
- package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.css +1 -0
- package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +230 -0
- package/dist/collection/index.js +3 -20
- package/dist/components/index.js +3 -20
- package/dist/components/index2.js +1 -1
- package/dist/components/package.js +1 -1
- package/dist/components/post-accordion-item2.js +12 -30
- package/dist/components/post-accordion2.js +1 -1
- package/dist/components/{post-list.d.ts → post-alert.d.ts} +4 -4
- package/dist/components/post-alert.js +6 -0
- package/dist/components/post-alert2.js +136 -0
- package/dist/components/post-card-control2.js +3 -3
- package/dist/components/post-collapsible-trigger2.js +17 -2
- package/dist/components/post-collapsible2.js +3 -5
- package/dist/components/post-icon2.js +54 -15
- package/dist/components/post-logo2.js +1 -1
- package/dist/components/post-popover2.js +35 -8
- package/dist/components/post-popovercontainer2.js +136 -41
- package/dist/components/post-rating2.js +2 -2
- package/dist/components/post-tab-header2.js +2 -2
- package/dist/components/post-tab-panel2.js +1 -1
- package/dist/components/post-tabs2.js +3 -3
- package/dist/components/post-tag2.js +2 -2
- package/dist/components/{post-breadcrumb-item.d.ts → post-tooltip-trigger.d.ts} +4 -4
- package/dist/components/post-tooltip-trigger.js +6 -0
- package/dist/components/post-tooltip-trigger2.js +4968 -0
- package/dist/components/post-tooltip2.js +32 -4962
- package/dist/docs.json +401 -1776
- package/dist/esm/{index-b49c9904.js → index-69587a51.js} +12 -2
- package/dist/esm/{index-fb8d6be7.js → index-e1b64755.js} +17 -30
- package/dist/esm/index.js +20 -27
- package/dist/esm/loader.js +3 -3
- package/dist/esm/package-45827c3b.js +3 -0
- package/dist/esm/{post-accordion-ee54a3ef.js → post-accordion-bcfe7e61.js} +3 -3
- package/dist/esm/post-accordion-item-8869c90b.js +50 -0
- package/dist/esm/post-accordion-item.entry.js +4 -5
- package/dist/esm/post-accordion.entry.js +3 -3
- package/dist/esm/post-alert-21fd0068.js +97 -0
- package/dist/esm/post-alert.entry.js +9 -0
- package/dist/esm/post-card-control-60c132dc.js +270 -0
- package/dist/esm/post-card-control.entry.js +3 -3
- package/dist/esm/{post-collapsible-trigger-1c7833f8.js → post-collapsible-trigger-3168178e.js} +22 -9
- package/dist/esm/post-collapsible_2.entry.js +4 -7
- package/dist/esm/post-components.js +3 -3
- package/dist/esm/post-icon-2e2e18ad.js +137 -0
- package/dist/esm/post-icon.entry.js +8 -0
- package/dist/esm/post-logo-f364eb72.js +37 -0
- package/dist/esm/post-logo.entry.js +7 -0
- package/dist/esm/post-popover-697201cd.js +129 -0
- package/dist/esm/post-popover.entry.js +3 -4
- package/dist/esm/{post-togglebutton-395bf3f0.js → post-popovercontainer-2b5f37fb.js} +149 -1093
- package/dist/esm/post-popovercontainer.entry.js +3 -0
- package/dist/esm/post-rating-0fd5de37.js +86 -0
- package/dist/esm/post-rating.entry.js +3 -3
- package/dist/esm/post-tab-header-c8898fa2.js +30 -0
- package/dist/esm/post-tab-header.entry.js +3 -3
- package/dist/esm/{post-tab-panel-cafd9e04.js → post-tab-panel-6b1219e0.js} +3 -3
- package/dist/esm/post-tab-panel.entry.js +3 -3
- package/dist/esm/{post-tabs-beef8eae.js → post-tabs-b8ff3c5d.js} +5 -5
- package/dist/esm/post-tabs.entry.js +3 -3
- package/dist/esm/post-tag-83470f28.js +45 -0
- package/dist/esm/post-tag.entry.js +3 -3
- package/dist/esm/post-tooltip-aa745743.js +67 -0
- package/dist/esm/{post-tooltip-b298039a.js → post-tooltip-trigger-ce0b4106.js} +507 -557
- package/dist/esm/post-tooltip-trigger.entry.js +4 -0
- package/dist/esm/post-tooltip.entry.js +3 -8
- package/dist/post-components/index.esm.js +1 -1
- package/dist/post-components/p-08dc45bb.entry.js +1 -0
- package/dist/post-components/p-1a48d1b0.js +1 -0
- package/dist/post-components/p-2b61a526.entry.js +1 -0
- package/dist/post-components/{p-c0ae9886.js → p-3eab790d.js} +1 -1
- package/dist/post-components/p-3f5bf5d9.entry.js +1 -0
- package/dist/post-components/p-40e5bb56.entry.js +1 -0
- package/dist/post-components/p-56ca6bb5.js +1 -0
- package/dist/post-components/p-58cbb854.entry.js +1 -0
- package/dist/post-components/p-5c557e64.js +1 -0
- package/dist/post-components/p-5ce2abc9.entry.js +1 -0
- package/dist/post-components/p-5f08d625.js +15 -0
- package/dist/post-components/p-7069ac74.entry.js +1 -0
- package/dist/post-components/p-755b2746.js +1 -0
- package/dist/post-components/p-788e64fb.js +1 -0
- package/dist/post-components/p-799cf60e.js +1 -0
- package/dist/post-components/p-7bbcc8ee.js +1 -0
- package/dist/post-components/p-7cdf9571.entry.js +1 -0
- package/dist/post-components/p-7e4181ce.entry.js +1 -0
- package/dist/post-components/p-9409f729.js +1 -0
- package/dist/post-components/p-a07846ea.js +1 -0
- package/dist/post-components/p-a4560368.js +1 -0
- package/dist/post-components/p-a503cb2c.entry.js +1 -0
- package/dist/post-components/p-b46e2451.js +1 -0
- package/dist/post-components/p-b7207224.js +1 -0
- package/dist/post-components/p-bafc0491.js +1 -0
- package/dist/post-components/p-c078fd94.entry.js +1 -0
- package/dist/post-components/p-c0aebe5e.entry.js +1 -0
- package/dist/post-components/p-c7e4acde.js +1 -0
- package/dist/post-components/p-ca71a3ff.entry.js +1 -0
- package/dist/post-components/p-d582cc10.js +1 -0
- package/dist/post-components/p-e49f57c0.entry.js +1 -0
- package/dist/post-components/p-eb712f9b.entry.js +1 -0
- package/dist/post-components/p-eebd060d.js +1 -0
- package/dist/post-components/p-f7cead60.entry.js +1 -0
- package/dist/post-components/p-ffd75503.js +1 -0
- 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 +1 -7
- package/dist/types/components/post-alert/alert-types.d.ts +2 -0
- package/dist/types/components/post-alert/post-alert.d.ts +54 -0
- package/dist/types/components/post-card-control/post-card-control.d.ts +7 -7
- package/dist/types/components/post-icon/post-icon.d.ts +1 -1
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +31 -13
- package/dist/types/components/post-tag/post-tag.d.ts +1 -1
- package/dist/types/components/post-tooltip/post-tooltip.d.ts +20 -34
- package/dist/types/components/post-tooltip-trigger/post-tooltip-trigger.d.ts +47 -0
- package/dist/types/components.d.ts +124 -590
- package/dist/types/index.d.ts +3 -20
- package/loaders/index.d.ts +4 -38
- package/loaders/index.js +4 -21
- package/loaders/index2.js +1 -1
- package/loaders/package.js +1 -1
- package/loaders/post-accordion-item.js +82 -1
- package/loaders/post-accordion.js +1 -1
- package/loaders/{post-list.d.ts → post-alert.d.ts} +4 -4
- package/loaders/post-alert.js +139 -0
- package/loaders/post-card-control.js +3 -3
- package/loaders/post-collapsible-trigger2.js +17 -2
- package/loaders/post-collapsible2.js +3 -5
- package/loaders/post-icon2.js +54 -15
- package/loaders/post-logo.js +2 -2
- package/loaders/post-popover.js +35 -8
- package/loaders/post-popovercontainer2.js +136 -41
- package/loaders/post-rating.js +2 -2
- package/loaders/post-tab-header.js +2 -2
- package/loaders/post-tab-panel.js +1 -1
- package/loaders/post-tabs.js +3 -3
- package/loaders/post-tag.js +2 -2
- package/loaders/{post-avatar.d.ts → post-tooltip-trigger.d.ts} +4 -4
- package/loaders/post-tooltip-trigger.js +4971 -0
- package/loaders/post-tooltip.js +32 -4962
- package/package.json +6 -9
- package/dist/cjs/attribute-observer-10f08c04.js +0 -27
- package/dist/cjs/check-url-3ffdd2fb.js +0 -14
- package/dist/cjs/debounce-1151afe3.js +0 -12
- package/dist/cjs/get-root-7a3498ef.js +0 -11
- package/dist/cjs/post-accordion-item-ecc6749f.js +0 -63
- package/dist/cjs/post-avatar-f7236084.js +0 -148
- package/dist/cjs/post-avatar.cjs.entry.js +0 -13
- package/dist/cjs/post-back-to-top-60762f8e.js +0 -75
- package/dist/cjs/post-back-to-top.cjs.entry.js +0 -15
- package/dist/cjs/post-banner-9662f22c.js +0 -90
- package/dist/cjs/post-breadcrumb-b40732fc.js +0 -111
- package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +0 -17
- package/dist/cjs/post-breadcrumb.cjs.entry.js +0 -13
- package/dist/cjs/post-card-control-039c9a4b.js +0 -272
- package/dist/cjs/post-closebutton_15.cjs.entry.js +0 -33
- package/dist/cjs/post-footer-5f7fdf96.js +0 -84
- package/dist/cjs/post-footer.cjs.entry.js +0 -11
- package/dist/cjs/post-menu-item-bb0b0b9e.js +0 -74
- package/dist/cjs/post-popover-d0ce9dc6.js +0 -104
- package/dist/cjs/post-rating-1082197c.js +0 -88
- package/dist/cjs/post-tab-header-4b6d8d54.js +0 -32
- package/dist/cjs/post-tag-ddaaaedc.js +0 -47
- package/dist/cjs/slide-5d51abe8.js +0 -28
- package/dist/collection/animations/slide.js +0 -23
- package/dist/collection/components/post-avatar/post-avatar.css +0 -3
- package/dist/collection/components/post-avatar/post-avatar.js +0 -237
- package/dist/collection/components/post-back-to-top/post-back-to-top.css +0 -1
- package/dist/collection/components/post-back-to-top/post-back-to-top.js +0 -107
- package/dist/collection/components/post-banner/banner-types.js +0 -1
- package/dist/collection/components/post-banner/post-banner.css +0 -3
- package/dist/collection/components/post-breadcrumb/post-breadcrumb.css +0 -3
- package/dist/collection/components/post-breadcrumb/post-breadcrumb.js +0 -161
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.css +0 -1
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +0 -93
- package/dist/collection/components/post-closebutton/post-closebutton.js +0 -12
- package/dist/collection/components/post-footer/post-footer.css +0 -1
- package/dist/collection/components/post-footer/post-footer.js +0 -75
- package/dist/collection/components/post-header/post-header.css +0 -1
- package/dist/collection/components/post-header/post-header.js +0 -160
- package/dist/collection/components/post-language-option/post-language-option.css +0 -3
- package/dist/collection/components/post-language-option/post-language-option.js +0 -215
- package/dist/collection/components/post-language-switch/post-language-switch.css +0 -1
- package/dist/collection/components/post-language-switch/post-language-switch.js +0 -163
- package/dist/collection/components/post-language-switch/switch-variants.js +0 -1
- package/dist/collection/components/post-list/post-list.css +0 -3
- package/dist/collection/components/post-list/post-list.js +0 -87
- package/dist/collection/components/post-list-item/post-list-item.css +0 -1
- package/dist/collection/components/post-list-item/post-list-item.js +0 -25
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +0 -1
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +0 -52
- package/dist/collection/components/post-megadropdown/post-megadropdown.css +0 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.js +0 -151
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.css +0 -1
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +0 -104
- package/dist/collection/components/post-menu/post-menu.css +0 -3
- package/dist/collection/components/post-menu/post-menu.js +0 -280
- package/dist/collection/components/post-menu-item/post-menu-item.css +0 -1
- package/dist/collection/components/post-menu-item/post-menu-item.js +0 -20
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.css +0 -1
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +0 -114
- package/dist/collection/components/post-togglebutton/post-togglebutton.css +0 -1
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +0 -74
- package/dist/collection/utils/breakpoints.js +0 -46
- package/dist/collection/utils/is-focusable.js +0 -26
- package/dist/components/attribute-observer.js +0 -25
- package/dist/components/debounce.js +0 -10
- package/dist/components/get-root.js +0 -9
- package/dist/components/post-avatar.d.ts +0 -11
- package/dist/components/post-avatar.js +0 -6
- package/dist/components/post-avatar2.js +0 -173
- package/dist/components/post-back-to-top.d.ts +0 -11
- package/dist/components/post-back-to-top.js +0 -6
- package/dist/components/post-back-to-top2.js +0 -100
- package/dist/components/post-banner.d.ts +0 -11
- package/dist/components/post-banner.js +0 -6
- package/dist/components/post-banner2.js +0 -125
- package/dist/components/post-breadcrumb-item.js +0 -6
- package/dist/components/post-breadcrumb-item2.js +0 -82
- package/dist/components/post-breadcrumb.d.ts +0 -11
- package/dist/components/post-breadcrumb.js +0 -6
- package/dist/components/post-breadcrumb2.js +0 -168
- package/dist/components/post-closebutton.d.ts +0 -11
- package/dist/components/post-closebutton.js +0 -6
- package/dist/components/post-closebutton2.js +0 -34
- package/dist/components/post-footer.d.ts +0 -11
- package/dist/components/post-footer.js +0 -6
- package/dist/components/post-footer2.js +0 -124
- package/dist/components/post-header.d.ts +0 -11
- package/dist/components/post-header.js +0 -6
- package/dist/components/post-header2.js +0 -276
- package/dist/components/post-language-option.d.ts +0 -11
- package/dist/components/post-language-option.js +0 -6
- package/dist/components/post-language-option2.js +0 -94
- package/dist/components/post-language-switch.d.ts +0 -11
- package/dist/components/post-language-switch.js +0 -6
- package/dist/components/post-language-switch2.js +0 -146
- package/dist/components/post-list-item.d.ts +0 -11
- package/dist/components/post-list-item.js +0 -6
- package/dist/components/post-list-item2.js +0 -35
- package/dist/components/post-list.js +0 -6
- package/dist/components/post-list2.js +0 -53
- package/dist/components/post-mainnavigation.d.ts +0 -11
- package/dist/components/post-mainnavigation.js +0 -6
- package/dist/components/post-mainnavigation2.js +0 -48
- package/dist/components/post-megadropdown-trigger.d.ts +0 -11
- package/dist/components/post-megadropdown-trigger.js +0 -6
- package/dist/components/post-megadropdown-trigger2.js +0 -91
- package/dist/components/post-megadropdown.d.ts +0 -11
- package/dist/components/post-megadropdown.js +0 -6
- package/dist/components/post-megadropdown2.js +0 -93
- package/dist/components/post-menu-item.d.ts +0 -11
- package/dist/components/post-menu-item.js +0 -6
- package/dist/components/post-menu-item2.js +0 -33
- package/dist/components/post-menu-trigger.d.ts +0 -11
- package/dist/components/post-menu-trigger.js +0 -6
- package/dist/components/post-menu-trigger2.js +0 -102
- package/dist/components/post-menu.d.ts +0 -11
- package/dist/components/post-menu.js +0 -6
- package/dist/components/post-menu2.js +0 -203
- package/dist/components/post-togglebutton.d.ts +0 -11
- package/dist/components/post-togglebutton.js +0 -6
- package/dist/components/post-togglebutton2.js +0 -61
- package/dist/components/slide.js +0 -25
- package/dist/esm/attribute-observer-37fa950a.js +0 -25
- package/dist/esm/check-url-a974431e.js +0 -12
- package/dist/esm/debounce-abe98cc2.js +0 -10
- package/dist/esm/get-root-7af2e0d1.js +0 -9
- package/dist/esm/package-4d81f3c2.js +0 -3
- package/dist/esm/post-accordion-item-e10452dc.js +0 -61
- package/dist/esm/post-avatar-5572fa73.js +0 -146
- package/dist/esm/post-avatar.entry.js +0 -5
- package/dist/esm/post-back-to-top-1d823c43.js +0 -73
- package/dist/esm/post-back-to-top.entry.js +0 -7
- package/dist/esm/post-banner-78480475.js +0 -88
- package/dist/esm/post-banner.entry.js +0 -10
- package/dist/esm/post-breadcrumb-aaa77f74.js +0 -109
- package/dist/esm/post-breadcrumb-item_2.entry.js +0 -8
- package/dist/esm/post-breadcrumb.entry.js +0 -5
- package/dist/esm/post-card-control-862aa961.js +0 -270
- package/dist/esm/post-closebutton_15.entry.js +0 -11
- package/dist/esm/post-footer-b18875e7.js +0 -82
- package/dist/esm/post-footer.entry.js +0 -3
- package/dist/esm/post-menu-item-2906384b.js +0 -71
- package/dist/esm/post-popover-2432bb3f.js +0 -102
- package/dist/esm/post-rating-95cbdbb8.js +0 -86
- package/dist/esm/post-tab-header-dfea00ea.js +0 -30
- package/dist/esm/post-tag-a77e7af6.js +0 -45
- package/dist/esm/slide-3422b8a3.js +0 -25
- package/dist/post-components/p-0711f76d.entry.js +0 -1
- package/dist/post-components/p-095a06f6.entry.js +0 -1
- package/dist/post-components/p-0b5a5f32.js +0 -1
- package/dist/post-components/p-135fa60f.js +0 -1
- package/dist/post-components/p-18e38d8a.js +0 -1
- package/dist/post-components/p-2e1ec074.entry.js +0 -1
- package/dist/post-components/p-4202b433.entry.js +0 -1
- package/dist/post-components/p-45773f59.js +0 -1
- package/dist/post-components/p-4953de7e.js +0 -1
- package/dist/post-components/p-4f67c5f5.entry.js +0 -1
- package/dist/post-components/p-4f9746f6.js +0 -15
- package/dist/post-components/p-5075c672.entry.js +0 -1
- package/dist/post-components/p-515e0f96.js +0 -1
- package/dist/post-components/p-5467b223.js +0 -1
- package/dist/post-components/p-67036798.entry.js +0 -1
- package/dist/post-components/p-6adeaa6c.js +0 -1
- package/dist/post-components/p-6d953fb2.js +0 -1
- package/dist/post-components/p-6edb0ac5.js +0 -1
- package/dist/post-components/p-6f8f39ca.js +0 -1
- package/dist/post-components/p-7503a623.js +0 -1
- package/dist/post-components/p-761b24c7.entry.js +0 -1
- package/dist/post-components/p-77c4c1d2.js +0 -1
- package/dist/post-components/p-7cf0c2ad.js +0 -1
- package/dist/post-components/p-856c14d6.entry.js +0 -1
- package/dist/post-components/p-866bf50a.entry.js +0 -1
- package/dist/post-components/p-8d621781.js +0 -1
- package/dist/post-components/p-8fe2d72c.entry.js +0 -1
- package/dist/post-components/p-9ad5088f.entry.js +0 -1
- package/dist/post-components/p-a1d2b90e.js +0 -1
- package/dist/post-components/p-a521419d.entry.js +0 -1
- package/dist/post-components/p-aa538648.js +0 -1
- package/dist/post-components/p-afdbee2f.js +0 -1
- package/dist/post-components/p-b02817f2.entry.js +0 -1
- package/dist/post-components/p-b157dcba.entry.js +0 -1
- package/dist/post-components/p-b22656b1.js +0 -1
- package/dist/post-components/p-bdbd11cb.js +0 -1
- package/dist/post-components/p-c537e196.entry.js +0 -1
- package/dist/post-components/p-d4f93f2b.js +0 -1
- package/dist/post-components/p-dca4246a.entry.js +0 -1
- package/dist/post-components/p-f319b026.js +0 -1
- package/dist/post-components/p-f4b7b379.js +0 -1
- package/dist/post-components/p-fac66087.entry.js +0 -1
- package/dist/post-components/p-fc91cbc2.js +0 -1
- package/dist/types/animations/slide.d.ts +0 -2
- package/dist/types/components/post-avatar/post-avatar.d.ts +0 -51
- package/dist/types/components/post-back-to-top/post-back-to-top.d.ts +0 -19
- package/dist/types/components/post-banner/banner-types.d.ts +0 -2
- package/dist/types/components/post-banner/post-banner.d.ts +0 -49
- package/dist/types/components/post-breadcrumb/post-breadcrumb.d.ts +0 -30
- package/dist/types/components/post-breadcrumb-item/post-breadcrumb-item.d.ts +0 -16
- package/dist/types/components/post-closebutton/post-closebutton.d.ts +0 -7
- package/dist/types/components/post-footer/post-footer.d.ts +0 -23
- package/dist/types/components/post-header/post-header.d.ts +0 -24
- package/dist/types/components/post-language-option/post-language-option.d.ts +0 -45
- package/dist/types/components/post-language-switch/post-language-switch.d.ts +0 -31
- package/dist/types/components/post-language-switch/switch-variants.d.ts +0 -2
- package/dist/types/components/post-list/post-list.d.ts +0 -24
- package/dist/types/components/post-list-item/post-list-item.d.ts +0 -8
- package/dist/types/components/post-mainnavigation/post-mainnavigation.d.ts +0 -19
- package/dist/types/components/post-megadropdown/post-megadropdown.d.ts +0 -35
- package/dist/types/components/post-megadropdown-trigger/post-megadropdown-trigger.d.ts +0 -25
- package/dist/types/components/post-menu/post-menu.d.ts +0 -48
- package/dist/types/components/post-menu-item/post-menu-item.d.ts +0 -4
- package/dist/types/components/post-menu-trigger/post-menu-trigger.d.ts +0 -27
- package/dist/types/components/post-togglebutton/post-togglebutton.d.ts +0 -15
- package/dist/types/utils/breakpoints.d.ts +0 -11
- package/dist/types/utils/is-focusable.d.ts +0 -1
- package/loaders/attribute-observer.js +0 -25
- package/loaders/debounce.js +0 -10
- package/loaders/get-root.js +0 -9
- package/loaders/post-accordion-item2.js +0 -102
- package/loaders/post-avatar.js +0 -176
- package/loaders/post-back-to-top.d.ts +0 -11
- package/loaders/post-back-to-top.js +0 -103
- package/loaders/post-banner.d.ts +0 -11
- package/loaders/post-banner.js +0 -128
- package/loaders/post-breadcrumb-item.d.ts +0 -11
- package/loaders/post-breadcrumb-item.js +0 -6
- package/loaders/post-breadcrumb-item2.js +0 -82
- package/loaders/post-breadcrumb.d.ts +0 -11
- package/loaders/post-breadcrumb.js +0 -171
- package/loaders/post-closebutton.d.ts +0 -11
- package/loaders/post-closebutton.js +0 -37
- package/loaders/post-footer.d.ts +0 -11
- package/loaders/post-footer.js +0 -127
- package/loaders/post-header.d.ts +0 -11
- package/loaders/post-header.js +0 -279
- package/loaders/post-language-option.d.ts +0 -11
- package/loaders/post-language-option.js +0 -97
- package/loaders/post-language-switch.d.ts +0 -11
- package/loaders/post-language-switch.js +0 -149
- package/loaders/post-list-item.d.ts +0 -11
- package/loaders/post-list-item.js +0 -38
- package/loaders/post-list.js +0 -56
- package/loaders/post-mainnavigation.d.ts +0 -11
- package/loaders/post-mainnavigation.js +0 -51
- package/loaders/post-megadropdown-trigger.d.ts +0 -11
- package/loaders/post-megadropdown-trigger.js +0 -94
- package/loaders/post-megadropdown.d.ts +0 -11
- package/loaders/post-megadropdown.js +0 -96
- package/loaders/post-menu-item.d.ts +0 -11
- package/loaders/post-menu-item.js +0 -6
- package/loaders/post-menu-item2.js +0 -33
- package/loaders/post-menu-trigger.d.ts +0 -11
- package/loaders/post-menu-trigger.js +0 -6
- package/loaders/post-menu-trigger2.js +0 -102
- package/loaders/post-menu.d.ts +0 -11
- package/loaders/post-menu.js +0 -6
- package/loaders/post-menu2.js +0 -203
- package/loaders/post-togglebutton.d.ts +0 -11
- package/loaders/post-togglebutton.js +0 -64
- package/loaders/slide.js +0 -25
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
import { h, Host } from "@stencil/core";
|
|
2
|
-
import { throttle } from "throttle-debounce";
|
|
3
|
-
import { version } from "../../../../package";
|
|
4
|
-
import { slideDown, slideUp } from "../../animations/slide";
|
|
5
|
-
export class PostHeader {
|
|
6
|
-
constructor() {
|
|
7
|
-
this.scrollParent = null;
|
|
8
|
-
this.throttledScroll = () => this.handleScrollEvent();
|
|
9
|
-
this.throttledResize = throttle(50, () => this.handleResize());
|
|
10
|
-
this.device = null;
|
|
11
|
-
this.mobileMenuExtended = false;
|
|
12
|
-
}
|
|
13
|
-
componentWillRender() {
|
|
14
|
-
this.scrollParent = this.getScrollParent(this.host);
|
|
15
|
-
this.scrollParent.addEventListener('scroll', this.throttledScroll, { passive: true });
|
|
16
|
-
window.addEventListener('resize', this.throttledResize, { passive: true });
|
|
17
|
-
this.handleResize();
|
|
18
|
-
this.handleScrollEvent();
|
|
19
|
-
}
|
|
20
|
-
frozeBody(isMobileMenuExtended) {
|
|
21
|
-
document.body.style.overflow = isMobileMenuExtended ? 'hidden' : '';
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Toggles the mobile navigation.
|
|
25
|
-
*/
|
|
26
|
-
async toggleMobileMenu() {
|
|
27
|
-
if (this.device === 'desktop')
|
|
28
|
-
return;
|
|
29
|
-
this.mobileMenuAnimation = this.mobileMenuExtended
|
|
30
|
-
? slideUp(this.mobileMenu)
|
|
31
|
-
: slideDown(this.mobileMenu);
|
|
32
|
-
// Update the state of the toggle button
|
|
33
|
-
const menuButton = this.host.querySelector('post-togglebutton');
|
|
34
|
-
menuButton.toggled = !this.mobileMenuExtended;
|
|
35
|
-
// Toggle menu visibility before it slides down and after it slides back up
|
|
36
|
-
if (this.mobileMenuExtended)
|
|
37
|
-
await this.mobileMenuAnimation.finished;
|
|
38
|
-
this.mobileMenuExtended = !this.mobileMenuExtended;
|
|
39
|
-
if (!this.mobileMenuExtended)
|
|
40
|
-
await this.mobileMenuAnimation.finished;
|
|
41
|
-
}
|
|
42
|
-
handleScrollEvent() {
|
|
43
|
-
// Credits: "https://github.com/qeremy/so/blob/master/so.dom.js#L426"
|
|
44
|
-
const st = Math.max(0, this.scrollParent instanceof Document
|
|
45
|
-
? this.scrollParent.documentElement.scrollTop
|
|
46
|
-
: this.scrollParent.scrollTop);
|
|
47
|
-
this.host.style.setProperty('--header-scroll-top', `${st}px`);
|
|
48
|
-
}
|
|
49
|
-
getScrollParent(node) {
|
|
50
|
-
let currentParent = node.parentElement;
|
|
51
|
-
while (currentParent) {
|
|
52
|
-
if (currentParent.nodeName === 'BODY') {
|
|
53
|
-
return document;
|
|
54
|
-
}
|
|
55
|
-
if (this.isScrollable(currentParent)) {
|
|
56
|
-
return currentParent;
|
|
57
|
-
}
|
|
58
|
-
currentParent = currentParent.parentElement;
|
|
59
|
-
}
|
|
60
|
-
return document;
|
|
61
|
-
}
|
|
62
|
-
isScrollable(node) {
|
|
63
|
-
if (!(node instanceof HTMLElement || node instanceof SVGElement)) {
|
|
64
|
-
return false;
|
|
65
|
-
}
|
|
66
|
-
const style = getComputedStyle(node);
|
|
67
|
-
return ['overflow', 'overflow-x', 'overflow-y'].some(propertyName => {
|
|
68
|
-
const value = style.getPropertyValue(propertyName);
|
|
69
|
-
return value === 'auto' || value === 'scroll';
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
handleResize() {
|
|
73
|
-
const previousDevice = this.device;
|
|
74
|
-
let newDevice;
|
|
75
|
-
const width = window === null || window === void 0 ? void 0 : window.innerWidth;
|
|
76
|
-
if (width >= 1024) {
|
|
77
|
-
newDevice = 'desktop';
|
|
78
|
-
}
|
|
79
|
-
else if (width >= 600) {
|
|
80
|
-
newDevice = 'tablet';
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
newDevice = 'mobile';
|
|
84
|
-
}
|
|
85
|
-
// Close any open mobile menu
|
|
86
|
-
if (newDevice === 'desktop' && this.mobileMenuExtended) {
|
|
87
|
-
this.toggleMobileMenu();
|
|
88
|
-
this.mobileMenuAnimation.finish(); // no animation
|
|
89
|
-
}
|
|
90
|
-
// Apply only on change for doing work only when necessary
|
|
91
|
-
if (newDevice !== previousDevice) {
|
|
92
|
-
this.device = newDevice;
|
|
93
|
-
window.requestAnimationFrame(() => {
|
|
94
|
-
this.switchLanguageSwitchMode();
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
switchLanguageSwitchMode() {
|
|
99
|
-
var _a;
|
|
100
|
-
const variant = this.device === 'desktop' ? 'dropdown' : 'list';
|
|
101
|
-
(_a = this.host.querySelector('post-language-switch')) === null || _a === void 0 ? void 0 : _a.setAttribute('variant', variant);
|
|
102
|
-
}
|
|
103
|
-
render() {
|
|
104
|
-
const navigationClasses = ['navigation'];
|
|
105
|
-
if (this.mobileMenuExtended) {
|
|
106
|
-
navigationClasses.push('extended');
|
|
107
|
-
}
|
|
108
|
-
return (h(Host, { key: 'd96b46b64946ef425059463d127fa1188c99ea58', version: version }, h("div", { key: '831ebc53d0f598a99e72d46a1530c2c34c196948', class: "global-header" }, h("div", { key: '69f3b3bc47a61810eea3ae60d7b2423af1750416', class: "global-sub" }, h("div", { key: 'ad6d36c7e7f029edfdee223ab1df664a1b7002f8', class: "logo" }, h("slot", { key: '95adfc2ad9e63fde9eef3cc71b63247e140fba3d', name: "post-logo" }))), h("div", { key: '741e62693a4df8558213c85d7a837efb8b0cfa6d', class: "global-sub" }, this.device === 'desktop' && h("slot", { key: '992844b617955cb77079a175fcaaf54943a6eef2', name: "meta-navigation" }), h("slot", { key: '4384ae4c04d239bf1b1947ba6d1457ae6879a5cf', name: "global-controls" }), this.device === 'desktop' && h("slot", { key: 'c5b33b6bfb8c00d44710ec997a80d56720aab760', name: "post-language-switch" }), h("div", { key: '25a629a419c94fc4789eb374b87cf7c159b746c6', onClick: () => this.toggleMobileMenu(), class: "mobile-toggle" }, h("slot", { key: '3f3078832237abc5a6df79b4a57fe20fae926aa3', name: "post-togglebutton" })))), h("div", { key: 'e11ca83bc108d4677e849b7386ad7bd09d8c9331', class: "title-header d-flex space-between align-center" }, h("slot", { key: '87430ad15ab09f800b714be45be00a50e5b7dc0a', name: "title" }), h("div", { key: '494a198d3ee8185a26b16fce97a85bed01d6b3f7', class: "global-sub" }, h("slot", { key: '8a54e3d1366d39c11d64c0de90f35a4330836428', name: "local-controls" }), h("slot", { key: '63f841457e0f7b7722a3f8b1ea83ff0d78d9c08e' }))), h("div", { key: '90cf667c412d90f8e466e7e7925fa4a2f8223ad8', ref: el => (this.mobileMenu = el), class: navigationClasses.join(' ') }, h("slot", { key: 'a046286cb6cc770bfb8fb4439cdacac7c351001b', name: "post-mainnavigation" }), (this.device === 'mobile' || this.device === 'tablet') && (h("div", { key: '6e0ad5841ef53daf0c0885b75efdf12d69f4a72d', class: "navigation-footer" }, h("slot", { key: '1eaebace0d5e37794867ae2a317a104726bb873a', name: "meta-navigation" }), h("slot", { key: '79217cd6fd16d4c6ef3e8aaa656e6dc0a8842b23', name: "post-language-switch" }))))));
|
|
109
|
-
}
|
|
110
|
-
static get is() { return "post-header"; }
|
|
111
|
-
static get encapsulation() { return "shadow"; }
|
|
112
|
-
static get originalStyleUrls() {
|
|
113
|
-
return {
|
|
114
|
-
"$": ["./post-header.scss"]
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
static get styleUrls() {
|
|
118
|
-
return {
|
|
119
|
-
"$": ["post-header.css"]
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
static get states() {
|
|
123
|
-
return {
|
|
124
|
-
"device": {},
|
|
125
|
-
"mobileMenuExtended": {}
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
static get methods() {
|
|
129
|
-
return {
|
|
130
|
-
"toggleMobileMenu": {
|
|
131
|
-
"complexType": {
|
|
132
|
-
"signature": "() => Promise<void>",
|
|
133
|
-
"parameters": [],
|
|
134
|
-
"references": {
|
|
135
|
-
"Promise": {
|
|
136
|
-
"location": "global",
|
|
137
|
-
"id": "global::Promise"
|
|
138
|
-
},
|
|
139
|
-
"HTMLPostTogglebuttonElement": {
|
|
140
|
-
"location": "global",
|
|
141
|
-
"id": "global::HTMLPostTogglebuttonElement"
|
|
142
|
-
}
|
|
143
|
-
},
|
|
144
|
-
"return": "Promise<void>"
|
|
145
|
-
},
|
|
146
|
-
"docs": {
|
|
147
|
-
"text": "Toggles the mobile navigation.",
|
|
148
|
-
"tags": []
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
static get elementRef() { return "host"; }
|
|
154
|
-
static get watchers() {
|
|
155
|
-
return [{
|
|
156
|
-
"propName": "mobileMenuExtended",
|
|
157
|
-
"methodName": "frozeBody"
|
|
158
|
-
}];
|
|
159
|
-
}
|
|
160
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2021 by Swiss Post, Information Technology
|
|
3
|
-
*/:host{display:inline-block;width:fit-content}button{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;appearance:button}a{color:inherit;text-decoration:none}:is(a,button){cursor:pointer;display:flex;align-items:center;justify-content:center;height:100%;width:100%;padding:var(--post-language-option-padding)}.post-language-option-list{border-radius:2px;width:40px;height:40px}.post-language-option-list{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-option-list: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-option-list:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.post-language-option-list: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-option-list:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.post-language-option-list[aria-current=true],.post-language-option-list[aria-current=page]{background-color:#050400;color:#fff}.post-language-option-dropdown{padding-block:13px;padding-inline:24px;box-sizing:border-box;position:relative}.post-language-option-dropdown[aria-current=true]::after,.post-language-option-dropdown[aria-current=page]::after{content:"";left:-2px;height:3px;background-color:#504f4b;width:calc(100% + 4px);display:block;position:absolute;bottom:3px}.post-language-option-dropdown[aria-current=true]:focus::after,.post-language-option-dropdown[aria-current=page]:focus::after{width:calc(100% - 5px);left:2px}
|
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
import { Host, h, } from "@stencil/core";
|
|
2
|
-
import { checkEmptyOrType, checkType } from "../../utils/index";
|
|
3
|
-
import { version } from "../../../../package";
|
|
4
|
-
/**
|
|
5
|
-
* @slot default - Slot for placing the content inside the anchor or button.
|
|
6
|
-
*/
|
|
7
|
-
export class PostLanguageOption {
|
|
8
|
-
constructor() {
|
|
9
|
-
this.code = undefined;
|
|
10
|
-
this.active = undefined;
|
|
11
|
-
this.variant = undefined;
|
|
12
|
-
this.name = undefined;
|
|
13
|
-
this.url = undefined;
|
|
14
|
-
}
|
|
15
|
-
validateCode(value = this.code) {
|
|
16
|
-
checkType(value, 'string', 'The "code" property of the post-language-option component must be a string.');
|
|
17
|
-
}
|
|
18
|
-
validateActiveProp(value = this.active) {
|
|
19
|
-
checkEmptyOrType(value, 'boolean', 'The "active" property of the post-language-option component must be a boolean value.');
|
|
20
|
-
}
|
|
21
|
-
validateName(value = this.name) {
|
|
22
|
-
checkEmptyOrType(value, 'string', 'The "name" property of the post-language-option component must be a string.');
|
|
23
|
-
}
|
|
24
|
-
validateUrl(value = this.url) {
|
|
25
|
-
checkEmptyOrType(value, 'string', 'The "url" property of the post-language-option component must be a valid URL.');
|
|
26
|
-
}
|
|
27
|
-
componentDidLoad() {
|
|
28
|
-
this.validateCode();
|
|
29
|
-
this.validateActiveProp();
|
|
30
|
-
this.validateName();
|
|
31
|
-
this.validateUrl();
|
|
32
|
-
if (!this.name && this.isNameRequired()) {
|
|
33
|
-
throw new Error('The "name" property of the post-language-option component is required when the full language name is not displayed.');
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Selects the language option programmatically.
|
|
38
|
-
*/
|
|
39
|
-
async select() {
|
|
40
|
-
this.active = true;
|
|
41
|
-
this.emitChange();
|
|
42
|
-
}
|
|
43
|
-
emitChange() {
|
|
44
|
-
this.postChange.emit(this.code);
|
|
45
|
-
}
|
|
46
|
-
isNameRequired() {
|
|
47
|
-
return this.host.textContent.toLowerCase() === this.code.toLowerCase();
|
|
48
|
-
}
|
|
49
|
-
render() {
|
|
50
|
-
const lang = this.code.toLowerCase();
|
|
51
|
-
return (h(Host, { key: '9a3f49ee993b69393ea8f81b671cd5482049ff1c', "data-version": version, role: "listitem" }, this.url ? (h("a", { class: this.variant ? `post-language-option-${this.variant}` : '', "aria-current": this.active ? 'page' : undefined, "aria-label": this.name, href: this.url, hrefLang: lang, lang: lang, onClick: () => this.emitChange() }, h("slot", null))) : (h("button", { class: this.variant ? `post-language-option-${this.variant}` : '', "aria-current": this.active ? 'true' : undefined, "aria-label": this.name, lang: lang, onClick: () => this.emitChange() }, h("slot", null)))));
|
|
52
|
-
}
|
|
53
|
-
static get is() { return "post-language-option"; }
|
|
54
|
-
static get encapsulation() { return "shadow"; }
|
|
55
|
-
static get originalStyleUrls() {
|
|
56
|
-
return {
|
|
57
|
-
"$": ["post-language-option.scss"]
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
static get styleUrls() {
|
|
61
|
-
return {
|
|
62
|
-
"$": ["post-language-option.css"]
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
static get properties() {
|
|
66
|
-
return {
|
|
67
|
-
"code": {
|
|
68
|
-
"type": "string",
|
|
69
|
-
"mutable": false,
|
|
70
|
-
"complexType": {
|
|
71
|
-
"original": "string",
|
|
72
|
-
"resolved": "string",
|
|
73
|
-
"references": {}
|
|
74
|
-
},
|
|
75
|
-
"required": true,
|
|
76
|
-
"optional": false,
|
|
77
|
-
"docs": {
|
|
78
|
-
"tags": [],
|
|
79
|
-
"text": "The ISO 639 language code, formatted according to [RFC 5646 (also known as BCP 47)](https://datatracker.ietf.org/doc/html/rfc5646). For example, \"de\"."
|
|
80
|
-
},
|
|
81
|
-
"attribute": "code",
|
|
82
|
-
"reflect": false
|
|
83
|
-
},
|
|
84
|
-
"active": {
|
|
85
|
-
"type": "boolean",
|
|
86
|
-
"mutable": true,
|
|
87
|
-
"complexType": {
|
|
88
|
-
"original": "boolean",
|
|
89
|
-
"resolved": "boolean",
|
|
90
|
-
"references": {}
|
|
91
|
-
},
|
|
92
|
-
"required": false,
|
|
93
|
-
"optional": false,
|
|
94
|
-
"docs": {
|
|
95
|
-
"tags": [],
|
|
96
|
-
"text": "If set to `true`, the language option is considered the current language for the page."
|
|
97
|
-
},
|
|
98
|
-
"attribute": "active",
|
|
99
|
-
"reflect": true
|
|
100
|
-
},
|
|
101
|
-
"variant": {
|
|
102
|
-
"type": "string",
|
|
103
|
-
"mutable": false,
|
|
104
|
-
"complexType": {
|
|
105
|
-
"original": "SwitchVariant | null",
|
|
106
|
-
"resolved": "\"dropdown\" | \"list\"",
|
|
107
|
-
"references": {
|
|
108
|
-
"SwitchVariant": {
|
|
109
|
-
"location": "import",
|
|
110
|
-
"path": "../post-language-switch/switch-variants",
|
|
111
|
-
"id": "src/components/post-language-switch/switch-variants.ts::SwitchVariant"
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
"required": false,
|
|
116
|
-
"optional": true,
|
|
117
|
-
"docs": {
|
|
118
|
-
"tags": [],
|
|
119
|
-
"text": "The variant of the post-language-switch parent (dynamically set by the parent)"
|
|
120
|
-
},
|
|
121
|
-
"attribute": "variant",
|
|
122
|
-
"reflect": false
|
|
123
|
-
},
|
|
124
|
-
"name": {
|
|
125
|
-
"type": "string",
|
|
126
|
-
"mutable": false,
|
|
127
|
-
"complexType": {
|
|
128
|
-
"original": "string",
|
|
129
|
-
"resolved": "string",
|
|
130
|
-
"references": {}
|
|
131
|
-
},
|
|
132
|
-
"required": false,
|
|
133
|
-
"optional": false,
|
|
134
|
-
"docs": {
|
|
135
|
-
"tags": [],
|
|
136
|
-
"text": "The full name of the language. For example, \"Deutsch\"."
|
|
137
|
-
},
|
|
138
|
-
"attribute": "name",
|
|
139
|
-
"reflect": false
|
|
140
|
-
},
|
|
141
|
-
"url": {
|
|
142
|
-
"type": "string",
|
|
143
|
-
"mutable": false,
|
|
144
|
-
"complexType": {
|
|
145
|
-
"original": "string",
|
|
146
|
-
"resolved": "string",
|
|
147
|
-
"references": {}
|
|
148
|
-
},
|
|
149
|
-
"required": false,
|
|
150
|
-
"optional": false,
|
|
151
|
-
"docs": {
|
|
152
|
-
"tags": [],
|
|
153
|
-
"text": "The URL used for the href attribute of the internal anchor.\nThis field is optional; if not provided, a button will be used internally instead of an anchor."
|
|
154
|
-
},
|
|
155
|
-
"attribute": "url",
|
|
156
|
-
"reflect": false
|
|
157
|
-
}
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
static get events() {
|
|
161
|
-
return [{
|
|
162
|
-
"method": "postChange",
|
|
163
|
-
"name": "postChange",
|
|
164
|
-
"bubbles": true,
|
|
165
|
-
"cancelable": true,
|
|
166
|
-
"composed": true,
|
|
167
|
-
"docs": {
|
|
168
|
-
"tags": [],
|
|
169
|
-
"text": "An event emitted when the language option is clicked. The payload is the ISO 639 code of the language."
|
|
170
|
-
},
|
|
171
|
-
"complexType": {
|
|
172
|
-
"original": "string",
|
|
173
|
-
"resolved": "string",
|
|
174
|
-
"references": {}
|
|
175
|
-
}
|
|
176
|
-
}];
|
|
177
|
-
}
|
|
178
|
-
static get methods() {
|
|
179
|
-
return {
|
|
180
|
-
"select": {
|
|
181
|
-
"complexType": {
|
|
182
|
-
"signature": "() => Promise<void>",
|
|
183
|
-
"parameters": [],
|
|
184
|
-
"references": {
|
|
185
|
-
"Promise": {
|
|
186
|
-
"location": "global",
|
|
187
|
-
"id": "global::Promise"
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
"return": "Promise<void>"
|
|
191
|
-
},
|
|
192
|
-
"docs": {
|
|
193
|
-
"text": "Selects the language option programmatically.",
|
|
194
|
-
"tags": []
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
static get elementRef() { return "host"; }
|
|
200
|
-
static get watchers() {
|
|
201
|
-
return [{
|
|
202
|
-
"propName": "code",
|
|
203
|
-
"methodName": "validateCode"
|
|
204
|
-
}, {
|
|
205
|
-
"propName": "active",
|
|
206
|
-
"methodName": "validateActiveProp"
|
|
207
|
-
}, {
|
|
208
|
-
"propName": "name",
|
|
209
|
-
"methodName": "validateName"
|
|
210
|
-
}, {
|
|
211
|
-
"propName": "url",
|
|
212
|
-
"methodName": "validateUrl"
|
|
213
|
-
}];
|
|
214
|
-
}
|
|
215
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
:host{display:block}.post-language-switch-dropdown-container{display:flex;flex-direction:column}.post-language-switch-trigger{cursor:pointer;padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;appearance:button;text-decoration:none;display:inline-flex;align-items:center;gap:var(--post-core-dimension-6);border-radius:var(--post-core-dimension-24);font-size:var(--post-core-font-size-16);padding:var(--post-core-dimension-3) var(--post-core-dimension-10)}.post-language-switch-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-switch-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-switch-trigger:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.post-language-switch-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-switch-trigger:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.post-language-switch-trigger:not(:disabled):hover,.post-language-switch-trigger.pretend-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-switch-trigger post-icon{height:var(--post-core-dimension-16);width:var(--post-core-dimension-16)}
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import { Host, h } from "@stencil/core";
|
|
2
|
-
import { checkEmptyOrOneOf, checkType } from "../../utils/index";
|
|
3
|
-
import { version } from "../../../../package";
|
|
4
|
-
import { SWITCH_VARIANTS } from "./switch-variants";
|
|
5
|
-
import { nanoid } from "nanoid";
|
|
6
|
-
export class PostLanguageSwitch {
|
|
7
|
-
constructor() {
|
|
8
|
-
this.menuId = `p${nanoid(11)}`;
|
|
9
|
-
this.caption = undefined;
|
|
10
|
-
this.description = undefined;
|
|
11
|
-
this.variant = 'list';
|
|
12
|
-
this.activeLang = undefined;
|
|
13
|
-
}
|
|
14
|
-
validateCaption(value = this.caption) {
|
|
15
|
-
checkType(value, 'string', 'The "caption" property of the post-language-switch component must be a string.');
|
|
16
|
-
}
|
|
17
|
-
validateDescription(value = this.description) {
|
|
18
|
-
checkType(value, 'string', 'The "description" property of the post-language-switch component must be a string.');
|
|
19
|
-
}
|
|
20
|
-
validateVariant(value = this.variant) {
|
|
21
|
-
checkEmptyOrOneOf(value, SWITCH_VARIANTS, `The "variant" property of the post-language-switch component must be: ${SWITCH_VARIANTS.join(', ')}`);
|
|
22
|
-
}
|
|
23
|
-
connectedCallback() {
|
|
24
|
-
this.updateChildrenVariant();
|
|
25
|
-
// Get the active language based on children's active state
|
|
26
|
-
this.activeLang = Array.from(this.host.querySelectorAll('post-language-option'))
|
|
27
|
-
.find(el => el.getAttribute('active') == 'true')
|
|
28
|
-
.getAttribute('code');
|
|
29
|
-
}
|
|
30
|
-
// Update post-language-option variant to have the correct style
|
|
31
|
-
updateChildrenVariant() {
|
|
32
|
-
this.host.querySelectorAll('post-language-option').forEach(el => {
|
|
33
|
-
el.setAttribute('variant', this.variant);
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
componentShouldUpdate() {
|
|
37
|
-
this.updateChildrenVariant();
|
|
38
|
-
}
|
|
39
|
-
componentDidLoad() {
|
|
40
|
-
this.validateCaption();
|
|
41
|
-
this.validateDescription();
|
|
42
|
-
this.validateVariant();
|
|
43
|
-
// Detects a change in the active language
|
|
44
|
-
this.host.addEventListener('postChange', (el) => {
|
|
45
|
-
this.activeLang = el.detail;
|
|
46
|
-
// Update the active state in the children post-language-option components
|
|
47
|
-
this.host.querySelectorAll('post-language-option').forEach(lang => {
|
|
48
|
-
if (lang.code && lang.code === this.activeLang) {
|
|
49
|
-
lang.setAttribute('active', 'true');
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
lang.setAttribute('active', 'false');
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
// Hides the dropdown when an option has been clicked
|
|
56
|
-
if (this.variant === 'dropdown') {
|
|
57
|
-
const menu = this.host.shadowRoot.querySelector('post-menu');
|
|
58
|
-
menu.toggle(menu);
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
renderList() {
|
|
63
|
-
return (h(Host, { "data-version": version, "aria-label": `${this.caption}, ${this.description}`, "aria-role": "list" }, h("slot", null)));
|
|
64
|
-
}
|
|
65
|
-
renderDropdown() {
|
|
66
|
-
return (h(Host, { "data-version": version }, h("post-menu-trigger", { for: this.menuId }, h("button", { class: "post-language-switch-trigger", "aria-label": `${this.caption}, ${this.description}` }, this.activeLang.toUpperCase(), h("post-icon", { "aria-hidden": "true", name: "chevrondown" }))), h("post-menu", { id: this.menuId }, h("div", { class: "post-language-switch-dropdown-container" }, h("slot", null)))));
|
|
67
|
-
}
|
|
68
|
-
render() {
|
|
69
|
-
return this.variant === 'list' ? this.renderList() : this.renderDropdown();
|
|
70
|
-
}
|
|
71
|
-
static get is() { return "post-language-switch"; }
|
|
72
|
-
static get encapsulation() { return "shadow"; }
|
|
73
|
-
static get originalStyleUrls() {
|
|
74
|
-
return {
|
|
75
|
-
"$": ["post-language-switch.scss"]
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
static get styleUrls() {
|
|
79
|
-
return {
|
|
80
|
-
"$": ["post-language-switch.css"]
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
static get properties() {
|
|
84
|
-
return {
|
|
85
|
-
"caption": {
|
|
86
|
-
"type": "string",
|
|
87
|
-
"mutable": false,
|
|
88
|
-
"complexType": {
|
|
89
|
-
"original": "string",
|
|
90
|
-
"resolved": "string",
|
|
91
|
-
"references": {}
|
|
92
|
-
},
|
|
93
|
-
"required": false,
|
|
94
|
-
"optional": false,
|
|
95
|
-
"docs": {
|
|
96
|
-
"tags": [],
|
|
97
|
-
"text": "A title for the list of language options"
|
|
98
|
-
},
|
|
99
|
-
"attribute": "caption",
|
|
100
|
-
"reflect": false
|
|
101
|
-
},
|
|
102
|
-
"description": {
|
|
103
|
-
"type": "string",
|
|
104
|
-
"mutable": false,
|
|
105
|
-
"complexType": {
|
|
106
|
-
"original": "string",
|
|
107
|
-
"resolved": "string",
|
|
108
|
-
"references": {}
|
|
109
|
-
},
|
|
110
|
-
"required": false,
|
|
111
|
-
"optional": false,
|
|
112
|
-
"docs": {
|
|
113
|
-
"tags": [],
|
|
114
|
-
"text": "A descriptive text for the list of language options"
|
|
115
|
-
},
|
|
116
|
-
"attribute": "description",
|
|
117
|
-
"reflect": false
|
|
118
|
-
},
|
|
119
|
-
"variant": {
|
|
120
|
-
"type": "string",
|
|
121
|
-
"mutable": false,
|
|
122
|
-
"complexType": {
|
|
123
|
-
"original": "SwitchVariant",
|
|
124
|
-
"resolved": "\"dropdown\" | \"list\"",
|
|
125
|
-
"references": {
|
|
126
|
-
"SwitchVariant": {
|
|
127
|
-
"location": "import",
|
|
128
|
-
"path": "./switch-variants",
|
|
129
|
-
"id": "src/components/post-language-switch/switch-variants.ts::SwitchVariant"
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
"required": false,
|
|
134
|
-
"optional": false,
|
|
135
|
-
"docs": {
|
|
136
|
-
"tags": [],
|
|
137
|
-
"text": "Variant that determines the rendering of the language switch either as a list (used on mobile in the header) or a dropdown (used on desktop in the header)"
|
|
138
|
-
},
|
|
139
|
-
"attribute": "variant",
|
|
140
|
-
"reflect": false,
|
|
141
|
-
"defaultValue": "'list'"
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
static get states() {
|
|
146
|
-
return {
|
|
147
|
-
"activeLang": {}
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
static get elementRef() { return "host"; }
|
|
151
|
-
static get watchers() {
|
|
152
|
-
return [{
|
|
153
|
-
"propName": "caption",
|
|
154
|
-
"methodName": "validateCaption"
|
|
155
|
-
}, {
|
|
156
|
-
"propName": "description",
|
|
157
|
-
"methodName": "validateDescription"
|
|
158
|
-
}, {
|
|
159
|
-
"propName": "variant",
|
|
160
|
-
"methodName": "validateVariant"
|
|
161
|
-
}];
|
|
162
|
-
}
|
|
163
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const SWITCH_VARIANTS = ['list', 'dropdown'];
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2021 by Swiss Post, Information Technology
|
|
3
|
-
*/post-list{display:flex;flex-direction:column;gap:var(--post-list-title-gap, 0)}post-list>[role=list]{display:flex;flex-direction:column;gap:var(--post-list-item-gap, 0)}post-list:where([horizontal]:not([horizontal=false])){flex-direction:row;align-items:center}post-list:where([horizontal]:not([horizontal=false]))>[role=list]{flex-direction:row;align-items:center}post-list>.list-title.visually-hidden{width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}post-list>.list-title.visually-hidden:not(caption){position:absolute !important}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { Host, h } from "@stencil/core";
|
|
2
|
-
import { version } from "../../../../package";
|
|
3
|
-
/**
|
|
4
|
-
* @slot default - Slot for placing the list title.
|
|
5
|
-
* @slot post-list-item - Slot for placing post-list-item components.
|
|
6
|
-
*/
|
|
7
|
-
export class PostList {
|
|
8
|
-
constructor() {
|
|
9
|
-
this.titleId = undefined;
|
|
10
|
-
this.titleHidden = false;
|
|
11
|
-
this.horizontal = false;
|
|
12
|
-
}
|
|
13
|
-
componentWillLoad() {
|
|
14
|
-
/**
|
|
15
|
-
* Get the id set on the host element or use a random id by default
|
|
16
|
-
*/
|
|
17
|
-
this.titleId = `title-${this.host.id || crypto.randomUUID()}`;
|
|
18
|
-
}
|
|
19
|
-
componentDidLoad() {
|
|
20
|
-
this.checkTitle();
|
|
21
|
-
}
|
|
22
|
-
checkTitle() {
|
|
23
|
-
if (!this.titleEl.textContent.trim()) {
|
|
24
|
-
throw new Error('Please provide a title to the list component. Title is mandatory for accessibility purposes.');
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
render() {
|
|
28
|
-
return (h(Host, { key: '4f982e717530514589c5528553b70463d678b676', "data-version": version }, h("div", { key: 'cc65ed208f48e7a22482af96fd069d05363f2617', ref: el => (this.titleEl = el), id: this.titleId, class: `list-title${this.titleHidden ? ' visually-hidden' : ''}` }, h("slot", { key: '0f8bbeade50b59e53767ce2169dd57bb79644705' })), h("div", { key: '7fa5de37a169e6f76928c2088c46ee747427887e', role: "list", "aria-labelledby": this.titleId }, h("slot", { key: '86b4d71b83671babb61dd12e842710d67350a09e', name: "post-list-item" }))));
|
|
29
|
-
}
|
|
30
|
-
static get is() { return "post-list"; }
|
|
31
|
-
static get originalStyleUrls() {
|
|
32
|
-
return {
|
|
33
|
-
"$": ["post-list.scss"]
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
static get styleUrls() {
|
|
37
|
-
return {
|
|
38
|
-
"$": ["post-list.css"]
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
static get properties() {
|
|
42
|
-
return {
|
|
43
|
-
"titleHidden": {
|
|
44
|
-
"type": "boolean",
|
|
45
|
-
"mutable": false,
|
|
46
|
-
"complexType": {
|
|
47
|
-
"original": "boolean",
|
|
48
|
-
"resolved": "boolean",
|
|
49
|
-
"references": {}
|
|
50
|
-
},
|
|
51
|
-
"required": false,
|
|
52
|
-
"optional": false,
|
|
53
|
-
"docs": {
|
|
54
|
-
"tags": [],
|
|
55
|
-
"text": "If `true`, the list title will be hidden. Otherwise, it will be displayed.`"
|
|
56
|
-
},
|
|
57
|
-
"attribute": "title-hidden",
|
|
58
|
-
"reflect": false,
|
|
59
|
-
"defaultValue": "false"
|
|
60
|
-
},
|
|
61
|
-
"horizontal": {
|
|
62
|
-
"type": "boolean",
|
|
63
|
-
"mutable": false,
|
|
64
|
-
"complexType": {
|
|
65
|
-
"original": "boolean",
|
|
66
|
-
"resolved": "boolean",
|
|
67
|
-
"references": {}
|
|
68
|
-
},
|
|
69
|
-
"required": false,
|
|
70
|
-
"optional": false,
|
|
71
|
-
"docs": {
|
|
72
|
-
"tags": [],
|
|
73
|
-
"text": "The list can become horizontal by setting `horizontal=\"true\"` or just `horizontal`"
|
|
74
|
-
},
|
|
75
|
-
"attribute": "horizontal",
|
|
76
|
-
"reflect": true,
|
|
77
|
-
"defaultValue": "false"
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
static get states() {
|
|
82
|
-
return {
|
|
83
|
-
"titleId": {}
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
static get elementRef() { return "host"; }
|
|
87
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
:host{display:flex}
|