medos-sdk 1.0.3 → 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.
Files changed (95) hide show
  1. package/README.md +39 -0
  2. package/dist/client/MedosClient.d.ts +2 -4
  3. package/dist/client/MedosClient.js +4 -4
  4. package/dist/components/AppointmentCalender.js +43 -2
  5. package/dist/components/AppointmentDateTimeModal.js +45 -31
  6. package/dist/components/ContactInformationStep.d.ts +13 -0
  7. package/dist/components/ContactInformationStep.js +14 -0
  8. package/dist/components/ContactPreferenceStep.d.ts +9 -0
  9. package/dist/components/ContactPreferenceStep.js +16 -0
  10. package/dist/components/DoctorSelectModal.js +30 -17
  11. package/dist/components/EnquiryForm.d.ts +7 -0
  12. package/dist/components/EnquiryForm.js +212 -0
  13. package/dist/components/Icons/ConsultationType.js +1 -1
  14. package/dist/components/Icons/Date&TimeIcon.js +1 -1
  15. package/dist/components/Icons/MapIcon.js +1 -1
  16. package/dist/components/Icons/PaymentMethodIcon.js +1 -1
  17. package/dist/components/Icons/UserIcon.js +1 -1
  18. package/dist/components/InquiryDetailsStep.d.ts +10 -0
  19. package/dist/components/InquiryDetailsStep.js +15 -0
  20. package/dist/components/PatientDetailsStep.js +9 -1
  21. package/dist/components/PhoneVerificationStep.js +22 -12
  22. package/dist/components/SuccessStep.d.ts +3 -1
  23. package/dist/components/SuccessStep.js +7 -15
  24. package/dist/components/custom-calendar.js +42 -24
  25. package/dist/components/theme-styles.d.ts +12 -0
  26. package/dist/components/theme-styles.js +319 -0
  27. package/dist/components/types.d.ts +0 -1
  28. package/dist/core/index.d.ts +4 -0
  29. package/dist/core/index.js +4 -0
  30. package/dist/core/theme/index.d.ts +3 -0
  31. package/dist/core/theme/index.js +3 -0
  32. package/dist/core/theme/themes.d.ts +8 -0
  33. package/dist/core/theme/themes.js +178 -0
  34. package/dist/core/theme/types.d.ts +106 -0
  35. package/dist/core/theme/types.js +1 -0
  36. package/dist/core/theme/utils.d.ts +8 -0
  37. package/dist/core/theme/utils.js +135 -0
  38. package/dist/enquiry-form/index.d.ts +4 -0
  39. package/dist/enquiry-form/index.js +4 -0
  40. package/dist/enquiry-form/provider.d.ts +3 -0
  41. package/dist/enquiry-form/provider.js +9 -0
  42. package/dist/enquiry-form/serialization.d.ts +4 -0
  43. package/dist/enquiry-form/serialization.js +57 -0
  44. package/dist/enquiry-form/types.d.ts +38 -0
  45. package/dist/enquiry-form/types.js +1 -0
  46. package/dist/enquiry-form/validation.d.ts +6 -0
  47. package/dist/enquiry-form/validation.js +21 -0
  48. package/dist/index.d.ts +9 -0
  49. package/dist/index.js +7 -0
  50. package/dist/react/ThemeProvider.d.ts +18 -0
  51. package/dist/react/ThemeProvider.js +45 -0
  52. package/dist/react/hooks/useTheme.d.ts +1 -0
  53. package/dist/react/hooks/useTheme.js +1 -0
  54. package/dist/react/index.d.ts +5 -0
  55. package/dist/react/index.js +3 -0
  56. package/dist/services/EnquiryService.d.ts +5 -0
  57. package/dist/services/EnquiryService.js +30 -0
  58. package/dist/vanilla/AppointmentCalendarWidget.js +0 -2
  59. package/dist/vanilla/EnquiryFormWidget.d.ts +35 -0
  60. package/dist/vanilla/EnquiryFormWidget.js +425 -0
  61. package/dist/vanilla/client/MedosClient.d.ts +2 -4
  62. package/dist/vanilla/components/ContactInformationStep.d.ts +13 -0
  63. package/dist/vanilla/components/ContactPreferenceStep.d.ts +9 -0
  64. package/dist/vanilla/components/EnquiryForm.d.ts +7 -0
  65. package/dist/vanilla/components/InquiryDetailsStep.d.ts +10 -0
  66. package/dist/vanilla/components/SuccessStep.d.ts +3 -1
  67. package/dist/vanilla/components/theme-styles.d.ts +12 -0
  68. package/dist/vanilla/components/types.d.ts +0 -1
  69. package/dist/vanilla/core/index.d.ts +4 -0
  70. package/dist/vanilla/core/theme/index.d.ts +3 -0
  71. package/dist/vanilla/core/theme/themes.d.ts +8 -0
  72. package/dist/vanilla/core/theme/types.d.ts +106 -0
  73. package/dist/vanilla/core/theme/utils.d.ts +8 -0
  74. package/dist/vanilla/enquiry-form/index.d.ts +4 -0
  75. package/dist/vanilla/enquiry-form/provider.d.ts +3 -0
  76. package/dist/vanilla/enquiry-form/serialization.d.ts +4 -0
  77. package/dist/vanilla/enquiry-form/types.d.ts +38 -0
  78. package/dist/vanilla/enquiry-form/validation.d.ts +6 -0
  79. package/dist/vanilla/enquiry-widget.js +4650 -0
  80. package/dist/vanilla/index.d.ts +9 -0
  81. package/dist/vanilla/index.js +3 -1
  82. package/dist/vanilla/react/ThemeProvider.d.ts +18 -0
  83. package/dist/vanilla/react/hooks/useTheme.d.ts +1 -0
  84. package/dist/vanilla/react/index.d.ts +5 -0
  85. package/dist/vanilla/services/EnquiryService.d.ts +5 -0
  86. package/dist/vanilla/theme-injector.d.ts +6 -0
  87. package/dist/vanilla/theme-injector.js +44 -0
  88. package/dist/vanilla/vanilla/EnquiryFormWidget.d.ts +35 -0
  89. package/dist/vanilla/vanilla/index.d.ts +3 -1
  90. package/dist/vanilla/vanilla/theme-injector.d.ts +6 -0
  91. package/dist/vanilla/vanilla/widget.d.ts +6 -1
  92. package/dist/vanilla/widget.css +173 -0
  93. package/dist/vanilla/widget.d.ts +6 -1
  94. package/dist/vanilla/widget.js +489 -12
  95. package/package.json +1 -1
