@lab-anssi/ui-kit 1.18.0 → 1.20.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.
@@ -0,0 +1,114 @@
1
+ .bouton {
2
+ display: flex;
3
+ align-items: center;
4
+ gap: 8px;
5
+ font-family: Marianne, arial, sans-serif;
6
+ cursor: pointer;
7
+ justify-content: center;
8
+
9
+ font-style: normal;
10
+ font-weight: 500;
11
+
12
+ &:focus {
13
+ outline: 2px solid #0a76f6;
14
+ outline-offset: 2px;
15
+ }
16
+
17
+ &.sm {
18
+ padding: 4px 12px;
19
+ font-size: 0.875rem;
20
+ line-height: 1.5rem;
21
+
22
+ &.icone-droite {
23
+ padding-right: 8px;
24
+ }
25
+
26
+ &.icone-gauche {
27
+ padding-left: 8px;
28
+ }
29
+
30
+ &.icone-seule {
31
+ padding: 8px;
32
+ }
33
+ }
34
+
35
+ &.md {
36
+ padding: 8px 16px;
37
+ font-size: 1rem;
38
+ line-height: 1.5rem;
39
+
40
+ &.icone-droite {
41
+ padding-right: 12px;
42
+ }
43
+
44
+ &.icone-gauche {
45
+ padding-left: 12px;
46
+ }
47
+
48
+ &.icone-seule {
49
+ padding: 8px;
50
+ }
51
+ }
52
+
53
+ &.lg {
54
+ padding: 10px 24px;
55
+ font-size: 1.125rem;
56
+ line-height: 1.75rem;
57
+
58
+ &.icone-droite {
59
+ padding-right: 18px;
60
+ }
61
+
62
+ &.icone-gauche {
63
+ padding-left: 18px;
64
+ }
65
+
66
+ &.icone-seule {
67
+ padding: 12px;
68
+ }
69
+ }
70
+
71
+ &.primaire {
72
+ background: $bouton-primaire-couleur-fond;
73
+ color: $bouton-primaire-couleur-texte;
74
+ border: 1px solid transparent;
75
+ border-radius: $bouton-arrondi;
76
+
77
+ &:hover {
78
+ background: $bouton-primaire-couleur-fond-survol;
79
+ }
80
+
81
+ &:active {
82
+ background: $bouton-primaire-couleur-fond-clique;
83
+ }
84
+ }
85
+
86
+ &.tertiaire,
87
+ &.tertiaire-sans-bordure {
88
+ color: $bouton-secondaire-tertiaire-couleur-texte;
89
+ text-align: center;
90
+ background: white;
91
+ border-radius: $bouton-arrondi;
92
+
93
+ &:hover {
94
+ background: rgb(0, 0, 0, 4%);
95
+ }
96
+
97
+ &:active {
98
+ background: rgb(0, 0, 0, 8%);
99
+ }
100
+
101
+ &:focus {
102
+ outline: 2px solid #0a76f6;
103
+ outline-offset: 2px;
104
+ }
105
+ }
106
+
107
+ &.tertiaire {
108
+ border: 1px solid #ddd;
109
+ }
110
+
111
+ &.tertiaire-sans-bordure {
112
+ border: 1px solid transparent;
113
+ }
114
+ }
@@ -11,11 +11,11 @@
11
11
  />
12
12
 
13
13
  <script>import { estLien } from "../../types.js";
14
- import ComposantTag from "./Tag.svelte";
14
+ import Tag from "../Tag.svelte";
15
15
  export let titre;
16
16
  export let description = "";
17
17
  export let filAriane = [];
18
- export let tag = null;
18
+ export let infosTag = null;
19
19
  let filArianeVisible = window.matchMedia("(min-width: 576px)").matches;
20
20
  </script>
21
21
 
@@ -37,9 +37,13 @@ let filArianeVisible = window.matchMedia("(min-width: 576px)").matches;
37
37
  </div>
38
38
  {/if}
39
39
  <div class="conteneur-texte">
40
- {#if tag}
40
+ {#if infosTag}
41
41
  <div class="conteneur-tag">
42
- <ComposantTag {tag} />
42
+ <Tag
43
+ couleurFond={infosTag.couleurFond}
44
+ couleurTexte={infosTag.couleurTexte}
45
+ label={infosTag.label}
46
+ />
43
47
  </div>
44
48
  {/if}
45
49
  <div class="conteneur-corps">
@@ -1,11 +1,11 @@
1
1
  import { SvelteComponent } from "svelte";
2
- import { type NoeudFilAriane, type Tag } from "../../types.js";
2
+ import { type NoeudFilAriane, type InfosTag } from "../../types.js";
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  titre: string;
6
6
  description?: string;
7
7
  filAriane?: NoeudFilAriane[];
8
- tag?: Tag | null;
8
+ infosTag?: InfosTag | null;
9
9
  };
10
10
  events: {
11
11
  [evt: string]: CustomEvent<any>;
@@ -1,4 +1,4 @@
1
- <script>import ComposantTag from "./Tag.svelte";
1
+ <script>import Tag from "../Tag.svelte";
2
2
  import Fleche from "../icones/Fleche.svelte";
3
3
  export let article;
4
4
  export let categorie;
@@ -6,7 +6,11 @@ export let categorie;
6
6
 
7
7
  <a class="carte-article" href={article.href}>
8
8
  <div class="conteneur-texte">
9
- <ComposantTag tag={categorie} />
9
+ <Tag
10
+ couleurFond={categorie.couleurFond}
11
+ couleurTexte={categorie.couleurTexte}
12
+ label={categorie.label}
13
+ />
10
14
  <p>{article.titre}</p>
11
15
  </div>
12
16
  <div class="conteneur-fleche">
@@ -1,9 +1,9 @@
1
1
  import { SvelteComponent } from "svelte";
2
- import type { ResumeArticle, Tag } from "../../types";
2
+ import type { ResumeArticle, InfosTag } from "../../types";
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  article: ResumeArticle;
6
- categorie: Tag;
6
+ categorie: InfosTag;
7
7
  };
8
8
  events: {
9
9
  [evt: string]: CustomEvent<any>;
package/dist/types.d.ts CHANGED
@@ -41,7 +41,7 @@ type Feuille = {
41
41
  };
42
42
  export type NoeudFilAriane = Lien | Feuille;
43
43
  export declare const estLien: (noeud: NoeudFilAriane) => noeud is Lien;
44
- export type Tag = {
44
+ export type InfosTag = {
45
45
  label: string;
46
46
  couleurTexte: string;
47
47
  couleurFond: string;
@@ -56,5 +56,5 @@ export type ResumeArticle = {
56
56
  titre: string;
57
57
  href: string;
58
58
  };
59
- export type CategoriesArticle = Record<string, Tag>;
59
+ export type CategoriesArticle = Record<string, InfosTag>;
60
60
  export {};