allaw-ui 0.0.303 → 0.0.305
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.js +6 -10
- package/dist/components/atoms/progressBars/ProgressBar.css +1 -0
- package/dist/components/atoms/typography/Heading.css +11 -2
- package/dist/components/atoms/typography/Heading.d.ts +1 -0
- package/dist/components/atoms/typography/Heading.js +2 -2
- package/dist/components/molecules/checkboxForm/CheckboxForm.css +2 -0
- package/dist/components/molecules/checkboxForm/CheckboxForm.js +8 -1
- package/package.json +1 -1
|
@@ -1,19 +1,15 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react";
|
|
2
2
|
import "./Checkbox.css";
|
|
3
3
|
import "../../../styles/global.css";
|
|
4
4
|
var Checkbox = function (_a) {
|
|
5
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
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}, [checked]);
|
|
10
|
-
var handleClick = function () {
|
|
11
|
-
var newChecked = !isChecked;
|
|
12
|
-
setIsChecked(newChecked);
|
|
6
|
+
var handleClick = function (e) {
|
|
7
|
+
e.preventDefault();
|
|
8
|
+
e.stopPropagation();
|
|
13
9
|
if (onChange) {
|
|
14
|
-
onChange(
|
|
10
|
+
onChange(!checked);
|
|
15
11
|
}
|
|
16
12
|
};
|
|
17
|
-
return (React.createElement("button", { className: "checkbox ".concat(
|
|
13
|
+
return (React.createElement("button", { className: "checkbox ".concat(checked ? "checkbox-pressed" : "checkbox-default", " ").concat(isWhite ? "checkbox-white" : "checkbox-black"), onClick: handleClick }, checked && (React.createElement("span", { className: "checkbox-icon allaw-icon-close ".concat(isWhite ? "checkbox-icon-white" : "checkbox-icon-black") }))));
|
|
18
14
|
};
|
|
19
15
|
export default Checkbox;
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
font-family: Poppins;
|
|
5
5
|
font-style: normal;
|
|
6
6
|
line-height: normal;
|
|
7
|
-
text-align: center;
|
|
8
7
|
}
|
|
9
8
|
|
|
10
9
|
.heading.h1 {
|
|
@@ -65,4 +64,14 @@
|
|
|
65
64
|
color: var(--pure-white);
|
|
66
65
|
}
|
|
67
66
|
|
|
68
|
-
|
|
67
|
+
.heading.align-left {
|
|
68
|
+
text-align: left;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.heading.align-justify {
|
|
72
|
+
text-align: justify;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.heading.align-center {
|
|
76
|
+
text-align: center;
|
|
77
|
+
}
|
|
@@ -4,6 +4,7 @@ export interface HeadingProps {
|
|
|
4
4
|
variant: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "h7";
|
|
5
5
|
color?: "bleu-allaw" | "mid-grey" | "dark-grey" | "noir" | "pure-white";
|
|
6
6
|
text: React.ReactNode;
|
|
7
|
+
align?: "left" | "justify" | "center";
|
|
7
8
|
}
|
|
8
9
|
declare const Heading: React.FC<HeadingProps>;
|
|
9
10
|
export default Heading;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "./Heading.css";
|
|
3
3
|
var Heading = function (_a) {
|
|
4
|
-
var variant = _a.variant, _b = _a.color, color = _b === void 0 ? "pure-white" : _b, text = _a.text;
|
|
5
|
-
return React.createElement("div", { className: "heading ".concat(variant, " color-").concat(color) }, text);
|
|
4
|
+
var variant = _a.variant, _b = _a.color, color = _b === void 0 ? "pure-white" : _b, text = _a.text, _c = _a.align, align = _c === void 0 ? "center" : _c;
|
|
5
|
+
return (React.createElement("div", { className: "heading ".concat(variant, " color-").concat(color, " align-").concat(align) }, text));
|
|
6
6
|
};
|
|
7
7
|
export default Heading;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
gap: 8px;
|
|
5
|
+
cursor: pointer;
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
.checkbox-form-black {
|
|
@@ -15,6 +16,7 @@
|
|
|
15
16
|
.checkbox-form-label-container {
|
|
16
17
|
display: flex;
|
|
17
18
|
align-items: center;
|
|
19
|
+
cursor: pointer;
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
.checkbox-form-required {
|
|
@@ -4,9 +4,16 @@ import Paragraph from "../../atoms/typography/Paragraph";
|
|
|
4
4
|
import "./CheckboxForm.css";
|
|
5
5
|
var CheckboxForm = function (_a) {
|
|
6
6
|
var _b = _a.checked, checked = _b === void 0 ? false : _b, onChange = _a.onChange, _c = _a.isWhite, isWhite = _c === void 0 ? false : _c, label = _a.label, _d = _a.isRequired, isRequired = _d === void 0 ? false : _d;
|
|
7
|
+
var handleClick = function (e) {
|
|
8
|
+
e.preventDefault();
|
|
9
|
+
e.stopPropagation();
|
|
10
|
+
if (onChange) {
|
|
11
|
+
onChange(!checked);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
7
14
|
return (React.createElement("div", { className: "checkbox-form ".concat(isWhite ? "checkbox-form-white" : "checkbox-form-black") },
|
|
8
15
|
React.createElement(Checkbox, { checked: checked, onChange: onChange, isWhite: isWhite }),
|
|
9
|
-
label && (React.createElement("div", { className: "checkbox-form-label-container" },
|
|
16
|
+
label && (React.createElement("div", { className: "checkbox-form-label-container", onClick: handleClick },
|
|
10
17
|
React.createElement(Paragraph, { variant: "semiBold", color: isWhite ? "pure-white" : "noir", text: label }),
|
|
11
18
|
isRequired && (React.createElement("span", { className: "checkbox-form-required" },
|
|
12
19
|
"\u00A0",
|