@abihealth/goapp-react-native 1.13.22 → 1.14.0

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 (104) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/common/animations/FindingAnimation/index.js +2 -2
  3. package/dist/common/animations/FindingAnimation/xml.d.ts +1 -2
  4. package/dist/common/animations/FindingAnimation/xml.js +2 -2
  5. package/dist/common/animations/HorizontalLoadingAnimation/index.d.ts +5 -2
  6. package/dist/common/animations/HorizontalLoadingAnimation/index.js +5 -2
  7. package/dist/common/animations/HorizontalLoadingAnimation/xml.d.ts +2 -1
  8. package/dist/common/animations/HorizontalLoadingAnimation/xml.js +4 -1
  9. package/dist/common/animations/LoadingCircleAnimation/index.js +2 -2
  10. package/dist/common/animations/LoadingCircleAnimation/xml.d.ts +1 -2
  11. package/dist/common/animations/LoadingCircleAnimation/xml.js +1 -1
  12. package/dist/common/animations/LoadingHeart.js +2 -2
  13. package/dist/common/api/models/consultation.d.ts +2 -2
  14. package/dist/common/components/ActionSheet.js +2 -2
  15. package/dist/common/components/AnswerScreen/Card.js +1 -1
  16. package/dist/common/components/AnswerScreen/DeliveryAddressCard.js +12 -6
  17. package/dist/common/components/AnswerScreen/PrescriptionCard/PrescriptionCardHeader.js +1 -1
  18. package/dist/common/components/AnswerScreen/PrescriptionCard/index.js +12 -9
  19. package/dist/common/components/AnswerScreen/Summary.js +11 -7
  20. package/dist/common/components/BackgroundPattern.js +8 -1
  21. package/dist/common/components/Button.js +30 -13
  22. package/dist/common/components/Checkbox.js +5 -6
  23. package/dist/common/components/DateInput.js +7 -7
  24. package/dist/common/components/DoctorProfileCard.js +31 -18
  25. package/dist/common/components/FormControl.d.ts +2 -1
  26. package/dist/common/components/FormControl.js +14 -9
  27. package/dist/common/components/Header.js +3 -3
  28. package/dist/common/components/Input.js +10 -8
  29. package/dist/common/components/Modal/AttachmentPreviewModal.js +6 -6
  30. package/dist/common/components/Modal/DoctorProfileModal.js +4 -4
  31. package/dist/common/components/Modal/ModalHeader.js +11 -5
  32. package/dist/common/components/Modal/index.js +12 -5
  33. package/dist/common/components/PhoneInput.js +8 -8
  34. package/dist/common/components/Reminder.js +2 -2
  35. package/dist/common/components/Select.js +6 -6
  36. package/dist/common/components/Text.d.ts +1 -2
  37. package/dist/common/components/Text.js +28 -46
  38. package/dist/common/contexts/ConsultationContext.d.ts +5 -2
  39. package/dist/common/contexts/ConsultationContext.js +24 -14
  40. package/dist/common/contexts/ThemeContext.d.ts +6 -2
  41. package/dist/common/contexts/ThemeContext.js +4 -3
  42. package/dist/common/hooks/useCustomComponents.d.ts +2 -0
  43. package/dist/common/hooks/useCustomComponents.js +12 -0
  44. package/dist/common/hooks/useTheme.d.ts +2 -1
  45. package/dist/common/hooks/useTheme.js +33 -16
  46. package/dist/common/hooks/useUser.d.ts +2 -0
  47. package/dist/common/hooks/useUser.js +2 -2
  48. package/dist/common/icons/AbiLogoIcon.js +2 -2
  49. package/dist/common/icons/BackArrowIcon.js +2 -2
  50. package/dist/common/icons/CloseIcon.js +2 -2
  51. package/dist/common/icons/DoctorIcon.js +3 -3
  52. package/dist/common/icons/DoctorImagePlaceholderIcon.js +5 -5
  53. package/dist/common/icons/ExitIcon.js +5 -5
  54. package/dist/common/icons/InfoIcon.js +2 -2
  55. package/dist/common/icons/MotorbikeIcon.js +11 -11
  56. package/dist/common/icons/NoCaseFoundIcon.js +5 -5
  57. package/dist/common/icons/PdfDownloadIcon.js +11 -11
  58. package/dist/common/icons/PdfIcon.js +3 -3
  59. package/dist/common/icons/PersonIcon.js +2 -2
  60. package/dist/common/icons/PillsIcon.js +5 -5
  61. package/dist/common/icons/PlaneIcon.js +2 -2
  62. package/dist/common/icons/RatingIcon.js +6 -6
  63. package/dist/common/icons/StarIcon.js +2 -2
  64. package/dist/common/icons/TextConsultationIcon.js +3 -3
  65. package/dist/common/icons/TrashIcon.js +2 -2
  66. package/dist/common/icons/VideoConsultationIcon.js +2 -2
  67. package/dist/common/index.d.ts +2 -1
  68. package/dist/common/index.js +4 -2
  69. package/dist/common/screens/AnswerScreen.d.ts +2 -1
  70. package/dist/common/screens/AnswerScreen.js +12 -10
  71. package/dist/common/screens/MatchingScreen.js +5 -2
  72. package/dist/common/screens/RatingScreen.js +1 -1
  73. package/dist/common/types/components.d.ts +121 -0
  74. package/dist/common/types/components.js +2 -0
  75. package/dist/common/types/consultation.d.ts +7 -3
  76. package/dist/common/types/consultation.js +6 -1
  77. package/dist/common/types/theme.d.ts +54 -20
  78. package/dist/common/types/theme.js +13 -27
  79. package/dist/common/utils/professional.js +1 -1
  80. package/dist/index.d.ts +3 -2
  81. package/dist/index.js +5 -2
  82. package/dist/video-consultations/animations/CallingAnimation/index.js +2 -2
  83. package/dist/video-consultations/animations/CallingAnimation/xml.d.ts +1 -2
  84. package/dist/video-consultations/animations/CallingAnimation/xml.js +1 -1
  85. package/dist/video-consultations/components/AgoraWrapper/components/BaseRenderUsers.js +7 -7
  86. package/dist/video-consultations/components/AgoraWrapper/components/BtnControls.js +4 -6
  87. package/dist/video-consultations/components/AgoraWrapper/components/ui/index.js +5 -13
  88. package/dist/video-consultations/components/Modal/EndVideoCallModal.js +1 -1
  89. package/dist/video-consultations/components/VideoConsultation.d.ts +2 -1
  90. package/dist/video-consultations/components/VideoConsultation.js +7 -1
  91. package/dist/video-consultations/icons/EndVideoCallIcon.js +5 -5
  92. package/dist/video-consultations/icons/HangUpIcon.js +7 -3
  93. package/dist/video-consultations/icons/MicroOffIcon.js +3 -3
  94. package/dist/video-consultations/icons/MicroOnIcon.js +8 -4
  95. package/dist/video-consultations/icons/PersonIcon.js +2 -2
  96. package/dist/video-consultations/icons/SwitchCameraIcon.js +7 -3
  97. package/dist/video-consultations/icons/VideoOffIcon.js +4 -2
  98. package/dist/video-consultations/icons/VideoOnIcon.js +7 -3
  99. package/dist/video-consultations/screens/DeliveryAddressScreen.js +2 -2
  100. package/dist/video-consultations/screens/EndingVideoScreen.d.ts +1 -1
  101. package/dist/video-consultations/screens/EndingVideoScreen.js +1 -1
  102. package/dist/video-consultations/screens/JoinVideoCallScreen.js +12 -11
  103. package/dist/video-consultations/screens/ProcessingPrescriptionScreen.js +5 -3
  104. package/package.json +12 -12
