scb-wc 0.1.26 → 0.1.28

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.
Files changed (58) hide show
  1. package/README.md +2 -1
  2. package/all.js +5 -0
  3. package/bin/scb-wc.mjs +51 -117
  4. package/index.js +5 -0
  5. package/mvc/components/all.js +5 -0
  6. package/mvc/components/scb-card/scb-action-card.js +1 -0
  7. package/mvc/components/scb-card/scb-card.js +70 -70
  8. package/mvc/components/scb-card/scb-container-card.js +1 -0
  9. package/mvc/components/scb-card/scb-link-card.js +1 -0
  10. package/mvc/components/scb-card/scb-list-card.js +1 -0
  11. package/mvc/components/scb-card/scb-social-card.js +1 -0
  12. package/mvc/components/scb-collapse/scb-collapse.js +6 -3
  13. package/package.json +22 -2
  14. package/scb-card/scb-action-card.js +1 -0
  15. package/scb-card/scb-card.js +54 -41
  16. package/scb-card/scb-container-card.js +1 -0
  17. package/scb-card/scb-link-card.js +1 -0
  18. package/scb-card/scb-list-card.js +1 -0
  19. package/scb-card/scb-social-card.js +1 -0
  20. package/scb-collapse/scb-collapse.js +6 -3
  21. package/scb-components/index.d.ts +5 -0
  22. package/scb-components/scb-card/scb-action-card.d.ts +1 -0
  23. package/scb-components/scb-card/scb-card.d.ts +2 -0
  24. package/scb-components/scb-card/scb-container-card.d.ts +1 -0
  25. package/scb-components/scb-card/scb-link-card.d.ts +1 -0
  26. package/scb-components/scb-card/scb-list-card.d.ts +1 -0
  27. package/scb-components/scb-card/scb-social-card.d.ts +1 -0
  28. package/scb-wc.bundle.js +48 -45
  29. package/scb-wc.d.ts +10 -0
  30. package/starters/blazor/Components/Pages/Home.razor +3 -3
  31. package/starters/blazor/README.md +1 -1
  32. package/starters/blazor/ScbStarterApp.csproj +1 -1
  33. package/starters/blazor-service/Components/App.razor +23 -0
  34. package/starters/blazor-service/Components/Layout/MainLayout.razor +13 -0
  35. package/starters/blazor-service/Components/Pages/Home.razor +55 -0
  36. package/starters/blazor-service/Components/Routes.razor +14 -0
  37. package/starters/blazor-service/Components/_Imports.razor +11 -0
  38. package/starters/blazor-service/Program.cs +23 -0
  39. package/starters/blazor-service/README.md +29 -0
  40. package/starters/blazor-service/ScbStarterApp.csproj +8 -0
  41. package/starters/blazor-service/dot-gitignore +3 -0
  42. package/starters/blazor-service/package.json +14 -0
  43. package/starters/blazor-service/wwwroot/app.css +54 -0
  44. package/starters/html/main.js +3 -3
  45. package/starters/html-service/README.md +24 -0
  46. package/starters/html-service/dot-gitignore +2 -0
  47. package/starters/html-service/index.html +12 -0
  48. package/starters/html-service/main.js +78 -0
  49. package/starters/html-service/package.json +16 -0
  50. package/starters/react/README.md +1 -2
  51. package/starters/react/src/App.jsx +4 -4
  52. package/starters/react-service/README.md +24 -0
  53. package/starters/react-service/dot-gitignore +2 -0
  54. package/starters/react-service/index.html +12 -0
  55. package/starters/react-service/package.json +19 -0
  56. package/starters/react-service/src/App.jsx +67 -0
  57. package/starters/react-service/src/main.jsx +22 -0
  58. package/starters/react-service/vite.config.js +6 -0
