allaw-ui 3.2.5 → 3.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/atoms/checkboxes/Checkbox.d.ts +2 -1
- package/dist/components/atoms/checkboxes/Checkbox.js +3 -3
- package/dist/components/atoms/radios/RadioButton.d.ts +2 -1
- package/dist/components/atoms/radios/RadioButton.js +3 -3
- package/dist/components/molecules/checkboxForm/CheckboxForm.d.ts +1 -0
- package/dist/components/molecules/checkboxForm/CheckboxForm.js +2 -2
- package/dist/components/molecules/proCard/ProCard.css +20 -3
- package/dist/components/molecules/proCard/ProCard.d.ts +1 -0
- package/dist/components/molecules/proCard/ProCard.js +7 -2
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import "./Checkbox.css";
|
|
3
2
|
import "../../../styles/global.css";
|
|
3
|
+
import "./Checkbox.css";
|
|
4
4
|
export interface CheckboxProps {
|
|
5
5
|
id?: string;
|
|
6
6
|
checked?: boolean;
|
|
@@ -9,6 +9,7 @@ export interface CheckboxProps {
|
|
|
9
9
|
size?: "default" | "small";
|
|
10
10
|
style?: "default" | "light" | "form";
|
|
11
11
|
markType?: "cross" | "check";
|
|
12
|
+
dataTestId?: string;
|
|
12
13
|
}
|
|
13
14
|
declare const Checkbox: React.FC<CheckboxProps>;
|
|
14
15
|
export default Checkbox;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
|
-
import "./Checkbox.css";
|
|
3
2
|
import "../../../styles/global.css";
|
|
3
|
+
import "./Checkbox.css";
|
|
4
4
|
var Checkbox = function (_a) {
|
|
5
|
-
var id = _a.id, _b = _a.checked, checked = _b === void 0 ? false : _b, onChange = _a.onChange, color = _a.color, _c = _a.size, size = _c === void 0 ? "default" : _c, _d = _a.style, style = _d === void 0 ? "default" : _d, _e = _a.markType, markType = _e === void 0 ? "cross" : _e;
|
|
5
|
+
var id = _a.id, _b = _a.checked, checked = _b === void 0 ? false : _b, onChange = _a.onChange, color = _a.color, _c = _a.size, size = _c === void 0 ? "default" : _c, _d = _a.style, style = _d === void 0 ? "default" : _d, _e = _a.markType, markType = _e === void 0 ? "cross" : _e, dataTestId = _a.dataTestId;
|
|
6
6
|
var _f = useState(checked), isChecked = _f[0], setIsChecked = _f[1];
|
|
7
7
|
var handleClick = function (e) {
|
|
8
8
|
e.preventDefault();
|
|
@@ -15,6 +15,6 @@ var Checkbox = function (_a) {
|
|
|
15
15
|
};
|
|
16
16
|
var checkboxColor = style === "light" ? "light" : color;
|
|
17
17
|
var colorClass = checkboxColor ? "checkbox-".concat(checkboxColor) : "";
|
|
18
|
-
return (React.createElement("button", { id: id, className: "checkbox ".concat(isChecked ? "checkbox-pressed" : "checkbox-default", " ").concat(colorClass, " ").concat(size === "small" ? "checkbox-small" : "", " ").concat(style === "light" ? "checkbox-light" : "", " ").concat(style === "form" ? "checkbox-style-form" : ""), onClick: handleClick, "data-
|
|
18
|
+
return (React.createElement("button", { id: id, className: "checkbox ".concat(isChecked ? "checkbox-pressed" : "checkbox-default", " ").concat(colorClass, " ").concat(size === "small" ? "checkbox-small" : "", " ").concat(style === "light" ? "checkbox-light" : "", " ").concat(style === "form" ? "checkbox-style-form" : ""), onClick: handleClick, "data-testid": dataTestId }, isChecked && (React.createElement("span", { className: "checkbox-icon ".concat(markType === "cross" ? "allaw-icon-close" : "allaw-icon-check", " ").concat(colorClass, " ").concat(style === "light" ? "checkbox-icon-light" : "") }))));
|
|
19
19
|
};
|
|
20
20
|
export default Checkbox;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import "./RadioButton.css";
|
|
3
2
|
import "../../../styles/global.css";
|
|
3
|
+
import "./RadioButton.css";
|
|
4
4
|
export interface RadioButtonProps {
|
|
5
5
|
label: string;
|
|
6
6
|
style?: "user" | "hybride";
|
|
7
7
|
isActive: boolean;
|
|
8
8
|
onClick: () => void;
|
|
9
|
+
dataTestId?: string;
|
|
9
10
|
}
|
|
10
11
|
declare const RadioButton: React.FC<RadioButtonProps>;
|
|
11
12
|
export default RadioButton;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import "./RadioButton.css";
|
|
3
2
|
import "../../../styles/global.css";
|
|
3
|
+
import "./RadioButton.css";
|
|
4
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 },
|
|
5
|
+
var label = _a.label, _b = _a.style, style = _b === void 0 ? "user" : _b, isActive = _a.isActive, onClick = _a.onClick, dataTestId = _a.dataTestId;
|
|
6
|
+
return (React.createElement("button", { className: "radio-button radio-button-".concat(style, " ").concat(isActive ? "radio-button-".concat(style, "-active") : ""), onClick: onClick, "data-testid": dataTestId },
|
|
7
7
|
React.createElement("span", { className: "radio-button-icon" }, isActive && React.createElement("span", { className: "radio-button-icon-inner" })),
|
|
8
8
|
React.createElement("span", { className: "radio-button-label" }, label)));
|
|
9
9
|
};
|
|
@@ -14,6 +14,7 @@ export interface CheckboxFormProps {
|
|
|
14
14
|
size?: "default" | "small";
|
|
15
15
|
style?: "default" | "light" | "form";
|
|
16
16
|
markType?: "cross" | "check";
|
|
17
|
+
dataTestId?: string;
|
|
17
18
|
}
|
|
18
19
|
declare const CheckboxForm: React.FC<CheckboxFormProps>;
|
|
19
20
|
export default CheckboxForm;
|
|
@@ -3,7 +3,7 @@ import Checkbox from "../../atoms/checkboxes/Checkbox";
|
|
|
3
3
|
import Paragraph from "../../atoms/typography/Paragraph";
|
|
4
4
|
import "./CheckboxForm.css";
|
|
5
5
|
var CheckboxForm = function (_a) {
|
|
6
|
-
var id = _a.id, _b = _a.checked, checked = _b === void 0 ? false : _b, onChange = _a.onChange, color = _a.color, label = _a.label, _c = _a.isRequired, isRequired = _c === void 0 ? false : _c, linkText = _a.linkText, linkUrl = _a.linkUrl, onLinkClick = _a.onLinkClick, _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 id = _a.id, _b = _a.checked, checked = _b === void 0 ? false : _b, onChange = _a.onChange, color = _a.color, label = _a.label, _c = _a.isRequired, isRequired = _c === void 0 ? false : _c, linkText = _a.linkText, linkUrl = _a.linkUrl, dataTestId = _a.dataTestId, onLinkClick = _a.onLinkClick, _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;
|
|
7
7
|
var checkboxId = id || "checkbox-".concat(Math.random().toString(36).substr(2, 9));
|
|
8
8
|
var handleCheckboxChange = function (checked) {
|
|
9
9
|
if (onChange) {
|
|
@@ -18,7 +18,7 @@ var CheckboxForm = function (_a) {
|
|
|
18
18
|
: color || "noir";
|
|
19
19
|
var colorClass = checkboxColor ? "checkbox-form-".concat(checkboxColor) : "";
|
|
20
20
|
return (React.createElement("div", { className: "checkbox-form ".concat(colorClass, " ").concat(size === "small" ? "checkbox-form-small" : "") },
|
|
21
|
-
React.createElement(Checkbox, { id: checkboxId, checked: checked, onChange: handleCheckboxChange, color: checkboxColor, size: size, style: style, markType: markType }),
|
|
21
|
+
React.createElement(Checkbox, { id: checkboxId, checked: checked, onChange: handleCheckboxChange, color: checkboxColor, size: size, style: style, markType: markType, dataTestId: dataTestId }),
|
|
22
22
|
label && (React.createElement("label", { htmlFor: checkboxId, className: "checkbox-form-label-container" },
|
|
23
23
|
React.createElement(Paragraph, { variant: style === "form" ? "medium" : "semiBold", color: color || (style === "form" ? undefined : "noir"), text: React.createElement(React.Fragment, null,
|
|
24
24
|
React.createElement("span", null, label),
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
.pro-card {
|
|
4
4
|
display: flex;
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
padding: 24px 16px;
|
|
7
|
-
flex-direction:
|
|
8
|
-
|
|
7
|
+
flex-direction: row;
|
|
8
|
+
|
|
9
|
+
justify-content: space-between;
|
|
10
|
+
align-items: center;
|
|
9
11
|
gap: 16px;
|
|
10
12
|
border-radius: 16px;
|
|
11
13
|
background: var(--Primary-Blanc, #fff);
|
|
@@ -61,6 +63,21 @@
|
|
|
61
63
|
border-radius: 50%;
|
|
62
64
|
}
|
|
63
65
|
|
|
66
|
+
.pro-card-button-action {
|
|
67
|
+
background-color: #25beeb;
|
|
68
|
+
border-radius: 8px;
|
|
69
|
+
padding: 0.75rem 1rem;
|
|
70
|
+
color: #fff;
|
|
71
|
+
font-size: 14px;
|
|
72
|
+
display: flex;
|
|
73
|
+
flex-direction: row;
|
|
74
|
+
align-items: center;
|
|
75
|
+
gap: 0.5rem;
|
|
76
|
+
font-family: var(--font-open-sans, "Open Sans");
|
|
77
|
+
font-weight: 600;
|
|
78
|
+
cursor: pointer;
|
|
79
|
+
}
|
|
80
|
+
|
|
64
81
|
.pro-card-verified-icon {
|
|
65
82
|
position: relative;
|
|
66
83
|
color: var(--primary-blue, #25beeb);
|
|
@@ -2,9 +2,10 @@ import React from "react";
|
|
|
2
2
|
import "./ProCard.css";
|
|
3
3
|
import OtherStatusTag from "../../atoms/tags/OtherStatusTag";
|
|
4
4
|
import Image from "next/image";
|
|
5
|
+
import Link from "next/link";
|
|
5
6
|
var NoPhoto = "/assets/NoPhoto.png";
|
|
6
7
|
var ProCard = function (_a) {
|
|
7
|
-
var imageUrl = _a.imageUrl, job = _a.job, firstName = _a.firstName, lastName = _a.lastName, address = _a.address, profileUrl = _a.profileUrl, _b = _a.isPro, isPro = _b === void 0 ? false : _b;
|
|
8
|
+
var imageUrl = _a.imageUrl, job = _a.job, firstName = _a.firstName, lastName = _a.lastName, address = _a.address, profileUrl = _a.profileUrl, _b = _a.isPro, isPro = _b === void 0 ? false : _b, _c = _a.showButton, showButton = _c === void 0 ? false : _c;
|
|
8
9
|
var uppercaseJob = job.toUpperCase();
|
|
9
10
|
return (React.createElement("div", { className: "pro-card" },
|
|
10
11
|
React.createElement("div", { className: "pro-card-content" },
|
|
@@ -20,6 +21,10 @@ var ProCard = function (_a) {
|
|
|
20
21
|
React.createElement("a", { href: profileUrl }, "".concat(firstName, " ").concat(lastName))))),
|
|
21
22
|
address && /[a-zA-Z0-9]/.test(address) && (React.createElement("div", { className: "pro-card-address" },
|
|
22
23
|
React.createElement("i", { className: "icon allaw-icon-map-pin" }),
|
|
23
|
-
React.createElement("span", null, address))))
|
|
24
|
+
React.createElement("span", null, address)))),
|
|
25
|
+
showButton &&
|
|
26
|
+
React.createElement(Link, { href: profileUrl || "#", className: "pro-card-button-action" },
|
|
27
|
+
React.createElement("i", { className: "allaw-icon-calendar" }),
|
|
28
|
+
" Prendre rendez-vous ")));
|
|
24
29
|
};
|
|
25
30
|
export default ProCard;
|