@mychoice/mychoice-sdk-modules 2.2.26 → 2.2.27

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.
@@ -1,5 +1,5 @@
1
1
  import { SelectOptionGroupInterface } from '@mychoice/mychoice-sdk-components';
2
2
  /**
3
- * Filter out G1/G2 options (ALC, RB) from the "Criminal" section for trafficTicketsGroupOptions
3
+ * Filter out G1/G2 options from "Serious" section for trafficTicketsGroupOptions
4
4
  */
5
5
  export declare const getTrafficTicketsGroupOptionsWithoutG1G2: () => SelectOptionGroupInterface[];
package/dist/esm/index.js CHANGED
@@ -918,6 +918,7 @@ const VehicleSectionMain = () => {
918
918
  const AccidentBenefitsModal = ({ selectedCoverages, onApply, onCancel, selectAllByDefault = false, }) => {
919
919
  const { appConfigState: { appType } } = useStoreAppConfig();
920
920
  const isMyChoice = isMyChoiceLike(appType);
921
+ const isMyChoiceOnly = appType === AppTypes.MyChoice;
921
922
  const allValues = accidentBenefitsOptionalOptions.map((o) => o.value);
922
923
  const [localSelected, setLocalSelected] = useState(selectedCoverages.length > 0
923
924
  ? [...selectedCoverages]
@@ -936,7 +937,7 @@ const AccidentBenefitsModal = ({ selectedCoverages, onApply, onCancel, selectAll
936
937
  };
937
938
  return (jsx("div", { className: "ab-modal-overlay", onClick: onCancel, children: jsxs("div", { className: "ab-modal", onClick: (e) => e.stopPropagation(), children: [jsxs("div", { className: "ab-modal-header", children: [jsx("h3", { children: "Accident Benefits" }), jsx("p", { className: "ab-modal-subtitle", children: isMyChoice ? 'Standard Coverage + Optional Enhancements' : 'Standard Coverage + Self-Selected Optional Enhancements' }), jsx("p", { className: "ab-modal-body-text", children: isMyChoice
938
939
  ? 'Maximum coverage with flexibility to remove additional benefits.'
939
- : 'Base coverage with flexibility to select additional benefits' })] }), jsxs("div", { className: "ab-modal-content", children: [jsxs("div", { className: "ab-modal-standard-block ab-modal-standard-block--included", children: [jsxs("div", { className: "ab-modal-standard-included-header", children: [jsx("input", { type: "checkbox", checked: true, disabled: true, readOnly: true, className: "ab-modal-standard-locked-checkbox" }), jsx("h4", { children: isMyChoice ? 'All Coverages Included by Default' : 'Standard Benefits — Included' })] }), !isMyChoice && (jsx("p", { className: "ab-modal-standard-subtitle", children: "Medical, Rehabilitation, and Attendant Care" })), jsx("p", { className: "ab-modal-standard-description", children: isMyChoice ? (jsxs(Fragment, { children: ["Our standard quote automatically includes all optional accident benefits at their minimum coverage limits. We strongly recommend keeping all coverages selected to ensure the most complete protection \u2014 opting out could leave you without critical support when you need it most. For example, deselecting Income Replacement means no weekly payments if an injury prevents you from working, and removing Caregiver Replacement leaves no financial support for dependents in your care.", jsx("br", {}), jsx("br", {}), "Please speak with a broker partner to discuss higher limits or learn more about how each benefit protects you."] })) : ('Covers medical expenses, therapy and personal care for injuries from an accident, including doctor visits and physiotherapy.') })] }), jsxs("div", { className: "ab-modal-optional-block", children: [jsxs("label", { className: "ab-modal-select-all", children: [jsx("input", { type: "checkbox", checked: allSelected, onChange: handleSelectAll }), jsx("span", { children: "Select All Additional Benefits" })] }), jsx("div", { className: "ab-modal-options", children: accidentBenefitsOptionalOptions.map((option) => (jsxs("label", { className: "ab-modal-option", children: [jsx("input", { type: "checkbox", checked: localSelected.includes(option.value), onChange: () => handleToggle(option.value) }), jsxs("div", { className: "ab-modal-option-text", children: [jsx("strong", { children: option.name }), jsx("span", { children: option.description })] })] }, option.value))) }), jsxs("div", { className: "ab-modal-minimum-notice", children: [jsx("strong", { children: "Minimum Limits Apply" }), jsx("p", { children: "All optional benefits selected below will be quoted at their minimum coverage limits. Please speak with your broker if you wish to discuss higher limits." })] })] })] }), jsxs("div", { className: "ab-modal-actions", children: [jsx("button", { type: "button", className: "ab-modal-btn ab-modal-btn-cancel", onClick: onCancel, children: "Cancel" }), jsx("button", { type: "button", className: "ab-modal-btn ab-modal-btn-apply", onClick: () => onApply(localSelected), children: "Apply" })] })] }) }));
940
+ : 'Base coverage with flexibility to select additional benefits' })] }), jsxs("div", { className: "ab-modal-content", children: [jsxs("div", { className: "ab-modal-standard-block ab-modal-standard-block--included", children: [jsxs("div", { className: "ab-modal-standard-included-header", children: [jsx("input", { type: "checkbox", checked: true, disabled: true, readOnly: true, className: "ab-modal-standard-locked-checkbox" }), jsx("h4", { children: isMyChoice ? 'All Coverages Included by Default' : 'Standard Benefits — Included' })] }), !isMyChoice && (jsx("p", { className: "ab-modal-standard-subtitle", children: "Medical, Rehabilitation, and Attendant Care" })), jsx("p", { className: "ab-modal-standard-description", children: isMyChoice ? (jsxs(Fragment, { children: ["Our standard quote automatically includes all optional accident benefits at their minimum coverage limits. We strongly recommend keeping all coverages selected to ensure the most complete protection \u2014 opting out could leave you without critical support when you need it most. For example, deselecting Income Replacement means no weekly payments if an injury prevents you from working, and removing Caregiver Replacement leaves no financial support for dependents in your care.", jsx("br", {}), jsx("br", {}), "Please speak with a broker partner to discuss higher limits or learn more about how each benefit protects you."] })) : ('Covers medical expenses, therapy and personal care for injuries from an accident, including doctor visits and physiotherapy.') })] }), jsxs("div", { className: "ab-modal-optional-block", children: [jsxs("label", { className: "ab-modal-select-all", children: [jsx("input", { type: "checkbox", checked: allSelected, onChange: handleSelectAll }), jsx("span", { children: "Select All Additional Benefits" })] }), jsx("div", { className: "ab-modal-options", children: accidentBenefitsOptionalOptions.map((option) => (jsxs("label", { className: "ab-modal-option", children: [jsx("input", { type: "checkbox", checked: localSelected.includes(option.value), onChange: () => handleToggle(option.value) }), jsxs("div", { className: "ab-modal-option-text", children: [jsx("strong", { children: option.name }), jsx("span", { children: option.description })] })] }, option.value))) }), jsxs("div", { className: "ab-modal-minimum-notice", children: [jsx("strong", { children: "Minimum Limits Apply" }), jsx("p", { children: "All optional benefits selected below will be quoted at their minimum coverage limits. Please speak with your broker if you wish to discuss higher limits." })] })] })] }), jsxs("div", { className: "ab-modal-actions", children: [jsx("button", { type: "button", className: "ab-modal-btn ab-modal-btn-cancel", onClick: onCancel, children: "Cancel" }), jsx("button", { type: "button", className: "ab-modal-btn ab-modal-btn-apply", onClick: () => onApply(localSelected), children: isMyChoiceOnly ? 'Next' : 'Apply' })] })] }) }));
940
941
  };