@@ -6,9 +6,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.BackgroundPattern = void 0;
7
7
  var react_1 = __importDefault(require("react"));
8
8
  var react_native_1 = require("react-native");
9
+ var useCustomComponents_1 = require("../hooks/useCustomComponents");
10
+ var useTheme_1 = require("../hooks/useTheme");
9
11
  var BackgroundPattern = function (_a) {
10
12
  var children = _a.children;
11
- return (<react_native_1.ImageBackground source={require('../assets/background-pattern.png')} style={styles.container} imageStyle={styles.image} resizeMode="cover">
13
+ var palette = (0, useTheme_1.useTheme)().palette;
14
+ var Background = (0, useCustomComponents_1.useCustomComponents)().Background;
15
+ var noImage = (Background === null || Background === void 0 ? void 0 : Background.image) === null;
16
+ if (noImage)
17
+ return <react_native_1.View style={[styles.container, { backgroundColor: (Background === null || Background === void 0 ? void 0 : Background.backgroundColor) || palette.grey.light }]}>{children}</react_native_1.View>;
18
+ return (<react_native_1.ImageBackground source={Background === null || Background === void 0 ? void 0 : Background.image} style={[styles.container, { backgroundColor: Background === null || Background === void 0 ? void 0 : Background.backgroundColor }]} imageStyle={styles.image} resizeMode="cover">
12
19
  {children}
13
20
  </react_native_1.ImageBackground>);
14
21
  };
@@ -48,22 +48,25 @@ exports.Button = void 0;
48
48
  var react_1 = __importStar(require("react"));
49
49
  var react_native_1 = require("react-native");
50
50
  var LoadingHeart_1 = require("../animations/LoadingHeart");
51
+ var useCustomComponents_1 = require("../hooks/useCustomComponents");
51
52
  var useForm_1 = require("../hooks/useForm");
52
53
  var useTheme_1 = require("../hooks/useTheme");
53
54
  var Text_1 = require("./Text");
54
55
  exports.Button = (0, react_1.forwardRef)(function (props, ref) {
56
+ var _a, _b;
55
57
  var theme = (0, useTheme_1.useTheme)();
56
58
  var styles = getStyles(theme);
57
- var _a = (0, useForm_1.useForm)(), handleSubmit = _a.handleSubmit, formLoading = _a.loading;
58
- var children = props.children, icon = props.icon, _b = props.variant, variant = _b === void 0 ? 'primary' : _b, _c = props.shadow, shadow = _c === void 0 ? true : _c, _d = props.radio, radio = _d === void 0 ? false : _d, style = props.style, submit = props.submit, rest = __rest(props, ["children", "icon", "variant", "shadow", "radio", "style", "submit"]);
59
+ var Button = (0, useCustomComponents_1.useCustomComponents)().Button;
60
+ var _c = (0, useForm_1.useForm)(), handleSubmit = _c.handleSubmit, formLoading = _c.loading;
61
+ var children = props.children, icon = props.icon, _d = props.variant, variant = _d === void 0 ? 'primary' : _d, _e = props.shadow, shadow = _e === void 0 ? true : _e, _f = props.radio, radio = _f === void 0 ? false : _f, style = props.style, submit = props.submit, rest = __rest(props, ["children", "icon", "variant", "shadow", "radio", "style", "submit"]);
59
62
  var backgroundColor = (0, react_1.useMemo)(function () {
60
63
  switch (variant) {
61
64
  case 'primary':
62
- return theme.colors.primary;
65
+ return theme.palette.primary.base;
63
66
  case 'secondary':
64
- return theme.colors.secondary;
67
+ return theme.palette.secondary;
65
68
  case 'tertiary':
66
- return theme.colors.success;
69
+ return theme.palette.success;
67
70
  }
68
71
  }, [variant]);
69
72
  var textVariantStyle = (0, react_1.useMemo)(function () {
@@ -83,17 +86,31 @@ exports.Button = (0, react_1.forwardRef)(function (props, ref) {
83
86
  (_a = props.onPress) === null || _a === void 0 ? void 0 : _a.call(props, e);
84
87
  };
85
88
  var loading = props.loading || formLoading;
86
- return (<react_native_1.TouchableOpacity {...rest} activeOpacity={0.6} ref={ref} style={[styles.buttonBase, { borderRadius: borderRadius }, { backgroundColor: backgroundColor }, shadow && theme.shadows.soft, style]} onPress={onPress} disabled={loading || props.disabled} accessibilityLabel={children} accessibilityState={{ disabled: loading || props.disabled }}>
89
+ return (<react_native_1.TouchableOpacity {...rest} activeOpacity={0.6} ref={ref} style={[
90
+ styles.buttonBase,
91
+ { borderRadius: borderRadius },
92
+ { backgroundColor: backgroundColor },
93
+ shadow && theme.shadows.soft,
94
+ style,
95
+ (_a = Button === null || Button === void 0 ? void 0 : Button[variant]) === null || _a === void 0 ? void 0 : _a.containerStyle
96
+ ]} onPress={onPress} disabled={loading || props.disabled} accessibilityLabel={children} accessibilityState={{ disabled: loading || props.disabled }}>
87
97
  {loading ? (<LoadingHeart_1.LoadingHeart />) : (<>
88
98
  {icon}
89
- {children && (<Text_1.Text variant="button" style={textVariantStyle}>
99
+ {children && (<Text_1.Text style={[
100
+ textVariantStyle,
101
+ {
102
+ textTransform: 'uppercase',
103
+ fontWeight: 'bold'
104
+ },
105
+ (_b = Button === null || Button === void 0 ? void 0 : Button[variant]) === null || _b === void 0 ? void 0 : _b.textStyle
106
+ ]}>
90
107
  {children}
91
108
  </Text_1.Text>)}
92
109
  </>)}
93
110
  </react_native_1.TouchableOpacity>);
94
111
  });
95
112
  var getStyles = function (_a) {
96
- var colors = _a.colors, spacing = _a.spacing;
113
+ var palette = _a.palette, spacing = _a.spacing;
97
114
  return react_native_1.StyleSheet.create({
98
115
  buttonBase: {
99
116
  width: '100%',
@@ -106,19 +123,19 @@ var getStyles = function (_a) {
106
123
  maxHeight: 53
107
124
  },
108
125
  buttonPrimary: {
109
- backgroundColor: colors.primary
126
+ backgroundColor: palette.primary.base
110
127
  },
111
128
  buttonSecondary: {
112
- backgroundColor: colors.white
129
+ backgroundColor: palette.white
113
130
  },
114
131
  buttonTertiary: {
115
- backgroundColor: colors.success
132
+ backgroundColor: palette.success
116
133
  },
117
134
  textPrimary: {
118
- color: colors.white
135
+ color: palette.white
119
136
  },
120
137
  textSecondary: {
121
- color: colors.primary
138
+ color: palette.primary.base
122
139
  }
123
140
  });
124
141
  };
@@ -31,8 +31,8 @@ var Checkbox = function (_a) {
31
31
  var err = formError || error;
32
32
  var innerBorderColor = (0, react_1.useMemo)(function () {
33
33
  if (localChecked)
34
- return theme.colors.primary;
35
- return err ? theme.colors.warning : theme.colors.gray;
34
+ return theme.palette.primary.base;
35
+ return err ? theme.palette.error : theme.palette.grey.base;
36
36
  }, [err, localChecked]);
37
37
  var formValue = data === null || data === void 0 ? void 0 : data[id];
38
38
  return (<react_native_1.View style={styles.container}>
@@ -42,15 +42,15 @@ var Checkbox = function (_a) {
42
42
  setLocalChecked(!checked);
43
43
  updateData === null || updateData === void 0 ? void 0 : updateData(id)(!checked);
44
44
  (_a = props.onPress) === null || _a === void 0 ? void 0 : _a.call(props, !checked);
45
- }} useBuiltInState={false} size={30} textComponent={children} style={styles.style} iconStyle={styles.iconStyle} innerIconStyle={[{ borderColor: innerBorderColor }, styles.innerIconStyle]} iconImageStyle={styles.iconImageStyle} fillColor={theme.colors.primary} disabled={loading} accessibilityState={{ checked: formValue || localChecked }}/>
46
- <Text_1.Text variant="sm" color={theme.colors.warning}>
45
+ }} useBuiltInState={false} size={30} textComponent={children} style={styles.style} iconStyle={styles.iconStyle} innerIconStyle={[{ borderColor: innerBorderColor }, styles.innerIconStyle]} iconImageStyle={styles.iconImageStyle} fillColor={theme.palette.primary.base} disabled={loading} accessibilityState={{ checked: formValue || localChecked }}/>
46
+ <Text_1.Text variant="sm" color={theme.palette.error} style={{ textAlign: 'auto' }}>
47
47
  {err}
48
48
  </Text_1.Text>
49
49
  </react_native_1.View>);
50
50
  };
51
51
  exports.Checkbox = Checkbox;
52
52
  var getStyles = function (_a) {
53
- var spacing = _a.spacing, colors = _a.colors, borderRadius = _a.borderRadius;
53
+ var spacing = _a.spacing, borderRadius = _a.borderRadius;
54
54
  return react_native_1.StyleSheet.create({
55
55
  container: {
56
56
  columnGap: spacing.xxs,
@@ -61,7 +61,6 @@ var getStyles = function (_a) {
61
61
  width: '100%'
62
62
  },
63
63
  iconStyle: {
64
- borderColor: colors.rating,
65
64
  borderRadius: borderRadius.sm
66
65
  },
67
66
  innerIconStyle: {
@@ -33,7 +33,7 @@ var DateInput = function (_a) {
33
33
  var err = formError || error;
34
34
  return (<FormControl_1.default label={label} error={err}>
35
35
  <react_native_1.View style={[styles.inputContainer, err && styles.error]}>
36
- <react_native_1.TextInput style={styles.input} value={formValue || (initialDate === null || initialDate === void 0 ? void 0 : initialDate.toLocaleDateString())} onFocus={onFocus} placeholder="dd/mm/yyyy" editable={!loading} placeholderTextColor={theme.colors.gray}/>
36
+ <react_native_1.TextInput style={styles.input} value={formValue || (initialDate === null || initialDate === void 0 ? void 0 : initialDate.toLocaleDateString())} onFocus={onFocus} placeholder="dd/mm/yyyy" editable={!loading} placeholderTextColor={theme.palette.grey.base}/>
37
37
 
38
38
  <react_native_1.Pressable onPress={onFocus}>
39
39
  <CalendarIcon_1.default />
@@ -52,25 +52,25 @@ var DateInput = function (_a) {
52
52
  exports.DateInput = DateInput;
53
53
  exports.default = exports.DateInput;
54
54
  var getStyles = function (_a) {
55
- var spacing = _a.spacing, colors = _a.colors, borderRadius = _a.borderRadius, fontSize = _a.fontSize;
55
+ var spacing = _a.spacing, palette = _a.palette, borderRadius = _a.borderRadius, base = _a.font.base;
56
56
  return react_native_1.StyleSheet.create({
57
57
  inputContainer: {
58
58
  flexDirection: 'row',
59
59
  justifyContent: 'space-between',
60
60
  padding: spacing.sm,
61
61
  borderWidth: 1,
62
- borderColor: colors.gray,
62
+ borderColor: palette.grey.base,
63
63
  borderRadius: borderRadius.md,
64
64
  width: '100%',
65
- backgroundColor: colors.white
65
+ backgroundColor: palette.white
66
66
  },
67
67
  input: {
68
- color: colors.black,
69
- fontSize: fontSize.base,
68
+ color: palette.black,
69
+ fontSize: base.size,
70
70
  minWidth: '80%'
71
71
  },
72
72
  error: {
73
- borderColor: colors.warning
73
+ borderColor: palette.error
74
74
  }
75
75
  });
76
76
  };
@@ -49,52 +49,64 @@ var react_1 = __importStar(require("react"));
49
49
  var react_i18next_1 = require("react-i18next");
50
50
  var react_native_1 = require("react-native");
51
51
  var LoadingDotsAnimation_1 = require("../animations/LoadingDotsAnimation");
52
+ var useCustomComponents_1 = require("../hooks/useCustomComponents");
52
53
  var useTheme_1 = require("../hooks/useTheme");
53
54
  var DoctorImagePlaceholderIcon_1 = require("../icons/DoctorImagePlaceholderIcon");
54
55
  var professional_1 = require("../utils/professional");
55
- var Button_1 = require("./Button");
56
56
  var DoctorProfileModal_1 = require("./Modal/DoctorProfileModal");
57
57
  var Text_1 = require("./Text");
58
58
  var DoctorProfileCard = function (_a) {
59
+ var _b, _c, _d;
59
60
  var professional = _a.professional, description = _a.description;
60
61
  var t = (0, react_i18next_1.useTranslation)().t;
61
62
  var theme = (0, useTheme_1.useTheme)();
63
+ var DoctorProfileCard = (0, useCustomComponents_1.useCustomComponents)().DoctorProfileCard;
62
64
  var styles = getStyles(theme);
63
- var _b = (0, react_1.useState)(false), showProfileModal = _b[0], setShowProfileModal = _b[1];
65
+ var _e = (0, react_1.useState)(false), showProfileModal = _e[0], setShowProfileModal = _e[1];
64
66
  var showModal = function () { return setShowProfileModal(true); };
65
67
  var hideModal = function () { return setShowProfileModal(false); };
66
68
  if (!professional)
67
69
  return <Text_1.Text>Professional not found</Text_1.Text>;
68
- return (<react_native_1.View style={styles.container}>
70
+ return (<react_native_1.View style={[styles.container, DoctorProfileCard === null || DoctorProfileCard === void 0 ? void 0 : DoctorProfileCard.containerStyle]}>
69
71
  {professional.profileImage ? (<react_native_1.Image source={{ uri: professional.profileImage }} style={styles.image}/>) : (<DoctorImagePlaceholderIcon_1.DoctorImagePlaceholderIcon style={styles.image}/>)}
70
72
 
71
73
  <react_native_1.View style={{ alignItems: 'center' }}>
72
74
  <Text_1.Text variant="h2">{(0, professional_1.getProfessionalLabel)(professional)}</Text_1.Text>
73
- <Text_1.Text style={styles.status} center>
75
+ <Text_1.Text style={[styles.status, DoctorProfileCard === null || DoctorProfileCard === void 0 ? void 0 : DoctorProfileCard.statusTextStyle]} center>
74
76
  {description}
75
77
  </Text_1.Text>
76
78
  </react_native_1.View>
79
+ {(DoctorProfileCard === null || DoctorProfileCard === void 0 ? void 0 : DoctorProfileCard.LoadingAnimation) ? DoctorProfileCard.LoadingAnimation : <LoadingDotsAnimation_1.LoadingDotsAnimation color={theme.palette.primary.dark}/>}
77
80
 
78
- <LoadingDotsAnimation_1.LoadingDotsAnimation color={theme.colors.primaryDark} size={64}/>
79
-
80
- <react_native_1.View style={styles.specialtiesContainer}>
81
- {professional.specialties.map(function (specialty, index) { return (<react_native_1.View key={index} style={styles.specialty}>
82
- <Text_1.Text>{t("specialty_".concat(specialty))}</Text_1.Text>
83
- </react_native_1.View>); })}
81
+ <react_native_1.View style={[styles.specialtiesContainer, DoctorProfileCard === null || DoctorProfileCard === void 0 ? void 0 : DoctorProfileCard.specialtiesContainerStyle]}>
82
+ {professional.specialties.map(function (specialty, index) {
83
+ var _a, _b, _c;
84
+ return ((_a = DoctorProfileCard === null || DoctorProfileCard === void 0 ? void 0 : DoctorProfileCard.SpecialtyBadge) === null || _a === void 0 ? void 0 : _a.customComponent) ? (<DoctorProfileCard.SpecialtyBadge.customComponent key={index} specialty={t("specialty_".concat(specialty))}/>) : (<react_native_1.View key={index} style={[styles.specialty, (_b = DoctorProfileCard === null || DoctorProfileCard === void 0 ? void 0 : DoctorProfileCard.SpecialtyBadge) === null || _b === void 0 ? void 0 : _b.containerStyle]}>
85
+ <Text_1.Text style={(_c = DoctorProfileCard === null || DoctorProfileCard === void 0 ? void 0 : DoctorProfileCard.SpecialtyBadge) === null || _c === void 0 ? void 0 : _c.textStyle}>{t("specialty_".concat(specialty))}</Text_1.Text>
86
+ </react_native_1.View>);
87
+ })}
84
88
  </react_native_1.View>
85
89
 
86
- {professional.profileUrl && (<Button_1.Button variant="secondary" shadow={false} onPress={showModal} style={styles.button}>
87
- {t('view_profile')}
88
- </Button_1.Button>)}
90
+ {professional.profileUrl && ((_b = DoctorProfileCard === null || DoctorProfileCard === void 0 ? void 0 : DoctorProfileCard.ViewProfileButton) === null || _b === void 0 ? void 0 : _b.customComponent) ? (<DoctorProfileCard.ViewProfileButton.customComponent onPress={showModal}/>) : (<react_native_1.TouchableOpacity onPress={showModal} style={[styles.button, (_c = DoctorProfileCard === null || DoctorProfileCard === void 0 ? void 0 : DoctorProfileCard.ViewProfileButton) === null || _c === void 0 ? void 0 : _c.containerStyle]}>
91
+ <Text_1.Text style={[
92
+ {
93
+ color: theme.palette.primary.base,
94
+ fontWeight: 'bold'
95
+ },
96
+ (_d = DoctorProfileCard === null || DoctorProfileCard === void 0 ? void 0 : DoctorProfileCard.ViewProfileButton) === null || _d === void 0 ? void 0 : _d.textStyle
97
+ ]}>
98
+ {t('view_profile')}
99
+ </Text_1.Text>
100
+ </react_native_1.TouchableOpacity>)}
89
101
 
90
102
  <DoctorProfileModal_1.DoctorProfileModal profileUrl={professional.profileUrl} visible={showProfileModal} onCancel={hideModal}/>
91
103
  </react_native_1.View>);
92
104
  };
93
105
  exports.DoctorProfileCard = DoctorProfileCard;
94
106
  var getStyles = function (_a) {
95
- var colors = _a.colors, spacing = _a.spacing, borderRadius = _a.borderRadius, shadows = _a.shadows;
107
+ var palette = _a.palette, spacing = _a.spacing, borderRadius = _a.borderRadius, shadows = _a.shadows;
96
108
  return react_native_1.StyleSheet.create({
97
- container: __assign({ width: '100%', backgroundColor: colors.white, borderRadius: borderRadius.xl, padding: spacing.sm, alignItems: 'center', rowGap: spacing.sm }, shadows.soft),
109
+ container: __assign({ width: '100%', backgroundColor: palette.white, borderRadius: borderRadius.xl, padding: spacing.sm, alignItems: 'center', rowGap: spacing.sm }, shadows.soft),
98
110
  image: {
99
111
  width: 100,
100
112
  height: 100,
@@ -114,15 +126,16 @@ var getStyles = function (_a) {
114
126
  paddingVertical: spacing.xs,
115
127
  paddingHorizontal: spacing.sm,
116
128
  borderRadius: borderRadius.full,
117
- backgroundColor: colors.background
129
+ backgroundColor: palette.grey.light
118
130
  },
119
131
  button: {
120
- borderTopColor: colors.divider,
132
+ borderTopColor: palette.grey.base,
121
133
  borderTopWidth: 1,
122
134
  paddingTop: spacing.md,
123
135
  paddingBottom: spacing.sm - 8, // Hack for centering the button
124
136
  width: '100%',
125
- alignItems: 'center'
137
+ alignItems: 'center',
138
+ backgroundColor: 'transparent'
126
139
  }
127
140
  });
128
141
  };
@@ -3,6 +3,7 @@ export interface FormControlProps {
3
3
  label?: string;
4
4
  error?: string;
5
5
  name?: string;
6
+ type?: 'input' | 'select';
6
7
  }
7
- export declare const FormControl: ({ label, error, name, children }: PropsWithChildren<FormControlProps>) => import("react").JSX.Element;
8
+ export declare const FormControl: ({ label, error, name, type, children }: PropsWithChildren<FormControlProps>) => import("react").JSX.Element;
8
9
  export default FormControl;
@@ -2,18 +2,21 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FormControl = void 0;
4
4
  var react_native_1 = require("react-native");
5
+ var useCustomComponents_1 = require("../hooks/useCustomComponents");
5
6
  var useTheme_1 = require("../hooks/useTheme");
6
7
  var Text_1 = require("./Text");
7
8
  var FormControl = function (_a) {
8
- var label = _a.label, error = _a.error, name = _a.name, children = _a.children;
9
+ var label = _a.label, error = _a.error, name = _a.name, _b = _a.type, type = _b === void 0 ? 'input' : _b, children = _a.children;
9
10
  var theme = (0, useTheme_1.useTheme)();
10
11
  var styles = getStyles(theme);
12
+ var _c = (0, useCustomComponents_1.useCustomComponents)(), customInputStyle = _c.Input, customSelectStyle = _c.Select;
13
+ var customComponentStyle = type === 'input' ? customInputStyle : customSelectStyle;
11
14
  return (<react_native_1.View style={styles.formControl}>
12
- {label && (<Text_1.Text style={styles.label} nativeID={name}>
15
+ {label && (<Text_1.Text style={[styles.label, customComponentStyle === null || customComponentStyle === void 0 ? void 0 : customComponentStyle.labelStyle]} nativeID={name}>
13
16
  {label}
14
17
  </Text_1.Text>)}
15
18
  {children}
16
- <Text_1.Text variant="sm" color={theme.colors.warning} style={styles.error}>
19
+ <Text_1.Text variant="sm" color={theme.palette.error} style={[styles.error, customComponentStyle === null || customComponentStyle === void 0 ? void 0 : customComponentStyle.errorStyle]}>
17
20
  {error}
18
21
  </Text_1.Text>
19
22
  </react_native_1.View>);
@@ -21,20 +24,22 @@ var FormControl = function (_a) {
21
24
  exports.FormControl = FormControl;
22
25
  exports.default = exports.FormControl;
23
26
  var getStyles = function (_a) {
24
- var spacing = _a.spacing, colors = _a.colors, fontSize = _a.fontSize, lineHeight = _a.lineHeight;
27
+ var spacing = _a.spacing, palette = _a.palette, sm = _a.font.sm;
25
28
  return react_native_1.StyleSheet.create({
26
29
  formControl: {
27
30
  rowGap: spacing.xxs,
28
31
  width: '100%'
29
32
  },
30
33
  label: {
31
- color: colors.black,
32
- fontSize: fontSize.sm,
33
- lineHeight: lineHeight.sm,
34
- fontWeight: 'bold'
34
+ color: palette.black,
35
+ fontSize: sm.size,
36
+ lineHeight: sm.lineHeight,
37
+ fontWeight: 'bold',
38
+ textAlign: 'auto'
35
39
  },
36
40
  error: {
37
- minHeight: spacing.xs
41
+ minHeight: spacing.xs,
42
+ textAlign: 'auto'
38
43
  }
39
44
  });
40
45
  };
@@ -89,16 +89,16 @@ var Header = function (_a) {
89
89
  };
90
90
  exports.Header = Header;
91
91
  var getStyles = function (_a) {
92
- var colors = _a.colors, spacing = _a.spacing, shadows = _a.shadows;
92
+ var palette = _a.palette, spacing = _a.spacing, shadows = _a.shadows;
93
93
  return react_native_1.StyleSheet.create({
94
- container: __assign({ width: '100%', paddingHorizontal: spacing.sm, backgroundColor: colors.primary, rowGap: spacing.xs }, shadows.soft),
94
+ container: __assign({ width: '100%', paddingHorizontal: spacing.sm, backgroundColor: palette.primary.base, rowGap: spacing.xs }, shadows.soft),
95
95
  row: {
96
96
  flexDirection: 'row',
97
97
  alignItems: 'center',
98
98
  columnGap: spacing.sm
99
99
  },
100
100
  whiteText: {
101
- color: colors.white
101
+ color: palette.white
102
102
  },
103
103
  iconWrapper: {
104
104
  minWidth: 26,
@@ -17,12 +17,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.Input = void 0;
18
18
  var react_1 = require("react");
19
19
  var react_native_1 = require("react-native");
20
+ var useCustomComponents_1 = require("../hooks/useCustomComponents");
20
21
  var useForm_1 = require("../hooks/useForm");
21
22
  var useTheme_1 = require("../hooks/useTheme");
22
23
  var FormControl_1 = __importDefault(require("./FormControl"));
23
24
  var Input = function (_a) {
24
25
  var label = _a.label, error = _a.error, id = _a.id, props = __rest(_a, ["label", "error", "id"]);
25
26
  var theme = (0, useTheme_1.useTheme)();
27
+ var Input = (0, useCustomComponents_1.useCustomComponents)().Input;
26
28
  var styles = getStyles(theme);
27
29
  var _b = (0, useForm_1.useForm)(), errors = _b.errors, data = _b.data, clearError = _b.clearError, updateData = _b.updateData, loading = _b.loading;
28
30
  var _c = (0, react_1.useState)(false), focused = _c[0], setFocused = _c[1];
@@ -46,29 +48,29 @@ var Input = function (_a) {
46
48
  var formValue = data === null || data === void 0 ? void 0 : data[id];
47
49
  var err = formError || error;
48
50
  return (<FormControl_1.default label={label} error={err} name={id}>
49
- <react_native_1.TextInput {...props} id={id} style={[styles.input, focused && styles.focused, err && styles.error, props.style]} onFocus={onFocus} onBlur={onBlur} placeholderTextColor={theme.colors.gray} value={formValue || props.value} onChangeText={onChangeText} editable={!loading} accessibilityLabel="input" accessibilityLabelledBy={id} accessibilityState={{ busy: loading, disabled: loading }}/>
51
+ <react_native_1.TextInput {...props} id={id} style={[styles.input, focused && styles.focused, err && styles.error, props.style, Input === null || Input === void 0 ? void 0 : Input.containerStyle]} onFocus={onFocus} onBlur={onBlur} placeholderTextColor={Input === null || Input === void 0 ? void 0 : Input.placeholderTextColor} value={formValue || props.value} onChangeText={onChangeText} editable={!loading} accessibilityLabel="input" accessibilityLabelledBy={id} accessibilityState={{ busy: loading, disabled: loading }}/>
50
52
  </FormControl_1.default>);
51
53
  };
52
54
  exports.Input = Input;
53
55
  exports.default = exports.Input;
54
56
  var getStyles = function (_a) {
55
- var colors = _a.colors, spacing = _a.spacing, fontSize = _a.fontSize, borderRadius = _a.borderRadius;
57
+ var palette = _a.palette, spacing = _a.spacing, base = _a.font.base, borderRadius = _a.borderRadius;
56
58
  return react_native_1.StyleSheet.create({
57
59
  input: {
58
- color: colors.black,
59
- fontSize: fontSize.base,
60
+ color: palette.black,
61
+ fontSize: base.size,
60
62
  padding: spacing.sm,
61
63
  borderWidth: 1,
62
- borderColor: colors.gray,
64
+ borderColor: palette.grey.base,
63
65
  borderRadius: borderRadius.md,
64
66
  width: '100%',
65
- backgroundColor: colors.white
67
+ backgroundColor: palette.white
66
68
  },
67
69
  focused: {
68
- borderColor: colors.primary
70
+ borderColor: palette.primary.base
69
71
  },
70
72
  error: {
71
- borderColor: colors.warning
73
+ borderColor: palette.error
72
74
  }
73
75
  });
74
76
  };
@@ -5,12 +5,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.AttachmentPreviewModal = void 0;
7
7
  var react_1 = __importDefault(require("react"));
8
- var react_native_1 = require("react-native");
9
8
  var react_i18next_1 = require("react-i18next");
10
- var _1 = require(".");
9
+ var react_native_1 = require("react-native");
11
10
  var useTheme_1 = require("../../hooks/useTheme");
12
11
  var TrashIcon_1 = require("../../icons/TrashIcon");
13
12
  var Button_1 = require("../Button");
13
+ var _1 = require(".");
14
14
  var ModalHeader_1 = require("./ModalHeader");
15
15
  var AttachmentPreviewModal = function (_a) {
16
16
  var onCancel = _a.onCancel, onRemove = _a.onRemove, visible = _a.visible, attachment = _a.attachment;
@@ -43,10 +43,10 @@ var AttachmentPreviewModal = function (_a) {
43
43
  };
44
44
  exports.AttachmentPreviewModal = AttachmentPreviewModal;
45
45
  var getStyles = function (_a) {
46
- var colors = _a.colors, spacing = _a.spacing, borderRadius = _a.borderRadius;
46
+ var palette = _a.palette, spacing = _a.spacing, borderRadius = _a.borderRadius;
47
47
  return react_native_1.StyleSheet.create({
48
48
  modal: {
49
- backgroundColor: colors.background,
49
+ backgroundColor: palette.grey.light,
50
50
  rowGap: spacing.xs
51
51
  },
52
52
  main: {
@@ -55,13 +55,13 @@ var getStyles = function (_a) {
55
55
  container: {
56
56
  width: '100%',
57
57
  padding: spacing.xs,
58
- backgroundColor: colors.white,
58
+ backgroundColor: palette.white,
59
59
  borderRadius: borderRadius.md,
60
60
  rowGap: spacing.xs
61
61
  },
62
62
  image: {
63
63
  width: '100%',
64
- backgroundColor: colors.primaryLight,
64
+ backgroundColor: palette.primary.light,
65
65
  borderRadius: borderRadius.sm
66
66
  }
67
67
  });
@@ -8,8 +8,8 @@ var react_1 = __importDefault(require("react"));
8
8
  var react_i18next_1 = require("react-i18next");
9
9
  var react_native_1 = require("react-native");
10
10
  var react_native_webview_1 = require("react-native-webview");
11
- var _1 = require(".");
12
11
  var useTheme_1 = require("../../hooks/useTheme");
12
+ var _1 = require(".");
13
13
  var ModalHeader_1 = require("./ModalHeader");
14
14
  var DoctorProfileModal = function (_a) {
15
15
  var onCancel = _a.onCancel, visible = _a.visible, profileUrl = _a.profileUrl;
@@ -26,16 +26,16 @@ var DoctorProfileModal = function (_a) {
26
26
  };
27
27
  exports.DoctorProfileModal = DoctorProfileModal;
28
28
  var getStyles = function (_a) {
29
- var colors = _a.colors, spacing = _a.spacing, borderRadius = _a.borderRadius;
29
+ var palette = _a.palette, spacing = _a.spacing, borderRadius = _a.borderRadius;
30
30
  return react_native_1.StyleSheet.create({
31
31
  modal: {
32
- backgroundColor: colors.background,
32
+ backgroundColor: palette.grey.light,
33
33
  rowGap: spacing.xs,
34
34
  height: '80%',
35
35
  padding: spacing.xs
36
36
  },
37
37
  container: {
38
- backgroundColor: colors.white,
38
+ backgroundColor: palette.white,
39
39
  borderRadius: borderRadius.md,
40
40
  overflow: 'hidden',
41
41
  flex: 1
@@ -6,25 +6,31 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.ModalHeader = void 0;
7
7
  var react_1 = __importDefault(require("react"));
8
8
  var react_native_1 = require("react-native");
9
+ var useCustomComponents_1 = require("../../hooks/useCustomComponents");
9
10
  var useTheme_1 = require("../../hooks/useTheme");
10
11
  var CloseIcon_1 = require("../../icons/CloseIcon");
11
12
  var Text_1 = require("../Text");
12
13
  var ModalHeader = function (_a) {
14
+ var _b, _c, _d;
13
15
  var title = _a.title, onCancel = _a.onCancel;
14
16
  var theme = (0, useTheme_1.useTheme)();
15
17
  var styles = getStyles(theme);
16
- return (<react_native_1.View style={styles.container}>
17
- <Text_1.Text variant="h4" style={styles.title}>
18
+ var Modal = (0, useCustomComponents_1.useCustomComponents)().Modal;
19
+ if ((_b = Modal === null || Modal === void 0 ? void 0 : Modal.Header) === null || _b === void 0 ? void 0 : _b.customComponent)
20
+ return <Modal.Header.customComponent title={title} onCancel={onCancel}/>;
21
+ return (<react_native_1.View style={[styles.container, (_c = Modal === null || Modal === void 0 ? void 0 : Modal.Header) === null || _c === void 0 ? void 0 : _c.containerStyle]}>
22
+ <Text_1.Text variant="h4" style={[styles.title, (_d = Modal === null || Modal === void 0 ? void 0 : Modal.Header) === null || _d === void 0 ? void 0 : _d.titleStyle]}>
18
23
  {title}
19
24
  </Text_1.Text>
25
+
20
26
  <react_native_1.TouchableOpacity activeOpacity={0.6} onPress={onCancel}>
21
- <CloseIcon_1.CloseIcon color={theme.colors.primary}/>
27
+ <CloseIcon_1.CloseIcon color={theme.palette.primary.base}/>
22
28
  </react_native_1.TouchableOpacity>
23
29
  </react_native_1.View>);
24
30
  };
25
31
  exports.ModalHeader = ModalHeader;
26
32
  var getStyles = function (_a) {
27
- var colors = _a.colors, spacing = _a.spacing;
33
+ var palette = _a.palette, spacing = _a.spacing;
28
34
  return react_native_1.StyleSheet.create({
29
35
  container: {
30
36
  flexDirection: 'row',
@@ -34,7 +40,7 @@ var getStyles = function (_a) {
34
40
  paddingHorizontal: spacing.sm
35
41
  },
36
42
  title: {
37
- color: colors.primary
43
+ color: palette.primary.base
38
44
  }
39
45
  });
40
46
  };
@@ -28,30 +28,37 @@ Object.defineProperty(exports, "__esModule", { value: true });
28
28
  exports.Modal = void 0;
29
29
  var react_1 = __importDefault(require("react"));
30
30
  var react_native_1 = require("react-native");
31
+ var useCustomComponents_1 = require("../../hooks/useCustomComponents");
31
32
  var useTheme_1 = require("../../hooks/useTheme");
32
33
  var Modal = function (_a) {
33
34
  var children = _a.children, modalStyle = _a.modalStyle, props = __rest(_a, ["children", "modalStyle"]);
34
35
  var theme = (0, useTheme_1.useTheme)();
35
36
  var styles = getStyles(theme);
37
+ var Modal = (0, useCustomComponents_1.useCustomComponents)().Modal;
36
38
  return (<react_native_1.Modal {...props} transparent statusBarTranslucent animationType="fade">
37
- <react_native_1.TouchableOpacity style={styles.container} onPress={props.onRequestClose}>
39
+ <react_native_1.TouchableOpacity style={[
40
+ styles.container,
41
+ {
42
+ backgroundColor: 'rgba(7, 30, 56, 0.55)'
43
+ },
44
+ Modal === null || Modal === void 0 ? void 0 : Modal.containerStyle
45
+ ]} onPress={props.onRequestClose}>
38
46
  <react_native_1.TouchableWithoutFeedback>
39
- <react_native_1.View style={[styles.modal, modalStyle]}>{children}</react_native_1.View>
47
+ <react_native_1.View style={[styles.modal, modalStyle, Modal === null || Modal === void 0 ? void 0 : Modal.innerContainerStyle]}>{children}</react_native_1.View>
40
48
  </react_native_1.TouchableWithoutFeedback>
41
49
  </react_native_1.TouchableOpacity>
42
50
  </react_native_1.Modal>);
43
51
  };
44
52
  exports.Modal = Modal;
45
53
  var getStyles = function (_a) {
46
- var colors = _a.colors, spacing = _a.spacing, shadows = _a.shadows, borderRadius = _a.borderRadius;
54
+ var palette = _a.palette, spacing = _a.spacing, shadows = _a.shadows, borderRadius = _a.borderRadius;
47
55
  return react_native_1.StyleSheet.create({
48
56
  container: {
49
57
  flex: 1,
50
58
  justifyContent: 'center',
51
59
  alignItems: 'center',
52
- backgroundColor: colors.backdrop,
53
60
  padding: spacing.sm
54
61
  },
55
- modal: __assign({ backgroundColor: colors.white, borderRadius: borderRadius.xl, width: '100%' }, shadows.soft)
62
+ modal: __assign({ backgroundColor: palette.white, borderRadius: borderRadius.xl, width: '100%' }, shadows.soft)
56
63
  });
57
64
  };
@@ -54,28 +54,28 @@ var PhoneInput = function (_a) {
54
54
  exports.PhoneInput = PhoneInput;
55
55
  exports.default = exports.PhoneInput;
56
56
  var getStyles = function (_a) {
57
- var colors = _a.colors, spacing = _a.spacing, fontSize = _a.fontSize, borderRadius = _a.borderRadius;
57
+ var palette = _a.palette, spacing = _a.spacing, base = _a.font.base, borderRadius = _a.borderRadius;
58
58
  return react_native_1.StyleSheet.create({
59
59
  input: {
60
60
  padding: spacing.sm,
61
61
  borderWidth: 1,
62
- borderColor: colors.gray,
62
+ borderColor: palette.grey.base,
63
63
  borderRadius: borderRadius.md,
64
64
  width: '100%',
65
- backgroundColor: colors.white
65
+ backgroundColor: palette.white
66
66
  },
67
67
  focused: {
68
- borderColor: colors.primary
68
+ borderColor: palette.primary.base
69
69
  },
70
70
  inputText: {
71
- color: colors.black,
72
- fontSize: fontSize.base,
71
+ color: palette.black,
72
+ fontSize: base.size,
73
73
  borderLeftWidth: 1,
74
- borderLeftColor: colors.gray,
74
+ borderLeftColor: palette.grey.base,
75
75
  paddingLeft: spacing.xs
76
76
  },
77
77
  error: {
78
- borderColor: colors.warning
78
+ borderColor: palette.error
79
79
  }
80
80
  });
81
81
  };