dhre-ui-kit 0.0.278 → 0.0.280

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
@@ -30,31 +30,28 @@ interface BadgeProps {
30
30
  }
31
31
  declare const _default$j: (props: BadgeProps) => React$1.JSX.Element;
32
32
 
33
- interface BottomDrawerProps {
34
- isModalVisible: boolean;
35
- toggleModal: () => void;
36
- isFullScreen?: boolean;
37
- children: React.ReactNode;
38
- title: string;
39
- testID?: string;
40
- style?: ViewStyle;
41
- modalContainerStyle?: ViewStyle;
42
- blurAmount?: number;
43
- blurViewStyle?: ViewStyle;
44
- showBlurView?: boolean;
45
- leftIcon?: React.ReactElement;
46
- rightIcon?: React.ReactElement;
47
- showLeftIcon?: boolean;
48
- showRightIcon?: boolean;
49
- onLeftIconPress?: () => void;
50
- titleStyle?: TextStyle;
51
- titleVariant?: string;
52
- showHeader?: boolean;
53
- blurType?: 'dark' | 'light' | 'xlight';
54
- showSeparator?: boolean;
55
- }
56
-
57
- declare const BottomDrawer: React$1.FC<BottomDrawerProps>;
33
+ declare const BottomDrawer: ({ isModalVisible, toggleModal, children, title, testID, style, modalContainerStyle, blurAmount, blurViewStyle, showBlurView, showLeftIcon, showRightIcon, leftIcon, rightIcon, onLeftIconPress, titleStyle, titleVariant, showHeader, blurType, showSeparator, }: {
34
+ isModalVisible: any;
35
+ toggleModal: any;
36
+ children: any;
37
+ title: any;
38
+ testID?: string | undefined;
39
+ style: any;
40
+ modalContainerStyle: any;
41
+ blurAmount?: number | undefined;
42
+ blurViewStyle: any;
43
+ showBlurView?: boolean | undefined;
44
+ showLeftIcon?: boolean | undefined;
45
+ showRightIcon?: boolean | undefined;
46
+ leftIcon: any;
47
+ rightIcon: any;
48
+ onLeftIconPress: any;
49
+ titleStyle: any;
50
+ titleVariant?: string | undefined;
51
+ showHeader?: boolean | undefined;
52
+ blurType: any;
53
+ showSeparator?: boolean | undefined;
54
+ }) => React$1.JSX.Element;
58
55
 
