allaw-ui 0.0.300 → 0.0.302

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 (110) hide show
  1. package/dist/app/layout.d.ts +0 -0
  2. package/dist/app/layout.js +0 -0
  3. package/dist/components/atoms/buttons/ActionCircleButton.d.ts +9 -0
  4. package/dist/components/atoms/buttons/ActionCircleButton.js +23 -0
  5. package/dist/components/atoms/buttons/AgendaSlot.d.ts +10 -0
  6. package/dist/components/atoms/buttons/AgendaSlot.js +7 -0
  7. package/dist/components/atoms/buttons/FavoriteToggle.d.ts +8 -0
  8. package/dist/components/atoms/buttons/FavoriteToggle.js +11 -0
  9. package/dist/components/atoms/buttons/FilterButton.d.ts +9 -0
  10. package/dist/components/atoms/buttons/FilterButton.js +9 -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 +10 -0
  14. package/dist/components/atoms/buttons/IconButton.js +14 -0
  15. package/dist/components/atoms/buttons/PendingDocuments.d.ts +10 -0
  16. package/dist/components/atoms/buttons/PendingDocuments.js +13 -0
  17. package/dist/components/atoms/buttons/PrimaryButton.d.ts +15 -0
  18. package/dist/components/atoms/buttons/PrimaryButton.js +11 -0
  19. package/dist/components/atoms/buttons/SecondaryButton.d.ts +14 -0
  20. package/dist/components/atoms/buttons/SecondaryButton.js +11 -0
  21. package/dist/components/atoms/buttons/TabNavigation.d.ts +13 -0
  22. package/dist/components/atoms/buttons/TabNavigation.js +10 -0
  23. package/dist/components/atoms/buttons/TertiaryButton.d.ts +10 -0
  24. package/dist/components/atoms/buttons/TertiaryButton.js +10 -0
  25. package/dist/components/atoms/buttons/index.d.ts +18 -0
  26. package/dist/components/atoms/buttons/index.js +9 -0
  27. package/dist/components/atoms/checkboxes/Checkbox.d.ts +10 -0
  28. package/dist/components/atoms/checkboxes/Checkbox.js +19 -0
  29. package/dist/components/atoms/checkboxes/index.d.ts +2 -0
  30. package/dist/components/atoms/checkboxes/index.js +1 -0
  31. package/dist/components/atoms/inputs/Input.d.ts +22 -0
  32. package/dist/components/atoms/inputs/Input.js +86 -0
  33. package/dist/components/atoms/inputs/SearchBar.d.ts +12 -0
  34. package/dist/components/atoms/inputs/SearchBar.js +20 -0
  35. package/dist/components/atoms/inputs/index.d.ts +4 -0
  36. package/dist/components/atoms/inputs/index.js +2 -0
  37. package/dist/components/atoms/progressBars/ProgressBar.d.ts +15 -0
  38. package/dist/components/atoms/progressBars/ProgressBar.js +17 -0
  39. package/dist/components/atoms/progressBars/index.d.ts +2 -0
  40. package/dist/components/atoms/progressBars/index.js +1 -0
  41. package/dist/components/atoms/radios/RadioButton.d.ts +11 -0
  42. package/dist/components/atoms/radios/RadioButton.js +10 -0
  43. package/dist/components/atoms/radios/index.d.ts +2 -0
  44. package/dist/components/atoms/radios/index.js +1 -0
  45. package/dist/components/atoms/selects/Select.d.ts +24 -0
  46. package/dist/components/atoms/selects/Select.js +84 -0
  47. package/dist/components/atoms/selects/index.d.ts +2 -0
  48. package/dist/components/atoms/selects/index.js +1 -0
  49. package/dist/components/atoms/tags/AppointementStatusTag.d.ts +8 -0
  50. package/dist/components/atoms/tags/AppointementStatusTag.js +41 -0
  51. package/dist/components/atoms/tags/FolderStatusTag.d.ts +7 -0
  52. package/dist/components/atoms/tags/FolderStatusTag.js +8 -0
  53. package/dist/components/atoms/tags/OtherStatusTag.d.ts +10 -0
  54. package/dist/components/atoms/tags/OtherStatusTag.js +10 -0
  55. package/dist/components/atoms/tags/index.d.ts +6 -0
  56. package/dist/components/atoms/tags/index.js +3 -0
  57. package/dist/components/atoms/typography/Heading.d.ts +9 -0
  58. package/dist/components/atoms/typography/Heading.js +7 -0
  59. package/dist/components/atoms/typography/Paragraph.d.ts +9 -0
  60. package/dist/components/atoms/typography/Paragraph.js +7 -0
  61. package/dist/components/atoms/typography/SmallTitle.d.ts +9 -0
  62. package/dist/components/atoms/typography/SmallTitle.js +7 -0
  63. package/dist/components/atoms/typography/Subtitle.d.ts +9 -0
  64. package/dist/components/atoms/typography/Subtitle.js +7 -0
  65. package/dist/components/atoms/typography/TinyInfo.d.ts +9 -0
  66. package/dist/components/atoms/typography/TinyInfo.js +8 -0
  67. package/dist/components/atoms/typography/index.d.ts +10 -0
  68. package/dist/components/atoms/typography/index.js +5 -0
  69. package/dist/components/atoms/uiVariables/BorderRadius.d.ts +6 -0
  70. package/dist/components/atoms/uiVariables/BorderRadius.js +12 -0
  71. package/dist/components/atoms/uiVariables/Shadows.d.ts +6 -0
  72. package/dist/components/atoms/uiVariables/Shadows.js +11 -0
  73. package/dist/components/atoms/uiVariables/Strokes.d.ts +6 -0
  74. package/dist/components/atoms/uiVariables/Strokes.js +10 -0
  75. package/dist/components/atoms/uiVariables/index.d.ts +3 -0
  76. package/dist/components/atoms/uiVariables/index.js +3 -0
  77. package/dist/components/molecules/appointmentSlot/AppointmentSlot.d.ts +25 -0
  78. package/dist/components/molecules/appointmentSlot/AppointmentSlot.js +109 -0
  79. package/dist/components/molecules/appointmentSlot/index.d.ts +2 -0
  80. package/dist/components/molecules/appointmentSlot/index.js +1 -0
  81. package/dist/components/molecules/caseCard/CaseCard.d.ts +14 -0
  82. package/dist/components/molecules/caseCard/CaseCard.js +20 -0
  83. package/dist/components/molecules/caseCard/index.d.ts +2 -0
  84. package/dist/components/molecules/caseCard/index.js +1 -0
  85. package/dist/components/molecules/checkboxForm/CheckboxForm.d.ts +11 -0
  86. package/dist/components/molecules/checkboxForm/CheckboxForm.js +15 -0
  87. package/dist/components/molecules/checkboxForm/index.d.ts +2 -0
  88. package/dist/components/molecules/checkboxForm/index.js +1 -0
  89. package/dist/components/molecules/contactCard/ContactCard.d.ts +17 -0
  90. package/dist/components/molecules/contactCard/ContactCard.js +80 -0
  91. package/dist/components/molecules/contactCard/index.d.ts +2 -0
  92. package/dist/components/molecules/contactCard/index.js +1 -0
  93. package/dist/components/molecules/documentCard/DocumentCard.d.ts +14 -0
  94. package/dist/components/molecules/documentCard/DocumentCard.js +59 -0
  95. package/dist/components/molecules/documentCard/index.d.ts +2 -0
  96. package/dist/components/molecules/documentCard/index.js +1 -0
  97. package/dist/components/molecules/employeeCard/EmployeeCard.d.ts +15 -0
  98. package/dist/components/molecules/employeeCard/EmployeeCard.js +34 -0
  99. package/dist/components/molecules/employeeCard/index.d.ts +2 -0
  100. package/dist/components/molecules/employeeCard/index.js +1 -0
  101. package/dist/components/molecules/stepper/Stepper.d.ts +27 -0
  102. package/dist/components/molecules/stepper/Stepper.js +68 -0
  103. package/dist/components/molecules/stepper/index.d.ts +2 -0
  104. package/dist/components/molecules/stepper/index.js +1 -0
  105. package/dist/index.d.ts +36 -0
  106. package/dist/index.js +52 -0
  107. package/dist/utils/regex.d.ts +5 -0
  108. package/dist/utils/regex.js +7 -0
  109. package/package.json +1 -1
  110. package/dist/tsconfig.tsbuildinfo +0 -1
