allaw-ui 1.0.1 → 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.
Files changed (154) hide show
  1. package/dist/components/atoms/buttons/ActionCircleButton.d.ts +9 -0
  2. package/dist/components/atoms/buttons/ActionCircleButton.js +23 -0
  3. package/dist/components/atoms/buttons/AgendaSlot.d.ts +10 -0
  4. package/dist/components/atoms/buttons/AgendaSlot.js +7 -0
  5. package/dist/components/atoms/buttons/FavoriteToggle.d.ts +8 -0
  6. package/dist/components/atoms/buttons/FavoriteToggle.js +11 -0
  7. package/dist/components/atoms/buttons/FilterButton.d.ts +9 -0
  8. package/dist/components/atoms/buttons/FilterButton.js +9 -0
  9. package/dist/components/atoms/buttons/FilterButtonPrimary.d.ts +9 -0
  10. package/dist/components/atoms/buttons/FilterButtonPrimary.js +46 -0
  11. package/dist/components/atoms/buttons/GhostButton.d.ts +14 -0
  12. package/dist/components/atoms/buttons/GhostButton.js +11 -0
  13. package/dist/components/atoms/buttons/IconButton.d.ts +11 -0
  14. package/dist/components/atoms/buttons/IconButton.js +14 -0
  15. package/dist/components/atoms/buttons/OAuthProviderButton.d.ts +12 -0
  16. package/dist/components/atoms/buttons/OAuthProviderButton.js +143 -0
  17. package/dist/components/atoms/buttons/PendingDocuments.d.ts +10 -0
  18. package/dist/components/atoms/buttons/PendingDocuments.js +13 -0
  19. package/dist/components/atoms/buttons/PrimaryButton.d.ts +17 -0
  20. package/dist/components/atoms/buttons/PrimaryButton.js +117 -0
  21. package/dist/components/atoms/buttons/SecondaryButton.d.ts +18 -0
  22. package/dist/components/atoms/buttons/SecondaryButton.js +117 -0
  23. package/dist/components/atoms/buttons/TabNavigation.d.ts +13 -0
  24. package/dist/components/atoms/buttons/TabNavigation.js +10 -0
  25. package/dist/components/atoms/buttons/TertiaryButton.d.ts +11 -0
  26. package/dist/components/atoms/buttons/TertiaryButton.js +10 -0
  27. package/dist/components/atoms/buttons/index.d.ts +22 -0
  28. package/dist/components/atoms/buttons/index.js +11 -0
  29. package/dist/components/atoms/checkboxes/Checkbox.d.ts +14 -0
  30. package/dist/components/atoms/checkboxes/Checkbox.js +19 -0
  31. package/dist/components/atoms/checkboxes/index.d.ts +2 -0
  32. package/dist/components/atoms/checkboxes/index.js +1 -0
  33. package/dist/components/atoms/filter/Filter.d.ts +17 -0
  34. package/dist/components/atoms/filter/Filter.js +70 -0
  35. package/dist/components/atoms/filter/index.d.ts +2 -0
  36. package/dist/components/atoms/filter/index.js +1 -0
  37. package/dist/components/atoms/filters/SingleFilter.d.ts +17 -0
  38. package/dist/components/atoms/filters/SingleFilter.js +81 -0
  39. package/dist/components/atoms/filters/index.d.ts +2 -0
  40. package/dist/components/atoms/filters/index.js +1 -0
  41. package/dist/components/atoms/inputs/Input.d.ts +22 -0
  42. package/dist/components/atoms/inputs/Input.js +86 -0
  43. package/dist/components/atoms/inputs/SearchBar.d.ts +12 -0
  44. package/dist/components/atoms/inputs/SearchBar.js +20 -0
  45. package/dist/components/atoms/inputs/TextArea.d.ts +21 -0
  46. package/dist/components/atoms/inputs/TextArea.js +66 -0
  47. package/dist/components/atoms/inputs/index.d.ts +6 -0
  48. package/dist/components/atoms/inputs/index.js +3 -0
  49. package/dist/components/atoms/progressBars/ProgressBar.d.ts +15 -0
  50. package/dist/components/atoms/progressBars/ProgressBar.js +18 -0
  51. package/dist/components/atoms/progressBars/index.d.ts +2 -0
  52. package/dist/components/atoms/progressBars/index.js +1 -0
  53. package/dist/components/atoms/radios/RadioButton.d.ts +11 -0
  54. package/dist/components/atoms/radios/RadioButton.js +10 -0
  55. package/dist/components/atoms/radios/index.d.ts +2 -0
  56. package/dist/components/atoms/radios/index.js +1 -0
  57. package/dist/components/atoms/selects/ComboBox.d.ts +27 -0
  58. package/dist/components/atoms/selects/ComboBox.js +172 -0
  59. package/dist/components/atoms/selects/Select.d.ts +25 -0
  60. package/dist/components/atoms/selects/Select.js +127 -0
  61. package/dist/components/atoms/selects/index.d.ts +4 -0
  62. package/dist/components/atoms/selects/index.js +2 -0
  63. package/dist/components/atoms/tags/AppointementStatusTag.d.ts +8 -0
  64. package/dist/components/atoms/tags/AppointementStatusTag.js +42 -0
  65. package/dist/components/atoms/tags/FolderStatusTag.d.ts +7 -0
  66. package/dist/components/atoms/tags/FolderStatusTag.js +8 -0
  67. package/dist/components/atoms/tags/OtherStatusTag.d.ts +10 -0
  68. package/dist/components/atoms/tags/OtherStatusTag.js +10 -0
  69. package/dist/components/atoms/tags/index.d.ts +6 -0
  70. package/dist/components/atoms/tags/index.js +3 -0
  71. package/dist/components/atoms/typography/Heading.d.ts +10 -0
  72. package/dist/components/atoms/typography/Heading.js +7 -0
  73. package/dist/components/atoms/typography/Paragraph.d.ts +12 -0
  74. package/dist/components/atoms/typography/Paragraph.js +33 -0
  75. package/dist/components/atoms/typography/SmallTitle.d.ts +9 -0
  76. package/dist/components/atoms/typography/SmallTitle.js +7 -0
  77. package/dist/components/atoms/typography/Subtitle.d.ts +9 -0
  78. package/dist/components/atoms/typography/Subtitle.js +7 -0
  79. package/dist/components/atoms/typography/TinyInfo.d.ts +12 -0
  80. package/dist/components/atoms/typography/TinyInfo.js +15 -0
  81. package/dist/components/atoms/typography/index.d.ts +10 -0
  82. package/dist/components/atoms/typography/index.js +5 -0
  83. package/dist/components/atoms/uiVariables/BorderRadius.d.ts +6 -0
  84. package/dist/components/atoms/uiVariables/BorderRadius.js +12 -0
  85. package/dist/components/atoms/uiVariables/Shadows.d.ts +6 -0
  86. package/dist/components/atoms/uiVariables/Shadows.js +11 -0
  87. package/dist/components/atoms/uiVariables/Strokes.d.ts +6 -0
  88. package/dist/components/atoms/uiVariables/Strokes.js +10 -0
  89. package/dist/components/atoms/uiVariables/index.d.ts +3 -0
  90. package/dist/components/atoms/uiVariables/index.js +3 -0
  91. package/dist/components/molecules/appointmentSlot/AppointmentSlot.d.ts +25 -0
  92. package/dist/components/molecules/appointmentSlot/AppointmentSlot.js +109 -0
  93. package/dist/components/molecules/appointmentSlot/index.d.ts +2 -0
  94. package/dist/components/molecules/appointmentSlot/index.js +1 -0
  95. package/dist/components/molecules/breadcrumb/Breadcrumb.d.ts +12 -0
  96. package/dist/components/molecules/breadcrumb/Breadcrumb.js +12 -0
  97. package/dist/components/molecules/breadcrumb/index.d.ts +2 -0
  98. package/dist/components/molecules/breadcrumb/index.js +1 -0
  99. package/dist/components/molecules/caseCard/CaseCard.d.ts +14 -0
  100. package/dist/components/molecules/caseCard/CaseCard.js +20 -0
  101. package/dist/components/molecules/caseCard/index.d.ts +2 -0
  102. package/dist/components/molecules/caseCard/index.js +1 -0
  103. package/dist/components/molecules/caseLinkCard/CaseLinkCard.d.ts +11 -0
  104. package/dist/components/molecules/caseLinkCard/CaseLinkCard.js +30 -0
  105. package/dist/components/molecules/caseLinkCard/index.d.ts +2 -0
  106. package/dist/components/molecules/caseLinkCard/index.js +1 -0
  107. package/dist/components/molecules/checkboxForm/CheckboxForm.d.ts +17 -0
  108. package/dist/components/molecules/checkboxForm/CheckboxForm.js +24 -0
  109. package/dist/components/molecules/checkboxForm/index.d.ts +2 -0
  110. package/dist/components/molecules/checkboxForm/index.js +1 -0
  111. package/dist/components/molecules/clientLinkCard/ClientLinkCard.d.ts +13 -0
  112. package/dist/components/molecules/clientLinkCard/ClientLinkCard.js +16 -0
  113. package/dist/components/molecules/clientLinkCard/index.d.ts +2 -0
  114. package/dist/components/molecules/clientLinkCard/index.js +1 -0
  115. package/dist/components/molecules/contactCard/ContactCard.d.ts +17 -0
  116. package/dist/components/molecules/contactCard/ContactCard.js +80 -0
  117. package/dist/components/molecules/contactCard/index.d.ts +2 -0
  118. package/dist/components/molecules/contactCard/index.js +1 -0
  119. package/dist/components/molecules/documentCard/DocumentCard.d.ts +15 -0
  120. package/dist/components/molecules/documentCard/DocumentCard.js +72 -0
  121. package/dist/components/molecules/documentCard/index.d.ts +2 -0
  122. package/dist/components/molecules/documentCard/index.js +1 -0
  123. package/dist/components/molecules/employeeCard/EmployeeCard.d.ts +15 -0
  124. package/dist/components/molecules/employeeCard/EmployeeCard.js +34 -0
  125. package/dist/components/molecules/employeeCard/index.d.ts +2 -0
  126. package/dist/components/molecules/employeeCard/index.js +1 -0
  127. package/dist/components/molecules/loadingBox/LoadingBox.d.ts +9 -0
  128. package/dist/components/molecules/loadingBox/LoadingBox.js +7 -0
  129. package/dist/components/molecules/loadingBox/index.d.ts +2 -0
  130. package/dist/components/molecules/loadingBox/index.js +1 -0
  131. package/dist/components/molecules/proCard/ProCard.d.ts +13 -0
  132. package/dist/components/molecules/proCard/ProCard.js +25 -0
  133. package/dist/components/molecules/proCard/index.d.ts +2 -0
  134. package/dist/components/molecules/proCard/index.js +1 -0
  135. package/dist/components/molecules/radioForm/RadioForm.d.ts +12 -0
  136. package/dist/components/molecules/radioForm/RadioForm.js +27 -0
  137. package/dist/components/molecules/radioForm/index.d.ts +2 -0
  138. package/dist/components/molecules/radioForm/index.js +1 -0
  139. package/dist/components/molecules/selectForm/SelectForm.d.ts +15 -0
  140. package/dist/components/molecules/selectForm/SelectForm.js +15 -0
  141. package/dist/components/molecules/selectForm/index.d.ts +2 -0
  142. package/dist/components/molecules/selectForm/index.js +1 -0
  143. package/dist/components/molecules/stepper/Stepper.d.ts +34 -0
  144. package/dist/components/molecules/stepper/Stepper.js +123 -0
  145. package/dist/components/molecules/stepper/index.d.ts +2 -0
  146. package/dist/components/molecules/stepper/index.js +1 -0
  147. package/dist/index.d.ts +51 -0
  148. package/dist/index.js +71 -0
  149. package/dist/utils/regex.d.ts +5 -0
  150. package/dist/utils/regex.js +7 -0
  151. package/dist/utils/utils.d.ts +2 -0
  152. package/dist/utils/utils.js +48 -0
  153. package/package.json +1 -1
  154. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -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 "./SecondaryButton.css";
