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 +0 -1
- package/dist/cjs/index.js +14 -9
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +14 -9
- package/dist/esm/index.js.map +1 -1
- package/dist/types/components/HealthInformationForm/HealthInformationForm.d.ts +6 -0
- package/dist/types/components/HealthQuestionGroup/HealthQuestionGroup.d.ts +13 -0
- package/dist/types/components/HealthQuestionGroup/index.d.ts +1 -1
- package/dist/types/components/NewHeader/NewHeader.d.ts +6 -2
- package/dist/types/components/ProductSelectionDrawer/ProductSelectionDrawer.d.ts +1 -5
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -1690,7 +1690,10 @@ function Header$1({ logo, navigationLinks, languages, currentLocale, userToken,
|
|
|
1690
1690
|
letterSpacing: '.3rem',
|
|
1691
1691
|
color: 'inherit',
|
|
1692
1692
|
textDecoration: 'none',
|
|
1693
|
-
} }, { children: jsx("img", { src: logo, alt: "Logo",
|
|
1693
|
+
} }, { children: jsx("img", { src: logo, alt: "Logo", height: 'auto', width: '126px', style: {
|
|
1694
|
+
height: 'auto',
|
|
1695
|
+
width: '126px',
|
|
1696
|
+
} }) })) })), !isMobile && (jsxs(Fragment, { children: [shouldShowContent && (jsxs(Box, Object.assign({ sx: {
|
|
1694
1697
|
flexGrow: 1,
|
|
1695
1698
|
display: { xs: 'none', md: 'flex', gap: 40 },
|
|
1696
1699
|
} }, { children: [jsxs(ButtonDesktopMenu, Object.assign({ onClick: handleOpenNavMenu, sx: { my: 2, textTransform: 'capitalize' }, "data-testid": "productNavigationMenu" }, { children: [jsx(Typography, Object.assign({ variant: "h6" }, { children: formatMessage({ id: 'Products' }) })), jsx(Icon, { component: ArrowDropDownIcon })] }), "product"), (menuItems === null || menuItems === void 0 ? void 0 : menuItems.partnership) && (jsx(ButtonDesktopMenu, Object.assign({ onClick: onPartnershipClick, sx: { my: 2, textTransform: 'capitalize' } }, { children: jsx(Typography, Object.assign({ variant: "h6" }, { children: 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) && (jsx(ButtonDesktopMenu, Object.assign({ onClick: onAboutUsClick, sx: { my: 2, textTransform: 'capitalize' } }, { children: jsx(Typography, Object.assign({ variant: "h6" }, { children: 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) && (jsx(ButtonDesktopMenu, Object.assign({ onClick: onBlogClick, sx: { my: 2, textTransform: 'capitalize' } }, { children: jsx(Typography, Object.assign({ variant: "h6" }, { children: 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"))] }))), jsxs(Box, Object.assign({ sx: {
|
|
@@ -1875,7 +1878,7 @@ styled(Box)(({ theme }) => ({
|
|
|
1875
1878
|
* />
|
|
1876
1879
|
* ```
|
|
1877
1880
|
*/
|
|
1878
|
-
function NewHeader({ logo: propLogo, navigationLinks = [], isMobile: propIsMobile, onLogoClick, onMenuOpen, onMenuClose, customDrawerContent, formatMessage = (descriptor) => descriptor.id, }) {
|
|
1881
|
+
function NewHeader({ logo: propLogo, logoAltText = 'Logo', navigationLinks = [], isMobile: propIsMobile, onLogoClick, onMenuOpen, onMenuClose, customDrawerContent, formatMessage = (descriptor) => descriptor.id, }) {
|
|
1879
1882
|
var _a;
|
|
1880
1883
|
const tenantTheme = useTenantTheme();
|
|
1881
1884
|
const theme = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme;
|
|
@@ -1903,7 +1906,7 @@ function NewHeader({ logo: propLogo, navigationLinks = [], isMobile: propIsMobil
|
|
|
1903
1906
|
(_a = item.onClick) === null || _a === void 0 ? void 0 : _a.call(item);
|
|
1904
1907
|
handleDrawerClose();
|
|
1905
1908
|
};
|
|
1906
|
-
return (jsxs(Fragment, { children: [jsx(StyledAppBar, Object.assign({ position: "fixed" }, { children: jsxs(StyledToolbar, Object.assign({ disableGutters: true }, { children: [jsx(LogoContainer$1, Object.assign({ onClick: handleLogoClick }, { children: jsx(LogoImage, { src: logo, alt:
|
|
1909
|
+
return (jsxs(Fragment, { children: [jsx(StyledAppBar, Object.assign({ position: "fixed" }, { children: jsxs(StyledToolbar, Object.assign({ disableGutters: true }, { children: [jsx(LogoContainer$1, Object.assign({ onClick: handleLogoClick }, { children: jsx(LogoImage, { src: logo, alt: logoAltText }) })), jsx(MenuIconButton, Object.assign({ size: "large", edge: "end", "aria-label": "menu", onClick: handleDrawerOpen }, { children: jsx(MenuIcon, {}) }))] })) })), jsx(StyledDrawer$2, Object.assign({ anchor: "right", open: drawerOpen, onClose: handleDrawerClose }, { children: customDrawerContent ? (jsx(Box, Object.assign({ sx: { width: isMobile ? '100vw' : 350 } }, { children: customDrawerContent }))) : (jsxs(Box, Object.assign({ sx: { width: isMobile ? '100vw' : 350 } }, { children: [jsxs(DrawerHeader$2, { children: [jsx(DrawerLogoContainer, Object.assign({ onClick: handleLogoClick }, { children: jsx(LogoImage, { src: logo, alt: logoAltText }) })), jsx(CloseIconButton, Object.assign({ onClick: handleDrawerClose, "aria-label": "close" }, { children: jsx(CloseIcon, {}) }))] }), jsx(Divider, {}), jsx(DrawerContent$2, { children: navigationLinks.length > 0 && (jsx(List, { children: navigationLinks.map((item) => (jsx(ListItem, Object.assign({ disablePadding: true }, { children: jsx(ListItemButton, Object.assign({ onClick: () => handleMenuItemClick(item) }, { children: jsx(ListItemText, { primary: formatMessage({ id: item.label }) }) })) }), item.key))) })) })] }))) }))] }));
|
|
1907
1910
|
}
|
|
1908
1911
|
|
|
1909
1912
|
const DivFooter = styled('div')(() => ({
|
|
@@ -2312,7 +2315,7 @@ const DialogHeaderTitle = styled$1(Typography)(() => ({
|
|
|
2312
2315
|
color: '#13131b',
|
|
2313
2316
|
marginBottom: '8px',
|
|
2314
2317
|
paddingRight: '32px',
|
|
2315
|
-
wordSpacing: '
|
|
2318
|
+
wordSpacing: '-5px',
|
|
2316
2319
|
}));
|
|
2317
2320
|
const DialogHeaderSubtitle = styled$1(Typography)(() => ({
|
|
2318
2321
|
fontFamily: 'Montserrat, sans-serif',
|
|
@@ -2561,7 +2564,7 @@ styled$1(Box)({
|
|
|
2561
2564
|
padding: '4px',
|
|
2562
2565
|
});
|
|
2563
2566
|
|
|
2564
|
-
function ProductSelectionDrawer({ open, onClose, products, onProductSelect, title = 'Select your product', subtitle = 'Pick the product that suits your protection goals to view available plans',
|
|
2567
|
+
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', }) {
|
|
2565
2568
|
// Desktop Dialog variant
|
|
2566
2569
|
if (variant === 'dialog') {
|
|
2567
2570
|
return (jsxs(StyledDialog, Object.assign({ open: open, onClose: onClose, maxWidth: "md", fullWidth: true }, { children: [jsxs(DialogHeader, { children: [jsx(IconButton, Object.assign({ onClick: onClose, sx: {
|
|
@@ -3693,8 +3696,10 @@ styled(Typography)(({ selected }) => ({
|
|
|
3693
3696
|
wordSpacing: '-5px',
|
|
3694
3697
|
}));
|
|
3695
3698
|
|
|
3696
|
-
const HealthQuestionGroup = ({ question, questionNumber, value, onChange, error, labels = { yes: 'Yes', no: 'No' }, sx, }) => {
|
|
3697
|
-
|
|
3699
|
+
const HealthQuestionGroup = ({ question, questionNumber, value, onChange, error, labels = { yes: 'Yes', no: 'No' }, sx, OptionButtonComponent, }) => {
|
|
3700
|
+
const yesLabel = labels.yes || 'Yes';
|
|
3701
|
+
const noLabel = labels.no || 'No';
|
|
3702
|
+
return (jsxs(QuestionContainer, Object.assign({ sx: sx }, { children: [jsxs(QuestionText, { children: [questionNumber && `${questionNumber}. `, question] }), jsx(OptionsContainer, { children: OptionButtonComponent ? (jsxs(Fragment, { children: [jsx(OptionButtonComponent, Object.assign({ variant: "filledLightBorder", selected: value === 'yes', onClick: () => onChange('yes'), fullWidth: true }, { children: yesLabel })), jsx(OptionButtonComponent, Object.assign({ variant: "filledLightBorder", selected: value === 'no', onClick: () => onChange('no'), fullWidth: true }, { children: noLabel }))] })) : (jsxs(Fragment, { children: [jsx(OptionButton, { value: "yes", label: yesLabel, selected: value === 'yes', onClick: () => onChange('yes'), variant: "form", size: "large" }), jsx(OptionButton, { value: "no", label: noLabel, selected: value === 'no', onClick: () => onChange('no'), variant: "form", size: "large" })] })) }), error && (jsx(Typography, Object.assign({ sx: {
|
|
3698
3703
|
color: 'error.main',
|
|
3699
3704
|
fontSize: '12px',
|
|
3700
3705
|
mt: 0.5,
|
|
@@ -3968,9 +3973,9 @@ const MeasurementFieldsGrid = styled(Box)({
|
|
|
3968
3973
|
},
|
|
3969
3974
|
});
|
|
3970
3975
|
|
|
3971
|
-
const HealthInformationForm = ({ renderField, measurementFields, healthQuestions, onSubmit, formRef, sx, desktopGridLayout = false, }) => {
|
|
3976
|
+
const HealthInformationForm = ({ renderField, measurementFields, healthQuestions, onSubmit, formRef, sx, desktopGridLayout = false, OptionButtonComponent, }) => {
|
|
3972
3977
|
const Container = desktopGridLayout ? DesktopFormContainer$1 : FormContainer$1;
|
|
3973
|
-
return (jsx(Container, Object.assign({ ref: formRef, component: "form", onSubmit: onSubmit, sx: sx }, { children: jsxs(Box, Object.assign({ sx: { display: 'flex', flexDirection: 'column', gap: '24px' } }, { children: [desktopGridLayout ? (jsxs(MeasurementFieldsGrid, { children: [renderField(measurementFields.weight), renderField(measurementFields.height)] })) : (jsxs(Fragment, { children: [renderField(measurementFields.weight), renderField(measurementFields.height)] })), healthQuestions.map((question, index) => (jsx(HealthQuestionGroup, { question: question.question, questionNumber: question.questionNumber, value: question.value, onChange: question.onChange, error: question.error, labels: question.labels }, question.name || index)))] })) })));
|
|
3978
|
+
return (jsx(Container, Object.assign({ ref: formRef, component: "form", onSubmit: onSubmit, sx: sx }, { children: jsxs(Box, Object.assign({ sx: { display: 'flex', flexDirection: 'column', gap: '24px' } }, { children: [desktopGridLayout ? (jsxs(MeasurementFieldsGrid, { children: [renderField(measurementFields.weight), renderField(measurementFields.height)] })) : (jsxs(Fragment, { children: [renderField(measurementFields.weight), renderField(measurementFields.height)] })), healthQuestions.map((question, index) => (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)))] })) })));
|
|
3974
3979
|
};
|
|
3975
3980
|
|
|
3976
3981
|
const FormContainer = styled(Box)({
|