medos-sdk 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -0
- package/dist/client/MedosClient.d.ts +3 -5
- package/dist/client/MedosClient.js +4 -4
- package/dist/components/AppointmentCalender.d.ts +1 -4
- package/dist/components/AppointmentCalender.js +323 -530
- package/dist/components/AppointmentDateTimeModal.d.ts +14 -0
- package/dist/components/AppointmentDateTimeModal.js +220 -0
- package/dist/components/ConfigurableCard.d.ts +12 -0
- package/dist/components/ConfigurableCard.js +29 -0
- package/dist/components/ContactInformationStep.d.ts +13 -0
- package/dist/components/ContactInformationStep.js +14 -0
- package/dist/components/ContactPreferenceStep.d.ts +9 -0
- package/dist/components/ContactPreferenceStep.js +16 -0
- package/dist/components/DoctorSelectModal.d.ts +7 -0
- package/dist/components/DoctorSelectModal.js +93 -0
- package/dist/components/EnquiryForm.d.ts +7 -0
- package/dist/components/EnquiryForm.js +212 -0
- package/dist/components/Icons/Check.d.ts +6 -0
- package/dist/components/Icons/Check.js +2 -0
- package/dist/components/Icons/ChevronDownIcon.d.ts +4 -0
- package/dist/components/Icons/ChevronDownIcon.js +2 -0
- package/dist/components/Icons/ChevronLeft.d.ts +3 -0
- package/dist/components/Icons/ChevronLeft.js +3 -0
- package/dist/components/Icons/ChevronRight.d.ts +3 -0
- package/dist/components/Icons/ChevronRight.js +3 -0
- package/dist/components/Icons/ConfirmationCheck.d.ts +1 -0
- package/dist/components/Icons/ConfirmationCheck.js +9 -0
- package/dist/components/Icons/ConsultationType.d.ts +1 -0
- package/dist/components/Icons/ConsultationType.js +2 -0
- package/dist/components/Icons/Date&TimeIcon.d.ts +1 -0
- package/dist/components/Icons/Date&TimeIcon.js +2 -0
- package/dist/components/Icons/MapIcon.d.ts +1 -0
- package/dist/components/Icons/MapIcon.js +2 -0
- package/dist/components/Icons/PaymentMethodIcon.d.ts +1 -0
- package/dist/components/Icons/PaymentMethodIcon.js +2 -0
- package/dist/components/Icons/UserIcon.d.ts +1 -0
- package/dist/components/Icons/UserIcon.js +2 -0
- package/dist/components/InquiryDetailsStep.d.ts +10 -0
- package/dist/components/InquiryDetailsStep.js +15 -0
- package/dist/components/PatientDetailsStep.d.ts +3 -0
- package/dist/components/PatientDetailsStep.js +84 -0
- package/dist/components/PhoneVerificationStep.d.ts +3 -0
- package/dist/components/PhoneVerificationStep.js +49 -0
- package/dist/components/SuccessStep.d.ts +5 -0
- package/dist/components/SuccessStep.js +9 -0
- package/dist/components/custom-calendar.d.ts +5 -0
- package/dist/components/custom-calendar.js +171 -0
- package/dist/components/styles.d.ts +6 -0
- package/dist/components/styles.js +257 -0
- package/dist/components/theme-styles.d.ts +12 -0
- package/dist/components/theme-styles.js +319 -0
- package/dist/components/types.d.ts +181 -0
- package/dist/components/types.js +55 -0
- package/dist/components/ui/select.d.ts +10 -0
- package/dist/components/ui/select.js +21 -0
- package/dist/components/uiComponents/SelectDropdown.d.ts +41 -0
- package/dist/components/uiComponents/SelectDropdown.js +302 -0
- package/dist/components/utils.d.ts +5 -0
- package/dist/components/utils.js +15 -0
- package/dist/components/validation.d.ts +2 -0
- package/dist/components/validation.js +7 -0
- package/dist/context/TemplateContext.d.ts +12 -0
- package/dist/context/TemplateContext.js +19 -0
- package/dist/core/index.d.ts +4 -0
- package/dist/core/index.js +4 -0
- package/dist/core/theme/index.d.ts +3 -0
- package/dist/core/theme/index.js +3 -0
- package/dist/core/theme/themes.d.ts +8 -0
- package/dist/core/theme/themes.js +178 -0
- package/dist/core/theme/types.d.ts +106 -0
- package/dist/core/theme/types.js +1 -0
- package/dist/core/theme/utils.d.ts +8 -0
- package/dist/core/theme/utils.js +135 -0
- package/dist/enquiry-form/index.d.ts +4 -0
- package/dist/enquiry-form/index.js +4 -0
- package/dist/enquiry-form/provider.d.ts +3 -0
- package/dist/enquiry-form/provider.js +9 -0
- package/dist/enquiry-form/serialization.d.ts +4 -0
- package/dist/enquiry-form/serialization.js +57 -0
- package/dist/enquiry-form/types.d.ts +38 -0
- package/dist/enquiry-form/types.js +1 -0
- package/dist/enquiry-form/validation.d.ts +6 -0
- package/dist/enquiry-form/validation.js +21 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +7 -0
- package/dist/lib/templateUtils.d.ts +3 -0
- package/dist/lib/templateUtils.js +28 -0
- package/dist/react/ThemeProvider.d.ts +18 -0
- package/dist/react/ThemeProvider.js +45 -0
- package/dist/react/hooks/useTheme.d.ts +1 -0
- package/dist/react/hooks/useTheme.js +1 -0
- package/dist/react/index.d.ts +5 -0
- package/dist/react/index.js +3 -0
- package/dist/services/AppointmentService.d.ts +4 -5
- package/dist/services/AppointmentService.js +12 -10
- package/dist/services/EnquiryService.d.ts +5 -0
- package/dist/services/EnquiryService.js +30 -0
- package/dist/templates/registry.d.ts +12 -0
- package/dist/templates/registry.js +58 -0
- package/dist/vanilla/AppointmentCalendarWidget.d.ts +2 -34
- package/dist/vanilla/AppointmentCalendarWidget.js +264 -275
- package/dist/vanilla/EnquiryFormWidget.d.ts +35 -0
- package/dist/vanilla/EnquiryFormWidget.js +425 -0
- package/dist/vanilla/client/MedosClient.d.ts +3 -5
- package/dist/vanilla/components/AppointmentCalender.d.ts +1 -4
- package/dist/vanilla/components/AppointmentDateTimeModal.d.ts +14 -0
- package/dist/vanilla/components/ConfigurableCard.d.ts +12 -0
- package/dist/vanilla/components/ContactInformationStep.d.ts +13 -0
- package/dist/vanilla/components/ContactPreferenceStep.d.ts +9 -0
- package/dist/vanilla/components/DoctorSelectModal.d.ts +7 -0
- package/dist/vanilla/components/EnquiryForm.d.ts +7 -0
- package/dist/vanilla/components/Icons/Check.d.ts +6 -0
- package/dist/vanilla/components/Icons/ChevronDownIcon.d.ts +4 -0
- package/dist/vanilla/components/Icons/ChevronLeft.d.ts +3 -0
- package/dist/vanilla/components/Icons/ChevronRight.d.ts +3 -0
- package/dist/vanilla/components/Icons/ConfirmationCheck.d.ts +1 -0
- package/dist/vanilla/components/Icons/ConsultationType.d.ts +1 -0
- package/dist/vanilla/components/Icons/Date&TimeIcon.d.ts +1 -0
- package/dist/vanilla/components/Icons/MapIcon.d.ts +1 -0
- package/dist/vanilla/components/Icons/PaymentMethodIcon.d.ts +1 -0
- package/dist/vanilla/components/Icons/UserIcon.d.ts +1 -0
- package/dist/vanilla/components/InquiryDetailsStep.d.ts +10 -0
- package/dist/vanilla/components/PatientDetailsStep.d.ts +3 -0
- package/dist/vanilla/components/PhoneVerificationStep.d.ts +3 -0
- package/dist/vanilla/components/SuccessStep.d.ts +5 -0
- package/dist/vanilla/components/custom-calendar.d.ts +5 -0
- package/dist/vanilla/components/styles.d.ts +6 -0
- package/dist/vanilla/components/theme-styles.d.ts +12 -0
- package/dist/vanilla/components/types.d.ts +181 -0
- package/dist/vanilla/components/ui/select.d.ts +10 -0
- package/dist/vanilla/components/uiComponents/SelectDropdown.d.ts +41 -0
- package/dist/vanilla/components/utils.d.ts +5 -0
- package/dist/vanilla/components/validation.d.ts +2 -0
- package/dist/vanilla/context/TemplateContext.d.ts +12 -0
- package/dist/vanilla/core/index.d.ts +4 -0
- package/dist/vanilla/core/theme/index.d.ts +3 -0
- package/dist/vanilla/core/theme/themes.d.ts +8 -0
- package/dist/vanilla/core/theme/types.d.ts +106 -0
- package/dist/vanilla/core/theme/utils.d.ts +8 -0
- package/dist/vanilla/enquiry-form/index.d.ts +4 -0
- package/dist/vanilla/enquiry-form/provider.d.ts +3 -0
- package/dist/vanilla/enquiry-form/serialization.d.ts +4 -0
- package/dist/vanilla/enquiry-form/types.d.ts +38 -0
- package/dist/vanilla/enquiry-form/validation.d.ts +6 -0
- package/dist/vanilla/enquiry-widget.js +4650 -0
- package/dist/vanilla/index.d.ts +9 -0
- package/dist/vanilla/index.js +3 -1
- package/dist/vanilla/lib/templateUtils.d.ts +3 -0
- package/dist/vanilla/react/ThemeProvider.d.ts +18 -0
- package/dist/vanilla/react/hooks/useTheme.d.ts +1 -0
- package/dist/vanilla/react/index.d.ts +5 -0
- package/dist/vanilla/services/AppointmentService.d.ts +4 -5
- package/dist/vanilla/services/EnquiryService.d.ts +5 -0
- package/dist/vanilla/templates/alternative.css +13 -0
- package/dist/vanilla/templates/default.css +13 -0
- package/dist/vanilla/templates/registry.d.ts +12 -0
- package/dist/vanilla/theme-injector.d.ts +6 -0
- package/dist/vanilla/theme-injector.js +44 -0
- package/dist/vanilla/vanilla/AppointmentCalendarWidget.d.ts +2 -34
- package/dist/vanilla/vanilla/EnquiryFormWidget.d.ts +35 -0
- package/dist/vanilla/vanilla/index.d.ts +3 -1
- package/dist/vanilla/vanilla/theme-injector.d.ts +6 -0
- package/dist/vanilla/vanilla/widget.d.ts +6 -1
- package/dist/vanilla/widget.css +173 -0
- package/dist/vanilla/widget.d.ts +6 -1
- package/dist/vanilla/widget.js +813 -288
- package/package.json +9 -4
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { MedosTheme } from "../core/theme/types";
|
|
3
|
+
export declare function getContainerStyles(theme: MedosTheme, prefix?: string): Record<string, React.CSSProperties>;
|
|
4
|
+
export declare function getButtonStyles(theme: MedosTheme, prefix?: string): Record<string, React.CSSProperties>;
|
|
5
|
+
export declare function getPhoneVerifyStyles(theme: MedosTheme, prefix?: string): Record<string, React.CSSProperties>;
|
|
6
|
+
export declare function getPatientDetailsStyles(theme: MedosTheme, prefix?: string): Record<string, React.CSSProperties>;
|
|
7
|
+
export declare function getSuccessStyles(theme: MedosTheme, prefix?: string): Record<string, React.CSSProperties>;
|
|
8
|
+
export declare const CONTAINER_STYLES: Record<string, React.CSSProperties>;
|
|
9
|
+
export declare const BUTTON_STYLES: Record<string, React.CSSProperties>;
|
|
10
|
+
export declare const PHONE_VERIFY_STYLES: Record<string, React.CSSProperties>;
|
|
11
|
+
export declare const PATIENT_DETAILS_STYLES: Record<string, React.CSSProperties>;
|
|
12
|
+
export declare const SUCCESS_STYLES: Record<string, React.CSSProperties>;
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { Doctor, Slot, AddressItem } from "../services/AppointmentService";
|
|
2
|
+
export type AppointmentCalenderProps = {
|
|
3
|
+
onError?: (err: Error) => void;
|
|
4
|
+
};
|
|
5
|
+
export type PhoneVerificationStepProps = {
|
|
6
|
+
state: AppointmentState;
|
|
7
|
+
dispatch: React.Dispatch<AppointmentAction>;
|
|
8
|
+
onSendOtp: () => Promise<void>;
|
|
9
|
+
onVerifyOtp: () => Promise<void>;
|
|
10
|
+
onBack: () => void;
|
|
11
|
+
onContinue: () => void;
|
|
12
|
+
};
|
|
13
|
+
export type PatientDetailsStepProps = {
|
|
14
|
+
state: AppointmentState;
|
|
15
|
+
dispatch: React.Dispatch<AppointmentAction>;
|
|
16
|
+
onBack: () => void;
|
|
17
|
+
onSubmit: () => Promise<void>;
|
|
18
|
+
};
|
|
19
|
+
export type SuccessStepProps = {
|
|
20
|
+
onReset: () => void;
|
|
21
|
+
};
|
|
22
|
+
export type PhoneInputSectionProps = {
|
|
23
|
+
countryCode: string;
|
|
24
|
+
patientPhone: string;
|
|
25
|
+
onCountryCodeChange: (code: string) => void;
|
|
26
|
+
onPhoneChange: (phone: string) => void;
|
|
27
|
+
};
|
|
28
|
+
export type OtpInputSectionProps = {
|
|
29
|
+
countryCode: string;
|
|
30
|
+
patientPhone: string;
|
|
31
|
+
otpCode: string;
|
|
32
|
+
otpVerified: boolean;
|
|
33
|
+
onOtpChange: (code: string) => void;
|
|
34
|
+
};
|
|
35
|
+
export type PatientInfoSectionProps = {
|
|
36
|
+
state: AppointmentState;
|
|
37
|
+
dispatch: React.Dispatch<AppointmentAction>;
|
|
38
|
+
};
|
|
39
|
+
export type AddressInfoSectionProps = {
|
|
40
|
+
state: AppointmentState;
|
|
41
|
+
dispatch: React.Dispatch<AppointmentAction>;
|
|
42
|
+
};
|
|
43
|
+
export interface AppointmentState {
|
|
44
|
+
step: number;
|
|
45
|
+
loading: boolean;
|
|
46
|
+
error: string | null;
|
|
47
|
+
workspaceId: number | null;
|
|
48
|
+
addresses: AddressItem[];
|
|
49
|
+
addressDoctorsMap: Record<number, Doctor[]>;
|
|
50
|
+
selectedAddress: number | null;
|
|
51
|
+
selectedDoctor: number | null;
|
|
52
|
+
selectedDate: Date;
|
|
53
|
+
slots: Slot[];
|
|
54
|
+
selectedSlot: Slot | null;
|
|
55
|
+
consultationMode: "ONLINE" | "OFFLINE";
|
|
56
|
+
consultationCharge: string;
|
|
57
|
+
patientName: string;
|
|
58
|
+
patientAge: string;
|
|
59
|
+
patientEmail: string;
|
|
60
|
+
patientGender: string;
|
|
61
|
+
bloodGroup: string;
|
|
62
|
+
patientAddress: string;
|
|
63
|
+
patientCity: string;
|
|
64
|
+
patientState: string;
|
|
65
|
+
patientCountry: string;
|
|
66
|
+
patientZipcode: string;
|
|
67
|
+
patientLandmark: string;
|
|
68
|
+
countryCode: string;
|
|
69
|
+
patientPhone: string;
|
|
70
|
+
otpCode: string;
|
|
71
|
+
otpSent: boolean;
|
|
72
|
+
otpVerified: boolean;
|
|
73
|
+
otpSending: boolean;
|
|
74
|
+
otpVerifying: boolean;
|
|
75
|
+
}
|
|
76
|
+
export type AppointmentAction = {
|
|
77
|
+
type: "SET_STEP";
|
|
78
|
+
payload: number;
|
|
79
|
+
} | {
|
|
80
|
+
type: "SET_LOADING";
|
|
81
|
+
payload: boolean;
|
|
82
|
+
} | {
|
|
83
|
+
type: "SET_ERROR";
|
|
84
|
+
payload: string | null;
|
|
85
|
+
} | {
|
|
86
|
+
type: "SET_WORKSPACE";
|
|
87
|
+
payload: {
|
|
88
|
+
id: number;
|
|
89
|
+
addresses: AddressItem[];
|
|
90
|
+
};
|
|
91
|
+
} | {
|
|
92
|
+
type: "SET_SELECTED_ADDRESS";
|
|
93
|
+
payload: number | null;
|
|
94
|
+
} | {
|
|
95
|
+
type: "SET_SELECTED_DOCTOR";
|
|
96
|
+
payload: number | null;
|
|
97
|
+
} | {
|
|
98
|
+
type: "SET_SELECTED_DATE";
|
|
99
|
+
payload: Date;
|
|
100
|
+
} | {
|
|
101
|
+
type: "SET_SLOTS";
|
|
102
|
+
payload: Slot[];
|
|
103
|
+
} | {
|
|
104
|
+
type: "SET_SELECTED_SLOT";
|
|
105
|
+
payload: Slot | null;
|
|
106
|
+
} | {
|
|
107
|
+
type: "SET_CONSULTATION_MODE";
|
|
108
|
+
payload: "ONLINE" | "OFFLINE";
|
|
109
|
+
} | {
|
|
110
|
+
type: "SET_CONSULTATION_CHARGE";
|
|
111
|
+
payload: string;
|
|
112
|
+
} | {
|
|
113
|
+
type: "SET_PATIENT_NAME";
|
|
114
|
+
payload: string;
|
|
115
|
+
} | {
|
|
116
|
+
type: "SET_PATIENT_AGE";
|
|
117
|
+
payload: string;
|
|
118
|
+
} | {
|
|
119
|
+
type: "SET_PATIENT_EMAIL";
|
|
120
|
+
payload: string;
|
|
121
|
+
} | {
|
|
122
|
+
type: "SET_PATIENT_GENDER";
|
|
123
|
+
payload: string;
|
|
124
|
+
} | {
|
|
125
|
+
type: "SET_BLOOD_GROUP";
|
|
126
|
+
payload: string;
|
|
127
|
+
} | {
|
|
128
|
+
type: "SET_PATIENT_ADDRESS";
|
|
129
|
+
payload: string;
|
|
130
|
+
} | {
|
|
131
|
+
type: "SET_PATIENT_CITY";
|
|
132
|
+
payload: string;
|
|
133
|
+
} | {
|
|
134
|
+
type: "SET_PATIENT_STATE";
|
|
135
|
+
payload: string;
|
|
136
|
+
} | {
|
|
137
|
+
type: "SET_PATIENT_COUNTRY";
|
|
138
|
+
payload: string;
|
|
139
|
+
} | {
|
|
140
|
+
type: "SET_PATIENT_ZIPCODE";
|
|
141
|
+
payload: string;
|
|
142
|
+
} | {
|
|
143
|
+
type: "SET_PATIENT_LANDMARK";
|
|
144
|
+
payload: string;
|
|
145
|
+
} | {
|
|
146
|
+
type: "SET_COUNTRY_CODE";
|
|
147
|
+
payload: string;
|
|
148
|
+
} | {
|
|
149
|
+
type: "SET_PATIENT_PHONE";
|
|
150
|
+
payload: string;
|
|
151
|
+
} | {
|
|
152
|
+
type: "SET_OTP_CODE";
|
|
153
|
+
payload: string;
|
|
154
|
+
} | {
|
|
155
|
+
type: "SET_OTP_SENT";
|
|
156
|
+
payload: boolean;
|
|
157
|
+
} | {
|
|
158
|
+
type: "SET_OTP_VERIFIED";
|
|
159
|
+
payload: boolean;
|
|
160
|
+
} | {
|
|
161
|
+
type: "SET_OTP_SENDING";
|
|
162
|
+
payload: boolean;
|
|
163
|
+
} | {
|
|
164
|
+
type: "SET_OTP_VERIFYING";
|
|
165
|
+
payload: boolean;
|
|
166
|
+
} | {
|
|
167
|
+
type: "RESET_FORM";
|
|
168
|
+
};
|
|
169
|
+
export declare const COUNTRY_CODES: {
|
|
170
|
+
code: string;
|
|
171
|
+
label: string;
|
|
172
|
+
}[];
|
|
173
|
+
export declare const GENDER_OPTIONS: {
|
|
174
|
+
value: string;
|
|
175
|
+
label: string;
|
|
176
|
+
}[];
|
|
177
|
+
export declare const BLOOD_GROUP_OPTIONS: {
|
|
178
|
+
value: string;
|
|
179
|
+
label: string;
|
|
180
|
+
}[];
|
|
181
|
+
export declare const INITIAL_STATE: AppointmentState;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface SelectProps extends React.SelectHTMLAttributes<HTMLSelectElement> {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
}
|
|
5
|
+
declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLSelectElement>>;
|
|
6
|
+
export interface SelectOptionProps extends React.OptionHTMLAttributes<HTMLOptionElement> {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
declare const SelectOption: React.ForwardRefExoticComponent<SelectOptionProps & React.RefAttributes<HTMLOptionElement>>;
|
|
10
|
+
export { Select, SelectOption };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface SelectProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
value?: string;
|
|
5
|
+
onValueChange?: (value: string) => void;
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface SelectTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
error?: boolean;
|
|
13
|
+
}
|
|
14
|
+
interface SelectValueProps {
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
}
|
|
17
|
+
interface SelectContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
interface SelectItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
22
|
+
children: React.ReactNode;
|
|
23
|
+
value: string;
|
|
24
|
+
className?: string;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
}
|
|
27
|
+
interface BaseComponentProps {
|
|
28
|
+
children: React.ReactNode;
|
|
29
|
+
className?: string;
|
|
30
|
+
}
|
|
31
|
+
declare const Select: React.FC<SelectProps>;
|
|
32
|
+
declare const SelectTrigger: React.ForwardRefExoticComponent<SelectTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
33
|
+
declare const SelectValue: React.FC<SelectValueProps>;
|
|
34
|
+
declare const SelectContent: React.ForwardRefExoticComponent<SelectContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
35
|
+
declare const SelectItem: React.ForwardRefExoticComponent<SelectItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
36
|
+
declare const SelectGroup: React.FC<BaseComponentProps>;
|
|
37
|
+
declare const SelectLabel: React.FC<BaseComponentProps>;
|
|
38
|
+
declare const SelectSeparator: React.FC<{
|
|
39
|
+
className?: string;
|
|
40
|
+
}>;
|
|
41
|
+
export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import type { TemplateId } from "../core";
|
|
3
|
+
interface TemplateContextType {
|
|
4
|
+
templateId: TemplateId;
|
|
5
|
+
}
|
|
6
|
+
export interface TemplateProviderProps {
|
|
7
|
+
templateId: TemplateId;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare const TemplateProvider: React.FC<TemplateProviderProps>;
|
|
11
|
+
export declare const useTemplate: () => TemplateContextType;
|
|
12
|
+
export {};
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
export { MedosClient } from "../client/MedosClient";
|
|
2
|
+
export * from "./theme";
|
|
2
3
|
export * from "../appointments/provider";
|
|
3
4
|
export * from "../appointments/types";
|
|
4
5
|
export * from "../appointment-calendar/provider";
|
|
5
6
|
export * from "../appointment-calendar/types";
|
|
7
|
+
export * from "../enquiry-form/provider";
|
|
8
|
+
export * from "../enquiry-form/types";
|
|
6
9
|
export { PatientService, SendPhoneVerificationOtpPayload, VerifyPhoneVerificationOtpPayload, } from "../services/PatientService";
|
|
7
10
|
export { AppointmentService, type BookAppointmentPayload, type PatientPayload, type PatientAddressPayload, type AddressesResponse, type AddressItem, } from "../services/AppointmentService";
|
|
8
11
|
export { AuthService } from "../services/AuthService";
|
|
12
|
+
export { EnquiryService } from "../services/EnquiryService";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { MedosTheme } from "./types";
|
|
2
|
+
export declare const defaultTheme: MedosTheme;
|
|
3
|
+
export declare const modernTheme: MedosTheme;
|
|
4
|
+
export declare const themes: {
|
|
5
|
+
readonly default: MedosTheme;
|
|
6
|
+
readonly modern: MedosTheme;
|
|
7
|
+
};
|
|
8
|
+
export type ThemeName = keyof typeof themes;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
export interface ThemeColors {
|
|
2
|
+
primary: string;
|
|
3
|
+
primaryHover: string;
|
|
4
|
+
primaryActive: string;
|
|
5
|
+
secondary: string;
|
|
6
|
+
secondaryHover: string;
|
|
7
|
+
accent: string;
|
|
8
|
+
accentHover: string;
|
|
9
|
+
background: string;
|
|
10
|
+
backgroundSecondary: string;
|
|
11
|
+
backgroundTertiary: string;
|
|
12
|
+
surface: string;
|
|
13
|
+
surfaceHover: string;
|
|
14
|
+
border: string;
|
|
15
|
+
borderHover: string;
|
|
16
|
+
borderFocus: string;
|
|
17
|
+
text: string;
|
|
18
|
+
textSecondary: string;
|
|
19
|
+
textTertiary: string;
|
|
20
|
+
textDisabled: string;
|
|
21
|
+
textOnPrimary: string;
|
|
22
|
+
textOnSecondary: string;
|
|
23
|
+
success: string;
|
|
24
|
+
successBackground: string;
|
|
25
|
+
successBorder: string;
|
|
26
|
+
error: string;
|
|
27
|
+
errorBackground: string;
|
|
28
|
+
errorBorder: string;
|
|
29
|
+
warning: string;
|
|
30
|
+
warningBackground: string;
|
|
31
|
+
warningBorder: string;
|
|
32
|
+
info: string;
|
|
33
|
+
infoBackground: string;
|
|
34
|
+
infoBorder: string;
|
|
35
|
+
}
|
|
36
|
+
export interface ThemeTypography {
|
|
37
|
+
fontFamily: string;
|
|
38
|
+
fontFamilyHeading: string;
|
|
39
|
+
fontSizeXs: string;
|
|
40
|
+
fontSizeSm: string;
|
|
41
|
+
fontSizeMd: string;
|
|
42
|
+
fontSizeLg: string;
|
|
43
|
+
fontSizeXl: string;
|
|
44
|
+
fontSize2xl: string;
|
|
45
|
+
fontSize3xl: string;
|
|
46
|
+
fontWeightNormal: string;
|
|
47
|
+
fontWeightMedium: string;
|
|
48
|
+
fontWeightSemibold: string;
|
|
49
|
+
fontWeightBold: string;
|
|
50
|
+
lineHeightTight: string;
|
|
51
|
+
lineHeightNormal: string;
|
|
52
|
+
lineHeightRelaxed: string;
|
|
53
|
+
}
|
|
54
|
+
export interface ThemeSpacing {
|
|
55
|
+
xs: string;
|
|
56
|
+
sm: string;
|
|
57
|
+
md: string;
|
|
58
|
+
lg: string;
|
|
59
|
+
xl: string;
|
|
60
|
+
"2xl": string;
|
|
61
|
+
"3xl": string;
|
|
62
|
+
"4xl": string;
|
|
63
|
+
}
|
|
64
|
+
export interface ThemeShadows {
|
|
65
|
+
sm: string;
|
|
66
|
+
md: string;
|
|
67
|
+
lg: string;
|
|
68
|
+
xl: string;
|
|
69
|
+
"2xl": string;
|
|
70
|
+
none: string;
|
|
71
|
+
}
|
|
72
|
+
export interface ThemeRadii {
|
|
73
|
+
none: string;
|
|
74
|
+
sm: string;
|
|
75
|
+
md: string;
|
|
76
|
+
lg: string;
|
|
77
|
+
xl: string;
|
|
78
|
+
full: string;
|
|
79
|
+
}
|
|
80
|
+
export interface ThemeTransitions {
|
|
81
|
+
fast: string;
|
|
82
|
+
normal: string;
|
|
83
|
+
slow: string;
|
|
84
|
+
}
|
|
85
|
+
export interface MedosTheme {
|
|
86
|
+
name: string;
|
|
87
|
+
colors: ThemeColors;
|
|
88
|
+
typography: ThemeTypography;
|
|
89
|
+
spacing: ThemeSpacing;
|
|
90
|
+
shadows: ThemeShadows;
|
|
91
|
+
radii: ThemeRadii;
|
|
92
|
+
transitions: ThemeTransitions;
|
|
93
|
+
}
|
|
94
|
+
export type PartialTheme = {
|
|
95
|
+
name?: string;
|
|
96
|
+
colors?: Partial<ThemeColors>;
|
|
97
|
+
typography?: Partial<ThemeTypography>;
|
|
98
|
+
spacing?: Partial<ThemeSpacing>;
|
|
99
|
+
shadows?: Partial<ThemeShadows>;
|
|
100
|
+
radii?: Partial<ThemeRadii>;
|
|
101
|
+
transitions?: Partial<ThemeTransitions>;
|
|
102
|
+
};
|
|
103
|
+
export interface ThemeConfig {
|
|
104
|
+
theme?: MedosTheme | PartialTheme;
|
|
105
|
+
cssVariablePrefix?: string;
|
|
106
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { MedosTheme, PartialTheme } from "./types";
|
|
2
|
+
export declare function mergeTheme(partialTheme?: PartialTheme): MedosTheme;
|
|
3
|
+
export declare function generateCssVariables(theme: MedosTheme, prefix?: string): string;
|
|
4
|
+
export declare function generateCssVariablesObject(theme: MedosTheme, prefix?: string): Record<string, string>;
|
|
5
|
+
export declare function getCssVar(prefix: string, category: string, key: string, fallback?: string): string;
|
|
6
|
+
export declare function injectCssVariables(theme: MedosTheme, containerId: string, prefix?: string): void;
|
|
7
|
+
export declare function createThemeStyleTag(theme: MedosTheme, prefix?: string, selector?: string): HTMLStyleElement | null;
|
|
8
|
+
export declare function validateTheme(theme: any): string[];
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface Enquiry {
|
|
2
|
+
id?: string;
|
|
3
|
+
patientName: string;
|
|
4
|
+
patientEmail: string;
|
|
5
|
+
countryCode: string;
|
|
6
|
+
patientPhone: string;
|
|
7
|
+
inquirySubject: string;
|
|
8
|
+
inquiryMessage: string;
|
|
9
|
+
preferredContactMethod: "PHONE" | "EMAIL" | "BOTH";
|
|
10
|
+
createdAt?: string;
|
|
11
|
+
status?: "PENDING" | "RESPONDED" | "CLOSED";
|
|
12
|
+
}
|
|
13
|
+
export interface EnquiryFormState {
|
|
14
|
+
step: number;
|
|
15
|
+
loading: boolean;
|
|
16
|
+
error: string | null;
|
|
17
|
+
patientName: string;
|
|
18
|
+
patientEmail: string;
|
|
19
|
+
countryCode: string;
|
|
20
|
+
patientPhone: string;
|
|
21
|
+
inquirySubject: string;
|
|
22
|
+
inquiryMessage: string;
|
|
23
|
+
preferredContactMethod: "PHONE" | "EMAIL" | "BOTH";
|
|
24
|
+
submitted: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface EnquirySubmission {
|
|
27
|
+
patientName: string;
|
|
28
|
+
patientEmail: string;
|
|
29
|
+
countryCode: string;
|
|
30
|
+
patientPhone: string;
|
|
31
|
+
inquirySubject: string;
|
|
32
|
+
inquiryMessage: string;
|
|
33
|
+
preferredContactMethod: "PHONE" | "EMAIL" | "BOTH";
|
|
34
|
+
}
|
|
35
|
+
export interface ValidationResult {
|
|
36
|
+
isValid: boolean;
|
|
37
|
+
error?: string;
|
|
38
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const validateName: (name: string) => boolean;
|
|
2
|
+
export declare const validateEmail: (email: string) => boolean;
|
|
3
|
+
export declare const validatePhoneNumber: (phone: string) => boolean;
|
|
4
|
+
export declare const validateSubject: (subject: string) => boolean;
|
|
5
|
+
export declare const validateMessage: (message: string) => boolean;
|
|
6
|
+
export declare const validateCountryCode: (code: string) => boolean;
|