@mychoice/mychoice-sdk-modules 2.1.34 → 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.
Files changed (30) hide show
  1. package/dist/cjs/index.js +7 -73
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/init/StoryAppWrapper/StoryAppWrapper.d.ts +1 -1
  4. package/dist/cjs/init/StoryAppWrapper/interfaces.d.ts +1 -1
  5. package/dist/cjs/insurances/car/pages/{three-point-five/BestOfferFirst.d.ts → quote/PageAllQuotes.d.ts} +1 -1
  6. package/dist/cjs/insurances/car/pages/quote/sections/blocks/BlockConfirmImages.d.ts +1 -0
  7. package/dist/cjs/insurances/car/pages/quote/sections/blocks/BlockQuoteStatistics.d.ts +2 -0
  8. package/dist/cjs/shared/navigations/interfaces.d.ts +0 -1
  9. package/dist/cjs/shared/sections/quotes/OfferSection/BestOfferSection.d.ts +3 -0
  10. package/dist/cjs/shared/sections/quotes/OfferSection/DummyOfferSection.d.ts +3 -0
  11. package/dist/esm/index.js +7 -73
  12. package/dist/esm/index.js.map +1 -1
  13. package/dist/esm/init/StoryAppWrapper/StoryAppWrapper.d.ts +1 -1
  14. package/dist/esm/init/StoryAppWrapper/interfaces.d.ts +1 -1
  15. package/dist/esm/insurances/car/pages/{three-point-five/BestOfferFirst.d.ts → quote/PageAllQuotes.d.ts} +1 -1
  16. package/dist/esm/insurances/car/pages/quote/sections/blocks/BlockConfirmImages.d.ts +1 -0
  17. package/dist/esm/insurances/car/pages/quote/sections/blocks/BlockQuoteStatistics.d.ts +2 -0
  18. package/dist/esm/shared/navigations/interfaces.d.ts +0 -1
  19. package/dist/esm/shared/sections/quotes/OfferSection/BestOfferSection.d.ts +3 -0
  20. package/dist/esm/shared/sections/quotes/OfferSection/DummyOfferSection.d.ts +3 -0
  21. package/dist/index.d.ts +0 -1
  22. package/package.json +2 -2
  23. package/dist/cjs/insurances/car/pages/three-point-five/index.d.ts +0 -1
  24. package/dist/cjs/insurances/car/pages/three-point-five/sections/OfferSectionCopy.d.ts +0 -3
  25. package/dist/cjs/insurances/car/pages/three-point-five/sections/OfferSectionDupe.d.ts +0 -3
  26. package/dist/cjs/insurances/car/pages/three-point-five/sections/index.d.ts +0 -1
  27. package/dist/esm/insurances/car/pages/three-point-five/index.d.ts +0 -1
  28. package/dist/esm/insurances/car/pages/three-point-five/sections/OfferSectionCopy.d.ts +0 -3
  29. package/dist/esm/insurances/car/pages/three-point-five/sections/OfferSectionDupe.d.ts +0 -3
  30. package/dist/esm/insurances/car/pages/three-point-five/sections/index.d.ts +0 -1
@@ -1,3 +1,3 @@
1
- import { SdkFC } from '@groksmith/mychoice-sdk-components';
1
+ import { SdkFC } from '@mychoice/mychoice-sdk-components';
2
2
  import { StoryAppWrapperInterface } from './interfaces';
3
3
  export declare const StoryAppWrapper: SdkFC<StoryAppWrapperInterface>;
@@ -1,4 +1,4 @@
1
- import { AppTypes } from '@groksmith/mychoice-sdk-components';
1
+ import { AppTypes } from '@mychoice/mychoice-sdk-components';
2
2
  export interface StoryAppWrapperInterface {
3
3
  appType?: AppTypes;
4
4
  }
@@ -1,2 +1,2 @@
1
1
  import { SdkFC } from '@groksmith/mychoice-sdk-components';
2
- export declare const BestOfferFirst: SdkFC;
2
+ export declare const PageAllQuotes: SdkFC;
@@ -0,0 +1 @@
1
+ export declare const BlockConfirmImages: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { SdkFC } from '@groksmith/mychoice-sdk-components';
2
+ export declare const BlockQuoteStatistics: SdkFC;
@@ -13,7 +13,6 @@ export type PostalCodeDataProps = {
13
13
  className?: string;
14
14
  title?: string;
15
15
  postalCode?: string;
16
- id?: string;
17
16
  };
