@maggioli-design-system/mds-modal 4.7.1 → 4.7.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.
Files changed (67) hide show
  1. package/dist/cjs/{index-1c3a970e.js → index-95c329c0.js} +29 -17
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/mds-modal.cjs.entry.js +129 -129
  4. package/dist/cjs/mds-modal.cjs.js +2 -2
  5. package/dist/collection/collection-manifest.json +1 -1
  6. package/dist/collection/common/aria.js +18 -18
  7. package/dist/collection/common/keyboard-manager.js +38 -38
  8. package/dist/collection/common/unit.js +7 -7
  9. package/dist/collection/components/mds-modal/mds-modal.css +8 -27
  10. package/dist/collection/components/mds-modal/mds-modal.js +188 -188
  11. package/dist/collection/components/mds-modal/meta/dictionary.js +5 -5
  12. package/dist/collection/components/mds-modal/test/mds-modal.e2e.js +34 -34
  13. package/dist/collection/components/mds-modal/test/mds-modal.stories.js +16 -16
  14. package/dist/collection/dictionary/autocomplete.js +56 -56
  15. package/dist/collection/dictionary/button.js +19 -19
  16. package/dist/collection/dictionary/color.js +14 -14
  17. package/dist/collection/dictionary/floating-ui.js +14 -14
  18. package/dist/collection/dictionary/input.js +31 -15
  19. package/dist/collection/dictionary/loading.js +2 -2
  20. package/dist/collection/dictionary/typography.js +46 -46
  21. package/dist/collection/dictionary/variant.js +54 -54
  22. package/dist/collection/fixtures/cities.js +107 -107
  23. package/dist/components/mds-modal.d.ts +2 -2
  24. package/dist/components/mds-modal.js +149 -149
  25. package/dist/documentation.json +2 -2
  26. package/dist/esm/{index-a33ffd58.js → index-2bd481c0.js} +29 -17
  27. package/dist/esm/loader.js +2 -2
  28. package/dist/esm/mds-modal.entry.js +129 -129
  29. package/dist/esm/mds-modal.js +3 -3
  30. package/dist/esm-es5/index-2bd481c0.js +1 -0
  31. package/dist/esm-es5/loader.js +1 -1
  32. package/dist/esm-es5/mds-modal.entry.js +1 -1
  33. package/dist/esm-es5/mds-modal.js +1 -1
  34. package/dist/mds-modal/mds-modal.esm.js +1 -1
  35. package/dist/mds-modal/mds-modal.js +15 -15
  36. package/{www/build/p-506f8ff7.system.js → dist/mds-modal/p-0a4de21e.system.js} +1 -1
  37. package/dist/mds-modal/{p-602c50be.js → p-2f9a631d.js} +1 -1
  38. package/dist/mds-modal/p-68c3fe7d.system.entry.js +1 -0
  39. package/dist/mds-modal/{p-7ead5b8b.system.js → p-969424eb.system.js} +1 -1
  40. package/dist/mds-modal/p-fe6df5e2.entry.js +1 -0
  41. package/dist/stats.json +30 -30
  42. package/dist/types/common/keyboard-manager.d.ts +9 -9
  43. package/dist/types/components/mds-modal/test/mds-modal.stories.d.ts +20 -20
  44. package/dist/types/dictionary/input.d.ts +2 -1
  45. package/dist/types/interface/input-value.d.ts +1 -1
  46. package/dist/types/stencil-public-runtime.d.ts +8 -0
  47. package/documentation.json +14 -4
  48. package/package.json +3 -3
  49. package/src/components/mds-modal/css/mds-modal-animate-bottom.css +2 -2
  50. package/src/components/mds-modal/css/mds-modal-animate-center.css +2 -2
  51. package/src/components/mds-modal/css/mds-modal-animate-top.css +2 -2
  52. package/src/components/mds-modal/mds-modal.css +2 -2
  53. package/src/dictionary/input.ts +18 -0
  54. package/src/fixtures/icons.json +3 -0
  55. package/src/fixtures/iconsauce.json +3 -0
  56. package/www/build/mds-modal.esm.js +1 -1
  57. package/www/build/mds-modal.js +15 -15
  58. package/{dist/mds-modal/p-506f8ff7.system.js → www/build/p-0a4de21e.system.js} +1 -1
  59. package/www/build/{p-602c50be.js → p-2f9a631d.js} +1 -1
  60. package/www/build/p-68c3fe7d.system.entry.js +1 -0
  61. package/www/build/{p-7ead5b8b.system.js → p-969424eb.system.js} +1 -1
  62. package/www/build/p-fe6df5e2.entry.js +1 -0
  63. package/dist/esm-es5/index-a33ffd58.js +0 -1
  64. package/dist/mds-modal/p-a0636f54.system.entry.js +0 -1
  65. package/dist/mds-modal/p-c5a84e4d.entry.js +0 -1
  66. package/www/build/p-a0636f54.system.entry.js +0 -1
  67. package/www/build/p-c5a84e4d.entry.js +0 -1
@@ -424,7 +424,11 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
424
424
  elm[memberName] = newValue;
425
425
  }
426
426
  }
427
- catch (e) { }
427
+ catch (e) {
428
+ /**
429
+ * in case someone tries to set a read-only property, e.g. "namespaceURI", we just ignore it
430
+ */
431
+ }
428
432
  }
429
433
  if (newValue == null || newValue === false) {
430
434
  if (newValue !== false || elm.getAttribute(memberName) === '') {
@@ -443,6 +447,11 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
443
447
  }
444
448
  };
445
449
  const parseClassListRegex = /\s/;
450
+ /**
451
+ * Parsed a string of classnames into an array
452
+ * @param value className string, e.g. "foo bar baz"
453
+ * @returns list of classes, e.g. ["foo", "bar", "baz"]
454
+ */
446
455
  const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
447
456
  const CAPTURE_EVENT_SUFFIX = 'Capture';
448
457
  const CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + '$');
@@ -1186,13 +1195,13 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
1186
1195
  */
