allaw-ui 2.8.9 → 2.9.1

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.
@@ -11,7 +11,7 @@ export interface ColoredCheckboxProps {
11
11
  size?: "default" | "small";
12
12
  markType?: "cross" | "check";
13
13
  isSignedIn?: boolean;
14
- unlinkIconPath?: string;
14
+ unlinkIconPath?: any;
15
15
  }
16
16
  declare const ColoredCheckbox: React.FC<ColoredCheckboxProps>;
17
17
  export default ColoredCheckbox;
@@ -1,9 +1,6 @@
1
1
  import React, { useState } from "react";
2
2
  import styles from "./ColoredCheckbox.module.css";
3
3
  import "../../../styles/global.css"; // Pour importer les icônes allaw
4
- // URL data en base64 pour l'icône de déconnexion (solution de secours)
5
- // Cette icône représente un lien brisé/déconnecté en rouge
6
- var DEFAULT_UNLINK_ICON = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTAuNjY3IDEwLjY2N0w4LjY2NyA4LjY2NyIgc3Ryb2tlPSIjRkYwMDAwIiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PHBhdGggZD0iTTEyLjY2NyA0LjY2N0MxMy40MDMgNS40MDMgMTMuNDAzIDYuNTk3IDEyLjY2NyA3LjMzM0MxMS45MyA4LjA3IDEwLjczNyA4LjA3IDEwIDcuMzMzQzkuMjYzIDYuNTk3IDkuMjYzIDUuNDAzIDEwIDQuNjY3QzEwLjczNyAzLjkzIDExLjkzIDMuOTMgMTIuNjY3IDQuNjY3WiIgc3Ryb2tlPSIjRkYwMDAwIiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PHBhdGggZD0iTTUuMzMzIDExLjMzM0M2LjA3IDEyLjA3IDcuMjYzIDEyLjA3IDggMTEuMzMzQzguNzM3IDEwLjU5NyA4LjczNyA5LjQwMyA4IDguNjY3QzcuMjYzIDcuOTMgNi4wNyA3LjkzIDUuMzMzIDguNjY3QzQuNTk3IDkuNDAzIDQuNTk3IDEwLjU5NyA1LjMzMyAxMS4zMzNaIiBzdHJva2U9IiNGRjAwMDAiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48cGF0aCBkPSJNNy4zMzMgNy4zMzNMNS4zMzMgNS4zMzMiIHN0cm9rZT0iI0ZGMDAwMCIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==";
7
4
  // Fonction pour formater l'email avec des ellipses intelligentes