18
17
  export type ButtonBoxProps = {
19
18
  isMobile?: boolean;
@@ -0,0 +1,3 @@
1
+ import { SdkFC } from '@groksmith/mychoice-sdk-components';
2
+ import { OfferSectionProps } from '../interfaces';
3
+ export declare const BestOfferSection: SdkFC<OfferSectionProps>;
@@ -0,0 +1,3 @@
1
+ import { SdkFC } from '@groksmith/mychoice-sdk-components';
2
+ import { OfferSectionProps } from '../interfaces';
3
+ export declare const DummyOfferSection: SdkFC<OfferSectionProps>;
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, id }) => {
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,21 +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 currentUTCDate = new Date();
3259
- const currentHour = currentUTCDate.getUTCHours() - 5; // EST is UTC-5
3260
- const currentDay = currentUTCDate.getUTCDay(); // Sunday is 0, Monday is 1, ..., Saturday is 6
3261
- // Check if it's a weekday (Monday to Friday) and if the current hour is between 9 am and 6 pm
3262
- const isWeekday = currentDay >= 1 && currentDay <= 5;
3263
- const isWorkingHours = currentHour >= 9 && currentHour < 18;
3264
- setShowContent(isWeekday && isWorkingHours);
3265
- };
3266
- checkTime(); // Initial check
3267
- const interval = setInterval(checkTime, 60000); // Check every minute
3268
- return () => clearInterval(interval); // Cleanup
3269
- }, []); // Run effect only once on component mount
3270
3253
  const { pathname } = useLocation();
3271
3254
  const currentPath = pathname.split('/');
3272
3255
  const activeStep = formSteps.find((step) => currentPath[currentPath.length - 1] === step.path?.substring(1));
@@ -3330,22 +3313,6 @@ const StepsBox = ({ formSteps, validationHooks, propertyIsCompleted, }) => {
3330
3313
  }
3331
3314
  }
3332
3315
  };
3333
- const [showQR, setShowQr] = useState(false);
3334
- const containerRef = useRef(null);
3335
- useEffect(() => {
3336
- const handleClickOutside = (event) => {
3337
- if (containerRef.current && !containerRef.current.contains(event.target)) {
3338
- setShowQr(false);
3339
- }
3340
- };
3341
- document.addEventListener('mousedown', handleClickOutside);
3342
- return () => {
3343
- document.removeEventListener('mousedown', handleClickOutside);
3344
- };
3345
- }, []);
3346
- const handleHelpButton = () => {
3347
- setShowQr(!showQR);
3348
- };
3349
3316
  return (jsxs("ol", { className: appType === AppTypes.MyChoice ? 'mychoice-navigation-steps-container' : 'navigation-steps-container', children: [!isMobile ? (jsx(Fragment, { children: formSteps?.map((item, index) => {
3350
3317
  let cls;
3351
3318
  switch (true) {
@@ -3362,11 +3329,9 @@ const StepsBox = ({ formSteps, validationHooks, propertyIsCompleted, }) => {
3362
3329
  return jsx(Fragment, {});
3363
3330
  }
3364
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
3365
- ? jsxs(Fragment, { children: [jsx(MychoiceStep, { className: cls, item: item, index: index }, `${index}-${item?.title}`), jsx(ButtonBase, {})] })
3332
+ ? jsx(MychoiceStep, { className: cls, item: item, index: index }, `${index}-${item?.title}`)
3366
3333
  : jsx(Step, { className: cls, item: item, index: index }, `${index}-${item?.title}`) }, `${index}-${item?.title}`));
3367
- }) })) : 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"] })] }), showContent && appType === AppTypes.MyChoice && (jsxs("div", { style: { gap: "1em", display: "flex", flexDirection: "column", marginTop: "1em", alignItems: "center", justifyContent: "center", marginLeft: "2em" }, children: [jsx("p", { style: { fontWeight: "600" }, children: "Need help? Call us at" }), jsxs("div", { ref: containerRef, style: { position: "relative", width: '180px' }, children: [jsx(ButtonBase, { size: SizeTypes.Medium, className: "button-with-text button-circle-medium", category: CategoryTypes.Filled, color: ColorTypes.Secondary, variant: ButtonVariantTypes.Circle, onClick: handleHelpButton, children: jsx("span", { style: { padding: "0 1rem", fontWeight: "700" }, children: "1-888-453-4644" }) }), showQR && (jsx("img", { style: { position: 'absolute', top: '355%', left: '50%', transform: 'translate(-50%, -50%)', opacity: 0, transition: 'opacity 500ms ease-in-out' }, onLoad: (e) => {
3368
- e.currentTarget.style.opacity = '1';
3369
- }, 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"] })] })] }))] }));
3370
3335
  };
