@maggioli-design-system/mds-modal 5.0.0 → 5.2.1

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 (70) hide show
  1. package/dist/cjs/mds-modal.cjs.entry.js +7 -5
  2. package/dist/collection/common/aria.js +17 -1
  3. package/dist/collection/common/device.js +6 -0
  4. package/dist/collection/common/keyboard-manager.js +2 -2
  5. package/dist/collection/common/slot.js +13 -0
  6. package/dist/collection/components/mds-modal/mds-modal.css +10 -23
  7. package/dist/collection/components/mds-modal/mds-modal.js +6 -4
  8. package/dist/collection/components/mds-modal/test/mds-modal.stories.js +15 -6
  9. package/dist/collection/dictionary/animation.js +5 -0
  10. package/dist/collection/dictionary/file-extensions.js +61 -56
  11. package/dist/collection/dictionary/text.js +60 -1
  12. package/dist/collection/fixtures/filenames.js +62 -1
  13. package/dist/collection/type/animation.js +1 -0
  14. package/dist/collection/type/variant-file-format.js +5 -0
  15. package/dist/components/mds-modal.js +7 -5
  16. package/dist/documentation.json +11 -1
  17. package/dist/esm/mds-modal.entry.js +7 -5
  18. package/dist/esm-es5/mds-modal.entry.js +1 -1
  19. package/dist/mds-modal/mds-modal.esm.js +1 -1
  20. package/dist/mds-modal/p-08a99956.entry.js +1 -0
  21. package/dist/mds-modal/p-0d78ea55.system.entry.js +1 -0
  22. package/dist/mds-modal/p-67c6f337.system.js +1 -1
  23. package/dist/stats.json +36 -17
  24. package/dist/types/common/aria.d.ts +3 -1
  25. package/dist/types/common/device.d.ts +2 -0
  26. package/dist/types/common/slot.d.ts +2 -0
  27. package/dist/types/components/mds-modal/test/mds-modal.stories.d.ts +3 -3
  28. package/dist/types/dictionary/animation.d.ts +2 -0
  29. package/dist/types/dictionary/text.d.ts +3 -1
  30. package/dist/types/fixtures/filenames.d.ts +62 -1
  31. package/dist/types/type/animation.d.ts +1 -0
  32. package/dist/types/type/file-types.d.ts +1 -1
  33. package/dist/types/type/text.d.ts +2 -0
  34. package/dist/types/type/variant-file-format.d.ts +1 -1
  35. package/documentation.json +35 -10
  36. package/package.json +2 -2
  37. package/readme.md +2 -0
  38. package/src/common/aria.ts +22 -2
  39. package/src/common/device.ts +9 -0
  40. package/src/common/keyboard-manager.ts +2 -2
  41. package/src/common/slot.ts +15 -0
  42. package/src/components/mds-modal/css/mds-modal-animate-left.css +2 -1
  43. package/src/components/mds-modal/css/mds-modal-animate-right.css +2 -1
  44. package/src/components/mds-modal/css/mds-modal-animate.css +0 -10
  45. package/src/components/mds-modal/mds-modal.css +6 -0
  46. package/src/components/mds-modal/mds-modal.tsx +3 -2
  47. package/src/components/mds-modal/readme.md +2 -0
  48. package/src/components/mds-modal/test/mds-modal.stories.tsx +18 -8
  49. package/src/dictionary/animation.ts +8 -0
  50. package/src/dictionary/file-extensions.ts +61 -56
  51. package/src/dictionary/text.ts +64 -0
  52. package/src/fixtures/filenames.ts +63 -0
  53. package/src/fixtures/icons.json +9 -0
  54. package/src/fixtures/iconsauce.json +5 -0
  55. package/src/meta/file-format/locale.el.json +44 -0
  56. package/src/meta/file-format/locale.en.json +44 -0
  57. package/src/meta/file-format/locale.es.json +44 -0
  58. package/src/meta/file-format/locale.it.json +44 -0
  59. package/src/type/animation.ts +3 -0
  60. package/src/type/file-types.ts +6 -0
  61. package/src/type/text.ts +59 -0
  62. package/src/type/variant-file-format.ts +6 -0
  63. package/www/build/mds-modal.esm.js +1 -1
  64. package/www/build/p-08a99956.entry.js +1 -0
  65. package/www/build/p-0d78ea55.system.entry.js +1 -0
  66. package/www/build/p-67c6f337.system.js +1 -1
  67. package/dist/mds-modal/p-63a918d2.system.entry.js +0 -1
  68. package/dist/mds-modal/p-67200987.entry.js +0 -1
  69. package/www/build/p-63a918d2.system.entry.js +0 -1
  70. package/www/build/p-67200987.entry.js +0 -1
@@ -16,7 +16,7 @@ const cssDurationToMilliseconds = (duration, defaultValue = 1000) => {
16
16
  return defaultValue;
17
17
  };
18
18
 
