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.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(() => {
|
|
@@ -4239,7 +4237,7 @@ const OTPInput = React__default["default"].forwardRef(
|
|
|
4239
4237
|
style: {
|
|
4240
4238
|
...styles$5.textInputStyle,
|
|
4241
4239
|
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,
|
|
4240
|
+
borderColor: errorMessage || isInValidOtp ? theme$1.ERROR : otp.length === length ? theme$1.SUCCESS : activeInput === index ? theme$1.BORDER_INVERTED : theme$1.BORDER_PRIMARY,
|
|
4243
4241
|
...textInputStyle
|
|
4244
4242
|
},
|
|
4245
4243
|
onFocus: () => setActiveInput(index),
|