@momentum-design/components 0.109.0 → 0.109.2

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.
@@ -2144,6 +2144,7 @@
2144
2144
  --mdc-popover-inverted-border-color: var(--mds-color-theme-inverted-outline-primary-normal);
2145
2145
  --mdc-popover-inverted-text-color: var(--mds-color-theme-inverted-text-primary-normal);
2146
2146
  --mdc-popover-elevation-3: var(--mds-elevation-3);
2147
+ --mdc-popover-width: unset;
2147
2148
  --mdc-popover-max-width: max-content;
2148
2149
  --mdc-popover-max-height: auto;
2149
2150
 
@@ -2157,7 +2158,8 @@
2157
2158
  border-radius: 0.5rem;
2158
2159
  border: 0.0625rem solid var(--mdc-popover-border-color);
2159
2160
  filter: var(--mdc-popover-elevation-3);
2160
- width: var(--mdc-popover-max-width);
2161
+ max-width: var(--mdc-popover-max-width);
2162
+ width: var(--mdc-popover-width, var(--mdc-popover-max-width));
2161
2163
  }
2162
2164
 
2163
2165
  :host([strategy='absolute']) {
@@ -2191,7 +2193,6 @@
2191
2193
  position: relative;
2192
2194
  cursor: default;
2193
2195
  padding: 0.75rem;
2194
- min-width: max-content;
2195
2196
  z-index: 9998;
2196
2197
  max-height: var(--mdc-popover-max-height);
2197
2198
  }
@@ -3523,7 +3524,6 @@
3523
3524
  }
3524
3525
  :host {
3525
3526
  background-color: var(--mdc-listitem-default-background-color);
3526
- column-gap: var(--mdc-listitem-column-gap);
3527
3527
  display: flex;
3528
3528
  flex-direction: row;
3529
3529
  cursor: var(--mdc-listitem-cursor);
@@ -3537,11 +3537,8 @@
3537
3537
  :host([variant='inset-pill']) {
3538
3538
  border-radius: 3.125rem;
3539
3539
  }
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
- }
3540
+ :host::part(leading-text),
3541
+ :host::part(trailing-text),
3545
3542
  :host::part(leading-text-primary-label),
3546
3543
  :host::part(leading-text-secondary-label),
3547
3544
  :host::part(leading-text-tertiary-label),
@@ -3583,11 +3580,16 @@
3583
3580
  align-items: center;
3584
3581
  column-gap: var(--mdc-listitem-column-gap);
3585
3582
  display: flex;
3586
- width: 100%;
3583
+ min-width: 0;
3584
+ }
3585
+ :host::part(leading) {
3586
+ flex: 1;
3587
3587
  }
3588
3588
  :host::part(trailing) {
3589
+ flex: 0 1 auto;
3589
3590
  justify-content: flex-end;
3590
3591
  }
3592
+
3591
3593
  :host::part(leading-text-secondary-label),
3592
3594
  :host::part(leading-text-tertiary-label) {
3593
3595
  color: var(--mdc-listitem-secondary-label-color);
@@ -3600,12 +3602,19 @@
3600
3602
  :host::part(trailing-text) {
3601
3603
  text-align: right;
3602
3604
  }
3605
+
3606
+ :host::part(trailing-text-side-header),
3607
+ :host::part(trailing-text-subline) {
3608
+ margin-inline-start: var(--mdc-listitem-column-gap);
3609
+ }
3610
+
3603
3611
  ::slotted([slot='leading-controls']),
3604
3612
  ::slotted([slot='trailing-controls']) {
3605
3613
  align-items: center;
3606
3614
  column-gap: var(--mdc-listitem-column-gap);
3607
3615
  display: flex;
3608
3616
  flex-direction: row;
3617
+ flex-shrink: 0;
3609
3618
  }
3610
3619
  `,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
3620
  <slot name="${t}">
@@ -4248,41 +4257,42 @@
4248
4257
  </div>
4249
4258
  `}};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
4259
  :host {
4260
+ --mdc-listitem-column-gap: 0.75rem;
4251
4261
  --mdc-option-icon-width: 1rem;
4262
+ }
4252
4263
 
4253
- flex-shrink: 0;
4254
-
4264
+ :host::part(leading-icon),
4265
+ :host::part(trailing) {
4255
4266
  display: flex;
4256
- flex-direction: row;
4257
4267
  align-items: center;
4268
+ width: var(--mdc-option-icon-width);
4258
4269
  }
4259
- :host::part(list-item) {
4260
- height: 2.25rem;
4270
+
4271
+ :host::part(leading-text) {
4272
+ flex: 1;
4261
4273
  }
4262
- :host::part(default-slot) {
4263
- display: none;
4274
+
4275
+ :host::part(leading-icon) {
4276
+ margin-inline-end: var(--mdc-listitem-column-gap);
4264
4277
  }
4265
- :host::part(leading-icon),
4266
4278
  :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)));
4279
+ margin-inline-start: var(--mdc-listitem-column-gap);
4274
4280
  }
4275
4281
  `,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
4282
  <div part="leading-icon">
4277
4283
  <mdc-icon length-unit="rem" slot="leading-controls" name="${st(this.prefixIcon)}"></mdc-icon>
4278
4284
  </div>
4279
- `:j,o=this.selected?I` <mdc-icon length-unit="rem" slot="trailing-controls" name="${Vf}"></mdc-icon> `:j;return I`
4285
+ `:j,o=this.selected?I`
4286
+ <mdc-icon length-unit="rem" slot="trailing-controls" name="${Vf}"></mdc-icon>
4287
+ `:j;return I`
4280
4288
  ${t}
4281
4289
  <div part="leading-text">
4282
4290
  ${this.getText("leading-text-primary-label",ot.BODY_MIDSIZE_REGULAR,this.label)}
4283
4291
  ${this.getText("leading-text-secondary-label",ot.BODY_SMALL_REGULAR,this.secondaryLabel)}
4284
4292
  </div>
4285
- <div part="trailing">${o}</div>
4293
+ <div part="trailing">
4294
+ ${o}
4295
+ </div>
4286
4296
  `}};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
4297
  <mdc-button
4288
4298
  part="trailing-button"