igloo-d2c-components 1.0.34 → 1.0.36
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 +322 -139
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +322 -139
- package/dist/esm/index.js.map +1 -1
- package/dist/types/components/CheckoutFormButton/styled.d.ts +9 -0
- package/dist/types/components/ChildInformationForm/ChildInformationForm.d.ts +26 -0
- package/dist/types/components/ContactDetailsForm/ContactDetailsForm.d.ts +29 -0
- package/dist/types/components/DesktopHeaderMenuBar/DesktopHeaderMenuBar.d.ts +1 -1
- package/dist/types/components/DesktopHeaderMenuBar/index.d.ts +1 -1
- package/dist/types/components/DesktopHeaderMenuBar/types.d.ts +22 -0
- package/dist/types/components/OptionButton/OptionButton.d.ts +1 -0
- package/dist/types/components/OptionButton/styled.d.ts +1 -1
- package/dist/types/components/PersonalInformationForm/PersonalInformationForm.d.ts +5 -0
- package/dist/types/components/ProductSelectionDrawer/ProductSelectionDrawer.d.ts +13 -0
- package/dist/types/components/ProductSelectionDrawer/styled.d.ts +35 -6
- package/dist/types/components/RecommendationsDrawer/styled.d.ts +3 -0
- package/dist/types/storybook-components/BillingToggle.stories.d.ts +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -1070,10 +1070,10 @@ const PurchaseButton = styled(Button$1)(() => ({
|
|
|
1070
1070
|
borderRadius: '24px',
|
|
1071
1071
|
whiteSpace: 'nowrap',
|
|
1072
1072
|
'&:hover': {
|
|
1073
|
-
backgroundColor: '
|
|
1073
|
+
backgroundColor: 'rgba(0, 144, 218, 0.7)',
|
|
1074
1074
|
},
|
|
1075
1075
|
'&:active': {
|
|
1076
|
-
backgroundColor: '#
|
|
1076
|
+
backgroundColor: '#0090DA',
|
|
1077
1077
|
},
|
|
1078
1078
|
}));
|
|
1079
1079
|
/**
|
|
@@ -1150,11 +1150,34 @@ function DesktopHeaderMenuBar({ logo, logoAlt = 'Logo', menuItems,
|
|
|
1150
1150
|
// Legacy props (deprecated)
|
|
1151
1151
|
showLoginButton, loginButtonText, onLoginClick,
|
|
1152
1152
|
// New CTA props
|
|
1153
|
-
showCtaButton = true, ctaButtonText = 'Purchase Now', onCtaClick, ctaScrollTargetId, onScrollToSection, onLogoClick, formatMessage = (descriptor) => descriptor.id, className,
|
|
1153
|
+
showCtaButton = true, ctaButtonText = 'Purchase Now', onCtaClick, ctaScrollTargetId, onScrollToSection, onLogoClick, formatMessage = (descriptor) => descriptor.id, className,
|
|
1154
|
+
// Language switcher props
|
|
1155
|
+
languages = [], currentLocale, onLanguageChange, }) {
|
|
1154
1156
|
var _a;
|
|
1155
1157
|
// Track which dropdown is currently open (for backward compatibility)
|
|
1156
1158
|
const [openMenuKey, setOpenMenuKey] = React.useState(null);
|
|
1157
1159
|
const [anchorEl, setAnchorEl] = React.useState(null);
|
|
1160
|
+
// Language menu state
|
|
1161
|
+
const [langAnchorEl, setLangAnchorEl] = React.useState(null);
|
|
1162
|
+
const isLangMenuOpen = Boolean(langAnchorEl);
|
|
1163
|
+
const handleLangMenuOpen = (event) => {
|
|
1164
|
+
setLangAnchorEl(event.currentTarget);
|
|
1165
|
+
};
|
|
1166
|
+
const handleLangMenuClose = () => {
|
|
1167
|
+
setLangAnchorEl(null);
|
|
1168
|
+
};
|
|
1169
|
+
const handleLangSelect = (locale, value) => {
|
|
1170
|
+
onLanguageChange === null || onLanguageChange === void 0 ? void 0 : onLanguageChange(locale, value);
|
|
1171
|
+
handleLangMenuClose();
|
|
1172
|
+
};
|
|
1173
|
+
// Derive short code for language switch trigger (per Figma: "EN" with chevron)
|
|
1174
|
+
const currentLangShortCode = React.useMemo(() => {
|
|
1175
|
+
var _a;
|
|
1176
|
+
const match = languages.find((l) => l.locale === currentLocale);
|
|
1177
|
+
if (match === null || match === void 0 ? void 0 : match.shortCode)
|
|
1178
|
+
return match.shortCode;
|
|
1179
|
+
return ((_a = match === null || match === void 0 ? void 0 : match.locale) === null || _a === void 0 ? void 0 : _a.toUpperCase().substring(0, 2)) || 'EN';
|
|
1180
|
+
}, [languages, currentLocale]);
|
|
1158
1181
|
// Determine which button props to use (support legacy props)
|
|
1159
1182
|
const shouldShowCtaButton = (_a = showCtaButton !== null && showCtaButton !== void 0 ? showCtaButton : showLoginButton) !== null && _a !== void 0 ? _a : true;
|
|
1160
1183
|
const ctaText = ctaButtonText || loginButtonText || 'Purchase Now';
|
|
@@ -1221,7 +1244,20 @@ showCtaButton = true, ctaButtonText = 'Purchase Now', onCtaClick, ctaScrollTarge
|
|
|
1221
1244
|
horizontal: 'left',
|
|
1222
1245
|
}, MenuListProps: {
|
|
1223
1246
|
'aria-labelledby': `menu-button-${item.key}`,
|
|
1224
|
-
} }, { children: item.subItems.map((subItem) => (jsxs(StyledMenuItem$1, Object.assign({ onClick: () => handleSubItemClick(item, subItem.key), "data-testid": `submenu-item-${subItem.key}` }, { children: [subItem.icon && (jsx(MenuItemIcon, { src: subItem.icon, alt: subItem.label })), formatMessage({ id: subItem.label })] }), subItem.key))) })))] }, item.key))),
|
|
1247
|
+
} }, { children: item.subItems.map((subItem) => (jsxs(StyledMenuItem$1, Object.assign({ onClick: () => handleSubItemClick(item, subItem.key), "data-testid": `submenu-item-${subItem.key}` }, { children: [subItem.icon && (jsx(MenuItemIcon, { src: subItem.icon, alt: subItem.label })), formatMessage({ id: subItem.label })] }), subItem.key))) })))] }, item.key))), languages.length > 0 && (jsxs(Fragment, { children: [jsxs(MenuItemButton, Object.assign({ onClick: handleLangMenuOpen, "aria-haspopup": "true", "aria-expanded": isLangMenuOpen, "data-testid": "language-switcher" }, { children: [jsx(MenuItemText, { children: currentLangShortCode }), jsx(DropdownIcon, { sx: {
|
|
1248
|
+
transform: isLangMenuOpen
|
|
1249
|
+
? 'rotate(180deg)'
|
|
1250
|
+
: 'rotate(0deg)',
|
|
1251
|
+
transition: 'transform 0.2s',
|
|
1252
|
+
} })] })), jsx(StyledMenu$1, Object.assign({ id: "language-menu", anchorEl: langAnchorEl, open: isLangMenuOpen, onClose: handleLangMenuClose, anchorOrigin: {
|
|
1253
|
+
vertical: 'bottom',
|
|
1254
|
+
horizontal: 'left',
|
|
1255
|
+
}, transformOrigin: {
|
|
1256
|
+
vertical: 'top',
|
|
1257
|
+
horizontal: 'left',
|
|
1258
|
+
}, MenuListProps: {
|
|
1259
|
+
'aria-labelledby': 'language-switcher',
|
|
1260
|
+
} }, { children: languages.map((lang) => (jsx(StyledMenuItem$1, Object.assign({ onClick: () => handleLangSelect(lang.locale, lang.value), selected: lang.locale === currentLocale, "data-testid": `lang-${lang.locale}` }, { children: lang.label }), lang.value))) }))] })), shouldShowCtaButton && (jsx(PurchaseButton, Object.assign({ onClick: handleCtaButtonClick, "data-testid": "header-cta-button" }, { children: formatMessage({ id: ctaText }) })))] })] }) })));
|
|
1225
1261
|
}
|
|
1226
1262
|
|
|
1227
1263
|
const StyledAppBar$1 = styled(AppBar)(({ theme, ispartnershippagemobileview, scrolled }) => {
|
|
@@ -1640,7 +1676,7 @@ function Header$1({ logo, navigationLinks, languages, currentLocale, userToken,
|
|
|
1640
1676
|
// Render new desktop layout when enabled and on actual desktop viewport
|
|
1641
1677
|
// Uses isActuallyDesktop to avoid SSR/prop issues with isMobile detection
|
|
1642
1678
|
if (useNewDesktopLayout && isActuallyDesktop) {
|
|
1643
|
-
return (jsx(DesktopHeaderMenuBar, { logo: logo, logoAlt: "Logo", menuItems: convertedDesktopMenuItems, showCtaButton: showCtaButton, ctaButtonText: ctaButtonText, onCtaClick: onCtaClick, ctaScrollTargetId: ctaScrollTargetId, onScrollToSection: onScrollToSection, onLogoClick: onLogoClick, formatMessage: formatMessage }));
|
|
1679
|
+
return (jsx(DesktopHeaderMenuBar, { logo: logo, logoAlt: "Logo", menuItems: convertedDesktopMenuItems, showCtaButton: showCtaButton, ctaButtonText: ctaButtonText, onCtaClick: onCtaClick, ctaScrollTargetId: ctaScrollTargetId, onScrollToSection: onScrollToSection, onLogoClick: onLogoClick, formatMessage: formatMessage, languages: languages, currentLocale: currentLocale, onLanguageChange: onLanguageChange }));
|
|
1644
1680
|
}
|
|
1645
1681
|
return (jsx(StyledAppBar$1, Object.assign({ ispartnershippagemobileview: isPartnershipPageMobileView, scrolled: scrolled }, { children: jsx(ResponsiveB2CLayout, { children: jsx(StyledContainer, Object.assign({ ispartnershippagemobileview: isPartnershipPageMobileView, scrolled: scrolled, maxWidth: "xl" }, { children: jsxs(Toolbar, Object.assign({ disableGutters: true }, { children: [jsx("a", Object.assign({ href: host || '#', onClick: (e) => {
|
|
1646
1682
|
e === null || e === void 0 ? void 0 : e.preventDefault();
|
|
@@ -2057,7 +2093,7 @@ function Footer({ simplifiedLayout = false, introText, addressText, socialLinks,
|
|
|
2057
2093
|
}), index === navigationLinks.length - 1 && (jsxs(Fragment, { children: [jsx(ButtonBottomLink, Object.assign({ onClick: onPrivacyPolicyClick }, { children: jsx(Typography, Object.assign({ variant: "body1" }, { children: jsx(AnchorLink, Object.assign({ href: `${host}/${currentLocale}/terms/privacypolicy`, onClick: (e) => e === null || e === void 0 ? void 0 : e.preventDefault() }, { children: formatMessage({ id: 'Privacy Policy' }) })) })) })), jsx(ButtonBottomLink, Object.assign({ onClick: onTermsOfServiceClick }, { children: jsx(Typography, Object.assign({ variant: "body1" }, { children: jsx(AnchorLink, Object.assign({ href: `${host}/${currentLocale}/terms/termsofservice`, onClick: (e) => e === null || e === void 0 ? void 0 : e.preventDefault() }, { children: formatMessage({ id: 'Terms of Service' }) })) })) })), jsx(DivSocial, { children: socialLinks.map((social) => (jsx(ButtonIcon, Object.assign({ onClick: () => onSocialClick === null || onSocialClick === void 0 ? void 0 : onSocialClick(social.platform, social.url), "aria-label": social.ariaLabel || social.platform }, { children: jsx(AnchorLink, Object.assign({ href: social.url, onClick: (e) => e === null || e === void 0 ? void 0 : e.preventDefault() }, { children: jsx("img", { src: social.icon, alt: social.platform, height: isMobile ? '24' : '28', width: isMobile ? '24' : '28', loading: "lazy" }) })) }), social.platform))) })] }))] }, index))) }))] })), isMobile && jsx(StyledDivider, {}), isMobile && (jsx(DivBottom, { children: jsxs(DivLinks, { children: [jsx("div", Object.assign({ onClick: onPrivacyPolicyClick, style: { cursor: 'pointer' } }, { children: jsx(Typography, Object.assign({ variant: "body2" }, { children: jsx(AnchorLink, Object.assign({ href: `${host}/${currentLocale}/terms/privacypolicy`, onClick: (e) => e === null || e === void 0 ? void 0 : e.preventDefault() }, { children: formatMessage({ id: 'Privacy Policy' }) })) })) })), jsx(DivSep, {}), jsx("div", Object.assign({ onClick: onTermsOfServiceClick, style: { cursor: 'pointer' } }, { children: jsx(Typography, Object.assign({ variant: "body2" }, { children: jsx(AnchorLink, Object.assign({ href: `${host}/${currentLocale}/terms/termsofservice`, onClick: (e) => e === null || e === void 0 ? void 0 : e.preventDefault() }, { children: formatMessage({ id: 'Terms of Service' }) })) })) }))] }) }))] }) }));
|
|
2058
2094
|
}
|
|
2059
2095
|
|
|
2060
|
-
const StyledDrawer$1 = styled(Drawer)(() => ({
|
|
2096
|
+
const StyledDrawer$1 = styled(Drawer)(({ theme }) => ({
|
|
2061
2097
|
zIndex: '1300 !important',
|
|
2062
2098
|
'& .MuiDrawer-root': {
|
|
2063
2099
|
zIndex: 1300,
|
|
@@ -2067,17 +2103,26 @@ const StyledDrawer$1 = styled(Drawer)(() => ({
|
|
|
2067
2103
|
boxSizing: 'border-box',
|
|
2068
2104
|
overflow: 'hidden',
|
|
2069
2105
|
zIndex: 1300,
|
|
2106
|
+
[theme.breakpoints.up('md')]: {
|
|
2107
|
+
maxWidth: '680px',
|
|
2108
|
+
margin: '0 auto',
|
|
2109
|
+
borderRadius: '16px',
|
|
2110
|
+
},
|
|
2070
2111
|
},
|
|
2071
2112
|
'& .MuiBackdrop-root': {
|
|
2072
2113
|
zIndex: 1299,
|
|
2073
2114
|
},
|
|
2074
2115
|
}));
|
|
2075
|
-
const DrawerHeader$1 = styled(Box)(() => ({
|
|
2116
|
+
const DrawerHeader$1 = styled(Box)(({ theme }) => ({
|
|
2076
2117
|
display: 'flex',
|
|
2077
2118
|
alignItems: 'center',
|
|
2078
|
-
justifyContent: 'flex-
|
|
2079
|
-
padding: '16px',
|
|
2080
|
-
minHeight: '
|
|
2119
|
+
justifyContent: 'flex-start',
|
|
2120
|
+
padding: '16px 24px',
|
|
2121
|
+
minHeight: '64px',
|
|
2122
|
+
[theme.breakpoints.down('md')]: {
|
|
2123
|
+
padding: '16px',
|
|
2124
|
+
minHeight: '56px',
|
|
2125
|
+
},
|
|
2081
2126
|
}));
|
|
2082
2127
|
const DrawerContent$1 = styled(Box)(() => ({
|
|
2083
2128
|
flex: 1,
|
|
@@ -2156,6 +2201,15 @@ const SecondaryButton = styled(Button$1)(() => ({
|
|
|
2156
2201
|
lineHeight: '18px',
|
|
2157
2202
|
wordSpacing: '-5px',
|
|
2158
2203
|
}));
|
|
2204
|
+
const BackArrowButton = styled(IconButton)(() => ({
|
|
2205
|
+
padding: 0,
|
|
2206
|
+
width: '32px',
|
|
2207
|
+
height: '32px',
|
|
2208
|
+
color: '#13131B',
|
|
2209
|
+
'& .MuiSvgIcon-root': {
|
|
2210
|
+
fontSize: '24px',
|
|
2211
|
+
},
|
|
2212
|
+
}));
|
|
2159
2213
|
|
|
2160
2214
|
/**
|
|
2161
2215
|
* RecommendationsDrawer - Mobile drawer for recommendations and forms
|
|
@@ -2211,7 +2265,7 @@ function RecommendationsDrawer({ open, onClose, children, headerIcon, title, sub
|
|
|
2211
2265
|
},
|
|
2212
2266
|
}, sx: {
|
|
2213
2267
|
zIndex: 1300,
|
|
2214
|
-
} }, { children: jsxs(Box, Object.assign({ sx: { display: 'flex', flexDirection: 'column', height: '100%' } }, { children: [jsx(DrawerHeader$1, { children: jsx(
|
|
2268
|
+
} }, { children: jsxs(Box, Object.assign({ sx: { display: 'flex', flexDirection: 'column', height: '100%' } }, { children: [jsx(DrawerHeader$1, { children: jsx(BackArrowButton, Object.assign({ onClick: handleBackOrClose, "aria-label": showBackButton ? 'back' : 'close' }, { children: showBackButton ? jsx(ArrowBackIcon, {}) : jsx(CloseIcon, {}) })) }), (title || subtitle || headerIcon) && (jsxs(HeaderSection, { children: [headerIcon && (jsx(CategoryIcon, { children: jsx("img", { src: headerIcon, alt: "Category icon", width: 32, height: 32 }) })), title && (jsx(TitleText, Object.assign({ variant: "h5" }, { children: formatMessage({ id: title }) }))), subtitle && (jsx(SubtitleText, Object.assign({ variant: "body2" }, { children: formatMessage({ id: subtitle }) })))] })), jsx(DrawerContent$1, { children: children }), showFooter && (jsx(DrawerFooter, { children: customFooter ? (customFooter) : (jsxs(FooterButtons, { children: [primaryButtonText && (jsx(PrimaryButton, Object.assign({ variant: "contained", fullWidth: true, onClick: onPrimaryAction, disabled: primaryButtonDisabled, sx: {
|
|
2215
2269
|
backgroundColor: primaryColor,
|
|
2216
2270
|
'&:hover': {
|
|
2217
2271
|
backgroundColor: primaryColor,
|
|
@@ -2273,12 +2327,25 @@ const DialogContent = styled$1(Box)(() => ({
|
|
|
2273
2327
|
overflowY: 'auto',
|
|
2274
2328
|
padding: '24px',
|
|
2275
2329
|
}));
|
|
2276
|
-
|
|
2330
|
+
/** Product grid for dialog - matches featured-form-section ProductGrid from life-landing-page */
|
|
2331
|
+
const DialogProductsGrid = styled$1(Box, {
|
|
2332
|
+
shouldForwardProp: (prop) => prop !== 'productCount',
|
|
2333
|
+
})(({ theme, productCount = 1 }) => ({
|
|
2277
2334
|
display: 'grid',
|
|
2278
2335
|
gridTemplateColumns: 'repeat(2, 1fr)',
|
|
2279
|
-
gap: '
|
|
2336
|
+
gap: '12px',
|
|
2337
|
+
width: '100%',
|
|
2338
|
+
maxWidth: '744px',
|
|
2339
|
+
[theme.breakpoints.up('md')]: Object.assign(Object.assign({}, (productCount >= 2
|
|
2340
|
+
? {
|
|
2341
|
+
gridTemplateColumns: `repeat(${productCount}, 158px)`,
|
|
2342
|
+
justifyContent: 'left',
|
|
2343
|
+
}
|
|
2344
|
+
: {
|
|
2345
|
+
gridTemplateColumns: '1fr',
|
|
2346
|
+
})), { gap: '12px' }),
|
|
2280
2347
|
}));
|
|
2281
|
-
|
|
2348
|
+
styled$1(Box)(() => ({
|
|
2282
2349
|
border: '1px solid #E0E0E0',
|
|
2283
2350
|
borderRadius: '0px',
|
|
2284
2351
|
padding: '16px',
|
|
@@ -2287,13 +2354,13 @@ const DialogProductCard = styled$1(Box)(() => ({
|
|
|
2287
2354
|
alignItems: 'center',
|
|
2288
2355
|
gap: '16px',
|
|
2289
2356
|
}));
|
|
2290
|
-
|
|
2357
|
+
styled$1(Box)(() => ({
|
|
2291
2358
|
height: '32px',
|
|
2292
2359
|
display: 'flex',
|
|
2293
2360
|
alignItems: 'center',
|
|
2294
2361
|
justifyContent: 'center',
|
|
2295
2362
|
}));
|
|
2296
|
-
|
|
2363
|
+
styled$1(Typography)(() => ({
|
|
2297
2364
|
fontFamily: 'Montserrat, sans-serif',
|
|
2298
2365
|
fontSize: '16px',
|
|
2299
2366
|
fontWeight: 600,
|
|
@@ -2302,7 +2369,7 @@ const DialogProductName = styled$1(Typography)(() => ({
|
|
|
2302
2369
|
textAlign: 'center',
|
|
2303
2370
|
wordSpacing: '0px',
|
|
2304
2371
|
}));
|
|
2305
|
-
|
|
2372
|
+
styled$1(Typography)(() => ({
|
|
2306
2373
|
fontFamily: 'Montserrat, sans-serif',
|
|
2307
2374
|
fontSize: '14px',
|
|
2308
2375
|
fontWeight: 400,
|
|
@@ -2355,45 +2422,120 @@ const ProductsContainer = styled$1(Box)({
|
|
|
2355
2422
|
padding: '16px',
|
|
2356
2423
|
backgroundColor: '#ffffff',
|
|
2357
2424
|
});
|
|
2358
|
-
|
|
2425
|
+
/** Product grid - matches featured-form-section ProductGrid from life-landing-page */
|
|
2426
|
+
const ProductsGrid = styled$1(Box, {
|
|
2427
|
+
shouldForwardProp: (prop) => prop !== 'productCount',
|
|
2428
|
+
})(({ theme, productCount = 1 }) => ({
|
|
2359
2429
|
display: 'grid',
|
|
2360
2430
|
gridTemplateColumns: 'repeat(2, 1fr)',
|
|
2361
2431
|
gap: '12px',
|
|
2362
|
-
|
|
2363
|
-
|
|
2432
|
+
width: '100%',
|
|
2433
|
+
maxWidth: '744px',
|
|
2434
|
+
[theme.breakpoints.up('md')]: Object.assign(Object.assign({}, (productCount >= 2
|
|
2435
|
+
? {
|
|
2436
|
+
gridTemplateColumns: `repeat(${productCount}, 158px)`,
|
|
2437
|
+
justifyContent: 'left',
|
|
2438
|
+
}
|
|
2439
|
+
: {
|
|
2440
|
+
gridTemplateColumns: '1fr',
|
|
2441
|
+
})), { gap: '12px' }),
|
|
2442
|
+
}));
|
|
2443
|
+
/** Category label above the product card (e.g., "Medical", "Critical Illness") */
|
|
2444
|
+
const ProductCategoryLabel = styled$1(Typography)(() => ({
|
|
2445
|
+
fontFamily: '"MetLifeCircular", "Montserrat", sans-serif',
|
|
2446
|
+
fontWeight: 500,
|
|
2447
|
+
fontSize: '12px',
|
|
2448
|
+
lineHeight: '16px',
|
|
2449
|
+
color: '#5f5e62',
|
|
2450
|
+
letterSpacing: '0px',
|
|
2451
|
+
}));
|
|
2452
|
+
/** Product card wrapper: includes category label + card */
|
|
2453
|
+
const ProductCardWrapper = styled$1(Box)(() => ({
|
|
2364
2454
|
display: 'flex',
|
|
2365
2455
|
flexDirection: 'column',
|
|
2366
|
-
gap: '
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2456
|
+
gap: '4px',
|
|
2457
|
+
alignItems: 'flex-start',
|
|
2458
|
+
}));
|
|
2459
|
+
/** Product card - square, clickable, matches featured-form-section design */
|
|
2460
|
+
const ProductCard$1 = styled$1(Box)(() => ({
|
|
2461
|
+
position: 'relative',
|
|
2462
|
+
width: '100%',
|
|
2463
|
+
aspectRatio: '1 / 1',
|
|
2464
|
+
border: '1px solid #0090da',
|
|
2465
|
+
borderRadius: '0px',
|
|
2374
2466
|
display: 'flex',
|
|
2375
2467
|
flexDirection: 'column',
|
|
2376
|
-
|
|
2468
|
+
justifyContent: 'flex-end',
|
|
2469
|
+
cursor: 'pointer',
|
|
2470
|
+
overflow: 'clip',
|
|
2471
|
+
transition: 'border 0.2s ease, box-shadow 0.2s ease',
|
|
2472
|
+
'&:hover': {
|
|
2473
|
+
borderWidth: '2px',
|
|
2474
|
+
boxShadow: '0 4px 12px rgba(0, 0, 0, 0.15)',
|
|
2475
|
+
},
|
|
2476
|
+
'&:focus': {
|
|
2477
|
+
outline: '2px solid #ffffff',
|
|
2478
|
+
outlineOffset: '2px',
|
|
2479
|
+
},
|
|
2480
|
+
'@media (min-width: 900px)': {
|
|
2481
|
+
width: '158px',
|
|
2482
|
+
height: '158px',
|
|
2483
|
+
},
|
|
2484
|
+
}));
|
|
2485
|
+
/** Background image that fills the product card */
|
|
2486
|
+
const ProductCardImage = styled$1('img')(() => ({
|
|
2487
|
+
position: 'absolute',
|
|
2488
|
+
inset: 0,
|
|
2489
|
+
width: '100%',
|
|
2490
|
+
height: '100%',
|
|
2491
|
+
objectFit: 'cover',
|
|
2492
|
+
pointerEvents: 'none',
|
|
2493
|
+
}));
|
|
2494
|
+
/** Placeholder gradient when no card image is provided */
|
|
2495
|
+
const ProductCardPlaceholder = styled$1(Box)(() => ({
|
|
2496
|
+
position: 'absolute',
|
|
2497
|
+
inset: 0,
|
|
2498
|
+
background: 'linear-gradient(135deg, #e8f4fd 0%, #b8dff5 100%)',
|
|
2499
|
+
pointerEvents: 'none',
|
|
2500
|
+
}));
|
|
2501
|
+
/** White bottom bar with logo + product name */
|
|
2502
|
+
const ProductCardBottomBar = styled$1(Box)(() => ({
|
|
2503
|
+
position: 'relative',
|
|
2504
|
+
display: 'flex',
|
|
2377
2505
|
alignItems: 'center',
|
|
2378
2506
|
justifyContent: 'center',
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2507
|
+
gap: '4px',
|
|
2508
|
+
height: '32px',
|
|
2509
|
+
width: '100%',
|
|
2510
|
+
flexShrink: 0,
|
|
2511
|
+
backgroundColor: '#ffffff',
|
|
2512
|
+
}));
|
|
2513
|
+
/** Icon inside the bottom bar */
|
|
2514
|
+
const ProductIcon = styled$1(Box)(() => ({
|
|
2382
2515
|
display: 'flex',
|
|
2383
2516
|
alignItems: 'center',
|
|
2384
2517
|
justifyContent: 'center',
|
|
2385
|
-
|
|
2386
|
-
|
|
2518
|
+
flexShrink: 0,
|
|
2519
|
+
height: '11px',
|
|
2520
|
+
width: '40.7px',
|
|
2521
|
+
'& img': {
|
|
2522
|
+
width: '100%',
|
|
2523
|
+
height: '100%',
|
|
2524
|
+
objectFit: 'contain',
|
|
2525
|
+
},
|
|
2526
|
+
}));
|
|
2387
2527
|
const ProductName$1 = styled$1(Typography)({
|
|
2388
|
-
fontFamily: 'Montserrat, sans-serif',
|
|
2389
|
-
fontSize: '14px',
|
|
2528
|
+
fontFamily: '"MetLifeCircular", "Montserrat", sans-serif',
|
|
2390
2529
|
fontWeight: 700,
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
color: '#
|
|
2530
|
+
fontSize: '14px',
|
|
2531
|
+
lineHeight: '20px',
|
|
2532
|
+
color: '#75787b',
|
|
2394
2533
|
textAlign: 'center',
|
|
2534
|
+
letterSpacing: '0px',
|
|
2535
|
+
whiteSpace: 'nowrap',
|
|
2395
2536
|
});
|
|
2396
|
-
|
|
2537
|
+
/** @deprecated Use ProductCategoryLabel - kept for Dialog variant */
|
|
2538
|
+
styled$1(Typography)({
|
|
2397
2539
|
fontFamily: 'Montserrat, sans-serif',
|
|
2398
2540
|
fontSize: '12px',
|
|
2399
2541
|
fontWeight: 400,
|
|
@@ -2402,68 +2544,62 @@ const ProductType = styled$1(Typography)({
|
|
|
2402
2544
|
color: '#13131b',
|
|
2403
2545
|
textAlign: 'center',
|
|
2404
2546
|
});
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2547
|
+
/** @deprecated Use new ProductCard - kept for Dialog variant */
|
|
2548
|
+
styled$1(Box)({
|
|
2549
|
+
display: 'flex',
|
|
2550
|
+
flexDirection: 'column',
|
|
2551
|
+
gap: '6px',
|
|
2552
|
+
alignItems: 'center',
|
|
2553
|
+
justifyContent: 'center',
|
|
2554
|
+
flex: 1,
|
|
2555
|
+
});
|
|
2556
|
+
/** @deprecated Use ProductIcon - kept for Dialog variant */
|
|
2557
|
+
styled$1(Box)({
|
|
2558
|
+
display: 'flex',
|
|
2559
|
+
alignItems: 'center',
|
|
2560
|
+
justifyContent: 'center',
|
|
2561
|
+
padding: '4px',
|
|
2415
2562
|
});
|
|
2416
2563
|
|
|
2417
2564
|
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', }) {
|
|
2418
|
-
var _a, _b, _c, _d, _e, _f;
|
|
2419
|
-
const tenantTheme = useTenantTheme();
|
|
2420
|
-
// Get primary color from tenant theme, fallback to default
|
|
2421
|
-
const primaryColor = ((_c = (_b = (_a = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme) === null || _a === void 0 ? void 0 : _a.palette) === null || _b === void 0 ? void 0 : _b.primary) === null || _c === void 0 ? void 0 : _c.main) || '#0090DA';
|
|
2422
|
-
const primaryDark = ((_f = (_e = (_d = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme) === null || _d === void 0 ? void 0 : _d.palette) === null || _e === void 0 ? void 0 : _e.primary) === null || _f === void 0 ? void 0 : _f.dark) || '#007bb8';
|
|
2423
|
-
const primaryDarker = '#006699'; // Active state
|
|
2424
2565
|
// Desktop Dialog variant
|
|
2425
2566
|
if (variant === 'dialog') {
|
|
2426
2567
|
return (jsxs(StyledDialog, Object.assign({ open: open, onClose: onClose, maxWidth: "md", fullWidth: true }, { children: [jsxs(DialogHeader, { children: [jsx(IconButton, Object.assign({ onClick: onClose, sx: {
|
|
2427
2568
|
position: 'absolute',
|
|
2428
2569
|
right: 16,
|
|
2429
2570
|
top: 16,
|
|
2430
|
-
} }, { children: jsx(CloseIcon, {}) })), jsx(DialogHeaderTitle, { children: title }), jsx(DialogHeaderSubtitle, { children: subtitle })] }), jsx(DialogContent, { children: jsx(DialogProductsGrid, {
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
'&:active': {
|
|
2440
|
-
backgroundColor: primaryDarker,
|
|
2441
|
-
},
|
|
2442
|
-
} }, { children: viewPlansButtonText }))] }, product.id))) }) })] })));
|
|
2571
|
+
} }, { children: jsx(CloseIcon, {}) })), jsx(DialogHeaderTitle, { children: title }), jsx(DialogHeaderSubtitle, { children: subtitle })] }), jsx(DialogContent, { children: jsx(DialogProductsGrid, Object.assign({ productCount: products.length }, { children: products.map((product) => {
|
|
2572
|
+
var _a, _b;
|
|
2573
|
+
return (jsxs(ProductCardWrapper, { children: [jsx(ProductCategoryLabel, { children: (_a = product.subtitle) !== null && _a !== void 0 ? _a : product.type }), jsxs(ProductCard$1, Object.assign({ onClick: () => onProductSelect(product.id), role: "button", tabIndex: 0, onKeyDown: (e) => {
|
|
2574
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
2575
|
+
e.preventDefault();
|
|
2576
|
+
onProductSelect(product.id);
|
|
2577
|
+
}
|
|
2578
|
+
} }, { children: [product.cardImage ? (jsx(ProductCardImage, { src: product.cardImage, alt: product.name })) : (jsx(ProductCardPlaceholder, {})), jsxs(ProductCardBottomBar, { children: [jsx(ProductIcon, { children: jsx("img", { src: (_b = product.icon) !== null && _b !== void 0 ? _b : product.logo, alt: "" }) }), jsx(ProductName$1, { children: product.name })] })] }))] }, product.id));
|
|
2579
|
+
}) })) })] })));
|
|
2443
2580
|
}
|
|
2444
2581
|
// Mobile Drawer variant (default)
|
|
2445
|
-
return (jsx(StyledDrawer, Object.assign({ anchor: "bottom", open: open, onClose: onClose }, { children: jsxs(DrawerContent, { children: [jsx(DrawerHeader, { children: jsx(CloseButtonContainer, { children: jsx(IconButton, Object.assign({ onClick: onClose, sx: { padding: 0 } }, { children: jsx(CloseIcon, { sx: { fontSize: 24, color: '#13131b' } }) })) }) }), jsxs(Header, { children: [jsx(HeaderTitle, { children: title }), jsx(HeaderSubtitle, { children: subtitle })] }), jsx(ProductsContainer, { children: jsx(ProductsGrid, {
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
'&:active': {
|
|
2455
|
-
backgroundColor: primaryDarker,
|
|
2456
|
-
},
|
|
2457
|
-
} }, { children: viewPlansButtonText }))] }, product.id))) }) })] }) })));
|
|
2582
|
+
return (jsx(StyledDrawer, Object.assign({ anchor: "bottom", open: open, onClose: onClose }, { children: jsxs(DrawerContent, { children: [jsx(DrawerHeader, { children: jsx(CloseButtonContainer, { children: jsx(IconButton, Object.assign({ onClick: onClose, sx: { padding: 0 } }, { children: jsx(CloseIcon, { sx: { fontSize: 24, color: '#13131b' } }) })) }) }), jsxs(Header, { children: [jsx(HeaderTitle, { children: title }), jsx(HeaderSubtitle, { children: subtitle })] }), jsx(ProductsContainer, { children: jsx(ProductsGrid, Object.assign({ productCount: products.length }, { children: products.map((product) => {
|
|
2583
|
+
var _a, _b;
|
|
2584
|
+
return (jsxs(ProductCardWrapper, { children: [jsx(ProductCategoryLabel, { children: (_a = product.subtitle) !== null && _a !== void 0 ? _a : product.type }), jsxs(ProductCard$1, Object.assign({ onClick: () => onProductSelect(product.id), role: "button", tabIndex: 0, onKeyDown: (e) => {
|
|
2585
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
2586
|
+
e.preventDefault();
|
|
2587
|
+
onProductSelect(product.id);
|
|
2588
|
+
}
|
|
2589
|
+
} }, { children: [product.cardImage ? (jsx(ProductCardImage, { src: product.cardImage, alt: product.name })) : (jsx(ProductCardPlaceholder, {})), jsxs(ProductCardBottomBar, { children: [jsx(ProductIcon, { children: jsx("img", { src: (_b = product.icon) !== null && _b !== void 0 ? _b : product.logo, alt: "" }) }), jsx(ProductName$1, { children: product.name })] })] }))] }, product.id));
|
|
2590
|
+
}) })) })] }) })));
|
|
2458
2591
|
}
|
|
2459
2592
|
|
|
2460
|
-
const QuestionContainer$1 = styled(Box)(() => ({
|
|
2593
|
+
const QuestionContainer$1 = styled(Box)(({ theme }) => ({
|
|
2461
2594
|
backgroundColor: '#FFFFFF',
|
|
2462
|
-
padding: '12px
|
|
2595
|
+
padding: '12px 0px',
|
|
2463
2596
|
display: 'flex',
|
|
2464
2597
|
flexDirection: 'column',
|
|
2465
2598
|
gap: '16px',
|
|
2466
2599
|
width: '100%',
|
|
2600
|
+
[theme.breakpoints.down('md')]: {
|
|
2601
|
+
padding: '8px 12px',
|
|
2602
|
+
},
|
|
2467
2603
|
}));
|
|
2468
2604
|
const QuestionHeader = styled(Box)(() => ({
|
|
2469
2605
|
display: 'flex',
|
|
@@ -2554,6 +2690,14 @@ const variantColors = {
|
|
|
2554
2690
|
hoverBg: 'rgba(0, 0, 0, 0.02)',
|
|
2555
2691
|
hoverBorder: '#5f5e62',
|
|
2556
2692
|
},
|
|
2693
|
+
formLightBorder: {
|
|
2694
|
+
unselectedBorder: '#E0E0E0',
|
|
2695
|
+
unselectedText: '#5f5e62',
|
|
2696
|
+
unselectedBg: 'transparent',
|
|
2697
|
+
selectedBg: 'rgba(61, 147, 222, 0.1)',
|
|
2698
|
+
hoverBg: 'rgba(0, 0, 0, 0.02)',
|
|
2699
|
+
hoverBorder: '#D0D0D0',
|
|
2700
|
+
},
|
|
2557
2701
|
};
|
|
2558
2702
|
const StyledOptionButton = styled(ButtonBase, {
|
|
2559
2703
|
shouldForwardProp: (prop) => prop !== 'colorVariant',
|
|
@@ -2877,16 +3021,16 @@ function BillingToggle({ value, onChange, formatMessage = (descriptor) => descri
|
|
|
2877
3021
|
? toggleActiveTextColor
|
|
2878
3022
|
: toggleInactiveTextColor,
|
|
2879
3023
|
} }, { children: jsx(ToggleText, { children: formatMessage({
|
|
2880
|
-
id: 'Billed
|
|
2881
|
-
defaultMessage: 'Billed
|
|
3024
|
+
id: 'Billed Monthly',
|
|
3025
|
+
defaultMessage: 'Billed Monthly',
|
|
2882
3026
|
}) }) })), jsx(ToggleButton, Object.assign({ active: value === 'annually', onClick: () => onChange('annually'), sx: {
|
|
2883
3027
|
backgroundColor: value === 'annually' ? toggleActiveColor : 'transparent',
|
|
2884
3028
|
color: value === 'annually'
|
|
2885
3029
|
? toggleActiveTextColor
|
|
2886
3030
|
: toggleInactiveTextColor,
|
|
2887
3031
|
} }, { children: jsx(ToggleText, { children: formatMessage({
|
|
2888
|
-
id: 'Billed
|
|
2889
|
-
defaultMessage: 'Billed
|
|
3032
|
+
id: 'Billed Annually',
|
|
3033
|
+
defaultMessage: 'Billed Annually',
|
|
2890
3034
|
}) }) }))] })));
|
|
2891
3035
|
}
|
|
2892
3036
|
|
|
@@ -3434,6 +3578,15 @@ const CheckoutHeader = ({ progress, product, sectionTitle, sectionDescription, s
|
|
|
3434
3578
|
return (jsxs(HeaderContainer, Object.assign({ sticky: sticky, sx: sx }, { children: [jsx(CheckoutProgress, Object.assign({}, progress, { progressBarTheme: progressBarTheme })), product && (jsx(Box, Object.assign({ sx: { padding: '0 16px 24px' } }, { children: jsx(ProductCard, Object.assign({}, product)) }))), jsxs(SectionHeader, { children: [jsx(SectionTitle$2, { children: sectionTitle }), jsx(SectionDescription, { children: sectionDescription })] })] })));
|
|
3435
3579
|
};
|
|
3436
3580
|
|
|
3581
|
+
/**
|
|
3582
|
+
* Checkout Form Button - styled components
|
|
3583
|
+
* Aligns with Figma button design system (node 133-11111)
|
|
3584
|
+
*
|
|
3585
|
+
* Filled button tokens:
|
|
3586
|
+
* - Default: #0090da bg, #ffffff text
|
|
3587
|
+
* - Hover: #007AC1
|
|
3588
|
+
* - Disabled: #f2f2f2 bg, #75787b text, 1px solid #a7a8aa
|
|
3589
|
+
*/
|
|
3437
3590
|
const ButtonContainer = styled(Box)(({ isFixed, desktopRightAligned }) => ({
|
|
3438
3591
|
position: isFixed ? 'fixed' : 'relative',
|
|
3439
3592
|
bottom: 0,
|
|
@@ -3443,39 +3596,45 @@ const ButtonContainer = styled(Box)(({ isFixed, desktopRightAligned }) => ({
|
|
|
3443
3596
|
padding: '16px',
|
|
3444
3597
|
boxShadow: isFixed ? '0px 2px 10px 0px rgba(0, 0, 0, 0.12)' : 'none',
|
|
3445
3598
|
zIndex: 999,
|
|
3446
|
-
// Desktop styles for
|
|
3447
|
-
'@media (min-width: 900px)':
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
}
|
|
3458
|
-
: {},
|
|
3599
|
+
// Desktop styles for button alignment
|
|
3600
|
+
'@media (min-width: 900px)': {
|
|
3601
|
+
display: 'flex',
|
|
3602
|
+
justifyContent: desktopRightAligned ? 'flex-end' : 'center',
|
|
3603
|
+
maxWidth: '938px',
|
|
3604
|
+
margin: '0 auto',
|
|
3605
|
+
padding: '24px 0',
|
|
3606
|
+
backgroundColor: 'transparent',
|
|
3607
|
+
boxShadow: 'none',
|
|
3608
|
+
position: 'relative',
|
|
3609
|
+
},
|
|
3459
3610
|
}));
|
|
3460
3611
|
const StyledButton = styled('button')(({ isDisabled, desktopWidth }) => ({
|
|
3461
3612
|
width: '100%',
|
|
3462
|
-
|
|
3463
|
-
|
|
3613
|
+
minHeight: '48px',
|
|
3614
|
+
padding: '14px 32px',
|
|
3615
|
+
borderRadius: '100px',
|
|
3464
3616
|
border: 'none',
|
|
3465
|
-
backgroundColor: isDisabled
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
fontSize: '14px',
|
|
3617
|
+
backgroundColor: isDisabled ? '#f2f2f2' : '#0090da',
|
|
3618
|
+
color: isDisabled ? '#75787b' : '#ffffff',
|
|
3619
|
+
fontFamily: '"MetLifeCircular", "Roboto", "Helvetica", "Arial", sans-serif',
|
|
3620
|
+
fontSize: '16px',
|
|
3470
3621
|
fontWeight: 500,
|
|
3471
|
-
lineHeight: '
|
|
3622
|
+
lineHeight: '20px',
|
|
3623
|
+
letterSpacing: 0,
|
|
3624
|
+
textTransform: 'none',
|
|
3472
3625
|
wordSpacing: '0px',
|
|
3473
3626
|
cursor: isDisabled ? 'not-allowed' : 'pointer',
|
|
3474
|
-
transition: 'all 0.2s ease',
|
|
3627
|
+
transition: 'all 0.2s ease-in-out',
|
|
3628
|
+
boxSizing: 'border-box',
|
|
3475
3629
|
'&:hover': {
|
|
3476
|
-
backgroundColor: isDisabled
|
|
3477
|
-
|
|
3478
|
-
|
|
3630
|
+
backgroundColor: isDisabled ? '#f2f2f2' : 'rgba(0, 144, 218, 0.7)',
|
|
3631
|
+
},
|
|
3632
|
+
'&:focus': {
|
|
3633
|
+
outline: isDisabled ? 'none' : '2px solid #0090da',
|
|
3634
|
+
outlineOffset: '2px',
|
|
3635
|
+
},
|
|
3636
|
+
'&:active': {
|
|
3637
|
+
backgroundColor: isDisabled ? '#f2f2f2' : 'rgba(0, 144, 218, 0.7)',
|
|
3479
3638
|
},
|
|
3480
3639
|
// Desktop styles for fixed width button
|
|
3481
3640
|
'@media (min-width: 900px)': desktopWidth
|
|
@@ -3487,7 +3646,7 @@ const StyledButton = styled('button')(({ isDisabled, desktopWidth }) => ({
|
|
|
3487
3646
|
}));
|
|
3488
3647
|
|
|
3489
3648
|
const CheckoutFormButton = ({ text = 'Next', disabled = false, onClick, fixed = true, type = 'button', sx, loading = false, desktopRightAligned = false, desktopWidth = '180px', }) => {
|
|
3490
|
-
return (jsx(ButtonContainer, Object.assign({ isFixed: fixed, desktopRightAligned: desktopRightAligned, sx: sx }, { children: jsx(StyledButton, Object.assign({ type: type, disabled: disabled || loading, isDisabled: disabled || loading, desktopWidth:
|
|
3649
|
+
return (jsx(ButtonContainer, Object.assign({ isFixed: fixed, desktopRightAligned: desktopRightAligned, sx: sx }, { children: jsx(StyledButton, Object.assign({ type: type, disabled: disabled || loading, isDisabled: disabled || loading, desktopWidth: desktopWidth, onClick: onClick }, { children: loading ? 'Processing...' : text })) })));
|
|
3491
3650
|
};
|
|
3492
3651
|
|
|
3493
3652
|
const QuestionContainer = styled(Box)({
|
|
@@ -3614,7 +3773,7 @@ const PersonalInformationForm = ({ renderField, fields, consents, onSubmit, form
|
|
|
3614
3773
|
color: '#5F5E62',
|
|
3615
3774
|
fontSize: '12px',
|
|
3616
3775
|
wordSpacing: '-5px',
|
|
3617
|
-
} }, { children: fields.full_name.helperText })))] }), renderField(fields.nric), renderField(fields.date_of_birth), renderField(fields.gender), renderField(fields.salutation), renderField(fields.nationality), renderField(fields.occupation), renderField(fields.industry), renderField(fields.crediting_bank_name), renderField(fields.crediting_bank_account_number), desktopGridLayout ? (jsx(FullWidthField$1, { children: jsxs(CheckboxContainer$1, { children: [jsx(FormControlLabel, { control: jsx(Checkbox, { checked: consents.bank_account_confirmation.checked, onChange: (e) => consents.bank_account_confirmation.onChange(e.target.checked), name: "bank_account_confirmation" }), label: jsx(CheckboxLabel$1, { children: consents.bank_account_confirmation.label ||
|
|
3776
|
+
} }, { children: fields.full_name.helperText })))] }), renderField(fields.nric), renderField(fields.date_of_birth), renderField(fields.gender), renderField(fields.salutation), renderField(fields.nationality), fields.place_of_birth && renderField(fields.place_of_birth), fields.marital_status && renderField(fields.marital_status), fields.race && renderField(fields.race), fields.religion && renderField(fields.religion), renderField(fields.occupation), renderField(fields.industry), renderField(fields.crediting_bank_name), renderField(fields.crediting_bank_account_number), fields.annual_income && renderField(fields.annual_income), desktopGridLayout ? (jsx(FullWidthField$1, { children: jsxs(CheckboxContainer$1, { children: [jsx(FormControlLabel, { control: jsx(Checkbox, { checked: consents.bank_account_confirmation.checked, onChange: (e) => consents.bank_account_confirmation.onChange(e.target.checked), name: "bank_account_confirmation" }), label: jsx(CheckboxLabel$1, { children: consents.bank_account_confirmation.label ||
|
|
3618
3777
|
defaultBankConfirmationLabel }) }), consents.bank_account_confirmation.error && (jsx(Typography, Object.assign({ sx: {
|
|
3619
3778
|
color: 'error.main',
|
|
3620
3779
|
fontSize: '12px',
|
|
@@ -3697,8 +3856,10 @@ const SectionTitle$1 = styled(Typography)({
|
|
|
3697
3856
|
wordSpacing: '-5px',
|
|
3698
3857
|
});
|
|
3699
3858
|
|
|
3700
|
-
const ContactDetailsForm = ({ renderField, fields, mailingFields, mailingAddressSame, onSubmit, formRef, sx, desktopGridLayout = false, }) => {
|
|
3859
|
+
const ContactDetailsForm = ({ renderField, fields, isForChild = false, mailingFields, mailingAddressSame, childContactFields, childContactNotSame, onSubmit, formRef, sx, desktopGridLayout = false, }) => {
|
|
3701
3860
|
const defaultMailingLabel = 'My mailing address is not the same as residential';
|
|
3861
|
+
const defaultChildContactLabel = 'My child contact details is not the same as residential';
|
|
3862
|
+
const childContactHelperText = 'Tick this box if the child has a different address, phone number, or email';
|
|
3702
3863
|
const Container = desktopGridLayout ? DesktopFormContainer$2 : FormContainer$2;
|
|
3703
3864
|
// Helper to render field with or without full width wrapper
|
|
3704
3865
|
const renderFieldWithLayout = (field, fullWidth = false) => {
|
|
@@ -3720,18 +3881,28 @@ const ContactDetailsForm = ({ renderField, fields, mailingFields, mailingAddress
|
|
|
3720
3881
|
}
|
|
3721
3882
|
return content;
|
|
3722
3883
|
};
|
|
3723
|
-
return (jsx(Container, Object.assign({ ref: formRef, component: "form", onSubmit: onSubmit, sx: sx }, { children: desktopGridLayout ? (jsxs(FieldsGridContainer$1, { children: [renderFieldWithHelperText(fields.phone_number, false), renderFieldWithLayout(fields.email_address, false), jsx(FullWidthField, { children: jsx(Divider, { sx: { borderColor: 'rgba(0,0,0,0.1)' } }) }), jsx(FullWidthField, { children: jsx(SectionTitle$1, { children: "Residential address" }) }), renderFieldWithHelperText(fields.residential_address_line1, false), renderFieldWithHelperText(fields.residential_address_line2, false), renderField(fields.postal_code), renderField(fields.city), renderField(fields.state), jsx(FullWidthField, { children: jsx(Divider, { sx: { borderColor: 'rgba(0,0,0,0.1)' } }) }), (
|
|
3884
|
+
return (jsx(Container, Object.assign({ ref: formRef, component: "form", onSubmit: onSubmit, sx: sx }, { children: desktopGridLayout ? (jsxs(FieldsGridContainer$1, { children: [isForChild && (jsx(FullWidthField, { children: jsx(SectionTitle$1, { children: "Policyowner contact details" }) })), renderFieldWithHelperText(fields.phone_number, false), renderFieldWithLayout(fields.email_address, false), ((mailingAddressSame === null || mailingAddressSame === void 0 ? void 0 : mailingAddressSame.checked) && !isForChild) && (jsxs(Fragment, { children: [jsx(FullWidthField, { children: jsx(Divider, { sx: { borderColor: 'rgba(0,0,0,0.1)' } }) }), jsx(FullWidthField, { children: jsx(SectionTitle$1, { children: "Residential address" }) })] })), renderFieldWithHelperText(fields.residential_address_line1, false), renderFieldWithHelperText(fields.residential_address_line2, false), fields.country && renderField(fields.country), renderField(fields.postal_code), renderField(fields.city), renderField(fields.state), (mailingAddressSame === null || mailingAddressSame === void 0 ? void 0 : mailingAddressSame.checked) && mailingFields && (jsxs(Fragment, { children: [jsx(FullWidthField, { children: jsx(Divider, { sx: { borderColor: 'rgba(0,0,0,0.1)' } }) }), jsx(FullWidthField, { children: jsx(SectionTitle$1, { children: isForChild ? 'Policyowner mailing address' : 'Mailing address' }) }), isForChild && mailingFields.mailing_phone_number && (renderFieldWithHelperText(mailingFields.mailing_phone_number, false)), isForChild && mailingFields.mailing_email_address && (renderFieldWithLayout(mailingFields.mailing_email_address, false)), renderFieldWithHelperText(mailingFields.mailing_address_line1, false), renderFieldWithHelperText(mailingFields.mailing_address_line2, false), mailingFields.mailing_country && renderField(mailingFields.mailing_country), renderField(mailingFields.mailing_postal_code), renderField(mailingFields.mailing_city), renderField(mailingFields.mailing_state)] })), (childContactNotSame === null || childContactNotSame === void 0 ? void 0 : childContactNotSame.checked) && childContactFields && (jsxs(Fragment, { children: [jsx(FullWidthField, { children: jsx(Divider, { sx: { borderColor: 'rgba(0,0,0,0.1)' } }) }), jsx(FullWidthField, { children: jsx(SectionTitle$1, { children: "Child's contact details" }) }), renderFieldWithHelperText(childContactFields.child_phone_number, false), renderFieldWithLayout(childContactFields.child_email_address, false), renderFieldWithHelperText(childContactFields.child_address_line1, false), renderFieldWithHelperText(childContactFields.child_address_line2, false), renderField(childContactFields.child_postal_code), childContactFields.child_country && renderField(childContactFields.child_country), renderField(childContactFields.child_city), renderField(childContactFields.child_state)] })), mailingAddressSame && (jsx(FullWidthField, { children: jsx(CheckboxContainer, { children: jsx(FormControlLabel, { control: jsx(Checkbox, { checked: mailingAddressSame.checked, onChange: (e) => mailingAddressSame.onChange(e.target.checked), name: "mailing_not_same_as_residential", sx: {
|
|
3724
3885
|
color: '#929094',
|
|
3725
3886
|
'&.Mui-checked': {
|
|
3726
3887
|
color: '#317abc',
|
|
3727
3888
|
},
|
|
3728
|
-
} }), label: jsx(CheckboxLabel, { children: mailingAddressSame.label || defaultMailingLabel }) }) }) }))
|
|
3889
|
+
} }), label: jsx(CheckboxLabel, { children: mailingAddressSame.label || defaultMailingLabel }) }) }) })), childContactNotSame && (jsx(FullWidthField, { children: jsx(CheckboxContainer, { children: jsx(FormControlLabel, { control: jsx(Checkbox, { checked: childContactNotSame.checked, onChange: (e) => childContactNotSame.onChange(e.target.checked), name: "child_contact_not_same", sx: {
|
|
3890
|
+
color: '#929094',
|
|
3891
|
+
'&.Mui-checked': {
|
|
3892
|
+
color: '#317abc',
|
|
3893
|
+
},
|
|
3894
|
+
} }), label: jsxs(Box, { children: [jsx(CheckboxLabel, { children: childContactNotSame.label || defaultChildContactLabel }), jsx(Box, Object.assign({ component: "span", sx: {
|
|
3895
|
+
display: 'block',
|
|
3896
|
+
fontSize: '12px',
|
|
3897
|
+
color: '#5F5E62',
|
|
3898
|
+
mt: 0.5,
|
|
3899
|
+
} }, { children: childContactHelperText }))] }) }) }) }))] })) : (jsxs(Box, Object.assign({ sx: { display: 'flex', flexDirection: 'column', gap: '24px' } }, { children: [isForChild && (jsx(SectionTitle$1, { children: "Policyowner contact details" })), jsxs(Box, { children: [renderField(fields.phone_number), fields.phone_number.helperText && (jsx(Box, Object.assign({ component: "span", sx: {
|
|
3729
3900
|
display: 'block',
|
|
3730
3901
|
mt: 0.5,
|
|
3731
3902
|
ml: 2,
|
|
3732
3903
|
color: '#5F5E62',
|
|
3733
3904
|
fontSize: '12px',
|
|
3734
|
-
} }, { children: fields.phone_number.helperText })))] }), renderField(fields.email_address), jsx(Divider, { sx: { borderColor: 'rgba(0,0,0,0.1)' } }), jsx(SectionTitle$1, { children: "Residential address" }), jsxs(Box, { children: [renderField(fields.residential_address_line1), fields.residential_address_line1.helperText && (jsx(Box, Object.assign({ component: "span", sx: {
|
|
3905
|
+
} }, { children: fields.phone_number.helperText })))] }), renderField(fields.email_address), ((mailingAddressSame === null || mailingAddressSame === void 0 ? void 0 : mailingAddressSame.checked) && !isForChild) && (jsxs(Fragment, { children: [jsx(Divider, { sx: { borderColor: 'rgba(0,0,0,0.1)' } }), jsx(SectionTitle$1, { children: "Residential address" })] })), jsxs(Box, { children: [renderField(fields.residential_address_line1), fields.residential_address_line1.helperText && (jsx(Box, Object.assign({ component: "span", sx: {
|
|
3735
3906
|
display: 'block',
|
|
3736
3907
|
mt: 0.5,
|
|
3737
3908
|
color: '#5F5E62',
|
|
@@ -3741,7 +3912,7 @@ const ContactDetailsForm = ({ renderField, fields, mailingFields, mailingAddress
|
|
|
3741
3912
|
mt: 0.5,
|
|
3742
3913
|
color: '#5F5E62',
|
|
3743
3914
|
fontSize: '12px',
|
|
3744
|
-
} }, { children: fields.residential_address_line2.helperText })))] }), renderField(fields.postal_code), renderField(fields.city), renderField(fields.state), jsx(Divider, { sx: { borderColor: 'rgba(0,0,0,0.1)' } }), (
|
|
3915
|
+
} }, { children: fields.residential_address_line2.helperText })))] }), fields.country && renderField(fields.country), renderField(fields.postal_code), renderField(fields.city), renderField(fields.state), (mailingAddressSame === null || mailingAddressSame === void 0 ? void 0 : mailingAddressSame.checked) && mailingFields && (jsxs(Fragment, { children: [jsx(Divider, { sx: { borderColor: 'rgba(0,0,0,0.1)' } }), jsx(SectionTitle$1, { children: isForChild ? 'Policyowner mailing address' : 'Mailing address' }), isForChild && mailingFields.mailing_phone_number && (jsxs(Box, { children: [renderField(mailingFields.mailing_phone_number), mailingFields.mailing_phone_number.helperText && (jsx(Box, Object.assign({ component: "span", sx: { display: 'block', mt: 0.5, ml: 2, color: '#5F5E62', fontSize: '12px' } }, { children: mailingFields.mailing_phone_number.helperText })))] })), isForChild && mailingFields.mailing_email_address && (renderField(mailingFields.mailing_email_address)), jsxs(Box, { children: [renderField(mailingFields.mailing_address_line1), mailingFields.mailing_address_line1.helperText && (jsx(Box, Object.assign({ component: "span", sx: {
|
|
3745
3916
|
display: 'block',
|
|
3746
3917
|
mt: 0.5,
|
|
3747
3918
|
color: '#5F5E62',
|
|
@@ -3751,12 +3922,22 @@ const ContactDetailsForm = ({ renderField, fields, mailingFields, mailingAddress
|
|
|
3751
3922
|
mt: 0.5,
|
|
3752
3923
|
color: '#5F5E62',
|
|
3753
3924
|
fontSize: '12px',
|
|
3754
|
-
} }, { children: mailingFields.mailing_address_line2.helperText })))] }), renderField(mailingFields.mailing_postal_code), renderField(mailingFields.mailing_city), renderField(mailingFields.mailing_state)] })), mailingAddressSame && (jsx(CheckboxContainer, { children: jsx(FormControlLabel, { control: jsx(Checkbox, { checked: mailingAddressSame.checked, onChange: (e) => mailingAddressSame.onChange(e.target.checked), name: "mailing_not_same_as_residential", sx: {
|
|
3925
|
+
} }, { children: mailingFields.mailing_address_line2.helperText })))] }), mailingFields.mailing_country && renderField(mailingFields.mailing_country), renderField(mailingFields.mailing_postal_code), renderField(mailingFields.mailing_city), renderField(mailingFields.mailing_state)] })), (childContactNotSame === null || childContactNotSame === void 0 ? void 0 : childContactNotSame.checked) && childContactFields && (jsxs(Fragment, { children: [jsx(Divider, { sx: { borderColor: 'rgba(0,0,0,0.1)' } }), jsx(SectionTitle$1, { children: "Child's contact details" }), jsxs(Box, { children: [renderField(childContactFields.child_phone_number), childContactFields.child_phone_number.helperText && (jsx(Box, Object.assign({ component: "span", sx: { display: 'block', mt: 0.5, ml: 2, color: '#5F5E62', fontSize: '12px' } }, { children: childContactFields.child_phone_number.helperText })))] }), renderField(childContactFields.child_email_address), jsxs(Box, { children: [renderField(childContactFields.child_address_line1), childContactFields.child_address_line1.helperText && (jsx(Box, Object.assign({ component: "span", sx: { display: 'block', mt: 0.5, color: '#5F5E62', fontSize: '12px' } }, { children: childContactFields.child_address_line1.helperText })))] }), jsxs(Box, { children: [renderField(childContactFields.child_address_line2), childContactFields.child_address_line2.helperText && (jsx(Box, Object.assign({ component: "span", sx: { display: 'block', mt: 0.5, color: '#5F5E62', fontSize: '12px' } }, { children: childContactFields.child_address_line2.helperText })))] }), renderField(childContactFields.child_postal_code), childContactFields.child_country && renderField(childContactFields.child_country), renderField(childContactFields.child_city), renderField(childContactFields.child_state)] })), mailingAddressSame && (jsx(CheckboxContainer, { children: jsx(FormControlLabel, { control: jsx(Checkbox, { checked: mailingAddressSame.checked, onChange: (e) => mailingAddressSame.onChange(e.target.checked), name: "mailing_not_same_as_residential", sx: {
|
|
3926
|
+
color: '#929094',
|
|
3927
|
+
'&.Mui-checked': {
|
|
3928
|
+
color: '#317abc',
|
|
3929
|
+
},
|
|
3930
|
+
} }), label: jsx(CheckboxLabel, { children: mailingAddressSame.label || defaultMailingLabel }) }) })), childContactNotSame && (jsx(CheckboxContainer, { children: jsx(FormControlLabel, { control: jsx(Checkbox, { checked: childContactNotSame.checked, onChange: (e) => childContactNotSame.onChange(e.target.checked), name: "child_contact_not_same", sx: {
|
|
3755
3931
|
color: '#929094',
|
|
3756
3932
|
'&.Mui-checked': {
|
|
3757
3933
|
color: '#317abc',
|
|
3758
3934
|
},
|
|
3759
|
-
} }), label: jsx(CheckboxLabel, { children:
|
|
3935
|
+
} }), label: jsxs(Box, { children: [jsx(CheckboxLabel, { children: childContactNotSame.label || defaultChildContactLabel }), jsx(Box, Object.assign({ component: "span", sx: {
|
|
3936
|
+
display: 'block',
|
|
3937
|
+
fontSize: '12px',
|
|
3938
|
+
color: '#5F5E62',
|
|
3939
|
+
mt: 0.5,
|
|
3940
|
+
} }, { children: childContactHelperText }))] }) }) }))] }))) })));
|
|
3760
3941
|
};
|
|
3761
3942
|
|
|
3762
3943
|
const FormContainer$1 = styled(Box)({
|
|
@@ -3831,28 +4012,30 @@ styled(Box)({
|
|
|
3831
4012
|
},
|
|
3832
4013
|
});
|
|
3833
4014
|
|
|
3834
|
-
const ChildInformationForm = ({ renderField, fields, onSubmit, formRef, sx, desktopGridLayout = false, }) => {
|
|
4015
|
+
const ChildInformationForm = ({ renderField, fields, consents, onSubmit, formRef, sx, desktopGridLayout = false, }) => {
|
|
3835
4016
|
const Container = desktopGridLayout ? DesktopFormContainer : FormContainer;
|
|
4017
|
+
const defaultBankConfirmationLabel = "I confirm this bank account is my child's and consent to AmMetLife crediting payouts to it";
|
|
4018
|
+
const defaultMarketingLabel = "I/We consent to AmMetLife Insurance Berhad using my child's personal data for marketing and communication via digital platforms such as email, WhatsApp, and mobile";
|
|
4019
|
+
const renderHelperField = (field) => (jsxs(Box, { children: [renderField(field), field.helperText && (jsx(Box, Object.assign({ component: "span", sx: {
|
|
4020
|
+
display: 'block',
|
|
4021
|
+
mt: 0.5,
|
|
4022
|
+
ml: 2,
|
|
4023
|
+
color: '#5F5E62',
|
|
4024
|
+
fontSize: '12px',
|
|
4025
|
+
wordSpacing: '-5px',
|
|
4026
|
+
} }, { children: field.helperText })))] }));
|
|
4027
|
+
const renderConsents = () => {
|
|
4028
|
+
if (!consents)
|
|
4029
|
+
return null;
|
|
4030
|
+
return (jsxs(Fragment, { children: [consents.bank_account_confirmation && (jsxs(Box, Object.assign({ sx: desktopGridLayout ? { gridColumn: '1 / -1' } : undefined }, { children: [jsx(FormControlLabel, { control: jsx(Checkbox, { checked: consents.bank_account_confirmation.checked, onChange: (e) => { var _a; return (_a = consents.bank_account_confirmation) === null || _a === void 0 ? void 0 : _a.onChange(e.target.checked); }, name: "bank_account_confirmation" }), label: jsx(Typography, Object.assign({ sx: { fontSize: '14px', color: '#5f5e62', lineHeight: '18px' } }, { children: consents.bank_account_confirmation.label || defaultBankConfirmationLabel })), sx: { alignItems: 'flex-start', m: 0, '& .MuiCheckbox-root': { pt: '2px' } } }), consents.bank_account_confirmation.error && (jsx(Typography, Object.assign({ sx: { color: 'error.main', fontSize: '12px', mt: 0.5, ml: 4 } }, { children: consents.bank_account_confirmation.error })))] }))), consents.marketing_consent && (jsx(Box, Object.assign({ sx: desktopGridLayout ? { gridColumn: '1 / -1' } : undefined }, { children: jsx(FormControlLabel, { control: jsx(Checkbox, { checked: consents.marketing_consent.checked, onChange: (e) => { var _a; return (_a = consents.marketing_consent) === null || _a === void 0 ? void 0 : _a.onChange(e.target.checked); }, name: "marketing_consent" }), label: jsx(Typography, Object.assign({ sx: { fontSize: '14px', color: '#5f5e62', lineHeight: '18px' } }, { children: consents.marketing_consent.label || defaultMarketingLabel })), sx: { alignItems: 'flex-start', m: 0, '& .MuiCheckbox-root': { pt: '2px' } } }) })))] }));
|
|
4031
|
+
};
|
|
4032
|
+
const renderAdditionalFields = () => (jsxs(Fragment, { children: [fields.place_of_birth && renderField(fields.place_of_birth), fields.marital_status && renderField(fields.marital_status), fields.race && renderField(fields.race), fields.religion && renderField(fields.religion), fields.occupation && renderField(fields.occupation), fields.industry && renderField(fields.industry), fields.crediting_bank_name && renderField(fields.crediting_bank_name), fields.crediting_bank_account_number && renderField(fields.crediting_bank_account_number), fields.annual_income && renderField(fields.annual_income)] }));
|
|
3836
4033
|
// Desktop layout with 2-column grid
|
|
3837
4034
|
if (desktopGridLayout) {
|
|
3838
|
-
return (jsx(Container, Object.assign({ ref: formRef, component: "form", onSubmit: onSubmit, sx: sx }, { children: jsxs(FieldsGridContainer, { children: [
|
|
3839
|
-
display: 'block',
|
|
3840
|
-
mt: 0.5,
|
|
3841
|
-
ml: 2,
|
|
3842
|
-
color: '#5F5E62',
|
|
3843
|
-
fontSize: '12px',
|
|
3844
|
-
wordSpacing: '-5px',
|
|
3845
|
-
} }, { children: fields.full_name.helperText })))] }), fields.nric ? renderField(fields.nric) : renderField(fields.date_of_birth), fields.nric && renderField(fields.date_of_birth), renderField(fields.gender), renderField(fields.nationality)] }) })));
|
|
4035
|
+
return (jsx(Container, Object.assign({ ref: formRef, component: "form", onSubmit: onSubmit, sx: sx }, { children: jsxs(FieldsGridContainer, { children: [renderHelperField(fields.full_name), fields.nric ? renderHelperField(fields.nric) : renderField(fields.date_of_birth), fields.nric && renderField(fields.date_of_birth), renderField(fields.gender), fields.salutation && renderField(fields.salutation), renderField(fields.nationality), renderAdditionalFields(), renderConsents()] }) })));
|
|
3846
4036
|
}
|
|
3847
4037
|
// Mobile layout - single column
|
|
3848
|
-
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: [
|
|
3849
|
-
display: 'block',
|
|
3850
|
-
mt: 0.5,
|
|
3851
|
-
ml: 2,
|
|
3852
|
-
color: '#5F5E62',
|
|
3853
|
-
fontSize: '12px',
|
|
3854
|
-
wordSpacing: '-5px',
|
|
3855
|
-
} }, { children: fields.full_name.helperText })))] }), fields.nric && renderField(fields.nric), renderField(fields.date_of_birth), renderField(fields.gender), renderField(fields.nationality)] })) })));
|
|
4038
|
+
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: [renderHelperField(fields.full_name), fields.nric && renderHelperField(fields.nric), renderField(fields.date_of_birth), renderField(fields.gender), fields.salutation && renderField(fields.salutation), renderField(fields.nationality), renderAdditionalFields(), renderConsents()] })) })));
|
|
3856
4039
|
};
|
|
3857
4040
|
|
|
3858
4041
|
/**
|