@momentum-design/components 0.109.0 → 0.109.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3523,7 +3523,6 @@
3523
3523
  }
3524
3524
  :host {
3525
3525
  background-color: var(--mdc-listitem-default-background-color);
3526
- column-gap: var(--mdc-listitem-column-gap);
3527
3526
  display: flex;
3528
3527
  flex-direction: row;
3529
3528
  cursor: var(--mdc-listitem-cursor);
@@ -3537,11 +3536,8 @@
3537
3536
  :host([variant='inset-pill']) {
3538
3537
  border-radius: 3.125rem;
3539
3538
  }
3540
- :host::part(leading-text) {
3541
- flex: 1;
3542
- /** 2x of column gap on both ends of the listitem - 100% width */
3543
- width: calc(100% - (2 * var(--mdc-listitem-padding-left-right)));
3544
- }
3539
+ :host::part(leading-text),
3540
+ :host::part(trailing-text),
3545
3541
  :host::part(leading-text-primary-label),
3546
3542
  :host::part(leading-text-secondary-label),
3547
3543
  :host::part(leading-text-tertiary-label),
@@ -3583,11 +3579,16 @@
3583
3579
  align-items: center;
3584
3580
  column-gap: var(--mdc-listitem-column-gap);
3585
3581
  display: flex;
3586
- width: 100%;
3582
+ min-width: 0;
3583
+ }
3584
+ :host::part(leading) {
3585
+ flex: 1;
3587
3586
  }
3588
3587
  :host::part(trailing) {
3588
+ flex: 0 1 auto;
3589
3589
  justify-content: flex-end;
3590
3590
  }
3591
+
3591
3592
  :host::part(leading-text-secondary-label),
