medos-sdk 1.1.10 → 1.1.12
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.d.ts +1 -0
- package/dist/client/MedosClient.js +8 -1
- package/dist/components/AppointmentCalender.js +19 -22
- package/dist/components/AppointmentConfirmationStep.d.ts +1 -0
- package/dist/components/AppointmentConfirmationStep.js +34 -42
- package/dist/components/AppointmentDateTimeModal.d.ts +1 -0
- package/dist/components/AppointmentDateTimeModal.js +201 -168
- package/dist/components/AppointmentSummaryStep.d.ts +12 -0
- package/dist/components/AppointmentSummaryStep.js +168 -0
- package/dist/components/BookingOptionStep.d.ts +14 -0
- package/dist/components/BookingOptionStep.js +346 -0
- package/dist/components/ContactInformationStep.js +10 -4
- package/dist/components/ContactPreferenceStep.js +10 -1
- package/dist/components/DoctorSelectModal.js +105 -59
- package/dist/components/EnquiryForm.js +81 -69
- package/dist/components/Icons/CloseIcon.d.ts +9 -0
- package/dist/components/Icons/CloseIcon.js +5 -0
- package/dist/components/InquiryDetailsStep.js +5 -1
- package/dist/components/PatientDetailsStep.js +17 -12
- package/dist/components/PatientSelectionStep.d.ts +12 -0
- package/dist/components/PatientSelectionStep.js +254 -0
- package/dist/components/PhoneVerificationStep.js +1 -1
- package/dist/components/SuccessStep.js +1 -1
- package/dist/components/appointment-booking/AppointmentCalender.js +145 -67
- 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.d.ts +0 -1
- package/dist/components/appointment-booking/hooks/useAppointmentFlow.js +111 -25
- package/dist/components/appointment-booking/hooks/useAppointmentState.js +32 -0
- package/dist/components/appointment-booking/hooks/useInitializeAddresses.js +0 -1
- 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 +167 -0
- package/dist/components/appointment-booking/types.js +16 -0
- package/dist/components/appointment-modal-styles.d.ts +259 -0
- package/dist/components/appointment-modal-styles.js +395 -0
- package/dist/components/constant.d.ts +2 -0
- package/dist/components/constant.js +15 -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/custom-calendar.js +20 -11
- 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 -257
- package/dist/components/theme-styles.d.ts +5 -4
- package/dist/components/theme-styles.js +239 -125
- 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 -52
- package/dist/components/types.js +1 -23
- 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 -5
- package/dist/components/utils.js +1 -15
- package/dist/components/validation.d.ts +1 -2
- package/dist/components/validation.js +1 -7
- package/dist/constants/index.d.ts +1 -1
- package/dist/constants/index.js +1 -1
- package/dist/core/theme/index.d.ts +1 -0
- package/dist/core/theme/index.js +1 -0
- package/dist/core/theme/responsive.d.ts +15 -0
- package/dist/core/theme/responsive.js +113 -0
- package/dist/core/theme/themes.js +16 -4
- package/dist/core/theme/types.d.ts +8 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +2 -1
- package/dist/react/ThemeProvider.d.ts +2 -1
- package/dist/react/ThemeProvider.js +49 -10
- package/dist/react/index.d.ts +3 -3
- package/dist/react/index.js +1 -1
- package/dist/services/AppointmentService.d.ts +80 -2
- package/dist/services/AppointmentService.js +131 -5
- package/dist/services/AuthService.js +1 -1
- package/dist/services/WorkspaceService.d.ts +58 -3
- package/dist/services/WorkspaceService.js +10 -1
- package/dist/vanilla/AppointmentCalendarWidget.d.ts +17 -7
- package/dist/vanilla/AppointmentCalendarWidget.js +1401 -380
- package/dist/vanilla/EnquiryFormWidget.d.ts +1 -0
- package/dist/vanilla/EnquiryFormWidget.js +25 -43
- package/dist/vanilla/client/MedosClient.d.ts +1 -0
- package/dist/vanilla/components/AppointmentConfirmationStep.d.ts +1 -0
- package/dist/vanilla/components/AppointmentDateTimeModal.d.ts +1 -0
- package/dist/vanilla/components/AppointmentSummaryStep.d.ts +12 -0
- package/dist/vanilla/components/BookingOptionStep.d.ts +14 -0
- package/dist/vanilla/components/Icons/CloseIcon.d.ts +9 -0
- package/dist/vanilla/components/PatientSelectionStep.d.ts +12 -0
- package/dist/vanilla/components/VanillaCalendar.js +33 -18
- package/dist/vanilla/components/VanillaIcons.d.ts +5 -0
- package/dist/vanilla/components/VanillaIcons.js +92 -0
- package/dist/vanilla/components/VanillaSelect.d.ts +3 -0
- package/dist/vanilla/components/VanillaSelect.js +93 -5
- 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/hooks/useAppointmentFlow.d.ts +0 -1
- package/dist/vanilla/components/appointment-booking/index.d.ts +2 -4
- package/dist/vanilla/components/appointment-booking/types.d.ts +167 -0
- package/dist/vanilla/components/appointment-modal-styles.d.ts +259 -0
- package/dist/vanilla/components/constant.d.ts +2 -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/theme-styles.d.ts +5 -4
- 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 -52
- 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 -5
- package/dist/vanilla/components/validation.d.ts +1 -2
- package/dist/vanilla/constants/index.d.ts +1 -1
- package/dist/vanilla/core/theme/index.d.ts +1 -0
- package/dist/vanilla/core/theme/responsive.d.ts +15 -0
- package/dist/vanilla/core/theme/types.d.ts +8 -0
- package/dist/vanilla/enquiry-widget.js +3632 -90
- package/dist/vanilla/index.d.ts +4 -2
- package/dist/vanilla/react/ThemeProvider.d.ts +2 -1
- package/dist/vanilla/react/index.d.ts +3 -3
- package/dist/vanilla/services/AppointmentService.d.ts +80 -2
- package/dist/vanilla/services/WorkspaceService.d.ts +58 -3
- package/dist/vanilla/vanilla/AppointmentCalendarWidget.d.ts +17 -7
- package/dist/vanilla/vanilla/EnquiryFormWidget.d.ts +1 -0
- package/dist/vanilla/vanilla/components/VanillaIcons.d.ts +5 -0
- package/dist/vanilla/vanilla/components/VanillaSelect.d.ts +3 -0
- package/dist/vanilla/widget.css +1045 -205
- package/dist/vanilla/widget.js +10365 -5737
- package/package.json +2 -2
|
@@ -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
|
+
];
|
|
@@ -3,14 +3,21 @@ import { useState, useEffect } from "react";
|
|
|
3
3
|
import ChevronLeft from "./Icons/ChevronLeft";
|
|
4
4
|
import ChevronRight from "./Icons/ChevronRight";
|
|
5
5
|
import { useTheme } from "../react/hooks/useTheme";
|
|
6
|
-
|
|
6
|
+
import { useBreakpoint } from "../core/theme/responsive";
|
|
7
|
+
const getStyle = (theme, isMobile) => `
|
|
8
|
+
.custom-calendar-wrapper {
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
-webkit-overflow-scrolling: touch;
|
|
11
|
+
}
|
|
7
12
|
.custom-calendar {
|
|
8
|
-
width:
|
|
13
|
+
width: ${isMobile ? "320px" : "100%"};
|
|
14
|
+
min-width: ${isMobile ? "320px" : "auto"};
|
|
9
15
|
background-color: ${theme.colors.background};
|
|
10
16
|
border-radius: ${theme.radii.md};
|
|
11
17
|
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
|
|
12
|
-
padding: 16px;
|
|
18
|
+
padding: ${isMobile ? "12px" : "16px"};
|
|
13
19
|
font-family: ${theme.typography.fontFamily};
|
|
20
|
+
box-sizing: border-box;
|
|
14
21
|
}
|
|
15
22
|
.calendar-header {
|
|
16
23
|
display: flex;
|
|
@@ -92,10 +99,12 @@ const getStyle = (theme) => `
|
|
|
92
99
|
`;
|
|
93
100
|
export const CustomCalendarWithDateSelector = ({ selectedDate, onSelect, pastDisabled = false, }) => {
|
|
94
101
|
const theme = useTheme();
|
|
102
|
+
const breakpoint = useBreakpoint(theme);
|
|
103
|
+
const isMobile = breakpoint === "mobile";
|
|
95
104
|
useEffect(() => {
|
|
96
105
|
const styleId = "custom-calendar-style";
|
|
97
106
|
const existingStyle = document.getElementById(styleId);
|
|
98
|
-
const themeStyle = getStyle(theme);
|
|
107
|
+
const themeStyle = getStyle(theme, isMobile);
|
|
99
108
|
if (existingStyle) {
|
|
100
109
|
existingStyle.innerHTML = themeStyle;
|
|
101
110
|
}
|
|
@@ -105,7 +114,7 @@ export const CustomCalendarWithDateSelector = ({ selectedDate, onSelect, pastDis
|
|
|
105
114
|
s.innerHTML = themeStyle;
|
|
106
115
|
document.head.appendChild(s);
|
|
107
116
|
}
|
|
108
|
-
}, [theme]);
|
|
117
|
+
}, [theme, isMobile]);
|
|
109
118
|
const today = new Date();
|
|
110
119
|
today.setHours(0, 0, 0, 0);
|
|
111
120
|
const [currentMonth, setCurrentMonth] = useState(today.getMonth());
|
|
@@ -162,10 +171,10 @@ export const CustomCalendarWithDateSelector = ({ selectedDate, onSelect, pastDis
|
|
|
162
171
|
todayStart.setHours(0, 0, 0, 0);
|
|
163
172
|
return date < todayStart;
|
|
164
173
|
};
|
|
165
|
-
return (_jsxs("div", { className: "custom-calendar", children: [_jsxs("div", { className: "calendar-header", children: [_jsx(ChevronLeft, { onClick: prevMonth, className: "calendar-nav" }), _jsxs("p", { className: "calendar-month", children: [months[currentMonth], " ", currentYear] }), _jsx(ChevronRight, { onClick: nextMonth, className: "calendar-nav" })] }), _jsx("div", { className: "calendar-days-header", children: daysOfWeek.map((d) => (_jsx("div", { className: "calendar-day-name", children: d }, d))) }), _jsxs("div", { className: "calendar-grid", children: [Array.from({ length: startOffset }).map((_, idx) => (_jsx("div", { className: "calendar-empty" }, `empty-${idx}`))), Array.from({ length: daysInMonth }).map((_, i) => {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
174
|
+
return (_jsx("div", { className: "custom-calendar-wrapper", children: _jsxs("div", { className: "custom-calendar", children: [_jsxs("div", { className: "calendar-header", children: [_jsx(ChevronLeft, { onClick: prevMonth, className: "calendar-nav" }), _jsxs("p", { className: "calendar-month", children: [months[currentMonth], " ", currentYear] }), _jsx(ChevronRight, { onClick: nextMonth, className: "calendar-nav" })] }), _jsx("div", { className: "calendar-days-header", children: daysOfWeek.map((d) => (_jsx("div", { className: "calendar-day-name", children: d }, d))) }), _jsxs("div", { className: "calendar-grid", children: [Array.from({ length: startOffset }).map((_, idx) => (_jsx("div", { className: "calendar-empty" }, `empty-start-${currentMonth}-${idx}`))), Array.from({ length: daysInMonth }).map((_, i) => {
|
|
175
|
+
const date = new Date(currentYear, currentMonth, i + 1);
|
|
176
|
+
const disabled = pastDisabled && isBeforeToday(date);
|
|
177
|
+
const isSelected = selectedDate && isSameDate(selectedDate, date);
|
|
178
|
+
return (_jsxs("button", { disabled: disabled, onClick: () => onSelect(date), className: `calendar-day ${isSelected ? "selected" : ""} ${disabled ? "disabled" : ""}`, children: [_jsx("span", { children: i + 1 }), isSelected && _jsx("span", { className: "calendar-dot", children: "\u2022" })] }, i + 1));
|
|
179
|
+
})] })] }) }));
|
|
171
180
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { EnquirySubmission } from "../../enquiry-form/types";
|
|
3
|
+
export interface EnquiryFormProps {
|
|
4
|
+
onSuccess?: (enquiry: EnquirySubmission) => void;
|
|
5
|
+
onError?: (error: Error) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const EnquiryForm: React.FC<EnquiryFormProps>;
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { 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, InquiryDetailsStep, ContactPreferenceStep, } from "./components";
|
|
6
|
+
import { SuccessStep } from "../appointment-booking/components";
|
|
7
|
+
import { useTheme } from "../../react/hooks/useTheme";
|
|
8
|
+
import { useBreakpoint } from "../../core/theme/responsive";
|
|
9
|
+
import { MedosLogo } from "../shared/icons";
|
|
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.",
|
|
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 resetForm = useCallback(() => {
|
|
123
|
+
dispatch({ type: "RESET_FORM" });
|
|
124
|
+
}, []);
|
|
125
|
+
const submitEnquiry = useCallback(async () => {
|
|
126
|
+
dispatch({ type: "SET_ERROR", payload: null });
|
|
127
|
+
if (!validateContactStep() || !validateInquiryStep()) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
dispatch({ type: "SET_LOADING", payload: true });
|
|
131
|
+
try {
|
|
132
|
+
const payload = {
|
|
133
|
+
patientName: state.patientName,
|
|
134
|
+
patientEmail: state.patientEmail,
|
|
135
|
+
countryCode: state.countryCode,
|
|
136
|
+
patientPhone: state.patientPhone,
|
|
137
|
+
inquirySubject: state.inquirySubject,
|
|
138
|
+
inquiryMessage: state.inquiryMessage,
|
|
139
|
+
preferredContactMethod: state.preferredContactMethod,
|
|
140
|
+
};
|
|
141
|
+
await EnquiryService.submitEnquiry(payload);
|
|
142
|
+
dispatch({ type: "SET_STEP", payload: 3 });
|
|
143
|
+
onSuccess?.(payload);
|
|
144
|
+
}
|
|
145
|
+
catch (e) {
|
|
146
|
+
const msg = e.message || "Failed to submit enquiry";
|
|
147
|
+
dispatch({ type: "SET_ERROR", payload: msg });
|
|
148
|
+
onError?.(e);
|
|
149
|
+
}
|
|
150
|
+
finally {
|
|
151
|
+
dispatch({ type: "SET_LOADING", payload: false });
|
|
152
|
+
}
|
|
153
|
+
}, [state, validateContactStep, validateInquiryStep]);
|
|
154
|
+
const theme = useTheme();
|
|
155
|
+
const breakpoint = useBreakpoint(theme);
|
|
156
|
+
const styles = React.useMemo(() => getStyles(theme, breakpoint), [theme, breakpoint]);
|
|
157
|
+
return (_jsx("div", { style: styles.container, children: _jsxs("div", { style: styles.card, children: [_jsx("div", { style: styles.header, children: _jsx("h2", { style: styles.title, children: "Submit Inquiry" }) }), _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({
|
|
158
|
+
type: "SET_PREFERRED_CONTACT_METHOD",
|
|
159
|
+
payload: method,
|
|
160
|
+
}), onBack: goBack, onSubmit: submitEnquiry, isLoading: state.loading })), state.step === 3 && _jsx(SuccessStep, { onReset: resetForm }), _jsxs("div", { style: styles.branding, children: [_jsx("span", { style: styles.poweredBy, children: "Powered by" }), _jsx("a", { href: "https://medos.one", target: "_blank", rel: "noopener noreferrer", children: _jsx(MedosLogo, { style: { height: 50, width: "auto" } }) })] })] })] }) }));
|
|
161
|
+
};
|
|
162
|
+
const getStyles = (theme, breakpoint) => {
|
|
163
|
+
const isMobile = breakpoint === "mobile";
|
|
164
|
+
const isTablet = breakpoint === "tablet";
|
|
165
|
+
return {
|
|
166
|
+
container: {
|
|
167
|
+
display: "flex",
|
|
168
|
+
justifyContent: "center",
|
|
169
|
+
padding: isMobile ? 12 : 20,
|
|
170
|
+
fontFamily: theme.typography.fontFamily,
|
|
171
|
+
background: theme.colors.background,
|
|
172
|
+
},
|
|
173
|
+
card: {
|
|
174
|
+
width: "100%",
|
|
175
|
+
maxWidth: isMobile || isTablet ? "100%" : 600,
|
|
176
|
+
background: theme.colors.surface,
|
|
177
|
+
borderRadius: isMobile ? theme.radii.md : theme.radii.lg,
|
|
178
|
+
boxShadow: isMobile ? theme.shadows.md : theme.shadows.lg,
|
|
179
|
+
overflow: "hidden",
|
|
180
|
+
boxSizing: "border-box",
|
|
181
|
+
},
|
|
182
|
+
header: {
|
|
183
|
+
background: theme.colors.primary,
|
|
184
|
+
padding: isMobile ? "16px 16px" : "20px 24px",
|
|
185
|
+
borderBottom: `1px solid ${theme.colors.border}`,
|
|
186
|
+
display: "flex",
|
|
187
|
+
justifyContent: "space-between",
|
|
188
|
+
alignItems: "center",
|
|
189
|
+
flexWrap: (isMobile ? "wrap" : "nowrap"),
|
|
190
|
+
gap: isMobile ? 8 : 0,
|
|
191
|
+
},
|
|
192
|
+
title: {
|
|
193
|
+
margin: 0,
|
|
194
|
+
fontSize: isMobile
|
|
195
|
+
? theme.typography.fontSizeLg
|
|
196
|
+
: theme.typography.fontSizeXl,
|
|
197
|
+
fontWeight: theme.typography.fontWeightSemibold,
|
|
198
|
+
color: theme.colors.textOnPrimary,
|
|
199
|
+
},
|
|
200
|
+
stepIndicator: {
|
|
201
|
+
fontSize: isMobile
|
|
202
|
+
? theme.typography.fontSizeXs
|
|
203
|
+
: theme.typography.fontSizeSm,
|
|
204
|
+
color: theme.colors.textOnPrimary,
|
|
205
|
+
opacity: 0.9,
|
|
206
|
+
margin: 0,
|
|
207
|
+
fontWeight: 500,
|
|
208
|
+
},
|
|
209
|
+
content: {
|
|
210
|
+
padding: isMobile ? 16 : 24,
|
|
211
|
+
},
|
|
212
|
+
errorMessage: {
|
|
213
|
+
marginBottom: 12,
|
|
214
|
+
color: theme.colors.error,
|
|
215
|
+
fontWeight: 600,
|
|
216
|
+
padding: isMobile ? "10px" : "12px",
|
|
217
|
+
background: theme.colors.errorBackground,
|
|
218
|
+
borderRadius: theme.radii.md,
|
|
219
|
+
border: `1px solid ${theme.colors.errorBorder}`,
|
|
220
|
+
fontSize: theme.typography.fontSizeSm,
|
|
221
|
+
},
|
|
222
|
+
branding: {
|
|
223
|
+
display: "flex",
|
|
224
|
+
alignItems: "center",
|
|
225
|
+
justifyContent: "center",
|
|
226
|
+
gap: 8,
|
|
227
|
+
marginTop: isMobile ? 16 : 24,
|
|
228
|
+
paddingTop: isMobile ? 12 : 16,
|
|
229
|
+
borderTop: `1px solid ${theme.colors.border}`,
|
|
230
|
+
opacity: 0.8,
|
|
231
|
+
},
|
|
232
|
+
poweredBy: {
|
|
233
|
+
fontSize: 12,
|
|
234
|
+
color: theme.colors.textSecondary,
|
|
235
|
+
fontWeight: 500,
|
|
236
|
+
},
|
|
237
|
+
};
|
|
238
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface ContactInformationStepProps {
|
|
3
|
+
patientName: string;
|
|
4
|
+
patientEmail: string;
|
|
5
|
+
countryCode: string;
|
|
6
|
+
patientPhone: string;
|
|
7
|
+
onNameChange: (value: string) => void;
|
|
8
|
+
onEmailChange: (value: string) => void;
|
|
9
|
+
onCountryCodeChange: (value: string) => void;
|
|
10
|
+
onPhoneChange: (value: string) => void;
|
|
11
|
+
onNext: () => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const ContactInformationStep: React.FC<ContactInformationStepProps>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { useTheme } from "../../../react/hooks/useTheme";
|
|
4
|
+
import { useBreakpoint } from "../../../core/theme/responsive";
|
|
5
|
+
import { getContainerStyles, getPhoneVerifyStyles, getButtonStyles, } from "../../theme-styles";
|
|
6
|
+
export const ContactInformationStep = React.memo(({ patientName, patientEmail, countryCode, patientPhone, onNameChange, onEmailChange, onCountryCodeChange, onPhoneChange, onNext, }) => {
|
|
7
|
+
const theme = useTheme();
|
|
8
|
+
const breakpoint = useBreakpoint(theme);
|
|
9
|
+
const PHONE_VERIFY_STYLES = React.useMemo(() => getPhoneVerifyStyles(theme, "medos", breakpoint), [theme, breakpoint]);
|
|
10
|
+
const BUTTON_STYLES = React.useMemo(() => getButtonStyles(theme, "medos", breakpoint), [theme, breakpoint]);
|
|
11
|
+
const CONTAINER_STYLES = React.useMemo(() => getContainerStyles(theme, "medos", breakpoint), [theme, breakpoint]);
|
|
12
|
+
const styles = getStyles(theme);
|
|
13
|
+
return (_jsxs("div", { children: [_jsxs("div", { style: { marginBottom: "16px" }, children: [_jsxs("label", { style: PHONE_VERIFY_STYLES.label, children: ["Name", _jsx("span", { style: styles.mandatory, children: "*" })] }), _jsx("input", { type: "text", value: patientName, onChange: (e) => onNameChange(e.target.value), placeholder: "Enter your full name", style: PHONE_VERIFY_STYLES.phoneInput })] }), _jsxs("div", { style: { marginBottom: "16px" }, children: [_jsx("label", { style: PHONE_VERIFY_STYLES.label, children: "Email" }), _jsx("input", { type: "email", value: patientEmail, onChange: (e) => onEmailChange(e.target.value), placeholder: "Enter your email", style: PHONE_VERIFY_STYLES.phoneInput })] }), _jsxs("div", { style: { marginBottom: "16px" }, children: [_jsxs("label", { style: PHONE_VERIFY_STYLES.label, children: ["Phone Number", _jsx("span", { style: styles.mandatory, children: "*" })] }), _jsxs("div", { style: PHONE_VERIFY_STYLES.phoneInputContainer, children: [_jsx("input", { type: "text", value: countryCode, onChange: (e) => onCountryCodeChange(e.target.value), placeholder: "+91", style: {
|
|
14
|
+
...PHONE_VERIFY_STYLES.phoneInput,
|
|
15
|
+
width: "80px",
|
|
16
|
+
flex: "none",
|
|
17
|
+
} }), _jsx("input", { type: "tel", value: patientPhone, onChange: (e) => onPhoneChange(e.target.value), placeholder: "Enter phone number", style: PHONE_VERIFY_STYLES.phoneInput })] })] }), _jsx("div", { style: CONTAINER_STYLES.actions, children: _jsx("button", { onClick: onNext, style: BUTTON_STYLES.primary, children: "Next" }) })] }));
|
|
18
|
+
});
|
|
19
|
+
const getStyles = (theme) => ({
|
|
20
|
+
mandatory: { color: theme.colors.error, marginLeft: 4 },
|
|
21
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface ContactPreferenceStepProps {
|
|
3
|
+
preferredContactMethod: "PHONE" | "EMAIL" | "BOTH";
|
|
4
|
+
onContactMethodChange: (method: "PHONE" | "EMAIL" | "BOTH") => void;
|
|
5
|
+
onBack: () => void;
|
|
6
|
+
onSubmit: () => void;
|
|
7
|
+
isLoading?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const ContactPreferenceStep: React.FC<ContactPreferenceStepProps>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { useTheme } from "../../../react/hooks/useTheme";
|
|
4
|
+
import { getPhoneVerifyStyles, getButtonStyles, getContainerStyles, } from "../../theme-styles";
|
|
5
|
+
import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem, } from "../../shared/ui/SelectDropdown";
|
|
6
|
+
export const ContactPreferenceStep = React.memo(({ preferredContactMethod, onContactMethodChange, onBack, onSubmit, isLoading = false, }) => {
|
|
7
|
+
const theme = useTheme();
|
|
8
|
+
const PHONE_VERIFY_STYLES = React.useMemo(() => getPhoneVerifyStyles(theme), [theme]);
|
|
9
|
+
const BUTTON_STYLES = React.useMemo(() => getButtonStyles(theme), [theme]);
|
|
10
|
+
const CONTAINER_STYLES = React.useMemo(() => getContainerStyles(theme), [theme]);
|
|
11
|
+
const contactOptions = [
|
|
12
|
+
{ value: "PHONE", label: "Phone" },
|
|
13
|
+
{ value: "EMAIL", label: "Email" },
|
|
14
|
+
{ value: "BOTH", label: "Both" },
|
|
15
|
+
];
|
|
16
|
+
const handleContactMethodSelect = (value) => {
|
|
17
|
+
onContactMethodChange(value);
|
|
18
|
+
};
|
|
19
|
+
return (_jsxs("div", { children: [_jsxs("div", { style: { marginBottom: "16px" }, children: [_jsx("label", { style: PHONE_VERIFY_STYLES.label, children: "Preferred Contact Method" }), _jsx("div", { style: { marginTop: "8px" }, children: _jsxs(Select, { value: preferredContactMethod, onValueChange: handleContactMethodSelect, children: [_jsx(SelectTrigger, { style: { width: "100%" }, children: _jsx(SelectValue, { placeholder: "Select contact method" }) }), _jsx(SelectContent, { children: contactOptions.map((option) => (_jsx(SelectItem, { value: option.value, children: option.label }, option.value))) })] }) })] }), _jsxs("div", { style: CONTAINER_STYLES.actions, children: [_jsx("button", { onClick: onBack, style: BUTTON_STYLES.secondary, children: "Back" }), _jsx("button", { onClick: onSubmit, style: BUTTON_STYLES.primary, children: isLoading ? "Submitting..." : "Submit" })] })] }));
|
|
20
|
+
});
|
|
@@ -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,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { useTheme } from "../../../react/hooks/useTheme";
|
|
4
|
+
import { getContainerStyles, getPhoneVerifyStyles, getButtonStyles, } from "../../theme-styles";
|
|
5
|
+
export const InquiryDetailsStep = React.memo(({ inquirySubject, inquiryMessage, onSubjectChange, onMessageChange, onBack, onNext, }) => {
|
|
6
|
+
const theme = useTheme();
|
|
7
|
+
const PHONE_VERIFY_STYLES = React.useMemo(() => getPhoneVerifyStyles(theme), [theme]);
|
|
8
|
+
const BUTTON_STYLES = React.useMemo(() => getButtonStyles(theme), [theme]);
|
|
9
|
+
const CONTAINER_STYLES = React.useMemo(() => getContainerStyles(theme), [theme]);
|
|
10
|
+
const styles = getStyles(theme);
|
|
11
|
+
return (_jsxs("div", { children: [_jsxs("div", { style: { marginBottom: "16px" }, children: [_jsxs("label", { style: PHONE_VERIFY_STYLES.label, children: ["Subject", _jsx("span", { style: styles.mandatory, children: "*" })] }), _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", _jsx("span", { style: styles.mandatory, children: "*" })] }), _jsx("textarea", { value: inquiryMessage, onChange: (e) => onMessageChange(e.target.value), placeholder: "Enter your inquiry message", rows: 5, style: {
|
|
12
|
+
...PHONE_VERIFY_STYLES.otpInput,
|
|
13
|
+
minHeight: "120px",
|
|
14
|
+
resize: "vertical",
|
|
15
|
+
fontFamily: "inherit",
|
|
16
|
+
} })] }), _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" })] })] }));
|
|
17
|
+
});
|
|
18
|
+
const getStyles = (theme) => ({
|
|
19
|
+
mandatory: { color: theme.colors.error, marginLeft: 4 },
|
|
20
|
+
});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export const Check = ({ className, size = 16 }) => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: className, children: _jsx("polyline", { points: "20 6 9 17 4 12" }) }));
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export const ChevronDownIcon = ({ className }) => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: className, children: _jsx("polyline", { points: "6 9 12 15 18 9" }) }));
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
const ChevronLeft = (props) => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: 20, height: 20, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", className: `lucide lucide-chevron-left ${props.className ?? ""}`, ...props, children: _jsx("path", { d: "m15 18-6-6 6-6" }) }));
|
|
3
|
+
export default ChevronLeft;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
const ChevronRight = ({ ...props }) => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: 20, height: 20, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", className: `lucide lucide-chevron-right-icon lucide-chevron-right`, ...props, children: _jsx("path", { d: "m9 18 6-6-6-6" }) }));
|
|
3
|
+
export default ChevronRight;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export const CloseIcon = ({ size = 12, color = "black", className, style, }) => {
|
|
3
|
+
return (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 12 12", fill: "none", className: className, style: style, children: _jsx("path", { d: "M0.878125 11.0896L0 10.2115L4.66667 5.54479L0 0.878126L0.878125 0L5.54479 4.66667L10.2115 0L11.0896 0.878126L6.42292 5.54479L11.0896 10.2115L10.2115 11.0896L5.54479 6.42292L0.878125 11.0896Z", fill: color }) }));
|
|
4
|
+
};
|
|
5
|
+
export default CloseIcon;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ConfirmationCheck: React.FC;
|