medos-sdk 1.0.2 → 1.1.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.
- package/README.md +39 -0
- package/dist/client/MedosClient.d.ts +3 -5
- package/dist/client/MedosClient.js +4 -4
- package/dist/components/AppointmentCalender.d.ts +1 -4
- package/dist/components/AppointmentCalender.js +323 -530
- package/dist/components/AppointmentDateTimeModal.d.ts +14 -0
- package/dist/components/AppointmentDateTimeModal.js +220 -0
- package/dist/components/ConfigurableCard.d.ts +12 -0
- package/dist/components/ConfigurableCard.js +29 -0
- package/dist/components/ContactInformationStep.d.ts +13 -0
- package/dist/components/ContactInformationStep.js +14 -0
- package/dist/components/ContactPreferenceStep.d.ts +9 -0
- package/dist/components/ContactPreferenceStep.js +16 -0
- package/dist/components/DoctorSelectModal.d.ts +7 -0
- package/dist/components/DoctorSelectModal.js +93 -0
- package/dist/components/EnquiryForm.d.ts +7 -0
- package/dist/components/EnquiryForm.js +212 -0
- package/dist/components/Icons/Check.d.ts +6 -0
- package/dist/components/Icons/Check.js +2 -0
- package/dist/components/Icons/ChevronDownIcon.d.ts +4 -0
- package/dist/components/Icons/ChevronDownIcon.js +2 -0
- package/dist/components/Icons/ChevronLeft.d.ts +3 -0
- package/dist/components/Icons/ChevronLeft.js +3 -0
- package/dist/components/Icons/ChevronRight.d.ts +3 -0
- package/dist/components/Icons/ChevronRight.js +3 -0
- package/dist/components/Icons/ConfirmationCheck.d.ts +1 -0
- package/dist/components/Icons/ConfirmationCheck.js +9 -0
- package/dist/components/Icons/ConsultationType.d.ts +1 -0
- package/dist/components/Icons/ConsultationType.js +2 -0
- package/dist/components/Icons/Date&TimeIcon.d.ts +1 -0
- package/dist/components/Icons/Date&TimeIcon.js +2 -0
- package/dist/components/Icons/MapIcon.d.ts +1 -0
- package/dist/components/Icons/MapIcon.js +2 -0
- package/dist/components/Icons/PaymentMethodIcon.d.ts +1 -0
- package/dist/components/Icons/PaymentMethodIcon.js +2 -0
- package/dist/components/Icons/UserIcon.d.ts +1 -0
- package/dist/components/Icons/UserIcon.js +2 -0
- package/dist/components/InquiryDetailsStep.d.ts +10 -0
- package/dist/components/InquiryDetailsStep.js +15 -0
- package/dist/components/PatientDetailsStep.d.ts +3 -0
- package/dist/components/PatientDetailsStep.js +84 -0
- package/dist/components/PhoneVerificationStep.d.ts +3 -0
- package/dist/components/PhoneVerificationStep.js +49 -0
- package/dist/components/SuccessStep.d.ts +5 -0
- package/dist/components/SuccessStep.js +9 -0
- package/dist/components/custom-calendar.d.ts +5 -0
- package/dist/components/custom-calendar.js +171 -0
- package/dist/components/styles.d.ts +6 -0
- package/dist/components/styles.js +257 -0
- package/dist/components/theme-styles.d.ts +12 -0
- package/dist/components/theme-styles.js +319 -0
- package/dist/components/types.d.ts +181 -0
- package/dist/components/types.js +55 -0
- package/dist/components/ui/select.d.ts +10 -0
- package/dist/components/ui/select.js +21 -0
- package/dist/components/uiComponents/SelectDropdown.d.ts +41 -0
- package/dist/components/uiComponents/SelectDropdown.js +302 -0
- package/dist/components/utils.d.ts +5 -0
- package/dist/components/utils.js +15 -0
- package/dist/components/validation.d.ts +2 -0
- package/dist/components/validation.js +7 -0
- package/dist/context/TemplateContext.d.ts +12 -0
- package/dist/context/TemplateContext.js +19 -0
- package/dist/core/index.d.ts +4 -0
- package/dist/core/index.js +4 -0
- package/dist/core/theme/index.d.ts +3 -0
- package/dist/core/theme/index.js +3 -0
- package/dist/core/theme/themes.d.ts +8 -0
- package/dist/core/theme/themes.js +178 -0
- package/dist/core/theme/types.d.ts +106 -0
- package/dist/core/theme/types.js +1 -0
- package/dist/core/theme/utils.d.ts +8 -0
- package/dist/core/theme/utils.js +135 -0
- package/dist/enquiry-form/index.d.ts +4 -0
- package/dist/enquiry-form/index.js +4 -0
- package/dist/enquiry-form/provider.d.ts +3 -0
- package/dist/enquiry-form/provider.js +9 -0
- package/dist/enquiry-form/serialization.d.ts +4 -0
- package/dist/enquiry-form/serialization.js +57 -0
- package/dist/enquiry-form/types.d.ts +38 -0
- package/dist/enquiry-form/types.js +1 -0
- package/dist/enquiry-form/validation.d.ts +6 -0
- package/dist/enquiry-form/validation.js +21 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +7 -0
- package/dist/lib/templateUtils.d.ts +3 -0
- package/dist/lib/templateUtils.js +28 -0
- package/dist/react/ThemeProvider.d.ts +18 -0
- package/dist/react/ThemeProvider.js +45 -0
- package/dist/react/hooks/useTheme.d.ts +1 -0
- package/dist/react/hooks/useTheme.js +1 -0
- package/dist/react/index.d.ts +5 -0
- package/dist/react/index.js +3 -0
- package/dist/services/AppointmentService.d.ts +4 -5
- package/dist/services/AppointmentService.js +12 -10
- package/dist/services/EnquiryService.d.ts +5 -0
- package/dist/services/EnquiryService.js +30 -0
- package/dist/templates/registry.d.ts +12 -0
- package/dist/templates/registry.js +58 -0
- package/dist/vanilla/AppointmentCalendarWidget.d.ts +2 -34
- package/dist/vanilla/AppointmentCalendarWidget.js +264 -275
- package/dist/vanilla/EnquiryFormWidget.d.ts +35 -0
- package/dist/vanilla/EnquiryFormWidget.js +425 -0
- package/dist/vanilla/client/MedosClient.d.ts +3 -5
- package/dist/vanilla/components/AppointmentCalender.d.ts +1 -4
- package/dist/vanilla/components/AppointmentDateTimeModal.d.ts +14 -0
- package/dist/vanilla/components/ConfigurableCard.d.ts +12 -0
- package/dist/vanilla/components/ContactInformationStep.d.ts +13 -0
- package/dist/vanilla/components/ContactPreferenceStep.d.ts +9 -0
- package/dist/vanilla/components/DoctorSelectModal.d.ts +7 -0
- package/dist/vanilla/components/EnquiryForm.d.ts +7 -0
- package/dist/vanilla/components/Icons/Check.d.ts +6 -0
- package/dist/vanilla/components/Icons/ChevronDownIcon.d.ts +4 -0
- package/dist/vanilla/components/Icons/ChevronLeft.d.ts +3 -0
- package/dist/vanilla/components/Icons/ChevronRight.d.ts +3 -0
- package/dist/vanilla/components/Icons/ConfirmationCheck.d.ts +1 -0
- package/dist/vanilla/components/Icons/ConsultationType.d.ts +1 -0
- package/dist/vanilla/components/Icons/Date&TimeIcon.d.ts +1 -0
- package/dist/vanilla/components/Icons/MapIcon.d.ts +1 -0
- package/dist/vanilla/components/Icons/PaymentMethodIcon.d.ts +1 -0
- package/dist/vanilla/components/Icons/UserIcon.d.ts +1 -0
- package/dist/vanilla/components/InquiryDetailsStep.d.ts +10 -0
- package/dist/vanilla/components/PatientDetailsStep.d.ts +3 -0
- package/dist/vanilla/components/PhoneVerificationStep.d.ts +3 -0
- package/dist/vanilla/components/SuccessStep.d.ts +5 -0
- package/dist/vanilla/components/custom-calendar.d.ts +5 -0
- package/dist/vanilla/components/styles.d.ts +6 -0
- package/dist/vanilla/components/theme-styles.d.ts +12 -0
- package/dist/vanilla/components/types.d.ts +181 -0
- package/dist/vanilla/components/ui/select.d.ts +10 -0
- package/dist/vanilla/components/uiComponents/SelectDropdown.d.ts +41 -0
- package/dist/vanilla/components/utils.d.ts +5 -0
- package/dist/vanilla/components/validation.d.ts +2 -0
- package/dist/vanilla/context/TemplateContext.d.ts +12 -0
- package/dist/vanilla/core/index.d.ts +4 -0
- package/dist/vanilla/core/theme/index.d.ts +3 -0
- package/dist/vanilla/core/theme/themes.d.ts +8 -0
- package/dist/vanilla/core/theme/types.d.ts +106 -0
- package/dist/vanilla/core/theme/utils.d.ts +8 -0
- package/dist/vanilla/enquiry-form/index.d.ts +4 -0
- package/dist/vanilla/enquiry-form/provider.d.ts +3 -0
- package/dist/vanilla/enquiry-form/serialization.d.ts +4 -0
- package/dist/vanilla/enquiry-form/types.d.ts +38 -0
- package/dist/vanilla/enquiry-form/validation.d.ts +6 -0
- package/dist/vanilla/enquiry-widget.js +4650 -0
- package/dist/vanilla/index.d.ts +9 -0
- package/dist/vanilla/index.js +3 -1
- package/dist/vanilla/lib/templateUtils.d.ts +3 -0
- package/dist/vanilla/react/ThemeProvider.d.ts +18 -0
- package/dist/vanilla/react/hooks/useTheme.d.ts +1 -0
- package/dist/vanilla/react/index.d.ts +5 -0
- package/dist/vanilla/services/AppointmentService.d.ts +4 -5
- package/dist/vanilla/services/EnquiryService.d.ts +5 -0
- package/dist/vanilla/templates/alternative.css +13 -0
- package/dist/vanilla/templates/default.css +13 -0
- package/dist/vanilla/templates/registry.d.ts +12 -0
- package/dist/vanilla/theme-injector.d.ts +6 -0
- package/dist/vanilla/theme-injector.js +44 -0
- package/dist/vanilla/vanilla/AppointmentCalendarWidget.d.ts +2 -34
- package/dist/vanilla/vanilla/EnquiryFormWidget.d.ts +35 -0
- package/dist/vanilla/vanilla/index.d.ts +3 -1
- package/dist/vanilla/vanilla/theme-injector.d.ts +6 -0
- package/dist/vanilla/vanilla/widget.d.ts +6 -1
- package/dist/vanilla/widget.css +173 -0
- package/dist/vanilla/widget.d.ts +6 -1
- package/dist/vanilla/widget.js +813 -288
- package/package.json +9 -4
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
export function getContainerStyles(theme, prefix = "medos") {
|
|
2
|
+
return {
|
|
3
|
+
container: {
|
|
4
|
+
display: "flex",
|
|
5
|
+
justifyContent: "center",
|
|
6
|
+
padding: theme.spacing.xl,
|
|
7
|
+
fontFamily: theme.typography.fontFamily,
|
|
8
|
+
background: theme.colors.background,
|
|
9
|
+
},
|
|
10
|
+
card: {
|
|
11
|
+
width: "100%",
|
|
12
|
+
maxWidth: 720,
|
|
13
|
+
background: theme.colors.surface,
|
|
14
|
+
borderRadius: theme.radii.lg,
|
|
15
|
+
boxShadow: theme.shadows.lg,
|
|
16
|
+
padding: theme.spacing["2xl"],
|
|
17
|
+
boxSizing: "border-box",
|
|
18
|
+
},
|
|
19
|
+
header: {
|
|
20
|
+
display: "flex",
|
|
21
|
+
alignItems: "center",
|
|
22
|
+
justifyContent: "space-between",
|
|
23
|
+
marginBottom: theme.spacing.lg,
|
|
24
|
+
},
|
|
25
|
+
title: {
|
|
26
|
+
marginLeft: 10,
|
|
27
|
+
fontSize: theme.typography.fontSizeXl,
|
|
28
|
+
fontWeight: theme.typography.fontWeightSemibold,
|
|
29
|
+
color: theme.colors.text,
|
|
30
|
+
},
|
|
31
|
+
section: {
|
|
32
|
+
marginTop: theme.spacing.md,
|
|
33
|
+
},
|
|
34
|
+
errorMessage: {
|
|
35
|
+
marginBottom: theme.spacing.md,
|
|
36
|
+
color: theme.colors.error,
|
|
37
|
+
fontWeight: theme.typography.fontWeightSemibold,
|
|
38
|
+
},
|
|
39
|
+
actions: {
|
|
40
|
+
display: "flex",
|
|
41
|
+
gap: theme.spacing.sm,
|
|
42
|
+
marginTop: theme.spacing.lg,
|
|
43
|
+
justifyContent: "flex-end",
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export function getButtonStyles(theme, prefix = "medos") {
|
|
48
|
+
return {
|
|
49
|
+
primary: {
|
|
50
|
+
background: theme.colors.secondary,
|
|
51
|
+
color: theme.colors.textOnSecondary,
|
|
52
|
+
border: "none",
|
|
53
|
+
padding: `${theme.spacing.sm} ${theme.spacing.md}`,
|
|
54
|
+
borderRadius: theme.radii.md,
|
|
55
|
+
cursor: "pointer",
|
|
56
|
+
fontWeight: theme.typography.fontWeightSemibold,
|
|
57
|
+
fontSize: theme.typography.fontSizeSm,
|
|
58
|
+
transition: theme.transitions.normal,
|
|
59
|
+
},
|
|
60
|
+
primaryHover: {
|
|
61
|
+
background: theme.colors.secondaryHover,
|
|
62
|
+
},
|
|
63
|
+
secondary: {
|
|
64
|
+
background: theme.colors.surface,
|
|
65
|
+
color: theme.colors.primary,
|
|
66
|
+
border: `1px solid ${theme.colors.primary}`,
|
|
67
|
+
padding: `${theme.spacing.sm} ${theme.spacing.md}`,
|
|
68
|
+
borderRadius: theme.radii.md,
|
|
69
|
+
cursor: "pointer",
|
|
70
|
+
fontSize: theme.typography.fontSizeSm,
|
|
71
|
+
transition: theme.transitions.normal,
|
|
72
|
+
},
|
|
73
|
+
secondaryHover: {
|
|
74
|
+
background: theme.colors.surfaceHover,
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
export function getPhoneVerifyStyles(theme, prefix = "medos") {
|
|
79
|
+
return {
|
|
80
|
+
container: {
|
|
81
|
+
border: `1px solid ${theme.colors.border}`,
|
|
82
|
+
borderRadius: theme.radii.lg,
|
|
83
|
+
overflow: "hidden",
|
|
84
|
+
backgroundColor: theme.colors.surface,
|
|
85
|
+
},
|
|
86
|
+
header: {
|
|
87
|
+
padding: "20px 24px 10px 24px",
|
|
88
|
+
},
|
|
89
|
+
title: { fontSize: 20, fontWeight: 600, margin: 0 },
|
|
90
|
+
content: {
|
|
91
|
+
padding: theme.spacing["2xl"],
|
|
92
|
+
},
|
|
93
|
+
label: {
|
|
94
|
+
display: "block",
|
|
95
|
+
fontSize: theme.typography.fontSizeSm,
|
|
96
|
+
fontWeight: theme.typography.fontWeightMedium,
|
|
97
|
+
color: theme.colors.text,
|
|
98
|
+
marginBottom: theme.spacing.sm,
|
|
99
|
+
},
|
|
100
|
+
phoneInputContainer: {
|
|
101
|
+
display: "flex",
|
|
102
|
+
gap: theme.spacing.sm,
|
|
103
|
+
},
|
|
104
|
+
phoneInput: {
|
|
105
|
+
flex: 1,
|
|
106
|
+
width: "100%",
|
|
107
|
+
padding: `${theme.spacing.sm} ${theme.spacing.md}`,
|
|
108
|
+
borderRadius: theme.radii.md,
|
|
109
|
+
border: `1px solid ${theme.colors.border}`,
|
|
110
|
+
fontSize: theme.typography.fontSizeSm,
|
|
111
|
+
outline: "none",
|
|
112
|
+
color: theme.colors.text,
|
|
113
|
+
boxSizing: "border-box",
|
|
114
|
+
transition: theme.transitions.normal,
|
|
115
|
+
},
|
|
116
|
+
phoneInputFocus: {
|
|
117
|
+
borderColor: theme.colors.borderFocus,
|
|
118
|
+
outline: `2px solid ${theme.colors.borderFocus}20`,
|
|
119
|
+
},
|
|
120
|
+
phoneDisplay: {
|
|
121
|
+
padding: `${theme.spacing.sm} ${theme.spacing.md}`,
|
|
122
|
+
background: theme.colors.backgroundSecondary,
|
|
123
|
+
borderRadius: theme.radii.md,
|
|
124
|
+
fontSize: theme.typography.fontSizeSm,
|
|
125
|
+
color: theme.colors.textSecondary,
|
|
126
|
+
fontWeight: theme.typography.fontWeightMedium,
|
|
127
|
+
},
|
|
128
|
+
otpInput: {
|
|
129
|
+
width: "100%",
|
|
130
|
+
padding: `${theme.spacing.sm} ${theme.spacing.md}`,
|
|
131
|
+
border: `1px solid ${theme.colors.borderHover}`,
|
|
132
|
+
borderRadius: theme.radii.md,
|
|
133
|
+
fontSize: theme.typography.fontSizeSm,
|
|
134
|
+
outline: "none",
|
|
135
|
+
color: theme.colors.text,
|
|
136
|
+
boxSizing: "border-box",
|
|
137
|
+
transition: theme.transitions.normal,
|
|
138
|
+
},
|
|
139
|
+
otpInputFocus: {
|
|
140
|
+
borderColor: theme.colors.borderFocus,
|
|
141
|
+
outline: `2px solid ${theme.colors.borderFocus}20`,
|
|
142
|
+
},
|
|
143
|
+
otpHint: {
|
|
144
|
+
marginTop: theme.spacing.sm,
|
|
145
|
+
fontSize: theme.typography.fontSizeXs,
|
|
146
|
+
color: theme.colors.textTertiary,
|
|
147
|
+
},
|
|
148
|
+
successMessage: {
|
|
149
|
+
marginTop: theme.spacing.xl,
|
|
150
|
+
padding: theme.spacing.lg,
|
|
151
|
+
borderRadius: theme.radii.md,
|
|
152
|
+
backgroundColor: theme.colors.successBackground,
|
|
153
|
+
border: `1px solid ${theme.colors.success}`,
|
|
154
|
+
display: "flex",
|
|
155
|
+
alignItems: "center",
|
|
156
|
+
gap: theme.spacing.md,
|
|
157
|
+
},
|
|
158
|
+
successIcon: {
|
|
159
|
+
fontSize: theme.typography.fontSize2xl,
|
|
160
|
+
color: theme.colors.success,
|
|
161
|
+
},
|
|
162
|
+
successTitle: {
|
|
163
|
+
fontSize: theme.typography.fontSizeSm,
|
|
164
|
+
fontWeight: theme.typography.fontWeightSemibold,
|
|
165
|
+
color: theme.colors.success,
|
|
166
|
+
},
|
|
167
|
+
successSubtitle: {
|
|
168
|
+
fontSize: theme.typography.fontSizeXs,
|
|
169
|
+
color: theme.colors.textTertiary,
|
|
170
|
+
marginTop: 2,
|
|
171
|
+
},
|
|
172
|
+
footer: {
|
|
173
|
+
padding: `${theme.spacing.lg} ${theme.spacing["2xl"]}`,
|
|
174
|
+
borderTop: `1px solid ${theme.colors.border}`,
|
|
175
|
+
backgroundColor: theme.colors.surface,
|
|
176
|
+
display: "flex",
|
|
177
|
+
gap: theme.spacing.md,
|
|
178
|
+
justifyContent: "flex-end",
|
|
179
|
+
},
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
export function getPatientDetailsStyles(theme, prefix = "medos") {
|
|
183
|
+
return {
|
|
184
|
+
sectionCard: {
|
|
185
|
+
border: `1px solid ${theme.colors.border}`,
|
|
186
|
+
borderRadius: theme.radii.lg,
|
|
187
|
+
marginBottom: theme.spacing["2xl"],
|
|
188
|
+
},
|
|
189
|
+
sectionHeader: {
|
|
190
|
+
backgroundColor: theme.colors.primary,
|
|
191
|
+
padding: `${theme.spacing.lg} ${theme.spacing.xl}`,
|
|
192
|
+
display: "flex",
|
|
193
|
+
alignItems: "center",
|
|
194
|
+
gap: theme.spacing.md,
|
|
195
|
+
borderBottom: `1px solid ${theme.colors.border}`,
|
|
196
|
+
color: theme.colors.textOnPrimary,
|
|
197
|
+
},
|
|
198
|
+
sectionTitle: {
|
|
199
|
+
fontSize: theme.typography.fontSizeLg,
|
|
200
|
+
fontWeight: theme.typography.fontWeightSemibold,
|
|
201
|
+
margin: 0,
|
|
202
|
+
color: theme.colors.textOnPrimary,
|
|
203
|
+
},
|
|
204
|
+
sectionBody: {
|
|
205
|
+
padding: theme.spacing["2xl"],
|
|
206
|
+
},
|
|
207
|
+
gridRow: {
|
|
208
|
+
display: "grid",
|
|
209
|
+
gridTemplateColumns: "1fr 1fr",
|
|
210
|
+
gap: theme.spacing.xl,
|
|
211
|
+
marginTop: theme.spacing.xl,
|
|
212
|
+
},
|
|
213
|
+
label: {
|
|
214
|
+
display: "block",
|
|
215
|
+
fontSize: theme.typography.fontSizeXs,
|
|
216
|
+
marginBottom: theme.spacing.xs,
|
|
217
|
+
color: theme.colors.textSecondary,
|
|
218
|
+
fontWeight: theme.typography.fontWeightMedium,
|
|
219
|
+
},
|
|
220
|
+
input: {
|
|
221
|
+
width: "100%",
|
|
222
|
+
padding: `${theme.spacing.sm} ${theme.spacing.md}`,
|
|
223
|
+
borderRadius: theme.radii.md,
|
|
224
|
+
border: `1px solid ${theme.colors.border}`,
|
|
225
|
+
outline: "none",
|
|
226
|
+
fontSize: theme.typography.fontSizeSm,
|
|
227
|
+
boxSizing: "border-box",
|
|
228
|
+
color: theme.colors.text,
|
|
229
|
+
transition: theme.transitions.normal,
|
|
230
|
+
},
|
|
231
|
+
inputFocus: {
|
|
232
|
+
borderColor: theme.colors.borderFocus,
|
|
233
|
+
outline: `2px solid ${theme.colors.borderFocus}20`,
|
|
234
|
+
},
|
|
235
|
+
phoneDisplay: {
|
|
236
|
+
display: "flex",
|
|
237
|
+
gap: theme.spacing.sm,
|
|
238
|
+
},
|
|
239
|
+
phoneCode: {
|
|
240
|
+
width: "100px",
|
|
241
|
+
padding: `${theme.spacing.sm} ${theme.spacing.md}`,
|
|
242
|
+
borderRadius: theme.radii.md,
|
|
243
|
+
border: `1px solid ${theme.colors.border}`,
|
|
244
|
+
backgroundColor: theme.colors.backgroundSecondary,
|
|
245
|
+
fontSize: theme.typography.fontSizeSm,
|
|
246
|
+
boxSizing: "border-box",
|
|
247
|
+
color: theme.colors.textSecondary,
|
|
248
|
+
},
|
|
249
|
+
phoneNumber: {
|
|
250
|
+
flex: 1,
|
|
251
|
+
padding: `${theme.spacing.sm} ${theme.spacing.md}`,
|
|
252
|
+
borderRadius: theme.radii.md,
|
|
253
|
+
border: `1px solid ${theme.colors.border}`,
|
|
254
|
+
backgroundColor: theme.colors.backgroundSecondary,
|
|
255
|
+
fontSize: theme.typography.fontSizeSm,
|
|
256
|
+
boxSizing: "border-box",
|
|
257
|
+
color: theme.colors.textSecondary,
|
|
258
|
+
},
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
export function getSuccessStyles(theme, prefix = "medos") {
|
|
262
|
+
return {
|
|
263
|
+
container: {
|
|
264
|
+
display: "flex",
|
|
265
|
+
flexDirection: "column",
|
|
266
|
+
height: "100%",
|
|
267
|
+
},
|
|
268
|
+
header: {
|
|
269
|
+
marginTop: `-${theme.spacing.lg}`,
|
|
270
|
+
alignItems: "center",
|
|
271
|
+
textAlign: "center",
|
|
272
|
+
color: theme.colors.success,
|
|
273
|
+
fontWeight: theme.typography.fontWeightBold,
|
|
274
|
+
fontSize: theme.typography.fontSizeLg,
|
|
275
|
+
marginBottom: theme.spacing.xl,
|
|
276
|
+
},
|
|
277
|
+
iconContainer: {
|
|
278
|
+
display: "flex",
|
|
279
|
+
alignItems: "center",
|
|
280
|
+
justifyContent: "center",
|
|
281
|
+
padding: `${theme.spacing.md} 0`,
|
|
282
|
+
},
|
|
283
|
+
detailsContainer: {
|
|
284
|
+
display: "flex",
|
|
285
|
+
flexDirection: "column",
|
|
286
|
+
alignItems: "center",
|
|
287
|
+
gap: theme.spacing.md,
|
|
288
|
+
textAlign: "center",
|
|
289
|
+
color: theme.colors.success,
|
|
290
|
+
},
|
|
291
|
+
detailsTitle: {
|
|
292
|
+
fontWeight: theme.typography.fontWeightSemibold,
|
|
293
|
+
fontSize: theme.typography.fontSizeMd,
|
|
294
|
+
},
|
|
295
|
+
detailsList: {
|
|
296
|
+
display: "flex",
|
|
297
|
+
flexDirection: "column",
|
|
298
|
+
gap: theme.spacing.xs,
|
|
299
|
+
fontSize: theme.typography.fontSizeSm,
|
|
300
|
+
width: "100%",
|
|
301
|
+
maxWidth: "28rem",
|
|
302
|
+
textAlign: "center",
|
|
303
|
+
},
|
|
304
|
+
confirmationNote: {
|
|
305
|
+
marginTop: theme.spacing.sm,
|
|
306
|
+
fontSize: theme.typography.fontSizeXs,
|
|
307
|
+
color: theme.colors.textTertiary,
|
|
308
|
+
},
|
|
309
|
+
actionContainer: {
|
|
310
|
+
marginTop: theme.spacing["2xl"],
|
|
311
|
+
},
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
import { defaultTheme } from "../core/theme/themes";
|
|
315
|
+
export const CONTAINER_STYLES = getContainerStyles(defaultTheme);
|
|
316
|
+
export const BUTTON_STYLES = getButtonStyles(defaultTheme);
|
|
317
|
+
export const PHONE_VERIFY_STYLES = getPhoneVerifyStyles(defaultTheme);
|
|
318
|
+
export const PATIENT_DETAILS_STYLES = getPatientDetailsStyles(defaultTheme);
|
|
319
|
+
export const SUCCESS_STYLES = getSuccessStyles(defaultTheme);
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { Doctor, Slot, AddressItem } from "../services/AppointmentService";
|
|
2
|
+
export type AppointmentCalenderProps = {
|
|
3
|
+
onError?: (err: Error) => void;
|
|
4
|
+
};
|
|
5
|
+
export type PhoneVerificationStepProps = {
|
|
6
|
+
state: AppointmentState;
|
|
7
|
+
dispatch: React.Dispatch<AppointmentAction>;
|
|
8
|
+
onSendOtp: () => Promise<void>;
|
|
9
|
+
onVerifyOtp: () => Promise<void>;
|
|
10
|
+
onBack: () => void;
|
|
11
|
+
onContinue: () => void;
|
|
12
|
+
};
|
|
13
|
+
export type PatientDetailsStepProps = {
|
|
14
|
+
state: AppointmentState;
|
|
15
|
+
dispatch: React.Dispatch<AppointmentAction>;
|
|
16
|
+
onBack: () => void;
|
|
17
|
+
onSubmit: () => Promise<void>;
|
|
18
|
+
};
|
|
19
|
+
export type SuccessStepProps = {
|
|
20
|
+
onReset: () => void;
|
|
21
|
+
};
|
|
22
|
+
export type PhoneInputSectionProps = {
|
|
23
|
+
countryCode: string;
|
|
24
|
+
patientPhone: string;
|
|
25
|
+
onCountryCodeChange: (code: string) => void;
|
|
26
|
+
onPhoneChange: (phone: string) => void;
|
|
27
|
+
};
|
|
28
|
+
export type OtpInputSectionProps = {
|
|
29
|
+
countryCode: string;
|
|
30
|
+
patientPhone: string;
|
|
31
|
+
otpCode: string;
|
|
32
|
+
otpVerified: boolean;
|
|
33
|
+
onOtpChange: (code: string) => void;
|
|
34
|
+
};
|
|
35
|
+
export type PatientInfoSectionProps = {
|
|
36
|
+
state: AppointmentState;
|
|
37
|
+
dispatch: React.Dispatch<AppointmentAction>;
|
|
38
|
+
};
|
|
39
|
+
export type AddressInfoSectionProps = {
|
|
40
|
+
state: AppointmentState;
|
|
41
|
+
dispatch: React.Dispatch<AppointmentAction>;
|
|
42
|
+
};
|
|
43
|
+
export interface AppointmentState {
|
|
44
|
+
step: number;
|
|
45
|
+
loading: boolean;
|
|
46
|
+
error: string | null;
|
|
47
|
+
workspaceId: number | null;
|
|
48
|
+
addresses: AddressItem[];
|
|
49
|
+
addressDoctorsMap: Record<number, Doctor[]>;
|
|
50
|
+
selectedAddress: number | null;
|
|
51
|
+
selectedDoctor: number | null;
|
|
52
|
+
selectedDate: Date;
|
|
53
|
+
slots: Slot[];
|
|
54
|
+
selectedSlot: Slot | null;
|
|
55
|
+
consultationMode: "ONLINE" | "OFFLINE";
|
|
56
|
+
consultationCharge: string;
|
|
57
|
+
patientName: string;
|
|
58
|
+
patientAge: string;
|
|
59
|
+
patientEmail: string;
|
|
60
|
+
patientGender: string;
|
|
61
|
+
bloodGroup: string;
|
|
62
|
+
patientAddress: string;
|
|
63
|
+
patientCity: string;
|
|
64
|
+
patientState: string;
|
|
65
|
+
patientCountry: string;
|
|
66
|
+
patientZipcode: string;
|
|
67
|
+
patientLandmark: string;
|
|
68
|
+
countryCode: string;
|
|
69
|
+
patientPhone: string;
|
|
70
|
+
otpCode: string;
|
|
71
|
+
otpSent: boolean;
|
|
72
|
+
otpVerified: boolean;
|
|
73
|
+
otpSending: boolean;
|
|
74
|
+
otpVerifying: boolean;
|
|
75
|
+
}
|
|
76
|
+
export type AppointmentAction = {
|
|
77
|
+
type: "SET_STEP";
|
|
78
|
+
payload: number;
|
|
79
|
+
} | {
|
|
80
|
+
type: "SET_LOADING";
|
|
81
|
+
payload: boolean;
|
|
82
|
+
} | {
|
|
83
|
+
type: "SET_ERROR";
|
|
84
|
+
payload: string | null;
|
|
85
|
+
} | {
|
|
86
|
+
type: "SET_WORKSPACE";
|
|
87
|
+
payload: {
|
|
88
|
+
id: number;
|
|
89
|
+
addresses: AddressItem[];
|
|
90
|
+
};
|
|
91
|
+
} | {
|
|
92
|
+
type: "SET_SELECTED_ADDRESS";
|
|
93
|
+
payload: number | null;
|
|
94
|
+
} | {
|
|
95
|
+
type: "SET_SELECTED_DOCTOR";
|
|
96
|
+
payload: number | null;
|
|
97
|
+
} | {
|
|
98
|
+
type: "SET_SELECTED_DATE";
|
|
99
|
+
payload: Date;
|
|
100
|
+
} | {
|
|
101
|
+
type: "SET_SLOTS";
|
|
102
|
+
payload: Slot[];
|
|
103
|
+
} | {
|
|
104
|
+
type: "SET_SELECTED_SLOT";
|
|
105
|
+
payload: Slot | null;
|
|
106
|
+
} | {
|
|
107
|
+
type: "SET_CONSULTATION_MODE";
|
|
108
|
+
payload: "ONLINE" | "OFFLINE";
|
|
109
|
+
} | {
|
|
110
|
+
type: "SET_CONSULTATION_CHARGE";
|
|
111
|
+
payload: string;
|
|
112
|
+
} | {
|
|
113
|
+
type: "SET_PATIENT_NAME";
|
|
114
|
+
payload: string;
|
|
115
|
+
} | {
|
|
116
|
+
type: "SET_PATIENT_AGE";
|
|
117
|
+
payload: string;
|
|
118
|
+
} | {
|
|
119
|
+
type: "SET_PATIENT_EMAIL";
|
|
120
|
+
payload: string;
|
|
121
|
+
} | {
|
|
122
|
+
type: "SET_PATIENT_GENDER";
|
|
123
|
+
payload: string;
|
|
124
|
+
} | {
|
|
125
|
+
type: "SET_BLOOD_GROUP";
|
|
126
|
+
payload: string;
|
|
127
|
+
} | {
|
|
128
|
+
type: "SET_PATIENT_ADDRESS";
|
|
129
|
+
payload: string;
|
|
130
|
+
} | {
|
|
131
|
+
type: "SET_PATIENT_CITY";
|
|
132
|
+
payload: string;
|
|
133
|
+
} | {
|
|
134
|
+
type: "SET_PATIENT_STATE";
|
|
135
|
+
payload: string;
|
|
136
|
+
} | {
|
|
137
|
+
type: "SET_PATIENT_COUNTRY";
|
|
138
|
+
payload: string;
|
|
139
|
+
} | {
|
|
140
|
+
type: "SET_PATIENT_ZIPCODE";
|
|
141
|
+
payload: string;
|
|
142
|
+
} | {
|
|
143
|
+
type: "SET_PATIENT_LANDMARK";
|
|
144
|
+
payload: string;
|
|
145
|
+
} | {
|
|
146
|
+
type: "SET_COUNTRY_CODE";
|
|
147
|
+
payload: string;
|
|
148
|
+
} | {
|
|
149
|
+
type: "SET_PATIENT_PHONE";
|
|
150
|
+
payload: string;
|
|
151
|
+
} | {
|
|
152
|
+
type: "SET_OTP_CODE";
|
|
153
|
+
payload: string;
|
|
154
|
+
} | {
|
|
155
|
+
type: "SET_OTP_SENT";
|
|
156
|
+
payload: boolean;
|
|
157
|
+
} | {
|
|
158
|
+
type: "SET_OTP_VERIFIED";
|
|
159
|
+
payload: boolean;
|
|
160
|
+
} | {
|
|
161
|
+
type: "SET_OTP_SENDING";
|
|
162
|
+
payload: boolean;
|
|
163
|
+
} | {
|
|
164
|
+
type: "SET_OTP_VERIFYING";
|
|
165
|
+
payload: boolean;
|
|
166
|
+
} | {
|
|
167
|
+
type: "RESET_FORM";
|
|
168
|
+
};
|
|
169
|
+
export declare const COUNTRY_CODES: {
|
|
170
|
+
code: string;
|
|
171
|
+
label: string;
|
|
172
|
+
}[];
|
|
173
|
+
export declare const GENDER_OPTIONS: {
|
|
174
|
+
value: string;
|
|
175
|
+
label: string;
|
|
176
|
+
}[];
|
|
177
|
+
export declare const BLOOD_GROUP_OPTIONS: {
|
|
178
|
+
value: string;
|
|
179
|
+
label: string;
|
|
180
|
+
}[];
|
|
181
|
+
export declare const INITIAL_STATE: AppointmentState;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export const COUNTRY_CODES = [
|
|
2
|
+
{ code: "+91", label: "🇮🇳 +91" },
|
|
3
|
+
{ code: "+1", label: "🇺🇸 +1" },
|
|
4
|
+
{ code: "+44", label: "🇬🇧 +44" },
|
|
5
|
+
{ code: "+86", label: "🇨🇳 +86" },
|
|
6
|
+
{ code: "+81", label: "🇯🇵 +81" },
|
|
7
|
+
];
|
|
8
|
+
export const GENDER_OPTIONS = [
|
|
9
|
+
{ value: "MALE", label: "Male" },
|
|
10
|
+
{ value: "FEMALE", label: "Female" },
|
|
11
|
+
{ value: "OTHER", label: "Other" },
|
|
12
|
+
];
|
|
13
|
+
export const BLOOD_GROUP_OPTIONS = [
|
|
14
|
+
{ value: "A+", label: "A+" },
|
|
15
|
+
{ value: "A-", label: "A-" },
|
|
16
|
+
{ value: "B+", label: "B+" },
|
|
17
|
+
{ value: "B-", label: "B-" },
|
|
18
|
+
{ value: "AB+", label: "AB+" },
|
|
19
|
+
{ value: "AB-", label: "AB-" },
|
|
20
|
+
{ value: "O+", label: "O+" },
|
|
21
|
+
{ value: "O-", label: "O-" },
|
|
22
|
+
];
|
|
23
|
+
export const INITIAL_STATE = {
|
|
24
|
+
step: 0,
|
|
25
|
+
loading: false,
|
|
26
|
+
error: null,
|
|
27
|
+
workspaceId: null,
|
|
28
|
+
addresses: [],
|
|
29
|
+
addressDoctorsMap: {},
|
|
30
|
+
selectedAddress: null,
|
|
31
|
+
selectedDoctor: null,
|
|
32
|
+
selectedDate: new Date(),
|
|
33
|
+
slots: [],
|
|
34
|
+
selectedSlot: null,
|
|
35
|
+
consultationMode: "OFFLINE",
|
|
36
|
+
consultationCharge: "",
|
|
37
|
+
patientName: "",
|
|
38
|
+
patientAge: "",
|
|
39
|
+
patientEmail: "",
|
|
40
|
+
patientGender: "",
|
|
41
|
+
bloodGroup: "",
|
|
42
|
+
patientAddress: "",
|
|
43
|
+
patientCity: "",
|
|
44
|
+
patientState: "",
|
|
45
|
+
patientCountry: "",
|
|
46
|
+
patientZipcode: "",
|
|
47
|
+
patientLandmark: "",
|
|
48
|
+
countryCode: "+91",
|
|
49
|
+
patientPhone: "",
|
|
50
|
+
otpCode: "",
|
|
51
|
+
otpSent: false,
|
|
52
|
+
otpVerified: false,
|
|
53
|
+
otpSending: false,
|
|
54
|
+
otpVerifying: false,
|
|
55
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface SelectProps extends React.SelectHTMLAttributes<HTMLSelectElement> {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
}
|
|
5
|
+
declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLSelectElement>>;
|
|
6
|
+
export interface SelectOptionProps extends React.OptionHTMLAttributes<HTMLOptionElement> {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
declare const SelectOption: React.ForwardRefExoticComponent<SelectOptionProps & React.RefAttributes<HTMLOptionElement>>;
|
|
10
|
+
export { Select, SelectOption };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
const Select = React.forwardRef(({ className, children, ...props }, ref) => {
|
|
4
|
+
return (_jsx("select", { ref: ref, className: className, style: {
|
|
5
|
+
width: "100%",
|
|
6
|
+
padding: "8px 12px",
|
|
7
|
+
borderRadius: "6px",
|
|
8
|
+
border: "1px solid var(--medos-border-color, #e6e9ef)",
|
|
9
|
+
fontSize: "14px",
|
|
10
|
+
cursor: "pointer",
|
|
11
|
+
backgroundColor: "#fff",
|
|
12
|
+
fontFamily: "inherit",
|
|
13
|
+
...props.style,
|
|
14
|
+
}, ...props, children: children }));
|
|
15
|
+
});
|
|
16
|
+
Select.displayName = "Select";
|
|
17
|
+
const SelectOption = React.forwardRef(({ className, children, ...props }, ref) => {
|
|
18
|
+
return (_jsx("option", { ref: ref, className: className, ...props, children: children }));
|
|
19
|
+
});
|
|
20
|
+
SelectOption.displayName = "SelectOption";
|
|
21
|
+
export { Select, SelectOption };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface SelectProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
value?: string;
|
|
5
|
+
onValueChange?: (value: string) => void;
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface SelectTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
error?: boolean;
|
|
13
|
+
}
|
|
14
|
+
interface SelectValueProps {
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
}
|
|
17
|
+
interface SelectContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
interface SelectItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
22
|
+
children: React.ReactNode;
|
|
23
|
+
value: string;
|
|
24
|
+
className?: string;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
}
|
|
27
|
+
interface BaseComponentProps {
|
|
28
|
+
children: React.ReactNode;
|
|
29
|
+
className?: string;
|
|
30
|
+
}
|
|
31
|
+
declare const Select: React.FC<SelectProps>;
|
|
32
|
+
declare const SelectTrigger: React.ForwardRefExoticComponent<SelectTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
33
|
+
declare const SelectValue: React.FC<SelectValueProps>;
|
|
34
|
+
declare const SelectContent: React.ForwardRefExoticComponent<SelectContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
35
|
+
declare const SelectItem: React.ForwardRefExoticComponent<SelectItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
36
|
+
declare const SelectGroup: React.FC<BaseComponentProps>;
|
|
37
|
+
declare const SelectLabel: React.FC<BaseComponentProps>;
|
|
38
|
+
declare const SelectSeparator: React.FC<{
|
|
39
|
+
className?: string;
|
|
40
|
+
}>;
|
|
41
|
+
export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, };
|