@@ -0,0 +1,212 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useReducer, useCallback } from "react";
3
+ import { EnquiryService } from "../services/EnquiryService";
4
+ import { validateName, validateEmail, validatePhoneNumber, validateSubject, validateMessage, validateCountryCode, } from "../enquiry-form/validation";
5
+ import { ContactInformationStep } from "./ContactInformationStep";
6
+ import { InquiryDetailsStep } from "./InquiryDetailsStep";
7
+ import { ContactPreferenceStep } from "./ContactPreferenceStep";
8
+ import { SuccessStep } from "./SuccessStep";
9
+ import { useTheme } from "../react/hooks/useTheme";
10
+ const INITIAL_STATE = {
11
+ step: 0,
12
+ loading: false,
13
+ error: null,
14
+ patientName: "",
15
+ patientEmail: "",
16
+ countryCode: "+91",
17
+ patientPhone: "",
18
+ inquirySubject: "",
19
+ inquiryMessage: "",
20
+ preferredContactMethod: "EMAIL",
21
+ submitted: false,
22
+ };
23
+ const enquiryFormReducer = (state, action) => {
24
+ switch (action.type) {
25
+ case "SET_STEP":
26
+ return { ...state, step: action.payload };
27
+ case "SET_LOADING":
28
+ return { ...state, loading: action.payload };
29
+ case "SET_ERROR":
30
+ return { ...state, error: action.payload };
31
+ case "SET_PATIENT_NAME":
32
+ return { ...state, patientName: action.payload };
33
+ case "SET_PATIENT_EMAIL":
34
+ return { ...state, patientEmail: action.payload };
35
+ case "SET_COUNTRY_CODE":
36
+ return { ...state, countryCode: action.payload };
37
+ case "SET_PATIENT_PHONE":
38
+ return { ...state, patientPhone: action.payload };
39
+ case "SET_INQUIRY_SUBJECT":
40
+ return { ...state, inquirySubject: action.payload };
41
+ case "SET_INQUIRY_MESSAGE":
42
+ return { ...state, inquiryMessage: action.payload };
43
+ case "SET_PREFERRED_CONTACT_METHOD":
44
+ return { ...state, preferredContactMethod: action.payload };
45
+ case "RESET_FORM":
46
+ return INITIAL_STATE;
47
+ default:
48
+ return state;
49
+ }
50
+ };
51
+ export const EnquiryForm = ({ onSuccess, onError, }) => {
52
+ const [state, dispatch] = useReducer(enquiryFormReducer, INITIAL_STATE);
53
+ const validateContactStep = useCallback(() => {
54
+ dispatch({ type: "SET_ERROR", payload: null });
55
+ if (!validateName(state.patientName)) {
56
+ dispatch({
57
+ type: "SET_ERROR",
58
+ payload: "Please enter a valid name.",
59
+ });
60
+ return false;
61
+ }
62
+ if (!validateEmail(state.patientEmail)) {
63
+ dispatch({
64
+ type: "SET_ERROR",
65
+ payload: "Please enter a valid email address.",
66
+ });
67
+ return false;
68
+ }
69
+ if (!validateCountryCode(state.countryCode)) {
70
+ dispatch({
71
+ type: "SET_ERROR",
72
+ payload: "Please enter a valid country code (e.g., +91, +1).",
73
+ });
74
+ return false;
75
+ }
76
+ if (!validatePhoneNumber(state.patientPhone)) {
77
+ dispatch({
78
+ type: "SET_ERROR",
79
+ payload: "Please enter a valid phone number (7-15 digits).",
80
+ });
81
+ return false;
82
+ }
83
+ return true;
84
+ }, [
85
+ state.patientName,
86
+ state.patientEmail,
87
+ state.countryCode,
88
+ state.patientPhone,
89
+ ]);
90
+ const validateInquiryStep = useCallback(() => {
91
+ dispatch({ type: "SET_ERROR", payload: null });
92
+ if (!validateSubject(state.inquirySubject)) {
93
+ dispatch({
94
+ type: "SET_ERROR",
95
+ payload: "Please enter a valid subject.",
96
+ });
97
+ return false;
98
+ }
99
+ if (!validateMessage(state.inquiryMessage)) {
100
+ dispatch({
101
+ type: "SET_ERROR",
102
+ payload: "Please enter a valid message (max 1000 characters).",
103
+ });
104
+ return false;
105
+ }
106
+ return true;
107
+ }, [state.inquirySubject, state.inquiryMessage]);
108
+ const goToNext = useCallback(() => {
109
+ if (state.step === 0) {
110
+ if (!validateContactStep())
111
+ return;
112
+ }
113
+ else if (state.step === 1) {
114
+ if (!validateInquiryStep())
115
+ return;
116
+ }
117
+ dispatch({ type: "SET_STEP", payload: Math.min(3, state.step + 1) });
118
+ }, [state.step, validateContactStep, validateInquiryStep]);
119
+ const goBack = useCallback(() => {
120
+ dispatch({ type: "SET_STEP", payload: Math.max(0, state.step - 1) });
121
+ }, [state.step]);
122
+ const submitEnquiry = useCallback(async () => {
123
+ dispatch({ type: "SET_ERROR", payload: null });
124
+ if (!validateContactStep() || !validateInquiryStep()) {
125
+ return;
126
+ }
127
+ dispatch({ type: "SET_LOADING", payload: true });
128
+ try {
129
+ const payload = {
130
+ patientName: state.patientName,
131
+ patientEmail: state.patientEmail,
132
+ countryCode: state.countryCode,
133
+ patientPhone: state.patientPhone,
134
+ inquirySubject: state.inquirySubject,
135
+ inquiryMessage: state.inquiryMessage,
136
+ preferredContactMethod: state.preferredContactMethod,
137
+ };
138
+ await EnquiryService.submitEnquiry(payload);
139
+ dispatch({ type: "SET_STEP", payload: 3 });
140
+ onSuccess?.(payload);
141
+ }
142
+ catch (e) {
143
+ const msg = e.message || "Failed to submit enquiry";
144
+ dispatch({ type: "SET_ERROR", payload: msg });
145
+ onError?.(e);
146
+ }
147
+ finally {
148
+ dispatch({ type: "SET_LOADING", payload: false });
149
+ }
150
+ }, [state, validateContactStep, validateInquiryStep, onSuccess, onError]);
151
+ const resetForm = useCallback(() => {
152
+ dispatch({ type: "RESET_FORM" });
153
+ }, []);
154
+ const theme = useTheme();
155
+ const styles = getStyles(theme);
156
+ return (_jsx("div", { style: styles.container, children: _jsxs("div", { style: styles.card, children: [_jsxs("div", { style: styles.header, children: [_jsx("h2", { style: styles.title, children: "Submit Inquiry" }), _jsxs("p", { style: styles.stepIndicator, children: ["Step ", state.step + 1, " of 4"] })] }), _jsxs("div", { style: styles.content, children: [state.loading && _jsx("div", { style: { marginBottom: 12 }, children: "Loading..." }), state.error && _jsx("div", { style: styles.errorMessage, children: state.error }), state.step === 0 && (_jsx(ContactInformationStep, { patientName: state.patientName, patientEmail: state.patientEmail, countryCode: state.countryCode, patientPhone: state.patientPhone, onNameChange: (value) => dispatch({ type: "SET_PATIENT_NAME", payload: value }), onEmailChange: (value) => dispatch({ type: "SET_PATIENT_EMAIL", payload: value }), onCountryCodeChange: (value) => dispatch({ type: "SET_COUNTRY_CODE", payload: value }), onPhoneChange: (value) => dispatch({ type: "SET_PATIENT_PHONE", payload: value }), onNext: goToNext })), state.step === 1 && (_jsx(InquiryDetailsStep, { inquirySubject: state.inquirySubject, inquiryMessage: state.inquiryMessage, onSubjectChange: (value) => dispatch({ type: "SET_INQUIRY_SUBJECT", payload: value }), onMessageChange: (value) => dispatch({ type: "SET_INQUIRY_MESSAGE", payload: value }), onBack: goBack, onNext: goToNext })), state.step === 2 && (_jsx(ContactPreferenceStep, { preferredContactMethod: state.preferredContactMethod, onContactMethodChange: (method) => dispatch({
157
+ type: "SET_PREFERRED_CONTACT_METHOD",
158
+ payload: method,
159
+ }), onBack: goBack, onSubmit: submitEnquiry, isLoading: state.loading })), state.step === 3 && _jsx(SuccessStep, { onReset: resetForm })] })] }) }));
160
+ };
161
+ const getStyles = (theme) => ({
162
+ container: {
163
+ display: "flex",
164
+ justifyContent: "center",
165
+ padding: 20,
166
+ fontFamily: theme.typography.fontFamily,
167
+ background: theme.colors.background,
168
+ },
169
+ card: {
170
+ width: "100%",
171
+ maxWidth: 600,
172
+ background: theme.colors.surface,
173
+ borderRadius: theme.radii.lg,
174
+ boxShadow: theme.shadows.lg,
175
+ overflow: "hidden",
176
+ boxSizing: "border-box",
177
+ },
178
+ header: {
179
+ background: theme.colors.primary,
180
+ padding: "20px 24px",
181
+ borderBottom: `1px solid ${theme.colors.border}`,
182
+ display: "flex",
183
+ justifyContent: "space-between",
184
+ alignItems: "center",
185
+ },
186
+ title: {
187
+ margin: 0,
188
+ fontSize: theme.typography.fontSizeXl,
189
+ fontWeight: theme.typography.fontWeightSemibold,
190
+ color: theme.colors.textOnPrimary,
191
+ },
192
+ stepIndicator: {
193
+ fontSize: theme.typography.fontSizeSm,
194
+ color: theme.colors.textOnPrimary,
195
+ opacity: 0.9,
196
+ margin: 0,
197
+ fontWeight: 500,
198
+ },
199
+ content: {
200
+ padding: 24,
201
+ },
202
+ errorMessage: {
203
+ marginBottom: 12,
204
+ color: theme.colors.error,
205
+ fontWeight: 600,
206
+ padding: "12px",
207
+ background: theme.colors.errorBackground,
208
+ borderRadius: theme.radii.md,
209
+ border: `1px solid ${theme.colors.errorBorder}`,
210
+ fontSize: theme.typography.fontSizeSm,
211
+ },
212
+ });
@@ -1,2 +1,2 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- export const ConsultationTypeIcon = () => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "20", viewBox: "0 0 18 20", fill: "none", children: _jsx("path", { d: "M2 20C1.45 20 0.979167 19.8042 0.5875 19.4125C0.195833 19.0208 0 18.55 0 18V4C0 3.45 0.195833 2.97917 0.5875 2.5875C0.979167 2.19583 1.45 2 2 2H3V0H5V2H13V0H15V2H16C16.55 2 17.0208 2.19583 17.4125 2.5875C17.8042 2.97917 18 3.45 18 4V18C18 18.55 17.8042 19.0208 17.4125 19.4125C17.0208 19.8042 16.55 20 16 20H2ZM2 18H16V8H2V18ZM2 6H16V4H2V6ZM4 12V10H14V12H4ZM4 16V14H11V16H4Z", fill: "#1E3A8A" }) }));
2
+ export const ConsultationTypeIcon = () => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "20", viewBox: "0 0 18 20", fill: "none", children: _jsx("path", { d: "M2 20C1.45 20 0.979167 19.8042 0.5875 19.4125C0.195833 19.0208 0 18.55 0 18V4C0 3.45 0.195833 2.97917 0.5875 2.5875C0.979167 2.19583 1.45 2 2 2H3V0H5V2H13V0H15V2H16C16.55 2 17.0208 2.19583 17.4125 2.5875C17.8042 2.97917 18 3.45 18 4V18C18 18.55 17.8042 19.0208 17.4125 19.4125C17.0208 19.8042 16.55 20 16 20H2ZM2 18H16V8H2V18ZM2 6H16V4H2V6ZM4 12V10H14V12H4ZM4 16V14H11V16H4Z", fill: "currentColor" }) }));
@@ -1,2 +1,2 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- export const DateTimeIcon = () => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "20", viewBox: "0 0 18 20", fill: "none", children: _jsx("path", { d: "M2 20C1.45 20 0.979167 19.8042 0.5875 19.4125C0.195833 19.0208 0 18.55 0 18V4C0 3.45 0.195833 2.97917 0.5875 2.5875C0.979167 2.19583 1.45 2 2 2H3V0H5V2H13V0H15V2H16C16.55 2 17.0208 2.19583 17.4125 2.5875C17.8042 2.97917 18 3.45 18 4V18C18 18.55 17.8042 19.0208 17.4125 19.4125C17.0208 19.8042 16.55 20 16 20H2ZM2 18H16V8H2V18ZM2 6H16V4H2V6ZM4 12V10H14V12H4ZM4 16V14H11V16H4Z", fill: "#C94300" }) }));
2
+ export const DateTimeIcon = () => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "20", viewBox: "0 0 18 20", fill: "none", children: _jsx("path", { d: "M2 20C1.45 20 0.979167 19.8042 0.5875 19.4125C0.195833 19.0208 0 18.55 0 18V4C0 3.45 0.195833 2.97917 0.5875 2.5875C0.979167 2.19583 1.45 2 2 2H3V0H5V2H13V0H15V2H16C16.55 2 17.0208 2.19583 17.4125 2.5875C17.8042 2.97917 18 3.45 18 4V18C18 18.55 17.8042 19.0208 17.4125 19.4125C17.0208 19.8042 16.55 20 16 20H2ZM2 18H16V8H2V18ZM2 6H16V4H2V6ZM4 12V10H14V12H4ZM4 16V14H11V16H4Z", fill: "currentColor" }) }));
@@ -1,2 +1,2 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- export const MapPinIcon = () => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "20", viewBox: "0 0 14 20", fill: "none", children: _jsx("path", { d: "M7 20C5.23333 20 3.79167 19.7208 2.675 19.1625C1.55833 18.6042 1 17.8833 1 17C1 16.6 1.12083 16.2292 1.3625 15.8875C1.60417 15.5458 1.94167 15.25 2.375 15L3.95 16.475C3.8 16.5417 3.6375 16.6167 3.4625 16.7C3.2875 16.7833 3.15 16.8833 3.05 17C3.26667 17.2667 3.76667 17.5 4.55 17.7C5.33333 17.9 6.15 18 7 18C7.85 18 8.67083 17.9 9.4625 17.7C10.2542 17.5 10.7583 17.2667 10.975 17C10.8583 16.8667 10.7083 16.7583 10.525 16.675C10.3417 16.5917 10.1667 16.5167 10 16.45L11.55 14.95C12.0167 15.2167 12.375 15.5208 12.625 15.8625C12.875 16.2042 13 16.5833 13 17C13 17.8833 12.4417 18.6042 11.325 19.1625C10.2083 19.7208 8.76667 20 7 20ZM7.025 14.5C8.675 13.2833 9.91667 12.0625 10.75 10.8375C11.5833 9.6125 12 8.38333 12 7.15C12 5.45 11.4583 4.16667 10.375 3.3C9.29167 2.43333 8.16667 2 7 2C5.83333 2 4.70833 2.43333 3.625 3.3C2.54167 4.16667 2 5.45 2 7.15C2 8.26667 2.40833 9.42917 3.225 10.6375C4.04167 11.8458 5.30833 13.1333 7.025 14.5ZM7 17C4.65 15.2667 2.89583 13.5833 1.7375 11.95C0.579167 10.3167 0 8.71667 0 7.15C0 5.96667 0.2125 4.92917 0.6375 4.0375C1.0625 3.14583 1.60833 2.4 2.275 1.8C2.94167 1.2 3.69167 0.75 4.525 0.45C5.35833 0.15 6.18333 0 7 0C7.81667 0 8.64167 0.15 9.475 0.45C10.3083 0.75 11.0583 1.2 11.725 1.8C12.3917 2.4 12.9375 3.14583 13.3625 4.0375C13.7875 4.92917 14 5.96667 14 7.15C14 8.71667 13.4208 10.3167 12.2625 11.95C11.1042 13.5833 9.35 15.2667 7 17ZM7 9C7.55 9 8.02083 8.80417 8.4125 8.4125C8.80417 8.02083 9 7.55 9 7C9 6.45 8.80417 5.97917 8.4125 5.5875C8.02083 5.19583 7.55 5 7 5C6.45 5 5.97917 5.19583 5.5875 5.5875C5.19583 5.97917 5 6.45 5 7C5 7.55 5.19583 8.02083 5.5875 8.4125C5.97917 8.80417 6.45 9 7 9Z", fill: "#087E8B" }) }));
2
+ export const MapPinIcon = () => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "20", viewBox: "0 0 14 20", fill: "none", children: _jsx("path", { d: "M7 20C5.23333 20 3.79167 19.7208 2.675 19.1625C1.55833 18.6042 1 17.8833 1 17C1 16.6 1.12083 16.2292 1.3625 15.8875C1.60417 15.5458 1.94167 15.25 2.375 15L3.95 16.475C3.8 16.5417 3.6375 16.6167 3.4625 16.7C3.2875 16.7833 3.15 16.8833 3.05 17C3.26667 17.2667 3.76667 17.5 4.55 17.7C5.33333 17.9 6.15 18 7 18C7.85 18 8.67083 17.9 9.4625 17.7C10.2542 17.5 10.7583 17.2667 10.975 17C10.8583 16.8667 10.7083 16.7583 10.525 16.675C10.3417 16.5917 10.1667 16.5167 10 16.45L11.55 14.95C12.0167 15.2167 12.375 15.5208 12.625 15.8625C12.875 16.2042 13 16.5833 13 17C13 17.8833 12.4417 18.6042 11.325 19.1625C10.2083 19.7208 8.76667 20 7 20ZM7.025 14.5C8.675 13.2833 9.91667 12.0625 10.75 10.8375C11.5833 9.6125 12 8.38333 12 7.15C12 5.45 11.4583 4.16667 10.375 3.3C9.29167 2.43333 8.16667 2 7 2C5.83333 2 4.70833 2.43333 3.625 3.3C2.54167 4.16667 2 5.45 2 7.15C2 8.26667 2.40833 9.42917 3.225 10.6375C4.04167 11.8458 5.30833 13.1333 7.025 14.5ZM7 17C4.65 15.2667 2.89583 13.5833 1.7375 11.95C0.579167 10.3167 0 8.71667 0 7.15C0 5.96667 0.2125 4.92917 0.6375 4.0375C1.0625 3.14583 1.60833 2.4 2.275 1.8C2.94167 1.2 3.69167 0.75 4.525 0.45C5.35833 0.15 6.18333 0 7 0C7.81667 0 8.64167 0.15 9.475 0.45C10.3083 0.75 11.0583 1.2 11.725 1.8C12.3917 2.4 12.9375 3.14583 13.3625 4.0375C13.7875 4.92917 14 5.96667 14 7.15C14 8.71667 13.4208 10.3167 12.2625 11.95C11.1042 13.5833 9.35 15.2667 7 17ZM7 9C7.55 9 8.02083 8.80417 8.4125 8.4125C8.80417 8.02083 9 7.55 9 7C9 6.45 8.80417 5.97917 8.4125 5.5875C8.02083 5.19583 7.55 5 7 5C6.45 5 5.97917 5.19583 5.5875 5.5875C5.19583 5.97917 5 6.45 5 7C5 7.55 5.19583 8.02083 5.5875 8.4125C5.97917 8.80417 6.45 9 7 9Z", fill: "currentColor" }) }));
@@ -1,2 +1,2 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- export const PaymentMethodIcon = () => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "21", height: "15", viewBox: "0 0 21 15", fill: "none", children: _jsx("path", { d: "M11.9038 8.096C11.2051 8.096 10.6138 7.854 10.1298 7.37C9.64575 6.886 9.40375 6.29467 9.40375 5.596C9.40375 4.89733 9.64575 4.306 10.1298 3.822C10.6138 3.338 11.2051 3.096 11.9038 3.096C12.6024 3.096 13.1938 3.338 13.6778 3.822C14.1618 4.306 14.4038 4.89733 14.4038 5.596C14.4038 6.29467 14.1618 6.886 13.6778 7.37C13.1938 7.854 12.6024 8.096 11.9038 8.096ZM5.3075 11.1923C4.8105 11.1923 4.385 11.0153 4.031 10.6613C3.677 10.3073 3.5 9.88167 3.5 9.3845V1.8075C3.5 1.3105 3.677 0.885 4.031 0.531C4.385 0.177 4.8105 0 5.3075 0H18.4998C18.9969 0 19.4225 0.177 19.7765 0.531C20.1305 0.885 20.3075 1.3105 20.3075 1.8075V9.3845C20.3075 9.88167 20.1305 10.3073 19.7765 10.6613C19.4225 11.0153 18.9969 11.1923 18.4998 11.1923H5.3075ZM6.8075 9.69225H17C17 9.19358 17.177 8.76758 17.531 8.41425C17.885 8.06108 18.3105 7.8845 18.8075 7.8845V3.3075C18.3088 3.3075 17.8829 3.1305 17.5298 2.7765C17.1766 2.4225 17 1.997 17 1.5H6.8075C6.8075 1.99867 6.6305 2.42458 6.2765 2.77775C5.9225 3.13092 5.497 3.3075 5 3.3075V7.8845C5.49867 7.8845 5.92458 8.0615 6.27775 8.4155C6.63092 8.7695 6.8075 9.19508 6.8075 9.69225ZM17.3267 14.6923H1.80775C1.31058 14.6923 0.885 14.5153 0.531 14.1613C0.177 13.8073 0 13.3817 0 12.8845V2.98075H1.5V12.8845C1.5 12.9613 1.532 13.0318 1.596 13.096C1.66017 13.1602 1.73075 13.1923 1.80775 13.1923H17.3267V14.6923ZM5.3075 9.69225H5V1.5H5.3075C5.22417 1.5 5.15208 1.53042 5.09125 1.59125C5.03042 1.65208 5 1.72417 5 1.8075V9.3845C5 9.46783 5.03042 9.53992 5.09125 9.60075C5.15208 9.66175 5.22417 9.69225 5.3075 9.69225Z", fill: "#27903F" }) }));
2
+ export const PaymentMethodIcon = () => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "21", height: "15", viewBox: "0 0 21 15", fill: "none", children: _jsx("path", { d: "M11.9038 8.096C11.2051 8.096 10.6138 7.854 10.1298 7.37C9.64575 6.886 9.40375 6.29467 9.40375 5.596C9.40375 4.89733 9.64575 4.306 10.1298 3.822C10.6138 3.338 11.2051 3.096 11.9038 3.096C12.6024 3.096 13.1938 3.338 13.6778 3.822C14.1618 4.306 14.4038 4.89733 14.4038 5.596C14.4038 6.29467 14.1618 6.886 13.6778 7.37C13.1938 7.854 12.6024 8.096 11.9038 8.096ZM5.3075 11.1923C4.8105 11.1923 4.385 11.0153 4.031 10.6613C3.677 10.3073 3.5 9.88167 3.5 9.3845V1.8075C3.5 1.3105 3.677 0.885 4.031 0.531C4.385 0.177 4.8105 0 5.3075 0H18.4998C18.9969 0 19.4225 0.177 19.7765 0.531C20.1305 0.885 20.3075 1.3105 20.3075 1.8075V9.3845C20.3075 9.88167 20.1305 10.3073 19.7765 10.6613C19.4225 11.0153 18.9969 11.1923 18.4998 11.1923H5.3075ZM6.8075 9.69225H17C17 9.19358 17.177 8.76758 17.531 8.41425C17.885 8.06108 18.3105 7.8845 18.8075 7.8845V3.3075C18.3088 3.3075 17.8829 3.1305 17.5298 2.7765C17.1766 2.4225 17 1.997 17 1.5H6.8075C6.8075 1.99867 6.6305 2.42458 6.2765 2.77775C5.9225 3.13092 5.497 3.3075 5 3.3075V7.8845C5.49867 7.8845 5.92458 8.0615 6.27775 8.4155C6.63092 8.7695 6.8075 9.19508 6.8075 9.69225ZM17.3267 14.6923H1.80775C1.31058 14.6923 0.885 14.5153 0.531 14.1613C0.177 13.8073 0 13.3817 0 12.8845V2.98075H1.5V12.8845C1.5 12.9613 1.532 13.0318 1.596 13.096C1.66017 13.1602 1.73075 13.1923 1.80775 13.1923H17.3267V14.6923ZM5.3075 9.69225H5V1.5H5.3075C5.22417 1.5 5.15208 1.53042 5.09125 1.59125C5.03042 1.65208 5 1.72417 5 1.8075V9.3845C5 9.46783 5.03042 9.53992 5.09125 9.60075C5.15208 9.66175 5.22417 9.69225 5.3075 9.69225Z", fill: "currentColor" }) }));
@@ -1,2 +1,2 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- export const UserIcon = () => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: _jsx("path", { d: "M14 13C13.1667 13 12.4583 12.7083 11.875 12.125C11.2917 11.5417 11 10.8333 11 10C11 9.16667 11.2917 8.45833 11.875 7.875C12.4583 7.29167 13.1667 7 14 7C14.8333 7 15.5417 7.29167 16.125 7.875C16.7083 8.45833 17 9.16667 17 10C17 10.8333 16.7083 11.5417 16.125 12.125C15.5417 12.7083 14.8333 13 14 13ZM14 11C14.2833 11 14.5208 10.9042 14.7125 10.7125C14.9042 10.5208 15 10.2833 15 10C15 9.71667 14.9042 9.47917 14.7125 9.2875C14.5208 9.09583 14.2833 9 14 9C13.7167 9 13.4792 9.09583 13.2875 9.2875C13.0958 9.47917 13 9.71667 13 10C13 10.2833 13.0958 10.5208 13.2875 10.7125C13.4792 10.9042 13.7167 11 14 11ZM8 20V17.1C8 16.75 8.08333 16.4208 8.25 16.1125C8.41667 15.8042 8.65 15.5583 8.95 15.375C9.48333 15.0583 10.0458 14.7958 10.6375 14.5875C11.2292 14.3792 11.8333 14.225 12.45 14.125L14 16L15.55 14.125C16.1667 14.225 16.7667 14.3792 17.35 14.5875C17.9333 14.7958 18.4917 15.0583 19.025 15.375C19.325 15.5583 19.5625 15.8042 19.7375 16.1125C19.9125 16.4208 20 16.75 20 17.1V20H8ZM9.975 18H13.05L11.7 16.35C11.4 16.4333 11.1083 16.5417 10.825 16.675C10.5417 16.8083 10.2583 16.95 9.975 17.1V18ZM14.95 18H18V17.1C17.7333 16.9333 17.4583 16.7875 17.175 16.6625C16.8917 16.5375 16.6 16.4333 16.3 16.35L14.95 18ZM2 18C1.45 18 0.979167 17.8042 0.5875 17.4125C0.195833 17.0208 0 16.55 0 16V2C0 1.45 0.195833 0.979167 0.5875 0.5875C0.979167 0.195833 1.45 0 2 0H16C16.55 0 17.0208 0.195833 17.4125 0.5875C17.8042 0.979167 18 1.45 18 2V7C17.7333 6.66667 17.4417 6.35 17.125 6.05C16.8083 5.75 16.4333 5.55 16 5.45V2H2V16H6.15C6.1 16.1833 6.0625 16.3667 6.0375 16.55C6.0125 16.7333 6 16.9167 6 17.1V18H2ZM4 6H11C11.4333 5.66667 11.9083 5.41667 12.425 5.25C12.9417 5.08333 13.4667 5 14 5V4H4V6ZM4 10H9C9 9.65 9.0375 9.30833 9.1125 8.975C9.1875 8.64167 9.29167 8.31667 9.425 8H4V10ZM4 14H7.45C7.63333 13.85 7.82917 13.7167 8.0375 13.6C8.24583 13.4833 8.45833 13.375 8.675 13.275V12H4V14ZM2 16V2V5.425V5V16Z", fill: "#06348D" }) }));
2
+ export const UserIcon = () => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: _jsx("path", { d: "M14 13C13.1667 13 12.4583 12.7083 11.875 12.125C11.2917 11.5417 11 10.8333 11 10C11 9.16667 11.2917 8.45833 11.875 7.875C12.4583 7.29167 13.1667 7 14 7C14.8333 7 15.5417 7.29167 16.125 7.875C16.7083 8.45833 17 9.16667 17 10C17 10.8333 16.7083 11.5417 16.125 12.125C15.5417 12.7083 14.8333 13 14 13ZM14 11C14.2833 11 14.5208 10.9042 14.7125 10.7125C14.9042 10.5208 15 10.2833 15 10C15 9.71667 14.9042 9.47917 14.7125 9.2875C14.5208 9.09583 14.2833 9 14 9C13.7167 9 13.4792 9.09583 13.2875 9.2875C13.0958 9.47917 13 9.71667 13 10C13 10.2833 13.0958 10.5208 13.2875 10.7125C13.4792 10.9042 13.7167 11 14 11ZM8 20V17.1C8 16.75 8.08333 16.4208 8.25 16.1125C8.41667 15.8042 8.65 15.5583 8.95 15.375C9.48333 15.0583 10.0458 14.7958 10.6375 14.5875C11.2292 14.3792 11.8333 14.225 12.45 14.125L14 16L15.55 14.125C16.1667 14.225 16.7667 14.3792 17.35 14.5875C17.9333 14.7958 18.4917 15.0583 19.025 15.375C19.325 15.5583 19.5625 15.8042 19.7375 16.1125C19.9125 16.4208 20 16.75 20 17.1V20H8ZM9.975 18H13.05L11.7 16.35C11.4 16.4333 11.1083 16.5417 10.825 16.675C10.5417 16.8083 10.2583 16.95 9.975 17.1V18ZM14.95 18H18V17.1C17.7333 16.9333 17.4583 16.7875 17.175 16.6625C16.8917 16.5375 16.6 16.4333 16.3 16.35L14.95 18ZM2 18C1.45 18 0.979167 17.8042 0.5875 17.4125C0.195833 17.0208 0 16.55 0 16V2C0 1.45 0.195833 0.979167 0.5875 0.5875C0.979167 0.195833 1.45 0 2 0H16C16.55 0 17.0208 0.195833 17.4125 0.5875C17.8042 0.979167 18 1.45 18 2V7C17.7333 6.66667 17.4417 6.35 17.125 6.05C16.8083 5.75 16.4333 5.55 16 5.45V2H2V16H6.15C6.1 16.1833 6.0625 16.3667 6.0375 16.55C6.0125 16.7333 6 16.9167 6 17.1V18H2ZM4 6H11C11.4333 5.66667 11.9083 5.41667 12.425 5.25C12.9417 5.08333 13.4667 5 14 5V4H4V6ZM4 10H9C9 9.65 9.0375 9.30833 9.1125 8.975C9.1875 8.64167 9.29167 8.31667 9.425 8H4V10ZM4 14H7.45C7.63333 13.85 7.82917 13.7167 8.0375 13.6C8.24583 13.4833 8.45833 13.375 8.675 13.275V12H4V14ZM2 16V2V5.425V5V16Z", fill: "currentColor" }) }));
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ export interface InquiryDetailsStepProps {
3
+ inquirySubject: string;
4
+ inquiryMessage: string;
5
+ onSubjectChange: (value: string) => void;
6
+ onMessageChange: (value: string) => void;
7
+ onBack: () => void;
8
+ onNext: () => void;
9
+ }
10
+ export declare const InquiryDetailsStep: React.FC<InquiryDetailsStepProps>;
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useTheme } from "../react/hooks/useTheme";
3
+ import { getContainerStyles, getPhoneVerifyStyles, getButtonStyles, } from "./theme-styles";
4
+ export const InquiryDetailsStep = ({ inquirySubject, inquiryMessage, onSubjectChange, onMessageChange, onBack, onNext, }) => {
5
+ 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: "Subject" }), _jsx("input", { type: "text", value: inquirySubject, onChange: (e) => onSubjectChange(e.target.value), placeholder: "Enter inquiry subject", style: PHONE_VERIFY_STYLES.phoneInput })] }), _jsxs("div", { style: { marginBottom: "16px" }, children: [_jsxs("label", { style: PHONE_VERIFY_STYLES.label, children: ["Message (", inquiryMessage.length, "/1000)"] }), _jsx("textarea", { value: inquiryMessage, onChange: (e) => onMessageChange(e.target.value), placeholder: "Enter your inquiry message", rows: 5, style: {
10
+ ...PHONE_VERIFY_STYLES.otpInput,
11
+ minHeight: "120px",
12
+ resize: "vertical",
13
+ fontFamily: "inherit",
14
+ } })] }), _jsxs("div", { style: CONTAINER_STYLES.actions, children: [_jsx("button", { onClick: onBack, style: BUTTON_STYLES.secondary, children: "Back" }), _jsx("button", { onClick: onNext, style: BUTTON_STYLES.primary, children: "Next" })] })] }));
15
+ };
@@ -1,10 +1,14 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { GENDER_OPTIONS, BLOOD_GROUP_OPTIONS, } from "./types";
3
- import { BUTTON_STYLES, PATIENT_DETAILS_STYLES, CONTAINER_STYLES, } from "./styles";
3
+ import { useTheme } from "../react/hooks/useTheme";
4
+ import { getButtonStyles, getPatientDetailsStyles, getContainerStyles, } from "./theme-styles";
4
5
  import { UserIcon } from "./Icons/UserIcon";
