medos-sdk 1.1.3 → 1.1.5
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/components/AppointmentCalender.js +17 -1
- package/dist/components/DoctorSelectModal.js +1 -1
- package/dist/components/EnquiryForm.js +17 -1
- package/dist/components/Icons/MedosLogo.d.ts +3 -0
- package/dist/components/Icons/MedosLogo.js +3 -0
- package/dist/components/PatientDetailsStep.js +16 -8
- package/dist/constants/index.d.ts +1 -1
- package/dist/constants/index.js +1 -1
- package/dist/vanilla/components/Icons/MedosLogo.d.ts +3 -0
- package/dist/vanilla/constants/index.d.ts +1 -1
- package/dist/vanilla/enquiry-widget.js +1 -1
- package/dist/vanilla/widget.js +1 -1
- package/package.json +1 -1
|
@@ -11,6 +11,7 @@ import { INITIAL_STATE, } from "./types";
|
|
|
11
11
|
import { validatePhoneNumber, validateCountryCode } from "./validation";
|
|
12
12
|
import { formatDateToISO, parsePatientName } from "./utils";
|
|
13
13
|
import { useTheme } from "../react/hooks/useTheme";
|
|
14
|
+
import MedosLogo from "./Icons/MedosLogo";
|
|
14
15
|
const appointmentReducer = (state, action) => {
|
|
15
16
|
switch (action.type) {
|
|
16
17
|
case "SET_STEP":
|
|
@@ -364,7 +365,7 @@ export const AppointmentCalender = ({ onError, }) => {
|
|
|
364
365
|
}, []);
|
|
365
366
|
const theme = useTheme();
|
|
366
367
|
const styles = getStyles(theme);
|
|
367
|
-
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: "Book Appointment" }) }), _jsx("hr", {}), _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(DoctorSelectModal, { onCancel: () => dispatch({ type: "SET_STEP", payload: 0 }), onContinue: handleDoctorSelect })), state.step === 1 && (_jsx(AppointmentDateTimeModal, { onlineFee: 500, offlineFee: 300, slots: state.slots, onCancel: goBack, onDateChange: handleDateChange, onContinue: handleDateTimeModalContinue })), state.step === 3 && (_jsx(PhoneVerificationStep, { state: state, dispatch: dispatch, onSendOtp: sendOtp, onVerifyOtp: verifyOtp, onBack: goBack, onContinue: goToNext })), state.step === 4 && (_jsx(PatientDetailsStep, { state: state, dispatch: dispatch, onBack: goBack, onSubmit: submitAppointment })), state.step === 5 && _jsx(SuccessStep, { onReset: resetForm })] })] }) }));
|
|
368
|
+
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: "Book Appointment" }) }), _jsx("hr", {}), _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(DoctorSelectModal, { onCancel: () => dispatch({ type: "SET_STEP", payload: 0 }), onContinue: handleDoctorSelect })), state.step === 1 && (_jsx(AppointmentDateTimeModal, { onlineFee: 500, offlineFee: 300, slots: state.slots, onCancel: goBack, onDateChange: handleDateChange, onContinue: handleDateTimeModalContinue })), state.step === 3 && (_jsx(PhoneVerificationStep, { state: state, dispatch: dispatch, onSendOtp: sendOtp, onVerifyOtp: verifyOtp, onBack: goBack, onContinue: goToNext })), state.step === 4 && (_jsx(PatientDetailsStep, { state: state, dispatch: dispatch, onBack: goBack, onSubmit: submitAppointment })), state.step === 5 && _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" } }) })] })] })] }) }));
|
|
368
369
|
};
|
|
369
370
|
const getStyles = (theme) => ({
|
|
370
371
|
container: {
|
|
@@ -404,4 +405,19 @@ const getStyles = (theme) => ({
|
|
|
404
405
|
border: `1px solid ${theme.colors.errorBorder}`,
|
|
405
406
|
fontSize: theme.typography.fontSizeSm,
|
|
406
407
|
},
|
|
408
|
+
branding: {
|
|
409
|
+
display: "flex",
|
|
410
|
+
alignItems: "center",
|
|
411
|
+
justifyContent: "center",
|
|
412
|
+
gap: 8,
|
|
413
|
+
marginTop: 24,
|
|
414
|
+
paddingTop: 16,
|
|
415
|
+
borderTop: `1px solid ${theme.colors.border}`,
|
|
416
|
+
opacity: 0.8,
|
|
417
|
+
},
|
|
418
|
+
poweredBy: {
|
|
419
|
+
fontSize: 12,
|
|
420
|
+
color: theme.colors.textSecondary,
|
|
421
|
+
fontWeight: 500,
|
|
422
|
+
},
|
|
407
423
|
});
|
|
@@ -50,7 +50,7 @@ const getStyles = (theme) => ({
|
|
|
50
50
|
padding: "20px 24px 10px 24px",
|
|
51
51
|
},
|
|
52
52
|
contentWrapper: {
|
|
53
|
-
padding: "20px 24px
|
|
53
|
+
padding: "20px 24px 10px 24px",
|
|
54
54
|
},
|
|
55
55
|
title: { fontSize: 20, fontWeight: 600, margin: 0 },
|
|
56
56
|
fieldGroup: { marginBottom: 18 },
|
|
@@ -7,6 +7,7 @@ import { InquiryDetailsStep } from "./InquiryDetailsStep";
|
|
|
7
7
|
import { ContactPreferenceStep } from "./ContactPreferenceStep";
|
|
8
8
|
import { SuccessStep } from "./SuccessStep";
|
|
9
9
|
import { useTheme } from "../react/hooks/useTheme";
|
|
10
|
+
import MedosLogo from "./Icons/MedosLogo";
|
|
10
11
|
const INITIAL_STATE = {
|
|
11
12
|
step: 0,
|
|
12
13
|
loading: false,
|
|
@@ -156,7 +157,7 @@ export const EnquiryForm = ({ onSuccess, onError, }) => {
|
|
|
156
157
|
return (_jsx("div", { style: styles.container, children: _jsxs("div", { style: styles.card, children: [_jsxs("div", { style: styles.header, children: [_jsx("h2", { style: styles.title, children: "Submit Inquiry" }), _jsxs("p", { style: styles.stepIndicator, children: ["Step ", state.step + 1, " of 4"] })] }), _jsxs("div", { style: styles.content, children: [state.loading && _jsx("div", { style: { marginBottom: 12 }, children: "Loading..." }), state.error && _jsx("div", { style: styles.errorMessage, children: state.error }), state.step === 0 && (_jsx(ContactInformationStep, { patientName: state.patientName, patientEmail: state.patientEmail, countryCode: state.countryCode, patientPhone: state.patientPhone, onNameChange: (value) => dispatch({ type: "SET_PATIENT_NAME", payload: value }), onEmailChange: (value) => dispatch({ type: "SET_PATIENT_EMAIL", payload: value }), onCountryCodeChange: (value) => dispatch({ type: "SET_COUNTRY_CODE", payload: value }), onPhoneChange: (value) => dispatch({ type: "SET_PATIENT_PHONE", payload: value }), onNext: goToNext })), state.step === 1 && (_jsx(InquiryDetailsStep, { inquirySubject: state.inquirySubject, inquiryMessage: state.inquiryMessage, onSubjectChange: (value) => dispatch({ type: "SET_INQUIRY_SUBJECT", payload: value }), onMessageChange: (value) => dispatch({ type: "SET_INQUIRY_MESSAGE", payload: value }), onBack: goBack, onNext: goToNext })), state.step === 2 && (_jsx(ContactPreferenceStep, { preferredContactMethod: state.preferredContactMethod, onContactMethodChange: (method) => dispatch({
|
|
157
158
|
type: "SET_PREFERRED_CONTACT_METHOD",
|
|
158
159
|
payload: method,
|
|
159
|
-
}), onBack: goBack, onSubmit: submitEnquiry, isLoading: state.loading })), state.step === 3 && _jsx(SuccessStep, { onReset: resetForm })] })] }) }));
|
|
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" } }) })] })] })] }) }));
|
|
160
161
|
};
|
|
161
162
|
const getStyles = (theme) => ({
|
|
162
163
|
container: {
|
|
@@ -209,4 +210,19 @@ const getStyles = (theme) => ({
|
|
|
209
210
|
border: `1px solid ${theme.colors.errorBorder}`,
|
|
210
211
|
fontSize: theme.typography.fontSizeSm,
|
|
211
212
|
},
|
|
213
|
+
branding: {
|
|
214
|
+
display: "flex",
|
|
215
|
+
alignItems: "center",
|
|
216
|
+
justifyContent: "center",
|
|
217
|
+
gap: 8,
|
|
218
|
+
marginTop: 24,
|
|
219
|
+
paddingTop: 16,
|
|
220
|
+
borderTop: `1px solid ${theme.colors.border}`,
|
|
221
|
+
opacity: 0.8,
|
|
222
|
+
},
|
|
223
|
+
poweredBy: {
|
|
224
|
+
fontSize: 12,
|
|
225
|
+
color: theme.colors.textSecondary,
|
|
226
|
+
fontWeight: 500,
|
|
227
|
+
},
|
|
212
228
|
});
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
const MedosLogo = (props) => (_jsxs("svg", { width: "250", height: "236", viewBox: "0 0 250 236", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [_jsx("g", { filter: "url(#filter0_d_4215_30142)", children: _jsx("path", { d: "M14.2067 123.859L21.2068 123.862L38.2027 67.687L55.7021 152.687L77.707 60.6836L93.7021 123.863L239.202 123.863", stroke: "#27903F", strokeWidth: "4", strokeLinecap: "round" }) }), _jsx("path", { d: "M111.695 118.797C108.857 118.797 106.408 118.171 104.35 116.918C102.305 115.652 100.726 113.888 99.6136 111.625C98.5142 109.35 97.9645 106.703 97.9645 103.686C97.9645 100.669 98.5142 98.0103 99.6136 95.7092C100.726 93.3952 102.273 91.5927 104.254 90.3015C106.249 88.9975 108.575 88.3455 111.234 88.3455C112.768 88.3455 114.283 88.6012 115.779 89.1126C117.275 89.6239 118.636 90.4549 119.864 91.6055C121.091 92.7433 122.069 94.2518 122.798 96.131C123.526 98.0103 123.891 100.324 123.891 103.073V104.99H101.186V101.078H119.288C119.288 99.4165 118.956 97.9336 118.291 96.6296C117.639 95.3256 116.706 94.2965 115.491 93.5423C114.29 92.788 112.871 92.4109 111.234 92.4109C109.432 92.4109 107.872 92.8583 106.555 93.7532C105.251 94.6353 104.248 95.7859 103.545 97.2049C102.842 98.6239 102.49 100.145 102.49 101.769V104.377C102.49 106.601 102.874 108.487 103.641 110.034C104.42 111.568 105.501 112.738 106.881 113.543C108.262 114.336 109.866 114.732 111.695 114.732C112.884 114.732 113.957 114.566 114.916 114.233C115.888 113.888 116.725 113.377 117.428 112.699C118.131 112.009 118.675 111.152 119.058 110.13L123.43 111.357C122.97 112.84 122.197 114.144 121.11 115.269C120.023 116.381 118.681 117.25 117.083 117.877C115.485 118.49 113.689 118.797 111.695 118.797ZM141.897 118.797C139.442 118.797 137.276 118.177 135.396 116.937C133.517 115.684 132.047 113.92 130.986 111.645C129.925 109.356 129.394 106.652 129.394 103.533C129.394 100.439 129.925 97.7546 130.986 95.479C132.047 93.2035 133.523 91.4457 135.415 90.2056C137.308 88.9656 139.494 88.3455 141.974 88.3455C143.891 88.3455 145.406 88.6651 146.518 89.3043C147.643 89.9308 148.5 90.6467 149.088 91.4521C149.689 92.2447 150.156 92.8967 150.488 93.408H150.871V78.9109H155.397V118.184H151.025V113.658H150.488C150.156 114.195 149.683 114.873 149.069 115.691C148.455 116.496 147.58 117.218 146.442 117.858C145.304 118.484 143.789 118.797 141.897 118.797ZM142.511 114.732C144.326 114.732 145.86 114.259 147.113 113.313C148.366 112.354 149.318 111.031 149.97 109.343C150.622 107.643 150.948 105.681 150.948 103.456C150.948 101.257 150.629 99.3335 149.989 97.6843C149.35 96.0224 148.404 94.7312 147.151 93.8107C145.898 92.8775 144.352 92.4109 142.511 92.4109C140.593 92.4109 138.995 92.9031 137.717 93.8874C136.451 94.859 135.499 96.1822 134.859 97.8569C134.233 99.5188 133.92 101.385 133.92 103.456C133.92 105.553 134.239 107.458 134.879 109.171C135.531 110.871 136.489 112.226 137.755 113.236C139.033 114.233 140.619 114.732 142.511 114.732ZM199.138 98.5472C199.138 102.779 198.345 106.403 196.76 109.42C195.188 112.424 193.04 114.725 190.317 116.324C187.607 117.922 184.532 118.721 181.093 118.721C177.654 118.721 174.573 117.922 171.85 116.324C169.14 114.713 166.992 112.405 165.407 109.401C163.835 106.384 163.048 102.766 163.048 98.5472C163.048 94.3157 163.835 90.6978 165.407 87.6935C166.992 84.6765 169.14 82.369 171.85 80.7709C174.573 79.1729 177.654 78.3739 181.093 78.3739C184.532 78.3739 187.607 79.1729 190.317 80.7709C193.04 82.369 195.188 84.6765 196.76 87.6935C198.345 90.6978 199.138 94.3157 199.138 98.5472ZM191.985 98.5472C191.985 95.5685 191.518 93.0565 190.585 91.011C189.665 88.9528 188.386 87.3995 186.75 86.3512C185.114 85.2901 183.228 84.7596 181.093 84.7596C178.958 84.7596 177.072 85.2901 175.436 86.3512C173.8 87.3995 172.515 88.9528 171.582 91.011C170.661 93.0565 170.201 95.5685 170.201 98.5472C170.201 101.526 170.661 104.044 171.582 106.103C172.515 108.148 173.8 109.701 175.436 110.762C177.072 111.811 178.958 112.335 181.093 112.335C183.228 112.335 185.114 111.811 186.75 110.762C188.386 109.701 189.665 108.148 190.585 106.103C191.518 104.044 191.985 101.526 191.985 98.5472ZM227.207 89.707C227.028 88.0323 226.274 86.7283 224.944 85.7951C223.627 84.8619 221.914 84.3952 219.805 84.3952C218.322 84.3952 217.05 84.619 215.989 85.0664C214.928 85.5138 214.116 86.1211 213.553 86.8881C212.991 87.6552 212.703 88.5309 212.691 89.5153C212.691 90.3335 212.876 91.043 213.247 91.6438C213.63 92.2447 214.148 92.756 214.8 93.1779C215.452 93.587 216.174 93.9322 216.967 94.2134C217.759 94.4947 218.558 94.7312 219.364 94.9229L223.046 95.8434C224.529 96.1886 225.954 96.6552 227.322 97.2433C228.703 97.8313 229.936 98.5728 231.023 99.4677C232.122 100.363 232.992 101.443 233.631 102.708C234.27 103.974 234.59 105.457 234.59 107.157C234.59 109.458 234.002 111.485 232.825 113.236C231.649 114.975 229.949 116.336 227.725 117.321C225.513 118.292 222.835 118.778 219.69 118.778C216.634 118.778 213.982 118.305 211.732 117.359C209.494 116.413 207.743 115.032 206.477 113.217C205.225 111.402 204.547 109.19 204.445 106.582H211.444C211.546 107.95 211.968 109.088 212.71 109.995C213.451 110.903 214.416 111.581 215.605 112.028C216.807 112.475 218.149 112.699 219.632 112.699C221.179 112.699 222.534 112.469 223.698 112.009C224.874 111.536 225.794 110.884 226.459 110.053C227.124 109.209 227.463 108.225 227.475 107.1C227.463 106.077 227.162 105.233 226.574 104.569C225.986 103.891 225.161 103.328 224.1 102.881C223.052 102.421 221.825 102.012 220.419 101.654L215.95 100.503C212.716 99.6722 210.159 98.413 208.28 96.7255C206.414 95.0252 205.48 92.7688 205.48 89.9563C205.48 87.6424 206.107 85.6161 207.36 83.8775C208.625 82.1388 210.345 80.7901 212.518 79.8313C214.691 78.8597 217.152 78.3739 219.901 78.3739C222.688 78.3739 225.129 78.8597 227.226 79.8313C229.335 80.7901 230.991 82.1261 232.193 83.8391C233.394 85.5394 234.014 87.4954 234.053 89.707H227.207Z", fill: "#27903F" }), _jsx("defs", { children: _jsxs("filter", { id: "filter0_d_4215_30142", x: "12.2031", y: "60.1914", width: "237", height: "100.961", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB", children: [_jsx("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), _jsx("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0", result: "hardAlpha" }), _jsx("feOffset", { dx: "4", dy: "4" }), _jsx("feGaussianBlur", { stdDeviation: "2" }), _jsx("feComposite", { in2: "hardAlpha", operator: "out" }), _jsx("feColorMatrix", { type: "matrix", values: "0 0 0 0 0.152941 0 0 0 0 0.564706 0 0 0 0 0.247059 0 0 0 0.12 0" }), _jsx("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow_4215_30142" }), _jsx("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow_4215_30142", result: "shape" })] }) })] }));
|
|
3
|
+
export default MedosLogo;
|
|
@@ -40,14 +40,22 @@ const PatientInfoSection = ({ state, dispatch }) => {
|
|
|
40
40
|
type: "SET_PATIENT_NAME",
|
|
41
41
|
payload: `${firstName} ${e.target.value}`,
|
|
42
42
|
});
|
|
43
|
-
} })] })] }), _jsxs("div", { style: PATIENT_DETAILS_STYLES.gridRow, children: [_jsxs("div", { children: [
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
} })] })] }), _jsxs("div", { style: PATIENT_DETAILS_STYLES.gridRow, children: [_jsxs("div", { children: [_jsx("label", { style: PATIENT_DETAILS_STYLES.label, children: "Age" }), _jsx("input", { style: PATIENT_DETAILS_STYLES.input, type: "number", placeholder: "25", value: state.patientAge || "", min: "0", max: "120", onChange: (e) => {
|
|
44
|
+
const val = e.target.value;
|
|
45
|
+
if (val === "") {
|
|
46
|
+
dispatch({
|
|
47
|
+
type: "SET_PATIENT_AGE",
|
|
48
|
+
payload: "",
|
|
49
|
+
});
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const age = parseInt(val);
|
|
53
|
+
if (!isNaN(age) && age >= 0 && age <= 120) {
|
|
54
|
+
dispatch({
|
|
55
|
+
type: "SET_PATIENT_AGE",
|
|
56
|
+
payload: val,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
51
59
|
} })] }), _jsxs("div", { children: [_jsxs("label", { style: PATIENT_DETAILS_STYLES.label, children: ["Email ", _jsx("span", { style: { color: "#EF4444" }, children: "*" })] }), _jsx("input", { style: PATIENT_DETAILS_STYLES.input, type: "email", placeholder: "jane@example.com", value: state.patientEmail, onChange: (e) => dispatch({
|
|
52
60
|
type: "SET_PATIENT_EMAIL",
|
|
53
61
|
payload: e.target.value,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const API_BASE_URL = "https://api
|
|
1
|
+
export declare const API_BASE_URL = "https://api.medos.one/v1";
|
package/dist/constants/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const API_BASE_URL = "https://api
|
|
1
|
+
export const API_BASE_URL = "https://api.medos.one/v1";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const API_BASE_URL = "https://api
|
|
1
|
+
export declare const API_BASE_URL = "https://api.medos.one/v1";
|
package/dist/vanilla/widget.js
CHANGED
package/package.json
CHANGED