igloo-d2c-components 1.0.33 → 1.0.35
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 +136 -59
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +136 -59
- package/dist/esm/index.js.map +1 -1
- 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 +20 -0
- package/dist/types/components/PersonalInformationForm/PersonalInformationForm.d.ts +5 -0
- 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/cjs/index.js
CHANGED
|
@@ -6,6 +6,7 @@ var React = require('react');
|
|
|
6
6
|
var material = require('@mui/material');
|
|
7
7
|
var ArrowDropDownIcon = require('@mui/icons-material/ArrowDropDown');
|
|
8
8
|
var CloseIcon = require('@mui/icons-material/Close');
|
|
9
|
+
var LanguageIcon = require('@mui/icons-material/Language');
|
|
9
10
|
var AppBar = require('@mui/material/AppBar');
|
|
10
11
|
var styles = require('@mui/material/styles');
|
|
11
12
|
var MenuIcon = require('@mui/icons-material/Menu');
|
|
@@ -1170,11 +1171,31 @@ function DesktopHeaderMenuBar({ logo, logoAlt = 'Logo', menuItems,
|
|
|
1170
1171
|
// Legacy props (deprecated)
|
|
1171
1172
|
showLoginButton, loginButtonText, onLoginClick,
|
|
1172
1173
|
// New CTA props
|
|
1173
|
-
showCtaButton = true, ctaButtonText = 'Purchase Now', onCtaClick, ctaScrollTargetId, onScrollToSection, onLogoClick, formatMessage = (descriptor) => descriptor.id, className,
|
|
1174
|
+
showCtaButton = true, ctaButtonText = 'Purchase Now', onCtaClick, ctaScrollTargetId, onScrollToSection, onLogoClick, formatMessage = (descriptor) => descriptor.id, className,
|
|
1175
|
+
// Language switcher props
|
|
1176
|
+
languages = [], currentLocale, onLanguageChange, }) {
|
|
1174
1177
|
var _a;
|
|
1175
1178
|
// Track which dropdown is currently open (for backward compatibility)
|
|
1176
1179
|
const [openMenuKey, setOpenMenuKey] = React__namespace.useState(null);
|
|
1177
1180
|
const [anchorEl, setAnchorEl] = React__namespace.useState(null);
|
|
1181
|
+
// Language menu state
|
|
1182
|
+
const [langAnchorEl, setLangAnchorEl] = React__namespace.useState(null);
|
|
1183
|
+
const isLangMenuOpen = Boolean(langAnchorEl);
|
|
1184
|
+
const handleLangMenuOpen = (event) => {
|
|
1185
|
+
setLangAnchorEl(event.currentTarget);
|
|
1186
|
+
};
|
|
1187
|
+
const handleLangMenuClose = () => {
|
|
1188
|
+
setLangAnchorEl(null);
|
|
1189
|
+
};
|
|
1190
|
+
const handleLangSelect = (locale, value) => {
|
|
1191
|
+
onLanguageChange === null || onLanguageChange === void 0 ? void 0 : onLanguageChange(locale, value);
|
|
1192
|
+
handleLangMenuClose();
|
|
1193
|
+
};
|
|
1194
|
+
// Derive current language label from locale
|
|
1195
|
+
const currentLangLabel = React__namespace.useMemo(() => {
|
|
1196
|
+
const match = languages.find((l) => l.locale === currentLocale);
|
|
1197
|
+
return (match === null || match === void 0 ? void 0 : match.label) || 'English';
|
|
1198
|
+
}, [languages, currentLocale]);
|
|
1178
1199
|
// Determine which button props to use (support legacy props)
|
|
1179
1200
|
const shouldShowCtaButton = (_a = showCtaButton !== null && showCtaButton !== void 0 ? showCtaButton : showLoginButton) !== null && _a !== void 0 ? _a : true;
|
|
1180
1201
|
const ctaText = ctaButtonText || loginButtonText || 'Purchase Now';
|
|
@@ -1241,7 +1262,20 @@ showCtaButton = true, ctaButtonText = 'Purchase Now', onCtaClick, ctaScrollTarge
|
|
|
1241
1262
|
horizontal: 'left',
|
|
1242
1263
|
}, MenuListProps: {
|
|
1243
1264
|
'aria-labelledby': `menu-button-${item.key}`,
|
|
1244
|
-
} }, { children: item.subItems.map((subItem) => (jsxRuntime.jsxs(StyledMenuItem$1, Object.assign({ onClick: () => handleSubItemClick(item, subItem.key), "data-testid": `submenu-item-${subItem.key}` }, { children: [subItem.icon && (jsxRuntime.jsx(MenuItemIcon, { src: subItem.icon, alt: subItem.label })), formatMessage({ id: subItem.label })] }), subItem.key))) })))] }, item.key))),
|
|
1265
|
+
} }, { children: item.subItems.map((subItem) => (jsxRuntime.jsxs(StyledMenuItem$1, Object.assign({ onClick: () => handleSubItemClick(item, subItem.key), "data-testid": `submenu-item-${subItem.key}` }, { children: [subItem.icon && (jsxRuntime.jsx(MenuItemIcon, { src: subItem.icon, alt: subItem.label })), formatMessage({ id: subItem.label })] }), subItem.key))) })))] }, item.key))), languages.length > 0 && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs(MenuItemButton, Object.assign({ onClick: handleLangMenuOpen, "aria-haspopup": "true", "aria-expanded": isLangMenuOpen, "data-testid": "language-switcher" }, { children: [jsxRuntime.jsx(LanguageIcon, { sx: { fontSize: '20px', mr: '4px' } }), jsxRuntime.jsx(MenuItemText, { children: currentLangLabel }), jsxRuntime.jsx(DropdownIcon, { sx: {
|
|
1266
|
+
transform: isLangMenuOpen
|
|
1267
|
+
? 'rotate(180deg)'
|
|
1268
|
+
: 'rotate(0deg)',
|
|
1269
|
+
transition: 'transform 0.2s',
|
|
1270
|
+
} })] })), jsxRuntime.jsx(StyledMenu$1, Object.assign({ id: "language-menu", anchorEl: langAnchorEl, open: isLangMenuOpen, onClose: handleLangMenuClose, anchorOrigin: {
|
|
1271
|
+
vertical: 'bottom',
|
|
1272
|
+
horizontal: 'left',
|
|
1273
|
+
}, transformOrigin: {
|
|
1274
|
+
vertical: 'top',
|
|
1275
|
+
horizontal: 'left',
|
|
1276
|
+
}, MenuListProps: {
|
|
1277
|
+
'aria-labelledby': 'language-switcher',
|
|
1278
|
+
} }, { children: languages.map((lang) => (jsxRuntime.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 && (jsxRuntime.jsx(PurchaseButton, Object.assign({ onClick: handleCtaButtonClick, "data-testid": "header-cta-button" }, { children: formatMessage({ id: ctaText }) })))] })] }) })));
|
|
1245
1279
|
}
|
|
1246
1280
|
|
|
1247
1281
|
const StyledAppBar$1 = styles.styled(AppBar)(({ theme, ispartnershippagemobileview, scrolled }) => {
|
|
@@ -1660,7 +1694,7 @@ function Header$1({ logo, navigationLinks, languages, currentLocale, userToken,
|
|
|
1660
1694
|
// Render new desktop layout when enabled and on actual desktop viewport
|
|
1661
1695
|
// Uses isActuallyDesktop to avoid SSR/prop issues with isMobile detection
|
|
1662
1696
|
if (useNewDesktopLayout && isActuallyDesktop) {
|
|
1663
|
-
return (jsxRuntime.jsx(DesktopHeaderMenuBar, { logo: logo, logoAlt: "Logo", menuItems: convertedDesktopMenuItems, showCtaButton: showCtaButton, ctaButtonText: ctaButtonText, onCtaClick: onCtaClick, ctaScrollTargetId: ctaScrollTargetId, onScrollToSection: onScrollToSection, onLogoClick: onLogoClick, formatMessage: formatMessage }));
|
|
1697
|
+
return (jsxRuntime.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 }));
|
|
1664
1698
|
}
|
|
1665
1699
|
return (jsxRuntime.jsx(StyledAppBar$1, Object.assign({ ispartnershippagemobileview: isPartnershipPageMobileView, scrolled: scrolled }, { children: jsxRuntime.jsx(ResponsiveB2CLayout, { children: jsxRuntime.jsx(StyledContainer, Object.assign({ ispartnershippagemobileview: isPartnershipPageMobileView, scrolled: scrolled, maxWidth: "xl" }, { children: jsxRuntime.jsxs(material.Toolbar, Object.assign({ disableGutters: true }, { children: [jsxRuntime.jsx("a", Object.assign({ href: host || '#', onClick: (e) => {
|
|
1666
1700
|
e === null || e === void 0 ? void 0 : e.preventDefault();
|
|
@@ -2077,7 +2111,7 @@ function Footer({ simplifiedLayout = false, introText, addressText, socialLinks,
|
|
|
2077
2111
|
}), index === navigationLinks.length - 1 && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ButtonBottomLink, Object.assign({ onClick: onPrivacyPolicyClick }, { children: jsxRuntime.jsx(material.Typography, Object.assign({ variant: "body1" }, { children: jsxRuntime.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' }) })) })) })), jsxRuntime.jsx(ButtonBottomLink, Object.assign({ onClick: onTermsOfServiceClick }, { children: jsxRuntime.jsx(material.Typography, Object.assign({ variant: "body1" }, { children: jsxRuntime.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' }) })) })) })), jsxRuntime.jsx(DivSocial, { children: socialLinks.map((social) => (jsxRuntime.jsx(ButtonIcon, Object.assign({ onClick: () => onSocialClick === null || onSocialClick === void 0 ? void 0 : onSocialClick(social.platform, social.url), "aria-label": social.ariaLabel || social.platform }, { children: jsxRuntime.jsx(AnchorLink, Object.assign({ href: social.url, onClick: (e) => e === null || e === void 0 ? void 0 : e.preventDefault() }, { children: jsxRuntime.jsx("img", { src: social.icon, alt: social.platform, height: isMobile ? '24' : '28', width: isMobile ? '24' : '28', loading: "lazy" }) })) }), social.platform))) })] }))] }, index))) }))] })), isMobile && jsxRuntime.jsx(StyledDivider, {}), isMobile && (jsxRuntime.jsx(DivBottom, { children: jsxRuntime.jsxs(DivLinks, { children: [jsxRuntime.jsx("div", Object.assign({ onClick: onPrivacyPolicyClick, style: { cursor: 'pointer' } }, { children: jsxRuntime.jsx(material.Typography, Object.assign({ variant: "body2" }, { children: jsxRuntime.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' }) })) })) })), jsxRuntime.jsx(DivSep, {}), jsxRuntime.jsx("div", Object.assign({ onClick: onTermsOfServiceClick, style: { cursor: 'pointer' } }, { children: jsxRuntime.jsx(material.Typography, Object.assign({ variant: "body2" }, { children: jsxRuntime.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' }) })) })) }))] }) }))] }) }));
|
|
2078
2112
|
}
|
|
2079
2113
|
|
|
2080
|
-
const StyledDrawer$1 = styles.styled(material.Drawer)(() => ({
|
|
2114
|
+
const StyledDrawer$1 = styles.styled(material.Drawer)(({ theme }) => ({
|
|
2081
2115
|
zIndex: '1300 !important',
|
|
2082
2116
|
'& .MuiDrawer-root': {
|
|
2083
2117
|
zIndex: 1300,
|
|
@@ -2087,17 +2121,26 @@ const StyledDrawer$1 = styles.styled(material.Drawer)(() => ({
|
|
|
2087
2121
|
boxSizing: 'border-box',
|
|
2088
2122
|
overflow: 'hidden',
|
|
2089
2123
|
zIndex: 1300,
|
|
2124
|
+
[theme.breakpoints.up('md')]: {
|
|
2125
|
+
maxWidth: '680px',
|
|
2126
|
+
margin: '0 auto',
|
|
2127
|
+
borderRadius: '16px',
|
|
2128
|
+
},
|
|
2090
2129
|
},
|
|
2091
2130
|
'& .MuiBackdrop-root': {
|
|
2092
2131
|
zIndex: 1299,
|
|
2093
2132
|
},
|
|
2094
2133
|
}));
|
|
2095
|
-
const DrawerHeader$1 = styles.styled(material.Box)(() => ({
|
|
2134
|
+
const DrawerHeader$1 = styles.styled(material.Box)(({ theme }) => ({
|
|
2096
2135
|
display: 'flex',
|
|
2097
2136
|
alignItems: 'center',
|
|
2098
|
-
justifyContent: 'flex-
|
|
2099
|
-
padding: '16px',
|
|
2100
|
-
minHeight: '
|
|
2137
|
+
justifyContent: 'flex-start',
|
|
2138
|
+
padding: '16px 24px',
|
|
2139
|
+
minHeight: '64px',
|
|
2140
|
+
[theme.breakpoints.down('md')]: {
|
|
2141
|
+
padding: '16px',
|
|
2142
|
+
minHeight: '56px',
|
|
2143
|
+
},
|
|
2101
2144
|
}));
|
|
2102
2145
|
const DrawerContent$1 = styles.styled(material.Box)(() => ({
|
|
2103
2146
|
flex: 1,
|
|
@@ -2176,6 +2219,15 @@ const SecondaryButton = styles.styled(material.Button)(() => ({
|
|
|
2176
2219
|
lineHeight: '18px',
|
|
2177
2220
|
wordSpacing: '-5px',
|
|
2178
2221
|
}));
|
|
2222
|
+
const BackArrowButton = styles.styled(material.IconButton)(() => ({
|
|
2223
|
+
padding: 0,
|
|
2224
|
+
width: '32px',
|
|
2225
|
+
height: '32px',
|
|
2226
|
+
color: '#13131B',
|
|
2227
|
+
'& .MuiSvgIcon-root': {
|
|
2228
|
+
fontSize: '24px',
|
|
2229
|
+
},
|
|
2230
|
+
}));
|
|
2179
2231
|
|
|
2180
2232
|
/**
|
|
2181
2233
|
* RecommendationsDrawer - Mobile drawer for recommendations and forms
|
|
@@ -2231,7 +2283,7 @@ function RecommendationsDrawer({ open, onClose, children, headerIcon, title, sub
|
|
|
2231
2283
|
},
|
|
2232
2284
|
}, sx: {
|
|
2233
2285
|
zIndex: 1300,
|
|
2234
|
-
} }, { children: jsxRuntime.jsxs(material.Box, Object.assign({ sx: { display: 'flex', flexDirection: 'column', height: '100%' } }, { children: [jsxRuntime.jsx(DrawerHeader$1, { children: jsxRuntime.jsx(
|
|
2286
|
+
} }, { children: jsxRuntime.jsxs(material.Box, Object.assign({ sx: { display: 'flex', flexDirection: 'column', height: '100%' } }, { children: [jsxRuntime.jsx(DrawerHeader$1, { children: jsxRuntime.jsx(BackArrowButton, Object.assign({ onClick: handleBackOrClose, "aria-label": showBackButton ? 'back' : 'close' }, { children: showBackButton ? jsxRuntime.jsx(ArrowBackIcon, {}) : jsxRuntime.jsx(CloseIcon, {}) })) }), (title || subtitle || headerIcon) && (jsxRuntime.jsxs(HeaderSection, { children: [headerIcon && (jsxRuntime.jsx(CategoryIcon, { children: jsxRuntime.jsx("img", { src: headerIcon, alt: "Category icon", width: 32, height: 32 }) })), title && (jsxRuntime.jsx(TitleText, Object.assign({ variant: "h5" }, { children: formatMessage({ id: title }) }))), subtitle && (jsxRuntime.jsx(SubtitleText, Object.assign({ variant: "body2" }, { children: formatMessage({ id: subtitle }) })))] })), jsxRuntime.jsx(DrawerContent$1, { children: children }), showFooter && (jsxRuntime.jsx(DrawerFooter, { children: customFooter ? (customFooter) : (jsxRuntime.jsxs(FooterButtons, { children: [primaryButtonText && (jsxRuntime.jsx(PrimaryButton, Object.assign({ variant: "contained", fullWidth: true, onClick: onPrimaryAction, disabled: primaryButtonDisabled, sx: {
|
|
2235
2287
|
backgroundColor: primaryColor,
|
|
2236
2288
|
'&:hover': {
|
|
2237
2289
|
backgroundColor: primaryColor,
|
|
@@ -2385,7 +2437,7 @@ const ProductCard$1 = material.styled(material.Box)({
|
|
|
2385
2437
|
flexDirection: 'column',
|
|
2386
2438
|
gap: '16px',
|
|
2387
2439
|
backgroundColor: '#ffffff',
|
|
2388
|
-
borderRadius: '
|
|
2440
|
+
borderRadius: '0',
|
|
2389
2441
|
boxShadow: '0px 2px 10px 0px rgba(0, 0, 0, 0.12)',
|
|
2390
2442
|
padding: '16px 12px 12px',
|
|
2391
2443
|
height: '168px',
|
|
@@ -2431,7 +2483,7 @@ const ViewPlansButton = material.styled(material.Button)({
|
|
|
2431
2483
|
fontSize: '14px',
|
|
2432
2484
|
fontWeight: 500,
|
|
2433
2485
|
lineHeight: '18px',
|
|
2434
|
-
wordSpacing: '
|
|
2486
|
+
wordSpacing: '0px',
|
|
2435
2487
|
});
|
|
2436
2488
|
|
|
2437
2489
|
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', }) {
|
|
@@ -2477,13 +2529,16 @@ function ProductSelectionDrawer({ open, onClose, products, onProductSelect, titl
|
|
|
2477
2529
|
} }, { children: viewPlansButtonText }))] }, product.id))) }) })] }) })));
|
|
2478
2530
|
}
|
|
2479
2531
|
|
|
2480
|
-
const QuestionContainer$1 = styles.styled(material.Box)(() => ({
|
|
2532
|
+
const QuestionContainer$1 = styles.styled(material.Box)(({ theme }) => ({
|
|
2481
2533
|
backgroundColor: '#FFFFFF',
|
|
2482
|
-
padding: '12px
|
|
2534
|
+
padding: '12px 0px',
|
|
2483
2535
|
display: 'flex',
|
|
2484
2536
|
flexDirection: 'column',
|
|
2485
2537
|
gap: '16px',
|
|
2486
2538
|
width: '100%',
|
|
2539
|
+
[theme.breakpoints.down('md')]: {
|
|
2540
|
+
padding: '8px 12px',
|
|
2541
|
+
},
|
|
2487
2542
|
}));
|
|
2488
2543
|
const QuestionHeader = styles.styled(material.Box)(() => ({
|
|
2489
2544
|
display: 'flex',
|
|
@@ -2897,16 +2952,16 @@ function BillingToggle({ value, onChange, formatMessage = (descriptor) => descri
|
|
|
2897
2952
|
? toggleActiveTextColor
|
|
2898
2953
|
: toggleInactiveTextColor,
|
|
2899
2954
|
} }, { children: jsxRuntime.jsx(ToggleText, { children: formatMessage({
|
|
2900
|
-
id: 'Billed
|
|
2901
|
-
defaultMessage: 'Billed
|
|
2955
|
+
id: 'Billed Monthly',
|
|
2956
|
+
defaultMessage: 'Billed Monthly',
|
|
2902
2957
|
}) }) })), jsxRuntime.jsx(ToggleButton, Object.assign({ active: value === 'annually', onClick: () => onChange('annually'), sx: {
|
|
2903
2958
|
backgroundColor: value === 'annually' ? toggleActiveColor : 'transparent',
|
|
2904
2959
|
color: value === 'annually'
|
|
2905
2960
|
? toggleActiveTextColor
|
|
2906
2961
|
: toggleInactiveTextColor,
|
|
2907
2962
|
} }, { children: jsxRuntime.jsx(ToggleText, { children: formatMessage({
|
|
2908
|
-
id: 'Billed
|
|
2909
|
-
defaultMessage: 'Billed
|
|
2963
|
+
id: 'Billed Annually',
|
|
2964
|
+
defaultMessage: 'Billed Annually',
|
|
2910
2965
|
}) }) }))] })));
|
|
2911
2966
|
}
|
|
2912
2967
|
|
|
@@ -3463,19 +3518,17 @@ const ButtonContainer = styles.styled(material.Box)(({ isFixed, desktopRightAlig
|
|
|
3463
3518
|
padding: '16px',
|
|
3464
3519
|
boxShadow: isFixed ? '0px 2px 10px 0px rgba(0, 0, 0, 0.12)' : 'none',
|
|
3465
3520
|
zIndex: 999,
|
|
3466
|
-
// Desktop styles for
|
|
3467
|
-
'@media (min-width: 900px)':
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
}
|
|
3478
|
-
: {},
|
|
3521
|
+
// Desktop styles for button alignment
|
|
3522
|
+
'@media (min-width: 900px)': {
|
|
3523
|
+
display: 'flex',
|
|
3524
|
+
justifyContent: desktopRightAligned ? 'flex-end' : 'center',
|
|
3525
|
+
maxWidth: '938px',
|
|
3526
|
+
margin: '0 auto',
|
|
3527
|
+
padding: '24px 0',
|
|
3528
|
+
backgroundColor: 'transparent',
|
|
3529
|
+
boxShadow: 'none',
|
|
3530
|
+
position: 'relative',
|
|
3531
|
+
},
|
|
3479
3532
|
}));
|
|
3480
3533
|
const StyledButton = styles.styled('button')(({ isDisabled, desktopWidth }) => ({
|
|
3481
3534
|
width: '100%',
|
|
@@ -3507,7 +3560,7 @@ const StyledButton = styles.styled('button')(({ isDisabled, desktopWidth }) => (
|
|
|
3507
3560
|
}));
|
|
3508
3561
|
|
|
3509
3562
|
const CheckoutFormButton = ({ text = 'Next', disabled = false, onClick, fixed = true, type = 'button', sx, loading = false, desktopRightAligned = false, desktopWidth = '180px', }) => {
|
|
3510
|
-
return (jsxRuntime.jsx(ButtonContainer, Object.assign({ isFixed: fixed, desktopRightAligned: desktopRightAligned, sx: sx }, { children: jsxRuntime.jsx(StyledButton, Object.assign({ type: type, disabled: disabled || loading, isDisabled: disabled || loading, desktopWidth:
|
|
3563
|
+
return (jsxRuntime.jsx(ButtonContainer, Object.assign({ isFixed: fixed, desktopRightAligned: desktopRightAligned, sx: sx }, { children: jsxRuntime.jsx(StyledButton, Object.assign({ type: type, disabled: disabled || loading, isDisabled: disabled || loading, desktopWidth: desktopWidth, onClick: onClick }, { children: loading ? 'Processing...' : text })) })));
|
|
3511
3564
|
};
|
|
3512
3565
|
|
|
3513
3566
|
const QuestionContainer = styles.styled(material.Box)({
|
|
@@ -3634,7 +3687,7 @@ const PersonalInformationForm = ({ renderField, fields, consents, onSubmit, form
|
|
|
3634
3687
|
color: '#5F5E62',
|
|
3635
3688
|
fontSize: '12px',
|
|
3636
3689
|
wordSpacing: '-5px',
|
|
3637
|
-
} }, { 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 ? (jsxRuntime.jsx(FullWidthField$1, { children: jsxRuntime.jsxs(CheckboxContainer$1, { children: [jsxRuntime.jsx(material.FormControlLabel, { control: jsxRuntime.jsx(material.Checkbox, { checked: consents.bank_account_confirmation.checked, onChange: (e) => consents.bank_account_confirmation.onChange(e.target.checked), name: "bank_account_confirmation" }), label: jsxRuntime.jsx(CheckboxLabel$1, { children: consents.bank_account_confirmation.label ||
|
|
3690
|
+
} }, { 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), fields.annual_income && renderField(fields.annual_income), renderField(fields.occupation), renderField(fields.industry), renderField(fields.crediting_bank_name), renderField(fields.crediting_bank_account_number), desktopGridLayout ? (jsxRuntime.jsx(FullWidthField$1, { children: jsxRuntime.jsxs(CheckboxContainer$1, { children: [jsxRuntime.jsx(material.FormControlLabel, { control: jsxRuntime.jsx(material.Checkbox, { checked: consents.bank_account_confirmation.checked, onChange: (e) => consents.bank_account_confirmation.onChange(e.target.checked), name: "bank_account_confirmation" }), label: jsxRuntime.jsx(CheckboxLabel$1, { children: consents.bank_account_confirmation.label ||
|
|
3638
3691
|
defaultBankConfirmationLabel }) }), consents.bank_account_confirmation.error && (jsxRuntime.jsx(material.Typography, Object.assign({ sx: {
|
|
3639
3692
|
color: 'error.main',
|
|
3640
3693
|
fontSize: '12px',
|
|
@@ -3692,7 +3745,7 @@ const FullWidthField = styles.styled(material.Box)({
|
|
|
3692
3745
|
const CheckboxContainer = styles.styled(material.Box)({
|
|
3693
3746
|
marginTop: '12px',
|
|
3694
3747
|
'& .MuiFormControlLabel-root': {
|
|
3695
|
-
alignItems: '
|
|
3748
|
+
alignItems: 'center',
|
|
3696
3749
|
marginLeft: 0,
|
|
3697
3750
|
'@media (min-width: 900px)': {
|
|
3698
3751
|
alignItems: 'center',
|
|
@@ -3717,8 +3770,10 @@ const SectionTitle$1 = styles.styled(material.Typography)({
|
|
|
3717
3770
|
wordSpacing: '-5px',
|
|
3718
3771
|
});
|
|
3719
3772
|
|
|
3720
|
-
const ContactDetailsForm = ({ renderField, fields, mailingFields, mailingAddressSame, onSubmit, formRef, sx, desktopGridLayout = false, }) => {
|
|
3773
|
+
const ContactDetailsForm = ({ renderField, fields, isForChild = false, mailingFields, mailingAddressSame, childContactFields, childContactNotSame, onSubmit, formRef, sx, desktopGridLayout = false, }) => {
|
|
3721
3774
|
const defaultMailingLabel = 'My mailing address is not the same as residential';
|
|
3775
|
+
const defaultChildContactLabel = 'My child contact details is not the same as residential';
|
|
3776
|
+
const childContactHelperText = 'Tick this box if the child has a different address, phone number, or email';
|
|
3722
3777
|
const Container = desktopGridLayout ? DesktopFormContainer$2 : FormContainer$2;
|
|
3723
3778
|
// Helper to render field with or without full width wrapper
|
|
3724
3779
|
const renderFieldWithLayout = (field, fullWidth = false) => {
|
|
@@ -3740,18 +3795,28 @@ const ContactDetailsForm = ({ renderField, fields, mailingFields, mailingAddress
|
|
|
3740
3795
|
}
|
|
3741
3796
|
return content;
|
|
3742
3797
|
};
|
|
3743
|
-
return (jsxRuntime.jsx(Container, Object.assign({ ref: formRef, component: "form", onSubmit: onSubmit, sx: sx }, { children: desktopGridLayout ? (jsxRuntime.jsxs(FieldsGridContainer$1, { children: [renderFieldWithHelperText(fields.phone_number, false), renderFieldWithLayout(fields.email_address, false), jsxRuntime.jsx(FullWidthField, { children: jsxRuntime.jsx(material.Divider, { sx: { borderColor: 'rgba(0,0,0,0.1)' } }) }), jsxRuntime.jsx(FullWidthField, { children: jsxRuntime.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), jsxRuntime.jsx(FullWidthField, { children: jsxRuntime.jsx(material.Divider, { sx: { borderColor: 'rgba(0,0,0,0.1)' } }) }), (
|
|
3798
|
+
return (jsxRuntime.jsx(Container, Object.assign({ ref: formRef, component: "form", onSubmit: onSubmit, sx: sx }, { children: desktopGridLayout ? (jsxRuntime.jsxs(FieldsGridContainer$1, { children: [isForChild && (jsxRuntime.jsx(FullWidthField, { children: jsxRuntime.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) && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(FullWidthField, { children: jsxRuntime.jsx(material.Divider, { sx: { borderColor: 'rgba(0,0,0,0.1)' } }) }), jsxRuntime.jsx(FullWidthField, { children: jsxRuntime.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 && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(FullWidthField, { children: jsxRuntime.jsx(material.Divider, { sx: { borderColor: 'rgba(0,0,0,0.1)' } }) }), jsxRuntime.jsx(FullWidthField, { children: jsxRuntime.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 && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(FullWidthField, { children: jsxRuntime.jsx(material.Divider, { sx: { borderColor: 'rgba(0,0,0,0.1)' } }) }), jsxRuntime.jsx(FullWidthField, { children: jsxRuntime.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 && (jsxRuntime.jsx(FullWidthField, { children: jsxRuntime.jsx(CheckboxContainer, { children: jsxRuntime.jsx(material.FormControlLabel, { control: jsxRuntime.jsx(material.Checkbox, { checked: mailingAddressSame.checked, onChange: (e) => mailingAddressSame.onChange(e.target.checked), name: "mailing_not_same_as_residential", sx: {
|
|
3744
3799
|
color: '#929094',
|
|
3745
3800
|
'&.Mui-checked': {
|
|
3746
3801
|
color: '#317abc',
|
|
3747
3802
|
},
|
|
3748
|
-
} }), label: jsxRuntime.jsx(CheckboxLabel, { children: mailingAddressSame.label || defaultMailingLabel }) }) }) }))
|
|
3803
|
+
} }), label: jsxRuntime.jsx(CheckboxLabel, { children: mailingAddressSame.label || defaultMailingLabel }) }) }) })), childContactNotSame && (jsxRuntime.jsx(FullWidthField, { children: jsxRuntime.jsx(CheckboxContainer, { children: jsxRuntime.jsx(material.FormControlLabel, { control: jsxRuntime.jsx(material.Checkbox, { checked: childContactNotSame.checked, onChange: (e) => childContactNotSame.onChange(e.target.checked), name: "child_contact_not_same", sx: {
|
|
3804
|
+
color: '#929094',
|
|
3805
|
+
'&.Mui-checked': {
|
|
3806
|
+
color: '#317abc',
|
|
3807
|
+
},
|
|
3808
|
+
} }), label: jsxRuntime.jsxs(material.Box, { children: [jsxRuntime.jsx(CheckboxLabel, { children: childContactNotSame.label || defaultChildContactLabel }), jsxRuntime.jsx(material.Box, Object.assign({ component: "span", sx: {
|
|
3809
|
+
display: 'block',
|
|
3810
|
+
fontSize: '12px',
|
|
3811
|
+
color: '#5F5E62',
|
|
3812
|
+
mt: 0.5,
|
|
3813
|
+
} }, { children: childContactHelperText }))] }) }) }) }))] })) : (jsxRuntime.jsxs(material.Box, Object.assign({ sx: { display: 'flex', flexDirection: 'column', gap: '24px' } }, { children: [isForChild && (jsxRuntime.jsx(SectionTitle$1, { children: "Policyowner contact details" })), jsxRuntime.jsxs(material.Box, { children: [renderField(fields.phone_number), fields.phone_number.helperText && (jsxRuntime.jsx(material.Box, Object.assign({ component: "span", sx: {
|
|
3749
3814
|
display: 'block',
|
|
3750
3815
|
mt: 0.5,
|
|
3751
3816
|
ml: 2,
|
|
3752
3817
|
color: '#5F5E62',
|
|
3753
3818
|
fontSize: '12px',
|
|
3754
|
-
} }, { children: fields.phone_number.helperText })))] }), renderField(fields.email_address), jsxRuntime.jsx(material.Divider, { sx: { borderColor: 'rgba(0,0,0,0.1)' } }), jsxRuntime.jsx(SectionTitle$1, { children: "Residential address" }), jsxRuntime.jsxs(material.Box, { children: [renderField(fields.residential_address_line1), fields.residential_address_line1.helperText && (jsxRuntime.jsx(material.Box, Object.assign({ component: "span", sx: {
|
|
3819
|
+
} }, { children: fields.phone_number.helperText })))] }), renderField(fields.email_address), ((mailingAddressSame === null || mailingAddressSame === void 0 ? void 0 : mailingAddressSame.checked) && !isForChild) && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(material.Divider, { sx: { borderColor: 'rgba(0,0,0,0.1)' } }), jsxRuntime.jsx(SectionTitle$1, { children: "Residential address" })] })), jsxRuntime.jsxs(material.Box, { children: [renderField(fields.residential_address_line1), fields.residential_address_line1.helperText && (jsxRuntime.jsx(material.Box, Object.assign({ component: "span", sx: {
|
|
3755
3820
|
display: 'block',
|
|
3756
3821
|
mt: 0.5,
|
|
3757
3822
|
color: '#5F5E62',
|
|
@@ -3761,7 +3826,7 @@ const ContactDetailsForm = ({ renderField, fields, mailingFields, mailingAddress
|
|
|
3761
3826
|
mt: 0.5,
|
|
3762
3827
|
color: '#5F5E62',
|
|
3763
3828
|
fontSize: '12px',
|
|
3764
|
-
} }, { children: fields.residential_address_line2.helperText })))] }), renderField(fields.postal_code), renderField(fields.city), renderField(fields.state), jsxRuntime.jsx(material.Divider, { sx: { borderColor: 'rgba(0,0,0,0.1)' } }), (
|
|
3829
|
+
} }, { 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 && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(material.Divider, { sx: { borderColor: 'rgba(0,0,0,0.1)' } }), jsxRuntime.jsx(SectionTitle$1, { children: isForChild ? 'Policyowner mailing address' : 'Mailing address' }), isForChild && mailingFields.mailing_phone_number && (jsxRuntime.jsxs(material.Box, { children: [renderField(mailingFields.mailing_phone_number), mailingFields.mailing_phone_number.helperText && (jsxRuntime.jsx(material.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)), jsxRuntime.jsxs(material.Box, { children: [renderField(mailingFields.mailing_address_line1), mailingFields.mailing_address_line1.helperText && (jsxRuntime.jsx(material.Box, Object.assign({ component: "span", sx: {
|
|
3765
3830
|
display: 'block',
|
|
3766
3831
|
mt: 0.5,
|
|
3767
3832
|
color: '#5F5E62',
|
|
@@ -3771,12 +3836,22 @@ const ContactDetailsForm = ({ renderField, fields, mailingFields, mailingAddress
|
|
|
3771
3836
|
mt: 0.5,
|
|
3772
3837
|
color: '#5F5E62',
|
|
3773
3838
|
fontSize: '12px',
|
|
3774
|
-
} }, { children: mailingFields.mailing_address_line2.helperText })))] }), renderField(mailingFields.mailing_postal_code), renderField(mailingFields.mailing_city), renderField(mailingFields.mailing_state)] })), mailingAddressSame && (jsxRuntime.jsx(CheckboxContainer, { children: jsxRuntime.jsx(material.FormControlLabel, { control: jsxRuntime.jsx(material.Checkbox, { checked: mailingAddressSame.checked, onChange: (e) => mailingAddressSame.onChange(e.target.checked), name: "mailing_not_same_as_residential", sx: {
|
|
3839
|
+
} }, { 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 && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(material.Divider, { sx: { borderColor: 'rgba(0,0,0,0.1)' } }), jsxRuntime.jsx(SectionTitle$1, { children: "Child's contact details" }), jsxRuntime.jsxs(material.Box, { children: [renderField(childContactFields.child_phone_number), childContactFields.child_phone_number.helperText && (jsxRuntime.jsx(material.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), jsxRuntime.jsxs(material.Box, { children: [renderField(childContactFields.child_address_line1), childContactFields.child_address_line1.helperText && (jsxRuntime.jsx(material.Box, Object.assign({ component: "span", sx: { display: 'block', mt: 0.5, color: '#5F5E62', fontSize: '12px' } }, { children: childContactFields.child_address_line1.helperText })))] }), jsxRuntime.jsxs(material.Box, { children: [renderField(childContactFields.child_address_line2), childContactFields.child_address_line2.helperText && (jsxRuntime.jsx(material.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 && (jsxRuntime.jsx(CheckboxContainer, { children: jsxRuntime.jsx(material.FormControlLabel, { control: jsxRuntime.jsx(material.Checkbox, { checked: mailingAddressSame.checked, onChange: (e) => mailingAddressSame.onChange(e.target.checked), name: "mailing_not_same_as_residential", sx: {
|
|
3775
3840
|
color: '#929094',
|
|
3776
3841
|
'&.Mui-checked': {
|
|
3777
3842
|
color: '#317abc',
|
|
3778
3843
|
},
|
|
3779
|
-
} }), label: jsxRuntime.jsx(CheckboxLabel, { children: mailingAddressSame.label || defaultMailingLabel }) }) }))
|
|
3844
|
+
} }), label: jsxRuntime.jsx(CheckboxLabel, { children: mailingAddressSame.label || defaultMailingLabel }) }) })), childContactNotSame && (jsxRuntime.jsx(CheckboxContainer, { children: jsxRuntime.jsx(material.FormControlLabel, { control: jsxRuntime.jsx(material.Checkbox, { checked: childContactNotSame.checked, onChange: (e) => childContactNotSame.onChange(e.target.checked), name: "child_contact_not_same", sx: {
|
|
3845
|
+
color: '#929094',
|
|
3846
|
+
'&.Mui-checked': {
|
|
3847
|
+
color: '#317abc',
|
|
3848
|
+
},
|
|
3849
|
+
} }), label: jsxRuntime.jsxs(material.Box, { children: [jsxRuntime.jsx(CheckboxLabel, { children: childContactNotSame.label || defaultChildContactLabel }), jsxRuntime.jsx(material.Box, Object.assign({ component: "span", sx: {
|
|
3850
|
+
display: 'block',
|
|
3851
|
+
fontSize: '12px',
|
|
3852
|
+
color: '#5F5E62',
|
|
3853
|
+
mt: 0.5,
|
|
3854
|
+
} }, { children: childContactHelperText }))] }) }) }))] }))) })));
|
|
3780
3855
|
};
|
|
3781
3856
|
|
|
3782
3857
|
const FormContainer$1 = styles.styled(material.Box)({
|
|
@@ -3851,28 +3926,30 @@ styles.styled(material.Box)({
|
|
|
3851
3926
|
},
|
|
3852
3927
|
});
|
|
3853
3928
|
|
|
3854
|
-
const ChildInformationForm = ({ renderField, fields, onSubmit, formRef, sx, desktopGridLayout = false, }) => {
|
|
3929
|
+
const ChildInformationForm = ({ renderField, fields, consents, onSubmit, formRef, sx, desktopGridLayout = false, }) => {
|
|
3855
3930
|
const Container = desktopGridLayout ? DesktopFormContainer : FormContainer;
|
|
3931
|
+
const defaultBankConfirmationLabel = "I confirm this bank account is my child's and consent to AmMetLife crediting payouts to it";
|
|
3932
|
+
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";
|
|
3933
|
+
const renderHelperField = (field) => (jsxRuntime.jsxs(material.Box, { children: [renderField(field), field.helperText && (jsxRuntime.jsx(material.Box, Object.assign({ component: "span", sx: {
|
|
3934
|
+
display: 'block',
|
|
3935
|
+
mt: 0.5,
|
|
3936
|
+
ml: 2,
|
|
3937
|
+
color: '#5F5E62',
|
|
3938
|
+
fontSize: '12px',
|
|
3939
|
+
wordSpacing: '-5px',
|
|
3940
|
+
} }, { children: field.helperText })))] }));
|
|
3941
|
+
const renderConsents = () => {
|
|
3942
|
+
if (!consents)
|
|
3943
|
+
return null;
|
|
3944
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [consents.bank_account_confirmation && (jsxRuntime.jsxs(material.Box, Object.assign({ sx: desktopGridLayout ? { gridColumn: '1 / -1' } : undefined }, { children: [jsxRuntime.jsx(material.FormControlLabel, { control: jsxRuntime.jsx(material.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: jsxRuntime.jsx(material.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 && (jsxRuntime.jsx(material.Typography, Object.assign({ sx: { color: 'error.main', fontSize: '12px', mt: 0.5, ml: 4 } }, { children: consents.bank_account_confirmation.error })))] }))), consents.marketing_consent && (jsxRuntime.jsx(material.Box, Object.assign({ sx: desktopGridLayout ? { gridColumn: '1 / -1' } : undefined }, { children: jsxRuntime.jsx(material.FormControlLabel, { control: jsxRuntime.jsx(material.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: jsxRuntime.jsx(material.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' } } }) })))] }));
|
|
3945
|
+
};
|
|
3946
|
+
const renderAdditionalFields = () => (jsxRuntime.jsxs(jsxRuntime.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)] }));
|
|
3856
3947
|
// Desktop layout with 2-column grid
|
|
3857
3948
|
if (desktopGridLayout) {
|
|
3858
|
-
return (jsxRuntime.jsx(Container, Object.assign({ ref: formRef, component: "form", onSubmit: onSubmit, sx: sx }, { children: jsxRuntime.jsxs(FieldsGridContainer, { children: [
|
|
3859
|
-
display: 'block',
|
|
3860
|
-
mt: 0.5,
|
|
3861
|
-
ml: 2,
|
|
3862
|
-
color: '#5F5E62',
|
|
3863
|
-
fontSize: '12px',
|
|
3864
|
-
wordSpacing: '-5px',
|
|
3865
|
-
} }, { 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)] }) })));
|
|
3949
|
+
return (jsxRuntime.jsx(Container, Object.assign({ ref: formRef, component: "form", onSubmit: onSubmit, sx: sx }, { children: jsxRuntime.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()] }) })));
|
|
3866
3950
|
}
|
|
3867
3951
|
// Mobile layout - single column
|
|
3868
|
-
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: [
|
|
3869
|
-
display: 'block',
|
|
3870
|
-
mt: 0.5,
|
|
3871
|
-
ml: 2,
|
|
3872
|
-
color: '#5F5E62',
|
|
3873
|
-
fontSize: '12px',
|
|
3874
|
-
wordSpacing: '-5px',
|
|
3875
|
-
} }, { children: fields.full_name.helperText })))] }), fields.nric && renderField(fields.nric), renderField(fields.date_of_birth), renderField(fields.gender), renderField(fields.nationality)] })) })));
|
|
3952
|
+
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: [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()] })) })));
|
|
3876
3953
|
};
|
|
3877
3954
|
|
|
3878
3955
|
/**
|
|
@@ -3897,7 +3974,7 @@ const FAQTitle = material.styled(material.Typography)(({ theme }) => ({
|
|
|
3897
3974
|
fontWeight: 700,
|
|
3898
3975
|
fontSize: '20px',
|
|
3899
3976
|
lineHeight: '28px',
|
|
3900
|
-
wordSpacing: '
|
|
3977
|
+
wordSpacing: '-5px',
|
|
3901
3978
|
textAlign: 'center',
|
|
3902
3979
|
width: '100%',
|
|
3903
3980
|
margin: 0,
|
|
@@ -3946,7 +4023,7 @@ const FAQQuestion = material.styled(material.Typography)(({ theme }) => ({
|
|
|
3946
4023
|
fontWeight: 700,
|
|
3947
4024
|
fontSize: '14px',
|
|
3948
4025
|
lineHeight: '20px',
|
|
3949
|
-
wordSpacing: '
|
|
4026
|
+
wordSpacing: '-5px',
|
|
3950
4027
|
flex: 1,
|
|
3951
4028
|
[theme.breakpoints.up('md')]: {
|
|
3952
4029
|
fontSize: '18px',
|