igloo-d2c-components 1.0.24 → 1.0.26
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 +114 -90
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +114 -90
- package/dist/esm/index.js.map +1 -1
- package/dist/types/components/DesktopHeaderMenuBar/styled.d.ts +18 -4
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -849,29 +849,47 @@ function Banner(_a) {
|
|
|
849
849
|
/**
|
|
850
850
|
* Styled components for Desktop Header Menu Bar
|
|
851
851
|
* Based on Figma Design: Tech-Solution-V1.0 (node 1581-22604)
|
|
852
|
+
*
|
|
853
|
+
* Design Specifications:
|
|
854
|
+
* - Header height: 80px
|
|
855
|
+
* - Background: white (#ffffff)
|
|
856
|
+
* - Content max-width: 1128px (equivalent to 156px padding on 1440px width)
|
|
857
|
+
* - Logo width: 126px
|
|
858
|
+
* - Gap between logo and menu items: 32px
|
|
859
|
+
* - Menu text: MetLife Circular Bold, 18px, #13131B
|
|
860
|
+
* - Login button: Text style, #0090da (teal/cyan)
|
|
852
861
|
*/
|
|
862
|
+
/**
|
|
863
|
+
* Design System Colors (from Figma node 1581-22604)
|
|
864
|
+
*/
|
|
865
|
+
const designColors = {
|
|
866
|
+
natural: {
|
|
867
|
+
dim100: '#13131B',
|
|
868
|
+
light00: '#ffffff',
|
|
869
|
+
},
|
|
870
|
+
primary: {
|
|
871
|
+
main60: '#0090da',
|
|
872
|
+
},
|
|
873
|
+
};
|
|
853
874
|
/**
|
|
854
875
|
* Main AppBar container
|
|
855
876
|
* Height: 80px, white background, centered content
|
|
856
877
|
*/
|
|
857
|
-
const StyledAppBar$2 = styles.styled(AppBar)(({ theme }) => {
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
justifyContent: 'center',
|
|
870
|
-
});
|
|
871
|
-
});
|
|
878
|
+
const StyledAppBar$2 = styles.styled(AppBar)(({ theme }) => ({
|
|
879
|
+
backgroundColor: designColors.natural.light00,
|
|
880
|
+
boxShadow: 'none',
|
|
881
|
+
position: 'fixed',
|
|
882
|
+
top: 0,
|
|
883
|
+
left: 0,
|
|
884
|
+
right: 0,
|
|
885
|
+
zIndex: 1000,
|
|
886
|
+
height: '80px',
|
|
887
|
+
display: 'flex',
|
|
888
|
+
justifyContent: 'center',
|
|
889
|
+
}));
|
|
872
890
|
/**
|
|
873
891
|
* Inner container with max-width constraint
|
|
874
|
-
* Max-width: 1128px, centered
|
|
892
|
+
* Max-width: 1128px, centered (equivalent to px-156 on 1440px viewport)
|
|
875
893
|
*/
|
|
876
894
|
const HeaderContainer$1 = styles.styled(material.Box)(({ theme }) => ({
|
|
877
895
|
display: 'flex',
|
|
@@ -888,6 +906,7 @@ const HeaderContainer$1 = styles.styled(material.Box)(({ theme }) => ({
|
|
|
888
906
|
}));
|
|
889
907
|
/**
|
|
890
908
|
* Left section containing logo and menu items
|
|
909
|
+
* Gap: 32px between all children (logo and menu items)
|
|
891
910
|
*/
|
|
892
911
|
const LeftSection = styles.styled(material.Box)({
|
|
893
912
|
display: 'flex',
|
|
@@ -903,57 +922,58 @@ const LogoContainer$2 = styles.styled(material.Box)({
|
|
|
903
922
|
alignItems: 'center',
|
|
904
923
|
cursor: 'pointer',
|
|
905
924
|
height: '100%',
|
|
925
|
+
flexShrink: 0,
|
|
906
926
|
});
|
|
907
927
|
/**
|
|
908
928
|
* Logo image
|
|
909
|
-
* Width: 126px, height:
|
|
929
|
+
* Width: 126px, height: 16px (per Figma)
|
|
910
930
|
*/
|
|
911
931
|
const LogoImage$1 = styles.styled('img')({
|
|
912
932
|
width: '126px',
|
|
913
|
-
height: '
|
|
933
|
+
height: '16px',
|
|
914
934
|
objectFit: 'contain',
|
|
915
935
|
});
|
|
916
936
|
/**
|
|
917
937
|
* Navigation menu container
|
|
938
|
+
* No additional gap - items are spaced by LeftSection's gap
|
|
918
939
|
*/
|
|
919
|
-
|
|
940
|
+
styles.styled(material.Box)({
|
|
920
941
|
display: 'flex',
|
|
921
942
|
alignItems: 'center',
|
|
922
943
|
height: '100%',
|
|
923
|
-
gap: '
|
|
944
|
+
gap: '0',
|
|
924
945
|
});
|
|
925
946
|
/**
|
|
926
947
|
* Individual menu item button
|
|
927
|
-
* Font: MetLife Circular Bold, 18px
|
|
948
|
+
* Font: MetLife Circular Bold, 18px, color: #13131B
|
|
949
|
+
* Padding: 10px horizontal (creates visual spacing between items)
|
|
928
950
|
*/
|
|
929
|
-
const MenuItemButton = styles.styled(material.Button)(({ theme }) => {
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
},
|
|
950
|
-
});
|
|
951
|
-
});
|
|
951
|
+
const MenuItemButton = styles.styled(material.Button)(({ theme }) => ({
|
|
952
|
+
display: 'flex',
|
|
953
|
+
alignItems: 'center',
|
|
954
|
+
gap: '8px',
|
|
955
|
+
padding: '0 10px',
|
|
956
|
+
height: '100%',
|
|
957
|
+
minWidth: 'auto',
|
|
958
|
+
textTransform: 'none',
|
|
959
|
+
color: designColors.natural.dim100,
|
|
960
|
+
fontFamily: '"MetLifeCircular", "Montserrat", "Roboto", "Helvetica", "Arial", sans-serif',
|
|
961
|
+
fontWeight: 700,
|
|
962
|
+
fontSize: '18px',
|
|
963
|
+
lineHeight: '24px',
|
|
964
|
+
letterSpacing: '0px',
|
|
965
|
+
borderRadius: 0,
|
|
966
|
+
'&:hover': {
|
|
967
|
+
backgroundColor: 'transparent',
|
|
968
|
+
color: designColors.primary.main60,
|
|
969
|
+
},
|
|
970
|
+
}));
|
|
952
971
|
/**
|
|
953
972
|
* Menu item text
|
|
973
|
+
* Font: MetLife Circular Bold, 18px
|
|
954
974
|
*/
|
|
955
975
|
const MenuItemText = styles.styled(material.Typography)({
|
|
956
|
-
fontFamily: '"Montserrat", "
|
|
976
|
+
fontFamily: '"MetLifeCircular", "Montserrat", "Roboto", "Helvetica", "Arial", sans-serif',
|
|
957
977
|
fontWeight: 700,
|
|
958
978
|
fontSize: '18px',
|
|
959
979
|
lineHeight: '24px',
|
|
@@ -962,12 +982,12 @@ const MenuItemText = styles.styled(material.Typography)({
|
|
|
962
982
|
});
|
|
963
983
|
/**
|
|
964
984
|
* Dropdown arrow icon
|
|
965
|
-
* Size: 24px
|
|
985
|
+
* Size: 24px, color: #13131B
|
|
966
986
|
*/
|
|
967
987
|
const DropdownIcon = styles.styled(ArrowDropDownIcon)({
|
|
968
988
|
width: '24px',
|
|
969
989
|
height: '24px',
|
|
970
|
-
color:
|
|
990
|
+
color: designColors.natural.dim100,
|
|
971
991
|
});
|
|
972
992
|
/**
|
|
973
993
|
* Right section containing login button
|
|
@@ -980,30 +1000,28 @@ const RightSection = styles.styled(material.Box)({
|
|
|
980
1000
|
/**
|
|
981
1001
|
* Login button (text style)
|
|
982
1002
|
* Based on Figma: Style=Text, State=enabled, Show Icon=False
|
|
1003
|
+
* Color: #0090da (primary blue/teal)
|
|
983
1004
|
*/
|
|
984
|
-
const LoginButton = styles.styled(material.Button)(({ theme }) => {
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1005
|
+
const LoginButton = styles.styled(material.Button)(({ theme }) => ({
|
|
1006
|
+
display: 'flex',
|
|
1007
|
+
alignItems: 'center',
|
|
1008
|
+
padding: '0 10px',
|
|
1009
|
+
height: '100%',
|
|
1010
|
+
minWidth: 'auto',
|
|
1011
|
+
textTransform: 'none',
|
|
1012
|
+
color: designColors.primary.main60,
|
|
1013
|
+
fontFamily: '"MetLifeCircular", "Montserrat", "Roboto", "Helvetica", "Arial", sans-serif',
|
|
1014
|
+
fontWeight: 700,
|
|
1015
|
+
fontSize: '18px',
|
|
1016
|
+
lineHeight: '24px',
|
|
1017
|
+
letterSpacing: '0px',
|
|
1018
|
+
borderRadius: 0,
|
|
1019
|
+
backgroundColor: 'transparent',
|
|
1020
|
+
'&:hover': {
|
|
1000
1021
|
backgroundColor: 'transparent',
|
|
1001
|
-
'
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
},
|
|
1005
|
-
});
|
|
1006
|
-
});
|
|
1022
|
+
textDecoration: 'underline',
|
|
1023
|
+
},
|
|
1024
|
+
}));
|
|
1007
1025
|
/**
|
|
1008
1026
|
* Dropdown menu container
|
|
1009
1027
|
*/
|
|
@@ -1023,11 +1041,11 @@ const StyledMenuItem$1 = styles.styled(material.MenuItem)(({ theme }) => ({
|
|
|
1023
1041
|
alignItems: 'center',
|
|
1024
1042
|
gap: '12px',
|
|
1025
1043
|
padding: '16px 20px',
|
|
1026
|
-
fontFamily: '"Montserrat", "
|
|
1044
|
+
fontFamily: '"MetLifeCircular", "Montserrat", "Roboto", "Helvetica", "Arial", sans-serif',
|
|
1027
1045
|
fontWeight: 500,
|
|
1028
1046
|
fontSize: '16px',
|
|
1029
1047
|
lineHeight: '24px',
|
|
1030
|
-
color:
|
|
1048
|
+
color: designColors.natural.dim100,
|
|
1031
1049
|
'&:hover': {
|
|
1032
1050
|
backgroundColor: 'rgba(0, 144, 218, 0.08)',
|
|
1033
1051
|
},
|
|
@@ -1092,15 +1110,15 @@ function DesktopHeaderMenuBar({ logo, logoAlt = 'Logo', menuItems, showLoginButt
|
|
|
1092
1110
|
e.preventDefault();
|
|
1093
1111
|
onLogoClick === null || onLogoClick === void 0 ? void 0 : onLogoClick();
|
|
1094
1112
|
};
|
|
1095
|
-
return (jsxRuntime.jsx(StyledAppBar$2, Object.assign({ className: className }, { children: jsxRuntime.jsxs(HeaderContainer$1, { children: [jsxRuntime.jsxs(LeftSection, { children: [jsxRuntime.jsx(LogoContainer$2, Object.assign({ onClick: handleLogoClick }, { children: jsxRuntime.jsx(LogoImage$1, { src: logo, alt: logoAlt }) })),
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1113
|
+
return (jsxRuntime.jsx(StyledAppBar$2, Object.assign({ className: className }, { children: jsxRuntime.jsxs(HeaderContainer$1, { children: [jsxRuntime.jsxs(LeftSection, { children: [jsxRuntime.jsx(LogoContainer$2, Object.assign({ onClick: handleLogoClick }, { children: jsxRuntime.jsx(LogoImage$1, { src: logo, alt: logoAlt }) })), menuItems.map((item) => (jsxRuntime.jsxs(React__namespace.Fragment, { children: [jsxRuntime.jsxs(MenuItemButton, Object.assign({ onClick: (e) => handleMenuClick(e, item), "aria-haspopup": item.hasDropdown ? 'true' : undefined, "aria-expanded": item.hasDropdown ? openMenuKey === item.key : undefined, "data-testid": `menu-item-${item.key}` }, { children: [jsxRuntime.jsx(MenuItemText, { children: formatMessage({ id: item.label }) }), item.hasDropdown && jsxRuntime.jsx(DropdownIcon, {})] })), item.hasDropdown && item.subItems && (jsxRuntime.jsx(StyledMenu$1, Object.assign({ id: `menu-${item.key}`, anchorEl: anchorEl, open: openMenuKey === item.key, onClose: handleCloseMenu, anchorOrigin: {
|
|
1114
|
+
vertical: 'bottom',
|
|
1115
|
+
horizontal: 'left',
|
|
1116
|
+
}, transformOrigin: {
|
|
1117
|
+
vertical: 'top',
|
|
1118
|
+
horizontal: 'left',
|
|
1119
|
+
}, MenuListProps: {
|
|
1120
|
+
'aria-labelledby': `menu-button-${item.key}`,
|
|
1121
|
+
} }, { 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)))] }), jsxRuntime.jsx(RightSection, { children: showLoginButton && (jsxRuntime.jsx(LoginButton, Object.assign({ onClick: onLoginClick, "data-testid": "header-login-button" }, { children: formatMessage({ id: loginButtonText }) }))) })] }) })));
|
|
1104
1122
|
}
|
|
1105
1123
|
|
|
1106
1124
|
const StyledAppBar$1 = styles.styled(AppBar)(({ theme, ispartnershippagemobileview, scrolled }) => {
|
|
@@ -2343,19 +2361,21 @@ const StyledOptionButton = styles.styled(material.ButtonBase, {
|
|
|
2343
2361
|
const colors = variantColors[colorVariant];
|
|
2344
2362
|
return {
|
|
2345
2363
|
height: heights[size],
|
|
2346
|
-
//
|
|
2364
|
+
// Allow flex to control width when in flex container, otherwise auto or full
|
|
2347
2365
|
width: fullWidth ? '100%' : 'auto',
|
|
2366
|
+
minWidth: 0,
|
|
2348
2367
|
borderRadius: '24px',
|
|
2349
2368
|
border: selected
|
|
2350
2369
|
? '2px solid #0090DA'
|
|
2351
2370
|
: `1px solid ${colors.unselectedBorder}`,
|
|
2352
2371
|
backgroundColor: selected ? colors.selectedBg : colors.unselectedBg,
|
|
2353
|
-
padding: '
|
|
2372
|
+
padding: '12px 24px',
|
|
2354
2373
|
display: 'flex',
|
|
2355
2374
|
alignItems: 'center',
|
|
2356
2375
|
justifyContent: 'center',
|
|
2357
2376
|
cursor: 'pointer',
|
|
2358
2377
|
transition: 'all 0.2s ease',
|
|
2378
|
+
boxSizing: 'border-box',
|
|
2359
2379
|
'&:hover': {
|
|
2360
2380
|
backgroundColor: selected ? colors.selectedBg : colors.hoverBg,
|
|
2361
2381
|
borderColor: selected ? '#0090DA' : colors.hoverBorder,
|
|
@@ -2388,12 +2408,12 @@ const OptionLabel = styles.styled(material.Typography)(({ theme, selected, color
|
|
|
2388
2408
|
const colors = variantColors[colorVariant];
|
|
2389
2409
|
return {
|
|
2390
2410
|
fontWeight: selected ? 700 : 500,
|
|
2391
|
-
fontSize: '
|
|
2392
|
-
lineHeight: '
|
|
2411
|
+
fontSize: '14px',
|
|
2412
|
+
lineHeight: '20px',
|
|
2393
2413
|
color: selected ? '#0090DA' : colors.unselectedText,
|
|
2394
2414
|
textAlign: 'center',
|
|
2415
|
+
fontFamily: '"MetLifeCircular", "Montserrat", sans-serif',
|
|
2395
2416
|
[theme.breakpoints.down('md')]: {
|
|
2396
|
-
lineHeight: '20px',
|
|
2397
2417
|
fontWeight: 500,
|
|
2398
2418
|
},
|
|
2399
2419
|
};
|
|
@@ -3257,18 +3277,22 @@ const CheckoutFormButton = ({ text = 'Next', disabled = false, onClick, fixed =
|
|
|
3257
3277
|
const QuestionContainer = styles.styled(material.Box)({
|
|
3258
3278
|
display: 'flex',
|
|
3259
3279
|
flexDirection: 'column',
|
|
3260
|
-
gap: '
|
|
3280
|
+
gap: '16px',
|
|
3261
3281
|
});
|
|
3262
3282
|
const QuestionText = styles.styled(material.Typography)({
|
|
3263
|
-
fontSize: '
|
|
3283
|
+
fontSize: '16px',
|
|
3264
3284
|
fontWeight: 400,
|
|
3265
3285
|
color: '#13131B',
|
|
3266
|
-
lineHeight: '
|
|
3286
|
+
lineHeight: '24px',
|
|
3287
|
+
fontFamily: '"MetLifeCircular", "Montserrat", sans-serif',
|
|
3267
3288
|
});
|
|
3268
3289
|
const OptionsContainer = styles.styled(material.Box)({
|
|
3269
3290
|
display: 'flex',
|
|
3270
3291
|
gap: '16px',
|
|
3271
|
-
|
|
3292
|
+
// Make children fill equal width
|
|
3293
|
+
'& > *': {
|
|
3294
|
+
flex: 1,
|
|
3295
|
+
},
|
|
3272
3296
|
});
|
|
3273
3297
|
styles.styled(material.Box)(({ selected }) => ({
|
|
3274
3298
|
flex: 1,
|
|
@@ -3293,7 +3317,7 @@ styles.styled(material.Typography)(({ selected }) => ({
|
|
|
3293
3317
|
}));
|
|
3294
3318
|
|
|
3295
3319
|
const HealthQuestionGroup = ({ question, questionNumber, value, onChange, error, labels = { yes: 'Yes', no: 'No' }, sx, }) => {
|
|
3296
|
-
return (jsxRuntime.jsxs(QuestionContainer, Object.assign({ sx: sx }, { children: [jsxRuntime.jsxs(QuestionText, { children: [questionNumber && `${questionNumber}. `, question] }), jsxRuntime.jsxs(OptionsContainer, { children: [jsxRuntime.jsx(OptionButton, { value: "yes", label: labels.yes || 'Yes', selected: value === 'yes', onClick: () => onChange('yes'), variant: "form" }), jsxRuntime.jsx(OptionButton, { value: "no", label: labels.no || 'No', selected: value === 'no', onClick: () => onChange('no'), variant: "form" })] }), error && (jsxRuntime.jsx(material.Typography, Object.assign({ sx: {
|
|
3320
|
+
return (jsxRuntime.jsxs(QuestionContainer, Object.assign({ sx: sx }, { children: [jsxRuntime.jsxs(QuestionText, { children: [questionNumber && `${questionNumber}. `, question] }), jsxRuntime.jsxs(OptionsContainer, { children: [jsxRuntime.jsx(OptionButton, { value: "yes", label: labels.yes || 'Yes', selected: value === 'yes', onClick: () => onChange('yes'), variant: "form", size: "large" }), jsxRuntime.jsx(OptionButton, { value: "no", label: labels.no || 'No', selected: value === 'no', onClick: () => onChange('no'), variant: "form", size: "large" })] }), error && (jsxRuntime.jsx(material.Typography, Object.assign({ sx: {
|
|
3297
3321
|
color: 'error.main',
|
|
3298
3322
|
fontSize: '12px',
|
|
3299
3323
|
mt: 0.5,
|