@momentum-design/components 0.127.3 → 0.127.5

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.
@@ -7098,13 +7098,14 @@
7098
7098
  ::slotted(mdc-option) {
7099
7099
  width: 100%;
7100
7100
  }
7101
- `,gb=[ZA];var qo=class extends Ms(Wi(q)){constructor(){super();this.loop="false";this.name=void 0;this.value=void 0;this.itemsStore=new Yr(this,{isValidItem:this.isValidItem});this.handleDestroyEvent=()=>{this.handleNoSelection()};this.addEventListener("click",this.handleClick),this.addEventListener("modified",this.handleModifiedEvent),this.addEventListener("destroyed",this.handleDestroyEvent)}connectedCallback(){super.connectedCallback(),this.role=rt.LISTBOX}handleModifiedEvent(t){let r=t.target;switch(t.detail.change){case"enabled":this.itemsStore.add(r);break;case"disabled":this.itemsStore.delete(r);break;case"selected":this.setSelectedOption(r,!1,!1);break;case"unselected":this.handleNoSelection();break;default:break}}handleNoSelection(){this.getFirstSelectedOption()||(this.selectedOption=void 0,this.value=void 0)}get navItems(){return this.itemsStore.items}isValidItem(t){return t.matches(`${ur}:not([disabled])`)}handleClick(t){let r=t.target;this.isValidItem(r)&&this.setSelectedOption(r)}getFirstSelectedOption(){return this.itemsStore.items.find(t=>t.matches("[selected]"))}updated(t){if(t.has("value")){let r=this.itemsStore.items.find(s=>s.value===this.value);r?this.setSelectedOption(r,!1):this.setSelectedOption(null,!1)}}setSelectedOption(t,r=!0,s=!0){t!=null&&t.disabled||t!=null&&t.softDisabled||(s&&this.updateSelectedInChildOptions(t),this.selectedOption=t,this.value=t==null?void 0:t.value,r&&this.fireEvents())}updateSelectedInChildOptions(t){this.itemsStore.items.forEach(r=>r.removeAttribute("selected")),t==null||t.toggleAttribute("selected",!0)}fireEvents(){this.selectedOption&&this.dispatchEvent(new Event("change",{composed:!0,bubbles:!0}))}render(){return _`<slot part="container"></slot>`}};qo.styles=[...ch.styles,...gb],p([u({type:String,reflect:!0})],qo.prototype,"name",2),p([u({type:String,reflect:!0})],qo.prototype,"value",2),p([ut()],qo.prototype,"selectedOption",2);var yp=qo;var bb=z.constructTagName("listbox");yp.register(bb);var QA=yp;var yb=z.constructTagName("banner"),js={CUSTOM:"custom",INFORMATIONAL:"informational",WARNING:"warning",ERROR:"error",SUCCESS:"success"},bn={INFORMATIONAL_ICON_NAME:"info-circle-bold",SUCCESS_ICON_NAME:"check-circle-bold",WARNING_ICON_NAME:"warning-bold",ERROR_ICON_NAME:"error-legacy-bold"},Rd={VARIANT:js.CUSTOM,PREFIX_ICON_SIZE:1.5};var JA=U`
7101
+ `,gb=[ZA];var qo=class extends Ms(Wi(q)){constructor(){super();this.loop="false";this.name=void 0;this.value=void 0;this.itemsStore=new Yr(this,{isValidItem:this.isValidItem});this.handleDestroyEvent=()=>{this.handleNoSelection()};this.addEventListener("click",this.handleClick),this.addEventListener("modified",this.handleModifiedEvent),this.addEventListener("destroyed",this.handleDestroyEvent)}connectedCallback(){super.connectedCallback(),this.role=rt.LISTBOX}handleModifiedEvent(t){let r=t.target;switch(t.detail.change){case"enabled":this.itemsStore.add(r);break;case"disabled":this.itemsStore.delete(r);break;case"selected":this.setSelectedOption(r,!1,!1);break;case"unselected":this.handleNoSelection();break;default:break}}handleNoSelection(){this.getFirstSelectedOption()||(this.selectedOption=void 0,this.value=void 0)}get navItems(){return this.itemsStore.items}isValidItem(t){return t.matches(`${ur}:not([disabled])`)}handleClick(t){let r=t.target;this.isValidItem(r)&&this.setSelectedOption(r)}getFirstSelectedOption(){return this.itemsStore.items.find(t=>t.matches("[selected]"))}updated(t){if(t.has("value")){let r=this.itemsStore.items.find(s=>s.value===this.value);r?this.setSelectedOption(r,!1):this.setSelectedOption(null,!1)}}setSelectedOption(t,r=!0,s=!0){t!=null&&t.disabled||t!=null&&t.softDisabled||(s&&this.updateSelectedInChildOptions(t),this.selectedOption=t,this.value=t==null?void 0:t.value,r&&this.fireEvents())}updateSelectedInChildOptions(t){this.itemsStore.items.forEach(r=>r.removeAttribute("selected")),t==null||t.toggleAttribute("selected",!0)}fireEvents(){this.selectedOption&&this.dispatchEvent(new Event("change",{composed:!0,bubbles:!0}))}render(){return _`<slot part="container"></slot>`}};qo.styles=[...ch.styles,...gb],p([u({type:String,reflect:!0})],qo.prototype,"name",2),p([u({type:String,reflect:!0})],qo.prototype,"value",2),p([ut()],qo.prototype,"selectedOption",2);var yp=qo;var bb=z.constructTagName("listbox");yp.register(bb);var QA=yp;var yb=z.constructTagName("banner"),js={CUSTOM:"custom",INFORMATIONAL:"informational",WARNING:"warning",ERROR:"error",SUCCESS:"success"},bn={INFORMATIONAL_ICON_NAME:"info-circle-bold",SUCCESS_ICON_NAME:"check-circle-bold",WARNING_ICON_NAME:"warning-bold",ERROR_ICON_NAME:"error-legacy-bold"},Rd={VARIANT:js.CUSTOM,PREFIX_ICON_SIZE:1.25};var JA=U`
7102
7102
  :host {
7103
7103
  --mdc-banner-background-color: var(--mds-color-theme-background-solid-primary-normal);
7104
7104
  --mdc-banner-border-color: var(--mds-color-theme-outline-secondary-normal);
7105
+ --mdc-banner-border-width: 1px;
7105
7106
  --mdc-banner-icon-color: var(--mds-color-theme-text-primary-normal);
7106
7107
  --mdc-banner-elevation: var(--mds-elevation-3);
7107
- --mdc-banner-padding: 0.75rem;
7108
+ --mdc-banner-padding: calc(0.75rem - var(--mdc-banner-border-width));
7108
7109
  --mdc-banner-gap: 0.5rem;
7109
7110
 
7110
7111
  display: flex;
@@ -7114,7 +7115,7 @@
7114
7115
  align-self: stretch;
7115
7116
  width: 100%;
7116
7117
  background-color: var(--mdc-banner-background-color);
7117
- border: 1px solid var(--mdc-banner-border-color);
7118
+ border: var(--mdc-banner-border-width) solid var(--mdc-banner-border-color);
7118
7119
  border-radius: 0.5rem;
7119
7120
  filter: var(--mdc-banner-elevation);
7120
7121
  }