8
5
  var formatEmail = function (email) {
9
6
  if (!email || typeof email !== "string" || !email.includes("@")) {
@@ -24,7 +21,6 @@ var formatEmail = function (email) {
24
21
  var ColoredCheckbox = function (_a) {
25
22
  var id = _a.id, _b = _a.label, label = _b === void 0 ? "mon-email@provider.com" : _b, _c = _a.checked, checked = _c === void 0 ? false : _c, onChange = _a.onChange, _d = _a.boxColor, boxColor = _d === void 0 ? "#000000" : _d, _e = _a.markColor, markColor = _e === void 0 ? "#FFFFFF" : _e, _f = _a.textColor, textColor = _f === void 0 ? "#000000" : _f, _g = _a.size, size = _g === void 0 ? "default" : _g, _h = _a.markType, markType = _h === void 0 ? "cross" : _h, _j = _a.isSignedIn, isSignedIn = _j === void 0 ? true : _j, _k = _a.unlinkIconPath, unlinkIconPath = _k === void 0 ? "/assets/images/allaw-icon-unlink-red.svg" : _k;
26
23
  var _l = useState(checked), isChecked = _l[0], setIsChecked = _l[1];
27
- var _m = useState(false), iconError = _m[0], setIconError = _m[1];
28
24
  // Generate a random ID if none is provided
29
25
  var checkboxId = id || "checkbox-".concat(Math.random().toString(36).substr(2, 9));
30
26
  var handleClick = function (e) {
@@ -57,7 +53,7 @@ var ColoredCheckbox = function (_a) {
57
53
  : label;
58
54
  return (React.createElement("div", { className: styles.container },
59
55
  React.createElement("button", { id: checkboxId, className: "".concat(styles.checkbox, " ").concat(isChecked ? styles.checked : "", " ").concat(size === "small" ? styles.small : ""), onClick: handleClick, style: checkboxStyle, "aria-checked": isChecked, role: "checkbox", "data-cy": "checkbox-".concat(checkboxId) }, isChecked && (React.createElement("span", { className: "".concat(styles.icon, " ").concat(markType === "cross" ? "allaw-icon-close" : "allaw-icon-check"), style: markStyle }))),
60
- isSignedIn === false && (React.createElement("img", { src: iconError ? DEFAULT_UNLINK_ICON : unlinkIconPath, alt: "Non connect\u00E9", className: styles.unlinkIcon, width: "16", height: "16", style: { width: "16px", height: "16px" }, onError: function () { return setIconError(true); } })),
56
+ isSignedIn === false && (React.createElement("img", { src: unlinkIconPath, alt: "Non connect\u00E9", className: styles.unlinkIcon, width: "16", height: "16", style: { width: "16px", height: "16px" } })),
61
57
  label && (React.createElement("label", { htmlFor: checkboxId, className: styles.label, style: labelStyle, onClick: handleClick }, formattedLabel))));
62
58
  };
63
59
  export default ColoredCheckbox;
@@ -4,13 +4,17 @@ declare namespace _default {
4
4
  export let tags: string[];
5
5
  export namespace args {
6
6
  let label: string;
7
+ let checked: boolean;
8
+ let boxColor: string;
9
+ let markType: string;
7
10
  }
8
11
  export namespace argTypes {
9
- export namespace checked {
12
+ export namespace checked_1 {
10
13
  namespace control {
11
14
  let type: string;
12
15
  }
13
16
  }
17
+ export { checked_1 as checked };
14
18
  export namespace onChange {
15
19
  let action: string;
16
20
  }
@@ -19,11 +23,12 @@ declare namespace _default {
19
23
  export { control_1 as control };
20
24
  }
21
25
  export { label_1 as label };
22
- export namespace boxColor {
26
+ export namespace boxColor_1 {
23
27
  let control_2: string;
24
28
  export { control_2 as control };
25
29
  export let defaultValue: string;
26
30
  }
31
+ export { boxColor_1 as boxColor };
27
32
  export namespace markColor {
28
33
  let control_3: string;
29
34
  export { control_3 as control };
@@ -44,7 +49,7 @@ declare namespace _default {
44
49
  }
45
50
  export { control_5 as control };
46
51
  }
47
- export namespace markType {
52
+ export namespace markType_1 {
48
53
  export namespace control_6 {
49
54
  let type_2: string;
50
55
  export { type_2 as type };
@@ -53,6 +58,7 @@ declare namespace _default {
53
58
  }
54
59
  export { control_6 as control };
55
60
  }
61
+ export { markType_1 as markType };
56
62
  export namespace isSignedIn {
57
63
  export namespace control_7 {
58
64
  let type_3: string;
@@ -16,7 +16,10 @@ export default {
16
16
  component: ColoredCheckbox,
17
17
  tags: ["autodocs"],
18
18
  args: {
19
- label: "Sample label",
19
+ label: "my-email-address@provider.com",
20
+ checked: true,
21
+ boxColor: "#25beeb",
22
+ markType: "check",
20
23
  },
21
24
  argTypes: {
22
25
  checked: {
@@ -49,7 +52,7 @@ export default {
49
52
  markType: {
50
53
  control: {
51
54
  type: "select",
52
- options: ["check", "cross"],
55
+ options: ["cross", "check"],
53
56
  },
54
57
  },
55
58
  isSignedIn: {
@@ -85,13 +88,13 @@ var Template = function (args) {
85
88
  };
86
89
  export var Default = Template.bind({});
87
90
  Default.args = {
88
- checked: false,
89
- label: "Default Checkbox",
90
- boxColor: "#000000",
91
+ checked: true,
92
+ label: "my-email-address@provider.com",
93
+ boxColor: "#25beeb",
91
94
  markColor: "#FFFFFF",
92
95
  textColor: "#000000",
93
96
  size: "default",
94
- markType: "cross",
97
+ markType: "check",
95
98
  isSignedIn: true,
96
99
  };
97
100
  export var Checked = Template.bind({});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allaw-ui",
3
- "version": "2.8.9",
3
+ "version": "2.9.1",
4
4
  "description": "Composants UI pour l'application Allaw",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",