igloo-d2c-components 1.0.36 → 1.0.38

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/README.md CHANGED
@@ -683,7 +683,6 @@ const products: Product[] = [
683
683
  }}
684
684
  title="Select your product"
685
685
  subtitle="Pick the product that suits your protection goals"
686
- viewPlansButtonText="View plans"
687
686
  />
688
687
  ```
689
688
 
package/dist/cjs/index.js CHANGED
@@ -1710,7 +1710,10 @@ function Header$1({ logo, navigationLinks, languages, currentLocale, userToken,
1710
1710
  letterSpacing: '.3rem',
1711
1711
  color: 'inherit',
1712
1712
  textDecoration: 'none',
1713
- } }, { children: jsxRuntime.jsx("img", { src: logo, alt: "Logo", style: Object.assign({}, (isMobile && { height: '32px', width: '119px' })), height: isMobile ? '32px' : '57px', width: isMobile ? '119px' : '93.36px' }) })) })), !isMobile && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [shouldShowContent && (jsxRuntime.jsxs(material.Box, Object.assign({ sx: {
1713
+ } }, { children: jsxRuntime.jsx("img", { src: logo, alt: "Logo", height: 'auto', width: '126px', style: {
1714
+ height: 'auto',
1715
+ width: '126px',
1716
+ } }) })) })), !isMobile && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [shouldShowContent && (jsxRuntime.jsxs(material.Box, Object.assign({ sx: {
1714
1717
  flexGrow: 1,
1715
1718
  display: { xs: 'none', md: 'flex', gap: 40 },
1716
1719
  } }, { children: [jsxRuntime.jsxs(ButtonDesktopMenu, Object.assign({ onClick: handleOpenNavMenu, sx: { my: 2, textTransform: 'capitalize' }, "data-testid": "productNavigationMenu" }, { children: [jsxRuntime.jsx(material.Typography, Object.assign({ variant: "h6" }, { children: formatMessage({ id: 'Products' }) })), jsxRuntime.jsx(material.Icon, { component: ArrowDropDownIcon })] }), "product"), (menuItems === null || menuItems === void 0 ? void 0 : menuItems.partnership) && (jsxRuntime.jsx(ButtonDesktopMenu, Object.assign({ onClick: onPartnershipClick, sx: { my: 2, textTransform: 'capitalize' } }, { children: jsxRuntime.jsx(material.Typography, Object.assign({ variant: "h6" }, { children: jsxRuntime.jsx(AnchorLink$1, Object.assign({ href: `${host}${menuItems.partnership.route}`, onClick: (e) => e === null || e === void 0 ? void 0 : e.preventDefault() }, { children: menuItems.partnership.label })) })) }), "partnership")), (menuItems === null || menuItems === void 0 ? void 0 : menuItems.aboutUs) && (jsxRuntime.jsx(ButtonDesktopMenu, Object.assign({ onClick: onAboutUsClick, sx: { my: 2, textTransform: 'capitalize' } }, { children: jsxRuntime.jsx(material.Typography, Object.assign({ variant: "h6" }, { children: jsxRuntime.jsx(AnchorLinks, Object.assign({ href: `${host}${menuItems.aboutUs.route}`, onClick: (e) => e === null || e === void 0 ? void 0 : e.preventDefault() }, { children: menuItems.aboutUs.label })) })) }), "aboutus")), (menuItems === null || menuItems === void 0 ? void 0 : menuItems.blog) && (jsxRuntime.jsx(ButtonDesktopMenu, Object.assign({ onClick: onBlogClick, sx: { my: 2, textTransform: 'capitalize' } }, { children: jsxRuntime.jsx(material.Typography, Object.assign({ variant: "h6" }, { children: jsxRuntime.jsx(AnchorLink$1, Object.assign({ href: menuItems.blog.url, onClick: (e) => e === null || e === void 0 ? void 0 : e.preventDefault() }, { children: menuItems.blog.label })) })) }), "blog"))] }))), jsxRuntime.jsxs(material.Box, Object.assign({ sx: {
@@ -1895,7 +1898,7 @@ styles.styled(material.Box)(({ theme }) => ({
1895
1898
  * />
1896
1899
  * ```
