@financial-times/dotcom-ui-header 11.3.0 → 12.0.0
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 +1 -1
- package/dist/node/components/drawer/additionalPartials.js +4 -4
- package/dist/node/components/drawer/topLevelPartials.js +11 -11
- package/dist/node/components/navigation/partials.js +6 -6
- package/dist/node/components/sticky/partials.d.ts +1 -1
- package/dist/node/components/sticky/partials.js +2 -2
- package/dist/node/components/sub-navigation/partials.js +2 -2
- package/dist/node/components/svg-components/BrandFtMasthead.js +1 -1
- package/dist/node/components/top/partials.d.ts +6 -6
- package/dist/node/components/top/partials.js +5 -5
- package/dist/node/index.d.ts +2 -2
- package/dist/node/index.js +26 -27
- package/dist/tsconfig.tsbuildinfo +1 -2983
- package/package.json +3 -3
- package/src/__test__/components/Drawer.spec.tsx +1 -1
- package/src/__test__/components/MainHeader.spec.tsx +2 -2
- package/src/__test__/components/NoOutboundLinks.spec.tsx +1 -1
- package/src/__test__/components/StickyHeader.spec.tsx +1 -1
- package/src/__test__/components/TypeaheadIntegration.test.tsx +1 -1
- package/src/__test__/output/component.spec.tsx +1 -1
- package/src/__test__/output/drawer.spec.tsx +1 -1
- package/styles.scss +1 -1
- package/src/__stories__/demos.scss +0 -28
- package/src/__stories__/story.tsx +0 -164
- /package/src/{__stories__/story-data → __test__/fixtures}/actionsUK.ts +0 -0
- /package/src/{__stories__/story-data → __test__/fixtures}/anon.ts +0 -0
- /package/src/{__stories__/story-data → __test__/fixtures}/drawerUK.ts +0 -0
- /package/src/{__stories__/story-data → __test__/fixtures}/editionsInternational.ts +0 -0
- /package/src/{__stories__/story-data → __test__/fixtures}/editionsUK.ts +0 -0
- /package/src/{__stories__/story-data → __test__/fixtures}/index.ts +0 -0
- /package/src/{__stories__/story-data → __test__/fixtures}/navbarRight.ts +0 -0
- /package/src/{__stories__/story-data → __test__/fixtures}/navbarRightAnon.ts +0 -0
- /package/src/{__stories__/story-data → __test__/fixtures}/navbarSimple.ts +0 -0
- /package/src/{__stories__/story-data → __test__/fixtures}/navbarTopRight.ts +0 -0
- /package/src/{__stories__/story-data → __test__/fixtures}/navbarTopRightAnon.ts +0 -0
- /package/src/{__stories__/story-data → __test__/fixtures}/navbarUK.ts +0 -0
- /package/src/{__stories__/story-data → __test__/fixtures}/profile.ts +0 -0
- /package/src/{__stories__/story-data → __test__/fixtures}/subNavigationProfile.ts +0 -0
- /package/src/{__stories__/story-data → __test__/fixtures}/subNavigationUK.ts +0 -0
- /package/src/{__stories__/story-data → __test__/fixtures}/user.ts +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@financial-times/dotcom-ui-header",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.0.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"browser": "browser.js",
|
|
6
6
|
"main": "component.js",
|
|
@@ -21,8 +21,7 @@
|
|
|
21
21
|
"author": "",
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@financial-times/dotcom-types-navigation": "^
|
|
25
|
-
"n-topic-search": "^8.0.5"
|
|
24
|
+
"@financial-times/dotcom-types-navigation": "^12.0.0"
|
|
26
25
|
},
|
|
27
26
|
"devDependencies": {
|
|
28
27
|
"@financial-times/logo-images": "^1.10.1",
|
|
@@ -32,6 +31,7 @@
|
|
|
32
31
|
"peerDependencies": {
|
|
33
32
|
"@financial-times/logo-images": "^1.10.1",
|
|
34
33
|
"@financial-times/o-header": "^14.0.4",
|
|
34
|
+
"n-topic-search": "^8.0.5",
|
|
35
35
|
"n-ui-foundations": "^9.0.0 || ^10.0.0",
|
|
36
36
|
"preact": "^10.23.2",
|
|
37
37
|
"react": "17.x || 18.x",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import renderer from 'react-test-renderer'
|
|
3
|
-
import fixture from '
|
|
3
|
+
import fixture from '../fixtures/index'
|
|
4
4
|
import { Drawer as Subject } from '../../index'
|
|
5
5
|
|
|
6
6
|
const propsAnonymous = { ...fixture, userIsAnonymous: true, userIsLoggedIn: false }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import renderer from 'react-test-renderer'
|
|
3
|
-
import fixture from '
|
|
4
|
-
import profileFixture from '
|
|
3
|
+
import fixture from '../fixtures/index'
|
|
4
|
+
import profileFixture from '../fixtures/profile'
|
|
5
5
|
import { MainHeader as Subject } from '../../index'
|
|
6
6
|
|
|
7
7
|
const propsAnonymous = { ...fixture, userIsAnonymous: true, userIsLoggedIn: false }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import renderer from 'react-test-renderer'
|
|
3
|
-
import fixture from '
|
|
3
|
+
import fixture from '../fixtures/index'
|
|
4
4
|
import { NoOutboundLinksHeader as Subject } from '../../index'
|
|
5
5
|
|
|
6
6
|
const propsAnonymous = { ...fixture, userIsAnonymous: true, userIsLoggedIn: false }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import renderer from 'react-test-renderer'
|
|
3
|
-
import fixture from '
|
|
3
|
+
import fixture from '../fixtures/index'
|
|
4
4
|
import { StickyHeader as Subject } from '../../index'
|
|
5
5
|
|
|
6
6
|
const propsAnonymous = { ...fixture, userIsAnonymous: true, userIsLoggedIn: false }
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import React from 'react'
|
|
5
5
|
import { render, screen } from '@testing-library/react'
|
|
6
6
|
import '@testing-library/jest-dom'
|
|
7
|
-
import fixture from '
|
|
7
|
+
import fixture from '../fixtures/index'
|
|
8
8
|
import { Drawer, MainHeader } from '../../index'
|
|
9
9
|
|
|
10
10
|
const propsAnonymous = { ...fixture, userIsAnonymous: true, userIsLoggedIn: false }
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import React from 'react'
|
|
5
5
|
import { render } from '@testing-library/react'
|
|
6
6
|
|
|
7
|
-
import dataFixture from '
|
|
7
|
+
import dataFixture from '../fixtures/index'
|
|
8
8
|
import { Header } from '../../index'
|
|
9
9
|
|
|
10
10
|
// data.currentPath to enable the mobile header
|
package/styles.scss
CHANGED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/* Additional Origami styles */
|
|
2
|
-
/* Demo styles are not included in o-header by default */
|
|
3
|
-
|
|
4
|
-
.demo-sticky {
|
|
5
|
-
height: 240px;
|
|
6
|
-
overflow: auto;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.demo-sticky-message {
|
|
10
|
-
margin: 50px 0;
|
|
11
|
-
text-align: center;
|
|
12
|
-
font-size: 24px;
|
|
13
|
-
|
|
14
|
-
&:before,
|
|
15
|
-
&:after {
|
|
16
|
-
padding: 0 1em;
|
|
17
|
-
font-size: 75%;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.demo-sticky-message--scroll {
|
|
22
|
-
margin-bottom: 1999px;
|
|
23
|
-
|
|
24
|
-
&:before,
|
|
25
|
-
&:after {
|
|
26
|
-
content: '▼';
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import Header from '@financial-times/o-header'
|
|
3
|
-
import { OnReady } from '../../../../.storybook/components/OnReady'
|
|
4
|
-
import {
|
|
5
|
-
Header as HeaderSimple,
|
|
6
|
-
Header as HeaderLarge,
|
|
7
|
-
Drawer,
|
|
8
|
-
StickyHeader,
|
|
9
|
-
LogoOnly,
|
|
10
|
-
NoOutboundLinksHeader
|
|
11
|
-
} from '../../src'
|
|
12
|
-
import storyData from './story-data'
|
|
13
|
-
import profileStoryData from './story-data/profile'
|
|
14
|
-
import '../../styles.scss'
|
|
15
|
-
import './demos.scss'
|
|
16
|
-
|
|
17
|
-
const onReadyCallback = () => {
|
|
18
|
-
Header.init()
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export default {
|
|
22
|
-
title: 'FT / Header',
|
|
23
|
-
args: {
|
|
24
|
-
currentPath: '/'
|
|
25
|
-
},
|
|
26
|
-
argTypes: {
|
|
27
|
-
currentPath: {
|
|
28
|
-
control: {
|
|
29
|
-
type: 'radio',
|
|
30
|
-
options: { show: '/', hide: '/404' }
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export const DefaultHeaderWithDrawer = (args) => (
|
|
37
|
-
<OnReady callback={onReadyCallback}>
|
|
38
|
-
<HeaderSimple {...storyData} {...args} />
|
|
39
|
-
<Drawer {...storyData} {...args} />
|
|
40
|
-
</OnReady>
|
|
41
|
-
)
|
|
42
|
-
|
|
43
|
-
DefaultHeaderWithDrawer.story = {
|
|
44
|
-
name: 'Default header with drawer'
|
|
45
|
-
}
|
|
46
|
-
DefaultHeaderWithDrawer.args = {
|
|
47
|
-
showSubNavigation: true,
|
|
48
|
-
showMegaNav: true,
|
|
49
|
-
showUserNavigation: true,
|
|
50
|
-
userIsLoggedIn: false,
|
|
51
|
-
userIsSubscribed: false,
|
|
52
|
-
showLogoLink: false,
|
|
53
|
-
showAskButton: false
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export const DefaultHeaderWithRightAlignedSubnav = (args) => (
|
|
57
|
-
<OnReady callback={onReadyCallback}>
|
|
58
|
-
<HeaderSimple {...profileStoryData} {...args} />
|
|
59
|
-
<Drawer {...profileStoryData} {...args} />
|
|
60
|
-
</OnReady>
|
|
61
|
-
)
|
|
62
|
-
|
|
63
|
-
DefaultHeaderWithRightAlignedSubnav.story = {
|
|
64
|
-
name: 'Default header with right aligned subnav'
|
|
65
|
-
}
|
|
66
|
-
DefaultHeaderWithRightAlignedSubnav.args = {
|
|
67
|
-
showSubNavigation: true,
|
|
68
|
-
showMegaNav: true,
|
|
69
|
-
showUserNavigation: true,
|
|
70
|
-
userIsLoggedIn: true,
|
|
71
|
-
showLogoLink: false,
|
|
72
|
-
showAskButton: false
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export const LargeHeaderWithDrawer = (args) => (
|
|
76
|
-
<OnReady callback={onReadyCallback}>
|
|
77
|
-
<HeaderLarge {...storyData} {...args} />
|
|
78
|
-
<Drawer {...storyData} {...args} />
|
|
79
|
-
</OnReady>
|
|
80
|
-
)
|
|
81
|
-
|
|
82
|
-
LargeHeaderWithDrawer.story = {
|
|
83
|
-
name: 'Large header with drawer'
|
|
84
|
-
}
|
|
85
|
-
LargeHeaderWithDrawer.story = {
|
|
86
|
-
name: 'Default header with drawer'
|
|
87
|
-
}
|
|
88
|
-
LargeHeaderWithDrawer.args = {
|
|
89
|
-
showSubNavigation: true,
|
|
90
|
-
showMegaNav: true,
|
|
91
|
-
showUserNavigation: true,
|
|
92
|
-
userIsLoggedIn: false,
|
|
93
|
-
variant: 'large-logo',
|
|
94
|
-
showAskButton: false
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export const _StickyHeader = (args) => (
|
|
98
|
-
<OnReady callback={onReadyCallback}>
|
|
99
|
-
<StickyHeader {...storyData} {...args} />
|
|
100
|
-
<p className="demo-sticky-message demo-sticky-message--scroll">Scroll down</p>
|
|
101
|
-
</OnReady>
|
|
102
|
-
)
|
|
103
|
-
|
|
104
|
-
_StickyHeader.story = {
|
|
105
|
-
name: 'Sticky header'
|
|
106
|
-
}
|
|
107
|
-
_StickyHeader.args = {
|
|
108
|
-
showUserNavigation: true,
|
|
109
|
-
userIsLoggedIn: false,
|
|
110
|
-
userIsSubscribed: false,
|
|
111
|
-
showStickyHeader: false,
|
|
112
|
-
showAskButton: false
|
|
113
|
-
}
|
|
114
|
-
_StickyHeader.argTypes = {
|
|
115
|
-
currentPath: {
|
|
116
|
-
table: {
|
|
117
|
-
disable: true
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export const _LogoOnly = (args) => {
|
|
123
|
-
return <LogoOnly {...args} />
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
_LogoOnly.story = {
|
|
127
|
-
name: 'Logo only'
|
|
128
|
-
}
|
|
129
|
-
_LogoOnly.args = {
|
|
130
|
-
variant: 'simple',
|
|
131
|
-
showLogoLink: false
|
|
132
|
-
}
|
|
133
|
-
_LogoOnly.argTypes = {
|
|
134
|
-
variant: {
|
|
135
|
-
control: {
|
|
136
|
-
type: 'radio',
|
|
137
|
-
options: { default: 'simple', large: 'large' }
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
currentPath: {
|
|
141
|
-
table: {
|
|
142
|
-
disable: true
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
export const NoOutboundLinks = (args) => <NoOutboundLinksHeader {...storyData} {...args} />
|
|
148
|
-
|
|
149
|
-
NoOutboundLinks.story = {
|
|
150
|
-
name: 'No Outbound links'
|
|
151
|
-
}
|
|
152
|
-
NoOutboundLinks.args = {
|
|
153
|
-
showSubNavigation: true,
|
|
154
|
-
showUserNavigation: true,
|
|
155
|
-
userIsLoggedIn: false,
|
|
156
|
-
showLogoLink: false
|
|
157
|
-
}
|
|
158
|
-
NoOutboundLinks.argTypes = {
|
|
159
|
-
currentPath: {
|
|
160
|
-
table: {
|
|
161
|
-
disable: true
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|