@lab-anssi/ui-kit 1.21.3 → 1.23.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.
@@ -7,6 +7,7 @@
7
7
  taille: { reflect: false, type: "String", attribute: "taille" },
8
8
  icone: { reflect: false, type: "String", attribute: "icone" },
9
9
  positionIcone: { reflect: false, type: "String", attribute: "position-icone" },
10
+ actif: { reflect: false, type: "Boolean", attribute: "actif" },
10
11
  },
11
12
  }}
12
13
  />
@@ -17,12 +18,13 @@ export let variante;
17
18
  export let taille;
18
19
  export let icone = void 0;
19
20
  export let positionIcone = "sans";
21
+ export let actif = true;
20
22
  </script>
21
23
 
22
24
  <button
23
25
  class={`bouton ${variante} ${taille} icone-${positionIcone}`}
24
- on:click
25
26
  title={positionIcone === "seule" ? titre : ""}
27
+ disabled={!actif}
26
28
  >
27
29
  {#if (positionIcone === "gauche" || positionIcone === "seule") && icone}
28
30
  <Icone nom={icone} taille={taille === "lg" ? "md" : "sm"} />
@@ -91,6 +93,9 @@ export let positionIcone = "sans";
91
93
  .bouton.lg.icone-seule {
92
94
  padding: 12px;
93
95
  }
96
+ .bouton:disabled, .bouton[aria-disabled] {
97
+ cursor: not-allowed;
98
+ }
94
99
  .bouton.primaire {
95
100
  background: var(--bouton-primaire-couleur-fond);
96
101
  color: var(--bouton-primaire-couleur-texte);
@@ -103,6 +108,10 @@ export let positionIcone = "sans";
103
108
  .bouton.primaire:active {
104
109
  background: var(--bouton-primaire-couleur-fond-clique);
105
110
  }
111
+ .bouton.primaire:disabled, .bouton.primaire[aria-disabled] {
112
+ background: #e5e5e5;
113
+ color: #929292;
114
+ }
106
115
  .bouton.tertiaire, .bouton.tertiaire-sans-bordure {
107
116
  color: var(--bouton-secondaire-tertiaire-couleur-texte);
108
117
  text-align: center;
@@ -115,6 +124,10 @@ export let positionIcone = "sans";
115
124
  .bouton.tertiaire:active, .bouton.tertiaire-sans-bordure:active {
116
125
  background: rgba(0, 0, 0, 0.08);
117
126
  }
127
+ .bouton.tertiaire:disabled, .bouton.tertiaire[aria-disabled], .bouton.tertiaire-sans-bordure:disabled, .bouton.tertiaire-sans-bordure[aria-disabled] {
128
+ background: transparent;
129
+ color: #929292;
130
+ }
118
131
  .bouton.tertiaire {
119
132
  border: 1px solid #ddd;
120
133
  }
@@ -6,10 +6,9 @@ declare const __propDef: {
6
6
  taille: "sm" | "md" | "lg";
7
7
  icone?: string | undefined;
8
8
  positionIcone?: "sans" | "seule" | "droite" | "gauche";
9
+ actif?: boolean;
9
10
  };
10
11
  events: {
11
- click: MouseEvent;
12
- } & {
13
12
  [evt: string]: CustomEvent<any>;
14
13
  };
15
14
  slots: {};
@@ -10,6 +10,7 @@
10
10
  apparence: { reflect: false, type: "String", attribute: "apparence" },
11
11
  cible: { reflect: false, type: "String", attribute: "cible" },
12
12
  positionIcone: { reflect: false, type: "String", attribute: "position-icone" },
13
+ actif: { reflect: false, type: "Boolean", attribute: "actif" },
13
14
  },
14
15
  }}
15
16
  />
@@ -23,6 +24,7 @@ export let icone = void 0;
23
24
  export let apparence = "lien";
24
25
  export let cible = void 0;
25
26
  export let positionIcone = "sans";
27
+ export let actif = true;
26
28
  </script>
27
29
 
28
30
  <a
@@ -30,6 +32,7 @@ export let positionIcone = "sans";
30
32
  {href}
31
33
  target={cible}
32
34
  title={positionIcone === "seule" ? titre : ""}
35
+ aria-disabled={!actif}
33
36
  >
