@maggioli-design-system/mds-modal 1.0.1 → 1.2.0
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/cjs/{index-ced1b9b6.js → index-8c1a6a17.js} +29 -1
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/mds-modal.cjs.entry.js +10 -4
- package/dist/cjs/mds-modal.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/mds-modal/mds-modal.css +109 -42
- package/dist/collection/components/mds-modal/mds-modal.js +14 -5
- package/dist/collection/components/mds-modal/meta/dictionary.js +2 -0
- package/dist/collection/components/mds-modal/test/mds-modal.stories.js +5 -9
- package/dist/collection/dictionary/icon.js +1 -1
- package/dist/collection/dictionary/typography.js +7 -1
- package/dist/collection/dictionary/variant.js +1 -0
- package/dist/{custom-elements → components}/index.d.ts +1 -20
- package/dist/components/index.js +1 -0
- package/dist/components/mds-modal.d.ts +11 -0
- package/dist/components/mds-modal.js +149 -0
- package/dist/esm/{index-7d5b7d79.js → index-8333247b.js} +29 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mds-modal.entry.js +10 -4
- package/dist/esm/mds-modal.js +3 -3
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm-es5/index-8333247b.js +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mds-modal.entry.js +1 -1
- package/dist/esm-es5/mds-modal.js +1 -1
- package/dist/mds-modal/mds-modal.esm.js +1 -1
- package/dist/mds-modal/mds-modal.js +1 -1
- package/dist/mds-modal/p-04873afb.system.js +1 -0
- package/dist/mds-modal/p-61a8f75c.system.entry.js +1 -0
- package/dist/mds-modal/p-642b8178.system.js +1 -0
- package/dist/mds-modal/p-9f22b0ed.entry.js +1 -0
- package/dist/mds-modal/p-ab19f930.js +1 -0
- package/dist/stats.json +55 -43
- package/dist/types/components/mds-modal/meta/types.d.ts +1 -1
- package/dist/types/dictionary/typography.d.ts +2 -1
- package/dist/types/stencil-public-runtime.d.ts +6 -4
- package/dist/types/types/typography.d.ts +3 -2
- package/dist/types/types/variant.d.ts +1 -1
- package/package.json +7 -6
- package/readme.md +4 -4
- package/src/components/mds-modal/css/mds-modal-animate-bottom.css +28 -0
- package/src/components/mds-modal/css/mds-modal-animate-top.css +28 -0
- package/src/components/mds-modal/mds-modal.css +30 -7
- package/src/components/mds-modal/mds-modal.tsx +11 -5
- package/src/components/mds-modal/meta/dictionary.ts +2 -0
- package/src/components/mds-modal/meta/types.ts +2 -0
- package/src/components/mds-modal/readme.md +4 -4
- package/src/components/mds-modal/test/mds-modal.stories.js +5 -9
- package/src/components/mds-modal/test/mds-modal.stories.mdx +14 -0
- package/src/dictionary/icon.ts +1 -1
- package/src/dictionary/typography.ts +8 -0
- package/src/dictionary/variant.ts +1 -0
- package/src/types/typography.ts +6 -0
- package/src/types/variant.ts +2 -1
- package/www/build/mds-modal.esm.js +1 -1
- package/www/build/mds-modal.js +1 -1
- package/www/build/p-04873afb.system.js +1 -0
- package/www/build/p-61a8f75c.system.entry.js +1 -0
- package/www/build/p-642b8178.system.js +1 -0
- package/www/build/p-9f22b0ed.entry.js +1 -0
- package/www/build/p-ab19f930.js +1 -0
- package/dist/custom-elements/index.js +0 -136
- package/dist/esm-es5/index-7d5b7d79.js +0 -1
- package/dist/mds-modal/p-0fa95990.system.js +0 -1
- package/dist/mds-modal/p-818ca69a.js +0 -1
- package/dist/mds-modal/p-c8003e96.system.js +0 -1
- package/dist/mds-modal/p-d10799a8.entry.js +0 -1
- package/dist/mds-modal/p-fda9967b.system.entry.js +0 -1
- package/dist/types/components/mds-modal/mds-modal.d.ts +0 -31
- package/www/build/p-0fa95990.system.js +0 -1
- package/www/build/p-818ca69a.js +0 -1
- package/www/build/p-c8003e96.system.js +0 -1
- package/www/build/p-d10799a8.entry.js +0 -1
- package/www/build/p-fda9967b.system.entry.js +0 -1
|
@@ -50,7 +50,7 @@ const supportsConstructibleStylesheets = /*@__PURE__*/ (() => {
|
|
|
50
50
|
const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
51
51
|
if (listeners) {
|
|
52
52
|
listeners.map(([flags, name, method]) => {
|
|
53
|
-
const target = elm;
|
|
53
|
+
const target = getHostListenerTarget(elm, flags) ;
|
|
54
54
|
const handler = hostListenerProxy(hostRef, method);
|
|
55
55
|
const opts = hostListenerOpts(flags);
|
|
56
56
|
plt.ael(target, name, handler, opts);
|
|
@@ -74,6 +74,11 @@ const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
74
74
|
consoleError(e);
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
|
+
const getHostListenerTarget = (elm, flags) => {
|
|
78
|
+
if (flags & 4 /* TargetDocument */)
|
|
79
|
+
return doc;
|
|
80
|
+
return elm;
|
|
81
|
+
};
|
|
77
82
|
// prettier-ignore
|
|
78
83
|
const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
|
|
79
84
|
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
@@ -754,6 +759,29 @@ const then = (promise, thenFn) => {
|
|
|
754
759
|
};
|
|
755
760
|
const addHydratedFlag = (elm) => elm.classList.add('hydrated')
|
|
756
761
|
;
|
|
762
|
+
/**
|
|
763
|
+
* Parse a new property value for a given property type.
|
|
764
|
+
*
|
|
765
|
+
* While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
|
|
766
|
+
* it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
|
|
767
|
+
* 1. `any`, the type given to `propValue` in the function signature
|
|
768
|
+
* 2. the type stored from `propType`.
|
|
769
|
+
*
|
|
770
|
+
* This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
|
|
771
|
+
*
|
|
772
|
+
* Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
|
|
773
|
+
* a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
|
|
774
|
+
* based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
|
|
775
|
+
* ```tsx
|
|
776
|
+
* <my-cmp prop-val={0}></my-cmp>
|
|
777
|
+
* ```
|
|
778
|
+
*
|
|
779
|
+
* HTML prop values on the other hand, will always a string
|
|
780
|
+
*
|
|
781
|
+
* @param propValue the new value to coerce to some type
|
|
782
|
+
* @param propType the type of the prop, expressed as a binary number
|
|
783
|
+
* @returns the parsed/coerced value
|
|
784
|
+
*/
|
|
757
785
|
const parsePropertyValue = (propValue, propType) => {
|
|
758
786
|
// ensure this value is of the correct prop type
|
|
759
787
|
if (propValue != null && !isComplexType(propValue)) {
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-8c1a6a17.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
|
-
Stencil Client Patch Esm v2.
|
|
8
|
+
Stencil Client Patch Esm v2.14.0 | MIT Licensed | https://stenciljs.com
|
|
9
9
|
*/
|
|
10
10
|
const patchEsm = () => {
|
|
11
11
|
return index.promiseResolve();
|
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["mds-modal.cjs",[[1,"mds-modal",{"opened":[1540],"position":[1537]},[[
|
|
17
|
+
return index.bootstrapLazy([["mds-modal.cjs",[[1,"mds-modal",{"opened":[1540],"position":[1537],"stateOpened":[32]},[[4,"close","onCloseListener"]]]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-8c1a6a17.js');
|
|
6
6
|
|
|
7
7
|
function toVal(mix) {
|
|
8
8
|
var k, y, str='';
|
|
@@ -45,7 +45,7 @@ function clsx () {
|
|
|
45
45
|
return str;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
const mdsModalCss = ".animate-left,.animate-right{opacity:0;-webkit-transition-property:background-color, border-color, color, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-duration:150ms;transition-duration:150ms;-webkit-transition-duration:500ms;transition-duration:500ms;-webkit-transition-timing-function:cubic-bezier(1, 0, 0, 1);transition-timing-function:cubic-bezier(1, 0, 0, 1)}.animate-right-intro,.animate-right-outro{-webkit-transform:translateX(calc(100% + 50px));transform:translateX(calc(100% + 50px))}.border{border-width:1px}.shadow{--tw-shadow:0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host{pointer-events:none;position:fixed;top:0px;right:0px;bottom:0px;left:0px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;--tw-bg-opacity:1;background-color:rgba(var(--adjust-tone-01), var(--tw-bg-opacity));--tw-bg-opacity:0;-webkit-transition-duration:700ms;transition-duration:700ms;-webkit-transition-timing-function:cubic-bezier(1, 0, 0, 1);transition-timing-function:cubic-bezier(1, 0, 0, 1);-webkit-perspective:600px;perspective:600px}:host(.animate-center-opened),:host(.animate-left-opened),:host(.animate-right-opened){pointer-events:auto;--tw-bg-opacity:0.5;-webkit-transition-duration:500ms;transition-duration:500ms}.close{position:absolute;top:0px;height:2.25rem;width:2.25rem;-webkit-transform-origin:center;transform-origin:center;cursor:pointer;font-size:2.25rem;line-height:2.5rem;--tw-text-opacity:1;color:rgba(var(--adjust-tone-10), var(--tw-text-opacity));opacity:0;-webkit-transition-property:background-color, border-color, color, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-duration:150ms;transition-duration:150ms;-webkit-transition-duration:500ms;transition-duration:500ms;-webkit-transition-timing-function:cubic-bezier(0.77, 0, 0.175, 1);transition-timing-function:cubic-bezier(0.77, 0, 0.175, 1);text-shadow:0px 0px 1px rgb(0 0 0 / 20%), 0px 0px 1px rgb(1 0 5 / 10%);-webkit-transform:translate(0, 24px) rotate(90deg);transform:translate(0, 24px) rotate(90deg)}.window{display:grid;height:100%;gap:0px;overflow:auto;background-color:var(--window-background, rgb(var(--adjust-tone)));-webkit-box-shadow:var(--window-shadow, 0 25px 50px -12px rgba(0, 0, 0, 0.25));box-shadow:var(--window-shadow, 0 25px 50px -12px rgba(0, 0, 0, 0.25));grid-template-rows:1fr;max-width:calc(100vw - 80px)}.window--top{grid-template-rows:auto 1fr}.window--bottom{grid-template-rows:1fr auto}.window--top-bottom{grid-template-rows:auto 1fr auto}:host(.animate-center){-ms-flex-pack:center;justify-content:center;padding:2rem}@media (max-width: 767px){:host(.animate-center){padding:1rem}}:host(.animate-center) .window,:host(.animate-center)>::slotted([slot=window]){opacity:0;-webkit-transition-property:background-color, border-color, color, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-duration:150ms;transition-duration:150ms;-webkit-transition-duration:500ms;transition-duration:500ms;-webkit-transition-timing-function:cubic-bezier(1, 0, 0, 1);transition-timing-function:cubic-bezier(1, 0, 0, 1)}:host(.animate-center-intro) .window,:host(.animate-center-intro)>::slotted([slot=window]){-webkit-transform:rotateX(-22deg) scale(0.5) translateY(40%);transform:rotateX(-22deg) scale(0.5) translateY(40%)}:host(.animate-center-opened.animate-center-outro) .window,:host(.animate-center-opened.animate-center-outro)>::slotted([slot=window]),:host(.animate-center-opened) .window,:host(.animate-center-opened)>::slotted([slot=window]){-webkit-transform:rotateX(0) scale(1) translateY(0);transform:rotateX(0) scale(1) translateY(0);opacity:1}:host(.animate-center-outro) .window,:host(.animate-center-outro)>::slotted([slot=window]){-webkit-transform:rotateX(-22deg) scale(0.5) translateY(-40%);transform:rotateX(-22deg) scale(0.5) translateY(-40%)}:host(.animate-right){-ms-flex-pack:end;justify-content:flex-end}:host(.animate-right) .window,:host(.animate-right)>::slotted([slot=window]){opacity:0;-webkit-transition-property:background-color, border-color, color, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-duration:150ms;transition-duration:150ms;-webkit-transition-duration:500ms;transition-duration:500ms;-webkit-transition-timing-function:cubic-bezier(1, 0, 0, 1);transition-timing-function:cubic-bezier(1, 0, 0, 1)}:host(.animate-right-intro) .window,:host(.animate-right-intro)>::slotted([slot=window]){-webkit-transform:translateX(calc(100% + 50px));transform:translateX(calc(100% + 50px))}:host(.animate-right-opened.animate-right-outro) .window,:host(.animate-right-opened.animate-right-outro)>::slotted([slot=window]),:host(.animate-right-opened) .window,:host(.animate-right-opened)>::slotted([slot=window]){-webkit-transform:translateX(0);transform:translateX(0);opacity:1}:host(.animate-right-opened) .close,:host(.animate-right-opened.animate-right-outro) .close{opacity:1;-webkit-transform:translate(24px, 24px) rotate(0);transform:translate(24px, 24px) rotate(0)}:host(.animate-right-outro) .window,:host(.animate-right-outro)>::slotted([slot=window]){-webkit-transform:translateX(calc(100% + 50px));transform:translateX(calc(100% + 50px))}:host(.animate-right-outro) .close{-webkit-transform:translate(-24px, 24px) rotate(90deg);transform:translate(-24px, 24px) rotate(90deg)}:host(.animate-right) .close{left:0px;-webkit-transform:translate(-36px, 24px) rotate(-90deg);transform:translate(-36px, 24px) rotate(-90deg)}:host(.animate-left){-ms-flex-pack:start;justify-content:flex-start}:host(.animate-left) .window,:host(.animate-left)>::slotted([slot=window]){opacity:0;-webkit-transition-property:background-color, border-color, color, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-duration:150ms;transition-duration:150ms;-webkit-transition-duration:500ms;transition-duration:500ms;-webkit-transition-timing-function:cubic-bezier(1, 0, 0, 1);transition-timing-function:cubic-bezier(1, 0, 0, 1)}:host(.animate-left-intro) .window,:host(.animate-left-intro)>::slotted([slot=window]){-webkit-transform:translateX(calc(-100% - 50px));transform:translateX(calc(-100% - 50px))}:host(.animate-left-opened.animate-left-outro) .window,:host(.animate-left-opened.animate-left-outro)>::slotted([slot=window]),:host(.animate-left-opened) .window,:host(.animate-left-opened)>::slotted([slot=window]){-webkit-transform:translateX(0);transform:translateX(0);opacity:1}:host(.animate-left-opened) .close,:host(.animate-left-opened.animate-left-outro) .close{opacity:1;-webkit-transform:translate(-24px, 24px) rotate(0);transform:translate(-24px, 24px) rotate(0)}:host(.animate-left-outro) .window,:host(.animate-left-outro)>::slotted([slot=window]){-webkit-transform:translateX(calc(-100% - 50px));transform:translateX(calc(-100% - 50px))}:host(.animate-left-outro) .close{-webkit-transform:translate(24px, 24px) rotate(-90deg);transform:translate(24px, 24px) rotate(-90deg)}:host(.animate-left) .close{right:0px;-webkit-transform:translate(36px, 24px) rotate(90deg);transform:translate(36px, 24px) rotate(90deg)}";
|
|
48
|
+
const mdsModalCss = ".animate-left,.animate-right{opacity:0;-webkit-transition-property:background-color, border-color, color, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-duration:500ms;transition-duration:500ms;-webkit-transition-timing-function:cubic-bezier(1, 0, 0, 1);transition-timing-function:cubic-bezier(1, 0, 0, 1)}.animate-right-intro,.animate-right-outro{-webkit-transform:translateX(calc(100% + 50px));transform:translateX(calc(100% + 50px))}.border{border-width:1px}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);-webkit-box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host{pointer-events:none;position:fixed;top:0px;right:0px;bottom:0px;left:0px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background-color:rgba(var(--adjust-tone-01), var(--tw-bg-opacity));--tw-bg-opacity:0;-webkit-transition-duration:700ms;transition-duration:700ms;-webkit-transition-timing-function:cubic-bezier(1, 0, 0, 1);transition-timing-function:cubic-bezier(1, 0, 0, 1);-webkit-perspective:600px;perspective:600px}:host([position=top]){-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:center;justify-content:center}:host([position=bottom]){-ms-flex-align:end;align-items:flex-end;-ms-flex-pack:center;justify-content:center}:host(.animate-bottom-opened),:host(.animate-center-opened),:host(.animate-left-opened),:host(.animate-right-opened),:host(.animate-top-opened){pointer-events:auto;--tw-bg-opacity:0.5;-webkit-transition-duration:500ms;transition-duration:500ms}.close{position:absolute;top:0px;height:2.25rem;width:2.25rem;-webkit-transform-origin:center;transform-origin:center;cursor:pointer;font-size:2.25rem;line-height:2.5rem;--tw-text-opacity:1;color:rgba(var(--adjust-tone-10), var(--tw-text-opacity));opacity:0;-webkit-transition-property:background-color, border-color, color, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-duration:500ms;transition-duration:500ms;-webkit-transition-timing-function:cubic-bezier(0.77, 0, 0.175, 1);transition-timing-function:cubic-bezier(0.77, 0, 0.175, 1);-webkit-transform:translate(0, 24px) rotate(90deg);transform:translate(0, 24px) rotate(90deg)}.window{display:grid;height:100%;gap:0px;overflow:auto;background-color:var(--window-background, rgb(var(--adjust-tone)));-webkit-box-shadow:var(--window-shadow, 0 25px 50px -12px rgb(0 0 0 / 0.25));box-shadow:var(--window-shadow, 0 25px 50px -12px rgb(0 0 0 / 0.25));grid-template-rows:1fr;max-width:calc(100vw - 80px)}.window--top{grid-template-rows:auto 1fr}.window--bottom{grid-template-rows:1fr auto}.window--top-bottom{grid-template-rows:auto 1fr auto}:host(.animate-bottom){-ms-flex-pack:center;justify-content:center;padding:2rem}@media (max-width: 767px){:host(.animate-bottom){padding:1rem}}:host(.animate-bottom) .window,:host(.animate-bottom)>::slotted([slot=window]){opacity:0;-webkit-transition-property:background-color, border-color, color, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-duration:500ms;transition-duration:500ms;-webkit-transition-timing-function:cubic-bezier(1, 0, 0, 1);transition-timing-function:cubic-bezier(1, 0, 0, 1)}:host(.animate-bottom-intro) .window,:host(.animate-bottom-intro)>::slotted([slot=window]){-webkit-transform:rotateX(-22deg) scale(0.5) translateY(40%);transform:rotateX(-22deg) scale(0.5) translateY(40%)}:host(.animate-bottom-opened.animate-bottom-outro) .window,:host(.animate-bottom-opened.animate-bottom-outro)>::slotted([slot=window]),:host(.animate-bottom-opened) .window,:host(.animate-bottom-opened)>::slotted([slot=window]){opacity:1;-webkit-transform:rotateX(0) scale(1) translateY(0);transform:rotateX(0) scale(1) translateY(0)}:host(.animate-bottom-outro) .window,:host(.animate-bottom-outro)>::slotted([slot=window]){-webkit-transform:rotateX(-22deg) scale(0.5) translateY(-40%);transform:rotateX(-22deg) scale(0.5) translateY(-40%)}:host(.animate-center){-ms-flex-pack:center;justify-content:center;padding:2rem}@media (max-width: 767px){:host(.animate-center){padding:1rem}}:host(.animate-center) .window,:host(.animate-center)>::slotted([slot=window]){opacity:0;-webkit-transition-property:background-color, border-color, color, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-duration:500ms;transition-duration:500ms;-webkit-transition-timing-function:cubic-bezier(1, 0, 0, 1);transition-timing-function:cubic-bezier(1, 0, 0, 1)}:host(.animate-center-intro) .window,:host(.animate-center-intro)>::slotted([slot=window]){-webkit-transform:rotateX(-22deg) scale(0.5) translateY(40%);transform:rotateX(-22deg) scale(0.5) translateY(40%)}:host(.animate-center-opened.animate-center-outro) .window,:host(.animate-center-opened.animate-center-outro)>::slotted([slot=window]),:host(.animate-center-opened) .window,:host(.animate-center-opened)>::slotted([slot=window]){opacity:1;-webkit-transform:rotateX(0) scale(1) translateY(0);transform:rotateX(0) scale(1) translateY(0)}:host(.animate-center-outro) .window,:host(.animate-center-outro)>::slotted([slot=window]){-webkit-transform:rotateX(-22deg) scale(0.5) translateY(-40%);transform:rotateX(-22deg) scale(0.5) translateY(-40%)}:host(.animate-left){-ms-flex-pack:start;justify-content:flex-start}:host(.animate-left) .window,:host(.animate-left)>::slotted([slot=window]){opacity:0;-webkit-transition-property:background-color, border-color, color, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-duration:500ms;transition-duration:500ms;-webkit-transition-timing-function:cubic-bezier(1, 0, 0, 1);transition-timing-function:cubic-bezier(1, 0, 0, 1)}:host(.animate-left-intro) .window,:host(.animate-left-intro)>::slotted([slot=window]){-webkit-transform:translateX(calc(-100% - 50px));transform:translateX(calc(-100% - 50px))}:host(.animate-left-opened.animate-left-outro) .window,:host(.animate-left-opened.animate-left-outro)>::slotted([slot=window]),:host(.animate-left-opened) .window,:host(.animate-left-opened)>::slotted([slot=window]){opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}:host(.animate-left-opened) .close,:host(.animate-left-opened.animate-left-outro) .close{opacity:1;-webkit-transform:translate(-24px, 24px) rotate(0);transform:translate(-24px, 24px) rotate(0)}:host(.animate-left-outro) .window,:host(.animate-left-outro)>::slotted([slot=window]){-webkit-transform:translateX(calc(-100% - 50px));transform:translateX(calc(-100% - 50px))}:host(.animate-left-outro) .close{-webkit-transform:translate(24px, 24px) rotate(-90deg);transform:translate(24px, 24px) rotate(-90deg)}:host(.animate-left) .close{right:0px;-webkit-transform:translate(36px, 24px) rotate(90deg);transform:translate(36px, 24px) rotate(90deg)}:host(.animate-right){-ms-flex-pack:end;justify-content:flex-end}:host(.animate-right) .window,:host(.animate-right)>::slotted([slot=window]){opacity:0;-webkit-transition-property:background-color, border-color, color, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-duration:500ms;transition-duration:500ms;-webkit-transition-timing-function:cubic-bezier(1, 0, 0, 1);transition-timing-function:cubic-bezier(1, 0, 0, 1)}:host(.animate-right-intro) .window,:host(.animate-right-intro)>::slotted([slot=window]){-webkit-transform:translateX(calc(100% + 50px));transform:translateX(calc(100% + 50px))}:host(.animate-right-opened.animate-right-outro) .window,:host(.animate-right-opened.animate-right-outro)>::slotted([slot=window]),:host(.animate-right-opened) .window,:host(.animate-right-opened)>::slotted([slot=window]){opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}:host(.animate-right-opened) .close,:host(.animate-right-opened.animate-right-outro) .close{opacity:1;-webkit-transform:translate(24px, 24px) rotate(0);transform:translate(24px, 24px) rotate(0)}:host(.animate-right-outro) .window,:host(.animate-right-outro)>::slotted([slot=window]){-webkit-transform:translateX(calc(100% + 50px));transform:translateX(calc(100% + 50px))}:host(.animate-right-outro) .close{-webkit-transform:translate(-24px, 24px) rotate(90deg);transform:translate(-24px, 24px) rotate(90deg)}:host(.animate-right) .close{left:0px;-webkit-transform:translate(-36px, 24px) rotate(-90deg);transform:translate(-36px, 24px) rotate(-90deg)}:host(.animate-top){-ms-flex-pack:center;justify-content:center;padding:2rem}@media (max-width: 767px){:host(.animate-top){padding:1rem}}:host(.animate-top) .window,:host(.animate-top)>::slotted([slot=window]){opacity:0;-webkit-transition-property:background-color, border-color, color, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-duration:500ms;transition-duration:500ms;-webkit-transition-timing-function:cubic-bezier(1, 0, 0, 1);transition-timing-function:cubic-bezier(1, 0, 0, 1)}:host(.animate-top-intro) .window,:host(.animate-top-intro)>::slotted([slot=window]){-webkit-transform:rotateX(-22deg) scale(0.5) translateY(40%);transform:rotateX(-22deg) scale(0.5) translateY(40%)}:host(.animate-top-opened.animate-top-outro) .window,:host(.animate-top-opened.animate-top-outro)>::slotted([slot=window]),:host(.animate-top-opened) .window,:host(.animate-top-opened)>::slotted([slot=window]){opacity:1;-webkit-transform:rotateX(0) scale(1) translateY(0);transform:rotateX(0) scale(1) translateY(0)}:host(.animate-top-outro) .window,:host(.animate-top-outro)>::slotted([slot=window]){-webkit-transform:rotateX(-22deg) scale(0.5) translateY(-40%);transform:rotateX(-22deg) scale(0.5) translateY(-40%)}";
|
|
49
49
|
|
|
50
50
|
let MdsModal = class {
|
|
51
51
|
constructor(hostRef) {
|
|
@@ -63,6 +63,10 @@ let MdsModal = class {
|
|
|
63
63
|
return `animate-${customPosition !== null ? customPosition : this.position}${customState !== null ? '-' + customState : ''}`;
|
|
64
64
|
};
|
|
65
65
|
this.closeModal = (e = null) => {
|
|
66
|
+
var _a;
|
|
67
|
+
if (((_a = e.target) === null || _a === void 0 ? void 0 : _a.localName) !== 'mds-modal') {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
66
70
|
this.opened = e.target !== e.currentTarget;
|
|
67
71
|
if (!this.opened) {
|
|
68
72
|
this.close.emit();
|
|
@@ -73,6 +77,7 @@ let MdsModal = class {
|
|
|
73
77
|
this.bottom = this.hostElement.querySelector('[slot="bottom"]') !== null;
|
|
74
78
|
this.top = this.hostElement.querySelector('[slot="top"]') !== null;
|
|
75
79
|
this.window = this.hostElement.querySelector('[slot="window"]') !== null;
|
|
80
|
+
this.stateOpened = this.opened;
|
|
76
81
|
if (this.window && this.position === null) {
|
|
77
82
|
this.position = 'center';
|
|
78
83
|
}
|
|
@@ -98,14 +103,15 @@ let MdsModal = class {
|
|
|
98
103
|
this.hostElement.classList.remove(this.animationName('intro', oldValue));
|
|
99
104
|
this.hostElement.classList.remove(this.animationName('outro', oldValue));
|
|
100
105
|
}
|
|
101
|
-
openedChange() {
|
|
106
|
+
openedChange(newValue) {
|
|
107
|
+
this.stateOpened = newValue;
|
|
102
108
|
window.clearTimeout(this.animationDeelay);
|
|
103
109
|
}
|
|
104
110
|
onCloseListener() {
|
|
105
111
|
this.opened = false;
|
|
106
112
|
}
|
|
107
113
|
render() {
|
|
108
|
-
return (index.h(index.Host, { class: clsx(this.
|
|
114
|
+
return (index.h(index.Host, { class: clsx(this.stateOpened && this.animationName('opened')), onClick: (e) => { this.closeModal(e); } }, this.window
|
|
109
115
|
?
|
|
110
116
|
index.h("slot", { name: "window" })
|
|
111
117
|
:
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
3
|
+
const index = require('./index-8c1a6a17.js');
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
|
-
Stencil Client Patch Browser v2.
|
|
6
|
+
Stencil Client Patch Browser v2.14.0 | MIT Licensed | https://stenciljs.com
|
|
7
7
|
*/
|
|
8
8
|
const patchBrowser = () => {
|
|
9
9
|
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('mds-modal.cjs.js', document.baseURI).href));
|
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["mds-modal.cjs",[[1,"mds-modal",{"opened":[1540],"position":[1537]},[[
|
|
18
|
+
return index.bootstrapLazy([["mds-modal.cjs",[[1,"mds-modal",{"opened":[1540],"position":[1537],"stateOpened":[32]},[[4,"close","onCloseListener"]]]]]], options);
|
|
19
19
|
});
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
.animate-left, .animate-right {
|
|
4
4
|
opacity: 0;
|
|
5
5
|
transition-property: background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width;
|
|
6
|
-
transition-duration: 150ms;
|
|
7
6
|
transition-duration: 500ms;
|
|
8
7
|
transition-timing-function: cubic-bezier(1, 0, 0, 1);
|
|
9
8
|
}
|
|
@@ -16,7 +15,8 @@
|
|
|
16
15
|
border-width: 1px;
|
|
17
16
|
}
|
|
18
17
|
.shadow {
|
|
19
|
-
--tw-shadow: 0 1px 3px 0
|
|
18
|
+
--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
|
|
19
|
+
--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
|
|
20
20
|
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -30,7 +30,6 @@
|
|
|
30
30
|
display: flex;
|
|
31
31
|
align-items: center;
|
|
32
32
|
justify-content: center;
|
|
33
|
-
--tw-bg-opacity: 1;
|
|
34
33
|
background-color: rgba(var(--adjust-tone-01), var(--tw-bg-opacity));
|
|
35
34
|
--tw-bg-opacity: 0;
|
|
36
35
|
transition-duration: 700ms;
|
|
@@ -39,7 +38,17 @@
|
|
|
39
38
|
perspective: 600px;
|
|
40
39
|
}
|
|
41
40
|
|
|
42
|
-
:host (
|
|
41
|
+
:host ( [position=top] ) {
|
|
42
|
+
align-items: flex-start;
|
|
43
|
+
justify-content: center;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
:host ( [position=bottom] ) {
|
|
47
|
+
align-items: flex-end;
|
|
48
|
+
justify-content: center;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
:host ( .animate-bottom-opened ), :host ( .animate-center-opened ), :host ( .animate-left-opened ), :host ( .animate-right-opened ), :host ( .animate-top-opened ) {
|
|
43
52
|
pointer-events: auto;
|
|
44
53
|
--tw-bg-opacity: 0.5;
|
|
45
54
|
transition-duration: 500ms;
|
|
@@ -58,10 +67,8 @@
|
|
|
58
67
|
color: rgba(var(--adjust-tone-10), var(--tw-text-opacity));
|
|
59
68
|
opacity: 0;
|
|
60
69
|
transition-property: background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width;
|
|
61
|
-
transition-duration: 150ms;
|
|
62
70
|
transition-duration: 500ms;
|
|
63
71
|
transition-timing-function: cubic-bezier(0.77, 0, 0.175, 1);
|
|
64
|
-
text-shadow: 0px 0px 1px rgb(0 0 0 / 20%), 0px 0px 1px rgb(1 0 5 / 10%);
|
|
65
72
|
|
|
66
73
|
transform: translate(0, 24px) rotate(90deg);
|
|
67
74
|
}
|
|
@@ -73,7 +80,7 @@
|
|
|
73
80
|
overflow: auto;
|
|
74
81
|
|
|
75
82
|
background-color: var(--window-background, rgb(var(--adjust-tone)));
|
|
76
|
-
box-shadow: var(--window-shadow, 0 25px 50px -12px
|
|
83
|
+
box-shadow: var(--window-shadow, 0 25px 50px -12px rgb(0 0 0 / 0.25));
|
|
77
84
|
grid-template-rows: 1fr;
|
|
78
85
|
|
|
79
86
|
/* grid-template-rows: var(--grid-template-rows, auto 1fr auto); */
|
|
@@ -92,6 +99,39 @@
|
|
|
92
99
|
grid-template-rows: auto 1fr auto;
|
|
93
100
|
}
|
|
94
101
|
|
|
102
|
+
:host ( .animate-bottom ) {
|
|
103
|
+
justify-content: center;
|
|
104
|
+
padding: 2rem;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
@media (max-width: 767px) {
|
|
108
|
+
|
|
109
|
+
:host ( .animate-bottom ) {
|
|
110
|
+
padding: 1rem;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
:host ( .animate-bottom ) .window, :host ( .animate-bottom ) > ::slotted ( [slot=window] ) {
|
|
115
|
+
opacity: 0;
|
|
116
|
+
transition-property: background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width;
|
|
117
|
+
transition-duration: 500ms;
|
|
118
|
+
transition-timing-function: cubic-bezier(1, 0, 0, 1);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
:host ( .animate-bottom-intro ) .window, :host ( .animate-bottom-intro ) > ::slotted ( [slot=window] ) {
|
|
122
|
+
transform: rotateX(-22deg) scale(0.5) translateY(40%);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
:host ( .animate-bottom-opened.animate-bottom-outro ) .window, :host ( .animate-bottom-opened.animate-bottom-outro ) > ::slotted ( [slot=window] ), :host ( .animate-bottom-opened ) .window, :host ( .animate-bottom-opened ) > ::slotted ( [slot=window] ) {
|
|
126
|
+
opacity: 1;
|
|
127
|
+
|
|
128
|
+
transform: rotateX(0) scale(1) translateY(0);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
:host ( .animate-bottom-outro ) .window, :host ( .animate-bottom-outro ) > ::slotted ( [slot=window] ) {
|
|
132
|
+
transform: rotateX(-22deg) scale(0.5) translateY(-40%);
|
|
133
|
+
}
|
|
134
|
+
|
|
95
135
|
:host ( .animate-center ) {
|
|
96
136
|
justify-content: center;
|
|
97
137
|
padding: 2rem;
|
|
@@ -107,7 +147,6 @@
|
|
|
107
147
|
:host ( .animate-center ) .window, :host ( .animate-center ) > ::slotted ( [slot=window] ) {
|
|
108
148
|
opacity: 0;
|
|
109
149
|
transition-property: background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width;
|
|
110
|
-
transition-duration: 150ms;
|
|
111
150
|
transition-duration: 500ms;
|
|
112
151
|
transition-timing-function: cubic-bezier(1, 0, 0, 1);
|
|
113
152
|
}
|
|
@@ -117,16 +156,56 @@
|
|
|
117
156
|
}
|
|
118
157
|
|
|
119
158
|
:host ( .animate-center-opened.animate-center-outro ) .window, :host ( .animate-center-opened.animate-center-outro ) > ::slotted ( [slot=window] ), :host ( .animate-center-opened ) .window, :host ( .animate-center-opened ) > ::slotted ( [slot=window] ) {
|
|
159
|
+
opacity: 1;
|
|
120
160
|
|
|
121
161
|
transform: rotateX(0) scale(1) translateY(0);
|
|
122
|
-
|
|
123
|
-
opacity: 1;
|
|
124
|
-
}
|
|
162
|
+
}
|
|
125
163
|
|
|
126
164
|
:host ( .animate-center-outro ) .window, :host ( .animate-center-outro ) > ::slotted ( [slot=window] ) {
|
|
127
165
|
transform: rotateX(-22deg) scale(0.5) translateY(-40%);
|
|
128
166
|
}
|
|
129
167
|
|
|
168
|
+
:host ( .animate-left ) {
|
|
169
|
+
justify-content: flex-start;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
:host ( .animate-left ) .window, :host ( .animate-left ) > ::slotted ( [slot=window] ) {
|
|
173
|
+
opacity: 0;
|
|
174
|
+
transition-property: background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width;
|
|
175
|
+
transition-duration: 500ms;
|
|
176
|
+
transition-timing-function: cubic-bezier(1, 0, 0, 1);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
:host ( .animate-left-intro ) .window, :host ( .animate-left-intro ) > ::slotted ( [slot=window] ) {
|
|
180
|
+
transform: translateX(calc(-100% - 50px));
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
:host ( .animate-left-opened.animate-left-outro ) .window, :host ( .animate-left-opened.animate-left-outro ) > ::slotted ( [slot=window] ), :host ( .animate-left-opened ) .window, :host ( .animate-left-opened ) > ::slotted ( [slot=window] ) {
|
|
184
|
+
opacity: 1;
|
|
185
|
+
|
|
186
|
+
transform: translateX(0);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
:host ( .animate-left-opened ) .close, :host ( .animate-left-opened.animate-left-outro ) .close {
|
|
190
|
+
opacity: 1;
|
|
191
|
+
|
|
192
|
+
transform: translate(-24px, 24px) rotate(0);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
:host ( .animate-left-outro ) .window, :host ( .animate-left-outro ) > ::slotted ( [slot=window] ) {
|
|
196
|
+
transform: translateX(calc(-100% - 50px));
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
:host ( .animate-left-outro ) .close {
|
|
200
|
+
transform: translate(24px, 24px) rotate(-90deg);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
:host ( .animate-left ) .close {
|
|
204
|
+
right: 0px;
|
|
205
|
+
|
|
206
|
+
transform: translate(36px, 24px) rotate(90deg);
|
|
207
|
+
}
|
|
208
|
+
|
|
130
209
|
:host ( .animate-right ) {
|
|
131
210
|
justify-content: flex-end;
|
|
132
211
|
}
|
|
@@ -134,7 +213,6 @@
|
|
|
134
213
|
:host ( .animate-right ) .window, :host ( .animate-right ) > ::slotted ( [slot=window] ) {
|
|
135
214
|
opacity: 0;
|
|
136
215
|
transition-property: background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width;
|
|
137
|
-
transition-duration: 150ms;
|
|
138
216
|
transition-duration: 500ms;
|
|
139
217
|
transition-timing-function: cubic-bezier(1, 0, 0, 1);
|
|
140
218
|
}
|
|
@@ -144,11 +222,10 @@
|
|
|
144
222
|
}
|
|
145
223
|
|
|
146
224
|
:host ( .animate-right-opened.animate-right-outro ) .window, :host ( .animate-right-opened.animate-right-outro ) > ::slotted ( [slot=window] ), :host ( .animate-right-opened ) .window, :host ( .animate-right-opened ) > ::slotted ( [slot=window] ) {
|
|
225
|
+
opacity: 1;
|
|
147
226
|
|
|
148
227
|
transform: translateX(0);
|
|
149
|
-
|
|
150
|
-
opacity: 1;
|
|
151
|
-
}
|
|
228
|
+
}
|
|
152
229
|
|
|
153
230
|
:host ( .animate-right-opened ) .close, :host ( .animate-right-opened.animate-right-outro ) .close {
|
|
154
231
|
opacity: 1;
|
|
@@ -170,46 +247,36 @@
|
|
|
170
247
|
transform: translate(-36px, 24px) rotate(-90deg);
|
|
171
248
|
}
|
|
172
249
|
|
|
173
|
-
:host ( .animate-
|
|
174
|
-
justify-content:
|
|
250
|
+
:host ( .animate-top ) {
|
|
251
|
+
justify-content: center;
|
|
252
|
+
padding: 2rem;
|
|
175
253
|
}
|
|
176
254
|
|
|
177
|
-
|
|
255
|
+
@media (max-width: 767px) {
|
|
256
|
+
|
|
257
|
+
:host ( .animate-top ) {
|
|
258
|
+
padding: 1rem;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
:host ( .animate-top ) .window, :host ( .animate-top ) > ::slotted ( [slot=window] ) {
|
|
178
263
|
opacity: 0;
|
|
179
264
|
transition-property: background-color, border-color, box-shadow, color, height, margin, opacity, padding, transform, width;
|
|
180
|
-
transition-duration: 150ms;
|
|
181
265
|
transition-duration: 500ms;
|
|
182
266
|
transition-timing-function: cubic-bezier(1, 0, 0, 1);
|
|
183
267
|
}
|
|
184
268
|
|
|
185
|
-
:host ( .animate-
|
|
186
|
-
transform:
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
:host ( .animate-left-opened.animate-left-outro ) .window, :host ( .animate-left-opened.animate-left-outro ) > ::slotted ( [slot=window] ), :host ( .animate-left-opened ) .window, :host ( .animate-left-opened ) > ::slotted ( [slot=window] ) {
|
|
190
|
-
|
|
191
|
-
transform: translateX(0);
|
|
192
|
-
|
|
193
|
-
opacity: 1;
|
|
269
|
+
:host ( .animate-top-intro ) .window, :host ( .animate-top-intro ) > ::slotted ( [slot=window] ) {
|
|
270
|
+
transform: rotateX(-22deg) scale(0.5) translateY(40%);
|
|
194
271
|
}
|
|
195
272
|
|
|
196
|
-
:host ( .animate-
|
|
273
|
+
:host ( .animate-top-opened.animate-top-outro ) .window, :host ( .animate-top-opened.animate-top-outro ) > ::slotted ( [slot=window] ), :host ( .animate-top-opened ) .window, :host ( .animate-top-opened ) > ::slotted ( [slot=window] ) {
|
|
197
274
|
opacity: 1;
|
|
198
275
|
|
|
199
|
-
|
|
276
|
+
transform: rotateX(0) scale(1) translateY(0);
|
|
200
277
|
}
|
|
201
278
|
|
|
202
|
-
:host ( .animate-
|
|
203
|
-
transform:
|
|
279
|
+
:host ( .animate-top-outro ) .window, :host ( .animate-top-outro ) > ::slotted ( [slot=window] ) {
|
|
280
|
+
transform: rotateX(-22deg) scale(0.5) translateY(-40%);
|
|
204
281
|
}
|
|
205
282
|
|
|
206
|
-
:host ( .animate-left-outro ) .close {
|
|
207
|
-
transform: translate(24px, 24px) rotate(-90deg);
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
:host ( .animate-left ) .close {
|
|
211
|
-
right: 0px;
|
|
212
|
-
|
|
213
|
-
transform: translate(36px, 24px) rotate(90deg);
|
|
214
|
-
}
|
|
215
|
-
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, Element, Event, Host, h, Listen, Prop, Watch } from '@stencil/core';
|
|
1
|
+
import { Component, Element, Event, Host, h, Listen, Prop, Watch, State } from '@stencil/core';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
export class MdsModal {
|
|
4
4
|
constructor() {
|
|
@@ -14,6 +14,10 @@ export class MdsModal {
|
|
|
14
14
|
return `animate-${customPosition !== null ? customPosition : this.position}${customState !== null ? '-' + customState : ''}`;
|
|
15
15
|
};
|
|
16
16
|
this.closeModal = (e = null) => {
|
|
17
|
+
var _a;
|
|
18
|
+
if (((_a = e.target) === null || _a === void 0 ? void 0 : _a.localName) !== 'mds-modal') {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
17
21
|
this.opened = e.target !== e.currentTarget;
|
|
18
22
|
if (!this.opened) {
|
|
19
23
|
this.close.emit();
|
|
@@ -24,6 +28,7 @@ export class MdsModal {
|
|
|
24
28
|
this.bottom = this.hostElement.querySelector('[slot="bottom"]') !== null;
|
|
25
29
|
this.top = this.hostElement.querySelector('[slot="top"]') !== null;
|
|
26
30
|
this.window = this.hostElement.querySelector('[slot="window"]') !== null;
|
|
31
|
+
this.stateOpened = this.opened;
|
|
27
32
|
if (this.window && this.position === null) {
|
|
28
33
|
this.position = 'center';
|
|
29
34
|
}
|
|
@@ -49,14 +54,15 @@ export class MdsModal {
|
|
|
49
54
|
this.hostElement.classList.remove(this.animationName('intro', oldValue));
|
|
50
55
|
this.hostElement.classList.remove(this.animationName('outro', oldValue));
|
|
51
56
|
}
|
|
52
|
-
openedChange() {
|
|
57
|
+
openedChange(newValue) {
|
|
58
|
+
this.stateOpened = newValue;
|
|
53
59
|
window.clearTimeout(this.animationDeelay);
|
|
54
60
|
}
|
|
55
61
|
onCloseListener() {
|
|
56
62
|
this.opened = false;
|
|
57
63
|
}
|
|
58
64
|
render() {
|
|
59
|
-
return (h(Host, { class: clsx(this.
|
|
65
|
+
return (h(Host, { class: clsx(this.stateOpened && this.animationName('opened')), onClick: (e) => { this.closeModal(e); } },
|
|
60
66
|
this.window
|
|
61
67
|
?
|
|
62
68
|
h("slot", { name: "window" })
|
|
@@ -100,7 +106,7 @@ export class MdsModal {
|
|
|
100
106
|
"mutable": true,
|
|
101
107
|
"complexType": {
|
|
102
108
|
"original": "ModalPositionType",
|
|
103
|
-
"resolved": "\"center\" | \"left\" | \"right\"",
|
|
109
|
+
"resolved": "\"bottom\" | \"center\" | \"left\" | \"right\" | \"top\"",
|
|
104
110
|
"references": {
|
|
105
111
|
"ModalPositionType": {
|
|
106
112
|
"location": "import",
|
|
@@ -119,6 +125,9 @@ export class MdsModal {
|
|
|
119
125
|
"defaultValue": "null"
|
|
120
126
|
}
|
|
121
127
|
}; }
|
|
128
|
+
static get states() { return {
|
|
129
|
+
"stateOpened": {}
|
|
130
|
+
}; }
|
|
122
131
|
static get events() { return [{
|
|
123
132
|
"method": "close",
|
|
124
133
|
"name": "close",
|
|
@@ -146,7 +155,7 @@ export class MdsModal {
|
|
|
146
155
|
static get listeners() { return [{
|
|
147
156
|
"name": "close",
|
|
148
157
|
"method": "onCloseListener",
|
|
149
|
-
"target":
|
|
158
|
+
"target": "document",
|
|
150
159
|
"capture": false,
|
|
151
160
|
"passive": false
|
|
152
161
|
}]; }
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import faker from 'faker'
|
|
3
2
|
import MdsModal from '@component/mds-modal/mds-modal'
|
|
4
3
|
|
|
5
4
|
import { modalPositionDictionary } from '../meta/dictionary'
|
|
@@ -21,13 +20,10 @@ export default {
|
|
|
21
20
|
},
|
|
22
21
|
}
|
|
23
22
|
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const text = faker.lorem.paragraphs(3)
|
|
27
|
-
const firstName = faker.name.firstName(1)
|
|
28
|
-
const lastName = faker.name.lastName(1)
|
|
23
|
+
const firstName = 'Mario'
|
|
24
|
+
const lastName = 'Rossi'
|
|
29
25
|
const fullName = `${firstName} ${lastName}`
|
|
30
|
-
const email =
|
|
26
|
+
const email = `${firstName.toLowerCase()}.${lastName.toLowerCase()}@nintendo.com`
|
|
31
27
|
|
|
32
28
|
const Template = args =>
|
|
33
29
|
<mds-modal {...args}>
|
|
@@ -40,7 +36,7 @@ const Template = args =>
|
|
|
40
36
|
</header>
|
|
41
37
|
<div className="p-8 max-w-lg">
|
|
42
38
|
<mds-text>
|
|
43
|
-
|
|
39
|
+
As a multi-brand design system, our components need to be flexible enough for any one of our brands to use them for multiple use cases. To achieve this, we ensure that all of the brands are involved in the specification stage, giving us more confidence that we’re future-proofing our components as more brands adopt NewsKit.
|
|
44
40
|
</mds-text>
|
|
45
41
|
</div>
|
|
46
42
|
<footer slot="bottom" className="p-8 max-w-lg flex gap-4 text-adjust-tone-02 border-t border-adjust-tone-09">
|
|
@@ -57,7 +53,7 @@ const CustomTemplate = args =>
|
|
|
57
53
|
<mds-modal {...args}>
|
|
58
54
|
<mds-banner slot="window" class="max-w-xl" deletable headline="Action required">
|
|
59
55
|
<mds-text typography="detail">
|
|
60
|
-
|
|
56
|
+
As a multi-brand design system, our components need to be flexible enough for any one of our brands to use them for multiple use cases. To achieve this, we ensure that all of the brands are involved in the specification stage, giving us more confidence that we’re future-proofing our components as more brands adopt NewsKit.
|
|
61
57
|
</mds-text>
|
|
62
58
|
<mds-button slot="actions" variant="primary" tone="quiet">Cancel</mds-button>
|
|
63
59
|
<mds-button slot="actions" variant="primary">Confirm</mds-button>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import mggIconsDictionary from '@maggioli-design-system/icons/original/dictionary.json';
|
|
1
|
+
import mggIconsDictionary from '@maggioli-design-system/icons/dist/original/dictionary.json';
|
|
2
2
|
const iconsDictionary = Object.keys(mggIconsDictionary).sort();
|
|
3
3
|
export { iconsDictionary, };
|
|
@@ -13,6 +13,7 @@ const typographyDictionary = [
|
|
|
13
13
|
'label',
|
|
14
14
|
'option',
|
|
15
15
|
'paragraph',
|
|
16
|
+
'tip',
|
|
16
17
|
];
|
|
17
18
|
const typographyMonoDictionary = [
|
|
18
19
|
'code',
|
|
@@ -33,5 +34,10 @@ const typographySecondaryDictionary = [
|
|
|
33
34
|
'label',
|
|
34
35
|
'option',
|
|
35
36
|
'paragraph',
|
|
37
|
+
'tip',
|
|
36
38
|
];
|
|
37
|
-
|
|
39
|
+
const typographySmallerDictionary = [
|
|
40
|
+
'option',
|
|
41
|
+
'tip',
|
|
42
|
+
];
|
|
43
|
+
export { typographyDictionary, typographyMonoDictionary, typographyPrimaryDictionary, typographySecondaryDictionary, typographySmallerDictionary, };
|
|
@@ -1,25 +1,7 @@
|
|
|
1
|
-
/* MdsModal custom elements
|
|
1
|
+
/* MdsModal custom elements */
|
|
2
2
|
|
|
3
3
|
import type { Components, JSX } from "../types/components";
|
|
4
4
|
|
|
5
|
-
interface MdsModal extends Components.MdsModal, HTMLElement {}
|
|
6
|
-
export const MdsModal: {
|
|
7
|
-
prototype: MdsModal;
|
|
8
|
-
new (): MdsModal;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Utility to define all custom elements within this package using the tag name provided in the component's source.
|
|
13
|
-
* When defining each custom element, it will also check it's safe to define by:
|
|
14
|
-
*
|
|
15
|
-
* 1. Ensuring the "customElements" registry is available in the global context (window).
|
|
16
|
-
* 2. The component tag name is not already defined.
|
|
17
|
-
*
|
|
18
|
-
* Use the standard [customElements.define()](https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/define)
|
|
19
|
-
* method instead to define custom elements individually, or to provide a different tag name.
|
|
20
|
-
*/
|
|
21
|
-
export declare const defineCustomElements: (opts?: any) => void;
|
|
22
|
-
|
|
23
5
|
/**
|
|
24
6
|
* Used to manually set the base path where assets can be found.
|
|
25
7
|
* If the script is used as "module", it's recommended to use "import.meta.url",
|
|
@@ -36,7 +18,6 @@ export interface SetPlatformOptions {
|
|
|
36
18
|
raf?: (c: FrameRequestCallback) => number;
|
|
37
19
|
ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
38
20
|
rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
39
|
-
ce?: (eventName: string, opts?: any) => CustomEvent;
|
|
40
21
|
}
|
|
41
22
|
export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
|
|
42
23
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|