19
- const mdsModalCss = "@-webkit-keyframes focus-bounce {\n 0%, 75%, 100% {\n outline-offset: var(--magma-outline-focus-offset, 6px);\n }\n\n 50% {\n outline-offset: var(--magma-outline-blur-offset, 2px);\n }\n}\n @keyframes focus-bounce {\n 0%, 75%, 100% {\n outline-offset: var(--magma-outline-focus-offset, 6px);\n }\n\n 50% {\n outline-offset: var(--magma-outline-blur-offset, 2px);\n }\n}\n /* included for focus effect */\n@tailwind components;\n@tailwind utilities;\n\n/**\n * @prop --mds-modal-close-icon-color: Set the color of the close icon button to the top left.\n * @prop --mds-modal-overlay-color: Set the overlay color of the background when the component is opened, this property can be inherited from `globals.css` in `styles^8.0.0`.\n * @prop --mds-modal-overlay-opacity: Set the overlay color opacity of the background when the component is opened, this property can be inherited from `globals.css` in `styles^8.0.0`.\n * @prop --mds-modal-window-background: Set the background color of the window\n * @prop --mds-modal-window-overflow: Set the overflow of the window\n * @prop --mds-modal-window-shadow: Set the box shadow of the window\n * @prop --mds-modal-z-index: Set the z-index of the window when the component is opened\n */\n\n:host {\n\n --mds-modal-overlay-color: var(--magma-overlay-color, 0 0 0);\n --mds-modal-overlay-opacity: var(--magma-overlay-opacity, 0.5);\n --mds-modal-transition-duration: 500ms;\n --mds-modal-transition-intro-ease: cubic-bezier(0.19, 1, 0.22, 1);\n --mds-modal-transition-outro-ease: cubic-bezier(0.86, 0, 0.07, 1);\n --mds-modal-window-background: rgb(var(--tone-neutral));\n --mds-modal-window-overflow: auto;\n --mds-modal-window-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);\n --mds-modal-z-index: var(--magma-modal-z-index);\n -webkit-transition-timing-function: cubic-bezier(1, 0, 0, 1);\n transition-timing-function: cubic-bezier(1, 0, 0, 1);\n\n -ms-flex-align: center;\n\n align-items: center;\n background-color: rgba(var(--mds-modal-overlay-color) / 0);\n display: -ms-flexbox;\n display: flex;\n fill: rgb(var(--tone-neutral));\n inset: 0;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-perspective: 600px;\n perspective: 600px;\n pointer-events: none;\n position: fixed;\n -webkit-transition-duration: var(--mds-modal-transition-duration);\n transition-duration: var(--mds-modal-transition-duration);\n -webkit-transition-property: background-color;\n transition-property: background-color;\n z-index: var(--mds-modal-z-index, 1000);\n}\n\n:host( [position=\"top\"] ) {\n -ms-flex-align: start;\n align-items: flex-start;\n -ms-flex-pack: center;\n justify-content: center;\n}\n\n:host( [position=\"bottom\"] ) {\n -ms-flex-align: end;\n align-items: flex-end;\n -ms-flex-pack: center;\n justify-content: center;\n}\n\n.action-close {\n border-radius: 100px;\n opacity: 0;\n pointer-events: none;\n position: absolute;\n -webkit-transition-duration: var(--mds-modal-transition-duration);\n transition-duration: var(--mds-modal-transition-duration);\n -webkit-transition-property: bottom, opacity, top, -webkit-transform;\n transition-property: bottom, opacity, top, -webkit-transform;\n transition-property: bottom, opacity, top, transform;\n transition-property: bottom, opacity, top, transform, -webkit-transform;\n -webkit-transition-timing-function: cubic-bezier(1, 0, 0, 1);\n transition-timing-function: cubic-bezier(1, 0, 0, 1);\n}\n\n:host([opened]:not([opened=\"false\"])) .action-close {\n opacity: 1;\n pointer-events: auto;\n}\n\n.action-close::part(icon) {\n height: 2.25rem;\n width: 2.25rem;\n}\n\n.window {\n gap: 0rem;\n\n background-color: var(--mds-modal-window-background);\n -webkit-box-shadow: var(--mds-modal-window-shadow);\n box-shadow: var(--mds-modal-window-shadow);\n display: grid;\n grid-template-rows: 1fr;\n overflow: var(--mds-modal-window-overflow);\n}\n\n.window--top {\n grid-template-rows: auto 1fr;\n}\n\n.window--bottom {\n grid-template-rows: 1fr auto;\n}\n\n.window--top-bottom {\n grid-template-rows: auto 1fr auto;\n}\n\n:host {\n padding: 2rem;\n}\n\n@media (max-width: 767px) {\n :host {\n padding: 1rem;\n }\n}\n\n:host .window {\n margin: -2rem;\n}\n\n@media (max-width: 767px) {\n :host .window {\n margin: -1rem;\n }\n}\n\n:host .window {\n\n -webkit-transition-delay: 0s, calc(var(--mds-modal-transition-duration) / 2);\n\n transition-delay: 0s, calc(var(--mds-modal-transition-duration) / 2);\n}\n\n\n:host([opened]:not([opened=\"false\"]) ) {\n background-color: rgba(var(--mds-modal-overlay-color) / var(--mds-modal-overlay-opacity));\n pointer-events: auto;\n}\n\n:host .window,\n:host > ::slotted( [slot=\"window\"] ) {\n opacity: 0;\n -webkit-transition-duration: var(--mds-modal-transition-duration);\n transition-duration: var(--mds-modal-transition-duration);\n -webkit-transition-property: opacity, -webkit-transform;\n transition-property: opacity, -webkit-transform;\n transition-property: transform, opacity;\n transition-property: transform, opacity, -webkit-transform;\n -webkit-transition-timing-function: var(--mds-modal-transition-outro-ease);\n transition-timing-function: var(--mds-modal-transition-outro-ease);\n}\n\n:host([opened]:not([opened=\"false\"]) ) .window,\n:host([opened]:not([opened=\"false\"]) ) > ::slotted( [slot=\"window\"] ) {\n opacity: 1;\n -webkit-transform: rotate(0) scale(1) translateY(0);\n transform: rotate(0) scale(1) translateY(0);\n -webkit-transition-delay: 0s;\n transition-delay: 0s;\n -webkit-transition-timing-function: var(--mds-modal-transition-intro-ease);\n transition-timing-function: var(--mds-modal-transition-intro-ease);\n}\n\n:host([position=\"bottom-left\"]) {\n -ms-flex-align: end;\n align-items: flex-end;\n -ms-flex-pack: start;\n justify-content: flex-start;\n}\n\n:host([position=\"bottom\"]) .window {\n height: auto;\n width: 100vw;\n}\n\n:host([position=\"bottom-left\"][opened=\"false\"]) > ::slotted( [slot=\"window\"] ),\n:host([position=\"bottom-left\"]:not([opened])) > ::slotted( [slot=\"window\"] ) {\n -webkit-transform: rotateX(22deg) rotateY(22deg) scale(0.5) translate(-80%, 80%);\n transform: rotateX(22deg) rotateY(22deg) scale(0.5) translate(-80%, 80%);\n}\n\n:host([position=\"bottom-left\"][opened=\"false\"]) .window,\n:host([position=\"bottom-left\"]:not([opened])) .window {\n -webkit-transform: translate(0, 100%);\n transform: translate(0, 100%);\n}\n\n:host([position=\"bottom-right\"]) {\n -ms-flex-align: end;\n align-items: flex-end;\n -ms-flex-pack: end;\n justify-content: flex-end;\n}\n\n:host([position=\"bottom\"]) .window {\n height: auto;\n width: 100vw;\n}\n\n:host([position=\"bottom-right\"][opened=\"false\"]) > ::slotted( [slot=\"window\"] ),\n:host([position=\"bottom-right\"]:not([opened])) > ::slotted( [slot=\"window\"] ) {\n -webkit-transform: rotateX(-22deg) rotateY(-22deg) scale(0.5) translate(80%, 80%);\n transform: rotateX(-22deg) rotateY(-22deg) scale(0.5) translate(80%, 80%);\n}\n\n:host([position=\"bottom-right\"][opened=\"false\"]) .window,\n:host([position=\"bottom-right\"]:not([opened])) .window {\n -webkit-transform: translate(0, 100%);\n transform: translate(0, 100%);\n}\n\n:host([position=\"bottom\"]) {\n -ms-flex-align: end;\n align-items: flex-end;\n -ms-flex-pack: center;\n justify-content: center;\n}\n\n:host([position=\"bottom\"]) .window {\n height: auto;\n width: 100vw;\n}\n\n:host([position=\"bottom\"][opened=\"false\"]) > ::slotted( [slot=\"window\"] ),\n:host([position=\"bottom\"]:not([opened])) > ::slotted( [slot=\"window\"] ) {\n -webkit-transform: rotateX(22deg) rotateY(0) scale(0.5) translate(0, 80%);\n transform: rotateX(22deg) rotateY(0) scale(0.5) translate(0, 80%);\n}\n\n:host([position=\"bottom\"][opened=\"false\"]) .window,\n:host([position=\"bottom\"]:not([opened])) .window {\n -webkit-transform: translate(0, 100%);\n transform: translate(0, 100%);\n}\n\n:host([position=\"center\"]) {\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n\n:host([position=\"center\"]) .window {\n -webkit-transition-delay: 0s;\n transition-delay: 0s;\n}\n\n:host([position=\"center\"][opened=\"false\"]) > ::slotted( [slot=\"window\"] ),\n:host([position=\"center\"]:not([opened])) > ::slotted( [slot=\"window\"] ) {\n -webkit-transform: rotateX(0) rotateY(22deg) scale(0.5) translate(0, 40%);\n transform: rotateX(0) rotateY(22deg) scale(0.5) translate(0, 40%);\n}\n\n:host([position=\"center\"][opened=\"false\"]) .window,\n:host([position=\"center\"]:not([opened])) .window {\n -webkit-transform: rotateX(0) rotateY(0) scale(0.5) translate(0, 0);\n transform: rotateX(0) rotateY(0) scale(0.5) translate(0, 0);\n}\n\n:host([position=\"left\"]) {\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-pack: start;\n justify-content: flex-start;\n}\n\n:host([position=\"left\"]) .window {\n height: 100dvh;\n max-width: calc(100vw - 80px);\n}\n\n:host([position=\"left\"][opened=\"false\"]) > ::slotted( [slot=\"window\"] ),\n:host([position=\"left\"]:not([opened])) > ::slotted( [slot=\"window\"] ) {\n -webkit-transform: rotateX(0) rotateY(22deg) rotateZ(0) scale(0.5) translate(-100%, 0%);\n transform: rotateX(0) rotateY(22deg) rotateZ(0) scale(0.5) translate(-100%, 0%);\n}\n\n:host([position=\"left\"][opened=\"false\"]) .window,\n:host([position=\"left\"]:not([opened])) .window {\n -webkit-transform: translate(-100%, 0%);\n transform: translate(-100%, 0%);\n}\n\n:host([position=\"left\"]) .action-close {\n right: 0.75rem;\n top: 0.75rem;\n -webkit-transform: translateX(-120%) rotate(-45deg);\n transform: translateX(-120%) rotate(-45deg);\n}\n\n:host([position=\"left\"][opened]:not([opened=\"false\"])) .action-close {\n -webkit-transform: translateX(0);\n transform: translateX(0);\n}\n\n:host([position=\"right\"]) {\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-pack: end;\n justify-content: flex-end;\n}\n\n:host([position=\"right\"]) .window {\n height: 100dvh;\n max-width: calc(100vw - 80px);\n}\n\n:host([position=\"right\"][opened=\"false\"]) > ::slotted( [slot=\"window\"] ),\n:host([position=\"right\"]:not([opened])) > ::slotted( [slot=\"window\"] ) {\n -webkit-transform: rotateX(0) rotateY(-22deg) rotateZ(0) scale(0.5) translate(100%, 0%);\n transform: rotateX(0) rotateY(-22deg) rotateZ(0) scale(0.5) translate(100%, 0%);\n}\n\n:host([position=\"right\"][opened=\"false\"]) .window,\n:host([position=\"right\"]:not([opened])) .window {\n -webkit-transform: translate(100%, 0%);\n transform: translate(100%, 0%);\n}\n\n:host([position=\"right\"]) .action-close {\n left: 0.75rem;\n top: 0.75rem;\n -webkit-transform: translateX(120%) rotate(45deg);\n transform: translateX(120%) rotate(45deg);\n}\n\n:host([position=\"right\"][opened]:not([opened=\"false\"])) .action-close {\n -webkit-transform: translateX(0);\n transform: translateX(0);\n}\n\n:host([position=\"top-left\"]) {\n -ms-flex-align: start;\n align-items: flex-start;\n -ms-flex-pack: start;\n justify-content: flex-start;\n}\n\n:host([position=\"bottom\"]) .window {\n height: auto;\n width: 100vw;\n}\n\n:host([position=\"top-left\"][opened=\"false\"]) > ::slotted( [slot=\"window\"] ),\n:host([position=\"top-left\"]:not([opened])) > ::slotted( [slot=\"window\"] ) {\n -webkit-transform: rotateX(22deg) rotateY(22deg) scale(0.5) translate(-80%, 80%);\n transform: rotateX(22deg) rotateY(22deg) scale(0.5) translate(-80%, 80%);\n}\n\n:host([position=\"top-left\"][opened=\"false\"]) .window,\n:host([position=\"top-left\"]:not([opened])) .window {\n -webkit-transform: translate(0, -100%);\n transform: translate(0, -100%);\n}\n\n:host([position=\"top-right\"]) {\n -ms-flex-align: start;\n align-items: flex-start;\n -ms-flex-pack: end;\n justify-content: flex-end;\n}\n\n:host([position=\"bottom\"]) .window {\n height: auto;\n width: 100vw;\n}\n\n:host([position=\"top-right\"][opened=\"false\"]) > ::slotted( [slot=\"window\"] ),\n:host([position=\"top-right\"]:not([opened])) > ::slotted( [slot=\"window\"] ) {\n -webkit-transform: rotateX(-22deg) rotateY(-22deg) scale(0.5) translate(80%, 80%);\n transform: rotateX(-22deg) rotateY(-22deg) scale(0.5) translate(80%, 80%);\n}\n\n:host([position=\"top-right\"][opened=\"false\"]) .window,\n:host([position=\"top-right\"]:not([opened])) .window {\n -webkit-transform: translate(0, 100%);\n transform: translate(0, 100%);\n}\n\n:host([position=\"top\"]) {\n -ms-flex-align: start;\n align-items: flex-start;\n -ms-flex-pack: center;\n justify-content: center;\n}\n\n:host([position=\"bottom\"]) .window {\n height: auto;\n width: 100vw;\n}\n\n:host([position=\"top\"][opened=\"false\"]) > ::slotted( [slot=\"window\"] ),\n:host([position=\"top\"]:not([opened])) > ::slotted( [slot=\"window\"] ) {\n -webkit-transform: rotateX(-22deg) rotateY(0) scale(0.5) translate(0, -80%);\n transform: rotateX(-22deg) rotateY(0) scale(0.5) translate(0, -80%);\n}\n\n:host([position=\"top\"][opened=\"false\"]) .window,\n:host([position=\"top\"]:not([opened])) .window {\n -webkit-transform: translate(0, -100%);\n transform: translate(0, -100%);\n}\n\n@tailwind utilities;\n\n@container style(--magma-pref-animation: reduce) {\n :host,\n .action-close,\n .window {\n -webkit-transition-duration: 0s !important;\n transition-duration: 0s !important;\n }\n\n :host {\n\n --mds-modal-transition-duration: 0s;\n }\n}\n\n@container style(--magma-pref-animation: system) {\n\n @media (prefers-reduced-motion) {\n :host,\n .action-close,\n .window {\n -webkit-transition-duration: 0s !important;\n transition-duration: 0s !important;\n }\n\n :host {\n\n --mds-modal-transition-duration: 0s;\n }\n }\n}\n\n@tailwind utilities;\n\n@container style(--magma-pref-contrast: more) {\n :host {\n\n --mds-modal-window-shadow: 0 0 0 2px rgb(var(--tone-neutral-01) / 0.6), 0 25px 50px -12px rgb(0 0 0 / 0.25);\n }\n}\n\n@container style(--magma-pref-contrast: system) {\n\n @media (prefers-contrast: more) {\n :host {\n\n --mds-modal-window-shadow: 0 0 0 2px rgb(var(--tone-neutral-01) / 0.6), 0 25px 50px -12px rgb(0 0 0 / 0.25);\n }\n }\n}\n\n@container style(--magma-pref-theme: dark) {\n :host {\n\n --mds-modal-window-background: rgb(var(--tone-neutral-09));\n --mds-modal-window-shadow: 0 0 0 1px rgb(var(--tone-neutral-01) / 0.3), 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);\n }\n}\n\n@container style(--magma-pref-theme: system) {\n\n @media (prefers-color-scheme: dark) {\n :host {\n\n --mds-modal-window-background: rgb(var(--tone-neutral-09));\n --mds-modal-window-shadow: 0 0 0 1px rgb(var(--tone-neutral-01) / 0.3), 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);\n }\n }\n}\n\n\n";
19
+ const mdsModalCss = "@-webkit-keyframes focus-bounce {\n 0%, 75%, 100% {\n outline-offset: var(--magma-outline-focus-offset, 6px);\n }\n\n 50% {\n outline-offset: var(--magma-outline-blur-offset, 2px);\n }\n}\n @keyframes focus-bounce {\n 0%, 75%, 100% {\n outline-offset: var(--magma-outline-focus-offset, 6px);\n }\n\n 50% {\n outline-offset: var(--magma-outline-blur-offset, 2px);\n }\n}\n /* included for focus effect */\n@tailwind components;\n@tailwind utilities;\n\n/**\n * @prop --mds-modal-close-icon-color: Set the color of the close icon button to the top left.\n * @prop --mds-modal-overlay-color: Set the overlay color of the background when the component is opened, this property can be inherited from `globals.css` in `styles^8.0.0`.\n * @prop --mds-modal-overlay-opacity: Set the overlay color opacity of the background when the component is opened, this property can be inherited from `globals.css` in `styles^8.0.0`.\n * @prop --mds-modal-window-background: Set the background color of the window\n * @prop --mds-modal-window-overflow: Set the overflow of the window\n * @prop --mds-modal-window-radius: Set the border radius of the window\n * @prop --mds-modal-window-distance: Set the distance between the modal window and the screen bounds\n * @prop --mds-modal-window-shadow: Set the box shadow of the window\n * @prop --mds-modal-z-index: Set the z-index of the window when the component is opened\n */\n\n:host {\n\n --mds-modal-overlay-color: var(--magma-overlay-color, 0 0 0);\n --mds-modal-overlay-opacity: var(--magma-overlay-opacity, 0.5);\n --mds-modal-transition-duration: 500ms;\n --mds-modal-transition-intro-ease: cubic-bezier(0.19, 1, 0.22, 1);\n --mds-modal-transition-outro-ease: cubic-bezier(0.86, 0, 0.07, 1);\n --mds-modal-window-background: rgb(var(--tone-neutral));\n --mds-modal-window-overflow: auto;\n --mds-modal-window-radius: 0;\n --mds-modal-window-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);\n --mds-modal-window-distance: 0;\n --mds-modal-z-index: var(--magma-modal-z-index);\n -webkit-transition-timing-function: cubic-bezier(1, 0, 0, 1);\n transition-timing-function: cubic-bezier(1, 0, 0, 1);\n\n -ms-flex-align: center;\n\n align-items: center;\n background-color: rgba(var(--mds-modal-overlay-color) / 0);\n display: -ms-flexbox;\n display: flex;\n fill: rgb(var(--tone-neutral));\n inset: 0;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-perspective: 600px;\n perspective: 600px;\n pointer-events: none;\n position: fixed;\n -webkit-transition-duration: var(--mds-modal-transition-duration);\n transition-duration: var(--mds-modal-transition-duration);\n -webkit-transition-property: background-color;\n transition-property: background-color;\n z-index: var(--mds-modal-z-index, 1000);\n}\n\n:host( [position=\"top\"] ) {\n -ms-flex-align: start;\n align-items: flex-start;\n -ms-flex-pack: center;\n justify-content: center;\n}\n\n:host( [position=\"bottom\"] ) {\n -ms-flex-align: end;\n align-items: flex-end;\n -ms-flex-pack: center;\n justify-content: center;\n}\n\n.action-close {\n border-radius: 100px;\n opacity: 0;\n pointer-events: none;\n position: absolute;\n -webkit-transition-duration: var(--mds-modal-transition-duration);\n transition-duration: var(--mds-modal-transition-duration);\n -webkit-transition-property: bottom, opacity, top, -webkit-transform;\n transition-property: bottom, opacity, top, -webkit-transform;\n transition-property: bottom, opacity, top, transform;\n transition-property: bottom, opacity, top, transform, -webkit-transform;\n -webkit-transition-timing-function: cubic-bezier(1, 0, 0, 1);\n transition-timing-function: cubic-bezier(1, 0, 0, 1);\n}\n\n:host([opened]:not([opened=\"false\"])) .action-close {\n opacity: 1;\n pointer-events: auto;\n}\n\n.action-close::part(icon) {\n height: 2.25rem;\n width: 2.25rem;\n}\n\n.window {\n gap: 0rem;\n\n background-color: var(--mds-modal-window-background);\n border-radius: var(--mds-modal-window-radius);\n -webkit-box-shadow: var(--mds-modal-window-shadow);\n box-shadow: var(--mds-modal-window-shadow);\n display: grid;\n grid-template-rows: 1fr;\n margin: var(--mds-modal-window-distance);\n overflow: var(--mds-modal-window-overflow);\n}\n\n.window--top {\n grid-template-rows: auto 1fr;\n}\n\n.window--bottom {\n grid-template-rows: 1fr auto;\n}\n\n.window--top-bottom {\n grid-template-rows: auto 1fr auto;\n}\n\n:host .window {\n -webkit-transition-delay: 0s, calc(var(--mds-modal-transition-duration) / 2);\n transition-delay: 0s, calc(var(--mds-modal-transition-duration) / 2);\n}\n\n\n:host([opened]:not([opened=\"false\"]) ) {\n background-color: rgba(var(--mds-modal-overlay-color) / var(--mds-modal-overlay-opacity));\n pointer-events: auto;\n}\n\n:host .window,\n:host > ::slotted( [slot=\"window\"] ) {\n opacity: 0;\n -webkit-transition-duration: var(--mds-modal-transition-duration);\n transition-duration: var(--mds-modal-transition-duration);\n -webkit-transition-property: opacity, -webkit-transform;\n transition-property: opacity, -webkit-transform;\n transition-property: transform, opacity;\n transition-property: transform, opacity, -webkit-transform;\n -webkit-transition-timing-function: var(--mds-modal-transition-outro-ease);\n transition-timing-function: var(--mds-modal-transition-outro-ease);\n}\n\n:host([opened]:not([opened=\"false\"]) ) .window,\n:host([opened]:not([opened=\"false\"]) ) > ::slotted( [slot=\"window\"] ) {\n opacity: 1;\n -webkit-transform: rotate(0) scale(1) translateY(0);\n transform: rotate(0) scale(1) translateY(0);\n -webkit-transition-delay: 0s;\n transition-delay: 0s;\n -webkit-transition-timing-function: var(--mds-modal-transition-intro-ease);\n transition-timing-function: var(--mds-modal-transition-intro-ease);\n}\n\n:host([position=\"bottom-left\"]) {\n -ms-flex-align: end;\n align-items: flex-end;\n -ms-flex-pack: start;\n justify-content: flex-start;\n}\n\n:host([position=\"bottom\"]) .window {\n height: auto;\n width: 100vw;\n}\n\n:host([position=\"bottom-left\"][opened=\"false\"]) > ::slotted( [slot=\"window\"] ),\n:host([position=\"bottom-left\"]:not([opened])) > ::slotted( [slot=\"window\"] ) {\n -webkit-transform: rotateX(22deg) rotateY(22deg) scale(0.5) translate(-80%, 80%);\n transform: rotateX(22deg) rotateY(22deg) scale(0.5) translate(-80%, 80%);\n}\n\n:host([position=\"bottom-left\"][opened=\"false\"]) .window,\n:host([position=\"bottom-left\"]:not([opened])) .window {\n -webkit-transform: translate(0, 100%);\n transform: translate(0, 100%);\n}\n\n:host([position=\"bottom-right\"]) {\n -ms-flex-align: end;\n align-items: flex-end;\n -ms-flex-pack: end;\n justify-content: flex-end;\n}\n\n:host([position=\"bottom\"]) .window {\n height: auto;\n width: 100vw;\n}\n\n:host([position=\"bottom-right\"][opened=\"false\"]) > ::slotted( [slot=\"window\"] ),\n:host([position=\"bottom-right\"]:not([opened])) > ::slotted( [slot=\"window\"] ) {\n -webkit-transform: rotateX(-22deg) rotateY(-22deg) scale(0.5) translate(80%, 80%);\n transform: rotateX(-22deg) rotateY(-22deg) scale(0.5) translate(80%, 80%);\n}\n\n:host([position=\"bottom-right\"][opened=\"false\"]) .window,\n:host([position=\"bottom-right\"]:not([opened])) .window {\n -webkit-transform: translate(0, 100%);\n transform: translate(0, 100%);\n}\n\n:host([position=\"bottom\"]) {\n -ms-flex-align: end;\n align-items: flex-end;\n -ms-flex-pack: center;\n justify-content: center;\n}\n\n:host([position=\"bottom\"]) .window {\n height: auto;\n width: 100vw;\n}\n\n:host([position=\"bottom\"][opened=\"false\"]) > ::slotted( [slot=\"window\"] ),\n:host([position=\"bottom\"]:not([opened])) > ::slotted( [slot=\"window\"] ) {\n -webkit-transform: rotateX(22deg) rotateY(0) scale(0.5) translate(0, 80%);\n transform: rotateX(22deg) rotateY(0) scale(0.5) translate(0, 80%);\n}\n\n:host([position=\"bottom\"][opened=\"false\"]) .window,\n:host([position=\"bottom\"]:not([opened])) .window {\n -webkit-transform: translate(0, 100%);\n transform: translate(0, 100%);\n}\n\n:host([position=\"center\"]) {\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n\n:host([position=\"center\"]) .window {\n -webkit-transition-delay: 0s;\n transition-delay: 0s;\n}\n\n:host([position=\"center\"][opened=\"false\"]) > ::slotted( [slot=\"window\"] ),\n:host([position=\"center\"]:not([opened])) > ::slotted( [slot=\"window\"] ) {\n -webkit-transform: rotateX(0) rotateY(22deg) scale(0.5) translate(0, 40%);\n transform: rotateX(0) rotateY(22deg) scale(0.5) translate(0, 40%);\n}\n\n:host([position=\"center\"][opened=\"false\"]) .window,\n:host([position=\"center\"]:not([opened])) .window {\n -webkit-transform: rotateX(0) rotateY(0) scale(0.5) translate(0, 0);\n transform: rotateX(0) rotateY(0) scale(0.5) translate(0, 0);\n}\n\n:host([position=\"left\"]) {\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-pack: start;\n justify-content: flex-start;\n}\n\n:host([position=\"left\"]) .window {\n height: 100%;\n max-height: calc(100dvh - calc(var(--mds-modal-window-distance) * 2));\n max-width: calc(100vw - 80px);\n}\n\n:host([position=\"left\"][opened=\"false\"]) > ::slotted( [slot=\"window\"] ),\n:host([position=\"left\"]:not([opened])) > ::slotted( [slot=\"window\"] ) {\n -webkit-transform: rotateX(0) rotateY(22deg) rotateZ(0) scale(0.5) translate(-100%, 0%);\n transform: rotateX(0) rotateY(22deg) rotateZ(0) scale(0.5) translate(-100%, 0%);\n}\n\n:host([position=\"left\"][opened=\"false\"]) .window,\n:host([position=\"left\"]:not([opened])) .window {\n -webkit-transform: translate(-100%, 0%);\n transform: translate(-100%, 0%);\n}\n\n:host([position=\"left\"]) .action-close {\n right: 0.75rem;\n top: 0.75rem;\n -webkit-transform: translateX(-120%) rotate(-45deg);\n transform: translateX(-120%) rotate(-45deg);\n}\n\n:host([position=\"left\"][opened]:not([opened=\"false\"])) .action-close {\n -webkit-transform: translateX(0);\n transform: translateX(0);\n}\n\n:host([position=\"right\"]) {\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-pack: end;\n justify-content: flex-end;\n}\n\n:host([position=\"right\"]) .window {\n height: 100%;\n max-height: calc(100dvh - calc(var(--mds-modal-window-distance) * 2));\n max-width: calc(100vw - 80px);\n}\n\n:host([position=\"right\"][opened=\"false\"]) > ::slotted( [slot=\"window\"] ),\n:host([position=\"right\"]:not([opened])) > ::slotted( [slot=\"window\"] ) {\n -webkit-transform: rotateX(0) rotateY(-22deg) rotateZ(0) scale(0.5) translate(100%, 0%);\n transform: rotateX(0) rotateY(-22deg) rotateZ(0) scale(0.5) translate(100%, 0%);\n}\n\n:host([position=\"right\"][opened=\"false\"]) .window,\n:host([position=\"right\"]:not([opened])) .window {\n -webkit-transform: translate(100%, 0%);\n transform: translate(100%, 0%);\n}\n\n:host([position=\"right\"]) .action-close {\n left: 0.75rem;\n top: 0.75rem;\n -webkit-transform: translateX(120%) rotate(45deg);\n transform: translateX(120%) rotate(45deg);\n}\n\n:host([position=\"right\"][opened]:not([opened=\"false\"])) .action-close {\n -webkit-transform: translateX(0);\n transform: translateX(0);\n}\n\n:host([position=\"top-left\"]) {\n -ms-flex-align: start;\n align-items: flex-start;\n -ms-flex-pack: start;\n justify-content: flex-start;\n}\n\n:host([position=\"bottom\"]) .window {\n height: auto;\n width: 100vw;\n}\n\n:host([position=\"top-left\"][opened=\"false\"]) > ::slotted( [slot=\"window\"] ),\n:host([position=\"top-left\"]:not([opened])) > ::slotted( [slot=\"window\"] ) {\n -webkit-transform: rotateX(22deg) rotateY(22deg) scale(0.5) translate(-80%, 80%);\n transform: rotateX(22deg) rotateY(22deg) scale(0.5) translate(-80%, 80%);\n}\n\n:host([position=\"top-left\"][opened=\"false\"]) .window,\n:host([position=\"top-left\"]:not([opened])) .window {\n -webkit-transform: translate(0, -100%);\n transform: translate(0, -100%);\n}\n\n:host([position=\"top-right\"]) {\n -ms-flex-align: start;\n align-items: flex-start;\n -ms-flex-pack: end;\n justify-content: flex-end;\n}\n\n:host([position=\"bottom\"]) .window {\n height: auto;\n width: 100vw;\n}\n\n:host([position=\"top-right\"][opened=\"false\"]) > ::slotted( [slot=\"window\"] ),\n:host([position=\"top-right\"]:not([opened])) > ::slotted( [slot=\"window\"] ) {\n -webkit-transform: rotateX(-22deg) rotateY(-22deg) scale(0.5) translate(80%, 80%);\n transform: rotateX(-22deg) rotateY(-22deg) scale(0.5) translate(80%, 80%);\n}\n\n:host([position=\"top-right\"][opened=\"false\"]) .window,\n:host([position=\"top-right\"]:not([opened])) .window {\n -webkit-transform: translate(0, 100%);\n transform: translate(0, 100%);\n}\n\n:host([position=\"top\"]) {\n -ms-flex-align: start;\n align-items: flex-start;\n -ms-flex-pack: center;\n justify-content: center;\n}\n\n:host([position=\"bottom\"]) .window {\n height: auto;\n width: 100vw;\n}\n\n:host([position=\"top\"][opened=\"false\"]) > ::slotted( [slot=\"window\"] ),\n:host([position=\"top\"]:not([opened])) > ::slotted( [slot=\"window\"] ) {\n -webkit-transform: rotateX(-22deg) rotateY(0) scale(0.5) translate(0, -80%);\n transform: rotateX(-22deg) rotateY(0) scale(0.5) translate(0, -80%);\n}\n\n:host([position=\"top\"][opened=\"false\"]) .window,\n:host([position=\"top\"]:not([opened])) .window {\n -webkit-transform: translate(0, -100%);\n transform: translate(0, -100%);\n}\n\n@tailwind utilities;\n\n@container style(--magma-pref-animation: reduce) {\n :host,\n .action-close,\n .window {\n -webkit-transition-duration: 0s !important;\n transition-duration: 0s !important;\n }\n\n :host {\n\n --mds-modal-transition-duration: 0s;\n }\n}\n\n@container style(--magma-pref-animation: system) {\n\n @media (prefers-reduced-motion) {\n :host,\n .action-close,\n .window {\n -webkit-transition-duration: 0s !important;\n transition-duration: 0s !important;\n }\n\n :host {\n\n --mds-modal-transition-duration: 0s;\n }\n }\n}\n\n@tailwind utilities;\n\n@container style(--magma-pref-contrast: more) {\n :host {\n\n --mds-modal-window-shadow: 0 0 0 2px rgb(var(--tone-neutral-01) / 0.6), 0 25px 50px -12px rgb(0 0 0 / 0.25);\n }\n}\n\n@container style(--magma-pref-contrast: system) {\n\n @media (prefers-contrast: more) {\n :host {\n\n --mds-modal-window-shadow: 0 0 0 2px rgb(var(--tone-neutral-01) / 0.6), 0 25px 50px -12px rgb(0 0 0 / 0.25);\n }\n }\n}\n\n@container style(--magma-pref-theme: dark) {\n :host {\n\n --mds-modal-window-background: rgb(var(--tone-neutral-09));\n --mds-modal-window-shadow: 0 0 0 1px rgb(var(--tone-neutral-01) / 0.3), 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);\n }\n}\n\n@container style(--magma-pref-theme: system) {\n\n @media (prefers-color-scheme: dark) {\n :host {\n\n --mds-modal-window-background: rgb(var(--tone-neutral-09));\n --mds-modal-window-shadow: 0 0 0 1px rgb(var(--tone-neutral-01) / 0.3), 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);\n }\n }\n}\n\n\n";
20
20
  const MdsModalStyle0 = mdsModalCss;
