allaw-ui 0.0.343 → 0.0.345

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.
@@ -27,6 +27,8 @@
27
27
  height: 20px;
28
28
  border: 2px solid;
29
29
  border-radius: 4px;
30
+ padding-left: 1px;
31
+ padding-bottom: 1px;
30
32
  }
31
33
 
32
34
  .checkbox-small-pressed {
@@ -114,3 +116,17 @@
114
116
  border-color: var(--venom-grey-dark);
115
117
  color: var(--venom-grey-dark);
116
118
  }
119
+
120
+ .checkbox-light {
121
+ border-color: var(--mid-grey);
122
+ border-width: 1px;
123
+ color: var(--bleu-allaw);
124
+ }
125
+
126
+ .checkbox-icon-light {
127
+ color: var(--bleu-allaw);
128
+ }
129
+
130
+ .checkbox-icon-light-pressed {
131
+ padding-left: 5px;
132
+ }
@@ -7,6 +7,7 @@ export interface CheckboxProps {
7
7
  onChange?: (checked: boolean) => void;
8
8
  color?: string;
9
9
  size?: "default" | "small";
10
+ style?: "default" | "light";
10
11
  }
11
12
  declare const Checkbox: React.FC<CheckboxProps>;
12
13
  export default Checkbox;
@@ -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;
6
- var _e = useState(checked), isChecked = _e[0], setIsChecked = _e[1];
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 _f = useState(checked), isChecked = _f[0], setIsChecked = _f[1];
7
7
  var handleClick = function (e) {
8
8
  e.preventDefault();
9
9
  e.stopPropagation();
@@ -13,6 +13,7 @@ var Checkbox = function (_a) {
13
13
  onChange(newChecked);
14
14
  }
15
15
  };
16
- return (React.createElement("button", { id: id, className: "checkbox ".concat(isChecked ? "checkbox-pressed" : "checkbox-default", " ").concat("checkbox-".concat(color), " ").concat(size === "small" ? "checkbox-small" : ""), onClick: handleClick }, isChecked && (React.createElement("span", { className: "checkbox-icon allaw-icon-close ".concat("checkbox-icon-".concat(color)) }))));
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
18
  };
18
19
  export default Checkbox;
@@ -6,7 +6,7 @@
6
6
  }
7
7
 
8
8
  .checkbox-form-small {
9
- gap: 0.5rem;
9
+ gap: 0.75rem;
10
10
  }
11
11
 
12
12
  .checkbox-form-label-container {
@@ -4,12 +4,13 @@ import "./CheckboxForm.css";
4
4
  export interface CheckboxFormProps {
5
5
  checked?: boolean;
6
6
  onChange?: (checked: boolean) => void;
7
- color?: ParagraphProps["color"] | "grey-venom" | "venom-grey-dark";
7
+ color?: ParagraphProps["color"];
8
8
  label?: React.ReactNode;
9
9
  isRequired?: boolean;
10
10
  linkText?: string;
11
11
  linkUrl?: string;
12
12
  size?: "default" | "small";
13
+ style?: "default" | "light";
13
14
  }
14
15
  declare const CheckboxForm: React.FC<CheckboxFormProps>;
15
16
  export default CheckboxForm;
@@ -3,15 +3,16 @@ 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 _b = _a.checked, checked = _b === void 0 ? false : _b, onChange = _a.onChange, _c = _a.color, color = _c === void 0 ? "noir" : _c, label = _a.label, _d = _a.isRequired, isRequired = _d === void 0 ? false : _d, linkText = _a.linkText, linkUrl = _a.linkUrl, _e = _a.size, size = _e === void 0 ? "default" : _e;
6
+ var _b = _a.checked, checked = _b === void 0 ? false : _b, onChange = _a.onChange, _c = _a.color, color = _c === void 0 ? "noir" : _c, label = _a.label, _d = _a.isRequired, isRequired = _d === void 0 ? false : _d, linkText = _a.linkText, linkUrl = _a.linkUrl, _e = _a.size, size = _e === void 0 ? "default" : _e, _f = _a.style, style = _f === void 0 ? "default" : _f;
7
7
  var checkboxId = "checkbox-".concat(Math.random().toString(36).substr(2, 9));
8
8
  var handleCheckboxChange = function (checked) {
9
9
  if (onChange) {
10
10
  onChange(checked);
11
11
  }
12
12
  };
13
- return (React.createElement("div", { className: "checkbox-form checkbox-form-".concat(color, " ").concat(size === "small" ? "checkbox-form-small" : "") },
14
- React.createElement(Checkbox, { id: checkboxId, checked: checked, onChange: handleCheckboxChange, color: color, size: size }),
13
+ var checkboxColor = style === "light" ? "light" : color;
14
+ return (React.createElement("div", { className: "checkbox-form checkbox-form-".concat(checkboxColor, " ").concat(size === "small" ? "checkbox-form-small" : "") },
15
+ React.createElement(Checkbox, { id: checkboxId, checked: checked, onChange: handleCheckboxChange, color: checkboxColor, size: size, style: style }),
15
16
  label && (React.createElement("label", { htmlFor: checkboxId, className: "checkbox-form-label-container" },
16
17
  React.createElement(Paragraph, { variant: "semiBold", color: color, text: React.createElement(React.Fragment, null,
17
18
  React.createElement("span", null, label),
@@ -13,6 +13,7 @@
13
13
  --active-grey: #e9eef5;
14
14
  --blue-lightning: #f6fcfe;
15
15
  --fond-de-selection: #f6fcfe;
16
+ --lightSteelBlue: #a2b5c8;
16
17
 
17
18
  /* Tag colors */
18
19
  --tag-white: #eef5fc;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allaw-ui",
3
- "version": "0.0.343",
3
+ "version": "0.0.345",
4
4
  "description": "Composants UI pour l'application Allaw",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",