medos-sdk 1.1.9 → 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 (118) 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 +22 -8
  4. package/dist/components/AppointmentConfirmationStep.d.ts +4 -0
  5. package/dist/components/AppointmentConfirmationStep.js +50 -52
  6. package/dist/components/AppointmentDateTimeModal.d.ts +4 -0
  7. package/dist/components/AppointmentDateTimeModal.js +216 -165
  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 +13 -6
  13. package/dist/components/ContactPreferenceStep.js +16 -6
  14. package/dist/components/DoctorSelectModal.d.ts +5 -0
  15. package/dist/components/DoctorSelectModal.js +169 -74
  16. package/dist/components/EnquiryForm.js +84 -72
  17. package/dist/components/Icons/CloseIcon.d.ts +9 -0
  18. package/dist/components/Icons/CloseIcon.js +5 -0
  19. package/dist/components/InquiryDetailsStep.js +11 -6
  20. package/dist/components/PatientDetailsStep.js +17 -12
  21. package/dist/components/PatientSelectionStep.d.ts +12 -0
  22. package/dist/components/PatientSelectionStep.js +254 -0
  23. package/dist/components/PhoneVerificationStep.js +1 -1
  24. package/dist/components/SuccessStep.js +1 -1
  25. package/dist/components/appointment-booking/AppointmentCalender.d.ts +5 -0
  26. package/dist/components/appointment-booking/AppointmentCalender.js +247 -0
  27. package/dist/components/appointment-booking/hooks/index.d.ts +3 -0
  28. package/dist/components/appointment-booking/hooks/index.js +3 -0
  29. package/dist/components/appointment-booking/hooks/useAppointmentFlow.d.ts +8 -0
  30. package/dist/components/appointment-booking/hooks/useAppointmentFlow.js +318 -0
  31. package/dist/components/appointment-booking/hooks/useAppointmentState.d.ts +9 -0
  32. package/dist/components/appointment-booking/hooks/useAppointmentState.js +125 -0
  33. package/dist/components/appointment-booking/hooks/useInitializeAddresses.d.ts +1 -0
  34. package/dist/components/appointment-booking/hooks/useInitializeAddresses.js +55 -0
  35. package/dist/components/appointment-booking/index.d.ts +5 -0
  36. package/dist/components/appointment-booking/index.js +3 -0
  37. package/dist/components/appointment-booking/types.d.ts +291 -0
  38. package/dist/components/appointment-booking/types.js +49 -0
  39. package/dist/components/appointment-modal-styles.d.ts +259 -0
  40. package/dist/components/appointment-modal-styles.js +395 -0
  41. package/dist/components/constant.d.ts +2 -0
  42. package/dist/components/constant.js +15 -0
  43. package/dist/components/custom-calendar.js +20 -11
  44. package/dist/components/styles.js +93 -52
  45. package/dist/components/theme-styles.d.ts +5 -4
  46. package/dist/components/theme-styles.js +221 -125
  47. package/dist/components/types.d.ts +12 -139
  48. package/dist/components/types.js +15 -32
  49. package/dist/components/uiComponents/SelectDropdown.d.ts +1 -1
  50. package/dist/components/uiComponents/SelectDropdown.js +24 -24
  51. package/dist/components/utils.d.ts +3 -0
  52. package/dist/components/utils.js +59 -0
  53. package/dist/components/validation.d.ts +2 -0
  54. package/dist/components/validation.js +41 -0
  55. package/dist/core/theme/index.d.ts +1 -0
  56. package/dist/core/theme/index.js +1 -0
  57. package/dist/core/theme/responsive.d.ts +15 -0
  58. package/dist/core/theme/responsive.js +113 -0
  59. package/dist/core/theme/themes.js +16 -4
  60. package/dist/core/theme/types.d.ts +8 -0
  61. package/dist/enquiry-form/validation.js +1 -1
  62. package/dist/index.d.ts +3 -1
  63. package/dist/index.js +2 -1
  64. package/dist/react/ThemeProvider.d.ts +2 -1
  65. package/dist/react/ThemeProvider.js +49 -10
  66. package/dist/react/index.d.ts +2 -1
  67. package/dist/react/index.js +1 -1
  68. package/dist/services/AppointmentService.d.ts +80 -2
  69. package/dist/services/AppointmentService.js +114 -5
  70. package/dist/services/WorkspaceService.d.ts +58 -3
  71. package/dist/services/WorkspaceService.js +10 -1
  72. package/dist/vanilla/AppointmentCalendarWidget.d.ts +9 -7
  73. package/dist/vanilla/AppointmentCalendarWidget.js +834 -384
  74. package/dist/vanilla/EnquiryFormWidget.d.ts +1 -0
  75. package/dist/vanilla/EnquiryFormWidget.js +25 -43
  76. package/dist/vanilla/client/MedosClient.d.ts +1 -0
  77. package/dist/vanilla/components/AppointmentConfirmationStep.d.ts +4 -0
  78. package/dist/vanilla/components/AppointmentDateTimeModal.d.ts +4 -0
  79. package/dist/vanilla/components/AppointmentSummaryStep.d.ts +12 -0
  80. package/dist/vanilla/components/BookingOptionStep.d.ts +14 -0
  81. package/dist/vanilla/components/DoctorSelectModal.d.ts +5 -0
  82. package/dist/vanilla/components/Icons/CloseIcon.d.ts +9 -0
  83. package/dist/vanilla/components/PatientSelectionStep.d.ts +12 -0
  84. package/dist/vanilla/components/VanillaCalendar.js +33 -18
  85. package/dist/vanilla/components/VanillaIcons.d.ts +5 -0
  86. package/dist/vanilla/components/VanillaIcons.js +92 -0
  87. package/dist/vanilla/components/VanillaSelect.d.ts +3 -0
  88. package/dist/vanilla/components/VanillaSelect.js +93 -5
  89. package/dist/vanilla/components/appointment-booking/AppointmentCalender.d.ts +5 -0
  90. package/dist/vanilla/components/appointment-booking/hooks/index.d.ts +3 -0
  91. package/dist/vanilla/components/appointment-booking/hooks/useAppointmentFlow.d.ts +8 -0
  92. package/dist/vanilla/components/appointment-booking/hooks/useAppointmentState.d.ts +9 -0
  93. package/dist/vanilla/components/appointment-booking/hooks/useInitializeAddresses.d.ts +1 -0
  94. package/dist/vanilla/components/appointment-booking/index.d.ts +5 -0
  95. package/dist/vanilla/components/appointment-booking/types.d.ts +291 -0
  96. package/dist/vanilla/components/appointment-modal-styles.d.ts +259 -0
  97. package/dist/vanilla/components/constant.d.ts +2 -0
  98. package/dist/vanilla/components/theme-styles.d.ts +5 -4
  99. package/dist/vanilla/components/types.d.ts +12 -139
  100. package/dist/vanilla/components/uiComponents/SelectDropdown.d.ts +1 -1
  101. package/dist/vanilla/components/utils.d.ts +3 -0
  102. package/dist/vanilla/components/validation.d.ts +2 -0
  103. package/dist/vanilla/core/theme/index.d.ts +1 -0
  104. package/dist/vanilla/core/theme/responsive.d.ts +15 -0
  105. package/dist/vanilla/core/theme/types.d.ts +8 -0
  106. package/dist/vanilla/enquiry-widget.js +374 -53
  107. package/dist/vanilla/index.d.ts +3 -1
  108. package/dist/vanilla/react/ThemeProvider.d.ts +2 -1
  109. package/dist/vanilla/react/index.d.ts +2 -1
  110. package/dist/vanilla/services/AppointmentService.d.ts +80 -2
  111. package/dist/vanilla/services/WorkspaceService.d.ts +58 -3
  112. package/dist/vanilla/vanilla/AppointmentCalendarWidget.d.ts +9 -7
  113. package/dist/vanilla/vanilla/EnquiryFormWidget.d.ts +1 -0
  114. package/dist/vanilla/vanilla/components/VanillaIcons.d.ts +5 -0
  115. package/dist/vanilla/vanilla/components/VanillaSelect.d.ts +3 -0
  116. package/dist/vanilla/widget.css +833 -207
  117. package/dist/vanilla/widget.js +6463 -5687
  118. package/package.json +1 -1
