@financial-times/dotcom-ui-header 7.3.0 → 7.3.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/dist/node/components/drawer/additionalPartials.d.ts +11 -0
- package/dist/node/components/drawer/topLevelPartials.d.ts +3 -0
- package/dist/node/components/navigation/partials.d.ts +8 -0
- package/dist/node/components/search/partials.d.ts +5 -0
- package/dist/node/components/sticky/partials.d.ts +10 -0
- package/dist/node/components/sub-navigation/partials.d.ts +4 -0
- package/dist/node/components/svg-components/BrandFtMasthead.d.ts +6 -0
- package/dist/node/components/top/partials.d.ts +24 -0
- package/dist/node/index.d.ts +38 -0
- package/dist/node/utils.d.ts +2 -0
- package/dist/tsconfig.tsbuildinfo +2124 -0
- package/package.json +12 -6
- package/src/__stories__/demos.scss +28 -0
- package/src/__stories__/story-data/actionsUK.ts +5 -0
- package/src/__stories__/story-data/anon.ts +24 -0
- package/src/__stories__/story-data/drawerUK.ts +968 -0
- package/src/__stories__/story-data/editionsInternational.ts +8 -0
- package/src/__stories__/story-data/editionsUK.ts +8 -0
- package/src/__stories__/story-data/index.ts +41 -0
- package/src/__stories__/story-data/navbarRight.ts +19 -0
- package/src/__stories__/story-data/navbarRightAnon.ts +19 -0
- package/src/__stories__/story-data/navbarSimple.ts +24 -0
- package/src/__stories__/story-data/navbarUK.ts +996 -0
- package/src/__stories__/story-data/profile.ts +44 -0
- package/src/__stories__/story-data/subNavigationProfile.ts +27 -0
- package/src/__stories__/story-data/subNavigationUK.ts +37 -0
- package/src/__stories__/story-data/user.ts +13 -0
- package/src/__stories__/story.tsx +163 -0
- package/src/__test__/components/Drawer.spec.tsx +19 -0
- package/src/__test__/components/MainHeader.spec.tsx +26 -0
- package/src/__test__/components/NoOutboundLinks.spec.tsx +19 -0
- package/src/__test__/components/StickyHeader.spec.tsx +19 -0
- package/src/__test__/components/__snapshots__/Drawer.spec.tsx.snap +2718 -0
- package/src/__test__/components/__snapshots__/MainHeader.spec.tsx.snap +5547 -0
- package/src/__test__/components/__snapshots__/NoOutboundLinks.spec.tsx.snap +337 -0
- package/src/__test__/components/__snapshots__/StickyHeader.spec.tsx.snap +588 -0
- package/src/__test__/enzyme/component.spec.tsx +107 -0
- package/src/__test__/enzyme/drawer.spec.tsx +114 -0
- package/screenshots/header-navigation.png +0 -0
- package/screenshots/header-sub-navigation.png +0 -0
- package/screenshots/header-top-search.png +0 -0
- package/scripts/convertSvgsToReactComponents.js +0 -23
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TNavMenuItem, TNavEditions, TNavAction } from '@financial-times/dotcom-types-navigation';
|
|
3
|
+
export declare type TDrawerParentItemProps = {
|
|
4
|
+
item: TNavMenuItem;
|
|
5
|
+
idSuffix: string;
|
|
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;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
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;
|
|
8
|
+
export { NavDesktop, NavListLeft, NavListRight, UserActionsNav, MobileNav };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { THeaderProps } from '../../interfaces';
|
|
3
|
+
declare const StickyHeaderWrapper: (props: THeaderProps & {
|
|
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;
|
|
10
|
+
export { StickyHeaderWrapper, TopWrapperSticky, TopColumnLeftSticky, TopColumnCenterSticky, TopColumnRightSticky };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { THeaderProps } from '../../interfaces';
|
|
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: () => JSX.Element;
|
|
8
|
+
declare const TopColumnCenterNoLink: () => JSX.Element;
|
|
9
|
+
declare const SignInLink: ({ item, variant, className }: {
|
|
10
|
+
item: TNavMenuItem;
|
|
11
|
+
variant?: string | undefined;
|
|
12
|
+
className?: string | undefined;
|
|
13
|
+
}) => JSX.Element;
|
|
14
|
+
declare const SubscribeButton: ({ item, variant, className }: {
|
|
15
|
+
item: TNavMenuItem;
|
|
16
|
+
variant?: string | undefined;
|
|
17
|
+
className?: string | undefined;
|
|
18
|
+
}) => JSX.Element;
|
|
19
|
+
declare const TopColumnRightAnon: ({ items, variant }: {
|
|
20
|
+
items: TNavMenuItem[];
|
|
21
|
+
variant?: string | undefined;
|
|
22
|
+
}) => JSX.Element;
|
|
23
|
+
declare const TopColumnRight: (props: THeaderProps) => JSX.Element;
|
|
24
|
+
export { HeaderWrapper, TopWrapper, TopColumnLeft, TopColumnCenter, TopColumnCenterNoLink, TopColumnRight, TopColumnRightAnon, SubscribeButton, SignInLink };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { THeaderProps, THeaderOptions } from './interfaces';
|
|
3
|
+
declare function MainHeader(props: THeaderProps): JSX.Element;
|
|
4
|
+
declare namespace MainHeader {
|
|
5
|
+
var defaultProps: {
|
|
6
|
+
showLogoLink: boolean;
|
|
7
|
+
variant?: "simple" | "large-logo" | undefined;
|
|
8
|
+
userIsAnonymous?: boolean | undefined;
|
|
9
|
+
userIsLoggedIn?: boolean | undefined;
|
|
10
|
+
userIsSubscribed?: boolean | undefined;
|
|
11
|
+
showSubNavigation?: boolean | undefined;
|
|
12
|
+
showUserNavigation?: boolean | undefined;
|
|
13
|
+
showStickyHeader?: boolean | undefined;
|
|
14
|
+
showMegaNav?: boolean | undefined;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
declare function StickyHeader(props: THeaderProps): JSX.Element | null;
|
|
18
|
+
declare namespace StickyHeader {
|
|
19
|
+
var defaultProps: Partial<THeaderOptions>;
|
|
20
|
+
}
|
|
21
|
+
declare function Header(props: THeaderProps): JSX.Element;
|
|
22
|
+
declare namespace Header {
|
|
23
|
+
var defaultProps: Partial<THeaderOptions>;
|
|
24
|
+
}
|
|
25
|
+
declare function LogoOnly(props: Pick<THeaderProps, 'variant' | 'showLogoLink'>): JSX.Element;
|
|
26
|
+
declare namespace LogoOnly {
|
|
27
|
+
var defaultProps: Partial<THeaderOptions>;
|
|
28
|
+
}
|
|
29
|
+
declare function Drawer(props: THeaderProps): JSX.Element;
|
|
30
|
+
declare namespace Drawer {
|
|
31
|
+
var defaultProps: Partial<THeaderOptions>;
|
|
32
|
+
}
|
|
33
|
+
declare function NoOutboundLinksHeader(props: THeaderProps): JSX.Element;
|
|
34
|
+
declare namespace NoOutboundLinksHeader {
|
|
35
|
+
var defaultProps: Partial<THeaderOptions>;
|
|
36
|
+
}
|
|
37
|
+
export { Header, MainHeader, StickyHeader, LogoOnly, NoOutboundLinksHeader, Drawer };
|
|
38
|
+
export type { THeaderProps };
|