5
6
  import { MapPinIcon } from "./Icons/MapIcon";
6
7
  import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem, } from "./uiComponents/SelectDropdown";
7
8
  export const PatientDetailsStep = ({ state, dispatch, onBack, onSubmit, }) => {
9
+ const theme = useTheme();
10
+ const CONTAINER_STYLES = getContainerStyles(theme);
11
+ const BUTTON_STYLES = getButtonStyles(theme);
8
12
  const isFormValid = state.patientName &&
9
13
  state.patientAge &&
10
14
  state.patientEmail &&
@@ -22,6 +26,8 @@ export const PatientDetailsStep = ({ state, dispatch, onBack, onSubmit, }) => {
22
26
  }, disabled: !isFormValid || state.loading, onClick: onSubmit, children: state.loading ? "Booking..." : "Continue" })] })] }));
23
27
  };
24
28
  const PatientInfoSection = ({ state, dispatch }) => {
29
+ const theme = useTheme();
30
+ const PATIENT_DETAILS_STYLES = getPatientDetailsStyles(theme);
25
31
  const firstName = state.patientName.split(" ")[0] || "";
26
32
  const lastName = state.patientName.split(" ").slice(1).join(" ") || "";
27
33
  return (_jsxs("div", { style: PATIENT_DETAILS_STYLES.sectionCard, children: [_jsxs("div", { style: PATIENT_DETAILS_STYLES.sectionHeader, children: [_jsx(UserIcon, {}), _jsx("h3", { style: PATIENT_DETAILS_STYLES.sectionTitle, children: "Patient Information" })] }), _jsxs("div", { style: PATIENT_DETAILS_STYLES.sectionBody, children: [_jsxs("div", { style: PATIENT_DETAILS_STYLES.gridRow, children: [_jsxs("div", { children: [_jsxs("label", { style: PATIENT_DETAILS_STYLES.label, children: ["First Name ", _jsx("span", { style: { color: "#EF4444" }, children: "*" })] }), _jsx("input", { style: PATIENT_DETAILS_STYLES.input, placeholder: "Jane", value: firstName, onChange: (e) => {
@@ -54,6 +60,8 @@ const PatientInfoSection = ({ state, dispatch }) => {
54
60
  }), children: [_jsx(SelectTrigger, { children: _jsx(SelectValue, { placeholder: "Select blood group" }) }), _jsx(SelectContent, { children: BLOOD_GROUP_OPTIONS.map((option) => (_jsx(SelectItem, { value: option.value, children: option.label }, option.value))) })] })] })] })] })] }));
55
61
  };
