dhre-ui-kit 0.0.310 → 0.0.312
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.
- package/lib/index.d.ts +1 -0
- package/lib/index.js +13 -9
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +13 -9
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -4064,20 +4064,18 @@ const OTPInput = React.forwardRef(
|
|
|
4064
4064
|
disabled,
|
|
4065
4065
|
maxResendCount = 2,
|
|
4066
4066
|
timerToResend = 6e4,
|
|
4067
|
-
timerIcon
|
|
4067
|
+
timerIcon,
|
|
4068
|
+
isInValidOtp
|
|
4068
4069
|
}, ref) => {
|
|
4069
4070
|
const [otp, setOTP] = useState("");
|
|
4070
4071
|
const [isResendOtpEnable, setIsResendOtpEnable] = useState(false);
|
|
4071
4072
|
const [activeInput, setActiveInput] = useState(null);
|
|
4072
4073
|
const [resendOTPCount, setResendOTPCount] = useState(0);
|
|
4073
4074
|
const [errorMessageMaxReachCount, setErrorMessageMaxReachCount] = useState("");
|
|
4074
|
-
const filteredTheme = Object?.keys(theme)?.reduce(
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
},
|
|
4079
|
-
{}
|
|
4080
|
-
);
|
|
4075
|
+
const filteredTheme = Object?.keys(theme)?.reduce((acc, key) => {
|
|
4076
|
+
acc[key] = theme[key][mode];
|
|
4077
|
+
return acc;
|
|
4078
|
+
}, {});
|
|
4081
4079
|
const { theme: theme$1 } = mode ? { theme: filteredTheme } : useTheme();
|
|
4082
4080
|
const [timeLeft, setTimeLeft] = useState(60);
|
|
4083
4081
|
useEffect(() => {
|
|
@@ -4184,6 +4182,12 @@ const OTPInput = React.forwardRef(
|
|
|
4184
4182
|
onComplete?.(otp);
|
|
4185
4183
|
}
|
|
4186
4184
|
}, [otp]);
|
|
4185
|
+
console.log("errorMessage ==>", errorMessage);
|
|
4186
|
+
console.log("isInValidOtp ==>", isInValidOtp);
|
|
4187
|
+
console.log(
|
|
4188
|
+
"errorMessage || isInValidOtp ==>",
|
|
4189
|
+
errorMessage || isInValidOtp
|
|
4190
|
+
);
|
|
4187
4191
|
return /* @__PURE__ */ React.createElement(ThemeProvider, null, /* @__PURE__ */ React.createElement(View, { style: { ...otpContainerStyle }, "data-testid": testId }, /* @__PURE__ */ React.createElement(
|
|
4188
4192
|
CustomTypography,
|
|
4189
4193
|
{
|
|
@@ -4202,7 +4206,7 @@ const OTPInput = React.forwardRef(
|
|
|
4202
4206
|
style: {
|
|
4203
4207
|
...styles$5.textInputStyle,
|
|
4204
4208
|
color: theme$1.CONTENT_PRIMARY,
|
|
4205
|
-
borderColor: errorMessage ? theme$1.ERROR : otp.length === length ? theme$1.SUCCESS : activeInput === index ? theme$1.BORDER_INVERTED : theme$1.BORDER_PRIMARY,
|
|
4209
|
+
borderColor: errorMessage || isInValidOtp ? theme$1.ERROR : otp.length === length ? theme$1.SUCCESS : activeInput === index ? theme$1.BORDER_INVERTED : theme$1.BORDER_PRIMARY,
|
|
4206
4210
|
...textInputStyle
|
|
4207
4211
|
},
|
|
4208
4212
|
onFocus: () => setActiveInput(index),
|