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.
Files changed (97) hide show
  1. package/dist/client/MedosClient.d.ts +1 -0
  2. package/dist/client/MedosClient.js +7 -0
  3. package/dist/components/AppointmentCalender.js +19 -22
  4. package/dist/components/AppointmentConfirmationStep.d.ts +1 -0
  5. package/dist/components/AppointmentConfirmationStep.js +34 -42
  6. package/dist/components/AppointmentDateTimeModal.d.ts +1 -0
  7. package/dist/components/AppointmentDateTimeModal.js +201 -168
  8. package/dist/components/AppointmentSummaryStep.d.ts +12 -0
  9. package/dist/components/AppointmentSummaryStep.js +168 -0
  10. package/dist/components/BookingOptionStep.d.ts +14 -0
  11. package/dist/components/BookingOptionStep.js +346 -0
  12. package/dist/components/ContactInformationStep.js +10 -4
  13. package/dist/components/ContactPreferenceStep.js +10 -1
  14. package/dist/components/DoctorSelectModal.js +105 -59
  15. package/dist/components/EnquiryForm.js +81 -69
  16. package/dist/components/Icons/CloseIcon.d.ts +9 -0
  17. package/dist/components/Icons/CloseIcon.js +5 -0
  18. package/dist/components/InquiryDetailsStep.js +5 -1
  19. package/dist/components/PatientDetailsStep.js +17 -12
  20. package/dist/components/PatientSelectionStep.d.ts +12 -0
  21. package/dist/components/PatientSelectionStep.js +254 -0
  22. package/dist/components/PhoneVerificationStep.js +1 -1
  23. package/dist/components/SuccessStep.js +1 -1
  24. package/dist/components/appointment-booking/AppointmentCalender.js +200 -60
  25. package/dist/components/appointment-booking/hooks/useAppointmentFlow.d.ts +0 -1
  26. package/dist/components/appointment-booking/hooks/useAppointmentFlow.js +110 -25
  27. package/dist/components/appointment-booking/hooks/useAppointmentState.js +32 -0
  28. package/dist/components/appointment-booking/hooks/useInitializeAddresses.js +0 -1
  29. package/dist/components/appointment-booking/types.d.ts +163 -0
  30. package/dist/components/appointment-booking/types.js +16 -0
  31. package/dist/components/appointment-modal-styles.d.ts +259 -0
  32. package/dist/components/appointment-modal-styles.js +395 -0
  33. package/dist/components/constant.d.ts +2 -0
  34. package/dist/components/constant.js +15 -0
  35. package/dist/components/custom-calendar.js +20 -11
  36. package/dist/components/styles.js +93 -52
  37. package/dist/components/theme-styles.d.ts +5 -4
  38. package/dist/components/theme-styles.js +221 -125
  39. package/dist/components/types.d.ts +3 -1
  40. package/dist/components/types.js +15 -0
  41. package/dist/components/utils.d.ts +3 -0
  42. package/dist/components/utils.js +59 -0
  43. package/dist/components/validation.d.ts +2 -0
  44. package/dist/components/validation.js +41 -0
  45. package/dist/core/theme/index.d.ts +1 -0
  46. package/dist/core/theme/index.js +1 -0
  47. package/dist/core/theme/responsive.d.ts +15 -0
  48. package/dist/core/theme/responsive.js +113 -0
  49. package/dist/core/theme/themes.js +16 -4
  50. package/dist/core/theme/types.d.ts +8 -0
  51. package/dist/index.d.ts +2 -0
  52. package/dist/index.js +1 -0
  53. package/dist/react/ThemeProvider.d.ts +2 -1
  54. package/dist/react/ThemeProvider.js +49 -10
  55. package/dist/services/AppointmentService.d.ts +80 -2
  56. package/dist/services/AppointmentService.js +114 -5
  57. package/dist/services/WorkspaceService.d.ts +58 -3
  58. package/dist/services/WorkspaceService.js +10 -1
  59. package/dist/vanilla/AppointmentCalendarWidget.d.ts +9 -7
  60. package/dist/vanilla/AppointmentCalendarWidget.js +820 -377
  61. package/dist/vanilla/EnquiryFormWidget.d.ts +1 -0
  62. package/dist/vanilla/EnquiryFormWidget.js +25 -43
  63. package/dist/vanilla/client/MedosClient.d.ts +1 -0
  64. package/dist/vanilla/components/AppointmentConfirmationStep.d.ts +1 -0
  65. package/dist/vanilla/components/AppointmentDateTimeModal.d.ts +1 -0
  66. package/dist/vanilla/components/AppointmentSummaryStep.d.ts +12 -0
  67. package/dist/vanilla/components/BookingOptionStep.d.ts +14 -0
  68. package/dist/vanilla/components/Icons/CloseIcon.d.ts +9 -0
  69. package/dist/vanilla/components/PatientSelectionStep.d.ts +12 -0
  70. package/dist/vanilla/components/VanillaCalendar.js +33 -18
  71. package/dist/vanilla/components/VanillaIcons.d.ts +5 -0
  72. package/dist/vanilla/components/VanillaIcons.js +92 -0
  73. package/dist/vanilla/components/VanillaSelect.d.ts +3 -0
  74. package/dist/vanilla/components/VanillaSelect.js +93 -5
  75. package/dist/vanilla/components/appointment-booking/hooks/useAppointmentFlow.d.ts +0 -1
  76. package/dist/vanilla/components/appointment-booking/types.d.ts +163 -0
  77. package/dist/vanilla/components/appointment-modal-styles.d.ts +259 -0
  78. package/dist/vanilla/components/constant.d.ts +2 -0
  79. package/dist/vanilla/components/theme-styles.d.ts +5 -4
  80. package/dist/vanilla/components/types.d.ts +3 -1
  81. package/dist/vanilla/components/utils.d.ts +3 -0
  82. package/dist/vanilla/components/validation.d.ts +2 -0
  83. package/dist/vanilla/core/theme/index.d.ts +1 -0
  84. package/dist/vanilla/core/theme/responsive.d.ts +15 -0
  85. package/dist/vanilla/core/theme/types.d.ts +8 -0
  86. package/dist/vanilla/enquiry-widget.js +373 -52
  87. package/dist/vanilla/index.d.ts +2 -0
  88. package/dist/vanilla/react/ThemeProvider.d.ts +2 -1
  89. package/dist/vanilla/services/AppointmentService.d.ts +80 -2
  90. package/dist/vanilla/services/WorkspaceService.d.ts +58 -3
  91. package/dist/vanilla/vanilla/AppointmentCalendarWidget.d.ts +9 -7
  92. package/dist/vanilla/vanilla/EnquiryFormWidget.d.ts +1 -0
  93. package/dist/vanilla/vanilla/components/VanillaIcons.d.ts +5 -0
  94. package/dist/vanilla/vanilla/components/VanillaSelect.d.ts +3 -0
  95. package/dist/vanilla/widget.css +833 -207
  96. package/dist/vanilla/widget.js +6444 -5676
  97. 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: theme.spacing.xl,
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: theme.radii.lg,
15
- boxShadow: theme.shadows.lg,
16
- padding: theme.spacing["2xl"],
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: theme.spacing.lg,
25
+ marginBottom: "20px",
26
+ flexWrap: isMobile ? "wrap" : "nowrap",
24
27
  },
