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.
- package/{src/assets/index.ts → lib/assets/index.d.ts} +1 -18
- package/lib/index.d.ts +862 -0
- package/lib/index.esm.js +2 -0
- package/lib/index.esm.js.map +1 -0
- package/lib/index.js +4333 -0
- package/lib/index.js.map +1 -0
- package/lib/index.mjs +4248 -0
- package/lib/index.mjs.map +1 -0
- package/lib/theme/ThemeContext.d.ts +10 -0
- package/lib/theme/colors.d.ts +166 -0
- package/lib/theme/fonts.d.ts +8 -0
- package/lib/theme/themes.d.ts +131 -0
- package/lib/theme/withThemeProvider.d.ts +2 -0
- package/lib/utils/appEnum.d.ts +90 -0
- package/lib/utils/commonStyles.d.ts +15 -0
- package/lib/utils/constants.d.ts +19 -0
- package/lib/utils/deviceUtils.d.ts +7 -0
- package/lib/utils/regex.d.ts +1 -0
- package/lib/utils/stylehelper.d.ts +5 -0
- package/package.json +61 -81
- package/README.md +0 -1
- package/__mocks__/custom-text.mock.tsx +0 -19
- package/__mocks__/setup-tests.ts +0 -24
- package/__mocks__/svgMock.ts +0 -2
- package/src/App.tsx +0 -43
- package/src/assets/fonts/MeraasAktiv_Bd.ttf +0 -0
- package/src/assets/fonts/MeraasAktiv_Lt.ttf +0 -0
- package/src/assets/fonts/MeraasAktiv_Rg.ttf +0 -0
- package/src/assets/images/arrowLeft.svg +0 -3
- package/src/assets/images/bellSimple.svg +0 -3
- package/src/assets/images/calenderDots.svg +0 -1
- package/src/assets/images/caretDown.svg +0 -3
- package/src/assets/images/caretLeft.svg +0 -3
- package/src/assets/images/caretRight.svg +0 -3
- package/src/assets/images/caretUp.svg +0 -3
- package/src/assets/images/checkWhite.svg +0 -3
- package/src/assets/images/circleTick.svg +0 -3
- package/src/assets/images/crossIcon.svg +0 -3
- package/src/assets/images/dotsThreeVertical.svg +0 -5
- package/src/assets/images/fileIcon.svg +0 -8
- package/src/assets/images/searchIcon.svg +0 -4
- package/src/assets/images/trash.svg +0 -7
- package/src/assets/images/uploadFileIcon.svg +0 -12
- package/src/components/ContactModel/ContactModel.tsx +0 -206
- package/src/components/ContactModel/index.ts +0 -1
- package/src/components/OutOfOffice/OurOffices.tsx +0 -91
- package/src/components/OutOfOffice/index.ts +0 -1
- package/src/components/accordion/Accordion.interface.ts +0 -16
- package/src/components/accordion/Accordion.styles.ts +0 -28
- package/src/components/accordion/Accordion.test.tsx +0 -21
- package/src/components/accordion/Accordion.tsx +0 -85
- package/src/components/accordion/index.ts +0 -1
- package/src/components/autoOtpReader/AutoOtpReader.test.tsx +0 -56
- package/src/components/autoOtpReader/AutoOtpReader.tsx +0 -79
- package/src/components/autoOtpReader/index.ts +0 -1
- package/src/components/badge/Badge.styles.ts +0 -20
- package/src/components/badge/Badge.test.tsx +0 -57
- package/src/components/badge/Badge.tsx +0 -48
- package/src/components/badge/index.ts +0 -1
- package/src/components/bottomDrawer/BottomDrawer.interface.ts +0 -23
- package/src/components/bottomDrawer/BottomDrawer.styles.ts +0 -47
- package/src/components/bottomDrawer/BottomDrawer.test.tsx +0 -19
- package/src/components/bottomDrawer/BottomDrawer.tsx +0 -92
- package/src/components/bottomDrawer/index.ts +0 -1
- package/src/components/button/Button.interface.ts +0 -19
- package/src/components/button/Button.styles.ts +0 -78
- package/src/components/button/Button.test.tsx +0 -43
- package/src/components/button/Button.tsx +0 -82
- package/src/components/button/index.ts +0 -1
- package/src/components/cards/Cards.interface.ts +0 -13
- package/src/components/cards/Cards.styles.ts +0 -59
- package/src/components/cards/Cards.test.tsx +0 -41
- package/src/components/cards/Cards.tsx +0 -69
- package/src/components/cards/index.ts +0 -1
- package/src/components/checkBox/CheckBox.interface.ts +0 -15
- package/src/components/checkBox/CheckBox.styles.ts +0 -35
- package/src/components/checkBox/CheckBox.test.tsx +0 -46
- package/src/components/checkBox/CheckBox.tsx +0 -50
- package/src/components/checkBox/index.ts +0 -1
- package/src/components/countryPicker/CountryPicker.tsx +0 -169
- package/src/components/countryPicker/index.ts +0 -1
- package/src/components/customDocumentPicker/CustomDocumentPicker.interface.ts +0 -13
- package/src/components/customDocumentPicker/CustomDocumentPicker.styles.ts +0 -33
- package/src/components/customDocumentPicker/CustomDocumentPicker.tsx +0 -100
- package/src/components/customDocumentPicker/index.ts +0 -1
- package/src/components/customDropdown/CustomDropdown.interface.ts +0 -15
- package/src/components/customDropdown/CustomDropdown.styles.tsx +0 -46
- package/src/components/customDropdown/CustomDropdown.test.tsx +0 -30
- package/src/components/customDropdown/CustomDropdown.tsx +0 -106
- package/src/components/customDropdown/index.ts +0 -1
- package/src/components/customHeader/CustomHeader.interface.tsx +0 -10
- package/src/components/customHeader/CustomHeader.styles.ts +0 -26
- package/src/components/customHeader/CustomHeader.test.tsx +0 -14
- package/src/components/customHeader/CustomHeader.tsx +0 -46
- package/src/components/customHeader/index.ts +0 -1
- package/src/components/customIcon/CustomIcon.interface.ts +0 -12
- package/src/components/customIcon/CustomIcon.styles.ts +0 -13
- package/src/components/customIcon/CustomIcon.test.tsx +0 -14
- package/src/components/customIcon/CustomIcon.tsx +0 -33
- package/src/components/customIcon/index.ts +0 -1
- package/src/components/customInputText/CustomInputText.interface.ts +0 -20
- package/src/components/customInputText/CustomInputText.styles.ts +0 -56
- package/src/components/customInputText/CustomInputText.test.tsx +0 -37
- package/src/components/customInputText/CustomInputText.tsx +0 -120
- package/src/components/customInputText/index.ts +0 -1
- package/src/components/customLoader/CustomLoader.inteface.ts +0 -3
- package/src/components/customLoader/CustomLoader.styles.ts +0 -16
- package/src/components/customLoader/CustomLoader.tsx +0 -16
- package/src/components/customLoader/index.ts +0 -1
- package/src/components/customSearchBar/CustomSearchBar.interface.ts +0 -21
- package/src/components/customSearchBar/CustomSearchBar.styles.ts +0 -23
- package/src/components/customSearchBar/CustomSearchBar.test.tsx +0 -27
- package/src/components/customSearchBar/CustomSearchBar.tsx +0 -87
- package/src/components/customSearchBar/index.ts +0 -1
- package/src/components/customSlideButton/custom-slide-button.interface.ts +0 -4
- package/src/components/customSlideButton/index.tsx +0 -78
- package/src/components/customSlideButton/styles.ts +0 -39
- package/src/components/customSwitchBtn/customSwitchBtn.interface.ts +0 -15
- package/src/components/customSwitchBtn/customSwitchBtn.styles.ts +0 -34
- package/src/components/customSwitchBtn/customSwitchBtn.tsx +0 -63
- package/src/components/customSwitchBtn/index.ts +0 -1
- package/src/components/customText/CustomText.tsx +0 -33
- package/src/components/customText/index.ts +0 -1
- package/src/components/customTooltip/CustomTooltip.interface.ts +0 -14
- package/src/components/customTooltip/CustomTooltip.styles.ts +0 -23
- package/src/components/customTooltip/CustomTooltip.test.tsx +0 -18
- package/src/components/customTooltip/CustomTooltip.tsx +0 -46
- package/src/components/customTooltip/index.ts +0 -1
- package/src/components/customTypography/CustomTypography.test.tsx +0 -12
- package/src/components/customTypography/CustomTypography.tsx +0 -27
- package/src/components/customTypography/index.ts +0 -1
- package/src/components/dateRangePicker/DateRangePicker.interface.ts +0 -19
- package/src/components/dateRangePicker/DateRangePicker.styles.ts +0 -19
- package/src/components/dateRangePicker/DateRangePicker.tsx +0 -108
- package/src/components/dateRangePicker/index.ts +0 -1
- package/src/components/dropDown/DropDown.tsx +0 -145
- package/src/components/dropDown/index.ts +0 -1
- package/src/components/feedback/feedback.style.ts +0 -48
- package/src/components/feedback/feedback.tsx +0 -61
- package/src/components/feedback/index.ts +0 -1
- package/src/components/fileUpload/FileUpload.styles.ts +0 -41
- package/src/components/fileUpload/FileUpload.test.tsx +0 -39
- package/src/components/fileUpload/FileUpload.tsx +0 -65
- package/src/components/fileUpload/index.ts +0 -1
- package/src/components/horizontalLine/Line.tsx +0 -26
- package/src/components/horizontalLine/index.ts +0 -1
- package/src/components/notificationBandge/NotificationBandge.interface.tsx +0 -3
- package/src/components/notificationBandge/NotificationBandge.styles.tsx +0 -26
- package/src/components/notificationBandge/NotificationBandge.tsx +0 -26
- package/src/components/notificationBandge/index.tsx +0 -1
- package/src/components/otp/index.tsx +0 -166
- package/src/components/otp/otp.interface.ts +0 -14
- package/src/components/otp/styles.ts +0 -29
- package/src/components/pdfView/PdfView.test.tsx +0 -12
- package/src/components/pdfView/PdfView.tsx +0 -8
- package/src/components/pdfView/index.ts +0 -1
- package/src/components/popup/PopUp.interface.ts +0 -9
- package/src/components/popup/PopUp.styles.ts +0 -52
- package/src/components/popup/PopUp.test.tsx +0 -35
- package/src/components/popup/PopUp.tsx +0 -60
- package/src/components/popup/index.ts +0 -1
- package/src/components/progressBar/ProgressBar.test.tsx +0 -78
- package/src/components/progressBar/ProgressBar.tsx +0 -120
- package/src/components/progressBar/index.ts +0 -1
- package/src/components/property360View/Property360View.test.tsx +0 -24
- package/src/components/property360View/Property360View.tsx +0 -19
- package/src/components/property360View/index.ts +0 -1
- package/src/components/rating/index.ts +0 -1
- package/src/components/rating/rating.styles.ts +0 -13
- package/src/components/rating/rating.test.tsx +0 -61
- package/src/components/rating/rating.tsx +0 -96
- package/src/components/scrollList/category.tsx +0 -110
- package/src/components/scrollList/index.ts +0 -1
- package/src/components/singleSelectionTag/TagSingleSelection.tsx +0 -105
- package/src/components/singleSelectionTag/index.ts +0 -1
- package/src/components/stepper/index.tsx +0 -105
- package/src/components/stepper/stepper.interface.ts +0 -24
- package/src/components/stepper/styles.ts +0 -74
- package/src/components/swipableList/SwipableList.interface.ts +0 -52
- package/src/components/swipableList/SwipableList.styles.ts +0 -30
- package/src/components/swipableList/SwipableList.test.tsx +0 -209
- package/src/components/swipableList/SwipableList.tsx +0 -137
- package/src/components/swipableList/index.ts +0 -1
- package/src/components/tabs/Tabs.interface.ts +0 -10
- package/src/components/tabs/Tabs.styles.ts +0 -24
- package/src/components/tabs/Tabs.tsx +0 -74
- package/src/components/tabs/index.ts +0 -1
- package/src/components/tags/Tags.interface.ts +0 -12
- package/src/components/tags/Tags.styles.ts +0 -36
- package/src/components/tags/Tags.test.tsx +0 -22
- package/src/components/tags/Tags.tsx +0 -76
- package/src/components/tags/index.ts +0 -1
- package/src/components/textInput/Textinput.tsx +0 -124
- package/src/components/textInput/index.ts +0 -1
- package/src/components/toast/Toast.interface.ts +0 -39
- package/src/components/toast/Toast.styles.ts +0 -41
- package/src/components/toast/Toast.test.tsx +0 -13
- package/src/components/toast/Toast.tsx +0 -115
- package/src/components/toast/ToastService.ts +0 -30
- package/src/components/toast/index.ts +0 -1
- package/src/components/toggleButton/ToggleButton.styles.ts +0 -40
- package/src/components/toggleButton/ToggleButton.test.tsx +0 -33
- package/src/components/toggleButton/ToggleButton.tsx +0 -78
- package/src/components/toggleButton/index.ts +0 -1
- package/src/components/topic/Topic.tsx +0 -85
- package/src/components/topic/index.ts +0 -1
- package/src/index.ts +0 -59
- package/src/theme/ThemeContext.tsx +0 -38
- package/src/theme/colors.ts +0 -186
- package/src/theme/fonts.ts +0 -72
- package/src/theme/themes.ts +0 -137
- package/src/theme/withThemeProvider.tsx +0 -14
- package/src/utils/appEnum.ts +0 -109
- package/src/utils/commonStyles.ts +0 -17
- package/src/utils/constants.ts +0 -20
- package/src/utils/deviceUtils.ts +0 -14
- package/src/utils/regex.ts +0 -1
- 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,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';
|