@@ -7155,7 +7156,6 @@
7155
7156
  flex: 1 0 0;
7156
7157
  display: flex;
7157
7158
  flex-direction: column;
7158
- gap: 0.25rem;
7159
7159
  }
7160
7160
 
7161
7161
  :host(:not([secondary-label]))::part(leading) {
@@ -7164,7 +7164,6 @@
7164
7164
 
7165
7165
  :host::part(leading-icon) {
7166
7166
  color: var(--mdc-banner-icon-color);
7167
- padding: 0.25rem 0;
7168
7167
  }
7169
7168
 
7170
7169
  :host::part(trailing) {
@@ -7189,10 +7188,13 @@
7189
7188
  length-unit="rem"
7190
7189
  ></mdc-icon>
7191
7190
  `:j}getTextLabel(){return this.label?_`
7192
- <mdc-text part="leading-label" type="${st.BODY_LARGE_REGULAR}" tagname="${mt.SPAN}"
7191
+ <mdc-text part="leading-label" type="${st.BODY_MIDSIZE_MEDIUM}" tagname="${mt.SPAN}"
7193
7192
  >${this.label}</mdc-text
7194
7193
  >
7195
- ${this.secondaryLabel?_`<mdc-text part="leading-secondary-label" type="${st.BODY_MIDSIZE_REGULAR}" tagname="${mt.SPAN}"
7194
+ ${this.secondaryLabel?_`<mdc-text
7195
+ part="leading-secondary-label"
7196
+ type="${st.BODY_MIDSIZE_REGULAR}"
7197
+ tagname="${mt.SPAN}"
7196
7198
  >${this.secondaryLabel}</mdc-text
7197
7199
  >`:j}
7198
7200
  `:j}render(){var t;return _`