3371
3336
  StepsBox.defaultProps = {
3372
3337
  partnerId: '',
@@ -3451,7 +3416,7 @@ ButtonsBox.defaultProps = {
3451
3416
  activeIndex: 0,
3452
3417
  };
3453
3418
 
3454
- const NavigationTop = ({ title, postalCode, validationHooks, formSteps, clearForm, propertyIsCompleted, id, }) => {
3419
+ const NavigationTop = ({ title, postalCode, validationHooks, formSteps, clearForm, propertyIsCompleted, }) => {
3455
3420
  const { pathname } = useLocation();
3456
3421
  const { appConfigState: { appType, localIndex } } = useStoreAppConfig();
3457
3422
  const isTheBig = appType === AppTypes.TheBig;
@@ -3479,8 +3444,8 @@ const NavigationTop = ({ title, postalCode, validationHooks, formSteps, clearFor
3479
3444
  return `rgba(${r}, ${g}, ${b}, ${alpha})`;
3480
3445
  }
3481
3446
  }
3482
- return (jsx("div", { id: id, 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
3483
- ? (jsx(Fragment, { children: !isDesktop && (formSteps.length - activeIndex - 1) ? (jsxs("div", { className: "estimated-minutes", children: [jsx(IconClock, {}), jsxs("div", { children: [isMobile ? (jsx(Fragment, { children: 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 })] }) }));
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 })] }) }));
3484
3449
  };
3485
3450
  NavigationTop.defaultProps = {
3486
3451
  isMobile: false,
@@ -3983,21 +3948,6 @@ const AppRouteWrapper = (props) => {
3983
3948
  const [steps, setSteps] = useState(formSteps[insuranceType]);
3984
3949
  const [validationHooks, setValidationHooks] = useState(formValidationHooks[insuranceType]);
3985
3950
  const [progressLength, setProgressLength] = useState('');
3986
- const [showContent, setShowContent] = useState(false);
3987
- useEffect(() => {
3988
- const checkTime = () => {
3989
- const currentUTCDate = new Date();
3990
- const currentHour = currentUTCDate.getUTCHours() - 5; // EST is UTC-5
3991
- const currentDay = currentUTCDate.getUTCDay(); // Sunday is 0, Monday is 1, ..., Saturday is 6
3992
- // Check if it's a weekday (Monday to Friday) and if the current hour is between 9 am and 6 pm
3993
- const isWeekday = currentDay >= 1 && currentDay <= 5;
3994
- const isWorkingHours = currentHour >= 9 && currentHour < 18;
3995
- setShowContent(isWeekday && isWorkingHours);
3996
- };
3997
- checkTime(); // Initial check
3998
- const interval = setInterval(checkTime, 60000); // Check every minute
3999
- return () => clearInterval(interval); // Cleanup
4000
- }, []); // Run effect only once on component mount
4001
3951
  useEffect(() => {
4002
3952
  let filteredSteps = formSteps[insuranceType];
4003
3953
  let filteredHooks = formValidationHooks[insuranceType];
@@ -4068,23 +4018,7 @@ const AppRouteWrapper = (props) => {
4068
4018
  }
4069
4019
  }
4070
4020
  }, [carPostal, homePostal, lifePostal, isReady]);
4071
- const isMobile = appDeviceType === DeviceTypes.Mobile;
4072
- const [showStickyBanner, setShowStickyBanner] = useState(false);
4073
- useEffect(() => {
4074
- const handleScroll = () => {
4075
- const postalCodeDataBox = document.getElementById('postalCodeData');
4076
- if (postalCodeDataBox) {
4077
- const postalCodeDataBoxRect = postalCodeDataBox.getBoundingClientRect();
4078
- 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
4079
- setShowStickyBanner(isScrolledPast);
4080
- }
4081
- };
4082
- window.addEventListener('scroll', handleScroll);
4083
- return () => {
4084
- window.removeEventListener('scroll', handleScroll);
4085
- };
4086
- }, []);
4087
- 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("a", { style: { fontWeight: 700, fontSize: "22px" }, href: "tel:18884534644", children: "Need Help? Give us a call at" }), jsx("a", { style: { marginTop: "5px", textDecoration: "underline", fontWeight: 850 }, 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, {})] })) }));
4088
4022
  };
4089
4023
  const NestedRoutes = () => {
4090
4024
  const insuranceType = getInsuranceType();