medos-sdk 1.1.10 → 1.1.11
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/dist/client/MedosClient.d.ts +1 -0
- package/dist/client/MedosClient.js +7 -0
- package/dist/components/AppointmentCalender.js +19 -22
- package/dist/components/AppointmentConfirmationStep.d.ts +1 -0
- package/dist/components/AppointmentConfirmationStep.js +34 -42
- package/dist/components/AppointmentDateTimeModal.d.ts +1 -0
- package/dist/components/AppointmentDateTimeModal.js +201 -168
- package/dist/components/AppointmentSummaryStep.d.ts +12 -0
- package/dist/components/AppointmentSummaryStep.js +168 -0
- package/dist/components/BookingOptionStep.d.ts +14 -0
- package/dist/components/BookingOptionStep.js +346 -0
- package/dist/components/ContactInformationStep.js +10 -4
- package/dist/components/ContactPreferenceStep.js +10 -1
- package/dist/components/DoctorSelectModal.js +105 -59
- package/dist/components/EnquiryForm.js +81 -69
- package/dist/components/Icons/CloseIcon.d.ts +9 -0
- package/dist/components/Icons/CloseIcon.js +5 -0
- package/dist/components/InquiryDetailsStep.js +5 -1
- package/dist/components/PatientDetailsStep.js +17 -12
- package/dist/components/PatientSelectionStep.d.ts +12 -0
- package/dist/components/PatientSelectionStep.js +254 -0
- package/dist/components/PhoneVerificationStep.js +1 -1
- package/dist/components/SuccessStep.js +1 -1
- package/dist/components/appointment-booking/AppointmentCalender.js +200 -60
- package/dist/components/appointment-booking/hooks/useAppointmentFlow.d.ts +0 -1
- package/dist/components/appointment-booking/hooks/useAppointmentFlow.js +110 -25
- package/dist/components/appointment-booking/hooks/useAppointmentState.js +32 -0
- package/dist/components/appointment-booking/hooks/useInitializeAddresses.js +0 -1
- package/dist/components/appointment-booking/types.d.ts +163 -0
- package/dist/components/appointment-booking/types.js +16 -0
- package/dist/components/appointment-modal-styles.d.ts +259 -0
- package/dist/components/appointment-modal-styles.js +395 -0
- package/dist/components/constant.d.ts +2 -0
- package/dist/components/constant.js +15 -0
- package/dist/components/custom-calendar.js +20 -11
- package/dist/components/styles.js +93 -52
- package/dist/components/theme-styles.d.ts +5 -4
- package/dist/components/theme-styles.js +221 -125
- package/dist/components/types.d.ts +3 -1
- package/dist/components/types.js +15 -0
- package/dist/components/utils.d.ts +3 -0
- package/dist/components/utils.js +59 -0
- package/dist/components/validation.d.ts +2 -0
- package/dist/components/validation.js +41 -0
- package/dist/core/theme/index.d.ts +1 -0
- package/dist/core/theme/index.js +1 -0
- package/dist/core/theme/responsive.d.ts +15 -0
- package/dist/core/theme/responsive.js +113 -0
- package/dist/core/theme/themes.js +16 -4
- package/dist/core/theme/types.d.ts +8 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/react/ThemeProvider.d.ts +2 -1
- package/dist/react/ThemeProvider.js +49 -10
- package/dist/services/AppointmentService.d.ts +80 -2
- package/dist/services/AppointmentService.js +114 -5
- package/dist/services/WorkspaceService.d.ts +58 -3
- package/dist/services/WorkspaceService.js +10 -1
- package/dist/vanilla/AppointmentCalendarWidget.d.ts +9 -7
- package/dist/vanilla/AppointmentCalendarWidget.js +820 -377
- package/dist/vanilla/EnquiryFormWidget.d.ts +1 -0
- package/dist/vanilla/EnquiryFormWidget.js +25 -43
- package/dist/vanilla/client/MedosClient.d.ts +1 -0
- package/dist/vanilla/components/AppointmentConfirmationStep.d.ts +1 -0
- package/dist/vanilla/components/AppointmentDateTimeModal.d.ts +1 -0
- package/dist/vanilla/components/AppointmentSummaryStep.d.ts +12 -0
- package/dist/vanilla/components/BookingOptionStep.d.ts +14 -0
- package/dist/vanilla/components/Icons/CloseIcon.d.ts +9 -0
- package/dist/vanilla/components/PatientSelectionStep.d.ts +12 -0
- package/dist/vanilla/components/VanillaCalendar.js +33 -18
- package/dist/vanilla/components/VanillaIcons.d.ts +5 -0
- package/dist/vanilla/components/VanillaIcons.js +92 -0
- package/dist/vanilla/components/VanillaSelect.d.ts +3 -0
- package/dist/vanilla/components/VanillaSelect.js +93 -5
- package/dist/vanilla/components/appointment-booking/hooks/useAppointmentFlow.d.ts +0 -1
- package/dist/vanilla/components/appointment-booking/types.d.ts +163 -0
- package/dist/vanilla/components/appointment-modal-styles.d.ts +259 -0
- package/dist/vanilla/components/constant.d.ts +2 -0
- package/dist/vanilla/components/theme-styles.d.ts +5 -4
- package/dist/vanilla/components/types.d.ts +3 -1
- package/dist/vanilla/components/utils.d.ts +3 -0
- package/dist/vanilla/components/validation.d.ts +2 -0
- package/dist/vanilla/core/theme/index.d.ts +1 -0
- package/dist/vanilla/core/theme/responsive.d.ts +15 -0
- package/dist/vanilla/core/theme/types.d.ts +8 -0
- package/dist/vanilla/enquiry-widget.js +373 -52
- package/dist/vanilla/index.d.ts +2 -0
- package/dist/vanilla/react/ThemeProvider.d.ts +2 -1
- package/dist/vanilla/services/AppointmentService.d.ts +80 -2
- package/dist/vanilla/services/WorkspaceService.d.ts +58 -3
- package/dist/vanilla/vanilla/AppointmentCalendarWidget.d.ts +9 -7
- package/dist/vanilla/vanilla/EnquiryFormWidget.d.ts +1 -0
- package/dist/vanilla/vanilla/components/VanillaIcons.d.ts +5 -0
- package/dist/vanilla/vanilla/components/VanillaSelect.d.ts +3 -0
- package/dist/vanilla/widget.css +833 -207
- package/dist/vanilla/widget.js +6444 -5676
- package/package.json +1 -1
|
@@ -1,258 +1,349 @@
|
|
|
1
|
-
export function getContainerStyles(theme, prefix = "medos") {
|
|
1
|
+
export function getContainerStyles(theme, prefix = "medos", breakpoint) {
|
|
2
|
+
const isMobile = breakpoint === "mobile";
|
|
3
|
+
const isTablet = breakpoint === "tablet";
|
|
2
4
|
return {
|
|
3
5
|
container: {
|
|
4
6
|
display: "flex",
|
|
5
7
|
justifyContent: "center",
|
|
6
|
-
padding:
|
|
8
|
+
padding: isMobile ? "16px" : "20px",
|
|
7
9
|
fontFamily: theme.typography.fontFamily,
|
|
8
10
|
background: theme.colors.background,
|
|
9
11
|
},
|
|
10
12
|
card: {
|
|
11
13
|
width: "100%",
|
|
12
|
-
maxWidth: 720,
|
|
14
|
+
maxWidth: isMobile || isTablet ? "100%" : 720,
|
|
13
15
|
background: theme.colors.surface,
|
|
14
|
-
borderRadius:
|
|
15
|
-
boxShadow:
|
|
16
|
-
padding:
|
|
16
|
+
borderRadius: "12px",
|
|
17
|
+
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.08)",
|
|
18
|
+
padding: isMobile ? "20px" : "24px",
|
|
17
19
|
boxSizing: "border-box",
|
|
18
20
|
},
|
|
19
21
|
header: {
|
|
20
22
|
display: "flex",
|
|
21
23
|
alignItems: "center",
|
|
22
24
|
justifyContent: "space-between",
|
|
23
|
-
marginBottom:
|
|
25
|
+
marginBottom: "20px",
|
|
26
|
+
flexWrap: isMobile ? "wrap" : "nowrap",
|
|
24
27
|
},
|
|
25
28
|
title: {
|
|
26
|
-
marginLeft: 10,
|
|
27
|
-
fontSize:
|
|
28
|
-
fontWeight:
|
|
29
|
+
marginLeft: isMobile ? 0 : 10,
|
|
30
|
+
fontSize: isMobile ? "18px" : "20px",
|
|
31
|
+
fontWeight: 600,
|
|
29
32
|
color: theme.colors.text,
|
|
33
|
+
margin: 0,
|
|
30
34
|
},
|
|
31
35
|
section: {
|
|
32
|
-
marginTop:
|
|
36
|
+
marginTop: "16px",
|
|
33
37
|
},
|
|
34
38
|
errorMessage: {
|
|
35
|
-
marginBottom:
|
|
39
|
+
marginBottom: "16px",
|
|
40
|
+
padding: "12px 16px",
|
|
41
|
+
borderRadius: "8px",
|
|
42
|
+
backgroundColor: theme.colors.errorBackground,
|
|
36
43
|
color: theme.colors.error,
|
|
37
|
-
fontWeight:
|
|
44
|
+
fontWeight: 500,
|
|
45
|
+
fontSize: "14px",
|
|
46
|
+
border: `1px solid ${theme.colors.error}20`,
|
|
38
47
|
},
|
|
39
48
|
actions: {
|
|
40
49
|
display: "flex",
|
|
41
|
-
gap:
|
|
42
|
-
marginTop:
|
|
43
|
-
|
|
50
|
+
gap: "12px",
|
|
51
|
+
marginTop: "24px",
|
|
52
|
+
paddingTop: "20px",
|
|
53
|
+
borderTop: `1px solid ${theme.colors.border}`,
|
|
54
|
+
justifyContent: isMobile ? "stretch" : "flex-end",
|
|
55
|
+
flexDirection: isMobile ? "column" : "row",
|
|
44
56
|
},
|
|
45
57
|
};
|
|
46
58
|
}
|
|
47
|
-
export function getButtonStyles(theme, prefix = "medos") {
|
|
59
|
+
export function getButtonStyles(theme, prefix = "medos", breakpoint) {
|
|
60
|
+
const isMobile = breakpoint === "mobile";
|
|
61
|
+
const minHeight = isMobile ? "44px" : "40px";
|
|
62
|
+
const basePadding = isMobile ? "12px 20px" : "10px 20px";
|
|
63
|
+
const borderRadius = "8px";
|
|
48
64
|
return {
|
|
49
65
|
primary: {
|
|
50
66
|
background: theme.colors.secondary,
|
|
51
67
|
color: theme.colors.textOnSecondary,
|
|
52
68
|
border: "none",
|
|
53
|
-
padding:
|
|
54
|
-
borderRadius
|
|
69
|
+
padding: basePadding,
|
|
70
|
+
borderRadius,
|
|
55
71
|
cursor: "pointer",
|
|
56
|
-
fontWeight:
|
|
57
|
-
fontSize:
|
|
58
|
-
transition:
|
|
72
|
+
fontWeight: 600,
|
|
73
|
+
fontSize: "14px",
|
|
74
|
+
transition: "all 0.2s ease",
|
|
75
|
+
minHeight,
|
|
76
|
+
width: isMobile ? "100%" : "auto",
|
|
77
|
+
boxShadow: "0 1px 2px rgba(0, 0, 0, 0.05)",
|
|
78
|
+
lineHeight: "1.5",
|
|
59
79
|
},
|
|
60
80
|
primaryHover: {
|
|
61
81
|
background: theme.colors.secondaryHover,
|
|
82
|
+
boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)",
|
|
83
|
+
},
|
|
84
|
+
primaryDisabled: {
|
|
85
|
+
opacity: 0.6,
|
|
86
|
+
cursor: "not-allowed",
|
|
62
87
|
},
|
|
63
88
|
secondary: {
|
|
64
89
|
background: theme.colors.surface,
|
|
65
90
|
color: theme.colors.primary,
|
|
66
|
-
border: `1px solid ${theme.colors.
|
|
67
|
-
padding:
|
|
68
|
-
borderRadius
|
|
91
|
+
border: `1px solid ${theme.colors.border}`,
|
|
92
|
+
padding: basePadding,
|
|
93
|
+
borderRadius,
|
|
69
94
|
cursor: "pointer",
|
|
70
|
-
|
|
71
|
-
|
|
95
|
+
fontWeight: 600,
|
|
96
|
+
fontSize: "14px",
|
|
97
|
+
transition: "all 0.2s ease",
|
|
98
|
+
minHeight,
|
|
99
|
+
width: isMobile ? "100%" : "auto",
|
|
100
|
+
lineHeight: "1.5",
|
|
72
101
|
},
|
|
73
102
|
secondaryHover: {
|
|
74
103
|
background: theme.colors.surfaceHover,
|
|
104
|
+
borderColor: theme.colors.borderHover,
|
|
105
|
+
},
|
|
106
|
+
outline: {
|
|
107
|
+
background: "transparent",
|
|
108
|
+
color: theme.colors.text,
|
|
109
|
+
border: `1px solid ${theme.colors.border}`,
|
|
110
|
+
padding: basePadding,
|
|
111
|
+
borderRadius,
|
|
112
|
+
cursor: "pointer",
|
|
113
|
+
fontWeight: 500,
|
|
114
|
+
fontSize: "14px",
|
|
115
|
+
transition: "all 0.2s ease",
|
|
116
|
+
minHeight,
|
|
117
|
+
width: isMobile ? "100%" : "auto",
|
|
118
|
+
lineHeight: "1.5",
|
|
119
|
+
},
|
|
120
|
+
outlineHover: {
|
|
121
|
+
background: theme.colors.backgroundSecondary,
|
|
122
|
+
borderColor: theme.colors.borderHover,
|
|
123
|
+
},
|
|
124
|
+
ghost: {
|
|
125
|
+
background: "transparent",
|
|
126
|
+
color: theme.colors.primary,
|
|
127
|
+
border: "none",
|
|
128
|
+
padding: basePadding,
|
|
129
|
+
borderRadius,
|
|
130
|
+
cursor: "pointer",
|
|
131
|
+
fontWeight: 500,
|
|
132
|
+
fontSize: "14px",
|
|
133
|
+
transition: "all 0.2s ease",
|
|
134
|
+
minHeight,
|
|
135
|
+
width: isMobile ? "100%" : "auto",
|
|
136
|
+
lineHeight: "1.5",
|
|
137
|
+
},
|
|
138
|
+
ghostHover: {
|
|
139
|
+
background: `${theme.colors.primary}10`,
|
|
75
140
|
},
|
|
76
141
|
};
|
|
77
142
|
}
|
|
78
|
-
export function getPhoneVerifyStyles(theme, prefix = "medos") {
|
|
143
|
+
export function getPhoneVerifyStyles(theme, prefix = "medos", breakpoint) {
|
|
144
|
+
const isMobile = breakpoint === "mobile";
|
|
145
|
+
const borderRadius = "12px";
|
|
146
|
+
const cardBorder = `1px solid ${theme.colors.border}`;
|
|
79
147
|
return {
|
|
80
148
|
container: {
|
|
81
|
-
border:
|
|
82
|
-
borderRadius
|
|
149
|
+
border: cardBorder,
|
|
150
|
+
borderRadius,
|
|
83
151
|
overflow: "hidden",
|
|
84
152
|
backgroundColor: theme.colors.surface,
|
|
153
|
+
boxShadow: "0 1px 3px rgba(0, 0, 0, 0.04)",
|
|
85
154
|
},
|
|
86
155
|
header: {
|
|
87
|
-
padding: "20px
|
|
156
|
+
padding: isMobile ? "16px 20px" : "18px 24px",
|
|
157
|
+
borderBottom: cardBorder,
|
|
158
|
+
backgroundColor: theme.colors.primary,
|
|
159
|
+
color: theme.colors.textOnPrimary,
|
|
160
|
+
},
|
|
161
|
+
title: {
|
|
162
|
+
fontSize: isMobile ? "16px" : "18px",
|
|
163
|
+
fontWeight: 600,
|
|
164
|
+
margin: 0,
|
|
165
|
+
color: theme.colors.textOnPrimary,
|
|
88
166
|
},
|
|
89
|
-
title: { fontSize: 20, fontWeight: 600, margin: 0 },
|
|
90
167
|
content: {
|
|
91
|
-
padding:
|
|
168
|
+
padding: isMobile ? "20px" : "24px",
|
|
92
169
|
},
|
|
93
170
|
label: {
|
|
94
171
|
display: "block",
|
|
95
|
-
fontSize:
|
|
96
|
-
fontWeight:
|
|
172
|
+
fontSize: "14px",
|
|
173
|
+
fontWeight: 500,
|
|
97
174
|
color: theme.colors.text,
|
|
98
|
-
marginBottom:
|
|
175
|
+
marginBottom: "8px",
|
|
99
176
|
},
|
|
100
177
|
phoneInputContainer: {
|
|
101
178
|
display: "flex",
|
|
102
|
-
gap:
|
|
179
|
+
gap: "10px",
|
|
180
|
+
flexDirection: isMobile ? "column" : "row",
|
|
103
181
|
},
|
|
104
182
|
phoneInput: {
|
|
105
183
|
flex: 1,
|
|
106
184
|
width: "100%",
|
|
107
|
-
padding:
|
|
108
|
-
borderRadius:
|
|
185
|
+
padding: "10px 14px",
|
|
186
|
+
borderRadius: "8px",
|
|
109
187
|
border: `1px solid ${theme.colors.border}`,
|
|
110
|
-
fontSize:
|
|
188
|
+
fontSize: "14px",
|
|
111
189
|
outline: "none",
|
|
112
190
|
color: theme.colors.text,
|
|
113
191
|
boxSizing: "border-box",
|
|
114
|
-
transition:
|
|
192
|
+
transition: "border-color 0.2s ease, box-shadow 0.2s ease",
|
|
193
|
+
minHeight: isMobile ? "44px" : "40px",
|
|
194
|
+
backgroundColor: theme.colors.surface,
|
|
115
195
|
},
|
|
116
196
|
phoneInputFocus: {
|
|
117
|
-
borderColor: theme.colors.
|
|
118
|
-
|
|
197
|
+
borderColor: theme.colors.primary,
|
|
198
|
+
boxShadow: `0 0 0 3px ${theme.colors.primary}15`,
|
|
119
199
|
},
|
|
120
200
|
phoneDisplay: {
|
|
121
|
-
padding:
|
|
201
|
+
padding: "10px 14px",
|
|
122
202
|
background: theme.colors.backgroundSecondary,
|
|
123
|
-
borderRadius:
|
|
124
|
-
fontSize:
|
|
125
|
-
color: theme.colors.
|
|
126
|
-
fontWeight:
|
|
203
|
+
borderRadius: "8px",
|
|
204
|
+
fontSize: "14px",
|
|
205
|
+
color: theme.colors.text,
|
|
206
|
+
fontWeight: 500,
|
|
207
|
+
border: `1px solid ${theme.colors.border}`,
|
|
127
208
|
},
|
|
128
209
|
otpInput: {
|
|
129
210
|
width: "100%",
|
|
130
|
-
padding:
|
|
131
|
-
border: `1px solid ${theme.colors.
|
|
132
|
-
borderRadius:
|
|
133
|
-
fontSize:
|
|
211
|
+
padding: "10px 14px",
|
|
212
|
+
border: `1px solid ${theme.colors.border}`,
|
|
213
|
+
borderRadius: "8px",
|
|
214
|
+
fontSize: "14px",
|
|
134
215
|
outline: "none",
|
|
135
216
|
color: theme.colors.text,
|
|
136
217
|
boxSizing: "border-box",
|
|
137
|
-
transition:
|
|
218
|
+
transition: "border-color 0.2s ease, box-shadow 0.2s ease",
|
|
219
|
+
backgroundColor: theme.colors.surface,
|
|
138
220
|
},
|
|
139
221
|
otpInputFocus: {
|
|
140
|
-
borderColor: theme.colors.
|
|
141
|
-
|
|
222
|
+
borderColor: theme.colors.primary,
|
|
223
|
+
boxShadow: `0 0 0 3px ${theme.colors.primary}15`,
|
|
142
224
|
},
|
|
143
225
|
otpHint: {
|
|
144
|
-
marginTop:
|
|
145
|
-
fontSize:
|
|
146
|
-
color: theme.colors.
|
|
226
|
+
marginTop: "8px",
|
|
227
|
+
fontSize: "12px",
|
|
228
|
+
color: theme.colors.textSecondary,
|
|
147
229
|
},
|
|
148
230
|
successMessage: {
|
|
149
|
-
marginTop:
|
|
150
|
-
padding:
|
|
151
|
-
borderRadius:
|
|
231
|
+
marginTop: "20px",
|
|
232
|
+
padding: "16px",
|
|
233
|
+
borderRadius: "8px",
|
|
152
234
|
backgroundColor: theme.colors.successBackground,
|
|
153
235
|
border: `1px solid ${theme.colors.success}`,
|
|
154
236
|
display: "flex",
|
|
155
237
|
alignItems: "center",
|
|
156
|
-
gap:
|
|
238
|
+
gap: "12px",
|
|
157
239
|
},
|
|
158
240
|
successIcon: {
|
|
159
|
-
fontSize:
|
|
241
|
+
fontSize: "24px",
|
|
160
242
|
color: theme.colors.success,
|
|
161
243
|
},
|
|
162
244
|
successTitle: {
|
|
163
|
-
fontSize:
|
|
164
|
-
fontWeight:
|
|
245
|
+
fontSize: "14px",
|
|
246
|
+
fontWeight: 600,
|
|
165
247
|
color: theme.colors.success,
|
|
166
248
|
},
|
|
167
249
|
successSubtitle: {
|
|
168
|
-
fontSize:
|
|
169
|
-
color: theme.colors.
|
|
170
|
-
marginTop:
|
|
250
|
+
fontSize: "12px",
|
|
251
|
+
color: theme.colors.textSecondary,
|
|
252
|
+
marginTop: "2px",
|
|
171
253
|
},
|
|
172
254
|
footer: {
|
|
173
|
-
padding:
|
|
255
|
+
padding: isMobile ? "16px 20px" : "18px 24px",
|
|
174
256
|
borderTop: `1px solid ${theme.colors.border}`,
|
|
175
257
|
backgroundColor: theme.colors.surface,
|
|
176
258
|
display: "flex",
|
|
177
|
-
gap:
|
|
178
|
-
justifyContent: "flex-end",
|
|
259
|
+
gap: "12px",
|
|
260
|
+
justifyContent: isMobile ? "stretch" : "flex-end",
|
|
261
|
+
flexDirection: isMobile ? "column" : "row",
|
|
179
262
|
},
|
|
180
263
|
};
|
|
181
264
|
}
|
|
182
|
-
export function getPatientDetailsStyles(theme, prefix = "medos") {
|
|
265
|
+
export function getPatientDetailsStyles(theme, prefix = "medos", breakpoint) {
|
|
266
|
+
const isMobile = breakpoint === "mobile";
|
|
267
|
+
const borderRadius = "12px";
|
|
268
|
+
const cardBorder = `1px solid ${theme.colors.border}`;
|
|
183
269
|
return {
|
|
184
270
|
sectionCard: {
|
|
185
|
-
border:
|
|
186
|
-
borderRadius
|
|
187
|
-
marginBottom:
|
|
271
|
+
border: cardBorder,
|
|
272
|
+
borderRadius,
|
|
273
|
+
marginBottom: "24px",
|
|
274
|
+
overflow: "visible",
|
|
275
|
+
boxShadow: "0 1px 3px rgba(0, 0, 0, 0.04)",
|
|
188
276
|
},
|
|
189
277
|
sectionHeader: {
|
|
190
278
|
backgroundColor: theme.colors.primary,
|
|
191
|
-
padding:
|
|
279
|
+
padding: isMobile ? "16px 20px" : "18px 24px",
|
|
192
280
|
display: "flex",
|
|
193
281
|
alignItems: "center",
|
|
194
|
-
gap:
|
|
195
|
-
borderBottom:
|
|
282
|
+
gap: "12px",
|
|
283
|
+
borderBottom: cardBorder,
|
|
196
284
|
color: theme.colors.textOnPrimary,
|
|
197
285
|
},
|
|
198
286
|
sectionTitle: {
|
|
199
|
-
fontSize:
|
|
200
|
-
fontWeight:
|
|
287
|
+
fontSize: isMobile ? "16px" : "18px",
|
|
288
|
+
fontWeight: 600,
|
|
201
289
|
margin: 0,
|
|
202
290
|
color: theme.colors.textOnPrimary,
|
|
203
291
|
},
|
|
204
292
|
sectionBody: {
|
|
205
|
-
padding:
|
|
293
|
+
padding: isMobile ? "20px" : "24px",
|
|
206
294
|
},
|
|
207
295
|
gridRow: {
|
|
208
296
|
display: "grid",
|
|
209
|
-
gridTemplateColumns: "1fr 1fr",
|
|
210
|
-
gap:
|
|
211
|
-
marginTop:
|
|
297
|
+
gridTemplateColumns: isMobile ? "1fr" : "1fr 1fr",
|
|
298
|
+
gap: isMobile ? "16px" : "20px",
|
|
299
|
+
marginTop: "20px",
|
|
212
300
|
},
|
|
213
301
|
label: {
|
|
214
302
|
display: "block",
|
|
215
|
-
fontSize:
|
|
216
|
-
marginBottom:
|
|
217
|
-
color: theme.colors.
|
|
218
|
-
fontWeight:
|
|
303
|
+
fontSize: "14px",
|
|
304
|
+
marginBottom: "8px",
|
|
305
|
+
color: theme.colors.text,
|
|
306
|
+
fontWeight: 500,
|
|
219
307
|
},
|
|
220
308
|
input: {
|
|
221
309
|
width: "100%",
|
|
222
|
-
padding:
|
|
223
|
-
borderRadius:
|
|
224
|
-
border:
|
|
310
|
+
padding: "10px 14px",
|
|
311
|
+
borderRadius: "8px",
|
|
312
|
+
border: cardBorder,
|
|
225
313
|
outline: "none",
|
|
226
|
-
fontSize:
|
|
314
|
+
fontSize: "14px",
|
|
227
315
|
boxSizing: "border-box",
|
|
228
316
|
color: theme.colors.text,
|
|
229
|
-
transition:
|
|
317
|
+
transition: "border-color 0.2s ease, box-shadow 0.2s ease",
|
|
318
|
+
minHeight: isMobile ? "44px" : "40px",
|
|
319
|
+
backgroundColor: theme.colors.surface,
|
|
230
320
|
},
|
|
231
321
|
inputFocus: {
|
|
232
|
-
borderColor: theme.colors.
|
|
233
|
-
|
|
322
|
+
borderColor: theme.colors.primary,
|
|
323
|
+
boxShadow: `0 0 0 3px ${theme.colors.primary}15`,
|
|
234
324
|
},
|
|
235
325
|
phoneDisplay: {
|
|
236
326
|
display: "flex",
|
|
237
|
-
gap:
|
|
327
|
+
gap: "10px",
|
|
328
|
+
flexDirection: isMobile ? "column" : "row",
|
|
238
329
|
},
|
|
239
330
|
phoneCode: {
|
|
240
|
-
width: "100px",
|
|
241
|
-
padding:
|
|
242
|
-
borderRadius:
|
|
243
|
-
border:
|
|
331
|
+
width: isMobile ? "100%" : "100px",
|
|
332
|
+
padding: "10px 14px",
|
|
333
|
+
borderRadius: "8px",
|
|
334
|
+
border: cardBorder,
|
|
244
335
|
backgroundColor: theme.colors.backgroundSecondary,
|
|
245
|
-
fontSize:
|
|
336
|
+
fontSize: "14px",
|
|
246
337
|
boxSizing: "border-box",
|
|
247
338
|
color: theme.colors.textSecondary,
|
|
248
339
|
},
|
|
249
340
|
phoneNumber: {
|
|
250
341
|
flex: 1,
|
|
251
|
-
padding:
|
|
252
|
-
borderRadius:
|
|
253
|
-
border:
|
|
342
|
+
padding: "10px 14px",
|
|
343
|
+
borderRadius: "8px",
|
|
344
|
+
border: cardBorder,
|
|
254
345
|
backgroundColor: theme.colors.backgroundSecondary,
|
|
255
|
-
fontSize:
|
|
346
|
+
fontSize: "14px",
|
|
256
347
|
boxSizing: "border-box",
|
|
257
348
|
color: theme.colors.textSecondary,
|
|
258
349
|
},
|
|
@@ -263,51 +354,56 @@ export function getSuccessStyles(theme, prefix = "medos") {
|
|
|
263
354
|
container: {
|
|
264
355
|
display: "flex",
|
|
265
356
|
flexDirection: "column",
|
|
266
|
-
height: "100%",
|
|
267
|
-
},
|
|
268
|
-
header: {
|
|
269
|
-
marginTop: `-${theme.spacing.lg}`,
|
|
270
357
|
alignItems: "center",
|
|
358
|
+
padding: "32px 24px",
|
|
271
359
|
textAlign: "center",
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
marginBottom: theme.spacing.xl,
|
|
360
|
+
},
|
|
361
|
+
header: {
|
|
362
|
+
marginBottom: "24px",
|
|
276
363
|
},
|
|
277
364
|
iconContainer: {
|
|
278
365
|
display: "flex",
|
|
279
366
|
alignItems: "center",
|
|
280
367
|
justifyContent: "center",
|
|
281
|
-
|
|
368
|
+
width: "72px",
|
|
369
|
+
height: "72px",
|
|
370
|
+
borderRadius: "50%",
|
|
371
|
+
backgroundColor: theme.colors.successBackground,
|
|
372
|
+
marginBottom: "20px",
|
|
282
373
|
},
|
|
283
374
|
detailsContainer: {
|
|
284
375
|
display: "flex",
|
|
285
376
|
flexDirection: "column",
|
|
286
377
|
alignItems: "center",
|
|
287
|
-
gap:
|
|
378
|
+
gap: "12px",
|
|
288
379
|
textAlign: "center",
|
|
289
|
-
color: theme.colors.success,
|
|
290
380
|
},
|
|
291
381
|
detailsTitle: {
|
|
292
|
-
fontWeight:
|
|
293
|
-
fontSize:
|
|
382
|
+
fontWeight: 600,
|
|
383
|
+
fontSize: "18px",
|
|
384
|
+
color: theme.colors.success,
|
|
385
|
+
margin: 0,
|
|
294
386
|
},
|
|
295
387
|
detailsList: {
|
|
296
388
|
display: "flex",
|
|
297
389
|
flexDirection: "column",
|
|
298
|
-
gap:
|
|
299
|
-
fontSize:
|
|
390
|
+
gap: "4px",
|
|
391
|
+
fontSize: "14px",
|
|
300
392
|
width: "100%",
|
|
301
|
-
maxWidth: "
|
|
393
|
+
maxWidth: "400px",
|
|
302
394
|
textAlign: "center",
|
|
395
|
+
color: theme.colors.textSecondary,
|
|
303
396
|
},
|
|
304
397
|
confirmationNote: {
|
|
305
|
-
marginTop:
|
|
306
|
-
fontSize:
|
|
307
|
-
color: theme.colors.
|
|
398
|
+
marginTop: "12px",
|
|
399
|
+
fontSize: "14px",
|
|
400
|
+
color: theme.colors.textSecondary,
|
|
401
|
+
lineHeight: "1.5",
|
|
308
402
|
},
|
|
309
403
|
actionContainer: {
|
|
310
|
-
marginTop:
|
|
404
|
+
marginTop: "32px",
|
|
405
|
+
display: "flex",
|
|
406
|
+
justifyContent: "center",
|
|
311
407
|
},
|
|
312
408
|
};
|
|
313
409
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { AppointmentState, AppointmentAction, } from "./appointment-booking/types";
|
|
1
|
+
export type { AppointmentState, AppointmentAction, Patient, SessionPack, AvailablePackage, BookingOptionType, } from "./appointment-booking/types";
|
|
2
2
|
export { INITIAL_STATE } from "./appointment-booking/types";
|
|
3
3
|
export type PhoneVerificationStepProps = {
|
|
4
4
|
state: any;
|
|
@@ -13,6 +13,7 @@ export type PatientDetailsStepProps = {
|
|
|
13
13
|
dispatch: React.Dispatch<any>;
|
|
14
14
|
onBack: () => void;
|
|
15
15
|
onSubmit: () => Promise<void>;
|
|
16
|
+
isFirstStep?: boolean;
|
|
16
17
|
};
|
|
17
18
|
export type SuccessStepProps = {
|
|
18
19
|
onReset: () => void;
|
|
@@ -50,3 +51,4 @@ export declare const BLOOD_GROUP_OPTIONS: {
|
|
|
50
51
|
value: string;
|
|
51
52
|
label: string;
|
|
52
53
|
}[];
|
|
54
|
+
export declare const mapBloodGroupToApi: (uiBloodGroup: string) => string;
|
package/dist/components/types.js
CHANGED
|
@@ -20,4 +20,19 @@ export const BLOOD_GROUP_OPTIONS = [
|
|
|
20
20
|
{ value: "AB-", label: "AB-" },
|
|
21
21
|
{ value: "O+", label: "O+" },
|
|
22
22
|
{ value: "O-", label: "O-" },
|
|
23
|
+
{ value: "UNKNOWN", label: "Unknown" },
|
|
23
24
|
];
|
|
25
|
+
export const mapBloodGroupToApi = (uiBloodGroup) => {
|
|
26
|
+
const bloodGroupMap = {
|
|
27
|
+
"A+": "A_POSITIVE",
|
|
28
|
+
"A-": "A_NEGATIVE",
|
|
29
|
+
"B+": "B_POSITIVE",
|
|
30
|
+
"B-": "B_NEGATIVE",
|
|
31
|
+
"AB+": "AB_POSITIVE",
|
|
32
|
+
"AB-": "AB_NEGATIVE",
|
|
33
|
+
"O+": "O_POSITIVE",
|
|
34
|
+
"O-": "O_NEGATIVE",
|
|
35
|
+
UNKNOWN: "UNKNOWN",
|
|
36
|
+
};
|
|
37
|
+
return bloodGroupMap[uiBloodGroup] || "UNKNOWN";
|
|
38
|
+
};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export declare const formatDateToISO: (date: Date) => string;
|
|
2
|
+
export declare const formatDate: (date: Date | string | null) => string;
|
|
3
|
+
export declare const formatTime: (timeStr: string | number) => string;
|
|
4
|
+
export declare const calculateDuration: (startTime?: string | number, endTime?: string | number, defaultDuration?: number) => number;
|
|
2
5
|
export declare const parsePatientName: (fullName: string) => {
|
|
3
6
|
firstName: string;
|
|
4
7
|
lastName: string;
|
package/dist/components/utils.js
CHANGED
|
@@ -4,6 +4,65 @@ export const formatDateToISO = (date) => {
|
|
|
4
4
|
const day = String(date.getDate()).padStart(2, "0");
|
|
5
5
|
return `${year}-${month}-${day}`;
|
|
6
6
|
};
|
|
7
|
+
export const formatDate = (date) => {
|
|
8
|
+
if (!date)
|
|
9
|
+
return "Not selected";
|
|
10
|
+
try {
|
|
11
|
+
const dateObj = typeof date === "string" ? new Date(date) : date;
|
|
12
|
+
return dateObj.toLocaleDateString("en-US", {
|
|
13
|
+
weekday: "long",
|
|
14
|
+
year: "numeric",
|
|
15
|
+
month: "long",
|
|
16
|
+
day: "numeric",
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return String(date);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
export const formatTime = (timeStr) => {
|
|
24
|
+
try {
|
|
25
|
+
if (typeof timeStr === "number" || !Number.isNaN(Number(timeStr))) {
|
|
26
|
+
const time = new Date(Number(timeStr));
|
|
27
|
+
return time.toLocaleTimeString("en-US", {
|
|
28
|
+
hour: "numeric",
|
|
29
|
+
minute: "2-digit",
|
|
30
|
+
hour12: true,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
if (timeStr.includes(":") && timeStr.length <= 5) {
|
|
34
|
+
const time = new Date(`2000-01-01T${timeStr}`);
|
|
35
|
+
return time.toLocaleTimeString("en-US", {
|
|
36
|
+
hour: "numeric",
|
|
37
|
+
minute: "2-digit",
|
|
38
|
+
hour12: true,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
const time = new Date(timeStr);
|
|
42
|
+
return time.toLocaleTimeString("en-US", {
|
|
43
|
+
hour: "numeric",
|
|
44
|
+
minute: "2-digit",
|
|
45
|
+
hour12: true,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return String(timeStr);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
export const calculateDuration = (startTime, endTime, defaultDuration = 60) => {
|
|
53
|
+
if (!startTime || !endTime)
|
|
54
|
+
return defaultDuration;
|
|
55
|
+
try {
|
|
56
|
+
const start = new Date(startTime);
|
|
57
|
+
const end = new Date(endTime);
|
|
58
|
+
const diffMs = end.getTime() - start.getTime();
|
|
59
|
+
const diffMinutes = Math.round(diffMs / (1000 * 60));
|
|
60
|
+
return diffMinutes > 0 ? diffMinutes : defaultDuration;
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
return defaultDuration;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
7
66
|
export const parsePatientName = (fullName) => {
|
|
8
67
|
const nameParts = fullName.trim().split(/\s+/);
|
|
9
68
|
const firstName = nameParts[0] || "Patient";
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export declare const validatePhoneNumber: (phone: string) => boolean;
|
|
2
2
|
export declare const validateCountryCode: (code: string) => boolean;
|
|
3
|
+
export declare const validateBloodGroup: (bloodGroup: string) => boolean;
|
|
4
|
+
export declare const validateDateOfBirth: (dob: string) => boolean;
|