@momentum-design/components 0.75.0 → 0.75.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.
- package/dist/browser/index.js +13 -1
- package/dist/browser/index.js.map +2 -2
- package/dist/components/animation/animation.component.js +4 -2
- package/dist/components/button/button.styles.js +12 -0
- package/dist/custom-elements.json +210 -210
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +2 -2
- package/package.json +1 -1
package/dist/browser/index.js
CHANGED
@@ -510,7 +510,7 @@
|
|
510
510
|
:host svg{
|
511
511
|
display: block;
|
512
512
|
}
|
513
|
-
`],zh=mv;var $h=j.constructTagName("animation"),Ba={NAME:void 0,AUTO_PLAY:!0,LOOP:"true"};var Sr=class extends Y{constructor(){super(...arguments);this.name=Ba.NAME;this.loop=Ba.LOOP;this.autoplay=Ba.AUTO_PLAY;this.ariaLabel=null;this.ariaLabelledBy=null;this.containerRef=za();this.onCompleteHandler=()=>{let e=new CustomEvent("complete",{detail:{name:this.name},bubbles:!0});this.dispatchEvent(e)}}get animation(){return this.lottieInstance}getLoopValue(){return this.loop==="true"?!0:this.loop==="false"?!1:this.loop?Number(this.loop):!0}onLoadSuccessHandler(e){this.lottieInstance&&(this.lottieInstance.removeEventListener("complete",this.onCompleteHandler),this.lottieInstance.destroy()),this.containerRef.value&&(this.lottieInstance=Vh.default.loadAnimation({container:this.containerRef.value,renderer:"svg",loop:this.getLoopValue(),autoplay:this.autoplay,animationData:e,name:this.name}),this.lottieInstance.addEventListener("complete",this.onCompleteHandler)),this.dispatchEvent(new CustomEvent("load",{bubbles:!0,cancelable:!0,detail:{name:this.name}}))}onLoadFailHandler(e){let s=new CustomEvent("error",{bubbles:!0,cancelable:!0,detail:{error:e}});this.dispatchEvent(s)}getAnimationData(){this.name&&Al[this.name]?import(`@momentum-design/animations/dist${Al[this.name].replace(
|
513
|
+
`],zh=mv;var $h=j.constructTagName("animation"),Ba={NAME:void 0,AUTO_PLAY:!0,LOOP:"true"};var Sr=class extends Y{constructor(){super(...arguments);this.name=Ba.NAME;this.loop=Ba.LOOP;this.autoplay=Ba.AUTO_PLAY;this.ariaLabel=null;this.ariaLabelledBy=null;this.containerRef=za();this.onCompleteHandler=()=>{let e=new CustomEvent("complete",{detail:{name:this.name},bubbles:!0});this.dispatchEvent(e)}}get animation(){return this.lottieInstance}getLoopValue(){return this.loop==="true"?!0:this.loop==="false"?!1:this.loop?Number(this.loop):!0}onLoadSuccessHandler(e){this.lottieInstance&&(this.lottieInstance.removeEventListener("complete",this.onCompleteHandler),this.lottieInstance.destroy()),this.containerRef.value&&(this.lottieInstance=Vh.default.loadAnimation({container:this.containerRef.value,renderer:"svg",loop:this.getLoopValue(),autoplay:this.autoplay,animationData:e,name:this.name}),this.lottieInstance.addEventListener("complete",this.onCompleteHandler)),this.dispatchEvent(new CustomEvent("load",{bubbles:!0,cancelable:!0,detail:{name:this.name}}))}onLoadFailHandler(e){let s=new CustomEvent("error",{bubbles:!0,cancelable:!0,detail:{error:e}});this.dispatchEvent(s)}getAnimationData(){this.name&&Al[this.name]?import(`@momentum-design/animations/dist/lottie${Al[this.name].replace(/^\.\/lottie/,"")}`).then(s=>this.onLoadSuccessHandler(s.default)).catch(s=>this.onLoadFailHandler(s)):this.onLoadFailHandler(new Error(`Invalid animation name: ${this.name}`))}updated(e){super.updated(e),(e.has("name")||e.has("loop")||e.has("autoplay"))&&this.getAnimationData(),(e.has("ariaLabel")||e.has("ariaLabelledBy"))&&(this.role=this.ariaLabel||this.ariaLabelledBy?"img":null)}render(){return D`<div aria-hidden="true" ${$a(this.containerRef)}></div>`}};Sr.styles=[...Y.styles,...zh],b([A({type:String,reflect:!0})],Sr.prototype,"name",2),b([A({type:String,reflect:!0})],Sr.prototype,"loop",2),b([A({type:Boolean,reflect:!0})],Sr.prototype,"autoplay",2),b([A({type:String,attribute:"aria-label"})],Sr.prototype,"ariaLabel",2),b([A({type:String,attribute:"aria-labelledby"})],Sr.prototype,"ariaLabelledBy",2);var _l=Sr;_l.register($h);var pv=_l;var uv=W`
|
514
514
|
:host {
|
515
515
|
--mdc-appheader-height: 4rem;
|
516
516
|
}
|
@@ -1202,6 +1202,18 @@
|
|
1202
1202
|
--mdc-button-primary-disabled-background-color: var(--mds-color-theme-inverted-button-primary-disabled);
|
1203
1203
|
--mdc-button-primary-disabled-color: var(--mds-color-theme-inverted-text-primary-disabled);
|
1204
1204
|
}
|
1205
|
+
|
1206
|
+
:host([data-btn-type='pill']) ::slotted(mdc-text),
|
1207
|
+
:host([data-btn-type='pill-with-icon']) ::slotted(mdc-text) {
|
1208
|
+
white-space: nowrap;
|
1209
|
+
overflow-x: hidden;
|
1210
|
+
text-overflow: ellipsis;
|
1211
|
+
}
|
1212
|
+
|
1213
|
+
:host::part(prefix-icon),
|
1214
|
+
:host::part(postfix-icon) {
|
1215
|
+
flex-shrink: 0;
|
1216
|
+
}
|
1205
1217
|
`,nm=[wv];var Is=l=>{let o=l.split("-"),e=["bold","filled","regular","light"];return o.filter(s=>!e.includes(s)).join("-")};var kr=class extends Wa(xe){constructor(){super(...arguments);this.size=_e.SIZE;this.inverted=_e.INVERTED;this.role="button"}update(e){super.update(e),e.has("active")&&this.inferFilledIconName(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.inferFilledIconName(this.active),this.inferButtonType())}inferFilledIconName(e){e?(this.prefixIcon&&(this.prefixFilledIconName=`${Is(this.prefixIcon)}-filled`),this.postfixIcon&&(this.postfixFilledIconName=`${Is(this.postfixIcon)}-filled`)):(this.prefixFilledIconName=this.prefixIcon,this.postfixFilledIconName=this.postfixIcon)}render(){return D`
|
1206
1218
|
${this.prefixFilledIconName?D` <mdc-icon name="${this.prefixFilledIconName}"
|
1207
1219
|
part="prefix-icon" length-unit="rem"></mdc-icon>`:""}
|