allaw-ui 0.1.71 → 1.0.2
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 +11 -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 +17 -0
- package/dist/components/atoms/buttons/PrimaryButton.js +117 -0
- package/dist/components/atoms/buttons/SecondaryButton.d.ts +18 -0
- package/dist/components/atoms/buttons/SecondaryButton.js +117 -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 +11 -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 +14 -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.d.ts +17 -0
- package/dist/components/atoms/filters/SingleFilter.js +81 -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/TextArea.d.ts +21 -0
- package/dist/components/atoms/inputs/TextArea.js +66 -0
- package/dist/components/atoms/inputs/index.d.ts +6 -0
- package/dist/components/atoms/inputs/index.js +3 -0
- package/dist/components/atoms/progressBars/ProgressBar.d.ts +15 -0
- package/dist/components/atoms/progressBars/ProgressBar.js +18 -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/ComboBox.d.ts +27 -0
- package/dist/components/atoms/selects/ComboBox.js +172 -0
- package/dist/components/atoms/selects/Select.d.ts +25 -0
- package/dist/components/atoms/selects/Select.js +127 -0
- package/dist/components/atoms/selects/index.d.ts +4 -0
- package/dist/components/atoms/selects/index.js +2 -0
- package/dist/components/atoms/tags/AppointementStatusTag.d.ts +8 -0
- package/dist/components/atoms/tags/AppointementStatusTag.js +42 -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 +33 -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/caseLinkCard/CaseLinkCard.d.ts +11 -0
- package/dist/components/molecules/caseLinkCard/CaseLinkCard.js +30 -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.d.ts +17 -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/clientLinkCard/ClientLinkCard.d.ts +13 -0
- package/dist/components/molecules/clientLinkCard/ClientLinkCard.js +16 -0
- package/dist/components/molecules/clientLinkCard/index.d.ts +2 -0
- package/dist/components/molecules/clientLinkCard/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 +15 -0
- package/dist/components/molecules/documentCard/DocumentCard.js +72 -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/loadingBox/LoadingBox.d.ts +9 -0
- package/dist/components/molecules/loadingBox/LoadingBox.js +7 -0
- package/dist/components/molecules/loadingBox/index.d.ts +2 -0
- package/dist/components/molecules/loadingBox/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/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.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.d.ts +34 -0
- package/dist/components/molecules/stepper/Stepper.js +123 -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 +51 -0
- package/dist/index.js +71 -0
- package/dist/utils/regex.d.ts +5 -0
- package/dist/utils/regex.js +7 -0
- package/dist/utils/utils.d.ts +2 -0
- package/dist/utils/utils.js +48 -0
- package/package.json +1 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./ContactCard.css";
|
|
3
|
+
import OtherStatusTag from "../../atoms/tags/OtherStatusTag";
|
|
4
|
+
import IconButton from "../../atoms/buttons/IconButton";
|
|
5
|
+
import Image from "next/image";
|
|
6
|
+
var NoPhoto = "/assets/NoPhoto.png";
|
|
7
|
+
var ContactCard = function (_a) {
|
|
8
|
+
var size = _a.size, name = _a.name, birthDate = _a.birthDate, avatarUrl = _a.avatarUrl, status = _a.status, address = _a.address, phone = _a.phone, email = _a.email, onEdit = _a.onEdit, gender = _a.gender;
|
|
9
|
+
var renderContent = function () {
|
|
10
|
+
switch (size) {
|
|
11
|
+
case "small":
|
|
12
|
+
return (React.createElement("div", { className: "contact-card-content" },
|
|
13
|
+
React.createElement("div", { className: "profile-picture-container" },
|
|
14
|
+
React.createElement(Image, { src: avatarUrl || NoPhoto, alt: name, width: 64, height: 64, className: "avatar" })),
|
|
15
|
+
React.createElement("div", { className: "contact-info" },
|
|
16
|
+
React.createElement("h3", { className: "contact-name" }, name),
|
|
17
|
+
React.createElement("p", { className: "contact-details" },
|
|
18
|
+
React.createElement("span", null, gender === "male" ? "M" : "F"),
|
|
19
|
+
React.createElement("span", { className: "gender-separator" }),
|
|
20
|
+
React.createElement("span", null, birthDate)))));
|
|
21
|
+
case "medium":
|
|
22
|
+
return (React.createElement("div", { className: "contact-card-content" },
|
|
23
|
+
React.createElement("div", { className: "profile-picture-container" },
|
|
24
|
+
React.createElement(Image, { src: avatarUrl || NoPhoto, alt: name, width: 72, height: 72, className: "avatar" })),
|
|
25
|
+
React.createElement("div", { className: "contact-info" },
|
|
26
|
+
React.createElement("h3", { className: "contact-name" }, name),
|
|
27
|
+
React.createElement("p", { className: "contact-details" },
|
|
28
|
+
React.createElement("span", null, gender === "male" ? "M" : "F"),
|
|
29
|
+
React.createElement("span", { className: "gender-separator" }),
|
|
30
|
+
React.createElement("span", null, birthDate))),
|
|
31
|
+
React.createElement("div", { className: "status-container" },
|
|
32
|
+
React.createElement(OtherStatusTag, { label: status, type: "readonly" }))));
|
|
33
|
+
case "large":
|
|
34
|
+
return (React.createElement(React.Fragment, null,
|
|
35
|
+
React.createElement("div", { className: "profile-picture-container" },
|
|
36
|
+
React.createElement(Image, { src: avatarUrl || NoPhoto, alt: name, width: 94, height: 94, className: "avatar" })),
|
|
37
|
+
React.createElement("div", { className: "content-container" },
|
|
38
|
+
React.createElement("div", null,
|
|
39
|
+
React.createElement("h3", { className: "contact-name" }, name),
|
|
40
|
+
React.createElement("p", { className: "contact-details" },
|
|
41
|
+
React.createElement("span", null, gender === "male" ? "M" : "F"),
|
|
42
|
+
React.createElement("span", { className: "gender-separator" }),
|
|
43
|
+
React.createElement("span", null, birthDate))),
|
|
44
|
+
React.createElement("div", { className: "contact-additional-info" },
|
|
45
|
+
React.createElement("div", { className: "contact-address-container" },
|
|
46
|
+
React.createElement("p", { className: "info-label" }, "ADRESSE"),
|
|
47
|
+
React.createElement("p", { className: "info-value" }, address)),
|
|
48
|
+
React.createElement("div", { className: "contact-telephone-email-container" },
|
|
49
|
+
React.createElement("p", { className: "info-label" }, "CONTACT"),
|
|
50
|
+
React.createElement("p", { className: "info-value" },
|
|
51
|
+
React.createElement("span", { className: "contact-phone" }, phone)),
|
|
52
|
+
React.createElement("p", { className: "info-value" },
|
|
53
|
+
React.createElement("span", { className: "contact-phone" }, email))))),
|
|
54
|
+
React.createElement("div", { className: "status-container" },
|
|
55
|
+
React.createElement(OtherStatusTag, { label: status, type: "readonly" }))));
|
|
56
|
+
case "editable":
|
|
57
|
+
return (React.createElement(React.Fragment, null,
|
|
58
|
+
React.createElement("div", { className: "content-container" },
|
|
59
|
+
React.createElement("div", { className: "name-tag-container" },
|
|
60
|
+
React.createElement("h3", { className: "contact-name" }, name),
|
|
61
|
+
React.createElement(OtherStatusTag, { label: status, type: "readonly" })),
|
|
62
|
+
React.createElement("div", { className: "info-container" },
|
|
63
|
+
React.createElement("div", { className: "info-item" },
|
|
64
|
+
React.createElement("i", { className: "allaw-icon-user info-icon" }),
|
|
65
|
+
React.createElement("span", { className: "info-text" },
|
|
66
|
+
gender === "male" ? "Client" : "Cliente",
|
|
67
|
+
" de l'\u00E9tude")),
|
|
68
|
+
React.createElement("div", { className: "telephone-email-items" },
|
|
69
|
+
React.createElement("div", { className: "info-item" },
|
|
70
|
+
React.createElement("i", { className: "allaw-icon-phone info-icon" }),
|
|
71
|
+
React.createElement("span", { className: "info-text contact" }, phone)),
|
|
72
|
+
React.createElement("div", { className: "info-item" },
|
|
73
|
+
React.createElement("i", { className: "allaw-icon-mail info-icon" }),
|
|
74
|
+
React.createElement("span", { className: "info-text contact" }, email))))),
|
|
75
|
+
React.createElement(IconButton, { style: "largeFilled", iconName: "allaw-icon-edit-2", onClick: onEdit })));
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
return React.createElement("div", { className: "contact-card ".concat(size) }, renderContent());
|
|
79
|
+
};
|
|
80
|
+
export default ContactCard;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ContactCard } from "./ContactCard";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./DocumentCard.css";
|
|
3
|
+
export interface DocumentCardProps {
|
|
4
|
+
type: "document" | "note" | "invoice" | "waiting";
|
|
5
|
+
title: string;
|
|
6
|
+
date: Date;
|
|
7
|
+
status: "sent" | "received" | "internal";
|
|
8
|
+
documents?: {
|
|
9
|
+
[key: string]: boolean;
|
|
10
|
+
};
|
|
11
|
+
onCardClick?: () => any;
|
|
12
|
+
documentCount?: string;
|
|
13
|
+
}
|
|
14
|
+
declare const DocumentCard: React.FC<DocumentCardProps>;
|
|
15
|
+
export default DocumentCard;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./DocumentCard.css";
|
|
3
|
+
import IconButton from "../../atoms/buttons/IconButton";
|
|
4
|
+
import OtherStatusTag from "../../atoms/tags/OtherStatusTag";
|
|
5
|
+
import { Paragraph } from "../../atoms/typography";
|
|
6
|
+
var DocumentCard = function (_a) {
|
|
7
|
+
var type = _a.type, title = _a.title, date = _a.date, onCardClick = _a.onCardClick, status = _a.status, _b = _a.documents, documents = _b === void 0 ? {} : _b, _c = _a.documentCount, documentCount = _c === void 0 ? "" : _c;
|
|
8
|
+
var getIconName = function () {
|
|
9
|
+
switch (type) {
|
|
10
|
+
case "document":
|
|
11
|
+
return "allaw-icon-edit-2";
|
|
12
|
+
case "note":
|
|
13
|
+
return "allaw-icon-document";
|
|
14
|
+
case "invoice":
|
|
15
|
+
return "allaw-icon-file";
|
|
16
|
+
case "waiting":
|
|
17
|
+
return "allaw-icon-clock";
|
|
18
|
+
default:
|
|
19
|
+
return "allaw-icon-document";
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
var getStatusName = function () {
|
|
23
|
+
switch (status) {
|
|
24
|
+
case "internal":
|
|
25
|
+
return "INTERNE";
|
|
26
|
+
case "received":
|
|
27
|
+
return "REÇU";
|
|
28
|
+
case "sent":
|
|
29
|
+
return "ENVOYÉ";
|
|
30
|
+
default:
|
|
31
|
+
return "INTERNE";
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
var getDisplayType = function (type) {
|
|
35
|
+
if (type === "invoice") {
|
|
36
|
+
return "FACTURE";
|
|
37
|
+
}
|
|
38
|
+
return type.toUpperCase();
|
|
39
|
+
};
|
|
40
|
+
var formatDate = function (date) {
|
|
41
|
+
return date.toLocaleDateString("fr-FR", {
|
|
42
|
+
day: "2-digit",
|
|
43
|
+
month: "2-digit",
|
|
44
|
+
year: "2-digit",
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
if (type === "waiting") {
|
|
48
|
+
var documentList = Object.keys(documents);
|
|
49
|
+
return (React.createElement("div", { className: "document-card waiting", style: { cursor: onCardClick ? "pointer" : "default" }, onClick: function () { return onCardClick && onCardClick(); } },
|
|
50
|
+
React.createElement("div", { className: "document-card-left" },
|
|
51
|
+
React.createElement(OtherStatusTag, { type: "information", label: "Documents demand\u00E9s pour ce rendez-vous" }),
|
|
52
|
+
React.createElement("h3", { className: "document-card-title" }, title),
|
|
53
|
+
React.createElement("div", { className: "document-list" },
|
|
54
|
+
React.createElement("ul", null, documentList.map(function (doc, index) { return (React.createElement("li", { key: index, className: "document-label" },
|
|
55
|
+
React.createElement("span", { className: "document-bullet" }),
|
|
56
|
+
" ",
|
|
57
|
+
doc)); })))),
|
|
58
|
+
React.createElement("div", { className: "document-card-right" },
|
|
59
|
+
React.createElement(IconButton, { style: "smallFilled", iconName: "allaw-icon-document" }),
|
|
60
|
+
React.createElement("span", { className: "document-count" }, documentCount))));
|
|
61
|
+
}
|
|
62
|
+
return (React.createElement("div", { className: "document-card", onClick: function () { return onCardClick && onCardClick(); }, style: { cursor: onCardClick ? "pointer" : "default" } },
|
|
63
|
+
React.createElement("div", { className: "document-card-left" },
|
|
64
|
+
React.createElement(IconButton, { style: "largeFilled", iconName: getIconName() }),
|
|
65
|
+
React.createElement("div", { className: "document-card-info" },
|
|
66
|
+
React.createElement("span", { className: "document-card-type" }, getDisplayType(type)),
|
|
67
|
+
React.createElement(Paragraph, { text: title, variant: "semiBold", size: "default", maxLines: 1, color: "noir" }),
|
|
68
|
+
React.createElement("span", { className: "document-card-date" }, formatDate(date)))),
|
|
69
|
+
React.createElement("div", { className: "document-card-right" },
|
|
70
|
+
React.createElement(OtherStatusTag, { type: "information", label: getStatusName() }))));
|
|
71
|
+
};
|
|
72
|
+
export default DocumentCard;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DocumentCard } from "./DocumentCard";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./EmployeeCard.css";
|
|
3
|
+
export interface EmployeeCardProps {
|
|
4
|
+
name: string;
|
|
5
|
+
role: string;
|
|
6
|
+
contactNumber: string;
|
|
7
|
+
email1: string;
|
|
8
|
+
email2: string;
|
|
9
|
+
profileImage: string;
|
|
10
|
+
isVerified: boolean;
|
|
11
|
+
size: "small" | "large";
|
|
12
|
+
onEdit: () => void;
|
|
13
|
+
}
|
|
14
|
+
declare const EmployeeCard: React.FC<EmployeeCardProps>;
|
|
15
|
+
export default EmployeeCard;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./EmployeeCard.css";
|
|
3
|
+
import OtherStatusTag from "../../atoms/tags/OtherStatusTag";
|
|
4
|
+
import IconButton from "../../atoms/buttons/IconButton";
|
|
5
|
+
import Image from "next/image";
|
|
6
|
+
var NoPhoto = "/assets/NoPhoto.png";
|
|
7
|
+
var EmployeeCard = function (_a) {
|
|
8
|
+
var name = _a.name, role = _a.role, contactNumber = _a.contactNumber, email1 = _a.email1, email2 = _a.email2, profileImage = _a.profileImage, isVerified = _a.isVerified, size = _a.size, onEdit = _a.onEdit;
|
|
9
|
+
var renderProfileImage = function () { return (React.createElement("div", { className: "profile-image-container" },
|
|
10
|
+
React.createElement(Image, { src: profileImage || NoPhoto, alt: name, width: size === "small" ? 64 : 94, height: size === "small" ? 64 : 94, className: "profile-image" }),
|
|
11
|
+
isVerified && (React.createElement("span", { className: "verified-icon allaw-icon-verified" })))); };
|
|
12
|
+
var renderNameAndRole = function () { return (React.createElement("div", { className: "name-tag-container" },
|
|
13
|
+
React.createElement("h3", { className: "name" }, name),
|
|
14
|
+
React.createElement("div", { className: "role-container" },
|
|
15
|
+
React.createElement(OtherStatusTag, { label: role, type: "information" })))); };
|
|
16
|
+
var renderContactInfo = function () { return (React.createElement("div", { className: "contact-container" },
|
|
17
|
+
React.createElement("span", { className: "contact-label" }, "CONTACT"),
|
|
18
|
+
React.createElement("div", { className: "phone-email-container" },
|
|
19
|
+
React.createElement("span", { className: "phone-number" }, contactNumber),
|
|
20
|
+
React.createElement("span", { className: "email" }, email1),
|
|
21
|
+
React.createElement("span", { className: "email" }, email2)))); };
|
|
22
|
+
var renderSmallCard = function () { return (React.createElement("div", { className: "content" },
|
|
23
|
+
renderProfileImage(),
|
|
24
|
+
renderNameAndRole())); };
|
|
25
|
+
var renderLargeCard = function () { return (React.createElement(React.Fragment, null,
|
|
26
|
+
React.createElement("div", { className: "content" },
|
|
27
|
+
renderProfileImage(),
|
|
28
|
+
React.createElement("div", { className: "content-main-container" },
|
|
29
|
+
renderNameAndRole(),
|
|
30
|
+
React.createElement("div", { className: "content-container" }, renderContactInfo()))),
|
|
31
|
+
React.createElement(IconButton, { style: "largeFilled", iconName: "allaw-icon-edit-2", onClick: onEdit }))); };
|
|
32
|
+
return (React.createElement("div", { className: "employee-card ".concat(size) }, size === "small" ? renderSmallCard() : renderLargeCard()));
|
|
33
|
+
};
|
|
34
|
+
export default EmployeeCard;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as EmployeeCard } from "./EmployeeCard";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./LoadingBox.css";
|
|
3
|
+
export type LoadingBoxProps = {
|
|
4
|
+
boxHeigth: string;
|
|
5
|
+
boxWidth: string;
|
|
6
|
+
boxRadius: string;
|
|
7
|
+
};
|
|
8
|
+
declare function LoadingBox({ boxHeigth, boxWidth, boxRadius }: LoadingBoxProps): React.JSX.Element;
|
|
9
|
+
export default LoadingBox;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./LoadingBox.css";
|
|
3
|
+
function LoadingBox(_a) {
|
|
4
|
+
var boxHeigth = _a.boxHeigth, boxWidth = _a.boxWidth, boxRadius = _a.boxRadius;
|
|
5
|
+
return React.createElement("div", { className: "loading-box", style: { minHeight: boxHeigth, minWidth: boxWidth, borderRadius: boxRadius } });
|
|
6
|
+
}
|
|
7
|
+
export default LoadingBox;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as LoadingBox } from "./LoadingBox";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./ProCard.css";
|
|
3
|
+
export interface ProCardProps {
|
|
4
|
+
imageUrl?: string;
|
|
5
|
+
job: string;
|
|
6
|
+
firstName: string;
|
|
7
|
+
lastName: string;
|
|
8
|
+
address: string;
|
|
9
|
+
profileUrl: string;
|
|
10
|
+
isPro?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare const ProCard: React.FC<ProCardProps>;
|
|
13
|
+
export default ProCard;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./ProCard.css";
|
|
3
|
+
import OtherStatusTag from "../../atoms/tags/OtherStatusTag";
|
|
4
|
+
import Image from "next/image";
|
|
5
|
+
var NoPhoto = "/assets/NoPhoto.png";
|
|
6
|
+
var ProCard = function (_a) {
|
|
7
|
+
var imageUrl = _a.imageUrl, job = _a.job, firstName = _a.firstName, lastName = _a.lastName, address = _a.address, profileUrl = _a.profileUrl, _b = _a.isPro, isPro = _b === void 0 ? false : _b;
|
|
8
|
+
var uppercaseJob = job.toUpperCase();
|
|
9
|
+
return (React.createElement("div", { className: "pro-card" },
|
|
10
|
+
React.createElement("div", { className: "pro-card-content" },
|
|
11
|
+
React.createElement("div", { className: "pro-card-top" },
|
|
12
|
+
React.createElement("div", { className: "pro-card-image-container" },
|
|
13
|
+
React.createElement(Image, { src: imageUrl || NoPhoto, alt: "".concat(firstName, " ").concat(lastName), width: 74, height: 74, className: "pro-card-avatar" }),
|
|
14
|
+
isPro && (React.createElement("div", { className: "pro-card-verified-icon-container" },
|
|
15
|
+
React.createElement("div", { className: "pro-card-verified-icon-background" }),
|
|
16
|
+
React.createElement("i", { className: "icon allaw-icon-verified pro-card-verified-icon" })))),
|
|
17
|
+
React.createElement("div", { className: "pro-card-job-name" },
|
|
18
|
+
React.createElement(OtherStatusTag, { label: uppercaseJob, type: "information" }),
|
|
19
|
+
React.createElement("h3", { className: "pro-card-name" },
|
|
20
|
+
React.createElement("a", { href: profileUrl }, "".concat(firstName, " ").concat(lastName))))),
|
|
21
|
+
address && /[a-zA-Z0-9]/.test(address) && (React.createElement("div", { className: "pro-card-address" },
|
|
22
|
+
React.createElement("i", { className: "icon allaw-icon-map-pin" }),
|
|
23
|
+
React.createElement("span", null, address))))));
|
|
24
|
+
};
|
|
25
|
+
export default ProCard;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ProCard } from "./ProCard";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./RadioForm.css";
|
|
3
|
+
import "../../../styles/global.css";
|
|
4
|
+
export interface RadioFormProps {
|
|
5
|
+
label: string;
|
|
6
|
+
isRequired: boolean;
|
|
7
|
+
options: string[];
|
|
8
|
+
defaultSelected?: string;
|
|
9
|
+
onChange?: (selectedOption: string | null) => void;
|
|
10
|
+
}
|
|
11
|
+
declare const RadioForm: React.FC<RadioFormProps>;
|
|
12
|
+
export default RadioForm;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React, { useState, useEffect } from "react";
|
|
2
|
+
import "./RadioForm.css";
|
|
3
|
+
import "../../../styles/global.css";
|
|
4
|
+
import Paragraph from "../../atoms/typography/Paragraph";
|
|
5
|
+
import RadioButton from "../../atoms/radios/RadioButton";
|
|
6
|
+
var RadioForm = function (_a) {
|
|
7
|
+
var label = _a.label, isRequired = _a.isRequired, options = _a.options, defaultSelected = _a.defaultSelected, onChange = _a.onChange;
|
|
8
|
+
var _b = useState(defaultSelected || null), selectedOption = _b[0], setSelectedOption = _b[1];
|
|
9
|
+
useEffect(function () {
|
|
10
|
+
if (defaultSelected) {
|
|
11
|
+
setSelectedOption(defaultSelected);
|
|
12
|
+
}
|
|
13
|
+
}, [defaultSelected]);
|
|
14
|
+
var handleOptionChange = function (option) {
|
|
15
|
+
setSelectedOption(option);
|
|
16
|
+
if (onChange) {
|
|
17
|
+
onChange(option);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
return (React.createElement("div", { className: "radio-form" },
|
|
21
|
+
React.createElement(Paragraph, { variant: "medium", color: "noir", text: React.createElement(React.Fragment, null,
|
|
22
|
+
label,
|
|
23
|
+
" ",
|
|
24
|
+
isRequired && React.createElement("span", { className: "radio-form-required" }, "*")), size: "default" }),
|
|
25
|
+
React.createElement("div", { className: "radio-form-options" }, options.map(function (option, index) { return (React.createElement(RadioButton, { key: index, label: option, style: "hybride", isActive: selectedOption === option, onClick: function () { return handleOptionChange(option); } })); }))));
|
|
26
|
+
};
|
|
27
|
+
export default RadioForm;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as RadioForm } from "./RadioForm";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./SelectForm.css";
|
|
3
|
+
import "../../../styles/global.css";
|
|
4
|
+
import { SelectItem } from "../../atoms/selects/Select";
|
|
5
|
+
export interface SelectFormProps {
|
|
6
|
+
label: string;
|
|
7
|
+
isRequired: boolean;
|
|
8
|
+
options: SelectItem[];
|
|
9
|
+
isMultiple: boolean;
|
|
10
|
+
width?: number;
|
|
11
|
+
selectedItem?: string | string[];
|
|
12
|
+
onChange?: (selected: string | string[]) => void;
|
|
13
|
+
}
|
|
14
|
+
declare const SelectForm: React.FC<SelectFormProps>;
|
|
15
|
+
export default SelectForm;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./SelectForm.css";
|
|
3
|
+
import "../../../styles/global.css";
|
|
4
|
+
import Paragraph from "../../atoms/typography/Paragraph";
|
|
5
|
+
import Select from "../../atoms/selects/Select";
|
|
6
|
+
var SelectForm = function (_a) {
|
|
7
|
+
var label = _a.label, isRequired = _a.isRequired, options = _a.options, isMultiple = _a.isMultiple, _b = _a.width, width = _b === void 0 ? 100 : _b, selectedItem = _a.selectedItem, onChange = _a.onChange;
|
|
8
|
+
return (React.createElement("div", { className: "select-form" },
|
|
9
|
+
React.createElement(Paragraph, { variant: "medium", color: "noir", text: React.createElement(React.Fragment, null,
|
|
10
|
+
label,
|
|
11
|
+
" ",
|
|
12
|
+
isRequired && React.createElement("span", { className: "select-form-required" }, "*")), size: "default" }),
|
|
13
|
+
React.createElement(Select, { items: options, multiple: isMultiple, isRequired: isRequired, width: width, selectedItem: selectedItem, onChange: onChange })));
|
|
14
|
+
};
|
|
15
|
+
export default SelectForm;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as SelectForm } from "./SelectForm";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./Stepper.css";
|
|
3
|
+
import "../../../styles/global.css";
|
|
4
|
+
import "../../../styles/icons.css";
|
|
5
|
+
export interface StepperProps {
|
|
6
|
+
steps: number;
|
|
7
|
+
currentStep: number;
|
|
8
|
+
startIcon?: boolean[];
|
|
9
|
+
endIcon?: boolean;
|
|
10
|
+
children: React.ReactNode[];
|
|
11
|
+
secondaryButton?: {
|
|
12
|
+
show: boolean;
|
|
13
|
+
label: string;
|
|
14
|
+
startIcon?: React.ReactNode;
|
|
15
|
+
endIcon?: React.ReactNode;
|
|
16
|
+
startIconName?: string;
|
|
17
|
+
endIconName?: string;
|
|
18
|
+
onSecondaryButtonClick?: (step: number) => void;
|
|
19
|
+
}[];
|
|
20
|
+
primaryButton?: {
|
|
21
|
+
show: boolean;
|
|
22
|
+
label: string;
|
|
23
|
+
startIcon?: React.ReactNode;
|
|
24
|
+
endIcon?: React.ReactNode;
|
|
25
|
+
startIconName?: string;
|
|
26
|
+
endIconName?: string;
|
|
27
|
+
onPrimaryButtonClick?: (step: number) => void;
|
|
28
|
+
}[];
|
|
29
|
+
showProgressBar?: boolean[];
|
|
30
|
+
onClose?: () => void;
|
|
31
|
+
validateStep?: (step: number) => boolean | Promise<boolean>;
|
|
32
|
+
}
|
|
33
|
+
declare const Stepper: React.FC<StepperProps>;
|
|
34
|
+
export default Stepper;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
import React, { useState, useEffect, useCallback, useRef } from "react";
|
|
39
|
+
import ReactDOM from "react-dom";
|
|
40
|
+
import "./Stepper.css";
|
|
41
|
+
import "../../../styles/global.css";
|
|
42
|
+
import "../../../styles/icons.css";
|
|
43
|
+
import ProgressBar from "../../atoms/progressBars/ProgressBar";
|
|
44
|
+
import PrimaryButton from "../../atoms/buttons/PrimaryButton";
|
|
45
|
+
import SecondaryButton from "../../atoms/buttons/SecondaryButton";
|
|
46
|
+
var Stepper = function (_a) {
|
|
47
|
+
var steps = _a.steps, currentStep = _a.currentStep, _b = _a.startIcon, startIcon = _b === void 0 ? [] : _b, _c = _a.endIcon, endIcon = _c === void 0 ? true : _c, children = _a.children, _d = _a.secondaryButton, secondaryButton = _d === void 0 ? [] : _d, _e = _a.primaryButton, primaryButton = _e === void 0 ? [] : _e, _f = _a.showProgressBar, showProgressBar = _f === void 0 ? [] : _f, onClose = _a.onClose, validateStep = _a.validateStep;
|
|
48
|
+
var _g = useState(currentStep || 1), step = _g[0], setStep = _g[1];
|
|
49
|
+
var _h = useState(false), isVisible = _h[0], setIsVisible = _h[1];
|
|
50
|
+
var portalContainerRef = useRef(null);
|
|
51
|
+
useEffect(function () {
|
|
52
|
+
var container = document.createElement("div");
|
|
53
|
+
document.body.appendChild(container);
|
|
54
|
+
portalContainerRef.current = container;
|
|
55
|
+
setIsVisible(true);
|
|
56
|
+
return function () {
|
|
57
|
+
setIsVisible(false);
|
|
58
|
+
if (portalContainerRef.current &&
|
|
59
|
+
document.body.contains(portalContainerRef.current)) {
|
|
60
|
+
document.body.removeChild(portalContainerRef.current);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}, []);
|
|
64
|
+
useEffect(function () {
|
|
65
|
+
setStep(currentStep || 1);
|
|
66
|
+
}, [currentStep]);
|
|
67
|
+
var handleNext = useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
68
|
+
var currentPrimaryButton, isValid;
|
|
69
|
+
return __generator(this, function (_a) {
|
|
70
|
+
switch (_a.label) {
|
|
71
|
+
case 0:
|
|
72
|
+
currentPrimaryButton = primaryButton[step - 1];
|
|
73
|
+
if (currentPrimaryButton === null || currentPrimaryButton === void 0 ? void 0 : currentPrimaryButton.onPrimaryButtonClick) {
|
|
74
|
+
currentPrimaryButton.onPrimaryButtonClick(step);
|
|
75
|
+
}
|
|
76
|
+
if (!validateStep) return [3 /*break*/, 2];
|
|
77
|
+
return [4 /*yield*/, validateStep(step)];
|
|
78
|
+
case 1:
|
|
79
|
+
isValid = _a.sent();
|
|
80
|
+
if (!isValid) {
|
|
81
|
+
return [2 /*return*/];
|
|
82
|
+
}
|
|
83
|
+
_a.label = 2;
|
|
84
|
+
case 2:
|
|
85
|
+
if (step < steps) {
|
|
86
|
+
setStep(step + 1);
|
|
87
|
+
}
|
|
88
|
+
else if (step === steps && onClose) {
|
|
89
|
+
onClose();
|
|
90
|
+
}
|
|
91
|
+
return [2 /*return*/];
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}); }, [step, steps, validateStep, primaryButton, onClose]);
|
|
95
|
+
var handlePrevious = useCallback(function () {
|
|
96
|
+
if (step > 1) {
|
|
97
|
+
setStep(step - 1);
|
|
98
|
+
}
|
|
99
|
+
}, [step]);
|
|
100
|
+
var currentSecondaryButton = secondaryButton[step - 1] || {};
|
|
101
|
+
var currentPrimaryButton = primaryButton[step - 1] || {};
|
|
102
|
+
var currentShowProgressBar = showProgressBar[step - 1] !== false;
|
|
103
|
+
var currentShowStartIcon = startIcon[step - 1];
|
|
104
|
+
var handleClose = useCallback(function () {
|
|
105
|
+
setIsVisible(false);
|
|
106
|
+
if (onClose) {
|
|
107
|
+
onClose();
|
|
108
|
+
}
|
|
109
|
+
}, [onClose]);
|
|
110
|
+
var stepperContent = (React.createElement("div", { className: "stepper-overlay ".concat(isVisible ? "visible" : ""), onClick: handleClose },
|
|
111
|
+
React.createElement("div", { className: "stepper-container", onClick: function (e) { return e.stopPropagation(); } },
|
|
112
|
+
React.createElement(ProgressBar, { steps: steps, currentStep: step, startIcon: currentShowStartIcon, endIcon: endIcon, onStartIconClick: handlePrevious, onEndIconClick: handleClose, showProgressBar: currentShowProgressBar }),
|
|
113
|
+
React.createElement("div", { className: "stepper-content" }, children[step - 1]),
|
|
114
|
+
React.createElement("div", { className: "stepper-buttons ".concat(!(currentSecondaryButton === null || currentSecondaryButton === void 0 ? void 0 : currentSecondaryButton.show) && !(currentPrimaryButton === null || currentPrimaryButton === void 0 ? void 0 : currentPrimaryButton.show) ? "no-buttons" : "") },
|
|
115
|
+
(currentSecondaryButton === null || currentSecondaryButton === void 0 ? void 0 : currentSecondaryButton.show) && (React.createElement("div", { className: "stepper-button-container secondary-button-container" },
|
|
116
|
+
React.createElement(SecondaryButton, { fullWidth: true, label: currentSecondaryButton.label, startIcon: currentSecondaryButton.startIconName ? true : undefined, endIcon: currentSecondaryButton.endIconName ? true : undefined, startIconName: currentSecondaryButton.startIconName, endIconName: currentSecondaryButton.endIconName, onClick: function () { var _a; return (_a = currentSecondaryButton.onSecondaryButtonClick) === null || _a === void 0 ? void 0 : _a.call(currentSecondaryButton, step); } }))),
|
|
117
|
+
(currentPrimaryButton === null || currentPrimaryButton === void 0 ? void 0 : currentPrimaryButton.show) && (React.createElement("div", { className: "stepper-button-container primary-button-container" },
|
|
118
|
+
React.createElement(PrimaryButton, { fullWidth: true, label: currentPrimaryButton.label, startIcon: currentPrimaryButton.startIconName ? true : undefined, endIcon: currentPrimaryButton.endIconName ? true : undefined, startIconName: currentPrimaryButton.startIconName, endIconName: currentPrimaryButton.endIconName, onClick: handleNext })))))));
|
|
119
|
+
return portalContainerRef.current && isVisible
|
|
120
|
+
? ReactDOM.createPortal(stepperContent, portalContainerRef.current)
|
|
121
|
+
: null;
|
|
122
|
+
};
|
|
123
|
+
export default Stepper;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Stepper } from "./Stepper";
|