allaw-ui 3.2.4 → 3.2.6

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.
@@ -88,7 +88,7 @@
88
88
 
89
89
  /* Style round */
90
90
  .tab-navigation.tab-navigation--round {
91
- padding: 4px;
91
+ padding: 0px;
92
92
  border-radius: 8px;
93
93
  gap: 8px;
94
94
  }
@@ -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-cy": "checkbox-".concat(id) }, isChecked && (React.createElement("span", { className: "checkbox-icon ".concat(markType === "cross" ? "allaw-icon-close" : "allaw-icon-check", " ").concat(colorClass, " ").concat(style === "light" ? "checkbox-icon-light" : "") }))));
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),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allaw-ui",
3
- "version": "3.2.4",
3
+ "version": "3.2.6",
4
4
  "description": "Composants UI pour l'application Allaw",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",