@mychoice/mychoice-sdk-modules 2.1.9 → 2.1.14
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 +20 -10
- 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/{quote/PageAllQuotes.d.ts → three-point-five/BestOfferFirst.d.ts} +1 -1
- package/dist/cjs/insurances/car/pages/three-point-five/index.d.ts +1 -0
- package/dist/cjs/insurances/car/pages/three-point-five/sections/OfferSectionCopy.d.ts +3 -0
- package/dist/cjs/insurances/car/pages/three-point-five/sections/OfferSectionDupe.d.ts +3 -0
- package/dist/cjs/insurances/car/pages/three-point-five/sections/index.d.ts +1 -0
- package/dist/esm/index.js +20 -10
- 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/{quote/PageAllQuotes.d.ts → three-point-five/BestOfferFirst.d.ts} +1 -1
- package/dist/esm/insurances/car/pages/three-point-five/index.d.ts +1 -0
- package/dist/esm/insurances/car/pages/three-point-five/sections/OfferSectionCopy.d.ts +3 -0
- package/dist/esm/insurances/car/pages/three-point-five/sections/OfferSectionDupe.d.ts +3 -0
- package/dist/esm/insurances/car/pages/three-point-five/sections/index.d.ts +1 -0
- package/package.json +4 -4
- package/dist/cjs/insurances/car/pages/quote/sections/blocks/BlockConfirmImages.d.ts +0 -1
- package/dist/cjs/insurances/car/pages/quote/sections/blocks/BlockQuoteStatistics.d.ts +0 -2
- package/dist/cjs/shared/sections/quotes/OfferSection/BestOfferSection.d.ts +0 -3
- package/dist/cjs/shared/sections/quotes/OfferSection/DummyOfferSection.d.ts +0 -3
- package/dist/esm/insurances/car/pages/quote/sections/blocks/BlockConfirmImages.d.ts +0 -1
- package/dist/esm/insurances/car/pages/quote/sections/blocks/BlockQuoteStatistics.d.ts +0 -2
- package/dist/esm/shared/sections/quotes/OfferSection/BestOfferSection.d.ts +0 -3
- package/dist/esm/shared/sections/quotes/OfferSection/DummyOfferSection.d.ts +0 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { SdkFC } from '@groksmith/mychoice-sdk-components';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const BestOfferFirst: SdkFC;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BestOfferFirst } from './BestOfferFirst';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { OfferSectionDupe } from './OfferSectionDupe';
|
package/dist/esm/index.js
CHANGED
|
@@ -178,9 +178,9 @@ const usePathGroups = (insuranceType) => {
|
|
|
178
178
|
// [`${InsuranceTypes.Life}`]: [{ name: 'Life', link: `/${appConfigState.localIndex}/life` }],
|
|
179
179
|
};
|
|
180
180
|
const externalPathGroup = [
|
|
181
|
-
{ name: 'Car', link: 'https://
|
|
182
|
-
{ name: 'Home', link: 'https://
|
|
183
|
-
{ name: 'Life', link: 'https://
|
|
181
|
+
{ name: 'Car', link: 'https://quote.mychoice.ca/insurance/car' },
|
|
182
|
+
{ name: 'Home', link: 'https://quote.mychoice.ca/insurance/home' },
|
|
183
|
+
{ name: 'Life', link: 'https://quote.mychoice.ca/insurance/life' },
|
|
184
184
|
{ name: 'Learn', link: 'https://www.mychoice.ca/blog/' },
|
|
185
185
|
];
|
|
186
186
|
// @todo: use in future.
|
|
@@ -298,10 +298,12 @@ const ModalPostal = () => {
|
|
|
298
298
|
const getVehicleYearRange = () => {
|
|
299
299
|
const currentDate = new Date();
|
|
300
300
|
const vehicleYear = [];
|
|
301
|
-
|
|
301
|
+
const currentYear = currentDate.getFullYear();
|
|
302
|
+
const minYear = currentYear - 25;
|
|
303
|
+
for (let year = (currentDate.getFullYear()); year > minYear; year -= 1) {
|
|
302
304
|
vehicleYear.push({ name: `${year}`, value: `${year}` });
|
|
303
305
|
}
|
|
304
|
-
vehicleYear.push({ name:
|
|
306
|
+
vehicleYear.push({ name: `${minYear} or older`, value: `${minYear}` });
|
|
305
307
|
return vehicleYear;
|
|
306
308
|
};
|
|
307
309
|
const getRecommendedRange = (distanceDaily, distanceBusiness) => {
|
|
@@ -404,7 +406,7 @@ const BlockCarInfo = () => {
|
|
|
404
406
|
const { vehicleState, dispatchVehicleState } = useStoreFormCarVehicle();
|
|
405
407
|
const { year: currentYear, make: currentMake, model: currentModel, } = vehicleState.items[vehicleState.activeIndex];
|
|
406
408
|
const yearIsValid = !currentYear || Number(currentYear) > 1998;
|
|
407
|
-
const yearMessage = (jsxs(Fragment, { children: ["Please contact a licenced representative at
|
|
409
|
+
const yearMessage = (jsxs(Fragment, { children: ["Please contact a licenced representative at Hagerty for classic car insurance:", ' ', jsx("a", { href: "tel:18335431540", children: "1-833-543-1540" })] }));
|
|
408
410
|
const handleVehicleYearChange = ({ value }) => {
|
|
409
411
|
if (value) {
|
|
410
412
|
dispatchVehicleState({
|
|
@@ -549,7 +551,12 @@ const BlockCarConditionInfo = () => {
|
|
|
549
551
|
const VehicleSectionMain = () => {
|
|
550
552
|
const { appConfigState: { appType } } = useStoreAppConfig();
|
|
551
553
|
const mychoiceCls = appType === AppTypes.MyChoice ? 'mychoice' : '';
|
|
552
|
-
|
|
554
|
+
const carEmoji = '\u{1F697}';
|
|
555
|
+
return (jsxs("div", { className: `form-section top-section ${mychoiceCls}`, children: [mychoiceCls && (jsx("h2", { style: {
|
|
556
|
+
whiteSpace: 'normal',
|
|
557
|
+
marginTop: '20px',
|
|
558
|
+
textAlign: 'center',
|
|
559
|
+
}, children: `${carEmoji} Give us the scoop on your four-wheeled friend.` })), jsx(BlockCarInfo, {}), jsx(BlockCarConditionInfo, {})] }));
|
|
553
560
|
};
|
|
554
561
|
|
|
555
562
|
const VehicleSectionCoverage = () => {
|
|
@@ -778,7 +785,8 @@ const SectionDriverInfo = () => {
|
|
|
778
785
|
payload: { applicantRelationship: value },
|
|
779
786
|
});
|
|
780
787
|
};
|
|
781
|
-
|
|
788
|
+
const inspectEmoji = '\u{1F50D}';
|
|
789
|
+
return (jsxs("div", { className: `form-section ${mychoiceCls}`, children: [mychoiceCls && jsx("h2", { className: "section-title", children: `${inspectEmoji} Time for a micro autobiography – tell us about you.` }), jsx(InputFormBox, { name: "firstName", title: "What is your legal first name?", onChange: handleFirstNameChange, defaultValue: firstName, description: "The name on a policy should match the one on your official driver\u2019s licence.", placeholder: "Driver First Name", error: !firstName && driverState.inValidation, errorMessage: getErrorMessage(firstName, driverState.inValidation) }), jsx(SelectFormBox, { options: maritalStatusOptions, name: "maritalStatus", onChange: handleMaritalStatusChange, defaultValue: getSelectedOption(maritalStatusOptions, maritalStatus), title: "What is your marital status?", placeholder: "Select from the list", description: "If you are married, it may have a positive effect on your car insurance premiums and coverage. In some provinces, the law now considers same-sex partners to have a common-law marriage, so you will need to check your local regulations. If you are divorced or widowed, select single.", autoSelectIfValueIsOutOfOptions: false, error: !maritalStatus && driverState.inValidation, errorMessage: getErrorMessage(maritalStatus, driverState.inValidation) }), jsx(DateSelectFormBox, { name: "dateOfBirth", dateNames: ['birthYear', 'birthMonth', 'birthDay'], onDateChange: handleDateOfBirthChange, defaultValue: defaultDateOfBirth, title: "When were you born?", description: "Insurers generally consider your age and driving experience when calculating a vehicle insurance quote. The safest drivers are often those who are over thirty, but each insurer will have their own parameters. The youngest and oldest drivers have the greatest liability reflected in their premiums due to inexperience or health complications, respectively.", errorMessage: getDateErrorMessage([birthDay || '', birthMonth || '', birthYear || ''], driverState.inValidation), error: driverState.inValidation, maxDate: subYearsFromDate('', configState.licenceConfig.minLicenceAge || 16), isDay: true }), jsx(SwitchButtonBox, { name: "occupation", items: occupationOptions, onChange: handleOccupationChange, defaultValue: getSelectedOption(occupationOptions, occupation), title: "Are you currently employed or unemployed?", description: "Your employment status reflects your driving frequency, and insurers consider this in your policy." }), jsx(SwitchButtonBox, { items: genderOptions, onChange: handleGenderChange, name: "gender", defaultValue: getSelectedOption(genderOptions, gender), title: "What is your gender?", description: "The gender on the policy should match your official driver\u2019s licence. Some insurers analyze a driver's sex when creating a policy. Men are typically considered higher risk than female drivers, but the statistics supporting this idea vary from province to province. On average, men and women pay roughly the same for insurance, though." }), driverState.activeIndex > 0
|
|
782
790
|
&& (jsx(SelectFormBox, { options: applicantRelationshipOptions, name: "applicantRelationship", onChange: handleApplicantRelationshipChange, defaultValue: getSelectedOption(applicantRelationshipOptions, applicantRelationship), title: "Relationship to applicant", placeholder: "Select...", autoSelectIfValueIsOutOfOptions: false, error: !applicantRelationship && driverState.inValidation, errorMessage: getErrorMessage(applicantRelationship, driverState.inValidation) }))] }));
|
|
783
791
|
};
|
|
784
792
|
|
|
@@ -1633,9 +1641,10 @@ const SectionDiscountInfo$1 = () => {
|
|
|
1633
1641
|
payload: { caslConsent: value },
|
|
1634
1642
|
});
|
|
1635
1643
|
};
|
|
1644
|
+
const moneyEmoji = '\u{1F4B0}';
|
|
1636
1645
|
return (jsxs("div", { className: `form-section ${mychoiceCls}`, children: [isTheBig
|
|
1637
1646
|
? (jsx(LabelFormBox, { title: "You are seconds away from receiving your car insurance quotes,\n please provide your email after completing the discount section so we\n can send you your personalized free car insurance quotes!" }))
|
|
1638
|
-
: (jsxs(Fragment, { children: [jsx("h2", { className: "section-title", children:
|
|
1647
|
+
: (jsxs(Fragment, { children: [jsx("h2", { className: "section-title", children: `${moneyEmoji} A little extra info for discounts and connecting you with our partners.` }), jsx("span", { className: "info-title-message", children: "You are seconds away from receiving your car insurance quotes, please provide your email after completing the discount section so we can send you your personalized free car insurance quotes!" })] })), jsx(BlockVehLinks, {}), jsx(SwitchButtonBox, { items: yesNoOptions, onChange: handleMultiplePolicyChange, name: "multiplePoliciesDiscount", defaultValue: getSelectedOption(yesNoOptions, multiplePoliciesDiscount), title: "You could receive a 10-15% discount for bundling insurance with multiple policies with the same insurance company. Does that interest you?", description: "Bundling your home and auto insurance can save you significantly on insurance premiums as a whole package. Do you want to learn more about the benefits of multiple policies for home, tenant, condo, or car insurance? All you have to do is select yes.." }), !(allProvinces.isAlbertaProvince && isTheBig) && (jsx(SwitchButtonBox, { items: yesNoOptions, onChange: handleCaaMemberChange, name: "caaMemberDiscount", defaultValue: getSelectedOption(yesNoOptions, caaMemberDiscount), title: "Please indicate if you are a member of CAA, you could save up to an additional 20%." })), jsx(SwitchButtonBox, { items: yesNoOptions, onChange: handleAppInstallChange, name: "appInstallDiscount", defaultValue: getSelectedOption(yesNoOptions, appInstallDiscount), title: "You could receive up to a 30% discount by using an app to track driving habits. Does that interest you?", description: "Get rewarded for safe driving with the click of a button. If you install the app, you may be eligible for a 30% discount on your insurance premiums. Typically, you receive 10% of the discount upfront and the balance after six months of good driving." }), isTheBig
|
|
1639
1648
|
? (jsxs("div", { className: "input-form-box-container", children: [jsx(LabelFormBox, { title: "Complete this form to see all your personalized\n quotes on the next page, you will also be able to:" }), jsxs("ol", { className: "ordered-block", children: [jsx("li", { children: "See what rates insurance carriers are offering" }), jsx("li", { children: "Get in touch with us and secure your rate" }), jsx("li", { children: "Potentially save more by speaking with a broker" })] })] }))
|
|
1640
1649
|
: jsx("h2", { children: "Complete the form below to see which companies are offering your quotes." }), jsx(InputFormBox, { name: "firstName", title: "First Name", onChange: handleFirstNameChange, defaultValue: firstName, placeholder: "Your First Name", error: !firstName && discountState.inValidation, errorMessage: getErrorMessage(firstName, discountState.inValidation) }), jsx(InputFormBox, { name: "lastname", title: "Last Name", onChange: handleLastNameChange, defaultValue: lastName, placeholder: "Your Last Name", error: !lastName && discountState.inValidation, errorMessage: getErrorMessage(lastName, discountState.inValidation) }), isTheBig
|
|
1641
1650
|
&& (jsx(InputFormLicenceBox, { ...getDynamicLicenceBoxProps({ ...allProvinces }), name: "driverLicense", title: "Driver Licence Number (Optional)", onChange: handleDriverLicenseChange, defaultValue: driverLicense, description: "Enter your drivers licence number in to receive a more accurate, prequalified quote from our broker partners. This will enable you to provide less details over the phone if you choose to have a broker contact you. This is an optional input." })), jsx(InputFormPhoneBox, { name: "phone", onChange: handlePhoneNumberChange, defaultValue: phone, title: "Phone Number", placeholder: "(855) 325-8444", error: !phone && discountState.inValidation, errorMessage: getErrorMessage(phone, discountState.inValidation) }), jsx(InputFormEmailBox, { validationStatus: emailStatus, errorMessage: emailStatus === ValidationStatusTypes.Declined
|
|
@@ -3766,6 +3775,7 @@ const AppRouteWrapper = (props) => {
|
|
|
3766
3775
|
let postalCode = carPostal;
|
|
3767
3776
|
const { clearFormData, checkIsExpired, checkIsExpiredWithModal, } = ClearFormDataHandler();
|
|
3768
3777
|
const { appLoaderState } = useStoreAppLoader();
|
|
3778
|
+
const isMychoice = appType === AppTypes.MyChoice;
|
|
3769
3779
|
switch (insuranceType) {
|
|
3770
3780
|
case InsuranceTypes.Car:
|
|
3771
3781
|
postalCode = carPostal;
|
|
@@ -3975,7 +3985,7 @@ const AppRouteWrapper = (props) => {
|
|
|
3975
3985
|
}
|
|
3976
3986
|
}
|
|
3977
3987
|
}, [carPostal, homePostal, lifePostal, isReady]);
|
|
3978
|
-
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: "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 }), !appLoaderState.isOpen &&
|
|
3988
|
+
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: "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, {})] })) }));
|
|
3979
3989
|
};
|
|
3980
3990
|
const NestedRoutes = () => {
|
|
3981
3991
|
const insuranceType = getInsuranceType();
|