21
21
 
22
22
  const MdsModal = class {
@@ -29,6 +29,8 @@ const MdsModal = class {
29
29
  this.bottom = false;
30
30
  this.updateCSSCustomProps = () => {
31
31
  var _a;
32
+ if (typeof window === 'undefined')
33
+ return;
32
34
  const elementStyles = window.getComputedStyle(this.host);
33
35
  this.cssTransitionDuration = (_a = elementStyles.getPropertyValue('--mds-modal-transition-duration')) !== null && _a !== void 0 ? _a : '500';
34
36
  };
@@ -73,7 +75,7 @@ const MdsModal = class {
73
75
  this.top = this.host.querySelector('[slot="top"]') !== null;
74
76
  this.window = this.host.querySelector('[slot="window"]') !== null;
75
77
  if (this.window) {
76
- (_a = this.host.querySelector('[slot="window"]')) === null || _a === void 0 ? void 0 : _a.setAttribute('role', 'modal');
78
+ (_a = this.host.querySelector('[slot="window"]')) === null || _a === void 0 ? void 0 : _a.setAttribute('role', 'dialog');
77
79
  }
78
80
  }
79
81
  componentWillRender() {
@@ -96,11 +98,11 @@ const MdsModal = class {
96
98
  this.opened = false;
97
99
  }
98
100
  render() {
99
- return (index.h(index.Host, { key: 'b47115bdc428fd9d0d7357ed96efd09ed7cf034f', "aria-modal": clsx(this.opened ? 'true' : 'false'), onClick: (e) => { this.closeModal(e); } }, this.window
101
+ return (index.h(index.Host, { key: '1d00f0a817af0b0a82eae1c790cc7e312165a46e', "aria-modal": clsx(this.opened ? 'true' : 'false'), onClick: (e) => { this.closeModal(e); } }, this.window
100
102
  ? index.h("slot", { name: "window" })
101
- : index.h("div", { class: clsx('window', (this.top || this.bottom) && `window-${this.top ? '-top' : ''}${this.bottom ? '-bottom' : ''}`), role: "dialog", part: "window" }, this.top &&
103
+ : index.h("div", { class: clsx('window', (this.top || this.bottom) && `window-${this.top ? '-top' : ''}${this.bottom ? '-bottom' : ''}`), part: "window" }, this.top &&
102
104
  index.h("slot", { name: "top" }), index.h("slot", null), this.bottom &&
103
- index.h("slot", { name: "bottom" })), !this.window && index.h("mds-button", { key: 'f53c045a86dd3db6d1ca7cfdf07aa448b6278e9f', class: "action-close", icon: "mi/baseline/close", variant: "light", tone: "quiet", size: "xl", onClick: (e) => { this.closeModal(e); } })));
105
+ index.h("slot", { name: "bottom" })), !this.window && index.h("mds-button", { key: '1f62de32ab98e24733a13fe9553ba9a12d9fcf31', class: "action-close", icon: "mi/baseline/close", variant: "light", tone: "quiet", size: "xl", onClick: (e) => { this.closeModal(e); } })));
104
106
  }
105
107
  get host() { return index.getElement(this); }
106
108
  static get watchers() { return {
@@ -18,6 +18,22 @@ const setAttributeIfEmpty = (element, attribute, value) => {
18
18
  element.setAttribute(attribute, value);
19
19
  return value;
20
20
  };
21
+ const removeAttributesIf = (element, attribute, valueCheck = 'true', cleanAttributes) => {
22
+ if (ifAttribute(element, attribute, valueCheck)) {
23
+ const attributesList = Array.isArray(cleanAttributes) ? cleanAttributes : [cleanAttributes];
24
+ attributesList.forEach(attributeToRemove => {
25
+ element.removeAttribute(attributeToRemove);
26
+ });
27
+ return true;
28
+ }
29
+ return false;
30
+ };
31
+ const ifAttribute = (element, attribute, valueCheck = 'true') => {
32
+ if (element.hasAttribute(attribute) && element.getAttribute(attribute) === valueCheck) {
33
+ return true;
34
+ }
35
+ return false;
36
+ };
21
37
  const hashValue = (value) => `${value}-${hash(value)}`;
22
38
  const hashRandomValue = (value) => {
23
39
  const randomValue = randomInt(1000000);
@@ -26,4 +42,4 @@ const hashRandomValue = (value) => {
26
42
  }
27
43
  return hash(randomValue.toString());
28
44
  };
29
- export { unslugName, setAttributeIfEmpty, hashRandomValue, hashValue, };
45
+ export { hashRandomValue, hashValue, removeAttributesIf, setAttributeIfEmpty, ifAttribute, unslugName, };
@@ -0,0 +1,6 @@
1
+ const isMobileDevice = () => {
2
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3
+ const userAgent = navigator.userAgent || navigator.vendor || window.opera;
4
+ return /android|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(userAgent);
5
+ };
6
+ export { isMobileDevice, };
@@ -31,13 +31,13 @@ export class KeyboardManager {
31
31
  };
32
32
  this.attachEscapeBehavior = (callback) => {
33
33
  this.escapeCallback = callback;
34
- if (window !== undefined) {
34
+ if (typeof window !== 'undefined') {
35
35
  window.addEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
36
36
  }
37
37
  };
38
38
  this.detachEscapeBehavior = () => {
39
39
  this.escapeCallback = () => { return; };
40
- if (window !== undefined) {
40
+ if (typeof window !== 'undefined') {
41
41
  window.removeEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
42
42
  }
43
43
  };
@@ -0,0 +1,13 @@
1
+ const hasSlottedElements = (el, name) => {
2
+ var _a;
3
+ let query = 'slot';
4
+ if (name) {
5
+ query = `slot[name=${name}]`;
6
+ }
7
+ const slot = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(query);
8
+ if (slot) {
9
+ return slot.assignedNodes().length > 0;
10
+ }
11
+ return false;
12
+ };
13
+ export { hasSlottedElements, };
@@ -17,6 +17,8 @@
17
17
  * @prop --mds-modal-overlay-opacity: Set the overlay color opacity of the background when the component is opened, this property can be inherited from `globals.css` in `styles^8.0.0`.
18
18
  * @prop --mds-modal-window-background: Set the background color of the window
19
19
  * @prop --mds-modal-window-overflow: Set the overflow of the window
20
+ * @prop --mds-modal-window-radius: Set the border radius of the window
21
+ * @prop --mds-modal-window-distance: Set the distance between the modal window and the screen bounds
20
22
  * @prop --mds-modal-window-shadow: Set the box shadow of the window
21
23
  * @prop --mds-modal-z-index: Set the z-index of the window when the component is opened
22
24
  */
@@ -30,7 +32,9 @@
30
32
  --mds-modal-transition-outro-ease: cubic-bezier(0.86, 0, 0.07, 1);
31
33
  --mds-modal-window-background: rgb(var(--tone-neutral));
32
34
  --mds-modal-window-overflow: auto;
35
+ --mds-modal-window-radius: 0;
33
36
  --mds-modal-window-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
37
+ --mds-modal-window-distance: 0;
34
38
  --mds-modal-z-index: var(--magma-modal-z-index);
35
39
  transition-timing-function: cubic-bezier(1, 0, 0, 1);
36
40
 
@@ -82,9 +86,11 @@
82
86
  gap: 0rem;
83
87
 
84
88
  background-color: var(--mds-modal-window-background);
89
+ border-radius: var(--mds-modal-window-radius);
85
90
  box-shadow: var(--mds-modal-window-shadow);
86
91
  display: grid;
87
92
  grid-template-rows: 1fr;
93
+ margin: var(--mds-modal-window-distance);
88
94
  overflow: var(--mds-modal-window-overflow);
89
95
  }
90
96
 
@@ -100,28 +106,7 @@
100
106
  grid-template-rows: auto 1fr auto;
101
107
  }
102
108
 
103
- :host {
104
- padding: 2rem;
105
- }
106
-
107
- @media (max-width: 767px) {
108
- :host {
109
- padding: 1rem;
110
- }
111
- }
112
-
113
109
  :host .window {
114
- margin: -2rem;
115
- }
116
-
117
- @media (max-width: 767px) {
118
- :host .window {
119
- margin: -1rem;
120
- }
121
- }
122
-
123
- :host .window {
124
-
125
110
  transition-delay: 0s, calc(var(--mds-modal-transition-duration) / 2);
126
111
  }
127
112
 
@@ -232,7 +217,8 @@
232
217
  }
233
218
 
234
219
  :host([position="left"]) .window {
235
- height: 100dvh;
220
+ height: 100%;
221
+ max-height: calc(100dvh - calc(var(--mds-modal-window-distance) * 2));
236
222
  max-width: calc(100vw - 80px);
237
223
  }
238
224
 
@@ -262,7 +248,8 @@
262
248
  }
263
249
 
264
250
  :host([position="right"]) .window {
265
- height: 100dvh;
251
+ height: 100%;
252
+ max-height: calc(100dvh - calc(var(--mds-modal-window-distance) * 2));
266
253
  max-width: calc(100vw - 80px);
267
254
  }
268
255
 
@@ -14,6 +14,8 @@ export class MdsModal {
14
14
  this.bottom = false;
15
15
  this.updateCSSCustomProps = () => {
16
16
  var _a;
17
+ if (typeof window === 'undefined')
18
+ return;
17
19
  const elementStyles = window.getComputedStyle(this.host);
18
20
  this.cssTransitionDuration = (_a = elementStyles.getPropertyValue('--mds-modal-transition-duration')) !== null && _a !== void 0 ? _a : '500';
19
21
  };
@@ -58,7 +60,7 @@ export class MdsModal {
58
60
  this.top = this.host.querySelector('[slot="top"]') !== null;
59
61
  this.window = this.host.querySelector('[slot="window"]') !== null;
60
62
  if (this.window) {
61
- (_a = this.host.querySelector('[slot="window"]')) === null || _a === void 0 ? void 0 : _a.setAttribute('role', 'modal');
63
+ (_a = this.host.querySelector('[slot="window"]')) === null || _a === void 0 ? void 0 : _a.setAttribute('role', 'dialog');
62
64
  }
63
65
  }
64
66
  componentWillRender() {
@@ -81,11 +83,11 @@ export class MdsModal {
81
83
  this.opened = false;
82
84
  }
83
85
  render() {
84
- return (h(Host, { key: 'b47115bdc428fd9d0d7357ed96efd09ed7cf034f', "aria-modal": clsx(this.opened ? 'true' : 'false'), onClick: (e) => { this.closeModal(e); } }, this.window
86
+ return (h(Host, { key: '1d00f0a817af0b0a82eae1c790cc7e312165a46e', "aria-modal": clsx(this.opened ? 'true' : 'false'), onClick: (e) => { this.closeModal(e); } }, this.window
85
87
  ? h("slot", { name: "window" })
86
- : h("div", { class: clsx('window', (this.top || this.bottom) && `window-${this.top ? '-top' : ''}${this.bottom ? '-bottom' : ''}`), role: "dialog", part: "window" }, this.top &&
88
+ : h("div", { class: clsx('window', (this.top || this.bottom) && `window-${this.top ? '-top' : ''}${this.bottom ? '-bottom' : ''}`), part: "window" }, this.top &&
87
89
  h("slot", { name: "top" }), h("slot", null), this.bottom &&
88
- h("slot", { name: "bottom" })), !this.window && h("mds-button", { key: 'f53c045a86dd3db6d1ca7cfdf07aa448b6278e9f', class: "action-close", icon: "mi/baseline/close", variant: "light", tone: "quiet", size: "xl", onClick: (e) => { this.closeModal(e); } })));
90
+ h("slot", { name: "bottom" })), !this.window && h("mds-button", { key: '1f62de32ab98e24733a13fe9553ba9a12d9fcf31', class: "action-close", icon: "mi/baseline/close", variant: "light", tone: "quiet", size: "xl", onClick: (e) => { this.closeModal(e); } })));
89
91
  }
90
92
  static get is() { return "mds-modal"; }
91
93
  static get encapsulation() { return "shadow"; }
@@ -6,13 +6,13 @@ export default {
6
6
  argTypes: {
7
7
  opened: {
8
8
  description: 'Specifies if the modal is opened or not',
9
- type: { name: 'boolean', required: false },
9
+ type: { name: 'boolean' },
10
10
  },
11
11
  position: {
12
12
  control: { type: 'select' },
13
13
  description: 'Specifies the animation position of the modal window',
14
14
  options: modalPositionDictionary,
15
- type: { name: 'string', required: false },
15
+ type: { name: 'string' },
16
16
  },
17
17
  },
18
18
  };
@@ -20,9 +20,9 @@ const firstName = 'Mario';
20
20
  const lastName = 'Rossi';
21
21
  const fullName = `${firstName} ${lastName}`;
22
22
  const email = `${firstName.toLowerCase()}.${lastName.toLowerCase()}@nintendo.com`;
23
- const Template = args => h("mds-modal", Object.assign({}, args), h("header", { slot: "top", class: "p-800 flex gap-400 items-center border-b border-solid border-0 border-tone-neutral-09" }, h("mds-img", { class: "w-1600", src: "/logo-gruppo-maggioli-512w.webp" }), h("div", { class: "text-tone-neutral-02" }, h("mds-text", { typography: "h5", class: "truncate min-w-0" }, "Maggioli Editore"), h("mds-text", { typography: "detail", class: "truncate min-w-0" }, "Menu di servizio"))), h("div", { class: "p-800" }, h("mds-text", null, "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\u2019re future-proofing our components as more brands adopt NewsKit.")), h("footer", { slot: "bottom", class: "p-800 flex gap-400 text-tone-neutral-02 border-t border-solid border-0 border-tone-neutral-09" }, h("mds-author", { class: "flex-grow" }, h("mds-avatar", { slot: "avatar", class: "w-1600 mobile:w-1200", src: "/avatar-01-200x200.jpeg" }), h("mds-text", { typography: "h6" }, fullName), h("mds-text", { typography: "caption", class: "text-tone-neutral-04" }, email)), h("mds-button", { icon: "mdi/dots-vertical", variant: "light" })));
23
+ const Template = args => h("mds-modal", Object.assign({}, args), h("header", { slot: "top", class: "p-800 flex gap-400 items-center border-b border-solid border-0 border-tone-neutral-09 max-w-[400px]" }, h("mds-img", { class: "w-1600", src: "/logo-gruppo-maggioli-512w.webp" }), h("div", { class: "text-tone-neutral-02" }, h("mds-text", { typography: "h5", class: "truncate min-w-0" }, "Maggioli Editore"), h("mds-text", { typography: "detail", class: "truncate min-w-0" }, "Menu di servizio"))), h("div", { class: "p-800 max-w-[400px]" }, h("mds-text", null, "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\u2019re future-proofing our components as more brands adopt NewsKit.")), h("footer", { slot: "bottom", class: "p-800 flex gap-400 text-tone-neutral-02 border-t border-solid border-0 border-tone-neutral-09 max-w-[400px]" }, h("mds-author", { class: "flex-grow" }, h("mds-avatar", { slot: "avatar", class: "w-1600 mobile:w-1200", src: "/avatar-01-200x200.jpeg" }), h("mds-text", { typography: "h6" }, fullName), h("mds-text", { typography: "caption", class: "text-tone-neutral-04" }, email)), h("mds-button", { icon: "mdi/dots-vertical", variant: "light" })));
24
24
  const CustomTemplate = args => h("mds-modal", Object.assign({}, args), h("mds-banner", { slot: "window", class: "max-w-xl mx-6", deletable: true, headline: "Action required" }, h("mds-text", { typography: "detail" }, "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\u2019re future-proofing our components as more brands adopt NewsKit."), h("mds-button", { slot: "actions", variant: "primary", tone: "quiet" }, "Cancel"), h("mds-button", { slot: "actions", variant: "primary" }, "Confirm")));
25
- const AriaTemplate = () => {
25
+ const InteractiveTemplate = () => {
26
26
  // Click not working with reader
27
27
  const [opened, setOpened] = useState(false);
28
28
  window.addEventListener('mdsModalClose', () => { setOpened(false); });
@@ -32,5 +32,14 @@ export const Default = Template.bind({});
32
32
  Default.args = {
33
33
  position: 'right',
34
34
  };
35
- export const CustomWindow = CustomTemplate.bind({});
36
- export const ARIATest = AriaTemplate.bind({});
35
+ export const DefaultWindowCustomized = Template.bind({});
36
+ DefaultWindowCustomized.args = {
37
+ position: 'right',
38
+ style: { '--mds-modal-window-distance': '1rem', '--mds-modal-window-radius': '1rem' },
39
+ };
40
+ export const CustomWindowElement = CustomTemplate.bind({});
41
+ export const Interactive = InteractiveTemplate.bind({});
42
+ export const ARIATest = CustomTemplate.bind({});
43
+ ARIATest.args = {
44
+ opened: true,
45
+ };
@@ -0,0 +1,5 @@
1
+ const horizontalActionsAnimationDictionary = [
2
+ 'fade',
3
+ 'slide',
4
+ ];
5
+ export { horizontalActionsAnimationDictionary, };
@@ -1,60 +1,65 @@
1
1
  const fileExtensionsDictionary = {
2
- '7z': { format: 'archive', description: 'Archivio compresso' },
3
- ace: { format: 'archive', description: 'Archivio compresso' },
4
- ai: { format: 'vector', description: 'Vettoriale Adobe Illustrator' },
5
- dart: { format: 'code', description: 'Dart' },
6
- db: { format: 'data', description: 'File di database' },
7
- default: { format: 'attachment', description: 'Formato sconosciuto' },
8
- dmg: { format: 'executable', description: 'Apple Disk Image' },
9
- doc: { format: 'text', description: 'Documento Microsoft Word' },
10
- docm: { format: 'text', description: 'Documento Microsoft Word' },
11
- docx: { format: 'text', description: 'Documento Microsoft Word Compresso' },
12
- eml: { format: 'email', description: 'E-mail di posta elettronica' },
13
- eps: { format: 'vector', description: 'Vettoriale Corel Draw' },
14
- exe: { format: 'executable', description: 'File eseguibile Windows' },
15
- flac: { format: 'audio', description: 'Audio non compresso' },
16
- gif: { format: 'image', description: 'Immagine compressa', preview: true },
17
- htm: { format: 'markup', description: 'Pagina web' },
18
- heic: { format: 'image', description: 'High Efficiency Image File Format' },
19
- html: { format: 'markup', description: 'Pagina web' },
20
- jpe: { format: 'image', description: 'Immagine compressa', preview: true },
21
- jpeg: { format: 'image', description: 'Immagine compressa', preview: true },
22
- jpg: { format: 'image', description: 'Immagine compressa', preview: true },
23
- js: { format: 'code', description: 'JavaScript' },
24
- json: { format: 'data', description: 'JavaScript Object Notation' },
25
- jsx: { format: 'code', description: 'JavaScript' },
26
- m2v: { format: 'video', description: 'Filmato SD' },
27
- mp2: { format: 'audio', description: 'Audio compresso' },
28
- mp3: { format: 'audio', description: 'Audio compresso' },
29
- mp4: { format: 'video', description: 'Filmato HD' },
30
- mp4v: { format: 'video', description: 'Filmato HD' },
31
- mpeg: { format: 'video', description: 'Filmato SD' },
32
- mpg4: { format: 'video', description: 'Filmato SD' },
33
- mpg: { format: 'video', description: 'Filmato SD' },
34
- mpga: { format: 'audio', description: 'Audio compresso' },
35
- odp: { format: 'slide', description: 'Slide di presentazione LibreOffice' },
36
- ods: { format: 'spreadsheet', description: 'Foglio di calcolo LibreOffice' },
37
- odt: { format: 'text', description: 'File di testo LibreOffice' },
38
- pdf: { format: 'document', description: 'Documento Adobe' },
39
- php: { format: 'code', description: 'Hypertext Preprocessor' },
40
- png: { format: 'image', description: 'Immagine Portable Network Graphics', preview: true },
41
- ppt: { format: 'slide', description: 'Slide di presentazione PowerPoint' },
42
- rar: { format: 'archive', description: 'Archivio compresso' },
43
- rtf: { format: 'text', description: 'Documento di testo Rich Text Format' },
44
- sass: { format: 'code', description: 'Syntactically Awesome StyleSheets' },
45
- shtml: { format: 'markup', description: 'Pagina web' },
46
- svg: { format: 'vector', description: 'Scalable Vector Graphics', preview: true },
47
- tar: { format: 'archive', description: 'Archivio non compresso' },
48
- tiff: { format: 'image', description: 'Tag Image File Format' },
49
- ts: { format: 'code', description: 'TypeScript' },
50
- tsx: { format: 'code', description: 'TypeScript Extended Syntax' },
51
- txt: { format: 'text', description: 'Documento di testo non formattato' },
52
- wav: { format: 'audio', description: 'Audio non compresso' },
53
- webp: { format: 'image', description: 'Immagine Web Picture', preview: true },
54
- xar: { format: 'archive', description: 'Archivio compresso' },
55
- xls: { format: 'spreadsheet', description: 'Foglio di calcolo Office' },
56
- xlsx: { format: 'spreadsheet', description: 'Foglio di calcolo Office' },
57
- zip: { format: 'archive', description: 'Archivio compresso' },
2
+ '7z': { format: 'archive', description: 'compressedArchive' },
3
+ ace: { format: 'archive', description: 'compressedArchive' },
4
+ ai: { format: 'vector', description: 'fileAI' },
5
+ dart: { format: 'code', description: 'dart' },
6
+ db: { format: 'data', description: 'fileDB' },
7
+ default: { format: 'attachment', description: 'unknown' },
8
+ dmg: { format: 'executable', description: 'appleDiskImage' },
9
+ doc: { format: 'text', description: 'documentMS' },
10
+ docm: { format: 'text', description: 'documentMS' },
11
+ docx: { format: 'text', description: 'compressedDocumentMS' },
12
+ eml: { format: 'email', description: 'email' },
13
+ eps: { format: 'vector', description: 'fileEPS' },
14
+ exe: { format: 'executable', description: 'fileEXE' },
15
+ flac: { format: 'audio', description: 'uncompressedAudio' },
16
+ gif: { format: 'image', description: 'compressedImage', preview: true },
17
+ heic: { format: 'image', description: 'imageHEFF' },
18
+ htm: { format: 'markup', description: 'documentWeb' },
19
+ html: { format: 'markup', description: 'documentWeb' },
20
+ jpe: { format: 'image', description: 'compressedImage', preview: true },
21
+ jpeg: { format: 'image', description: 'compressedImage', preview: true },
22
+ jpg: { format: 'image', description: 'compressedImage', preview: true },
23
+ js: { format: 'code', description: 'fileJS' },
24
+ json: { format: 'data', description: 'fileJSON' },
25
+ jsx: { format: 'code', description: 'fileJS' },
26
+ m2v: { format: 'video', description: 'videoSD' },
27
+ mp2: { format: 'audio', description: 'compressedAudio' },
28
+ mp3: { format: 'audio', description: 'compressedAudio' },
29
+ mp4: { format: 'video', description: 'videoHD' },
30
+ mp4v: { format: 'video', description: 'videoHD' },
31
+ mpeg: { format: 'video', description: 'videoSD' },
32
+ mpg4: { format: 'video', description: 'videoSD' },
33
+ mpg: { format: 'video', description: 'videoSD' },
34
+ mpga: { format: 'audio', description: 'compressedAudio' },
35
+ odf: { format: 'document', description: 'openDocumentFormat' },
36
+ odp: { format: 'slide', description: 'slideLO' },
37
+ ods: { format: 'spreadsheet', description: 'spreadsheetLO' },
38
+ odt: { format: 'text', description: 'documentLO' },
39
+ ole: { format: 'document', description: 'objectLinkingAndEmbedding' },
40
+ p7m: { format: 'certificate', description: 'documentDigitalSingnature' },
41
+ pdf: { format: 'document', description: 'documentAdobe' },
42
+ php: { format: 'code', description: 'filePHP' },
43
+ png: { format: 'image', description: 'imagePNG', preview: true },
44
+ ppt: { format: 'slide', description: 'slidePowerPoint' },
45
+ rar: { format: 'archive', description: 'compressedArchive' },
46
+ rtf: { format: 'text', description: 'documentRTF' },
47
+ sass: { format: 'code', description: 'fileSASS' },
48
+ shtml: { format: 'markup', description: 'documentWeb' },
49
+ svg: { format: 'vector', description: 'imageSVG', preview: true },
50
+ tar: { format: 'archive', description: 'uncompressedArchive' },
51
+ tiff: { format: 'image', description: 'imageTIFF' },
52
+ ts: { format: 'code', description: 'fileTS' },
53
+ tsd: { format: 'certificate', description: 'certificateTSD' },
54
+ tsx: { format: 'code', description: 'fileTSX' },
55
+ txt: { format: 'text', description: 'documentTXT' },
56
+ wav: { format: 'audio', description: 'uncompressedAudio' },
57
+ webp: { format: 'image', description: 'imageWEBP', preview: true },
58
+ xar: { format: 'archive', description: 'compressedArchive' },
59
+ xls: { format: 'spreadsheet', description: 'spreadsheetMS' },
60
+ xlsx: { format: 'spreadsheet', description: 'spreadsheetMS' },
61
+ xml: { format: 'markup', description: 'extensibleMarkupLanguage' },
62
+ zip: { format: 'archive', description: 'compressedArchive' },
58
63
  };
59
64
  const genericMimeToExt = new Map([
60
65
  ['image', ['.png', '.jpg', '.jpeg', '.tiff', '.webp', '.jpe', '.gif', '.heic']],
@@ -1,6 +1,65 @@
1
+ const typographyTagDictionary = [
2
+ 'abbr',
3
+ 'address',
4
+ 'article',
5
+ 'b',
6
+ 'bdo',
7
+ 'blockquote',
8
+ 'cite',
9
+ 'code',
10
+ 'dd',
11
+ 'del',
12
+ 'details',
13
+ 'dfn',
14
+ 'div',
15
+ 'dl',
16
+ 'dt',
17
+ 'em',
18
+ 'figcaption',
19
+ 'h1',
20
+ 'h2',
21
+ 'h3',
22
+ 'h4',
23
+ 'h5',
24
+ 'h6',
25
+ 'i',
26
+ 'ins',
27
+ 'kbd',
28
+ 'label',
29
+ 'legend',
30
+ 'li',
31
+ 'mark',
32
+ 'ol',
33
+ 'p',
34
+ 'pre',
35
+ 'q',
36
+ 'rb',
37
+ 'rt',
38
+ 'ruby',
39
+ 's',
40
+ 'samp',
41
+ 'small',
42
+ 'span',
43
+ 'strong',
44
+ 'sub',
45
+ 'summary',
46
+ 'sup',
47
+ 'time',
48
+ 'u',
49
+ 'ul',
50
+ 'var',
51
+ ];
52
+ const typographyHeadingTagDictionary = [
53
+ 'h1',
54
+ 'h2',
55
+ 'h3',
56
+ 'h4',
57
+ 'h5',
58
+ 'h6',
59
+ ];
1
60
  const truncateDictionary = [
2
61
  'all',
3
62
  'none',
4
63
  'word',
5
64
  ];
6
- export { truncateDictionary, };
65
+ export { truncateDictionary, typographyHeadingTagDictionary, typographyTagDictionary, };
@@ -54,4 +54,65 @@ const filesList = [
54
54
  'wisconsin_bypassing_small.xar',
55
55
  'wooden.jsx',
56
56
  ];
57
- export { filesList, };
57
+ const namedFilesList = {
58
+ '7z': 'frozen_haptic.7z',
59
+ 'No extension file': 'this_is_an_extensionless_file',
60
+ 'png with URL': 'https://i2.wp.com/clipart.info/images/ccovers/1495750818Apple-PNG-Clip-Art.png',
61
+ ace: 'sky_marketing.ace',
62
+ ai: 'foreground_overriding.ai',
63
+ db: 'matrix_black_hat.db',
64
+ default: 'copying.default',
65
+ dmg: 'protocol_designer.dmg',
66
+ doc: 'forges.doc',
67
+ docm: 'officer_somalia.docm',
68
+ docx: 'upgradable_gold.docx',
69
+ eml: 'brunei_logistical.eml',
70
+ eps: 'alarm_circuit_plastic.eps',
71
+ exe: 'rss_systematic_avon.exe',
72
+ flac: 'liaison_panel_central.flac',
73
+ gif: 'initiatives_group.gif',
74
+ htm: 'books_monetize_arizona.htm',
75
+ html: 'flexibility_auto_money.html',
76
+ jpe: 'intelligent_radical.jpe',
77
+ jpeg: 'iowa_installation.jpeg',
78
+ jpg: 'buckinghamshire_macao.jpg',
79
+ js: 'monitor.js',
80
+ json: 'calculating.json',
81
+ jsx: 'wooden.jsx',
82
+ m2v: 'interface_bedfordshire_solid.m2v',
83
+ mp2: 'explicit.mp2',
84
+ mp3: 'optimization_radical.mp3',
85
+ mp4: 'nebraska.mp4',
86
+ mp4v: 'reduced_regional_greenland.mp4v',
87
+ mpeg: 'impactful_alarm_handmade.mpeg',
88
+ mpg4: 'revolutionize.mpg4',
89
+ mpg: 'complexity_deposit.mpg',
90
+ mpga: 'ports_copy_granite.mpga',
91
+ odf: 'This is a file_to_read.odf',
92
+ odp: 'needs_based_solid.odp',
93
+ ods: 'compressing_black_colorado.ods',
94
+ odt: 'salad_compressing.odt',
95
+ ole: 'Document-RPF_Open-new.ole',
96
+ p7m: 'file with certificate from government.pdf.p7m',
97
+ pdf: 'connect_local_visualize.pdf',
98
+ php: 'fish.php',
99
+ png: 'awesome_orchestration.png',
100
+ ppt: 'gorgeous_manager_savings.ppt',
101
+ rar: 'unbranded.rar',
102
+ rtf: 'pound.rtf',
103
+ sass: 'open_source_gorgeous.sass',
104
+ shtml: 'brand.shtml',
105
+ svg: 'b2c_tan_sports.svg',
106
+ tar: 'graphic_frozen_bedfordshire.tar',
107
+ ts: 'forge_face.ts',
108
+ tsd: 'Marked file-7483274hy6Fg6R8.tsd',
109
+ txt: 'bedfordshire_iceland_identity.txt',
110
+ wav: 'synergistic.wav',
111
+ webp: 'open_source.webp',
112
+ xar: 'wisconsin_bypassing_small.xar',
113
+ xls: 'metrics_lempira_account.xls',
114
+ xlsx: 'hdd_navigate_panama.xlsx',
115
+ xml: 'Markup language.xml',
116
+ zip: 'tuna_table_fall.zip',
117
+ };
118
+ export { filesList, namedFilesList, };
@@ -0,0 +1 @@
1
+ export {};