@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.
- package/dist/browser/index.js +15 -15
- package/dist/browser/index.js.map +3 -3
- package/dist/components/avatarbutton/avatarbutton.component.d.ts +5 -0
- package/dist/components/avatarbutton/avatarbutton.component.js +5 -0
- package/dist/components/button/button.component.d.ts +5 -0
- package/dist/components/button/button.component.js +26 -17
- package/dist/components/buttonsimple/buttonsimple.component.d.ts +5 -0
- package/dist/components/buttonsimple/buttonsimple.component.js +5 -0
- package/dist/components/checkbox/checkbox.component.d.ts +3 -0
- package/dist/components/checkbox/checkbox.component.js +3 -0
- package/dist/components/input/input.component.d.ts +5 -0
- package/dist/components/input/input.component.js +5 -0
- package/dist/components/radio/radio.component.d.ts +3 -0
- package/dist/components/radio/radio.component.js +3 -0
- package/dist/components/tab/tab.component.d.ts +5 -0
- package/dist/components/tab/tab.component.js +5 -0
- package/dist/components/toggle/toggle.component.d.ts +3 -0
- package/dist/components/toggle/toggle.component.js +3 -0
- package/dist/components/virtualizedlist/virtualizedlist.component.d.ts +2 -0
- package/dist/components/virtualizedlist/virtualizedlist.component.js +2 -0
- package/dist/custom-elements.json +1052 -832
- package/dist/react/avatarbutton/index.d.ts +11 -1
- package/dist/react/avatarbutton/index.js +11 -1
- package/dist/react/button/index.d.ts +11 -1
- package/dist/react/button/index.js +11 -1
- package/dist/react/buttonsimple/index.d.ts +11 -1
- package/dist/react/buttonsimple/index.js +11 -1
- package/dist/react/checkbox/index.d.ts +8 -1
- package/dist/react/checkbox/index.js +8 -1
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/input/index.d.ts +12 -1
- package/dist/react/input/index.js +12 -1
- package/dist/react/radio/index.d.ts +8 -1
- package/dist/react/radio/index.js +8 -1
- package/dist/react/tab/index.d.ts +11 -1
- package/dist/react/tab/index.js +11 -1
- package/dist/react/toggle/index.d.ts +8 -1
- package/dist/react/toggle/index.js +8 -1
- package/dist/react/virtualizedlist/index.d.ts +5 -1
- package/dist/react/virtualizedlist/index.js +5 -1
- package/package.json +1 -1
package/dist/browser/index.js
CHANGED
@@ -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
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
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
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
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);
|