1897
1900
  */
1898
- function NewHeader({ logo: propLogo, navigationLinks = [], isMobile: propIsMobile, onLogoClick, onMenuOpen, onMenuClose, customDrawerContent, formatMessage = (descriptor) => descriptor.id, }) {
1901
+ function NewHeader({ logo: propLogo, logoAltText = 'Logo', navigationLinks = [], isMobile: propIsMobile, onLogoClick, onMenuOpen, onMenuClose, customDrawerContent, formatMessage = (descriptor) => descriptor.id, }) {
1899
1902
  var _a;
1900
1903
  const tenantTheme = useTenantTheme();
1901
1904
  const theme = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme;
@@ -1923,7 +1926,7 @@ function NewHeader({ logo: propLogo, navigationLinks = [], isMobile: propIsMobil
1923
1926
  (_a = item.onClick) === null || _a === void 0 ? void 0 : _a.call(item);
1924
1927
  handleDrawerClose();
1925
1928
  };
1926
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(StyledAppBar, Object.assign({ position: "fixed" }, { children: jsxRuntime.jsxs(StyledToolbar, Object.assign({ disableGutters: true }, { children: [jsxRuntime.jsx(LogoContainer$1, Object.assign({ onClick: handleLogoClick }, { children: jsxRuntime.jsx(LogoImage, { src: logo, alt: "Logo" }) })), jsxRuntime.jsx(MenuIconButton, Object.assign({ size: "large", edge: "end", "aria-label": "menu", onClick: handleDrawerOpen }, { children: jsxRuntime.jsx(MenuIcon, {}) }))] })) })), jsxRuntime.jsx(StyledDrawer$2, Object.assign({ anchor: "right", open: drawerOpen, onClose: handleDrawerClose }, { children: customDrawerContent ? (jsxRuntime.jsx(material.Box, Object.assign({ sx: { width: isMobile ? '100vw' : 350 } }, { children: customDrawerContent }))) : (jsxRuntime.jsxs(material.Box, Object.assign({ sx: { width: isMobile ? '100vw' : 350 } }, { children: [jsxRuntime.jsxs(DrawerHeader$2, { children: [jsxRuntime.jsx(DrawerLogoContainer, Object.assign({ onClick: handleLogoClick }, { children: jsxRuntime.jsx(LogoImage, { src: logo, alt: "Logo" }) })), jsxRuntime.jsx(CloseIconButton, Object.assign({ onClick: handleDrawerClose, "aria-label": "close" }, { children: jsxRuntime.jsx(CloseIcon, {}) }))] }), jsxRuntime.jsx(material.Divider, {}), jsxRuntime.jsx(DrawerContent$2, { children: navigationLinks.length > 0 && (jsxRuntime.jsx(material.List, { children: navigationLinks.map((item) => (jsxRuntime.jsx(material.ListItem, Object.assign({ disablePadding: true }, { children: jsxRuntime.jsx(material.ListItemButton, Object.assign({ onClick: () => handleMenuItemClick(item) }, { children: jsxRuntime.jsx(material.ListItemText, { primary: formatMessage({ id: item.label }) }) })) }), item.key))) })) })] }))) }))] }));
1929
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(StyledAppBar, Object.assign({ position: "fixed" }, { children: jsxRuntime.jsxs(StyledToolbar, Object.assign({ disableGutters: true }, { children: [jsxRuntime.jsx(LogoContainer$1, Object.assign({ onClick: handleLogoClick }, { children: jsxRuntime.jsx(LogoImage, { src: logo, alt: logoAltText }) })), jsxRuntime.jsx(MenuIconButton, Object.assign({ size: "large", edge: "end", "aria-label": "menu", onClick: handleDrawerOpen }, { children: jsxRuntime.jsx(MenuIcon, {}) }))] })) })), jsxRuntime.jsx(StyledDrawer$2, Object.assign({ anchor: "right", open: drawerOpen, onClose: handleDrawerClose }, { children: customDrawerContent ? (jsxRuntime.jsx(material.Box, Object.assign({ sx: { width: isMobile ? '100vw' : 350 } }, { children: customDrawerContent }))) : (jsxRuntime.jsxs(material.Box, Object.assign({ sx: { width: isMobile ? '100vw' : 350 } }, { children: [jsxRuntime.jsxs(DrawerHeader$2, { children: [jsxRuntime.jsx(DrawerLogoContainer, Object.assign({ onClick: handleLogoClick }, { children: jsxRuntime.jsx(LogoImage, { src: logo, alt: logoAltText }) })), jsxRuntime.jsx(CloseIconButton, Object.assign({ onClick: handleDrawerClose, "aria-label": "close" }, { children: jsxRuntime.jsx(CloseIcon, {}) }))] }), jsxRuntime.jsx(material.Divider, {}), jsxRuntime.jsx(DrawerContent$2, { children: navigationLinks.length > 0 && (jsxRuntime.jsx(material.List, { children: navigationLinks.map((item) => (jsxRuntime.jsx(material.ListItem, Object.assign({ disablePadding: true }, { children: jsxRuntime.jsx(material.ListItemButton, Object.assign({ onClick: () => handleMenuItemClick(item) }, { children: jsxRuntime.jsx(material.ListItemText, { primary: formatMessage({ id: item.label }) }) })) }), item.key))) })) })] }))) }))] }));
1927
1930
  }
