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,84 @@
|
|
|
1
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
+
if (ar || !(i in from)) {
|
|
4
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
+
ar[i] = from[i];
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
+
};
|
|
10
|
+
import React, { useState, useEffect, useRef, useImperativeHandle, forwardRef, } from "react";
|
|
11
|
+
import "./Select.css";
|
|
12
|
+
import "../../../styles/global.css";
|
|
13
|
+
import TinyInfo from "../typography/TinyInfo";
|
|
14
|
+
function Select(_a, ref) {
|
|
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 _g = useState(false), isOpen = _g[0], setIsOpen = _g[1];
|
|
18
|
+
var _h = useState((multiple ? selectedItem || [] : selectedItem || "")), selected = _h[0], setSelected = _h[1];
|
|
19
|
+
var _j = useState(""), error = _j[0], setError = _j[1];
|
|
20
|
+
var selectRef = useRef(null);
|
|
21
|
+
useEffect(function () {
|
|
22
|
+
setSelected((multiple ? selectedItem || [] : selectedItem || ""));
|
|
23
|
+
}, [selectedItem, multiple]);
|
|
24
|
+
var handleSelect = function (item) {
|
|
25
|
+
var newSelected;
|
|
26
|
+
if (multiple) {
|
|
27
|
+
newSelected = (Array.isArray(selected)
|
|
28
|
+
? selected.includes(item.value)
|
|
29
|
+
? selected.filter(function (i) { return i !== item.value; })
|
|
30
|
+
: __spreadArray(__spreadArray([], selected, true), [item.value], false)
|
|
31
|
+
: [item.value]);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
newSelected = item.value;
|
|
35
|
+
setIsOpen(false);
|
|
36
|
+
}
|
|
37
|
+
setSelected(newSelected);
|
|
38
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newSelected);
|
|
39
|
+
validateSelect(newSelected);
|
|
40
|
+
};
|
|
41
|
+
var validateSelect = function (value) {
|
|
42
|
+
var isEmpty = value === "" || (Array.isArray(value) && value.length === 0);
|
|
43
|
+
var errorMessage = isRequired && isEmpty ? "Ce champ est requis" : "";
|
|
44
|
+
setError(errorMessage);
|
|
45
|
+
onError === null || onError === void 0 ? void 0 : onError(errorMessage);
|
|
46
|
+
return !errorMessage;
|
|
47
|
+
};
|
|
48
|
+
var toggleOpen = function () {
|
|
49
|
+
setIsOpen(!isOpen);
|
|
50
|
+
};
|
|
51
|
+
var handleClickOutside = function (event) {
|
|
52
|
+
if (selectRef.current &&
|
|
53
|
+
!selectRef.current.contains(event.target)) {
|
|
54
|
+
setIsOpen(false);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
useEffect(function () {
|
|
58
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
59
|
+
return function () {
|
|
60
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
61
|
+
};
|
|
62
|
+
}, []);
|
|
63
|
+
useImperativeHandle(ref, function () { return ({
|
|
64
|
+
validate: function () { return validateSelect(selected); },
|
|
65
|
+
}); });
|
|
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 },
|
|
68
|
+
React.createElement("span", { className: "select-text" }, Array.isArray(selected) && selected.length > 0
|
|
69
|
+
? selected
|
|
70
|
+
.map(function (val) { var _a; return (_a = items.find(function (item) { return item.value === val; })) === null || _a === void 0 ? void 0 : _a.label; })
|
|
71
|
+
.join(", ")
|
|
72
|
+
: !Array.isArray(selected) && selected
|
|
73
|
+
? (_b = items.find(function (item) { return item.value === selected; })) === null || _b === void 0 ? void 0 : _b.label
|
|
74
|
+
: placeholder),
|
|
75
|
+
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)
|
|
77
|
+
? "selected"
|
|
78
|
+
: "", " ").concat(!multiple ? "single-select" : ""), onClick: function () { return handleSelect(item); } },
|
|
79
|
+
multiple && (React.createElement("span", { className: "select-item-icon allaw-icon-check" })),
|
|
80
|
+
React.createElement("span", { className: "select-item-text" }, item.label))); }))),
|
|
81
|
+
isRequired && showError && error && (React.createElement("div", { className: "error-message" },
|
|
82
|
+
React.createElement(TinyInfo, { variant: "medium12", color: "actions-error", text: error })))));
|
|
83
|
+
}
|
|
84
|
+
export default forwardRef(Select);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Select";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./AppointementStatusTag.css";
|
|
3
|
+
export interface AppointementStatusTagProps {
|
|
4
|
+
status: "confirmed" | "pending" | "available" | "unavailable" | "cancelled" | "passed" | "refused";
|
|
5
|
+
variant?: "default" | "big";
|
|
6
|
+
}
|
|
7
|
+
declare const AppointementStatusTag: ({ status, variant, }: AppointementStatusTagProps) => React.JSX.Element;
|
|
8
|
+
export default AppointementStatusTag;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./AppointementStatusTag.css";
|
|
3
|
+
var statusStyles = {
|
|
4
|
+
confirmed: "status-confirmed",
|
|
5
|
+
pending: "status-pending",
|
|
6
|
+
available: "status-available",
|
|
7
|
+
unavailable: "status-unavailable",
|
|
8
|
+
cancelled: "status-cancelled",
|
|
9
|
+
passed: "status-passed",
|
|
10
|
+
refused: "status-refused",
|
|
11
|
+
};
|
|
12
|
+
var statusLabels = {
|
|
13
|
+
confirmed: "CONFIRMÉ",
|
|
14
|
+
pending: "EN ATTENTE",
|
|
15
|
+
available: "DISPONIBLE",
|
|
16
|
+
unavailable: "INDISPONIBLE",
|
|
17
|
+
cancelled: "ANNULÉ",
|
|
18
|
+
passed: "PASSÉ",
|
|
19
|
+
refused: "REFUSÉ",
|
|
20
|
+
};
|
|
21
|
+
var variantLabels = {
|
|
22
|
+
confirmed: "RDV CONFIRMÉ",
|
|
23
|
+
passed: "RDV PASSÉ",
|
|
24
|
+
cancelled: "RDV ANNULÉ",
|
|
25
|
+
};
|
|
26
|
+
var variantStyles = {
|
|
27
|
+
big: "variant-big",
|
|
28
|
+
default: "variant-default",
|
|
29
|
+
};
|
|
30
|
+
var AppointementStatusTag = function (_a) {
|
|
31
|
+
var status = _a.status, _b = _a.variant, variant = _b === void 0 ? "default" : _b;
|
|
32
|
+
var label = variant === "big" && variantLabels[status]
|
|
33
|
+
? variantLabels[status]
|
|
34
|
+
: statusLabels[status];
|
|
35
|
+
var variantClass = variantStyles[variant];
|
|
36
|
+
var specificStyles = status === "cancelled" && variant === "big"
|
|
37
|
+
? "status-cancelled-big"
|
|
38
|
+
: statusStyles[status];
|
|
39
|
+
return (React.createElement("span", { className: "appointement-status-tag ".concat(variantClass, " ").concat(specificStyles) }, label));
|
|
40
|
+
};
|
|
41
|
+
export default AppointementStatusTag;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./FolderStatusTag.css";
|
|
3
|
+
var FolderStatusTag = function (_a) {
|
|
4
|
+
var _b = _a.isClosed, isClosed = _b === void 0 ? false : _b;
|
|
5
|
+
var label = isClosed ? "DOSSIER CLÔS" : "DOSSIER OUVERT";
|
|
6
|
+
return (React.createElement("div", { className: "folder-status-tag ".concat(isClosed ? "closed" : "open") }, label));
|
|
7
|
+
};
|
|
8
|
+
export default FolderStatusTag;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./OtherStatusTag.css";
|
|
3
|
+
export interface OtherStatusTagProps {
|
|
4
|
+
label?: string;
|
|
5
|
+
type?: "readonly" | "editable" | "information";
|
|
6
|
+
startIcon?: boolean;
|
|
7
|
+
startIconName?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const OtherStatusTag: React.FC<OtherStatusTagProps>;
|
|
10
|
+
export default OtherStatusTag;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./OtherStatusTag.css";
|
|
3
|
+
var OtherStatusTag = function (_a) {
|
|
4
|
+
var _b = _a.label, label = _b === void 0 ? "Tags" : _b, _c = _a.type, type = _c === void 0 ? "readonly" : _c, _d = _a.startIcon, startIcon = _d === void 0 ? false : _d, _e = _a.startIconName, startIconName = _e === void 0 ? "allaw-icon-pmr" : _e;
|
|
5
|
+
return (React.createElement("div", { className: "other-status-tag ".concat(type) },
|
|
6
|
+
type === "information" && startIcon && (React.createElement("span", { className: "icon ".concat(startIconName) })),
|
|
7
|
+
label,
|
|
8
|
+
type === "editable" && React.createElement("span", { className: "icon allaw-icon-close" })));
|
|
9
|
+
};
|
|
10
|
+
export default OtherStatusTag;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as AppointementStatusTag } from "./AppointementStatusTag";
|
|
2
|
+
export { default as FolderStatusTag } from "./FolderStatusTag";
|
|
3
|
+
export { default as OtherStatusTag } from "./OtherStatusTag";
|
|
4
|
+
export type { AppointementStatusTagProps } from "./AppointementStatusTag";
|
|
5
|
+
export type { FolderStatusTagProps } from "./FolderStatusTag";
|
|
6
|
+
export type { OtherStatusTagProps } from "./OtherStatusTag";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./Heading.css";
|
|
3
|
+
export interface HeadingProps {
|
|
4
|
+
variant: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "h7";
|
|
5
|
+
color?: "bleu-allaw" | "mid-grey" | "dark-grey" | "noir" | "pure-white";
|
|
6
|
+
text: React.ReactNode;
|
|
7
|
+
align?: "left" | "justify" | "center";
|
|
8
|
+
}
|
|
9
|
+
declare const Heading: React.FC<HeadingProps>;
|
|
10
|
+
export default Heading;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./Heading.css";
|
|
3
|
+
var Heading = function (_a) {
|
|
4
|
+
var variant = _a.variant, _b = _a.color, color = _b === void 0 ? "pure-white" : _b, text = _a.text, _c = _a.align, align = _c === void 0 ? "center" : _c;
|
|
5
|
+
return React.createElement("span", { className: "heading ".concat(variant, " color-").concat(color, " align-").concat(align) }, text);
|
|
6
|
+
};
|
|
7
|
+
export default Heading;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./Paragraph.css";
|
|
3
|
+
export interface ParagraphProps {
|
|
4
|
+
variant: "bold" | "semiBold" | "medium";
|
|
5
|
+
color?: "bleu-allaw" | "mid-grey" | "dark-grey" | "noir" | "pure-white" | "grey-venom" | "venom-grey-dark";
|
|
6
|
+
text: React.ReactNode;
|
|
7
|
+
maxLines?: number;
|
|
8
|
+
maxChars?: number;
|
|
9
|
+
size?: "default" | "small";
|
|
10
|
+
}
|
|
11
|
+
declare const Paragraph: React.FC<ParagraphProps>;
|
|
12
|
+
export default Paragraph;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./Paragraph.css";
|
|
3
|
+
var Paragraph = function (_a) {
|
|
4
|
+
var variant = _a.variant, color = _a.color, text = _a.text, maxLines = _a.maxLines, maxChars = _a.maxChars, _b = _a.size, size = _b === void 0 ? "default" : _b;
|
|
5
|
+
// Fonction pour tronquer le texte en fonction du nombre maximum de caractères
|
|
6
|
+
var truncateText = function (text, maxChars) {
|
|
7
|
+
if (text.length <= maxChars)
|
|
8
|
+
return text;
|
|
9
|
+
return text.slice(0, maxChars) + "...";
|
|
10
|
+
};
|
|
11
|
+
// Tronquer le texte si maxChars est défini
|
|
12
|
+
var truncatedText = maxChars
|
|
13
|
+
? truncateText(text, maxChars)
|
|
14
|
+
: text;
|
|
15
|
+
return (React.createElement("p", { className: "paragraph ".concat(variant, " ").concat(color ? "color-".concat(color) : "", " ").concat(size === "small" ? "paragraph-small" : ""), style: maxLines
|
|
16
|
+
? {
|
|
17
|
+
WebkitLineClamp: maxLines,
|
|
18
|
+
display: "-webkit-box",
|
|
19
|
+
WebkitBoxOrient: "vertical",
|
|
20
|
+
overflow: "hidden",
|
|
21
|
+
}
|
|
22
|
+
: {} }, truncatedText));
|
|
23
|
+
};
|
|
24
|
+
export default Paragraph;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./SmallTitle.css";
|
|
3
|
+
export interface SmallTitleProps {
|
|
4
|
+
variant: "bold20" | "medium32" | "semiBold12" | "medium12";
|
|
5
|
+
color?: "bleu-allaw" | "mid-grey" | "dark-grey" | "noir" | "pure-white";
|
|
6
|
+
text: string;
|
|
7
|
+
}
|
|
8
|
+
declare const SmallTitle: React.FC<SmallTitleProps>;
|
|
9
|
+
export default SmallTitle;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./SmallTitle.css";
|
|
3
|
+
var SmallTitle = function (_a) {
|
|
4
|
+
var variant = _a.variant, _b = _a.color, color = _b === void 0 ? "noir" : _b, text = _a.text;
|
|
5
|
+
return (React.createElement("p", { className: "small-title ".concat(variant, " ").concat(color ? "color-".concat(color) : ""), dangerouslySetInnerHTML: { __html: text } }));
|
|
6
|
+
};
|
|
7
|
+
export default SmallTitle;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./Subtitle.css";
|
|
3
|
+
export interface SubtitleProps {
|
|
4
|
+
variant: "bold" | "medium";
|
|
5
|
+
color?: "bleu-allaw" | "mid-grey" | "dark-grey" | "noir" | "pure-white";
|
|
6
|
+
text: string;
|
|
7
|
+
}
|
|
8
|
+
declare const Subtitle: React.FC<SubtitleProps>;
|
|
9
|
+
export default Subtitle;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./Subtitle.css";
|
|
3
|
+
var Subtitle = function (_a) {
|
|
4
|
+
var variant = _a.variant, color = _a.color, text = _a.text;
|
|
5
|
+
return (React.createElement("p", { className: "subtitle ".concat(variant, " ").concat(color ? "color-".concat(color) : ""), dangerouslySetInnerHTML: { __html: text } }));
|
|
6
|
+
};
|
|
7
|
+
export default Subtitle;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./TinyInfo.css";
|
|
3
|
+
export interface TinyInfoProps {
|
|
4
|
+
variant: "bold14" | "medium14" | "semiBold12" | "medium12";
|
|
5
|
+
color?: "bleu-allaw" | "mid-grey" | "dark-grey" | "noir" | "pure-white" | "actions-error";
|
|
6
|
+
text: string;
|
|
7
|
+
href?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
uppercase?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const TinyInfo: React.FC<TinyInfoProps>;
|
|
12
|
+
export default TinyInfo;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./TinyInfo.css";
|
|
3
|
+
var toUpperCaseWithAccents = function (str) {
|
|
4
|
+
return str.replace(/[a-zàáâãäåçèéêëìíîïñòóôõöùúûü]/g, function (letter) {
|
|
5
|
+
return letter.toLocaleUpperCase();
|
|
6
|
+
});
|
|
7
|
+
};
|
|
8
|
+
var TinyInfo = function (_a) {
|
|
9
|
+
var variant = _a.variant, _b = _a.color, color = _b === void 0 ? "noir" : _b, text = _a.text, href = _a.href, className = _a.className, _c = _a.uppercase, uppercase = _c === void 0 ? false : _c;
|
|
10
|
+
var processedText = uppercase ? toUpperCaseWithAccents(text) : text;
|
|
11
|
+
var content = (React.createElement("span", { className: "tiny-info ".concat(variant, " ").concat(color ? "color-".concat(color) : "", " ").concat(className || ""), dangerouslySetInnerHTML: { __html: processedText } }));
|
|
12
|
+
return href ? (React.createElement("a", { href: href, className: "tiny-info-link ".concat(className || "") }, content)) : (content);
|
|
13
|
+
};
|
|
14
|
+
export default TinyInfo;
|
|
15
|
+
TinyInfo.displayName = "TinyInfo";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { default as Heading } from "./Heading";
|
|
2
|
+
export { default as Paragraph } from "./Paragraph";
|
|
3
|
+
export { default as SmallTitle } from "./SmallTitle";
|
|
4
|
+
export { default as Subtitle } from "./Subtitle";
|
|
5
|
+
export { default as TinyInfo } from "./TinyInfo";
|
|
6
|
+
export type { HeadingProps } from "./Heading";
|
|
7
|
+
export type { ParagraphProps } from "./Paragraph";
|
|
8
|
+
export type { SmallTitleProps } from "./SmallTitle";
|
|
9
|
+
export type { SubtitleProps } from "./Subtitle";
|
|
10
|
+
export type { TinyInfoProps } from "./TinyInfo";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "../../../styles/ui-variables/border-radius.css";
|
|
3
|
+
import "./BorderRadiusExample.css";
|
|
4
|
+
import "../../../styles/global.css";
|
|
5
|
+
var BorderRadius = function () {
|
|
6
|
+
return (React.createElement("div", null,
|
|
7
|
+
React.createElement("div", { className: "example-card", style: { borderRadius: "var(--border-radius-card)" } }, "Card - 16px"),
|
|
8
|
+
React.createElement("div", { className: "example-button", style: { borderRadius: "var(--border-radius-buttons)" } }, "Button - 100px"),
|
|
9
|
+
React.createElement("div", { className: "example-tag", style: { borderRadius: "var(--border-radius-tags)" } }, "Tag - 8px"),
|
|
10
|
+
React.createElement("div", { className: "example-input", style: { borderRadius: "var(--border-radius-inputs)" } }, "Input - 8px")));
|
|
11
|
+
};
|
|
12
|
+
export default BorderRadius;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "../../../styles/global.css";
|
|
3
|
+
import "../../../styles/ui-variables/shadows.css";
|
|
4
|
+
import "./ShadowsExample.css";
|
|
5
|
+
var Shadows = function () {
|
|
6
|
+
return (React.createElement("div", null,
|
|
7
|
+
React.createElement("div", { className: "example-card", style: { boxShadow: "var(--shadow-cartes-rdv)" } }, "Cartes RDV"),
|
|
8
|
+
React.createElement("div", { className: "example-nav-bar", style: { boxShadow: "var(--shadow-nav-bar)" } }, "Nav_bar_shadow"),
|
|
9
|
+
React.createElement("div", { className: "example-carte-pro", style: { boxShadow: "var(--shadow-carte-pro)" } }, "Carte pro - Blue Shadow")));
|
|
10
|
+
};
|
|
11
|
+
export default Shadows;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "../../../styles/global.css";
|
|
3
|
+
import "../../../styles/ui-variables/stroke.css";
|
|
4
|
+
import "./StrokesExample.css";
|
|
5
|
+
var Strokes = function () {
|
|
6
|
+
return (React.createElement("div", null,
|
|
7
|
+
React.createElement("div", { className: "example-stroke-default" }, "#25BEEB, 2px"),
|
|
8
|
+
React.createElement("div", { className: "example-stroke-active" }, "#CFD5D8, 2px")));
|
|
9
|
+
};
|
|
10
|
+
export default Strokes;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./AppointmentSlot.css";
|
|
3
|
+
type AppointmentStatus = "pending" | "available" | "cancelled" | "passed" | "refused" | "confirmed" | "unavailable" | "summary";
|
|
4
|
+
export interface AppointmentSlotProps {
|
|
5
|
+
status: AppointmentStatus;
|
|
6
|
+
startTime: string;
|
|
7
|
+
endTime: string;
|
|
8
|
+
date?: string;
|
|
9
|
+
clientName?: string;
|
|
10
|
+
appointmentContent?: string;
|
|
11
|
+
tags?: string[];
|
|
12
|
+
noteCount?: string;
|
|
13
|
+
documentCount?: string;
|
|
14
|
+
actions?: {
|
|
15
|
+
onApprove?: () => void;
|
|
16
|
+
onReject?: () => void;
|
|
17
|
+
onMakeUnavailable?: () => void;
|
|
18
|
+
onEdit?: () => void;
|
|
19
|
+
onViewDocument?: () => void;
|
|
20
|
+
};
|
|
21
|
+
isEditable?: boolean;
|
|
22
|
+
appointmentDetails?: string;
|
|
23
|
+
}
|
|
24
|
+
declare const AppointmentSlot: React.FC<AppointmentSlotProps>;
|
|
25
|
+
export default AppointmentSlot;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import React, { useState, useCallback } from "react";
|
|
2
|
+
import "./AppointmentSlot.css";
|
|
3
|
+
import AppointementStatusTag from "../../atoms/tags/AppointementStatusTag";
|
|
4
|
+
import OtherStatusTag from "../../atoms/tags/OtherStatusTag";
|
|
5
|
+
import ActionCircleButton from "../../atoms/buttons/ActionCircleButton";
|
|
6
|
+
import IconButton from "../../atoms/buttons/IconButton";
|
|
7
|
+
var AppointmentSlot = function (_a) {
|
|
8
|
+
var status = _a.status, startTime = _a.startTime, endTime = _a.endTime, date = _a.date, clientName = _a.clientName, appointmentContent = _a.appointmentContent, tags = _a.tags, noteCount = _a.noteCount, documentCount = _a.documentCount, actions = _a.actions;
|
|
9
|
+
var _b = useState(false), isActive = _b[0], setIsActive = _b[1];
|
|
10
|
+
// Handlers
|
|
11
|
+
var handleApprove = useCallback(function () {
|
|
12
|
+
var _a;
|
|
13
|
+
console.log("Approved!");
|
|
14
|
+
(_a = actions === null || actions === void 0 ? void 0 : actions.onApprove) === null || _a === void 0 ? void 0 : _a.call(actions);
|
|
15
|
+
}, [actions]);
|
|
16
|
+
var handleReject = useCallback(function () {
|
|
17
|
+
var _a;
|
|
18
|
+
console.log("Refused!");
|
|
19
|
+
(_a = actions === null || actions === void 0 ? void 0 : actions.onReject) === null || _a === void 0 ? void 0 : _a.call(actions);
|
|
20
|
+
}, [actions]);
|
|
21
|
+
var handleMouseDown = function (e) {
|
|
22
|
+
if (!isClickableElement(e.target)) {
|
|
23
|
+
setIsActive(true);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
var handleMouseUp = function () {
|
|
27
|
+
setIsActive(false);
|
|
28
|
+
};
|
|
29
|
+
var handleClick = function (e) {
|
|
30
|
+
if (!isClickableElement(e.target)) {
|
|
31
|
+
console.log("card clicked");
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
// Helper function
|
|
35
|
+
var isClickableElement = function (element) {
|
|
36
|
+
return (element.closest(".action-button-container, .document-actions, button") !==
|
|
37
|
+
null);
|
|
38
|
+
};
|
|
39
|
+
// Render functions
|
|
40
|
+
var renderHeader = function () { return (React.createElement("div", { className: "appointment-header" },
|
|
41
|
+
React.createElement("span", { className: "appointment-time" }, "".concat(startTime, " - ").concat(endTime)),
|
|
42
|
+
status !== "summary" && (React.createElement(AppointementStatusTag, { status: status })))); };
|
|
43
|
+
var renderFooter = function () {
|
|
44
|
+
if (status === "available") {
|
|
45
|
+
return renderAvailableFooter();
|
|
46
|
+
}
|
|
47
|
+
if (status === "summary") {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
if (status !== "unavailable") {
|
|
51
|
+
return renderDefaultFooter();
|
|
52
|
+
}
|
|
53
|
+
return null;
|
|
54
|
+
};
|
|
55
|
+
var renderAvailableFooter = function () { return (React.createElement("div", { className: "appointment-footer" },
|
|
56
|
+
React.createElement("div", { className: "action-button-container", onClick: actions === null || actions === void 0 ? void 0 : actions.onMakeUnavailable },
|
|
57
|
+
React.createElement("div", { className: "icon-close-container" },
|
|
58
|
+
React.createElement("i", { className: "allaw-icon-close" })),
|
|
59
|
+
React.createElement("span", { className: "make-unavailable-text" }, "Rendre indisponible")))); };
|
|
60
|
+
var renderDefaultFooter = function () { return (React.createElement("div", { className: "appointment-footer" },
|
|
61
|
+
React.createElement("div", { className: "footer-left" },
|
|
62
|
+
clientName && React.createElement("div", { className: "client-name" }, clientName),
|
|
63
|
+
appointmentContent && (React.createElement("div", { className: "appointment-content" }, appointmentContent)),
|
|
64
|
+
renderTags()),
|
|
65
|
+
renderActionButtons())); };
|
|
66
|
+
var renderTags = function () {
|
|
67
|
+
return tags && (React.createElement("div", { className: "tags-container" }, tags.map(function (tag, index) { return (React.createElement(OtherStatusTag, { key: index, label: tag })); })));
|
|
68
|
+
};
|
|
69
|
+
var renderActionButtons = function () {
|
|
70
|
+
switch (status) {
|
|
71
|
+
case "pending":
|
|
72
|
+
return (React.createElement("div", { className: "action-button-container" },
|
|
73
|
+
React.createElement(ActionCircleButton, { status: "dual", onApprove: handleApprove, onReject: handleReject })));
|
|
74
|
+
case "confirmed":
|
|
75
|
+
return (React.createElement("div", { className: "document-actions" },
|
|
76
|
+
React.createElement(IconButton, { style: "smallFilled", iconName: "allaw-icon-document", onClick: actions === null || actions === void 0 ? void 0 : actions.onViewDocument }),
|
|
77
|
+
documentCount && (React.createElement("span", { className: "document-count" }, documentCount))));
|
|
78
|
+
case "passed":
|
|
79
|
+
return (React.createElement("div", { className: "document-actions" },
|
|
80
|
+
React.createElement(IconButton, { style: "smallFilled", iconName: "allaw-icon-edit-2", onClick: actions === null || actions === void 0 ? void 0 : actions.onEdit }),
|
|
81
|
+
noteCount && React.createElement("span", { className: "note-count" }, noteCount),
|
|
82
|
+
React.createElement(IconButton, { style: "smallFilled", iconName: "allaw-icon-document", onClick: actions === null || actions === void 0 ? void 0 : actions.onViewDocument }),
|
|
83
|
+
documentCount && (React.createElement("span", { className: "document-count" }, documentCount))));
|
|
84
|
+
default:
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
if (status === "summary") {
|
|
89
|
+
return (React.createElement("div", { className: "appointment-slot-summary" },
|
|
90
|
+
React.createElement("div", { className: "appointment-header" },
|
|
91
|
+
React.createElement("div", { className: "date-time-container" },
|
|
92
|
+
React.createElement("span", { className: "summary-date" }, date),
|
|
93
|
+
React.createElement("span", { className: "summary-time" }, "".concat(startTime, " - ").concat(endTime))),
|
|
94
|
+
React.createElement(IconButton, { style: "largeFilled", iconName: "allaw-icon-edit-2", onClick: actions === null || actions === void 0 ? void 0 : actions.onEdit })),
|
|
95
|
+
React.createElement("div", { className: "appointment-footer" },
|
|
96
|
+
React.createElement("div", { className: "appointment-content-container" },
|
|
97
|
+
React.createElement("div", { className: "client-name" }, clientName),
|
|
98
|
+
React.createElement("div", { className: "appointment-content" }, appointmentContent),
|
|
99
|
+
renderTags()),
|
|
100
|
+
React.createElement("div", { className: "document-actions-container" },
|
|
101
|
+
React.createElement("div", { className: "document-actions" },
|
|
102
|
+
React.createElement(IconButton, { style: "smallFilled", iconName: "allaw-icon-document", onClick: actions === null || actions === void 0 ? void 0 : actions.onViewDocument }),
|
|
103
|
+
documentCount && (React.createElement("span", { className: "document-count" }, documentCount)))))));
|
|
104
|
+
}
|
|
105
|
+
return (React.createElement("div", { className: "appointment-slot ".concat(status, " ").concat(isActive ? "active" : ""), onMouseDown: handleMouseDown, onMouseUp: handleMouseUp, onMouseLeave: handleMouseUp, onClick: handleClick },
|
|
106
|
+
renderHeader(),
|
|
107
|
+
renderFooter()));
|
|
108
|
+
};
|
|
109
|
+
export default AppointmentSlot;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as AppointmentSlot } from "./AppointmentSlot";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./Breadcrumb.css";
|
|
3
|
+
export interface BreadcrumbItem {
|
|
4
|
+
key: number;
|
|
5
|
+
label: string;
|
|
6
|
+
link: string;
|
|
7
|
+
}
|
|
8
|
+
export interface BreadcrumbProps {
|
|
9
|
+
items: BreadcrumbItem[];
|
|
10
|
+
}
|
|
11
|
+
declare const Breadcrumb: React.FC<BreadcrumbProps>;
|
|
12
|
+
export default Breadcrumb;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./Breadcrumb.css";
|
|
3
|
+
import TinyInfo from "../../atoms/typography/TinyInfo";
|
|
4
|
+
var Breadcrumb = function (_a) {
|
|
5
|
+
var items = _a.items;
|
|
6
|
+
return (React.createElement("nav", { className: "breadcrumb" }, items.map(function (item, index) { return (React.createElement(React.Fragment, { key: item.key },
|
|
7
|
+
index > 0 && (React.createElement("span", { className: "breadcrumb-separator" },
|
|
8
|
+
React.createElement("i", { className: "allaw-icon-chevron-right" }))),
|
|
9
|
+
React.createElement("a", { href: item.link, className: "breadcrumb-link" },
|
|
10
|
+
React.createElement(TinyInfo, { variant: "medium14", color: index === items.length - 1 ? "dark-grey" : "mid-grey", text: item.label })))); })));
|
|
11
|
+
};
|
|
12
|
+
export default Breadcrumb;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Breadcrumb } from "./Breadcrumb";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./CaseCard.css";
|
|
3
|
+
export interface CaseCardProps {
|
|
4
|
+
clientName: string;
|
|
5
|
+
title: string;
|
|
6
|
+
nextAppointment?: {
|
|
7
|
+
date: string;
|
|
8
|
+
time?: string;
|
|
9
|
+
};
|
|
10
|
+
categories: string[];
|
|
11
|
+
variant: "desktop" | "mobile" | "archived";
|
|
12
|
+
}
|
|
13
|
+
declare const CaseCard: React.FC<CaseCardProps>;
|
|
14
|
+
export default CaseCard;
|