1187
1196
  const proxyComponent = (Cstr, cmpMeta, flags) => {
1188
1197
  var _a;
1198
+ const prototype = Cstr.prototype;
1189
1199
  if (cmpMeta.$members$) {
1190
1200
  if (Cstr.watchers) {
1191
1201
  cmpMeta.$watchers$ = Cstr.watchers;
1192
1202
  }
1193
1203
  // It's better to have a const than two Object.entries()
1194
1204
  const members = Object.entries(cmpMeta.$members$);
1195
- const prototype = Cstr.prototype;
1196
1205
  members.map(([memberName, [memberFlags]]) => {
1197
1206
  if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
1198
1207
  ((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
@@ -1215,6 +1224,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1215
1224
  const attrNameToPropName = new Map();
1216
1225
  prototype.attributeChangedCallback = function (attrName, oldValue, newValue) {
1217
1226
  plt.jmp(() => {
1227
+ var _a;
1218
1228
  const propName = attrNameToPropName.get(attrName);
1219
1229
  // In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
1220
1230
  // in the case where an attribute was set inline.
@@ -1270,11 +1280,12 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1270
1280
  // 1. The instance is ready
1271
1281
  // 2. The watchers are ready
1272
1282
  // 3. The value has changed
1273
- if (!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
1283
+ if (flags &&
1284
+ !(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
1274
1285
  flags & 128 /* HOST_FLAGS.isWatchReady */ &&
1275
1286
  newValue !== oldValue) {
1276
1287
  const instance = hostRef.$lazyInstance$ ;
1277
- const entry = cmpMeta.$watchers$[attrName];
1288
+ const entry = (_a = cmpMeta.$watchers$) === null || _a === void 0 ? void 0 : _a[attrName];
1278
1289
  entry === null || entry === void 0 ? void 0 : entry.forEach((callbackName) => {
1279
1290
  if (instance[callbackName] != null) {
1280
1291
  instance[callbackName].call(instance, newValue, oldValue, attrName);
@@ -1296,10 +1307,11 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1296
1307
  ...members
1297
1308
  .filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */)
1298
1309
  .map(([propName, m]) => {
1310
+ var _a;
1299
1311
  const attrName = m[1] || propName;
1300
1312
  attrNameToPropName.set(attrName, propName);
1301
1313
  if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
1302
- cmpMeta.$attrsToReflect$.push([propName, attrName]);
1314
+ (_a = cmpMeta.$attrsToReflect$) === null || _a === void 0 ? void 0 : _a.push([propName, attrName]);
1303
1315
  }
1304
1316
  return attrName;
1305
1317
  }),
@@ -1690,19 +1702,19 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
1690
1702
  return module[exportName];
1691
1703
  }
1692
1704
 
1693
- if (!hmrVersionId || !BUILD.hotModuleReplacement) {
1694
- const processMod = importedModule => {
1695
- cmpModules.set(bundleId, importedModule);
1696
- return importedModule[exportName];
1697
- }
1698
- switch(bundleId) {
1699
-
1700
- case 'mds-modal.cjs':
1701
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
1702
- /* webpackMode: "lazy" */
1703
- './mds-modal.cjs.entry.js')); }).then(processMod, consoleError);
1705
+ if (!hmrVersionId || !BUILD.hotModuleReplacement) {
1706
+ const processMod = importedModule => {
1707
+ cmpModules.set(bundleId, importedModule);
1708
+ return importedModule[exportName];
1709
+ }
1710
+ switch(bundleId) {
1711
+
1712
+ case 'mds-modal.cjs':
1713
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
1714
+ /* webpackMode: "lazy" */
1715
+ './mds-modal.cjs.entry.js')); }).then(processMod, consoleError);
1716
+ }
1704
1717
  }
1705
- }
1706
1718
  return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
1707
1719
  /* @vite-ignore */
1708
1720
  /* webpackInclude: /\.entry\.js$/ */
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-1c3a970e.js');
5
+ const index = require('./index-95c329c0.js');
6
6
 
7
7
  const defineCustomElements = (win, options) => {
8
8
  if (typeof window === 'undefined') return undefined;
@@ -2,147 +2,147 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-1c3a970e.js');
5
+ const index = require('./index-95c329c0.js');
6
6
 
7
7
  function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
8
8
 
9
9
  const miBaselineClose = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z"/></svg>`;
10
10
 
11
11
  class KeyboardManager {
12
- constructor() {
13
- this.elements = [];
14
- this.handleClickBehaviorDispatchEvent = (event) => {
15
- if (event.code === 'Space' || event.code === 'Enter' || event.code === 'NumpadEnter') {
16
- event.target.click();
17
- }
18
- };
19
- this.handleEscapeBehaviorDispatchEvent = (event) => {
20
- if (event.code === 'Escape' && this.escapeCallback) {
21
- this.escapeCallback();
22
- }
23
- };
24
- this.addElement = (el, name = 'element') => {
25
- this.elements[name] = el;
26
- };
27
- this.attachClickBehavior = (name = 'element') => {
28
- if (this.elements[name]) {
29
- this.elements[name].addEventListener('keydown', this.handleClickBehaviorDispatchEvent);
30
- }
31
- };
32
- this.detachClickBehavior = (name = 'element') => {
33
- if (this.elements[name]) {
34
- this.elements[name].removeEventListener('keydown', this.handleClickBehaviorDispatchEvent);
35
- }
36
- };
37
- this.attachEscapeBehavior = (callBack) => {
38
- this.escapeCallback = callBack;
39
- if (window !== undefined) {
40
- window.addEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
41
- }
42
- };
43
- this.detachEscapeBehavior = () => {
44
- this.escapeCallback = () => { return; };
45
- if (window !== undefined) {
46
- window.removeEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
47
- }
48
- };
49
- }
12
+ constructor() {
13
+ this.elements = [];
14
+ this.handleClickBehaviorDispatchEvent = (event) => {
15
+ if (event.code === 'Space' || event.code === 'Enter' || event.code === 'NumpadEnter') {
16
+ event.target.click();
17
+ }
18
+ };
19
+ this.handleEscapeBehaviorDispatchEvent = (event) => {
20
+ if (event.code === 'Escape' && this.escapeCallback) {
21
+ this.escapeCallback();
22
+ }
23
+ };
24
+ this.addElement = (el, name = 'element') => {
25
+ this.elements[name] = el;
26
+ };
27
+ this.attachClickBehavior = (name = 'element') => {
28
+ if (this.elements[name]) {
29
+ this.elements[name].addEventListener('keydown', this.handleClickBehaviorDispatchEvent);
30
+ }
31
+ };
32
+ this.detachClickBehavior = (name = 'element') => {
33
+ if (this.elements[name]) {
34
+ this.elements[name].removeEventListener('keydown', this.handleClickBehaviorDispatchEvent);
35
+ }
36
+ };
37
+ this.attachEscapeBehavior = (callBack) => {
38
+ this.escapeCallback = callBack;
39
+ if (window !== undefined) {
40
+ window.addEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
41
+ }
42
+ };
43
+ this.detachEscapeBehavior = () => {
44
+ this.escapeCallback = () => { return; };
45
+ if (window !== undefined) {
46
+ window.removeEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
47
+ }
48
+ };
49
+ }
50
50
  }
51
51
 
52
- const mdsModalCss = "@-webkit-keyframes focus-bounce{0%,75%,100%{outline-offset:var(--magma-outline-focus-offset)}50%{outline-offset:var(--magma-outline-blur-offset)}}@keyframes focus-bounce{0%,75%,100%{outline-offset:var(--magma-outline-focus-offset)}50%{outline-offset:var(--magma-outline-blur-offset)}}@tailwind components; @tailwind utilities; .svg{display:-ms-flexbox;display:flex}.svg svg{aspect-ratio:1 / 1;height:100%;width:100%}.animate-right-intro,.animate-right-outro{-webkit-transform:translateX(calc(100% + 50px));transform:translateX(calc(100% + 50px))}.fixed{position:fixed}.absolute{position:absolute}.mx-6{margin-left:1.5rem;margin-right:1.5rem}.ml-auto{margin-left:auto}.flex{display:-ms-flexbox;display:flex}.w-16{width:4rem}.min-w-0{min-width:0px}.max-w-lg{max-width:32rem}.max-w-xl{max-width:36rem}.items-center{-ms-flex-align:center;align-items:center}.gap-4{gap:1rem}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rounded-full{border-radius:9999px}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-tone-neutral-09{--tw-border-opacity:1;border-color:rgb(var(--tone-neutral-09) / var(--tw-border-opacity))}.bg-transparent{background-color:transparent}.p-4{padding:1rem}.p-8{padding:2rem}.text-tone-neutral-02{--tw-text-opacity:1;color:rgb(var(--tone-neutral-02) / var(--tw-text-opacity))}.text-tone-neutral-04{--tw-text-opacity:1;color:rgb(var(--tone-neutral-04) / var(--tw-text-opacity))}.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{--mds-modal-overlay-color:var(--magma-overlay-color, 0 0 0);--mds-modal-overlay-opacity:var(--magma-overlay-opacity, 0.5);--mds-modal-window-background:rgb(var(--tone-neutral));--mds-modal-window-overflow:auto;--mds-modal-window-shadow:0 25px 50px -12px rgb(0 0 0 / 0.25);--mds-modal-z-index:var(--magma-modal-z-index);-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);-ms-flex-align:center;align-items:center;background-color:rgba(var(--mds-modal-overlay-color) / 0);display:-ms-flexbox;display:flex;fill:rgb(var(--tone-neutral));inset:0;-ms-flex-pack:center;justify-content:center;-webkit-perspective:600px;perspective:600px;pointer-events:none;position:fixed;z-index:var(--mds-modal-z-index, 1000)}: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(.to-bottom-opened),:host(.to-center-opened),:host(.to-left-opened),:host(.to-right-opened),:host(.to-top-opened){-webkit-transition-duration:500ms;transition-duration:500ms;background-color:rgba(var(--mds-modal-overlay-color) / var(--mds-modal-overlay-opacity));pointer-events:auto}.close{top:0px;height:2.25rem;width:2.25rem;border-radius:9999px;font-size:2.25rem;line-height:2.5rem;opacity:0;-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);cursor:pointer;fill:inherit;position:absolute;-webkit-transform:translate(0, 24px) rotate(90deg);transform:translate(0, 24px) rotate(90deg);-webkit-transform-origin:center;transform-origin:center;-webkit-transition-property:opacity, outline, outline-offset, -webkit-transform;transition-property:opacity, outline, outline-offset, -webkit-transform;transition-property:opacity, outline, outline-offset, transform;transition-property:opacity, outline, outline-offset, transform, -webkit-transform}.window{height:100%;gap:0px;background-color:var(--mds-modal-window-background);-webkit-box-shadow:var(--mds-modal-window-shadow);box-shadow:var(--mds-modal-window-shadow);display:grid;grid-template-rows:1fr;max-width:calc(100vw - 80px);overflow:var(--mds-modal-window-overflow)}.window--top{grid-template-rows:auto 1fr}.window--bottom{grid-template-rows:1fr auto}.window--top-bottom{grid-template-rows:auto 1fr auto}:host(.to-bottom){padding:2rem}@media (max-width: 767px){:host(.to-bottom){padding:1rem}}:host(.to-bottom){-ms-flex-pack:center;justify-content:center}:host(.to-bottom) .window,:host(.to-bottom)>::slotted([slot=\"window\"]){opacity:0;-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-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(.to-bottom-intro) .window,:host(.to-bottom-intro)>::slotted([slot=\"window\"]){-webkit-transform:rotateX(-22deg) scale(0.5) translateY(40%);transform:rotateX(-22deg) scale(0.5) translateY(40%)}:host(.to-bottom-opened.to-bottom-outro) .window,:host(.to-bottom-opened.to-bottom-outro)>::slotted([slot=\"window\"]),:host(.to-bottom-opened) .window,:host(.to-bottom-opened)>::slotted([slot=\"window\"]){opacity:1;-webkit-transform:rotateX(0) scale(1) translateY(0);transform:rotateX(0) scale(1) translateY(0)}:host(.to-bottom-outro) .window,:host(.to-bottom-outro)>::slotted([slot=\"window\"]){-webkit-transform:rotateX(-22deg) scale(0.5) translateY(-40%);transform:rotateX(-22deg) scale(0.5) translateY(-40%)}:host(.to-center){padding:2rem}@media (max-width: 767px){:host(.to-center){padding:1rem}}:host(.to-center){-ms-flex-pack:center;justify-content:center}:host(.to-center) .window,:host(.to-center)>::slotted([slot=\"window\"]){opacity:0;-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-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(.to-center-intro) .window,:host(.to-center-intro)>::slotted([slot=\"window\"]){-webkit-transform:rotateX(-22deg) scale(0.5) translateY(40%);transform:rotateX(-22deg) scale(0.5) translateY(40%)}:host(.to-center-opened.to-center-outro) .window,:host(.to-center-opened.to-center-outro)>::slotted([slot=\"window\"]),:host(.to-center-opened) .window,:host(.to-center-opened)>::slotted([slot=\"window\"]){opacity:1;-webkit-transform:rotateX(0) scale(1) translateY(0);transform:rotateX(0) scale(1) translateY(0)}:host(.to-center-outro) .window,:host(.to-center-outro)>::slotted([slot=\"window\"]){-webkit-transform:rotateX(-22deg) scale(0.5) translateY(-40%);transform:rotateX(-22deg) scale(0.5) translateY(-40%)}:host(.to-left){-ms-flex-pack:start;justify-content:flex-start}:host(.to-left) .window,:host(.to-left)>::slotted([slot=\"window\"]){opacity:0;-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-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(.to-left-intro) .window,:host(.to-left-intro)>::slotted([slot=\"window\"]){-webkit-transform:translateX(calc(-100% - 50px));transform:translateX(calc(-100% - 50px))}:host(.to-left-opened.to-left-outro) .window,:host(.to-left-opened.to-left-outro)>::slotted([slot=\"window\"]),:host(.to-left-opened) .window,:host(.to-left-opened)>::slotted([slot=\"window\"]){opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}:host(.to-left-opened) .close,:host(.to-left-opened.to-left-outro) .close{opacity:1;-webkit-transform:translate(-24px, 24px) rotate(0);transform:translate(-24px, 24px) rotate(0)}:host(.to-left-outro) .window,:host(.to-left-outro)>::slotted([slot=\"window\"]){-webkit-transform:translateX(calc(-100% - 50px));transform:translateX(calc(-100% - 50px))}:host(.to-left-outro) .close{-webkit-transform:translate(24px, 24px) rotate(-90deg);transform:translate(24px, 24px) rotate(-90deg)}:host(.to-left) .close{right:0px;-webkit-transform:translate(36px, 24px) rotate(90deg);transform:translate(36px, 24px) rotate(90deg)}:host(.to-right){-ms-flex-pack:end;justify-content:flex-end}:host(.to-right) .window,:host(.to-right)>::slotted([slot=\"window\"]){opacity:0;-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-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(.to-right-intro) .window,:host(.to-right-intro)>::slotted([slot=\"window\"]){-webkit-transform:translateX(calc(100% + 50px));transform:translateX(calc(100% + 50px))}:host(.to-right-opened.to-right-outro) .window,:host(.to-right-opened.to-right-outro)>::slotted([slot=\"window\"]),:host(.to-right-opened) .window,:host(.to-right-opened)>::slotted([slot=\"window\"]){opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}:host(.to-right-opened) .close,:host(.to-right-opened.to-right-outro) .close{opacity:1;-webkit-transform:translate(24px, 24px) rotate(0);transform:translate(24px, 24px) rotate(0)}:host(.to-right-outro) .window,:host(.to-right-outro)>::slotted([slot=\"window\"]){-webkit-transform:translateX(calc(100% + 50px));transform:translateX(calc(100% + 50px))}:host(.to-right-outro) .close{-webkit-transform:translate(-24px, 24px) rotate(90deg);transform:translate(-24px, 24px) rotate(90deg)}:host(.to-right) .close{left:0px;-webkit-transform:translate(-36px, 24px) rotate(-90deg);transform:translate(-36px, 24px) rotate(-90deg)}:host(.to-top){padding:2rem}@media (max-width: 767px){:host(.to-top){padding:1rem}}:host(.to-top){-ms-flex-pack:center;justify-content:center}:host(.to-top) .window,:host(.to-top)>::slotted([slot=\"window\"]){opacity:0;-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-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(.to-top-intro) .window,:host(.to-top-intro)>::slotted([slot=\"window\"]){-webkit-transform:rotateX(-22deg) scale(0.5) translateY(40%);transform:rotateX(-22deg) scale(0.5) translateY(40%)}:host(.to-top-opened.to-top-outro) .window,:host(.to-top-opened.to-top-outro)>::slotted([slot=\"window\"]),:host(.to-top-opened) .window,:host(.to-top-opened)>::slotted([slot=\"window\"]){opacity:1;-webkit-transform:rotateX(0) scale(1) translateY(0);transform:rotateX(0) scale(1) translateY(0)}:host(.to-top-outro) .window,:host(.to-top-outro)>::slotted([slot=\"window\"]){-webkit-transform:rotateX(-22deg) scale(0.5) translateY(-40%);transform:rotateX(-22deg) scale(0.5) translateY(-40%)}@media (max-width: 767px){.mobile\\:w-12{width:3rem}}";
52
+ const mdsModalCss = "@-webkit-keyframes focus-bounce{0%,75%,100%{outline-offset:var(--magma-outline-focus-offset)}50%{outline-offset:var(--magma-outline-blur-offset)}}@keyframes focus-bounce{0%,75%,100%{outline-offset:var(--magma-outline-focus-offset)}50%{outline-offset:var(--magma-outline-blur-offset)}}@tailwind components; @tailwind utilities; .svg{display:-ms-flexbox;display:flex}.svg svg{aspect-ratio:1/1;height:100%;width:100%}.animate-right-intro,.animate-right-outro{-webkit-transform:translateX(calc(100% + 50px));transform:translateX(calc(100% + 50px))}.fixed{position:fixed}.absolute{position:absolute}.ml-auto{margin-left:auto}.flex{display:-ms-flexbox;display:flex}.min-w-0{min-width:0rem}.max-w-lg{max-width:32rem}.max-w-xl{max-width:36rem}.items-center{-ms-flex-align:center;align-items:center}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rounded-full{border-radius:9999px}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-tone-neutral-09{--tw-border-opacity:1;border-color:rgb(var(--tone-neutral-09) / var(--tw-border-opacity))}.bg-transparent{background-color:transparent}.text{font-size:1rem}.text-tone-neutral-02{--tw-text-opacity:1;color:rgb(var(--tone-neutral-02) / var(--tw-text-opacity))}.text-tone-neutral-04{--tw-text-opacity:1;color:rgb(var(--tone-neutral-04) / var(--tw-text-opacity))}.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{--mds-modal-overlay-color:var(--magma-overlay-color, 0 0 0);--mds-modal-overlay-opacity:var(--magma-overlay-opacity, 0.5);--mds-modal-window-background:rgb(var(--tone-neutral));--mds-modal-window-overflow:auto;--mds-modal-window-shadow:0 25px 50px -12px rgb(0 0 0 / 0.25);--mds-modal-z-index:var(--magma-modal-z-index);-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);-ms-flex-align:center;align-items:center;background-color:rgba(var(--mds-modal-overlay-color) / 0);display:-ms-flexbox;display:flex;fill:rgb(var(--tone-neutral));inset:0;-ms-flex-pack:center;justify-content:center;-webkit-perspective:600px;perspective:600px;pointer-events:none;position:fixed;z-index:var(--mds-modal-z-index, 1000)}: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(.to-bottom-opened),:host(.to-center-opened),:host(.to-left-opened),:host(.to-right-opened),:host(.to-top-opened){-webkit-transition-duration:500ms;transition-duration:500ms;background-color:rgba(var(--mds-modal-overlay-color) / var(--mds-modal-overlay-opacity));pointer-events:auto}.close{top:0rem;height:2.25rem;width:2.25rem;border-radius:9999px;font-size:2.25rem;line-height:2.5rem;opacity:0;-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);cursor:pointer;fill:inherit;position:absolute;-webkit-transform:translate(0, 24px) rotate(90deg);transform:translate(0, 24px) rotate(90deg);-webkit-transform-origin:center;transform-origin:center;-webkit-transition-property:opacity, outline, outline-offset, -webkit-transform;transition-property:opacity, outline, outline-offset, -webkit-transform;transition-property:opacity, outline, outline-offset, transform;transition-property:opacity, outline, outline-offset, transform, -webkit-transform}.window{height:100%;gap:0rem;background-color:var(--mds-modal-window-background);-webkit-box-shadow:var(--mds-modal-window-shadow);box-shadow:var(--mds-modal-window-shadow);display:grid;grid-template-rows:1fr;max-width:calc(100vw - 80px);overflow:var(--mds-modal-window-overflow)}.window--top{grid-template-rows:auto 1fr}.window--bottom{grid-template-rows:1fr auto}.window--top-bottom{grid-template-rows:auto 1fr auto}:host(.to-bottom){padding:2rem}@media (max-width: 767px){:host(.to-bottom){padding:1rem}}:host(.to-bottom){-ms-flex-pack:center;justify-content:center}:host(.to-bottom) .window,:host(.to-bottom)>::slotted([slot=\"window\"]){opacity:0;-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-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(.to-bottom-intro) .window,:host(.to-bottom-intro)>::slotted([slot=\"window\"]){-webkit-transform:rotateX(-22deg) scale(0.5) translateY(40%);transform:rotateX(-22deg) scale(0.5) translateY(40%)}:host(.to-bottom-opened.to-bottom-outro) .window,:host(.to-bottom-opened.to-bottom-outro)>::slotted([slot=\"window\"]),:host(.to-bottom-opened) .window,:host(.to-bottom-opened)>::slotted([slot=\"window\"]){opacity:1;-webkit-transform:rotateX(0) scale(1) translateY(0);transform:rotateX(0) scale(1) translateY(0)}:host(.to-bottom-outro) .window,:host(.to-bottom-outro)>::slotted([slot=\"window\"]){-webkit-transform:rotateX(-22deg) scale(0.5) translateY(-40%);transform:rotateX(-22deg) scale(0.5) translateY(-40%)}:host(.to-center){padding:2rem}@media (max-width: 767px){:host(.to-center){padding:1rem}}:host(.to-center){-ms-flex-pack:center;justify-content:center}:host(.to-center) .window,:host(.to-center)>::slotted([slot=\"window\"]){opacity:0;-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-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(.to-center-intro) .window,:host(.to-center-intro)>::slotted([slot=\"window\"]){-webkit-transform:rotateX(-22deg) scale(0.5) translateY(40%);transform:rotateX(-22deg) scale(0.5) translateY(40%)}:host(.to-center-opened.to-center-outro) .window,:host(.to-center-opened.to-center-outro)>::slotted([slot=\"window\"]),:host(.to-center-opened) .window,:host(.to-center-opened)>::slotted([slot=\"window\"]){opacity:1;-webkit-transform:rotateX(0) scale(1) translateY(0);transform:rotateX(0) scale(1) translateY(0)}:host(.to-center-outro) .window,:host(.to-center-outro)>::slotted([slot=\"window\"]){-webkit-transform:rotateX(-22deg) scale(0.5) translateY(-40%);transform:rotateX(-22deg) scale(0.5) translateY(-40%)}:host(.to-left){-ms-flex-pack:start;justify-content:flex-start}:host(.to-left) .window,:host(.to-left)>::slotted([slot=\"window\"]){opacity:0;-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-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(.to-left-intro) .window,:host(.to-left-intro)>::slotted([slot=\"window\"]){-webkit-transform:translateX(calc(-100% - 50px));transform:translateX(calc(-100% - 50px))}:host(.to-left-opened.to-left-outro) .window,:host(.to-left-opened.to-left-outro)>::slotted([slot=\"window\"]),:host(.to-left-opened) .window,:host(.to-left-opened)>::slotted([slot=\"window\"]){opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}:host(.to-left-opened) .close,:host(.to-left-opened.to-left-outro) .close{opacity:1;-webkit-transform:translate(-24px, 24px) rotate(0);transform:translate(-24px, 24px) rotate(0)}:host(.to-left-outro) .window,:host(.to-left-outro)>::slotted([slot=\"window\"]){-webkit-transform:translateX(calc(-100% - 50px));transform:translateX(calc(-100% - 50px))}:host(.to-left-outro) .close{-webkit-transform:translate(24px, 24px) rotate(-90deg);transform:translate(24px, 24px) rotate(-90deg)}:host(.to-left) .close{right:0rem;-webkit-transform:translate(36px, 24px) rotate(90deg);transform:translate(36px, 24px) rotate(90deg)}:host(.to-right){-ms-flex-pack:end;justify-content:flex-end}:host(.to-right) .window,:host(.to-right)>::slotted([slot=\"window\"]){opacity:0;-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-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(.to-right-intro) .window,:host(.to-right-intro)>::slotted([slot=\"window\"]){-webkit-transform:translateX(calc(100% + 50px));transform:translateX(calc(100% + 50px))}:host(.to-right-opened.to-right-outro) .window,:host(.to-right-opened.to-right-outro)>::slotted([slot=\"window\"]),:host(.to-right-opened) .window,:host(.to-right-opened)>::slotted([slot=\"window\"]){opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}:host(.to-right-opened) .close,:host(.to-right-opened.to-right-outro) .close{opacity:1;-webkit-transform:translate(24px, 24px) rotate(0);transform:translate(24px, 24px) rotate(0)}:host(.to-right-outro) .window,:host(.to-right-outro)>::slotted([slot=\"window\"]){-webkit-transform:translateX(calc(100% + 50px));transform:translateX(calc(100% + 50px))}:host(.to-right-outro) .close{-webkit-transform:translate(-24px, 24px) rotate(90deg);transform:translate(-24px, 24px) rotate(90deg)}:host(.to-right) .close{left:0rem;-webkit-transform:translate(-36px, 24px) rotate(-90deg);transform:translate(-36px, 24px) rotate(-90deg)}:host(.to-top){padding:2rem}@media (max-width: 767px){:host(.to-top){padding:1rem}}:host(.to-top){-ms-flex-pack:center;justify-content:center}:host(.to-top) .window,:host(.to-top)>::slotted([slot=\"window\"]){opacity:0;-webkit-transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, color, fill, height, margin, opacity, padding, width, -webkit-box-shadow, -webkit-transform;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width;transition-property:background-color, border-color, box-shadow, color, fill, height, margin, opacity, padding, transform, width, -webkit-box-shadow, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-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(.to-top-intro) .window,:host(.to-top-intro)>::slotted([slot=\"window\"]){-webkit-transform:rotateX(-22deg) scale(0.5) translateY(40%);transform:rotateX(-22deg) scale(0.5) translateY(40%)}:host(.to-top-opened.to-top-outro) .window,:host(.to-top-opened.to-top-outro)>::slotted([slot=\"window\"]),:host(.to-top-opened) .window,:host(.to-top-opened)>::slotted([slot=\"window\"]){opacity:1;-webkit-transform:rotateX(0) scale(1) translateY(0);transform:rotateX(0) scale(1) translateY(0)}:host(.to-top-outro) .window,:host(.to-top-outro)>::slotted([slot=\"window\"]){-webkit-transform:rotateX(-22deg) scale(0.5) translateY(-40%);transform:rotateX(-22deg) scale(0.5) translateY(-40%)}";
53
53
 
54
54
  const MdsModal = class {
55
- constructor(hostRef) {
56
- index.registerInstance(this, hostRef);
57
- this.closeEvent = index.createEvent(this, "mdsModalClose", 7);
58
- this.window = false;
59
- this.top = false;
60
- this.bottom = false;
61
- this.animationState = 'intro';
62
- this.km = new KeyboardManager();
63
- this.componentDidLoad = () => {
64
- var _a;
65
- this.km.addElement(this.host, 'host');
66
- const close = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.close');
67
- if (close)
68
- this.km.addElement(close, 'close');
69
- this.km.attachEscapeBehavior(() => this.closeEvent.emit());
70
- this.km.attachClickBehavior('close');
71
- };
72
- this.animationName = (customState = '', customPosition = '') => {
73
- return `to-${customPosition !== '' ? customPosition : this.position}${customState !== '' ? '-' + customState : ''}`;
74
- };
75
- this.closeModal = (e) => {
76
- var _a;
77
- if (((_a = e.target) === null || _a === void 0 ? void 0 : _a.localName) !== 'mds-modal') {
78
- return;
79
- }
80
- this.opened = e.target !== e.currentTarget;
81
- if (!this.opened) {
82
- this.closeEvent.emit();
83
- }
84
- };
85
- this.stateOpened = undefined;
86
- this.opened = false;
87
- this.position = 'center';
88
- }
89
- componentWillLoad() {
90
- var _a;
91
- this.bottom = this.host.querySelector('[slot="bottom"]') !== null;
92
- this.top = this.host.querySelector('[slot="top"]') !== null;
93
- this.window = this.host.querySelector('[slot="window"]') !== null;
94
- this.stateOpened = this.opened;
95
- if (!this.window) {
96
- this.position = 'right';
55
+ constructor(hostRef) {
56
+ index.registerInstance(this, hostRef);
57
+ this.closeEvent = index.createEvent(this, "mdsModalClose", 7);
58
+ this.window = false;
59
+ this.top = false;
60
+ this.bottom = false;
61
+ this.animationState = 'intro';
62
+ this.km = new KeyboardManager();
63
+ this.componentDidLoad = () => {
64
+ var _a;
65
+ this.km.addElement(this.host, 'host');
66
+ const close = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.close');
67
+ if (close)
68
+ this.km.addElement(close, 'close');
69
+ this.km.attachEscapeBehavior(() => this.closeEvent.emit());
70
+ this.km.attachClickBehavior('close');
71
+ };
72
+ this.animationName = (customState = '', customPosition = '') => {
73
+ return `to-${customPosition !== '' ? customPosition : this.position}${customState !== '' ? '-' + customState : ''}`;
74
+ };
75
+ this.closeModal = (e) => {
76
+ var _a;
77
+ if (((_a = e.target) === null || _a === void 0 ? void 0 : _a.localName) !== 'mds-modal') {
78
+ return;
79
+ }
80
+ this.opened = e.target !== e.currentTarget;
81
+ if (!this.opened) {
82
+ this.closeEvent.emit();
83
+ }
84
+ };
85
+ this.stateOpened = undefined;
86
+ this.opened = false;
87
+ this.position = 'center';
88
+ }
89
+ componentWillLoad() {
90
+ var _a;
91
+ this.bottom = this.host.querySelector('[slot="bottom"]') !== null;
92
+ this.top = this.host.querySelector('[slot="top"]') !== null;
93
+ this.window = this.host.querySelector('[slot="window"]') !== null;
94
+ this.stateOpened = this.opened;
95
+ if (!this.window) {
96
+ this.position = 'right';
97
+ }
98
+ if (this.window) {
99
+ (_a = this.host.querySelector('[slot="window"]')) === null || _a === void 0 ? void 0 : _a.setAttribute('role', 'modal');
100
+ }
101
+ }
102
+ componentWillRender() {
103
+ this.animationState = this.opened ? 'intro' : 'outro';
104
+ this.host.classList.add(this.animationName());
105
+ }
106
+ componentDidRender() {
107
+ this.animationDeelay = window.setTimeout(() => {
108
+ this.animationState = this.animationState === 'intro' ? 'outro' : 'intro';
109
+ this.host.classList.remove(this.animationName(this.animationState === 'intro' ? 'outro' : 'intro'));
110
+ this.host.classList.add(this.animationName(this.animationState));
111
+ window.clearTimeout(this.animationDeelay);
112
+ }, 500);
113
+ }
114
+ disconnectedCallback() {
115
+ this.km.detachEscapeBehavior();
116
+ this.km.detachClickBehavior('close');
117
+ }
118
+ positionChange(_newValue, oldValue) {
119
+ window.clearTimeout(this.animationDeelay);
120
+ this.host.classList.remove(this.animationName('', oldValue));
121
+ this.host.classList.remove(this.animationName('intro', oldValue));
122
+ this.host.classList.remove(this.animationName('outro', oldValue));
123
+ }
124
+ openedChange(newValue) {
125
+ this.stateOpened = newValue;
126
+ window.clearTimeout(this.animationDeelay);
127
+ }
128
+ onModalCloseListener() {
129
+ this.opened = false;
130
+ }
131
+ onBannerCloseListener() {
132
+ this.opened = false;
97
133
  }
98
- if (this.window) {
99
- (_a = this.host.querySelector('[slot="window"]')) === null || _a === void 0 ? void 0 : _a.setAttribute('role', 'modal');
134
+ render() {
135
+ return (index.h(index.Host, { "aria-modal": clsx(this.opened ? 'true' : 'false'), class: clsx(this.stateOpened && this.animationName('opened')), onClick: (e) => { this.closeModal(e); } }, this.window
136
+ ? index.h("slot", { name: "window" })
137
+ : index.h("div", { class: clsx('window', (this.top || this.bottom) && `window-${this.top ? '-top' : ''}${this.bottom ? '-bottom' : ''}`), role: "dialog", part: "window" }, this.top &&
138
+ index.h("slot", { name: "top" }), index.h("slot", null), this.bottom &&
139
+ index.h("slot", { name: "bottom" })), !this.window && index.h("i", { innerHTML: miBaselineClose, tabindex: "0", onClick: (e) => { this.closeModal(e); }, class: "svg close focus-bounce-light" })));
100
140
  }
101
- }
102
- componentWillRender() {
103
- this.animationState = this.opened ? 'intro' : 'outro';
104
- this.host.classList.add(this.animationName());
105
- }
106
- componentDidRender() {
107
- this.animationDeelay = window.setTimeout(() => {
108
- this.animationState = this.animationState === 'intro' ? 'outro' : 'intro';
109
- this.host.classList.remove(this.animationName(this.animationState === 'intro' ? 'outro' : 'intro'));
110
- this.host.classList.add(this.animationName(this.animationState));
111
- window.clearTimeout(this.animationDeelay);
112
- }, 500);
113
- }
114
- disconnectedCallback() {
115
- this.km.detachEscapeBehavior();
116
- this.km.detachClickBehavior('close');
117
- }
118
- positionChange(_newValue, oldValue) {
119
- window.clearTimeout(this.animationDeelay);
120
- this.host.classList.remove(this.animationName('', oldValue));
121
- this.host.classList.remove(this.animationName('intro', oldValue));
122
- this.host.classList.remove(this.animationName('outro', oldValue));
123
- }
124
- openedChange(newValue) {
125
- this.stateOpened = newValue;
126
- window.clearTimeout(this.animationDeelay);
127
- }
128
- onModalCloseListener() {
129
- this.opened = false;
130
- }
131
- onBannerCloseListener() {
132
- this.opened = false;
133
- }
134
- render() {
135
- return (index.h(index.Host, { "aria-modal": clsx(this.opened ? 'true' : 'false'), class: clsx(this.stateOpened && this.animationName('opened')), onClick: (e) => { this.closeModal(e); } }, this.window
136
- ? index.h("slot", { name: "window" })
137
- : index.h("div", { class: clsx('window', (this.top || this.bottom) && `window-${this.top ? '-top' : ''}${this.bottom ? '-bottom' : ''}`), role: "dialog", part: "window" }, this.top &&
138
- index.h("slot", { name: "top" }), index.h("slot", null), this.bottom &&
139
- index.h("slot", { name: "bottom" })), !this.window && index.h("i", { innerHTML: miBaselineClose, tabindex: "0", onClick: (e) => { this.closeModal(e); }, class: "svg close focus-bounce-light" })));
140
- }
141
- get host() { return index.getElement(this); }
142
- static get watchers() { return {
143
- "position": ["positionChange"],
144
- "opened": ["openedChange"]
145
- }; }
141
+ get host() { return index.getElement(this); }
142
+ static get watchers() { return {
143
+ "position": ["positionChange"],
144
+ "opened": ["openedChange"]
145
+ }; }
146
146
  };
147
147
  MdsModal.style = mdsModalCss;
148
148
 
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-1c3a970e.js');
5
+ const index = require('./index-95c329c0.js');
6
6
 
7
7
  /*
8
- Stencil Client Patch Browser v4.7.2 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Patch Browser v4.8.0 | MIT Licensed | https://stenciljs.com
9
9
  */
10
10
  const patchBrowser = () => {
11
11
  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));
@@ -4,7 +4,7 @@
4
4
  ],
5
5
  "compiler": {
6
6
  "name": "@stencil/core",
7
- "version": "4.7.2",
7
+ "version": "4.8.0",
8
8
  "typescriptVersion": "5.2.2"
9
9
  },
10
10
  "collections": [],
@@ -1,29 +1,29 @@
1
1
  const hash = (s) => {
2
- let i, h;
3
- for (i = 0, h = 0; i < s.length; i++) {
4
- h = Math.imul(31, h) + s.charCodeAt(i) | 0;
5
- }
6
- return h.toString();
2
+ let i, h;
3
+ for (i = 0, h = 0; i < s.length; i++) {
4
+ h = Math.imul(31, h) + s.charCodeAt(i) | 0;
5
+ }
6
+ return h.toString();
7
7
  };
8
8
  const randomInt = (max) => Math.floor(Math.random() * max);
9
9
  const unslugName = (name) => {
10
- var _a, _b, _c;
11
- return (_c = (_b = (_a = name.split('/')) === null || _a === void 0 ? void 0 : _a.slice(-1).pop()) === null || _b === void 0 ? void 0 : _b.replace(/-/g, ' ')) !== null && _c !== void 0 ? _c : name;
10
+ var _a, _b, _c;
11
+ return (_c = (_b = (_a = name.split('/')) === null || _a === void 0 ? void 0 : _a.slice(-1).pop()) === null || _b === void 0 ? void 0 : _b.replace(/-/g, ' ')) !== null && _c !== void 0 ? _c : name;
12
12
  };
13
13
  const setAttributeIfEmpty = (element, attribute, value) => {
14
- var _a;
15
- if (element.hasAttribute(attribute)) {
16
- return (_a = element.getAttribute(attribute)) !== null && _a !== void 0 ? _a : '';
17
- }
18
- element.setAttribute(attribute, value);
19
- return value;
14
+ var _a;
15
+ if (element.hasAttribute(attribute)) {
16
+ return (_a = element.getAttribute(attribute)) !== null && _a !== void 0 ? _a : '';
17
+ }
18
+ element.setAttribute(attribute, value);
19
+ return value;
20
20
  };
21
21
  const hashValue = (value) => `${value}-${hash(value)}`;
22
22
  const hashRandomValue = (value) => {
23
- const randomValue = randomInt(1000000);
24
- if (value) {
25
- return `${value}-${hash(randomValue.toString())}`;
26
- }
27
- return hash(randomValue.toString());
23
+ const randomValue = randomInt(1000000);
24
+ if (value) {
25
+ return `${value}-${hash(randomValue.toString())}`;
26
+ }
27
+ return hash(randomValue.toString());
28
28
  };
29
29
  export { unslugName, setAttributeIfEmpty, hashRandomValue, hashValue, };
@@ -1,40 +1,40 @@
1
1
  export class KeyboardManager {
2
- constructor() {
3
- this.elements = [];
4
- this.handleClickBehaviorDispatchEvent = (event) => {
5
- if (event.code === 'Space' || event.code === 'Enter' || event.code === 'NumpadEnter') {
6
- event.target.click();
7
- }
8
- };
9
- this.handleEscapeBehaviorDispatchEvent = (event) => {
10
- if (event.code === 'Escape' && this.escapeCallback) {
11
- this.escapeCallback();
12
- }
13
- };
14
- this.addElement = (el, name = 'element') => {
15
- this.elements[name] = el;
16
- };
17
- this.attachClickBehavior = (name = 'element') => {
18
- if (this.elements[name]) {
19
- this.elements[name].addEventListener('keydown', this.handleClickBehaviorDispatchEvent);
20
- }
21
- };
22
- this.detachClickBehavior = (name = 'element') => {
23
- if (this.elements[name]) {
24
- this.elements[name].removeEventListener('keydown', this.handleClickBehaviorDispatchEvent);
25
- }
26
- };
27
- this.attachEscapeBehavior = (callBack) => {
28
- this.escapeCallback = callBack;
29
- if (window !== undefined) {
30
- window.addEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
31
- }
32
- };
33
- this.detachEscapeBehavior = () => {
34
- this.escapeCallback = () => { return; };
35
- if (window !== undefined) {
36
- window.removeEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
37
- }
38
- };
39
- }
2
+ constructor() {
3
+ this.elements = [];
4
+ this.handleClickBehaviorDispatchEvent = (event) => {
5
+ if (event.code === 'Space' || event.code === 'Enter' || event.code === 'NumpadEnter') {
6
+ event.target.click();
7
+ }
8
+ };
9
+ this.handleEscapeBehaviorDispatchEvent = (event) => {
10
+ if (event.code === 'Escape' && this.escapeCallback) {
11
+ this.escapeCallback();
12
+ }
13
+ };
14
+ this.addElement = (el, name = 'element') => {
15
+ this.elements[name] = el;
16
+ };
17
+ this.attachClickBehavior = (name = 'element') => {
18
+ if (this.elements[name]) {
19
+ this.elements[name].addEventListener('keydown', this.handleClickBehaviorDispatchEvent);
20
+ }
21
+ };
22
+ this.detachClickBehavior = (name = 'element') => {
23
+ if (this.elements[name]) {
24
+ this.elements[name].removeEventListener('keydown', this.handleClickBehaviorDispatchEvent);
25
+ }
26
+ };
27
+ this.attachEscapeBehavior = (callBack) => {
28
+ this.escapeCallback = callBack;
29
+ if (window !== undefined) {
30
+ window.addEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
31
+ }
32
+ };
33
+ this.detachEscapeBehavior = () => {
34
+ this.escapeCallback = () => { return; };
35
+ if (window !== undefined) {
36
+ window.removeEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
37
+ }
38
+ };
39
+ }
40
40
  }
@@ -1,10 +1,10 @@
1
1
  const cssDurationToMilliseconds = (duration, defaultValue = 1000) => {
2
- if (duration.includes('s')) {
3
- return Number(duration.replace('s', '')) * 1000;
4
- }
5
- if (duration.includes('ms')) {
6
- return Number(duration.replace('s', ''));
7
- }
8
- return defaultValue;
2
+ if (duration.includes('s')) {
3
+ return Number(duration.replace('s', '')) * 1000;
4
+ }
5
+ if (duration.includes('ms')) {
6
+ return Number(duration.replace('s', ''));
7
+ }
8
+ return defaultValue;
9
9
  };
10
10
  export { cssDurationToMilliseconds, };