allaw-ui 2.3.9 → 2.4.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.
@@ -32,23 +32,24 @@ var VerificationCodeInput = function (_a) {
32
32
  var validateAllInputs = function () {
33
33
  var _a;
34
34
  var fullValue = values.join("");
35
- // console.log("Attempting validation with value:", fullValue);
35
+ console.log("[VerificationCodeInput] Validating inputs:", fullValue);
36
36
  if (fullValue.length === numInputs) {
37
+ console.log("[VerificationCodeInput] All inputs filled");
37
38
  if (testError) {
38
- // console.log("Showing error state");
39
39
  setError("Code de vérification invalide");
40
40
  onError === null || onError === void 0 ? void 0 : onError("Code de vérification invalide");
41
41
  return;
42
42
  }
43
- // console.log("Code validation successful:", fullValue);
44
43
  setError("");
45
44
  onError === null || onError === void 0 ? void 0 : onError(null);
45
+ console.log("[VerificationCodeInput] Calling onComplete with:", fullValue);
46
46
  onComplete === null || onComplete === void 0 ? void 0 : onComplete(fullValue);
47
47
  (_a = inputRefs.current[numInputs - 1]) === null || _a === void 0 ? void 0 : _a.blur();
48
48
  }
49
49
  };
50
50
  var handleInputChange = function (index, value) {
51
51
  var _a, _b, _c, _d;
52
+ console.log("[VerificationCodeInput] Input ".concat(index, " changed to:"), value);
52
53
  if (value.length > 1) {
53
54
  var pastedChars = value.split("");
54
55
  var validChars = pastedChars
@@ -70,15 +71,18 @@ var VerificationCodeInput = function (_a) {
70
71
  validateAllInputs();
71
72
  (_b = inputRefs.current[numInputs - 1]) === null || _b === void 0 ? void 0 : _b.blur();
72
73
  }
74
+ console.log("[VerificationCodeInput] Handling pasted value");
73
75
  return;
74
76
  }
75
77
  }
76
78
  if (!validateInput(value, allowedChars)) {
79
+ console.log("[VerificationCodeInput] Invalid input value");
77
80
  return;
78
81
  }
79
82
  var newValues = __spreadArray([], values, true);
80
83
  newValues[index] = value;
81
84
  setValues(newValues);
85
+ console.log("[VerificationCodeInput] New values:", newValues.join(""));
82
86
  if (value === "")
83
87
  return;
84
88
  setError("");
@@ -89,7 +93,6 @@ var VerificationCodeInput = function (_a) {
89
93
  (_c = inputRefs.current[index + 1]) === null || _c === void 0 ? void 0 : _c.focus();
90
94
  }
91
95
  else if (index === numInputs - 1 && value !== "") {
92
- // console.log("Last input filled, triggering validation");
93
96
  validateAllInputs();
94
97
  (_d = inputRefs.current[index]) === null || _d === void 0 ? void 0 : _d.blur();
95
98
  }
@@ -108,7 +111,6 @@ var VerificationCodeInput = function (_a) {
108
111
  setTimeout(function () {
109
112
  var isStillFocused = inputRefs.current.some(function (ref) { return ref === document.activeElement; });
110
113
  if (!isStillFocused) {
111
- // console.log("All inputs lost focus, checking validation");
112
114
  validateAllInputs();
113
115
  }
114
116
  }, 0);
@@ -117,7 +119,6 @@ var VerificationCodeInput = function (_a) {
117
119
  var _a, _b;
118
120
  e.preventDefault();
119
121
  var pastedText = e.clipboardData.getData("text");
120
- // console.log("Pasted text:", pastedText);
121
122
  var validChars = pastedText
122
123
  .split("")
123
124
  .filter(function (char) { return validateInput(char, allowedChars); })
@@ -132,7 +133,6 @@ var VerificationCodeInput = function (_a) {
132
133
  setValues(newValues_2);
133
134
  onChange === null || onChange === void 0 ? void 0 : onChange(newValues_2.join(""));
134
135
  if (validChars.length >= numInputs) {
135
- // console.log("All inputs filled by paste, triggering validation");
136
136
  validateAllInputs();
137
137
  inputRefs.current.forEach(function (input) { return input === null || input === void 0 ? void 0 : input.blur(); });
138
138
  (_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.blur();
@@ -1,6 +1,5 @@
1
1
  import React from "react";
2
2
  import styles from "./BlogCard.module.css";
3
- import Link from "next/link";
4
3
  import TinyInfo from "../../atoms/typography/TinyInfo";
5
4
  import Image from "next/image";
6
5
  var BlogTopSection = function (_a) {
@@ -26,7 +25,7 @@ var BlogCard = function (_a) {
26
25
  var articleUrl = _a.articleUrl, imageUrl = _a.imageUrl, tags = _a.tags, date = _a.date, title = _a.title, description = _a.description, _b = _a.preview, preview = _b === void 0 ? false : _b, onClick = _a.onClick;
27
26
  return (React.createElement(React.Fragment, null, onClick ? (React.createElement("button", { className: styles.blogContainer, onClick: function () { return onClick && onClick(); } },
28
27
  !preview && React.createElement(BlogTopSection, { imageUrl: imageUrl, title: title }),
29
- React.createElement(BlogBottomSection, { tags: tags, date: date, title: title, description: description }))) : (React.createElement(Link, { href: articleUrl, className: styles.blogContainer },
28
+ React.createElement(BlogBottomSection, { tags: tags, date: date, title: title, description: description }))) : (React.createElement("a", { href: articleUrl, className: styles.blogContainer },
30
29
  !preview && React.createElement(BlogTopSection, { imageUrl: imageUrl, title: title }),
31
30
  React.createElement(BlogBottomSection, { tags: tags, date: date, title: title, description: description })))));
32
31
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allaw-ui",
3
- "version": "2.3.9",
3
+ "version": "2.4.1",
4
4
  "description": "Composants UI pour l'application Allaw",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",