dhre-ui-kit 0.0.159 → 0.0.161

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
@@ -3295,16 +3295,16 @@ const CommonTextInput = (props) => {
3295
3295
  pointerEvents,
3296
3296
  multiline,
3297
3297
  numberOfLines: multiline ? 4 : 1,
3298
- right: /* @__PURE__ */ React__default["default"].createElement(
3298
+ right: rightIcon ? /* @__PURE__ */ React__default["default"].createElement(
3299
3299
  reactNativePaper.TextInput.Icon,
3300
3300
  {
3301
- icon: rightIcon ?? "",
3301
+ icon: rightIcon,
3302
3302
  size: 24,
3303
3303
  onPress: () => {
3304
3304
  onRightIconPress?.();
3305
3305
  }
3306
3306
  }
3307
- ),
3307
+ ) : null,
3308
3308
  ...props
3309
3309
  }
3310
3310
  ), errorMessage ? /* @__PURE__ */ React__default["default"].createElement(
@@ -3806,12 +3806,20 @@ const OTPInput = React__default["default"].forwardRef(
3806
3806
  otpHeaderTextStyle,
3807
3807
  textInputStyle,
3808
3808
  resendTextStyle,
3809
- resendOtpColor
3809
+ resendOtpColor,
3810
+ mode
3810
3811
  }, ref) => {
3811
3812
  const [otp, setOTP] = React.useState("");
3812
3813
  const [isResendOtpEnable, setIsResendOtpEnable] = React.useState(false);
3813
3814
  const [activeInput, setActiveInput] = React.useState(null);
3814
- const { theme } = useTheme();
3815
+ const filteredTheme = Object?.keys(theme)?.reduce(
3816
+ (acc, key) => {
3817
+ acc[key] = theme[key][mode];
3818
+ return acc;
3819
+ },
3820
+ {}
3821
+ );
3822
+ const { theme: theme$1 } = mode ? { theme: filteredTheme } : useTheme();
3815
3823
  const refs = React.useRef([]);
3816
3824
  refs.current = Array(length).fill(0).map((_, index) => refs.current[index] || null);
3817
3825
  React.useEffect(() => {
@@ -3865,7 +3873,7 @@ const OTPInput = React__default["default"].forwardRef(
3865
3873
  text: "OTP",
3866
3874
  variant: FontStyle.B4_REGULAR,
3867
3875
  style: {
3868
- color: otp?.length ? theme.CONTENT_PRIMARY : theme.CONTENT_SECONDRY,
3876
+ color: otp?.length ? theme$1.CONTENT_PRIMARY : theme$1.CONTENT_SECONDRY,
3869
3877
  textAlign: "left",
3870
3878
  ...otpHeaderTextStyle
3871
3879
  }
@@ -3876,8 +3884,8 @@ const OTPInput = React__default["default"].forwardRef(
3876
3884
  key: index?.toString(),
3877
3885
  style: {
3878
3886
  ...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,
3887
+ color: theme$1.CONTENT_PRIMARY,
3888
+ borderColor: errorMessage ? theme$1.ERROR : otp.length === length ? theme$1.SUCCESS : activeInput === index ? theme$1.BORDER_INVERTED : theme$1.BORDER_PRIMARY,
3881
3889
  ...textInputStyle
3882
3890
  },
3883
3891
  onFocus: () => setActiveInput(index),
@@ -3889,7 +3897,7 @@ const OTPInput = React__default["default"].forwardRef(
3889
3897
  keyboardType: "numeric",
3890
3898
  ref: (el) => refs.current[index] = el,
3891
3899
  returnKeyType: otp.length === length ? "done" : "next",
3892
- selectionColor: theme.CONTENT_PRIMARY
3900
+ selectionColor: theme$1.CONTENT_PRIMARY
3893
3901
  }
3894
3902
  ))), /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$4.resendOtpContainer }, errorMessage ? /* @__PURE__ */ React__default["default"].createElement(
3895
3903
  CustomTypography,
@@ -3897,7 +3905,7 @@ const OTPInput = React__default["default"].forwardRef(
3897
3905
  text: errorMessage,
3898
3906
  variant: FontStyle.L2_REGULAR,
3899
3907
  style: {
3900
- color: theme.ERROR
3908
+ color: theme$1.ERROR
3901
3909
  }
3902
3910
  }
3903
3911
  ) : /* @__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 +3915,7 @@ const OTPInput = React__default["default"].forwardRef(
3907
3915
  variant: FontStyle.L2_REGULAR,
3908
3916
  style: {
3909
3917
  textDecorationLine: "underline",
3910
- color: isResendOtpEnable ? resendOtpColor ?? theme.CONTENT_PRIMARY : theme.CONTENT_DISABLE,
3918
+ color: isResendOtpEnable ? resendOtpColor ?? theme$1.CONTENT_PRIMARY : theme$1.CONTENT_DISABLE,
3911
3919
  ...resendTextStyle
3912
3920
  }
3913
3921
  }