@momentum-design/components 0.17.1 → 0.17.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/browser/index.js +5 -1
- package/dist/browser/index.js.map +2 -2
- package/dist/components/buttonsimple/buttonsimple.component.js +2 -2
- package/dist/components/themeprovider/themeprovider.styles.js +4 -0
- package/dist/custom-elements.json +582 -582
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +1 -1
- package/package.json +1 -1
package/dist/browser/index.js
CHANGED
@@ -21,11 +21,15 @@
|
|
21
21
|
--mdc-themeprovider-font-weight: 400;
|
22
22
|
/* adjusting Inter's letter spacing to better match the old CiscoSans */
|
23
23
|
--mdc-themeprovider-letter-spacing-adjustment: -0.25px;
|
24
|
+
/* Adjusting font feature settings for accessibility reasons */
|
25
|
+
--mdc-themeprovider-font-feature-settings: "ss02" on;
|
24
26
|
|
25
27
|
color: var(--mdc-themeprovider-color-default);
|
26
28
|
font-family: var(--mdc-themeprovider-font-family);
|
27
29
|
font-weight: var(--mdc-themeprovider-font-weight);
|
28
30
|
letter-spacing: var(--mdc-themeprovider-letter-spacing-adjustment);
|
31
|
+
|
32
|
+
font-feature-settings: var(--mdc-themeprovider-font-feature-settings);
|
29
33
|
}
|
30
34
|
`,pr=[uo];var nt=class extends st{constructor(){super({context:Xt.context,initialValue:new Xt(me.THEMECLASS)});this.themeclass=me.THEMECLASS}static get Context(){return Xt.context}updated(t){super.updated(t),t.has("themeclass")&&(this.setThemeInClassList(),this.currentThemeClass=this.themeclass)}updateContext(){this.context.value.themeclass!==this.themeclass&&(this.context.value.themeclass=this.themeclass,this.context.updateObservers())}setThemeInClassList(){this.currentThemeClass&&this.classList.remove(...this.currentThemeClass.split(" ")),this.themeclass&&this.classList.add(...this.themeclass.split(" "))}};nt.styles=[...st.styles,...pr],a([S()],nt.prototype,"currentThemeClass",2),a([d({type:String})],nt.prototype,"themeclass",2);var Te=nt;Te.register(Gt);var go=Te;var E=m`
|
31
35
|
:host {
|
@@ -927,7 +931,7 @@
|
|
927
931
|
:host([size="20"]){
|
928
932
|
height: var(--mdc-button-height-size-20);
|
929
933
|
}
|
930
|
-
`,...at()],kr=Oo;var oe=i=>{class e extends i{constructor(){super(...arguments);this.disabled=!1}}return a([d({reflect:!0,type:Boolean})],e.prototype,"disabled",2),e};var $r=i=>{class e extends i{constructor(){super(...arguments);this.tabIndex=0}}return a([d({reflect:!0,type:Number})],e.prototype,"tabIndex",2),e};var O=class extends $r(oe(h)){constructor(){super();this.active=!1;this.softDisabled=!1;this.size=ee.SIZE;this.role=ee.ROLE;this.type=ee.TYPE;this.prevTabindex=0;this.addEventListener("click",this.executeAction.bind(this)),this.addEventListener("keydown",this.handleKeyDown.bind(this)),this.addEventListener("keyup",this.handleKeyUp.bind(this)),this.internals=this.attachInternals()}get form(){return this.internals.form}update(t){super.update(t),t.has("disabled")&&this.setDisabled(this,this.disabled),t.has("softDisabled")&&this.setSoftDisabled(this,this.softDisabled),t.has("active")&&this.setAriaPressed(this,this.active)}executeAction(){this.type===mt.SUBMIT&&this.internals.form&&this.internals.form.requestSubmit(),this.type===mt.RESET&&this.internals.form&&this.internals.form.reset()}setAriaPressed(t,r){r?t.setAttribute("aria-pressed","true"):t.
|
934
|
+
`,...at()],kr=Oo;var oe=i=>{class e extends i{constructor(){super(...arguments);this.disabled=!1}}return a([d({reflect:!0,type:Boolean})],e.prototype,"disabled",2),e};var $r=i=>{class e extends i{constructor(){super(...arguments);this.tabIndex=0}}return a([d({reflect:!0,type:Number})],e.prototype,"tabIndex",2),e};var O=class extends $r(oe(h)){constructor(){super();this.active=!1;this.softDisabled=!1;this.size=ee.SIZE;this.role=ee.ROLE;this.type=ee.TYPE;this.prevTabindex=0;this.addEventListener("click",this.executeAction.bind(this)),this.addEventListener("keydown",this.handleKeyDown.bind(this)),this.addEventListener("keyup",this.handleKeyUp.bind(this)),this.internals=this.attachInternals()}get form(){return this.internals.form}update(t){super.update(t),t.has("disabled")&&this.setDisabled(this,this.disabled),t.has("softDisabled")&&this.setSoftDisabled(this,this.softDisabled),t.has("active")&&this.setAriaPressed(this,this.active)}executeAction(){this.type===mt.SUBMIT&&this.internals.form&&this.internals.form.requestSubmit(),this.type===mt.RESET&&this.internals.form&&this.internals.form.reset()}setAriaPressed(t,r){r?t.setAttribute("aria-pressed","true"):t.removeAttribute("aria-pressed")}setSoftDisabled(t,r){r?t.setAttribute("aria-disabled","true"):t.removeAttribute("aria-disabled")}setDisabled(t,r){r?(t.setAttribute("aria-disabled","true"),this.prevTabindex=this.tabIndex,this.tabIndex=-1):(this.tabIndex=this.prevTabindex,t.removeAttribute("aria-disabled"))}triggerClickEvent(){let t=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});this.dispatchEvent(t),this.executeAction()}handleKeyDown(t){["Enter"," "].includes(t.key)&&(this.classList.add("pressed"),t.key==="Enter"&&this.triggerClickEvent())}handleKeyUp(t){["Enter"," "].includes(t.key)&&(this.classList.remove("pressed"),t.key===" "&&this.triggerClickEvent())}render(){return p`
|
931
935
|
<slot></slot>
|
932
936
|
`}};O.formAssociated=!0,O.styles=[...h.styles,...kr],a([d({type:Boolean})],O.prototype,"active",2),a([d({type:Boolean,attribute:"soft-disabled"})],O.prototype,"softDisabled",2),a([d({type:Number,reflect:!0})],O.prototype,"size",2),a([d({type:String,reflect:!0})],O.prototype,"role",2),a([d({reflect:!0})],O.prototype,"type",2);var zt=O;var R=class extends zt{constructor(){super(...arguments);this.variant=w.VARIANT;this.size=w.SIZE;this.color=w.COLOR;this.role="button";this.typeInternal=w.TYPE_INTERNAL;this.iconSize=1}update(t){super.update(t),t.has("active")&&this.modifyIconName(this.active),t.has("size")&&this.setSize(this.size),t.has("variant")&&(this.setVariant(this.variant),this.setSize(this.size)),t.has("color")&&this.setColor(this.color),t.has("typeInternal")&&this.setSize(this.size),(t.has("prefixIcon")||t.has("postfixIcon"))&&this.inferButtonType()}modifyIconName(t){t?(this.prefixIcon&&(this.prevPrefixIcon=this.prefixIcon,this.prefixIcon=`${we(this.prefixIcon)}-filled`),this.postfixIcon&&(this.prevPostfixIcon=this.postfixIcon,this.postfixIcon=`${we(this.postfixIcon)}-filled`)):(this.prevPrefixIcon&&(this.prefixIcon=this.prevPrefixIcon),this.prevPostfixIcon&&(this.postfixIcon=this.prevPostfixIcon))}setVariant(t){this.setAttribute("variant",Object.values(Nt).includes(t)?t:w.VARIANT)}setSize(t){let o=this.typeInternal===pt.ICON?Object.values(J).includes(t)&&!(t===J[20]&&this.variant!==Nt.TERTIARY):Object.values(re).includes(t);this.setAttribute("size",o?`${t}`:`${w.SIZE}`),this.iconSize=Mr(t)}setColor(t){!Object.values(Le).includes(t)||this.variant===Nt.TERTIARY?this.setAttribute("color",`${w.COLOR}`):this.setAttribute("color",t)}inferButtonType(){var r,o;let t=(o=(r=this.shadowRoot)==null?void 0:r.querySelector("slot"))==null?void 0:o.assignedNodes().length;t&&(this.prefixIcon||this.postfixIcon)?(this.typeInternal=pt.PILL_WITH_ICON,this.setAttribute("data-btn-type","pill-with-icon")):!t&&(this.prefixIcon||this.postfixIcon)?(this.typeInternal=pt.ICON,this.setAttribute("data-btn-type","icon")):(this.typeInternal=pt.PILL,this.setAttribute("data-btn-type","pill"))}render(){return p`
|
933
937
|
${this.prefixIcon?p`
|