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.d.ts CHANGED
@@ -696,6 +696,7 @@ interface IProps$1 {
696
696
  textInputStyle?: TextStyle;
697
697
  resendTextStyle?: TextStyle;
698
698
  resendOtpColor?: string;
699
+ mode?: 'light' | 'dark';
699
700
  }
700
701
  type OTPInputHandle = {
701
702
  reset: () => void;
package/lib/index.js CHANGED
@@ -3293,6 +3293,7 @@ const CommonTextInput = (props) => {
3293
3293
  placeholder: placeholderText,
3294
3294
  editable,
3295
3295
  pointerEvents,
3296
+ error: errorMessage?.length ? true : false,
3296
3297
  multiline,
3297
3298
  numberOfLines: multiline ? 4 : 1,
3298
3299
  right: rightIcon ? /* @__PURE__ */ React__default["default"].createElement(
@@ -3333,6 +3334,7 @@ const styles$8 = reactNative.StyleSheet.create({
3333
3334
  errorInput: {
3334
3335
  marginTop: verticalScale(12),
3335
3336
  backgroundColor: DHRE_COLORS_TEXT.DH_WHITE,
3337
+ borderColor: DHRE_DEFAULT.DH_ERROR,
3336
3338
  paddingVertical: 0,
3337
3339
  height: verticalScale(48),
3338
3340
  justifyContent: "center"
@@ -3806,12 +3808,20 @@ const OTPInput = React__default["default"].forwardRef(
3806
3808
  otpHeaderTextStyle,
3807
3809
  textInputStyle,
3808
3810
  resendTextStyle,
3809
- resendOtpColor
3811
+ resendOtpColor,
3812
+ mode
3810
3813
  }, ref) => {
3811
3814
  const [otp, setOTP] = React.useState("");
3812
3815
  const [isResendOtpEnable, setIsResendOtpEnable] = React.useState(false);
3813
3816
  const [activeInput, setActiveInput] = React.useState(null);
3814
- const { theme } = useTheme();
3817
+ const filteredTheme = Object?.keys(theme)?.reduce(
3818
+ (acc, key) => {
3819
+ acc[key] = theme[key][mode];
3820
+ return acc;
3821
+ },
3822
+ {}
3823
+ );
3824
+ const { theme: theme$1 } = mode ? { theme: filteredTheme } : useTheme();
3815
3825
  const refs = React.useRef([]);
3816
3826
  refs.current = Array(length).fill(0).map((_, index) => refs.current[index] || null);
3817
3827
  React.useEffect(() => {
@@ -3865,7 +3875,7 @@ const OTPInput = React__default["default"].forwardRef(
3865
3875
  text: "OTP",
3866
3876
  variant: FontStyle.B4_REGULAR,
3867
3877
  style: {
3868
- color: otp?.length ? theme.CONTENT_PRIMARY : theme.CONTENT_SECONDRY,
3878
+ color: otp?.length ? theme$1.CONTENT_PRIMARY : theme$1.CONTENT_SECONDRY,
3869
3879
  textAlign: "left",
3870
3880
  ...otpHeaderTextStyle
3871
3881
  }
@@ -3876,8 +3886,8 @@ const OTPInput = React__default["default"].forwardRef(
3876
3886
  key: index?.toString(),
3877
3887
  style: {
3878
3888
  ...styles$4.textInputStyle,
3879
- color: theme.CONTENT_PRIMARY,
3880
- borderColor: errorMessage ? theme.ERROR : otp.length === length ? theme.SUCCESS : activeInput === index ? theme.BORDER_INVERTED : theme.BORDER_PRIMARY,
3889
+ color: theme$1.CONTENT_PRIMARY,
3890
+ borderColor: errorMessage ? theme$1.ERROR : otp.length === length ? theme$1.SUCCESS : activeInput === index ? theme$1.BORDER_INVERTED : theme$1.BORDER_PRIMARY,
3881
3891
  ...textInputStyle
3882
3892
  },
3883
3893
  onFocus: () => setActiveInput(index),
@@ -3889,7 +3899,7 @@ const OTPInput = React__default["default"].forwardRef(
3889
3899
  keyboardType: "numeric",
3890
3900
  ref: (el) => refs.current[index] = el,
3891
3901
  returnKeyType: otp.length === length ? "done" : "next",
3892
- selectionColor: theme.CONTENT_PRIMARY
3902
+ selectionColor: theme$1.CONTENT_PRIMARY
3893
3903
  }
3894
3904
  ))), /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$4.resendOtpContainer }, errorMessage ? /* @__PURE__ */ React__default["default"].createElement(
3895
3905
  CustomTypography,
@@ -3897,7 +3907,7 @@ const OTPInput = React__default["default"].forwardRef(
3897
3907
  text: errorMessage,
3898
3908
  variant: FontStyle.L2_REGULAR,
3899
3909
  style: {
3900
- color: theme.ERROR
3910
+ color: theme$1.ERROR
3901
3911
  }
3902
3912
  }
3903
3913
  ) : /* @__PURE__ */ React__default["default"].createElement(reactNative.View, null), /* @__PURE__ */ React__default["default"].createElement(reactNative.Pressable, { onPress: onClickResendOTP, disabled: !isResendOtpEnable }, /* @__PURE__ */ React__default["default"].createElement(
@@ -3907,7 +3917,7 @@ const OTPInput = React__default["default"].forwardRef(
3907
3917
  variant: FontStyle.L2_REGULAR,
3908
3918
  style: {
3909
3919
  textDecorationLine: "underline",
3910
- color: isResendOtpEnable ? resendOtpColor ?? theme.CONTENT_PRIMARY : theme.CONTENT_DISABLE,
3920
+ color: isResendOtpEnable ? resendOtpColor ?? theme$1.CONTENT_PRIMARY : theme$1.CONTENT_DISABLE,
3911
3921
  ...resendTextStyle
3912
3922
  }
3913
3923
  }