dhre-ui-kit 0.0.310 → 0.0.311
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 +7 -9
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +7 -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(() => {
|
|
@@ -4202,7 +4200,7 @@ const OTPInput = React.forwardRef(
|
|
|
4202
4200
|
style: {
|
|
4203
4201
|
...styles$5.textInputStyle,
|
|
4204
4202
|
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,
|
|
4203
|
+
borderColor: errorMessage || isInValidOtp ? theme$1.ERROR : otp.length === length ? theme$1.SUCCESS : activeInput === index ? theme$1.BORDER_INVERTED : theme$1.BORDER_PRIMARY,
|
|
4206
4204
|
...textInputStyle
|
|
4207
4205
|
},
|
|
4208
4206
|
onFocus: () => setActiveInput(index),
|