File without changes
File without changes
@@ -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,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,10 @@
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
+ onClick?: () => void;
8
+ }
9
+ declare const IconButton: React.FC<IconButtonProps>;
10
+ 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, onClick = _a.onClick;
6
+ return (React.createElement("button", { className: "icon-button ".concat(style), onClick: onClick },
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,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,15 @@
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?: () => void;
12
+ fullWidth?: boolean;
13
+ }
14
+ declare const PrimaryButton: React.FC<PrimaryButtonProps>;
15
+ export default PrimaryButton;
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import "./PrimaryButton.css";
3
+ import "../../../styles/global.css";
4
+ var PrimaryButton = function (_a) {
5
+ 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;
6
+ return (React.createElement("button", { className: "primary-button ".concat(disabled ? "primary-button-disabled" : "primary-button-enabled", " ").concat(fullWidth ? "primary-button-full-width" : ""), disabled: disabled, onClick: onClick },
7
+ startIcon && React.createElement("span", { className: "primary-button-icon ".concat(startIconName) }),
8
+ React.createElement("span", { className: "primary-button-label" }, label),
9
+ endIcon && React.createElement("span", { className: "primary-button-icon ".concat(endIconName) })));
10
+ };
11
+ export default PrimaryButton;
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import "./SecondaryButton.css";
3
+ import "../../../styles/global.css";
4
+ export interface SecondaryButtonProps {
5
+ startIcon?: React.ReactNode;
6
+ endIcon?: React.ReactNode;
7
+ label: string;
8
+ disabled?: boolean;
9
+ mode?: "dark" | "light";
10
+ onClick?: () => void;
11
+ fullWidth?: boolean;
12
+ }
13
+ declare const SecondaryButton: React.FC<SecondaryButtonProps>;
14
+ export default SecondaryButton;
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import "./SecondaryButton.css";
3
+ import "../../../styles/global.css";
4
+ var SecondaryButton = function (_a) {
5
+ var startIcon = _a.startIcon, endIcon = _a.endIcon, 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;
6
+ return (React.createElement("button", { className: "secondary-button ".concat(disabled ? "secondary-button-disabled" : "secondary-button-enabled", " secondary-button-").concat(mode, " ").concat(fullWidth ? "secondary-button-full-width" : ""), disabled: disabled, onClick: onClick },
7
+ startIcon && React.createElement("span", { className: "secondary-button-icon ".concat(startIcon) }),
8
+ React.createElement("span", { className: "secondary-button-label" }, label),
9
+ endIcon && React.createElement("span", { className: "secondary-button-icon ".concat(endIcon) })));
10
+ };
11
+ 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,10 @@
1
+ import React from "react";
2
+ import "./TertiaryButton.css";
3
+ import "../../../styles/global.css";
4
+ export interface TertiaryButtonProps {
5
+ startIcon?: React.ReactNode;
6
+ label: string;
7
+ variant?: boolean;
8
+ }
9
+ declare const TertiaryButton: React.FC<TertiaryButtonProps>;
10
+ 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;
6
+ return (React.createElement("button", { className: "tertiary-button ".concat(variant ? "tertiary-button-variant" : "tertiary-button-default") },
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,18 @@
1
+ export { default as FavoriteToggle } from "./FavoriteToggle";
2
+ export { default as FilterButton } from "./FilterButton";
3
+ export { default as GhostButton } from "./GhostButton";
4
+ export { default as IconButton } from "./IconButton";
5
+ export { default as PendingDocuments } from "./PendingDocuments";
6
+ export { default as PrimaryButton } from "./PrimaryButton";
7
+ export { default as SecondaryButton } from "./SecondaryButton";
8
+ export { default as TabNavigation } from "./TabNavigation";
9
+ export { default as TertiaryButton } from "./TertiaryButton";
10
+ export type { FavoriteToggleProps } from "./FavoriteToggle";
11
+ export type { FilterButtonProps } from "./FilterButton";
12
+ export type { GhostButtonProps } from "./GhostButton";
13
+ export type { IconButtonProps } from "./IconButton";
14
+ export type { PendingDocumentsProps } from "./PendingDocuments";
15
+ export type { PrimaryButtonProps } from "./PrimaryButton";
16
+ export type { SecondaryButtonProps } from "./SecondaryButton";
17
+ export type { TabNavigationProps } from "./TabNavigation";
18
+ export type { TertiaryButtonProps } from "./TertiaryButton";
@@ -0,0 +1,9 @@
1
+ export { default as FavoriteToggle } from "./FavoriteToggle";
2
+ export { default as FilterButton } from "./FilterButton";
3
+ export { default as GhostButton } from "./GhostButton";
4
+ export { default as IconButton } from "./IconButton";
5
+ export { default as PendingDocuments } from "./PendingDocuments";
6
+ export { default as PrimaryButton } from "./PrimaryButton";
7
+ export { default as SecondaryButton } from "./SecondaryButton";
8
+ export { default as TabNavigation } from "./TabNavigation";
9
+ export { default as TertiaryButton } from "./TertiaryButton";
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import "./Checkbox.css";
3
+ import "../../../styles/global.css";
4
+ export interface CheckboxProps {
5
+ checked?: boolean;
6
+ onChange?: (checked: boolean) => void;
7
+ isWhite?: boolean;
8
+ }
9
+ declare const Checkbox: React.FC<CheckboxProps>;
10
+ export default Checkbox;
@@ -0,0 +1,19 @@
1
+ import React, { useState, useEffect } from "react";
2
+ import "./Checkbox.css";
3
+ import "../../../styles/global.css";
4
+ var Checkbox = function (_a) {
5
+ var _b = _a.checked, checked = _b === void 0 ? false : _b, onChange = _a.onChange, _c = _a.isWhite, isWhite = _c === void 0 ? false : _c;
6
+ var _d = useState(checked), isChecked = _d[0], setIsChecked = _d[1];
7
+ useEffect(function () {
8
+ setIsChecked(checked);
9
+ }, [checked]);
10
+ var handleClick = function () {
11
+ var newChecked = !isChecked;
12
+ setIsChecked(newChecked);
13
+ if (onChange) {
14
+ onChange(newChecked);
15
+ }
16
+ };
17
+ return (React.createElement("button", { className: "checkbox ".concat(isChecked ? "checkbox-pressed" : "checkbox-default", " ").concat(isWhite ? "checkbox-white" : "checkbox-black"), onClick: handleClick }, isChecked && (React.createElement("span", { className: "checkbox-icon allaw-icon-close ".concat(isWhite ? "checkbox-icon-white" : "checkbox-icon-black") }))));
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,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,4 @@
1
+ export { default as Input } from "./Input";
2
+ export { default as SearchBar } from "./SearchBar";
3
+ export type { InputProps, InputRef } from "./Input";
4
+ export type { SearchBarProps } from "./SearchBar";
@@ -0,0 +1,2 @@
1
+ export { default as Input } from "./Input";
2
+ export { default as SearchBar } from "./SearchBar";
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import "./ProgressBar.css";
3
+ import "../../../styles/global.css";
4
+ import "../../../styles/icons.css";
5
+ export interface ProgressBarProps {
6
+ steps: number;
7
+ currentStep: number;
8
+ startIcon?: boolean;
9
+ endIcon?: boolean;
10
+ onStartIconClick?: () => void;
11
+ onEndIconClick?: () => void;
12
+ showProgressBar?: boolean;
13
+ }
14
+ declare const ProgressBar: React.FC<ProgressBarProps>;
15
+ export default ProgressBar;
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import "./ProgressBar.css";
3
+ import "../../../styles/global.css";
4
+ import "../../../styles/icons.css";
5
+ var ProgressBar = function (_a) {
6
+ var steps = _a.steps, currentStep = _a.currentStep, _b = _a.startIcon, startIcon = _b === void 0 ? true : _b, _c = _a.endIcon, endIcon = _c === void 0 ? true : _c, onStartIconClick = _a.onStartIconClick, onEndIconClick = _a.onEndIconClick, _d = _a.showProgressBar, showProgressBar = _d === void 0 ? true : _d;
7
+ var constrainedCurrentStep = Math.max(1, Math.min(currentStep, steps));
8
+ var progressWidth = ((constrainedCurrentStep - 1) / (steps - 1)) * 100;
9
+ return (React.createElement("div", { className: "progress-bar-container" },
10
+ React.createElement("div", { className: "progress-bar-icon-container" }, startIcon && currentStep > 1 && (React.createElement("button", { className: "progress-bar-chevron", onClick: onStartIconClick },
11
+ React.createElement("i", { className: "allaw-icon-chevron-left" })))),
12
+ React.createElement("div", { className: "progress-bar-background ".concat(showProgressBar ? "" : "hidden-content") },
13
+ React.createElement("div", { className: "progress-bar-fill", style: { width: "".concat(progressWidth, "%") } })),
14
+ endIcon && (React.createElement("button", { className: "progress-bar-close", onClick: onEndIconClick },
15
+ React.createElement("i", { className: "allaw-icon-close" })))));
16
+ };
17
+ export default ProgressBar;
@@ -0,0 +1,2 @@
1
+ export { default as ProgressBar } from "./ProgressBar";
2
+ export type { ProgressBarProps } from "./ProgressBar";
@@ -0,0 +1 @@
1
+ export { default as ProgressBar } from "./ProgressBar";
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import "./RadioButton.css";
3
+ import "../../../styles/global.css";
4
+ export interface RadioButtonProps {
5
+ label: string;
6
+ style?: "user" | "hybride";
7
+ isActive: boolean;
8
+ onClick: () => void;
9
+ }
10
+ declare const RadioButton: React.FC<RadioButtonProps>;
11
+ export default RadioButton;
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import "./RadioButton.css";
3
+ import "../../../styles/global.css";
4
+ var RadioButton = function (_a) {
5
+ var label = _a.label, _b = _a.style, style = _b === void 0 ? "user" : _b, isActive = _a.isActive, onClick = _a.onClick;
6
+ return (React.createElement("button", { className: "radio-button radio-button-".concat(style, " ").concat(isActive ? "radio-button-".concat(style, "-active") : ""), onClick: onClick },
7
+ React.createElement("span", { className: "radio-button-icon" }, isActive && React.createElement("span", { className: "radio-button-icon-inner" })),
8
+ React.createElement("span", { className: "radio-button-label" }, label)));
9
+ };
10
+ export default RadioButton;
@@ -0,0 +1,2 @@
1
+ export { default as RadioButton } from "./RadioButton";
2
+ export type { RadioButtonProps } from "./RadioButton";
@@ -0,0 +1 @@
1
+ export { default as RadioButton } from "./RadioButton";
@@ -0,0 +1,24 @@
1
+ import React from "react";
2
+ import "./Select.css";
3
+ import "../../../styles/global.css";
4
+ export interface SelectItem {
5
+ label: string;
6
+ value: string;
7
+ }
8
+ export interface SelectProps<T extends string | string[]> {
9
+ items: SelectItem[];
10
+ selectedItem?: T;
11
+ placeholder?: string;
12
+ multiple?: boolean;
13
+ isRequired?: boolean;
14
+ showError?: boolean;
15
+ onChange?: (selected: T) => void;
16
+ onError?: (error: string) => void;
17
+ }
18
+ export interface SelectRef {
19
+ validate: () => boolean;
20
+ }
21
+ declare const _default: <T extends string | string[]>(props: SelectProps<T> & {
22
+ ref?: React.Ref<SelectRef>;
23
+ }) => React.ReactElement;
24
+ export default _default;