@mychoice/mychoice-sdk-modules 2.1.33 → 2.1.35
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/cjs/index.js +7 -63
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/init/StoryAppWrapper/StoryAppWrapper.d.ts +1 -1
- package/dist/cjs/init/StoryAppWrapper/interfaces.d.ts +1 -1
- package/dist/cjs/insurances/car/pages/{three-point-five/BestOfferFirst.d.ts → quote/PageAllQuotes.d.ts} +1 -1
- package/dist/cjs/insurances/car/pages/quote/sections/blocks/BlockConfirmImages.d.ts +1 -0
- package/dist/cjs/insurances/car/pages/quote/sections/blocks/BlockQuoteStatistics.d.ts +2 -0
- package/dist/cjs/shared/navigations/interfaces.d.ts +0 -1
- package/dist/cjs/shared/sections/quotes/OfferSection/BestOfferSection.d.ts +3 -0
- package/dist/cjs/shared/sections/quotes/OfferSection/DummyOfferSection.d.ts +3 -0
- package/dist/esm/index.js +7 -63
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/init/StoryAppWrapper/StoryAppWrapper.d.ts +1 -1
- package/dist/esm/init/StoryAppWrapper/interfaces.d.ts +1 -1
- package/dist/esm/insurances/car/pages/{three-point-five/BestOfferFirst.d.ts → quote/PageAllQuotes.d.ts} +1 -1
- package/dist/esm/insurances/car/pages/quote/sections/blocks/BlockConfirmImages.d.ts +1 -0
- package/dist/esm/insurances/car/pages/quote/sections/blocks/BlockQuoteStatistics.d.ts +2 -0
- package/dist/esm/shared/navigations/interfaces.d.ts +0 -1
- package/dist/esm/shared/sections/quotes/OfferSection/BestOfferSection.d.ts +3 -0
- package/dist/esm/shared/sections/quotes/OfferSection/DummyOfferSection.d.ts +3 -0
- package/dist/index.d.ts +0 -1
- package/package.json +2 -2
- package/dist/cjs/insurances/car/pages/three-point-five/index.d.ts +0 -1
- package/dist/cjs/insurances/car/pages/three-point-five/sections/OfferSectionCopy.d.ts +0 -3
- package/dist/cjs/insurances/car/pages/three-point-five/sections/OfferSectionDupe.d.ts +0 -3
- package/dist/cjs/insurances/car/pages/three-point-five/sections/index.d.ts +0 -1
- package/dist/esm/insurances/car/pages/three-point-five/index.d.ts +0 -1
- package/dist/esm/insurances/car/pages/three-point-five/sections/OfferSectionCopy.d.ts +0 -3
- package/dist/esm/insurances/car/pages/three-point-five/sections/OfferSectionDupe.d.ts +0 -3
- package/dist/esm/insurances/car/pages/three-point-five/sections/index.d.ts +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { SdkFC } from '@groksmith/mychoice-sdk-components';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const PageAllQuotes: SdkFC;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const BlockConfirmImages: () => import("react/jsx-runtime").JSX.Element;
|
package/dist/esm/index.js
CHANGED
|
@@ -3236,9 +3236,7 @@ const ModalQuoteRequest = ({ title, description, phoneNumber, }) => (jsxs("div",
|
|
|
3236
3236
|
&& jsx("p", { children: description }), jsxs("div", { className: "modal-buttons", children: [jsx(ButtonBase, { type: ButtonTypes.Button, label: "OK", category: CategoryTypes.Filled, color: ColorTypes.Primary, variant: ButtonVariantTypes.Rectangle, size: SizeTypes.Large }), phoneNumber
|
|
3237
3237
|
&& (jsx("a", { target: "_blank", rel: "noreferrer noopener", href: `tel:1${phoneNumber}`, className: "phoneNumber", children: "Call the Broker" }))] })] }));
|
|
3238
3238
|
|
|
3239
|
-
const PostalCodeDataBox = ({ title, postalCode, className,
|
|
3240
|
-
return (jsx(Fragment, { children: jsxs("div", { id: id, className: `${className} postal-code-data-box`, children: [jsx("h2", { children: title }), postalCode && (jsxs("p", { children: ["Your postal code:", ' ', postalCode] }))] }) }));
|
|
3241
|
-
};
|
|
3239
|
+
const PostalCodeDataBox = ({ title, postalCode, className }) => (jsxs("div", { className: `${className} postal-code-data-box`, children: [jsx("h2", { children: title }), postalCode && (jsxs("p", { children: ["Your postal code:", ' ', postalCode] }))] }));
|
|
3242
3240
|
PostalCodeDataBox.defaultProps = {
|
|
3243
3241
|
title: '',
|
|
3244
3242
|
postalCode: '',
|
|
@@ -3252,16 +3250,6 @@ const StepsBox = ({ formSteps, validationHooks, propertyIsCompleted, }) => {
|
|
|
3252
3250
|
// const { dispatchAppModalState } = useStoreAppModal();
|
|
3253
3251
|
// const [steps, setSteps] = useState(formSteps);
|
|
3254
3252
|
// const [validations, setValidations] = useState(validationHooks);
|
|
3255
|
-
const [showContent, setShowContent] = useState(false);
|
|
3256
|
-
useEffect(() => {
|
|
3257
|
-
const checkTime = () => {
|
|
3258
|
-
const currentHour = new Date().getUTCHours() - 5; // EST is UTC-5
|
|
3259
|
-
setShowContent(currentHour >= 9 && currentHour < 18);
|
|
3260
|
-
};
|
|
3261
|
-
checkTime(); // Initial check
|
|
3262
|
-
const interval = setInterval(checkTime, 60000); // Check every minute
|
|
3263
|
-
return () => clearInterval(interval); // Cleanup
|
|
3264
|
-
}, []); // Run effect only once on component mount
|
|
3265
3253
|
const { pathname } = useLocation();
|
|
3266
3254
|
const currentPath = pathname.split('/');
|
|
3267
3255
|
const activeStep = formSteps.find((step) => currentPath[currentPath.length - 1] === step.path?.substring(1));
|
|
@@ -3325,22 +3313,6 @@ const StepsBox = ({ formSteps, validationHooks, propertyIsCompleted, }) => {
|
|
|
3325
3313
|
}
|
|
3326
3314
|
}
|
|
3327
3315
|
};
|
|
3328
|
-
const [showQR, setShowQr] = useState(false);
|
|
3329
|
-
const containerRef = useRef(null);
|
|
3330
|
-
useEffect(() => {
|
|
3331
|
-
const handleClickOutside = (event) => {
|
|
3332
|
-
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
3333
|
-
setShowQr(false);
|
|
3334
|
-
}
|
|
3335
|
-
};
|
|
3336
|
-
document.addEventListener('mousedown', handleClickOutside);
|
|
3337
|
-
return () => {
|
|
3338
|
-
document.removeEventListener('mousedown', handleClickOutside);
|
|
3339
|
-
};
|
|
3340
|
-
}, []);
|
|
3341
|
-
const handleHelpButton = () => {
|
|
3342
|
-
setShowQr(!showQR);
|
|
3343
|
-
};
|
|
3344
3316
|
return (jsxs("ol", { className: appType === AppTypes.MyChoice ? 'mychoice-navigation-steps-container' : 'navigation-steps-container', children: [!isMobile ? (jsx(Fragment, { children: formSteps?.map((item, index) => {
|
|
3345
3317
|
let cls;
|
|
3346
3318
|
switch (true) {
|
|
@@ -3357,11 +3329,9 @@ const StepsBox = ({ formSteps, validationHooks, propertyIsCompleted, }) => {
|
|
|
3357
3329
|
return jsx(Fragment, {});
|
|
3358
3330
|
}
|
|
3359
3331
|
return (jsx("div", { role: "presentation", className: appType === AppTypes.MyChoice ? navigationCls : 'navigation-step-container', onKeyDown: handleStepClick(item, index), onClick: handleStepClick(item, index), children: appType === AppTypes.MyChoice
|
|
3360
|
-
?
|
|
3332
|
+
? jsx(MychoiceStep, { className: cls, item: item, index: index }, `${index}-${item?.title}`)
|
|
3361
3333
|
: jsx(Step, { className: cls, item: item, index: index }, `${index}-${item?.title}`) }, `${index}-${item?.title}`));
|
|
3362
|
-
}) })) : jsx(Step, { item: formSteps[activeIndex], index: activeIndex, itemsCount: formSteps.length, isMobile: true }), appType === AppTypes.MyChoice && (jsxs(Fragment, { children: [jsx("hr", {}), jsxs("div", { className: "estimated-minutes", children: [jsx(IconClock, {}), jsxs("div", { children: ["Estimated", ' ', jsxs("span", { className: "time", children: [formSteps.length - activeIndex - 1, ' ', formSteps.length - activeIndex - 1 > 1 ? 'minutes' : 'minute'] }), ' ', "to complete"] })] })
|
|
3363
|
-
e.currentTarget.style.opacity = '1';
|
|
3364
|
-
}, src: "https://www.mychoice.ca/wp-content/themes/mychoice-theme/img/svg/qr-phone-with-text.svg", alt: "QR code scan to call" }))] })] }))] }))] }));
|
|
3334
|
+
}) })) : jsx(Step, { item: formSteps[activeIndex], index: activeIndex, itemsCount: formSteps.length, isMobile: true }), appType === AppTypes.MyChoice && (jsxs(Fragment, { children: [jsx("hr", {}), jsxs("div", { className: "estimated-minutes", children: [jsx(IconClock, {}), jsxs("div", { children: ["Estimated", ' ', jsxs("span", { className: "time", children: [formSteps.length - activeIndex - 1, ' ', formSteps.length - activeIndex - 1 > 1 ? 'minutes' : 'minute'] }), ' ', "to complete"] })] })] }))] }));
|
|
3365
3335
|
};
|
|
3366
3336
|
StepsBox.defaultProps = {
|
|
3367
3337
|
partnerId: '',
|
|
@@ -3446,7 +3416,7 @@ ButtonsBox.defaultProps = {
|
|
|
3446
3416
|
activeIndex: 0,
|
|
3447
3417
|
};
|
|
3448
3418
|
|
|
3449
|
-
const NavigationTop = ({ title, postalCode, validationHooks, formSteps, clearForm, propertyIsCompleted,
|
|
3419
|
+
const NavigationTop = ({ title, postalCode, validationHooks, formSteps, clearForm, propertyIsCompleted, }) => {
|
|
3450
3420
|
const { pathname } = useLocation();
|
|
3451
3421
|
const { appConfigState: { appType, localIndex } } = useStoreAppConfig();
|
|
3452
3422
|
const isTheBig = appType === AppTypes.TheBig;
|
|
@@ -3474,8 +3444,8 @@ const NavigationTop = ({ title, postalCode, validationHooks, formSteps, clearFor
|
|
|
3474
3444
|
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
3475
3445
|
}
|
|
3476
3446
|
}
|
|
3477
|
-
return (jsx("div", {
|
|
3478
|
-
? (jsx(Fragment, { children: !isDesktop && (formSteps.length - activeIndex - 1) ? (jsxs("div", { className: "estimated-minutes", children: [jsx(IconClock, {}), jsxs("div", { children: [isMobile ? (jsx(
|
|
3447
|
+
return (jsx("div", { className: localIndex !== defaultLocalIndex ? 'navigation-container-partner' : 'navigation-container', children: jsxs("div", { className: `content ${appType === AppTypes.MyChoice ? 'mychoice' : ''}`, children: [jsx(PostalCodeDataBox, { className: isTheBig ? 'thebig' : '', title: title, postalCode: postalCode }), appType === AppTypes.MyChoice
|
|
3448
|
+
? (jsx(Fragment, { children: !isDesktop && (formSteps.length - activeIndex - 1) ? (jsxs("div", { className: "estimated-minutes", children: [jsx(IconClock, {}), jsxs("div", { children: [isMobile ? (jsx("div", { children: jsxs("span", { className: "time", children: [formSteps.length - activeIndex - 1, ' ', formSteps.length - activeIndex - 1 > 1 ? 'minutes' : 'minute'] }) })) : (jsx(Fragment, { children: jsxs("div", { children: ["Estimated", ' ', jsxs("span", { className: "time", children: [formSteps.length - activeIndex - 1, ' ', formSteps.length - activeIndex - 1 > 1 ? 'minutes' : 'minute'] }), ' ', "to complete"] }) })), jsx("span", { children: `Step ${activeIndex + 1}/${formSteps.length - 1}` })] })] })) : jsx("span", {}) })) : (jsx(StepsBox, { formSteps: formSteps, validationHooks: validationHooks, propertyIsCompleted: propertyIsCompleted })), jsx(ButtonsBox, { formSteps: formSteps, validationHooks: validationHooks, clearForm: clearForm, propertyIsCompleted: propertyIsCompleted })] }) }));
|
|
3479
3449
|
};
|
|
3480
3450
|
NavigationTop.defaultProps = {
|
|
3481
3451
|
isMobile: false,
|
|
@@ -3978,16 +3948,6 @@ const AppRouteWrapper = (props) => {
|
|
|
3978
3948
|
const [steps, setSteps] = useState(formSteps[insuranceType]);
|
|
3979
3949
|
const [validationHooks, setValidationHooks] = useState(formValidationHooks[insuranceType]);
|
|
3980
3950
|
const [progressLength, setProgressLength] = useState('');
|
|
3981
|
-
const [showContent, setShowContent] = useState(false);
|
|
3982
|
-
useEffect(() => {
|
|
3983
|
-
const checkTime = () => {
|
|
3984
|
-
const currentHour = new Date().getUTCHours() - 5; // EST is UTC-5
|
|
3985
|
-
setShowContent(currentHour >= 9 && currentHour < 18);
|
|
3986
|
-
};
|
|
3987
|
-
checkTime(); // Initial check
|
|
3988
|
-
const interval = setInterval(checkTime, 60000); // Check every minute
|
|
3989
|
-
return () => clearInterval(interval); // Cleanup
|
|
3990
|
-
}, []); // Run effect only once on component mount
|
|
3991
3951
|
useEffect(() => {
|
|
3992
3952
|
let filteredSteps = formSteps[insuranceType];
|
|
3993
3953
|
let filteredHooks = formValidationHooks[insuranceType];
|
|
@@ -4058,23 +4018,7 @@ const AppRouteWrapper = (props) => {
|
|
|
4058
4018
|
}
|
|
4059
4019
|
}
|
|
4060
4020
|
}, [carPostal, homePostal, lifePostal, isReady]);
|
|
4061
|
-
|
|
4062
|
-
const [showStickyBanner, setShowStickyBanner] = useState(false);
|
|
4063
|
-
useEffect(() => {
|
|
4064
|
-
const handleScroll = () => {
|
|
4065
|
-
const postalCodeDataBox = document.getElementById('postalCodeData');
|
|
4066
|
-
if (postalCodeDataBox) {
|
|
4067
|
-
const postalCodeDataBoxRect = postalCodeDataBox.getBoundingClientRect();
|
|
4068
|
-
const isScrolledPast = postalCodeDataBoxRect.bottom <= 0; // Change to <= if you want the banner to appear when the bottom of the box touches the top of the viewport
|
|
4069
|
-
setShowStickyBanner(isScrolledPast);
|
|
4070
|
-
}
|
|
4071
|
-
};
|
|
4072
|
-
window.addEventListener('scroll', handleScroll);
|
|
4073
|
-
return () => {
|
|
4074
|
-
window.removeEventListener('scroll', handleScroll);
|
|
4075
|
-
};
|
|
4076
|
-
}, []);
|
|
4077
|
-
return (jsx(Fragment, { children: isReady && (jsxs(Fragment, { children: [jsx(AppHeader, {}), jsx(AppModal, {}), insuranceType && (jsx(Fragment, { children: jsx(NavigationTop, { title: `${insuranceType.replace(/^./, insuranceType[0].toUpperCase())} Insurance Quote`, postalCode: postalCode, formSteps: steps, validationHooks: validationHooks, clearForm: clearFormData, propertyIsCompleted: isCompleted, id: "postalCodeData" }) })), showStickyBanner && showContent && isMobile && appType === AppTypes.MyChoice && (jsxs("div", { id: "stickyBanner", style: { position: "sticky", top: 0, color: "#FFFFFF", backgroundColor: "#8ED6DC", width: "100%", height: "75px", zIndex: 5000, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center" }, children: [jsx("p", { style: { fontWeight: 700, fontSize: "22px" }, children: "Need Help? Give us a call at" }), jsx("a", { style: { marginTop: "5px" }, href: "tel:18884534644", children: "1-888-453-4644" })] })), insuranceType && appType === AppTypes.MyChoice && (jsx("div", { className: localIndex !== defaultLocalIndex ? 'step-progress-bar-partner' : 'step-progress-bar', children: jsx("span", { style: { width: progressLength } }) })), jsx("div", { className: `${insuranceType ? 'form-page-content' : ''} ${insuranceType && appType === AppTypes.MyChoice ? 'mychoice' : ''}`, children: insuranceType && appType === AppTypes.MyChoice && isDesktop && progressLength ? (jsx(Fragment, { children: jsxs("div", { className: "mychoice-content", children: [jsx(StepsBox, { className: "step-box", formSteps: steps, validationHooks: validationHooks, propertyIsCompleted: isCompleted }), children, jsx("div", { className: "empty-steps-container" })] }) })) : children }), isMychoice && !appLoaderState.isOpen && jsx(ProviderImageFooter, {})] })) }));
|
|
4021
|
+
return (jsx(Fragment, { children: isReady && (jsxs(Fragment, { children: [jsx(AppHeader, {}), jsx(AppModal, {}), insuranceType && (jsx(NavigationTop, { title: `${insuranceType.replace(/^./, insuranceType[0].toUpperCase())} Insurance Quote`, postalCode: postalCode, formSteps: steps, validationHooks: validationHooks, clearForm: clearFormData, propertyIsCompleted: isCompleted })), insuranceType && appType === AppTypes.MyChoice && (jsx("div", { className: localIndex !== defaultLocalIndex ? 'step-progress-bar-partner' : 'step-progress-bar', children: jsx("span", { style: { width: progressLength } }) })), jsx("div", { className: `${insuranceType ? 'form-page-content' : ''} ${insuranceType && appType === AppTypes.MyChoice ? 'mychoice' : ''}`, children: insuranceType && appType === AppTypes.MyChoice && isDesktop && progressLength ? (jsx(Fragment, { children: jsxs("div", { className: "mychoice-content", children: [jsx(StepsBox, { className: "step-box", formSteps: steps, validationHooks: validationHooks, propertyIsCompleted: isCompleted }), children, jsx("div", { className: "empty-steps-container" })] }) })) : children }), isMychoice && !appLoaderState.isOpen && jsx(ProviderImageFooter, {})] })) }));
|
|
4078
4022
|
};
|
|
4079
4023
|
const NestedRoutes = () => {
|
|
4080
4024
|
const insuranceType = getInsuranceType();
|