@lendi/navbar 7.40.12 → 7.41.1
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/declarations/src/Header/HeaderBase.d.ts +1 -1
- package/dist/declarations/src/Header/Nav.d.ts +2 -0
- package/dist/declarations/src/Header/NavButtons.d.ts +2 -1
- package/dist/declarations/src/Header/PrimaryCTA.d.ts +2 -1
- package/dist/declarations/src/Header/aussie/AccountMenu.d.ts +2 -2
- package/dist/declarations/src/Header/aussie/CtaNav.d.ts +2 -1
- package/dist/declarations/src/Header/aussie/TalkToExpert.d.ts +1 -2
- package/dist/declarations/src/Header/shared.styles.d.ts +1 -1
- package/dist/navbar.cjs.dev.js +142 -121
- package/dist/navbar.cjs.prod.js +134 -112
- package/dist/navbar.esm.js +143 -122
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { GlobalProps } from '@lendi-ui/commons/utils';
|
|
3
3
|
export declare const HeaderPaddingSmall = 10;
|
|
4
|
-
export declare const HeaderPaddingLarge =
|
|
4
|
+
export declare const HeaderPaddingLarge = 16;
|
|
5
5
|
export interface HeaderBaseProps extends GlobalProps {
|
|
6
6
|
navSlot: React.ReactNode;
|
|
7
7
|
ctaSlot: React.ReactNode;
|
|
@@ -6,6 +6,7 @@ export interface NavCommonProps {
|
|
|
6
6
|
export interface NavItemProps extends NavCommonProps {
|
|
7
7
|
label: string;
|
|
8
8
|
link?: string | undefined;
|
|
9
|
+
badge?: string | undefined;
|
|
9
10
|
}
|
|
10
11
|
export interface NavElements extends NavItemProps {
|
|
11
12
|
children?: NavSubItems[];
|
|
@@ -16,6 +17,7 @@ export interface NavSubItems extends NavCommonProps {
|
|
|
16
17
|
link: string;
|
|
17
18
|
}
|
|
18
19
|
export declare const NAV_MENU_ITEMS: NavElements[];
|
|
20
|
+
export declare const Badge: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
|
19
21
|
interface NavTypes {
|
|
20
22
|
isSlideout?: boolean;
|
|
21
23
|
}
|
|
@@ -11,5 +11,6 @@ export interface NavLinkProps extends GlobalProps {
|
|
|
11
11
|
href: string;
|
|
12
12
|
onClick?: () => void;
|
|
13
13
|
isActive?: boolean;
|
|
14
|
+
badge?: string;
|
|
14
15
|
}
|
|
15
|
-
export declare const NavLink: ({ children, href, onClick, isActive, ...props }: NavLinkProps) => JSX.Element;
|
|
16
|
+
export declare const NavLink: ({ children, href, onClick, badge, isActive, ...props }: NavLinkProps) => JSX.Element;
|
|
@@ -2,5 +2,6 @@ import { Application } from '../shared/hooks/useApplication';
|
|
|
2
2
|
export interface PrimaryCTAProps {
|
|
3
3
|
handleApplyNowClick: () => void;
|
|
4
4
|
application?: Application;
|
|
5
|
+
isAuthenticated?: boolean;
|
|
5
6
|
}
|
|
6
|
-
export declare const PrimaryCTA: ({ application, handleApplyNowClick, ...props }: PrimaryCTAProps) => JSX.Element;
|
|
7
|
+
export declare const PrimaryCTA: ({ application, isAuthenticated, handleApplyNowClick, ...props }: PrimaryCTAProps) => JSX.Element | null;
|
|
@@ -8,6 +8,6 @@ interface SignOutProps {
|
|
|
8
8
|
onLogout: () => void;
|
|
9
9
|
}
|
|
10
10
|
export type AccountProps = AuthenticationProps & PrimaryCTAProps & TalkToExpertProps & SignOutProps;
|
|
11
|
-
export declare const AccountDropdown: ({ application, session, handleApplyNowClick, talkTo,
|
|
12
|
-
export declare const AccountSlideoutMenu: ({ session, application, talkTo, handleApplyNowClick,
|
|
11
|
+
export declare const AccountDropdown: ({ application, session, handleApplyNowClick, talkTo, onLogout }: AccountProps) => JSX.Element;
|
|
12
|
+
export declare const AccountSlideoutMenu: ({ session, application, talkTo, handleApplyNowClick, onLogout }: AccountProps) => JSX.Element;
|
|
13
13
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AccountProps } from './AccountMenu';
|
|
2
2
|
interface CtaNavProps extends AccountProps {
|
|
3
3
|
isExperiment?: boolean;
|
|
4
|
+
isAuthenticated?: boolean;
|
|
4
5
|
}
|
|
5
|
-
export declare const CtaNav: ({ handleApplyNowClick, session, application, talkTo,
|
|
6
|
+
export declare const CtaNav: ({ handleApplyNowClick, session, application, talkTo, onLogout, isExperiment, isAuthenticated, }: CtaNavProps) => JSX.Element;
|
|
6
7
|
export {};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { CustomerChatState } from '@lendi/chat';
|
|
2
2
|
export interface TalkToExpertProps {
|
|
3
|
-
openCommPanel: () => void;
|
|
4
3
|
customerOwner?: CustomerChatState['customerOwner'];
|
|
5
4
|
storeName?: CustomerChatState['storeName'];
|
|
6
5
|
talkTo?: string;
|
|
7
6
|
}
|
|
8
|
-
export declare const TalkToExpertButton: ({
|
|
7
|
+
export declare const TalkToExpertButton: ({ talkTo, ...props }: TalkToExpertProps) => JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const LargeTweakpoint = "
|
|
1
|
+
export declare const LargeTweakpoint = "65.825rem";
|
|
2
2
|
export declare const ExtraLargeTweakpoint = "82.5rem";
|
|
3
3
|
export declare const Px: import("styled-components").FlattenSimpleInterpolation;
|
|
4
4
|
export declare const Py: import("styled-components").FlattenSimpleInterpolation;
|
package/dist/navbar.cjs.dev.js
CHANGED
|
@@ -2734,7 +2734,7 @@ var MultiNavbarComponent = _ref => {
|
|
|
2734
2734
|
var MultiNavbar = withErrorProvider(launchdarkly.withLendiLDProvider(withCommPanel(withDomainChat(MultiNavbarComponent))));
|
|
2735
2735
|
|
|
2736
2736
|
var _templateObject$4, _templateObject2$2, _templateObject3$1, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
|
|
2737
|
-
var LargeTweakpoint = '
|
|
2737
|
+
var LargeTweakpoint = '65.825rem';
|
|
2738
2738
|
var ExtraLargeTweakpoint = '82.5rem';
|
|
2739
2739
|
var Px = styled.css(["padding-left:", ";padding-right:", ";"], utils$1.pxToRem(16), utils$1.pxToRem(16));
|
|
2740
2740
|
var Py = styled.css(["padding-top:", ";padding-bottom:", ";"], utils$1.pxToRem(24), utils$1.pxToRem(24));
|
|
@@ -2828,7 +2828,7 @@ var SrOnlySpan = styled__default["default"].span.withConfig({
|
|
|
2828
2828
|
})(["", ";"], utils$1.srOnly);
|
|
2829
2829
|
|
|
2830
2830
|
var _excluded$a = ["children", "isOpen", "onClick"],
|
|
2831
|
-
_excluded2$1 = ["children", "href", "onClick", "isActive"];
|
|
2831
|
+
_excluded2$1 = ["children", "href", "onClick", "badge", "isActive"];
|
|
2832
2832
|
/**
|
|
2833
2833
|
* @todo Line-height: prefer to use token but the current one is not accessible here
|
|
2834
2834
|
* @todo Helper functions: getTypography you have to specify each property of the font you need should this be simpler
|
|
@@ -2839,7 +2839,7 @@ var _excluded$a = ["children", "isOpen", "onClick"],
|
|
|
2839
2839
|
var StyledNavButton = styled__default["default"].button.withConfig({
|
|
2840
2840
|
displayName: "NavButtons__StyledNavButton",
|
|
2841
2841
|
componentId: "lui__sc-1rf7mpw-0"
|
|
2842
|
-
})(["", ";color:", ";background-color:", ";font-family:", ";font-weight:", ";font-size:", ";line-height:1.5;padding:", " ", ";display:flex;align-items:center;justify-content:
|
|
2842
|
+
})(["", ";color:", ";background-color:", ";font-family:", ";font-weight:", ";font-size:", ";line-height:1.5;padding:", " ", ";display:flex;align-items:center;justify-content:", ";&:hover{color:", ";}@media (min-width:", "){padding:", " ", ";}", " ", ""], buttonReset, _ref => {
|
|
2843
2843
|
var {
|
|
2844
2844
|
theme
|
|
2845
2845
|
} = _ref;
|
|
@@ -2849,30 +2849,35 @@ var StyledNavButton = styled__default["default"].button.withConfig({
|
|
|
2849
2849
|
theme
|
|
2850
2850
|
} = _ref2;
|
|
2851
2851
|
return theme.color.interaction.main;
|
|
2852
|
-
}, () => getTypography__default["default"]('
|
|
2852
|
+
}, () => getTypography__default["default"]('display', 'fontFamily'), () => getTypography__default["default"]('display', 'fontWeight'), utils$1.pxToRem(14), utils$1.pxToRem(16), utils$1.pxToRem(12), _ref3 => {
|
|
2853
2853
|
var {
|
|
2854
|
-
|
|
2854
|
+
isBadge
|
|
2855
2855
|
} = _ref3;
|
|
2856
|
-
return
|
|
2856
|
+
return isBadge ? "flex-start" : "space-between";
|
|
2857
2857
|
}, _ref4 => {
|
|
2858
|
+
var {
|
|
2859
|
+
theme
|
|
2860
|
+
} = _ref4;
|
|
2861
|
+
return theme.color.interaction.emphasis;
|
|
2862
|
+
}, ExtraLargeTweakpoint, utils$1.pxToRem(12), utils$1.pxToRem(8), _ref5 => {
|
|
2858
2863
|
var {
|
|
2859
2864
|
isOpen,
|
|
2860
2865
|
isActive,
|
|
2861
2866
|
theme
|
|
2862
|
-
} =
|
|
2867
|
+
} = _ref5;
|
|
2863
2868
|
return (isOpen !== null && isOpen !== void 0 ? isOpen : isActive) ? "color: ".concat(theme.color.interaction.emphasis, ";") : null;
|
|
2864
2869
|
}, insetFocusVisible);
|
|
2865
2870
|
var StyledNavButtonText = styled__default["default"].span.withConfig({
|
|
2866
2871
|
displayName: "NavButtons__StyledNavButtonText",
|
|
2867
2872
|
componentId: "lui__sc-1rf7mpw-1"
|
|
2868
2873
|
})(["margin-right:", ";"], utils$1.pxToRem(4));
|
|
2869
|
-
var NavButton =
|
|
2874
|
+
var NavButton = _ref6 => {
|
|
2870
2875
|
var {
|
|
2871
2876
|
children,
|
|
2872
2877
|
isOpen = false,
|
|
2873
2878
|
onClick
|
|
2874
|
-
} =
|
|
2875
|
-
props = _objectWithoutProperties(
|
|
2879
|
+
} = _ref6,
|
|
2880
|
+
props = _objectWithoutProperties(_ref6, _excluded$a);
|
|
2876
2881
|
var globalProps = utils$1.filterGlobalProps(props);
|
|
2877
2882
|
return /*#__PURE__*/jsxRuntime.jsxs(StyledNavButton, _objectSpread2(_objectSpread2({
|
|
2878
2883
|
type: "button",
|
|
@@ -2891,24 +2896,28 @@ var NavButton = _ref5 => {
|
|
|
2891
2896
|
})]
|
|
2892
2897
|
}));
|
|
2893
2898
|
};
|
|
2894
|
-
var NavLink =
|
|
2899
|
+
var NavLink = _ref7 => {
|
|
2895
2900
|
var {
|
|
2896
2901
|
children,
|
|
2897
2902
|
href,
|
|
2898
2903
|
onClick,
|
|
2904
|
+
badge,
|
|
2899
2905
|
isActive
|
|
2900
|
-
} =
|
|
2901
|
-
props = _objectWithoutProperties(
|
|
2906
|
+
} = _ref7,
|
|
2907
|
+
props = _objectWithoutProperties(_ref7, _excluded2$1);
|
|
2902
2908
|
var globalProps = utils$1.filterGlobalProps(props);
|
|
2903
|
-
return /*#__PURE__*/jsxRuntime.
|
|
2909
|
+
return /*#__PURE__*/jsxRuntime.jsxs(StyledNavButton, _objectSpread2(_objectSpread2({
|
|
2904
2910
|
href: href,
|
|
2905
2911
|
as: "a",
|
|
2906
2912
|
onClick: onClick,
|
|
2907
|
-
isActive: isActive
|
|
2913
|
+
isActive: isActive,
|
|
2914
|
+
isBadge: badge
|
|
2908
2915
|
}, globalProps), {}, {
|
|
2909
|
-
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
2916
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
2910
2917
|
children: children
|
|
2911
|
-
})
|
|
2918
|
+
}), badge ? /*#__PURE__*/jsxRuntime.jsx(Badge, {
|
|
2919
|
+
children: badge
|
|
2920
|
+
}) : null]
|
|
2912
2921
|
}));
|
|
2913
2922
|
};
|
|
2914
2923
|
|
|
@@ -2956,7 +2965,7 @@ var Dropdown = /*#__PURE__*/React.forwardRef(DropdownComponent);
|
|
|
2956
2965
|
var _excluded$8 = ["navSlot", "ctaSlot", "isExperiment"];
|
|
2957
2966
|
var _templateObject$3, _templateObject2$1;
|
|
2958
2967
|
var HeaderPaddingSmall = 10;
|
|
2959
|
-
var HeaderPaddingLarge =
|
|
2968
|
+
var HeaderPaddingLarge = 16;
|
|
2960
2969
|
|
|
2961
2970
|
/**
|
|
2962
2971
|
* @todo z-index: tokenise z-index to make it easier to manage levels
|
|
@@ -2977,7 +2986,7 @@ var HeaderInner = styled__default["default"].div.withConfig({
|
|
|
2977
2986
|
var LogoLink = styled__default["default"].a.withConfig({
|
|
2978
2987
|
displayName: "HeaderBase__LogoLink",
|
|
2979
2988
|
componentId: "lui__sc-1ik75ai-2"
|
|
2980
|
-
})(["width:", ";height:", ";order:1;flex:0 0 auto;", " ", ""], utils$1.pxToRem(87), utils$1.pxToRem(16), breakpoint.gte('md')(_templateObject2$1 || (_templateObject2$1 = _taggedTemplateLiteral(["\n width: ", ";\n height: ", ";\n margin-right: ", ";\n "])), utils$1.pxToRem(
|
|
2989
|
+
})(["width:", ";height:", ";order:1;flex:0 0 auto;", " ", ""], utils$1.pxToRem(87), utils$1.pxToRem(16), breakpoint.gte('md')(_templateObject2$1 || (_templateObject2$1 = _taggedTemplateLiteral(["\n width: ", ";\n height: ", ";\n margin-right: ", ";\n "])), utils$1.pxToRem(99), utils$1.pxToRem(22), utils$1.pxToRem(32)), focusVisible);
|
|
2981
2990
|
var StyledNavSlot = styled__default["default"].div.withConfig({
|
|
2982
2991
|
displayName: "HeaderBase__StyledNavSlot",
|
|
2983
2992
|
componentId: "lui__sc-1ik75ai-3"
|
|
@@ -3044,8 +3053,8 @@ var HeaderBase = _ref4 => {
|
|
|
3044
3053
|
};
|
|
3045
3054
|
|
|
3046
3055
|
var trimStringWithEllipsis = str => {
|
|
3047
|
-
if (str.length >
|
|
3048
|
-
return str.substring(0,
|
|
3056
|
+
if (str.length > 10) {
|
|
3057
|
+
return str.substring(0, 10) + '...';
|
|
3049
3058
|
} else {
|
|
3050
3059
|
return str;
|
|
3051
3060
|
}
|
|
@@ -3242,10 +3251,14 @@ var MenuButton = _ref5 => {
|
|
|
3242
3251
|
|
|
3243
3252
|
var _excluded$5 = ["navOptions", "isSlideout"];
|
|
3244
3253
|
var NavMobileStyled = styled.css(["ul{", "}"], listReset);
|
|
3254
|
+
var Badge = styled__default["default"].span.withConfig({
|
|
3255
|
+
displayName: "Nav__Badge",
|
|
3256
|
+
componentId: "lui__sc-zq7yzs-0"
|
|
3257
|
+
})(["height:24px;padding:4px 8px;margin-left:8px;font-family:", ";font-weight:700;color:", ";font-size:", ";line-height:16px;background-color:#ffd11f;border-radius:4px;"], () => getTypography__default["default"]('body1', 'fontFamily'), () => getColour__default["default"]('text', 'main'), utils$1.pxToRem(12));
|
|
3245
3258
|
var NavDesktopStyled = styled.css(["ul{", ";display:flex;align-items:center;}"], listReset);
|
|
3246
3259
|
var NavElement = styled__default["default"].nav.withConfig({
|
|
3247
3260
|
displayName: "Nav__NavElement",
|
|
3248
|
-
componentId: "lui__sc-zq7yzs-
|
|
3261
|
+
componentId: "lui__sc-zq7yzs-1"
|
|
3249
3262
|
})(["", ""], _ref => {
|
|
3250
3263
|
var {
|
|
3251
3264
|
isSlideout
|
|
@@ -3254,7 +3267,7 @@ var NavElement = styled__default["default"].nav.withConfig({
|
|
|
3254
3267
|
});
|
|
3255
3268
|
var StyledChildrenWrapper = styled__default["default"].div.withConfig({
|
|
3256
3269
|
displayName: "Nav__StyledChildrenWrapper",
|
|
3257
|
-
componentId: "lui__sc-zq7yzs-
|
|
3270
|
+
componentId: "lui__sc-zq7yzs-2"
|
|
3258
3271
|
})(["::after{content:'';display:block;", "}"], _ref2 => {
|
|
3259
3272
|
var {
|
|
3260
3273
|
isOpen,
|
|
@@ -3300,26 +3313,28 @@ var Nav = _ref4 => {
|
|
|
3300
3313
|
var globalProps = utils$1.filterGlobalProps(props);
|
|
3301
3314
|
var listItems = navOptions.map((item, index) => {
|
|
3302
3315
|
var _item$children, _item$children2;
|
|
3303
|
-
var navItems = isSlideout ? /*#__PURE__*/jsxRuntime.jsx(
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3316
|
+
var navItems = isSlideout ? /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
3317
|
+
children: /*#__PURE__*/jsxRuntime.jsx(MenuItem, {
|
|
3318
|
+
label: item.label,
|
|
3319
|
+
children: (_item$children = item.children) === null || _item$children === void 0 ? void 0 : _item$children.map((childItem, index) => {
|
|
3320
|
+
return /*#__PURE__*/jsxRuntime.jsx(MenuLink, {
|
|
3321
|
+
href: childItem.link,
|
|
3322
|
+
isActive: childItem.isActive,
|
|
3323
|
+
onClick: () => {
|
|
3324
|
+
var event = {
|
|
3325
|
+
category: analytics$1.EventCategory.NAVBAR,
|
|
3326
|
+
event_name: 'Menu Element Clicked',
|
|
3327
|
+
menuName: item.label,
|
|
3328
|
+
text: childItem.label,
|
|
3329
|
+
position: analytics$1.EventCategory.CMS,
|
|
3330
|
+
customerType: analytics$1.CustomerType.CUSTOMER
|
|
3331
|
+
};
|
|
3332
|
+
analytics(event);
|
|
3333
|
+
},
|
|
3334
|
+
"data-testid": "header-menu-link-".concat(trimSpaceWithDash(childItem.label)),
|
|
3335
|
+
children: childItem.label
|
|
3336
|
+
}, index);
|
|
3337
|
+
})
|
|
3323
3338
|
})
|
|
3324
3339
|
}) : /*#__PURE__*/jsxRuntime.jsx(NavDropdown, {
|
|
3325
3340
|
label: item.label,
|
|
@@ -3335,23 +3350,25 @@ var Nav = _ref4 => {
|
|
|
3335
3350
|
analytics(event);
|
|
3336
3351
|
},
|
|
3337
3352
|
children: (_item$children2 = item.children) === null || _item$children2 === void 0 ? void 0 : _item$children2.map((childItem, index) => {
|
|
3338
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3353
|
+
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
3354
|
+
children: /*#__PURE__*/jsxRuntime.jsx(MenuLink, {
|
|
3355
|
+
href: childItem.link,
|
|
3356
|
+
isActive: childItem.isActive,
|
|
3357
|
+
onClick: () => {
|
|
3358
|
+
var event = {
|
|
3359
|
+
category: analytics$1.EventCategory.NAVBAR,
|
|
3360
|
+
event_name: 'Menu Element Clicked',
|
|
3361
|
+
menuName: item.label,
|
|
3362
|
+
text: childItem.label,
|
|
3363
|
+
position: analytics$1.EventCategory.CMS,
|
|
3364
|
+
customerType: analytics$1.CustomerType.CUSTOMER
|
|
3365
|
+
};
|
|
3366
|
+
analytics(event);
|
|
3367
|
+
},
|
|
3368
|
+
"data-testid": "header-dropdown-menu-link-".concat(trimSpaceWithDash(childItem.label)),
|
|
3369
|
+
children: childItem.label
|
|
3370
|
+
}, index)
|
|
3371
|
+
});
|
|
3355
3372
|
})
|
|
3356
3373
|
});
|
|
3357
3374
|
if (Object.prototype.hasOwnProperty.call(item, 'children')) {
|
|
@@ -3360,9 +3377,14 @@ var Nav = _ref4 => {
|
|
|
3360
3377
|
}, index);
|
|
3361
3378
|
}
|
|
3362
3379
|
return item.link && /*#__PURE__*/jsxRuntime.jsx("li", {
|
|
3380
|
+
style: {
|
|
3381
|
+
display: 'flex',
|
|
3382
|
+
alignItems: 'center'
|
|
3383
|
+
},
|
|
3363
3384
|
children: /*#__PURE__*/jsxRuntime.jsx(NavLink, {
|
|
3364
3385
|
href: item.link,
|
|
3365
3386
|
isActive: item.isActive,
|
|
3387
|
+
badge: item.badge,
|
|
3366
3388
|
onClick: () => {
|
|
3367
3389
|
var event = {
|
|
3368
3390
|
event_name: 'Link Clicked',
|
|
@@ -3496,16 +3518,18 @@ var SlideoutMenu = _ref6 => {
|
|
|
3496
3518
|
}));
|
|
3497
3519
|
};
|
|
3498
3520
|
|
|
3499
|
-
var _excluded$3 = ["
|
|
3521
|
+
var _excluded$3 = ["talkTo"];
|
|
3500
3522
|
var TalkToExpertButton = _ref => {
|
|
3501
3523
|
var {
|
|
3502
|
-
openCommPanel,
|
|
3503
3524
|
talkTo
|
|
3504
3525
|
} = _ref,
|
|
3505
3526
|
props = _objectWithoutProperties(_ref, _excluded$3);
|
|
3527
|
+
var {
|
|
3528
|
+
store,
|
|
3529
|
+
broker
|
|
3530
|
+
} = chat.useBootstrappedChatState();
|
|
3506
3531
|
var globalProps = utils$1.filterGlobalProps(props);
|
|
3507
3532
|
var handleClick = () => {
|
|
3508
|
-
openCommPanel();
|
|
3509
3533
|
var event = {
|
|
3510
3534
|
event_name: 'Button Clicked',
|
|
3511
3535
|
category: analytics$1.EventCategory.NAVBAR,
|
|
@@ -3514,10 +3538,14 @@ var TalkToExpertButton = _ref => {
|
|
|
3514
3538
|
customerType: analytics$1.CustomerType.CUSTOMER,
|
|
3515
3539
|
buttonType: analytics$1.ButtonType.SECONDARY
|
|
3516
3540
|
};
|
|
3541
|
+
store !== null && store !== void 0 && store.id ? sessionStorage.setItem(lalaUtils.SESSION_STORAGE_KEYS.CTOR_TARGET_STORE_ID, store === null || store === void 0 ? void 0 : store.id) : sessionStorage.removeItem(lalaUtils.SESSION_STORAGE_KEYS.CTOR_TARGET_STORE_ID);
|
|
3542
|
+
broker !== null && broker !== void 0 && broker.id ? sessionStorage.setItem(lalaUtils.SESSION_STORAGE_KEYS.CTOR_TARGET_BROKER_ID, broker === null || broker === void 0 ? void 0 : broker.id) : sessionStorage.removeItem(lalaUtils.SESSION_STORAGE_KEYS.CTOR_TARGET_BROKER_ID);
|
|
3517
3543
|
analytics(event);
|
|
3518
3544
|
};
|
|
3519
|
-
return /*#__PURE__*/jsxRuntime.jsx(Button.
|
|
3545
|
+
return /*#__PURE__*/jsxRuntime.jsx(Button.AnchorButton, _objectSpread2(_objectSpread2({
|
|
3520
3546
|
variant: "secondary",
|
|
3547
|
+
href: "/book-appointment/",
|
|
3548
|
+
size: "sm",
|
|
3521
3549
|
"data-component": "navbar-button-talk-to-expert",
|
|
3522
3550
|
isInverse: true,
|
|
3523
3551
|
width: "100%",
|
|
@@ -3562,18 +3590,21 @@ var ApplyNowButton = _ref => {
|
|
|
3562
3590
|
}));
|
|
3563
3591
|
};
|
|
3564
3592
|
|
|
3565
|
-
var _excluded$1 = ["application", "handleApplyNowClick"];
|
|
3593
|
+
var _excluded$1 = ["application", "isAuthenticated", "handleApplyNowClick"];
|
|
3566
3594
|
var PrimaryCTA = _ref => {
|
|
3567
3595
|
var {
|
|
3568
3596
|
application,
|
|
3597
|
+
isAuthenticated,
|
|
3569
3598
|
handleApplyNowClick
|
|
3570
3599
|
} = _ref,
|
|
3571
3600
|
props = _objectWithoutProperties(_ref, _excluded$1);
|
|
3572
|
-
return !(application !== null && application !== void 0 && application.id) ? /*#__PURE__*/jsxRuntime.jsx(ApplyNowButton, _objectSpread2({
|
|
3601
|
+
return !(application !== null && application !== void 0 && application.id) ? /*#__PURE__*/jsxRuntime.jsx(ApplyNowButton, _objectSpread2(_objectSpread2({
|
|
3573
3602
|
onClick: handleApplyNowClick,
|
|
3574
3603
|
width: "100%"
|
|
3575
|
-
}, props)
|
|
3576
|
-
|
|
3604
|
+
}, props), {}, {
|
|
3605
|
+
size: "sm"
|
|
3606
|
+
})) : !isAuthenticated ? /*#__PURE__*/jsxRuntime.jsx(Button.AnchorButton, {
|
|
3607
|
+
onClick: () => {
|
|
3577
3608
|
var event = {
|
|
3578
3609
|
event_name: 'Button Clicked',
|
|
3579
3610
|
category: analytics$1.EventCategory.NAVBAR,
|
|
@@ -3589,8 +3620,9 @@ var PrimaryCTA = _ref => {
|
|
|
3589
3620
|
isInverse: true,
|
|
3590
3621
|
width: "100%",
|
|
3591
3622
|
"data-testid": "header-continue-application",
|
|
3623
|
+
size: "sm",
|
|
3592
3624
|
children: "Continue Application"
|
|
3593
|
-
});
|
|
3625
|
+
}) : null;
|
|
3594
3626
|
};
|
|
3595
3627
|
|
|
3596
3628
|
var _excluded = ["navOptions"];
|
|
@@ -3599,8 +3631,7 @@ var HamburgerCtaBlock = _ref => {
|
|
|
3599
3631
|
var {
|
|
3600
3632
|
handleApplyNowClick,
|
|
3601
3633
|
talkTo,
|
|
3602
|
-
application
|
|
3603
|
-
openCommPanel
|
|
3634
|
+
application
|
|
3604
3635
|
} = _ref;
|
|
3605
3636
|
return /*#__PURE__*/jsxRuntime.jsx(MenuPadding, {
|
|
3606
3637
|
children: /*#__PURE__*/jsxRuntime.jsxs(Layout.Spacer, {
|
|
@@ -3610,7 +3641,6 @@ var HamburgerCtaBlock = _ref => {
|
|
|
3610
3641
|
application: application,
|
|
3611
3642
|
"data-testid": "header-apply-now-mobile"
|
|
3612
3643
|
}), /*#__PURE__*/jsxRuntime.jsx(TalkToExpertButton, {
|
|
3613
|
-
openCommPanel: openCommPanel,
|
|
3614
3644
|
talkTo: talkTo,
|
|
3615
3645
|
"data-testid": "header-talk-to-expert-mobile"
|
|
3616
3646
|
})]
|
|
@@ -3710,7 +3740,6 @@ var LoggedInContent = _ref2 => {
|
|
|
3710
3740
|
handleApplyNowClick,
|
|
3711
3741
|
application,
|
|
3712
3742
|
talkTo,
|
|
3713
|
-
openCommPanel,
|
|
3714
3743
|
onLogout
|
|
3715
3744
|
} = _ref2;
|
|
3716
3745
|
var {
|
|
@@ -3731,7 +3760,6 @@ var LoggedInContent = _ref2 => {
|
|
|
3731
3760
|
"data-testid": "header-dropdown-apply-now"
|
|
3732
3761
|
})
|
|
3733
3762
|
}), /*#__PURE__*/jsxRuntime.jsx(TalkToExpertButton, {
|
|
3734
|
-
openCommPanel: openCommPanel,
|
|
3735
3763
|
talkTo: talkTo,
|
|
3736
3764
|
"data-testid": "header-dropdown-talk-to-broker"
|
|
3737
3765
|
})]
|
|
@@ -3879,7 +3907,6 @@ var AccountDropdown = _ref3 => {
|
|
|
3879
3907
|
session,
|
|
3880
3908
|
handleApplyNowClick,
|
|
3881
3909
|
talkTo,
|
|
3882
|
-
openCommPanel,
|
|
3883
3910
|
onLogout
|
|
3884
3911
|
} = _ref3;
|
|
3885
3912
|
var isAuthenticated = (session === null || session === void 0 ? void 0 : session.status) === lalaReact.Status.Authenticated;
|
|
@@ -3901,7 +3928,6 @@ var AccountDropdown = _ref3 => {
|
|
|
3901
3928
|
talkTo: talkTo,
|
|
3902
3929
|
application: application,
|
|
3903
3930
|
handleApplyNowClick: handleApplyNowClick,
|
|
3904
|
-
openCommPanel: openCommPanel,
|
|
3905
3931
|
onLogout: onLogout,
|
|
3906
3932
|
"data-testid": "header-menu-link-log-out"
|
|
3907
3933
|
}) : /*#__PURE__*/jsxRuntime.jsx(LoggedOutContent, {})
|
|
@@ -3913,7 +3939,6 @@ var AccountSlideoutMenu = _ref4 => {
|
|
|
3913
3939
|
application,
|
|
3914
3940
|
talkTo,
|
|
3915
3941
|
handleApplyNowClick,
|
|
3916
|
-
openCommPanel,
|
|
3917
3942
|
onLogout
|
|
3918
3943
|
} = _ref4;
|
|
3919
3944
|
var {
|
|
@@ -3959,7 +3984,6 @@ var AccountSlideoutMenu = _ref4 => {
|
|
|
3959
3984
|
talkTo: talkTo,
|
|
3960
3985
|
application: application,
|
|
3961
3986
|
handleApplyNowClick: handleApplyNowClick,
|
|
3962
|
-
openCommPanel: openCommPanel,
|
|
3963
3987
|
onLogout: onLogout
|
|
3964
3988
|
}) : /*#__PURE__*/jsxRuntime.jsx(LoggedOutContent, {})
|
|
3965
3989
|
})]
|
|
@@ -3972,46 +3996,50 @@ var CtaNav = _ref => {
|
|
|
3972
3996
|
session,
|
|
3973
3997
|
application,
|
|
3974
3998
|
talkTo,
|
|
3975
|
-
openCommPanel,
|
|
3976
3999
|
onLogout,
|
|
3977
|
-
isExperiment
|
|
4000
|
+
isExperiment,
|
|
4001
|
+
isAuthenticated
|
|
3978
4002
|
} = _ref;
|
|
3979
4003
|
return /*#__PURE__*/jsxRuntime.jsxs(Layout.Spacer, {
|
|
3980
4004
|
xalign: "center",
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
})
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
4005
|
+
gap: "0",
|
|
4006
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(Layout.Spacer, {
|
|
4007
|
+
xalign: "center",
|
|
4008
|
+
gap: "xs",
|
|
4009
|
+
end: "8",
|
|
4010
|
+
width: "unset",
|
|
4011
|
+
children: [isExperiment ? /*#__PURE__*/jsxRuntime.jsx(ShowFromTweakExtraLarge, {
|
|
4012
|
+
children: /*#__PURE__*/jsxRuntime.jsx(TalkToExpertButton, {
|
|
4013
|
+
talkTo: talkTo,
|
|
4014
|
+
"data-testid": "header-talk-to-broker-desktop"
|
|
4015
|
+
})
|
|
4016
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(ShowFromTweakLarge, {
|
|
4017
|
+
children: /*#__PURE__*/jsxRuntime.jsx(TalkToExpertButton, {
|
|
4018
|
+
talkTo: talkTo,
|
|
4019
|
+
"data-testid": "header-talk-to-broker-desktop"
|
|
4020
|
+
})
|
|
4021
|
+
}), /*#__PURE__*/jsxRuntime.jsx(ShowFromSmall, {
|
|
4022
|
+
children: /*#__PURE__*/jsxRuntime.jsx(PrimaryCTA, {
|
|
4023
|
+
handleApplyNowClick: handleApplyNowClick,
|
|
4024
|
+
application: application,
|
|
4025
|
+
isAuthenticated: isAuthenticated,
|
|
4026
|
+
"data-testid": "header-apply-now-desktop"
|
|
4027
|
+
})
|
|
4028
|
+
}), /*#__PURE__*/jsxRuntime.jsx(HideFromMedium, {
|
|
4029
|
+
children: /*#__PURE__*/jsxRuntime.jsx(AccountSlideoutMenu, {
|
|
4030
|
+
handleApplyNowClick: handleApplyNowClick,
|
|
4031
|
+
session: session,
|
|
4032
|
+
talkTo: talkTo,
|
|
4033
|
+
application: application,
|
|
4034
|
+
onLogout: onLogout
|
|
4035
|
+
})
|
|
4036
|
+
})]
|
|
3999
4037
|
}), /*#__PURE__*/jsxRuntime.jsx(ShowFromMedium, {
|
|
4000
4038
|
children: /*#__PURE__*/jsxRuntime.jsx(AccountDropdown, {
|
|
4001
4039
|
handleApplyNowClick: handleApplyNowClick,
|
|
4002
4040
|
session: session,
|
|
4003
4041
|
talkTo: talkTo,
|
|
4004
4042
|
application: application,
|
|
4005
|
-
openCommPanel: openCommPanel,
|
|
4006
|
-
onLogout: onLogout
|
|
4007
|
-
})
|
|
4008
|
-
}), /*#__PURE__*/jsxRuntime.jsx(HideFromMedium, {
|
|
4009
|
-
children: /*#__PURE__*/jsxRuntime.jsx(AccountSlideoutMenu, {
|
|
4010
|
-
handleApplyNowClick: handleApplyNowClick,
|
|
4011
|
-
session: session,
|
|
4012
|
-
talkTo: talkTo,
|
|
4013
|
-
application: application,
|
|
4014
|
-
openCommPanel: openCommPanel,
|
|
4015
4043
|
onLogout: onLogout
|
|
4016
4044
|
})
|
|
4017
4045
|
})]
|
|
@@ -4101,21 +4129,16 @@ var HeaderWithContext = _ref => {
|
|
|
4101
4129
|
onLogout,
|
|
4102
4130
|
navOptions = [],
|
|
4103
4131
|
// Internal props, from ChatProps
|
|
4104
|
-
isCommPanelOpen,
|
|
4105
|
-
closeCommPanel,
|
|
4106
|
-
openCommPanel: _openCommPanel,
|
|
4107
4132
|
customerOwner,
|
|
4108
4133
|
storeName,
|
|
4109
4134
|
isExperiment
|
|
4110
4135
|
} = _ref;
|
|
4111
4136
|
var session = lalaReact.useSession();
|
|
4112
4137
|
var application = useApplication(session);
|
|
4113
|
-
var
|
|
4114
|
-
cmsNavbarBrokerNameButton
|
|
4115
|
-
} = launchdarkly.useFlags();
|
|
4138
|
+
var isAuthenticated = (session === null || session === void 0 ? void 0 : session.status) === lalaReact.Status.Authenticated;
|
|
4116
4139
|
// to set AHL value in session storage for funnel1 journey
|
|
4117
4140
|
useAHLParam();
|
|
4118
|
-
var textForTalkTo =
|
|
4141
|
+
var textForTalkTo = "Talk to ".concat(trimStringWithEllipsis((customerOwner === null || customerOwner === void 0 ? void 0 : customerOwner.firstName) || storeName || 'a broker'));
|
|
4119
4142
|
var navbarMenu = isExperiment ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
4120
4143
|
children: [/*#__PURE__*/jsxRuntime.jsx(ShowFromTweakExtraLarge, {
|
|
4121
4144
|
children: /*#__PURE__*/jsxRuntime.jsx(Nav, {
|
|
@@ -4126,8 +4149,7 @@ var HeaderWithContext = _ref => {
|
|
|
4126
4149
|
handleApplyNowClick: handleApplyNow,
|
|
4127
4150
|
application: application,
|
|
4128
4151
|
talkTo: textForTalkTo,
|
|
4129
|
-
navOptions: navOptions
|
|
4130
|
-
openCommPanel: () => isCommPanelOpen ? closeCommPanel() : _openCommPanel()
|
|
4152
|
+
navOptions: navOptions
|
|
4131
4153
|
})
|
|
4132
4154
|
})]
|
|
4133
4155
|
}) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
@@ -4140,8 +4162,7 @@ var HeaderWithContext = _ref => {
|
|
|
4140
4162
|
handleApplyNowClick: handleApplyNow,
|
|
4141
4163
|
application: application,
|
|
4142
4164
|
talkTo: textForTalkTo,
|
|
4143
|
-
navOptions: navOptions
|
|
4144
|
-
openCommPanel: () => isCommPanelOpen ? closeCommPanel() : _openCommPanel()
|
|
4165
|
+
navOptions: navOptions
|
|
4145
4166
|
})
|
|
4146
4167
|
})]
|
|
4147
4168
|
});
|
|
@@ -4153,9 +4174,9 @@ var HeaderWithContext = _ref => {
|
|
|
4153
4174
|
application: application,
|
|
4154
4175
|
session: session,
|
|
4155
4176
|
talkTo: textForTalkTo,
|
|
4156
|
-
openCommPanel: () => isCommPanelOpen ? closeCommPanel() : _openCommPanel(),
|
|
4157
4177
|
onLogout: onLogout,
|
|
4158
|
-
isExperiment: isExperiment
|
|
4178
|
+
isExperiment: isExperiment,
|
|
4179
|
+
isAuthenticated: isAuthenticated
|
|
4159
4180
|
})
|
|
4160
4181
|
});
|
|
4161
4182
|
};
|