igloo-d2c-components 1.0.28 → 1.0.30
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 +169 -35
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +169 -35
- package/dist/esm/index.js.map +1 -1
- package/dist/types/components/DesktopHeaderMenuBar/DesktopHeaderMenuBar.d.ts +16 -10
- package/dist/types/components/DesktopHeaderMenuBar/index.d.ts +1 -0
- package/dist/types/components/DesktopHeaderMenuBar/styled.d.ts +22 -10
- package/dist/types/components/DesktopHeaderMenuBar/types.d.ts +36 -0
- package/dist/types/components/Header/Header.d.ts +33 -1
- package/package.json +1 -1
|
@@ -2,19 +2,22 @@
|
|
|
2
2
|
* Desktop Header Menu Bar Component
|
|
3
3
|
* Based on Figma Design: Tech-Solution-V1.0 (node 1581-22604)
|
|
4
4
|
*
|
|
5
|
-
* A desktop-only header menu bar with logo, navigation items
|
|
6
|
-
* and a
|
|
5
|
+
* A desktop-only header menu bar with logo on left, navigation items
|
|
6
|
+
* and a CTA button on right. Supports scroll-to-section interactions.
|
|
7
7
|
*
|
|
8
8
|
* Usage:
|
|
9
9
|
* ```tsx
|
|
10
10
|
* <DesktopHeaderMenuBar
|
|
11
11
|
* logo={logoSrc}
|
|
12
12
|
* menuItems={[
|
|
13
|
-
* { key: '
|
|
14
|
-
* { key: '
|
|
13
|
+
* { key: 'medical', label: 'Medical', scrollTargetId: 'medical-section' },
|
|
14
|
+
* { key: 'critical-illness', label: 'Critical Illness', scrollTargetId: 'ci-section' },
|
|
15
|
+
* { key: 'life', label: 'Life', scrollTargetId: 'life-section' },
|
|
16
|
+
* { key: 'support', label: 'Support', scrollTargetId: 'support-section' },
|
|
15
17
|
* ]}
|
|
18
|
+
* ctaButtonText="Purchase Now"
|
|
19
|
+
* onCtaClick={() => scrollToQuotation()}
|
|
16
20
|
* onLogoClick={() => navigate('/')}
|
|
17
|
-
* onLoginClick={() => setShowLoginModal(true)}
|
|
18
21
|
* />
|
|
19
22
|
* ```
|
|
20
23
|
*/
|
|
@@ -22,17 +25,20 @@ import { DesktopHeaderMenuBarProps } from './types';
|
|
|
22
25
|
/**
|
|
23
26
|
* DesktopHeaderMenuBar Component
|
|
24
27
|
*
|
|
25
|
-
* A
|
|
28
|
+
* A desktop header with logo on left, navigation menu items and CTA button on right.
|
|
29
|
+
* Supports scroll-to-section interactions for menu items.
|
|
26
30
|
*
|
|
27
31
|
* @param logo - Logo image source URL
|
|
28
32
|
* @param logoAlt - Alt text for the logo image
|
|
29
33
|
* @param menuItems - Array of menu items to display
|
|
30
|
-
* @param
|
|
31
|
-
* @param
|
|
34
|
+
* @param showCtaButton - Whether to show the CTA button (default: true)
|
|
35
|
+
* @param ctaButtonText - Text for the CTA button (default: 'Purchase Now')
|
|
36
|
+
* @param onCtaClick - Handler for CTA button click
|
|
37
|
+
* @param ctaScrollTargetId - Target element ID for CTA scroll action
|
|
38
|
+
* @param onScrollToSection - Callback when menu item triggers scroll
|
|
32
39
|
* @param onLogoClick - Handler for logo click
|
|
33
|
-
* @param onLoginClick - Handler for login button click
|
|
34
40
|
* @param formatMessage - i18n function for translations
|
|
35
41
|
*/
|
|
36
|
-
declare function DesktopHeaderMenuBar({ logo, logoAlt, menuItems, showLoginButton, loginButtonText,
|
|
42
|
+
declare function DesktopHeaderMenuBar({ logo, logoAlt, menuItems, showLoginButton, loginButtonText, onLoginClick, showCtaButton, ctaButtonText, onCtaClick, ctaScrollTargetId, onScrollToSection, onLogoClick, formatMessage, className, }: DesktopHeaderMenuBarProps): import("react/jsx-runtime").JSX.Element;
|
|
37
43
|
export default DesktopHeaderMenuBar;
|
|
38
44
|
export { DesktopHeaderMenuBar };
|
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
* Design Specifications:
|
|
6
6
|
* - Header height: 80px
|
|
7
7
|
* - Background: white (#ffffff)
|
|
8
|
-
* - Content
|
|
9
|
-
* - Logo
|
|
10
|
-
* - Gap between
|
|
11
|
-
* - Menu text: MetLife Circular Bold, 18px, #13131B
|
|
12
|
-
* -
|
|
8
|
+
* - Content padding: 156px horizontal on 1440px viewport
|
|
9
|
+
* - Logo dimensions: 126px × 16px
|
|
10
|
+
* - Gap between menu items: 32px
|
|
11
|
+
* - Menu text: MetLife Circular Bold, 18px, #13131B, line-height 24px
|
|
12
|
+
* - CTA Button: Filled, #0090da, border-radius 24px, height 48px
|
|
13
|
+
* - CTA text: MetLife Circular Medium, 16px, white, line-height 20px
|
|
13
14
|
*/
|
|
14
15
|
/// <reference types="react" />
|
|
15
16
|
/**
|
|
@@ -27,8 +28,8 @@ export declare const HeaderContainer: import("@emotion/styled").StyledComponent<
|
|
|
27
28
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
28
29
|
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
29
30
|
/**
|
|
30
|
-
* Left section containing logo
|
|
31
|
-
*
|
|
31
|
+
* Left section containing logo only
|
|
32
|
+
* Per Figma: Logo on left side of header
|
|
32
33
|
*/
|
|
33
34
|
export declare const LeftSection: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
34
35
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
@@ -41,7 +42,7 @@ export declare const LogoContainer: import("@emotion/styled").StyledComponent<im
|
|
|
41
42
|
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
42
43
|
/**
|
|
43
44
|
* Logo image
|
|
44
|
-
* Width: 126px, height: 16px (per Figma)
|
|
45
|
+
* Width: 126px, height: 16px (per Figma node 1328:28463)
|
|
45
46
|
*/
|
|
46
47
|
export declare const LogoImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
47
48
|
/**
|
|
@@ -74,19 +75,30 @@ export declare const DropdownIcon: import("@emotion/styled").StyledComponent<imp
|
|
|
74
75
|
ref?: ((instance: SVGSVGElement | null) => void) | import("react").RefObject<SVGSVGElement> | null | undefined;
|
|
75
76
|
}, "children" | "style" | "fontSize" | "className" | "classes" | "sx" | "color" | "shapeRendering" | "viewBox" | "htmlColor" | "inheritViewBox" | "titleAccess"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
76
77
|
/**
|
|
77
|
-
* Right section containing
|
|
78
|
+
* Right section containing menu items and CTA button
|
|
79
|
+
* Gap: 32px between menu items (per Figma node 3506:35611)
|
|
78
80
|
*/
|
|
79
81
|
export declare const RightSection: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
80
82
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
81
83
|
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
82
84
|
/**
|
|
83
|
-
* Login button (text style)
|
|
85
|
+
* Login button (text style) - DEPRECATED
|
|
86
|
+
* @deprecated Use PurchaseButton instead
|
|
84
87
|
* Based on Figma: Style=Text, State=enabled, Show Icon=False
|
|
85
88
|
* Color: #0090da (primary blue/teal)
|
|
86
89
|
*/
|
|
87
90
|
export declare const LoginButton: import("@emotion/styled").StyledComponent<import("@mui/material").ButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
88
91
|
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
89
92
|
}, "children" | "style" | "className" | "classes" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "tabIndex" | "TouchRippleProps" | "touchRippleRef" | "color" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "href" | "size" | "startIcon" | "variant"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
93
|
+
/**
|
|
94
|
+
* Purchase Now CTA Button (filled style)
|
|
95
|
+
* Based on Figma: Style=Filled, State=Enabled (node 3506:36976)
|
|
96
|
+
* Background: #0090da, border-radius: 24px, height: 48px
|
|
97
|
+
* Text: MetLife Circular Medium, 16px, white, line-height 20px
|
|
98
|
+
*/
|
|
99
|
+
export declare const PurchaseButton: import("@emotion/styled").StyledComponent<import("@mui/material").ButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
100
|
+
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
101
|
+
}, "children" | "style" | "className" | "classes" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "tabIndex" | "TouchRippleProps" | "touchRippleRef" | "color" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "href" | "size" | "startIcon" | "variant"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
90
102
|
/**
|
|
91
103
|
* Dropdown menu container
|
|
92
104
|
*/
|
|
@@ -27,6 +27,16 @@ export interface MenuItemWithDropdown {
|
|
|
27
27
|
* URL for navigation (optional)
|
|
28
28
|
*/
|
|
29
29
|
href?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Target element ID to scroll to when clicked
|
|
32
|
+
* Used for scroll-to-section behavior
|
|
33
|
+
*/
|
|
34
|
+
scrollTargetId?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Product code to select when scrolling (e.g., 'AMP_MED_XPNSE')
|
|
37
|
+
* Used in conjunction with scrollTargetId for product selection
|
|
38
|
+
*/
|
|
39
|
+
scrollTargetProductCode?: string;
|
|
30
40
|
}
|
|
31
41
|
export interface SubMenuItem {
|
|
32
42
|
/**
|
|
@@ -65,10 +75,12 @@ export interface DesktopHeaderMenuBarProps {
|
|
|
65
75
|
menuItems: MenuItemWithDropdown[];
|
|
66
76
|
/**
|
|
67
77
|
* Whether to show the login button
|
|
78
|
+
* @deprecated Use showCtaButton instead
|
|
68
79
|
*/
|
|
69
80
|
showLoginButton?: boolean;
|
|
70
81
|
/**
|
|
71
82
|
* Login button text
|
|
83
|
+
* @deprecated Use ctaButtonText instead
|
|
72
84
|
*/
|
|
73
85
|
loginButtonText?: string;
|
|
74
86
|
/**
|
|
@@ -77,8 +89,32 @@ export interface DesktopHeaderMenuBarProps {
|
|
|
77
89
|
onLogoClick?: () => void;
|
|
78
90
|
/**
|
|
79
91
|
* Login button click handler
|
|
92
|
+
* @deprecated Use onCtaClick instead
|
|
80
93
|
*/
|
|
81
94
|
onLoginClick?: () => void;
|
|
95
|
+
/**
|
|
96
|
+
* Whether to show the CTA button (Purchase Now)
|
|
97
|
+
* @default true
|
|
98
|
+
*/
|
|
99
|
+
showCtaButton?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* CTA button text
|
|
102
|
+
* @default 'Purchase Now'
|
|
103
|
+
*/
|
|
104
|
+
ctaButtonText?: string;
|
|
105
|
+
/**
|
|
106
|
+
* CTA button click handler
|
|
107
|
+
*/
|
|
108
|
+
onCtaClick?: () => void;
|
|
109
|
+
/**
|
|
110
|
+
* Target element ID to scroll to when CTA is clicked
|
|
111
|
+
*/
|
|
112
|
+
ctaScrollTargetId?: string;
|
|
113
|
+
/**
|
|
114
|
+
* Callback when a menu item triggers a scroll action
|
|
115
|
+
* Receives the scrollTargetId and optional productCode
|
|
116
|
+
*/
|
|
117
|
+
onScrollToSection?: (targetId: string, productCode?: string) => void;
|
|
82
118
|
/**
|
|
83
119
|
* Format message function for i18n
|
|
84
120
|
*/
|
|
@@ -25,6 +25,15 @@ export interface DesktopMenuItem {
|
|
|
25
25
|
onClick?: () => void;
|
|
26
26
|
}[];
|
|
27
27
|
onClick?: () => void;
|
|
28
|
+
/**
|
|
29
|
+
* Target element ID to scroll to when clicked
|
|
30
|
+
* Used for scroll-to-section behavior
|
|
31
|
+
*/
|
|
32
|
+
scrollTargetId?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Product code to select when scrolling
|
|
35
|
+
*/
|
|
36
|
+
scrollTargetProductCode?: string;
|
|
28
37
|
}
|
|
29
38
|
export interface LanguageOption {
|
|
30
39
|
value: string;
|
|
@@ -166,6 +175,29 @@ export interface HeaderProps {
|
|
|
166
175
|
* Only used when useNewDesktopLayout is true
|
|
167
176
|
*/
|
|
168
177
|
desktopMenuItems?: DesktopMenuItem[];
|
|
178
|
+
/**
|
|
179
|
+
* Whether to show the CTA button in desktop layout
|
|
180
|
+
* @default true
|
|
181
|
+
*/
|
|
182
|
+
showCtaButton?: boolean;
|
|
183
|
+
/**
|
|
184
|
+
* CTA button text for desktop layout
|
|
185
|
+
* @default 'Purchase Now'
|
|
186
|
+
*/
|
|
187
|
+
ctaButtonText?: string;
|
|
188
|
+
/**
|
|
189
|
+
* CTA button click handler for desktop layout
|
|
190
|
+
*/
|
|
191
|
+
onCtaClick?: () => void;
|
|
192
|
+
/**
|
|
193
|
+
* Target element ID to scroll to when CTA is clicked
|
|
194
|
+
*/
|
|
195
|
+
ctaScrollTargetId?: string;
|
|
196
|
+
/**
|
|
197
|
+
* Callback when a menu item triggers a scroll action
|
|
198
|
+
* Receives the scrollTargetId and optional productCode
|
|
199
|
+
*/
|
|
200
|
+
onScrollToSection?: (targetId: string, productCode?: string) => void;
|
|
169
201
|
}
|
|
170
202
|
/**
|
|
171
203
|
* Header component with tenant theme support and responsive navigation
|
|
@@ -182,4 +214,4 @@ export interface HeaderProps {
|
|
|
182
214
|
* />
|
|
183
215
|
* ```
|
|
184
216
|
*/
|
|
185
|
-
export declare function Header({ logo, alternateLogo, showAlternateLogo, navigationLinks, languages, currentLocale, currentLang, userToken, userFirstName, isMobile: propIsMobile, scrolled, isPartnershipPageMobileView, isPartnershipPagePCView, isSeoPageView, showGetQuoteButton, bannerData, ctaData, host, welcomeMessage, formatMessage, menuItems, userProfileComponent, onLogoClick, onProductMenuClick, onLanguageChange, onLoginClick, onSignupClick, onLogoutClick, onPartnershipClick, onAboutUsClick, onBlogClick, onMyProfileClick, onGetQuoteClick, onPartnershipCTAClick, useNewDesktopLayout, desktopMenuItems, }: HeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
217
|
+
export declare function Header({ logo, alternateLogo, showAlternateLogo, navigationLinks, languages, currentLocale, currentLang, userToken, userFirstName, isMobile: propIsMobile, scrolled, isPartnershipPageMobileView, isPartnershipPagePCView, isSeoPageView, showGetQuoteButton, bannerData, ctaData, host, welcomeMessage, formatMessage, menuItems, userProfileComponent, onLogoClick, onProductMenuClick, onLanguageChange, onLoginClick, onSignupClick, onLogoutClick, onPartnershipClick, onAboutUsClick, onBlogClick, onMyProfileClick, onGetQuoteClick, onPartnershipCTAClick, useNewDesktopLayout, desktopMenuItems, showCtaButton, ctaButtonText, onCtaClick, ctaScrollTargetId, onScrollToSection, }: HeaderProps): import("react/jsx-runtime").JSX.Element;
|
package/package.json
CHANGED