dhre-ui-kit 0.0.122 → 0.0.124

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
@@ -600,15 +600,19 @@ interface CustomDropdownProps {
600
600
  placeholder?: string;
601
601
  containerStyle?: ViewStyle;
602
602
  dropdownStyle?: ViewStyle;
603
+ dropdownFocusStyle?: ViewStyle;
603
604
  placeholderStyle?: TextStyle;
604
605
  selectedTextStyle?: TextStyle;
605
606
  iconStyle?: ImageStyle;
606
607
  labelStyle?: TextStyle;
608
+ labelFocusStyle?: TextStyle;
607
609
  defaultValue?: string;
608
610
  iconColor?: string;
609
611
  itemTextStyle?: TextStyle;
610
612
  onValueChange?: (value: string) => void;
611
613
  itemContainerStyle?: ViewStyle;
614
+ menuContainerStyle?: ViewStyle;
615
+ activeColor?: string;
612
616
  }
613
617
  declare const CustomDropdown: React$1.FC<CustomDropdownProps>;
614
618
 
@@ -670,6 +674,10 @@ interface IProps$1 {
670
674
  testId?: string;
671
675
  otpContainerStyle?: ViewStyle;
672
676
  resendOTP?: () => void;
677
+ otpHeaderTextStyle?: TextStyle;
678
+ textInputStyle?: TextStyle;
679
+ resendTextStyle?: TextStyle;
680
+ resendOtpColor?: string;
673
681
  }