56
62
  const AddressInfoSection = ({ state, dispatch }) => {
63
+ const theme = useTheme();
64
+ const PATIENT_DETAILS_STYLES = getPatientDetailsStyles(theme);
57
65
  return (_jsxs("div", { style: PATIENT_DETAILS_STYLES.sectionCard, children: [_jsxs("div", { style: PATIENT_DETAILS_STYLES.sectionHeader, children: [_jsx(MapPinIcon, {}), _jsx("h3", { style: PATIENT_DETAILS_STYLES.sectionTitle, children: "Address Information" })] }), _jsxs("div", { style: PATIENT_DETAILS_STYLES.sectionBody, children: [_jsxs("div", { style: { marginBottom: 20 }, children: [_jsxs("label", { style: PATIENT_DETAILS_STYLES.label, children: ["Address ", _jsx("span", { style: { color: "#EF4444" }, children: "*" })] }), _jsx("input", { style: PATIENT_DETAILS_STYLES.input, placeholder: "123 Main Street", value: state.patientAddress, onChange: (e) => dispatch({
58
66
  type: "SET_PATIENT_ADDRESS",
59
67
  payload: e.target.value,
@@ -1,9 +1,13 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { COUNTRY_CODES, } from "./types";
3
- import { BUTTON_STYLES, PHONE_VERIFY_STYLES } from "./styles";
2
+ import { COUNTRY_CODES } from "./types";
3
+ import { useTheme } from "../react/hooks/useTheme";
4
+ import { getButtonStyles, getPhoneVerifyStyles } from "./theme-styles";
4
5
  import { validatePhoneNumber, validateCountryCode } from "./validation";
5
6
  import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem, } from "./uiComponents/SelectDropdown";
6
7
  export const PhoneVerificationStep = ({ state, dispatch, onSendOtp, onVerifyOtp, onBack, onContinue, }) => {
8
+ const theme = useTheme();
9
+ const PHONE_VERIFY_STYLES = getPhoneVerifyStyles(theme);
10
+ const BUTTON_STYLES = getButtonStyles(theme);
7
11
  const isPhoneValid = validatePhoneNumber(state.patientPhone) &&
8
12
  validateCountryCode(state.countryCode);
9
13
  return (_jsxs("div", { style: PHONE_VERIFY_STYLES.container, children: [_jsx("div", { style: PHONE_VERIFY_STYLES.header, children: _jsx("h3", { style: PHONE_VERIFY_STYLES.title, children: "Verify Details" }) }), _jsx("div", { style: PHONE_VERIFY_STYLES.content, children: !state.otpSent ? (_jsx(PhoneInputSection, { countryCode: state.countryCode, patientPhone: state.patientPhone, onCountryCodeChange: (code) => {
@@ -20,20 +24,26 @@ export const PhoneVerificationStep = ({ state, dispatch, onSendOtp, onVerifyOtp,
20
24
  }, disabled: state.otpCode.length !== 6 || state.otpVerifying, onClick: onVerifyOtp, children: state.otpVerifying ? "Verifying..." : "Verify OTP" })] })) : (_jsxs(_Fragment, { children: [_jsx("button", { style: BUTTON_STYLES.secondary, onClick: onBack, children: "Back" }), _jsx("button", { style: BUTTON_STYLES.primary, onClick: onContinue, children: "Continue to Details" })] })) })] }));
21
25
  };
22
26
  const PhoneInputSection = ({ countryCode, patientPhone, onCountryCodeChange, onPhoneChange }) => {
27
+ const theme = useTheme();
28
+ const PHONE_VERIFY_STYLES = getPhoneVerifyStyles(theme);
23
29
  const selectedCountry = COUNTRY_CODES.find((c) => c.code === countryCode);
24
30
  return (_jsx(_Fragment, { children: _jsxs("div", { style: { marginBottom: 20 }, children: [_jsx("label", { style: PHONE_VERIFY_STYLES.label, children: "Enter Phone Number" }), _jsxs("div", { style: PHONE_VERIFY_STYLES.phoneInputContainer, children: [_jsx("div", { style: { width: 120 }, children: _jsxs(Select, { value: countryCode, onValueChange: onCountryCodeChange, children: [_jsx(SelectTrigger, { children: _jsx(SelectValue, { placeholder: selectedCountry?.label || "Code" }) }), _jsx(SelectContent, { children: COUNTRY_CODES.map((item) => (_jsx(SelectItem, { value: item.code, children: item.label }, item.code))) })] }) }), _jsx("input", { type: "tel", style: PHONE_VERIFY_STYLES.phoneInput, placeholder: "0000 000 000", value: patientPhone, onChange: (e) => {
25
31
  const value = e.target.value.replace(/\D/g, "");
26
32
  onPhoneChange(value);
27
33
  }, maxLength: 15 })] })] }) }));
28
34
  };
29
- const OtpInputSection = ({ countryCode, patientPhone, otpCode, otpVerified, onOtpChange }) => (_jsxs(_Fragment, { children: [_jsxs("div", { style: { marginBottom: 16 }, children: [_jsx("label", { style: PHONE_VERIFY_STYLES.label, children: "Phone Number" }), _jsxs("div", { style: PHONE_VERIFY_STYLES.phoneDisplay, children: [countryCode, " ", patientPhone] })] }), _jsxs("div", { style: { marginBottom: 20 }, children: [_jsx("label", { style: PHONE_VERIFY_STYLES.label, children: "Enter OTP" }), _jsx("input", { style: {
30
- ...PHONE_VERIFY_STYLES.otpInput,
31
- ...(otpVerified ? { opacity: 0.6, pointerEvents: "none" } : {}),
32
- }, type: "text", placeholder: "Enter 6-digit OTP", value: otpCode, onChange: (e) => {
33
- if (!otpVerified) {
34
- const value = e.target.value.replace(/\D/g, "");
35
- if (value.length <= 6) {
36
- onOtpChange(value);
35
+ const OtpInputSection = ({ countryCode, patientPhone, otpCode, otpVerified, onOtpChange }) => {
36
+ const theme = useTheme();
37
+ const PHONE_VERIFY_STYLES = getPhoneVerifyStyles(theme);
38
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { style: { marginBottom: 16 }, children: [_jsx("label", { style: PHONE_VERIFY_STYLES.label, children: "Phone Number" }), _jsxs("div", { style: PHONE_VERIFY_STYLES.phoneDisplay, children: [countryCode, " ", patientPhone] })] }), _jsxs("div", { style: { marginBottom: 20 }, children: [_jsx("label", { style: PHONE_VERIFY_STYLES.label, children: "Enter OTP" }), _jsx("input", { style: {
39
+ ...PHONE_VERIFY_STYLES.otpInput,
40
+ ...(otpVerified ? { opacity: 0.6, pointerEvents: "none" } : {}),
41
+ }, type: "text", placeholder: "Enter 6-digit OTP", value: otpCode, onChange: (e) => {
42
+ if (!otpVerified) {
43
+ const value = e.target.value.replace(/\D/g, "");
44
+ if (value.length <= 6) {
45
+ onOtpChange(value);
46
+ }
37
47
  }
38
- }
39
- }, maxLength: 6, disabled: otpVerified }), _jsx("div", { style: PHONE_VERIFY_STYLES.otpHint, children: "We've sent a 6-digit code to your phone number" })] }), otpVerified && (_jsxs("div", { style: PHONE_VERIFY_STYLES.successMessage, children: [_jsx("div", { style: PHONE_VERIFY_STYLES.successIcon, children: "\u2713" }), _jsxs("div", { children: [_jsx("div", { style: PHONE_VERIFY_STYLES.successTitle, children: "Phone verified successfully" }), _jsx("div", { style: PHONE_VERIFY_STYLES.successSubtitle, children: "Your phone number has been verified" })] })] }))] }));
48
+ }, maxLength: 6, disabled: otpVerified }), _jsx("div", { style: PHONE_VERIFY_STYLES.otpHint, children: "We've sent a 6-digit code to your phone number" })] }), otpVerified && (_jsxs("div", { style: PHONE_VERIFY_STYLES.successMessage, children: [_jsx("div", { style: PHONE_VERIFY_STYLES.successIcon, children: "\u2713" }), _jsxs("div", { children: [_jsx("div", { style: PHONE_VERIFY_STYLES.successTitle, children: "Phone verified successfully" }), _jsx("div", { style: PHONE_VERIFY_STYLES.successSubtitle, children: "Your phone number has been verified" })] })] }))] }));
49
+ };
@@ -1,3 +1,5 @@
1
1
  import React from "react";
2
- import { SuccessStepProps } from "./types";
2
+ export interface SuccessStepProps {
3
+ onReset: () => void;
4
+ }
3
5
  export declare const SuccessStep: React.FC<SuccessStepProps>;
@@ -1,17 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { BUTTON_STYLES, SUCCESS_STYLES, CONTAINER_STYLES } from "./styles";
3
- import { ConfirmationCheck } from "./Icons/ConfirmationCheck";
4
- export const SuccessStep = ({ state, onReset }) => {
5
- const formattedDate = state.selectedDate
6
- ? new Date(state.selectedDate).toLocaleDateString("en-US", {
7
- weekday: "long",
8
- year: "numeric",
9
- month: "long",
10
- day: "numeric",
11
- })
12
- : "";
13
- const formattedTime = state.selectedSlot
14
- ? state.selectedSlot.startTime
15
- : "TBD";
16
- return (_jsx("div", { style: CONTAINER_STYLES.section, children: _jsxs("div", { style: SUCCESS_STYLES.container, children: [_jsxs("div", { style: SUCCESS_STYLES.header, children: [_jsx("div", { style: SUCCESS_STYLES.iconContainer, children: _jsx(ConfirmationCheck, {}) }), _jsx("div", { children: "Appointment Confirmed!" })] }), _jsxs("div", { style: SUCCESS_STYLES.detailsContainer, children: [_jsx("div", { style: SUCCESS_STYLES.detailsTitle, children: "Your appointment has been successfully booked" }), _jsxs("div", { style: SUCCESS_STYLES.detailsList, children: [_jsxs("div", { children: [_jsx("strong", { children: "Patient Name:" }), " ", state.patientName] }), _jsxs("div", { children: [_jsx("strong", { children: "Consultation Mode:" }), " ", state.consultationMode] }), _jsxs("div", { children: [_jsx("strong", { children: "Date:" }), " ", formattedDate] }), _jsxs("div", { children: [_jsx("strong", { children: "Time:" }), " ", formattedTime] }), state.selectedSlot && (_jsxs("div", { children: [_jsx("strong", { children: "Duration:" }), " ", state.selectedSlot.duration, " minutes"] })), _jsxs("div", { children: [_jsx("strong", { children: "Charge:" }), " ", state.consultationCharge] })] }), _jsxs("div", { style: SUCCESS_STYLES.confirmationNote, children: ["A confirmation email has been sent to ", state.patientEmail] })] }), _jsx("div", { style: SUCCESS_STYLES.actionContainer, children: _jsx("button", { style: BUTTON_STYLES.primary, onClick: onReset, children: "Book Another Appointment" }) })] }) }));
2
+ import { useTheme } from "../react/hooks/useTheme";
3
+ import { getSuccessStyles, getButtonStyles } from "./theme-styles";
4
+ export const SuccessStep = ({ onReset }) => {
5
+ const theme = useTheme();
6
+ const SUCCESS_STYLES = getSuccessStyles(theme);
7
+ const BUTTON_STYLES = getButtonStyles(theme);
8
+ return (_jsxs("div", { style: SUCCESS_STYLES.container, children: [_jsx("div", { style: SUCCESS_STYLES.iconContainer, children: _jsx("div", { style: { fontSize: "48px", color: theme.colors.success }, children: "\u2713" }) }), _jsxs("div", { style: SUCCESS_STYLES.detailsContainer, children: [_jsx("h3", { style: SUCCESS_STYLES.detailsTitle, children: "Inquiry Submitted Successfully" }), _jsx("p", { style: SUCCESS_STYLES.confirmationNote, children: "Thank you for your inquiry. We will get back to you soon." })] }), _jsx("div", { style: SUCCESS_STYLES.actionContainer, children: _jsx("button", { onClick: onReset, style: BUTTON_STYLES.primary, children: "Submit Another Inquiry" }) })] }));
17
9
  };
@@ -2,14 +2,15 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState, useEffect } from "react";
3
3
  import ChevronLeft from "./Icons/ChevronLeft";
4
4
  import ChevronRight from "./Icons/ChevronRight";
5
- const style = `
5
+ import { useTheme } from "../react/hooks/useTheme";
6
+ const getStyle = (theme) => `
6
7
  .custom-calendar {
7
8
  width: 340px;
8
- background-color: #ffffff;
9
- border-radius: 8px;
9
+ background-color: ${theme.colors.background};
10
+ border-radius: ${theme.radii.md};
10
11
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
11
12
  padding: 16px;
12
- font-family: Inter, sans-serif;
13
+ font-family: ${theme.typography.fontFamily};
13
14
  }
14
15
  .calendar-header {
15
16
  display: flex;
@@ -20,18 +21,18 @@ const style = `
20
21
  .calendar-month {
21
22
  font-size: 14px;
22
23
  font-weight: 600;
23
- color: #1e1e1e;
24
+ color: ${theme.colors.text};
24
25
  }
25
26
  .calendar-nav {
26
27
  width: 20px;
27
28
  height: 20px;
28
- color: #218838;
29
+ color: ${theme.colors.secondary};
29
30
  cursor: pointer;
30
- border-radius: 4px;
31
+ border-radius: ${theme.radii.sm};
31
32
  transition: background-color 0.2s;
32
33
  }
33
34
  .calendar-nav:hover {
34
- background-color: #eaf8f0;
35
+ background-color: ${theme.colors.backgroundSecondary};
35
36
  }
36
37
  .calendar-days-header {
37
38
  display: grid;
@@ -40,7 +41,7 @@ const style = `
40
41
  margin-bottom: 6px;
41
42
  font-size: 13px;
42
43
  font-weight: 500;
43
- color: #222;
44
+ color: ${theme.colors.text};
44
45
  }
45
46
  .calendar-grid {
46
47
  display: grid;
@@ -52,8 +53,8 @@ const style = `
52
53
  width: 38px;
53
54
  height: 38px;
54
55
  border: 1px solid transparent;
55
- border-radius: 6px;
56
- color: #218838;
56
+ border-radius: ${theme.radii.md};
57
+ color: ${theme.colors.secondary};
57
58
  background-color: transparent;
58
59
  font-size: 14px;
59
60
  transition: all 0.2s;
@@ -66,17 +67,17 @@ const style = `
66
67
  line-height: 1;
67
68
  }
68
69
  .calendar-day:hover:not(.disabled):not(.selected) {
69
- background-color: #218838;
70
- color: #ffffff;
70
+ background-color: ${theme.colors.secondary};
71
+ color: ${theme.colors.textOnSecondary};
71
72
  }
72
73
  .calendar-day.selected {
73
- border: 1px solid #218838;
74
- color: #218838;
74
+ border: 1px solid ${theme.colors.secondary};
75
+ color: ${theme.colors.secondary};
75
76
  background-color: transparent;
76
77
  font-weight: 600;
77
78
  }
78
79
  .calendar-day.disabled {
79
- color: #b3b3b3;
80
+ color: ${theme.colors.textSecondary};
80
81
  opacity: 0.4;
81
82
  cursor: not-allowed;
82
83
  }
@@ -90,22 +91,39 @@ const style = `
90
91
  }
91
92
  `;
92
93
  export const CustomCalendarWithDateSelector = ({ selectedDate, onSelect, pastDisabled = false, }) => {
94
+ const theme = useTheme();
93
95
  useEffect(() => {
94
- if (!document.getElementById("custom-calendar-style")) {
96
+ const styleId = "custom-calendar-style";
97
+ const existingStyle = document.getElementById(styleId);
98
+ const themeStyle = getStyle(theme);
99
+ if (existingStyle) {
100
+ existingStyle.innerHTML = themeStyle;
101
+ }
102
+ else {
95
103
  const s = document.createElement("style");
96
- s.id = "custom-calendar-style";
97
- s.innerHTML = style;
104
+ s.id = styleId;
105
+ s.innerHTML = themeStyle;
98
106
  document.head.appendChild(s);
99
107
  }
100
- }, []);
108
+ }, [theme]);
101
109
  const today = new Date();
102
110
  today.setHours(0, 0, 0, 0);
103
111
  const [currentMonth, setCurrentMonth] = useState(today.getMonth());
104
112
  const [currentYear, setCurrentYear] = useState(today.getFullYear());
105
113
  const daysOfWeek = ["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"];
106
114
  const months = [
107
- "January", "February", "March", "April", "May", "June",
108
- "July", "August", "September", "October", "November", "December"
115
+ "January",
116
+ "February",
117
+ "March",
118
+ "April",
119
+ "May",
120
+ "June",
121
+ "July",
122
+ "August",
123
+ "September",
124
+ "October",
125
+ "November",
126
+ "December",
109
127
  ];
110
128
  const getDaysInMonth = (year, month) => {
111
129
  return new Date(year, month + 1, 0).getDate();
@@ -135,9 +153,9 @@ export const CustomCalendarWithDateSelector = ({ selectedDate, onSelect, pastDis
135
153
  }
136
154
  };
137
155
  const isSameDate = (d1, d2) => {
138
- return d1.getFullYear() === d2.getFullYear() &&
156
+ return (d1.getFullYear() === d2.getFullYear() &&
139
157
  d1.getMonth() === d2.getMonth() &&
140
- d1.getDate() === d2.getDate();
158
+ d1.getDate() === d2.getDate());
141
159
  };
142
160
  const isBeforeToday = (date) => {
143
161
  const todayStart = new Date(today);
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ import { MedosTheme } from "../core/theme/types";
3
+ export declare function getContainerStyles(theme: MedosTheme, prefix?: string): Record<string, React.CSSProperties>;
4
+ export declare function getButtonStyles(theme: MedosTheme, prefix?: string): Record<string, React.CSSProperties>;
5
+ export declare function getPhoneVerifyStyles(theme: MedosTheme, prefix?: string): Record<string, React.CSSProperties>;
6
+ export declare function getPatientDetailsStyles(theme: MedosTheme, prefix?: string): Record<string, React.CSSProperties>;
7
+ export declare function getSuccessStyles(theme: MedosTheme, prefix?: string): Record<string, React.CSSProperties>;
8
+ export declare const CONTAINER_STYLES: Record<string, React.CSSProperties>;
9
+ export declare const BUTTON_STYLES: Record<string, React.CSSProperties>;
10
+ export declare const PHONE_VERIFY_STYLES: Record<string, React.CSSProperties>;
11
+ export declare const PATIENT_DETAILS_STYLES: Record<string, React.CSSProperties>;
12
+ export declare const SUCCESS_STYLES: Record<string, React.CSSProperties>;