@@ -0,0 +1,346 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import React from "react";
3
+ import { useTheme } from "../react/hooks/useTheme";
4
+ import { useBreakpoint } from "../core/theme/responsive";
5
+ export const BookingOptionStep = ({ userSessionPacks, availablePackages, showPackageExplorer, selectedNewPackage, onSelectOption, onSelectPackage, onBack, }) => {
6
+ const theme = useTheme();
7
+ const breakpoint = useBreakpoint(theme);
8
+ const styles = getStyles(theme, breakpoint);
9
+ const [tempSelectedOption, setTempSelectedOption] = React.useState(null);
10
+ const [tempSelectedPackage, setTempSelectedPackage] = React.useState(null);
11
+ const activePack = userSessionPacks.find((pack) => pack.remainingSessions > 0);
12
+ const hasAvailablePackages = availablePackages.length > 0;
13
+ const handleOptionClick = (optionType, sessionPack) => {
14
+ setTempSelectedOption({ type: optionType, sessionPack });
15
+ };
16
+ const handlePackageSelect = (pkg) => {
17
+ setTempSelectedPackage(pkg);
18
+ };
19
+ const handlePackageNext = () => {
20
+ if (tempSelectedPackage) {
21
+ onSelectPackage(tempSelectedPackage);
22
+ }
23
+ };
24
+ const handleNext = () => {
25
+ if (tempSelectedOption) {
26
+ onSelectOption(tempSelectedOption.type, tempSelectedOption.sessionPack, undefined);
27
+ }
28
+ };
29
+ if (showPackageExplorer) {
30
+ return (_jsxs("div", { style: styles.container, children: [_jsx("div", { style: styles.header, children: _jsx("h3", { style: styles.title, children: "Explore Packages" }) }), _jsx("p", { style: styles.subtitle, children: "Choose a package that suits your needs" }), hasAvailablePackages ? (_jsx("div", { style: styles.packagesGrid, children: availablePackages.map((pkg) => (_jsxs("div", { style: {
31
+ ...styles.packageCard,
32
+ ...(tempSelectedPackage?.id === pkg.id
33
+ ? styles.packageCardSelected
34
+ : {}),
35
+ }, onClick: () => handlePackageSelect(pkg), children: [_jsx("h4", { style: styles.packageName, children: pkg.name }), _jsx("p", { style: styles.packageDescription, children: pkg.description }), pkg.allowedDoctors && pkg.allowedDoctors.length > 0 && (_jsx("div", { style: styles.packageDoctors, children: pkg.allowedDoctors.map((doc) => (_jsx("span", { style: styles.doctorBadge, children: doc.fullName }, doc.id))) })), pkg.allowedConsultationModes &&
36
+ pkg.allowedConsultationModes.length > 0 && (_jsx("div", { style: styles.consultationModes, children: pkg.allowedConsultationModes.map((mode) => (_jsx("span", { style: styles.modeBadge, children: mode === "ONLINE" ? "🌐 Online" : "🏥 In-Person" }, mode))) })), _jsxs("div", { style: styles.packageDetails, children: [_jsxs("span", { style: styles.packageSessions, children: [pkg.totalSessions || pkg.sessions, " session", (pkg.totalSessions || pkg.sessions || 1) > 1 ? "s" : ""] }), _jsx("div", { style: styles.priceContainer, children: pkg.discountedPrice && pkg.discountedPrice < pkg.price ? (_jsxs(_Fragment, { children: [_jsxs("span", { style: styles.originalPrice, children: ["\u20B9", pkg.price.toLocaleString()] }), _jsxs("span", { style: styles.packagePrice, children: ["\u20B9", pkg.discountedPrice.toLocaleString()] }), pkg.discount && (_jsx("span", { style: styles.discountBadge, children: pkg.discountType === "PERCENTAGE"
37
+ ? `${pkg.discount}% OFF`
38
+ : `₹${pkg.discount} OFF` }))] })) : (_jsxs("span", { style: styles.packagePrice, children: ["\u20B9", pkg.price.toLocaleString()] })) })] }), _jsxs("div", { style: styles.packageValidity, children: ["Valid for ", pkg.validityDays, " days"] })] }, pkg.id))) })) : (_jsx("div", { style: styles.emptyState, children: _jsx("p", { children: "No packages available at the moment." }) })), _jsxs("div", { style: styles.actions, children: [_jsx("button", { style: styles.backBtn, onClick: onBack, children: "Back" }), _jsx("button", { style: {
39
+ ...styles.nextBtn,
40
+ ...(tempSelectedPackage ? {} : styles.nextBtnDisabled),
41
+ }, onClick: handlePackageNext, disabled: !tempSelectedPackage, children: "Next" })] })] }));
42
+ }
43
+ return (_jsxs("div", { style: styles.container, children: [_jsx("h3", { style: styles.title, children: "Choose Booking Option" }), _jsx("p", { style: styles.subtitle, children: "How would you like to book your appointment?" }), userSessionPacks.filter((p) => p.remainingSessions > 0).length > 1 && (_jsxs("div", { style: styles.sessionPacksSection, children: [_jsx("h4", { style: styles.sectionTitle, children: "Your Active Session Packs" }), _jsx("div", { style: styles.sessionPacksList, children: userSessionPacks
44
+ .filter((pack) => pack.remainingSessions > 0)
45
+ .map((pack) => (_jsxs("div", { style: {
46
+ ...styles.sessionPackCard,
47
+ ...(tempSelectedOption?.type === "session-pack" &&
48
+ tempSelectedOption?.sessionPack?.id === pack.id
49
+ ? styles.sessionPackCardSelected
50
+ : {}),
51
+ }, onClick: () => handleOptionClick("session-pack", pack), children: [_jsxs("div", { style: styles.sessionPackInfo, children: [_jsx("span", { style: styles.sessionPackName, children: pack.name }), _jsxs("span", { style: styles.sessionPackRemaining, children: [pack.remainingSessions, "/", pack.totalSessions, " sessions"] }), pack.doctorName && (_jsx("span", { style: styles.sessionPackDoctor, children: pack.doctorName }))] }), _jsxs("div", { style: styles.sessionPackExpiry, children: ["Expires: ", new Date(pack.expiryDate).toLocaleDateString()] })] }, pack.id))) })] })), userSessionPacks.length > 0 && _jsx("hr", { style: { margin: "6px 0 6px 0" } }), _jsxs("div", { style: styles.optionsGrid, children: [activePack && (_jsxs("div", { style: {
52
+ ...styles.optionCard,
53
+ ...(tempSelectedOption?.type === "session-pack" &&
54
+ tempSelectedOption?.sessionPack?.id === activePack.id
55
+ ? styles.optionCardSelected
56
+ : {}),
57
+ }, onClick: () => handleOptionClick("session-pack", activePack), children: [_jsx("div", { style: styles.optionIcon, children: "\uD83D\uDCCB" }), _jsx("h4", { style: styles.optionTitle, children: "Use Session Pack" }), _jsxs("p", { style: styles.optionDescription, children: ["You have ", activePack.remainingSessions, " session", activePack.remainingSessions > 1 ? "s" : "", " remaining"] }), _jsx("div", { style: styles.sessionPackBadge, children: activePack.name })] })), _jsxs("div", { style: {
58
+ ...styles.optionCard,
59
+ ...(tempSelectedOption?.type === "new-appointment"
60
+ ? styles.optionCardSelected
61
+ : {}),
62
+ }, onClick: () => handleOptionClick("new-appointment"), children: [_jsx("div", { style: styles.optionIcon, children: "\uD83D\uDCC5" }), _jsx("h4", { style: styles.optionTitle, children: "Book New Appointment" }), _jsx("p", { style: styles.optionDescription, children: "Schedule a single consultation visit" })] }), hasAvailablePackages && (_jsxs("div", { style: {
63
+ ...styles.optionCard,
64
+ ...(tempSelectedOption?.type === "explore-packages"
65
+ ? styles.optionCardSelected
66
+ : {}),
67
+ }, onClick: () => handleOptionClick("explore-packages"), children: [_jsx("div", { style: styles.optionIcon, children: "\uD83C\uDF81" }), _jsx("h4", { style: styles.optionTitle, children: "Explore Packages" }), _jsx("p", { style: styles.optionDescription, children: "View and purchase consultation packages" })] }))] }), _jsxs("div", { style: styles.actions, children: [_jsx("button", { style: styles.backBtn, onClick: onBack, children: "Back" }), _jsx("button", { style: {
68
+ ...styles.nextBtn,
69
+ ...(tempSelectedOption ? {} : styles.nextBtnDisabled),
70
+ }, onClick: handleNext, disabled: !tempSelectedOption, children: "Next" })] })] }));
71
+ };
72
+ const getStyles = (theme, breakpoint) => {
73
+ const isMobile = breakpoint === "mobile";
74
+ const borderRadius = "12px";
75
+ const buttonRadius = "8px";
76
+ const cardBorder = `1px solid ${theme.colors.border}`;
77
+ return {
78
+ container: {
79
+ display: "flex",
80
+ flexDirection: "column",
81
+ gap: 20,
82
+ },
83
+ header: {
84
+ marginBottom: 4,
85
+ },
86
+ title: {
87
+ margin: 0,
88
+ fontSize: isMobile ? 18 : 20,
89
+ fontWeight: 600,
90
+ color: theme.colors.text,
91
+ },
92
+ subtitle: {
93
+ margin: 0,
94
+ fontSize: 14,
95
+ color: theme.colors.textSecondary,
96
+ lineHeight: 1.5,
97
+ },
98
+ optionsGrid: {
99
+ display: "grid",
100
+ gridTemplateColumns: isMobile
101
+ ? "1fr"
102
+ : "repeat(auto-fit, minmax(200px, 1fr))",
103
+ gap: 16,
104
+ },
105
+ optionCard: {
106
+ display: "flex",
107
+ flexDirection: "column",
108
+ alignItems: "center",
109
+ padding: 24,
110
+ border: cardBorder,
111
+ borderRadius,
112
+ cursor: "pointer",
113
+ transition: "all 0.2s ease",
114
+ textAlign: "center",
115
+ backgroundColor: theme.colors.surface,
116
+ boxShadow: "0 1px 3px rgba(0, 0, 0, 0.04)",
117
+ },
118
+ optionCardSelected: {
119
+ borderColor: theme.colors.primary,
120
+ backgroundColor: `${theme.colors.primary}08`,
121
+ boxShadow: `0 0 0 1px ${theme.colors.primary}`,
122
+ },
123
+ optionIcon: {
124
+ fontSize: 32,
125
+ marginBottom: 12,
126
+ },
127
+ optionTitle: {
128
+ margin: "0 0 8px 0",
129
+ fontSize: 16,
130
+ fontWeight: 600,
131
+ color: theme.colors.text,
132
+ },
133
+ optionDescription: {
134
+ margin: 0,
135
+ fontSize: 14,
136
+ color: theme.colors.textSecondary,
137
+ lineHeight: 1.5,
138
+ },
139
+ sessionPackBadge: {
140
+ marginTop: 12,
141
+ padding: "6px 14px",
142
+ backgroundColor: theme.colors.successBackground || "#dcfce7",
143
+ color: theme.colors.success || "#166534",
144
+ borderRadius: 999,
145
+ fontSize: 12,
146
+ fontWeight: 500,
147
+ },
148
+ sessionPacksSection: {
149
+ marginBottom: 8,
150
+ },
151
+ sectionTitle: {
152
+ margin: "0 0 16px 0",
153
+ fontSize: 15,
154
+ fontWeight: 600,
155
+ color: theme.colors.text,
156
+ },
157
+ sessionPacksList: {
158
+ display: "flex",
159
+ flexDirection: "column",
160
+ gap: 12,
161
+ },
162
+ sessionPackCard: {
163
+ display: "flex",
164
+ justifyContent: "space-between",
165
+ alignItems: "center",
166
+ padding: 16,
167
+ border: cardBorder,
168
+ borderRadius,
169
+ cursor: "pointer",
170
+ transition: "all 0.2s ease",
171
+ backgroundColor: theme.colors.surface,
172
+ },
173
+ sessionPackCardSelected: {
174
+ borderColor: theme.colors.primary,
175
+ backgroundColor: `${theme.colors.primary}08`,
176
+ },
177
+ sessionPackInfo: {
178
+ display: "flex",
179
+ flexDirection: "column",
180
+ gap: 4,
181
+ },
182
+ sessionPackName: {
183
+ fontSize: 14,
184
+ fontWeight: 600,
185
+ color: theme.colors.text,
186
+ },
187
+ sessionPackRemaining: {
188
+ fontSize: 13,
189
+ color: theme.colors.textSecondary,
190
+ },
191
+ sessionPackDoctor: {
192
+ fontSize: 13,
193
+ color: theme.colors.textSecondary,
194
+ },
195
+ sessionPackExpiry: {
196
+ fontSize: 12,
197
+ color: theme.colors.error || "#dc2626",
198
+ fontWeight: 500,
199
+ },
200
+ packagesGrid: {
201
+ display: "grid",
202
+ gridTemplateColumns: isMobile
203
+ ? "1fr"
204
+ : "repeat(auto-fit, minmax(250px, 1fr))",
205
+ gap: 16,
206
+ },
207
+ packageCard: {
208
+ display: "flex",
209
+ flexDirection: "column",
210
+ padding: 20,
211
+ border: cardBorder,
212
+ borderRadius,
213
+ cursor: "pointer",
214
+ transition: "all 0.2s ease",
215
+ backgroundColor: theme.colors.surface,
216
+ boxShadow: "0 1px 3px rgba(0, 0, 0, 0.04)",
217
+ },
218
+ packageCardSelected: {
219
+ borderColor: theme.colors.primary,
220
+ backgroundColor: `${theme.colors.primary}08`,
221
+ boxShadow: `0 0 0 1px ${theme.colors.primary}`,
222
+ },
223
+ packageName: {
224
+ margin: "0 0 8px 0",
225
+ fontSize: 16,
226
+ fontWeight: 600,
227
+ color: theme.colors.text,
228
+ },
229
+ packageDescription: {
230
+ margin: "0 0 16px 0",
231
+ fontSize: 14,
232
+ color: theme.colors.textSecondary,
233
+ lineHeight: 1.5,
234
+ flex: 1,
235
+ },
236
+ packageDetails: {
237
+ display: "flex",
238
+ justifyContent: "space-between",
239
+ alignItems: "center",
240
+ paddingTop: 16,
241
+ borderTop: cardBorder,
242
+ },
243
+ packageSessions: {
244
+ fontSize: 13,
245
+ color: theme.colors.textSecondary,
246
+ },
247
+ priceContainer: {
248
+ display: "flex",
249
+ flexDirection: "column",
250
+ alignItems: "flex-end",
251
+ gap: 4,
252
+ },
253
+ originalPrice: {
254
+ fontSize: 14,
255
+ color: theme.colors.textSecondary,
256
+ textDecoration: "line-through",
257
+ },
258
+ packagePrice: {
259
+ fontSize: 18,
260
+ fontWeight: 600,
261
+ color: theme.colors.primary,
262
+ },
263
+ discountBadge: {
264
+ fontSize: 11,
265
+ fontWeight: 600,
266
+ color: "#fff",
267
+ backgroundColor: theme.colors.success || "#16a34a",
268
+ padding: "2px 8px",
269
+ borderRadius: 999,
270
+ },
271
+ packageValidity: {
272
+ marginTop: 8,
273
+ fontSize: 12,
274
+ color: theme.colors.textSecondary,
275
+ },
276
+ packageDoctors: {
277
+ display: "flex",
278
+ flexWrap: "wrap",
279
+ gap: 6,
280
+ marginBottom: 12,
281
+ },
282
+ doctorBadge: {
283
+ fontSize: 12,
284
+ color: theme.colors.text,
285
+ backgroundColor: theme.colors.backgroundSecondary || "#f1f5f9",
286
+ padding: "4px 10px",
287
+ borderRadius: 999,
288
+ },
289
+ consultationModes: {
290
+ display: "flex",
291
+ gap: 8,
292
+ marginBottom: 12,
293
+ },
294
+ modeBadge: {
295
+ fontSize: 11,
296
+ color: theme.colors.textSecondary,
297
+ backgroundColor: theme.colors.backgroundSecondary || "#f1f5f9",
298
+ padding: "4px 8px",
299
+ borderRadius: 6,
300
+ },
301
+ emptyState: {
302
+ textAlign: "center",
303
+ padding: "40px 20px",
304
+ color: theme.colors.textSecondary,
305
+ fontSize: 14,
306
+ },
307
+ actions: {
308
+ display: "flex",
309
+ gap: 12,
310
+ marginTop: 24,
311
+ paddingTop: 20,
312
+ borderTop: cardBorder,
313
+ justifyContent: "flex-end",
314
+ },
315
+ backBtn: {
316
+ padding: "10px 20px",
317
+ border: cardBorder,
318
+ borderRadius: buttonRadius,
319
+ backgroundColor: theme.colors.surface,
320
+ color: theme.colors.text,
321
+ cursor: "pointer",
322
+ fontSize: 14,
323
+ fontWeight: 600,
324
+ transition: "all 0.2s ease",
325
+ minHeight: 40,
326
+ },
327
+ nextBtn: {
328
+ padding: "10px 24px",
329
+ border: "none",
330
+ borderRadius: buttonRadius,
331
+ backgroundColor: theme.colors.primary,
332
+ color: "#fff",
333
+ cursor: "pointer",
334
+ fontSize: 14,
335
+ fontWeight: 600,
336
+ transition: "all 0.2s ease",
337
+ minHeight: 40,
338
+ },
339
+ nextBtnDisabled: {
340
+ backgroundColor: theme.colors.textSecondary || "#9ca3af",
341
+ cursor: "not-allowed",
342
+ opacity: 0.6,
343
+ },
344
+ };
345
+ };
346
+ export default BookingOptionStep;
@@ -1,14 +1,21 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from "react";
2
3
  import { useTheme } from "../react/hooks/useTheme";
