allaw-ui 0.0.354 → 0.1.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/README.md +0 -0
- package/dist/app/globals.css +0 -0
- package/dist/assets/NoPhoto.png +0 -0
- package/dist/assets/NoPhoto.svg +0 -0
- package/dist/assets/allaw-font.eot +0 -0
- package/dist/assets/allaw-font.svg +0 -0
- package/dist/assets/allaw-font.ttf +0 -0
- package/dist/assets/allaw-font.woff +0 -0
- package/dist/components/atoms/buttons/ActionCircleButton.css +0 -0
- package/dist/components/atoms/buttons/AgendaSlot.css +0 -0
- package/dist/components/atoms/buttons/FavoriteToggle.css +0 -0
- package/dist/components/atoms/buttons/FilterButton.css +0 -0
- package/dist/components/atoms/buttons/GhostButton.css +0 -0
- package/dist/components/atoms/buttons/IconButton.css +0 -0
- package/dist/components/atoms/buttons/IconButton.d.ts +1 -0
- package/dist/components/atoms/buttons/IconButton.js +2 -2
- package/dist/components/atoms/buttons/OAuthProviderButton.css +0 -0
- package/dist/components/atoms/buttons/PendingDocuments.css +0 -0
- package/dist/components/atoms/buttons/PrimaryButton.css +24 -0
- package/dist/components/atoms/buttons/PrimaryButton.d.ts +2 -1
- package/dist/components/atoms/buttons/PrimaryButton.js +85 -4
- package/dist/components/atoms/buttons/SecondaryButton.css +0 -0
- package/dist/components/atoms/buttons/SecondaryButton.d.ts +8 -4
- package/dist/components/atoms/buttons/SecondaryButton.js +113 -7
- package/dist/components/atoms/buttons/TabNavigation.css +0 -0
- package/dist/components/atoms/buttons/TertiaryButton.css +0 -0
- package/dist/components/atoms/checkboxes/Checkbox.css +0 -0
- package/dist/components/atoms/checkboxes/Checkbox.d.ts +1 -0
- package/dist/components/atoms/checkboxes/Checkbox.js +3 -3
- package/dist/components/atoms/filter/Basefiler.css +0 -0
- package/dist/components/atoms/filters/SingleFilter.css +0 -0
- package/dist/components/atoms/filters/SingleFilter.js +20 -9
- package/dist/components/atoms/inputs/Input.css +0 -0
- package/dist/components/atoms/inputs/SearchBar.css +0 -0
- package/dist/components/atoms/inputs/TextArea.css +202 -0
- package/dist/components/atoms/inputs/TextArea.d.ts +22 -0
- package/dist/components/atoms/inputs/TextArea.js +79 -0
- package/dist/components/atoms/inputs/index.d.ts +2 -0
- package/dist/components/atoms/inputs/index.js +1 -0
- package/dist/components/atoms/progressBars/ProgressBar.css +0 -0
- package/dist/components/atoms/progressBars/ProgressBar.js +5 -4
- package/dist/components/atoms/radios/RadioButton.css +0 -0
- package/dist/components/atoms/selects/Select.css +16 -3
- package/dist/components/atoms/selects/Select.d.ts +1 -0
- package/dist/components/atoms/selects/Select.js +20 -8
- package/dist/components/atoms/tags/AppointementStatusTag.css +0 -0
- package/dist/components/atoms/tags/FolderStatusTag.css +0 -0
- package/dist/components/atoms/tags/OtherStatusTag.css +0 -0
- package/dist/components/atoms/typography/Heading.css +0 -0
- package/dist/components/atoms/typography/Paragraph.css +0 -0
- package/dist/components/atoms/typography/SmallTitle.css +0 -0
- package/dist/components/atoms/typography/Subtitle.css +0 -0
- package/dist/components/atoms/typography/TinyInfo.css +3 -0
- package/dist/components/atoms/typography/TinyInfo.d.ts +1 -1
- package/dist/components/atoms/uiVariables/BorderRadiusExample.css +0 -0
- package/dist/components/atoms/uiVariables/ShadowsExample.css +0 -0
- package/dist/components/atoms/uiVariables/StrokesExample.css +0 -0
- package/dist/components/molecules/appointmentSlot/AppointmentSlot.css +0 -0
- package/dist/components/molecules/breadcrumb/Breadcrumb.css +0 -0
- package/dist/components/molecules/caseCard/CaseCard.css +0 -0
- package/dist/components/molecules/caseLinkCard/CaseLinkCard.css +47 -0
- package/dist/components/molecules/caseLinkCard/CaseLinkCard.d.ts +10 -0
- package/dist/components/molecules/caseLinkCard/CaseLinkCard.js +27 -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.css +0 -0
- package/dist/components/molecules/checkboxForm/CheckboxForm.d.ts +1 -0
- package/dist/components/molecules/checkboxForm/CheckboxForm.js +2 -2
- package/dist/components/molecules/contactCard/ContactCard.css +0 -0
- package/dist/components/molecules/documentCard/DocumentCard.css +2 -2
- package/dist/components/molecules/documentCard/DocumentCard.d.ts +2 -1
- package/dist/components/molecules/documentCard/DocumentCard.js +18 -5
- package/dist/components/molecules/employeeCard/EmployeeCard.css +0 -0
- package/dist/components/molecules/proCard/ProCard.css +0 -0
- package/dist/components/molecules/proCard/ProCard.js +2 -2
- package/dist/components/molecules/radioForm/RadioForm.css +14 -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.css +9 -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.css +12 -1
- package/dist/components/molecules/stepper/Stepper.d.ts +9 -2
- package/dist/components/molecules/stepper/Stepper.js +90 -35
- package/dist/index.d.ts +6 -0
- package/dist/index.js +7 -0
- package/dist/stories/assets/accessibility.png +0 -0
- package/dist/stories/assets/accessibility.svg +0 -0
- package/dist/stories/assets/addon-library.png +0 -0
- package/dist/stories/assets/assets.png +0 -0
- package/dist/stories/assets/context.png +0 -0
- package/dist/stories/assets/discord.svg +0 -0
- package/dist/stories/assets/docs.png +0 -0
- package/dist/stories/assets/figma-plugin.png +0 -0
- package/dist/stories/assets/github.svg +0 -0
- package/dist/stories/assets/share.png +0 -0
- package/dist/stories/assets/styling.png +0 -0
- package/dist/stories/assets/testing.png +0 -0
- package/dist/stories/assets/theming.png +0 -0
- package/dist/stories/assets/tutorials.svg +0 -0
- package/dist/stories/assets/youtube.svg +0 -0
- package/dist/styles/colors.css +0 -0
- package/dist/styles/global.css +0 -0
- package/dist/styles/icons.css +0 -0
- package/dist/styles/ui-variables/border-radius.css +0 -0
- package/dist/styles/ui-variables/shadows.css +0 -0
- package/dist/styles/ui-variables/stroke.css +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
File without changes
|
package/dist/app/globals.css
CHANGED
|
File without changes
|
package/dist/assets/NoPhoto.png
CHANGED
|
File without changes
|
package/dist/assets/NoPhoto.svg
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -2,8 +2,8 @@ import React from "react";
|
|
|
2
2
|
import "./IconButton.css";
|
|
3
3
|
import "../../../styles/global.css";
|
|
4
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 },
|
|
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
7
|
React.createElement("i", { className: "icon ".concat(iconName) })));
|
|
8
8
|
};
|
|
9
9
|
IconButton.defaultProps = {
|
|
File without changes
|
|
File without changes
|
|
@@ -55,3 +55,27 @@
|
|
|
55
55
|
.primary-button-full-width {
|
|
56
56
|
width: 100%;
|
|
57
57
|
}
|
|
58
|
+
|
|
59
|
+
.primary-button-loading {
|
|
60
|
+
animation: pulse-background 1.5s infinite alternate;
|
|
61
|
+
pointer-events: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@keyframes pulse-background {
|
|
65
|
+
0% {
|
|
66
|
+
background-color: #171e25;
|
|
67
|
+
}
|
|
68
|
+
50% {
|
|
69
|
+
background-color: #171e25;
|
|
70
|
+
}
|
|
71
|
+
100% {
|
|
72
|
+
background-color: #1985e8;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.primary-button-loading-dots {
|
|
77
|
+
width: 1.25rem;
|
|
78
|
+
display: inline-block;
|
|
79
|
+
text-align: left;
|
|
80
|
+
font-size: 0.9rem;
|
|
81
|
+
}
|
|
@@ -8,9 +8,10 @@ export interface PrimaryButtonProps extends ButtonHTMLAttributes<HTMLButtonEleme
|
|
|
8
8
|
endIconName?: string;
|
|
9
9
|
label: string;
|
|
10
10
|
disabled?: boolean;
|
|
11
|
-
onClick?: () => void;
|
|
11
|
+
onClick?: () => Promise<void> | void;
|
|
12
12
|
fullWidth?: boolean;
|
|
13
13
|
type?: "button" | "submit" | "reset";
|
|
14
|
+
isLoading?: boolean;
|
|
14
15
|
}
|
|
15
16
|
declare const PrimaryButton: React.ForwardRefExoticComponent<PrimaryButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
16
17
|
export default PrimaryButton;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
var __assign = (this && this.__assign) || function () {
|
|
2
3
|
__assign = Object.assign || function(t) {
|
|
3
4
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -9,6 +10,42 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
10
|
};
|
|
10
11
|
return __assign.apply(this, arguments);
|
|
11
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
|
+
};
|
|
12
49
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
50
|
var t = {};
|
|
14
51
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -20,17 +57,61 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
57
|
}
|
|
21
58
|
return t;
|
|
22
59
|
};
|
|
23
|
-
import React, { forwardRef, useImperativeHandle, } from "react";
|
|
60
|
+
import React, { forwardRef, useImperativeHandle, useState, useEffect, } from "react";
|
|
24
61
|
import "./PrimaryButton.css";
|
|
25
62
|
import "../../../styles/global.css";
|
|
26
63
|
var PrimaryButton = forwardRef(function (_a, ref) {
|
|
27
|
-
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, props = __rest(_a, ["startIcon", "endIcon", "startIconName", "endIconName", "label", "disabled", "onClick", "fullWidth", "type"]);
|
|
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"]);
|
|
28
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];
|
|
29
68
|
useImperativeHandle(ref, function () { return buttonRef.current; });
|
|
30
|
-
|
|
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),
|
|
31
112
|
startIcon && (React.createElement("span", { className: "primary-button-icon ".concat(startIconName) })),
|
|
32
113
|
React.createElement("span", { className: "primary-button-label" }, label),
|
|
33
|
-
endIcon && React.createElement("span", { className: "primary-button-icon ".concat(endIconName) })));
|
|
114
|
+
isButtonLoading ? (React.createElement("span", { className: "primary-button-loading-dots" }, loadingDots)) : (endIcon && React.createElement("span", { className: "primary-button-icon ".concat(endIconName) }))));
|
|
34
115
|
});
|
|
35
116
|
PrimaryButton.displayName = "PrimaryButton";
|
|
36
117
|
export default PrimaryButton;
|
|
File without changes
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { ButtonHTMLAttributes } from "react";
|
|
2
2
|
import "./SecondaryButton.css";
|
|
3
3
|
import "../../../styles/global.css";
|
|
4
|
-
export interface SecondaryButtonProps {
|
|
4
|
+
export interface SecondaryButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
5
5
|
startIcon?: React.ReactNode;
|
|
6
6
|
endIcon?: React.ReactNode;
|
|
7
|
+
startIconName?: string;
|
|
8
|
+
endIconName?: string;
|
|
7
9
|
label: string;
|
|
8
10
|
disabled?: boolean;
|
|
9
11
|
mode?: "dark" | "light";
|
|
10
|
-
onClick?: () => void;
|
|
12
|
+
onClick?: () => Promise<void> | void;
|
|
11
13
|
fullWidth?: boolean;
|
|
14
|
+
type?: "button" | "submit" | "reset";
|
|
15
|
+
isLoading?: boolean;
|
|
12
16
|
}
|
|
13
|
-
declare const SecondaryButton: React.
|
|
17
|
+
declare const SecondaryButton: React.ForwardRefExoticComponent<SecondaryButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
14
18
|
export default SecondaryButton;
|
|
@@ -1,11 +1,117 @@
|
|
|
1
|
-
|
|
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";
|
|
2
61
|
import "./SecondaryButton.css";
|
|
3
62
|
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
|
-
|
|
7
|
-
|
|
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) })),
|
|
8
113
|
React.createElement("span", { className: "secondary-button-label" }, label),
|
|
9
|
-
endIcon && React.createElement("span", { className: "secondary-button-icon ".concat(
|
|
10
|
-
};
|
|
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";
|
|
11
117
|
export default SecondaryButton;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -2,8 +2,8 @@ import React, { useState } from "react";
|
|
|
2
2
|
import "./Checkbox.css";
|
|
3
3
|
import "../../../styles/global.css";
|
|
4
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;
|
|
6
|
-
var
|
|
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
7
|
var handleClick = function (e) {
|
|
8
8
|
e.preventDefault();
|
|
9
9
|
e.stopPropagation();
|
|
@@ -14,6 +14,6 @@ var Checkbox = function (_a) {
|
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
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 allaw-icon-close ".concat("checkbox-icon-".concat(checkboxColor), " ").concat(style === "light" ? "checkbox-icon-light" : "") }))));
|
|
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
18
|
};
|
|
19
19
|
export default Checkbox;
|
|
File without changes
|
|
File without changes
|
|
@@ -23,38 +23,48 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
23
23
|
import "./SingleFilter.css";
|
|
24
24
|
import { FilterButtonPrimary, PrimaryButton } from "../buttons";
|
|
25
25
|
import { TinyInfo } from "../typography";
|
|
26
|
-
import React, { useState } from "react";
|
|
26
|
+
import React, { useState, useEffect } from "react";
|
|
27
27
|
var SingleFilter = function (_a) {
|
|
28
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
29
|
var _e = useState(false), isOpen = _e[0], setIsOpen = _e[1];
|
|
30
30
|
var _f = useState(defaultSelectedValue || ""), selectedValue = _f[0], setSelectedValue = _f[1];
|
|
31
|
+
useEffect(function () {
|
|
32
|
+
if (selectedValue) {
|
|
33
|
+
setFilter(selectedValue);
|
|
34
|
+
}
|
|
35
|
+
}, [selectedValue, setFilter]);
|
|
31
36
|
var handleClose = function () {
|
|
32
|
-
setFilter(selectedValue);
|
|
33
37
|
setIsOpen(false);
|
|
34
38
|
};
|
|
35
39
|
var handleButtonTap = function () {
|
|
36
|
-
|
|
40
|
+
setIsOpen(!isOpen);
|
|
37
41
|
};
|
|
38
42
|
var Item = function (_a) {
|
|
39
43
|
var name = _a.name, value = _a.value;
|
|
40
|
-
return (React.createElement("button", { className: "item", onClick: function () {
|
|
44
|
+
return (React.createElement("button", { className: "item", onClick: function () {
|
|
45
|
+
setSelectedValue(value);
|
|
46
|
+
handleClose();
|
|
47
|
+
} },
|
|
41
48
|
React.createElement("div", { className: "round" },
|
|
42
49
|
React.createElement("div", { className: selectedValue === value ? "selected" : "notSelected" })),
|
|
43
50
|
React.createElement("span", null, name)));
|
|
44
51
|
};
|
|
45
52
|
var SmallItem = function (_a) {
|
|
46
53
|
var name = _a.name, value = _a.value;
|
|
47
|
-
return (React.createElement("button", { className: "smallItem", onClick: function () {
|
|
54
|
+
return (React.createElement("button", { className: "smallItem", onClick: function () {
|
|
55
|
+
setSelectedValue(value);
|
|
56
|
+
} },
|
|
48
57
|
React.createElement("div", { className: "round" },
|
|
49
58
|
React.createElement("div", { className: selectedValue === value ? "selected" : "notSelected" })),
|
|
50
59
|
React.createElement("span", null, name)));
|
|
51
60
|
};
|
|
52
61
|
return (React.createElement(React.Fragment, null,
|
|
53
62
|
React.createElement("div", __assign({ className: "baseFilter" }, props),
|
|
54
|
-
React.createElement(FilterButtonPrimary, { onClick: handleButtonTap
|
|
63
|
+
React.createElement(FilterButtonPrimary, { onClick: handleButtonTap },
|
|
55
64
|
children,
|
|
56
65
|
React.createElement("p", { style: { color: "#25BEEB", fontWeight: "600" } }, showNumIndic && "(".concat(selectedValue.length, ")"))),
|
|
57
|
-
isOpen && (React.createElement("div", { className: "options" }, filterData &&
|
|
66
|
+
isOpen && (React.createElement("div", { className: "options" }, filterData &&
|
|
67
|
+
filterData.length > 0 &&
|
|
58
68
|
filterData.map(function (item, idx) { return (React.createElement(Item, { name: item.name, value: item.value, key: idx })); }))),
|
|
59
69
|
React.createElement("div", { className: "optionsSmall", style: { bottom: isOpen ? "0" : "-100%" } },
|
|
60
70
|
React.createElement("div", { className: "row" },
|
|
@@ -62,9 +72,10 @@ var SingleFilter = function (_a) {
|
|
|
62
72
|
React.createElement(TinyInfo, { text: children, variant: "bold14", color: "noir" }),
|
|
63
73
|
React.createElement("button", { className: "closeButton", onClick: handleClose },
|
|
64
74
|
React.createElement("i", { className: "allaw-icon-close" }))),
|
|
65
|
-
React.createElement("div", { className: "choices" }, filterData &&
|
|
75
|
+
React.createElement("div", { className: "choices" }, filterData &&
|
|
76
|
+
filterData.length > 0 &&
|
|
66
77
|
filterData.map(function (item, idx) { return (React.createElement(SmallItem, { name: item.name, value: item.value, key: idx })); })),
|
|
67
78
|
React.createElement(PrimaryButton, { label: "Voir les r\u00E9sultats", onClick: handleClose }))),
|
|
68
|
-
isOpen &&
|
|
79
|
+
isOpen && React.createElement("div", { className: "backdrop", onClick: handleClose })));
|
|
69
80
|
};
|
|
70
81
|
export default SingleFilter;
|
|
File without changes
|
|
File without changes
|