@maggioli-design-system/mds-modal 5.1.0 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-7b5471f5.js → index-6f236cfa.js} +164 -69
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mds-modal.cjs.entry.js +16 -7
- package/dist/cjs/mds-modal.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/common/floating-controller.js +180 -0
- package/dist/collection/common/slot.js +19 -0
- package/dist/collection/components/mds-modal/mds-modal.css +10 -23
- package/dist/collection/components/mds-modal/mds-modal.js +20 -5
- package/dist/collection/components/mds-modal/test/mds-modal.stories.js +7 -2
- package/dist/collection/dictionary/animation.js +5 -0
- package/dist/collection/dictionary/file-extensions.js +6 -59
- package/dist/collection/dictionary/tree.js +13 -0
- package/dist/collection/fixtures/filenames.js +62 -1
- package/dist/collection/type/animation.js +1 -0
- package/dist/collection/type/tree.js +1 -0
- package/dist/collection/type/variant-file-format.js +5 -0
- package/dist/components/mds-modal.js +15 -6
- package/dist/documentation.d.ts +8 -0
- package/dist/documentation.json +21 -5
- package/dist/esm/{index-1c34ac95.js → index-f8d2dee4.js} +164 -69
- package/dist/esm/loader.js +2 -2
- package/dist/esm/mds-modal.entry.js +16 -7
- package/dist/esm/mds-modal.js +3 -3
- package/dist/esm-es5/index-f8d2dee4.js +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mds-modal.entry.js +1 -1
- package/dist/esm-es5/mds-modal.js +1 -1
- package/dist/mds-modal/mds-modal.esm.js +1 -1
- package/dist/mds-modal/mds-modal.js +1 -1
- package/dist/mds-modal/p-413a00c5.entry.js +1 -0
- package/dist/mds-modal/p-96958acc.system.entry.js +1 -0
- package/dist/mds-modal/p-bc1fa4e4.system.js +2 -0
- package/dist/mds-modal/p-c6899cb0.system.js +1 -0
- package/dist/mds-modal/p-ee90f86a.js +2 -0
- package/dist/stats.json +77 -38
- package/dist/types/common/floating-controller.d.ts +46 -0
- package/dist/types/common/slot.d.ts +3 -0
- package/dist/types/components/mds-modal/test/mds-modal.stories.d.ts +2 -1
- package/dist/types/dictionary/animation.d.ts +2 -0
- package/dist/types/dictionary/tree.d.ts +4 -0
- package/dist/types/fixtures/filenames.d.ts +62 -1
- package/dist/types/type/animation.d.ts +1 -0
- package/dist/types/type/file-types.d.ts +1 -1
- package/dist/types/type/tree.d.ts +3 -0
- package/dist/types/type/variant-file-format.d.ts +1 -1
- package/documentation.json +62 -16
- package/package.json +4 -4
- package/readme.md +2 -0
- package/src/common/floating-controller.ts +263 -0
- package/src/common/slot.ts +24 -0
- package/src/components/mds-modal/css/mds-modal-animate-left.css +2 -1
- package/src/components/mds-modal/css/mds-modal-animate-right.css +2 -1
- package/src/components/mds-modal/css/mds-modal-animate.css +0 -10
- package/src/components/mds-modal/mds-modal.css +6 -0
- package/src/components/mds-modal/mds-modal.tsx +1 -1
- package/src/components/mds-modal/readme.md +2 -0
- package/src/components/mds-modal/test/mds-modal.stories.tsx +10 -4
- package/src/dictionary/animation.ts +8 -0
- package/src/dictionary/file-extensions.ts +6 -60
- package/src/dictionary/tree.ts +21 -0
- package/src/fixtures/filenames.ts +63 -0
- package/src/fixtures/icons.json +21 -0
- package/src/fixtures/iconsauce.json +6 -0
- package/src/meta/file-format/locale.el.json +26 -21
- package/src/meta/file-format/locale.en.json +26 -21
- package/src/meta/file-format/locale.es.json +26 -21
- package/src/meta/file-format/locale.it.json +26 -21
- package/src/type/animation.ts +3 -0
- package/src/type/file-types.ts +6 -0
- package/src/type/tree.ts +12 -0
- package/src/type/variant-file-format.ts +6 -0
- package/www/build/mds-modal.esm.js +1 -1
- package/www/build/mds-modal.js +1 -1
- package/www/build/p-413a00c5.entry.js +1 -0
- package/www/build/p-96958acc.system.entry.js +1 -0
- package/www/build/p-bc1fa4e4.system.js +2 -0
- package/www/build/p-c6899cb0.system.js +1 -0
- package/www/build/p-ee90f86a.js +2 -0
- package/dist/esm-es5/index-1c34ac95.js +0 -1
- package/dist/mds-modal/p-0ed6e0c8.js +0 -2
- package/dist/mds-modal/p-2bf0fd79.system.entry.js +0 -1
- package/dist/mds-modal/p-423dac35.system.js +0 -2
- package/dist/mds-modal/p-67c6f337.system.js +0 -1
- package/dist/mds-modal/p-fbfe7e2e.entry.js +0 -1
- package/www/build/p-0ed6e0c8.js +0 -2
- package/www/build/p-2bf0fd79.system.entry.js +0 -1
- package/www/build/p-423dac35.system.js +0 -2
- package/www/build/p-67c6f337.system.js +0 -1
- package/www/build/p-fbfe7e2e.entry.js +0 -1
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { arrow, autoPlacement, autoUpdate, computePosition, flip, offset, shift, } from "@floating-ui/dom";
|
|
2
|
+
import { cssDurationToMilliseconds } from "./unit";
|
|
3
|
+
import { setAttributeIfEmpty } from "./aria";
|
|
4
|
+
export class FloatingController {
|
|
5
|
+
constructor(host, arrowEl) {
|
|
6
|
+
this.arrowInset = (middleware, arrowPosition) => {
|
|
7
|
+
const { arrow } = middleware;
|
|
8
|
+
const inset = { bottom: '', left: '', right: '', top: '' };
|
|
9
|
+
if (arrow === undefined) {
|
|
10
|
+
return {};
|
|
11
|
+
}
|
|
12
|
+
switch (arrowPosition) {
|
|
13
|
+
case 'bottom':
|
|
14
|
+
inset.left = arrow.x !== null ? `${arrow.x}px` : '';
|
|
15
|
+
inset.top = '100%';
|
|
16
|
+
break;
|
|
17
|
+
case 'left':
|
|
18
|
+
inset.right = '100%';
|
|
19
|
+
inset.top = arrow.y !== null ? `${arrow.y}px` : '';
|
|
20
|
+
break;
|
|
21
|
+
case 'right':
|
|
22
|
+
inset.left = '100%';
|
|
23
|
+
inset.top = arrow.y !== null ? `${arrow.y}px` : '';
|
|
24
|
+
break;
|
|
25
|
+
case 'top':
|
|
26
|
+
inset.left = arrow.x !== null ? `${arrow.x}px` : '';
|
|
27
|
+
inset.top = '';
|
|
28
|
+
break;
|
|
29
|
+
default:
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
return inset;
|
|
33
|
+
};
|
|
34
|
+
this.arrowTransform = (arrowPosition) => {
|
|
35
|
+
let transformProps = this._host.arrow && this._host.visible ? 'scale(1)' : 'scale(0)';
|
|
36
|
+
switch (arrowPosition) {
|
|
37
|
+
case 'bottom':
|
|
38
|
+
transformProps = `rotate(180deg) ${transformProps} translate(0, -100%)`;
|
|
39
|
+
break;
|
|
40
|
+
case 'left':
|
|
41
|
+
transformProps = `rotate(-90deg) ${transformProps} translate(50%, -50%)`;
|
|
42
|
+
break;
|
|
43
|
+
case 'right':
|
|
44
|
+
transformProps = `rotate(90deg) ${transformProps} translate(-50%, -50%)`;
|
|
45
|
+
break;
|
|
46
|
+
case 'top':
|
|
47
|
+
transformProps = `rotate(0deg) ${transformProps} translate(0, 0)`;
|
|
48
|
+
break;
|
|
49
|
+
default:
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
return { transform: transformProps };
|
|
53
|
+
};
|
|
54
|
+
this.arrowTransformOrigin = (arrowPosition) => {
|
|
55
|
+
switch (arrowPosition) {
|
|
56
|
+
case 'bottom':
|
|
57
|
+
return { transformOrigin: 'center top' };
|
|
58
|
+
case 'left':
|
|
59
|
+
return { transformOrigin: 'right center' };
|
|
60
|
+
case 'right':
|
|
61
|
+
return { transformOrigin: 'left center' };
|
|
62
|
+
case 'top':
|
|
63
|
+
return { transformOrigin: 'center bottom' };
|
|
64
|
+
default:
|
|
65
|
+
return { transformOrigin: 'center top' };
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
this.calculatePosition = () => {
|
|
69
|
+
if (!this._caller)
|
|
70
|
+
return;
|
|
71
|
+
const middleware = new Array();
|
|
72
|
+
const config = {};
|
|
73
|
+
if (this._host.shiftPadding) {
|
|
74
|
+
config.padding = this._host.shiftPadding;
|
|
75
|
+
}
|
|
76
|
+
if (this._host.autoPlacement) {
|
|
77
|
+
middleware.push(autoPlacement());
|
|
78
|
+
}
|
|
79
|
+
if (this._host.offset) {
|
|
80
|
+
middleware.push(offset(this._host.offset));
|
|
81
|
+
}
|
|
82
|
+
if (!this._host.autoPlacement && this._host.flip) {
|
|
83
|
+
middleware.push(flip(config));
|
|
84
|
+
}
|
|
85
|
+
if (this._host.shift) {
|
|
86
|
+
middleware.push(shift(config));
|
|
87
|
+
}
|
|
88
|
+
if (this.arrowEl && this._host.arrow) {
|
|
89
|
+
middleware.push(arrow({
|
|
90
|
+
element: this.arrowEl,
|
|
91
|
+
padding: this._host.arrowPadding,
|
|
92
|
+
}));
|
|
93
|
+
}
|
|
94
|
+
computePosition(this._caller, this._host, {
|
|
95
|
+
middleware,
|
|
96
|
+
placement: this._host.placement,
|
|
97
|
+
strategy: this._host.strategy,
|
|
98
|
+
}).then(({ x, y, placement, middlewareData }) => {
|
|
99
|
+
Object.assign(this._host.style, {
|
|
100
|
+
left: `${x}px`,
|
|
101
|
+
top: `${y}px`,
|
|
102
|
+
});
|
|
103
|
+
const arrowStyle = {};
|
|
104
|
+
const arrowPosition = {
|
|
105
|
+
top: 'bottom',
|
|
106
|
+
right: 'left',
|
|
107
|
+
bottom: 'top',
|
|
108
|
+
left: 'right',
|
|
109
|
+
}[placement.split('-')[0]];
|
|
110
|
+
if (arrowPosition && this.arrowEl) {
|
|
111
|
+
Object.assign(arrowStyle, this.arrowTransform(arrowPosition));
|
|
112
|
+
Object.assign(arrowStyle, this.arrowInset(middlewareData, arrowPosition));
|
|
113
|
+
Object.assign(arrowStyle, this.arrowTransformOrigin(arrowPosition));
|
|
114
|
+
Object.assign(this.arrowEl.style, arrowStyle);
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
this._host = host;
|
|
119
|
+
this.arrowEl = arrowEl;
|
|
120
|
+
}
|
|
121
|
+
updateCaller(target) {
|
|
122
|
+
var _a, _b, _c;
|
|
123
|
+
// search caller in document or rootNode of host (if target is in shadowDOM)
|
|
124
|
+
const caller = (_c = (_b = (_a = this._host.parentElement) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector(target)) !== null && _c !== void 0 ? _c : this._host.getRootNode().querySelector(target);
|
|
125
|
+
if (!caller) {
|
|
126
|
+
throw Error(`Target not found: ${target}`);
|
|
127
|
+
}
|
|
128
|
+
this._caller = caller;
|
|
129
|
+
setAttributeIfEmpty(this._caller, 'aria-haspopup', 'true');
|
|
130
|
+
setAttributeIfEmpty(this._caller, 'aria-controls', target);
|
|
131
|
+
setAttributeIfEmpty(this._host, 'role', 'menu');
|
|
132
|
+
setAttributeIfEmpty(this._host, 'aria-labelledby', target);
|
|
133
|
+
return caller;
|
|
134
|
+
}
|
|
135
|
+
updatePosition() {
|
|
136
|
+
if (this.cleanupAutoUpdate)
|
|
137
|
+
this.cleanupAutoUpdate();
|
|
138
|
+
this.cleanupAutoUpdate = autoUpdate(this._caller, this._host, this.calculatePosition);
|
|
139
|
+
}
|
|
140
|
+
dismiss() {
|
|
141
|
+
this.cleanupAutoUpdate();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
export class Backdrop {
|
|
145
|
+
constructor(backdropId) {
|
|
146
|
+
this.defaultBackdropId = 'mds-backdrop';
|
|
147
|
+
this.backdropBackgroundVisible = 'rgba(var(--magma-backdrop-color, 0 0 0) / var(--magma-backdrop-opacity, 0.1))';
|
|
148
|
+
this.backdropBackgroundHidden = 'rgba(var(--magma-backdrop-color, 0 0 0) / 0)';
|
|
149
|
+
this.backdropId = backdropId !== null && backdropId !== void 0 ? backdropId : this.defaultBackdropId;
|
|
150
|
+
this.cssBackdropZIndex = `var(--${this.backdropId}-z-index)`;
|
|
151
|
+
this.cssBackdropDuration = `var(--${this.backdropId}-duration)`;
|
|
152
|
+
}
|
|
153
|
+
attachBackdrop() {
|
|
154
|
+
if (!this.backdropEl) {
|
|
155
|
+
this.backdropEl = document.createElement('div');
|
|
156
|
+
this.backdropEl.className = this.backdropId;
|
|
157
|
+
this.backdropEl.style.inset = '0';
|
|
158
|
+
this.backdropEl.style.pointerEvents = 'none';
|
|
159
|
+
this.backdropEl.style.position = 'fixed';
|
|
160
|
+
this.backdropEl.style.transition = `background-color ${this.cssBackdropDuration} ease-out`;
|
|
161
|
+
this.backdropEl.style.zIndex = this.cssBackdropZIndex;
|
|
162
|
+
}
|
|
163
|
+
this.backdropEl.style.backgroundColor = this.backdropBackgroundHidden;
|
|
164
|
+
document.body.appendChild(this.backdropEl);
|
|
165
|
+
clearTimeout(this.backdropTimer);
|
|
166
|
+
this.backdropTimer = setTimeout(() => {
|
|
167
|
+
this.backdropEl.style.backgroundColor = this.backdropBackgroundVisible;
|
|
168
|
+
}, 1);
|
|
169
|
+
}
|
|
170
|
+
detachBackdrop() {
|
|
171
|
+
if (!this.backdropEl) {
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
this.backdropEl.style.backgroundColor = 'transparent';
|
|
175
|
+
clearTimeout(this.backdropTimer);
|
|
176
|
+
this.backdropTimer = setTimeout(() => {
|
|
177
|
+
this.backdropEl.remove();
|
|
178
|
+
}, cssDurationToMilliseconds(this.cssBackdropDuration));
|
|
179
|
+
}
|
|
180
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const hasSlottedElements = (el, name) => {
|
|
2
|
+
var _a;
|
|
3
|
+
const query = name ? `slot[name="${name}"]` : 'slot:not([name])';
|
|
4
|
+
const slot = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(query);
|
|
5
|
+
if (slot) {
|
|
6
|
+
return slot.assignedElements({ flatten: true }).length > 0;
|
|
7
|
+
}
|
|
8
|
+
return false;
|
|
9
|
+
};
|
|
10
|
+
const hasSlottedNodes = (el, name) => {
|
|
11
|
+
var _a;
|
|
12
|
+
const query = name ? `slot[name="${name}"]` : 'slot:not([name])';
|
|
13
|
+
const slot = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(query);
|
|
14
|
+
if (slot) {
|
|
15
|
+
return slot.assignedNodes().length > 0;
|
|
16
|
+
}
|
|
17
|
+
return false;
|
|
18
|
+
};
|
|
19
|
+
export { hasSlottedElements, hasSlottedNodes, };
|
|
@@ -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:
|
|
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:
|
|
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
|
|
|
@@ -12,6 +12,18 @@ export class MdsModal {
|
|
|
12
12
|
this.window = false;
|
|
13
13
|
this.top = false;
|
|
14
14
|
this.bottom = false;
|
|
15
|
+
/**
|
|
16
|
+
* Specifies if the modal is opened or not
|
|
17
|
+
*/
|
|
18
|
+
this.opened = false;
|
|
19
|
+
/**
|
|
20
|
+
* Specifies the animation position of the modal window
|
|
21
|
+
*/
|
|
22
|
+
this.position = 'center';
|
|
23
|
+
/**
|
|
24
|
+
* Specifies if the component is animating itself or not
|
|
25
|
+
*/
|
|
26
|
+
this.animating = 'none';
|
|
15
27
|
this.updateCSSCustomProps = () => {
|
|
16
28
|
var _a;
|
|
17
29
|
if (typeof window === 'undefined')
|
|
@@ -50,9 +62,6 @@ export class MdsModal {
|
|
|
50
62
|
this.closeEvent.emit();
|
|
51
63
|
}
|
|
52
64
|
};
|
|
53
|
-
this.opened = false;
|
|
54
|
-
this.position = 'center';
|
|
55
|
-
this.animating = 'none';
|
|
56
65
|
}
|
|
57
66
|
componentWillLoad() {
|
|
58
67
|
var _a;
|
|
@@ -85,9 +94,9 @@ export class MdsModal {
|
|
|
85
94
|
render() {
|
|
86
95
|
return (h(Host, { key: '1d00f0a817af0b0a82eae1c790cc7e312165a46e', "aria-modal": clsx(this.opened ? 'true' : 'false'), onClick: (e) => { this.closeModal(e); } }, this.window
|
|
87
96
|
? h("slot", { name: "window" })
|
|
88
|
-
: h("div", { class: clsx('window', (this.top || this.bottom) && `window-${this.top ? '-top' : ''}${this.bottom ? '-bottom' : ''}`),
|
|
97
|
+
: h("div", { class: clsx('window', (this.top || this.bottom) && `window-${this.top ? '-top' : ''}${this.bottom ? '-bottom' : ''}`), part: "window" }, this.top &&
|
|
89
98
|
h("slot", { name: "top" }), h("slot", null), this.bottom &&
|
|
90
|
-
h("slot", { name: "bottom" })), !this.window && h("mds-button", { key: '
|
|
99
|
+
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); } })));
|
|
91
100
|
}
|
|
92
101
|
static get is() { return "mds-modal"; }
|
|
93
102
|
static get encapsulation() { return "shadow"; }
|
|
@@ -117,6 +126,8 @@ export class MdsModal {
|
|
|
117
126
|
"tags": [],
|
|
118
127
|
"text": "Specifies if the modal is opened or not"
|
|
119
128
|
},
|
|
129
|
+
"getter": false,
|
|
130
|
+
"setter": false,
|
|
120
131
|
"attribute": "opened",
|
|
121
132
|
"reflect": true,
|
|
122
133
|
"defaultValue": "false"
|
|
@@ -141,6 +152,8 @@ export class MdsModal {
|
|
|
141
152
|
"tags": [],
|
|
142
153
|
"text": "Specifies the animation position of the modal window"
|
|
143
154
|
},
|
|
155
|
+
"getter": false,
|
|
156
|
+
"setter": false,
|
|
144
157
|
"attribute": "position",
|
|
145
158
|
"reflect": true,
|
|
146
159
|
"defaultValue": "'center'"
|
|
@@ -165,6 +178,8 @@ export class MdsModal {
|
|
|
165
178
|
"tags": [],
|
|
166
179
|
"text": "Specifies if the component is animating itself or not"
|
|
167
180
|
},
|
|
181
|
+
"getter": false,
|
|
182
|
+
"setter": false,
|
|
168
183
|
"attribute": "animating",
|
|
169
184
|
"reflect": true,
|
|
170
185
|
"defaultValue": "'none'"
|
|
@@ -20,7 +20,7 @@ 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
25
|
const InteractiveTemplate = () => {
|
|
26
26
|
// Click not working with reader
|
|
@@ -32,7 +32,12 @@ export const Default = Template.bind({});
|
|
|
32
32
|
Default.args = {
|
|
33
33
|
position: 'right',
|
|
34
34
|
};
|
|
35
|
-
export const
|
|
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({});
|
|
36
41
|
export const Interactive = InteractiveTemplate.bind({});
|
|
37
42
|
export const ARIATest = CustomTemplate.bind({});
|
|
38
43
|
ARIATest.args = {
|
|
@@ -14,8 +14,8 @@ const fileExtensionsDictionary = {
|
|
|
14
14
|
exe: { format: 'executable', description: 'fileEXE' },
|
|
15
15
|
flac: { format: 'audio', description: 'uncompressedAudio' },
|
|
16
16
|
gif: { format: 'image', description: 'compressedImage', preview: true },
|
|
17
|
-
htm: { format: 'markup', description: 'documentWeb' },
|
|
18
17
|
heic: { format: 'image', description: 'imageHEFF' },
|
|
18
|
+
htm: { format: 'markup', description: 'documentWeb' },
|
|
19
19
|
html: { format: 'markup', description: 'documentWeb' },
|
|
20
20
|
jpe: { format: 'image', description: 'compressedImage', preview: true },
|
|
21
21
|
jpeg: { format: 'image', description: 'compressedImage', preview: true },
|
|
@@ -32,9 +32,12 @@ const fileExtensionsDictionary = {
|
|
|
32
32
|
mpg4: { format: 'video', description: 'videoSD' },
|
|
33
33
|
mpg: { format: 'video', description: 'videoSD' },
|
|
34
34
|
mpga: { format: 'audio', description: 'compressedAudio' },
|
|
35
|
+
odf: { format: 'document', description: 'openDocumentFormat' },
|
|
35
36
|
odp: { format: 'slide', description: 'slideLO' },
|
|
36
37
|
ods: { format: 'spreadsheet', description: 'spreadsheetLO' },
|
|
37
38
|
odt: { format: 'text', description: 'documentLO' },
|
|
39
|
+
ole: { format: 'document', description: 'objectLinkingAndEmbedding' },
|
|
40
|
+
p7m: { format: 'certificate', description: 'documentDigitalSingnature' },
|
|
38
41
|
pdf: { format: 'document', description: 'documentAdobe' },
|
|
39
42
|
php: { format: 'code', description: 'filePHP' },
|
|
40
43
|
png: { format: 'image', description: 'imagePNG', preview: true },
|
|
@@ -47,6 +50,7 @@ const fileExtensionsDictionary = {
|
|
|
47
50
|
tar: { format: 'archive', description: 'uncompressedArchive' },
|
|
48
51
|
tiff: { format: 'image', description: 'imageTIFF' },
|
|
49
52
|
ts: { format: 'code', description: 'fileTS' },
|
|
53
|
+
tsd: { format: 'certificate', description: 'certificateTSD' },
|
|
50
54
|
tsx: { format: 'code', description: 'fileTSX' },
|
|
51
55
|
txt: { format: 'text', description: 'documentTXT' },
|
|
52
56
|
wav: { format: 'audio', description: 'uncompressedAudio' },
|
|
@@ -54,66 +58,9 @@ const fileExtensionsDictionary = {
|
|
|
54
58
|
xar: { format: 'archive', description: 'compressedArchive' },
|
|
55
59
|
xls: { format: 'spreadsheet', description: 'spreadsheetMS' },
|
|
56
60
|
xlsx: { format: 'spreadsheet', description: 'spreadsheetMS' },
|
|
61
|
+
xml: { format: 'markup', description: 'extensibleMarkupLanguage' },
|
|
57
62
|
zip: { format: 'archive', description: 'compressedArchive' },
|
|
58
63
|
};
|
|
59
|
-
// const fileExtensionsDictionary: FileExtenstion = {
|
|
60
|
-
// '7z': { format: 'archive', description: 'Archivio compresso' },
|
|
61
|
-
// ace: { format: 'archive', description: 'Archivio compresso' },
|
|
62
|
-
// ai: { format: 'vector', description: 'Vettoriale Adobe Illustrator' },
|
|
63
|
-
// dart: { format: 'code', description: 'Dart' },
|
|
64
|
-
// db: { format: 'data', description: 'File di database' },
|
|
65
|
-
// default: { format: 'attachment', description: 'Formato sconosciuto' },
|
|
66
|
-
// dmg: { format: 'executable', description: 'Apple Disk Image' },
|
|
67
|
-
// doc: { format: 'text', description: 'Documento Microsoft Word' },
|
|
68
|
-
// docm: { format: 'text', description: 'Documento Microsoft Word' },
|
|
69
|
-
// docx: { format: 'text', description: 'Documento Microsoft Word Compresso' },
|
|
70
|
-
// eml: { format: 'email', description: 'E-mail di posta elettronica' },
|
|
71
|
-
// eps: { format: 'vector', description: 'Vettoriale Corel Draw' },
|
|
72
|
-
// exe: { format: 'executable', description: 'File eseguibile Windows' },
|
|
73
|
-
// flac: { format: 'audio', description: 'Audio non compresso' },
|
|
74
|
-
// gif: { format: 'image', description: 'Immagine compressa', preview: true },
|
|
75
|
-
// htm: { format: 'markup', description: 'Pagina web' },
|
|
76
|
-
// heic: { format: 'image', description: 'High Efficiency Image File Format' },
|
|
77
|
-
// html: { format: 'markup', description: 'Pagina web' },
|
|
78
|
-
// jpe: { format: 'image', description: 'Immagine compressa', preview: true },
|
|
79
|
-
// jpeg: { format: 'image', description: 'Immagine compressa', preview: true },
|
|
80
|
-
// jpg: { format: 'image', description: 'Immagine compressa', preview: true },
|
|
81
|
-
// js: { format: 'code', description: 'JavaScript' },
|
|
82
|
-
// json: { format: 'data', description: 'JavaScript Object Notation' },
|
|
83
|
-
// jsx: { format: 'code', description: 'JavaScript' },
|
|
84
|
-
// m2v: { format: 'video', description: 'Filmato SD' },
|
|
85
|
-
// mp2: { format: 'audio', description: 'Audio compresso' },
|
|
86
|
-
// mp3: { format: 'audio', description: 'Audio compresso' },
|
|
87
|
-
// mp4: { format: 'video', description: 'Filmato HD' },
|
|
88
|
-
// mp4v: { format: 'video', description: 'Filmato HD' },
|
|
89
|
-
// mpeg: { format: 'video', description: 'Filmato SD' },
|
|
90
|
-
// mpg4: { format: 'video', description: 'Filmato SD' },
|
|
91
|
-
// mpg: { format: 'video', description: 'Filmato SD' },
|
|
92
|
-
// mpga: { format: 'audio', description: 'Audio compresso' },
|
|
93
|
-
// odp: { format: 'slide', description: 'Slide di presentazione LibreOffice' },
|
|
94
|
-
// ods: { format: 'spreadsheet', description: 'Foglio di calcolo LibreOffice' },
|
|
95
|
-
// odt: { format: 'text', description: 'File di testo LibreOffice' },
|
|
96
|
-
// pdf: { format: 'document', description: 'Documento Adobe' },
|
|
97
|
-
// php: { format: 'code', description: 'Hypertext Preprocessor' },
|
|
98
|
-
// png: { format: 'image', description: 'Immagine Portable Network Graphics', preview: true },
|
|
99
|
-
// ppt: { format: 'slide', description: 'Slide di presentazione PowerPoint' },
|
|
100
|
-
// rar: { format: 'archive', description: 'Archivio compresso' },
|
|
101
|
-
// rtf: { format: 'text', description: 'Documento di testo Rich Text Format' },
|
|
102
|
-
// sass: { format: 'code', description: 'Syntactically Awesome StyleSheets' },
|
|
103
|
-
// shtml: { format: 'markup', description: 'Pagina web' },
|
|
104
|
-
// svg: { format: 'vector', description: 'Scalable Vector Graphics', preview: true },
|
|
105
|
-
// tar: { format: 'archive', description: 'Archivio non compresso' },
|
|
106
|
-
// tiff: { format: 'image', description: 'Tag Image File Format' },
|
|
107
|
-
// ts: { format: 'code', description: 'TypeScript' },
|
|
108
|
-
// tsx: { format: 'code', description: 'TypeScript Extended Syntax' },
|
|
109
|
-
// txt: { format: 'text', description: 'Documento di testo non formattato' },
|
|
110
|
-
// wav: { format: 'audio', description: 'Audio non compresso' },
|
|
111
|
-
// webp: { format: 'image', description: 'Immagine Web Picture', preview: true },
|
|
112
|
-
// xar: { format: 'archive', description: 'Archivio compresso' },
|
|
113
|
-
// xls: { format: 'spreadsheet', description: 'Foglio di calcolo Office' },
|
|
114
|
-
// xlsx: { format: 'spreadsheet', description: 'Foglio di calcolo Office' },
|
|
115
|
-
// zip: { format: 'archive', description: 'Archivio compresso' },
|
|
116
|
-
// }
|
|
117
64
|
const genericMimeToExt = new Map([
|
|
118
65
|
['image', ['.png', '.jpg', '.jpeg', '.tiff', '.webp', '.jpe', '.gif', '.heic']],
|
|
119
66
|
['audio', ['.mp2', '.mp3', '.mpga', '.wav', '.flac']],
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const treeActionsDictionary = [
|
|
2
|
+
'auto',
|
|
3
|
+
'visible',
|
|
4
|
+
];
|
|
5
|
+
const treeAppearanceDictionary = [
|
|
6
|
+
'depth',
|
|
7
|
+
'none',
|
|
8
|
+
];
|
|
9
|
+
const treeIconDictionary = [
|
|
10
|
+
'folder',
|
|
11
|
+
'chevron',
|
|
12
|
+
];
|
|
13
|
+
export { treeActionsDictionary, treeAppearanceDictionary, treeIconDictionary, };
|
|
@@ -54,4 +54,65 @@ const filesList = [
|
|
|
54
54
|
'wisconsin_bypassing_small.xar',
|
|
55
55
|
'wooden.jsx',
|
|
56
56
|
];
|
|
57
|
-
|
|
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 {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,6 +3,7 @@ import baselineAttachFile from "@icon/mi/baseline/attach-file.svg";
|
|
|
3
3
|
import baselineAudiotrack from "@icon/mi/baseline/audiotrack.svg";
|
|
4
4
|
import baselineTerminal from "@icon/mi/baseline/terminal.svg";
|
|
5
5
|
import baselineInsertDriveFile from "@icon/mi/baseline/insert-drive-file.svg";
|
|
6
|
+
import mdiLicense from "@icon/mdi/license.svg";
|
|
6
7
|
import mdiHardDisk from "@icon/mdi/harddisk.svg";
|
|
7
8
|
import baselineEmail from "@icon/mi/baseline/email.svg";
|
|
8
9
|
import baselineWysiwyg from "@icon/mi/baseline/wysiwyg.svg";
|
|
@@ -26,6 +27,10 @@ const fileFormatsVariant = {
|
|
|
26
27
|
icon: baselineAudiotrack,
|
|
27
28
|
variant: 'violet',
|
|
28
29
|
},
|
|
30
|
+
certificate: {
|
|
31
|
+
icon: mdiLicense,
|
|
32
|
+
variant: 'orange',
|
|
33
|
+
},
|
|
29
34
|
code: {
|
|
30
35
|
icon: baselineTerminal,
|
|
31
36
|
variant: 'yellow',
|