@@ -1,15 +1,15 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/vendor-material.js","../../vendor/vendor.js","../../vendor/vendor-lit.js"])))=>i.map(i=>d[i]);
2
- import"../../vendor/vendor-material.js";import{_ as nt,b as ct,g as $,h as a,v as o,y as r}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as i}from"../../vendor/decorate.js";import{n as ot,t as v}from"../../vendor/assertClassBrand.js";import"../scb-button/scb-button.js";import{t as R}from"../../vendor/preload-helper.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-list/scb-list.js";import"../scb-avatar/scb-avatar.js";import"../scb-link/scb-link.js";import"../scb-chip/scb-chip.js";import"../scb-tooltip/scb-tooltip.js";(function(){try{var d=typeof globalThis<"u"?globalThis:window;if(!d.__scb_ce_guard_installed__){d.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(s,n,l){try{customElements.get(s)||t(s,n,l)}catch(b){var h=String(b||"");if(h.indexOf("already been used")===-1&&h.indexOf("NotSupportedError")===-1)throw b}}}}catch{}})();var g,_,S,dt=["standard","list","social","link","action","container"],c={fromAttribute:d=>d??"",toAttribute:d=>typeof d!="string"||d.trim()===""?null:d},e=(g=new WeakSet,_=class extends nt{constructor(...t){super(...t),ot(this,g),this.__managedSocialAttributes=new Set(["social-comments-text","social-comments","social-comments-href","social-likes-text","social-likes","social-likes-hover-content","social-has-liked","social-likes-interactive","social-author","social-author-text","social-author-href"]),this.__isSyncingManagedSocialAttributes=!1,this.type="standard",this.variant="standard",this.direction="dynamic",this.size="large",this.mediaType="",this.mediaHref="",this.mediaAlt="",this.mediaSrcset="",this.mediaSizes="",this.mediaLoading="auto",this.mediaDecoding="async",this.mediaFetchPriority="auto",this.mediaFit="cover",this.mediaPosition="center",this.mediaWidth="",this.mediaHeight="",this.mediaAspect="",this.mediaPlaceholder=!1,this.cardHref="",this.href="",this.title="",this.cardTitle="",this.subtitle="",this.vignette="",this.vignetteVariant="filled",this.vignetteSpacing=void 0,this.vignetteSpacingTop=void 0,this.vignetteSpacingBottom=void 0,this.vignetteSpacingLeft=void 0,this.vignetteSpacingRight=void 0,this.supportingText="",this.commentsText="",this.commentsDisabled=!1,this.commentsHref="",this.likesText="",this.likesDisabled=!1,this.likesHoverContent="",this.hasLiked=!1,this.likesInteractive=!0,this.author=!1,this.authorText="",this.authorHref="",this.replyEnabled=!1,this.editEnabled=!1,this.deleteEnabled=!1,this.width="",this.maxWidth="",this.height="",this.maxHeight="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.innerPadding=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.__onImgLoad=s=>{const n=s.currentTarget.closest(".media");n&&n.classList.add("is-loaded")},this.__onKeyDown=s=>{const n=this.__effectiveHref();(s.key==="Enter"||s.key===" ")&&n&&(s.preventDefault(),this.__navigate(n,s))},this.__handleHrefNavigation=s=>{const n=this.__effectiveHref();n&&(s.target.closest("a")||this.__navigate(n,s))}}attributeChangedCallback(t,s,n){this.__isSyncingManagedSocialAttributes&&this.__managedSocialAttributes.has(t)||super.attributeChangedCallback(t,s,n)}get likeButton(){return this.cardType!=="social"?null:this.renderRoot.querySelector(".likes scb-icon-button")}__calcAspectWH(t){const s=(t||"").trim();if(!s)return{w:600,h:400};const n=s.includes("/")?s.split("/"):s.includes(":")?s.split(":"):s.includes("x")?s.split("x"):null;if(n&&n.length===2){const h=Number(n[0]),b=Number(n[1]);if(h>0&&b>0)return{w:h,h:b}}const l=Number(s);return isFinite(l)&&l>0?{w:1e3,h:Math.round(1e3/l)}:{w:600,h:400}}__noWrapText(t){return(t??"").replace(/ /g," ").replace(/-/g,"‑")}get cardType(){const t=(this.type||"standard").toLowerCase();return dt.includes(t)?t:"standard"}__dispatchLikeEvent(t,s){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:s})),this.dispatchEvent(new CustomEvent(t.replace("-",""),{bubbles:!0,composed:!0,detail:s}))}__dispatchSocialActionEvent(t,s){this.dispatchEvent(new CustomEvent(`social-${t}`,{bubbles:!0,composed:!0,detail:{action:t,originalEvent:s}}))}__dispatchCardNavigate(t,s){const n={href:t,originalEvent:s},l=new CustomEvent("card-navigate",{bubbles:!0,composed:!0,cancelable:!0,detail:n});if(this.dispatchEvent(l),l.defaultPrevented)return!1;const h=new CustomEvent("cardnavigate",{bubbles:!0,composed:!0,cancelable:!0,detail:n});return this.dispatchEvent(h),!h.defaultPrevented}__effectiveHref(){return this.cardHref||this.href}__navigate(t,s){t&&this.__dispatchCardNavigate(t,s)&&window.open(t,"_self")}__hasSlottedContent(t){return Array.from(this.children).some(s=>s.getAttribute("slot")===t)}__mediaTemplate(){if(this.__hasSlottedContent("media"))return r`
2
+ import"../../vendor/vendor-material.js";import{_ as ct,b as ot,g as $,h as a,v as o,y as n}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as s}from"../../vendor/decorate.js";import{n as dt,t as v}from"../../vendor/assertClassBrand.js";import"../scb-button/scb-button.js";import{t as N}from"../../vendor/preload-helper.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-list/scb-list.js";import"../scb-avatar/scb-avatar.js";import"../scb-link/scb-link.js";import"../scb-chip/scb-chip.js";import"../scb-tooltip/scb-tooltip.js";(function(){try{var d=typeof globalThis<"u"?globalThis:window;if(!d.__scb_ce_guard_installed__){d.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,r,l){try{customElements.get(e)||t(e,r,l)}catch(b){var h=String(b||"");if(h.indexOf("already been used")===-1&&h.indexOf("NotSupportedError")===-1)throw b}}}}catch{}})();var m,_,S,lt=["standard","list","social","link","action","container"],c={fromAttribute:d=>d??"",toAttribute:d=>typeof d!="string"||d.trim()===""?null:d},i=(m=new WeakSet,_=class extends ct{constructor(...t){super(...t),dt(this,m),this.__managedSocialAttributes=new Set(["social-comments-text","social-comments","social-comments-href","social-likes-text","social-likes","social-likes-hover-content","social-has-liked","social-likes-interactive","social-author","social-author-text","social-author-href"]),this.__isSyncingManagedSocialAttributes=!1,this.type="standard",this.variant="standard",this.direction="dynamic",this.size="large",this.mediaType="",this.mediaHref="",this.mediaAlt="",this.mediaSrcset="",this.mediaSizes="",this.mediaLoading="auto",this.mediaDecoding="async",this.mediaFetchPriority="auto",this.mediaFit="cover",this.mediaPosition="center",this.mediaWidth="",this.mediaHeight="",this.mediaAspect="",this.mediaPlaceholder=!1,this.cardHref="",this.href="",this.title="",this.cardTitle="",this.subtitle="",this.vignette="",this.vignetteVariant="filled",this.vignetteSpacing=void 0,this.vignetteSpacingTop=void 0,this.vignetteSpacingBottom=void 0,this.vignetteSpacingLeft=void 0,this.vignetteSpacingRight=void 0,this.supportingText="",this.commentsText="",this.commentsDisabled=!1,this.commentsHref="",this.likesText="",this.likesDisabled=!1,this.likesHoverContent="",this.hasLiked=!1,this.likesInteractive=!0,this.author=!1,this.authorText="",this.authorHref="",this.replyEnabled=!1,this.editEnabled=!1,this.deleteEnabled=!1,this.width="",this.maxWidth="",this.height="",this.maxHeight="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.innerPadding=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.__onImgLoad=e=>{const r=e.currentTarget.closest(".media");r&&r.classList.add("is-loaded")},this.__onKeyDown=e=>{const r=this.__effectiveHref();(e.key==="Enter"||e.key===" ")&&r&&(e.preventDefault(),this.__navigate(r,e))},this.__handleHrefNavigation=e=>{const r=this.__effectiveHref();r&&(e.target.closest("a")||this.__navigate(r,e))}}attributeChangedCallback(t,e,r){this.__isSyncingManagedSocialAttributes&&this.__managedSocialAttributes.has(t)||super.attributeChangedCallback(t,e,r)}get likeButton(){return this.cardType!=="social"?null:this.renderRoot.querySelector(".likes scb-icon-button")}__calcAspectWH(t){const e=(t||"").trim();if(!e)return{w:600,h:400};const r=e.includes("/")?e.split("/"):e.includes(":")?e.split(":"):e.includes("x")?e.split("x"):null;if(r&&r.length===2){const h=Number(r[0]),b=Number(r[1]);if(h>0&&b>0)return{w:h,h:b}}const l=Number(e);return isFinite(l)&&l>0?{w:1e3,h:Math.round(1e3/l)}:{w:600,h:400}}__noWrapText(t){return(t??"").replace(/ /g," ").replace(/-/g,"‑")}__decodeHtmlEntities(t){const e=document.createElement("textarea");return e.innerHTML=t,e.value}__normalizePlainText(t){let e=String(t??"");for(let r=0;r<5;r+=1){const l=this.__decodeHtmlEntities(e);if(l===e)break;e=l}return e.replace(/<\s*(br|\/p|\/div|\/li|\/h[1-6]|\/tr)\b[^>]*>/gi," ").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim()}get cardType(){const t=(this.type||"standard").toLowerCase();return lt.includes(t)?t:"standard"}__dispatchLikeEvent(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e})),this.dispatchEvent(new CustomEvent(t.replace("-",""),{bubbles:!0,composed:!0,detail:e}))}__dispatchSocialActionEvent(t,e){this.dispatchEvent(new CustomEvent(`social-${t}`,{bubbles:!0,composed:!0,detail:{action:t,originalEvent:e}}))}__dispatchCardNavigate(t,e){const r={href:t,originalEvent:e},l=new CustomEvent("card-navigate",{bubbles:!0,composed:!0,cancelable:!0,detail:r});if(this.dispatchEvent(l),l.defaultPrevented)return!1;const h=new CustomEvent("cardnavigate",{bubbles:!0,composed:!0,cancelable:!0,detail:r});return this.dispatchEvent(h),!h.defaultPrevented}__effectiveHref(){return this.cardHref||this.href}__navigate(t,e){t&&this.__dispatchCardNavigate(t,e)&&window.open(t,"_self")}__hasSlottedContent(t){return Array.from(this.children).some(e=>e.getAttribute("slot")===t)}__mediaTemplate(){if(this.__hasSlottedContent("media"))return n`
3
3
  <div class="media">
4
4
  <slot name="media"></slot>
5
5
  </div>
6
- `;if((this.mediaType||"").toLowerCase()==="avatar")return r`
6
+ `;if((this.mediaType||"").toLowerCase()==="avatar")return n`
7
7
  <div class="media">
8
8
  <slot name="media">
9
- <scb-avatar variant="icon" label="${T.call(v(g,this))}" icon-name="person"></scb-avatar>
9
+ <scb-avatar variant="icon" label="${T.call(v(m,this))}" icon-name="person"></scb-avatar>
10
10
  </slot>
11
11
  </div>
12
- `;if(this.mediaHref||this.mediaSrcset){let t=Number(this.mediaWidth)||0,s=Number(this.mediaHeight)||0;const n=(this.mediaAspect||"").trim();if(!t||!s){const h=this.__calcAspectWH(n||"3/2");t||(t=h.w),s||(s=h.h)}const l=`aspect-ratio:${n||`${t}/${s}`};`;return r`
12
+ `;if(this.mediaHref||this.mediaSrcset){let t=Number(this.mediaWidth)||0,e=Number(this.mediaHeight)||0;const r=(this.mediaAspect||"").trim();if(!t||!e){const h=this.__calcAspectWH(r||"3/2");t||(t=h.w),e||(e=h.h)}const l=`aspect-ratio:${r||`${t}/${e}`};`;return n`
13
13
  <div class="media ${this.mediaPlaceholder?"has-ph":""}" style="${l}">
14
14
  <slot name="media-sources"></slot>
15
15
  <img
@@ -21,74 +21,74 @@ import"../../vendor/vendor-material.js";import{_ as nt,b as ct,g as $,h as a,v a
21
21
  decoding="${this.mediaDecoding}"
22
22
  fetchpriority="${this.mediaFetchPriority}"
23
23
  width="${t}"
24
- height="${s}"
24
+ height="${e}"
25
25
  @load=${this.__onImgLoad}
26
26
  />
27
27
  </div>
28
- `}return null}mapSpacingToken(t){if(!t)return;const s=String(t).trim();if(s)return/^\d+$/.test(s)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(s,10)))})`:s}__syncStringAttribute(t,s){this.__isSyncingManagedSocialAttributes=!0;try{typeof s=="string"&&s.trim()!==""?this.setAttribute(t,s):this.removeAttribute(t)}finally{this.__isSyncingManagedSocialAttributes=!1}}__syncNumberAttribute(t,s){this.__isSyncingManagedSocialAttributes=!0;try{typeof s=="number"&&Number.isFinite(s)?this.setAttribute(t,String(s)):this.removeAttribute(t)}finally{this.__isSyncingManagedSocialAttributes=!1}}__syncBooleanAttribute(t,s){this.__isSyncingManagedSocialAttributes=!0;try{s?this.setAttribute(t,""):this.removeAttribute(t)}finally{this.__isSyncingManagedSocialAttributes=!1}}__syncSocialAttributes(){this.cardType==="social"&&(this.__syncStringAttribute("social-comments-text",this.commentsText),this.__syncNumberAttribute("social-comments",this.comments),this.__syncStringAttribute("social-comments-href",this.commentsHref),this.__syncStringAttribute("social-likes-text",this.likesText),this.__syncNumberAttribute("social-likes",this.likes),this.__syncStringAttribute("social-likes-hover-content",this.likesHoverContent),this.__syncBooleanAttribute("social-has-liked",this.hasLiked),this.__syncBooleanAttribute("social-likes-interactive",this.likesInteractive),this.__syncBooleanAttribute("social-author",this.author),this.__syncStringAttribute("social-author-text",this.authorText),this.__syncStringAttribute("social-author-href",this.authorHref))}render(){const t=this.cardType,s=this.variant?`${this.variant.toLowerCase()}`:"",n=(this.direction||"dynamic").toLowerCase(),l=t!=="list"&&t!=="container"&&n!=="vertical"&&n!=="horizontal"?"dynamic-direction":"",h=t==="list"||t==="container"?"vertical":n==="horizontal"?"horizontal":"vertical",b=this.__effectiveHref(),y=(t==="standard"||t==="social")&&!!b,K=y?"clickable":"",P=this.date instanceof Date?this.date.toISOString().slice(0,10):this.date||"",C=!!T.call(v(g,this))||this.__hasSlottedContent("heading"),A=!!this.subtitle||this.__hasSlottedContent("subtitle"),q=!!this.supportingText||this.__hasSlottedContent("supporting-text"),G=!!P||this.__hasSlottedContent("date"),X=this.__hasSlottedContent("footer"),E=(m=!1)=>C?r`
28
+ `}return null}mapSpacingToken(t){if(!t)return;const e=String(t).trim();if(e)return/^\d+$/.test(e)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(e,10)))})`:e}__syncStringAttribute(t,e){this.__isSyncingManagedSocialAttributes=!0;try{typeof e=="string"&&e.trim()!==""?this.setAttribute(t,e):this.removeAttribute(t)}finally{this.__isSyncingManagedSocialAttributes=!1}}__syncNumberAttribute(t,e){this.__isSyncingManagedSocialAttributes=!0;try{typeof e=="number"&&Number.isFinite(e)?this.setAttribute(t,String(e)):this.removeAttribute(t)}finally{this.__isSyncingManagedSocialAttributes=!1}}__syncBooleanAttribute(t,e){this.__isSyncingManagedSocialAttributes=!0;try{e?this.setAttribute(t,""):this.removeAttribute(t)}finally{this.__isSyncingManagedSocialAttributes=!1}}__syncSocialAttributes(){this.cardType==="social"&&(this.__syncStringAttribute("social-comments-text",this.commentsText),this.__syncNumberAttribute("social-comments",this.comments),this.__syncStringAttribute("social-comments-href",this.commentsHref),this.__syncStringAttribute("social-likes-text",this.likesText),this.__syncNumberAttribute("social-likes",this.likes),this.__syncStringAttribute("social-likes-hover-content",this.likesHoverContent),this.__syncBooleanAttribute("social-has-liked",this.hasLiked),this.__syncBooleanAttribute("social-likes-interactive",this.likesInteractive),this.__syncBooleanAttribute("social-author",this.author),this.__syncStringAttribute("social-author-text",this.authorText),this.__syncStringAttribute("social-author-href",this.authorHref))}render(){const t=this.cardType,e=this.variant?`${this.variant.toLowerCase()}`:"",r=(this.direction||"dynamic").toLowerCase(),l=t!=="list"&&t!=="container"&&r!=="vertical"&&r!=="horizontal"?"dynamic-direction":"",h=t==="list"||t==="container"?"vertical":r==="horizontal"?"horizontal":"vertical",b=this.__effectiveHref(),f=(t==="standard"||t==="social")&&!!b,q=f?"clickable":"",P=this.date instanceof Date?this.date.toISOString().slice(0,10):this.date||"",E=t==="social"?this.__normalizePlainText(this.supportingText):this.supportingText,C=!!T.call(v(m,this))||this.__hasSlottedContent("heading"),L=!!this.subtitle||this.__hasSlottedContent("subtitle"),G=!!E||this.__hasSlottedContent("supporting-text"),X=!!P||this.__hasSlottedContent("date"),U=this.__hasSlottedContent("footer"),H=(g=!1)=>C?n`
29
29
  <div class="header">
