allaw-ui 0.0.354 → 0.1.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/README.md +0 -0
- package/dist/app/globals.css +0 -0
- package/dist/assets/NoPhoto.png +0 -0
- package/dist/assets/NoPhoto.svg +0 -0
- package/dist/assets/allaw-font.eot +0 -0
- package/dist/assets/allaw-font.svg +0 -0
- package/dist/assets/allaw-font.ttf +0 -0
- package/dist/assets/allaw-font.woff +0 -0
- package/dist/components/atoms/buttons/ActionCircleButton.css +0 -0
- package/dist/components/atoms/buttons/AgendaSlot.css +0 -0
- package/dist/components/atoms/buttons/FavoriteToggle.css +0 -0
- package/dist/components/atoms/buttons/FilterButton.css +0 -0
- package/dist/components/atoms/buttons/GhostButton.css +0 -0
- package/dist/components/atoms/buttons/IconButton.css +0 -0
- package/dist/components/atoms/buttons/IconButton.d.ts +1 -0
- package/dist/components/atoms/buttons/IconButton.js +2 -2
- package/dist/components/atoms/buttons/OAuthProviderButton.css +0 -0
- package/dist/components/atoms/buttons/PendingDocuments.css +0 -0
- package/dist/components/atoms/buttons/PrimaryButton.css +24 -0
- package/dist/components/atoms/buttons/PrimaryButton.d.ts +2 -1
- package/dist/components/atoms/buttons/PrimaryButton.js +85 -4
- package/dist/components/atoms/buttons/SecondaryButton.css +0 -0
- package/dist/components/atoms/buttons/SecondaryButton.d.ts +8 -4
- package/dist/components/atoms/buttons/SecondaryButton.js +113 -7
- package/dist/components/atoms/buttons/TabNavigation.css +0 -0
- package/dist/components/atoms/buttons/TertiaryButton.css +0 -0
- package/dist/components/atoms/checkboxes/Checkbox.css +0 -0
- package/dist/components/atoms/checkboxes/Checkbox.d.ts +1 -0
- package/dist/components/atoms/checkboxes/Checkbox.js +3 -3
- package/dist/components/atoms/filter/Basefiler.css +0 -0
- package/dist/components/atoms/filters/SingleFilter.css +0 -0
- package/dist/components/atoms/filters/SingleFilter.js +20 -9
- package/dist/components/atoms/inputs/Input.css +0 -0
- package/dist/components/atoms/inputs/SearchBar.css +0 -0
- package/dist/components/atoms/inputs/TextArea.css +202 -0
- package/dist/components/atoms/inputs/TextArea.d.ts +22 -0
- package/dist/components/atoms/inputs/TextArea.js +79 -0
- package/dist/components/atoms/inputs/index.d.ts +2 -0
- package/dist/components/atoms/inputs/index.js +1 -0
- package/dist/components/atoms/progressBars/ProgressBar.css +0 -0
- package/dist/components/atoms/progressBars/ProgressBar.js +5 -4
- package/dist/components/atoms/radios/RadioButton.css +0 -0
- package/dist/components/atoms/selects/Select.css +16 -3
- package/dist/components/atoms/selects/Select.d.ts +1 -0
- package/dist/components/atoms/selects/Select.js +20 -8
- package/dist/components/atoms/tags/AppointementStatusTag.css +0 -0
- package/dist/components/atoms/tags/FolderStatusTag.css +0 -0
- package/dist/components/atoms/tags/OtherStatusTag.css +0 -0
- package/dist/components/atoms/typography/Heading.css +0 -0
- package/dist/components/atoms/typography/Paragraph.css +0 -0
- package/dist/components/atoms/typography/SmallTitle.css +0 -0
- package/dist/components/atoms/typography/Subtitle.css +0 -0
- package/dist/components/atoms/typography/TinyInfo.css +3 -0
- package/dist/components/atoms/typography/TinyInfo.d.ts +1 -1
- package/dist/components/atoms/uiVariables/BorderRadiusExample.css +0 -0
- package/dist/components/atoms/uiVariables/ShadowsExample.css +0 -0
- package/dist/components/atoms/uiVariables/StrokesExample.css +0 -0
- package/dist/components/molecules/appointmentSlot/AppointmentSlot.css +0 -0
- package/dist/components/molecules/breadcrumb/Breadcrumb.css +0 -0
- package/dist/components/molecules/caseCard/CaseCard.css +0 -0
- package/dist/components/molecules/caseLinkCard/CaseLinkCard.css +47 -0
- package/dist/components/molecules/caseLinkCard/CaseLinkCard.d.ts +10 -0
- package/dist/components/molecules/caseLinkCard/CaseLinkCard.js +27 -0
- package/dist/components/molecules/caseLinkCard/index.d.ts +2 -0
- package/dist/components/molecules/caseLinkCard/index.js +1 -0
- package/dist/components/molecules/checkboxForm/CheckboxForm.css +0 -0
- package/dist/components/molecules/checkboxForm/CheckboxForm.d.ts +1 -0
- package/dist/components/molecules/checkboxForm/CheckboxForm.js +2 -2
- package/dist/components/molecules/contactCard/ContactCard.css +0 -0
- package/dist/components/molecules/documentCard/DocumentCard.css +2 -2
- package/dist/components/molecules/documentCard/DocumentCard.d.ts +2 -1
- package/dist/components/molecules/documentCard/DocumentCard.js +18 -5
- package/dist/components/molecules/employeeCard/EmployeeCard.css +0 -0
- package/dist/components/molecules/proCard/ProCard.css +0 -0
- package/dist/components/molecules/proCard/ProCard.js +2 -2
- package/dist/components/molecules/radioForm/RadioForm.css +14 -0
- package/dist/components/molecules/radioForm/RadioForm.d.ts +12 -0
- package/dist/components/molecules/radioForm/RadioForm.js +27 -0
- package/dist/components/molecules/radioForm/index.d.ts +2 -0
- package/dist/components/molecules/radioForm/index.js +1 -0
- package/dist/components/molecules/selectForm/SelectForm.css +9 -0
- package/dist/components/molecules/selectForm/SelectForm.d.ts +15 -0
- package/dist/components/molecules/selectForm/SelectForm.js +15 -0
- package/dist/components/molecules/selectForm/index.d.ts +2 -0
- package/dist/components/molecules/selectForm/index.js +1 -0
- package/dist/components/molecules/stepper/Stepper.css +12 -1
- package/dist/components/molecules/stepper/Stepper.d.ts +9 -2
- package/dist/components/molecules/stepper/Stepper.js +90 -35
- package/dist/index.d.ts +6 -0
- package/dist/index.js +7 -0
- package/dist/stories/assets/accessibility.png +0 -0
- package/dist/stories/assets/accessibility.svg +0 -0
- package/dist/stories/assets/addon-library.png +0 -0
- package/dist/stories/assets/assets.png +0 -0
- package/dist/stories/assets/context.png +0 -0
- package/dist/stories/assets/discord.svg +0 -0
- package/dist/stories/assets/docs.png +0 -0
- package/dist/stories/assets/figma-plugin.png +0 -0
- package/dist/stories/assets/github.svg +0 -0
- package/dist/stories/assets/share.png +0 -0
- package/dist/stories/assets/styling.png +0 -0
- package/dist/stories/assets/testing.png +0 -0
- package/dist/stories/assets/theming.png +0 -0
- package/dist/stories/assets/tutorials.svg +0 -0
- package/dist/stories/assets/youtube.svg +0 -0
- package/dist/styles/colors.css +0 -0
- package/dist/styles/global.css +0 -0
- package/dist/styles/icons.css +0 -0
- package/dist/styles/ui-variables/border-radius.css +0 -0
- package/dist/styles/ui-variables/shadows.css +0 -0
- package/dist/styles/ui-variables/stroke.css +0 -0
- package/package.json +1 -1
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
@import "../../../styles/colors.css";
|
|
2
|
+
|
|
3
|
+
/* Style commun */
|
|
4
|
+
.text-area {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
gap: 8px;
|
|
8
|
+
field-sizing: content;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.text-area-title-container {
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.text-area-required {
|
|
17
|
+
color: var(--dark-grey, #456073);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.text-area-placeholder {
|
|
21
|
+
color: var(--Tags-Mid-grey, rgba(114, 142, 167, 1));
|
|
22
|
+
font-family: "Open Sans";
|
|
23
|
+
font-size: 14px;
|
|
24
|
+
font-style: normal;
|
|
25
|
+
font-weight: 400;
|
|
26
|
+
line-height: normal;
|
|
27
|
+
opacity: 0.8;
|
|
28
|
+
width: 100%;
|
|
29
|
+
padding-left: 4px;
|
|
30
|
+
resize: vertical;
|
|
31
|
+
min-height: 100px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* Style default */
|
|
35
|
+
.text-area-default {
|
|
36
|
+
display: flex;
|
|
37
|
+
width: 100%;
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
align-items: flex-start;
|
|
41
|
+
gap: 11px;
|
|
42
|
+
field-sizing: content;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.text-area-default .text-area-container {
|
|
46
|
+
display: flex;
|
|
47
|
+
width: 100%;
|
|
48
|
+
flex-direction: column;
|
|
49
|
+
justify-content: center;
|
|
50
|
+
align-items: flex-start;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.text-area-default .text-area-input {
|
|
54
|
+
display: flex;
|
|
55
|
+
width: 100%;
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
align-items: flex-start;
|
|
58
|
+
border-radius: 8px;
|
|
59
|
+
border: 3px solid var(--grey-venom, #e6edf5);
|
|
60
|
+
background: var(--Primary-Blanc, #fff);
|
|
61
|
+
padding: 10px;
|
|
62
|
+
field-sizing: content;
|
|
63
|
+
font-size: 16px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.text-area-default .text-area-input:hover {
|
|
67
|
+
border-color: var(--venom-grey-dark, #d1dce8);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.text-area-default .text-area-input:focus-within {
|
|
71
|
+
border-color: var(--mid-grey, #728ea7);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.text-area-default .text-area-input textarea {
|
|
75
|
+
width: 100%;
|
|
76
|
+
border: none;
|
|
77
|
+
outline: none;
|
|
78
|
+
color: var(--noir, #171e25);
|
|
79
|
+
field-sizing: content;
|
|
80
|
+
font-size: 16px;
|
|
81
|
+
line-height: 24px;
|
|
82
|
+
padding: 8px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.text-area-variation {
|
|
86
|
+
display: flex;
|
|
87
|
+
width: 100%;
|
|
88
|
+
flex-direction: column;
|
|
89
|
+
justify-content: center;
|
|
90
|
+
align-items: flex-start;
|
|
91
|
+
gap: 11px;
|
|
92
|
+
field-sizing: content;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.text-area-variation .text-area-container {
|
|
96
|
+
display: flex;
|
|
97
|
+
width: 100%;
|
|
98
|
+
flex-direction: row;
|
|
99
|
+
justify-content: space-between;
|
|
100
|
+
align-items: center;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.text-area-variation .text-area-input {
|
|
104
|
+
display: flex;
|
|
105
|
+
flex: 1;
|
|
106
|
+
flex-direction: column;
|
|
107
|
+
align-items: flex-start;
|
|
108
|
+
border-radius: 8px;
|
|
109
|
+
border: 1px solid rgba(114, 142, 167, 1);
|
|
110
|
+
background: var(--Primary-Blanc, #fff);
|
|
111
|
+
padding: 10px;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.text-area-variation .text-area-input textarea {
|
|
115
|
+
width: 100%;
|
|
116
|
+
border: none;
|
|
117
|
+
outline: none;
|
|
118
|
+
color: var(--noir);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.text-area-variation .text-area-icon-button {
|
|
122
|
+
display: flex;
|
|
123
|
+
width: 40px;
|
|
124
|
+
height: 40px;
|
|
125
|
+
justify-content: center;
|
|
126
|
+
align-items: center;
|
|
127
|
+
border-radius: 4px;
|
|
128
|
+
background: var(--Primary-Light-grey, #f4f7fb);
|
|
129
|
+
border: none;
|
|
130
|
+
margin-left: 8px;
|
|
131
|
+
cursor: pointer;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.text-area-variation .text-area-icon-button:hover {
|
|
135
|
+
background: rgba(0, 0, 0, 0.1);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.text-area-variation .text-area-icon-button i {
|
|
139
|
+
width: 19px;
|
|
140
|
+
height: 19px;
|
|
141
|
+
flex-shrink: 0;
|
|
142
|
+
color: var(--dark-grey, #f4f7fb);
|
|
143
|
+
font-size: 18px;
|
|
144
|
+
padding-left: 2px;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/* Style password */
|
|
148
|
+
.text-area-password {
|
|
149
|
+
display: flex;
|
|
150
|
+
width: 100%;
|
|
151
|
+
flex-direction: column;
|
|
152
|
+
justify-content: center;
|
|
153
|
+
align-items: flex-start;
|
|
154
|
+
gap: 11px;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.text-area-password .text-area-container {
|
|
158
|
+
display: flex;
|
|
159
|
+
width: 100%;
|
|
160
|
+
flex-direction: row;
|
|
161
|
+
justify-content: space-between;
|
|
162
|
+
align-items: center;
|
|
163
|
+
border-radius: 8px;
|
|
164
|
+
border: 1px solid rgba(114, 142, 167, 1);
|
|
165
|
+
background: var(--Primary-Blanc, #fff);
|
|
166
|
+
padding: 10px;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.text-area-password .text-area-input {
|
|
170
|
+
display: flex;
|
|
171
|
+
flex: 1;
|
|
172
|
+
flex-direction: column;
|
|
173
|
+
align-items: flex-start;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.text-area-password .text-area-input textarea {
|
|
177
|
+
width: 100%;
|
|
178
|
+
border: none;
|
|
179
|
+
outline: none;
|
|
180
|
+
color: var(--noir);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.text-area-password .text-area-button {
|
|
184
|
+
color: var(--Primary-Mid-black, var(--primary-black, #171e25));
|
|
185
|
+
font-family: "Open Sans";
|
|
186
|
+
font-size: 12px;
|
|
187
|
+
font-style: normal;
|
|
188
|
+
font-weight: 600;
|
|
189
|
+
line-height: normal;
|
|
190
|
+
background: none;
|
|
191
|
+
border: none;
|
|
192
|
+
cursor: pointer;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.text-area-error {
|
|
196
|
+
margin-top: 4px;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.error-message {
|
|
200
|
+
padding-top: 4px;
|
|
201
|
+
padding-left: 14px;
|
|
202
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./TextArea.css";
|
|
3
|
+
import "../../../styles/global.css";
|
|
4
|
+
import "../../../styles/icons.css";
|
|
5
|
+
import { commonRegex } from "../../../utils/regex";
|
|
6
|
+
export interface TextAreaProps {
|
|
7
|
+
title: string;
|
|
8
|
+
style?: "default" | "variation" | "password";
|
|
9
|
+
placeholder: string;
|
|
10
|
+
endIcon?: string;
|
|
11
|
+
isRequired?: boolean;
|
|
12
|
+
validate?: RegExp | keyof typeof commonRegex;
|
|
13
|
+
onError?: (error: string) => void;
|
|
14
|
+
onChange?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
15
|
+
value?: string;
|
|
16
|
+
error?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface TextAreaRef {
|
|
19
|
+
validate: () => boolean;
|
|
20
|
+
}
|
|
21
|
+
declare const TextArea: React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<TextAreaRef>>;
|
|
22
|
+
export default TextArea;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// TextArea.tsx
|
|
2
|
+
import React, { useState, useEffect, useCallback, forwardRef, useImperativeHandle, useRef, } from "react";
|
|
3
|
+
import "./TextArea.css";
|
|
4
|
+
import "../../../styles/global.css";
|
|
5
|
+
import "../../../styles/icons.css";
|
|
6
|
+
import { commonRegex } from "../../../utils/regex";
|
|
7
|
+
import TinyInfo from "../typography/TinyInfo";
|
|
8
|
+
import Paragraph from "../typography/Paragraph";
|
|
9
|
+
var TextArea = forwardRef(function (_a, ref) {
|
|
10
|
+
var title = _a.title, _b = _a.style, style = _b === void 0 ? "default" : _b, placeholder = _a.placeholder, endIcon = _a.endIcon, _c = _a.isRequired, isRequired = _c === void 0 ? false : _c, validate = _a.validate, onError = _a.onError, onChange = _a.onChange, propValue = _a.value, propError = _a.error;
|
|
11
|
+
var _d = useState(false), isPasswordVisible = _d[0], setIsPasswordVisible = _d[1];
|
|
12
|
+
var _e = useState(propValue || ""), value = _e[0], setValue = _e[1];
|
|
13
|
+
var _f = useState(propError || ""), error = _f[0], setError = _f[1];
|
|
14
|
+
var _g = useState(false), isTouched = _g[0], setIsTouched = _g[1];
|
|
15
|
+
var textareaRef = useRef(null);
|
|
16
|
+
useEffect(function () {
|
|
17
|
+
setValue(propValue || "");
|
|
18
|
+
}, [propValue]);
|
|
19
|
+
useEffect(function () {
|
|
20
|
+
setError(propError || "");
|
|
21
|
+
}, [propError]);
|
|
22
|
+
var validateTextArea = useCallback(function () {
|
|
23
|
+
var _a;
|
|
24
|
+
var currentValue = ((_a = textareaRef.current) === null || _a === void 0 ? void 0 : _a.value) || value;
|
|
25
|
+
var errorMessage = "";
|
|
26
|
+
if (isRequired && currentValue.trim() === "") {
|
|
27
|
+
errorMessage = "Ce champ est requis";
|
|
28
|
+
}
|
|
29
|
+
else if (validate && currentValue) {
|
|
30
|
+
var regex = typeof validate === "string" ? commonRegex[validate] : validate;
|
|
31
|
+
if (!regex.test(currentValue)) {
|
|
32
|
+
errorMessage = "Veuillez vérifier votre saisie";
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
setError(errorMessage);
|
|
36
|
+
setIsTouched(true);
|
|
37
|
+
onError === null || onError === void 0 ? void 0 : onError(errorMessage);
|
|
38
|
+
return !errorMessage;
|
|
39
|
+
}, [isRequired, value, validate, onError]);
|
|
40
|
+
useImperativeHandle(ref, function () { return ({
|
|
41
|
+
validate: validateTextArea,
|
|
42
|
+
}); });
|
|
43
|
+
var handleChange = function (e) {
|
|
44
|
+
var newValue = e.target.value;
|
|
45
|
+
setValue(newValue);
|
|
46
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(e);
|
|
47
|
+
if (isTouched) {
|
|
48
|
+
validateTextArea();
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
var handleBlur = function () {
|
|
52
|
+
setIsTouched(true);
|
|
53
|
+
validateTextArea();
|
|
54
|
+
};
|
|
55
|
+
var renderEndIcon = function () {
|
|
56
|
+
if (style === "variation" && endIcon) {
|
|
57
|
+
return (React.createElement("button", { className: "text-area-icon-button" },
|
|
58
|
+
React.createElement("i", { className: endIcon })));
|
|
59
|
+
}
|
|
60
|
+
if (style === "password") {
|
|
61
|
+
return (React.createElement("button", { className: "text-area-button", onClick: function () { return setIsPasswordVisible(!isPasswordVisible); } }, isPasswordVisible ? "CACHER" : "AFFICHER"));
|
|
62
|
+
}
|
|
63
|
+
return null;
|
|
64
|
+
};
|
|
65
|
+
return (React.createElement("div", { className: "TextArea text-area-".concat(style) },
|
|
66
|
+
React.createElement("div", { className: "text-area-title-container" },
|
|
67
|
+
React.createElement(Paragraph, { variant: "semiBold", color: "noir", text: title }),
|
|
68
|
+
isRequired && title && (React.createElement("span", { className: "text-area-required" },
|
|
69
|
+
"\u00A0",
|
|
70
|
+
"*"))),
|
|
71
|
+
React.createElement("div", { className: "text-area-container" },
|
|
72
|
+
React.createElement("div", { className: "text-area-input ".concat(style === "password" ? "text-area-password-input" : "") },
|
|
73
|
+
React.createElement("textarea", { ref: textareaRef, placeholder: placeholder, className: "text-area-placeholder", value: value, onChange: handleChange, onBlur: handleBlur })),
|
|
74
|
+
renderEndIcon(),
|
|
75
|
+
error && isTouched && (React.createElement("div", { className: "error-message" },
|
|
76
|
+
React.createElement(TinyInfo, { variant: "medium12", color: "actions-error", text: error }))))));
|
|
77
|
+
});
|
|
78
|
+
TextArea.displayName = "TextArea";
|
|
79
|
+
export default TextArea;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { default as Input } from "./Input";
|
|
2
|
+
export { default as TextArea } from "./TextArea";
|
|
2
3
|
export { default as SearchBar } from "./SearchBar";
|
|
3
4
|
export type { InputProps, InputRef } from "./Input";
|
|
4
5
|
export type { SearchBarProps } from "./SearchBar";
|
|
6
|
+
export type { TextAreaProps, TextAreaRef } from "./TextArea";
|
|
File without changes
|
|
@@ -4,11 +4,12 @@ import "../../../styles/global.css";
|
|
|
4
4
|
import "../../../styles/icons.css";
|
|
5
5
|
var ProgressBar = function (_a) {
|
|
6
6
|
var steps = _a.steps, currentStep = _a.currentStep, _b = _a.startIcon, startIcon = _b === void 0 ? true : _b, _c = _a.endIcon, endIcon = _c === void 0 ? true : _c, onStartIconClick = _a.onStartIconClick, onEndIconClick = _a.onEndIconClick, _d = _a.showProgressBar, showProgressBar = _d === void 0 ? true : _d;
|
|
7
|
-
var constrainedCurrentStep = Math.max(
|
|
8
|
-
var progressWidth =
|
|
7
|
+
var constrainedCurrentStep = Math.max(0, Math.min(currentStep, steps));
|
|
8
|
+
var progressWidth = constrainedCurrentStep === 0 ? 0 : (constrainedCurrentStep / steps) * 100;
|
|
9
9
|
return (React.createElement("div", { className: "progress-bar-container" },
|
|
10
|
-
|
|
11
|
-
React.createElement("
|
|
10
|
+
startIcon && currentStep > 1 && (React.createElement("div", { className: "progress-bar-icon-container" },
|
|
11
|
+
React.createElement("button", { className: "progress-bar-chevron", onClick: onStartIconClick },
|
|
12
|
+
React.createElement("i", { className: "allaw-icon-chevron-left" })))),
|
|
12
13
|
React.createElement("div", { className: "progress-bar-background ".concat(showProgressBar ? "" : "hidden-content") },
|
|
13
14
|
React.createElement("div", { className: "progress-bar-fill", style: { width: "".concat(progressWidth, "%") } })),
|
|
14
15
|
endIcon && (React.createElement("button", { className: "progress-bar-close", onClick: onEndIconClick },
|
|
File without changes
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
.select {
|
|
6
6
|
display: flex;
|
|
7
|
-
width: 100%;
|
|
8
7
|
padding: 8px 16px;
|
|
9
8
|
justify-content: space-between;
|
|
10
9
|
align-items: center;
|
|
@@ -14,6 +13,14 @@
|
|
|
14
13
|
cursor: pointer;
|
|
15
14
|
}
|
|
16
15
|
|
|
16
|
+
.select:hover {
|
|
17
|
+
background: var(--grey-venom, #e6edf5);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.select:focus {
|
|
21
|
+
background: var(--grey-venom, #e6edf5);
|
|
22
|
+
}
|
|
23
|
+
|
|
17
24
|
.select-text {
|
|
18
25
|
color: var(--Primary-Mid-black, var(--primary-black, #171e25));
|
|
19
26
|
font-family: "Open Sans";
|
|
@@ -37,9 +44,8 @@
|
|
|
37
44
|
}
|
|
38
45
|
|
|
39
46
|
.select-list {
|
|
40
|
-
display: none;
|
|
47
|
+
display: none;
|
|
41
48
|
flex-direction: column;
|
|
42
|
-
width: 480px;
|
|
43
49
|
background: var(--secondary-light-grey, #f4f7fb);
|
|
44
50
|
border-radius: 8px;
|
|
45
51
|
margin-top: 8px;
|
|
@@ -56,6 +62,9 @@
|
|
|
56
62
|
top: 100%;
|
|
57
63
|
left: 0;
|
|
58
64
|
z-index: 1000;
|
|
65
|
+
border: 1px solid var(--grey-venom, #e6edf5);
|
|
66
|
+
box-shadow: 0px 4px 8px 0px rgba(9, 30, 66, 0.15);
|
|
67
|
+
scroll-behavior: auto;
|
|
59
68
|
}
|
|
60
69
|
|
|
61
70
|
.select-pressed .select-list {
|
|
@@ -101,3 +110,7 @@
|
|
|
101
110
|
padding-top: 4px;
|
|
102
111
|
padding-left: 14px;
|
|
103
112
|
}
|
|
113
|
+
|
|
114
|
+
.select-item.highlighted {
|
|
115
|
+
background-color: var(--venom-grey-dark, #d1dce8);
|
|
116
|
+
}
|
|
@@ -13,14 +13,26 @@ import "../../../styles/global.css";
|
|
|
13
13
|
import TinyInfo from "../typography/TinyInfo";
|
|
14
14
|
function Select(_a, ref) {
|
|
15
15
|
var _b;
|
|
16
|
-
var items = _a.items, selectedItem = _a.selectedItem, _c = _a.placeholder, placeholder = _c === void 0 ? "Select..." : _c, _d = _a.multiple, multiple = _d === void 0 ? false : _d, _e = _a.isRequired, isRequired = _e === void 0 ? false : _e, _f = _a.showError, showError = _f === void 0 ? false : _f, onChange = _a.onChange, onError = _a.onError;
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
var
|
|
16
|
+
var items = _a.items, selectedItem = _a.selectedItem, _c = _a.placeholder, placeholder = _c === void 0 ? "Select..." : _c, _d = _a.multiple, multiple = _d === void 0 ? false : _d, _e = _a.isRequired, isRequired = _e === void 0 ? false : _e, _f = _a.showError, showError = _f === void 0 ? false : _f, _g = _a.width, width = _g === void 0 ? 100 : _g, onChange = _a.onChange, onError = _a.onError;
|
|
17
|
+
var _h = useState(false), isOpen = _h[0], setIsOpen = _h[1];
|
|
18
|
+
var _j = useState((multiple ? selectedItem || [] : selectedItem || "")), selected = _j[0], setSelected = _j[1];
|
|
19
|
+
var _k = useState(""), error = _k[0], setError = _k[1];
|
|
20
20
|
var selectRef = useRef(null);
|
|
21
|
+
var listRef = useRef(null);
|
|
21
22
|
useEffect(function () {
|
|
22
23
|
setSelected((multiple ? selectedItem || [] : selectedItem || ""));
|
|
23
24
|
}, [selectedItem, multiple]);
|
|
25
|
+
useEffect(function () {
|
|
26
|
+
if (!multiple && selectedItem && isOpen && listRef.current) {
|
|
27
|
+
var selectedItemElement = listRef.current.querySelector(".select-item[data-value=\"".concat(selectedItem, "\"]"));
|
|
28
|
+
if (selectedItemElement instanceof HTMLElement) {
|
|
29
|
+
var listHeight = listRef.current.offsetHeight;
|
|
30
|
+
var itemHeight = selectedItemElement.offsetHeight;
|
|
31
|
+
var scrollTop = selectedItemElement.offsetTop - listHeight / 2 + itemHeight / 2;
|
|
32
|
+
listRef.current.scrollTop = scrollTop;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}, [isOpen, multiple, selectedItem]);
|
|
24
36
|
var handleSelect = function (item) {
|
|
25
37
|
var newSelected;
|
|
26
38
|
if (multiple) {
|
|
@@ -63,8 +75,8 @@ function Select(_a, ref) {
|
|
|
63
75
|
useImperativeHandle(ref, function () { return ({
|
|
64
76
|
validate: function () { return validateSelect(selected); },
|
|
65
77
|
}); });
|
|
66
|
-
return (React.createElement("div", { ref: selectRef, className: "select-container ".concat(isOpen ? "select-pressed" : "") },
|
|
67
|
-
React.createElement("button", { className: "select ".concat(isOpen ? "select-pressed" : "select-default"), onClick: toggleOpen },
|
|
78
|
+
return (React.createElement("div", { ref: selectRef, className: "select-container ".concat(isOpen ? "select-pressed" : ""), style: { width: "".concat(width, "%") } },
|
|
79
|
+
React.createElement("button", { className: "select ".concat(isOpen ? "select-pressed" : "select-default"), onClick: toggleOpen, style: { width: "100%" } },
|
|
68
80
|
React.createElement("span", { className: "select-text" }, Array.isArray(selected) && selected.length > 0
|
|
69
81
|
? selected
|
|
70
82
|
.map(function (val) { var _a; return (_a = items.find(function (item) { return item.value === val; })) === null || _a === void 0 ? void 0 : _a.label; })
|
|
@@ -73,9 +85,9 @@ function Select(_a, ref) {
|
|
|
73
85
|
? (_b = items.find(function (item) { return item.value === selected; })) === null || _b === void 0 ? void 0 : _b.label
|
|
74
86
|
: placeholder),
|
|
75
87
|
React.createElement("span", { className: "select-icon ".concat(isOpen ? "allaw-icon-chevron-up" : "allaw-icon-chevron-down") })),
|
|
76
|
-
isOpen && (React.createElement("div", { className: "select-list" }, items.map(function (item) { return (React.createElement("div", { key: item.value, className: "select-item ".concat(Array.isArray(selected) && selected.includes(item.value)
|
|
88
|
+
isOpen && (React.createElement("div", { ref: listRef, className: "select-list", style: { width: "100%" } }, items.map(function (item) { return (React.createElement("div", { key: item.value, "data-value": item.value, className: "select-item ".concat(Array.isArray(selected) && selected.includes(item.value)
|
|
77
89
|
? "selected"
|
|
78
|
-
: "", " ").concat(!multiple ? "single-select" : ""), onClick: function () { return handleSelect(item); } },
|
|
90
|
+
: "", " ").concat(!multiple && item.value === selectedItem ? "highlighted" : "", " ").concat(!multiple ? "single-select" : ""), onClick: function () { return handleSelect(item); } },
|
|
79
91
|
multiple && (React.createElement("span", { className: "select-item-icon allaw-icon-check" })),
|
|
80
92
|
React.createElement("span", { className: "select-item-text" }, item.label))); }))),
|
|
81
93
|
isRequired && showError && error && (React.createElement("div", { className: "error-message" },
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import "./TinyInfo.css";
|
|
3
3
|
export interface TinyInfoProps {
|
|
4
4
|
variant: "bold14" | "medium14" | "semiBold12" | "medium12";
|
|
5
|
-
color?: "bleu-allaw" | "mid-grey" | "dark-grey" | "noir" | "pure-white" | "actions-error";
|
|
5
|
+
color?: "bleu-allaw" | "mid-grey" | "dark-grey" | "noir" | "pure-white" | "actions-error" | "actions-valid";
|
|
6
6
|
text: string;
|
|
7
7
|
href?: string;
|
|
8
8
|
className?: string;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
@import "../../../styles/colors.css";
|
|
2
|
+
|
|
3
|
+
.case-card-link {
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: flex-start;
|
|
6
|
+
align-self: stretch;
|
|
7
|
+
border-radius: 8px;
|
|
8
|
+
background: var(--Primary-Light-grey, #F4F7FB);
|
|
9
|
+
display: flex;
|
|
10
|
+
padding: 16px;
|
|
11
|
+
align-items: center;
|
|
12
|
+
gap: 16px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.case-card-link-right {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
justify-content: flex-end;
|
|
19
|
+
align-items: flex-start;
|
|
20
|
+
gap: 8px;
|
|
21
|
+
flex: 1 0 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.case-card-link-folder-icon {
|
|
25
|
+
border-radius: 8px;
|
|
26
|
+
background: rgba(255, 255, 255, 0.90);
|
|
27
|
+
display: flex;
|
|
28
|
+
padding: 12px 14px;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
align-items: center;
|
|
32
|
+
align-self: stretch;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.case-card-link-info-row {
|
|
36
|
+
display: flex;
|
|
37
|
+
width: 100%;
|
|
38
|
+
flex-direction: row;
|
|
39
|
+
justify-content: space-between;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.case-card-link-info-col {
|
|
43
|
+
display: flex;
|
|
44
|
+
gap: 4px;
|
|
45
|
+
flex-direction:column;
|
|
46
|
+
justify-content: space-between;
|
|
47
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./CaseLinkCard.css";
|
|
3
|
+
export type CaseLinkCardProps = {
|
|
4
|
+
proName: string;
|
|
5
|
+
caseName: string;
|
|
6
|
+
createdDate: Date;
|
|
7
|
+
onCaseCardClick?: () => any;
|
|
8
|
+
};
|
|
9
|
+
declare function CaseLinkCard({ proName, caseName, createdDate, onCaseCardClick }: CaseLinkCardProps): React.JSX.Element;
|
|
10
|
+
export default CaseLinkCard;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./CaseLinkCard.css";
|
|
3
|
+
import { Paragraph, SmallTitle } from "../../atoms/typography";
|
|
4
|
+
function CaseLinkCard(_a) {
|
|
5
|
+
var proName = _a.proName, caseName = _a.caseName, createdDate = _a.createdDate, onCaseCardClick = _a.onCaseCardClick;
|
|
6
|
+
var formatDate = function (date) {
|
|
7
|
+
return date.toLocaleDateString("fr-FR", {
|
|
8
|
+
day: "2-digit",
|
|
9
|
+
month: "2-digit",
|
|
10
|
+
year: "2-digit",
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var formatProName = function (name) {
|
|
14
|
+
return "Ma\u00EEtre ".concat(name).toUpperCase();
|
|
15
|
+
};
|
|
16
|
+
return React.createElement("div", { className: "case-card-link", onClick: onCaseCardClick && onCaseCardClick(), style: { cursor: onCaseCardClick ? "pointer" : "default" } },
|
|
17
|
+
React.createElement("div", { className: "case-card-link-folder-icon" },
|
|
18
|
+
React.createElement("i", { className: "allaw-icon-folder", style: { fontSize: "20px" } })),
|
|
19
|
+
React.createElement("div", { className: "case-card-link-right" },
|
|
20
|
+
React.createElement("div", { className: "case-card-link-info-row" },
|
|
21
|
+
React.createElement(SmallTitle, { text: "DOSSIER", variant: "semiBold12", color: "dark-grey" }),
|
|
22
|
+
React.createElement(SmallTitle, { text: "Cr\u00E9\u00E9 le ".concat(formatDate(createdDate)), variant: "semiBold12", color: "dark-grey" })),
|
|
23
|
+
React.createElement("div", { className: "case-card-link-info-col" },
|
|
24
|
+
React.createElement(Paragraph, { variant: "bold", size: "default", text: caseName, maxLines: 1 }),
|
|
25
|
+
React.createElement(SmallTitle, { variant: "medium12", color: "mid-grey", text: formatProName(proName) }))));
|
|
26
|
+
}
|
|
27
|
+
export default CaseLinkCard;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CaseCardLink } from "./CaseLinkCard";
|
|
File without changes
|
|
@@ -3,7 +3,7 @@ import Checkbox from "../../atoms/checkboxes/Checkbox";
|
|
|
3
3
|
import Paragraph from "../../atoms/typography/Paragraph";
|
|
4
4
|
import "./CheckboxForm.css";
|
|
5
5
|
var CheckboxForm = function (_a) {
|
|
6
|
-
var _b = _a.checked, checked = _b === void 0 ? false : _b, onChange = _a.onChange, _c = _a.color, color = _c === void 0 ? "noir" : _c, label = _a.label, _d = _a.isRequired, isRequired = _d === void 0 ? false : _d, linkText = _a.linkText, linkUrl = _a.linkUrl, _e = _a.size, size = _e === void 0 ? "default" : _e, _f = _a.style, style = _f === void 0 ? "default" : _f;
|
|
6
|
+
var _b = _a.checked, checked = _b === void 0 ? false : _b, onChange = _a.onChange, _c = _a.color, color = _c === void 0 ? "noir" : _c, label = _a.label, _d = _a.isRequired, isRequired = _d === void 0 ? false : _d, linkText = _a.linkText, linkUrl = _a.linkUrl, _e = _a.size, size = _e === void 0 ? "default" : _e, _f = _a.style, style = _f === void 0 ? "default" : _f, _g = _a.markType, markType = _g === void 0 ? "cross" : _g;
|
|
7
7
|
var checkboxId = "checkbox-".concat(Math.random().toString(36).substr(2, 9));
|
|
8
8
|
var handleCheckboxChange = function (checked) {
|
|
9
9
|
if (onChange) {
|
|
@@ -12,7 +12,7 @@ var CheckboxForm = function (_a) {
|
|
|
12
12
|
};
|
|
13
13
|
var checkboxColor = style === "light" ? "light" : color;
|
|
14
14
|
return (React.createElement("div", { className: "checkbox-form checkbox-form-".concat(checkboxColor, " ").concat(size === "small" ? "checkbox-form-small" : "") },
|
|
15
|
-
React.createElement(Checkbox, { id: checkboxId, checked: checked, onChange: handleCheckboxChange, color: checkboxColor, size: size, style: style }),
|
|
15
|
+
React.createElement(Checkbox, { id: checkboxId, checked: checked, onChange: handleCheckboxChange, color: checkboxColor, size: size, style: style, markType: markType }),
|
|
16
16
|
label && (React.createElement("label", { htmlFor: checkboxId, className: "checkbox-form-label-container" },
|
|
17
17
|
React.createElement(Paragraph, { variant: "semiBold", color: color, text: React.createElement(React.Fragment, null,
|
|
18
18
|
React.createElement("span", null, label),
|
|
File without changes
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
.document-card {
|
|
4
4
|
display: flex;
|
|
5
|
-
width:
|
|
5
|
+
width: 100%;
|
|
6
6
|
padding: 16px;
|
|
7
7
|
justify-content: space-between;
|
|
8
8
|
align-items: flex-start;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
.document-card-left {
|
|
16
16
|
display: flex;
|
|
17
17
|
align-items: center;
|
|
18
|
-
gap:
|
|
18
|
+
gap: 16px;
|
|
19
19
|
align-self: stretch;
|
|
20
20
|
}
|
|
21
21
|
|