@1024pix/pix-ui 60.7.0 → 60.8.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.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MODAL_VARIANTS } from '@1024pix/pix-ui/helpers/variants';
|
|
1
2
|
import { guidFor } from '@ember/object/internals';
|
|
2
3
|
import Component from '@glimmer/component';
|
|
3
4
|
|
|
@@ -17,6 +18,18 @@ export default class PixModal extends Component {
|
|
|
17
18
|
return guidFor(this);
|
|
18
19
|
}
|
|
19
20
|
|
|
21
|
+
get variant() {
|
|
22
|
+
if (this.args.variant && !MODAL_VARIANTS.includes(this.args.variant)) {
|
|
23
|
+
throw new Error(
|
|
24
|
+
`ERROR in PixModal component: @variant should be one of ${MODAL_VARIANTS.join(', ')}`,
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const value = this.args.variant ?? 'default';
|
|
29
|
+
|
|
30
|
+
return value;
|
|
31
|
+
}
|
|
32
|
+
|
|
20
33
|
<template>
|
|
21
34
|
<PixOverlay
|
|
22
35
|
@isVisible={{@showModal}}
|
|
@@ -25,14 +38,14 @@ export default class PixModal extends Component {
|
|
|
25
38
|
@hasCenteredContent={{true}}
|
|
26
39
|
>
|
|
27
40
|
<div
|
|
28
|
-
class="pix-modal"
|
|
41
|
+
class="pix-modal pix-modal--{{this.variant}}"
|
|
29
42
|
role="dialog"
|
|
30
43
|
aria-labelledby="modal-title--{{this.id}}"
|
|
31
44
|
aria-describedby="modal-content--{{this.id}}"
|
|
32
45
|
aria-modal="true"
|
|
33
46
|
...attributes
|
|
34
47
|
>
|
|
35
|
-
<div class="pix-modal__header">
|
|
48
|
+
<div class="pix-modal__header pix-modal__header--{{this.variant}}">
|
|
36
49
|
<h1 id="modal-title--{{this.id}}" class="pix-modal__title">{{@title}}</h1>
|
|
37
50
|
<PixIconButton
|
|
38
51
|
@iconName="close"
|
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
@use "pix-design-tokens/shadows";
|
|
4
4
|
|
|
5
5
|
.pix-modal {
|
|
6
|
-
@extend %pix-shadow-sm;
|
|
7
|
-
|
|
8
6
|
position: relative;
|
|
9
7
|
left: 50%;
|
|
10
8
|
width: min(32rem, calc(100% - var(--pix-spacing-4x)));
|
|
@@ -13,15 +11,38 @@
|
|
|
13
11
|
border-radius: var(--pix-spacing-4x);
|
|
14
12
|
transform: translateX(-50%);
|
|
15
13
|
|
|
14
|
+
&--default {
|
|
15
|
+
@extend %pix-shadow-default;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&--orga {
|
|
19
|
+
@extend %pix-shadow-orga;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&--certif {
|
|
23
|
+
@extend %pix-shadow-certif;
|
|
24
|
+
}
|
|
25
|
+
|
|
16
26
|
&__header {
|
|
17
27
|
display: flex;
|
|
18
28
|
align-items: flex-start;
|
|
19
29
|
justify-content: space-between;
|
|
20
30
|
padding: var(--pix-spacing-6x) var(--pix-spacing-4x) var(--pix-spacing-6x) var(--pix-spacing-6x);
|
|
21
31
|
color: var(--pix-neutral-900);
|
|
22
|
-
background: var(--pix-gradient-default-light);
|
|
23
32
|
border-top-left-radius: var(--pix-spacing-4x) var(--pix-spacing-4x);
|
|
24
33
|
border-top-right-radius: var(--pix-spacing-4x) var(--pix-spacing-4x);
|
|
34
|
+
|
|
35
|
+
&--default {
|
|
36
|
+
background: var(--pix-gradient-default-light);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&--orga {
|
|
40
|
+
background: var(--pix-gradient-orga-light);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&--certif {
|
|
44
|
+
background: var(--pix-gradient-certif-light);
|
|
45
|
+
}
|
|
25
46
|
}
|
|
26
47
|
|
|
27
48
|
&__close-button {
|