1928
1931
 
1929
1932
  const DivFooter = styles.styled('div')(() => ({
@@ -2332,7 +2335,7 @@ const DialogHeaderTitle = material.styled(material.Typography)(() => ({
2332
2335
  color: '#13131b',
2333
2336
  marginBottom: '8px',
2334
2337
  paddingRight: '32px',
2335
- wordSpacing: '0px',
2338
+ wordSpacing: '-5px',
2336
2339
  }));
2337
2340
  const DialogHeaderSubtitle = material.styled(material.Typography)(() => ({
2338
2341
  fontFamily: 'Montserrat, sans-serif',
@@ -2581,7 +2584,7 @@ material.styled(material.Box)({
2581
2584
  padding: '4px',
2582
2585
  });
2583
2586
 
2584
- function ProductSelectionDrawer({ open, onClose, products, onProductSelect, title = 'Select your product', subtitle = 'Pick the product that suits your protection goals to view available plans', viewPlansButtonText = 'View plans', variant = 'drawer', }) {
2587
+ function ProductSelectionDrawer({ open, onClose, products, onProductSelect, title = 'Select your product', subtitle = 'Pick the product that suits your protection goals to view available plans', variant = 'drawer', }) {
2585
2588
  // Desktop Dialog variant
2586
2589
  if (variant === 'dialog') {
2587
2590
  return (jsxRuntime.jsxs(StyledDialog, Object.assign({ open: open, onClose: onClose, maxWidth: "md", fullWidth: true }, { children: [jsxRuntime.jsxs(DialogHeader, { children: [jsxRuntime.jsx(material.IconButton, Object.assign({ onClick: onClose, sx: {
@@ -3713,8 +3716,10 @@ styles.styled(material.Typography)(({ selected }) => ({
3713
3716
  wordSpacing: '-5px',
3714
3717
  }));
3715
3718
 
3716
- const HealthQuestionGroup = ({ question, questionNumber, value, onChange, error, labels = { yes: 'Yes', no: 'No' }, sx, }) => {
3717
- return (jsxRuntime.jsxs(QuestionContainer, Object.assign({ sx: sx }, { children: [jsxRuntime.jsxs(QuestionText, { children: [questionNumber && `${questionNumber}. `, question] }), jsxRuntime.jsxs(OptionsContainer, { children: [jsxRuntime.jsx(OptionButton, { value: "yes", label: labels.yes || 'Yes', selected: value === 'yes', onClick: () => onChange('yes'), variant: "form", size: "large" }), jsxRuntime.jsx(OptionButton, { value: "no", label: labels.no || 'No', selected: value === 'no', onClick: () => onChange('no'), variant: "form", size: "large" })] }), error && (jsxRuntime.jsx(material.Typography, Object.assign({ sx: {
3719
+ const HealthQuestionGroup = ({ question, questionNumber, value, onChange, error, labels = { yes: 'Yes', no: 'No' }, sx, OptionButtonComponent, }) => {
3720
+ const yesLabel = labels.yes || 'Yes';
3721
+ const noLabel = labels.no || 'No';
3722
+ return (jsxRuntime.jsxs(QuestionContainer, Object.assign({ sx: sx }, { children: [jsxRuntime.jsxs(QuestionText, { children: [questionNumber && `${questionNumber}. `, question] }), jsxRuntime.jsx(OptionsContainer, { children: OptionButtonComponent ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(OptionButtonComponent, Object.assign({ variant: "filledLightBorder", selected: value === 'yes', onClick: () => onChange('yes'), fullWidth: true }, { children: yesLabel })), jsxRuntime.jsx(OptionButtonComponent, Object.assign({ variant: "filledLightBorder", selected: value === 'no', onClick: () => onChange('no'), fullWidth: true }, { children: noLabel }))] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(OptionButton, { value: "yes", label: yesLabel, selected: value === 'yes', onClick: () => onChange('yes'), variant: "form", size: "large" }), jsxRuntime.jsx(OptionButton, { value: "no", label: noLabel, selected: value === 'no', onClick: () => onChange('no'), variant: "form", size: "large" })] })) }), error && (jsxRuntime.jsx(material.Typography, Object.assign({ sx: {
3718
3723
  color: 'error.main',
3719
3724
  fontSize: '12px',
3720
3725
  mt: 0.5,
@@ -3988,9 +3993,9 @@ const MeasurementFieldsGrid = styles.styled(material.Box)({
3988
3993
  },
3989
3994
  });
3990
3995
 
3991
- const HealthInformationForm = ({ renderField, measurementFields, healthQuestions, onSubmit, formRef, sx, desktopGridLayout = false, }) => {
3996
+ const HealthInformationForm = ({ renderField, measurementFields, healthQuestions, onSubmit, formRef, sx, desktopGridLayout = false, OptionButtonComponent, }) => {
3992
3997
  const Container = desktopGridLayout ? DesktopFormContainer$1 : FormContainer$1;
3993
- return (jsxRuntime.jsx(Container, Object.assign({ ref: formRef, component: "form", onSubmit: onSubmit, sx: sx }, { children: jsxRuntime.jsxs(material.Box, Object.assign({ sx: { display: 'flex', flexDirection: 'column', gap: '24px' } }, { children: [desktopGridLayout ? (jsxRuntime.jsxs(MeasurementFieldsGrid, { children: [renderField(measurementFields.weight), renderField(measurementFields.height)] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [renderField(measurementFields.weight), renderField(measurementFields.height)] })), healthQuestions.map((question, index) => (jsxRuntime.jsx(HealthQuestionGroup, { question: question.question, questionNumber: question.questionNumber, value: question.value, onChange: question.onChange, error: question.error, labels: question.labels }, question.name || index)))] })) })));
3998
+ return (jsxRuntime.jsx(Container, Object.assign({ ref: formRef, component: "form", onSubmit: onSubmit, sx: sx }, { children: jsxRuntime.jsxs(material.Box, Object.assign({ sx: { display: 'flex', flexDirection: 'column', gap: '24px' } }, { children: [desktopGridLayout ? (jsxRuntime.jsxs(MeasurementFieldsGrid, { children: [renderField(measurementFields.weight), renderField(measurementFields.height)] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [renderField(measurementFields.weight), renderField(measurementFields.height)] })), healthQuestions.map((question, index) => (jsxRuntime.jsx(HealthQuestionGroup, { question: question.question, questionNumber: question.questionNumber, value: question.value, onChange: question.onChange, error: question.error, labels: question.labels, OptionButtonComponent: OptionButtonComponent }, question.name || index)))] })) })));
3994
3999
  };
3995
4000
 
3996
4001
  const FormContainer = styles.styled(material.Box)({