@momentum-design/components 0.27.3 → 0.27.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.
Files changed (42) hide show
  1. package/dist/browser/index.js +15 -15
  2. package/dist/browser/index.js.map +3 -3
  3. package/dist/components/avatarbutton/avatarbutton.component.d.ts +5 -0
  4. package/dist/components/avatarbutton/avatarbutton.component.js +5 -0
  5. package/dist/components/button/button.component.d.ts +5 -0
  6. package/dist/components/button/button.component.js +26 -17
  7. package/dist/components/buttonsimple/buttonsimple.component.d.ts +5 -0
  8. package/dist/components/buttonsimple/buttonsimple.component.js +5 -0
  9. package/dist/components/checkbox/checkbox.component.d.ts +3 -0
  10. package/dist/components/checkbox/checkbox.component.js +3 -0
  11. package/dist/components/input/input.component.d.ts +5 -0
  12. package/dist/components/input/input.component.js +5 -0
  13. package/dist/components/radio/radio.component.d.ts +3 -0
  14. package/dist/components/radio/radio.component.js +3 -0
  15. package/dist/components/tab/tab.component.d.ts +5 -0
  16. package/dist/components/tab/tab.component.js +5 -0
  17. package/dist/components/toggle/toggle.component.d.ts +3 -0
  18. package/dist/components/toggle/toggle.component.js +3 -0
  19. package/dist/components/virtualizedlist/virtualizedlist.component.d.ts +2 -0
  20. package/dist/components/virtualizedlist/virtualizedlist.component.js +2 -0
  21. package/dist/custom-elements.json +1052 -832
  22. package/dist/react/avatarbutton/index.d.ts +11 -1
  23. package/dist/react/avatarbutton/index.js +11 -1
  24. package/dist/react/button/index.d.ts +11 -1
  25. package/dist/react/button/index.js +11 -1
  26. package/dist/react/buttonsimple/index.d.ts +11 -1
  27. package/dist/react/buttonsimple/index.js +11 -1
  28. package/dist/react/checkbox/index.d.ts +8 -1
  29. package/dist/react/checkbox/index.js +8 -1
  30. package/dist/react/index.d.ts +1 -1
  31. package/dist/react/index.js +1 -1
  32. package/dist/react/input/index.d.ts +12 -1
  33. package/dist/react/input/index.js +12 -1
  34. package/dist/react/radio/index.d.ts +8 -1
  35. package/dist/react/radio/index.js +8 -1
  36. package/dist/react/tab/index.d.ts +11 -1
  37. package/dist/react/tab/index.js +11 -1
  38. package/dist/react/toggle/index.d.ts +8 -1
  39. package/dist/react/toggle/index.js +8 -1
  40. package/dist/react/virtualizedlist/index.d.ts +5 -1
  41. package/dist/react/virtualizedlist/index.js +5 -1
  42. package/package.json +1 -1
@@ -924,22 +924,22 @@
924
924
  --mdc-button-secondary-hover-background-color: var(--mds-color-theme-button-secondary-hover);
925
925
  --mdc-button-secondary-pressed-background-color: var(--mds-color-theme-button-secondary-pressed);
926
926
  }