62
+ import "../../../styles/global.css";
63
+ var SecondaryButton = 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, _c = _a.mode, mode = _c === void 0 ? "dark" : _c, onClick = _a.onClick, _d = _a.fullWidth, fullWidth = _d === void 0 ? false : _d, _e = _a.type, type = _e === void 0 ? "button" : _e, _f = _a.isLoading, isLoading = _f === void 0 ? false : _f, props = __rest(_a, ["startIcon", "endIcon", "startIconName", "endIconName", "label", "disabled", "mode", "onClick", "fullWidth", "type", "isLoading"]);
65
+ var buttonRef = React.useRef(null);
66
+ var _g = useState(false), internalIsLoading = _g[0], setInternalIsLoading = _g[1];
67
+ var _h = useState(""), loadingDots = _h[0], setLoadingDots = _h[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: "secondary-button ".concat(disabled ? "secondary-button-disabled" : "secondary-button-enabled", " secondary-button-").concat(mode, " ").concat(fullWidth ? "secondary-button-full-width" : "", " ").concat(isButtonLoading ? "secondary-button-loading" : ""), disabled: disabled, onClick: handleClick, type: type }, props),
112
+ startIcon && (React.createElement("span", { className: "secondary-button-icon ".concat(startIconName) })),
113
+ React.createElement("span", { className: "secondary-button-label" }, label),
114
+ isButtonLoading ? (React.createElement("span", { className: "secondary-button-loading-dots" }, loadingDots)) : (endIcon && React.createElement("span", { className: "secondary-button-icon ".concat(endIconName) }))));
115
+ });
116
+ SecondaryButton.displayName = "SecondaryButton";
117
+ export default SecondaryButton;
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import "./TabNavigation.css";
3
+ import "../../../styles/global.css";
4
+ export interface TabNavigationProps {
5
+ tabs: {
6
+ label: string;
7
+ isActive: boolean;
8
+ hasNotification: boolean;
9
+ }[];
10
+ onTabClick: (index: number) => void;
11
+ }
12
+ declare const TabNavigation: React.FC<TabNavigationProps>;
13
+ export default TabNavigation;
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import "./TabNavigation.css";
3
+ import "../../../styles/global.css";
4
+ var TabNavigation = function (_a) {
5
+ var tabs = _a.tabs, onTabClick = _a.onTabClick;
6
+ return (React.createElement("div", { className: "tab-navigation" }, tabs.map(function (tab, index) { return (React.createElement("div", { key: index, className: "tab-item ".concat(tab.isActive ? "active" : "inactive"), onClick: function () { return onTabClick(index); } },
7
+ React.createElement("span", { className: "tab-label" }, tab.label),
8
+ tab.hasNotification && React.createElement("span", { className: "tab-notification-dot" }))); })));
9
+ };
10
+ export default TabNavigation;
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import "./TertiaryButton.css";
3
+ import "../../../styles/global.css";
4
+ export interface TertiaryButtonProps {
5
+ startIcon?: string;
6
+ label: string;
7
+ variant?: boolean;
8
+ onClick?: () => void;
9
+ }
10
+ declare const TertiaryButton: React.FC<TertiaryButtonProps>;
11
+ export default TertiaryButton;
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import "./TertiaryButton.css";
3
+ import "../../../styles/global.css";
4
+ var TertiaryButton = function (_a) {
5
+ var startIcon = _a.startIcon, label = _a.label, _b = _a.variant, variant = _b === void 0 ? false : _b, onClick = _a.onClick;
6
+ return (React.createElement("button", { type: "button", className: "tertiary-button ".concat(variant ? "tertiary-button-variant" : "tertiary-button-default"), onClick: onClick },
7
+ startIcon && React.createElement("span", { className: "tertiary-button-icon ".concat(startIcon) }),
8
+ React.createElement("span", { className: "tertiary-button-label" }, label)));
9
+ };
10
+ export default TertiaryButton;
@@ -0,0 +1,22 @@
1
+ export { default as FavoriteToggle } from "./FavoriteToggle";
2
+ export { default as FilterButtonPrimary } from "./FilterButtonPrimary";
3
+ export { default as FilterButton } from "./FilterButton";
4
+ export { default as GhostButton } from "./GhostButton";
5
+ export { default as IconButton } from "./IconButton";
6
+ export { default as PendingDocuments } from "./PendingDocuments";
7
+ export { default as PrimaryButton } from "./PrimaryButton";
8
+ export { default as SecondaryButton } from "./SecondaryButton";
9
+ export { default as TabNavigation } from "./TabNavigation";
10
+ export { default as TertiaryButton } from "./TertiaryButton";
11
+ export { default as OAuthProviderButton } from "./OAuthProviderButton";
12
+ export type { FavoriteToggleProps } from "./FavoriteToggle";
13
+ export type { FilterButtonProps } from "./FilterButton";
14
+ export type { GhostButtonProps } from "./GhostButton";
15
+ export type { IconButtonProps } from "./IconButton";
16
+ export type { PendingDocumentsProps } from "./PendingDocuments";
17
+ export type { PrimaryButtonProps } from "./PrimaryButton";
18
+ export type { SecondaryButtonProps } from "./SecondaryButton";
19
+ export type { TabNavigationProps } from "./TabNavigation";
20
+ export type { TertiaryButtonProps } from "./TertiaryButton";
21
+ export type { OAuthProviderButtonProps } from "./OAuthProviderButton";
22
+ export type { FilterButtonPrimaryProps } from "./FilterButtonPrimary";
@@ -0,0 +1,11 @@
1
+ export { default as FavoriteToggle } from "./FavoriteToggle";
2
+ export { default as FilterButtonPrimary } from "./FilterButtonPrimary";
3
+ export { default as FilterButton } from "./FilterButton";
4
+ export { default as GhostButton } from "./GhostButton";
5
+ export { default as IconButton } from "./IconButton";
6
+ export { default as PendingDocuments } from "./PendingDocuments";
7
+ export { default as PrimaryButton } from "./PrimaryButton";
8
+ export { default as SecondaryButton } from "./SecondaryButton";
9
+ export { default as TabNavigation } from "./TabNavigation";
10
+ export { default as TertiaryButton } from "./TertiaryButton";
11
+ export { default as OAuthProviderButton } from "./OAuthProviderButton";
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import "./Checkbox.css";
3
+ import "../../../styles/global.css";
4
+ export interface CheckboxProps {
5
+ id?: string;
6
+ checked?: boolean;
7
+ onChange?: (checked: boolean) => void;
8
+ color?: string;
9
+ size?: "default" | "small";
10
+ style?: "default" | "light";
11
+ markType?: "cross" | "check";
12
+ }
13
+ declare const Checkbox: React.FC<CheckboxProps>;
14
+ export default Checkbox;
@@ -0,0 +1,19 @@
1
+ import React, { useState } from "react";
2
+ import "./Checkbox.css";
3
+ import "../../../styles/global.css";
4
+ var Checkbox = function (_a) {
5
+ var id = _a.id, _b = _a.checked, checked = _b === void 0 ? false : _b, onChange = _a.onChange, _c = _a.color, color = _c === void 0 ? "noir" : _c, _d = _a.size, size = _d === void 0 ? "default" : _d, _e = _a.style, style = _e === void 0 ? "default" : _e, _f = _a.markType, markType = _f === void 0 ? "cross" : _f;
6
+ var _g = useState(checked), isChecked = _g[0], setIsChecked = _g[1];
7
+ var handleClick = function (e) {
8
+ e.preventDefault();
9
+ e.stopPropagation();
10
+ var newChecked = !isChecked;
11
+ setIsChecked(newChecked);
12
+ if (onChange) {
13
+ onChange(newChecked);
14
+ }
15
+ };
16
+ var checkboxColor = style === "light" ? "light" : color;
17
+ return (React.createElement("button", { id: id, className: "checkbox ".concat(isChecked ? "checkbox-pressed" : "checkbox-default", " ").concat("checkbox-".concat(checkboxColor), " ").concat(size === "small" ? "checkbox-small" : "", " ").concat(style === "light" ? "checkbox-light" : ""), onClick: handleClick }, isChecked && (React.createElement("span", { className: "checkbox-icon ".concat(markType === "cross" ? "allaw-icon-close" : "allaw-icon-check", " ").concat("checkbox-icon-".concat(checkboxColor), " ").concat(style === "light" ? "checkbox-icon-light" : "") }))));
18
+ };
19
+ export default Checkbox;
@@ -0,0 +1,2 @@
1
+ export { default as Checkbox } from "./Checkbox";
2
+ export type { CheckboxProps } from "./Checkbox";
@@ -0,0 +1 @@
1
+ export { default as Checkbox } from "./Checkbox";
@@ -0,0 +1,17 @@
1
+ import "./Basefiler.css";
2
+ import React from "react";
3
+ export type FilterProps = {
4
+ defaultSelectedValue?: string;
5
+ filterData: {
6
+ value: string;
7
+ name: string;
8
+ }[];
9
+ setFilter: (selectedValue: string) => void;
10
+ children?: React.ReactNode;
11
+ required?: boolean;
12
+ showNumIndic?: boolean;
13
+ showBackdrop?: boolean;
14
+ isStatusTag?: boolean;
15
+ };
16
+ declare const BaseFilter: ({ showNumIndic, required, defaultSelectedValue, filterData, setFilter, showBackdrop, children, ...props }: FilterProps) => React.JSX.Element;
17
+ export default BaseFilter;
@@ -0,0 +1,70 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import "./Basefiler.css";
24
+ import { FilterButtonPrimary, PrimaryButton } from "../buttons";
25
+ import { TinyInfo } from "../typography";
26
+ import React, { useState } from "react";
27
+ var BaseFilter = function (_a) {
28
+ var _b = _a.showNumIndic, showNumIndic = _b === void 0 ? false : _b, _c = _a.required, required = _c === void 0 ? true : _c, defaultSelectedValue = _a.defaultSelectedValue, filterData = _a.filterData, setFilter = _a.setFilter, _d = _a.showBackdrop, showBackdrop = _d === void 0 ? false : _d, children = _a.children, props = __rest(_a, ["showNumIndic", "required", "defaultSelectedValue", "filterData", "setFilter", "showBackdrop", "children"]);
29
+ var _e = useState(false), isOpen = _e[0], setIsOpen = _e[1];
30
+ var _f = useState(defaultSelectedValue || ""), selectedValue = _f[0], setSelectedValue = _f[1];
31
+ var handleClose = function () {
32
+ setFilter(selectedValue);
33
+ setIsOpen(false);
34
+ };
35
+ var handleButtonTap = function () {
36
+ isOpen ? handleClose() : setIsOpen(true);
37
+ };
38
+ var Item = function (_a) {
39
+ var name = _a.name, value = _a.value;
40
+ return (React.createElement("button", { className: "item", onClick: function () { setSelectedValue(value); handleClose(); } },
41
+ React.createElement("div", { className: "round" },
42
+ React.createElement("div", { className: selectedValue === value ? "selected" : "notSelected" })),
43
+ React.createElement("span", null, name)));
44
+ };
45
+ var SmallItem = function (_a) {
46
+ var name = _a.name, value = _a.value;
47
+ return (React.createElement("button", { className: "smallItem", onClick: function () { setSelectedValue(value); } },
48
+ React.createElement("div", { className: "round" },
49
+ React.createElement("div", { className: selectedValue === value ? "selected" : "notSelected" })),
50
+ React.createElement("span", null, name)));
51
+ };
52
+ return (React.createElement(React.Fragment, null,
53
+ React.createElement("div", __assign({ className: "baseFilter" }, props),
54
+ React.createElement(FilterButtonPrimary, { onClick: handleButtonTap, zIndex: "2000" },
55
+ children,
56
+ React.createElement("p", { style: { color: "#25BEEB", fontWeight: "600" } }, showNumIndic && "(".concat(selectedValue.length, ")"))),
57
+ isOpen && (React.createElement("div", { className: "options" }, filterData && filterData.length > 0 &&
58
+ filterData.map(function (item, idx) { return (React.createElement(Item, { name: item.name, value: item.value, key: idx })); }))),
59
+ React.createElement("div", { className: "optionsSmall", style: { bottom: isOpen ? "0" : "-100%" } },
60
+ React.createElement("div", { className: "row" },
61
+ React.createElement("div", { style: { minWidth: "20px" } }),
62
+ React.createElement(TinyInfo, { text: children, variant: "bold14", color: "noir" }),
63
+ React.createElement("button", { className: "closeButton", onClick: handleClose },
64
+ React.createElement("i", { className: "allaw-icon-close" }))),
65
+ React.createElement("div", { className: "choices" }, filterData && filterData.length > 0 &&
66
+ filterData.map(function (item, idx) { return (React.createElement(SmallItem, { name: item.name, value: item.value, key: idx })); })),
67
+ React.createElement(PrimaryButton, { label: "Voir les r\u00E9sultats", onClick: handleClose }))),
68
+ isOpen && (React.createElement("div", { className: "backdrop", onClick: handleClose }))));
69
+ };
70
+ export default BaseFilter;
@@ -0,0 +1,2 @@
1
+ export { default as Filter } from "./Filter";
2
+ export type { FilterProps } from "./Filter";
@@ -0,0 +1 @@
1
+ export { default as Filter } from "./Filter";
@@ -0,0 +1,17 @@
1
+ import "./SingleFilter.css";
2
+ import React from "react";
3
+ export type SingleFilterProps = {
4
+ defaultSelectedValue?: string;
5
+ filterData: {
6
+ value: string;
7
+ name: string;
8
+ }[];
9
+ setFilter: (selectedValue: string) => void;
10
+ children?: React.ReactNode;
11
+ required?: boolean;
12
+ showNumIndic?: boolean;
13
+ showBackdrop?: boolean;
14
+ isStatusTag?: boolean;
15
+ };
16
+ declare const SingleFilter: ({ showNumIndic, required, defaultSelectedValue, filterData, setFilter, showBackdrop, children, ...props }: SingleFilterProps) => React.JSX.Element;
17
+ export default SingleFilter;
@@ -0,0 +1,81 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import "./SingleFilter.css";
24
+ import { FilterButtonPrimary, PrimaryButton } from "../buttons";
25
+ import { TinyInfo } from "../typography";
26
+ import React, { useState, useEffect } from "react";
27
+ var SingleFilter = function (_a) {
28
+ var _b = _a.showNumIndic, showNumIndic = _b === void 0 ? false : _b, _c = _a.required, required = _c === void 0 ? true : _c, defaultSelectedValue = _a.defaultSelectedValue, filterData = _a.filterData, setFilter = _a.setFilter, _d = _a.showBackdrop, showBackdrop = _d === void 0 ? false : _d, children = _a.children, props = __rest(_a, ["showNumIndic", "required", "defaultSelectedValue", "filterData", "setFilter", "showBackdrop", "children"]);
29
+ var _e = useState(false), isOpen = _e[0], setIsOpen = _e[1];
30
+ var _f = useState(defaultSelectedValue || ""), selectedValue = _f[0], setSelectedValue = _f[1];
31
+ useEffect(function () {
32
+ if (selectedValue) {
33
+ setFilter(selectedValue);
34
+ }
35
+ }, [selectedValue, setFilter]);
36
+ var handleClose = function () {
37
+ setIsOpen(false);
38
+ };
39
+ var handleButtonTap = function () {
40
+ setIsOpen(!isOpen);
41
+ };
42
+ var Item = function (_a) {
43
+ var name = _a.name, value = _a.value;
44
+ return (React.createElement("button", { className: "item", onClick: function () {
45
+ setSelectedValue(value);
46
+ handleClose();
47
+ } },
48
+ React.createElement("div", { className: "round" },
49
+ React.createElement("div", { className: selectedValue === value ? "selected" : "notSelected" })),
50
+ React.createElement("span", null, name)));
51
+ };
52
+ var SmallItem = function (_a) {
53
+ var name = _a.name, value = _a.value;
54
+ return (React.createElement("button", { className: "smallItem", onClick: function () {
55
+ setSelectedValue(value);
56
+ } },
57
+ React.createElement("div", { className: "round" },
58
+ React.createElement("div", { className: selectedValue === value ? "selected" : "notSelected" })),
59
+ React.createElement("span", null, name)));
60
+ };
61
+ return (React.createElement(React.Fragment, null,
62
+ React.createElement("div", __assign({ className: "baseFilter" }, props),
63
+ React.createElement(FilterButtonPrimary, { onClick: handleButtonTap },
64
+ children,
65
+ React.createElement("p", { style: { color: "#25BEEB", fontWeight: "600" } }, showNumIndic && "(".concat(selectedValue.length, ")"))),
66
+ isOpen && (React.createElement("div", { className: "options" }, filterData &&
67
+ filterData.length > 0 &&
68
+ filterData.map(function (item, idx) { return (React.createElement(Item, { name: item.name, value: item.value, key: idx })); }))),
69
+ React.createElement("div", { className: "optionsSmall", style: { bottom: isOpen ? "0" : "-100%" } },
70
+ React.createElement("div", { className: "row" },
71
+ React.createElement("div", { style: { minWidth: "20px" } }),
72
+ React.createElement(TinyInfo, { text: children, variant: "bold14", color: "noir" }),
73
+ React.createElement("button", { className: "closeButton", onClick: handleClose },
74
+ React.createElement("i", { className: "allaw-icon-close" }))),
75
+ React.createElement("div", { className: "choices" }, filterData &&
76
+ filterData.length > 0 &&
77
+ filterData.map(function (item, idx) { return (React.createElement(SmallItem, { name: item.name, value: item.value, key: idx })); })),
78
+ React.createElement(PrimaryButton, { label: "Voir les r\u00E9sultats", onClick: handleClose }))),
79
+ isOpen && React.createElement("div", { className: "backdrop", onClick: handleClose })));
80
+ };
81
+ export default SingleFilter;
@@ -0,0 +1,2 @@
1
+ export { default as SingleFilter } from "./SingleFilter";
2
+ export type { SingleFilterProps } from "./SingleFilter";
@@ -0,0 +1 @@
1
+ export { default as SingleFilter } from "./SingleFilter";
@@ -0,0 +1,22 @@
1
+ import React from "react";
2
+ import "./Input.css";
3
+ import "../../../styles/global.css";
4
+ import "../../../styles/icons.css";
5
+ import { commonRegex } from "../../../utils/regex";
6
+ export interface InputProps {
7
+ title: string;
8
+ style?: "default" | "variation" | "password";
9
+ placeholder: string;
10
+ endIcon?: string;
11
+ isRequired?: boolean;
12
+ validate?: RegExp | keyof typeof commonRegex;
13
+ onError?: (error: string) => void;
14
+ onChange?: (value: string) => void;
15
+ value?: string;
16
+ error?: string;
17
+ }
18
+ export interface InputRef {
19
+ validate: () => boolean;
20
+ }
21
+ declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<InputRef>>;
22
+ export default Input;
@@ -0,0 +1,86 @@
1
+ import React, { useState, useEffect, useCallback, forwardRef, useImperativeHandle, useRef, } from "react";
2
+ import "./Input.css";
3
+ import "../../../styles/global.css";
4
+ import "../../../styles/icons.css";
5
+ import { commonRegex } from "../../../utils/regex";
6
+ import TinyInfo from "../typography/TinyInfo";
7
+ import Paragraph from "../typography/Paragraph";
8
+ var Input = forwardRef(function (_a, ref) {
9
+ var title = _a.title, _b = _a.style, style = _b === void 0 ? "default" : _b, placeholder = _a.placeholder, endIcon = _a.endIcon, _c = _a.isRequired, isRequired = _c === void 0 ? false : _c, validate = _a.validate, onError = _a.onError, onChange = _a.onChange, propValue = _a.value, propError = _a.error;
10
+ var _d = useState(false), isPasswordVisible = _d[0], setIsPasswordVisible = _d[1];
11
+ var _e = useState(propValue || ""), value = _e[0], setValue = _e[1];
12
+ var _f = useState(propError || ""), error = _f[0], setError = _f[1];
13
+ var _g = useState(false), isTouched = _g[0], setIsTouched = _g[1];
14
+ var inputRef = useRef(null);
15
+ useEffect(function () {
16
+ setValue(propValue || "");
17
+ }, [propValue]);
18
+ useEffect(function () {
19
+ setError(propError || "");
20
+ }, [propError]);
21
+ var validateInput = useCallback(function () {
22
+ var _a;
23
+ // console.log(`Input ${title}: Validating input`);
24
+ var currentValue = ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.value) || value;
25
+ // console.log(`Input ${title}: Current value: "${currentValue}"`);
26
+ var errorMessage = "";
27
+ if (isRequired && currentValue.trim() === "") {
28
+ errorMessage = "Ce champ est requis";
29
+ }
30
+ else if (validate && currentValue) {
31
+ var regex = typeof validate === "string" ? commonRegex[validate] : validate;
32
+ // console.log(`Input ${title}: Regex used: ${regex}`);
33
+ if (!regex.test(currentValue)) {
34
+ errorMessage = "Veuillez vérifier votre saisie";
35
+ }
36
+ }
37
+ setError(errorMessage);
38
+ setIsTouched(true);
39
+ // console.log(
40
+ // `Input ${title}: Validation result - ${errorMessage ? "invalid" : "valid"}`
41
+ // );
42
+ onError === null || onError === void 0 ? void 0 : onError(errorMessage);
43
+ return !errorMessage;
44
+ }, [isRequired, value, validate, onError, title]);
45
+ useImperativeHandle(ref, function () { return ({
46
+ validate: validateInput,
47
+ }); });
48
+ var handleChange = function (e) {
49
+ var newValue = e.target.value;
50
+ // console.log(`Input ${title}: Value changed to "${newValue}"`);
51
+ setValue(newValue);
52
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
53
+ if (isTouched) {
54
+ validateInput();
55
+ }
56
+ };
57
+ var handleBlur = function () {
58
+ // console.log(`Input ${title}: Blur event triggered`);
59
+ setIsTouched(true);
60
+ validateInput();
61
+ };
62
+ var renderEndIcon = function () {
63
+ if (style === "variation" && endIcon) {
64
+ return (React.createElement("button", { className: "Input-icon-button" },
65
+ React.createElement("i", { className: endIcon })));
66
+ }
67
+ if (style === "password") {
68
+ return (React.createElement("button", { className: "Input-button", onClick: function () { return setIsPasswordVisible(!isPasswordVisible); } }, isPasswordVisible ? "CACHER" : "AFFICHER"));
69
+ }
70
+ return null;
71
+ };
72
+ return (React.createElement("div", { className: "Input Input-".concat(style) },
73
+ React.createElement("div", { className: "Input-title-container" },
74
+ React.createElement(Paragraph, { variant: "semiBold", color: "noir", text: title }),
75
+ isRequired && title && (React.createElement("span", { className: "Input-required" },
76
+ "\u00A0",
77
+ "*"))),
78
+ React.createElement("div", { className: "Input-container" },
79
+ React.createElement("div", { className: "Input-input ".concat(style === "password" ? "Input-password-input" : "") },
80
+ React.createElement("input", { ref: inputRef, type: style === "password" && !isPasswordVisible ? "password" : "text", placeholder: placeholder, className: "Input-placeholder", value: value, onChange: handleChange, onBlur: handleBlur })),
81
+ renderEndIcon(),
82
+ error && isTouched && (React.createElement("div", { className: "error-message" },
83
+ React.createElement(TinyInfo, { variant: "medium12", color: "actions-error", text: error }))))));
84
+ });
85
+ Input.displayName = "Input";
86
+ export default Input;
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ import "./SearchBar.css";
3
+ import "../../../styles/global.css";
4
+ import "../../../styles/icons.css";
5
+ export interface SearchBarProps {
6
+ placeholder?: string;
7
+ endIcon?: string;
8
+ value?: string;
9
+ onChange?: (value: string) => void;
10
+ }
11
+ declare const SearchBar: React.FC<SearchBarProps>;
12
+ export default SearchBar;
@@ -0,0 +1,20 @@
1
+ import React, { useState } from "react";
2
+ import "./SearchBar.css";
3
+ import "../../../styles/global.css";
4
+ import "../../../styles/icons.css";
5
+ var SearchBar = function (_a) {
6
+ var _b = _a.placeholder, placeholder = _b === void 0 ? "Faites une recherche" : _b, _c = _a.endIcon, endIcon = _c === void 0 ? "allaw-icon-search" : _c, _d = _a.value, controlledValue = _d === void 0 ? "" : _d, onChange = _a.onChange;
7
+ var _e = useState(controlledValue), value = _e[0], setValue = _e[1];
8
+ var handleChange = function (event) {
9
+ var newValue = event.target.value;
10
+ setValue(newValue);
11
+ if (onChange) {
12
+ onChange(newValue);
13
+ }
14
+ };
15
+ return (React.createElement("div", { className: "SearchBar" },
16
+ React.createElement("input", { type: "text", placeholder: placeholder, className: "SearchBar-placeholder", value: controlledValue || value, onChange: handleChange }),
17
+ React.createElement("button", { className: "SearchBar-icon-button" },
18
+ React.createElement("i", { className: endIcon }))));
19
+ };
20
+ export default SearchBar;
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+ import "./TextArea.css";
3
+ import "../../../styles/global.css";
4
+ import { commonRegex } from "../../../utils/regex";
5
+ export interface TextAreaProps {
6
+ title: string;
7
+ style?: "default" | "variation";
8
+ placeholder: string;
9
+ isRequired?: boolean;
10
+ validate?: RegExp | keyof typeof commonRegex;
11
+ onError?: (error: string) => void;
12
+ onChange?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
13
+ value?: string;
14
+ error?: string;
15
+ maxHeight?: number;
16
+ }
17
+ export interface TextAreaRef {
18
+ validate: () => boolean;
19
+ }
20
+ declare const TextArea: React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<TextAreaRef>>;
21
+ export default TextArea;