dhre-ui-kit 0.0.222 → 0.0.224

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
@@ -18,7 +18,7 @@ interface CustomTextProps extends TextProps {
18
18
  style?: StyleProp<TextStyle>;
19
19
  textColor?: string;
20
20
  }
21
- declare const _default$k: (props: CustomTextProps) => React$1.JSX.Element;
21
+ declare const _default$l: (props: CustomTextProps) => React$1.JSX.Element;
22
22
 
23
23
  interface BadgeProps {
24
24
  text?: string;
@@ -28,7 +28,7 @@ interface BadgeProps {
28
28
  iconStyle?: ViewStyle;
29
29
  handleIconPress: () => void;
30
30
  }
31
- declare const _default$j: (props: BadgeProps) => React$1.JSX.Element;
31
+ declare const _default$k: (props: BadgeProps) => React$1.JSX.Element;
32
32
 
33
33
  interface BottomDrawerProps {
34
34
  isModalVisible: boolean;
@@ -73,7 +73,7 @@ interface CustomButtonProps {
73
73
  isLoading?: boolean;
74
74
  }
75
75
 
76
- declare const _default$i: (props: CustomButtonProps) => React$1.JSX.Element;
76
+ declare const _default$j: (props: CustomButtonProps) => React$1.JSX.Element;
77
77
 
78
78
  interface CardsProps {
79
79
  topLeftTitle?: string;
@@ -325,7 +325,7 @@ interface Props {
325
325
  onSelectionChange?: (selected: string[]) => void;
326
326
  style?: ViewStyle;
327
327
  }
328
- declare const _default$h: (props: Props) => React$1.JSX.Element;
328
+ declare const _default$i: (props: Props) => React$1.JSX.Element;
329
329
 
330
330
  interface TagsProps {
331
331
  tags: string[];
@@ -364,7 +364,7 @@ interface AccordionProps {
364
364
  titleVariant?: string;
365
365
  }
366
366
 
367
- declare const _default$g: (props: AccordionProps) => React$1.JSX.Element;
367
+ declare const _default$h: (props: AccordionProps) => React$1.JSX.Element;
368
368
 
369
369
  interface ToastProps {
370
370
  sucessIcon: React$1.ReactElement;
@@ -419,7 +419,7 @@ interface CustomHeaderProps {
419
419
  onRightPress?: () => void;
420
420
  }
421
421
 
422
- declare const _default$f: (props: CustomHeaderProps) => React$1.JSX.Element;
422
+ declare const _default$g: (props: CustomHeaderProps) => React$1.JSX.Element;
423
423
 
424
424
  interface ListItem {
425
425
  id: string;
@@ -462,7 +462,7 @@ interface SwipableListProps {
462
462
  titleStyle?: TextStyle;
463
463
  }
464
464
 
465
- declare const _default$e: (props: SwipableListProps) => React$1.JSX.Element;
465
+ declare const _default$f: (props: SwipableListProps) => React$1.JSX.Element;
466
466
 
467
467
  interface TypoTextProps extends TextProps {
468
468
  variant: keyof typeof FONT_STYLES;
@@ -487,7 +487,7 @@ interface CustomLoaderProps {
487
487
  loading: boolean;
488
488
  }
489
489
 
490
- declare const CustomLoader: ({ loading }: CustomLoaderProps) => React$1.JSX.Element | null;
490
+ declare const _default$e: (props: CustomLoaderProps) => React$1.JSX.Element;
491
491
 
492
492
  declare const _default$d: (props: {
493
493
  backgroundColor?: string;
@@ -1116,4 +1116,4 @@ interface RadioButtonGroupProps {
1116
1116
 
1117
1117
  declare const RadioButtonGroup: React$1.FC<RadioButtonGroupProps>;
1118
1118
 
1119
- export { _default$g as Accordion, _default$1 as AppointmentCard, _default$j as Badge, BottomDrawer, _default$i as Button, Cards, _default$8 as Category, Checkbox as CheckBox, _default$b as ContactModel, CountryDropDown as CountryPicker, _default$5 as CustomDocumentPicker, CustomDropdown$1 as CustomDropdown, _default$f as CustomHeader, type CustomHeaderProps, CustomIcon, CustomLoader, CustomProgressBar, CustomSearchBar, _default$2 as CustomSlideButton, CustomSwitchBtn, _default$k as CustomText, CustomTextInput, CustomTooltip, CustomTypography, DHRE_COLORS_ALERT, DHRE_COLORS_BG, DHRE_COLORS_PRIMARY, DHRE_COLORS_SECONDARY, DHRE_COLORS_TEXT, DHRE_DEFAULT, _default$a as DateRangePicker, CustomDropdown as DropDown, FONT_STYLES, _default$7 as FeedbackForm, FileUpload, FontStyle, _default$d as Line, NotificationBandge, _default$4 as OTPInput, _default$9 as OurOfficesButton, PdfView, PopUp, _default as PropertyDetails, RadioButtonGroup, ShapeType, _default$6 as SingleSelectionTags, type SlideButtonHandle, Star as StarRating, _default$3 as Stepper, _default$e as SwipableList, _default$h as Tabs, Tags, TextDirectType, CommonTextInput as TextInput, Theme, Toast, type ToastRef, CustomSwitch as ToggleButton, ToggleButtonType, ToggleTextType, _default$c as Topic, copyToClipboard, theme as default, height, horizontalScale, moderateScale, toastService, verticalScale, width };
1119
+ export { _default$h as Accordion, _default$1 as AppointmentCard, _default$k as Badge, BottomDrawer, _default$j as Button, Cards, _default$8 as Category, Checkbox as CheckBox, _default$b as ContactModel, CountryDropDown as CountryPicker, _default$5 as CustomDocumentPicker, CustomDropdown$1 as CustomDropdown, _default$g as CustomHeader, type CustomHeaderProps, CustomIcon, _default$e as CustomLoader, CustomProgressBar, CustomSearchBar, _default$2 as CustomSlideButton, CustomSwitchBtn, _default$l as CustomText, CustomTextInput, CustomTooltip, CustomTypography, DHRE_COLORS_ALERT, DHRE_COLORS_BG, DHRE_COLORS_PRIMARY, DHRE_COLORS_SECONDARY, DHRE_COLORS_TEXT, DHRE_DEFAULT, _default$a as DateRangePicker, CustomDropdown as DropDown, FONT_STYLES, _default$7 as FeedbackForm, FileUpload, FontStyle, _default$d as Line, NotificationBandge, _default$4 as OTPInput, _default$9 as OurOfficesButton, PdfView, PopUp, _default as PropertyDetails, RadioButtonGroup, ShapeType, _default$6 as SingleSelectionTags, type SlideButtonHandle, Star as StarRating, _default$3 as Stepper, _default$f as SwipableList, _default$i as Tabs, Tags, TextDirectType, CommonTextInput as TextInput, Theme, Toast, type ToastRef, CustomSwitch as ToggleButton, ToggleButtonType, ToggleTextType, _default$c as Topic, copyToClipboard, theme as default, height, horizontalScale, moderateScale, toastService, verticalScale, width };
package/lib/index.js CHANGED
@@ -7,6 +7,7 @@ var reactRedux = require('react-redux');
7
7
  var reactNative = require('react-native');
8
8
  var reactNativeGestureHandler = require('react-native-gesture-handler');
9
9
  var blur = require('@react-native-community/blur');
10
+ var Svg = require('react-native-svg');
10
11
  var Tooltip = require('react-native-walkthrough-tooltip');
11
12
  var Pdf = require('react-native-pdf');
12
13
  var Progress = require('react-native-progress');
@@ -41,6 +42,7 @@ function _interopNamespace(e) {
41
42
  }
42
43
 
43
44
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
45
+ var Svg__default = /*#__PURE__*/_interopDefaultLegacy(Svg);
44
46
  var Tooltip__default = /*#__PURE__*/_interopDefaultLegacy(Tooltip);
45
47
  var Pdf__default = /*#__PURE__*/_interopDefaultLegacy(Pdf);
46
48
  var Progress__namespace = /*#__PURE__*/_interopNamespace(Progress);
@@ -370,13 +372,13 @@ const CustomTypography = ({
370
372
  reactNative.Text,
371
373
  {
372
374
  testID,
373
- style: [textStyle, styles$C.container, style],
375
+ style: [textStyle, styles$B.container, style],
374
376
  ...props
375
377
  },
376
378
  text
377
379
  );
378
380
  };
379
- const styles$C = reactNative.StyleSheet.create({
381
+ const styles$B = reactNative.StyleSheet.create({
380
382
  container: { writingDirection: "auto", alignSelf: "flex-start" }
381
383
  });
382
384
 
@@ -588,7 +590,7 @@ const DHRE_COLORS_TEXT = {
588
590
  DH_SURFACE_SECONDARY: "#212121"
589
591
  };
590
592
 
591
- const styles$B = reactNative.StyleSheet.create({
593
+ const styles$A = reactNative.StyleSheet.create({
592
594
  badge: {
593
595
  backgroundColor: DHRE_COLORS_ALERT.DH_SUCCESS_GREEN,
594
596
  borderRadius: 15,
@@ -615,16 +617,16 @@ const Badge = ({
615
617
  return /* @__PURE__ */ React__default["default"].createElement(
616
618
  reactNative.Pressable,
617
619
  {
618
- style: [styles$B.badge, commonStyles.centerRow, style],
620
+ style: [styles$A.badge, commonStyles.centerRow, style],
619
621
  testID: "BADGE",
620
622
  onPress: handleIconPress
621
623
  },
622
- iconName && /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: [styles$B.icon, iconStyle] }, React__default["default"].cloneElement(iconName)),
624
+ iconName && /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: [styles$A.icon, iconStyle] }, React__default["default"].cloneElement(iconName)),
623
625
  text && /* @__PURE__ */ React__default["default"].createElement(
624
626
  CustomTypography,
625
627
  {
626
628
  variant: "B3semiBold",
627
- style: [styles$B.text, textStyle],
629
+ style: [styles$A.text, textStyle],
628
630
  text
629
631
  }
630
632
  )
@@ -632,7 +634,7 @@ const Badge = ({
632
634
  };
633
635
  var Badge$1 = withThemeProvider(Badge);
634
636
 
635
- const styles$A = reactNative.StyleSheet.create({
637
+ const styles$z = reactNative.StyleSheet.create({
636
638
  mainContainer: {
637
639
  flex: 1,
638
640
  justifyContent: "flex-end"
@@ -712,52 +714,132 @@ const BottomDrawer = ({
712
714
  behavior: reactNative.Platform.OS === "ios" ? "padding" : "height",
713
715
  style: { flex: 1 }
714
716
  },
715
- /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: [styles$A.mainContainer, style], testID }, showBlurView ? /* @__PURE__ */ React__default["default"].createElement(
717
+ /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: [styles$z.mainContainer, style], testID }, showBlurView ? /* @__PURE__ */ React__default["default"].createElement(
716
718
  blur.BlurView,
717
719
  {
718
- style: [styles$A.blurView, blurViewStyle],
720
+ style: [styles$z.blurView, blurViewStyle],
719
721
  blurType,
720
722
  blurAmount
721
723
  }
722
- ) : null, /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: [styles$A.modalContainer, modalContainerStyle] }, showHeader && /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$A.separator }), /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$A.headerContainer }, showLeftIcon && leftIcon ? React__default["default"].cloneElement(leftIcon, {
724
+ ) : null, /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: [styles$z.modalContainer, modalContainerStyle] }, showHeader && /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, /* @__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
725
  width: moderateScale(24),
724
726
  height: moderateScale(24),
725
- style: styles$A.leftIconStyle,
727
+ style: styles$z.leftIconStyle,
726
728
  onPress: onLeftIconPress
727
729
  }) : null, /* @__PURE__ */ React__default["default"].createElement(
728
730
  CustomTypography,
729
731
  {
730
732
  variant: titleVariant,
731
733
  text: title,
732
- style: { ...styles$A.title, ...titleStyle }
734
+ style: { ...styles$z.title, ...titleStyle }
733
735
  }
734
736
  ), showRightIcon && rightIcon ? React__default["default"].cloneElement(rightIcon, {
735
737
  width: moderateScale(24),
736
738
  height: moderateScale(24),
737
- style: styles$A.rightIconStyle,
739
+ style: styles$z.rightIconStyle,
738
740
  onPress: toggleModal
739
741
  }) : null)), children))
740
742
  ))
741
743
  );
742
744
  };
743
745
 
744
- const styles$z = reactNative.StyleSheet.create({
745
- container: {
746
- flex: 1,
747
- justifyContent: "center",
748
- alignItems: "center",
749
- backgroundColor: "transparent",
750
- position: "absolute",
751
- width: "100%",
752
- height: "100%",
753
- zIndex: 1e3
754
- }
755
- });
746
+ const createStyles$3 = (theme) => {
747
+ return reactNative.StyleSheet.create({
748
+ backdrop: {
749
+ flex: 1,
750
+ justifyContent: "center",
751
+ alignItems: "center",
752
+ backgroundColor: "rgba(0, 0, 0, 0.3)"
753
+ },
754
+ box: {
755
+ width: 148,
756
+ height: 187,
757
+ backgroundColor: theme.SURFACE_PRIMARY,
758
+ borderRadius: 16,
759
+ justifyContent: "center",
760
+ alignItems: "center",
761
+ shadowColor: "#000",
762
+ shadowOffset: { width: 0, height: 2 },
763
+ shadowOpacity: 0.2,
764
+ shadowRadius: 4,
765
+ elevation: 5
766
+ },
767
+ loader: {
768
+ width: 80,
769
+ height: 80,
770
+ justifyContent: "center",
771
+ alignItems: "center"
772
+ },
773
+ text: {
774
+ marginTop: 16,
775
+ textAlign: "center",
776
+ alignSelf: "center",
777
+ alignContent: "center",
778
+ color: theme.CONTENT_PRIMARY
779
+ }
780
+ });
781
+ };
756
782
 
757
783
  const CustomLoader = ({ loading }) => {
784
+ const rotateAnim = React.useRef(new reactNative.Animated.Value(0)).current;
785
+ const { theme, mode } = useTheme();
786
+ const styles = createStyles$3(theme);
787
+ React.useEffect(() => {
788
+ if (loading) {
789
+ reactNative.Animated.loop(
790
+ reactNative.Animated.parallel([
791
+ reactNative.Animated.timing(rotateAnim, {
792
+ toValue: 1,
793
+ duration: 1500,
794
+ easing: reactNative.Easing.linear,
795
+ useNativeDriver: true
796
+ })
797
+ ])
798
+ ).start();
799
+ }
800
+ }, [loading]);
758
801
  if (!loading) return null;
759
- return /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$z.container }, /* @__PURE__ */ React__default["default"].createElement(reactNative.ActivityIndicator, { size: "large", color: "#686868" }));
802
+ const spin = rotateAnim.interpolate({
803
+ inputRange: [0, 1],
804
+ outputRange: ["0deg", "360deg"]
805
+ });
806
+ return /* @__PURE__ */ React__default["default"].createElement(reactNative.Modal, { transparent: true, visible: loading, animationType: "fade" }, /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles.backdrop }, /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles.box }, /* @__PURE__ */ React__default["default"].createElement(reactNative.Animated.View, { style: [styles.loader, { transform: [{ rotate: spin }] }] }, /* @__PURE__ */ React__default["default"].createElement(Svg__default["default"], { width: "100", height: "100", viewBox: "0 0 100 100" }, /* @__PURE__ */ React__default["default"].createElement(Svg.Defs, null, /* @__PURE__ */ React__default["default"].createElement(Svg.LinearGradient, { id: "grad", x1: "0%", y1: "0%", x2: "100%", y2: "100%" }, /* @__PURE__ */ React__default["default"].createElement(Svg.Stop, { offset: "0%", stopColor: "#000000", stopOpacity: "2" }), /* @__PURE__ */ React__default["default"].createElement(
807
+ Svg.Stop,
808
+ {
809
+ offset: "40%",
810
+ stopColor: mode === "dark" ? "#5A5A5A00" : "#686868",
811
+ stopOpacity: "5"
812
+ }
813
+ ), /* @__PURE__ */ React__default["default"].createElement(
814
+ Svg.Stop,
815
+ {
816
+ offset: "100%",
817
+ stopColor: mode === "dark" ? "#FFFFFF" : "#AAAAAA",
818
+ stopOpacity: ".9"
819
+ }
820
+ ))), /* @__PURE__ */ React__default["default"].createElement(
821
+ Svg.Circle,
822
+ {
823
+ cx: "50",
824
+ cy: "50",
825
+ r: "40",
826
+ stroke: "url(#grad)",
827
+ strokeWidth: "8",
828
+ fill: "none",
829
+ strokeDasharray: "250",
830
+ strokeLinecap: "round"
831
+ }
832
+ ))), /* @__PURE__ */ React__default["default"].createElement(
833
+ CustomText$1,
834
+ {
835
+ text: "Loading...",
836
+ style: styles.text,
837
+ variant: FontStyle.B4_REGULAR,
838
+ textColor: "#000000"
839
+ }
840
+ ))));
760
841
  };
842
+ var CustomLoader$1 = withThemeProvider(CustomLoader);
761
843
 
762
844
  const CustomButton = ({
763
845
  title,
@@ -795,7 +877,7 @@ const CustomButton = ({
795
877
  disabled
796
878
  },
797
879
  imagePosition === "left" && leftIcon && /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: iconStyle }, React__default["default"].cloneElement(leftIcon, { width: 20, height: 20 })),
798
- isLoading ? /* @__PURE__ */ React__default["default"].createElement(CustomLoader, { loading: isLoading }) : /* @__PURE__ */ React__default["default"].createElement(
880
+ isLoading ? /* @__PURE__ */ React__default["default"].createElement(CustomLoader$1, { loading: isLoading }) : /* @__PURE__ */ React__default["default"].createElement(
799
881
  CustomText$1,
800
882
  {
801
883
  text: title,
@@ -4805,7 +4887,7 @@ exports.CustomDocumentPicker = CustomDocumentPicker$1;
4805
4887
  exports.CustomDropdown = CustomDropdown$1;
4806
4888
  exports.CustomHeader = CustomHeader$1;
4807
4889
  exports.CustomIcon = CustomIcon;
4808
- exports.CustomLoader = CustomLoader;
4890
+ exports.CustomLoader = CustomLoader$1;
4809
4891
  exports.CustomProgressBar = CustomProgressBar;
4810
4892
  exports.CustomSearchBar = CustomSearchBar;
4811
4893
  exports.CustomSlideButton = index$2;