dhre-ui-kit 0.0.94 → 0.0.96

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.
Files changed (218) hide show
  1. package/{src/assets/index.ts → lib/assets/index.d.ts} +1 -18
  2. package/lib/index.d.ts +862 -0
  3. package/lib/index.esm.js +2 -0
  4. package/lib/index.esm.js.map +1 -0
  5. package/lib/index.js +4333 -0
  6. package/lib/index.js.map +1 -0
  7. package/lib/index.mjs +4248 -0
  8. package/lib/index.mjs.map +1 -0
  9. package/lib/theme/ThemeContext.d.ts +10 -0
  10. package/lib/theme/colors.d.ts +166 -0
  11. package/lib/theme/fonts.d.ts +8 -0
  12. package/lib/theme/themes.d.ts +131 -0
  13. package/lib/theme/withThemeProvider.d.ts +2 -0
  14. package/lib/utils/appEnum.d.ts +90 -0
  15. package/lib/utils/commonStyles.d.ts +15 -0
  16. package/lib/utils/constants.d.ts +19 -0
  17. package/lib/utils/deviceUtils.d.ts +7 -0
  18. package/lib/utils/regex.d.ts +1 -0
  19. package/lib/utils/stylehelper.d.ts +5 -0
  20. package/package.json +61 -81
  21. package/README.md +0 -1
  22. package/__mocks__/custom-text.mock.tsx +0 -19
  23. package/__mocks__/setup-tests.ts +0 -24
  24. package/__mocks__/svgMock.ts +0 -2
  25. package/src/App.tsx +0 -43
  26. package/src/assets/fonts/MeraasAktiv_Bd.ttf +0 -0
  27. package/src/assets/fonts/MeraasAktiv_Lt.ttf +0 -0
  28. package/src/assets/fonts/MeraasAktiv_Rg.ttf +0 -0
  29. package/src/assets/images/arrowLeft.svg +0 -3
  30. package/src/assets/images/bellSimple.svg +0 -3
  31. package/src/assets/images/calenderDots.svg +0 -1
  32. package/src/assets/images/caretDown.svg +0 -3
  33. package/src/assets/images/caretLeft.svg +0 -3
  34. package/src/assets/images/caretRight.svg +0 -3
  35. package/src/assets/images/caretUp.svg +0 -3
  36. package/src/assets/images/checkWhite.svg +0 -3
  37. package/src/assets/images/circleTick.svg +0 -3
  38. package/src/assets/images/crossIcon.svg +0 -3
  39. package/src/assets/images/dotsThreeVertical.svg +0 -5
  40. package/src/assets/images/fileIcon.svg +0 -8
  41. package/src/assets/images/searchIcon.svg +0 -4
  42. package/src/assets/images/trash.svg +0 -7
  43. package/src/assets/images/uploadFileIcon.svg +0 -12
  44. package/src/components/ContactModel/ContactModel.tsx +0 -206
  45. package/src/components/ContactModel/index.ts +0 -1
  46. package/src/components/OutOfOffice/OurOffices.tsx +0 -91
  47. package/src/components/OutOfOffice/index.ts +0 -1
  48. package/src/components/accordion/Accordion.interface.ts +0 -16
  49. package/src/components/accordion/Accordion.styles.ts +0 -28
  50. package/src/components/accordion/Accordion.test.tsx +0 -21
  51. package/src/components/accordion/Accordion.tsx +0 -85
  52. package/src/components/accordion/index.ts +0 -1
  53. package/src/components/autoOtpReader/AutoOtpReader.test.tsx +0 -56
  54. package/src/components/autoOtpReader/AutoOtpReader.tsx +0 -79
  55. package/src/components/autoOtpReader/index.ts +0 -1
  56. package/src/components/badge/Badge.styles.ts +0 -20
  57. package/src/components/badge/Badge.test.tsx +0 -57
  58. package/src/components/badge/Badge.tsx +0 -48
  59. package/src/components/badge/index.ts +0 -1
  60. package/src/components/bottomDrawer/BottomDrawer.interface.ts +0 -23
  61. package/src/components/bottomDrawer/BottomDrawer.styles.ts +0 -47
  62. package/src/components/bottomDrawer/BottomDrawer.test.tsx +0 -19
  63. package/src/components/bottomDrawer/BottomDrawer.tsx +0 -92
  64. package/src/components/bottomDrawer/index.ts +0 -1
  65. package/src/components/button/Button.interface.ts +0 -19
  66. package/src/components/button/Button.styles.ts +0 -78
  67. package/src/components/button/Button.test.tsx +0 -43
  68. package/src/components/button/Button.tsx +0 -82
  69. package/src/components/button/index.ts +0 -1
  70. package/src/components/cards/Cards.interface.ts +0 -13
  71. package/src/components/cards/Cards.styles.ts +0 -59
  72. package/src/components/cards/Cards.test.tsx +0 -41
  73. package/src/components/cards/Cards.tsx +0 -69
  74. package/src/components/cards/index.ts +0 -1
  75. package/src/components/checkBox/CheckBox.interface.ts +0 -15
  76. package/src/components/checkBox/CheckBox.styles.ts +0 -35
  77. package/src/components/checkBox/CheckBox.test.tsx +0 -46
  78. package/src/components/checkBox/CheckBox.tsx +0 -50
  79. package/src/components/checkBox/index.ts +0 -1
  80. package/src/components/countryPicker/CountryPicker.tsx +0 -169
  81. package/src/components/countryPicker/index.ts +0 -1
  82. package/src/components/customDocumentPicker/CustomDocumentPicker.interface.ts +0 -13
  83. package/src/components/customDocumentPicker/CustomDocumentPicker.styles.ts +0 -33
  84. package/src/components/customDocumentPicker/CustomDocumentPicker.tsx +0 -100
  85. package/src/components/customDocumentPicker/index.ts +0 -1
  86. package/src/components/customDropdown/CustomDropdown.interface.ts +0 -15
  87. package/src/components/customDropdown/CustomDropdown.styles.tsx +0 -46
  88. package/src/components/customDropdown/CustomDropdown.test.tsx +0 -30
  89. package/src/components/customDropdown/CustomDropdown.tsx +0 -106
  90. package/src/components/customDropdown/index.ts +0 -1
  91. package/src/components/customHeader/CustomHeader.interface.tsx +0 -10
  92. package/src/components/customHeader/CustomHeader.styles.ts +0 -26
  93. package/src/components/customHeader/CustomHeader.test.tsx +0 -14
  94. package/src/components/customHeader/CustomHeader.tsx +0 -46
  95. package/src/components/customHeader/index.ts +0 -1
  96. package/src/components/customIcon/CustomIcon.interface.ts +0 -12
  97. package/src/components/customIcon/CustomIcon.styles.ts +0 -13
  98. package/src/components/customIcon/CustomIcon.test.tsx +0 -14
  99. package/src/components/customIcon/CustomIcon.tsx +0 -33
  100. package/src/components/customIcon/index.ts +0 -1
  101. package/src/components/customInputText/CustomInputText.interface.ts +0 -20
  102. package/src/components/customInputText/CustomInputText.styles.ts +0 -56
  103. package/src/components/customInputText/CustomInputText.test.tsx +0 -37
  104. package/src/components/customInputText/CustomInputText.tsx +0 -120
  105. package/src/components/customInputText/index.ts +0 -1
  106. package/src/components/customLoader/CustomLoader.inteface.ts +0 -3
  107. package/src/components/customLoader/CustomLoader.styles.ts +0 -16
  108. package/src/components/customLoader/CustomLoader.tsx +0 -16
  109. package/src/components/customLoader/index.ts +0 -1
  110. package/src/components/customSearchBar/CustomSearchBar.interface.ts +0 -21
  111. package/src/components/customSearchBar/CustomSearchBar.styles.ts +0 -23
  112. package/src/components/customSearchBar/CustomSearchBar.test.tsx +0 -27
  113. package/src/components/customSearchBar/CustomSearchBar.tsx +0 -87
  114. package/src/components/customSearchBar/index.ts +0 -1
  115. package/src/components/customSlideButton/custom-slide-button.interface.ts +0 -4
  116. package/src/components/customSlideButton/index.tsx +0 -78
  117. package/src/components/customSlideButton/styles.ts +0 -39
  118. package/src/components/customSwitchBtn/customSwitchBtn.interface.ts +0 -15
  119. package/src/components/customSwitchBtn/customSwitchBtn.styles.ts +0 -34
  120. package/src/components/customSwitchBtn/customSwitchBtn.tsx +0 -63
  121. package/src/components/customSwitchBtn/index.ts +0 -1
  122. package/src/components/customText/CustomText.tsx +0 -33
  123. package/src/components/customText/index.ts +0 -1
  124. package/src/components/customTooltip/CustomTooltip.interface.ts +0 -14
  125. package/src/components/customTooltip/CustomTooltip.styles.ts +0 -23
  126. package/src/components/customTooltip/CustomTooltip.test.tsx +0 -18
  127. package/src/components/customTooltip/CustomTooltip.tsx +0 -46
  128. package/src/components/customTooltip/index.ts +0 -1
  129. package/src/components/customTypography/CustomTypography.test.tsx +0 -12
  130. package/src/components/customTypography/CustomTypography.tsx +0 -27
  131. package/src/components/customTypography/index.ts +0 -1
  132. package/src/components/dateRangePicker/DateRangePicker.interface.ts +0 -19
  133. package/src/components/dateRangePicker/DateRangePicker.styles.ts +0 -19
  134. package/src/components/dateRangePicker/DateRangePicker.tsx +0 -108
  135. package/src/components/dateRangePicker/index.ts +0 -1
  136. package/src/components/dropDown/DropDown.tsx +0 -145
  137. package/src/components/dropDown/index.ts +0 -1
  138. package/src/components/feedback/feedback.style.ts +0 -48
  139. package/src/components/feedback/feedback.tsx +0 -61
  140. package/src/components/feedback/index.ts +0 -1
  141. package/src/components/fileUpload/FileUpload.styles.ts +0 -41
  142. package/src/components/fileUpload/FileUpload.test.tsx +0 -39
  143. package/src/components/fileUpload/FileUpload.tsx +0 -65
  144. package/src/components/fileUpload/index.ts +0 -1
  145. package/src/components/horizontalLine/Line.tsx +0 -26
  146. package/src/components/horizontalLine/index.ts +0 -1
  147. package/src/components/notificationBandge/NotificationBandge.interface.tsx +0 -3
  148. package/src/components/notificationBandge/NotificationBandge.styles.tsx +0 -26
  149. package/src/components/notificationBandge/NotificationBandge.tsx +0 -26
  150. package/src/components/notificationBandge/index.tsx +0 -1
  151. package/src/components/otp/index.tsx +0 -166
  152. package/src/components/otp/otp.interface.ts +0 -14
  153. package/src/components/otp/styles.ts +0 -29
  154. package/src/components/pdfView/PdfView.test.tsx +0 -12
  155. package/src/components/pdfView/PdfView.tsx +0 -8
  156. package/src/components/pdfView/index.ts +0 -1
  157. package/src/components/popup/PopUp.interface.ts +0 -9
  158. package/src/components/popup/PopUp.styles.ts +0 -52
  159. package/src/components/popup/PopUp.test.tsx +0 -35
  160. package/src/components/popup/PopUp.tsx +0 -60
  161. package/src/components/popup/index.ts +0 -1
  162. package/src/components/progressBar/ProgressBar.test.tsx +0 -78
  163. package/src/components/progressBar/ProgressBar.tsx +0 -120
  164. package/src/components/progressBar/index.ts +0 -1
  165. package/src/components/property360View/Property360View.test.tsx +0 -24
  166. package/src/components/property360View/Property360View.tsx +0 -19
  167. package/src/components/property360View/index.ts +0 -1
  168. package/src/components/rating/index.ts +0 -1
  169. package/src/components/rating/rating.styles.ts +0 -13
  170. package/src/components/rating/rating.test.tsx +0 -61
  171. package/src/components/rating/rating.tsx +0 -96
  172. package/src/components/scrollList/category.tsx +0 -110
  173. package/src/components/scrollList/index.ts +0 -1
  174. package/src/components/singleSelectionTag/TagSingleSelection.tsx +0 -105
  175. package/src/components/singleSelectionTag/index.ts +0 -1
  176. package/src/components/stepper/index.tsx +0 -105
  177. package/src/components/stepper/stepper.interface.ts +0 -24
  178. package/src/components/stepper/styles.ts +0 -74
  179. package/src/components/swipableList/SwipableList.interface.ts +0 -52
  180. package/src/components/swipableList/SwipableList.styles.ts +0 -30
  181. package/src/components/swipableList/SwipableList.test.tsx +0 -209
  182. package/src/components/swipableList/SwipableList.tsx +0 -137
  183. package/src/components/swipableList/index.ts +0 -1
  184. package/src/components/tabs/Tabs.interface.ts +0 -10
  185. package/src/components/tabs/Tabs.styles.ts +0 -24
  186. package/src/components/tabs/Tabs.tsx +0 -74
  187. package/src/components/tabs/index.ts +0 -1
  188. package/src/components/tags/Tags.interface.ts +0 -12
  189. package/src/components/tags/Tags.styles.ts +0 -36
  190. package/src/components/tags/Tags.test.tsx +0 -22
  191. package/src/components/tags/Tags.tsx +0 -76
  192. package/src/components/tags/index.ts +0 -1
  193. package/src/components/textInput/Textinput.tsx +0 -124
  194. package/src/components/textInput/index.ts +0 -1
  195. package/src/components/toast/Toast.interface.ts +0 -39
  196. package/src/components/toast/Toast.styles.ts +0 -41
  197. package/src/components/toast/Toast.test.tsx +0 -13
  198. package/src/components/toast/Toast.tsx +0 -115
  199. package/src/components/toast/ToastService.ts +0 -30
  200. package/src/components/toast/index.ts +0 -1
  201. package/src/components/toggleButton/ToggleButton.styles.ts +0 -40
  202. package/src/components/toggleButton/ToggleButton.test.tsx +0 -33
  203. package/src/components/toggleButton/ToggleButton.tsx +0 -78
  204. package/src/components/toggleButton/index.ts +0 -1
  205. package/src/components/topic/Topic.tsx +0 -85
  206. package/src/components/topic/index.ts +0 -1
  207. package/src/index.ts +0 -59
  208. package/src/theme/ThemeContext.tsx +0 -38
  209. package/src/theme/colors.ts +0 -186
  210. package/src/theme/fonts.ts +0 -72
  211. package/src/theme/themes.ts +0 -137
  212. package/src/theme/withThemeProvider.tsx +0 -14
  213. package/src/utils/appEnum.ts +0 -109
  214. package/src/utils/commonStyles.ts +0 -17
  215. package/src/utils/constants.ts +0 -20
  216. package/src/utils/deviceUtils.ts +0 -14
  217. package/src/utils/regex.ts +0 -1
  218. package/src/utils/stylehelper.ts +0 -13
