dhre-ui-kit 0.0.160 → 0.0.162

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.mjs CHANGED
@@ -3260,6 +3260,7 @@ const CommonTextInput = (props) => {
3260
3260
  placeholder: placeholderText,
3261
3261
  editable,
3262
3262
  pointerEvents,
3263
+ error: errorMessage?.length ? true : false,
3263
3264
  multiline,
3264
3265
  numberOfLines: multiline ? 4 : 1,
3265
3266
  right: rightIcon ? /* @__PURE__ */ React.createElement(
@@ -3300,6 +3301,7 @@ const styles$8 = StyleSheet.create({
3300
3301
  errorInput: {
3301
3302
  marginTop: verticalScale(12),
3302
3303
  backgroundColor: DHRE_COLORS_TEXT.DH_WHITE,
3304
+ borderColor: DHRE_DEFAULT.DH_ERROR,
3303
3305
  paddingVertical: 0,
3304
3306
  height: verticalScale(48),
3305
3307
  justifyContent: "center"
@@ -3773,12 +3775,20 @@ const OTPInput = React.forwardRef(
3773
3775
  otpHeaderTextStyle,
3774
3776
  textInputStyle,
3775
3777
  resendTextStyle,
3776
- resendOtpColor
3778
+ resendOtpColor,
3779
+ mode
3777
3780
  }, ref) => {
3778
3781
  const [otp, setOTP] = useState("");
3779
3782
  const [isResendOtpEnable, setIsResendOtpEnable] = useState(false);
3780
3783
  const [activeInput, setActiveInput] = useState(null);
3781
- const { theme } = useTheme();
3784
+ const filteredTheme = Object?.keys(theme)?.reduce(
3785
+ (acc, key) => {
3786
+ acc[key] = theme[key][mode];
3787
+ return acc;
3788
+ },
3789
+ {}
3790
+ );
3791
+ const { theme: theme$1 } = mode ? { theme: filteredTheme } : useTheme();
3782
3792
  const refs = useRef([]);
3783
3793
  refs.current = Array(length).fill(0).map((_, index) => refs.current[index] || null);
3784
3794
  useEffect(() => {
@@ -3832,7 +3842,7 @@ const OTPInput = React.forwardRef(
3832
3842
  text: "OTP",
3833
3843
  variant: FontStyle.B4_REGULAR,
3834
3844
  style: {
3835
- color: otp?.length ? theme.CONTENT_PRIMARY : theme.CONTENT_SECONDRY,
3845
+ color: otp?.length ? theme$1.CONTENT_PRIMARY : theme$1.CONTENT_SECONDRY,
3836
3846
  textAlign: "left",
3837
3847
  ...otpHeaderTextStyle
3838
3848
  }
@@ -3843,8 +3853,8 @@ const OTPInput = React.forwardRef(
3843
3853
  key: index?.toString(),
3844
3854
  style: {
3845
3855
  ...styles$4.textInputStyle,
3846
- color: theme.CONTENT_PRIMARY,
3847
- borderColor: errorMessage ? theme.ERROR : otp.length === length ? theme.SUCCESS : activeInput === index ? theme.BORDER_INVERTED : theme.BORDER_PRIMARY,
3856
+ color: theme$1.CONTENT_PRIMARY,
3857
+ borderColor: errorMessage ? theme$1.ERROR : otp.length === length ? theme$1.SUCCESS : activeInput === index ? theme$1.BORDER_INVERTED : theme$1.BORDER_PRIMARY,
3848
3858
  ...textInputStyle
3849
3859
  },
3850
3860
  onFocus: () => setActiveInput(index),
@@ -3856,7 +3866,7 @@ const OTPInput = React.forwardRef(
3856
3866
  keyboardType: "numeric",
3857
3867
  ref: (el) => refs.current[index] = el,
3858
3868
  returnKeyType: otp.length === length ? "done" : "next",
3859
- selectionColor: theme.CONTENT_PRIMARY
3869
+ selectionColor: theme$1.CONTENT_PRIMARY
3860
3870
  }
3861
3871
  ))), /* @__PURE__ */ React.createElement(View, { style: styles$4.resendOtpContainer }, errorMessage ? /* @__PURE__ */ React.createElement(
3862
3872
  CustomTypography,
@@ -3864,7 +3874,7 @@ const OTPInput = React.forwardRef(
3864
3874
  text: errorMessage,
3865
3875
  variant: FontStyle.L2_REGULAR,
3866
3876
  style: {
3867
- color: theme.ERROR
3877
+ color: theme$1.ERROR
3868
3878
  }
3869
3879
  }
3870
3880
  ) : /* @__PURE__ */ React.createElement(View, null), /* @__PURE__ */ React.createElement(Pressable, { onPress: onClickResendOTP, disabled: !isResendOtpEnable }, /* @__PURE__ */ React.createElement(
@@ -3874,7 +3884,7 @@ const OTPInput = React.forwardRef(
3874
3884
  variant: FontStyle.L2_REGULAR,
3875
3885
  style: {
3876
3886
  textDecorationLine: "underline",
3877
- color: isResendOtpEnable ? resendOtpColor ?? theme.CONTENT_PRIMARY : theme.CONTENT_DISABLE,
3887
+ color: isResendOtpEnable ? resendOtpColor ?? theme$1.CONTENT_PRIMARY : theme$1.CONTENT_DISABLE,
3878
3888
  ...resendTextStyle
3879
3889
  }
3880
3890
  }