allaw-ui 3.2.8 → 3.3.0

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.
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
- import "./TextArea.css";
3
2
  import "../../../styles/global.css";
4
3
  import { commonRegex } from "../../../utils/regex";
4
+ import "./TextArea.css";
5
5
  export interface TextAreaProps {
6
6
  title: string;
7
7
  style?: "default" | "variation";
@@ -16,7 +16,7 @@ export interface TextAreaProps {
16
16
  minHeight?: number;
17
17
  variant?: "bold" | "semiBold" | "medium";
18
18
  color?: "bleu-allaw" | "mid-grey" | "dark-grey" | "noir" | "pure-white" | "grey-venom" | "venom-grey-dark";
19
- dataCy?: string;
19
+ dataTestId?: string;
20
20
  }
21
21
  export interface TextAreaRef {
22
22
  validate: () => boolean;
@@ -1,12 +1,12 @@
1
1
  // TextArea.tsx
2
- import React, { useState, useEffect, useCallback, forwardRef, useImperativeHandle, useRef, } from "react";
3
- import "./TextArea.css";
2
+ import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useRef, useState, } from "react";
4
3
  import "../../../styles/global.css";
5
4
  import { commonRegex } from "../../../utils/regex";
6
- import TinyInfo from "../typography/TinyInfo";
7
5
  import Paragraph from "../typography/Paragraph";
6
+ import TinyInfo from "../typography/TinyInfo";
7
+ import "./TextArea.css";
8
8
  var TextArea = forwardRef(function (_a, ref) {
9
- var title = _a.title, _b = _a.style, style = _b === void 0 ? "default" : _b, placeholder = _a.placeholder, _c = _a.isRequired, isRequired = _c === void 0 ? false : _c, validate = _a.validate, onError = _a.onError, onChange = _a.onChange, propValue = _a.value, propError = _a.error, _d = _a.maxHeight, maxHeight = _d === void 0 ? 400 : _d, minHeight = _a.minHeight, _e = _a.variant, variant = _e === void 0 ? "medium" : _e, _f = _a.color, color = _f === void 0 ? "noir" : _f, dataCy = _a.dataCy;
9
+ var title = _a.title, _b = _a.style, style = _b === void 0 ? "default" : _b, placeholder = _a.placeholder, _c = _a.isRequired, isRequired = _c === void 0 ? false : _c, validate = _a.validate, onError = _a.onError, onChange = _a.onChange, propValue = _a.value, propError = _a.error, _d = _a.maxHeight, maxHeight = _d === void 0 ? 400 : _d, minHeight = _a.minHeight, _e = _a.variant, variant = _e === void 0 ? "medium" : _e, _f = _a.color, color = _f === void 0 ? "noir" : _f, dataTestId = _a.dataTestId;
10
10
  var _g = useState(propValue || ""), value = _g[0], setValue = _g[1];
11
11
  var _h = useState(propError || ""), error = _h[0], setError = _h[1];
12
12
  var _j = useState(false), isTouched = _j[0], setIsTouched = _j[1];
@@ -66,10 +66,10 @@ var TextArea = forwardRef(function (_a, ref) {
66
66
  "\u00A0",
67
67
  "*"))),
68
68
  React.createElement("div", { className: "text-area-container" },
69
- React.createElement("div", { className: "text-area-input", "data-cy": dataCy || "text-area" },
69
+ React.createElement("div", { className: "text-area-input", "data-testid": dataTestId || "text-area" },
70
70
  React.createElement("textarea", { ref: textareaRef, placeholder: placeholder, className: minHeight !== undefined
71
71
  ? "text-area-placeholder no-transition"
72
- : "text-area-placeholder", value: value, onChange: handleChange, onBlur: handleBlur, style: textareaStyle })),
72
+ : "text-area-placeholder", value: value, onChange: handleChange, onBlur: handleBlur, style: textareaStyle, "data-testid": dataTestId || "text-area" })),
73
73
  error && isTouched && (React.createElement("div", { className: "error-message" },
74
74
  React.createElement(TinyInfo, { variant: "medium12", color: "actions-error", text: error }))))));
75
75
  });
@@ -8,6 +8,7 @@ export interface SelectableListItemProps {
8
8
  isActive: boolean;
9
9
  onClick: () => void;
10
10
  icon?: string;
11
+ testIdKey?: string | number;
11
12
  }
12
13
  declare const SelectableListItem: React.FC<SelectableListItemProps>;
13
14
  export default SelectableListItem;
@@ -1,12 +1,12 @@
1
1
  import React from "react";
2
- import styles from "./SelectableListItem.module.css";
3
2
  import "../../../styles/global.css";
4
3
  import "../../../styles/icons.css";
5
4
  import { slugify } from "../../../utils/utils";
5
+ import styles from "./SelectableListItem.module.css";
6
6
  var SelectableListItem = function (_a) {
7
- var label = _a.label, duration = _a.duration, price = _a.price, isActive = _a.isActive, onClick = _a.onClick, icon = _a.icon;
7
+ var label = _a.label, duration = _a.duration, price = _a.price, isActive = _a.isActive, onClick = _a.onClick, icon = _a.icon, testIdKey = _a.testIdKey;
8
8
  var hasIcon = icon && icon.length > 0;
9
- return (React.createElement("button", { className: "".concat(styles.container, " ").concat(isActive ? styles.active : "", " ").concat(hasIcon ? styles.withIcon : ""), onClick: onClick, "data-cy": "item-".concat(slugify(label)) },
9
+ return (React.createElement("button", { className: "".concat(styles.container, " ").concat(isActive ? styles.active : "", " ").concat(hasIcon ? styles.withIcon : ""), onClick: onClick, "data-testid": "item-".concat(testIdKey !== undefined ? testIdKey : slugify(label)) },
10
10
  React.createElement("div", { className: styles.iconContainer }, isActive && React.createElement("span", { className: styles.activeIcon })),
11
11
  hasIcon && (React.createElement("div", { className: styles.iconWrapper },
12
12
  React.createElement("i", { className: "".concat(icon, " ").concat(styles.icon) }))),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allaw-ui",
3
- "version": "3.2.8",
3
+ "version": "3.3.0",
4
4
  "description": "Composants UI pour l'application Allaw",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",