allaw-ui 3.5.1 → 3.5.3
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/components/atoms/buttons/InboxButton.d.ts +22 -11
- package/dist/components/atoms/buttons/InboxButton.js +41 -10
- package/dist/components/atoms/buttons/InboxButton.module.css +88 -7
- package/dist/components/atoms/buttons/InboxButton.stories.d.ts +59 -80
- package/dist/components/atoms/buttons/InboxButton.stories.js +54 -73
- package/dist/styles/global.css +1 -1
- package/package.json +1 -1
- package/dist/app/[job]/[profile]/common/ProfileClientWrapper.d.ts +0 -0
- package/dist/app/[job]/[profile]/common/ProfileClientWrapper.js +0 -0
- package/dist/app/[job]/[profile]/page.d.ts +0 -0
- package/dist/app/[job]/[profile]/page.js +0 -0
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export
|
|
3
|
-
|
|
2
|
+
export interface InboxButtonProps {
|
|
3
|
+
/** Nombre d'éléments à afficher */
|
|
4
|
+
count?: number;
|
|
5
|
+
/** Callback au clic */
|
|
4
6
|
onClick?: () => void;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
/** Textes à afficher suivant la valeur de `count` */
|
|
8
|
+
labels: {
|
|
9
|
+
none: string;
|
|
10
|
+
one: string;
|
|
11
|
+
multiple: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Thème de couleur automatique :
|
|
15
|
+
* - "notification" : bleu si 0, rouge sinon (et disabled si 0)
|
|
16
|
+
* - "qualification" : vert si count>0, gris sinon
|
|
17
|
+
*/
|
|
18
|
+
scheme?: "notification" | "qualification";
|
|
19
|
+
/** Classe CSS de l'icône à gauche */
|
|
20
|
+
iconClassName?: string;
|
|
21
|
+
/** aria-label de l'icône */
|
|
22
|
+
iconAriaLabel?: string;
|
|
23
|
+
}
|
|
24
|
+
declare const InboxButton: React.FC<InboxButtonProps>;
|
|
14
25
|
export default InboxButton;
|
|
@@ -2,15 +2,46 @@ import clsx from "clsx";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import styles from "./InboxButton.module.css";
|
|
4
4
|
var InboxButton = function (_a) {
|
|
5
|
-
var _b = _a.
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
var _b = _a.count, count = _b === void 0 ? 0 : _b, onClick = _a.onClick, labels = _a.labels, _c = _a.scheme, scheme = _c === void 0 ? "notification" : _c, iconClassName = _a.iconClassName, iconAriaLabel = _a.iconAriaLabel;
|
|
6
|
+
var isZero = count === 0;
|
|
7
|
+
var isDisabled = scheme === "notification" && isZero;
|
|
8
|
+
var isQualificationZero = scheme === "qualification" && isZero;
|
|
9
|
+
// Choix du label
|
|
10
|
+
var label = isZero
|
|
11
|
+
? labels.none
|
|
12
|
+
: count === 1
|
|
13
|
+
? labels.one
|
|
14
|
+
: labels.multiple.replace("{{count}}", String(count));
|
|
15
|
+
// Choix automatique des classes bg + text
|
|
16
|
+
var bgKey;
|
|
17
|
+
var colorKey;
|
|
18
|
+
if (scheme === "notification") {
|
|
19
|
+
if (isZero) {
|
|
20
|
+
bgKey = "light-blue";
|
|
21
|
+
colorKey = "blue";
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
bgKey = "light-red";
|
|
25
|
+
colorKey = "red";
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
// qualification
|
|
30
|
+
if (isZero) {
|
|
31
|
+
bgKey = "pure-white";
|
|
32
|
+
colorKey = "mid-grey";
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
bgKey = "pure-white";
|
|
36
|
+
colorKey = "noir";
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return (React.createElement("button", { className: clsx(styles.inboxBtn, isDisabled && styles.disabled, isQualificationZero && styles.qualificationZero, !isDisabled && !isQualificationZero && styles["bg-".concat(bgKey)], scheme === "qualification" &&
|
|
40
|
+
!isQualificationZero &&
|
|
41
|
+
styles.qualificationActive), disabled: isDisabled, onClick: onClick },
|
|
42
|
+
iconClassName && (React.createElement("i", { className: clsx(styles.icon, iconClassName, !isDisabled && !isQualificationZero && styles["color-".concat(colorKey)], isQualificationZero && styles.colorDarkGrey, scheme === "qualification" &&
|
|
43
|
+
!isQualificationZero &&
|
|
44
|
+
styles.colorNoir), "aria-label": iconAriaLabel })),
|
|
45
|
+
React.createElement("span", { className: clsx(styles.label, isDisabled && styles.labelDisabled, !isDisabled && !isQualificationZero && styles["color-".concat(colorKey)], isQualificationZero && styles.colorDarkGrey, scheme === "qualification" && !isQualificationZero && styles.colorNoir) }, label)));
|
|
15
46
|
};
|
|
16
47
|
export default InboxButton;
|
|
@@ -14,14 +14,86 @@
|
|
|
14
14
|
cursor: pointer;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
.inboxBtn:hover
|
|
18
|
-
|
|
17
|
+
.inboxBtn:hover:not(.disabled):not(.qualificationZero):not(
|
|
18
|
+
.qualificationActive
|
|
19
|
+
) {
|
|
20
|
+
background-color: #fbe8e8;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.qualificationActive:hover {
|
|
24
|
+
background-color: var(--noir);
|
|
25
|
+
color: var(--bleu-allaw);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.qualificationActive:hover .icon {
|
|
29
|
+
color: var(--bleu-allaw);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.qualificationActive:hover .label {
|
|
33
|
+
color: var(--bleu-allaw);
|
|
19
34
|
}
|
|
20
35
|
|
|
21
36
|
.disabled {
|
|
22
37
|
cursor: initial;
|
|
23
|
-
background-color: var(--tag-light-blue);
|
|
24
|
-
color: var(--tag-
|
|
38
|
+
background-color: var(--tag-light-blue, #daebfb);
|
|
39
|
+
color: var(--blue-tag-dark, #1985e8);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.qualificationZero {
|
|
43
|
+
cursor: initial;
|
|
44
|
+
background-color: var(--pure-white, #ffffff);
|
|
45
|
+
color: var(venom-grey-dark, #d1dce8);
|
|
46
|
+
border: 2px solid #8b8e92;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.qualificationActive {
|
|
50
|
+
background-color: transparent;
|
|
51
|
+
color: var(--noir);
|
|
52
|
+
position: relative;
|
|
53
|
+
border: 2px solid var(--noir);
|
|
54
|
+
overflow: hidden;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.qualificationActive::before {
|
|
58
|
+
content: "";
|
|
59
|
+
position: absolute;
|
|
60
|
+
top: -2px;
|
|
61
|
+
left: -2px;
|
|
62
|
+
right: -2px;
|
|
63
|
+
bottom: -2px;
|
|
64
|
+
border-radius: 0.5rem;
|
|
65
|
+
background: var(--noir);
|
|
66
|
+
z-index: -1;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.qualificationActive::after {
|
|
70
|
+
content: "";
|
|
71
|
+
position: absolute;
|
|
72
|
+
top: -2px;
|
|
73
|
+
left: -2px;
|
|
74
|
+
right: -2px;
|
|
75
|
+
bottom: -2px;
|
|
76
|
+
border-radius: 0.5rem;
|
|
77
|
+
background: conic-gradient(
|
|
78
|
+
from 0deg,
|
|
79
|
+
transparent 0deg,
|
|
80
|
+
transparent 70deg,
|
|
81
|
+
rgba(230, 237, 245, 0.8) 85deg,
|
|
82
|
+
rgba(230, 237, 245, 1) 90deg,
|
|
83
|
+
rgba(230, 237, 245, 0.8) 95deg,
|
|
84
|
+
transparent 110deg,
|
|
85
|
+
transparent 360deg
|
|
86
|
+
);
|
|
87
|
+
animation: rotateReflection 4s linear infinite;
|
|
88
|
+
z-index: -1;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.colorDarkGrey {
|
|
92
|
+
color: #8b8e92;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.colorNoir {
|
|
96
|
+
color: var(--noir);
|
|
25
97
|
}
|
|
26
98
|
|
|
27
99
|
.label {
|
|
@@ -53,11 +125,11 @@
|
|
|
53
125
|
}
|
|
54
126
|
|
|
55
127
|
.bg-light-red {
|
|
56
|
-
background-color: var(--
|
|
128
|
+
background-color: var(--tag-light-red, #fdf2f2);
|
|
57
129
|
}
|
|
58
130
|
|
|
59
131
|
.bg-light-blue {
|
|
60
|
-
background-color: var(--blue-tag-light);
|
|
132
|
+
background-color: var(--blue-tag-light, #daebfb);
|
|
61
133
|
}
|
|
62
134
|
|
|
63
135
|
.bg-dark-green {
|
|
@@ -81,7 +153,7 @@
|
|
|
81
153
|
}
|
|
82
154
|
|
|
83
155
|
.color-red {
|
|
84
|
-
color: var(--
|
|
156
|
+
color: var(--tag-red, #e15151);
|
|
85
157
|
}
|
|
86
158
|
|
|
87
159
|
.color-green {
|
|
@@ -98,3 +170,12 @@
|
|
|
98
170
|
display: flex;
|
|
99
171
|
align-items: center;
|
|
100
172
|
}
|
|
173
|
+
|
|
174
|
+
@keyframes rotateReflection {
|
|
175
|
+
from {
|
|
176
|
+
transform: rotate(0deg);
|
|
177
|
+
}
|
|
178
|
+
to {
|
|
179
|
+
transform: rotate(360deg);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
@@ -2,90 +2,69 @@ declare namespace _default {
|
|
|
2
2
|
export let title: string;
|
|
3
3
|
export { InboxButton as component };
|
|
4
4
|
export let tags: string[];
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
let type_6: string;
|
|
64
|
-
export { type_6 as type };
|
|
65
|
-
}
|
|
66
|
-
export { control_6 as control };
|
|
67
|
-
let description_6: string;
|
|
68
|
-
export { description_6 as description };
|
|
69
|
-
}
|
|
70
|
-
namespace startIconName {
|
|
71
|
-
export namespace control_7 {
|
|
72
|
-
let type_7: string;
|
|
73
|
-
export { type_7 as type };
|
|
74
|
-
}
|
|
75
|
-
export { control_7 as control };
|
|
76
|
-
let description_7: string;
|
|
77
|
-
export { description_7 as description };
|
|
78
|
-
}
|
|
79
|
-
namespace onClick {
|
|
80
|
-
let action: string;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
5
|
+
export let argTypes: {
|
|
6
|
+
count: {
|
|
7
|
+
control: {
|
|
8
|
+
type: string;
|
|
9
|
+
};
|
|
10
|
+
description: string;
|
|
11
|
+
defaultValue: number;
|
|
12
|
+
};
|
|
13
|
+
"labels.none": {
|
|
14
|
+
control: {
|
|
15
|
+
type: string;
|
|
16
|
+
};
|
|
17
|
+
description: string;
|
|
18
|
+
table: {
|
|
19
|
+
category: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
"labels.one": {
|
|
23
|
+
control: {
|
|
24
|
+
type: string;
|
|
25
|
+
};
|
|
26
|
+
description: string;
|
|
27
|
+
table: {
|
|
28
|
+
category: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
"labels.multiple": {
|
|
32
|
+
control: {
|
|
33
|
+
type: string;
|
|
34
|
+
};
|
|
35
|
+
description: string;
|
|
36
|
+
table: {
|
|
37
|
+
category: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
scheme: {
|
|
41
|
+
control: {
|
|
42
|
+
type: string;
|
|
43
|
+
options: string[];
|
|
44
|
+
};
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
iconClassName: {
|
|
48
|
+
control: {
|
|
49
|
+
type: string;
|
|
50
|
+
};
|
|
51
|
+
description: string;
|
|
52
|
+
};
|
|
53
|
+
iconAriaLabel: {
|
|
54
|
+
control: {
|
|
55
|
+
type: string;
|
|
56
|
+
};
|
|
57
|
+
description: string;
|
|
58
|
+
};
|
|
59
|
+
onClick: {
|
|
60
|
+
action: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
83
63
|
export namespace parameters {
|
|
84
64
|
namespace docs {
|
|
85
|
-
|
|
65
|
+
namespace description {
|
|
86
66
|
let component: string;
|
|
87
67
|
}
|
|
88
|
-
export { description_8 as description };
|
|
89
68
|
}
|
|
90
69
|
}
|
|
91
70
|
}
|
|
@@ -17,67 +17,44 @@ export default {
|
|
|
17
17
|
component: InboxButton,
|
|
18
18
|
tags: ["autodocs"],
|
|
19
19
|
argTypes: {
|
|
20
|
-
|
|
20
|
+
count: {
|
|
21
21
|
control: { type: "number" },
|
|
22
22
|
description: "Nombre d’éléments à traiter",
|
|
23
23
|
defaultValue: 0,
|
|
24
24
|
},
|
|
25
|
-
|
|
25
|
+
"labels.none": {
|
|
26
26
|
control: { type: "text" },
|
|
27
|
-
description: "Texte affiché si
|
|
27
|
+
description: "Texte affiché si count === 0",
|
|
28
|
+
table: { category: "labels" },
|
|
28
29
|
},
|
|
29
|
-
|
|
30
|
+
"labels.one": {
|
|
30
31
|
control: { type: "text" },
|
|
31
|
-
description: "Texte affiché si
|
|
32
|
+
description: "Texte affiché si count === 1",
|
|
33
|
+
table: { category: "labels" },
|
|
32
34
|
},
|
|
33
|
-
|
|
35
|
+
"labels.multiple": {
|
|
34
36
|
control: { type: "text" },
|
|
35
|
-
description: "Texte affiché si
|
|
37
|
+
description: "Texte affiché si count > 1 (utiliser {{count}})",
|
|
38
|
+
table: { category: "labels" },
|
|
36
39
|
},
|
|
37
|
-
|
|
38
|
-
control: {
|
|
39
|
-
|
|
40
|
-
options: [
|
|
41
|
-
"light-blue",
|
|
42
|
-
"light-red",
|
|
43
|
-
"mid-grey",
|
|
44
|
-
"dark-grey",
|
|
45
|
-
"noir",
|
|
46
|
-
"tag-light-blue",
|
|
47
|
-
"dark-green",
|
|
48
|
-
],
|
|
49
|
-
},
|
|
50
|
-
description: "Couleur de fond (classe CSS)",
|
|
51
|
-
},
|
|
52
|
-
color: {
|
|
53
|
-
control: {
|
|
54
|
-
type: "select",
|
|
55
|
-
options: [
|
|
56
|
-
"blue",
|
|
57
|
-
"red",
|
|
58
|
-
"green",
|
|
59
|
-
"mid-grey",
|
|
60
|
-
"dark-grey",
|
|
61
|
-
"noir",
|
|
62
|
-
"pure-white",
|
|
63
|
-
],
|
|
64
|
-
},
|
|
65
|
-
description: "Couleur du texte (classe CSS)",
|
|
40
|
+
scheme: {
|
|
41
|
+
control: { type: "select", options: ["notification", "qualification"] },
|
|
42
|
+
description: "Thème de couleur du bouton",
|
|
66
43
|
},
|
|
67
|
-
|
|
44
|
+
iconClassName: {
|
|
68
45
|
control: { type: "text" },
|
|
69
|
-
description: "
|
|
46
|
+
description: "Classe CSS de l’icône à afficher",
|
|
70
47
|
},
|
|
71
|
-
|
|
48
|
+
iconAriaLabel: {
|
|
72
49
|
control: { type: "text" },
|
|
73
|
-
description: "Label accessible pour l’icône
|
|
50
|
+
description: "Label accessible pour l’icône",
|
|
74
51
|
},
|
|
75
52
|
onClick: { action: "clicked" },
|
|
76
53
|
},
|
|
77
54
|
parameters: {
|
|
78
55
|
docs: {
|
|
79
56
|
description: {
|
|
80
|
-
component: "Bouton
|
|
57
|
+
component: "Bouton affichant un nombre d’éléments avec style conditionnel en fonction du thème.",
|
|
81
58
|
},
|
|
82
59
|
},
|
|
83
60
|
},
|
|
@@ -86,45 +63,49 @@ var Template = function (args) { return (React.createElement("div", { style: { p
|
|
|
86
63
|
React.createElement(InboxButton, __assign({}, args)))); };
|
|
87
64
|
export var AucuneNotification = Template.bind({});
|
|
88
65
|
AucuneNotification.args = {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
66
|
+
count: 0,
|
|
67
|
+
labels: {
|
|
68
|
+
none: "Aucune demande",
|
|
69
|
+
one: "1 demande en attente",
|
|
70
|
+
multiple: "{{count}} demandes en attente",
|
|
71
|
+
},
|
|
72
|
+
scheme: "notification",
|
|
73
|
+
iconClassName: "allaw-icon-inbox",
|
|
74
|
+
iconAriaLabel: "Inbox",
|
|
97
75
|
};
|
|
98
76
|
export var UneNotification = Template.bind({});
|
|
99
77
|
UneNotification.args = {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
78
|
+
count: 1,
|
|
79
|
+
labels: {
|
|
80
|
+
none: "Aucune demande",
|
|
81
|
+
one: "1 demande en attente",
|
|
82
|
+
multiple: "{{count}} demandes en attente",
|
|
83
|
+
},
|
|
84
|
+
scheme: "notification",
|
|
85
|
+
iconClassName: "allaw-icon-inbox",
|
|
86
|
+
iconAriaLabel: "Inbox",
|
|
108
87
|
};
|
|
109
88
|
export var PlusieursNotifications = Template.bind({});
|
|
110
89
|
PlusieursNotifications.args = {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
90
|
+
count: 7,
|
|
91
|
+
labels: {
|
|
92
|
+
none: "Aucune demande",
|
|
93
|
+
one: "1 demande en attente",
|
|
94
|
+
multiple: "{{count}} demandes en attente",
|
|
95
|
+
},
|
|
96
|
+
scheme: "notification",
|
|
97
|
+
iconClassName: "allaw-icon-inbox",
|
|
98
|
+
iconAriaLabel: "Inbox",
|
|
119
99
|
};
|
|
120
100
|
export var ClientQualifications = Template.bind({});
|
|
121
101
|
ClientQualifications.args = {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
102
|
+
count: 5,
|
|
103
|
+
labels: {
|
|
104
|
+
none: "Aucune demande",
|
|
105
|
+
one: "1 demande en attente",
|
|
106
|
+
multiple: "{{count}} demandes en attente",
|
|
107
|
+
},
|
|
108
|
+
scheme: "qualification",
|
|
109
|
+
iconClassName: "allaw-icon-check-circle",
|
|
110
|
+
iconAriaLabel: "Check",
|
|
130
111
|
};
|
package/dist/styles/global.css
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700;800;900&display=swap");
|
|
4
4
|
@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");
|
|
5
5
|
|
|
6
|
-
@import "~typeface-open-sans/index.css";
|
|
6
|
+
/* @import "~typeface-open-sans/index.css"; */
|
|
7
7
|
@import "./colors.css";
|
|
8
8
|
|
|
9
9
|
@import "./icons.css";
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|