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.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -4101,20 +4101,18 @@ const OTPInput = React__default["default"].forwardRef(
|
|
|
4101
4101
|
disabled,
|
|
4102
4102
|
maxResendCount = 2,
|
|
4103
4103
|
timerToResend = 6e4,
|
|
4104
|
-
timerIcon
|
|
4104
|
+
timerIcon,
|
|
4105
|
+
isInValidOtp
|
|
4105
4106
|
}, ref) => {
|
|
4106
4107
|
const [otp, setOTP] = React.useState("");
|
|
4107
4108
|
const [isResendOtpEnable, setIsResendOtpEnable] = React.useState(false);
|
|
4108
4109
|
const [activeInput, setActiveInput] = React.useState(null);
|
|
4109
4110
|
const [resendOTPCount, setResendOTPCount] = React.useState(0);
|
|
4110
4111
|
const [errorMessageMaxReachCount, setErrorMessageMaxReachCount] = React.useState("");
|
|
4111
|
-
const filteredTheme = Object?.keys(theme)?.reduce(
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
},
|
|
4116
|
-
{}
|
|
4117
|
-
);
|
|
4112
|
+
const filteredTheme = Object?.keys(theme)?.reduce((acc, key) => {
|
|
4113
|
+
acc[key] = theme[key][mode];
|
|
4114
|
+
return acc;
|
|
4115
|
+
}, {});
|
|
4118
4116
|
const { theme: theme$1 } = mode ? { theme: filteredTheme } : useTheme();
|
|
4119
4117
|
const [timeLeft, setTimeLeft] = React.useState(60);
|
|
4120
4118
|
React.useEffect(() => {
|
|
@@ -4221,6 +4219,12 @@ const OTPInput = React__default["default"].forwardRef(
|
|
|
4221
4219
|
onComplete?.(otp);
|
|
4222
4220
|
}
|
|
4223
4221
|
}, [otp]);
|
|
4222
|
+
console.log("errorMessage ==>", errorMessage);
|
|
4223
|
+
console.log("isInValidOtp ==>", isInValidOtp);
|
|
4224
|
+
console.log(
|
|
4225
|
+
"errorMessage || isInValidOtp ==>",
|
|
4226
|
+
errorMessage || isInValidOtp
|
|
4227
|
+
);
|
|
4224
4228
|
return /* @__PURE__ */ React__default["default"].createElement(ThemeProvider, null, /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: { ...otpContainerStyle }, "data-testid": testId }, /* @__PURE__ */ React__default["default"].createElement(
|
|
4225
4229
|
CustomTypography,
|
|
4226
4230
|
{
|
|
@@ -4239,7 +4243,7 @@ const OTPInput = React__default["default"].forwardRef(
|
|
|
4239
4243
|
style: {
|
|
4240
4244
|
...styles$5.textInputStyle,
|
|
4241
4245
|
color: theme$1.CONTENT_PRIMARY,
|
|
4242
|
-
borderColor: errorMessage ? theme$1.ERROR : otp.length === length ? theme$1.SUCCESS : activeInput === index ? theme$1.BORDER_INVERTED : theme$1.BORDER_PRIMARY,
|
|
4246
|
+
borderColor: errorMessage || isInValidOtp ? theme$1.ERROR : otp.length === length ? theme$1.SUCCESS : activeInput === index ? theme$1.BORDER_INVERTED : theme$1.BORDER_PRIMARY,
|
|
4243
4247
|
...textInputStyle
|
|
4244
4248
|
},
|
|
4245
4249
|
onFocus: () => setActiveInput(index),
|