allaw-ui 1.0.1 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/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/CardDate.d.ts +8 -0
- package/dist/components/atoms/typography/CardDate.js +37 -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/cardDate.css +38 -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.css +31 -43
- package/dist/components/molecules/caseCard/CaseCard.d.ts +14 -0
- package/dist/components/molecules/caseCard/CaseCard.js +16 -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,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./ActionCircleButton.css";
|
|
3
|
+
interface ActionCircleButtonProps {
|
|
4
|
+
status: "approved" | "rejected" | "dual";
|
|
5
|
+
onApprove?: () => void;
|
|
6
|
+
onReject?: () => void;
|
|
7
|
+
}
|
|
8
|
+
declare const ActionCircleButton: React.FC<ActionCircleButtonProps>;
|
|
9
|
+
export default ActionCircleButton;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./ActionCircleButton.css";
|
|
3
|
+
var ActionCircleButton = function (_a) {
|
|
4
|
+
var status = _a.status, onApprove = _a.onApprove, onReject = _a.onReject;
|
|
5
|
+
if (status === "approved") {
|
|
6
|
+
return (React.createElement("button", { className: "approved-circle", onClick: onApprove },
|
|
7
|
+
React.createElement("span", { className: "allaw-icon-check approved-icon" })));
|
|
8
|
+
}
|
|
9
|
+
if (status === "rejected") {
|
|
10
|
+
return (React.createElement("button", { className: "rejected-circle", onClick: onReject },
|
|
11
|
+
React.createElement("span", { className: "allaw-icon-close rejected-icon" })));
|
|
12
|
+
}
|
|
13
|
+
if (status === "dual") {
|
|
14
|
+
return (React.createElement("div", { className: "dual-button" },
|
|
15
|
+
React.createElement("button", { className: "dual-rejected-icon", onClick: onReject },
|
|
16
|
+
React.createElement("span", { className: "allaw-icon-close" })),
|
|
17
|
+
React.createElement("span", { className: "separator" }),
|
|
18
|
+
React.createElement("button", { className: "dual-approved-icon", onClick: onApprove },
|
|
19
|
+
React.createElement("span", { className: "allaw-icon-check" }))));
|
|
20
|
+
}
|
|
21
|
+
return null;
|
|
22
|
+
};
|
|
23
|
+
export default ActionCircleButton;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./AgendaSlot.css";
|
|
3
|
+
interface AgendaSlotProps {
|
|
4
|
+
time: string;
|
|
5
|
+
appearance: "pro" | "hybride" | "user";
|
|
6
|
+
isDisabled?: boolean;
|
|
7
|
+
onClick?: () => void;
|
|
8
|
+
}
|
|
9
|
+
declare const AgendaSlot: React.FC<AgendaSlotProps>;
|
|
10
|
+
export default AgendaSlot;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./AgendaSlot.css";
|
|
3
|
+
var AgendaSlot = function (_a) {
|
|
4
|
+
var time = _a.time, appearance = _a.appearance, _b = _a.isDisabled, isDisabled = _b === void 0 ? false : _b, onClick = _a.onClick;
|
|
5
|
+
return (React.createElement("div", { className: "agenda-slot ".concat(appearance, " ").concat(isDisabled ? "disabled" : ""), onClick: !isDisabled ? onClick : undefined }, time));
|
|
6
|
+
};
|
|
7
|
+
export default AgendaSlot;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./FavoriteToggle.css";
|
|
3
|
+
export interface FavoriteToggleProps {
|
|
4
|
+
isFavorite: boolean;
|
|
5
|
+
onToggle: (isFavorite: boolean) => void;
|
|
6
|
+
}
|
|
7
|
+
declare const FavoriteToggle: React.FC<FavoriteToggleProps>;
|
|
8
|
+
export default FavoriteToggle;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./FavoriteToggle.css";
|
|
3
|
+
var FavoriteToggle = function (_a) {
|
|
4
|
+
var isFavorite = _a.isFavorite, onToggle = _a.onToggle;
|
|
5
|
+
var handleToggle = function () {
|
|
6
|
+
onToggle(!isFavorite);
|
|
7
|
+
};
|
|
8
|
+
return (React.createElement("div", { className: "favorite-toggle", onClick: handleToggle },
|
|
9
|
+
React.createElement("i", { className: "icon ".concat(isFavorite ? "favorite allaw-icon-star-fill" : "not-favorite allaw-icon-star-unfill") })));
|
|
10
|
+
};
|
|
11
|
+
export default FavoriteToggle;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./FilterButton.css";
|
|
3
|
+
import "../../../styles/global.css";
|
|
4
|
+
export interface FilterButtonProps {
|
|
5
|
+
label: string;
|
|
6
|
+
isActive: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const FilterButton: React.FC<FilterButtonProps>;
|
|
9
|
+
export default FilterButton;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./FilterButton.css";
|
|
3
|
+
import "../../../styles/global.css";
|
|
4
|
+
var FilterButton = function (_a) {
|
|
5
|
+
var label = _a.label, isActive = _a.isActive;
|
|
6
|
+
return (React.createElement("button", { className: "filter-button ".concat(isActive ? "filter-button-active" : "filter-button-inactive") },
|
|
7
|
+
React.createElement("span", { className: "filter-button-label" }, label)));
|
|
8
|
+
};
|
|
9
|
+
export default FilterButton;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type FilterButtonPrimaryProps = {
|
|
3
|
+
onClick: any;
|
|
4
|
+
zIndex?: string;
|
|
5
|
+
children: any;
|
|
6
|
+
props?: any;
|
|
7
|
+
};
|
|
8
|
+
declare function FilterButtonPrimary({ onClick, zIndex, children, ...props }: FilterButtonPrimaryProps | any): React.JSX.Element;
|
|
9
|
+
export default FilterButtonPrimary;
|
|
@@ -0,0 +1,46 @@
|
|
|
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 React from "react";
|
|
24
|
+
function FilterButtonPrimary(_a) {
|
|
25
|
+
var onClick = _a.onClick, _b = _a.zIndex, zIndex = _b === void 0 ? "100" : _b, children = _a.children, props = __rest(_a, ["onClick", "zIndex", "children"]);
|
|
26
|
+
return (React.createElement("button", __assign({ style: {
|
|
27
|
+
fontWeight: "600",
|
|
28
|
+
backgroundColor: "var(--primary-light-grey, #F4F7FB)",
|
|
29
|
+
padding: "10px",
|
|
30
|
+
borderRadius: "5px",
|
|
31
|
+
fontSize: "14px",
|
|
32
|
+
textWrap: "nowrap",
|
|
33
|
+
border: "1px solid var(--primary-venom-grey, #E6EDF5)",
|
|
34
|
+
position: "sticky",
|
|
35
|
+
color: "#000",
|
|
36
|
+
display: "flex",
|
|
37
|
+
cursor: "pointer",
|
|
38
|
+
flexDirection: "row",
|
|
39
|
+
gap: "0.5rem",
|
|
40
|
+
alignItems: "center",
|
|
41
|
+
zIndex: zIndex,
|
|
42
|
+
}, onClick: function () { return onClick && onClick(); } }, props),
|
|
43
|
+
React.createElement("i", { className: "allaw-icon-filter", style: { fontSize: "14px", color: "#25BEEB" } }),
|
|
44
|
+
children));
|
|
45
|
+
}
|
|
46
|
+
export default FilterButtonPrimary;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./GhostButton.css";
|
|
3
|
+
import "../../../styles/global.css";
|
|
4
|
+
export interface GhostButtonProps {
|
|
5
|
+
startIcon?: React.ReactNode;
|
|
6
|
+
endIcon?: React.ReactNode;
|
|
7
|
+
label: string;
|
|
8
|
+
variant?: boolean;
|
|
9
|
+
startIconName?: string;
|
|
10
|
+
endIconName?: string;
|
|
11
|
+
onClick?: () => void;
|
|
12
|
+
}
|
|
13
|
+
declare const GhostButton: React.FC<GhostButtonProps>;
|
|
14
|
+
export default GhostButton;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./GhostButton.css";
|
|
3
|
+
import "../../../styles/global.css";
|
|
4
|
+
var GhostButton = function (_a) {
|
|
5
|
+
var startIcon = _a.startIcon, endIcon = _a.endIcon, label = _a.label, _b = _a.variant, variant = _b === void 0 ? false : _b, startIconName = _a.startIconName, endIconName = _a.endIconName, onClick = _a.onClick;
|
|
6
|
+
return (React.createElement("button", { className: "ghost-button ".concat(variant ? "ghost-button-variant" : "ghost-button-default"), onClick: onClick },
|
|
7
|
+
startIcon && React.createElement("span", { className: "ghost-button-icon ".concat(startIconName) }),
|
|
8
|
+
React.createElement("span", { className: "ghost-button-label" }, label),
|
|
9
|
+
endIcon && React.createElement("span", { className: "ghost-button-icon ".concat(endIconName) })));
|
|
10
|
+
};
|
|
11
|
+
export default GhostButton;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./IconButton.css";
|
|
3
|
+
import "../../../styles/global.css";
|
|
4
|
+
export interface IconButtonProps {
|
|
5
|
+
style: "smallFilled" | "largeFilled" | "mediumOutline" | "iconOnly";
|
|
6
|
+
iconName: string;
|
|
7
|
+
color?: string;
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
}
|
|
10
|
+
declare const IconButton: React.FC<IconButtonProps>;
|
|
11
|
+
export default IconButton;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./IconButton.css";
|
|
3
|
+
import "../../../styles/global.css";
|
|
4
|
+
var IconButton = function (_a) {
|
|
5
|
+
var style = _a.style, iconName = _a.iconName, _b = _a.color, color = _b === void 0 ? "var(--secondary-light-grey, #f4f7fb)" : _b, onClick = _a.onClick;
|
|
6
|
+
return (React.createElement("button", { className: "icon-button ".concat(style), onClick: onClick, style: { backgroundColor: color } },
|
|
7
|
+
React.createElement("i", { className: "icon ".concat(iconName) })));
|
|
8
|
+
};
|
|
9
|
+
IconButton.defaultProps = {
|
|
10
|
+
style: "smallFilled",
|
|
11
|
+
iconName: "allaw-icon-calendar",
|
|
12
|
+
onClick: function () { },
|
|
13
|
+
};
|
|
14
|
+
export default IconButton;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./OAuthProviderButton.css";
|
|
3
|
+
import "../../../styles/global.css";
|
|
4
|
+
export interface OAuthProviderButtonProps {
|
|
5
|
+
provider: "google" | "apple" | "linkedin";
|
|
6
|
+
type: "login" | "signup";
|
|
7
|
+
url: string;
|
|
8
|
+
size: 14 | 16 | 18 | 20 | 22 | 24;
|
|
9
|
+
onClick?: () => void;
|
|
10
|
+
}
|
|
11
|
+
declare const OAuthProviderButton: React.FC<OAuthProviderButtonProps>;
|
|
12
|
+
export default OAuthProviderButton;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import React, { useState, useEffect, useRef } from "react";
|
|
2
|
+
import "./OAuthProviderButton.css";
|
|
3
|
+
import "../../../styles/global.css";
|
|
4
|
+
var OAuthProviderButton = function (_a) {
|
|
5
|
+
var provider = _a.provider, type = _a.type, url = _a.url, size = _a.size, onClick = _a.onClick;
|
|
6
|
+
var _b = useState(""), label = _b[0], setLabel = _b[1];
|
|
7
|
+
var buttonRef = useRef(null);
|
|
8
|
+
var getLabels = function () {
|
|
9
|
+
var labels = {
|
|
10
|
+
google: {
|
|
11
|
+
login: "Continuer avec Google",
|
|
12
|
+
signup: "S'inscrire avec Google",
|
|
13
|
+
},
|
|
14
|
+
apple: {
|
|
15
|
+
login: "Continuer avec Apple",
|
|
16
|
+
signup: "S'inscrire avec Apple",
|
|
17
|
+
},
|
|
18
|
+
linkedin: {
|
|
19
|
+
login: "Continuer avec LinkedIn",
|
|
20
|
+
signup: "S'inscrire avec LinkedIn",
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
var shortLabels = {
|
|
24
|
+
google: "Google",
|
|
25
|
+
apple: "Apple",
|
|
26
|
+
linkedin: "LinkedIn",
|
|
27
|
+
};
|
|
28
|
+
return { labels: labels, shortLabels: shortLabels };
|
|
29
|
+
};
|
|
30
|
+
var getThresholdWidth = function (size) {
|
|
31
|
+
switch (size) {
|
|
32
|
+
case 14:
|
|
33
|
+
return 210;
|
|
34
|
+
case 16:
|
|
35
|
+
return 220;
|
|
36
|
+
case 18:
|
|
37
|
+
return 230;
|
|
38
|
+
case 20:
|
|
39
|
+
return 240;
|
|
40
|
+
case 22:
|
|
41
|
+
return 260;
|
|
42
|
+
case 24:
|
|
43
|
+
return 290;
|
|
44
|
+
default:
|
|
45
|
+
return 250;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
var updateLabel = function () {
|
|
49
|
+
var _a, _b;
|
|
50
|
+
var _c = getLabels(), labels = _c.labels, shortLabels = _c.shortLabels;
|
|
51
|
+
var maxWidth = (_b = (_a = buttonRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) !== null && _b !== void 0 ? _b : 0;
|
|
52
|
+
var thresholdWidth = getThresholdWidth(size);
|
|
53
|
+
var newLabel = maxWidth < thresholdWidth
|
|
54
|
+
? shortLabels[provider]
|
|
55
|
+
: labels[provider][type];
|
|
56
|
+
setLabel(newLabel);
|
|
57
|
+
};
|
|
58
|
+
useEffect(function () {
|
|
59
|
+
var resizeObserver = new ResizeObserver(function () {
|
|
60
|
+
updateLabel();
|
|
61
|
+
});
|
|
62
|
+
if (buttonRef.current) {
|
|
63
|
+
resizeObserver.observe(buttonRef.current);
|
|
64
|
+
}
|
|
65
|
+
return function () {
|
|
66
|
+
if (buttonRef.current) {
|
|
67
|
+
resizeObserver.unobserve(buttonRef.current);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
}, [provider, type, size]);
|
|
71
|
+
// Force an update after the first render to ensure the correct label is set
|
|
72
|
+
useEffect(function () {
|
|
73
|
+
if (buttonRef.current) {
|
|
74
|
+
updateLabel();
|
|
75
|
+
}
|
|
76
|
+
}, []);
|
|
77
|
+
var renderIcon = function () {
|
|
78
|
+
var iconSizes = {
|
|
79
|
+
google: size * 0.8,
|
|
80
|
+
apple: size * 1.2,
|
|
81
|
+
linkedin: size * 0.8,
|
|
82
|
+
};
|
|
83
|
+
var iconClasses = {
|
|
84
|
+
google: "allaw-icon-google",
|
|
85
|
+
apple: "allaw-icon-apple",
|
|
86
|
+
linkedin: "allaw-icon-linkedin",
|
|
87
|
+
};
|
|
88
|
+
var iconSize = iconSizes[provider];
|
|
89
|
+
var iconClass = iconClasses[provider];
|
|
90
|
+
if (provider === "google") {
|
|
91
|
+
return (React.createElement("span", { className: iconClass, style: { fontSize: "".concat(iconSize, "px") } },
|
|
92
|
+
React.createElement("span", { className: "path1" }),
|
|
93
|
+
React.createElement("span", { className: "path2" }),
|
|
94
|
+
React.createElement("span", { className: "path3" }),
|
|
95
|
+
React.createElement("span", { className: "path4" })));
|
|
96
|
+
}
|
|
97
|
+
else if (provider === "linkedin") {
|
|
98
|
+
var containerSize = size * 1.4;
|
|
99
|
+
return (React.createElement("div", { className: "linkedin-icon-container", style: {
|
|
100
|
+
fontSize: "".concat(iconSize, "px"),
|
|
101
|
+
width: "".concat(containerSize, "px"),
|
|
102
|
+
height: "".concat(containerSize, "px"),
|
|
103
|
+
minWidth: "".concat(containerSize, "px"),
|
|
104
|
+
minHeight: "".concat(containerSize, "px"),
|
|
105
|
+
} },
|
|
106
|
+
React.createElement("i", { className: iconClass, style: { fontSize: "".concat(iconSize, "px") } })));
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
return (React.createElement("i", { className: iconClass, style: { fontSize: "".concat(iconSize, "px") } }));
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
var handleClick = function () {
|
|
113
|
+
if (onClick) {
|
|
114
|
+
onClick();
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
window.open(url, "_blank");
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
var getMaxWidth = function () {
|
|
121
|
+
switch (size) {
|
|
122
|
+
case 14:
|
|
123
|
+
return "200px";
|
|
124
|
+
case 16:
|
|
125
|
+
return "300px";
|
|
126
|
+
case 18:
|
|
127
|
+
return "320px";
|
|
128
|
+
case 20:
|
|
129
|
+
return "370px";
|
|
130
|
+
case 22:
|
|
131
|
+
return "380px";
|
|
132
|
+
case 24:
|
|
133
|
+
return "400px";
|
|
134
|
+
default:
|
|
135
|
+
return "400px";
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
var maxWidth = getMaxWidth();
|
|
139
|
+
return (React.createElement("button", { ref: buttonRef, className: "oauth-provider-button ".concat(provider), onClick: handleClick, style: { height: "".concat(size * 2.55, "px"), maxWidth: maxWidth } },
|
|
140
|
+
renderIcon(),
|
|
141
|
+
React.createElement("span", { className: "label", style: { fontSize: "".concat(size, "px") } }, label)));
|
|
142
|
+
};
|
|
143
|
+
export default OAuthProviderButton;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./PendingDocuments.css";
|
|
3
|
+
import "../../../styles/global.css";
|
|
4
|
+
export interface PendingDocumentsProps {
|
|
5
|
+
icon?: React.ReactNode;
|
|
6
|
+
pendingCount: number;
|
|
7
|
+
onClick?: () => void;
|
|
8
|
+
}
|
|
9
|
+
declare const PendingDocuments: React.FC<PendingDocumentsProps>;
|
|
10
|
+
export default PendingDocuments;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./PendingDocuments.css";
|
|
3
|
+
import "../../../styles/global.css";
|
|
4
|
+
var PendingDocuments = function (_a) {
|
|
5
|
+
var icon = _a.icon, pendingCount = _a.pendingCount, onClick = _a.onClick;
|
|
6
|
+
var isPending = pendingCount > 0;
|
|
7
|
+
return (React.createElement("div", { className: "pending-documents ".concat(isPending ? "pending-documents-pending" : "pending-documents-none"), onClick: isPending ? onClick : undefined },
|
|
8
|
+
icon && React.createElement("span", { className: "pending-documents-icon" }, icon),
|
|
9
|
+
React.createElement("span", { className: "pending-documents-label" }, isPending
|
|
10
|
+
? "".concat(pendingCount, " demandes en attente")
|
|
11
|
+
: "Aucune demande en attente")));
|
|
12
|
+
};
|
|
13
|
+
export default PendingDocuments;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { ButtonHTMLAttributes } from "react";
|
|
2
|
+
import "./PrimaryButton.css";
|
|
3
|
+
import "../../../styles/global.css";
|
|
4
|
+
export interface PrimaryButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
5
|
+
startIcon?: React.ReactNode;
|
|
6
|
+
endIcon?: React.ReactNode;
|
|
7
|
+
startIconName?: string;
|
|
8
|
+
endIconName?: string;
|
|
9
|
+
label: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
onClick?: () => Promise<void> | void;
|
|
12
|
+
fullWidth?: boolean;
|
|
13
|
+
type?: "button" | "submit" | "reset";
|
|
14
|
+
isLoading?: boolean;
|
|
15
|
+
}
|
|
16
|
+
declare const PrimaryButton: React.ForwardRefExoticComponent<PrimaryButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
17
|
+
export default PrimaryButton;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
+
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;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
50
|
+
var t = {};
|
|
51
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
52
|
+
t[p] = s[p];
|
|
53
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
54
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
55
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
56
|
+
t[p[i]] = s[p[i]];
|
|
57
|
+
}
|
|
58
|
+
return t;
|
|
59
|
+
};
|
|
60
|
+
import React, { forwardRef, useImperativeHandle, useState, useEffect, } from "react";
|
|
61
|
+
import "./PrimaryButton.css";
|
|
62
|
+
import "../../../styles/global.css";
|
|
63
|
+
var PrimaryButton = forwardRef(function (_a, ref) {
|
|
64
|
+
var startIcon = _a.startIcon, endIcon = _a.endIcon, startIconName = _a.startIconName, endIconName = _a.endIconName, label = _a.label, _b = _a.disabled, disabled = _b === void 0 ? false : _b, onClick = _a.onClick, _c = _a.fullWidth, fullWidth = _c === void 0 ? false : _c, _d = _a.type, type = _d === void 0 ? "button" : _d, _e = _a.isLoading, isLoading = _e === void 0 ? false : _e, props = __rest(_a, ["startIcon", "endIcon", "startIconName", "endIconName", "label", "disabled", "onClick", "fullWidth", "type", "isLoading"]);
|
|
65
|
+
var buttonRef = React.useRef(null);
|
|
66
|
+
var _f = useState(false), internalIsLoading = _f[0], setInternalIsLoading = _f[1];
|
|
67
|
+
var _g = useState(""), loadingDots = _g[0], setLoadingDots = _g[1];
|
|
68
|
+
useImperativeHandle(ref, function () { return buttonRef.current; });
|
|
69
|
+
var isButtonLoading = isLoading || internalIsLoading;
|
|
70
|
+
useEffect(function () {
|
|
71
|
+
var interval = null;
|
|
72
|
+
if (isButtonLoading) {
|
|
73
|
+
interval = setInterval(function () {
|
|
74
|
+
setLoadingDots(function (prev) {
|
|
75
|
+
if (prev.length >= 3)
|
|
76
|
+
return "";
|
|
77
|
+
return prev + ".";
|
|
78
|
+
});
|
|
79
|
+
}, 500);
|
|
80
|
+
}
|
|
81
|
+
return function () {
|
|
82
|
+
if (interval) {
|
|
83
|
+
clearInterval(interval);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
}, [isButtonLoading]);
|
|
87
|
+
var handleClick = function (event) { return __awaiter(void 0, void 0, void 0, function () {
|
|
88
|
+
return __generator(this, function (_a) {
|
|
89
|
+
switch (_a.label) {
|
|
90
|
+
case 0:
|
|
91
|
+
if (isButtonLoading) {
|
|
92
|
+
event.preventDefault();
|
|
93
|
+
return [2 /*return*/];
|
|
94
|
+
}
|
|
95
|
+
if (!onClick) return [3 /*break*/, 4];
|
|
96
|
+
setInternalIsLoading(true);
|
|
97
|
+
_a.label = 1;
|
|
98
|
+
case 1:
|
|
99
|
+
_a.trys.push([1, , 3, 4]);
|
|
100
|
+
return [4 /*yield*/, onClick()];
|
|
101
|
+
case 2:
|
|
102
|
+
_a.sent();
|
|
103
|
+
return [3 /*break*/, 4];
|
|
104
|
+
case 3:
|
|
105
|
+
setInternalIsLoading(false);
|
|
106
|
+
return [7 /*endfinally*/];
|
|
107
|
+
case 4: return [2 /*return*/];
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
}); };
|
|
111
|
+
return (React.createElement("button", __assign({ ref: buttonRef, className: "primary-button ".concat(disabled ? "primary-button-disabled" : "primary-button-enabled", " ").concat(fullWidth ? "primary-button-full-width" : "", " ").concat(isButtonLoading ? "primary-button-loading" : ""), disabled: disabled, onClick: handleClick, type: type }, props),
|
|
112
|
+
startIcon && (React.createElement("span", { className: "primary-button-icon ".concat(startIconName) })),
|
|
113
|
+
React.createElement("span", { className: "primary-button-label" }, label),
|
|
114
|
+
isButtonLoading ? (React.createElement("span", { className: "primary-button-loading-dots" }, loadingDots)) : (endIcon && React.createElement("span", { className: "primary-button-icon ".concat(endIconName) }))));
|
|
115
|
+
});
|
|
116
|
+
PrimaryButton.displayName = "PrimaryButton";
|
|
117
|
+
export default PrimaryButton;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { ButtonHTMLAttributes } from "react";
|
|
2
|
+
import "./SecondaryButton.css";
|
|
3
|
+
import "../../../styles/global.css";
|
|
4
|
+
export interface SecondaryButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
5
|
+
startIcon?: React.ReactNode;
|
|
6
|
+
endIcon?: React.ReactNode;
|
|
7
|
+
startIconName?: string;
|
|
8
|
+
endIconName?: string;
|
|
9
|
+
label: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
mode?: "dark" | "light";
|
|
12
|
+
onClick?: () => Promise<void> | void;
|
|
13
|
+
fullWidth?: boolean;
|
|
14
|
+
type?: "button" | "submit" | "reset";
|
|
15
|
+
isLoading?: boolean;
|
|
16
|
+
}
|
|
17
|
+
declare const SecondaryButton: React.ForwardRefExoticComponent<SecondaryButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
18
|
+
export default SecondaryButton;
|