3592
3593
  :host::part(leading-text-tertiary-label) {
3593
3594
  color: var(--mdc-listitem-secondary-label-color);
@@ -3600,12 +3601,19 @@
3600
3601
  :host::part(trailing-text) {
3601
3602
  text-align: right;
3602
3603
  }
3604
+
3605
+ :host::part(trailing-text-side-header),
3606
+ :host::part(trailing-text-subline) {
3607
+ margin-inline-start: var(--mdc-listitem-column-gap);
3608
+ }
3609
+
3603
3610
  ::slotted([slot='leading-controls']),
3604
3611
  ::slotted([slot='trailing-controls']) {
3605
3612
  align-items: center;
3606
3613
  column-gap: var(--mdc-listitem-column-gap);
3607
3614
  display: flex;
3608
3615
  flex-direction: row;
3616
+ flex-shrink: 0;
3609
3617
  }
3610
3618
  `,mf=[VE,...xt()];var Ve=class extends zt(Xe(pf(W))){constructor(){super();this.variant=nf.VARIANT;this.addEventListener("keydown",this.handleKeyDown.bind(this)),this.addEventListener("click",this.handleClick.bind(this))}connectedCallback(){super.connectedCallback(),this.role=this.role||tt.LISTITEM}handleClick(t){this.disabled&&(t.stopImmediatePropagation(),t.preventDefault())}handleKeyDown(t){(t.key===J.ENTER||t.key===J.SPACE)&&(this.triggerClickEvent(),t.preventDefault())}triggerClickEvent(){let t=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});this.dispatchEvent(t)}getText(t,o,a){return I`
3611
3619
  <slot name="${t}">
@@ -4248,41 +4256,42 @@
4248
4256
  </div>
4249
4257
  `}};bs.styles=[...W.styles,...zf],p([u({type:String,reflect:!0})],bs.prototype,"label",2),p([Lt({selector:"mdc-option"})],bs.prototype,"options",2);var Od=bs;Od.register($f);var hT=Od;var Vf="check-bold",li=H.constructTagName("option");var pT=U`
4250
4258
  :host {
4259
+ --mdc-listitem-column-gap: 0.75rem;
4251
4260
  --mdc-option-icon-width: 1rem;
4261
+ }
4252
4262
 
4253
- flex-shrink: 0;
4254
-
4263
+ :host::part(leading-icon),
4264
+ :host::part(trailing) {
4255
4265
  display: flex;
4256
- flex-direction: row;
4257
4266
  align-items: center;
4267
+ width: var(--mdc-option-icon-width);
4258
4268
  }
4259
- :host::part(list-item) {
4260
- height: 2.25rem;
4269
+
4270
+ :host::part(leading-text) {
4271
+ flex: 1;
4261
4272
  }
4262
- :host::part(default-slot) {
4263
- display: none;
4273
+
4274
+ :host::part(leading-icon) {
4275
+ margin-inline-end: var(--mdc-listitem-column-gap);
4264
4276
  }
4265
- :host::part(leading-icon),
4266
4277
  :host::part(trailing) {
4267
- flex: 1;
4268
- max-width: var(--mdc-option-icon-width);
4269
- }
4270
- :host::part(leading-text) {
4271
- flex: 1;
4272
- /** 2x of leading and trailing icon width + 2x of column gap on both sides of the label text */
4273
- width: calc(100% - (2 * var(--mdc-option-icon-width)) - (2 * var(--mdc-listitem-column-gap)));
4278
+ margin-inline-start: var(--mdc-listitem-column-gap);
4274
4279
  }
4275
4280
  `,Bf=[pT];var xo=class extends Pe(si){constructor(){super(...arguments);this.selected=!1;this.ariaLabel=null}connectedCallback(){super.connectedCallback(),this.role="option",this.variant=Aa.INSET_RECTANGLE,this.setAttribute("aria-selected",`${this.selected}`),this.setAttribute("aria-disabled",`${!!this.disabled}`),this.name=void 0,this.sideHeaderText=void 0,this.sublineText=void 0}update(t){super.update(t),t.has("selected")&&(this.setAttribute("aria-selected",`${this.selected}`),this.dispatchModifiedEvent(this.selected?"selected":"unselected"))}render(){let t=this.prefixIcon?I`
4276
4281
  <div part="leading-icon">
4277
4282
  <mdc-icon length-unit="rem" slot="leading-controls" name="${st(this.prefixIcon)}"></mdc-icon>
4278
4283
  </div>
4279
- `:j,o=this.selected?I` <mdc-icon length-unit="rem" slot="trailing-controls" name="${Vf}"></mdc-icon> `:j;return I`
4284
+ `:j,o=this.selected?I`
4285
+ <mdc-icon length-unit="rem" slot="trailing-controls" name="${Vf}"></mdc-icon>
4286
+ `:j;return I`
4280
4287
  ${t}
4281
4288
  <div part="leading-text">
4282
4289
  ${this.getText("leading-text-primary-label",ot.BODY_MIDSIZE_REGULAR,this.label)}
4283
4290
  ${this.getText("leading-text-secondary-label",ot.BODY_SMALL_REGULAR,this.secondaryLabel)}
4284
4291
  </div>
4285
- <div part="trailing">${o}</div>
4292
+ <div part="trailing">
4293
+ ${o}
4294
+ </div>
4286
4295
  `}};xo.styles=[...si.styles,...Bf],p([u({type:Boolean,reflect:!0})],xo.prototype,"selected",2),p([u({type:String,reflect:!0,attribute:"prefix-icon"})],xo.prototype,"prefixIcon",2),p([u({type:String,reflect:!0,attribute:"aria-label"})],xo.prototype,"ariaLabel",2);var Pd=xo;Pd.register(li);var mT=Pd;var Dd={HIDE_BOLD:"hide-bold",SHOW_BOLD:"show-bold"},Uf=H.constructTagName("password");var Ao=class extends oi{constructor(){super(...arguments);this.showHideButtonAriaLabel="";this.helpTextType=Dt.VALIDATION;this.showPassword=!1}connectedCallback(){super.connectedCallback(),this.trailingButton=!0}toggleShowPassword(){this.showPassword=!this.showPassword}renderTrailingButton(t=!1){let o=t||this.value;return o?I`
4287
4296
  <mdc-button
4288
4297
  part="trailing-button"