allaw-ui 0.0.347 → 0.0.352
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/ActionCircleButton.d.ts +9 -0
- package/dist/components/atoms/buttons/ActionCircleButton.js +23 -0
- package/dist/components/atoms/buttons/AgendaSlot.d.ts +10 -0
- package/dist/components/atoms/buttons/AgendaSlot.js +7 -0
- package/dist/components/atoms/buttons/FavoriteToggle.d.ts +8 -0
- package/dist/components/atoms/buttons/FavoriteToggle.js +11 -0
- package/dist/components/atoms/buttons/FilterButton.d.ts +9 -0
- package/dist/components/atoms/buttons/FilterButton.js +9 -0
- package/dist/components/atoms/buttons/FilterButtonPrimary.d.ts +9 -0
- package/dist/components/atoms/buttons/FilterButtonPrimary.js +46 -0
- package/dist/components/atoms/buttons/GhostButton.d.ts +14 -0
- package/dist/components/atoms/buttons/GhostButton.js +11 -0
- package/dist/components/atoms/buttons/IconButton.d.ts +10 -0
- package/dist/components/atoms/buttons/IconButton.js +14 -0
- package/dist/components/atoms/buttons/OAuthProviderButton.d.ts +12 -0
- package/dist/components/atoms/buttons/OAuthProviderButton.js +143 -0
- package/dist/components/atoms/buttons/PendingDocuments.d.ts +10 -0
- package/dist/components/atoms/buttons/PendingDocuments.js +13 -0
- package/dist/components/atoms/buttons/PrimaryButton.d.ts +16 -0
- package/dist/components/atoms/buttons/PrimaryButton.js +34 -0
- package/dist/components/atoms/buttons/SecondaryButton.d.ts +14 -0
- package/dist/components/atoms/buttons/SecondaryButton.js +11 -0
- package/dist/components/atoms/buttons/TabNavigation.d.ts +13 -0
- package/dist/components/atoms/buttons/TabNavigation.js +10 -0
- package/dist/components/atoms/buttons/TertiaryButton.d.ts +10 -0
- package/dist/components/atoms/buttons/TertiaryButton.js +10 -0
- package/dist/components/atoms/buttons/index.d.ts +22 -0
- package/dist/components/atoms/buttons/index.js +11 -0
- package/dist/components/atoms/checkboxes/Checkbox.d.ts +13 -0
- package/dist/components/atoms/checkboxes/Checkbox.js +19 -0
- package/dist/components/atoms/checkboxes/index.d.ts +2 -0
- package/dist/components/atoms/checkboxes/index.js +1 -0
- package/dist/components/atoms/filter/Filter.d.ts +17 -0
- package/dist/components/atoms/filter/Filter.js +70 -0
- package/dist/components/atoms/filter/index.d.ts +2 -0
- package/dist/components/atoms/filter/index.js +1 -0
- package/dist/components/atoms/filters/SingleFilter.css +172 -0
- package/dist/components/atoms/filters/SingleFilter.d.ts +17 -0
- package/dist/components/atoms/filters/SingleFilter.js +70 -0
- package/dist/components/atoms/filters/index.d.ts +2 -0
- package/dist/components/atoms/filters/index.js +1 -0
- package/dist/components/atoms/inputs/Input.d.ts +22 -0
- package/dist/components/atoms/inputs/Input.js +86 -0
- package/dist/components/atoms/inputs/SearchBar.d.ts +12 -0
- package/dist/components/atoms/inputs/SearchBar.js +20 -0
- package/dist/components/atoms/inputs/index.d.ts +4 -0
- package/dist/components/atoms/inputs/index.js +2 -0
- package/dist/components/atoms/progressBars/ProgressBar.d.ts +15 -0
- package/dist/components/atoms/progressBars/ProgressBar.js +17 -0
- package/dist/components/atoms/progressBars/index.d.ts +2 -0
- package/dist/components/atoms/progressBars/index.js +1 -0
- package/dist/components/atoms/radios/RadioButton.d.ts +11 -0
- package/dist/components/atoms/radios/RadioButton.js +10 -0
- package/dist/components/atoms/radios/index.d.ts +2 -0
- package/dist/components/atoms/radios/index.js +1 -0
- package/dist/components/atoms/selects/Select.d.ts +24 -0
- package/dist/components/atoms/selects/Select.js +84 -0
- package/dist/components/atoms/selects/index.d.ts +2 -0
- package/dist/components/atoms/selects/index.js +1 -0
- package/dist/components/atoms/tags/AppointementStatusTag.d.ts +8 -0
- package/dist/components/atoms/tags/AppointementStatusTag.js +41 -0
- package/dist/components/atoms/tags/FolderStatusTag.d.ts +7 -0
- package/dist/components/atoms/tags/FolderStatusTag.js +8 -0
- package/dist/components/atoms/tags/OtherStatusTag.d.ts +10 -0
- package/dist/components/atoms/tags/OtherStatusTag.js +10 -0
- package/dist/components/atoms/tags/index.d.ts +6 -0
- package/dist/components/atoms/tags/index.js +3 -0
- package/dist/components/atoms/typography/Heading.d.ts +10 -0
- package/dist/components/atoms/typography/Heading.js +7 -0
- package/dist/components/atoms/typography/Paragraph.d.ts +12 -0
- package/dist/components/atoms/typography/Paragraph.js +24 -0
- package/dist/components/atoms/typography/SmallTitle.d.ts +9 -0
- package/dist/components/atoms/typography/SmallTitle.js +7 -0
- package/dist/components/atoms/typography/Subtitle.d.ts +9 -0
- package/dist/components/atoms/typography/Subtitle.js +7 -0
- package/dist/components/atoms/typography/TinyInfo.d.ts +12 -0
- package/dist/components/atoms/typography/TinyInfo.js +15 -0
- package/dist/components/atoms/typography/index.d.ts +10 -0
- package/dist/components/atoms/typography/index.js +5 -0
- package/dist/components/atoms/uiVariables/BorderRadius.d.ts +6 -0
- package/dist/components/atoms/uiVariables/BorderRadius.js +12 -0
- package/dist/components/atoms/uiVariables/Shadows.d.ts +6 -0
- package/dist/components/atoms/uiVariables/Shadows.js +11 -0
- package/dist/components/atoms/uiVariables/Strokes.d.ts +6 -0
- package/dist/components/atoms/uiVariables/Strokes.js +10 -0
- package/dist/components/atoms/uiVariables/index.d.ts +3 -0
- package/dist/components/atoms/uiVariables/index.js +3 -0
- package/dist/components/molecules/appointmentSlot/AppointmentSlot.d.ts +25 -0
- package/dist/components/molecules/appointmentSlot/AppointmentSlot.js +109 -0
- package/dist/components/molecules/appointmentSlot/index.d.ts +2 -0
- package/dist/components/molecules/appointmentSlot/index.js +1 -0
- package/dist/components/molecules/breadcrumb/Breadcrumb.d.ts +12 -0
- package/dist/components/molecules/breadcrumb/Breadcrumb.js +12 -0
- package/dist/components/molecules/breadcrumb/index.d.ts +2 -0
- package/dist/components/molecules/breadcrumb/index.js +1 -0
- package/dist/components/molecules/caseCard/CaseCard.d.ts +14 -0
- package/dist/components/molecules/caseCard/CaseCard.js +20 -0
- package/dist/components/molecules/caseCard/index.d.ts +2 -0
- package/dist/components/molecules/caseCard/index.js +1 -0
- package/dist/components/molecules/checkboxForm/CheckboxForm.d.ts +16 -0
- package/dist/components/molecules/checkboxForm/CheckboxForm.js +24 -0
- package/dist/components/molecules/checkboxForm/index.d.ts +2 -0
- package/dist/components/molecules/checkboxForm/index.js +1 -0
- package/dist/components/molecules/contactCard/ContactCard.d.ts +17 -0
- package/dist/components/molecules/contactCard/ContactCard.js +80 -0
- package/dist/components/molecules/contactCard/index.d.ts +2 -0
- package/dist/components/molecules/contactCard/index.js +1 -0
- package/dist/components/molecules/documentCard/DocumentCard.d.ts +14 -0
- package/dist/components/molecules/documentCard/DocumentCard.js +59 -0
- package/dist/components/molecules/documentCard/index.d.ts +2 -0
- package/dist/components/molecules/documentCard/index.js +1 -0
- package/dist/components/molecules/employeeCard/EmployeeCard.d.ts +15 -0
- package/dist/components/molecules/employeeCard/EmployeeCard.js +34 -0
- package/dist/components/molecules/employeeCard/index.d.ts +2 -0
- package/dist/components/molecules/employeeCard/index.js +1 -0
- package/dist/components/molecules/proCard/ProCard.d.ts +13 -0
- package/dist/components/molecules/proCard/ProCard.js +25 -0
- package/dist/components/molecules/proCard/index.d.ts +2 -0
- package/dist/components/molecules/proCard/index.js +1 -0
- package/dist/components/molecules/stepper/Stepper.d.ts +27 -0
- package/dist/components/molecules/stepper/Stepper.js +68 -0
- package/dist/components/molecules/stepper/index.d.ts +2 -0
- package/dist/components/molecules/stepper/index.js +1 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.js +60 -0
- package/dist/utils/regex.d.ts +5 -0
- package/dist/utils/regex.js +7 -0
- package/package.json +2 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -0,0 +1,70 @@
|
|
|
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
|
+
};
|
|
23
|
+
import "./Basefiler.css";
|
|
24
|
+
import { FilterButtonPrimary, PrimaryButton } from "../buttons";
|
|
25
|
+
import { TinyInfo } from "../typography";
|
|
26
|
+
import React, { useState } from "react";
|
|
27
|
+
var BaseFilter = function (_a) {
|
|
28
|
+
var _b = _a.showNumIndic, showNumIndic = _b === void 0 ? false : _b, _c = _a.required, required = _c === void 0 ? true : _c, defaultSelectedValue = _a.defaultSelectedValue, filterData = _a.filterData, setFilter = _a.setFilter, _d = _a.showBackdrop, showBackdrop = _d === void 0 ? false : _d, children = _a.children, props = __rest(_a, ["showNumIndic", "required", "defaultSelectedValue", "filterData", "setFilter", "showBackdrop", "children"]);
|
|
29
|
+
var _e = useState(false), isOpen = _e[0], setIsOpen = _e[1];
|
|
30
|
+
var _f = useState(defaultSelectedValue || ""), selectedValue = _f[0], setSelectedValue = _f[1];
|
|
31
|
+
var handleClose = function () {
|
|
32
|
+
setFilter(selectedValue);
|
|
33
|
+
setIsOpen(false);
|
|
34
|
+
};
|
|
35
|
+
var handleButtonTap = function () {
|
|
36
|
+
isOpen ? handleClose() : setIsOpen(true);
|
|
37
|
+
};
|
|
38
|
+
var Item = function (_a) {
|
|
39
|
+
var name = _a.name, value = _a.value;
|
|
40
|
+
return (React.createElement("button", { className: "item", onClick: function () { setSelectedValue(value); handleClose(); } },
|
|
41
|
+
React.createElement("div", { className: "round" },
|
|
42
|
+
React.createElement("div", { className: selectedValue === value ? "selected" : "notSelected" })),
|
|
43
|
+
React.createElement("span", null, name)));
|
|
44
|
+
};
|
|
45
|
+
var SmallItem = function (_a) {
|
|
46
|
+
var name = _a.name, value = _a.value;
|
|
47
|
+
return (React.createElement("button", { className: "smallItem", onClick: function () { setSelectedValue(value); } },
|
|
48
|
+
React.createElement("div", { className: "round" },
|
|
49
|
+
React.createElement("div", { className: selectedValue === value ? "selected" : "notSelected" })),
|
|
50
|
+
React.createElement("span", null, name)));
|
|
51
|
+
};
|
|
52
|
+
return (React.createElement(React.Fragment, null,
|
|
53
|
+
React.createElement("div", __assign({ className: "baseFilter" }, props),
|
|
54
|
+
React.createElement(FilterButtonPrimary, { onClick: handleButtonTap, zIndex: "2000" },
|
|
55
|
+
children,
|
|
56
|
+
React.createElement("p", { style: { color: "#25BEEB", fontWeight: "600" } }, showNumIndic && "(".concat(selectedValue.length, ")"))),
|
|
57
|
+
isOpen && (React.createElement("div", { className: "options" }, filterData && filterData.length > 0 &&
|
|
58
|
+
filterData.map(function (item, idx) { return (React.createElement(Item, { name: item.name, value: item.value, key: idx })); }))),
|
|
59
|
+
React.createElement("div", { className: "optionsSmall", style: { bottom: isOpen ? "0" : "-100%" } },
|
|
60
|
+
React.createElement("div", { className: "row" },
|
|
61
|
+
React.createElement("div", { style: { minWidth: "20px" } }),
|
|
62
|
+
React.createElement(TinyInfo, { text: children, variant: "bold14", color: "noir" }),
|
|
63
|
+
React.createElement("button", { className: "closeButton", onClick: handleClose },
|
|
64
|
+
React.createElement("i", { className: "allaw-icon-close" }))),
|
|
65
|
+
React.createElement("div", { className: "choices" }, filterData && filterData.length > 0 &&
|
|
66
|
+
filterData.map(function (item, idx) { return (React.createElement(SmallItem, { name: item.name, value: item.value, key: idx })); })),
|
|
67
|
+
React.createElement(PrimaryButton, { label: "Voir les r\u00E9sultats", onClick: handleClose }))),
|
|
68
|
+
isOpen && (React.createElement("div", { className: "backdrop", onClick: handleClose }))));
|
|
69
|
+
};
|
|
70
|
+
export default BaseFilter;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Filter } from "./Filter";
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
.backdrop {
|
|
2
|
+
position: fixed;
|
|
3
|
+
top: 0;
|
|
4
|
+
left: 0;
|
|
5
|
+
height: 100vh;
|
|
6
|
+
width: 100vw;
|
|
7
|
+
z-index: 4500;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.baseFilter {
|
|
11
|
+
position: relative;
|
|
12
|
+
width: fit-content;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.smallOpenFilter{
|
|
16
|
+
position: relative;
|
|
17
|
+
width: fit-content;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.options {
|
|
21
|
+
position: absolute;
|
|
22
|
+
top: 120%;
|
|
23
|
+
left: 0;
|
|
24
|
+
width: fit-content;
|
|
25
|
+
border: 0.5px solid #ddd;
|
|
26
|
+
border-radius: 4px;
|
|
27
|
+
background-color: #ffffff;
|
|
28
|
+
box-shadow: rgba(9, 30, 66, 0.15) 0px 8px 12px 0px;
|
|
29
|
+
z-index: 5000;
|
|
30
|
+
padding: 0.4rem 0rem;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.item {
|
|
34
|
+
background: none;
|
|
35
|
+
border: none;
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: row;
|
|
38
|
+
align-items: center;
|
|
39
|
+
gap: 0.75rem;
|
|
40
|
+
padding: 0.5rem 1rem;
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
border-left: 2px solid #FFF;
|
|
43
|
+
width: 100%;
|
|
44
|
+
color: #0000
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.round {
|
|
48
|
+
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
justify-content: center;
|
|
52
|
+
border: 1px solid #D1DCE7;
|
|
53
|
+
border-radius: 3rem;
|
|
54
|
+
padding: 2px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.selected {
|
|
58
|
+
background-color: #25BEEB;
|
|
59
|
+
min-width: 0.6rem;
|
|
60
|
+
min-height: 0.6rem;
|
|
61
|
+
border-radius: 1rem;
|
|
62
|
+
display: block;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.notSelected {
|
|
66
|
+
background-color: #FFF;
|
|
67
|
+
min-width: 0.6rem;
|
|
68
|
+
min-height: 0.6rem;
|
|
69
|
+
border-radius: 1rem;
|
|
70
|
+
display: block;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.item > span {
|
|
74
|
+
text-wrap: nowrap;
|
|
75
|
+
font-family: var(--font-open-sans);
|
|
76
|
+
font-size: 14px;
|
|
77
|
+
font-weight: 500;
|
|
78
|
+
color: #000;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.item:hover {
|
|
82
|
+
background-color: #EFF2F5;
|
|
83
|
+
border-left: 2px solid #25BEEB;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.optionsSmall {
|
|
87
|
+
position: fixed;
|
|
88
|
+
right: 0;
|
|
89
|
+
transition: bottom 225ms cubic-bezier(0, 0, 0.2, 1);
|
|
90
|
+
max-height: 90dvh;
|
|
91
|
+
background-color: white;
|
|
92
|
+
width: 100vw;
|
|
93
|
+
display: none;
|
|
94
|
+
border-radius: 16px 16px 0 0;
|
|
95
|
+
padding: 1rem;
|
|
96
|
+
flex-direction: column;
|
|
97
|
+
gap: 2rem;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.smallItem {
|
|
101
|
+
background: none;
|
|
102
|
+
border: none;
|
|
103
|
+
display: flex;
|
|
104
|
+
flex-direction: row-reverse;
|
|
105
|
+
align-items: center;
|
|
106
|
+
justify-content: space-between;
|
|
107
|
+
padding: 1.5rem 1rem;
|
|
108
|
+
cursor: pointer;
|
|
109
|
+
border-left: 2px solid #FFF;
|
|
110
|
+
width: 100%;
|
|
111
|
+
color: #0000;
|
|
112
|
+
border-top: 1px solid #e4edf6;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.smallItem:first-child {
|
|
116
|
+
border-top: none;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.smallItem > span {
|
|
120
|
+
text-wrap: nowrap;
|
|
121
|
+
font-family: var(--font-open-sans);
|
|
122
|
+
font-size: 14px;
|
|
123
|
+
font-weight: 500;
|
|
124
|
+
color: #000;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.choices {
|
|
128
|
+
display: flex;
|
|
129
|
+
flex-direction: column;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.closeButton {
|
|
133
|
+
height: fit-content;
|
|
134
|
+
border: none;
|
|
135
|
+
color: #000;
|
|
136
|
+
background: transparent;
|
|
137
|
+
cursor: pointer;
|
|
138
|
+
width: 20px;
|
|
139
|
+
display: flex;
|
|
140
|
+
align-items: center;
|
|
141
|
+
justify-content: center;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.closeButton > i {
|
|
145
|
+
font-size: 16px;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.row {
|
|
149
|
+
width: 100%;
|
|
150
|
+
height: fit-content;
|
|
151
|
+
display: flex;
|
|
152
|
+
flex-direction: row;
|
|
153
|
+
justify-content: space-between;
|
|
154
|
+
align-items: center;
|
|
155
|
+
gap: 1rem;
|
|
156
|
+
padding: 1rem 0.5rem;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
@media screen and (max-width: 800px) {
|
|
160
|
+
.options {
|
|
161
|
+
display: none;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.optionsSmall {
|
|
165
|
+
z-index: 5000;
|
|
166
|
+
display: flex;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.backdrop {
|
|
170
|
+
background: linear-gradient(180deg, rgba(26, 50, 56, 0.00) 0%, rgba(2, 9, 11, 0.45) 100%);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import "./SingleFilter.css";
|
|
2
|
+
import React from "react";
|
|
3
|
+
export type SingleFilterProps = {
|
|
4
|
+
defaultSelectedValue?: string;
|
|
5
|
+
filterData: {
|
|
6
|
+
value: string;
|
|
7
|
+
name: string;
|
|
8
|
+
}[];
|
|
9
|
+
setFilter: (selectedValue: string) => void;
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
required?: boolean;
|
|
12
|
+
showNumIndic?: boolean;
|
|
13
|
+
showBackdrop?: boolean;
|
|
14
|
+
isStatusTag?: boolean;
|
|
15
|
+
};
|
|
16
|
+
declare const SingleFilter: ({ showNumIndic, required, defaultSelectedValue, filterData, setFilter, showBackdrop, children, ...props }: SingleFilterProps) => React.JSX.Element;
|
|
17
|
+
export default SingleFilter;
|
|
@@ -0,0 +1,70 @@
|
|
|
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
|
+
};
|
|
23
|
+
import "./SingleFilter.css";
|
|
24
|
+
import { FilterButtonPrimary, PrimaryButton } from "../buttons";
|
|
25
|
+
import { TinyInfo } from "../typography";
|
|
26
|
+
import React, { useState } from "react";
|
|
27
|
+
var SingleFilter = function (_a) {
|
|
28
|
+
var _b = _a.showNumIndic, showNumIndic = _b === void 0 ? false : _b, _c = _a.required, required = _c === void 0 ? true : _c, defaultSelectedValue = _a.defaultSelectedValue, filterData = _a.filterData, setFilter = _a.setFilter, _d = _a.showBackdrop, showBackdrop = _d === void 0 ? false : _d, children = _a.children, props = __rest(_a, ["showNumIndic", "required", "defaultSelectedValue", "filterData", "setFilter", "showBackdrop", "children"]);
|
|
29
|
+
var _e = useState(false), isOpen = _e[0], setIsOpen = _e[1];
|
|
30
|
+
var _f = useState(defaultSelectedValue || ""), selectedValue = _f[0], setSelectedValue = _f[1];
|
|
31
|
+
var handleClose = function () {
|
|
32
|
+
setFilter(selectedValue);
|
|
33
|
+
setIsOpen(false);
|
|
34
|
+
};
|
|
35
|
+
var handleButtonTap = function () {
|
|
36
|
+
isOpen ? handleClose() : setIsOpen(true);
|
|
37
|
+
};
|
|
38
|
+
var Item = function (_a) {
|
|
39
|
+
var name = _a.name, value = _a.value;
|
|
40
|
+
return (React.createElement("button", { className: "item", onClick: function () { setSelectedValue(value); handleClose(); } },
|
|
41
|
+
React.createElement("div", { className: "round" },
|
|
42
|
+
React.createElement("div", { className: selectedValue === value ? "selected" : "notSelected" })),
|
|
43
|
+
React.createElement("span", null, name)));
|
|
44
|
+
};
|
|
45
|
+
var SmallItem = function (_a) {
|
|
46
|
+
var name = _a.name, value = _a.value;
|
|
47
|
+
return (React.createElement("button", { className: "smallItem", onClick: function () { setSelectedValue(value); } },
|
|
48
|
+
React.createElement("div", { className: "round" },
|
|
49
|
+
React.createElement("div", { className: selectedValue === value ? "selected" : "notSelected" })),
|
|
50
|
+
React.createElement("span", null, name)));
|
|
51
|
+
};
|
|
52
|
+
return (React.createElement(React.Fragment, null,
|
|
53
|
+
React.createElement("div", __assign({ className: "baseFilter" }, props),
|
|
54
|
+
React.createElement(FilterButtonPrimary, { onClick: handleButtonTap, zIndex: "2000" },
|
|
55
|
+
children,
|
|
56
|
+
React.createElement("p", { style: { color: "#25BEEB", fontWeight: "600" } }, showNumIndic && "(".concat(selectedValue.length, ")"))),
|
|
57
|
+
isOpen && (React.createElement("div", { className: "options" }, filterData && filterData.length > 0 &&
|
|
58
|
+
filterData.map(function (item, idx) { return (React.createElement(Item, { name: item.name, value: item.value, key: idx })); }))),
|
|
59
|
+
React.createElement("div", { className: "optionsSmall", style: { bottom: isOpen ? "0" : "-100%" } },
|
|
60
|
+
React.createElement("div", { className: "row" },
|
|
61
|
+
React.createElement("div", { style: { minWidth: "20px" } }),
|
|
62
|
+
React.createElement(TinyInfo, { text: children, variant: "bold14", color: "noir" }),
|
|
63
|
+
React.createElement("button", { className: "closeButton", onClick: handleClose },
|
|
64
|
+
React.createElement("i", { className: "allaw-icon-close" }))),
|
|
65
|
+
React.createElement("div", { className: "choices" }, filterData && filterData.length > 0 &&
|
|
66
|
+
filterData.map(function (item, idx) { return (React.createElement(SmallItem, { name: item.name, value: item.value, key: idx })); })),
|
|
67
|
+
React.createElement(PrimaryButton, { label: "Voir les r\u00E9sultats", onClick: handleClose }))),
|
|
68
|
+
isOpen && (React.createElement("div", { className: "backdrop", onClick: handleClose }))));
|
|
69
|
+
};
|
|
70
|
+
export default SingleFilter;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as SingleFilter } from "./SingleFilter";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./Input.css";
|
|
3
|
+
import "../../../styles/global.css";
|
|
4
|
+
import "../../../styles/icons.css";
|
|
5
|
+
import { commonRegex } from "../../../utils/regex";
|
|
6
|
+
export interface InputProps {
|
|
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?: (value: string) => void;
|
|
15
|
+
value?: string;
|
|
16
|
+
error?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface InputRef {
|
|
19
|
+
validate: () => boolean;
|
|
20
|
+
}
|
|
21
|
+
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<InputRef>>;
|
|
22
|
+
export default Input;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import React, { useState, useEffect, useCallback, forwardRef, useImperativeHandle, useRef, } from "react";
|
|
2
|
+
import "./Input.css";
|
|
3
|
+
import "../../../styles/global.css";
|
|
4
|
+
import "../../../styles/icons.css";
|
|
5
|
+
import { commonRegex } from "../../../utils/regex";
|
|
6
|
+
import TinyInfo from "../typography/TinyInfo";
|
|
7
|
+
import Paragraph from "../typography/Paragraph";
|
|
8
|
+
var Input = forwardRef(function (_a, ref) {
|
|
9
|
+
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;
|
|
10
|
+
var _d = useState(false), isPasswordVisible = _d[0], setIsPasswordVisible = _d[1];
|
|
11
|
+
var _e = useState(propValue || ""), value = _e[0], setValue = _e[1];
|
|
12
|
+
var _f = useState(propError || ""), error = _f[0], setError = _f[1];
|
|
13
|
+
var _g = useState(false), isTouched = _g[0], setIsTouched = _g[1];
|
|
14
|
+
var inputRef = useRef(null);
|
|
15
|
+
useEffect(function () {
|
|
16
|
+
setValue(propValue || "");
|
|
17
|
+
}, [propValue]);
|
|
18
|
+
useEffect(function () {
|
|
19
|
+
setError(propError || "");
|
|
20
|
+
}, [propError]);
|
|
21
|
+
var validateInput = useCallback(function () {
|
|
22
|
+
var _a;
|
|
23
|
+
// console.log(`Input ${title}: Validating input`);
|
|
24
|
+
var currentValue = ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.value) || value;
|
|
25
|
+
// console.log(`Input ${title}: Current value: "${currentValue}"`);
|
|
26
|
+
var errorMessage = "";
|
|
27
|
+
if (isRequired && currentValue.trim() === "") {
|
|
28
|
+
errorMessage = "Ce champ est requis";
|
|
29
|
+
}
|
|
30
|
+
else if (validate && currentValue) {
|
|
31
|
+
var regex = typeof validate === "string" ? commonRegex[validate] : validate;
|
|
32
|
+
// console.log(`Input ${title}: Regex used: ${regex}`);
|
|
33
|
+
if (!regex.test(currentValue)) {
|
|
34
|
+
errorMessage = "Veuillez vérifier votre saisie";
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
setError(errorMessage);
|
|
38
|
+
setIsTouched(true);
|
|
39
|
+
// console.log(
|
|
40
|
+
// `Input ${title}: Validation result - ${errorMessage ? "invalid" : "valid"}`
|
|
41
|
+
// );
|
|
42
|
+
onError === null || onError === void 0 ? void 0 : onError(errorMessage);
|
|
43
|
+
return !errorMessage;
|
|
44
|
+
}, [isRequired, value, validate, onError, title]);
|
|
45
|
+
useImperativeHandle(ref, function () { return ({
|
|
46
|
+
validate: validateInput,
|
|
47
|
+
}); });
|
|
48
|
+
var handleChange = function (e) {
|
|
49
|
+
var newValue = e.target.value;
|
|
50
|
+
// console.log(`Input ${title}: Value changed to "${newValue}"`);
|
|
51
|
+
setValue(newValue);
|
|
52
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
53
|
+
if (isTouched) {
|
|
54
|
+
validateInput();
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
var handleBlur = function () {
|
|
58
|
+
// console.log(`Input ${title}: Blur event triggered`);
|
|
59
|
+
setIsTouched(true);
|
|
60
|
+
validateInput();
|
|
61
|
+
};
|
|
62
|
+
var renderEndIcon = function () {
|
|
63
|
+
if (style === "variation" && endIcon) {
|
|
64
|
+
return (React.createElement("button", { className: "Input-icon-button" },
|
|
65
|
+
React.createElement("i", { className: endIcon })));
|
|
66
|
+
}
|
|
67
|
+
if (style === "password") {
|
|
68
|
+
return (React.createElement("button", { className: "Input-button", onClick: function () { return setIsPasswordVisible(!isPasswordVisible); } }, isPasswordVisible ? "CACHER" : "AFFICHER"));
|
|
69
|
+
}
|
|
70
|
+
return null;
|
|
71
|
+
};
|
|
72
|
+
return (React.createElement("div", { className: "Input Input-".concat(style) },
|
|
73
|
+
React.createElement("div", { className: "Input-title-container" },
|
|
74
|
+
React.createElement(Paragraph, { variant: "semiBold", color: "noir", text: title }),
|
|
75
|
+
isRequired && title && (React.createElement("span", { className: "Input-required" },
|
|
76
|
+
"\u00A0",
|
|
77
|
+
"*"))),
|
|
78
|
+
React.createElement("div", { className: "Input-container" },
|
|
79
|
+
React.createElement("div", { className: "Input-input ".concat(style === "password" ? "Input-password-input" : "") },
|
|
80
|
+
React.createElement("input", { ref: inputRef, type: style === "password" && !isPasswordVisible ? "password" : "text", placeholder: placeholder, className: "Input-placeholder", value: value, onChange: handleChange, onBlur: handleBlur })),
|
|
81
|
+
renderEndIcon(),
|
|
82
|
+
error && isTouched && (React.createElement("div", { className: "error-message" },
|
|
83
|
+
React.createElement(TinyInfo, { variant: "medium12", color: "actions-error", text: error }))))));
|
|
84
|
+
});
|
|
85
|
+
Input.displayName = "Input";
|
|
86
|
+
export default Input;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./SearchBar.css";
|
|
3
|
+
import "../../../styles/global.css";
|
|
4
|
+
import "../../../styles/icons.css";
|
|
5
|
+
export interface SearchBarProps {
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
endIcon?: string;
|
|
8
|
+
value?: string;
|
|
9
|
+
onChange?: (value: string) => void;
|
|
10
|
+
}
|
|
11
|
+
declare const SearchBar: React.FC<SearchBarProps>;
|
|
12
|
+
export default SearchBar;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import "./SearchBar.css";
|
|
3
|
+
import "../../../styles/global.css";
|
|
4
|
+
import "../../../styles/icons.css";
|
|
5
|
+
var SearchBar = function (_a) {
|
|
6
|
+
var _b = _a.placeholder, placeholder = _b === void 0 ? "Faites une recherche" : _b, _c = _a.endIcon, endIcon = _c === void 0 ? "allaw-icon-search" : _c, _d = _a.value, controlledValue = _d === void 0 ? "" : _d, onChange = _a.onChange;
|
|
7
|
+
var _e = useState(controlledValue), value = _e[0], setValue = _e[1];
|
|
8
|
+
var handleChange = function (event) {
|
|
9
|
+
var newValue = event.target.value;
|
|
10
|
+
setValue(newValue);
|
|
11
|
+
if (onChange) {
|
|
12
|
+
onChange(newValue);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
return (React.createElement("div", { className: "SearchBar" },
|
|
16
|
+
React.createElement("input", { type: "text", placeholder: placeholder, className: "SearchBar-placeholder", value: controlledValue || value, onChange: handleChange }),
|
|
17
|
+
React.createElement("button", { className: "SearchBar-icon-button" },
|
|
18
|
+
React.createElement("i", { className: endIcon }))));
|
|
19
|
+
};
|
|
20
|
+
export default SearchBar;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./ProgressBar.css";
|
|
3
|
+
import "../../../styles/global.css";
|
|
4
|
+
import "../../../styles/icons.css";
|
|
5
|
+
export interface ProgressBarProps {
|
|
6
|
+
steps: number;
|
|
7
|
+
currentStep: number;
|
|
8
|
+
startIcon?: boolean;
|
|
9
|
+
endIcon?: boolean;
|
|
10
|
+
onStartIconClick?: () => void;
|
|
11
|
+
onEndIconClick?: () => void;
|
|
12
|
+
showProgressBar?: boolean;
|
|
13
|
+
}
|
|
14
|
+
declare const ProgressBar: React.FC<ProgressBarProps>;
|
|
15
|
+
export default ProgressBar;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./ProgressBar.css";
|
|
3
|
+
import "../../../styles/global.css";
|
|
4
|
+
import "../../../styles/icons.css";
|
|
5
|
+
var ProgressBar = function (_a) {
|
|
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(1, Math.min(currentStep, steps));
|
|
8
|
+
var progressWidth = ((constrainedCurrentStep - 1) / (steps - 1)) * 100;
|
|
9
|
+
return (React.createElement("div", { className: "progress-bar-container" },
|
|
10
|
+
React.createElement("div", { className: "progress-bar-icon-container" }, startIcon && currentStep > 1 && (React.createElement("button", { className: "progress-bar-chevron", onClick: onStartIconClick },
|
|
11
|
+
React.createElement("i", { className: "allaw-icon-chevron-left" })))),
|
|
12
|
+
React.createElement("div", { className: "progress-bar-background ".concat(showProgressBar ? "" : "hidden-content") },
|
|
13
|
+
React.createElement("div", { className: "progress-bar-fill", style: { width: "".concat(progressWidth, "%") } })),
|
|
14
|
+
endIcon && (React.createElement("button", { className: "progress-bar-close", onClick: onEndIconClick },
|
|
15
|
+
React.createElement("i", { className: "allaw-icon-close" })))));
|
|
16
|
+
};
|
|
17
|
+
export default ProgressBar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ProgressBar } from "./ProgressBar";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./RadioButton.css";
|
|
3
|
+
import "../../../styles/global.css";
|
|
4
|
+
export interface RadioButtonProps {
|
|
5
|
+
label: string;
|
|
6
|
+
style?: "user" | "hybride";
|
|
7
|
+
isActive: boolean;
|
|
8
|
+
onClick: () => void;
|
|
9
|
+
}
|
|
10
|
+
declare const RadioButton: React.FC<RadioButtonProps>;
|
|
11
|
+
export default RadioButton;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./RadioButton.css";
|
|
3
|
+
import "../../../styles/global.css";
|
|
4
|
+
var RadioButton = function (_a) {
|
|
5
|
+
var label = _a.label, _b = _a.style, style = _b === void 0 ? "user" : _b, isActive = _a.isActive, onClick = _a.onClick;
|
|
6
|
+
return (React.createElement("button", { className: "radio-button radio-button-".concat(style, " ").concat(isActive ? "radio-button-".concat(style, "-active") : ""), onClick: onClick },
|
|
7
|
+
React.createElement("span", { className: "radio-button-icon" }, isActive && React.createElement("span", { className: "radio-button-icon-inner" })),
|
|
8
|
+
React.createElement("span", { className: "radio-button-label" }, label)));
|
|
9
|
+
};
|
|
10
|
+
export default RadioButton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as RadioButton } from "./RadioButton";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./Select.css";
|
|
3
|
+
import "../../../styles/global.css";
|
|
4
|
+
export interface SelectItem {
|
|
5
|
+
label: string;
|
|
6
|
+
value: string;
|
|
7
|
+
}
|
|
8
|
+
export interface SelectProps<T extends string | string[]> {
|
|
9
|
+
items: SelectItem[];
|
|
10
|
+
selectedItem?: T;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
multiple?: boolean;
|
|
13
|
+
isRequired?: boolean;
|
|
14
|
+
showError?: boolean;
|
|
15
|
+
onChange?: (selected: T) => void;
|
|
16
|
+
onError?: (error: string) => void;
|
|
17
|
+
}
|
|
18
|
+
export interface SelectRef {
|
|
19
|
+
validate: () => boolean;
|
|
20
|
+
}
|
|
21
|
+
declare const _default: <T extends string | string[]>(props: SelectProps<T> & {
|
|
22
|
+
ref?: React.Ref<SelectRef>;
|
|
23
|
+
}) => React.ReactElement;
|
|
24
|
+
export default _default;
|