674
682
  type OTPInputHandle = {
675
683
  reset: () => void;
@@ -688,7 +696,7 @@ interface IProps {
688
696
  showStepCount?: boolean;
689
697
  showStatus?: boolean;
690
698
  data: IData[];
691
- completedStatusIcon: React$1.ReactElement;
699
+ completedStatusIcon?: React$1.ReactElement;
692
700
  }
693
701
 
694
702
  declare const _default$1: (props: IProps) => React$1.JSX.Element;
package/lib/index.js CHANGED
@@ -250,8 +250,8 @@ const theme = {
250
250
  dark: "#404040"
251
251
  },
252
252
  [Theme.BORDER_SEPRATOR]: {
253
- light: "#282828",
254
- dark: "#FFFFFF"
253
+ light: "#F5F5F5",
254
+ dark: "#282828"
255
255
  },
256
256
  [Theme.BORDER_SEPERATOR_HEADER]: {
257
257
  light: "#E1E1E1",
@@ -296,10 +296,10 @@ const withThemeProvider = (Component) => {
296
296
  return (props) => /* @__PURE__ */ React__default["default"].createElement(ThemeProvider, null, /* @__PURE__ */ React__default["default"].createElement(Component, { ...props }));
297
297
  };
298
298
 
299
- const { width: width$1, height } = reactNative.Dimensions.get("window");
299
+ const { width, height } = reactNative.Dimensions.get("window");
300
300
  const guidelineBaseWidth = 375;
301
301
  const guidelineBaseHeight = 812;
302
- const horizontalScale = (size) => width$1 / guidelineBaseWidth * size;
302
+ const horizontalScale = (size) => width / guidelineBaseWidth * size;
303
303
  const verticalScale = (size) => height / guidelineBaseHeight * size;
304
304
  const moderateScale = (size, factor = 0.5) => size + (horizontalScale(size) - size) * factor;
305
305
 
@@ -1979,7 +1979,7 @@ const styles$m = reactNative.StyleSheet.create({
1979
1979
  position: "absolute",
1980
1980
  alignSelf: "center",
1981
1981
  height: verticalScale(72),
1982
- width: width$1 - horizontalScale(32),
1982
+ width: width - horizontalScale(32),
1983
1983
  top: 56,
1984
1984
  borderRadius: moderateScale(8),
1985
1985
  overflow: "hidden"
@@ -2089,7 +2089,7 @@ const Toast = React__default["default"].forwardRef(({ sucessIcon, errorIcon }, r
2089
2089
  Progress__namespace.Bar,
2090
2090
  {
2091
2091
  progress,
2092
- width: width$1 - horizontalScale(48),
2092
+ width: width - horizontalScale(48),
2093
2093
  height: 3,
2094
2094
  color: isSuccess ? "#024324" : "#851D41",
2095
2095
  borderColor: "transparent"
@@ -3275,15 +3275,19 @@ const CustomDropdown = ({
3275
3275
  placeholder,
3276
3276
  containerStyle,
3277
3277
  dropdownStyle,
3278
+ dropdownFocusStyle,
3278
3279
  placeholderStyle,
3279
3280
  selectedTextStyle,
3280
3281
  iconStyle,
3281
3282
  labelStyle,
3283
+ labelFocusStyle,
3282
3284
  defaultValue,
3283
3285
  iconColor,
3284
3286
  itemTextStyle,
3285
3287
  onValueChange,
3286
- itemContainerStyle
3288
+ itemContainerStyle,
3289
+ menuContainerStyle,
3290
+ activeColor
3287
3291
  }) => {
3288
3292
  const [value, setValue] = React.useState(defaultValue);
3289
3293
  const [isFocus, setIsFocus] = React.useState(false);
@@ -3295,7 +3299,7 @@ const CustomDropdown = ({
3295
3299
  style: [
3296
3300
  styles$6.label,
3297
3301
  labelStyle,
3298
- isFocus && { color: theme.BORDER_INVERTED["light"] }
3302
+ isFocus && (labelFocusStyle ?? { color: theme.BORDER_INVERTED["light"] })
3299
3303
  ]
3300
3304
  },
3301
3305
  label
@@ -3317,7 +3321,7 @@ const CustomDropdown = ({
3317
3321
  style: [
3318
3322
  styles$6.dropdown,
3319
3323
  dropdownStyle,
3320
- isFocus && { borderColor: theme.BORDER_INVERTED["light"] }
3324
+ isFocus && (dropdownFocusStyle ?? { borderColor: theme.BORDER_INVERTED["light"] })
3321
3325
  ],
3322
3326
  placeholderStyle: [styles$6.placeholderStyle, placeholderStyle],
3323
3327
  selectedTextStyle: [styles$6.selectedTextStyle, selectedTextStyle],
@@ -3333,6 +3337,8 @@ const CustomDropdown = ({
3333
3337
  iconColor,
3334
3338
  dropdownPosition: "bottom",
3335
3339
  itemTextStyle,
3340
+ containerStyle: menuContainerStyle,
3341
+ activeColor,
3336
3342
  itemContainerStyle: [styles$6.itemListStyle, itemContainerStyle]
3337
3343
  }
3338
3344
  ));
@@ -3713,7 +3719,11 @@ const OTPInput = React__default["default"].forwardRef(
3713
3719
  resendOTP,
3714
3720
  errorMessage,
3715
3721
  testId = "",
3716
- otpContainerStyle
3722
+ otpContainerStyle,
3723
+ otpHeaderTextStyle,
3724
+ textInputStyle,
3725
+ resendTextStyle,
3726
+ resendOtpColor
3717
3727
  }, ref) => {
3718
3728
  const [otp, setOTP] = React.useState("");
3719
3729
  const [isResendOtpEnable, setIsResendOtpEnable] = React.useState(false);
@@ -3728,6 +3738,7 @@ const OTPInput = React__default["default"].forwardRef(
3728
3738
  setIsResendOtpEnable(false);
3729
3739
  enableResendOtp();
3730
3740
  resendOTP?.();
3741
+ setOTP("");
3731
3742
  };
3732
3743
  const enableResendOtp = () => {
3733
3744
  setTimeout(() => {
@@ -3765,14 +3776,15 @@ const OTPInput = React__default["default"].forwardRef(
3765
3776
  onComplete?.(otp);
3766
3777
  }
3767
3778
  }, [otp]);
3768
- return /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: { ...otpContainerStyle }, testID: testId }, /* @__PURE__ */ React__default["default"].createElement(
3779
+ return /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: { ...otpContainerStyle }, "data-testid": testId }, /* @__PURE__ */ React__default["default"].createElement(
3769
3780
  CustomTypography,
3770
3781
  {
3771
3782
  text: "OTP",
3772
3783
  variant: FontStyle.B4_REGULAR,
3773
3784
  style: {
3774
3785
  color: otp?.length ? theme.CONTENT_PRIMARY : theme.CONTENT_SECONDRY,
3775
- textAlign: "left"
3786
+ textAlign: "left",
3787
+ ...otpHeaderTextStyle
3776
3788
  }
3777
3789
  }
3778
3790
  ), /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: { ...styles$2.textInputContainer } }, Array.from({ length }).map((_, index) => /* @__PURE__ */ React__default["default"].createElement(
@@ -3782,7 +3794,8 @@ const OTPInput = React__default["default"].forwardRef(
3782
3794
  style: {
3783
3795
  ...styles$2.textInputStyle,
3784
3796
  color: theme.CONTENT_PRIMARY,
3785
- borderColor: errorMessage ? theme.ERROR : otp.length === length ? theme.SUCCESS : activeInput === index ? theme.BORDER_INVERTED : theme.BORDER_PRIMARY
3797
+ borderColor: errorMessage ? theme.ERROR : otp.length === length ? theme.SUCCESS : activeInput === index ? theme.BORDER_INVERTED : theme.BORDER_PRIMARY,
3798
+ ...textInputStyle
3786
3799
  },
3787
3800
  onFocus: () => setActiveInput(index),
3788
3801
  onBlur: () => setActiveInput(null),
@@ -3811,7 +3824,8 @@ const OTPInput = React__default["default"].forwardRef(
3811
3824
  variant: FontStyle.L2_REGULAR,
3812
3825
  style: {
3813
3826
  textDecorationLine: "underline",
3814
- color: isResendOtpEnable ? theme.CONTENT_PRIMARY : theme.CONTENT_DISABLE
3827
+ color: isResendOtpEnable ? resendOtpColor ?? theme.CONTENT_PRIMARY : theme.CONTENT_DISABLE,
3828
+ ...resendTextStyle
3815
3829
  }
3816
3830
  }
3817
3831
  ))));
@@ -4016,14 +4030,25 @@ const styles = reactNative.StyleSheet.create({
4016
4030
  }
4017
4031
  });
4018
4032
 
4019
- const { width } = reactNative.Dimensions.get("window");
4020
4033
  const BUTTON_WIDTH = 40;
4021
4034
  const CustomSlideButton = ({
4022
4035
  label,
4023
4036
  onComplete,
4024
4037
  icon
4025
4038
  }) => {
4039
+ const value = React.useRef(0);
4040
+ const cardRef = React.useRef(null);
4026
4041
  const pan = React.useRef(new reactNative.Animated.Value(0)).current;
4042
+ const handleLayout = (event) => {
4043
+ const { width } = event.nativeEvent.layout;
4044
+ if (cardRef.current) {
4045
+ cardRef.current.setNativeProps({
4046
+ style: { width }
4047
+ // Change the width here
4048
+ });
4049
+ value.current = width;
4050
+ }
4051
+ };
4027
4052
  const panResponder = React.useRef(
4028
4053
  reactNative.PanResponder.create({
4029
4054
  onMoveShouldSetPanResponder: (evt, gestureState) => {
@@ -4032,15 +4057,15 @@ const CustomSlideButton = ({
4032
4057
  onPanResponderGrant: () => {
4033
4058
  },
4034
4059
  onPanResponderMove: (evt, gestureState) => {
4035
- if (gestureState.dx < width - BUTTON_WIDTH) {
4060
+ if (gestureState.dx < value.current - BUTTON_WIDTH) {
4036
4061
  pan.setValue(gestureState.dx);
4037
4062
  }
4038
4063
  },
4039
4064
  onPanResponderRelease: (evt, gestureState) => {
4040
- if (gestureState.dx > width - BUTTON_WIDTH - 100) {
4065
+ if (gestureState.dx > value.current - BUTTON_WIDTH - 100) {
4041
4066
  onComplete && onComplete();
4042
4067
  reactNative.Animated.spring(pan, {
4043
- toValue: width - BUTTON_WIDTH - 10,
4068
+ toValue: value.current - BUTTON_WIDTH - 10,
4044
4069
  useNativeDriver: false
4045
4070
  }).start();
4046
4071
  } else {
@@ -4053,43 +4078,36 @@ const CustomSlideButton = ({
4053
4078
  })
4054
4079
  ).current;
4055
4080
  const { theme } = useTheme();
4056
- return /* @__PURE__ */ React__default["default"].createElement(
4057
- reactNative.View,
4081
+ return /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: {
4082
+ ...styles.sliderContainer,
4083
+ backgroundColor: theme.SURFACE_INVERTED
4084
+ }, onLayout: handleLayout, ref: cardRef }, /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles.buttonTextCOntainer }, /* @__PURE__ */ React__default["default"].createElement(
4085
+ CustomTypography,
4058
4086
  {
4087
+ text: label,
4088
+ variant: FontStyle.L1_REGULAR,
4059
4089
  style: {
4060
- ...styles.sliderContainer,
4061
- backgroundColor: theme.SURFACE_INVERTED
4090
+ color: theme.CONTENT_INVERTED
4062
4091
  }
4092
+ }
4093
+ )), /* @__PURE__ */ React__default["default"].createElement(
4094
+ reactNative.Animated.View,
4095
+ {
4096
+ style: [styles.slider, { transform: [{ translateX: pan }] }],
4097
+ ...panResponder.panHandlers
4063
4098
  },
4064
- /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles.buttonTextCOntainer }, /* @__PURE__ */ React__default["default"].createElement(
4065
- CustomTypography,
4099
+ /* @__PURE__ */ React__default["default"].createElement(
4100
+ reactNative.View,
4066
4101
  {
4067
- text: label,
4068
- variant: FontStyle.L1_REGULAR,
4069
4102
  style: {
4070
- color: theme.CONTENT_INVERTED
4103
+ ...styles.button,
4104
+ backgroundColor: theme.SURFACE_PRIMARY,
4105
+ width: BUTTON_WIDTH
4071
4106
  }
4072
- }
4073
- )),
4074
- /* @__PURE__ */ React__default["default"].createElement(
4075
- reactNative.Animated.View,
4076
- {
4077
- style: [styles.slider, { transform: [{ translateX: pan }] }],
4078
- ...panResponder.panHandlers
4079
4107
  },
4080
- /* @__PURE__ */ React__default["default"].createElement(
4081
- reactNative.View,
4082
- {
4083
- style: {
4084
- ...styles.button,
4085
- backgroundColor: theme.SURFACE_PRIMARY,
4086
- width: BUTTON_WIDTH
4087
- }
4088
- },
4089
- icon
4090
- )
4108
+ icon
4091
4109
  )
4092
- );
4110
+ ));
4093
4111
  };
4094
4112
  var index = withThemeProvider(CustomSlideButton);
4095
4113
 
@@ -4159,5 +4177,5 @@ exports.horizontalScale = horizontalScale;
4159
4177
  exports.moderateScale = moderateScale;
4160
4178
  exports.toastService = toastService;
4161
4179
  exports.verticalScale = verticalScale;
4162
- exports.width = width$1;
4180
+ exports.width = width;
4163
4181
  //# sourceMappingURL=index.js.map