@1024pix/pix-ui 60.7.0 → 60.9.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"
@@ -1 +1,3 @@
1
1
  export const VARIANTS = ['primary', 'orga', 'certif', 'admin', 'modulix'];
2
+
3
+ export const MODAL_VARIANTS = ['default', 'orga', 'certif'];
@@ -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 {
@@ -5,6 +5,13 @@
5
5
  src: url('../@1024pix/pix-ui/fonts/Nunito/Nunito-Bold.woff2');
6
6
  }
7
7
 
8
+ @font-face {
9
+ font-weight: 800;
10
+ font-family: 'Nunito';
11
+ font-style: normal;
12
+ src: url('../@1024pix/pix-ui/fonts/Nunito/Nunito-ExtraBold.woff2');
13
+ }
14
+
8
15
  @font-face {
9
16
  font-weight: 400;
10
17
  font-family: 'Nunito';
@@ -66,6 +73,7 @@ $font-bold: 700;
66
73
  --pix-font-normal: 400;
67
74
  --pix-font-medium: 500;
68
75
  --pix-font-bold: 700;
76
+ --pix-font-extrabold: 800;
69
77
 
70
78
  // Private property, do not use directly
71
79
  // See https://ui.pix.fr/?path=/docs/utiliser-pix-ui-design-tokens-typographie--docs
@@ -4,7 +4,7 @@
4
4
 
5
5
  // Placeholder pour permettre l'utilisation dans une classe css si jamais le tag html a trop de classe
6
6
  %-pix-title {
7
- font-weight: var(--pix-font-bold);
7
+ font-weight: var(--pix-font-extrabold);
8
8
 
9
9
  // stylelint-disable-next-line custom-property-pattern
10
10
  font-family: var(--_pix-font-family-title);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1024pix/pix-ui",
3
- "version": "60.7.0",
3
+ "version": "60.9.0",
4
4
  "description": "Pix-UI is the implementation of Pix design principles and guidelines for its products.",
5
5
  "keywords": [
6
6
  "ember-addon"