@swisspost/design-system-components 10.0.0-next.47 → 10.0.0-next.48
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/{event-from-AKK8RQrn.js → event-from-C6kpQwhw.js} +2 -2
- package/dist/cjs/index-CpDyH7Ww.js +4 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{package-wsZ6ig4j.js → package-CZyXYkIN.js} +1 -1
- package/dist/cjs/post-accordion_2.cjs.entry.js +4 -4
- package/dist/cjs/post-avatar.cjs.entry.js +91 -54
- package/dist/cjs/post-back-to-top.cjs.entry.js +1 -1
- package/dist/cjs/post-banner.cjs.entry.js +3 -3
- package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +1 -1
- package/dist/cjs/post-breadcrumbs.cjs.entry.js +1 -1
- package/dist/cjs/post-card-control.cjs.entry.js +1 -1
- package/dist/cjs/post-closebutton_15.cjs.entry.js +4 -5
- package/dist/cjs/post-collapsible_2.cjs.entry.js +2 -2
- package/dist/cjs/post-components.cjs.js +1 -1
- package/dist/cjs/post-footer.cjs.entry.js +1 -1
- package/dist/cjs/post-linkarea.cjs.entry.js +1 -1
- package/dist/cjs/post-popover.cjs.entry.js +1 -1
- package/dist/cjs/post-rating.cjs.entry.js +1 -1
- package/dist/cjs/post-tab-header.cjs.entry.js +1 -1
- package/dist/cjs/post-tab-panel.cjs.entry.js +1 -1
- package/dist/cjs/post-tabs.cjs.entry.js +2 -2
- package/dist/cjs/post-tooltip-trigger.cjs.entry.js +1 -1
- package/dist/cjs/post-tooltip.cjs.entry.js +1 -1
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +5 -5
- package/dist/collection/components/post-avatar/avatar-utils.js +16 -0
- package/dist/collection/components/post-avatar/post-avatar.js +90 -57
- package/dist/collection/components/post-banner/post-banner.js +2 -2
- package/dist/collection/components/post-closebutton/post-closebutton.js +1 -19
- package/dist/collection/components/post-menu/post-menu.js +4 -1
- package/dist/collection/components/post-tabs/post-tabs.js +3 -3
- package/dist/collection/utils/event-from.js +2 -2
- package/dist/{esm/event-from-8U5GFtQP.js → components/event-from.js} +2 -2
- package/dist/components/get-root.js +15 -0
- package/dist/components/index.d.ts +73 -0
- package/dist/components/index.js +36 -2315
- package/dist/components/package.js +3 -0
- package/dist/components/post-accordion-item.js +1 -1
- package/dist/components/post-accordion-item2.js +113 -0
- package/dist/components/post-accordion.js +1 -1
- package/dist/components/post-accordion2.js +138 -0
- package/dist/components/post-avatar.js +99 -62
- package/dist/components/post-back-to-top.js +6 -7
- package/dist/components/post-banner.js +10 -11
- package/dist/components/post-breadcrumb-item.js +1 -1
- package/dist/components/post-breadcrumb-item2.js +79 -0
- package/dist/components/post-breadcrumbs.js +13 -14
- package/dist/components/post-card-control.js +8 -9
- package/dist/components/post-closebutton.js +5 -7
- package/dist/components/post-collapsible-trigger.js +1 -1
- package/dist/components/post-collapsible-trigger2.js +135 -0
- package/dist/components/post-collapsible.js +1 -1
- package/dist/components/post-collapsible2.js +110 -0
- package/dist/components/post-footer.js +10 -11
- package/dist/components/post-header.js +6 -7
- package/dist/components/post-icon.js +1 -1
- package/dist/components/post-icon2.js +153 -0
- package/dist/components/post-language-option.js +8 -9
- package/dist/components/post-language-switch.js +12 -13
- package/dist/components/post-linkarea.js +3 -4
- package/dist/components/post-list-item.js +3 -4
- package/dist/components/post-list.js +4 -5
- package/dist/components/post-logo.js +5 -6
- package/dist/components/post-mainnavigation.js +4 -5
- package/dist/components/post-megadropdown-trigger.js +6 -7
- package/dist/components/post-megadropdown.js +7 -8
- package/dist/components/post-menu-item.js +1 -1
- package/dist/components/post-menu-item2.js +30 -0
- package/dist/components/post-menu-trigger.js +1 -1
- package/dist/components/post-menu-trigger2.js +110 -0
- package/dist/components/post-menu.js +1 -1
- package/dist/components/post-menu2.js +222 -0
- package/dist/components/post-popover.js +6 -7
- package/dist/components/post-popovercontainer.js +1 -1
- package/dist/components/post-popovercontainer2.js +3018 -0
- package/dist/components/post-rating.js +8 -9
- package/dist/components/post-tab-header.js +6 -7
- package/dist/components/post-tab-panel.js +6 -7
- package/dist/components/post-tabs.js +7 -8
- package/dist/components/post-togglebutton.js +3 -4
- package/dist/components/post-tooltip-trigger.js +6 -7
- package/dist/components/post-tooltip.js +6 -7
- package/dist/components/react/index.d.ts +33 -0
- package/dist/components/react/index.js +2315 -0
- package/dist/components/react/p-0Ltezq5O.js +3 -0
- package/dist/components/{p-i0-mizzM.js → react/p-38PqL5iD.js} +1 -1
- package/dist/components/react/p-BLchVpF6.js +14 -0
- package/dist/components/react/p-C35MCWIp.js +35 -0
- package/dist/components/{p-336Lbkey.js → react/p-CGsAj6ij.js} +1 -1
- package/dist/components/react/p-CJ80BZ06.js +178 -0
- package/dist/{esm/index-BWC0gtGU.js → components/react/p-CV7fm1rW.js} +1 -1
- package/dist/components/react/p-C_2k3G1c.js +264 -0
- package/dist/components/{p-DP5pj8mq.js → react/p-Ce7jgYmK.js} +1 -1
- package/dist/components/{p-BSvy4uym.js → react/p-CiYSngKM.js} +7 -7
- package/dist/components/{p-Cxrx7SXz.js → react/p-Da5wbVP8.js} +1 -1
- package/dist/components/{p-DVGX_JCp.js → react/p-Dq9F2i7n.js} +2 -2
- package/dist/components/{p-DEi5TIMq.js → react/p-DzYquz3e.js} +2 -2
- package/dist/components/{p-pHxypsHK.js → react/p-JHuJA2Lv.js} +4 -4
- package/dist/components/react/p-SbIC4aZX.js +11 -0
- package/dist/components/{p-C0H2ohSv.js → react/p-Tg0GNTZM.js} +2 -2
- package/dist/components/{p-8U5GFtQP.js → react/p-kraHE1r3.js} +2 -2
- package/dist/components/{p-BM8mtEfS.js → react/p-q8Fvf8A0.js} +1 -1
- package/dist/components/react/p-r4txK0AC.js +3 -0
- package/dist/components/react/post-accordion-item.d.ts +11 -0
- package/dist/components/react/post-accordion-item.js +6 -0
- package/dist/components/react/post-accordion.d.ts +11 -0
- package/dist/components/react/post-accordion.js +6 -0
- package/dist/components/react/post-avatar.d.ts +11 -0
- package/dist/components/react/post-avatar.js +226 -0
- package/dist/components/react/post-back-to-top.d.ts +11 -0
- package/dist/components/react/post-back-to-top.js +145 -0
- package/dist/components/react/post-banner.d.ts +11 -0
- package/dist/components/react/post-banner.js +99 -0
- package/dist/components/react/post-breadcrumb-item.d.ts +11 -0
- package/dist/components/react/post-breadcrumb-item.js +6 -0
- package/dist/components/react/post-breadcrumbs.d.ts +11 -0
- package/dist/components/react/post-breadcrumbs.js +187 -0
- package/dist/components/react/post-card-control.d.ts +11 -0
- package/dist/components/react/post-card-control.js +327 -0
- package/dist/components/react/post-closebutton.d.ts +11 -0
- package/dist/components/react/post-closebutton.js +50 -0
- package/dist/components/react/post-collapsible-trigger.d.ts +11 -0
- package/dist/components/react/post-collapsible-trigger.js +6 -0
- package/dist/components/react/post-collapsible.d.ts +11 -0
- package/dist/components/react/post-collapsible.js +6 -0
- package/dist/components/react/post-footer.d.ts +11 -0
- package/dist/components/react/post-footer.js +117 -0
- package/dist/components/react/post-header.d.ts +11 -0
- package/dist/components/react/post-header.js +333 -0
- package/dist/components/react/post-icon.d.ts +11 -0
- package/dist/components/react/post-icon.js +6 -0
- package/dist/components/react/post-language-option.d.ts +11 -0
- package/dist/components/react/post-language-option.js +101 -0
- package/dist/components/react/post-language-switch.d.ts +11 -0
- package/dist/components/react/post-language-switch.js +159 -0
- package/dist/components/react/post-linkarea.d.ts +11 -0
- package/dist/components/react/post-linkarea.js +46 -0
- package/dist/components/react/post-list-item.d.ts +11 -0
- package/dist/components/react/post-list-item.js +39 -0
- package/dist/components/react/post-list.d.ts +11 -0
- package/dist/components/react/post-list.js +62 -0
- package/dist/components/react/post-logo.d.ts +11 -0
- package/dist/components/react/post-logo.js +59 -0
- package/dist/components/react/post-mainnavigation.d.ts +11 -0
- package/dist/components/react/post-mainnavigation.js +181 -0
- package/dist/components/react/post-megadropdown-trigger.d.ts +11 -0
- package/dist/components/react/post-megadropdown-trigger.js +137 -0
- package/dist/components/react/post-megadropdown.d.ts +11 -0
- package/dist/components/react/post-megadropdown.js +197 -0
- package/dist/components/react/post-menu-item.d.ts +11 -0
- package/dist/components/react/post-menu-item.js +6 -0
- package/dist/components/react/post-menu-trigger.d.ts +11 -0
- package/dist/components/react/post-menu-trigger.js +6 -0
- package/dist/components/react/post-menu.d.ts +11 -0
- package/dist/components/react/post-menu.js +6 -0
- package/dist/components/react/post-popover.d.ts +11 -0
- package/dist/components/react/post-popover.js +189 -0
- package/dist/components/react/post-popovercontainer.d.ts +11 -0
- package/dist/components/react/post-popovercontainer.js +6 -0
- package/dist/components/react/post-rating.d.ts +11 -0
- package/dist/components/react/post-rating.js +153 -0
- package/dist/components/react/post-tab-header.d.ts +11 -0
- package/dist/components/react/post-tab-header.js +53 -0
- package/dist/components/react/post-tab-panel.d.ts +11 -0
- package/dist/components/react/post-tab-panel.js +55 -0
- package/dist/components/react/post-tabs.d.ts +11 -0
- package/dist/components/react/post-tabs.js +197 -0
- package/dist/components/react/post-togglebutton.d.ts +11 -0
- package/dist/components/react/post-togglebutton.js +57 -0
- package/dist/components/react/post-tooltip-trigger.d.ts +11 -0
- package/dist/components/react/post-tooltip-trigger.js +5223 -0
- package/dist/components/react/post-tooltip.d.ts +11 -0
- package/dist/components/react/post-tooltip.js +115 -0
- package/dist/components/switch-variants.js +3 -0
- package/dist/docs.json +20 -30
- package/dist/esm/event-from-kraHE1r3.js +105 -0
- package/dist/esm/index-C8a0ddDa.js +4 -4
- package/dist/esm/index-VmK3ABCB.js +88 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/package-0Ltezq5O.js +3 -0
- package/dist/esm/post-accordion_2.entry.js +5 -5
- package/dist/esm/post-avatar.entry.js +92 -55
- package/dist/esm/post-back-to-top.entry.js +2 -2
- package/dist/esm/post-banner.entry.js +4 -4
- package/dist/esm/post-breadcrumb-item_2.entry.js +2 -2
- package/dist/esm/post-breadcrumbs.entry.js +2 -2
- package/dist/esm/post-card-control.entry.js +2 -2
- package/dist/esm/post-closebutton_15.entry.js +6 -7
- package/dist/esm/post-collapsible_2.entry.js +3 -3
- package/dist/esm/post-components.js +1 -1
- package/dist/esm/post-footer.entry.js +2 -2
- package/dist/esm/post-linkarea.entry.js +1 -1
- package/dist/esm/post-popover.entry.js +2 -2
- package/dist/esm/post-rating.entry.js +2 -2
- package/dist/esm/post-tab-header.entry.js +2 -2
- package/dist/esm/post-tab-panel.entry.js +2 -2
- package/dist/esm/post-tabs.entry.js +2 -2
- package/dist/esm/post-tooltip-trigger.entry.js +2 -2
- package/dist/esm/post-tooltip.entry.js +2 -2
- package/dist/loader/cdn.js +1 -0
- package/dist/loader/index.cjs.js +1 -0
- package/{loader → dist/loader}/index.d.ts +1 -1
- package/dist/loader/index.es2017.js +1 -0
- package/{loader → dist/loader}/index.js +1 -1
- package/dist/post-components/p-0Ltezq5O.js +1 -0
- package/dist/post-components/{p-bbe02ba3.entry.js → p-16772417.entry.js} +1 -1
- package/dist/post-components/{p-45007aac.entry.js → p-38d3d441.entry.js} +1 -1
- package/dist/post-components/{p-f67b616a.entry.js → p-3c71f590.entry.js} +1 -1
- package/dist/post-components/{p-a2fa5ce4.entry.js → p-40f21542.entry.js} +1 -1
- package/dist/post-components/{p-031f7489.entry.js → p-4243cdd1.entry.js} +1 -1
- package/dist/post-components/p-4c18cb8c.entry.js +1 -0
- package/dist/post-components/{p-c1cf39cb.entry.js → p-51dc7647.entry.js} +1 -1
- package/dist/post-components/{p-e9802b56.entry.js → p-6777e505.entry.js} +1 -1
- package/dist/post-components/{p-2f698af4.entry.js → p-6add880f.entry.js} +1 -1
- package/dist/post-components/{p-2ca196d6.entry.js → p-8363fedb.entry.js} +1 -1
- package/dist/post-components/p-83998038.entry.js +1 -0
- package/dist/post-components/{p-d0d92071.entry.js → p-85bb1b5e.entry.js} +1 -1
- package/dist/post-components/{p-3adbdda7.entry.js → p-8f4d8685.entry.js} +1 -1
- package/dist/post-components/{p-1e6a068a.entry.js → p-95ad536d.entry.js} +1 -1
- package/dist/post-components/{p-9428231b.entry.js → p-9d806e89.entry.js} +1 -1
- package/dist/post-components/{p-BWC0gtGU.js → p-VmK3ABCB.js} +1 -1
- package/dist/post-components/{p-57703aee.entry.js → p-aad86320.entry.js} +1 -1
- package/dist/post-components/p-c3e38acf.entry.js +1 -0
- package/dist/post-components/{p-ab8017bb.entry.js → p-d61bb2ff.entry.js} +1 -1
- package/dist/post-components/p-kraHE1r3.js +1 -0
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/components/post-accordion-item/post-accordion-item.d.ts +3 -3
- package/dist/types/components/post-avatar/avatar-utils.d.ts +3 -0
- package/dist/types/components/post-avatar/post-avatar.d.ts +13 -10
- package/dist/types/components/post-closebutton/post-closebutton.d.ts +0 -6
- package/dist/types/components/post-menu/post-menu.d.ts +3 -0
- package/dist/types/components/post-tabs/post-tabs.d.ts +2 -2
- package/dist/types/components.d.ts +0 -19
- package/dist/types/utils/component-on-ready.d.ts +2 -2
- package/hydrate/index.js +110 -70
- package/hydrate/index.mjs +110 -70
- package/package.json +19 -9
- package/dist/components/p-Z01QMrov.js +0 -3
- package/dist/esm/package-Z01QMrov.js +0 -3
- package/dist/post-components/p-7b8ab026.entry.js +0 -1
- package/dist/post-components/p-8U5GFtQP.js +0 -1
- package/dist/post-components/p-Z01QMrov.js +0 -1
- package/dist/post-components/p-ac73ab00.entry.js +0 -1
- package/dist/post-components/p-e96239c4.entry.js +0 -1
- package/loader/cdn.js +0 -1
- package/loader/index.cjs.js +0 -1
- package/loader/index.es2017.js +0 -1
- /package/dist/components/{p-CJ80BZ06.js → breakpoints.js} +0 -0
- /package/dist/components/{p-SbIC4aZX.js → fade.js} +0 -0
- /package/dist/components/{p-C35MCWIp.js → get-focusable-children.js} +0 -0
- /package/dist/components/{p-r4txK0AC.js → heading-levels.js} +0 -0
- /package/dist/components/{p-BLchVpF6.js → index.browser.js} +0 -0
- /package/dist/components/{p-CV7fm1rW.js → index2.js} +0 -0
- /package/dist/components/{p-C_2k3G1c.js → long-press-event.js} +0 -0
- /package/dist/components/{p-CBFgkSgY.js → react/p-CBFgkSgY.js} +0 -0
- /package/dist/components/{p-DjIHLduJ.js → react/p-DjIHLduJ.js} +0 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { p as proxyCustomElement, H, c as createEvent, h, a as Host } from './index.js';
|
|
2
|
+
import { c as checkRequiredAndType, d as checkEmptyOrOneOf, e as checkEmptyOrType, a as checkEmptyOrUrl } from './p-CV7fm1rW.js';
|
|
3
|
+
import './p-CJ80BZ06.js';
|
|
4
|
+
import { v as version } from './p-0Ltezq5O.js';
|
|
5
|
+
import { S as SWITCH_VARIANTS } from './p-DjIHLduJ.js';
|
|
6
|
+
|
|
7
|
+
const postLanguageOptionCss = "@keyframes popIn{from{transform:scale(0.9);opacity:0;transition-property:transform,opacity,overlay,display;transition-behavior:allow-discrete;transition-duration:var(--post-transition-duration, 0.35s);transition-timing-function:linear(0, 0.007, 0.029 2.2%, 0.118 4.7%, 0.625 14.4%, 0.826 19%, 0.902, 0.962, 1.008 26.1%, 1.041 28.7%, 1.064 32.1%, 1.07 36%, 1.061 40.5%, 1.015 53.4%, 0.999 61.6%, 0.995 71.2%, 1)}to{opacity:1;transform:scale(1)}}post-language-option{display:inline-block}post-language-option 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-option button{background-color:ButtonFace !important}post-language-option button:hover{background-color:Highlight !important}}post-language-option button .visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}post-language-option a{color:var(--post-current-fg);text-decoration:none}post-language-option :is(a,button){cursor:pointer;display:flex;align-items:center;justify-content:center;width:100%;height:100%;text-transform:uppercase}post-language-option :is(a,button){outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}post-language-option :is(a,button):is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;outline-offset:-2px !important;border-radius:4px}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-language-option :is(a,button):is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){post-language-option :is(a,button):is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;outline-offset:-2px !important;border-radius:4px}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-language-option :is(a,button):is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}post-language-option:where([variant=list]) :is(a,button){padding-inline:0;width:40px;height:40px;border-radius:2px}post-language-option:where([variant=list]) :is(a,button):hover{color:#504f4b}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-language-option:where([variant=list]) :is(a,button){border:1px solid ButtonBorder;color:ButtonText}}post-language-option:where([variant=list])[active]:not([active=false]) :is(a,button){background-color:#050400 !important;color:#fff;pointer-events:none}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-language-option:where([variant=list])[active]:not([active=false]) :is(a,button){background-color:Highlight !important;color:HighlightText}}post-language-option:where([variant=menu]){min-width:72px}post-language-option:where([variant=menu])[active]:not([active=false]){display:none}post-language-option:where([variant=menu]) :is(a,button){padding-block:13px;padding-inline:16px;box-sizing:border-box;justify-content:flex-start;position:relative;border-radius:0}post-language-option:where([variant=menu]) :is(a,button):hover{color:#fff;background-color:#504f4b}post-language-option:where([variant=menu]):first-child :is(a,button){border-start-start-radius:4px;border-start-end-radius:4px}post-language-option:where([variant=menu]):last-child :is(a,button){border-end-start-radius:4px;border-end-end-radius:4px}";
|
|
8
|
+
|
|
9
|
+
const PostLanguageOption$1 = /*@__PURE__*/ proxyCustomElement(class PostLanguageOption extends H {
|
|
10
|
+
constructor() {
|
|
11
|
+
super();
|
|
12
|
+
this.__registerHost();
|
|
13
|
+
this.postChange = createEvent(this, "postChange");
|
|
14
|
+
this.postLanguageOptionInitiallyActive = createEvent(this, "postLanguageOptionInitiallyActive");
|
|
15
|
+
}
|
|
16
|
+
validateCode() {
|
|
17
|
+
checkRequiredAndType(this, 'code', 'string');
|
|
18
|
+
}
|
|
19
|
+
validateVariant() {
|
|
20
|
+
checkEmptyOrOneOf(this, 'variant', SWITCH_VARIANTS);
|
|
21
|
+
}
|
|
22
|
+
validateName() {
|
|
23
|
+
checkEmptyOrType(this, 'name', 'string');
|
|
24
|
+
}
|
|
25
|
+
validateUrl() {
|
|
26
|
+
checkEmptyOrUrl(this, 'url');
|
|
27
|
+
}
|
|
28
|
+
componentDidLoad() {
|
|
29
|
+
this.validateCode();
|
|
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
|
+
if (this.active) {
|
|
36
|
+
this.postLanguageOptionInitiallyActive.emit(this.code);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Selects the language option programmatically.
|
|
41
|
+
*/
|
|
42
|
+
async select() {
|
|
43
|
+
this.active = true;
|
|
44
|
+
this.emitChange();
|
|
45
|
+
}
|
|
46
|
+
emitChange() {
|
|
47
|
+
this.postChange.emit(this.code);
|
|
48
|
+
}
|
|
49
|
+
isNameRequired() {
|
|
50
|
+
return this.host.textContent.toLowerCase() === this.code.toLowerCase();
|
|
51
|
+
}
|
|
52
|
+
render() {
|
|
53
|
+
const lang = this.code.toLowerCase();
|
|
54
|
+
const role = this.variant === 'menu' ? 'menuitem' : undefined;
|
|
55
|
+
const emitOnKeyDown = (e) => {
|
|
56
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
57
|
+
this.emitChange();
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
return (h(Host, { key: '565abb06373e341d429242f6d1943edfdb20f8d7', "data-version": version }, this.url ? (h("a", { role: role, "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", { role: role, "aria-current": this.active ? 'true' : undefined, lang: lang, onClick: () => this.emitChange(), onKeyDown: emitOnKeyDown }, h("slot", null), h("span", { class: "visually-hidden" }, this.name)))));
|
|
61
|
+
}
|
|
62
|
+
get host() { return this; }
|
|
63
|
+
static get watchers() { return {
|
|
64
|
+
"code": ["validateCode"],
|
|
65
|
+
"variant": ["validateVariant"],
|
|
66
|
+
"name": ["validateName"],
|
|
67
|
+
"url": ["validateUrl"]
|
|
68
|
+
}; }
|
|
69
|
+
static get style() { return postLanguageOptionCss; }
|
|
70
|
+
}, [4, "post-language-option", {
|
|
71
|
+
"code": [1],
|
|
72
|
+
"active": [1540],
|
|
73
|
+
"variant": [1],
|
|
74
|
+
"name": [1],
|
|
75
|
+
"url": [1],
|
|
76
|
+
"select": [64]
|
|
77
|
+
}, undefined, {
|
|
78
|
+
"code": ["validateCode"],
|
|
79
|
+
"variant": ["validateVariant"],
|
|
80
|
+
"name": ["validateName"],
|
|
81
|
+
"url": ["validateUrl"]
|
|
82
|
+
}]);
|
|
83
|
+
function defineCustomElement$1() {
|
|
84
|
+
if (typeof customElements === "undefined") {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const components = ["post-language-option"];
|
|
88
|
+
components.forEach(tagName => { switch (tagName) {
|
|
89
|
+
case "post-language-option":
|
|
90
|
+
if (!customElements.get(tagName)) {
|
|
91
|
+
customElements.define(tagName, PostLanguageOption$1);
|
|
92
|
+
}
|
|
93
|
+
break;
|
|
94
|
+
} });
|
|
95
|
+
}
|
|
96
|
+
defineCustomElement$1();
|
|
97
|
+
|
|
98
|
+
const PostLanguageOption = PostLanguageOption$1;
|
|
99
|
+
const defineCustomElement = defineCustomElement$1;
|
|
100
|
+
|
|
101
|
+
export { PostLanguageOption, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../../types/components";
|
|
2
|
+
|
|
3
|
+
interface PostLanguageSwitch extends Components.PostLanguageSwitch, HTMLElement {}
|
|
4
|
+
export const PostLanguageSwitch: {
|
|
5
|
+
prototype: PostLanguageSwitch;
|
|
6
|
+
new (): PostLanguageSwitch;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { p as proxyCustomElement, H, h, a as Host } from './index.js';
|
|
2
|
+
import { c as checkRequiredAndType, d as checkEmptyOrOneOf } from './p-CV7fm1rW.js';
|
|
3
|
+
import './p-CJ80BZ06.js';
|
|
4
|
+
import { E as EventFrom } from './p-kraHE1r3.js';
|
|
5
|
+
import { v as version } from './p-0Ltezq5O.js';
|
|
6
|
+
import { S as SWITCH_VARIANTS } from './p-DjIHLduJ.js';
|
|
7
|
+
import { n as nanoid } from './p-BLchVpF6.js';
|
|
8
|
+
import { d as defineCustomElement$5 } from './p-Da5wbVP8.js';
|
|
9
|
+
import { d as defineCustomElement$4 } from './p-JHuJA2Lv.js';
|
|
10
|
+
import { d as defineCustomElement$3 } from './p-CGsAj6ij.js';
|
|
11
|
+
import { d as defineCustomElement$2 } from './p-Ce7jgYmK.js';
|
|
12
|
+
|
|
13
|
+
const postLanguageSwitchCss = ":host{display:flex !important;flex-wrap:wrap;gap:.5rem}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}.post-language-switch-dropdown-container{display:flex;flex-direction:column}.post-language-switch-trigger{cursor:pointer;text-transform:uppercase;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;text-decoration:none;display:inline-flex;align-items:center;gap:6px;border-radius:24px;font-size:16px;padding:3px 10px}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.post-language-switch-trigger{background-color:ButtonFace !important}.post-language-switch-trigger:hover{background-color:Highlight !important}}.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:24px;width:24px}.post-language-switch-trigger[aria-expanded=true]{background-color:#050400;color:#fff}.post-language-switch-trigger[aria-expanded=true] post-icon{transform:rotate(180deg)}.post-language-switch-trigger[aria-expanded=true]:hover{background-color:#504f4b;color:#fff}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.post-language-switch-trigger{border:1px solid ButtonBorder}.post-language-switch-trigger[aria-expanded=true] post-icon,.post-language-switch-trigger:hover post-icon{color:HighlightText}}post-menu::part(menu){padding-block:0}";
|
|
14
|
+
|
|
15
|
+
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
16
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
17
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
18
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
19
|
+
else
|
|
20
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
21
|
+
if (d = decorators[i])
|
|
22
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
23
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
24
|
+
};
|
|
25
|
+
const PostLanguageSwitch$1 = /*@__PURE__*/ proxyCustomElement(class PostLanguageSwitch extends H {
|
|
26
|
+
constructor() {
|
|
27
|
+
super();
|
|
28
|
+
this.__registerHost();
|
|
29
|
+
this.__attachShadow();
|
|
30
|
+
this.menuId = `p${nanoid(11)}`;
|
|
31
|
+
this.listSpanId = `list-span-${nanoid(11)}`;
|
|
32
|
+
/**
|
|
33
|
+
* Whether the component is rendered as a list or a menu
|
|
34
|
+
*/
|
|
35
|
+
this.variant = 'list';
|
|
36
|
+
}
|
|
37
|
+
get languageOptions() {
|
|
38
|
+
return Array.from(this.host.querySelectorAll('post-language-option'));
|
|
39
|
+
}
|
|
40
|
+
validateCaption() {
|
|
41
|
+
checkRequiredAndType(this, 'caption', 'string');
|
|
42
|
+
}
|
|
43
|
+
validateDescription() {
|
|
44
|
+
checkRequiredAndType(this, 'description', 'string');
|
|
45
|
+
}
|
|
46
|
+
validateVariant() {
|
|
47
|
+
checkEmptyOrOneOf(this, 'variant', SWITCH_VARIANTS);
|
|
48
|
+
this.updateChildrenVariant();
|
|
49
|
+
}
|
|
50
|
+
componentDidLoad() {
|
|
51
|
+
this.validateCaption();
|
|
52
|
+
this.validateDescription();
|
|
53
|
+
this.validateVariant();
|
|
54
|
+
// Initially set variants and active language
|
|
55
|
+
// Handles cases where the language-switch is rendered after the language-options have been rendered
|
|
56
|
+
this.updateChildrenVariant();
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Listen for the postChange event and guard it to run only for events originating from a <post-language-option> element.
|
|
60
|
+
*/
|
|
61
|
+
handlePostChange(event) {
|
|
62
|
+
this.activeLang = event.detail;
|
|
63
|
+
// Update the active state in the children post-language-option components
|
|
64
|
+
this.languageOptions.forEach(lang => {
|
|
65
|
+
if (lang.code && lang.code === this.activeLang) {
|
|
66
|
+
lang.setAttribute('active', '');
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
lang.removeAttribute('active');
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
// Hides the dropdown when an option has been clicked
|
|
73
|
+
if (this.variant === 'menu') {
|
|
74
|
+
const menu = this.host.shadowRoot.querySelector('post-menu');
|
|
75
|
+
menu.hide();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Handles cases where the language switch is being rendered before options are available
|
|
80
|
+
* @param event Initially emitted by <post-langauge-option>
|
|
81
|
+
*/
|
|
82
|
+
handleInitiallyActive(event) {
|
|
83
|
+
this.activeLang = event.detail;
|
|
84
|
+
}
|
|
85
|
+
// Update post-language-option variant to have the correct style
|
|
86
|
+
updateChildrenVariant() {
|
|
87
|
+
this.languageOptions.forEach(el => {
|
|
88
|
+
el.setAttribute('variant', this.variant);
|
|
89
|
+
el.setAttribute('role', this.variant == 'menu' ? 'menuitem' : 'listitem');
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
renderList() {
|
|
93
|
+
return (h(Host, { "data-version": version }, h("div", { class: "post-language-switch-list", role: "list", "aria-label": this.caption, "aria-describedby": this.listSpanId }, h("span", { id: this.listSpanId, class: "visually-hidden" }, this.description), h("slot", null))));
|
|
94
|
+
}
|
|
95
|
+
renderDropdown() {
|
|
96
|
+
return (h(Host, { "data-version": version }, h("post-menu-trigger", { for: this.menuId }, h("button", { class: "post-language-switch-trigger" }, this.activeLang, h("span", { class: "visually-hidden" }, this.caption), h("span", { class: "visually-hidden" }, this.description), h("post-icon", { "aria-hidden": "true", name: "chevrondown" }))), h("post-menu", { id: this.menuId, class: "post-language-switch-dropdown-container", "aria-label": this.caption, role: "menu" }, h("slot", null))));
|
|
97
|
+
}
|
|
98
|
+
render() {
|
|
99
|
+
return this.variant === 'list' ? this.renderList() : this.renderDropdown();
|
|
100
|
+
}
|
|
101
|
+
get host() { return this; }
|
|
102
|
+
static get watchers() { return {
|
|
103
|
+
"caption": ["validateCaption"],
|
|
104
|
+
"description": ["validateDescription"],
|
|
105
|
+
"variant": ["validateVariant"]
|
|
106
|
+
}; }
|
|
107
|
+
static get style() { return postLanguageSwitchCss; }
|
|
108
|
+
}, [1, "post-language-switch", {
|
|
109
|
+
"caption": [1],
|
|
110
|
+
"description": [1],
|
|
111
|
+
"variant": [1],
|
|
112
|
+
"activeLang": [32]
|
|
113
|
+
}, [[0, "postChange", "handlePostChange"], [0, "postLanguageOptionInitiallyActive", "handleInitiallyActive"]], {
|
|
114
|
+
"caption": ["validateCaption"],
|
|
115
|
+
"description": ["validateDescription"],
|
|
116
|
+
"variant": ["validateVariant"]
|
|
117
|
+
}]);
|
|
118
|
+
__decorate([
|
|
119
|
+
EventFrom('post-language-option')
|
|
120
|
+
], PostLanguageSwitch$1.prototype, "handlePostChange", null);
|
|
121
|
+
function defineCustomElement$1() {
|
|
122
|
+
if (typeof customElements === "undefined") {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
const components = ["post-language-switch", "post-icon", "post-menu", "post-menu-trigger", "post-popovercontainer"];
|
|
126
|
+
components.forEach(tagName => { switch (tagName) {
|
|
127
|
+
case "post-language-switch":
|
|
128
|
+
if (!customElements.get(tagName)) {
|
|
129
|
+
customElements.define(tagName, PostLanguageSwitch$1);
|
|
130
|
+
}
|
|
131
|
+
break;
|
|
132
|
+
case "post-icon":
|
|
133
|
+
if (!customElements.get(tagName)) {
|
|
134
|
+
defineCustomElement$5();
|
|
135
|
+
}
|
|
136
|
+
break;
|
|
137
|
+
case "post-menu":
|
|
138
|
+
if (!customElements.get(tagName)) {
|
|
139
|
+
defineCustomElement$4();
|
|
140
|
+
}
|
|
141
|
+
break;
|
|
142
|
+
case "post-menu-trigger":
|
|
143
|
+
if (!customElements.get(tagName)) {
|
|
144
|
+
defineCustomElement$3();
|
|
145
|
+
}
|
|
146
|
+
break;
|
|
147
|
+
case "post-popovercontainer":
|
|
148
|
+
if (!customElements.get(tagName)) {
|
|
149
|
+
defineCustomElement$2();
|
|
150
|
+
}
|
|
151
|
+
break;
|
|
152
|
+
} });
|
|
153
|
+
}
|
|
154
|
+
defineCustomElement$1();
|
|
155
|
+
|
|
156
|
+
const PostLanguageSwitch = PostLanguageSwitch$1;
|
|
157
|
+
const defineCustomElement = defineCustomElement$1;
|
|
158
|
+
|
|
159
|
+
export { PostLanguageSwitch, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../../types/components";
|
|
2
|
+
|
|
3
|
+
interface PostLinkarea extends Components.PostLinkarea, HTMLElement {}
|
|
4
|
+
export const PostLinkarea: {
|
|
5
|
+
prototype: PostLinkarea;
|
|
6
|
+
new (): PostLinkarea;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { p as proxyCustomElement, H, h, a as Host } from './index.js';
|
|
2
|
+
import { v as version } from './p-0Ltezq5O.js';
|
|
3
|
+
|
|
4
|
+
const postLinkareaCss = ":host{display:contents;cursor:pointer}";
|
|
5
|
+
|
|
6
|
+
const INTERACTIVE_ELEMENTS = ['a'].join(',');
|
|
7
|
+
const INTERACTIVE_ELEMENTS_SELECTOR = `:where(${INTERACTIVE_ELEMENTS})`;
|
|
8
|
+
const PostLinkarea$1 = /*@__PURE__*/ proxyCustomElement(class PostLinkarea extends H {
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
this.__registerHost();
|
|
12
|
+
this.__attachShadow();
|
|
13
|
+
}
|
|
14
|
+
dispatchClick({ ctrlKey, shiftKey, altKey, metaKey }) {
|
|
15
|
+
const interactiveElement = this.host.querySelector(`[data-link]${INTERACTIVE_ELEMENTS_SELECTOR}`) ??
|
|
16
|
+
this.host.querySelector(INTERACTIVE_ELEMENTS_SELECTOR);
|
|
17
|
+
if (!interactiveElement) {
|
|
18
|
+
throw new Error(`The \`post-linkarea\` component must contain an interactive element. Possible elements are: ${INTERACTIVE_ELEMENTS}.`);
|
|
19
|
+
}
|
|
20
|
+
interactiveElement.dispatchEvent(new MouseEvent('click', { ctrlKey, shiftKey, altKey, metaKey }));
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
return (h(Host, { key: 'ccd776a066fec91edfd5fdb1d4fc8c67dc5ee4ed', "data-version": version, onClick: (e) => this.dispatchClick(e), tabindex: "0" }, h("slot", { key: '8fa2d023650c42d3e57b1e38f263e9c51e6aa012' })));
|
|
24
|
+
}
|
|
25
|
+
get host() { return this; }
|
|
26
|
+
static get style() { return postLinkareaCss; }
|
|
27
|
+
}, [1, "post-linkarea"]);
|
|
28
|
+
function defineCustomElement$1() {
|
|
29
|
+
if (typeof customElements === "undefined") {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const components = ["post-linkarea"];
|
|
33
|
+
components.forEach(tagName => { switch (tagName) {
|
|
34
|
+
case "post-linkarea":
|
|
35
|
+
if (!customElements.get(tagName)) {
|
|
36
|
+
customElements.define(tagName, PostLinkarea$1);
|
|
37
|
+
}
|
|
38
|
+
break;
|
|
39
|
+
} });
|
|
40
|
+
}
|
|
41
|
+
defineCustomElement$1();
|
|
42
|
+
|
|
43
|
+
const PostLinkarea = PostLinkarea$1;
|
|
44
|
+
const defineCustomElement = defineCustomElement$1;
|
|
45
|
+
|
|
46
|
+
export { PostLinkarea, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../../types/components";
|
|
2
|
+
|
|
3
|
+
interface PostListItem extends Components.PostListItem, HTMLElement {}
|
|
4
|
+
export const PostListItem: {
|
|
5
|
+
prototype: PostListItem;
|
|
6
|
+
new (): PostListItem;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { p as proxyCustomElement, H, h, a as Host } from './index.js';
|
|
2
|
+
import { v as version } from './p-0Ltezq5O.js';
|
|
3
|
+
|
|
4
|
+
const postListItemCss = ":host{display:flex}";
|
|
5
|
+
|
|
6
|
+
const PostListItem$1 = /*@__PURE__*/ proxyCustomElement(class PostListItem extends H {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.__registerHost();
|
|
10
|
+
this.__attachShadow();
|
|
11
|
+
}
|
|
12
|
+
connectedCallback() {
|
|
13
|
+
this.host.setAttribute('slot', 'post-list-item');
|
|
14
|
+
}
|
|
15
|
+
render() {
|
|
16
|
+
return (h(Host, { key: 'c6e5d38b3b01e37bb59cf31d64228e12dcd47bde', role: "listitem", slot: "post-list-item", version: version }, h("slot", { key: '0e156cf6e671ff4835b0262ef44b9e4342e58b94' })));
|
|
17
|
+
}
|
|
18
|
+
get host() { return this; }
|
|
19
|
+
static get style() { return postListItemCss; }
|
|
20
|
+
}, [1, "post-list-item"]);
|
|
21
|
+
function defineCustomElement$1() {
|
|
22
|
+
if (typeof customElements === "undefined") {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const components = ["post-list-item"];
|
|
26
|
+
components.forEach(tagName => { switch (tagName) {
|
|
27
|
+
case "post-list-item":
|
|
28
|
+
if (!customElements.get(tagName)) {
|
|
29
|
+
customElements.define(tagName, PostListItem$1);
|
|
30
|
+
}
|
|
31
|
+
break;
|
|
32
|
+
} });
|
|
33
|
+
}
|
|
34
|
+
defineCustomElement$1();
|
|
35
|
+
|
|
36
|
+
const PostListItem = PostListItem$1;
|
|
37
|
+
const defineCustomElement = defineCustomElement$1;
|
|
38
|
+
|
|
39
|
+
export { PostListItem, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../../types/components";
|
|
2
|
+
|
|
3
|
+
interface PostList extends Components.PostList, HTMLElement {}
|
|
4
|
+
export const PostList: {
|
|
5
|
+
prototype: PostList;
|
|
6
|
+
new (): PostList;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { p as proxyCustomElement, H, h, a as Host } from './index.js';
|
|
2
|
+
import { v as version } from './p-0Ltezq5O.js';
|
|
3
|
+
import { n as nanoid } from './p-BLchVpF6.js';
|
|
4
|
+
|
|
5
|
+
const postListCss = "@keyframes popIn{from{transform:scale(0.9);opacity:0;transition-property:transform,opacity,overlay,display;transition-behavior:allow-discrete;transition-duration:var(--post-transition-duration, 0.35s);transition-timing-function:linear(0, 0.007, 0.029 2.2%, 0.118 4.7%, 0.625 14.4%, 0.826 19%, 0.902, 0.962, 1.008 26.1%, 1.041 28.7%, 1.064 32.1%, 1.07 36%, 1.061 40.5%, 1.015 53.4%, 0.999 61.6%, 0.995 71.2%, 1)}to{opacity:1;transform:scale(1)}}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{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}";
|
|
6
|
+
|
|
7
|
+
const PostList$1 = /*@__PURE__*/ proxyCustomElement(class PostList extends H {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this.__registerHost();
|
|
11
|
+
/**
|
|
12
|
+
* If `true`, the list title will be hidden. Otherwise, it will be displayed.`
|
|
13
|
+
*/
|
|
14
|
+
this.titleHidden = false;
|
|
15
|
+
/**
|
|
16
|
+
* The list can become horizontal by setting `horizontal="true"` or just `horizontal`
|
|
17
|
+
*/
|
|
18
|
+
this.horizontal = false;
|
|
19
|
+
}
|
|
20
|
+
componentWillLoad() {
|
|
21
|
+
/**
|
|
22
|
+
* Get the id set on the host element or use a random id by default
|
|
23
|
+
*/
|
|
24
|
+
this.titleId = `title-${this.host.id || nanoid(6)}`;
|
|
25
|
+
}
|
|
26
|
+
componentDidLoad() {
|
|
27
|
+
this.checkTitle();
|
|
28
|
+
}
|
|
29
|
+
checkTitle() {
|
|
30
|
+
if (!this.titleEl.textContent.trim()) {
|
|
31
|
+
console.error('Please provide a title to the list component. Title is mandatory for accessibility purposes.');
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
render() {
|
|
35
|
+
return (h(Host, { key: '36b2afb0224903b411ca77257ab80d0a455bdf82', "data-version": version }, h("div", { key: 'af0b3536d697097bc841a7ea50871fc69c230aee', ref: el => (this.titleEl = el), id: this.titleId, class: `list-title${this.titleHidden ? ' visually-hidden' : ''}` }, h("slot", { key: '4e115aa68fdbb2c674065e7644f326e0990b4867' })), h("div", { key: '49c0032b0baca56af8015d457a2d134dc0a9d39b', role: "list", "aria-labelledby": this.titleId }, h("slot", { key: 'ec67e9a226b003c6f2e9aca019bef483fa22011e', name: "post-list-item" }))));
|
|
36
|
+
}
|
|
37
|
+
get host() { return this; }
|
|
38
|
+
static get style() { return postListCss; }
|
|
39
|
+
}, [4, "post-list", {
|
|
40
|
+
"titleHidden": [4, "title-hidden"],
|
|
41
|
+
"horizontal": [516],
|
|
42
|
+
"titleId": [32]
|
|
43
|
+
}]);
|
|
44
|
+
function defineCustomElement$1() {
|
|
45
|
+
if (typeof customElements === "undefined") {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const components = ["post-list"];
|
|
49
|
+
components.forEach(tagName => { switch (tagName) {
|
|
50
|
+
case "post-list":
|
|
51
|
+
if (!customElements.get(tagName)) {
|
|
52
|
+
customElements.define(tagName, PostList$1);
|
|
53
|
+
}
|
|
54
|
+
break;
|
|
55
|
+
} });
|
|
56
|
+
}
|
|
57
|
+
defineCustomElement$1();
|
|
58
|
+
|
|
59
|
+
const PostList = PostList$1;
|
|
60
|
+
const defineCustomElement = defineCustomElement$1;
|
|
61
|
+
|
|
62
|
+
export { PostList, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../../types/components";
|
|
2
|
+
|
|
3
|
+
interface PostLogo extends Components.PostLogo, HTMLElement {}
|
|
4
|
+
export const PostLogo: {
|
|
5
|
+
prototype: PostLogo;
|
|
6
|
+
new (): PostLogo;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { p as proxyCustomElement, H, h, a as Host } from './index.js';
|
|
2
|
+
import { v as version } from './p-0Ltezq5O.js';
|
|
3
|
+
import { a as checkEmptyOrUrl } from './p-CV7fm1rW.js';
|
|
4
|
+
import './p-CJ80BZ06.js';
|
|
5
|
+
|
|
6
|
+
const postLogoCss = ":host,.logo{display:inline-block}:host,:host .logo>svg,.logo,.logo .logo>svg{height:100%}.description{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}.logo-link{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}.logo-link: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){.logo-link:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.logo-link: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){.logo-link:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.logo-link :focus,:focus-visible{border-radius:2px}";
|
|
7
|
+
|
|
8
|
+
const PostLogo$1 = /*@__PURE__*/ proxyCustomElement(class PostLogo extends H {
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
this.__registerHost();
|
|
12
|
+
this.__attachShadow();
|
|
13
|
+
}
|
|
14
|
+
validateUrl() {
|
|
15
|
+
checkEmptyOrUrl(this, 'url');
|
|
16
|
+
}
|
|
17
|
+
componentDidLoad() {
|
|
18
|
+
this.validateUrl();
|
|
19
|
+
this.checkDescription();
|
|
20
|
+
}
|
|
21
|
+
checkDescription() {
|
|
22
|
+
if (!this.host.textContent) {
|
|
23
|
+
console.warn('Be sure to add descriptive text in the post-logo to ensure good accessibility of the component.');
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
render() {
|
|
27
|
+
const logoLink = this.url && (typeof this.url === 'string' ? this.url : this.url.href);
|
|
28
|
+
const LogoTag = logoLink ? 'a' : 'span';
|
|
29
|
+
return (h(Host, { key: 'd6279e660f4e48e1810a76cd7449a964908a327f', "data-version": version }, h(LogoTag, { key: 'aa1c6764aafb74cd7c670cc5281f267df5e684e2', class: `logo ${logoLink ? 'logo-link' : ''}`, ...(logoLink ? { href: logoLink } : {}) }, h("span", { key: 'ab4ab45ed0b58d309aef262335c2bfb12f42b5d6', class: "description" }, h("slot", { key: '4ddbcb53683853723b426a76b4614bee59d83777', onSlotchange: () => this.checkDescription() })), h("svg", { key: '2c78f3b6bb6364f5872032aeb32e29d315451c4d', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 72 72", "aria-hidden": "true" }, h("g", { key: '8d02b5cf5b5f88f52dcf49c0d40f6153a3dc5714', id: "Logo" }, h("rect", { key: '18901557af215a699c6070638c21e7ad552c071a', fill: "#ffcc00", x: "0", y: "0", width: "72", height: "72" }), h("polygon", { key: '56d26b229eb79d87ad41a8b1d8a98937150b1e6d', 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: 'f1a2f2083359e4204c8af9d1e75d27c8b50df480', 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" }))))));
|
|
30
|
+
}
|
|
31
|
+
get host() { return this; }
|
|
32
|
+
static get watchers() { return {
|
|
33
|
+
"url": ["validateUrl"]
|
|
34
|
+
}; }
|
|
35
|
+
static get style() { return postLogoCss; }
|
|
36
|
+
}, [1, "post-logo", {
|
|
37
|
+
"url": [1]
|
|
38
|
+
}, undefined, {
|
|
39
|
+
"url": ["validateUrl"]
|
|
40
|
+
}]);
|
|
41
|
+
function defineCustomElement$1() {
|
|
42
|
+
if (typeof customElements === "undefined") {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const components = ["post-logo"];
|
|
46
|
+
components.forEach(tagName => { switch (tagName) {
|
|
47
|
+
case "post-logo":
|
|
48
|
+
if (!customElements.get(tagName)) {
|
|
49
|
+
customElements.define(tagName, PostLogo$1);
|
|
50
|
+
}
|
|
51
|
+
break;
|
|
52
|
+
} });
|
|
53
|
+
}
|
|
54
|
+
defineCustomElement$1();
|
|
55
|
+
|
|
56
|
+
const PostLogo = PostLogo$1;
|
|
57
|
+
const defineCustomElement = defineCustomElement$1;
|
|
58
|
+
|
|
59
|
+
export { PostLogo, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../../types/components";
|
|
2
|
+
|
|
3
|
+
interface PostMainnavigation extends Components.PostMainnavigation, HTMLElement {}
|
|
4
|
+
export const PostMainnavigation: {
|
|
5
|
+
prototype: PostMainnavigation;
|
|
6
|
+
new (): PostMainnavigation;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|