927
- `,Yo=[Ts];var Xo=i=>{switch(i){case K[64]:return 2;case K[52]:return 1.75;case K[40]:return 1.25;default:return 1}},rt=i=>{let t=i.split("-"),e=["bold","filled","regular","light"];return t.filter(r=>!e.includes(r)).join("-")};var $=class extends oe{constructor(){super(...arguments);this.variant=G.VARIANT;this.size=G.SIZE;this.color=G.COLOR;this.role="button";this.typeInternal=G.TYPE_INTERNAL;this.iconSize=1}update(e){super.update(e),e.has("active")&&this.modifyIconName(this.active),e.has("size")&&this.setSize(this.size),e.has("variant")&&(this.setVariant(this.variant),this.setSize(this.size)),e.has("color")&&this.setColor(this.color),e.has("typeInternal")&&this.setSize(this.size),(e.has("prefixIcon")||e.has("postfixIcon"))&&this.inferButtonType()}modifyIconName(e){e?(this.prefixIcon&&(this.prevPrefixIcon=this.prefixIcon,this.prefixIcon=`${rt(this.prefixIcon)}-filled`),this.postfixIcon&&(this.prevPostfixIcon=this.postfixIcon,this.postfixIcon=`${rt(this.postfixIcon)}-filled`)):(this.prevPrefixIcon&&(this.prefixIcon=this.prevPrefixIcon),this.prevPostfixIcon&&(this.postfixIcon=this.prevPostfixIcon))}setVariant(e){this.setAttribute("variant",Object.values(fe).includes(e)?e:G.VARIANT)}setSize(e){let o=this.typeInternal===Pe.ICON?Object.values(K).includes(e)&&!(e===K[20]&&this.variant!==fe.TERTIARY):Object.values($t).includes(e);this.setAttribute("size",o?`${e}`:`${G.SIZE}`),this.iconSize=Xo(e)}setColor(e){!Object.values(gr).includes(e)||this.variant===fe.TERTIARY?this.setAttribute("color",`${G.COLOR}`):this.setAttribute("color",e)}inferButtonType(){var r,o;let e=(o=(r=this.shadowRoot)==null?void 0:r.querySelector("slot"))==null?void 0:o.assignedNodes().length;e&&(this.prefixIcon||this.postfixIcon)?(this.typeInternal=Pe.PILL_WITH_ICON,this.setAttribute("data-btn-type","pill-with-icon")):!e&&(this.prefixIcon||this.postfixIcon)?(this.typeInternal=Pe.ICON,this.setAttribute("data-btn-type","icon")):(this.typeInternal=Pe.PILL,this.setAttribute("data-btn-type","pill"))}render(){return m`
928
- ${this.prefixIcon?m`
929
- <mdc-icon
930
- name="${this.prefixIcon}"
931
- part="prefix-icon"
932
- size=${this.iconSize}
933
- length-unit="rem">
934
- </mdc-icon>`:""}
927
+ `,Yo=[Ts];var Xo=i=>{switch(i){case K[64]:return 2;case K[52]:return 1.75;case K[40]:return 1.25;default:return 1}},rt=i=>{let t=i.split("-"),e=["bold","filled","regular","light"];return t.filter(r=>!e.includes(r)).join("-")};var $=class extends oe{constructor(){super(...arguments);this.variant=G.VARIANT;this.size=G.SIZE;this.color=G.COLOR;this.role="button";this.typeInternal=G.TYPE_INTERNAL;this.iconSize=1}update(e){super.update(e),e.has("active")&&this.modifyIconName(this.active),e.has("size")&&this.setSize(this.size),e.has("variant")&&(this.setVariant(this.variant),this.setSize(this.size)),e.has("color")&&this.setColor(this.color),e.has("typeInternal")&&this.setSize(this.size),(e.has("prefixIcon")||e.has("postfixIcon"))&&this.inferButtonType()}modifyIconName(e){e?(this.prefixIcon&&(this.prevPrefixIcon=this.prefixIcon,this.prefixIcon=`${rt(this.prefixIcon)}-filled`),this.postfixIcon&&(this.prevPostfixIcon=this.postfixIcon,this.postfixIcon=`${rt(this.postfixIcon)}-filled`)):(this.prevPrefixIcon&&(this.prefixIcon=this.prevPrefixIcon),this.prevPostfixIcon&&(this.postfixIcon=this.prevPostfixIcon))}setVariant(e){this.setAttribute("variant",Object.values(fe).includes(e)?e:G.VARIANT)}setSize(e){let o=this.typeInternal===Pe.ICON?Object.values(K).includes(e)&&!(e===K[20]&&this.variant!==fe.TERTIARY):Object.values($t).includes(e);this.setAttribute("size",o?`${e}`:`${G.SIZE}`),this.iconSize=Xo(e)}setColor(e){!Object.values(gr).includes(e)||this.variant===fe.TERTIARY?this.setAttribute("color",`${G.COLOR}`):this.setAttribute("color",e)}inferButtonType(){var r,o;let e=(o=(r=this.shadowRoot)==null?void 0:r.querySelector("slot"))==null?void 0:o.assignedNodes().filter(n=>{var s;return n.nodeType!==Node.TEXT_NODE||((s=n.textContent)==null?void 0:s.trim())}).length;e&&(this.prefixIcon||this.postfixIcon)?(this.typeInternal=Pe.PILL_WITH_ICON,this.setAttribute("data-btn-type","pill-with-icon")):!e&&(this.prefixIcon||this.postfixIcon)?(this.typeInternal=Pe.ICON,this.setAttribute("data-btn-type","icon")):(this.typeInternal=Pe.PILL,this.setAttribute("data-btn-type","pill"))}render(){return m`
928
+ ${this.prefixIcon?m` <mdc-icon
929
+ name="${this.prefixIcon}"
930
+ part="prefix-icon"
931
+ size=${this.iconSize}
932
+ length-unit="rem"
933
+ >
934
+ </mdc-icon>`:""}
935
935
  <slot @slotchange=${this.inferButtonType}></slot>
936
- ${this.postfixIcon?m`
937
- <mdc-icon
938
- name="${this.postfixIcon}"
939
- part="postfix-icon"
940
- size=${this.iconSize}
941
- length-unit="rem">
942
- </mdc-icon>`:""}
936
+ ${this.postfixIcon?m` <mdc-icon
937
+ name="${this.postfixIcon}"
938
+ part="postfix-icon"
939
+ size=${this.iconSize}
940
+ length-unit="rem"
941
+ >
942
+ </mdc-icon>`:""}
943
943
  `}};$.styles=[...oe.styles,...Yo],a([c({type:String,attribute:"prefix-icon",reflect:!0})],$.prototype,"prefixIcon",2),a([c({type:String,attribute:"postfix-icon",reflect:!0})],$.prototype,"postfixIcon",2),a([c({type:String})],$.prototype,"variant",2),a([c({type:Number})],$.prototype,"size",2),a([c({type:String})],$.prototype,"color",2),a([c({type:String,reflect:!0})],$.prototype,"role",2),a([L()],$.prototype,"typeInternal",2),a([L()],$.prototype,"iconSize",2);var vr=$;vr.register(tt);var _s=vr;var As=h`
944
944
  :host {
945
945
  --mdc-bullet-background-color: var(--mds-color-theme-outline-secondary-normal);