medos-sdk 1.1.11 → 1.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/MedosClient.js +1 -1
- package/dist/components/appointment-booking/AppointmentCalender.js +10 -72
- package/dist/components/appointment-booking/appointment-modal-styles.d.ts +272 -0
- package/dist/components/appointment-booking/appointment-modal-styles.js +419 -0
- package/dist/components/appointment-booking/components/AppointmentConfirmationStep.d.ts +28 -0
- package/dist/components/appointment-booking/components/AppointmentConfirmationStep.js +107 -0
- package/dist/components/appointment-booking/components/AppointmentDateTimeModal.d.ts +18 -0
- package/dist/components/appointment-booking/components/AppointmentDateTimeModal.js +306 -0
- package/dist/components/appointment-booking/components/AppointmentSummaryStep.d.ts +12 -0
- package/dist/components/appointment-booking/components/AppointmentSummaryStep.js +194 -0
- package/dist/components/appointment-booking/components/BookingOptionStep.d.ts +14 -0
- package/dist/components/appointment-booking/components/BookingOptionStep.js +350 -0
- package/dist/components/appointment-booking/components/DoctorSelectModal.d.ts +14 -0
- package/dist/components/appointment-booking/components/DoctorSelectModal.js +213 -0
- package/dist/components/appointment-booking/components/PatientDetailsStep.d.ts +3 -0
- package/dist/components/appointment-booking/components/PatientDetailsStep.js +96 -0
- package/dist/components/appointment-booking/components/PatientSelectionStep.d.ts +12 -0
- package/dist/components/appointment-booking/components/PatientSelectionStep.js +254 -0
- package/dist/components/appointment-booking/components/PhoneVerificationStep.d.ts +3 -0
- package/dist/components/appointment-booking/components/PhoneVerificationStep.js +49 -0
- package/dist/components/appointment-booking/components/SuccessStep.d.ts +5 -0
- package/dist/components/appointment-booking/components/SuccessStep.js +9 -0
- package/dist/components/appointment-booking/components/index.d.ts +9 -0
- package/dist/components/appointment-booking/components/index.js +9 -0
- package/dist/components/appointment-booking/hooks/useAppointmentFlow.js +1 -0
- package/dist/components/appointment-booking/index.d.ts +2 -4
- package/dist/components/appointment-booking/index.js +2 -2
- package/dist/components/appointment-booking/types.d.ts +4 -0
- package/dist/components/constants/constant.d.ts +2 -0
- package/dist/components/constants/constant.js +15 -0
- package/dist/components/constants/index.d.ts +3 -0
- package/dist/components/constants/index.js +24 -0
- package/dist/components/constants/options.d.ts +13 -0
- package/dist/components/constants/options.js +35 -0
- package/dist/components/constants/validation.d.ts +6 -0
- package/dist/components/constants/validation.js +16 -0
- package/dist/components/enquiry-form/EnquiryForm.d.ts +7 -0
- package/dist/components/enquiry-form/EnquiryForm.js +238 -0
- package/dist/components/enquiry-form/components/ContactInformationStep.d.ts +13 -0
- package/dist/components/enquiry-form/components/ContactInformationStep.js +21 -0
- package/dist/components/enquiry-form/components/ContactPreferenceStep.d.ts +9 -0
- package/dist/components/enquiry-form/components/ContactPreferenceStep.js +20 -0
- package/dist/components/enquiry-form/components/InquiryDetailsStep.d.ts +10 -0
- package/dist/components/enquiry-form/components/InquiryDetailsStep.js +20 -0
- package/dist/components/enquiry-form/components/index.d.ts +3 -0
- package/dist/components/enquiry-form/components/index.js +3 -0
- package/dist/components/enquiry-form/index.d.ts +2 -0
- package/dist/components/enquiry-form/index.js +2 -0
- package/dist/components/index.d.ts +7 -0
- package/dist/components/index.js +7 -0
- package/dist/components/shared/icons/Check.d.ts +6 -0
- package/dist/components/shared/icons/Check.js +2 -0
- package/dist/components/shared/icons/ChevronDownIcon.d.ts +4 -0
- package/dist/components/shared/icons/ChevronDownIcon.js +2 -0
- package/dist/components/shared/icons/ChevronLeft.d.ts +3 -0
- package/dist/components/shared/icons/ChevronLeft.js +3 -0
- package/dist/components/shared/icons/ChevronRight.d.ts +3 -0
- package/dist/components/shared/icons/ChevronRight.js +3 -0
- package/dist/components/shared/icons/CloseIcon.d.ts +9 -0
- package/dist/components/shared/icons/CloseIcon.js +5 -0
- package/dist/components/shared/icons/ConfirmationCheck.d.ts +1 -0
- package/dist/components/shared/icons/ConfirmationCheck.js +9 -0
- package/dist/components/shared/icons/ConsultationType.d.ts +1 -0
- package/dist/components/shared/icons/ConsultationType.js +2 -0
- package/dist/components/shared/icons/Date&TimeIcon.d.ts +1 -0
- package/dist/components/shared/icons/Date&TimeIcon.js +2 -0
- package/dist/components/shared/icons/MapIcon.d.ts +1 -0
- package/dist/components/shared/icons/MapIcon.js +2 -0
- package/dist/components/shared/icons/MedosLogo.d.ts +3 -0
- package/dist/components/shared/icons/MedosLogo.js +3 -0
- package/dist/components/shared/icons/PaymentMethodIcon.d.ts +1 -0
- package/dist/components/shared/icons/PaymentMethodIcon.js +2 -0
- package/dist/components/shared/icons/SuccessIcon.d.ts +8 -0
- package/dist/components/shared/icons/SuccessIcon.js +14 -0
- package/dist/components/shared/icons/UserIcon.d.ts +1 -0
- package/dist/components/shared/icons/UserIcon.js +2 -0
- package/dist/components/shared/icons/index.d.ts +13 -0
- package/dist/components/shared/icons/index.js +13 -0
- package/dist/components/shared/index.d.ts +2 -0
- package/dist/components/shared/index.js +2 -0
- package/dist/components/shared/ui/Calendar.d.ts +5 -0
- package/dist/components/shared/ui/Calendar.js +167 -0
- package/dist/components/shared/ui/SelectDropdown.d.ts +41 -0
- package/dist/components/shared/ui/SelectDropdown.js +301 -0
- package/dist/components/shared/ui/index.d.ts +2 -0
- package/dist/components/shared/ui/index.js +2 -0
- package/dist/components/styles/appointment.d.ts +4 -0
- package/dist/components/styles/appointment.js +220 -0
- package/dist/components/styles/enquiry.d.ts +2 -0
- package/dist/components/styles/enquiry.js +3 -0
- package/dist/components/styles/index.d.ts +2 -0
- package/dist/components/styles/index.js +2 -0
- package/dist/components/styles/shared.d.ts +3 -0
- package/dist/components/styles/shared.js +78 -0
- package/dist/components/styles.d.ts +1 -6
- package/dist/components/styles.js +1 -298
- package/dist/components/theme-styles.js +18 -0
- package/dist/components/types/appointment.d.ts +42 -0
- package/dist/components/types/appointment.js +1 -0
- package/dist/components/types/common.d.ts +24 -0
- package/dist/components/types/common.js +1 -0
- package/dist/components/types/enquiry.d.ts +59 -0
- package/dist/components/types/enquiry.js +1 -0
- package/dist/components/types/index.d.ts +4 -0
- package/dist/components/types/index.js +4 -0
- package/dist/components/types.d.ts +1 -54
- package/dist/components/types.js +1 -38
- package/dist/components/utils/date.d.ts +4 -0
- package/dist/components/utils/date.js +65 -0
- package/dist/components/utils/formatting.d.ts +4 -0
- package/dist/components/utils/formatting.js +9 -0
- package/dist/components/utils/index.d.ts +3 -0
- package/dist/components/utils/index.js +3 -0
- package/dist/components/utils/validation.d.ts +4 -0
- package/dist/components/utils/validation.js +37 -0
- package/dist/components/utils.d.ts +1 -8
- package/dist/components/utils.js +1 -74
- package/dist/components/validation.d.ts +1 -4
- package/dist/components/validation.js +1 -48
- package/dist/constants/index.d.ts +1 -1
- package/dist/constants/index.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/react/index.d.ts +3 -3
- package/dist/react/index.js +1 -1
- package/dist/services/AppointmentService.js +26 -9
- package/dist/services/AuthService.js +1 -1
- package/dist/vanilla/AppointmentCalendarWidget.d.ts +8 -0
- package/dist/vanilla/AppointmentCalendarWidget.js +598 -20
- package/dist/vanilla/components/appointment-booking/appointment-modal-styles.d.ts +272 -0
- package/dist/vanilla/components/appointment-booking/components/AppointmentConfirmationStep.d.ts +28 -0
- package/dist/vanilla/components/appointment-booking/components/AppointmentDateTimeModal.d.ts +18 -0
- package/dist/vanilla/components/appointment-booking/components/AppointmentSummaryStep.d.ts +12 -0
- package/dist/vanilla/components/appointment-booking/components/BookingOptionStep.d.ts +14 -0
- package/dist/vanilla/components/appointment-booking/components/DoctorSelectModal.d.ts +14 -0
- package/dist/vanilla/components/appointment-booking/components/PatientDetailsStep.d.ts +3 -0
- package/dist/vanilla/components/appointment-booking/components/PatientSelectionStep.d.ts +12 -0
- package/dist/vanilla/components/appointment-booking/components/PhoneVerificationStep.d.ts +3 -0
- package/dist/vanilla/components/appointment-booking/components/SuccessStep.d.ts +5 -0
- package/dist/vanilla/components/appointment-booking/components/index.d.ts +9 -0
- package/dist/vanilla/components/appointment-booking/index.d.ts +2 -4
- package/dist/vanilla/components/appointment-booking/types.d.ts +4 -0
- package/dist/vanilla/components/constants/constant.d.ts +2 -0
- package/dist/vanilla/components/constants/index.d.ts +3 -0
- package/dist/vanilla/components/constants/options.d.ts +13 -0
- package/dist/vanilla/components/constants/validation.d.ts +6 -0
- package/dist/vanilla/components/enquiry-form/EnquiryForm.d.ts +7 -0
- package/dist/vanilla/components/enquiry-form/components/ContactInformationStep.d.ts +13 -0
- package/dist/vanilla/components/enquiry-form/components/ContactPreferenceStep.d.ts +9 -0
- package/dist/vanilla/components/enquiry-form/components/InquiryDetailsStep.d.ts +10 -0
- package/dist/vanilla/components/enquiry-form/components/index.d.ts +3 -0
- package/dist/vanilla/components/enquiry-form/index.d.ts +2 -0
- package/dist/vanilla/components/index.d.ts +7 -3
- package/dist/vanilla/components/shared/icons/Check.d.ts +6 -0
- package/dist/vanilla/components/shared/icons/ChevronDownIcon.d.ts +4 -0
- package/dist/vanilla/components/shared/icons/ChevronLeft.d.ts +3 -0
- package/dist/vanilla/components/shared/icons/ChevronRight.d.ts +3 -0
- package/dist/vanilla/components/shared/icons/CloseIcon.d.ts +9 -0
- package/dist/vanilla/components/shared/icons/ConfirmationCheck.d.ts +1 -0
- package/dist/vanilla/components/shared/icons/ConsultationType.d.ts +1 -0
- package/dist/vanilla/components/shared/icons/Date&TimeIcon.d.ts +1 -0
- package/dist/vanilla/components/shared/icons/MapIcon.d.ts +1 -0
- package/dist/vanilla/components/shared/icons/MedosLogo.d.ts +3 -0
- package/dist/vanilla/components/shared/icons/PaymentMethodIcon.d.ts +1 -0
- package/dist/vanilla/components/shared/icons/SuccessIcon.d.ts +8 -0
- package/dist/vanilla/components/shared/icons/UserIcon.d.ts +1 -0
- package/dist/vanilla/components/shared/icons/index.d.ts +13 -0
- package/dist/vanilla/components/shared/index.d.ts +2 -0
- package/dist/vanilla/components/shared/ui/Calendar.d.ts +5 -0
- package/dist/vanilla/components/shared/ui/SelectDropdown.d.ts +41 -0
- package/dist/vanilla/components/shared/ui/index.d.ts +2 -0
- package/dist/vanilla/components/styles/appointment.d.ts +4 -0
- package/dist/vanilla/components/styles/enquiry.d.ts +2 -0
- package/dist/vanilla/components/styles/index.d.ts +2 -0
- package/dist/vanilla/components/styles/shared.d.ts +3 -0
- package/dist/vanilla/components/styles.d.ts +1 -6
- package/dist/vanilla/components/types/appointment.d.ts +42 -0
- package/dist/vanilla/components/types/common.d.ts +24 -0
- package/dist/vanilla/components/types/enquiry.d.ts +59 -0
- package/dist/vanilla/components/types/index.d.ts +4 -0
- package/dist/vanilla/components/types.d.ts +1 -54
- package/dist/vanilla/components/utils/date.d.ts +4 -0
- package/dist/vanilla/components/utils/formatting.d.ts +4 -0
- package/dist/vanilla/components/utils/index.d.ts +3 -0
- package/dist/vanilla/components/utils/validation.d.ts +4 -0
- package/dist/vanilla/components/utils.d.ts +1 -8
- package/dist/vanilla/components/validation.d.ts +1 -4
- package/dist/vanilla/constants/index.d.ts +1 -1
- package/dist/vanilla/enquiry-widget.js +3277 -56
- package/dist/vanilla/index.d.ts +2 -2
- package/dist/vanilla/react/index.d.ts +3 -3
- package/dist/vanilla/vanilla/AppointmentCalendarWidget.d.ts +8 -0
- package/dist/vanilla/widget.css +214 -0
- package/dist/vanilla/widget.js +4047 -187
- package/package.json +2 -2
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { GENDER_OPTIONS, BLOOD_GROUP_OPTIONS } from "../../constants/options";
|
|
3
|
+
import { useTheme } from "../../../react/hooks/useTheme";
|
|
4
|
+
import { useBreakpoint } from "../../../core/theme/responsive";
|
|
5
|
+
import { getButtonStyles, getPatientDetailsStyles, getContainerStyles, } from "../../theme-styles";
|
|
6
|
+
import { UserIcon, MapPinIcon } from "../../shared/icons";
|
|
7
|
+
import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem, } from "../../shared/ui/SelectDropdown";
|
|
8
|
+
export const PatientDetailsStep = ({ state, dispatch, onBack, onSubmit, isFirstStep = false, }) => {
|
|
9
|
+
const theme = useTheme();
|
|
10
|
+
const breakpoint = useBreakpoint(theme);
|
|
11
|
+
const CONTAINER_STYLES = getContainerStyles(theme, "medos", breakpoint);
|
|
12
|
+
const BUTTON_STYLES = getButtonStyles(theme, "medos", breakpoint);
|
|
13
|
+
const isFormValid = state.patientName &&
|
|
14
|
+
state.patientAge &&
|
|
15
|
+
state.patientGender &&
|
|
16
|
+
state.patientAddress &&
|
|
17
|
+
state.patientCity &&
|
|
18
|
+
state.patientState &&
|
|
19
|
+
state.patientCountry &&
|
|
20
|
+
state.patientZipcode &&
|
|
21
|
+
state.otpVerified;
|
|
22
|
+
return (_jsxs("div", { style: CONTAINER_STYLES.section, children: [_jsx(PatientInfoSection, { state: state, dispatch: dispatch }), _jsx(AddressInfoSection, { state: state, dispatch: dispatch }), _jsxs("div", { style: {
|
|
23
|
+
...CONTAINER_STYLES.actions,
|
|
24
|
+
justifyContent: isFirstStep ? "flex-end" : "space-between",
|
|
25
|
+
}, children: [!isFirstStep && (_jsx("button", { style: BUTTON_STYLES.secondary, onClick: onBack, children: "Back" })), _jsx("button", { style: {
|
|
26
|
+
...BUTTON_STYLES.primary,
|
|
27
|
+
opacity: isFormValid ? 1 : 0.6,
|
|
28
|
+
}, disabled: !isFormValid || state.loading, onClick: onSubmit, children: state.loading ? "Booking..." : "Continue" })] })] }));
|
|
29
|
+
};
|
|
30
|
+
const PatientInfoSection = ({ state, dispatch }) => {
|
|
31
|
+
const theme = useTheme();
|
|
32
|
+
const breakpoint = useBreakpoint(theme);
|
|
33
|
+
const PATIENT_DETAILS_STYLES = getPatientDetailsStyles(theme, "medos", breakpoint);
|
|
34
|
+
const firstName = state.patientName.split(" ")[0] || "";
|
|
35
|
+
const lastName = state.patientName.split(" ").slice(1).join(" ") || "";
|
|
36
|
+
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) => {
|
|
37
|
+
dispatch({
|
|
38
|
+
type: "SET_PATIENT_NAME",
|
|
39
|
+
payload: `${e.target.value} ${lastName}`,
|
|
40
|
+
});
|
|
41
|
+
} })] }), _jsxs("div", { children: [_jsxs("label", { style: PATIENT_DETAILS_STYLES.label, children: ["Last Name ", _jsx("span", { style: { color: "#EF4444" }, children: "*" })] }), _jsx("input", { style: PATIENT_DETAILS_STYLES.input, placeholder: "Doe", value: lastName, onChange: (e) => {
|
|
42
|
+
dispatch({
|
|
43
|
+
type: "SET_PATIENT_NAME",
|
|
44
|
+
payload: `${firstName} ${e.target.value}`,
|
|
45
|
+
});
|
|
46
|
+
} })] })] }), _jsxs("div", { style: PATIENT_DETAILS_STYLES.gridRow, children: [_jsxs("div", { children: [_jsxs("label", { style: PATIENT_DETAILS_STYLES.label, children: ["Age ", _jsx("span", { style: { color: "#EF4444" }, children: "*" })] }), _jsx("input", { style: PATIENT_DETAILS_STYLES.input, type: "number", placeholder: "25", value: state.patientAge || "", min: "0", max: "120", onChange: (e) => {
|
|
47
|
+
const val = e.target.value;
|
|
48
|
+
if (val === "") {
|
|
49
|
+
dispatch({
|
|
50
|
+
type: "SET_PATIENT_AGE",
|
|
51
|
+
payload: "",
|
|
52
|
+
});
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const age = parseInt(val);
|
|
56
|
+
if (!isNaN(age) && age >= 0 && age <= 120) {
|
|
57
|
+
dispatch({
|
|
58
|
+
type: "SET_PATIENT_AGE",
|
|
59
|
+
payload: val,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
} })] }), _jsxs("div", { children: [_jsx("label", { style: PATIENT_DETAILS_STYLES.label, children: "Email" }), _jsx("input", { style: PATIENT_DETAILS_STYLES.input, type: "email", placeholder: "jane@example.com (optional)", value: state.patientEmail, onChange: (e) => dispatch({
|
|
63
|
+
type: "SET_PATIENT_EMAIL",
|
|
64
|
+
payload: e.target.value,
|
|
65
|
+
}) })] })] }), _jsxs("div", { style: PATIENT_DETAILS_STYLES.gridRow, children: [_jsxs("div", { children: [_jsxs("label", { style: PATIENT_DETAILS_STYLES.label, children: ["Gender ", _jsx("span", { style: { color: "#EF4444" }, children: "*" })] }), _jsxs(Select, { value: state.patientGender, onValueChange: (value) => dispatch({
|
|
66
|
+
type: "SET_PATIENT_GENDER",
|
|
67
|
+
payload: value,
|
|
68
|
+
}), children: [_jsx(SelectTrigger, { children: _jsx(SelectValue, { placeholder: "Select gender" }) }), _jsx(SelectContent, { children: GENDER_OPTIONS.map((option) => (_jsx(SelectItem, { value: option.value, children: option.label }, option.value))) })] })] }), _jsxs("div", { children: [_jsx("label", { style: PATIENT_DETAILS_STYLES.label, children: "Blood Group" }), _jsxs(Select, { value: state.bloodGroup, onValueChange: (value) => dispatch({
|
|
69
|
+
type: "SET_BLOOD_GROUP",
|
|
70
|
+
payload: value,
|
|
71
|
+
}), children: [_jsx(SelectTrigger, { children: _jsx(SelectValue, { placeholder: "Select blood group (optional)" }) }), _jsx(SelectContent, { children: BLOOD_GROUP_OPTIONS.map((option) => (_jsx(SelectItem, { value: option.value, children: option.label }, option.value))) })] })] })] })] })] }));
|
|
72
|
+
};
|
|
73
|
+
const AddressInfoSection = ({ state, dispatch }) => {
|
|
74
|
+
const theme = useTheme();
|
|
75
|
+
const breakpoint = useBreakpoint(theme);
|
|
76
|
+
const PATIENT_DETAILS_STYLES = getPatientDetailsStyles(theme, "medos", breakpoint);
|
|
77
|
+
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({
|
|
78
|
+
type: "SET_PATIENT_ADDRESS",
|
|
79
|
+
payload: e.target.value,
|
|
80
|
+
}) })] }), _jsxs("div", { style: PATIENT_DETAILS_STYLES.gridRow, children: [_jsxs("div", { children: [_jsxs("label", { style: PATIENT_DETAILS_STYLES.label, children: ["City ", _jsx("span", { style: { color: "#EF4444" }, children: "*" })] }), _jsx("input", { style: PATIENT_DETAILS_STYLES.input, placeholder: "New York", value: state.patientCity, onChange: (e) => dispatch({
|
|
81
|
+
type: "SET_PATIENT_CITY",
|
|
82
|
+
payload: e.target.value,
|
|
83
|
+
}) })] }), _jsxs("div", { children: [_jsxs("label", { style: PATIENT_DETAILS_STYLES.label, children: ["State ", _jsx("span", { style: { color: "#EF4444" }, children: "*" })] }), _jsx("input", { style: PATIENT_DETAILS_STYLES.input, placeholder: "NY", value: state.patientState, onChange: (e) => dispatch({
|
|
84
|
+
type: "SET_PATIENT_STATE",
|
|
85
|
+
payload: e.target.value,
|
|
86
|
+
}) })] })] }), _jsxs("div", { style: PATIENT_DETAILS_STYLES.gridRow, children: [_jsxs("div", { children: [_jsxs("label", { style: PATIENT_DETAILS_STYLES.label, children: ["Country ", _jsx("span", { style: { color: "#EF4444" }, children: "*" })] }), _jsx("input", { style: PATIENT_DETAILS_STYLES.input, placeholder: "United States", value: state.patientCountry, onChange: (e) => dispatch({
|
|
87
|
+
type: "SET_PATIENT_COUNTRY",
|
|
88
|
+
payload: e.target.value,
|
|
89
|
+
}) })] }), _jsxs("div", { children: [_jsxs("label", { style: PATIENT_DETAILS_STYLES.label, children: ["Zipcode ", _jsx("span", { style: { color: "#EF4444" }, children: "*" })] }), _jsx("input", { style: PATIENT_DETAILS_STYLES.input, placeholder: "10001", value: state.patientZipcode, onChange: (e) => dispatch({
|
|
90
|
+
type: "SET_PATIENT_ZIPCODE",
|
|
91
|
+
payload: e.target.value,
|
|
92
|
+
}) })] })] }), _jsxs("div", { style: { marginTop: 20 }, children: [_jsx("label", { style: PATIENT_DETAILS_STYLES.label, children: "Landmark" }), _jsx("input", { style: PATIENT_DETAILS_STYLES.input, placeholder: "Near Central Park", value: state.patientLandmark, onChange: (e) => dispatch({
|
|
93
|
+
type: "SET_PATIENT_LANDMARK",
|
|
94
|
+
payload: e.target.value,
|
|
95
|
+
}) })] })] })] }));
|
|
96
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Patient } from "../types";
|
|
3
|
+
interface PatientSelectionStepProps {
|
|
4
|
+
verifiedPatients: Patient[];
|
|
5
|
+
selectedPatient: Patient | null;
|
|
6
|
+
onSelectPatient: (patient: Patient) => void;
|
|
7
|
+
onProceedAsNewPatient: () => void;
|
|
8
|
+
onBack: () => void;
|
|
9
|
+
isFirstStep?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const PatientSelectionStep: React.FC<PatientSelectionStepProps>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,254 @@
|
|
|
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 { getButtonStyles } from "../../theme-styles";
|
|
5
|
+
export const PatientSelectionStep = ({ verifiedPatients, selectedPatient, onSelectPatient, onProceedAsNewPatient, onBack, isFirstStep = false, }) => {
|
|
6
|
+
const theme = useTheme();
|
|
7
|
+
const BUTTON_STYLES = getButtonStyles(theme);
|
|
8
|
+
const styles = getPatientSelectionStyles(theme);
|
|
9
|
+
const [tempSelection, setTempSelection] = React.useState(null);
|
|
10
|
+
const handlePatientSelect = (patient) => {
|
|
11
|
+
setTempSelection({ type: "existing", patient });
|
|
12
|
+
};
|
|
13
|
+
const handleNewPatientSelect = () => {
|
|
14
|
+
setTempSelection({ type: "new" });
|
|
15
|
+
};
|
|
16
|
+
const handleNext = () => {
|
|
17
|
+
if (tempSelection) {
|
|
18
|
+
if (tempSelection.type === "existing" && tempSelection.patient) {
|
|
19
|
+
onSelectPatient(tempSelection.patient);
|
|
20
|
+
}
|
|
21
|
+
else if (tempSelection.type === "new") {
|
|
22
|
+
onProceedAsNewPatient();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
return (_jsxs("div", { style: styles.container, children: [_jsxs("div", { style: styles.header, children: [_jsx("h3", { style: styles.title, children: "Select Patient" }), verifiedPatients.length > 0 ? (_jsxs("p", { style: styles.subtitle, children: ["We found ", verifiedPatients.length, " registered patient", verifiedPatients.length > 1 ? "s" : "", " with this number"] })) : (_jsx("p", { style: styles.subtitle, children: "No registered patients found with this number" }))] }), _jsxs("div", { style: styles.content, children: [verifiedPatients.length > 0 && (_jsxs(_Fragment, { children: [_jsx("div", { style: styles.patientList, children: verifiedPatients.map((patient) => (_jsx(PatientCard, { patient: patient, isSelected: tempSelection?.type === "existing" &&
|
|
27
|
+
tempSelection?.patient?.id === patient.id, onSelect: () => handlePatientSelect(patient), theme: theme }, patient.id))) }), _jsx("div", { style: styles.divider, children: _jsx("span", { style: styles.dividerText, children: "OR" }) })] })), _jsxs("button", { style: {
|
|
28
|
+
...styles.newPatientButton,
|
|
29
|
+
...(tempSelection?.type === "new"
|
|
30
|
+
? styles.newPatientButtonSelected
|
|
31
|
+
: {}),
|
|
32
|
+
}, onClick: handleNewPatientSelect, children: [_jsx("div", { style: styles.newPatientIcon, children: "+" }), _jsxs("div", { style: styles.newPatientContent, children: [_jsx("div", { style: styles.newPatientTitle, children: "Register as New Patient" }), _jsx("div", { style: styles.newPatientSubtitle, children: "Fill out the form to create a new patient profile" })] })] })] }), _jsxs("div", { style: {
|
|
33
|
+
...styles.footer,
|
|
34
|
+
justifyContent: "flex-end",
|
|
35
|
+
}, children: [!isFirstStep && (_jsx("button", { style: BUTTON_STYLES.secondary, onClick: onBack, children: "Back" })), _jsx("button", { style: {
|
|
36
|
+
...BUTTON_STYLES.primary,
|
|
37
|
+
opacity: tempSelection ? 1 : 0.6,
|
|
38
|
+
}, onClick: handleNext, disabled: !tempSelection, children: "Next" })] })] }));
|
|
39
|
+
};
|
|
40
|
+
const PatientCard = ({ patient, isSelected, onSelect, theme }) => {
|
|
41
|
+
const styles = getPatientCardStyles(theme, isSelected);
|
|
42
|
+
const formatDate = (dateStr) => {
|
|
43
|
+
const date = new Date(dateStr);
|
|
44
|
+
return date.toLocaleDateString("en-US", {
|
|
45
|
+
year: "numeric",
|
|
46
|
+
month: "short",
|
|
47
|
+
day: "numeric",
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
return (_jsxs("button", { style: styles.card, onClick: onSelect, type: "button", children: [_jsx("div", { style: styles.radioContainer, children: _jsx("div", { style: styles.radio, children: isSelected && _jsx("div", { style: styles.radioInner }) }) }), _jsxs("div", { style: styles.content, children: [_jsxs("div", { style: styles.header, children: [_jsxs("div", { style: styles.name, children: [patient.firstName, " ", patient.lastName] }), _jsxs("div", { style: styles.mrn, children: ["MRN: ", patient.mrn] })] }), _jsxs("div", { style: styles.details, children: [_jsxs("div", { style: styles.detailRow, children: [_jsx("span", { style: styles.detailLabel, children: "Email:" }), _jsx("span", { style: styles.detailValue, children: patient.email })] }), _jsxs("div", { style: styles.detailRow, children: [_jsx("span", { style: styles.detailLabel, children: "Phone:" }), _jsxs("span", { style: styles.detailValue, children: [patient.countryCode, " ", patient.phoneNumber] })] }), _jsxs("div", { style: styles.detailRow, children: [_jsx("span", { style: styles.detailLabel, children: "DOB:" }), _jsx("span", { style: styles.detailValue, children: formatDate(patient.dob) })] }), _jsxs("div", { style: styles.detailRow, children: [_jsx("span", { style: styles.detailLabel, children: "Gender:" }), _jsx("span", { style: styles.detailValue, children: patient.gender })] }), _jsxs("div", { style: styles.detailRow, children: [_jsx("span", { style: styles.detailLabel, children: "Blood Group:" }), _jsx("span", { style: styles.detailValue, children: patient.bloodGroup })] }), patient.address && (_jsxs("div", { style: styles.detailRow, children: [_jsx("span", { style: styles.detailLabel, children: "Address:" }), _jsxs("span", { style: styles.detailValue, children: [patient.address.city, ", ", patient.address.state] })] }))] })] })] }));
|
|
51
|
+
};
|
|
52
|
+
const getPatientSelectionStyles = (theme) => ({
|
|
53
|
+
container: {
|
|
54
|
+
display: "flex",
|
|
55
|
+
flexDirection: "column",
|
|
56
|
+
height: "100%",
|
|
57
|
+
gap: "20px",
|
|
58
|
+
},
|
|
59
|
+
header: {
|
|
60
|
+
textAlign: "center",
|
|
61
|
+
marginBottom: "4px",
|
|
62
|
+
},
|
|
63
|
+
title: {
|
|
64
|
+
fontSize: "24px",
|
|
65
|
+
fontWeight: "600",
|
|
66
|
+
color: theme.colors.text,
|
|
67
|
+
marginBottom: "8px",
|
|
68
|
+
},
|
|
69
|
+
subtitle: {
|
|
70
|
+
fontSize: "14px",
|
|
71
|
+
color: theme.colors.textSecondary,
|
|
72
|
+
margin: 0,
|
|
73
|
+
},
|
|
74
|
+
content: {
|
|
75
|
+
flex: 1,
|
|
76
|
+
overflowY: "auto",
|
|
77
|
+
display: "flex",
|
|
78
|
+
flexDirection: "column",
|
|
79
|
+
gap: "20px",
|
|
80
|
+
},
|
|
81
|
+
patientList: {
|
|
82
|
+
display: "flex",
|
|
83
|
+
flexDirection: "column",
|
|
84
|
+
gap: "12px",
|
|
85
|
+
},
|
|
86
|
+
divider: {
|
|
87
|
+
display: "flex",
|
|
88
|
+
alignItems: "center",
|
|
89
|
+
textAlign: "center",
|
|
90
|
+
margin: "16px 0",
|
|
91
|
+
position: "relative",
|
|
92
|
+
"&::before": {
|
|
93
|
+
content: '""',
|
|
94
|
+
flex: 1,
|
|
95
|
+
borderBottom: `1px solid ${theme.colors.border}`,
|
|
96
|
+
},
|
|
97
|
+
"&::after": {
|
|
98
|
+
content: '""',
|
|
99
|
+
flex: 1,
|
|
100
|
+
borderBottom: `1px solid ${theme.colors.border}`,
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
dividerText: {
|
|
104
|
+
padding: "0 16px",
|
|
105
|
+
color: theme.colors.textSecondary,
|
|
106
|
+
fontSize: "14px",
|
|
107
|
+
fontWeight: "500",
|
|
108
|
+
backgroundColor: theme.colors.background,
|
|
109
|
+
},
|
|
110
|
+
newPatientButton: {
|
|
111
|
+
display: "flex",
|
|
112
|
+
alignItems: "center",
|
|
113
|
+
justifyContent: "center",
|
|
114
|
+
gap: "16px",
|
|
115
|
+
padding: "14px",
|
|
116
|
+
border: `2px dashed ${theme.colors.border}`,
|
|
117
|
+
borderRadius: theme.radii.md,
|
|
118
|
+
background: theme.colors.background,
|
|
119
|
+
cursor: "pointer",
|
|
120
|
+
transition: "all 0.2s ease",
|
|
121
|
+
textAlign: "center",
|
|
122
|
+
"&:hover": {
|
|
123
|
+
borderColor: theme.colors.primary,
|
|
124
|
+
background: `${theme.colors.primary}10`,
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
newPatientIcon: {
|
|
128
|
+
width: "48px",
|
|
129
|
+
height: "48px",
|
|
130
|
+
borderRadius: "50%",
|
|
131
|
+
background: theme.colors.primary,
|
|
132
|
+
color: "white",
|
|
133
|
+
display: "flex",
|
|
134
|
+
alignItems: "center",
|
|
135
|
+
justifyContent: "center",
|
|
136
|
+
fontSize: "24px",
|
|
137
|
+
fontWeight: "400",
|
|
138
|
+
flexShrink: 0,
|
|
139
|
+
lineHeight: "1",
|
|
140
|
+
},
|
|
141
|
+
newPatientContent: {
|
|
142
|
+
display: "flex",
|
|
143
|
+
flexDirection: "column",
|
|
144
|
+
alignItems: "center",
|
|
145
|
+
justifyContent: "center",
|
|
146
|
+
textAlign: "center",
|
|
147
|
+
},
|
|
148
|
+
newPatientTitle: {
|
|
149
|
+
fontSize: "16px",
|
|
150
|
+
fontWeight: "600",
|
|
151
|
+
color: theme.colors.text,
|
|
152
|
+
marginBottom: "4px",
|
|
153
|
+
textAlign: "center",
|
|
154
|
+
},
|
|
155
|
+
newPatientSubtitle: {
|
|
156
|
+
fontSize: "14px",
|
|
157
|
+
color: theme.colors.textSecondary,
|
|
158
|
+
textAlign: "center",
|
|
159
|
+
},
|
|
160
|
+
newPatientButtonSelected: {
|
|
161
|
+
borderColor: theme.colors.primary,
|
|
162
|
+
background: `${theme.colors.primary}08`,
|
|
163
|
+
},
|
|
164
|
+
footer: {
|
|
165
|
+
display: "flex",
|
|
166
|
+
justifyContent: "space-between",
|
|
167
|
+
gap: "12px",
|
|
168
|
+
paddingTop: "16px",
|
|
169
|
+
borderTop: `1px solid ${theme.colors.border}`,
|
|
170
|
+
},
|
|
171
|
+
nextBtnDisabled: {
|
|
172
|
+
backgroundColor: theme.colors.textSecondary || "#9ca3af",
|
|
173
|
+
cursor: "not-allowed",
|
|
174
|
+
opacity: 0.6,
|
|
175
|
+
color: "white",
|
|
176
|
+
},
|
|
177
|
+
});
|
|
178
|
+
const getPatientCardStyles = (theme, isSelected) => ({
|
|
179
|
+
card: {
|
|
180
|
+
display: "flex",
|
|
181
|
+
gap: "16px",
|
|
182
|
+
padding: "16px",
|
|
183
|
+
border: `2px solid ${isSelected ? theme.colors.primary : theme.colors.border}`,
|
|
184
|
+
borderRadius: theme.radii.md,
|
|
185
|
+
background: isSelected
|
|
186
|
+
? `${theme.colors.primary}08`
|
|
187
|
+
: theme.colors.background,
|
|
188
|
+
cursor: "pointer",
|
|
189
|
+
transition: "all 0.2s ease",
|
|
190
|
+
"&:hover": {
|
|
191
|
+
borderColor: theme.colors.primary,
|
|
192
|
+
background: `${theme.colors.primary}05`,
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
radioContainer: {
|
|
196
|
+
paddingTop: "2px",
|
|
197
|
+
},
|
|
198
|
+
radio: {
|
|
199
|
+
width: "20px",
|
|
200
|
+
height: "20px",
|
|
201
|
+
borderRadius: "50%",
|
|
202
|
+
border: `2px solid ${isSelected ? theme.colors.primary : theme.colors.border}`,
|
|
203
|
+
display: "flex",
|
|
204
|
+
alignItems: "center",
|
|
205
|
+
justifyContent: "center",
|
|
206
|
+
transition: "all 0.2s ease",
|
|
207
|
+
},
|
|
208
|
+
radioInner: {
|
|
209
|
+
width: "10px",
|
|
210
|
+
height: "10px",
|
|
211
|
+
borderRadius: "50%",
|
|
212
|
+
background: theme.colors.primary,
|
|
213
|
+
},
|
|
214
|
+
content: {
|
|
215
|
+
flex: 1,
|
|
216
|
+
},
|
|
217
|
+
header: {
|
|
218
|
+
display: "flex",
|
|
219
|
+
justifyContent: "space-between",
|
|
220
|
+
alignItems: "center",
|
|
221
|
+
marginBottom: "12px",
|
|
222
|
+
},
|
|
223
|
+
name: {
|
|
224
|
+
fontSize: "18px",
|
|
225
|
+
fontWeight: "600",
|
|
226
|
+
color: theme.colors.text,
|
|
227
|
+
},
|
|
228
|
+
mrn: {
|
|
229
|
+
fontSize: "13px",
|
|
230
|
+
color: theme.colors.textSecondary,
|
|
231
|
+
fontWeight: "500",
|
|
232
|
+
padding: "4px 8px",
|
|
233
|
+
background: theme.colors.border,
|
|
234
|
+
borderRadius: theme.radii.sm,
|
|
235
|
+
},
|
|
236
|
+
details: {
|
|
237
|
+
display: "flex",
|
|
238
|
+
flexDirection: "column",
|
|
239
|
+
gap: "6px",
|
|
240
|
+
},
|
|
241
|
+
detailRow: {
|
|
242
|
+
display: "flex",
|
|
243
|
+
fontSize: "14px",
|
|
244
|
+
gap: "8px",
|
|
245
|
+
},
|
|
246
|
+
detailLabel: {
|
|
247
|
+
color: theme.colors.textSecondary,
|
|
248
|
+
fontWeight: "500",
|
|
249
|
+
minWidth: "100px",
|
|
250
|
+
},
|
|
251
|
+
detailValue: {
|
|
252
|
+
color: theme.colors.text,
|
|
253
|
+
},
|
|
254
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { COUNTRY_CODES } from "../../constants/options";
|
|
3
|
+
import { useTheme } from "../../../react/hooks/useTheme";
|
|
4
|
+
import { getButtonStyles, getPhoneVerifyStyles } from "../../theme-styles";
|
|
5
|
+
import { validatePhoneNumber, validateCountryCode, } from "../../utils/validation";
|
|
6
|
+
import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem, } from "../../shared/ui/SelectDropdown";
|
|
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);
|
|
11
|
+
const isPhoneValid = validatePhoneNumber(state.patientPhone) &&
|
|
12
|
+
validateCountryCode(state.countryCode);
|
|
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) => {
|
|
14
|
+
dispatch({ type: "SET_COUNTRY_CODE", payload: code });
|
|
15
|
+
}, onPhoneChange: (phone) => dispatch({ type: "SET_PATIENT_PHONE", payload: phone }) })) : (_jsx(OtpInputSection, { countryCode: state.countryCode, patientPhone: state.patientPhone, otpCode: state.otpCode, otpVerified: state.otpVerified, onOtpChange: (code) => dispatch({ type: "SET_OTP_CODE", payload: code }) })) }), _jsx("div", { style: PHONE_VERIFY_STYLES.footer, children: !state.otpSent ? (_jsxs(_Fragment, { children: [_jsx("button", { style: BUTTON_STYLES.secondary, onClick: onBack, children: "Back" }), _jsx("button", { style: {
|
|
16
|
+
...BUTTON_STYLES.primary,
|
|
17
|
+
opacity: isPhoneValid ? 1 : 0.6,
|
|
18
|
+
}, disabled: !isPhoneValid || state.otpSending, onClick: onSendOtp, children: state.otpSending ? "Sending..." : "Continue" })] })) : !state.otpVerified ? (_jsxs(_Fragment, { children: [_jsx("button", { style: BUTTON_STYLES.secondary, onClick: () => {
|
|
19
|
+
dispatch({ type: "SET_OTP_SENT", payload: false });
|
|
20
|
+
dispatch({ type: "SET_OTP_CODE", payload: "" });
|
|
21
|
+
}, children: "Change Number" }), _jsx("button", { style: {
|
|
22
|
+
...BUTTON_STYLES.primary,
|
|
23
|
+
opacity: state.otpCode.length === 6 ? 1 : 0.6,
|
|
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" })] })) })] }));
|
|
25
|
+
};
|
|
26
|
+
const PhoneInputSection = ({ countryCode, patientPhone, onCountryCodeChange, onPhoneChange }) => {
|
|
27
|
+
const theme = useTheme();
|
|
28
|
+
const PHONE_VERIFY_STYLES = getPhoneVerifyStyles(theme);
|
|
29
|
+
const selectedCountry = COUNTRY_CODES.find((c) => c.code === countryCode);
|
|
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) => {
|
|
31
|
+
const value = e.target.value.replace(/\D/g, "");
|
|
32
|
+
onPhoneChange(value);
|
|
33
|
+
}, maxLength: 15 })] })] }) }));
|
|
34
|
+
};
|
|
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
|
+
}
|
|
47
|
+
}
|
|
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
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
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("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "none", stroke: theme.colors.success, strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: _jsx("polyline", { points: "20 6 9 17 4 12" }) }) }), _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" }) })] }));
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { PhoneVerificationStep } from "./PhoneVerificationStep";
|
|
2
|
+
export { PatientDetailsStep } from "./PatientDetailsStep";
|
|
3
|
+
export { SuccessStep } from "./SuccessStep";
|
|
4
|
+
export { AppointmentDateTimeModal } from "./AppointmentDateTimeModal";
|
|
5
|
+
export { DoctorSelectModal } from "./DoctorSelectModal";
|
|
6
|
+
export { default as AppointmentConfirmationStep } from "./AppointmentConfirmationStep";
|
|
7
|
+
export { AppointmentSummaryStep } from "./AppointmentSummaryStep";
|
|
8
|
+
export { BookingOptionStep } from "./BookingOptionStep";
|
|
9
|
+
export { PatientSelectionStep } from "./PatientSelectionStep";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { PhoneVerificationStep } from "./PhoneVerificationStep";
|
|
2
|
+
export { PatientDetailsStep } from "./PatientDetailsStep";
|
|
3
|
+
export { SuccessStep } from "./SuccessStep";
|
|
4
|
+
export { AppointmentDateTimeModal } from "./AppointmentDateTimeModal";
|
|
5
|
+
export { DoctorSelectModal } from "./DoctorSelectModal";
|
|
6
|
+
export { default as AppointmentConfirmationStep } from "./AppointmentConfirmationStep";
|
|
7
|
+
export { AppointmentSummaryStep } from "./AppointmentSummaryStep";
|
|
8
|
+
export { BookingOptionStep } from "./BookingOptionStep";
|
|
9
|
+
export { PatientSelectionStep } from "./PatientSelectionStep";
|
|
@@ -181,6 +181,7 @@ export const useAppointmentFlow = (state, dispatch, onError) => {
|
|
|
181
181
|
validityDays: pack.validityDays,
|
|
182
182
|
allowedConsultationModes: pack.allowedConsultationModes,
|
|
183
183
|
allowedDoctors: pack.allowedDoctors,
|
|
184
|
+
doctorIds: pack.doctorIds,
|
|
184
185
|
applicableOnline: pack.allowedConsultationModes?.includes("ONLINE"),
|
|
185
186
|
applicableOffline: pack.allowedConsultationModes?.includes("OFFLINE"),
|
|
186
187
|
}));
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
export { AppointmentCalender } from "./AppointmentCalender";
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export type { AppointmentState, AppointmentAction } from "./types";
|
|
5
|
-
export { INITIAL_STATE } from "./types";
|
|
2
|
+
export * from "./components";
|
|
3
|
+
export * from "./types";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { AppointmentCalender } from "./AppointmentCalender";
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export * from "./components";
|
|
3
|
+
export * from "./types";
|
|
@@ -96,6 +96,7 @@ export interface AvailablePackage {
|
|
|
96
96
|
applicableOffline?: boolean;
|
|
97
97
|
allowedConsultationModes?: ("ONLINE" | "OFFLINE")[];
|
|
98
98
|
allowedDoctors?: SessionPackDoctor[];
|
|
99
|
+
doctorIds?: number[];
|
|
99
100
|
}
|
|
100
101
|
export type BookingOptionType = "session-pack" | "new-appointment" | "explore-packages" | null;
|
|
101
102
|
export interface AppointmentState {
|
|
@@ -288,4 +289,7 @@ export type AppointmentAction = {
|
|
|
288
289
|
} | {
|
|
289
290
|
type: "RESET_FORM";
|
|
290
291
|
};
|
|
292
|
+
export interface AppointmentCalenderProps {
|
|
293
|
+
onError?: (err: Error) => void;
|
|
294
|
+
}
|
|
291
295
|
export declare const INITIAL_STATE: AppointmentState;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const MONTHS = [
|
|
2
|
+
"January",
|
|
3
|
+
"February",
|
|
4
|
+
"March",
|
|
5
|
+
"April",
|
|
6
|
+
"May",
|
|
7
|
+
"June",
|
|
8
|
+
"July",
|
|
9
|
+
"August",
|
|
10
|
+
"September",
|
|
11
|
+
"October",
|
|
12
|
+
"November",
|
|
13
|
+
"December",
|
|
14
|
+
];
|
|
15
|
+
export const WEEKDAYS = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export const API_BASE_URL = "https://api.medos.one/v1";
|
|
2
|
+
export const MONTHS = [
|
|
3
|
+
"January",
|
|
4
|
+
"February",
|
|
5
|
+
"March",
|
|
6
|
+
"April",
|
|
7
|
+
"May",
|
|
8
|
+
"June",
|
|
9
|
+
"July",
|
|
10
|
+
"August",
|
|
11
|
+
"September",
|
|
12
|
+
"October",
|
|
13
|
+
"November",
|
|
14
|
+
"December",
|
|
15
|
+
];
|
|
16
|
+
export const WEEKDAYS = [
|
|
17
|
+
"Sunday",
|
|
18
|
+
"Monday",
|
|
19
|
+
"Tuesday",
|
|
20
|
+
"Wednesday",
|
|
21
|
+
"Thursday",
|
|
22
|
+
"Friday",
|
|
23
|
+
"Saturday",
|
|
24
|
+
];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const COUNTRY_CODES: {
|
|
2
|
+
code: string;
|
|
3
|
+
label: string;
|
|
4
|
+
}[];
|
|
5
|
+
export declare const GENDER_OPTIONS: {
|
|
6
|
+
value: string;
|
|
7
|
+
label: string;
|
|
8
|
+
}[];
|
|
9
|
+
export declare const BLOOD_GROUP_OPTIONS: {
|
|
10
|
+
value: string;
|
|
11
|
+
label: string;
|
|
12
|
+
}[];
|
|
13
|
+
export declare const mapBloodGroupToApi: (uiBloodGroup: string) => string;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export const COUNTRY_CODES = [
|
|
2
|
+
{ code: "+91", label: "🇮🇳 +91" },
|
|
3
|
+
{ code: "+1", label: "🇺🇸 +1" },
|
|
4
|
+
{ code: "+44", label: "🇬🇧 +44" },
|
|
5
|
+
{ code: "+86", label: "🇨🇳 +86" },
|
|
6
|
+
{ code: "+81", label: "🇯🇵 +81" },
|
|
7
|
+
];
|
|
8
|
+
export const GENDER_OPTIONS = [
|
|
9
|
+
{ value: "MALE", label: "Male" },
|
|
10
|
+
{ value: "FEMALE", label: "Female" },
|
|
11
|
+
{ value: "OTHER", label: "Other" },
|
|
12
|
+
];
|
|
13
|
+
export const BLOOD_GROUP_OPTIONS = [
|
|
14
|
+
{ value: "A+", label: "A+" },
|
|
15
|
+
{ value: "A-", label: "A-" },
|
|
16
|
+
{ value: "B+", label: "B+" },
|
|
17
|
+
{ value: "B-", label: "B-" },
|
|
18
|
+
{ value: "AB+", label: "AB+" },
|
|
19
|
+
{ value: "AB-", label: "AB-" },
|
|
20
|
+
{ value: "O+", label: "O+" },
|
|
21
|
+
{ value: "O-", label: "O-" },
|
|
22
|
+
];
|
|
23
|
+
export const mapBloodGroupToApi = (uiBloodGroup) => {
|
|
24
|
+
const bloodGroupMap = {
|
|
25
|
+
"A+": "A_POSITIVE",
|
|
26
|
+
"A-": "A_NEGATIVE",
|
|
27
|
+
"B+": "B_POSITIVE",
|
|
28
|
+
"B-": "B_NEGATIVE",
|
|
29
|
+
"AB+": "AB_POSITIVE",
|
|
30
|
+
"AB-": "AB_NEGATIVE",
|
|
31
|
+
"O+": "O_POSITIVE",
|
|
32
|
+
"O-": "O_NEGATIVE",
|
|
33
|
+
};
|
|
34
|
+
return bloodGroupMap[uiBloodGroup];
|
|
35
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const PHONE_MIN_LENGTH = 7;
|
|
2
|
+
export declare const PHONE_MAX_LENGTH = 15;
|
|
3
|
+
export declare const COUNTRY_CODE_REGEX: RegExp;
|
|
4
|
+
export declare const DATE_FORMAT_REGEX: RegExp;
|
|
5
|
+
export declare const MIN_BIRTH_YEAR = 1900;
|
|
6
|
+
export declare const VALID_BLOOD_GROUPS: string[];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const PHONE_MIN_LENGTH = 7;
|
|
2
|
+
export const PHONE_MAX_LENGTH = 15;
|
|
3
|
+
export const COUNTRY_CODE_REGEX = /^\+[1-9]\d{0,3}$/;
|
|
4
|
+
export const DATE_FORMAT_REGEX = /^\d{4}-\d{2}-\d{2}$/;
|
|
5
|
+
export const MIN_BIRTH_YEAR = 1900;
|
|
6
|
+
export const VALID_BLOOD_GROUPS = [
|
|
7
|
+
"A+",
|
|
8
|
+
"A-",
|
|
9
|
+
"B+",
|
|
10
|
+
"B-",
|
|
11
|
+
"AB+",
|
|
12
|
+
"AB-",
|
|
13
|
+
"O+",
|
|
14
|
+
"O-",
|
|
15
|
+
"UNKNOWN",
|
|
16
|
+
];
|