@momentum-design/components 0.120.30 → 0.120.31

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.
@@ -1361,31 +1361,31 @@
1361
1361
  --mdc-avatar-loading-indicator-foreground-color: var(--mdc-avatar-default-foreground-color);
1362
1362
  --mdc-avatar-loading-overlay-background-color: var(--mds-color-theme-common-overlays-secondary-normal);
1363
1363
  }
1364
- :host([size='124'])::part(content) {
1364
+ :host([size='124']) {
1365
1365
  width: 7.75rem;
1366
1366
  height: 7.75rem;
1367
1367
  }
1368
- :host([size='88'])::part(content) {
1368
+ :host([size='88']) {
1369
1369
  width: 5.5rem;
1370
1370
  height: 5.5rem;
1371
1371
  }
1372
- :host([size='72'])::part(content) {
1372
+ :host([size='72']) {
1373
1373
  width: 4.5rem;
1374
1374
  height: 4.5rem;
1375
1375
  }
1376
- :host([size='64'])::part(content) {
1376
+ :host([size='64']) {
1377
1377
  width: 4rem;
1378
1378
  height: 4rem;
1379
1379
  }
1380
- :host([size='48'])::part(content) {
1380
+ :host([size='48']) {
1381
1381
  width: 3rem;
1382
1382
  height: 3rem;
1383
1383
  }
1384
- :host([size='32'])::part(content) {
1384
+ :host([size='32']) {
1385
1385
  width: 2rem;
1386
1386
  height: 2rem;
1387
1387
  }
1388
- :host([size='24'])::part(content) {
1388
+ :host([size='24']) {
1389
1389
  width: 1.5rem;
1390
1390
  height: 1.5rem;
1391
1391
  }
@@ -1408,7 +1408,7 @@
1408
1408
  :host([size='24'])::part(loader) {
1409
1409
  transform: scale(0.3);
1410
1410
  }
1411
- :host::part(content) {
1411
+ :host {
1412
1412
  width: 2rem;
1413
1413
  height: 2rem;
1414
1414
  background-color: var(--mdc-avatar-default-background-color);
@@ -1504,11 +1504,11 @@
1504
1504
 
1505
1505
  /* High Contrast Mode */
1506
1506
  @media (forced-colors: active) {
1507
- :host::part(content) {
1507
+ :host {
1508
1508
  outline: 0.125rem solid;
1509
1509
  }
1510
1510
  }
1511
- `],gu=oE;var bu=z.constructTagName("presence"),Te={ACTIVE:"active",AWAY:"away",AWAY_CALLING:"away-calling",BUSY:"busy",DND:"dnd",MEETING:"meeting",ON_CALL:"on-call",ON_DEVICE:"on-device",ON_MOBILE:"on-mobile",PAUSE:"pause",PTO:"pto",PRESENTING:"presenting",QUIET:"quiet",SCHEDULED:"scheduled"},Xt={24:24,32:32,48:48,64:64,72:72,88:88,124:124},ms={TYPE:Te.ACTIVE,SIZE:Xt[32]};var yu=n=>({[Ft[124]]:Xt[124],[Ft[88]]:Xt[88],[Ft[72]]:Xt[72],[Ft[64]]:Xt[64],[Ft[48]]:Xt[48],[Ft[32]]:Xt[32],[Ft[24]]:Xt[24]})[n]||Xt[32],Eu=n=>({[Ft[124]]:4.75,[Ft[88]]:3,[Ft[72]]:2.5,[Ft[64]]:2.25,[Ft[48]]:1.75,[Ft[32]]:1.25,[Ft[24]]:1})[n]||1.25,Tu=n=>({[Ft[124]]:st.HEADING_XLARGE_MEDIUM,[Ft[88]]:st.HEADING_LARGE_MEDIUM,[Ft[72]]:st.HEADING_MIDSIZE_MEDIUM,[Ft[64]]:st.HEADING_SMALL_MEDIUM,[Ft[48]]:st.HEADING_SMALL_MEDIUM,[Ft[32]]:st.BODY_MIDSIZE_MEDIUM,[Ft[24]]:st.BODY_SMALL_MEDIUM})[n]||st.BODY_MIDSIZE_MEDIUM;var _a=class extends bl(Kt(q)){constructor(){super(...arguments);this.isPhotoLoaded=!1}getPresenceTemplateBasedOnType(t){return t===Se.COUNTER&&(this.counter||this.counter===0)||this.isTyping?j:this.presence?_`
1511
+ `],gu=oE;var bu=z.constructTagName("presence"),Te={ACTIVE:"active",AWAY:"away",AWAY_CALLING:"away-calling",BUSY:"busy",DND:"dnd",MEETING:"meeting",ON_CALL:"on-call",ON_DEVICE:"on-device",ON_MOBILE:"on-mobile",PAUSE:"pause",PTO:"pto",PRESENTING:"presenting",QUIET:"quiet",SCHEDULED:"scheduled"},Xt={24:24,32:32,48:48,64:64,72:72,88:88,124:124},ms={TYPE:Te.ACTIVE,SIZE:Xt[32]};var yu=n=>({[Ft[124]]:Xt[124],[Ft[88]]:Xt[88],[Ft[72]]:Xt[72],[Ft[64]]:Xt[64],[Ft[48]]:Xt[48],[Ft[32]]:Xt[32],[Ft[24]]:Xt[24]})[n]||Xt[32],Eu=n=>({[Ft[124]]:4.75,[Ft[88]]:3,[Ft[72]]:2.5,[Ft[64]]:2.25,[Ft[48]]:1.75,[Ft[32]]:1.25,[Ft[24]]:1})[n]||1.25,Tu=n=>({[Ft[124]]:st.HEADING_XLARGE_MEDIUM,[Ft[88]]:st.HEADING_LARGE_MEDIUM,[Ft[72]]:st.HEADING_MIDSIZE_MEDIUM,[Ft[64]]:st.HEADING_SMALL_MEDIUM,[Ft[48]]:st.HEADING_SMALL_MEDIUM,[Ft[32]]:st.BODY_MIDSIZE_MEDIUM,[Ft[24]]:st.BODY_SMALL_MEDIUM})[n]||st.BODY_MIDSIZE_MEDIUM;var _a=class extends bl(Kt(q)){constructor(){super(...arguments);this.isPhotoLoaded=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}getPresenceTemplateBasedOnType(t){return t===Se.COUNTER&&(this.counter||this.counter===0)||this.isTyping?j:this.presence?_`
1512
1512
  <mdc-presence part="presence" type="${this.presence}" size="${yu(this.size)}"></mdc-presence>
1513
1513
  `:j}handleOnLoad(){this.isPhotoLoaded=!0}handleOnError(){this.isPhotoLoaded=!1,this.onerror&&this.onerror("There was a problem while fetching the <img/>. Please check the src attribute and try again.")}photoTemplate(){return _`
1514
1514
  <img
@@ -1522,10 +1522,8 @@
1522
1522
  `}iconTemplate(){let t=this.iconName||ps.ICON_NAME;return _`
1523
1523
  <mdc-icon name="${rt(t)}" length-unit="rem" size="${Eu(this.size)}"></mdc-icon>
1524
1524
  `}textTemplate(t){return _` <mdc-text type="${Tu(this.size)}" tagname="span"> ${t} </mdc-text> `}generateCounterText(t){return t<0?"0":t>vc?`${vc}+`:t.toString()}generateInitialsText(t){return t.toUpperCase().slice(0,2)}generateTextContent(t){let i="";return t===Se.TEXT&&this.initials&&(i=this.generateInitialsText(this.initials)),t===Se.COUNTER&&(this.counter||this.counter===0)&&(i=this.generateCounterText(this.counter)),this.textTemplate(i)}getTypeBasedOnInputs(){return this.src?Se.PHOTO:this.iconName?Se.ICON:this.initials?Se.TEXT:this.counter||this.counter===0?Se.COUNTER:Se.ICON}getTemplateBasedOnType(t){switch(t){case Se.PHOTO:return this.photoTemplate();case Se.TEXT:case Se.COUNTER:return this.generateTextContent(t);case Se.ICON:default:return this.iconTemplate()}}getLoadingContent(){return this.isTyping?_`<div part="loading-wrapper"><div part="loader"></div></div>`:j}getPhotoPlaceHolderContent(t){return this.isPhotoLoaded?j:t===Se.PHOTO?this.initials?this.textTemplate(this.generateInitialsText(this.initials)):this.iconTemplate():j}update(t){super.update(t),t.has("src")&&!this.src&&(this.isPhotoLoaded=!1)}render(){let t=this.getTypeBasedOnInputs();return _`
1525
- <div part="content" aria-hidden="true">
1526
- ${this.getPhotoPlaceHolderContent(t)} ${this.getTemplateBasedOnType(t)} ${this.getLoadingContent()}
1527
- ${this.getPresenceTemplateBasedOnType(t)}
1528
- </div>
1525
+ ${this.getPhotoPlaceHolderContent(t)} ${this.getTemplateBasedOnType(t)} ${this.getLoadingContent()}
1526
+ ${this.getPresenceTemplateBasedOnType(t)}
1529
1527
  `}};_a.styles=[...q.styles,...gu],p([vt()],_a.prototype,"isPhotoLoaded",2);var gc=_a;var sE=[bt,B`
1530
1528
  :host {
1531
1529
  --mdc-presence-active-background-color: var(--mds-color-theme-indicator-stable);