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,108 +0,0 @@
1
- import React, {useState} from 'react';
2
- import {View} from 'react-native';
3
- import {Calendar} from 'react-native-calendars';
4
- import Button from '../button';
5
- import {
6
- DateRangePickerProps,
7
- DayType,
8
- MarkedDate,
9
- } from './DateRangePicker.interface';
10
- import styles from './DateRangePicker.styles';
11
-
12
- const DateRangePicker = (props: DateRangePickerProps) => {
13
- const {onButtonPress} = props;
14
- const [selectedRange, setSelectedRange] = useState<{
15
- startDate: string;
16
- endDate: string;
17
- }>({
18
- startDate: '',
19
- endDate: '',
20
- });
21
-
22
- const onDayPress = (day: DayType) => {
23
- const {dateString} = day;
24
- const {startDate, endDate} = selectedRange;
25
-
26
- if (!startDate || (startDate && endDate)) {
27
- setSelectedRange({startDate: dateString, endDate: ''});
28
- } else if (startDate && !endDate) {
29
- if (new Date(dateString) >= new Date(startDate)) {
30
- setSelectedRange({startDate, endDate: dateString});
31
- } else {
32
- setSelectedRange({startDate: dateString, endDate: ''});
33
- }
34
- }
35
- };
36
-
37
- const getMarkedDates = () => {
38
- const {startDate, endDate} = selectedRange;
39
-
40
- const markedDates: {[key: string]: MarkedDate} = {};
41
-
42
- if (startDate) {
43
- markedDates[startDate] = {
44
- startingDay: true,
45
- color: '#2DE3A6',
46
- textColor: '#000000',
47
- };
48
- }
49
- if (endDate) {
50
- markedDates[endDate] = {
51
- endingDay: true,
52
- color: '#2DE3A6',
53
- textColor: '#000000',
54
- };
55
- }
56
-
57
- if (startDate && endDate) {
58
- const start = new Date(startDate);
59
- const end = new Date(endDate);
60
-
61
- while (start < end) {
62
- start.setDate(start.getDate() + 1);
63
- markedDates[start.toISOString().split('T')[0]] = {
64
- color: '#2DE3A6',
65
- textColor: '#000000',
66
- };
67
- }
68
- }
69
-
70
- return markedDates;
71
- };
72
-
73
- const isButtonDisabled = !selectedRange.startDate || !selectedRange.endDate;
74
-
75
- return (
76
- <View>
77
- <Calendar
78
- markedDates={getMarkedDates()}
79
- mode="date"
80
- markingType={'period'}
81
- theme={{
82
- calendarBackground: 'transparent',
83
- arrowColor: '#fff',
84
- monthTextColor: '#FFFFFF',
85
- dayTextColor: '#A7A7A7',
86
- todayTextColor: '#2DE3A6',
87
- }}
88
- style={{
89
- backgroundColor: 'transparent',
90
- color: '#A7A7A7',
91
- }}
92
- onDayPress={onDayPress}
93
- {...props}
94
- />
95
- <Button
96
- title="Apply"
97
- onPress={() => {
98
- onButtonPress(selectedRange?.startDate, selectedRange?.endDate);
99
- }}
100
- containerStyle={styles.applyButton}
101
- textStyle={styles.applyButtonText}
102
- disabled={isButtonDisabled}
103
- />
104
- </View>
105
- );
106
- };
107
-
108
- export default DateRangePicker;
@@ -1 +0,0 @@
1
- export {default} from './DateRangePicker';
@@ -1,145 +0,0 @@
1
- import React, {useState} from 'react';
2
- import {
3
- StyleSheet,
4
- Text,
5
- View,
6
- ViewStyle,
7
- TextStyle,
8
- ImageStyle,
9
- } from 'react-native';
10
- import {Dropdown} from 'react-native-element-dropdown';
11
- import {horizontalScale, verticalScale} from '../../utils/stylehelper';
12
- import theme from '../../theme/themes';
13
-
14
- interface CustomDropdownProps {
15
- data: {[key: string]: string}[];
16
- labelField?: string;
17
- valueField?: string;
18
- label?: string;
19
- placeholder?: string;
20
- containerStyle?: ViewStyle;
21
- dropdownStyle?: ViewStyle;
22
- placeholderStyle?: TextStyle;
23
- selectedTextStyle?: TextStyle;
24
- iconStyle?: ImageStyle;
25
- labelStyle?: TextStyle;
26
- defaultValue?: string;
27
- iconColor?: string;
28
- itemTextStyle?: TextStyle;
29
- onValueChange?: (value: string) => void;
30
- itemContainerStyle?: ViewStyle;
31
- }
32
-
33
- const CustomDropdown: React.FC<CustomDropdownProps> = ({
34
- data,
35
- labelField = 'label',
36
- valueField = 'value',
37
- label,
38
- placeholder,
39
- containerStyle,
40
- dropdownStyle,
41
- placeholderStyle,
42
- selectedTextStyle,
43
- iconStyle,
44
- labelStyle,
45
- defaultValue,
46
- iconColor,
47
- itemTextStyle,
48
- onValueChange,
49
- itemContainerStyle,
50
- }) => {
51
- const [value, setValue] = useState<string | undefined>(defaultValue);
52
- const [isFocus, setIsFocus] = useState<boolean>(false);
53
-
54
- const renderLabel = () => {
55
- if (value || isFocus) {
56
- return (
57
- <Text
58
- style={[
59
- styles.label,
60
- labelStyle,
61
- isFocus && {color: theme.BORDER_INVERTED['light']},
62
- ]}>
63
- {label}
64
- </Text>
65
- );
66
- }
67
- return null;
68
- };
69
-
70
- const handleValueChange = (item: {[key: string]: string}) => {
71
- const newValue = item[valueField];
72
- setValue(newValue);
73
- setIsFocus(false);
74
- if (onValueChange) {
75
- onValueChange(newValue);
76
- }
77
- };
78
-
79
- return (
80
- <View style={[styles.container, containerStyle]}>
81
- {label && renderLabel()}
82
- <Dropdown
83
- style={[
84
- styles.dropdown,
85
- dropdownStyle,
86
- isFocus && {borderColor: theme.BORDER_INVERTED['light']},
87
- ]}
88
- placeholderStyle={[styles.placeholderStyle, placeholderStyle]}
89
- selectedTextStyle={[styles.selectedTextStyle, selectedTextStyle]}
90
- iconStyle={[styles.iconStyle, iconStyle]}
91
- data={data ?? []}
92
- labelField={labelField}
93
- valueField={valueField}
94
- placeholder={!isFocus ? placeholder : ''}
95
- value={value}
96
- onFocus={() => setIsFocus(true)}
97
- onBlur={() => setIsFocus(false)}
98
- onChange={handleValueChange}
99
- iconColor={iconColor}
100
- dropdownPosition="bottom"
101
- itemTextStyle={itemTextStyle}
102
- itemContainerStyle={[styles.itemListStyle, itemContainerStyle]}
103
- />
104
- </View>
105
- );
106
- };
107
-
108
- const styles = StyleSheet.create({
109
- container: {
110
- backgroundColor: theme.SURFACE_STATIC['light'],
111
- marginVertical: verticalScale(4), // External margin
112
- },
113
- dropdown: {
114
- height: verticalScale(48),
115
- borderColor: theme.BORDER_PRIMARY['light'],
116
- borderWidth: 1,
117
- borderRadius: 8,
118
- paddingHorizontal: horizontalScale(12),
119
- backgroundColor: theme.SURFACE_STATIC['light'],
120
- },
121
- label: {
122
- position: 'absolute',
123
- backgroundColor: theme.SURFACE_STATIC['light'],
124
- left: horizontalScale(10),
125
- top: verticalScale(-8),
126
- zIndex: 10,
127
- paddingHorizontal: horizontalScale(4),
128
- fontSize: verticalScale(12),
129
- },
130
- placeholderStyle: {
131
- fontSize: verticalScale(16),
132
- },
133
- selectedTextStyle: {
134
- fontSize: verticalScale(16),
135
- },
136
- iconStyle: {
137
- width: horizontalScale(20),
138
- height: verticalScale(20),
139
- },
140
- itemListStyle: {
141
- maxHeight: verticalScale(150),
142
- },
143
- });
144
-
145
- export default CustomDropdown;
@@ -1 +0,0 @@
1
- export {default} from './DropDown';
@@ -1,48 +0,0 @@
1
- import {StyleSheet} from 'react-native';
2
-
3
- const styles = StyleSheet.create({
4
- container: {
5
- flex: 1,
6
- backgroundColor: 'black',
7
- padding: 20,
8
- justifyContent: 'center',
9
- },
10
- headerText: {
11
- color: 'white',
12
- fontSize: 18,
13
- fontWeight: 'bold',
14
- marginBottom: 20,
15
- },
16
- textInput: {
17
- backgroundColor: 'white',
18
- borderRadius: 10,
19
- padding: 15,
20
- color: 'black',
21
- fontSize: 16,
22
- textAlignVertical: 'top',
23
- minHeight: 100,
24
- },
25
- charCounter: {
26
- textAlign: 'left',
27
- marginTop: 10,
28
- },
29
- buttonContainer: {
30
- flexDirection: 'row',
31
- //justifyContent: "space-between",
32
- marginTop: 20,
33
- },
34
- feedbackButton: {
35
- backgroundColor: 'transparent',
36
- borderColor: 'white',
37
- borderWidth: 1,
38
- paddingVertical: 10,
39
- paddingHorizontal: 20,
40
- borderRadius: 30,
41
- },
42
- cancelButton: {
43
- paddingVertical: 10,
44
- paddingHorizontal: 40,
45
- },
46
- });
47
-
48
- export default styles;
@@ -1,61 +0,0 @@
1
- import React from 'react';
2
- import {View, Text, TextInput, Pressable} from 'react-native';
3
- import CustomText from '../customText/CustomText';
4
-
5
- import styles from './feedback.style';
6
- const FeedbackForm = ({
7
- title,
8
- clearAllData,
9
- handleSendFeedback,
10
- feedback,
11
- setFeedback,
12
- }: {
13
- title: string;
14
- feedback: string;
15
- clearAllData?: () => void;
16
- handleSendFeedback?: () => void;
17
- setFeedback: (val: string) => void;
18
- }) => {
19
- const maxChars = 200;
20
-
21
- return (
22
- <View style={styles.container}>
23
- <Text style={styles.headerText}>{title}</Text>
24
-
25
- <TextInput
26
- style={[styles.textInput, {height: Math.max(100)}]}
27
- placeholder="Would you like to tell us more..."
28
- placeholderTextColor="gray"
29
- multiline
30
- maxLength={maxChars}
31
- value={feedback}
32
- onChangeText={text => setFeedback(text)}
33
- />
34
- <CustomText
35
- text={`${feedback.length}/${maxChars} characters`}
36
- variant="L2_REGULAR"
37
- textColor="CONTENT_SECONDRY"
38
- style={styles.charCounter}
39
- />
40
- <View style={styles.buttonContainer}>
41
- <Pressable style={styles.feedbackButton} onPress={handleSendFeedback}>
42
- <CustomText
43
- text="Send feedback"
44
- variant="L1_REGULAR"
45
- textColor="CONTENT_PRIMARY"
46
- />
47
- </Pressable>
48
-
49
- <Pressable style={styles.cancelButton} onPress={clearAllData}>
50
- <CustomText
51
- text="Cancel"
52
- variant="L1_REGULAR"
53
- textColor="CONTENT_PRIMARY"
54
- />
55
- </Pressable>
56
- </View>
57
- </View>
58
- );
59
- };
60
-
61
- export default FeedbackForm;
@@ -1 +0,0 @@
1
- export {default} from './feedback';
@@ -1,41 +0,0 @@
1
- import {DHRE_COLORS_PRIMARY, DHRE_COLORS_TEXT} from '../../theme/colors';
2
- import {horizontalScale, verticalScale} from '../../utils/stylehelper';
3
- import {StyleSheet} from 'react-native';
4
-
5
- export const styles = StyleSheet.create({
6
- container: {
7
- backgroundColor: DHRE_COLORS_TEXT.DH_BLACK,
8
- paddingHorizontal: horizontalScale(16),
9
- paddingVertical: verticalScale(24),
10
- width: verticalScale(327),
11
- alignItems: 'center',
12
- justifyContent: 'center',
13
- },
14
- content: {
15
- alignItems: 'center',
16
- },
17
- title: {
18
- color: DHRE_COLORS_TEXT.DH_TEXTDARK,
19
- marginTop: verticalScale(16),
20
- },
21
- description: {
22
- color: DHRE_COLORS_TEXT.DH_TEXTLIGHT,
23
- textAlign: 'center',
24
- marginTop: verticalScale(16),
25
- },
26
- browse: {
27
- color: DHRE_COLORS_PRIMARY.DH_RED_100,
28
- textDecorationLine: 'underline',
29
- },
30
- button: {
31
- backgroundColor: DHRE_COLORS_TEXT.DH_BLACK,
32
- padding: verticalScale(12),
33
- borderRadius: 20,
34
- width: '40%',
35
- marginTop: verticalScale(16),
36
- },
37
- buttonText: {
38
- color: DHRE_COLORS_TEXT.DH_WHITE,
39
- textAlign: 'center',
40
- },
41
- });
@@ -1,39 +0,0 @@
1
- import React from 'react';
2
- import {render, fireEvent} from '@testing-library/react-native';
3
- import FileUpload from './FileUpload';
4
-
5
- describe('FileUpload component', () => {
6
- it('renders correctly', () => {
7
- const onUploadMock = jest.fn();
8
- const {getByTestId} = render(
9
- <FileUpload
10
- onUpload={onUploadMock}
11
- containerStyle={{}}
12
- btnText={'upload'}
13
- uploadImageStyling={{}}
14
- title="Upload Image"
15
- />,
16
- );
17
-
18
- expect(getByTestId('file-upload-container')).toBeTruthy();
19
- expect(getByTestId('file-upload-image')).toBeTruthy();
20
- expect(getByTestId('file-upload-button')).toBeTruthy();
21
- });
22
-
23
- it('calls onUpload when button is pressed', () => {
24
- const onUploadMock = jest.fn();
25
- const {getByTestId} = render(
26
- <FileUpload
27
- onUpload={onUploadMock}
28
- containerStyle={{}}
29
- btnText={'upload'}
30
- uploadImageStyling={{}}
31
- title="Upload Image"
32
- />,
33
- );
34
-
35
- const button = getByTestId('file-upload-button');
36
- fireEvent.press(button);
37
- expect(onUploadMock).toHaveBeenCalledTimes(1);
38
- });
39
- });
@@ -1,65 +0,0 @@
1
- import React from 'react';
2
- import {View, Pressable, ViewStyle, ImageStyle} from 'react-native';
3
- import CustomTypography from '../customTypography/CustomTypography';
4
- import {styles} from './FileUpload.styles';
5
-
6
- interface FileUploadProps {
7
- onUpload: () => void;
8
- title: string;
9
- containerStyle?: ViewStyle;
10
- btnText: string;
11
- uploadImageStyling: ImageStyle;
12
- icon?: React.ReactElement;
13
- iconStyle?: ViewStyle;
14
- }
15
-
16
- const FileUpload: React.FC<FileUploadProps> = ({
17
- onUpload,
18
- title,
19
- containerStyle,
20
- btnText,
21
- uploadImageStyling,
22
- icon,
23
- iconStyle,
24
- }) => {
25
- return (
26
- <View
27
- style={[styles.container, containerStyle]}
28
- testID="file-upload-container">
29
- <View style={styles.content}>
30
- <View style={[uploadImageStyling]} testID="file-upload-image">
31
- {icon && React.cloneElement(icon, {style: [iconStyle]})}
32
- </View>
33
- <CustomTypography variant="H8bold" style={styles.title} text={title} />
34
- <CustomTypography
35
- variant="P4regular"
36
- style={styles.description}
37
- text={`Drop files directly here or `}
38
- />
39
- <CustomTypography
40
- variant="P4regular"
41
- style={styles.browse}
42
- text={btnText}
43
- />
44
- <CustomTypography
45
- testID="file-upload-description"
46
- variant="P4regular"
47
- style={styles.description}
48
- text={` from your device`}
49
- />
50
- </View>
51
- <Pressable
52
- style={styles.button}
53
- onPress={onUpload}
54
- testID="file-upload-button">
55
- <CustomTypography
56
- variant="B2semiBold"
57
- style={styles.buttonText}
58
- text={btnText}
59
- />
60
- </Pressable>
61
- </View>
62
- );
63
- };
64
-
65
- export default FileUpload;
@@ -1 +0,0 @@
1
- export {default} from './FileUpload';
@@ -1,26 +0,0 @@
1
- import React from 'react';
2
- import {View, StyleSheet, ViewStyle} from 'react-native';
3
- import {useTheme} from '../../theme/ThemeContext';
4
- import {withThemeProvider} from '../../theme/withThemeProvider';
5
-
6
- const HorizontalLine = ({style}: {style?: ViewStyle}) => {
7
- const {theme} = useTheme();
8
- return (
9
- <View
10
- style={[
11
- styles.line,
12
- {backgroundColor: theme['SURFACE_SECONDARY']},
13
- style,
14
- ]}
15
- />
16
- );
17
- };
18
-
19
- const styles = StyleSheet.create({
20
- line: {
21
- height: 1,
22
- width: '100%',
23
- },
24
- });
25
-
26
- export default withThemeProvider(HorizontalLine);
@@ -1 +0,0 @@
1
- export {default} from './Line';
@@ -1,3 +0,0 @@
1
- export interface NotificationBandgeProps {
2
- notificationCount?: number;
3
- }
@@ -1,26 +0,0 @@
1
- import {StyleSheet} from 'react-native';
2
- import {FONT_STYLES} from '../../theme/fonts';
3
-
4
- const styles = StyleSheet.create({
5
- iconContainer: {
6
- position: 'relative',
7
- alignItems: 'center',
8
- },
9
- badge: {
10
- position: 'absolute',
11
- top: -5,
12
- right: -5,
13
- minWidth: 20,
14
- height: 20,
15
- borderRadius: 10,
16
- justifyContent: 'center',
17
- alignItems: 'center',
18
- backgroundColor: '#F5524A',
19
- },
20
- badgeText: {
21
- ...FONT_STYLES.L3_BOLD,
22
- color: '#fff',
23
- },
24
- });
25
-
26
- export default styles;
@@ -1,26 +0,0 @@
1
- import React from 'react';
2
- import {View, Text} from 'react-native';
3
- import {BellSimple} from '../../assets';
4
- import styles from './NotificationBandge.styles';
5
- import {NotificationBandgeProps} from './NotificationBandge.interface';
6
-
7
- const NotificationBandge: React.FC<NotificationBandgeProps> = ({
8
- notificationCount = 0,
9
- }) => {
10
- if (notificationCount <= 0) {
11
- return <BellSimple />;
12
- }
13
-
14
- return (
15
- <View style={styles.iconContainer}>
16
- <BellSimple />
17
- <View style={styles.badge}>
18
- <Text style={[styles.badgeText]}>
19
- {notificationCount > 99 ? '99+' : notificationCount}
20
- </Text>
21
- </View>
22
- </View>
23
- );
24
- };
25
-
26
- export default NotificationBandge;
@@ -1 +0,0 @@
1
- export {default} from './NotificationBandge';