@momentum-design/components 0.133.2 → 0.133.4
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 +7 -6
- package/dist/browser/index.js.map +3 -3
- package/dist/components/dialog/dialog.component.d.ts +1 -0
- package/dist/components/dialog/dialog.component.js +1 -0
- package/dist/components/dialog/dialog.styles.js +2 -0
- package/dist/components/popover/popover.component.d.ts +1 -0
- package/dist/components/popover/popover.component.js +1 -0
- package/dist/components/popover/popover.styles.js +2 -0
- package/dist/components/themeprovider/themeprovider.component.d.ts +0 -1
- package/dist/components/themeprovider/themeprovider.component.js +0 -1
- package/dist/components/themeprovider/themeprovider.styles.js +0 -3
- package/dist/custom-elements.json +52 -8
- package/dist/react/dialog/index.d.ts +1 -0
- package/dist/react/dialog/index.js +1 -0
- package/dist/react/popover/index.d.ts +1 -0
- package/dist/react/popover/index.js +1 -0
- package/dist/react/themeprovider/index.d.ts +0 -1
- package/dist/react/themeprovider/index.js +0 -1
- package/dist/utils/mixins/BackdropMixin.js +5 -1
- package/package.json +1 -1
package/dist/browser/index.js
CHANGED
|
@@ -1068,17 +1068,17 @@
|
|
|
1068
1068
|
@slotchange=${()=>this.handleFooterSlot(Ae.BUTTON,Vt.PRIMARY)}
|
|
1069
1069
|
></slot>
|
|
1070
1070
|
</div>
|
|
1071
|
-
</slot>`}}return h([Yt({slot:"footer-link"})],i.prototype,"footerLink",2),h([Yt({slot:"footer-button-primary"})],i.prototype,"footerButtonPrimary",2),h([Yt({slot:"footer-button-secondary"})],i.prototype,"footerButtonSecondary",2),i};var Be=[],Kf=1e3,Ix=3,bh=-2,yh=-1,ao=class{constructor(i){this.host=i,i.addController(this)}hostConnected(){}hostDisconnected(){this.remove([this.host])}get length(){return Be.length}pushHost(){var i,t;return this.has(this.host)?!1:(Be.push(this.host),(t=(i=this.host).onComponentStackChanged)==null||t.call(i,"added"),!0)}popHost(){return this.popItem(this.host)}popItem(i){if(!this.has(i))return;let t=Be.filter(l=>l.stackGroupName===i.stackGroupName),e=t.indexOf(i),o=[];for(let l=t.length-1;l>=e;l-=1){let c=t[l];(c===i||c.triggerID!==i.triggerID)&&o.push(c)}return this.remove(o),i}pop(){var t;let i=Be.pop();return(t=i==null?void 0:i.onComponentStackChanged)==null||t.call(i,"removed"),i}popUntil(i){let t=[];for(let e=Be.length-1;e>=0;e-=1){let o=Be[e],l=i(o,e);if(l===!1)break;l!=="skip"&&t.push(o)}return this.remove(t)}peek(){return Be.at(-1)}remove(i){var o,l;let t=i.filter(c=>Be.includes(c)),e=t.reduce((c,f)=>Math.min(c,Be.indexOf(f)),1/0);t.forEach(c=>{Be.splice(Be.indexOf(c),1)}),t.forEach(c=>{var f;(f=c==null?void 0:c.onComponentStackChanged)==null||f.call(c,"removed")});for(let c=e;c<Be.length;c+=1)(l=(o=Be[c]).onComponentStackChanged)==null||l.call(o,"moved");return t}has(i){return Be.includes(i)}getHostDepth(){return this.getElementDepth(this.host)}getElementDepth(i){return Be.indexOf(i)}getHostZIndex(){return this.getItemZIndex(this.host)}getItemZIndex(i){let t=this.getElementDepth(i);return t>=0?Kf+t*Ix:Kf}isHostOnTop(){return this.peek()===this.host}clear(){this.popUntil(()=>!0)}};var ql=n=>{class i extends n{constructor(){super(...arguments);this.isBackdropInvisible=!1;this.backdropElement=null;this.triggerElementCache=null}update(o){var l;if(super.update(o),o.has("zIndex")&&this.backdropElement){this.backdropElement.style.zIndex=`${this.zIndex+bh}`;let c=(l=this.triggerElementCache)==null?void 0:l.deref();c&&(c.style.zIndex=`${this.zIndex+yh}`)}}createBackdrop(o){let l=document.createElement("div");l.classList.add(`${o}-backdrop`);let c=document.createElement("style");c.textContent=`
|
|
1071
|
+
</slot>`}}return h([Yt({slot:"footer-link"})],i.prototype,"footerLink",2),h([Yt({slot:"footer-button-primary"})],i.prototype,"footerButtonPrimary",2),h([Yt({slot:"footer-button-secondary"})],i.prototype,"footerButtonSecondary",2),i};var Be=[],Kf=1e3,Ix=3,bh=-2,yh=-1,ao=class{constructor(i){this.host=i,i.addController(this)}hostConnected(){}hostDisconnected(){this.remove([this.host])}get length(){return Be.length}pushHost(){var i,t;return this.has(this.host)?!1:(Be.push(this.host),(t=(i=this.host).onComponentStackChanged)==null||t.call(i,"added"),!0)}popHost(){return this.popItem(this.host)}popItem(i){if(!this.has(i))return;let t=Be.filter(l=>l.stackGroupName===i.stackGroupName),e=t.indexOf(i),o=[];for(let l=t.length-1;l>=e;l-=1){let c=t[l];(c===i||c.triggerID!==i.triggerID)&&o.push(c)}return this.remove(o),i}pop(){var t;let i=Be.pop();return(t=i==null?void 0:i.onComponentStackChanged)==null||t.call(i,"removed"),i}popUntil(i){let t=[];for(let e=Be.length-1;e>=0;e-=1){let o=Be[e],l=i(o,e);if(l===!1)break;l!=="skip"&&t.push(o)}return this.remove(t)}peek(){return Be.at(-1)}remove(i){var o,l;let t=i.filter(c=>Be.includes(c)),e=t.reduce((c,f)=>Math.min(c,Be.indexOf(f)),1/0);t.forEach(c=>{Be.splice(Be.indexOf(c),1)}),t.forEach(c=>{var f;(f=c==null?void 0:c.onComponentStackChanged)==null||f.call(c,"removed")});for(let c=e;c<Be.length;c+=1)(l=(o=Be[c]).onComponentStackChanged)==null||l.call(o,"moved");return t}has(i){return Be.includes(i)}getHostDepth(){return this.getElementDepth(this.host)}getElementDepth(i){return Be.indexOf(i)}getHostZIndex(){return this.getItemZIndex(this.host)}getItemZIndex(i){let t=this.getElementDepth(i);return t>=0?Kf+t*Ix:Kf}isHostOnTop(){return this.peek()===this.host}clear(){this.popUntil(()=>!0)}};var ql=n=>{class i extends n{constructor(){super(...arguments);this.isBackdropInvisible=!1;this.backdropElement=null;this.triggerElementCache=null}update(o){var l;if(super.update(o),o.has("zIndex")&&this.backdropElement){this.backdropElement.style.zIndex=`${this.zIndex+bh}`;let c=(l=this.triggerElementCache)==null?void 0:l.deref();c&&(c.style.zIndex=`${this.zIndex+yh}`)}}createBackdrop(o){let l=document.createElement("div");l.classList.add(`${o}-backdrop`);let c=document.createElement("style"),f=this.isBackdropInvisible?"transparent":getComputedStyle(this).getPropertyValue("--mdc-backdrop-mixin-background-color")||"var(--mds-color-theme-common-overlays-secondary-normal)";c.textContent=`
|
|
1072
1072
|
.${o}-backdrop {
|
|
1073
1073
|
position: fixed;
|
|
1074
1074
|
top: 0;
|
|
1075
1075
|
left: 0;
|
|
1076
1076
|
width: 100%;
|
|
1077
1077
|
height: 100%;
|
|
1078
|
-
background: ${
|
|
1078
|
+
background: ${f};
|
|
1079
1079
|
z-index: ${this.zIndex+bh};
|
|
1080
1080
|
}
|
|
1081
|
-
`,l.appendChild(c);let
|
|
1081
|
+
`,l.appendChild(c);let A=document.getElementById(this.backdropAppendTo)||this.parentElement;A==null||A.appendChild(l),this.backdropElement=l}removeBackdrop(){this.backdropElement&&(this.backdropElement.remove(),this.backdropElement=null)}keepElementAboveBackdrop(o){o&&(this.triggerElementCache=new WeakRef(o),this.elementOriginalStyle={zIndex:o.style.zIndex,position:o.style.position},o.style.zIndex=`${this.zIndex+yh}`,["fixed","absolute"].includes(window.getComputedStyle(o).position)||(o.style.position="relative"))}moveElementBackAfterBackdropRemoval(o){!o||!this.elementOriginalStyle||(o.style.zIndex=this.elementOriginalStyle.zIndex,o.style.position=this.elementOriginalStyle.position,this.elementOriginalStyle=void 0,this.triggerElementCache=null)}}return i};var Xl=z.constructTagName("responsivesettingsprovider"),Fr={FORCE_FULLSCREEN_DIALOG:!1,POPOVER_POSITIONING:"float",MEDIA:"unknown"},Wf=["float","dialog"],Yf=["unknown","mobile","desktop","tablet"];var Zl=class{constructor(i={}){this.media=Fr.MEDIA;this.forceFullscreenDialog=Fr.FORCE_FULLSCREEN_DIALOG;this.popoverPositioning=Fr.POPOVER_POSITIONING;Object.assign(this,i)}};Zl.context=Xl;var Ql=Zl;var Gs=class extends Te{constructor(){super({context:Ql.context,initialValue:new Ql({media:Fr.MEDIA,popoverPositioning:Fr.POPOVER_POSITIONING,forceFullscreenDialog:Fr.FORCE_FULLSCREEN_DIALOG})});this.forceFullscreenDialog=Fr.FORCE_FULLSCREEN_DIALOG;this.privatePopoverPositioning=Fr.POPOVER_POSITIONING;this.privateMedia=Fr.MEDIA}static get Context(){return Ql.context}set popoverPositioning(t){Wf.includes(t)&&(this.privatePopoverPositioning=t)}get popoverPositioning(){return this.privatePopoverPositioning}set media(t){Yf.includes(t)&&(this.privateMedia=t)}get media(){return this.privateMedia}updateContext(){var t,e,o;(((t=this.context.value)==null?void 0:t.media)!==this.privateMedia||((e=this.context.value)==null?void 0:e.popoverPositioning)!==this.privatePopoverPositioning||((o=this.context.value)==null?void 0:o.forceFullscreenDialog)!==this.forceFullscreenDialog)&&(this.context.value.media=this.media,this.context.value.popoverPositioning=this.popoverPositioning,this.context.value.forceFullscreenDialog=this.forceFullscreenDialog,this.context.updateObservers())}};h([u({type:Boolean,attribute:"force-fullscreen-dialog",reflect:!0})],Gs.prototype,"forceFullscreenDialog",2),h([u({type:String,attribute:"popover-positioning",reflect:!0})],Gs.prototype,"popoverPositioning",1),h([u({type:String,attribute:"media",reflect:!0})],Gs.prototype,"media",1);var Eh=Gs;Eh.register(Xl);var Th=Eh;var jf=z.constructTagName("dialog"),xh={DEFAULT:"default",PROMOTIONAL:"promotional"},Sr={VISIBLE:!1,Z_INDEX:1e3,ROLE:tt.DIALOG,SIZE:"small",HEADER_TAG_NAME:mt.H2,DESCRIPTION_TAG_NAME:mt.P,CANCEL_ICON:"cancel-bold",VARIANT:xh.DEFAULT,DISABLE_ARIA_HAS_POPUP:!1,FOCUS_TRAP:!0,HIDE_BACKDROP:!1};var r1=[tt.DIALOG,tt.ALERTDIALOG];var no=class{static dispatchDialogEvent(i,t,e=!0){t.dispatchEvent(new CustomEvent(i,{detail:{show:t.visible},composed:!0,bubbles:e}))}static onShowDialog(i){this.dispatchDialogEvent("shown",i)}static onHideDialog(i){this.dispatchDialogEvent("hidden",i)}static onCloseDialog(i,t=!0){this.dispatchDialogEvent("close",i,t)}static onCreatedDialog(i){this.dispatchDialogEvent("created",i)}static onDestroyedDialog(i){this.dispatchDialogEvent("destroyed",i)}};var _x=B`
|
|
1082
1082
|
:host {
|
|
1083
1083
|
--mdc-dialog-primary-background-color: var(--mds-color-theme-background-solid-primary-normal);
|
|
1084
1084
|
--mdc-dialog-border-color: var(--mds-color-theme-outline-secondary-normal);
|
|
@@ -1088,6 +1088,8 @@
|
|
|
1088
1088
|
--mdc-dialog-width: 27rem; /* Default to small */
|
|
1089
1089
|
--mdc-dialog-height: auto;
|
|
1090
1090
|
--mdc-dialog-padding: 1.5rem;
|
|
1091
|
+
--mdc-dialog-backdrop-color: var(--mds-color-theme-common-overlays-secondary-normal);
|
|
1092
|
+
--mdc-backdrop-mixin-background-color: var(--mdc-dialog-backdrop-color);
|
|
1091
1093
|
|
|
1092
1094
|
background-color: var(--mdc-dialog-primary-background-color);
|
|
1093
1095
|
border: 0.0625rem solid var(--mdc-dialog-border-color);
|
|
@@ -2597,6 +2599,8 @@
|
|
|
2597
2599
|
--mdc-popover-width: unset;
|
|
2598
2600
|
--mdc-popover-max-width: max-content;
|
|
2599
2601
|
--mdc-popover-max-height: auto;
|
|
2602
|
+
--mdc-popover-backdrop-color: var(--mds-color-theme-common-overlays-secondary-normal);
|
|
2603
|
+
--mdc-backdrop-mixin-background-color: var(--mdc-popover-backdrop-color);
|
|
2600
2604
|
|
|
2601
2605
|
display: none;
|
|
2602
2606
|
position: absolute;
|
|
@@ -7165,8 +7169,6 @@
|
|
|
7165
7169
|
--mdc-themeprovider-color-default: var(--mds-color-theme-text-primary-normal);
|
|
7166
7170
|
--mdc-themeprovider-font-family: var(--mds-font-family-primary);
|
|
7167
7171
|
--mdc-themeprovider-font-weight: 400;
|
|
7168
|
-
/* adjusting Inter's letter spacing to better match the old CiscoSans */
|
|
7169
|
-
--mdc-themeprovider-letter-spacing-adjustment: -0.25px;
|
|
7170
7172
|
/* Adjusting font feature settings for accessibility reasons */
|
|
7171
7173
|
--mdc-themeprovider-font-feature-settings: 'ss02' on;
|
|
7172
7174
|
|
|
@@ -7177,7 +7179,6 @@
|
|
|
7177
7179
|
color: var(--mdc-themeprovider-color-default);
|
|
7178
7180
|
font-family: var(--mdc-themeprovider-font-family);
|
|
7179
7181
|
font-weight: var(--mdc-themeprovider-font-weight);
|
|
7180
|
-
letter-spacing: var(--mdc-themeprovider-letter-spacing-adjustment);
|
|
7181
7182
|
|
|
7182
7183
|
font-feature-settings: var(--mdc-themeprovider-font-feature-settings);
|
|
7183
7184
|
}
|