941
942
 
942
943
  const allAccidentBenefitsCoverageValues = accidentBenefitsOptionalOptions.map((option) => option.value);
@@ -2037,17 +2038,16 @@ const BlockDriverAccident = () => {
2037
2038
  };
2038
2039
 
2039
2040
  /**
2040
- * Filter out G1/G2 options (ALC, RB) from the "Criminal" section for trafficTicketsGroupOptions
2041
+ * Filter out G1/G2 options from "Serious" section for trafficTicketsGroupOptions
2041
2042
  */
2042
2043
  const getTrafficTicketsGroupOptionsWithoutG1G2 = () => {
2043
2044
  const excludeOptions = ['ALC', 'RB'];
2044
- return trafficTicketsGroupOptions.map((group) => {
2045
- if (group.label !== 'Criminal')
2046
- return group;
2047
- return {
2048
- ...group,
2049
- options: group.options.filter((option) => !excludeOptions.includes(option.value)),
2050
- };
2045
+ const seriousOptions = trafficTicketsGroupOptions.find((entry) => entry.label === 'Serious');
2046
+ const filteredSeriousOptions = seriousOptions.options.filter((option) => !excludeOptions.includes(option.value));
2047
+ return trafficTicketsGroupOptions.map((option) => {
2048
+ if (option.label === 'Serious')
2049
+ return { ...option, options: filteredSeriousOptions };
2050
+ return option;
2051
2051
  });
2052
2052
  };
2053
2053