@mychoice/mychoice-sdk-modules 2.1.81 → 2.1.83

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/esm/index.js CHANGED
@@ -394,7 +394,19 @@ const OfferSection = ({ offerCompany, brokerCompany, offerPrice, phoneNumber, is
394
394
  postRequestQuoteOnliaUrl(true, redirectUrl);
395
395
  };
396
396
  const isHubIntegration = brokerIntegration?.type === 'hub';
397
- return (jsxs("div", { className: `offer-section ${mychoiceCls}`, children: [(isTheBig || !offsiteUrl) && (jsx(Fragment, { children: jsx(OfferDetail, { className: isTheBig ? 'thebig-bold' : '', logo: brokerCompany?.logo, name: brokerCompany?.title, companyType: CompanyRoleTypes.Broker, description: brokerCompany?.description }) })), jsx(OfferDetail, { className: isTheBig ? 'thebig-bold' : '', name: "Hours of Operation", children: jsx(OperationHoursInfo, { weekdayHours: weekdayHours, saturdayHours: saturdayHours, sundayHours: sundayHours }) }), jsx("hr", {}), !isHubIntegration && (jsx(OfferHeader, { className: isTheBig ? 'thebig-bold' : '', companyName: offerCompany?.name, isBestOffer: isBestOffer })), !isHubIntegration && (jsx(OfferPrice, { className: isTheBig ? 'thebig' : '', companyLogo: offerCompany?.logo, price: offerPrice })), isHubIntegration && (jsx("div", { className: "offer-phone hub-integration", children: jsx("div", { className: "hub-message-container", children: jsxs("p", { className: "hub-description", children: [jsx("span", { children: brokerIntegration?.data?.label }), jsx("br", {}), brokerIntegration?.data?.description] }) }) })), brokerIntegration?.type === 'youset' && brokerIntegration?.data?.url && (jsxs("div", { className: "offer-phone", children: [jsx("h3", { children: brokerIntegration?.data?.description || 'Click below to view your YouSet offer' }), jsx(ButtonBase, { className: `offer-phone-number ${mychoiceCls}`, label: brokerIntegration?.data?.label || 'View Offer', type: ButtonTypes.Button, category: CategoryTypes.Filled, color: ColorTypes.Primary, variant: ButtonVariantTypes.Rectangle, size: SizeTypes.Medium, onClick: () => window.open(brokerIntegration.data.url, '_blank') })] })), !brokerIntegration && !isTheBig && offsiteUrl && (jsxs("div", { className: "offer-phone", children: [jsx("h3", { children: "Click below to get this rate" }), jsx(ButtonBase, { className: `offer-phone-number ${mychoiceCls}`, label: "Buy Online", type: ButtonTypes.Button, category: CategoryTypes.Filled, color: ColorTypes.Primary, variant: ButtonVariantTypes.Rectangle, size: SizeTypes.Medium, onClick: handleCTAClick })] })), !brokerIntegration && (isTheBig || !offsiteUrl) && (jsxs("div", { className: "offer-phone", children: [jsx("h3", { className: isTheBig ? 'thebig-bold' : '', children: "Call now to get this rate" }), jsx("a", { target: "_blank", rel: "noreferrer noopener", href: `tel:${phoneNumber?.number}`, children: jsx(ButtonBase, { className: `${isTheBig ? 'thebig-bold' : 'mychoice'} offer-phone-number`, label: phoneNumber?.title, type: ButtonTypes.Button, category: CategoryTypes.Filled, color: ColorTypes.Primary, variant: ButtonVariantTypes.Rectangle, size: SizeTypes.Medium }) })] })), jsxs("button", { className: "dropdown", onClick: handleDropdownClick, children: [jsx("span", { children: detailsIsOpen ? 'Less Info' : 'More Info' }), jsx(IconDropdownArrow, { color: "grey", className: detailsIsOpen ? 'rotated' : '' })] }), detailsIsOpen && (jsxs("div", { className: "offer-details", children: [!isHubIntegration && (jsx(Fragment, { children: jsx(OfferDetail, { className: isTheBig ? 'thebig-bold' : '', name: offerCompany?.name, companyType: CompanyRoleTypes.Offering, description: offerCompany?.description }) })), isMyChoice && coverages && (jsxs(Fragment, { children: [jsx("hr", {}), jsx(VehicleOfferCoverages, { coverages: coverages, nonStandardCoverages: nonStandardCoverages })] }))] }))] }));
397
+ return (jsxs("div", { className: `offer-section ${mychoiceCls}`, children: [(isTheBig || !offsiteUrl) && (jsxs(Fragment, { children: [jsx(OfferDetail, { className: isTheBig ? 'thebig-bold' : '', logo: brokerCompany?.logo, name: brokerCompany?.title, companyType: CompanyRoleTypes.Broker, description: brokerCompany?.description, isBestOffer: isBestOffer }), jsx("hr", { style: {
398
+ margin: '0',
399
+ padding: '0',
400
+ width: '100%',
401
+ height: '1px',
402
+ backgroundColor: '$color-background-header-primary',
403
+ } })] })), jsx(OfferDetail, { className: isTheBig ? 'thebig-bold' : '', name: "Hours of Operation", children: jsx(OperationHoursInfo, { weekdayHours: weekdayHours, saturdayHours: saturdayHours, sundayHours: sundayHours }) }), jsx("hr", { style: {
404
+ margin: '0',
405
+ padding: '0',
406
+ width: '100%',
407
+ height: '1px',
408
+ backgroundColor: '$color-background-header-primary',
409
+ } }), !isHubIntegration && (jsx(OfferHeader, { className: isTheBig ? 'thebig-bold' : '', companyName: offerCompany?.name, isBestOffer: isBestOffer })), !isHubIntegration && (jsx(OfferPrice, { className: isTheBig ? 'thebig' : '', companyLogo: offerCompany?.logo, price: offerPrice })), isHubIntegration && (jsx("div", { className: "offer-phone hub-integration", children: jsx("div", { className: "hub-message-container", children: jsxs("p", { className: "hub-description", children: [jsx("span", { children: brokerIntegration?.data?.label }), jsx("br", {}), brokerIntegration?.data?.description] }) }) })), brokerIntegration?.type === 'youset' && brokerIntegration?.data?.url && (jsxs("div", { className: "offer-phone", children: [jsx("h3", { children: brokerIntegration?.data?.description || 'Click below to view your YouSet offer' }), jsx(ButtonBase, { className: `offer-phone-number ${mychoiceCls}`, label: brokerIntegration?.data?.label || 'View Offer', type: ButtonTypes.Button, category: CategoryTypes.Filled, color: ColorTypes.Primary, variant: ButtonVariantTypes.Rectangle, size: SizeTypes.Medium, onClick: () => window.open(brokerIntegration.data.url, '_blank') })] })), !brokerIntegration && !isTheBig && offsiteUrl && (jsxs("div", { className: "offer-phone", children: [jsx("h3", { children: "Click below to get this rate" }), jsx(ButtonBase, { className: `offer-phone-number ${mychoiceCls}`, label: "Buy Online", type: ButtonTypes.Button, category: CategoryTypes.Filled, color: ColorTypes.Primary, variant: ButtonVariantTypes.Rectangle, size: SizeTypes.Medium, onClick: handleCTAClick })] })), !brokerIntegration && (isTheBig || !offsiteUrl) && (jsxs("div", { className: "offer-phone", children: [jsx("h3", { className: isTheBig ? 'thebig-bold' : '', children: "Call now to get this rate" }), jsx("a", { target: "_blank", rel: "noreferrer noopener", href: `tel:${phoneNumber?.number}`, children: jsx(ButtonBase, { className: `${isTheBig ? 'thebig-bold' : 'mychoice'} offer-phone-number`, label: phoneNumber?.title, type: ButtonTypes.Button, category: CategoryTypes.Filled, color: ColorTypes.Primary, variant: ButtonVariantTypes.Rectangle, size: SizeTypes.Medium }) })] })), jsxs("button", { className: "dropdown", onClick: handleDropdownClick, children: [jsx("span", { children: detailsIsOpen ? 'Less Info' : 'More Info' }), jsx(IconDropdownArrow, { color: "grey", className: detailsIsOpen ? 'rotated' : '' })] }), detailsIsOpen && (jsxs("div", { className: "offer-details", children: [!isHubIntegration && (jsx(Fragment, { children: jsx(OfferDetail, { className: isTheBig ? 'thebig-bold' : '', name: offerCompany?.name, companyType: CompanyRoleTypes.Offering, description: offerCompany?.description, isBestOffer: isBestOffer }) })), isMyChoice && coverages && (jsxs(Fragment, { children: [jsx("hr", {}), jsx(VehicleOfferCoverages, { coverages: coverages, nonStandardCoverages: nonStandardCoverages })] }))] }))] }));
398
410
  };
