allaw-ui 2.9.2 → 2.9.4
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/molecules/checkboxForm/ColoredCheckbox.d.ts +3 -0
- package/dist/components/molecules/checkboxForm/ColoredCheckbox.js +24 -2
- package/dist/components/molecules/questionAnswer/QuestionAnswer.d.ts +1 -0
- package/dist/components/molecules/questionAnswer/QuestionAnswer.js +3 -8
- package/dist/components/molecules/questionAnswer/questionAnswer.module.css +15 -40
- package/package.json +1 -1
|
@@ -12,6 +12,9 @@ export interface ColoredCheckboxProps {
|
|
|
12
12
|
markType?: "cross" | "check";
|
|
13
13
|
isSignedIn?: boolean;
|
|
14
14
|
unlinkIconPath?: any;
|
|
15
|
+
"data-tooltip-id"?: string;
|
|
16
|
+
"data-tooltip-content"?: string;
|
|
17
|
+
[key: string]: any;
|
|
15
18
|
}
|
|
16
19
|
declare const ColoredCheckbox: React.FC<ColoredCheckboxProps>;
|
|
17
20
|
export default ColoredCheckbox;
|
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
1
23
|
import React, { useState } from "react";
|
|
2
24
|
import styles from "./ColoredCheckbox.module.css";
|
|
3
25
|
import "../../../styles/global.css"; // Pour importer les icônes allaw
|
|
@@ -19,7 +41,7 @@ var formatEmail = function (email) {
|
|
|
19
41
|
React.createElement("span", { className: styles.emailTLD }, tld)));
|
|
20
42
|
};
|
|
21
43
|
var ColoredCheckbox = function (_a) {
|
|
22
|
-
var id = _a.id, _b = _a.label, label = _b === void 0 ? "mon-email@provider.com" : _b, _c = _a.checked, checked = _c === void 0 ? false : _c, onChange = _a.onChange, _d = _a.boxColor, boxColor = _d === void 0 ? "#000000" : _d, _e = _a.markColor, markColor = _e === void 0 ? "#FFFFFF" : _e, _f = _a.textColor, textColor = _f === void 0 ? "#000000" : _f, _g = _a.size, size = _g === void 0 ? "default" : _g, _h = _a.markType, markType = _h === void 0 ? "cross" : _h, _j = _a.isSignedIn, isSignedIn = _j === void 0 ? true : _j, _k = _a.unlinkIconPath, unlinkIconPath = _k === void 0 ? "/assets/images/allaw-icon-unlink-red.svg" : _k;
|
|
44
|
+
var id = _a.id, _b = _a.label, label = _b === void 0 ? "mon-email@provider.com" : _b, _c = _a.checked, checked = _c === void 0 ? false : _c, onChange = _a.onChange, _d = _a.boxColor, boxColor = _d === void 0 ? "#000000" : _d, _e = _a.markColor, markColor = _e === void 0 ? "#FFFFFF" : _e, _f = _a.textColor, textColor = _f === void 0 ? "#000000" : _f, _g = _a.size, size = _g === void 0 ? "default" : _g, _h = _a.markType, markType = _h === void 0 ? "cross" : _h, _j = _a.isSignedIn, isSignedIn = _j === void 0 ? true : _j, _k = _a.unlinkIconPath, unlinkIconPath = _k === void 0 ? "/assets/images/allaw-icon-unlink-red.svg" : _k, tooltipId = _a["data-tooltip-id"], tooltipContent = _a["data-tooltip-content"], rest = __rest(_a, ["id", "label", "checked", "onChange", "boxColor", "markColor", "textColor", "size", "markType", "isSignedIn", "unlinkIconPath", "data-tooltip-id", "data-tooltip-content"]);
|
|
23
45
|
var _l = useState(checked), isChecked = _l[0], setIsChecked = _l[1];
|
|
24
46
|
// Generate a random ID if none is provided
|
|
25
47
|
var checkboxId = id || "checkbox-".concat(Math.random().toString(36).substr(2, 9));
|
|
@@ -51,7 +73,7 @@ var ColoredCheckbox = function (_a) {
|
|
|
51
73
|
var formattedLabel = typeof label === "string" && label.includes("@")
|
|
52
74
|
? formatEmail(label)
|
|
53
75
|
: label;
|
|
54
|
-
return (React.createElement("div", { className: styles.container },
|
|
76
|
+
return (React.createElement("div", __assign({ className: styles.container, "data-tooltip-id": tooltipId, "data-tooltip-content": tooltipContent || (typeof label === "string" ? label : undefined) }, rest),
|
|
55
77
|
React.createElement("button", { id: checkboxId, className: "".concat(styles.checkbox, " ").concat(isChecked ? styles.checked : "", " ").concat(size === "small" ? styles.small : ""), onClick: handleClick, style: checkboxStyle, "aria-checked": isChecked, role: "checkbox", "data-cy": "checkbox-".concat(checkboxId) }, isChecked && (React.createElement("span", { className: "".concat(styles.icon, " ").concat(markType === "cross" ? "allaw-icon-close" : "allaw-icon-check"), style: markStyle }))),
|
|
56
78
|
isSignedIn === false && unlinkIconPath && (React.createElement("img", { src: unlinkIconPath.src || unlinkIconPath, alt: "Non connect\u00E9", className: styles.unlinkIcon, width: "16", height: "16", style: { width: "16px", height: "16px" } })),
|
|
57
79
|
label && (React.createElement("label", { htmlFor: checkboxId, className: styles.label, style: labelStyle, onClick: handleClick }, formattedLabel))));
|
|
@@ -9,9 +9,8 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
9
9
|
};
|
|
10
10
|
import React, { useState } from "react";
|
|
11
11
|
import styles from "./questionAnswer.module.css";
|
|
12
|
-
import IconButton from "../../atoms/buttons/IconButton";
|
|
13
12
|
var QuestionAnswer = function (_a) {
|
|
14
|
-
var questions = _a.questions;
|
|
13
|
+
var questions = _a.questions, title = _a.title;
|
|
15
14
|
var _b = useState([]), openIndices = _b[0], setOpenIndices = _b[1];
|
|
16
15
|
var toggleAnswer = function (index) {
|
|
17
16
|
if (openIndices.includes(index)) {
|
|
@@ -23,15 +22,11 @@ var QuestionAnswer = function (_a) {
|
|
|
23
22
|
};
|
|
24
23
|
return (React.createElement("section", { className: styles.questionAnswerContainer, "aria-labelledby": "faq-title" },
|
|
25
24
|
React.createElement("div", { className: styles.questionAnswerContent },
|
|
26
|
-
React.createElement("h2", { className: styles.questionAnswerTitle }, "Questions
|
|
25
|
+
React.createElement("h2", { className: styles.questionAnswerTitle }, title ? title : "Questions Fréquemment Posées"),
|
|
27
26
|
React.createElement("ul", { className: styles.questionAnswerListContent }, questions.map(function (item, index) { return (React.createElement("li", { key: index, className: styles.questionAnswerItem, onClick: function () { return toggleAnswer(index); } },
|
|
28
27
|
React.createElement("div", { className: styles.questionContainer },
|
|
29
28
|
React.createElement("h3", { className: styles.questionTitle }, item.question),
|
|
30
|
-
React.createElement(
|
|
31
|
-
? "allaw-icon-chevron-up"
|
|
32
|
-
: "allaw-icon-chevron-down", "aria-label": openIndices.includes(index)
|
|
33
|
-
? "Fermer la r\u00E9ponse \u00E0 : ".concat(item.question)
|
|
34
|
-
: "Ouvrir la r\u00E9ponse \u00E0 : ".concat(item.question) })),
|
|
29
|
+
React.createElement("i", { className: !openIndices.includes(index) ? "allaw-icon-chevron-down" : "allaw-icon-chevron-up", style: { color: "#171E25" } })),
|
|
35
30
|
React.createElement("div", { id: "answer-".concat(index), className: "".concat(styles.answerContainer, " ").concat(openIndices.includes(index) ? styles.open : "") },
|
|
36
31
|
React.createElement("p", { className: styles.answer }, item.answer)))); })))));
|
|
37
32
|
};
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
width: 100%;
|
|
3
3
|
height: auto;
|
|
4
4
|
display: flex;
|
|
5
|
-
padding: 64px 0;
|
|
6
5
|
flex-direction: column;
|
|
7
6
|
justify-content: center;
|
|
8
7
|
align-items: center;
|
|
@@ -16,14 +15,14 @@
|
|
|
16
15
|
height: auto;
|
|
17
16
|
flex-direction: column;
|
|
18
17
|
align-items: center;
|
|
19
|
-
gap:
|
|
18
|
+
gap: 56px;
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
.questionAnswerTitle {
|
|
23
22
|
color: var(--Primary-Mid-black, #171e25);
|
|
24
|
-
text-align:
|
|
23
|
+
text-align: left;
|
|
25
24
|
font-family: Poppins;
|
|
26
|
-
font-size:
|
|
25
|
+
font-size: 26px;
|
|
27
26
|
font-style: normal;
|
|
28
27
|
font-weight: 600;
|
|
29
28
|
line-height: normal;
|
|
@@ -51,7 +50,7 @@
|
|
|
51
50
|
|
|
52
51
|
.questionContainer {
|
|
53
52
|
display: flex;
|
|
54
|
-
align-items:
|
|
53
|
+
align-items: center;
|
|
55
54
|
gap: 32px;
|
|
56
55
|
align-self: stretch;
|
|
57
56
|
justify-content: space-between;
|
|
@@ -59,9 +58,9 @@
|
|
|
59
58
|
}
|
|
60
59
|
|
|
61
60
|
.questionTitle {
|
|
62
|
-
color:
|
|
63
|
-
font-family:
|
|
64
|
-
font-size:
|
|
61
|
+
color: #171E25;
|
|
62
|
+
font-family: "Open Sans";
|
|
63
|
+
font-size: 18px;
|
|
65
64
|
font-style: normal;
|
|
66
65
|
font-weight: 600;
|
|
67
66
|
line-height: normal;
|
|
@@ -81,46 +80,22 @@
|
|
|
81
80
|
}
|
|
82
81
|
|
|
83
82
|
.answer {
|
|
84
|
-
color:
|
|
83
|
+
color: #456073;
|
|
85
84
|
font-family: "Open Sans";
|
|
86
|
-
font-size:
|
|
85
|
+
font-size: 16px;
|
|
87
86
|
font-weight: 400;
|
|
88
87
|
line-height: normal;
|
|
88
|
+
text-align: justify;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
@media (max-width:
|
|
92
|
-
.questionAnswerContainer {
|
|
93
|
-
padding: 26px 80px;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.questionAnswerContent {
|
|
97
|
-
gap: 70px;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.questionAnswerTitle {
|
|
101
|
-
font-size: 26px;
|
|
102
|
-
}
|
|
103
|
-
|
|
91
|
+
@media (max-width: 800px) {
|
|
104
92
|
.answer {
|
|
105
|
-
|
|
93
|
+
text-align: justify;
|
|
106
94
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
@media (max-width: 450px) {
|
|
110
|
-
.questionAnswerContainer {
|
|
111
|
-
padding: 12px 40px;
|
|
112
|
-
gap: 20px;
|
|
95
|
+
.questionAnswerTitle {
|
|
96
|
+
font-size: 20px;
|
|
113
97
|
}
|
|
114
|
-
|
|
115
98
|
.questionAnswerContent {
|
|
116
|
-
gap:
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.questionTitle {
|
|
120
|
-
font-size: 18px;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.answer {
|
|
124
|
-
font-size: 16px;
|
|
99
|
+
gap: 42px;
|
|
125
100
|
}
|
|
126
101
|
}
|