4
+ import { useBreakpoint } from "../core/theme/responsive";
3
5
  import { getContainerStyles, getPhoneVerifyStyles, getButtonStyles, } from "./theme-styles";
4
- export const ContactInformationStep = ({ patientName, patientEmail, countryCode, patientPhone, onNameChange, onEmailChange, onCountryCodeChange, onPhoneChange, onNext, }) => {
6
+ export const ContactInformationStep = React.memo(({ patientName, patientEmail, countryCode, patientPhone, onNameChange, onEmailChange, onCountryCodeChange, onPhoneChange, onNext, }) => {
5
7
  const theme = useTheme();
6
- const PHONE_VERIFY_STYLES = getPhoneVerifyStyles(theme);
7
- const BUTTON_STYLES = getButtonStyles(theme);
8
- const CONTAINER_STYLES = getContainerStyles(theme);
9
- return (_jsxs("div", { children: [_jsxs("div", { style: { marginBottom: "16px" }, children: [_jsx("label", { style: PHONE_VERIFY_STYLES.label, children: "Name" }), _jsx("input", { type: "text", value: patientName, onChange: (e) => onNameChange(e.target.value), placeholder: "Enter your full name", style: PHONE_VERIFY_STYLES.phoneInput })] }), _jsxs("div", { style: { marginBottom: "16px" }, children: [_jsx("label", { style: PHONE_VERIFY_STYLES.label, children: "Email" }), _jsx("input", { type: "email", value: patientEmail, onChange: (e) => onEmailChange(e.target.value), placeholder: "Enter your email", style: PHONE_VERIFY_STYLES.phoneInput })] }), _jsxs("div", { style: { marginBottom: "16px" }, children: [_jsx("label", { style: PHONE_VERIFY_STYLES.label, children: "Phone Number" }), _jsxs("div", { style: PHONE_VERIFY_STYLES.phoneInputContainer, children: [_jsx("input", { type: "text", value: countryCode, onChange: (e) => onCountryCodeChange(e.target.value), placeholder: "+91", style: {
8
+ const breakpoint = useBreakpoint(theme);
9
+ const PHONE_VERIFY_STYLES = React.useMemo(() => getPhoneVerifyStyles(theme, "medos", breakpoint), [theme, breakpoint]);
10
+ const BUTTON_STYLES = React.useMemo(() => getButtonStyles(theme, "medos", breakpoint), [theme, breakpoint]);
11
+ const CONTAINER_STYLES = React.useMemo(() => getContainerStyles(theme, "medos", breakpoint), [theme, breakpoint]);
12
+ const styles = getStyles(theme);
13
+ return (_jsxs("div", { children: [_jsxs("div", { style: { marginBottom: "16px" }, children: [_jsxs("label", { style: PHONE_VERIFY_STYLES.label, children: ["Name", _jsx("span", { style: styles.mandatory, children: "*" })] }), _jsx("input", { type: "text", value: patientName, onChange: (e) => onNameChange(e.target.value), placeholder: "Enter your full name", style: PHONE_VERIFY_STYLES.phoneInput })] }), _jsxs("div", { style: { marginBottom: "16px" }, children: [_jsx("label", { style: PHONE_VERIFY_STYLES.label, children: "Email" }), _jsx("input", { type: "email", value: patientEmail, onChange: (e) => onEmailChange(e.target.value), placeholder: "Enter your email", style: PHONE_VERIFY_STYLES.phoneInput })] }), _jsxs("div", { style: { marginBottom: "16px" }, children: [_jsxs("label", { style: PHONE_VERIFY_STYLES.label, children: ["Phone Number", _jsx("span", { style: styles.mandatory, children: "*" })] }), _jsxs("div", { style: PHONE_VERIFY_STYLES.phoneInputContainer, children: [_jsx("input", { type: "text", value: countryCode, onChange: (e) => onCountryCodeChange(e.target.value), placeholder: "+91", style: {
10
14
  ...PHONE_VERIFY_STYLES.phoneInput,
11
15
  width: "80px",
12
16
  flex: "none",
13
17
  } }), _jsx("input", { type: "tel", value: patientPhone, onChange: (e) => onPhoneChange(e.target.value), placeholder: "Enter phone number", style: PHONE_VERIFY_STYLES.phoneInput })] })] }), _jsx("div", { style: CONTAINER_STYLES.actions, children: _jsx("button", { onClick: onNext, style: BUTTON_STYLES.primary, children: "Next" }) })] }));
14
- };
18
+ });
19
+ const getStyles = (theme) => ({
20
+ mandatory: { color: theme.colors.error, marginLeft: 4 },
21
+ });
@@ -1,10 +1,20 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from "react";
2
3
  import { useTheme } from "../react/hooks/useTheme";
3
4
  import { getPhoneVerifyStyles, getButtonStyles, getContainerStyles, } from "./theme-styles";
4
- export const ContactPreferenceStep = ({ preferredContactMethod, onContactMethodChange, onBack, onSubmit, isLoading = false, }) => {
5
+ import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem, } from "./uiComponents/SelectDropdown";
6
+ export const ContactPreferenceStep = React.memo(({ preferredContactMethod, onContactMethodChange, onBack, onSubmit, isLoading = false, }) => {
5
7
  const theme = useTheme();
6
- const PHONE_VERIFY_STYLES = getPhoneVerifyStyles(theme);
7
- const BUTTON_STYLES = getButtonStyles(theme);
8
- const CONTAINER_STYLES = getContainerStyles(theme);
9
- return (_jsxs("div", { children: [_jsxs("div", { style: { marginBottom: "16px" }, children: [_jsx("label", { style: PHONE_VERIFY_STYLES.label, children: "Preferred Contact Method" }), _jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [_jsxs("label", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [_jsx("input", { type: "radio", name: "contactMethod", value: "PHONE", checked: preferredContactMethod === "PHONE", onChange: (e) => onContactMethodChange(e.target.value) }), "Phone"] }), _jsxs("label", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [_jsx("input", { type: "radio", name: "contactMethod", value: "EMAIL", checked: preferredContactMethod === "EMAIL", onChange: (e) => onContactMethodChange(e.target.value) }), "Email"] }), _jsxs("label", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [_jsx("input", { type: "radio", name: "contactMethod", value: "BOTH", checked: preferredContactMethod === "BOTH", onChange: (e) => onContactMethodChange(e.target.value) }), "Both"] })] })] }), _jsxs("div", { style: CONTAINER_STYLES.actions, children: [_jsx("button", { onClick: onBack, style: BUTTON_STYLES.secondary, children: "Back" }), _jsx("button", { onClick: onSubmit, style: BUTTON_STYLES.primary, children: isLoading ? "Submitting..." : "Submit" })] })] }));
10
- };
8
+ const PHONE_VERIFY_STYLES = React.useMemo(() => getPhoneVerifyStyles(theme), [theme]);
9
+ const BUTTON_STYLES = React.useMemo(() => getButtonStyles(theme), [theme]);
10
+ const CONTAINER_STYLES = React.useMemo(() => getContainerStyles(theme), [theme]);
11
+ const contactOptions = [
12
+ { value: "PHONE", label: "Phone" },
13
+ { value: "EMAIL", label: "Email" },
14
+ { value: "BOTH", label: "Both" },
15
+ ];
16
+ const handleContactMethodSelect = (value) => {
17
+ onContactMethodChange(value);
18
+ };
19
+ return (_jsxs("div", { children: [_jsxs("div", { style: { marginBottom: "16px" }, children: [_jsx("label", { style: PHONE_VERIFY_STYLES.label, children: "Preferred Contact Method" }), _jsx("div", { style: { marginTop: "8px" }, children: _jsxs(Select, { value: preferredContactMethod, onValueChange: handleContactMethodSelect, children: [_jsx(SelectTrigger, { style: { width: "100%" }, children: _jsx(SelectValue, { placeholder: "Select contact method" }) }), _jsx(SelectContent, { children: contactOptions.map((option) => (_jsx(SelectItem, { value: option.value, children: option.label }, option.value))) })] }) })] }), _jsxs("div", { style: CONTAINER_STYLES.actions, children: [_jsx("button", { onClick: onBack, style: BUTTON_STYLES.secondary, children: "Back" }), _jsx("button", { onClick: onSubmit, style: BUTTON_STYLES.primary, children: isLoading ? "Submitting..." : "Submit" })] })] }));
20
+ });
@@ -1,5 +1,10 @@
1
1
  import React from "react";
2
+ import { Doctor, AddressItem } from "../services/AppointmentService";
2
3
  type DoctorSelectModalProps = {
4
+ addresses?: AddressItem[];
5
+ addressDoctorsMap?: Record<number, Doctor[]>;
6
+ selectedAddressId?: number | null;
7
+ selectedDoctorId?: number | null;
3
8
  onCancel: () => void;
4
9
  onContinue: (addressId: number, doctorId: number, notes?: string) => void;
5
10
  };