@@ -1,23 +0,0 @@
1
- import {StyleSheet} from 'react-native';
2
- import {FONT_STYLES} from '../../theme/fonts';
3
- import {horizontalScale, moderateScale} from '../../utils/stylehelper';
4
-
5
- const styles = StyleSheet.create({
6
- inputContainer: {
7
- flexDirection: 'row',
8
- justifyContent: 'center',
9
- alignItems: 'center',
10
- paddingHorizontal: horizontalScale(16),
11
- borderRadius: moderateScale(8),
12
- borderWidth: moderateScale(1),
13
- },
14
- input: {
15
- flex: 1,
16
- ...FONT_STYLES.L1_REGULAR,
17
- color: '#fff',
18
- },
19
- crossIconStyle: {marginLeft: horizontalScale(8)},
20
- searchIconStyle: {marginRight: horizontalScale(8)},
21
- });
22
-
23
- export default styles;
@@ -1,27 +0,0 @@
1
- import React from 'react';
2
- import {it} from '@jest/globals';
3
- import {fireEvent, render} from '@testing-library/react-native';
4
- import CustomSearchBar from './CustomSearchBar';
5
-
6
- const mockProps = {
7
- testID: 'CUSTOM-SEARCH-BAR',
8
- disabled: false,
9
- handelOnChangeText: jest.fn(),
10
- };
11
-
12
- describe('Custom search bar component', () => {
13
- it('Component renders correctly', () => {
14
- const {getByTestId} = render(
15
- <CustomSearchBar
16
- setValue={(val: string) => {
17
- return val;
18
- }}
19
- value={''}
20
- {...mockProps}
21
- />,
22
- );
23
- expect(getByTestId(mockProps.testID)).toBeTruthy();
24
- const textInput = getByTestId('CUSTOM-SEARCH-BAR-INPUT');
25
- fireEvent.changeText(textInput, 'test@example.com');
26
- });
27
- });
@@ -1,87 +0,0 @@
1
- import React from 'react';
2
- import {Pressable, TextInput, View} from 'react-native';
3
- import {CrossIcon, SearchIcon} from '../../assets';
4
- import {moderateScale, verticalScale} from '../../utils/stylehelper';
5
- import {CustomSearchBarProps} from './CustomSearchBar.interface';
6
- import styles from './CustomSearchBar.styles';
7
-
8
- const CustomSearchBar = ({
9
- value,
10
- height = 40,
11
- disabled = false,
12
- testID = 'CUSTOM-SEARCH-BAR',
13
- inputContainerStyle,
14
- searchIconStyle,
15
- crossIconStyle,
16
- inputStyle,
17
- onSearchIconPress,
18
- onCrossIconPress,
19
- handleOnChangeText,
20
- setValue,
21
- rightIcon = <CrossIcon />,
22
- disableBorderColor = '#4F4F4F',
23
- borderColor = '#FFFFFF',
24
- disablePlaceHolderStyle = '#686868',
25
- enablePlaceHolderStyle = '#A7A7A7',
26
- ...props
27
- }: CustomSearchBarProps) => {
28
- return (
29
- <View
30
- testID={testID}
31
- style={[
32
- styles.inputContainer,
33
- {
34
- height: verticalScale(height),
35
- borderColor: disabled
36
- ? disableBorderColor
37
- : value
38
- ? borderColor
39
- : '#A7A7A7',
40
- },
41
- inputContainerStyle,
42
- ]}>
43
- <Pressable
44
- onPress={() => {
45
- console.log('Search icon pressed'); // Default behavior
46
- onSearchIconPress?.(); // Call custom handler if provided
47
- }}
48
- style={searchIconStyle}>
49
- {React.cloneElement(<SearchIcon />, {
50
- width: moderateScale(24),
51
- height: moderateScale(24),
52
- style: [styles.searchIconStyle, searchIconStyle],
53
- })}
54
- </Pressable>
55
- <TextInput
56
- {...props}
57
- testID={`${testID}-INPUT`}
58
- style={[styles.input, inputStyle]} // Apply custom input styles
59
- editable={!disabled}
60
- value={value}
61
- placeholderTextColor={
62
- disabled ? disablePlaceHolderStyle : enablePlaceHolderStyle
63
- }
64
- onChangeText={val => {
65
- setValue(val);
66
- handleOnChangeText?.(val);
67
- }}
68
- />
69
- {value && (
70
- <Pressable
71
- onPress={() => {
72
- setValue(''); // Clear the input field
73
- onCrossIconPress?.(); // Call custom handler if provided
74
- }}
75
- style={crossIconStyle}>
76
- {React.cloneElement(rightIcon, {
77
- // width: moderateScale(24),
78
- // height: moderateScale(24),
79
- style: [styles.crossIconStyle, crossIconStyle],
80
- })}
81
- </Pressable>
82
- )}
83
- </View>
84
- );
85
- };
86
-
87
- export default CustomSearchBar;
@@ -1 +0,0 @@
1
- export {default} from './CustomSearchBar';
@@ -1,4 +0,0 @@
1
- export interface CustomSlideButtonProps {
2
- label?: string;
3
- onComplete?: () => void;
4
- }
@@ -1,78 +0,0 @@
1
- import React, {useRef} from 'react';
2
- import {View, PanResponder, Animated, Dimensions} from 'react-native';
3
- import {CaretRight} from '../../assets/index';
4
- import {CustomTypography, FontStyle} from '../../index';
5
- import styles from './styles';
6
- import {CustomSlideButtonProps} from './custom-slide-button.interface';
7
- import {useTheme} from '../../theme/ThemeContext';
8
- import {withThemeProvider} from '../../theme/withThemeProvider';
9
-
10
- const {width} = Dimensions.get('window');
11
- const BUTTON_WIDTH = 40; // Width of the button
12
-
13
- const CustomSlideButton = ({label, onComplete}: CustomSlideButtonProps) => {
14
- const pan = useRef(new Animated.Value(0)).current;
15
-
16
- const panResponder = useRef(
17
- PanResponder.create({
18
- onMoveShouldSetPanResponder: (evt, gestureState) => {
19
- return gestureState.dx > 0; // Only set when moving right
20
- },
21
- onPanResponderGrant: () => {},
22
- onPanResponderMove: (evt, gestureState) => {
23
- if (gestureState.dx < width - BUTTON_WIDTH) {
24
- pan.setValue(gestureState.dx);
25
- }
26
- },
27
- onPanResponderRelease: (evt, gestureState) => {
28
- if (gestureState.dx > width - BUTTON_WIDTH - 100) {
29
- // If slid far enough, trigger payment action
30
- onComplete && onComplete();
31
- Animated.spring(pan, {
32
- toValue: width - BUTTON_WIDTH - 10,
33
- useNativeDriver: false,
34
- }).start();
35
- } else {
36
- // Otherwise, reset position
37
- Animated.spring(pan, {
38
- toValue: 0,
39
- useNativeDriver: false,
40
- }).start();
41
- }
42
- },
43
- }),
44
- ).current;
45
-
46
- const {theme} = useTheme();
47
- return (
48
- <View
49
- style={{
50
- ...styles.sliderContainer,
51
- backgroundColor: theme.SURFACE_INVERTED,
52
- }}>
53
- <View style={styles.buttonTextCOntainer}>
54
- <CustomTypography
55
- text={label}
56
- variant={FontStyle.L1_REGULAR}
57
- style={{
58
- color: theme.CONTENT_INVERTED,
59
- }}
60
- />
61
- </View>
62
- <Animated.View
63
- style={[styles.slider, {transform: [{translateX: pan}]}]}
64
- {...panResponder.panHandlers}>
65
- <View
66
- style={{
67
- ...styles.button,
68
- backgroundColor: theme.SURFACE_PRIMARY,
69
- width: BUTTON_WIDTH,
70
- }}>
71
- <CaretRight />
72
- </View>
73
- </Animated.View>
74
- </View>
75
- );
76
- };
77
-
78
- export default withThemeProvider(CustomSlideButton);
@@ -1,39 +0,0 @@
1
- import {StyleSheet} from 'react-native';
2
- import {moderateScale, verticalScale} from '../../utils/stylehelper';
3
-
4
- const styles = StyleSheet.create({
5
- container: {
6
- flex: 1,
7
- justifyContent: 'center',
8
- alignItems: 'center',
9
- },
10
- sliderContainer: {
11
- height: verticalScale(48),
12
- borderRadius: moderateScale(25),
13
- overflow: 'hidden',
14
- justifyContent: 'center',
15
- },
16
- slider: {
17
- height: '100%',
18
- width: '100%',
19
- position: 'absolute',
20
- },
21
- button: {
22
- height: verticalScale(40),
23
- justifyContent: 'center',
24
- alignItems: 'center',
25
- borderRadius: moderateScale(20),
26
- margin: moderateScale(4),
27
- },
28
- buttonTextCOntainer: {
29
- position: 'absolute',
30
- left: 0,
31
- right: 0,
32
- bottom: 0,
33
- top: 0,
34
- alignItems: 'center',
35
- justifyContent: 'center',
36
- },
37
- });
38
-
39
- export default styles;
@@ -1,15 +0,0 @@
1
- import {TextStyle, ViewStyle} from 'react-native';
2
-
3
- export interface CustomSwitchBtnProps {
4
- value: boolean;
5
- onValueChange: (value: boolean) => void;
6
- activeText: string;
7
- activeTextVariant?: string;
8
- inActiveText: string;
9
- inActiveTextVariant?: string;
10
- containerStyle?: ViewStyle;
11
- activeTextStyle?: TextStyle;
12
- inActiveTextStyle?: TextStyle;
13
- disabled?: boolean;
14
- circleStyle?: ViewStyle;
15
- }
@@ -1,34 +0,0 @@
1
- import {StyleSheet} from 'react-native';
2
- import {
3
- horizontalScale,
4
- moderateScale,
5
- verticalScale,
6
- } from '../../utils/stylehelper';
7
-
8
- const styles = StyleSheet.create({
9
- mainContainer: {
10
- flexDirection: 'row',
11
- justifyContent: 'space-between',
12
- alignItems: 'center',
13
- width: horizontalScale(75),
14
- height: verticalScale(32),
15
- borderRadius: moderateScale(25),
16
- padding: moderateScale(4),
17
- },
18
- circle: {
19
- width: horizontalScale(38),
20
- height: verticalScale(24),
21
- borderRadius: moderateScale(25),
22
- },
23
- activeText: {
24
- position: 'absolute',
25
- left: horizontalScale(12),
26
- },
27
- inActiveText: {
28
- position: 'absolute',
29
- top: verticalScale(2),
30
- right: horizontalScale(18),
31
- },
32
- });
33
-
34
- export default styles;
@@ -1,63 +0,0 @@
1
- import React, {useEffect, useState} from 'react';
2
- import {Pressable, Animated} from 'react-native';
3
- import CustomTypography from '../customTypography';
4
- import {FontStyle} from '../../utils/appEnum';
5
- import {CustomSwitchBtnProps} from './customSwitchBtn.interface';
6
- import styles from './customSwitchBtn.styles';
7
-
8
- const CustomSwitchBtn = ({
9
- value,
10
- onValueChange,
11
- disabled = false,
12
- activeText,
13
- activeTextVariant = FontStyle.L2_BOLD,
14
- inActiveText,
15
- inActiveTextVariant = FontStyle.B3_REGULAR,
16
- containerStyle,
17
- activeTextStyle,
18
- inActiveTextStyle,
19
- circleStyle,
20
- }: CustomSwitchBtnProps) => {
21
- const [animatedValue] = useState(new Animated.Value(value ? 1 : 0));
22
-
23
- const translateX = animatedValue.interpolate({
24
- inputRange: [0, 1],
25
- outputRange: [0, 28],
26
- });
27
- useEffect(() => {
28
- Animated.timing(animatedValue, {
29
- toValue: value ? 1 : 0,
30
- duration: 300,
31
- useNativeDriver: false,
32
- }).start();
33
- }, [value]);
34
-
35
- const toggleSwitch = () => {
36
- onValueChange(!value);
37
- };
38
- return (
39
- <Pressable
40
- disabled={disabled}
41
- onPress={toggleSwitch}
42
- style={{...styles.mainContainer, ...containerStyle}}>
43
- <Animated.View
44
- style={[styles.circle, {transform: [{translateX}], ...circleStyle}]}
45
- />
46
- <CustomTypography
47
- style={[styles.activeText, value ? inActiveTextStyle : activeTextStyle]}
48
- text={activeText}
49
- variant={activeTextVariant}
50
- />
51
- <CustomTypography
52
- style={[
53
- styles.inActiveText,
54
- value ? activeTextStyle : inActiveTextStyle,
55
- ]}
56
- text={inActiveText}
57
- variant={inActiveTextVariant}
58
- />
59
- </Pressable>
60
- );
61
- };
62
-
63
- export default CustomSwitchBtn;
@@ -1 +0,0 @@
1
- export {default} from './customSwitchBtn';
@@ -1,33 +0,0 @@
1
- import React from 'react';
2
- import {StyleProp, TextProps, TextStyle} from 'react-native';
3
- import {useTheme} from '../../theme/ThemeContext';
4
- import {withThemeProvider} from '../../theme/withThemeProvider';
5
- import {FONT_STYLES} from '../../theme/fonts';
6
- import CustomTypography from '../customTypography/CustomTypography';
7
-
8
- export interface CustomTextProps extends TextProps {
9
- text: string;
10
- variant: keyof typeof FONT_STYLES | string;
11
- style?: StyleProp<TextStyle>;
12
- textColor?: string;
13
- }
14
-
15
- const CustomText: React.FC<CustomTextProps> = ({
16
- text,
17
- style,
18
- variant,
19
- textColor = 'SURFACE_STATIC',
20
- ...props
21
- }) => {
22
- const {theme} = useTheme();
23
- return (
24
- <CustomTypography
25
- variant={variant}
26
- text={text || ''}
27
- style={[{color: theme[textColor]}, style]}
28
- {...props}
29
- />
30
- );
31
- };
32
-
33
- export default withThemeProvider(CustomText);
@@ -1 +0,0 @@
1
- export {default} from './CustomText';
@@ -1,14 +0,0 @@
1
- import React, {ReactElement} from 'react';
2
- import {ViewStyle} from 'react-native';
3
-
4
- export interface CustomTooltipProps {
5
- message: string;
6
- children: React.ReactNode;
7
- actionType?: 'press' | 'longPress';
8
- testId?: string;
9
- backgroundColor?: string;
10
- popoverContent?: React.ReactElement;
11
- icon?: ReactElement;
12
- iconStyle?: ViewStyle;
13
- iconColor?: string;
14
- }
@@ -1,23 +0,0 @@
1
- import {StyleSheet} from 'react-native';
2
- import {DHRE_COLORS_TEXT} from '../../theme/colors';
3
- import {moderateScale} from '../../utils/stylehelper';
4
-
5
- const styles = StyleSheet.create({
6
- tooltipContainerStyle: {
7
- flex: 1,
8
- borderRadius: moderateScale(16),
9
- padding: moderateScale(8),
10
- },
11
- mesageContainer: {
12
- flex: 1,
13
- flexDirection: 'row',
14
- justifyContent: 'space-between',
15
- alignItems: 'center',
16
- },
17
- messageStyle: {
18
- flex: 1,
19
- color: DHRE_COLORS_TEXT.DH_TEXTDARK,
20
- },
21
- });
22
-
23
- export default styles;
@@ -1,18 +0,0 @@
1
- import React from 'react';
2
- import {Pressable, Text} from 'react-native';
3
- import {it} from '@jest/globals';
4
- import {fireEvent, render} from '@testing-library/react-native';
5
- import CustomTooltip from './CustomTooltip';
6
-
7
- describe('Custom Tooltip Component', () => {
8
- it('Component renders correctly', () => {
9
- const {getByTestId} = render(
10
- <CustomTooltip message="TEST">
11
- <Pressable testID="BTN">
12
- <Text>Press me</Text>
13
- </Pressable>
14
- </CustomTooltip>,
15
- );
16
- fireEvent.press(getByTestId('BTN'));
17
- });
18
- });
@@ -1,46 +0,0 @@
1
- import React from 'react';
2
- import {View} from 'react-native';
3
- import Tooltip from 'rn-tooltip';
4
- import CustomTypography from '../customTypography/CustomTypography';
5
- import {CustomTooltipProps} from './CustomTooltip.interface';
6
- import styles from './CustomTooltip.styles';
7
- import {DHRE_COLORS_TEXT} from '../../theme/colors';
8
-
9
- const CustomTooltip: React.FC<CustomTooltipProps> = ({
10
- message,
11
- children,
12
- actionType = 'press',
13
- testId = 'CUSTOM-TOOLTIP',
14
- backgroundColor = DHRE_COLORS_TEXT.DH_WHITE,
15
- popoverContent,
16
- icon,
17
- iconStyle,
18
- iconColor = DHRE_COLORS_TEXT.DH_BLACK,
19
- }) => {
20
- const defaultPopoverContent = (
21
- <View style={styles.mesageContainer} testID={testId}>
22
- <CustomTypography
23
- variant="P4regular"
24
- style={styles.messageStyle}
25
- text={message}
26
- />
27
- {icon && (
28
- <View style={iconStyle}>
29
- {React.cloneElement(icon, {fill: iconColor})}
30
- </View>
31
- )}
32
- </View>
33
- );
34
-
35
- return (
36
- <Tooltip
37
- containerStyle={styles.tooltipContainerStyle}
38
- backgroundColor={backgroundColor}
39
- popover={popoverContent || defaultPopoverContent}
40
- actionType={actionType}>
41
- {children}
42
- </Tooltip>
43
- );
44
- };
45
-
46
- export default CustomTooltip;
@@ -1 +0,0 @@
1
- export {default} from './CustomTooltip';
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- import {render} from '@testing-library/react-native';
3
- import CustomTypography from './CustomTypography';
4
-
5
- describe('CustomTypography Component', () => {
6
- it('renders text correctly', () => {
7
- const {getByTestId} = render(
8
- <CustomTypography variant={'H1_BOLD'} text={'TESTING TEXT'} />,
9
- );
10
- expect(getByTestId('CUSTOM_TYPOGRAPHY')).toBeTruthy();
11
- });
12
- });
@@ -1,27 +0,0 @@
1
- import React from 'react';
2
- import {Text, TextProps} from 'react-native';
3
- import {FONT_STYLES} from '../../theme/fonts';
4
-
5
- interface TypoTextProps extends TextProps {
6
- variant: keyof typeof FONT_STYLES;
7
- text?: string;
8
- testID?: string;
9
- }
10
-
11
- const CustomTypography: React.FC<TypoTextProps> = ({
12
- variant,
13
- style,
14
- text,
15
- testID = 'CUSTOM_TYPOGRAPHY',
16
- ...props
17
- }) => {
18
- const textStyle = FONT_STYLES[variant];
19
-
20
- return (
21
- <Text testID={testID} style={[textStyle, style]} {...props}>
22
- {text}
23
- </Text>
24
- );
25
- };
26
-
27
- export default CustomTypography;
@@ -1 +0,0 @@
1
- export {default} from './CustomTypography';
@@ -1,19 +0,0 @@
1
- import {CalendarProps} from 'react-native-calendars';
2
- export interface DateRangePickerProps extends CalendarProps {
3
- onButtonPress: (startDate: string, endDate: string) => void;
4
- }
5
-
6
- export interface DayType {
7
- dateString: string;
8
- day: number;
9
- month: number;
10
- year: number;
11
- timestamp: number;
12
- }
13
-
14
- export interface MarkedDate {
15
- startingDay?: boolean;
16
- endingDay?: boolean;
17
- color: string;
18
- textColor: string;
19
- }
@@ -1,19 +0,0 @@
1
- import {StyleSheet} from 'react-native';
2
- import {FONT_STYLES} from '../../theme/fonts';
3
- import {verticalScale, moderateScale} from '../../utils/stylehelper';
4
-
5
- const styles = StyleSheet.create({
6
- applyButton: {
7
- marginTop: verticalScale(24),
8
- height: verticalScale(48),
9
- alignItems: 'center',
10
- borderRadius: moderateScale(25),
11
- backgroundColor: '#fff',
12
- },
13
- applyButtonText: {
14
- color: '#000',
15
- ...FONT_STYLES.L1_REGULAR,
16
- },
17
- });
18
-
19
- export default styles;