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.mjs CHANGED
@@ -3262,16 +3262,16 @@ const CommonTextInput = (props) => {
3262
3262
  pointerEvents,
3263
3263
  multiline,
3264
3264
  numberOfLines: multiline ? 4 : 1,
3265
- right: /* @__PURE__ */ React.createElement(
3265
+ right: rightIcon ? /* @__PURE__ */ React.createElement(
3266
3266
  TextInput$1.Icon,
3267
3267
  {
3268
- icon: rightIcon ?? "",
3268
+ icon: rightIcon,
3269
3269
  size: 24,
3270
3270
  onPress: () => {
3271
3271
  onRightIconPress?.();
3272
3272
  }
3273
3273
  }
3274
- ),
3274
+ ) : null,
3275
3275
  ...props
3276
3276
  }
3277
3277
  ), errorMessage ? /* @__PURE__ */ React.createElement(
@@ -3773,12 +3773,20 @@ const OTPInput = React.forwardRef(
3773
3773
  otpHeaderTextStyle,
3774
3774
  textInputStyle,
3775
3775
  resendTextStyle,
3776
- resendOtpColor
3776
+ resendOtpColor,
3777
+ mode
3777
3778
  }, ref) => {
3778
3779
  const [otp, setOTP] = useState("");
3779
3780
  const [isResendOtpEnable, setIsResendOtpEnable] = useState(false);
3780
3781
  const [activeInput, setActiveInput] = useState(null);
3781
- const { theme } = useTheme();
3782
+ const filteredTheme = Object?.keys(theme)?.reduce(
3783
+ (acc, key) => {
3784
+ acc[key] = theme[key][mode];
3785
+ return acc;
3786
+ },
3787
+ {}
3788
+ );
3789
+ const { theme: theme$1 } = mode ? { theme: filteredTheme } : useTheme();
3782
3790
  const refs = useRef([]);
3783
3791
  refs.current = Array(length).fill(0).map((_, index) => refs.current[index] || null);
3784
3792
  useEffect(() => {
@@ -3832,7 +3840,7 @@ const OTPInput = React.forwardRef(
3832
3840
  text: "OTP",
3833
3841
  variant: FontStyle.B4_REGULAR,
3834
3842
  style: {
3835
- color: otp?.length ? theme.CONTENT_PRIMARY : theme.CONTENT_SECONDRY,
3843
+ color: otp?.length ? theme$1.CONTENT_PRIMARY : theme$1.CONTENT_SECONDRY,
3836
3844
  textAlign: "left",
3837
3845
  ...otpHeaderTextStyle
3838
3846
  }
@@ -3843,8 +3851,8 @@ const OTPInput = React.forwardRef(
3843
3851
  key: index?.toString(),
3844
3852
  style: {
3845
3853
  ...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,
3854
+ color: theme$1.CONTENT_PRIMARY,
3855
+ borderColor: errorMessage ? theme$1.ERROR : otp.length === length ? theme$1.SUCCESS : activeInput === index ? theme$1.BORDER_INVERTED : theme$1.BORDER_PRIMARY,
3848
3856
  ...textInputStyle
3849
3857
  },
3850
3858
  onFocus: () => setActiveInput(index),
@@ -3856,7 +3864,7 @@ const OTPInput = React.forwardRef(
3856
3864
  keyboardType: "numeric",
3857
3865
  ref: (el) => refs.current[index] = el,
3858
3866
  returnKeyType: otp.length === length ? "done" : "next",
3859
- selectionColor: theme.CONTENT_PRIMARY
3867
+ selectionColor: theme$1.CONTENT_PRIMARY
3860
3868
  }
3861
3869
  ))), /* @__PURE__ */ React.createElement(View, { style: styles$4.resendOtpContainer }, errorMessage ? /* @__PURE__ */ React.createElement(
3862
3870
  CustomTypography,
@@ -3864,7 +3872,7 @@ const OTPInput = React.forwardRef(
3864
3872
  text: errorMessage,
3865
3873
  variant: FontStyle.L2_REGULAR,
3866
3874
  style: {
3867
- color: theme.ERROR
3875
+ color: theme$1.ERROR
3868
3876
  }
3869
3877
  }
3870
3878
  ) : /* @__PURE__ */ React.createElement(View, null), /* @__PURE__ */ React.createElement(Pressable, { onPress: onClickResendOTP, disabled: !isResendOtpEnable }, /* @__PURE__ */ React.createElement(
@@ -3874,7 +3882,7 @@ const OTPInput = React.forwardRef(
3874
3882
  variant: FontStyle.L2_REGULAR,
3875
3883
  style: {
3876
3884
  textDecorationLine: "underline",
3877
- color: isResendOtpEnable ? resendOtpColor ?? theme.CONTENT_PRIMARY : theme.CONTENT_DISABLE,
3885
+ color: isResendOtpEnable ? resendOtpColor ?? theme$1.CONTENT_PRIMARY : theme$1.CONTENT_DISABLE,
3878
3886
  ...resendTextStyle
3879
3887
  }
3880
3888
  }