399
411
  OfferSection.defaultProps = {
400
412
  offerPrice: { monthly: 0, yearly: 0 },
@@ -609,7 +621,7 @@ const getRecommendedRange = (distanceDaily, distanceBusiness) => {
609
621
  };
610
622
 
611
623
  const BlockCarInfo = () => {
612
- const { status: statusMake, getVehicleMake, vehicleMakeList = [] } = useHandlerCarMake();
624
+ const { status: statusMake, getVehicleMake, vehicleMakeGroupList = [], } = useHandlerCarMake();
613
625
  const { status: statusModel, getVehicleModel, vehicleModelList = [] } = useHandlerCarModel();
614
626
  const { vehicleState, dispatchVehicleState } = useStoreFormCarVehicle();
615
627
  const { year: currentYear, make: currentMake, model: currentModel, } = vehicleState.items[vehicleState.activeIndex];
@@ -649,10 +661,10 @@ const BlockCarInfo = () => {
649
661
  getVehicleModel(currentYear, currentMake);
650
662
  }
651
663
  });
652
- return (jsxs(Fragment, { children: [jsx(SelectFormBox, { options: getVehicleYearRange(), name: "carYear", title: "Car Year", placeholder: "Select Year", description: "Every car is different, so for insurers to accurately cover, repair, or replace your vehicle, they need to know the make, model, age, body type, and vehicle history. Each factor will raise or lower your premium\u2014an older vehicle is typically more affordable to repair, for example, since cars lose value each year.", error: !currentYear && vehicleState.inValidation, errorMessage: !yearIsValid ? yearMessage : getErrorMessage(currentYear, vehicleState.inValidation), defaultValue: currentYear, autoSelectIfValueIsOutOfOptions: false, onChange: handleVehicleYearChange }), !!vehicleMakeList.length
664
+ return (jsxs(Fragment, { children: [jsx(SelectFormBox, { options: getVehicleYearRange(), name: "carYear", title: "Car Year", placeholder: "Select Year", description: "Every car is different, so for insurers to accurately cover, repair, or replace your vehicle, they need to know the make, model, age, body type, and vehicle history. Each factor will raise or lower your premium\u2014an older vehicle is typically more affordable to repair, for example, since cars lose value each year.", error: !currentYear && vehicleState.inValidation, errorMessage: !yearIsValid ? yearMessage : getErrorMessage(currentYear, vehicleState.inValidation), defaultValue: currentYear, autoSelectIfValueIsOutOfOptions: false, onChange: handleVehicleYearChange }), !!vehicleMakeGroupList.length
653
665
  && yearIsValid
654
666
  && statusMake === RequestStatusTypes.Success
655
- && (jsx(SelectFormBox, { options: vehicleMakeList, name: "carMakes", title: "Car Manufacturer", placeholder: "Select a Make", description: "The manufacturer of your vehicle is a huge influence on your insurance premium, but it isn\u2019t the only consideration. Some car manufacturers include security features that may qualify for discounts, like anti-theft protection or anti-lock brakes. Insurers also consider repair, risk, injury, and retail prices. If you do not see your vehicle on our list, call us for a telephonic quote.", error: !currentMake && vehicleState.inValidation, errorMessage: getErrorMessage(currentMake, vehicleState.inValidation), defaultValue: currentMake, autoSelectIfValueIsOutOfOptions: false, onChange: handleVehicleMakeChange })), vehicleModelList.length > 0
667
+ && (jsx(SelectFormBox, { options: [], groupOptions: vehicleMakeGroupList, name: "carMakes", title: "Car Manufacturer", placeholder: "Select a Make", description: "The manufacturer of your vehicle is a huge influence on your insurance premium, but it isn\u2019t the only consideration. Some car manufacturers include security features that may qualify for discounts, like anti-theft protection or anti-lock brakes. Insurers also consider repair, risk, injury, and retail prices. If you do not see your vehicle on our list, call us for a telephonic quote.", error: !currentMake && vehicleState.inValidation, errorMessage: getErrorMessage(currentMake, vehicleState.inValidation), defaultValue: currentMake, autoSelectIfValueIsOutOfOptions: false, onChange: handleVehicleMakeChange })), vehicleModelList.length > 0
656
668
  && currentMake
657
669
  && yearIsValid
658
670
  && statusModel === RequestStatusTypes.Success