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/esm/index.js
CHANGED
|
@@ -829,29 +829,47 @@ function Banner(_a) {
|
|
|
829
829
|
/**
|
|
830
830
|
* Styled components for Desktop Header Menu Bar
|
|
831
831
|
* Based on Figma Design: Tech-Solution-V1.0 (node 1581-22604)
|
|
832
|
+
*
|
|
833
|
+
* Design Specifications:
|
|
834
|
+
* - Header height: 80px
|
|
835
|
+
* - Background: white (#ffffff)
|
|
836
|
+
* - Content max-width: 1128px (equivalent to 156px padding on 1440px width)
|
|
837
|
+
* - Logo width: 126px
|
|
838
|
+
* - Gap between logo and menu items: 32px
|
|
839
|
+
* - Menu text: MetLife Circular Bold, 18px, #13131B
|
|
840
|
+
* - Login button: Text style, #0090da (teal/cyan)
|
|
832
841
|
*/
|
|
842
|
+
/**
|
|
843
|
+
* Design System Colors (from Figma node 1581-22604)
|
|
844
|
+
*/
|
|
845
|
+
const designColors = {
|
|
846
|
+
natural: {
|
|
847
|
+
dim100: '#13131B',
|
|
848
|
+
light00: '#ffffff',
|
|
849
|
+
},
|
|
850
|
+
primary: {
|
|
851
|
+
main60: '#0090da',
|
|
852
|
+
},
|
|
853
|
+
};
|
|
833
854
|
/**
|
|
834
855
|
* Main AppBar container
|
|
835
856
|
* Height: 80px, white background, centered content
|
|
836
857
|
*/
|
|
837
|
-
const StyledAppBar$2 = styled(AppBar)(({ theme }) => {
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
justifyContent: 'center',
|
|
850
|
-
});
|
|
851
|
-
});
|
|
858
|
+
const StyledAppBar$2 = styled(AppBar)(({ theme }) => ({
|
|
859
|
+
backgroundColor: designColors.natural.light00,
|
|
860
|
+
boxShadow: 'none',
|
|
861
|
+
position: 'fixed',
|
|
862
|
+
top: 0,
|
|
863
|
+
left: 0,
|
|
864
|
+
right: 0,
|
|
865
|
+
zIndex: 1000,
|
|
866
|
+
height: '80px',
|
|
867
|
+
display: 'flex',
|
|
868
|
+
justifyContent: 'center',
|
|
869
|
+
}));
|
|
852
870
|
/**
|
|
853
871
|
* Inner container with max-width constraint
|
|
854
|
-
* Max-width: 1128px, centered
|
|
872
|
+
* Max-width: 1128px, centered (equivalent to px-156 on 1440px viewport)
|
|
855
873
|
*/
|
|
856
874
|
const HeaderContainer$1 = styled(Box)(({ theme }) => ({
|
|
857
875
|
display: 'flex',
|
|
@@ -868,6 +886,7 @@ const HeaderContainer$1 = styled(Box)(({ theme }) => ({
|
|
|
868
886
|
}));
|
|
869
887
|
/**
|
|
870
888
|
* Left section containing logo and menu items
|
|
889
|
+
* Gap: 32px between all children (logo and menu items)
|
|
871
890
|
*/
|
|
872
891
|
const LeftSection = styled(Box)({
|
|
873
892
|
display: 'flex',
|
|
@@ -883,57 +902,58 @@ const LogoContainer$2 = styled(Box)({
|
|
|
883
902
|
alignItems: 'center',
|
|
884
903
|
cursor: 'pointer',
|
|
885
904
|
height: '100%',
|
|
905
|
+
flexShrink: 0,
|
|
886
906
|
});
|
|
887
907
|
/**
|
|
888
908
|
* Logo image
|
|
889
|
-
* Width: 126px, height:
|
|
909
|
+
* Width: 126px, height: 16px (per Figma)
|
|
890
910
|
*/
|
|
891
911
|
const LogoImage$1 = styled('img')({
|
|
892
912
|
width: '126px',
|
|
893
|
-
height: '
|
|
913
|
+
height: '16px',
|
|
894
914
|
objectFit: 'contain',
|
|
895
915
|
});
|
|
896
916
|
/**
|
|
897
917
|
* Navigation menu container
|
|
918
|
+
* No additional gap - items are spaced by LeftSection's gap
|
|
898
919
|
*/
|
|
899
|
-
|
|
920
|
+
styled(Box)({
|
|
900
921
|
display: 'flex',
|
|
901
922
|
alignItems: 'center',
|
|
902
923
|
height: '100%',
|
|
903
|
-
gap: '
|
|
924
|
+
gap: '0',
|
|
904
925
|
});
|
|
905
926
|
/**
|
|
906
927
|
* Individual menu item button
|
|
907
|
-
* Font: MetLife Circular Bold, 18px
|
|
928
|
+
* Font: MetLife Circular Bold, 18px, color: #13131B
|
|
929
|
+
* Padding: 10px horizontal (creates visual spacing between items)
|
|
908
930
|
*/
|
|
909
|
-
const MenuItemButton = styled(Button$1)(({ theme }) => {
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
},
|
|
930
|
-
});
|
|
931
|
-
});
|
|
931
|
+
const MenuItemButton = styled(Button$1)(({ theme }) => ({
|
|
932
|
+
display: 'flex',
|
|
933
|
+
alignItems: 'center',
|
|
934
|
+
gap: '8px',
|
|
935
|
+
padding: '0 10px',
|
|
936
|
+
height: '100%',
|
|
937
|
+
minWidth: 'auto',
|
|
938
|
+
textTransform: 'none',
|
|
939
|
+
color: designColors.natural.dim100,
|
|
940
|
+
fontFamily: '"MetLifeCircular", "Montserrat", "Roboto", "Helvetica", "Arial", sans-serif',
|
|
941
|
+
fontWeight: 700,
|
|
942
|
+
fontSize: '18px',
|
|
943
|
+
lineHeight: '24px',
|
|
944
|
+
letterSpacing: '0px',
|
|
945
|
+
borderRadius: 0,
|
|
946
|
+
'&:hover': {
|
|
947
|
+
backgroundColor: 'transparent',
|
|
948
|
+
color: designColors.primary.main60,
|
|
949
|
+
},
|
|
950
|
+
}));
|
|
932
951
|
/**
|
|
933
952
|
* Menu item text
|
|
953
|
+
* Font: MetLife Circular Bold, 18px
|
|
934
954
|
*/
|
|
935
955
|
const MenuItemText = styled(Typography)({
|
|
936
|
-
fontFamily: '"Montserrat", "
|
|
956
|
+
fontFamily: '"MetLifeCircular", "Montserrat", "Roboto", "Helvetica", "Arial", sans-serif',
|
|
937
957
|
fontWeight: 700,
|
|
938
958
|
fontSize: '18px',
|
|
939
959
|
lineHeight: '24px',
|
|
@@ -942,12 +962,12 @@ const MenuItemText = styled(Typography)({
|
|
|
942
962
|
});
|
|
943
963
|
/**
|
|
944
964
|
* Dropdown arrow icon
|
|
945
|
-
* Size: 24px
|
|
965
|
+
* Size: 24px, color: #13131B
|
|
946
966
|
*/
|
|
947
967
|
const DropdownIcon = styled(ArrowDropDownIcon)({
|
|
948
968
|
width: '24px',
|
|
949
969
|
height: '24px',
|
|
950
|
-
color:
|
|
970
|
+
color: designColors.natural.dim100,
|
|
951
971
|
});
|
|
952
972
|
/**
|
|
953
973
|
* Right section containing login button
|
|
@@ -960,30 +980,28 @@ const RightSection = styled(Box)({
|
|
|
960
980
|
/**
|
|
961
981
|
* Login button (text style)
|
|
962
982
|
* Based on Figma: Style=Text, State=enabled, Show Icon=False
|
|
983
|
+
* Color: #0090da (primary blue/teal)
|
|
963
984
|
*/
|
|
964
|
-
const LoginButton = styled(Button$1)(({ theme }) => {
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
985
|
+
const LoginButton = styled(Button$1)(({ theme }) => ({
|
|
986
|
+
display: 'flex',
|
|
987
|
+
alignItems: 'center',
|
|
988
|
+
padding: '0 10px',
|
|
989
|
+
height: '100%',
|
|
990
|
+
minWidth: 'auto',
|
|
991
|
+
textTransform: 'none',
|
|
992
|
+
color: designColors.primary.main60,
|
|
993
|
+
fontFamily: '"MetLifeCircular", "Montserrat", "Roboto", "Helvetica", "Arial", sans-serif',
|
|
994
|
+
fontWeight: 700,
|
|
995
|
+
fontSize: '18px',
|
|
996
|
+
lineHeight: '24px',
|
|
997
|
+
letterSpacing: '0px',
|
|
998
|
+
borderRadius: 0,
|
|
999
|
+
backgroundColor: 'transparent',
|
|
1000
|
+
'&:hover': {
|
|
980
1001
|
backgroundColor: 'transparent',
|
|
981
|
-
'
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
},
|
|
985
|
-
});
|
|
986
|
-
});
|
|
1002
|
+
textDecoration: 'underline',
|
|
1003
|
+
},
|
|
1004
|
+
}));
|
|
987
1005
|
/**
|
|
988
1006
|
* Dropdown menu container
|
|
989
1007
|
*/
|
|
@@ -1003,11 +1021,11 @@ const StyledMenuItem$1 = styled(MenuItem)(({ theme }) => ({
|
|
|
1003
1021
|
alignItems: 'center',
|
|
1004
1022
|
gap: '12px',
|
|
1005
1023
|
padding: '16px 20px',
|
|
1006
|
-
fontFamily: '"Montserrat", "
|
|
1024
|
+
fontFamily: '"MetLifeCircular", "Montserrat", "Roboto", "Helvetica", "Arial", sans-serif',
|
|
1007
1025
|
fontWeight: 500,
|
|
1008
1026
|
fontSize: '16px',
|
|
1009
1027
|
lineHeight: '24px',
|
|
1010
|
-
color:
|
|
1028
|
+
color: designColors.natural.dim100,
|
|
1011
1029
|
'&:hover': {
|
|
1012
1030
|
backgroundColor: 'rgba(0, 144, 218, 0.08)',
|
|
1013
1031
|
},
|
|
@@ -1072,15 +1090,15 @@ function DesktopHeaderMenuBar({ logo, logoAlt = 'Logo', menuItems, showLoginButt
|
|
|
1072
1090
|
e.preventDefault();
|
|
1073
1091
|
onLogoClick === null || onLogoClick === void 0 ? void 0 : onLogoClick();
|
|
1074
1092
|
};
|
|
1075
|
-
return (jsx(StyledAppBar$2, Object.assign({ className: className }, { children: jsxs(HeaderContainer$1, { children: [jsxs(LeftSection, { children: [jsx(LogoContainer$2, Object.assign({ onClick: handleLogoClick }, { children: jsx(LogoImage$1, { src: logo, alt: logoAlt }) })),
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1093
|
+
return (jsx(StyledAppBar$2, Object.assign({ className: className }, { children: jsxs(HeaderContainer$1, { children: [jsxs(LeftSection, { children: [jsx(LogoContainer$2, Object.assign({ onClick: handleLogoClick }, { children: jsx(LogoImage$1, { src: logo, alt: logoAlt }) })), menuItems.map((item) => (jsxs(React.Fragment, { children: [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: [jsx(MenuItemText, { children: formatMessage({ id: item.label }) }), item.hasDropdown && jsx(DropdownIcon, {})] })), item.hasDropdown && item.subItems && (jsx(StyledMenu$1, Object.assign({ id: `menu-${item.key}`, anchorEl: anchorEl, open: openMenuKey === item.key, onClose: handleCloseMenu, anchorOrigin: {
|
|
1094
|
+
vertical: 'bottom',
|
|
1095
|
+
horizontal: 'left',
|
|
1096
|
+
}, transformOrigin: {
|
|
1097
|
+
vertical: 'top',
|
|
1098
|
+
horizontal: 'left',
|
|
1099
|
+
}, MenuListProps: {
|
|
1100
|
+
'aria-labelledby': `menu-button-${item.key}`,
|
|
1101
|
+
} }, { 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)))] }), jsx(RightSection, { children: showLoginButton && (jsx(LoginButton, Object.assign({ onClick: onLoginClick, "data-testid": "header-login-button" }, { children: formatMessage({ id: loginButtonText }) }))) })] }) })));
|
|
1084
1102
|
}
|
|
1085
1103
|
|
|
1086
1104
|
const StyledAppBar$1 = styled(AppBar)(({ theme, ispartnershippagemobileview, scrolled }) => {
|
|
@@ -2323,19 +2341,21 @@ const StyledOptionButton = styled(ButtonBase, {
|
|
|
2323
2341
|
const colors = variantColors[colorVariant];
|
|
2324
2342
|
return {
|
|
2325
2343
|
height: heights[size],
|
|
2326
|
-
//
|
|
2344
|
+
// Allow flex to control width when in flex container, otherwise auto or full
|
|
2327
2345
|
width: fullWidth ? '100%' : 'auto',
|
|
2346
|
+
minWidth: 0,
|
|
2328
2347
|
borderRadius: '24px',
|
|
2329
2348
|
border: selected
|
|
2330
2349
|
? '2px solid #0090DA'
|
|
2331
2350
|
: `1px solid ${colors.unselectedBorder}`,
|
|
2332
2351
|
backgroundColor: selected ? colors.selectedBg : colors.unselectedBg,
|
|
2333
|
-
padding: '
|
|
2352
|
+
padding: '12px 24px',
|
|
2334
2353
|
display: 'flex',
|
|
2335
2354
|
alignItems: 'center',
|
|
2336
2355
|
justifyContent: 'center',
|
|
2337
2356
|
cursor: 'pointer',
|
|
2338
2357
|
transition: 'all 0.2s ease',
|
|
2358
|
+
boxSizing: 'border-box',
|
|
2339
2359
|
'&:hover': {
|
|
2340
2360
|
backgroundColor: selected ? colors.selectedBg : colors.hoverBg,
|
|
2341
2361
|
borderColor: selected ? '#0090DA' : colors.hoverBorder,
|
|
@@ -2368,12 +2388,12 @@ const OptionLabel = styled(Typography)(({ theme, selected, colorVariant = 'defau
|
|
|
2368
2388
|
const colors = variantColors[colorVariant];
|
|
2369
2389
|
return {
|
|
2370
2390
|
fontWeight: selected ? 700 : 500,
|
|
2371
|
-
fontSize: '
|
|
2372
|
-
lineHeight: '
|
|
2391
|
+
fontSize: '14px',
|
|
2392
|
+
lineHeight: '20px',
|
|
2373
2393
|
color: selected ? '#0090DA' : colors.unselectedText,
|
|
2374
2394
|
textAlign: 'center',
|
|
2395
|
+
fontFamily: '"MetLifeCircular", "Montserrat", sans-serif',
|
|
2375
2396
|
[theme.breakpoints.down('md')]: {
|
|
2376
|
-
lineHeight: '20px',
|
|
2377
2397
|
fontWeight: 500,
|
|
2378
2398
|
},
|
|
2379
2399
|
};
|
|
@@ -3237,18 +3257,22 @@ const CheckoutFormButton = ({ text = 'Next', disabled = false, onClick, fixed =
|
|
|
3237
3257
|
const QuestionContainer = styled(Box)({
|
|
3238
3258
|
display: 'flex',
|
|
3239
3259
|
flexDirection: 'column',
|
|
3240
|
-
gap: '
|
|
3260
|
+
gap: '16px',
|
|
3241
3261
|
});
|
|
3242
3262
|
const QuestionText = styled(Typography)({
|
|
3243
|
-
fontSize: '
|
|
3263
|
+
fontSize: '16px',
|
|
3244
3264
|
fontWeight: 400,
|
|
3245
3265
|
color: '#13131B',
|
|
3246
|
-
lineHeight: '
|
|
3266
|
+
lineHeight: '24px',
|
|
3267
|
+
fontFamily: '"MetLifeCircular", "Montserrat", sans-serif',
|
|
3247
3268
|
});
|
|
3248
3269
|
const OptionsContainer = styled(Box)({
|
|
3249
3270
|
display: 'flex',
|
|
3250
3271
|
gap: '16px',
|
|
3251
|
-
|
|
3272
|
+
// Make children fill equal width
|
|
3273
|
+
'& > *': {
|
|
3274
|
+
flex: 1,
|
|
3275
|
+
},
|
|
3252
3276
|
});
|
|
3253
3277
|
styled(Box)(({ selected }) => ({
|
|
3254
3278
|
flex: 1,
|
|
@@ -3273,7 +3297,7 @@ styled(Typography)(({ selected }) => ({
|
|
|
3273
3297
|
}));
|
|
3274
3298
|
|
|
3275
3299
|
const HealthQuestionGroup = ({ question, questionNumber, value, onChange, error, labels = { yes: 'Yes', no: 'No' }, sx, }) => {
|
|
3276
|
-
return (jsxs(QuestionContainer, Object.assign({ sx: sx }, { children: [jsxs(QuestionText, { children: [questionNumber && `${questionNumber}. `, question] }), jsxs(OptionsContainer, { children: [jsx(OptionButton, { value: "yes", label: labels.yes || 'Yes', selected: value === 'yes', onClick: () => onChange('yes'), variant: "form" }), jsx(OptionButton, { value: "no", label: labels.no || 'No', selected: value === 'no', onClick: () => onChange('no'), variant: "form" })] }), error && (jsx(Typography, Object.assign({ sx: {
|
|
3300
|
+
return (jsxs(QuestionContainer, Object.assign({ sx: sx }, { children: [jsxs(QuestionText, { children: [questionNumber && `${questionNumber}. `, question] }), jsxs(OptionsContainer, { children: [jsx(OptionButton, { value: "yes", label: labels.yes || 'Yes', selected: value === 'yes', onClick: () => onChange('yes'), variant: "form", size: "large" }), jsx(OptionButton, { value: "no", label: labels.no || 'No', selected: value === 'no', onClick: () => onChange('no'), variant: "form", size: "large" })] }), error && (jsx(Typography, Object.assign({ sx: {
|
|
3277
3301
|
color: 'error.main',
|
|
3278
3302
|
fontSize: '12px',
|
|
3279
3303
|
mt: 0.5,
|