59
56
  interface CustomButtonProps {
60
57
  title: string;
package/lib/index.js CHANGED
@@ -5,8 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var React = require('react');
6
6
  var reactRedux = require('react-redux');
7
7
  var reactNative = require('react-native');
8
- var BottomSheet = require('@gorhom/bottom-sheet');
9
8
  var blur = require('@react-native-community/blur');
9
+ var Modal = require('react-native-modal');
10
+ var stylehelper = require('src/utils/stylehelper');
10
11
  var LottieView = require('lottie-react-native');
11
12
  var Tooltip = require('react-native-walkthrough-tooltip');
12
13
  var Pdf = require('react-native-pdf');
@@ -43,7 +44,7 @@ function _interopNamespace(e) {
43
44
  }
44
45
 
45
46
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
46
- var BottomSheet__default = /*#__PURE__*/_interopDefaultLegacy(BottomSheet);
47
+ var Modal__default = /*#__PURE__*/_interopDefaultLegacy(Modal);
47
48
  var LottieView__default = /*#__PURE__*/_interopDefaultLegacy(LottieView);
48
49
  var Tooltip__default = /*#__PURE__*/_interopDefaultLegacy(Tooltip);
49
50
  var Pdf__default = /*#__PURE__*/_interopDefaultLegacy(Pdf);
@@ -694,53 +695,49 @@ const BottomDrawer = ({
694
695
  titleStyle,
695
696
  titleVariant = "B2_REGULAR",
696
697
  showHeader = true,
697
- blurType = "light",
698
+ blurType,
698
699
  showSeparator = true
699
700
  }) => {
700
- const bottomSheetRef = React.useRef(null);
701
- const handleSheetChanges = React.useCallback(
702
- (index) => {
703
- if (index === -1) {
704
- toggleModal();
705
- }
706
- },
707
- [toggleModal]
708
- );
709
701
  return /* @__PURE__ */ React__default["default"].createElement(
710
- BottomSheet__default["default"],
702
+ Modal__default["default"],
711
703
  {
712
- ref: bottomSheetRef,
713
- index: isModalVisible ? 0 : -1,
714
- snapPoints: ["50%", "100%"],
715
- onChange: handleSheetChanges,
716
- enablePanDownToClose: true,
717
- style: [styles$z.mainContainer, style]
704
+ isVisible: isModalVisible,
705
+ swipeDirection: "down",
706
+ onSwipeComplete: toggleModal,
707
+ style: { margin: 0 }
718
708
  },
719
- /* @__PURE__ */ React__default["default"].createElement(BottomSheet.BottomSheetView, { style: [styles$z.mainContainer, style], testID }, showBlurView ? /* @__PURE__ */ React__default["default"].createElement(
720
- blur.BlurView,
721
- {
722
- style: [styles$z.blurView, blurViewStyle],
723
- blurType,
724
- blurAmount
725
- }
726
- ) : null, /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: [styles$z.modalContainer, modalContainerStyle] }, showHeader && /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, showSeparator && /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$z.separator }), /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$z.headerContainer }, showLeftIcon && leftIcon ? React__default["default"].cloneElement(leftIcon, {
727
- width: moderateScale(24),
728
- height: moderateScale(24),
729
- style: styles$z.leftIconStyle,
730
- onPress: onLeftIconPress
731
- }) : null, /* @__PURE__ */ React__default["default"].createElement(
732
- CustomTypography,
709
+ /* @__PURE__ */ React__default["default"].createElement(
710
+ reactNative.KeyboardAvoidingView,
733
711
  {
734
- variant: titleVariant,
735
- text: title,
736
- style: { ...styles$z.title, ...titleStyle }
737
- }
738
- ), showRightIcon && rightIcon ? React__default["default"].cloneElement(rightIcon, {
739
- width: moderateScale(24),
740
- height: moderateScale(24),
741
- style: styles$z.rightIconStyle,
742
- onPress: toggleModal
743
- }) : null)), children))
712
+ behavior: reactNative.Platform.OS === "ios" ? "padding" : "height",
713
+ style: { flex: 1 }
714
+ },
715
+ /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: [styles$z.mainContainer, style], testID }, showBlurView ? /* @__PURE__ */ React__default["default"].createElement(
716
+ blur.BlurView,
717
+ {
718
+ style: [styles$z.blurView, blurViewStyle],
719
+ blurType,
720
+ blurAmount
721
+ }
722
+ ) : null, /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: [styles$z.modalContainer, modalContainerStyle] }, showHeader && /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, showSeparator && /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$z.separator }), /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$z.headerContainer }, showLeftIcon && leftIcon ? React__default["default"].cloneElement(leftIcon, {
723
+ width: stylehelper.moderateScale(24),
724
+ height: stylehelper.moderateScale(24),
725
+ style: styles$z.leftIconStyle,
726
+ onPress: onLeftIconPress
727
+ }) : null, /* @__PURE__ */ React__default["default"].createElement(
728
+ CustomTypography,
729
+ {
730
+ variant: titleVariant,
731
+ text: title,
732
+ style: { ...styles$z.title, ...titleStyle }
733
+ }
734
+ ), showRightIcon && rightIcon ? React__default["default"].cloneElement(rightIcon, {
735
+ width: stylehelper.moderateScale(24),
736
+ height: stylehelper.moderateScale(24),
737
+ style: styles$z.rightIconStyle,
738
+ onPress: toggleModal
739
+ }) : null)), children))
740
+ )
744
741
  );
745
742
  };
746
743