34
37
  {#if (positionIcone === "gauche" || positionIcone === "seule") && icone}
35
38
  <Icone nom={icone} taille={taille === "lg" ? "md" : "sm"} />
@@ -195,6 +198,10 @@ export let positionIcone = "sans";
195
198
  padding: 12px;
196
199
  }
197
200
 
201
+ .bouton:disabled, .bouton[aria-disabled] {
202
+ cursor: not-allowed;
203
+ }
204
+
198
205
  .bouton.primaire {
199
206
  background: var(--bouton-primaire-couleur-fond);
200
207
  color: var(--bouton-primaire-couleur-texte);
@@ -210,6 +217,11 @@ export let positionIcone = "sans";
210
217
  background: var(--bouton-primaire-couleur-fond-clique);
211
218
  }
212
219
 
220
+ .bouton.primaire:disabled, .bouton.primaire[aria-disabled] {
221
+ background: #e5e5e5;
222
+ color: #929292;
223
+ }
224
+
213
225
  .bouton.tertiaire, .bouton.tertiaire-sans-bordure {
214
226
  color: var(--bouton-secondaire-tertiaire-couleur-texte);
215
227
  text-align: center;
@@ -225,6 +237,11 @@ export let positionIcone = "sans";
225
237
  background: rgba(0, 0, 0, 0.08);
226
238
  }
227
239
 
240
+ .bouton.tertiaire:disabled, .bouton.tertiaire[aria-disabled], .bouton.tertiaire-sans-bordure:disabled, .bouton.tertiaire-sans-bordure[aria-disabled] {
241
+ background: transparent;
242
+ color: #929292;
243
+ }
244
+
228
245
  .bouton.tertiaire {
229
246
  border: 1px solid #ddd;
230
247
  }
@@ -9,6 +9,7 @@ declare const __propDef: {
9
9
  apparence?: "lien" | "bouton" | "lien-texte";
10
10
  cible?: string | undefined;
11
11
  positionIcone?: "sans" | "seule" | "droite" | "gauche";
12
+ actif?: boolean;
12
13
  };
13
14
  events: {
14
15
  [evt: string]: CustomEvent<any>;
@@ -7,6 +7,7 @@
7
7
  label: { reflect: false, type: "String", attribute: "label" },
8
8
  taille: { reflect: false, type: "String", attribute: "taille" },
9
9
  type: { reflect: false, type: "String", attribute: "type" },
10
+ presse: { reflect: false, type: "Boolean", attribute: "presse" },
10
11
  },
11
12
  }}
12
13
  />
@@ -16,7 +17,8 @@ export let couleurTexte;
16
17
  export let couleurFond;
17
18
  export let taille = "sm";
18
19
  export let type = "defaut";
19
- let selectionne = false;
20
+ export let presse = false;
21
+ $: selectionne = presse;
20
22
  const bascule = () => {
21
23
  selectionne = !selectionne;
22
24
  };
@@ -6,6 +6,7 @@ declare const __propDef: {
6
6
  couleurFond: string | undefined;
7
7
  taille?: "sm" | "md";
8
8
  type?: "defaut" | "selectionnable";
9
+ presse?: boolean;
9
10
  };
10
11
  events: {
11
12
  [evt: string]: CustomEvent<any>;
@@ -68,6 +68,11 @@
68
68
  }
69
69
  }
70
70
 
71
+ &:disabled,
72
+ &[aria-disabled] {
73
+ cursor: not-allowed;
74
+ }
75
+
71
76
  &.primaire {
72
77
  background: $bouton-primaire-couleur-fond;
73
78
  color: $bouton-primaire-couleur-texte;
@@ -81,6 +86,12 @@
81
86
  &:active {
82
87
  background: $bouton-primaire-couleur-fond-clique;
83
88
  }
89
+
90
+ &:disabled,
91
+ &[aria-disabled] {
92
+ background: #e5e5e5;
93
+ color: #929292;
94
+ }
84
95
  }
85
96
 
86
97
  &.tertiaire,
@@ -97,6 +108,12 @@
97
108
  &:active {
98
109
  background: rgb(0, 0, 0, 8%);
99
110
  }
111
+
112
+ &:disabled,
113
+ &[aria-disabled] {
114
+ background: transparent;
115
+ color: #929292;
116
+ }
100
117
  }
101
118
 
102
119
  &.tertiaire {