30
30
  <slot name="heading">
31
- ${m?r`<a class="title" href="${b}" tabindex="-1">${T.call(v(g,this))}</a>`:r`<span class="title">${T.call(v(g,this))}</span>`}
31
+ ${g?n`<a class="title" href="${b}" tabindex="-1">${T.call(v(m,this))}</a>`:n`<span class="title">${T.call(v(m,this))}</span>`}
32
32
  </slot>
33
- ${m?r`<md-icon>arrow_forward</md-icon>`:o}
33
+ ${g?n`<md-icon>arrow_forward</md-icon>`:o}
34
34
  </div>
35
- `:o,F=()=>A?r`<div class="sub-label"><slot name="subtitle">${this.subtitle}</slot></div>`:o,U=()=>q?r`<div class="supporting-text"><slot name="supporting-text">${this.supportingText}</slot></div>`:o,J=()=>G?r`<div class="date"><slot name="date">${P}</slot></div>`:o,Q=()=>this.__mediaTemplate(),Y=this.vignetteSpacing||o,Z=this.vignetteSpacingTop||o,tt=this.vignetteSpacingBottom||(this.vignetteSpacing?o:"5"),et=this.vignetteSpacingLeft||o,it=this.vignetteSpacingRight||o,H=!!this.vignette?.trim(),st=H?r`<scb-chip
35
+ `:o,F=()=>L?n`<div class="sub-label"><slot name="subtitle">${this.subtitle}</slot></div>`:o,J=()=>G?n`<div class="supporting-text"><slot name="supporting-text">${E}</slot></div>`:o,Q=()=>X?n`<div class="date"><slot name="date">${P}</slot></div>`:o,Y=()=>this.__mediaTemplate(),Z=this.vignetteSpacing||o,tt=this.vignetteSpacingTop||o,et=this.vignetteSpacingBottom||(this.vignetteSpacing?o:"5"),it=this.vignetteSpacingLeft||o,st=this.vignetteSpacingRight||o,B=!!this.vignette?.trim(),at=B?n`<scb-chip
36
36
  class="content-vignette"
37
37
  variant="static"
38
38
  static-variant="${this.vignetteVariant==="outline"||this.vignetteVariant==="outlined"?"outlined":"filled"}"
39
39
  label="${this.vignette}"
40
- spacing=${Y}
41
- spacing-top=${Z}
42
- spacing-bottom=${tt}
43
- spacing-left=${et}
44
- spacing-right=${it}
45
- ></scb-chip>`:o,B=()=>this.__hasSlottedContent("scb-chip")?r`<div class="chip-slot"><slot name="scb-chip"></slot></div>`:H?r`<div class="chip-slot">${st}</div>`:o,z=(m=!1,w=!0,u=!0)=>r`
46
- ${B()}
40
+ spacing=${Z}
41
+ spacing-top=${tt}
42
+ spacing-bottom=${et}
43
+ spacing-left=${it}
44
+ spacing-right=${st}
45
+ ></scb-chip>`:o,D=()=>this.__hasSlottedContent("scb-chip")?n`<div class="chip-slot"><slot name="scb-chip"></slot></div>`:B?n`<div class="chip-slot">${at}</div>`:o,z=(g=!1,w=!0,u=!0)=>n`
46
+ ${D()}
47
47
  <div class="top-content">