25
28
  title: {
26
- marginLeft: 10,
27
- fontSize: theme.typography.fontSizeXl,
28
- fontWeight: theme.typography.fontWeightSemibold,
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: theme.spacing.md,
36
+ marginTop: "16px",
33
37
  },
34
38
  errorMessage: {
35
- marginBottom: theme.spacing.md,
39
+ marginBottom: "16px",
40
+ padding: "12px 16px",
41
+ borderRadius: "8px",
42
+ backgroundColor: theme.colors.errorBackground,
36
43
  color: theme.colors.error,
37
- fontWeight: theme.typography.fontWeightSemibold,
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: theme.spacing.sm,
42
- marginTop: theme.spacing.lg,
43
- justifyContent: "flex-end",
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: `${theme.spacing.sm} ${theme.spacing.md}`,
54
- borderRadius: theme.radii.md,
69
+ padding: basePadding,
70
+ borderRadius,
55
71
  cursor: "pointer",
56
- fontWeight: theme.typography.fontWeightSemibold,
57
- fontSize: theme.typography.fontSizeSm,
58
- transition: theme.transitions.normal,
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.primary}`,
67
- padding: `${theme.spacing.sm} ${theme.spacing.md}`,
68
- borderRadius: theme.radii.md,
91
+ border: `1px solid ${theme.colors.border}`,
92
+ padding: basePadding,
93
+ borderRadius,
69
94
  cursor: "pointer",
70
- fontSize: theme.typography.fontSizeSm,
71
- transition: theme.transitions.normal,
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: `1px solid ${theme.colors.border}`,
82
- borderRadius: theme.radii.lg,
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 24px 10px 24px",
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: theme.spacing["2xl"],
168
+ padding: isMobile ? "20px" : "24px",
92
169
  },
93
170
  label: {
94
171
  display: "block",
95
- fontSize: theme.typography.fontSizeSm,
96
- fontWeight: theme.typography.fontWeightMedium,
172
+ fontSize: "14px",
173
+ fontWeight: 500,
97
174
  color: theme.colors.text,
98
- marginBottom: theme.spacing.sm,
175
+ marginBottom: "8px",
99
176
  },
100
177
  phoneInputContainer: {
101
178
  display: "flex",
102
- gap: theme.spacing.sm,
179
+ gap: "10px",
180
+ flexDirection: isMobile ? "column" : "row",
103
181
  },
104
182
  phoneInput: {
105
183
  flex: 1,
106
184
  width: "100%",
107
- padding: `${theme.spacing.sm} ${theme.spacing.md}`,
108
- borderRadius: theme.radii.md,
185
+ padding: "10px 14px",
186
+ borderRadius: "8px",
109
187
  border: `1px solid ${theme.colors.border}`,
110
- fontSize: theme.typography.fontSizeSm,
188
+ fontSize: "14px",
111
189
  outline: "none",
112
190
  color: theme.colors.text,
113
191
  boxSizing: "border-box",
114
- transition: theme.transitions.normal,
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.borderFocus,
118
- outline: `2px solid ${theme.colors.borderFocus}20`,
197
+ borderColor: theme.colors.primary,
198
+ boxShadow: `0 0 0 3px ${theme.colors.primary}15`,
119
199
  },
120
200
  phoneDisplay: {
121
- padding: `${theme.spacing.sm} ${theme.spacing.md}`,
201
+ padding: "10px 14px",
122
202
  background: theme.colors.backgroundSecondary,
123
- borderRadius: theme.radii.md,
124
- fontSize: theme.typography.fontSizeSm,
125
- color: theme.colors.textSecondary,
126
- fontWeight: theme.typography.fontWeightMedium,
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: `${theme.spacing.sm} ${theme.spacing.md}`,
131
- border: `1px solid ${theme.colors.borderHover}`,
132
- borderRadius: theme.radii.md,
133
- fontSize: theme.typography.fontSizeSm,
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: theme.transitions.normal,
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.borderFocus,
141
- outline: `2px solid ${theme.colors.borderFocus}20`,
222
+ borderColor: theme.colors.primary,
223
+ boxShadow: `0 0 0 3px ${theme.colors.primary}15`,
142
224
  },
143
225
  otpHint: {
144
- marginTop: theme.spacing.sm,
145
- fontSize: theme.typography.fontSizeXs,
146
- color: theme.colors.textTertiary,
226
+ marginTop: "8px",
227
+ fontSize: "12px",
228
+ color: theme.colors.textSecondary,
147
229
  },
148
230
  successMessage: {
149
- marginTop: theme.spacing.xl,
150
- padding: theme.spacing.lg,
151
- borderRadius: theme.radii.md,
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: theme.spacing.md,
238
+ gap: "12px",
157
239
  },
158
240
  successIcon: {
159
- fontSize: theme.typography.fontSize2xl,
241
+ fontSize: "24px",
160
242
  color: theme.colors.success,
161
243
  },
162
244
  successTitle: {
163
- fontSize: theme.typography.fontSizeSm,
164
- fontWeight: theme.typography.fontWeightSemibold,
245
+ fontSize: "14px",
246
+ fontWeight: 600,
165
247
  color: theme.colors.success,
166
248
  },
167
249
  successSubtitle: {
168
- fontSize: theme.typography.fontSizeXs,
169
- color: theme.colors.textTertiary,
170
- marginTop: 2,
250
+ fontSize: "12px",
251
+ color: theme.colors.textSecondary,
252
+ marginTop: "2px",
171
253
  },
172
254
  footer: {
173
- padding: `${theme.spacing.lg} ${theme.spacing["2xl"]}`,
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: theme.spacing.md,
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: `1px solid ${theme.colors.border}`,
186
- borderRadius: theme.radii.lg,
187
- marginBottom: theme.spacing["2xl"],
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: `${theme.spacing.lg} ${theme.spacing.xl}`,
279
+ padding: isMobile ? "16px 20px" : "18px 24px",
192
280
  display: "flex",
193
281
  alignItems: "center",
194
- gap: theme.spacing.md,
195
- borderBottom: `1px solid ${theme.colors.border}`,
282
+ gap: "12px",
283
+ borderBottom: cardBorder,
196
284
  color: theme.colors.textOnPrimary,
197
285
  },
198
286
  sectionTitle: {
199
- fontSize: theme.typography.fontSizeLg,
200
- fontWeight: theme.typography.fontWeightSemibold,
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: theme.spacing["2xl"],
293
+ padding: isMobile ? "20px" : "24px",
206
294
  },
207
295
  gridRow: {
208
296
  display: "grid",
209
- gridTemplateColumns: "1fr 1fr",
210
- gap: theme.spacing.xl,
211
- marginTop: theme.spacing.xl,
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: theme.typography.fontSizeXs,
216
- marginBottom: theme.spacing.xs,
217
- color: theme.colors.textSecondary,
218
- fontWeight: theme.typography.fontWeightMedium,
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: `${theme.spacing.sm} ${theme.spacing.md}`,
223
- borderRadius: theme.radii.md,
224
- border: `1px solid ${theme.colors.border}`,
310
+ padding: "10px 14px",
311
+ borderRadius: "8px",
312
+ border: cardBorder,
225
313
  outline: "none",
226
- fontSize: theme.typography.fontSizeSm,
314
+ fontSize: "14px",
227
315
  boxSizing: "border-box",
228
316
  color: theme.colors.text,
229
- transition: theme.transitions.normal,
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.borderFocus,
233
- outline: `2px solid ${theme.colors.borderFocus}20`,
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: theme.spacing.sm,
327
+ gap: "10px",
328
+ flexDirection: isMobile ? "column" : "row",
238
329
  },
239
330
  phoneCode: {
240
- width: "100px",
241
- padding: `${theme.spacing.sm} ${theme.spacing.md}`,
242
- borderRadius: theme.radii.md,
243
- border: `1px solid ${theme.colors.border}`,
331
+ width: isMobile ? "100%" : "100px",
332
+ padding: "10px 14px",
333
+ borderRadius: "8px",
334
+ border: cardBorder,
244
335
  backgroundColor: theme.colors.backgroundSecondary,
245
- fontSize: theme.typography.fontSizeSm,
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: `${theme.spacing.sm} ${theme.spacing.md}`,
252
- borderRadius: theme.radii.md,
253
- border: `1px solid ${theme.colors.border}`,
342
+ padding: "10px 14px",
343
+ borderRadius: "8px",
344
+ border: cardBorder,
254
345
  backgroundColor: theme.colors.backgroundSecondary,
255
- fontSize: theme.typography.fontSizeSm,
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
- color: theme.colors.success,
273
- fontWeight: theme.typography.fontWeightBold,
274
- fontSize: theme.typography.fontSizeLg,
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
- padding: `${theme.spacing.md} 0`,
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: theme.spacing.md,
378
+ gap: "12px",
288
379
  textAlign: "center",
289
- color: theme.colors.success,
290
380
  },
291
381
  detailsTitle: {
292
- fontWeight: theme.typography.fontWeightSemibold,
293
- fontSize: theme.typography.fontSizeMd,
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: theme.spacing.xs,
299
- fontSize: theme.typography.fontSizeSm,
390
+ gap: "4px",
391
+ fontSize: "14px",
300
392
  width: "100%",
301
- maxWidth: "28rem",
393
+ maxWidth: "400px",
302
394
  textAlign: "center",
395
+ color: theme.colors.textSecondary,
303
396
  },
304
397
  confirmationNote: {
305
- marginTop: theme.spacing.sm,
306
- fontSize: theme.typography.fontSizeXs,
307
- color: theme.colors.textTertiary,
398
+ marginTop: "12px",
399
+ fontSize: "14px",
400
+ color: theme.colors.textSecondary,
401
+ lineHeight: "1.5",
308
402
  },
309
403
  actionContainer: {
310
- marginTop: theme.spacing["2xl"],
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;
@@ -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;
@@ -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;