@financial-times/dotcom-ui-header 9.0.0-beta.9 → 9.0.2
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/browser.js +3 -7
- package/dist/node/components/drawer/additionalPartials.d.ts +6 -6
- package/dist/node/components/drawer/additionalPartials.js +10 -5
- package/dist/node/components/drawer/topLevelPartials.d.ts +2 -2
- package/dist/node/components/navigation/partials.d.ts +6 -6
- package/dist/node/components/search/partials.d.ts +2 -2
- package/dist/node/components/sticky/partials.d.ts +5 -5
- package/dist/node/components/sticky/partials.js +4 -8
- package/dist/node/components/sub-navigation/partials.d.ts +2 -2
- package/dist/node/components/svg-components/BrandFtMasthead.d.ts +2 -2
- package/dist/node/components/top/partials.d.ts +10 -12
- package/dist/node/components/top/partials.js +8 -14
- package/dist/node/index.d.ts +7 -7
- package/dist/node/index.js +2 -4
- package/dist/node/utils.js +2 -1
- package/dist/tsconfig.tsbuildinfo +1410 -567
- package/package.json +9 -9
- package/src/__test__/components/__snapshots__/MainHeader.spec.tsx.snap +3 -3
- package/src/__test__/output/component.spec.tsx +113 -0
- package/src/__test__/output/drawer.spec.tsx +124 -0
- package/src/components/sticky/partials.tsx +16 -16
- package/src/components/top/partials.tsx +17 -21
- package/src/index.tsx +2 -14
- package/styles.scss +4 -8
- package/src/__test__/enzyme/component.spec.tsx +0 -107
- package/src/__test__/enzyme/drawer.spec.tsx +0 -114
- package/src/enhanced-search/customList.js +0 -168
- package/src/enhanced-search/enhancedSearch.js +0 -59
- package/src/enhanced-search/styles.scss +0 -146
package/browser.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import Header from '@financial-times/o-header'
|
|
2
2
|
import TopicSearch from 'n-topic-search'
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
/**
|
|
5
5
|
* @typedef HeaderOptions
|
|
6
6
|
* @property { HTMLElement } [rootElement] - the root element passed to o-header
|
|
7
7
|
* @property { string } [hostName]
|
|
8
|
-
* @property { 'open' | 'close' } [searchState]
|
|
9
|
-
* @property { string } [enhancedSearchUrl]
|
|
10
8
|
*/
|
|
11
9
|
|
|
12
10
|
/**
|
|
@@ -18,12 +16,10 @@ export const init = (headerOptions = {}) => {
|
|
|
18
16
|
'.o-header [data-n-topic-search], .o-header__drawer [data-n-topic-search]'
|
|
19
17
|
)
|
|
20
18
|
topicSearchElements.forEach((element) => {
|
|
21
|
-
headerOptions
|
|
22
|
-
? new EnhancedSearch(element, headerOptions)
|
|
23
|
-
: new TopicSearch(element, headerOptions)
|
|
19
|
+
new TopicSearch(element, headerOptions)
|
|
24
20
|
})
|
|
25
21
|
|
|
26
|
-
Header.init(headerOptions.rootElement
|
|
22
|
+
Header.init(headerOptions.rootElement)
|
|
27
23
|
}
|
|
28
24
|
|
|
29
25
|
export { Header as OrigamiHeader }
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { TNavMenuItem, TNavEditions, TNavAction } from '@financial-times/dotcom-types-navigation';
|
|
3
3
|
export declare type TDrawerParentItemProps = {
|
|
4
4
|
item: TNavMenuItem;
|
|
5
5
|
idSuffix: string;
|
|
6
6
|
};
|
|
7
|
-
export declare const DrawerParentItem: ({ item, idSuffix }: TDrawerParentItemProps) => JSX.Element;
|
|
8
|
-
export declare const DrawerSingleItem: (item: TNavMenuItem) => JSX.Element;
|
|
9
|
-
export declare const DrawerSpecialItem: (item: TNavMenuItem) => JSX.Element;
|
|
10
|
-
export declare const EditionsSwitcher: (editions: TNavEditions) => JSX.Element;
|
|
11
|
-
export declare const SubscribeButton: (action: TNavAction) => JSX.Element;
|
|
7
|
+
export declare const DrawerParentItem: ({ item, idSuffix }: TDrawerParentItemProps) => React.JSX.Element;
|
|
8
|
+
export declare const DrawerSingleItem: (item: TNavMenuItem) => React.JSX.Element;
|
|
9
|
+
export declare const DrawerSpecialItem: (item: TNavMenuItem) => React.JSX.Element;
|
|
10
|
+
export declare const EditionsSwitcher: (editions: TNavEditions) => React.JSX.Element;
|
|
11
|
+
export declare const SubscribeButton: (action: TNavAction) => React.JSX.Element;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.SubscribeButton = exports.EditionsSwitcher = exports.DrawerSpecialItem = exports.DrawerSingleItem = exports.DrawerParentItem = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const utils_1 = require("../../utils");
|
|
9
|
-
|
|
9
|
+
const DrawerParentItem = ({ item, idSuffix }) => {
|
|
10
10
|
var _a, _b;
|
|
11
11
|
const selected = item.selected ? 'selected' : 'unselected';
|
|
12
12
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
@@ -20,17 +20,20 @@ exports.DrawerParentItem = ({ item, idSuffix }) => {
|
|
|
20
20
|
react_1.default.createElement("a", Object.assign({ className: `o-header__drawer-menu-link o-header__drawer-menu-link--${selected} o-header__drawer-menu-link--child`, href: (_a = item.url) !== null && _a !== void 0 ? _a : undefined, "data-trackable": item.label }, utils_1.ariaSelected(item)), item.label)));
|
|
21
21
|
}))));
|
|
22
22
|
};
|
|
23
|
-
exports.
|
|
23
|
+
exports.DrawerParentItem = DrawerParentItem;
|
|
24
|
+
const DrawerSingleItem = (item) => {
|
|
24
25
|
var _a;
|
|
25
26
|
const selected = item.selected ? 'selected' : 'unselected';
|
|
26
27
|
return (react_1.default.createElement("a", Object.assign({ className: `o-header__drawer-menu-link o-header__drawer-menu-link--${selected}`, href: (_a = item.url) !== null && _a !== void 0 ? _a : undefined, "data-trackable": item.label }, utils_1.ariaSelected(item)), item.label));
|
|
27
28
|
};
|
|
28
|
-
exports.
|
|
29
|
+
exports.DrawerSingleItem = DrawerSingleItem;
|
|
30
|
+
const DrawerSpecialItem = (item) => {
|
|
29
31
|
var _a;
|
|
30
32
|
const selected = item.selected ? 'selected' : 'unselected';
|
|
31
33
|
return (react_1.default.createElement("a", Object.assign({ className: `o-header__drawer-menu-link o-header__drawer-menu-link--${selected} o-header__drawer-menu-link--secondary`, href: (_a = item.url) !== null && _a !== void 0 ? _a : undefined, "data-trackable": item.label }, utils_1.ariaSelected(item)), item.label));
|
|
32
34
|
};
|
|
33
|
-
exports.
|
|
35
|
+
exports.DrawerSpecialItem = DrawerSpecialItem;
|
|
36
|
+
const EditionsSwitcher = (editions) => (react_1.default.createElement("ul", { className: "o-header__drawer-menu-list" }, editions.others.map(({ id, name, url }) => {
|
|
34
37
|
const href = `${url}?edition=${id}`;
|
|
35
38
|
return (react_1.default.createElement("li", { key: id, className: "o-header__drawer-menu-item", "data-trackable": "edition-switcher" },
|
|
36
39
|
react_1.default.createElement("a", { className: "o-header__drawer-menu-link", href: href, "data-trackable": id },
|
|
@@ -38,5 +41,7 @@ exports.EditionsSwitcher = (editions) => (react_1.default.createElement("ul", {
|
|
|
38
41
|
name,
|
|
39
42
|
" Edition")));
|
|
40
43
|
})));
|
|
41
|
-
exports.
|
|
44
|
+
exports.EditionsSwitcher = EditionsSwitcher;
|
|
45
|
+
const SubscribeButton = (action) => (react_1.default.createElement("div", { className: "o-header__drawer-actions" },
|
|
42
46
|
react_1.default.createElement("a", { className: "o-header__drawer-button", role: "button", href: action.url, "data-trackable": "subscribe-button" }, action.name)));
|
|
47
|
+
exports.SubscribeButton = SubscribeButton;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
declare const IncludeDrawer: (props: any) => JSX.Element;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const IncludeDrawer: (props: any) => React.JSX.Element;
|
|
3
3
|
export { IncludeDrawer };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { THeaderProps } from '../../interfaces';
|
|
3
|
-
declare const MobileNav: (props: THeaderProps) => JSX.Element | null;
|
|
4
|
-
declare const NavDesktop: (props: any) => JSX.Element;
|
|
5
|
-
declare const NavListLeft: (props: THeaderProps) => JSX.Element;
|
|
6
|
-
declare const NavListRight: (props: THeaderProps) => JSX.Element | null;
|
|
7
|
-
declare const UserActionsNav: (props: THeaderProps) => JSX.Element;
|
|
3
|
+
declare const MobileNav: (props: THeaderProps) => React.JSX.Element | null;
|
|
4
|
+
declare const NavDesktop: (props: any) => React.JSX.Element;
|
|
5
|
+
declare const NavListLeft: (props: THeaderProps) => React.JSX.Element;
|
|
6
|
+
declare const NavListRight: (props: THeaderProps) => React.JSX.Element | null;
|
|
7
|
+
declare const UserActionsNav: (props: THeaderProps) => React.JSX.Element;
|
|
8
8
|
export { NavDesktop, NavListLeft, NavListRight, UserActionsNav, MobileNav };
|
|
@@ -2,9 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import { THeaderProps } from '../../interfaces';
|
|
3
3
|
declare const StickyHeaderWrapper: (props: THeaderProps & {
|
|
4
4
|
children: React.ReactNode;
|
|
5
|
-
}) => JSX.Element;
|
|
6
|
-
declare const TopWrapperSticky: (props: any) => JSX.Element;
|
|
7
|
-
declare const TopColumnLeftSticky: () => JSX.Element;
|
|
8
|
-
declare const TopColumnCenterSticky: (props: THeaderProps) => JSX.Element;
|
|
9
|
-
declare const TopColumnRightSticky: (props: THeaderProps) => JSX.Element;
|
|
5
|
+
}) => React.JSX.Element;
|
|
6
|
+
declare const TopWrapperSticky: (props: any) => React.JSX.Element;
|
|
7
|
+
declare const TopColumnLeftSticky: () => React.JSX.Element;
|
|
8
|
+
declare const TopColumnCenterSticky: (props: THeaderProps) => React.JSX.Element;
|
|
9
|
+
declare const TopColumnRightSticky: (props: THeaderProps) => React.JSX.Element;
|
|
10
10
|
export { StickyHeaderWrapper, TopWrapperSticky, TopColumnLeftSticky, TopColumnCenterSticky, TopColumnRightSticky };
|
|
@@ -31,12 +31,8 @@ const NavListRightAnonSticky = (props) => {
|
|
|
31
31
|
subscribeAction && (react_1.default.createElement(partials_1.SubscribeButton, { item: subscribeAction, variant: "sticky", className: "o-header__top-button--hide-m" })),
|
|
32
32
|
signInAction && react_1.default.createElement(partials_1.SignInLink, { item: signInAction, variant: "sticky", className: "" }))));
|
|
33
33
|
};
|
|
34
|
-
const MyFtSticky = ({ className
|
|
35
|
-
|
|
36
|
-
const ftUrl = (_a = items === null || items === void 0 ? void 0 : items.find((el) => el.label === 'myFT')) === null || _a === void 0 ? void 0 : _a.url;
|
|
37
|
-
return (react_1.default.createElement("a", { className: `o-header__top-icon-link o-header__top-icon-link--myft ${className}`, href: ftUrl !== null && ftUrl !== void 0 ? ftUrl : '/myft', "data-trackable": "my-ft", tabIndex: -1 },
|
|
38
|
-
react_1.default.createElement("span", { className: "o-header__visually-hidden" }, "myFT")));
|
|
39
|
-
};
|
|
34
|
+
const MyFtSticky = ({ className }) => (react_1.default.createElement("a", { className: `o-header__top-icon-link o-header__top-icon-link--myft ${className}`, href: "/myft", "data-trackable": "my-ft", tabIndex: -1 },
|
|
35
|
+
react_1.default.createElement("span", { className: "o-header__visually-hidden" }, "myFT")));
|
|
40
36
|
const TopWrapperSticky = (props) => (react_1.default.createElement("div", { className: "o-header__row o-header__top", "data-trackable": "header-sticky" },
|
|
41
37
|
react_1.default.createElement("div", { className: "o-header__container" },
|
|
42
38
|
react_1.default.createElement("div", { className: "o-header__top-wrapper" }, props.children))));
|
|
@@ -54,11 +50,11 @@ const TopColumnCenterSticky = (props) => {
|
|
|
54
50
|
};
|
|
55
51
|
exports.TopColumnCenterSticky = TopColumnCenterSticky;
|
|
56
52
|
const NavListRightLoggedInSticky = (props) => {
|
|
57
|
-
var _a
|
|
53
|
+
var _a;
|
|
58
54
|
const subscribeAction = (_a = props.data['navbar-right-anon'].items) === null || _a === void 0 ? void 0 : _a[1];
|
|
59
55
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
60
56
|
!props.userIsSubscribed && subscribeAction && (react_1.default.createElement(partials_1.SubscribeButton, { item: subscribeAction, variant: "sticky", className: "o-header__top-button--hide-m" })),
|
|
61
|
-
react_1.default.createElement(MyFtSticky, { className: ""
|
|
57
|
+
react_1.default.createElement(MyFtSticky, { className: "" })));
|
|
62
58
|
};
|
|
63
59
|
// This behaviour is similar to `NavListRight` in '../navigation/partials' but:
|
|
64
60
|
// - The sticky header renders either the `navbar-right-anon` data or the myFT component
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { THeaderProps } from '../../interfaces';
|
|
3
|
-
declare const SubNavigation: (props: THeaderProps) => JSX.Element;
|
|
3
|
+
declare const SubNavigation: (props: THeaderProps) => React.JSX.Element;
|
|
4
4
|
export { SubNavigation };
|
|
@@ -1,26 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { THeaderProps } from '../../interfaces';
|
|
3
3
|
import { TNavMenuItem } from '@financial-times/dotcom-types-navigation';
|
|
4
|
-
declare const HeaderWrapper: (props: any) => JSX.Element;
|
|
5
|
-
declare const TopWrapper: (props: any) => JSX.Element;
|
|
6
|
-
declare const TopColumnLeft: () => JSX.Element;
|
|
7
|
-
declare const TopColumnCenter: (
|
|
8
|
-
|
|
9
|
-
}) => JSX.Element;
|
|
10
|
-
declare const TopColumnCenterNoLink: () => JSX.Element;
|
|
4
|
+
declare const HeaderWrapper: (props: any) => React.JSX.Element;
|
|
5
|
+
declare const TopWrapper: (props: any) => React.JSX.Element;
|
|
6
|
+
declare const TopColumnLeft: () => React.JSX.Element;
|
|
7
|
+
declare const TopColumnCenter: () => React.JSX.Element;
|
|
8
|
+
declare const TopColumnCenterNoLink: () => React.JSX.Element;
|
|
11
9
|
declare const SignInLink: ({ item, variant, className }: {
|
|
12
10
|
item: TNavMenuItem;
|
|
13
11
|
variant?: string | undefined;
|
|
14
12
|
className?: string | undefined;
|
|
15
|
-
}) => JSX.Element;
|
|
13
|
+
}) => React.JSX.Element;
|
|
16
14
|
declare const SubscribeButton: ({ item, variant, className }: {
|
|
17
15
|
item: TNavMenuItem;
|
|
18
16
|
variant?: string | undefined;
|
|
19
17
|
className?: string | undefined;
|
|
20
|
-
}) => JSX.Element;
|
|
18
|
+
}) => React.JSX.Element;
|
|
21
19
|
declare const TopColumnRightAnon: ({ items, variant }: {
|
|
22
20
|
items: TNavMenuItem[];
|
|
23
21
|
variant?: string | undefined;
|
|
24
|
-
}) => JSX.Element;
|
|
25
|
-
declare const TopColumnRight: (props: THeaderProps) => JSX.Element;
|
|
22
|
+
}) => React.JSX.Element;
|
|
23
|
+
declare const TopColumnRight: (props: THeaderProps) => React.JSX.Element;
|
|
26
24
|
export { HeaderWrapper, TopWrapper, TopColumnLeft, TopColumnCenter, TopColumnCenterNoLink, TopColumnRight, TopColumnRightAnon, SubscribeButton, SignInLink };
|
|
@@ -12,12 +12,8 @@ const DrawerIcon = () => (react_1.default.createElement("a", { href: "#o-header-
|
|
|
12
12
|
react_1.default.createElement("span", { className: "o-header__top-link-label" }, "Open side navigation menu")));
|
|
13
13
|
const SearchIcon = () => (react_1.default.createElement("a", { href: `#o-header-search-primary`, className: "o-header__top-icon-link o-header__top-icon-link--search", "aria-controls": `o-header-search-primary`, title: "Open search bar", "data-trackable": "search-toggle" },
|
|
14
14
|
react_1.default.createElement("span", { className: "o-header__top-link-label" }, "Open search bar")));
|
|
15
|
-
const MyFt = ({ className
|
|
16
|
-
|
|
17
|
-
const ftUrl = (_a = items === null || items === void 0 ? void 0 : items.find((el) => el.label === 'myFT')) === null || _a === void 0 ? void 0 : _a.url;
|
|
18
|
-
return (react_1.default.createElement("a", { className: `o-header__top-icon-link o-header__top-icon-link--myft ${className}`, id: "o-header-top-link-myft", href: ftUrl !== null && ftUrl !== void 0 ? ftUrl : '/myft', "data-trackable": "my-ft", "data-tour-stage": "myFt", "aria-label": "My F T" },
|
|
19
|
-
react_1.default.createElement("span", { className: "o-header__visually-hidden" }, "myFT")));
|
|
20
|
-
};
|
|
15
|
+
const MyFt = ({ className }) => (react_1.default.createElement("a", { className: `o-header__top-icon-link o-header__top-icon-link--myft ${className}`, id: "o-header-top-link-myft", href: "/myft", "data-trackable": "my-ft", "data-tour-stage": "myFt", "aria-label": "My F T" },
|
|
16
|
+
react_1.default.createElement("span", { className: "o-header__visually-hidden" }, "myFT")));
|
|
21
17
|
const TopWrapper = (props) => (react_1.default.createElement("div", { className: "o-header__row o-header__top", "data-trackable": "header-top" },
|
|
22
18
|
react_1.default.createElement("div", { className: "o-header__container" },
|
|
23
19
|
react_1.default.createElement("div", { className: "o-header__top-wrapper" }, props.children))));
|
|
@@ -26,8 +22,8 @@ const TopColumnLeft = () => (react_1.default.createElement("div", { className: "
|
|
|
26
22
|
react_1.default.createElement(DrawerIcon, null),
|
|
27
23
|
react_1.default.createElement(SearchIcon, null)));
|
|
28
24
|
exports.TopColumnLeft = TopColumnLeft;
|
|
29
|
-
const TopColumnCenter = (
|
|
30
|
-
react_1.default.createElement("a", { className: "o-header__top-logo", style: { backgroundImage: 'none' }, "data-trackable": "logo", href:
|
|
25
|
+
const TopColumnCenter = () => (react_1.default.createElement("div", { className: "o-header__top-column o-header__top-column--center" },
|
|
26
|
+
react_1.default.createElement("a", { className: "o-header__top-logo", style: { backgroundImage: 'none' }, "data-trackable": "logo", href: "/", title: "Go to Financial Times homepage" },
|
|
31
27
|
react_1.default.createElement(BrandFtMasthead_1.default, { title: "Financial Times" }))));
|
|
32
28
|
exports.TopColumnCenter = TopColumnCenter;
|
|
33
29
|
const TopColumnCenterNoLink = () => (react_1.default.createElement("div", { className: "o-header__top-column o-header__top-column--center" },
|
|
@@ -35,11 +31,11 @@ const TopColumnCenterNoLink = () => (react_1.default.createElement("div", { clas
|
|
|
35
31
|
react_1.default.createElement(BrandFtMasthead_1.default, { title: "Financial Times" }))));
|
|
36
32
|
exports.TopColumnCenterNoLink = TopColumnCenterNoLink;
|
|
37
33
|
const TopColumnRightLoggedIn = (props) => {
|
|
38
|
-
var _a, _b
|
|
34
|
+
var _a, _b;
|
|
39
35
|
const subscribeAction = (_b = (_a = props.data['navbar-right-anon']) === null || _a === void 0 ? void 0 : _a.items) === null || _b === void 0 ? void 0 : _b[1];
|
|
40
36
|
return (react_1.default.createElement("div", { className: "o-header__top-column o-header__top-column--right" },
|
|
41
37
|
!props.userIsSubscribed && subscribeAction && (react_1.default.createElement(SubscribeButton, { item: subscribeAction, variant: props.variant, className: "o-header__top-button--hide-m" })),
|
|
42
|
-
react_1.default.createElement(MyFt, { className: ""
|
|
38
|
+
react_1.default.createElement(MyFt, { className: "" })));
|
|
43
39
|
};
|
|
44
40
|
const SignInLink = ({ item, variant, className }) => {
|
|
45
41
|
var _a;
|
|
@@ -62,18 +58,16 @@ const TopColumnRightAnon = ({ items, variant }) => {
|
|
|
62
58
|
return (react_1.default.createElement("div", { className: "o-header__top-column o-header__top-column--right" },
|
|
63
59
|
subscribeAction && (react_1.default.createElement(SubscribeButton, { item: subscribeAction, variant: variant, className: "o-header__top-button--hide-m" })),
|
|
64
60
|
signInAction && (react_1.default.createElement(SignInLink, { item: signInAction, variant: variant, className: "o-header__top-link--hide-m" })),
|
|
65
|
-
react_1.default.createElement(MyFt, { className: "o-header__top-icon-link--show-m"
|
|
61
|
+
react_1.default.createElement(MyFt, { className: "o-header__top-icon-link--show-m" })));
|
|
66
62
|
};
|
|
67
63
|
exports.TopColumnRightAnon = TopColumnRightAnon;
|
|
68
64
|
const TopColumnRight = (props) => {
|
|
69
|
-
var _a, _b;
|
|
70
65
|
if (props.userIsLoggedIn) {
|
|
71
66
|
return react_1.default.createElement(TopColumnRightLoggedIn, Object.assign({}, props));
|
|
72
67
|
}
|
|
73
68
|
else {
|
|
74
69
|
const userNavAnonItems = props.data['navbar-right-anon'].items;
|
|
75
|
-
|
|
76
|
-
return react_1.default.createElement(TopColumnRightAnon, { items: userNavAnonItems.concat(userNavAccountItems), variant: props.variant });
|
|
70
|
+
return react_1.default.createElement(TopColumnRightAnon, { items: userNavAnonItems, variant: props.variant });
|
|
77
71
|
}
|
|
78
72
|
};
|
|
79
73
|
exports.TopColumnRight = TopColumnRight;
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { THeaderProps, THeaderOptions } from './interfaces';
|
|
3
|
-
declare function MainHeader(props: THeaderProps): JSX.Element;
|
|
3
|
+
declare function MainHeader(props: THeaderProps): React.JSX.Element;
|
|
4
4
|
declare namespace MainHeader {
|
|
5
5
|
var defaultProps: {
|
|
6
6
|
showLogoLink: boolean;
|
|
@@ -14,23 +14,23 @@ declare namespace MainHeader {
|
|
|
14
14
|
showMegaNav?: boolean | undefined;
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
declare function StickyHeader(props: THeaderProps): JSX.Element | null;
|
|
17
|
+
declare function StickyHeader(props: THeaderProps): React.JSX.Element | null;
|
|
18
18
|
declare namespace StickyHeader {
|
|
19
19
|
var defaultProps: Partial<THeaderOptions>;
|
|
20
20
|
}
|
|
21
|
-
declare function Header(props: THeaderProps): JSX.Element;
|
|
21
|
+
declare function Header(props: THeaderProps): React.JSX.Element;
|
|
22
22
|
declare namespace Header {
|
|
23
23
|
var defaultProps: Partial<THeaderOptions>;
|
|
24
24
|
}
|
|
25
|
-
declare function LogoOnly(props: Pick<THeaderProps, 'variant' | 'showLogoLink'>): JSX.Element;
|
|
25
|
+
declare function LogoOnly(props: Pick<THeaderProps, 'variant' | 'showLogoLink'>): React.JSX.Element;
|
|
26
26
|
declare namespace LogoOnly {
|
|
27
27
|
var defaultProps: Partial<THeaderOptions>;
|
|
28
28
|
}
|
|
29
|
-
declare function Drawer(props: THeaderProps): JSX.Element;
|
|
29
|
+
declare function Drawer(props: THeaderProps): React.JSX.Element;
|
|
30
30
|
declare namespace Drawer {
|
|
31
31
|
var defaultProps: Partial<THeaderOptions>;
|
|
32
32
|
}
|
|
33
|
-
declare function NoOutboundLinksHeader(props: THeaderProps): JSX.Element;
|
|
33
|
+
declare function NoOutboundLinksHeader(props: THeaderProps): React.JSX.Element;
|
|
34
34
|
declare namespace NoOutboundLinksHeader {
|
|
35
35
|
var defaultProps: Partial<THeaderOptions>;
|
|
36
36
|
}
|
package/dist/node/index.js
CHANGED
|
@@ -20,14 +20,13 @@ const defaultProps = {
|
|
|
20
20
|
showMegaNav: true
|
|
21
21
|
};
|
|
22
22
|
function MainHeader(props) {
|
|
23
|
-
var _a, _b;
|
|
24
23
|
const includeUserActionsNav = props.showUserNavigation && !props.userIsLoggedIn;
|
|
25
24
|
const includeSubNavigation = props.showSubNavigation && (props.data.breadcrumb || props.data.subsections);
|
|
26
25
|
return (react_1.default.createElement(partials_1.HeaderWrapper, Object.assign({}, props),
|
|
27
26
|
includeUserActionsNav ? react_1.default.createElement(partials_2.UserActionsNav, Object.assign({}, props)) : null,
|
|
28
27
|
react_1.default.createElement(partials_1.TopWrapper, null,
|
|
29
28
|
react_1.default.createElement(partials_1.TopColumnLeft, null),
|
|
30
|
-
props.showLogoLink ?
|
|
29
|
+
props.showLogoLink ? react_1.default.createElement(partials_1.TopColumnCenter, null) : react_1.default.createElement(partials_1.TopColumnCenterNoLink, null),
|
|
31
30
|
react_1.default.createElement(partials_1.TopColumnRight, Object.assign({}, props))),
|
|
32
31
|
react_1.default.createElement(partials_5.Search, { instance: "primary" }),
|
|
33
32
|
react_1.default.createElement(partials_2.MobileNav, Object.assign({}, props)),
|
|
@@ -67,12 +66,11 @@ function Drawer(props) {
|
|
|
67
66
|
exports.Drawer = Drawer;
|
|
68
67
|
Drawer.defaultProps = defaultProps;
|
|
69
68
|
function NoOutboundLinksHeader(props) {
|
|
70
|
-
var _a, _b;
|
|
71
69
|
const includeUserActionsNav = props.showUserNavigation && !props.userIsLoggedIn;
|
|
72
70
|
const includeSubNavigation = props.showSubNavigation && (props.data.breadcrumb || props.data.subsections);
|
|
73
71
|
return (react_1.default.createElement(partials_1.HeaderWrapper, Object.assign({}, props),
|
|
74
72
|
includeUserActionsNav ? react_1.default.createElement(partials_2.UserActionsNav, Object.assign({}, props)) : null,
|
|
75
|
-
react_1.default.createElement(partials_1.TopWrapper, null, props.showLogoLink ?
|
|
73
|
+
react_1.default.createElement(partials_1.TopWrapper, null, props.showLogoLink ? react_1.default.createElement(partials_1.TopColumnCenter, null) : react_1.default.createElement(partials_1.TopColumnCenterNoLink, null)),
|
|
76
74
|
react_1.default.createElement(partials_2.NavDesktop, null, props.showUserNavigation ? react_1.default.createElement(partials_2.NavListRight, Object.assign({}, props)) : null),
|
|
77
75
|
includeSubNavigation ? react_1.default.createElement(partials_4.SubNavigation, Object.assign({}, props)) : null));
|
|
78
76
|
}
|
package/dist/node/utils.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ariaSelected = void 0;
|
|
4
|
-
|
|
4
|
+
const ariaSelected = (item) => {
|
|
5
5
|
return item.selected ? { 'aria-label': `${item.label}, current page`, 'aria-current': 'page' } : null;
|
|
6
6
|
};
|
|
7
|
+
exports.ariaSelected = ariaSelected;
|