48
- ${E(m)}
48
+ ${H(g)}
49
49
  ${F()}
50
- ${w?U():o}
51
- ${u?J():o}
50
+ ${w?J():o}
51
+ ${u?Q():o}
52
52
  </div>
53
- `,f=()=>X?r`
53
+ `,y=()=>U?n`
54
54
  <div class="content footer">
55
55
  <slot name="footer"></slot>
56
56
  </div>
57
- `:o,x=m=>r`
57
+ `:o,x=g=>n`
58
58
  <div
59
- class="scb-card ${s} ${h} ${l} ${K}"
60
- @click=${y?this.__handleHrefNavigation:null}
61
- @keydown=${y?this.__onKeyDown:null}
62
- style="cursor:${y?"pointer":"default"};"
63
- role=${y?"link":o}
64
- tabindex=${y?"0":o}
65
- aria-label=${T.call(v(g,this))||this.subtitle||"Kort"}
59
+ class="scb-card ${e} ${h} ${l} ${q}"
60
+ @click=${f?this.__handleHrefNavigation:null}
61
+ @keydown=${f?this.__onKeyDown:null}
62
+ style="cursor:${f?"pointer":"default"};"
63
+ role=${f?"link":o}
64
+ tabindex=${f?"0":o}
65
+ aria-label=${T.call(v(m,this))||this.subtitle||"Kort"}
66
66
  >
67
- ${y?r`<md-ripple></md-ripple>`:""}
68
- ${Q()}
69
- ${m}
67
+ ${f?n`<md-ripple></md-ripple>`:""}
68
+ ${Y()}
69
+ ${g}
70
70
  </div>
71
71
  <md-focus-ring></md-focus-ring>
72
- `;switch(t){case"standard":return x(r`
72
+ `;switch(t){case"standard":return x(n`
73
73
  <div class="full-content">
74
74
  ${z(!!b)}
75
- ${f()}
75
+ ${y()}
76
76
  </div>
77
- `);case"list":return x(r`
77
+ `);case"list":return x(n`
78
78
  <div class="full-content">
79
79
  ${z(!1)}
80
80
  <div class="content list">
81
81
  <slot name="list"></slot><slot></slot>
82
82
  </div>
83
- ${f()}
83
+ ${y()}
84
84
  </div>
85
- `);case"social":const m=this.commentsHref,w=p=>{p.stopPropagation()},u=p=>{const k=this.renderRoot?.querySelector(".scb-card");k&&(p?k.classList.add("no-hover"):k.classList.remove("no-hover"))},at=this.commentsText?`${this.commentsText}: `:"",rt=this.likesText?`${this.likesText}: `:"",L=p=>k=>{k.stopPropagation(),this.__dispatchSocialActionEvent(p,k)},D=this.likesDisabled?o:r`
85
+ `);case"social":const g=this.commentsHref,w=p=>{p.stopPropagation()},u=p=>{const k=this.renderRoot?.querySelector(".scb-card");k&&(p?k.classList.add("no-hover"):k.classList.remove("no-hover"))},rt=this.commentsText?`${this.commentsText}: `:"",nt=this.likesText?`${this.likesText}: `:"",A=p=>k=>{k.stopPropagation(),this.__dispatchSocialActionEvent(p,k)},R=this.likesDisabled?o:n`
86
86
  <span
87
87
  class="likes"
88
88
  @mouseenter=${()=>u(!0)}
89
89
  @mouseleave=${()=>u(!1)}
90
90
  >
91
- ${this.likesInteractive?r`
91
+ ${this.likesInteractive?n`
92
92
  <scb-icon-button
93
93
  id="like-button"
94
94
  variant="standard"
@@ -99,15 +99,15 @@ import"../../vendor/vendor-material.js";import{_ as nt,b as ct,g as $,h as a,v a
99
99
  @keydown=${p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),p.stopPropagation(),this.hasLiked=!this.hasLiked,this.__dispatchLikeEvent("like-click",{hasLiked:this.hasLiked,likes:this.likes??0}))}}
100
100
  @hover=${p=>{p.preventDefault(),p.stopPropagation(),this.__dispatchLikeEvent("like-hover",{hasLiked:this.hasLiked,likes:this.likes??0})}}
101
101
  ></scb-icon-button>
102
- `:r`<md-icon>thumb_up</md-icon>`}
103
- <span class="social-text">${rt}${this.likes??0}</span>
102
+ `:n`<md-icon>thumb_up</md-icon>`}
103
+ <span class="social-text">${nt}${this.likes??0}</span>
104
104
  </span>
105
- `;return x(r`
105
+ `;return x(n`
106
106
  <div class="full-content">
107
107
  ${z(!!b)}
108
108
  <div class="content">
109
109
  <div class="social-metrics">
