@swisspost/design-system-components 10.0.0-next.44 → 10.0.0-next.45
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/{package-B67YsyGQ.js → package-BBZl2psA.js} +1 -1
- package/dist/cjs/post-accordion_2.cjs.entry.js +1 -1
- package/dist/cjs/post-avatar.cjs.entry.js +1 -1
- package/dist/cjs/post-back-to-top.cjs.entry.js +1 -1
- package/dist/cjs/post-banner.cjs.entry.js +1 -1
- 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 +1 -1
- package/dist/cjs/post-collapsible_2.cjs.entry.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 +1 -1
- package/dist/cjs/post-tooltip-trigger.cjs.entry.js +1 -1
- package/dist/cjs/post-tooltip.cjs.entry.js +1 -1
- package/dist/components/{p-UZ70Uf5s.js → p-BFBjELGG.js} +2 -2
- package/dist/components/{p-Dr9p_hZ_.js → p-BW0P1SOg.js} +4 -4
- package/dist/components/{p-SKeGpQLv.js → p-BYcEkyqQ.js} +2 -2
- package/dist/components/{p-CwqvvFZ2.js → p-CNbSwutu.js} +1 -1
- package/dist/components/{p-Dd9p1b8w.js → p-CZkyqiwP.js} +1 -1
- package/dist/components/{p-NT9odSeg.js → p-CmYZ8bPr.js} +1 -1
- package/dist/components/{p-q_uZd5m8.js → p-Cy5YxvE1.js} +1 -1
- package/dist/components/p-Di1H2wNs.js +3 -0
- package/dist/components/{p-WxHIex3Y.js → p-DoHEmJm4.js} +1 -1
- package/dist/components/{p-Dt7aSEAx.js → p-DwcM8snc.js} +1 -1
- package/dist/components/{p-g-hTnW6H.js → p-LeNTjBsp.js} +1 -1
- package/dist/components/post-accordion-item.js +1 -1
- package/dist/components/post-accordion.js +1 -1
- package/dist/components/post-avatar.js +1 -1
- package/dist/components/post-back-to-top.js +2 -2
- package/dist/components/post-banner.js +2 -2
- package/dist/components/post-breadcrumb-item.js +1 -1
- package/dist/components/post-breadcrumbs.js +7 -7
- package/dist/components/post-card-control.js +2 -2
- package/dist/components/post-closebutton.js +2 -2
- package/dist/components/post-collapsible-trigger.js +1 -1
- package/dist/components/post-collapsible.js +1 -1
- package/dist/components/post-footer.js +6 -6
- package/dist/components/post-header.js +1 -1
- package/dist/components/post-icon.js +1 -1
- package/dist/components/post-language-option.js +1 -1
- package/dist/components/post-language-switch.js +5 -5
- package/dist/components/post-linkarea.js +1 -1
- package/dist/components/post-list-item.js +1 -1
- package/dist/components/post-list.js +1 -1
- package/dist/components/post-logo.js +1 -1
- package/dist/components/post-mainnavigation.js +2 -2
- package/dist/components/post-megadropdown-trigger.js +1 -1
- package/dist/components/post-megadropdown.js +1 -1
- package/dist/components/post-menu-item.js +1 -1
- package/dist/components/post-menu-trigger.js +1 -1
- package/dist/components/post-menu.js +1 -1
- package/dist/components/post-popover.js +2 -2
- package/dist/components/post-popovercontainer.js +1 -1
- package/dist/components/post-rating.js +2 -2
- package/dist/components/post-tab-header.js +1 -1
- package/dist/components/post-tab-panel.js +1 -1
- package/dist/components/post-tabs.js +1 -1
- package/dist/components/post-togglebutton.js +1 -1
- package/dist/components/post-tooltip-trigger.js +1 -1
- package/dist/components/post-tooltip.js +2 -2
- package/dist/docs.json +1 -1
- package/dist/esm/package-Di1H2wNs.js +3 -0
- package/dist/esm/post-accordion_2.entry.js +1 -1
- package/dist/esm/post-avatar.entry.js +1 -1
- package/dist/esm/post-back-to-top.entry.js +1 -1
- package/dist/esm/post-banner.entry.js +1 -1
- package/dist/esm/post-breadcrumb-item_2.entry.js +1 -1
- package/dist/esm/post-breadcrumbs.entry.js +1 -1
- package/dist/esm/post-card-control.entry.js +1 -1
- package/dist/esm/post-closebutton_15.entry.js +1 -1
- package/dist/esm/post-collapsible_2.entry.js +1 -1
- package/dist/esm/post-footer.entry.js +1 -1
- package/dist/esm/post-linkarea.entry.js +1 -1
- package/dist/esm/post-popover.entry.js +1 -1
- package/dist/esm/post-rating.entry.js +1 -1
- package/dist/esm/post-tab-header.entry.js +1 -1
- package/dist/esm/post-tab-panel.entry.js +1 -1
- package/dist/esm/post-tabs.entry.js +1 -1
- package/dist/esm/post-tooltip-trigger.entry.js +1 -1
- package/dist/esm/post-tooltip.entry.js +1 -1
- package/dist/post-components/{p-2942dfc0.entry.js → p-09c1822c.entry.js} +1 -1
- package/dist/post-components/{p-c936d457.entry.js → p-0c25c428.entry.js} +1 -1
- package/dist/post-components/{p-8bd78b58.entry.js → p-17bcb457.entry.js} +1 -1
- package/dist/post-components/{p-a4316d9b.entry.js → p-2342da52.entry.js} +1 -1
- package/dist/post-components/{p-7f0533f7.entry.js → p-401bdce7.entry.js} +1 -1
- package/dist/post-components/{p-16597bb9.entry.js → p-4bf808d9.entry.js} +1 -1
- package/dist/post-components/{p-0bf2c2a2.entry.js → p-5a1ba589.entry.js} +1 -1
- package/dist/post-components/{p-542e8506.entry.js → p-5e8ee2b1.entry.js} +1 -1
- package/dist/post-components/{p-86b6298e.entry.js → p-778ca412.entry.js} +1 -1
- package/dist/post-components/{p-5482dc25.entry.js → p-87c5fc42.entry.js} +1 -1
- package/dist/post-components/{p-b7f64972.entry.js → p-928788fc.entry.js} +1 -1
- package/dist/post-components/{p-2399c6ff.entry.js → p-9c3d4d93.entry.js} +1 -1
- package/dist/post-components/p-Di1H2wNs.js +1 -0
- package/dist/post-components/{p-6768ff84.entry.js → p-a9f01db1.entry.js} +1 -1
- package/dist/post-components/{p-c0028958.entry.js → p-dabec4b3.entry.js} +1 -1
- package/dist/post-components/{p-0cbafde4.entry.js → p-f4beab0e.entry.js} +1 -1
- package/dist/post-components/{p-33a028ca.entry.js → p-f63af959.entry.js} +1 -1
- package/dist/post-components/{p-098030c2.entry.js → p-f841f6f8.entry.js} +1 -1
- package/dist/post-components/{p-c3e0dca4.entry.js → p-f9892cd5.entry.js} +1 -1
- package/dist/post-components/post-components.esm.js +1 -1
- package/hydrate/index.js +1 -1
- package/hydrate/index.mjs +1 -1
- package/package.json +3 -3
- package/dist/components/p-BNM7v6FW.js +0 -3
- package/dist/esm/package-BNM7v6FW.js +0 -3
- package/dist/post-components/p-BNM7v6FW.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as i,H as a,a as s}from"./p-C8a0ddDa.js";import{v as e}from"./p-
|
|
1
|
+
import{r as t,h as i,H as a,a as s}from"./p-C8a0ddDa.js";import{v as e}from"./p-Di1H2wNs.js";import{c as r,a as o,b as n}from"./p-BWC0gtGU.js";import"./p-_0G7tavk.js";const h=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;var l;!function(t){t.Slotted="slotted",t.Image="image",t.Initials="initials",t[t.Null=null]="Null"}(l||(l={}));const d=class{constructor(i){t(this,i),this.avatarType=null,this.imageUrl="",this.imageAlt="",this.initials=""}validateFirstname(){r(this,"firstname","string")}validateLastname(){o(this,"lastname","string")}validateUserid(){o(this,"userid","string")}validateEmail(){this.email&&n(this,"email",h)}async getAvatar(){if(null!==this.slottedImage)this.avatarType=l.Slotted;else{let t=!1;!t&&this.userid&&(t=await this.getImageByProp(this.userid,this.fetchImageByUserId.bind(this))),!t&&this.email&&(t=await this.getImageByProp(this.email,this.fetchImageByEmail.bind(this))),t||this.getAvatarByInitials()}}async getImageByProp(t,i){if(!t)return!1;const a=await this.getStorageItem(t)??{ok:!1,url:""};if(!a.ok)try{const t=await i();a.ok=t.ok,a.url=t.url,this.imageUrl=a.url,this.imageAlt=`${this.firstname} ${this.lastname} avatar`,this.avatarType=l.Image,this.setStorageItem(this.userid,JSON.stringify(a))}catch(i){this.removeStorageItem(t),console.info(`Loading avatar by type "${l.Image}" failed.`)}return a.ok}async fetchImageByUserId(){return await fetch(d.INTERNAL_USERID_IMAGE_SRC.replace("{userid}",encodeURIComponent(this.userid)))}async fetchImageByEmail(){const t=await this.cryptify(this.email),i="https://www.gravatar.com/avatar/{email}?s=80&d=404&r=g".replace("{email}",t);return await fetch(i)}getAvatarByInitials(){this.initials=this.getInitials(),this.avatarType=l.Initials}getNames(){return[this.firstname,this.lastname].filter((t=>t))}getInitials(){return this.getNames().map((t=>t.charAt(0))).join("").trim()}async getStorageItem(t){const i=await this.cryptify(t),a=window?.sessionStorage?.getItem(i);return a?JSON.parse(a):null}async setStorageItem(t,i){const a=await this.cryptify(t);window?.sessionStorage?.setItem(a,i)}async removeStorageItem(t){const i=await this.cryptify(t);window?.sessionStorage?.removeItem(i)}async cryptify(t){return await crypto.subtle.digest("SHA-256",(new TextEncoder).encode(t)).then((t=>Array.from(new Uint8Array(t)).map((t=>t.toString(16).padStart(2,"0"))).join("")))}onSlotDefaultChange(){this.slottedImage=this.host.querySelector("img"),this.getAvatar()}componentWillRender(){this.slottedImage=this.host.querySelector("img"),this.getAvatar()}componentDidLoad(){this.validateFirstname(),this.validateLastname(),this.validateUserid(),this.validateEmail()}render(){const t=this.getNames().reduce(((t,a,s)=>(s>0&&t.push(i("span",null," ")),t.push(a.charAt(0)),t.push(i("span",null,a.slice(1))),t)),[]);return i(a,{"data-version":e},i("slot",{onSlotchange:this.onSlotDefaultChange.bind(this)},"image"===this.avatarType&&i("img",{src:this.imageUrl,alt:this.imageAlt}),"initials"===this.avatarType&&i("div",{class:"initials"},t)))}get host(){return s(this)}static get watchers(){return{firstname:["validateFirstname"],lastname:["validateLastname"],userid:["validateUserid"],email:["validateEmail"]}}};d.INTERNAL_USERID_IMAGE_SRC="https://web.post.ch/UserProfileImage/{userid}.png",d.style='@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)}}:host{--post-avatar-bg:var(--post-scheme-color-interactive-primary-enabled-bg2);--post-avatar-fg:var(--post-scheme-color-interactive-primary-enabled-fg3);display:inline-flex;position:relative;width:var(--post-device-sizing-interactive-icon-size3);height:var(--post-device-sizing-interactive-icon-size3);background-color:var(--post-scheme-color-interactive-primary-enabled-stroke3);border:var(--post-device-border-width-default) solid var(--post-scheme-color-interactive-primary-enabled-stroke3);border-radius:var(--post-device-border-radius-round);font-size:var(--post-device-font-size-8);vertical-align:top;line-height:1}:host::after{display:block;content:"";position:absolute;inset:0;z-index:1;border-radius:inherit}*,*::before,*::after{box-sizing:border-box}slot,img,::slotted(img){display:block;width:100%;height:100%}img,::slotted(img){border-radius:var(--post-device-border-radius-round)}::slotted(:not(img)){display:none !important}.initials{display:flex;justify-content:center;align-items:center;position:relative;z-index:2;width:100%;height:100%;background-color:var(--post-avatar-bg);border-radius:var(--post-device-border-radius-round);color:var(--post-avatar-fg);text-transform:uppercase}.initials span{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}';export{d as post_avatar}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,g as a,b as l}from"./p-C8a0ddDa.js";export{s as setNonce}from"./p-C8a0ddDa.js";(()=>{const a=import.meta.url,l={};return""!==a&&(l.resourcesUrl=new URL(".",a).href),e(l)})().then((async e=>(await a(),l([["p-
|
|
1
|
+
import{p as e,g as a,b as l}from"./p-C8a0ddDa.js";export{s as setNonce}from"./p-C8a0ddDa.js";(()=>{const a=import.meta.url,l={};return""!==a&&(l.resourcesUrl=new URL(".",a).href),e(l)})().then((async e=>(await a(),l([["p-5a1ba589",[[1,"post-breadcrumbs",{homeUrl:[1,"home-url"],homeText:[1,"home-text"],breadcrumbItems:[32],isConcatenated:[32],lastWindowWidth:[32]},null,{homeUrl:["validateHomeUrl"],homeText:["validateHomeText"]}]]],["p-17bcb457",[[1,"post-footer",{label:[1],device:[32],gridSlotDisplayed:[32]},null,{label:["validateLabel"]}]]],["p-a9f01db1",[[1,"post-back-to-top",{label:[513],belowFold:[32]},null,{label:["validateLabel"],belowFold:["watchBelowFold"]}]]],["p-f4beab0e",[[1,"post-banner",{dismissible:[4],dismissLabel:[1,"dismiss-label"],icon:[1],type:[1],bannerId:[32],classes:[32],hasActions:[32],hasHeading:[32],onDismissButtonClick:[32],dismiss:[64]},null,{dismissible:["checkDismissible"],icon:["validateIcon"],type:["validateType"]}]]],["p-401bdce7",[[65,"post-card-control",{label:[513],description:[1],type:[1],name:[1],value:[1],checked:[1028],disabled:[1028],validity:[1028],icon:[1],focused:[32],reset:[64],groupReset:[64]},null,{label:["validateControlLabel"],description:["validateControlDescription"],type:["validateControlType"],name:["validateControlName"],value:["validateControlValue"],icon:["validateControlIcon"],checked:["updateControlChecked"],disabled:["updateControlDisabled"]}]]],["p-2342da52",[[1,"post-popover",{placement:[1],closeButtonCaption:[1,"close-button-caption"],arrow:[4],show:[64],hide:[64],toggle:[64]},null,{placement:["validatePlacement"],closeButtonCaption:["validateCloseButtonCaption"]}]]],["p-87c5fc42",[[1,"post-rating",{label:[1],stars:[2],currentRating:[1026,"current-rating"],readonly:[4],hoveredIndex:[32]},null,{label:["validateLabel"],stars:["validateStars"],currentRating:["validateCurrentRating"]}]]],["p-f841f6f8",[[1,"post-tooltip",{placement:[1],arrow:[4],animation:[1],open:[1540],show:[64],hide:[64],toggle:[64]},null,{placement:["validatePlacement"]}]]],["p-f9892cd5",[[1,"post-avatar",{firstname:[513],lastname:[1],userid:[1],email:[1],slottedImage:[32],avatarType:[32],imageUrl:[32],imageAlt:[32],initials:[32]},null,{firstname:["validateFirstname"],lastname:["validateLastname"],userid:["validateUserid"],email:["validateEmail"]}]]],["p-09c1822c",[[1,"post-linkarea"]]],["p-0c25c428",[[1,"post-tab-header",{panel:[513],tabId:[32]},null,{panel:["validateFor"]}]]],["p-5e8ee2b1",[[1,"post-tab-panel",{name:[513],panelId:[32]},null,{name:["validateName"]}]]],["p-dabec4b3",[[1,"post-tabs",{activePanel:[1,"active-panel"],fullWidth:[516,"full-width"],show:[64]}]]],["p-f63af959",[[1,"post-tooltip-trigger",{for:[513],delay:[2]},null,{for:["validateControlFor"]}]]],["p-4bf808d9",[[1,"post-collapsible",{collapsed:[1028],toggle:[64]},null,{collapsed:["collapsedChange"]}],[1,"post-collapsible-trigger",{for:[513],update:[64]},null,{for:["validateAriaAttributes"]}]]],["p-778ca412",[[1,"post-language-switch",{caption:[1],description:[1],variant:[1],activeLang:[32]},[[0,"postChange","handlePostChange"],[0,"postLanguageOptionInitiallyActive","handleInitiallyActive"]],{caption:["validateCaption"],description:["validateDescription"],variant:["validateVariant"]}],[1,"post-closebutton"],[4,"post-mainnavigation",{canScrollLeft:[32],canScrollRight:[32]},[[9,"mouseup","stopScrolling"],[9,"mouseleave","stopScrolling"]]],[1,"post-header",{device:[32],hasNavigation:[32],mobileMenuExtended:[32],megadropdownOpen:[32],toggleMobileMenu:[64]},null,{device:["lockBody"],mobileMenuExtended:["lockBody"]}],[4,"post-language-option",{code:[1],active:[1540],variant:[1],name:[1],url:[1],select:[64]},null,{code:["validateCode"],variant:["validateVariant"],name:["validateName"],url:["validateUrl"]}],[4,"post-list",{titleHidden:[4,"title-hidden"],horizontal:[516],titleId:[32]}],[1,"post-list-item"],[1,"post-logo",{url:[1]},null,{url:["validateUrl"]}],[4,"post-megadropdown",{device:[32],isVisible:[32],animationClass:[32],toggle:[64],show:[64],hide:[64],focusFirst:[64]}],[4,"post-megadropdown-trigger",{for:[1],ariaExpanded:[32]},null,{for:["validateControlFor"]}],[1,"post-togglebutton",{toggled:[1028]}],[1,"post-menu",{placement:[1],isVisible:[32],toggle:[64],show:[64],hide:[64]},null,{placement:["validatePlacement"]}],[4,"post-menu-trigger",{for:[513],ariaExpanded:[32]},null,{for:["validateControlFor"]}],[4,"post-popovercontainer",{placement:[1],edgeGap:[2,"edge-gap"],animation:[1],arrow:[4],manualClose:[4,"manual-close"],safeSpace:[513,"safe-space"],show:[64],hide:[64],toggle:[64]},null,{placement:["validatePlacement"],edgeGap:["validateEdgeGap"],safeSpace:["validateSafeSpace"]}],[1,"post-icon",{animation:[1],base:[1],flipH:[4,"flip-h"],flipV:[4,"flip-v"],name:[513],rotate:[2],scale:[2]},null,{animation:["validateAnimation"],base:["validateBase"],name:["validateName"],rotate:["validateRotate"],scale:["validateScale"]}]]],["p-9c3d4d93",[[1,"post-accordion-item",{collapsed:[1028],headingLevel:[2,"heading-level"],id:[32],slottedLogo:[32],toggle:[64]},[[2,"postToggle","onCollapseToggle"]],{headingLevel:["validateHeadingLevel"]}],[1,"post-accordion",{headingLevel:[2,"heading-level"],multiple:[4],toggle:[64],expandAll:[64],collapseAll:[64]},[[0,"postToggle","collapseToggleHandler"]],{headingLevel:["validateHeadingLevel"]}]]],["p-928788fc",[[1,"post-breadcrumb-item",{url:[1],fullUrl:[32]},null,{url:["validateUrl"]}],[4,"post-menu-item"]]]],e))));
|
package/hydrate/index.js
CHANGED
package/hydrate/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swisspost/design-system-components",
|
|
3
|
-
"version": "10.0.0-next.
|
|
3
|
+
"version": "10.0.0-next.45",
|
|
4
4
|
"description": "A collection of web components built with Stencil JS for the Swiss Post Design System.",
|
|
5
5
|
"author": "Swiss Post <design-system@post.ch>",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@floating-ui/dom": "1.7.3",
|
|
60
60
|
"@oddbird/popover-polyfill": "0.6.0",
|
|
61
|
-
"@swisspost/design-system-icons": "10.0.0-next.
|
|
62
|
-
"@swisspost/design-system-styles": "10.0.0-next.
|
|
61
|
+
"@swisspost/design-system-icons": "10.0.0-next.45",
|
|
62
|
+
"@swisspost/design-system-styles": "10.0.0-next.45",
|
|
63
63
|
"ally.js": "1.4.1",
|
|
64
64
|
"long-press-event": "2.5.0",
|
|
65
65
|
"nanoid": "5.1.5"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const t="10.0.0-next.44";export{t as v}
|