110
- ${this.author?r`
110
+ ${this.author?n`
111
111
  <a
112
112
  class="author social-text"
113
113
  href="${this.authorHref||"#"}"
@@ -118,28 +118,28 @@ import"../../vendor/vendor-material.js";import{_ as nt,b as ct,g as $,h as a,v a
118
118
  >${this.authorText}</a
119
119
  >
120
120
  `:""}
121
- ${this.commentsDisabled?o:r`
121
+ ${this.commentsDisabled?o:n`
122
122
  <span
123
123
  class="comments"
124
124
  @mouseenter=${()=>u(!0)}
125
125
  @mouseleave=${()=>u(!1)}
126
126
  >
127
- ${m!==""?r`
127
+ ${g!==""?n`
128
128
  <scb-icon-button
129
- href="${m}"
129
+ href="${g}"
130
130
  tabindex="0"
131
131
  @click=${w}
132
132
  variant="standard"
133
133
  icon="comment"
134
134
  aria-label="Gå till kommentarer"
135
135
  ></scb-icon-button>
136
- `:r`
136
+ `:n`
137
137
  <md-icon>comment</md-icon>
138
138
  `}
139
- <span class="social-text">${at}${this.comments??0}</span>
139
+ <span class="social-text">${rt}${this.comments??0}</span>
140
140
  </span>
141
141
  `}
142
- ${this.likesHoverContent?r`
142
+ ${this.likesHoverContent?n`
143
143
  <scb-tooltip
144
144
  variant="rich"
145
145
  for="like-button"
@@ -147,80 +147,80 @@ import"../../vendor/vendor-material.js";import{_ as nt,b as ct,g as $,h as a,v a
147
147
  trigger="hover"
148
148
  position="right"
149
149
  >
150
- ${D}
150
+ ${R}
151
151
  </scb-tooltip>
152
- `:D}
153
- ${this.replyEnabled?r`
152
+ `:R}
153
+ ${this.replyEnabled?n`
154
154
  <span class="social-action">
155
155
  <scb-icon-button
156
156
  variant="standard"
157
157
  icon="reply"
158
158
  aria-label="Svara"
159
- @click=${L("reply")}
159
+ @click=${A("reply")}
160
160
  ></scb-icon-button>
161
161
  <span class="social-text">Svara</span>
162
162
  </span>
163
163
  `:o}
164
- ${this.editEnabled?r`
164
+ ${this.editEnabled?n`
165
165
  <span class="social-action">
166
166
  <scb-icon-button
167
167
  variant="standard"
168
168
  icon="edit"
169
169
  aria-label="Redigera"
170
- @click=${L("edit")}
170
+ @click=${A("edit")}
171
171
  ></scb-icon-button>
172
172
  <span class="social-text">Redigera</span>
173
173
  </span>
174
174
  `:o}
175
- ${this.deleteEnabled?r`
175
+ ${this.deleteEnabled?n`
176
176
  <span class="social-action">
177
177
  <scb-icon-button
178
178
  variant="standard"
179
179
  icon="delete"
180
180
  aria-label="Ta bort"
181
- @click=${L("delete")}
181
+ @click=${A("delete")}
182
182
  ></scb-icon-button>
183
183
  <span class="social-text">Ta bort</span>
184
184
  </span>
185
185
  `:o}
186
186
  </div>
187
187
  </div>
188
- ${f()}
188
+ ${y()}
189
189
  </div>
190
- `);case"link":return x(r`
190
+ `);case"link":return x(n`
191
191
  <div class="full-content">
192
192
  ${z(!1)}
193
193
  <div class="content links">
194
194
  <slot name="links"></slot><slot></slot>
195
195
  </div>
196
- ${f()}
196
+ ${y()}
197
197
  </div>
198
- `);case"action":return x(r`
198
+ `);case"action":return x(n`
199
199
  <div class="full-content">
200
200
  ${z(!1)}
201
201
  <div class="content actions">
202
202
  <slot name="actions"></slot><slot></slot>
203
203
  </div>
204
- ${f()}
204
+ ${y()}
205
205
  </div>
206
- `);case"container":return x(r`
207
- <div class="container-content ${C||A?"has-header":""}">
208
- ${B()}
209
- ${C||A?r`
206
+ `);case"container":return x(n`
207
+ <div class="container-content ${C||L?"has-header":""}">
208
+ ${D()}
209
+ ${C||L?n`
210
210
  <div class="top-content">
211
- ${E(!1)}
211
+ ${H(!1)}
212
212
  ${F()}
213
213
  </div>
214
214
  `:o}
215
215
  <slot></slot>
216
- ${f()}
216
+ ${y()}
217
217
  </div>
218
- `);default:return x(r`
218
+ `);default:return x(n`
219
219
  <div class="full-content">
220
220
  ${z(!!b)}
221
- ${f()}
221
+ ${y()}
222
222
  </div>
223
- `)}}updated(t){super.updated(t),t.has("width")&&(this.width?this.style.inlineSize=this.width:this.style.removeProperty("inline-size")),t.has("maxWidth")&&(this.maxWidth?this.style.maxInlineSize=this.maxWidth:this.style.removeProperty("max-inline-size")),t.has("height")&&(this.height?this.style.blockSize=this.height:this.style.removeProperty("block-size")),t.has("maxHeight")&&(this.maxHeight?this.style.maxBlockSize=this.maxHeight:this.style.removeProperty("max-block-size")),t.has("type")&&(this.cardType==="list"?this.setAttribute("data-density","-2"):this.removeAttribute("data-density")),this.mediaFit&&this.mediaFit!=="cover"?this.style.setProperty("--scb-card-media-fit",this.mediaFit):this.style.removeProperty("--scb-card-media-fit"),this.mediaPosition&&this.mediaPosition!=="center"?this.style.setProperty("--scb-card-media-position",this.mediaPosition):this.style.removeProperty("--scb-card-media-position"),this.__syncSocialAttributes(),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&v(g,this,N).call(this),(t.has("innerPadding")||t.has("paddingTop")||t.has("paddingBottom")||t.has("paddingLeft")||t.has("paddingRight"))&&v(g,this,I).call(this)}async firstUpdated(t){S.__iconLoaded||(await R(()=>import("../../vendor/vendor-material.js").then(s=>s.p),__vite__mapDeps([0,1,2]),import.meta.url),S.__iconLoaded=!0),S.__rippleLoaded||(await R(()=>import("../../vendor/vendor-material.js").then(s=>s.f),__vite__mapDeps([0,1,2]),import.meta.url),S.__rippleLoaded=!0),v(g,this,N).call(this),v(g,this,I).call(this),this.__syncSocialAttributes()}},S=_,_.__iconLoaded=!1,_.__rippleLoaded=!1,_.styles=ct`
223
+ `)}}updated(t){super.updated(t),t.has("width")&&(this.width?this.style.inlineSize=this.width:this.style.removeProperty("inline-size")),t.has("maxWidth")&&(this.maxWidth?this.style.maxInlineSize=this.maxWidth:this.style.removeProperty("max-inline-size")),t.has("height")&&(this.height?this.style.blockSize=this.height:this.style.removeProperty("block-size")),t.has("maxHeight")&&(this.maxHeight?this.style.maxBlockSize=this.maxHeight:this.style.removeProperty("max-block-size")),t.has("type")&&(this.cardType==="list"?this.setAttribute("data-density","-2"):this.removeAttribute("data-density")),this.mediaFit&&this.mediaFit!=="cover"?this.style.setProperty("--scb-card-media-fit",this.mediaFit):this.style.removeProperty("--scb-card-media-fit"),this.mediaPosition&&this.mediaPosition!=="center"?this.style.setProperty("--scb-card-media-position",this.mediaPosition):this.style.removeProperty("--scb-card-media-position"),this.__syncSocialAttributes(),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&v(m,this,I).call(this),(t.has("innerPadding")||t.has("paddingTop")||t.has("paddingBottom")||t.has("paddingLeft")||t.has("paddingRight"))&&v(m,this,M).call(this)}async firstUpdated(t){S.__iconLoaded||(await N(()=>import("../../vendor/vendor-material.js").then(e=>e.p),__vite__mapDeps([0,1,2]),import.meta.url),S.__iconLoaded=!0),S.__rippleLoaded||(await N(()=>import("../../vendor/vendor-material.js").then(e=>e.f),__vite__mapDeps([0,1,2]),import.meta.url),S.__rippleLoaded=!0),v(m,this,I).call(this),v(m,this,M).call(this),this.__syncSocialAttributes()}},S=_,_.__iconLoaded=!1,_.__rippleLoaded=!1,_.styles=ot`
224
224
  :host {
225
225
  display: block;
226
226
  container-type: inline-size;
@@ -824,4 +824,4 @@ import"../../vendor/vendor-material.js";import{_ as nt,b as ct,g as $,h as a,v a
824
824
  .scb-card.filled-alternative .content.list ::slotted(scb-list) {
825
825
  --scb-list-bg: var(--md-sys-color-surface-container, #EEF3FF);
826
826
  }
827
- `,_);function T(){return this.cardTitle||this.title}function N(){const d=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??d,s=this.mapSpacingToken(this.spacingBottom)??d,n=this.mapSpacingToken(this.spacingLeft),l=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty("--scb-card-spacing-block-start",t):this.style.removeProperty("--scb-card-spacing-block-start"),s?this.style.setProperty("--scb-card-spacing-block-end",s):this.style.removeProperty("--scb-card-spacing-block-end"),n?this.style.setProperty("--scb-card-spacing-inline-start",n):this.style.removeProperty("--scb-card-spacing-inline-start"),l?this.style.setProperty("--scb-card-spacing-inline-end",l):this.style.removeProperty("--scb-card-spacing-inline-end")}function I(){const d=this.mapSpacingToken(this.innerPadding),t=this.mapSpacingToken(this.paddingTop)??d,s=this.mapSpacingToken(this.paddingBottom)??d,n=this.mapSpacingToken(this.paddingLeft)??d,l=this.mapSpacingToken(this.paddingRight)??d;t?this.style.setProperty("--scb-card-content-padding-block-start",t):this.style.removeProperty("--scb-card-content-padding-block-start"),s?this.style.setProperty("--scb-card-content-padding-block-end",s):this.style.removeProperty("--scb-card-content-padding-block-end"),n?this.style.setProperty("--scb-card-content-padding-inline-start",n):this.style.removeProperty("--scb-card-content-padding-inline-start"),l?this.style.setProperty("--scb-card-content-padding-inline-end",l):this.style.removeProperty("--scb-card-content-padding-inline-end")}i([a({type:String,reflect:!0,converter:c})],e.prototype,"type",void 0);i([a({type:String,reflect:!0,converter:c})],e.prototype,"variant",void 0);i([a({type:String,reflect:!0,converter:c})],e.prototype,"direction",void 0);i([a({type:String,reflect:!0})],e.prototype,"size",void 0);i([a({type:String,attribute:"media-type"})],e.prototype,"mediaType",void 0);i([a({type:String,attribute:"media-href"})],e.prototype,"mediaHref",void 0);i([a({type:String,attribute:"media-alt"})],e.prototype,"mediaAlt",void 0);i([a({type:String,attribute:"media-srcset"})],e.prototype,"mediaSrcset",void 0);i([a({type:String,attribute:"media-sizes"})],e.prototype,"mediaSizes",void 0);i([a({type:String,attribute:"media-loading"})],e.prototype,"mediaLoading",void 0);i([a({type:String,attribute:"media-decoding"})],e.prototype,"mediaDecoding",void 0);i([a({type:String,attribute:"media-fetchpriority"})],e.prototype,"mediaFetchPriority",void 0);i([a({type:String,attribute:"media-fit"})],e.prototype,"mediaFit",void 0);i([a({type:String,attribute:"media-position"})],e.prototype,"mediaPosition",void 0);i([a({type:String,attribute:"media-width"})],e.prototype,"mediaWidth",void 0);i([a({type:String,attribute:"media-height"})],e.prototype,"mediaHeight",void 0);i([a({type:String,attribute:"media-aspect"})],e.prototype,"mediaAspect",void 0);i([a({type:Boolean,attribute:"media-placeholder"})],e.prototype,"mediaPlaceholder",void 0);i([a({type:String,attribute:"card-href",reflect:!0,converter:c})],e.prototype,"cardHref",void 0);i([a({type:String,reflect:!0,converter:c})],e.prototype,"href",void 0);i([a({type:String,reflect:!0,converter:c})],e.prototype,"title",void 0);i([a({type:String,attribute:"card-title",reflect:!0,converter:c})],e.prototype,"cardTitle",void 0);i([a({type:String,reflect:!0,converter:c})],e.prototype,"subtitle",void 0);i([a({type:String,reflect:!0,converter:c})],e.prototype,"vignette",void 0);i([a({type:String,attribute:"vignette-variant",reflect:!0,converter:c})],e.prototype,"vignetteVariant",void 0);i([a({type:String,attribute:"vignette-spacing",reflect:!0,converter:c})],e.prototype,"vignetteSpacing",void 0);i([a({type:String,attribute:"vignette-spacing-top",reflect:!0,converter:c})],e.prototype,"vignetteSpacingTop",void 0);i([a({type:String,attribute:"vignette-spacing-bottom",reflect:!0,converter:c})],e.prototype,"vignetteSpacingBottom",void 0);i([a({type:String,attribute:"vignette-spacing-left",reflect:!0,converter:c})],e.prototype,"vignetteSpacingLeft",void 0);i([a({type:String,attribute:"vignette-spacing-right",reflect:!0,converter:c})],e.prototype,"vignetteSpacingRight",void 0);i([a({type:String,attribute:"supporting-text",reflect:!0,converter:c})],e.prototype,"supportingText",void 0);i([a({type:Date,reflect:!0})],e.prototype,"date",void 0);i([a({type:String,attribute:"social-comments-text"})],e.prototype,"commentsText",void 0);i([a({type:Number,attribute:"social-comments"})],e.prototype,"comments",void 0);i([a({type:Boolean,attribute:"social-comments-disabled"})],e.prototype,"commentsDisabled",void 0);i([a({type:String,attribute:"social-comments-href"})],e.prototype,"commentsHref",void 0);i([a({type:String,attribute:"social-likes-text"})],e.prototype,"likesText",void 0);i([a({type:Number,attribute:"social-likes"})],e.prototype,"likes",void 0);i([a({type:Boolean,attribute:"social-likes-disabled"})],e.prototype,"likesDisabled",void 0);i([a({type:String,attribute:"social-likes-hover-content"})],e.prototype,"likesHoverContent",void 0);i([a({type:Boolean,attribute:"social-has-liked"})],e.prototype,"hasLiked",void 0);i([a({type:Boolean,attribute:"social-likes-interactive"})],e.prototype,"likesInteractive",void 0);i([a({type:Boolean,attribute:"social-author"})],e.prototype,"author",void 0);i([a({type:String,attribute:"social-author-text"})],e.prototype,"authorText",void 0);i([a({type:String,attribute:"social-author-href"})],e.prototype,"authorHref",void 0);i([a({type:Boolean,attribute:"social-reply-enabled"})],e.prototype,"replyEnabled",void 0);i([a({type:Boolean,attribute:"social-edit-enabled"})],e.prototype,"editEnabled",void 0);i([a({type:Boolean,attribute:"social-delete-enabled"})],e.prototype,"deleteEnabled",void 0);i([a({type:String,reflect:!0,converter:c})],e.prototype,"sizing",void 0);i([a({type:String,reflect:!0,converter:c})],e.prototype,"width",void 0);i([a({type:String,reflect:!0,attribute:"max-width",converter:c})],e.prototype,"maxWidth",void 0);i([a({type:String,reflect:!0,converter:c})],e.prototype,"height",void 0);i([a({type:String,reflect:!0,attribute:"max-height",converter:c})],e.prototype,"maxHeight",void 0);i([a({type:String,reflect:!0,converter:c})],e.prototype,"spacing",void 0);i([a({type:String,attribute:"spacing-top",reflect:!0,converter:c})],e.prototype,"spacingTop",void 0);i([a({type:String,attribute:"spacing-bottom",reflect:!0,converter:c})],e.prototype,"spacingBottom",void 0);i([a({type:String,attribute:"spacing-left",reflect:!0,converter:c})],e.prototype,"spacingLeft",void 0);i([a({type:String,attribute:"spacing-right",reflect:!0,converter:c})],e.prototype,"spacingRight",void 0);i([a({type:String,attribute:"padding",reflect:!0,converter:c})],e.prototype,"innerPadding",void 0);i([a({type:String,attribute:"padding-top",reflect:!0,converter:c})],e.prototype,"paddingTop",void 0);i([a({type:String,attribute:"padding-bottom",reflect:!0,converter:c})],e.prototype,"paddingBottom",void 0);i([a({type:String,attribute:"padding-left",reflect:!0,converter:c})],e.prototype,"paddingLeft",void 0);i([a({type:String,attribute:"padding-right",reflect:!0,converter:c})],e.prototype,"paddingRight",void 0);e=S=i([$("scb-card")],e);var W=class extends e{constructor(){super(),this.type="list"}get cardType(){return"list"}};W=i([$("scb-list-card")],W);var M=class extends e{constructor(){super(),this.type="link"}get cardType(){return"link"}};M=i([$("scb-link-card")],M);var V=class extends e{constructor(){super(),this.type="action"}get cardType(){return"action"}};V=i([$("scb-action-card")],V);var j=class extends e{constructor(){super(),this.type="social"}get cardType(){return"social"}};j=i([$("scb-social-card")],j);var O=class extends e{constructor(){super(),this.type="container"}get cardType(){return"container"}};O=i([$("scb-container-card")],O);
827
+ `,_);function T(){return this.cardTitle||this.title}function I(){const d=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??d,e=this.mapSpacingToken(this.spacingBottom)??d,r=this.mapSpacingToken(this.spacingLeft),l=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty("--scb-card-spacing-block-start",t):this.style.removeProperty("--scb-card-spacing-block-start"),e?this.style.setProperty("--scb-card-spacing-block-end",e):this.style.removeProperty("--scb-card-spacing-block-end"),r?this.style.setProperty("--scb-card-spacing-inline-start",r):this.style.removeProperty("--scb-card-spacing-inline-start"),l?this.style.setProperty("--scb-card-spacing-inline-end",l):this.style.removeProperty("--scb-card-spacing-inline-end")}function M(){const d=this.mapSpacingToken(this.innerPadding),t=this.mapSpacingToken(this.paddingTop)??d,e=this.mapSpacingToken(this.paddingBottom)??d,r=this.mapSpacingToken(this.paddingLeft)??d,l=this.mapSpacingToken(this.paddingRight)??d;t?this.style.setProperty("--scb-card-content-padding-block-start",t):this.style.removeProperty("--scb-card-content-padding-block-start"),e?this.style.setProperty("--scb-card-content-padding-block-end",e):this.style.removeProperty("--scb-card-content-padding-block-end"),r?this.style.setProperty("--scb-card-content-padding-inline-start",r):this.style.removeProperty("--scb-card-content-padding-inline-start"),l?this.style.setProperty("--scb-card-content-padding-inline-end",l):this.style.removeProperty("--scb-card-content-padding-inline-end")}s([a({type:String,reflect:!0,converter:c})],i.prototype,"type",void 0);s([a({type:String,reflect:!0,converter:c})],i.prototype,"variant",void 0);s([a({type:String,reflect:!0,converter:c})],i.prototype,"direction",void 0);s([a({type:String,reflect:!0})],i.prototype,"size",void 0);s([a({type:String,attribute:"media-type"})],i.prototype,"mediaType",void 0);s([a({type:String,attribute:"media-href"})],i.prototype,"mediaHref",void 0);s([a({type:String,attribute:"media-alt"})],i.prototype,"mediaAlt",void 0);s([a({type:String,attribute:"media-srcset"})],i.prototype,"mediaSrcset",void 0);s([a({type:String,attribute:"media-sizes"})],i.prototype,"mediaSizes",void 0);s([a({type:String,attribute:"media-loading"})],i.prototype,"mediaLoading",void 0);s([a({type:String,attribute:"media-decoding"})],i.prototype,"mediaDecoding",void 0);s([a({type:String,attribute:"media-fetchpriority"})],i.prototype,"mediaFetchPriority",void 0);s([a({type:String,attribute:"media-fit"})],i.prototype,"mediaFit",void 0);s([a({type:String,attribute:"media-position"})],i.prototype,"mediaPosition",void 0);s([a({type:String,attribute:"media-width"})],i.prototype,"mediaWidth",void 0);s([a({type:String,attribute:"media-height"})],i.prototype,"mediaHeight",void 0);s([a({type:String,attribute:"media-aspect"})],i.prototype,"mediaAspect",void 0);s([a({type:Boolean,attribute:"media-placeholder"})],i.prototype,"mediaPlaceholder",void 0);s([a({type:String,attribute:"card-href",reflect:!0,converter:c})],i.prototype,"cardHref",void 0);s([a({type:String,reflect:!0,converter:c})],i.prototype,"href",void 0);s([a({type:String,reflect:!0,converter:c})],i.prototype,"title",void 0);s([a({type:String,attribute:"card-title",reflect:!0,converter:c})],i.prototype,"cardTitle",void 0);s([a({type:String,reflect:!0,converter:c})],i.prototype,"subtitle",void 0);s([a({type:String,reflect:!0,converter:c})],i.prototype,"vignette",void 0);s([a({type:String,attribute:"vignette-variant",reflect:!0,converter:c})],i.prototype,"vignetteVariant",void 0);s([a({type:String,attribute:"vignette-spacing",reflect:!0,converter:c})],i.prototype,"vignetteSpacing",void 0);s([a({type:String,attribute:"vignette-spacing-top",reflect:!0,converter:c})],i.prototype,"vignetteSpacingTop",void 0);s([a({type:String,attribute:"vignette-spacing-bottom",reflect:!0,converter:c})],i.prototype,"vignetteSpacingBottom",void 0);s([a({type:String,attribute:"vignette-spacing-left",reflect:!0,converter:c})],i.prototype,"vignetteSpacingLeft",void 0);s([a({type:String,attribute:"vignette-spacing-right",reflect:!0,converter:c})],i.prototype,"vignetteSpacingRight",void 0);s([a({type:String,attribute:"supporting-text",reflect:!0,converter:c})],i.prototype,"supportingText",void 0);s([a({type:Date,reflect:!0})],i.prototype,"date",void 0);s([a({type:String,attribute:"social-comments-text"})],i.prototype,"commentsText",void 0);s([a({type:Number,attribute:"social-comments"})],i.prototype,"comments",void 0);s([a({type:Boolean,attribute:"social-comments-disabled"})],i.prototype,"commentsDisabled",void 0);s([a({type:String,attribute:"social-comments-href"})],i.prototype,"commentsHref",void 0);s([a({type:String,attribute:"social-likes-text"})],i.prototype,"likesText",void 0);s([a({type:Number,attribute:"social-likes"})],i.prototype,"likes",void 0);s([a({type:Boolean,attribute:"social-likes-disabled"})],i.prototype,"likesDisabled",void 0);s([a({type:String,attribute:"social-likes-hover-content"})],i.prototype,"likesHoverContent",void 0);s([a({type:Boolean,attribute:"social-has-liked"})],i.prototype,"hasLiked",void 0);s([a({type:Boolean,attribute:"social-likes-interactive"})],i.prototype,"likesInteractive",void 0);s([a({type:Boolean,attribute:"social-author"})],i.prototype,"author",void 0);s([a({type:String,attribute:"social-author-text"})],i.prototype,"authorText",void 0);s([a({type:String,attribute:"social-author-href"})],i.prototype,"authorHref",void 0);s([a({type:Boolean,attribute:"social-reply-enabled"})],i.prototype,"replyEnabled",void 0);s([a({type:Boolean,attribute:"social-edit-enabled"})],i.prototype,"editEnabled",void 0);s([a({type:Boolean,attribute:"social-delete-enabled"})],i.prototype,"deleteEnabled",void 0);s([a({type:String,reflect:!0,converter:c})],i.prototype,"sizing",void 0);s([a({type:String,reflect:!0,converter:c})],i.prototype,"width",void 0);s([a({type:String,reflect:!0,attribute:"max-width",converter:c})],i.prototype,"maxWidth",void 0);s([a({type:String,reflect:!0,converter:c})],i.prototype,"height",void 0);s([a({type:String,reflect:!0,attribute:"max-height",converter:c})],i.prototype,"maxHeight",void 0);s([a({type:String,reflect:!0,converter:c})],i.prototype,"spacing",void 0);s([a({type:String,attribute:"spacing-top",reflect:!0,converter:c})],i.prototype,"spacingTop",void 0);s([a({type:String,attribute:"spacing-bottom",reflect:!0,converter:c})],i.prototype,"spacingBottom",void 0);s([a({type:String,attribute:"spacing-left",reflect:!0,converter:c})],i.prototype,"spacingLeft",void 0);s([a({type:String,attribute:"spacing-right",reflect:!0,converter:c})],i.prototype,"spacingRight",void 0);s([a({type:String,attribute:"padding",reflect:!0,converter:c})],i.prototype,"innerPadding",void 0);s([a({type:String,attribute:"padding-top",reflect:!0,converter:c})],i.prototype,"paddingTop",void 0);s([a({type:String,attribute:"padding-bottom",reflect:!0,converter:c})],i.prototype,"paddingBottom",void 0);s([a({type:String,attribute:"padding-left",reflect:!0,converter:c})],i.prototype,"paddingLeft",void 0);s([a({type:String,attribute:"padding-right",reflect:!0,converter:c})],i.prototype,"paddingRight",void 0);i=S=s([$("scb-card")],i);var W=class extends i{constructor(){super(),this.type="list"}get cardType(){return"list"}};W=s([$("scb-list-card")],W);var V=class extends i{constructor(){super(),this.type="link"}get cardType(){return"link"}};V=s([$("scb-link-card")],V);var j=class extends i{constructor(){super(),this.type="action"}get cardType(){return"action"}};j=s([$("scb-action-card")],j);var O=class extends i{constructor(){super(),this.type="social"}get cardType(){return"social"}};O=s([$("scb-social-card")],O);var K=class extends i{constructor(){super(),this.type="container"}get cardType(){return"container"}};K=s([$("scb-container-card")],K);export{j as ScbActionCard,K as ScbContainerCard,V as ScbLinkCard,W as ScbListCard,O as ScbSocialCard};
@@ -0,0 +1 @@
1
+ import"./scb-card.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var r=customElements.define.bind(customElements);customElements.define=function(e,o,d){try{customElements.get(e)||r(e,o,d)}catch(i){var n=String(i||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw i}}}}catch{}})();
@@ -0,0 +1 @@
1
+ import"./scb-card.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var r=customElements.define.bind(customElements);customElements.define=function(e,d,o){try{customElements.get(e)||r(e,d,o)}catch(i){var n=String(i||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw i}}}}catch{}})();
@@ -0,0 +1 @@
1
+ import"./scb-card.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var r=customElements.define.bind(customElements);customElements.define=function(e,d,o){try{customElements.get(e)||r(e,d,o)}catch(n){var i=String(n||"");if(i.indexOf("already been used")===-1&&i.indexOf("NotSupportedError")===-1)throw n}}}}catch{}})();
@@ -0,0 +1 @@
1
+ import"./scb-card.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var r=customElements.define.bind(customElements);customElements.define=function(e,o,c){try{customElements.get(e)||r(e,o,c)}catch(n){var i=String(n||"");if(i.indexOf("already been used")===-1&&i.indexOf("NotSupportedError")===-1)throw n}}}}catch{}})();
@@ -1,6 +1,6 @@
1
1
  import{_ as f,b as v,g as y,h as a,y as h}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as n}from"../../vendor/decorate.js";import{n as _,t as d}from"../../vendor/assertClassBrand.js";import"../scb-button/scb-button.js";(function(){try{var l=typeof globalThis<"u"?globalThis:window;if(!l.__scb_ce_guard_installed__){l.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,i,s){try{customElements.get(e)||t(e,i,s)}catch(r){var p=String(r||"");if(p.indexOf("already been used")===-1&&p.indexOf("NotSupportedError")===-1)throw r}}}}catch{}})();var c,u,o=(c=new WeakSet,u=class extends f{constructor(...t){super(...t),_(this,c),this._contentId=`scb-collapse-content-${Math.random().toString(36).substr(2,9)}`,this.variant="elements",this.collapsedHeight=40,this.visibleElements=1,this.expanded=!1,this._elementCount=0,this.expandButtonLabel="Mer",this.collapseButtonLabel="Mindre",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.itemsGap=void 0,this._contentHeight=0}get _regionLabel(){return`${this.expanded?this.collapseButtonLabel:this.expandButtonLabel} – ${this._contentId}`}toggle(){this.expanded=!this.expanded}mapSpacingToken(t){if(!t)return;const e=String(t).trim();if(e)return/^\d+$/.test(e)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(e,10)))})`:e}willUpdate(t){t.has("variant")&&(this._measureContent(!1),this._countElements(!1))}firstUpdated(){requestAnimationFrame(()=>{this._measureContent(),this._countElements()});const t=this.shadowRoot?.querySelector("slot");t&&t.addEventListener("slotchange",()=>{requestAnimationFrame(()=>{this._measureContent(),this._countElements(),d(c,this,g).call(this)})}),d(c,this,b).call(this),d(c,this,g).call(this)}updated(t){(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&d(c,this,b).call(this),t.has("itemsGap")&&(d(c,this,g).call(this),this._measureContent()),t.has("expanded")&&(d(c,this,g).call(this),this.dispatchEvent(new CustomEvent("expandedchange",{detail:{expanded:this.expanded},bubbles:!0,composed:!0})))}_measureContent(t=!0){if(this.variant==="height"){const e=this.shadowRoot?.querySelector("slot");if(e){const i=e.assignedNodes({flatten:!0});let s=0;i.forEach(r=>{if(r.nodeType===Node.ELEMENT_NODE){const m=r;s+=m.offsetHeight||m.scrollHeight||0}});const p=s;p!==this._contentHeight&&(this._contentHeight=p,t&&this.requestUpdate())}}}_countElements(t=!0){if(this.variant==="elements"){const e=this.shadowRoot?.querySelector("slot");if(e){const i=e.assignedNodes({flatten:!0}).filter(s=>s.nodeType===Node.ELEMENT_NODE).length;i!==this._elementCount&&(this._elementCount=i,t&&this.requestUpdate())}}}render(){if(this.variant==="height"){const t=this.expanded?`${this._contentHeight}px`:`${this.collapsedHeight}px`,e=this._contentHeight>this.collapsedHeight;return h`
2
2
  <div
3
- class="collapse-content"
3
+ class="collapse-content ${this.expanded?"expanded":""}"
4
4
  id="${this._contentId}"
5
5
  style="max-height: ${t};"
6
6
  role="region"
@@ -23,7 +23,7 @@ import{_ as f,b as v,g as y,h as a,y as h}from"../../vendor/vendor.js";import"..
23
23
  `:""}
24
24
  `}else{const t=typeof this.visibleElements=="string"?parseInt(this.visibleElements,10):this.visibleElements,e=this._elementCount>t;return setTimeout(()=>{const i=this.shadowRoot?.querySelector("slot");i&&i.assignedNodes({flatten:!0}).filter(s=>s.nodeType===Node.ELEMENT_NODE).forEach((s,p)=>{const r=s;!this.expanded&&p>=t?r.classList.add("scb-collapsed-hidden"):r.classList.remove("scb-collapsed-hidden")})},0),h`
25
25
  <div
26
- class="collapse-content"
26
+ class="collapse-content ${this.expanded?"expanded":""}"
27
27
  id="${this._contentId}"
28
28
  role="region"
29
29
  aria-label="${this._regionLabel}"
@@ -55,6 +55,9 @@ import{_ as f,b as v,g as y,h as a,y as h}from"../../vendor/vendor.js";import"..
55
55
  overflow: hidden;
56
56
  transition: max-height var(--motion-duration-medium) var(--motion-easing-standard);
57
57
  }
58
+ .collapse-content.expanded {
59
+ overflow: visible;
60
+ }
58
61
  .collapse-gradient-overlay {
59
62
  position: absolute;
60
63
  left: 0;
@@ -83,7 +86,7 @@ import{_ as f,b as v,g as y,h as a,y as h}from"../../vendor/vendor.js";import"..
83
86
  ::slotted(*) {
84
87
  max-height: 1000px;
85
88
  transition: max-height var(--motion-duration-medium) var(--motion-easing-standard), opacity var(--motion-duration-medium) var(--motion-easing-standard);
86
- overflow: hidden;
89
+ overflow: visible;
87
90
  display: block;
88
91
  }
89
92
  `,u);function b(){const l=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??l,e=this.mapSpacingToken(this.spacingBottom)??l,i=this.mapSpacingToken(this.spacingLeft),s=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty("--scb-collapse-spacing-block-start",t):this.style.removeProperty("--scb-collapse-spacing-block-start"),e?this.style.setProperty("--scb-collapse-spacing-block-end",e):this.style.removeProperty("--scb-collapse-spacing-block-end"),i?this.style.setProperty("--scb-collapse-spacing-inline-start",i):this.style.removeProperty("--scb-collapse-spacing-inline-start"),s?this.style.setProperty("--scb-collapse-spacing-inline-end",s):this.style.removeProperty("--scb-collapse-spacing-inline-end")}function g(){const l=this.mapSpacingToken(this.itemsGap);l?this.style.setProperty("--scb-collapse-items-gap",l):this.style.removeProperty("--scb-collapse-items-gap");const t=this.shadowRoot?.querySelector("slot");t&&t.assignedNodes({flatten:!0}).filter(e=>e.nodeType===Node.ELEMENT_NODE).forEach((e,i)=>{const s=e;i===0||!l?s.style.removeProperty("margin-block-start"):s.style.setProperty("margin-block-start","var(--scb-collapse-items-gap)")})}n([a({type:String})],o.prototype,"variant",void 0);n([a({type:Number,attribute:"collapsed-height",reflect:!0})],o.prototype,"collapsedHeight",void 0);n([a({type:Number,attribute:"visible-elements",reflect:!0})],o.prototype,"visibleElements",void 0);n([a({type:Boolean,reflect:!0})],o.prototype,"expanded",void 0);n([a({type:String,attribute:"expand-button-label",reflect:!0})],o.prototype,"expandButtonLabel",void 0);n([a({type:String,attribute:"collapse-button-label",reflect:!0})],o.prototype,"collapseButtonLabel",void 0);n([a({type:String,reflect:!0})],o.prototype,"spacing",void 0);n([a({type:String,attribute:"spacing-top",reflect:!0})],o.prototype,"spacingTop",void 0);n([a({type:String,attribute:"spacing-bottom",reflect:!0})],o.prototype,"spacingBottom",void 0);n([a({type:String,attribute:"spacing-left",reflect:!0})],o.prototype,"spacingLeft",void 0);n([a({type:String,attribute:"spacing-right",reflect:!0})],o.prototype,"spacingRight",void 0);n([a({type:String,attribute:"items-gap",reflect:!0})],o.prototype,"itemsGap",void 0);o=n([y("scb-collapse")],o);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scb-wc",
3
- "version": "0.1.26",
3
+ "version": "0.1.28",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -107,6 +107,26 @@
107
107
  "import": "./scb-card/scb-card.js",
108
108
  "require": "./scb-card/scb-card.js"
109
109
  },
110
+ "./scb-card/scb-action-card": {
111
+ "import": "./scb-card/scb-action-card.js",
112
+ "require": "./scb-card/scb-action-card.js"
113
+ },
114
+ "./scb-card/scb-container-card": {
115
+ "import": "./scb-card/scb-container-card.js",
116
+ "require": "./scb-card/scb-container-card.js"
117
+ },
118
+ "./scb-card/scb-link-card": {
119
+ "import": "./scb-card/scb-link-card.js",
120
+ "require": "./scb-card/scb-link-card.js"
121
+ },
122
+ "./scb-card/scb-list-card": {
123
+ "import": "./scb-card/scb-list-card.js",
124
+ "require": "./scb-card/scb-list-card.js"
125
+ },
126
+ "./scb-card/scb-social-card": {
127
+ "import": "./scb-card/scb-social-card.js",
128
+ "require": "./scb-card/scb-social-card.js"
129
+ },
110
130
  "./scb-checkbox": {
111
131
  "import": "./scb-checkbox/scb-checkbox.js",
112
132
  "require": "./scb-checkbox/scb-checkbox.js"
@@ -417,5 +437,5 @@
417
437
  },
418
438
  "./mvc/*": "./mvc/*"
419
439
  },
420
- "buildHash": "458C1B8AEDE69F1820B80ACE8E8D87E2D19195DAFD4D14A997D4EE17AA997116"
440
+ "buildHash": "AFBF8ABA1D36B04FB900ADC00638A36226C11847C595CD90A8922792E50DE4D7"
421
441
  }
@@ -0,0 +1 @@
1
+ import "./scb-card.js";