@financial-times/dotcom-ui-header 11.2.1 → 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.
Files changed (41) hide show
  1. package/dist/node/components/drawer/additionalPartials.d.ts +1 -1
  2. package/dist/node/components/drawer/additionalPartials.js +4 -4
  3. package/dist/node/components/drawer/topLevelPartials.js +11 -11
  4. package/dist/node/components/navigation/partials.js +7 -7
  5. package/dist/node/components/sticky/partials.d.ts +1 -1
  6. package/dist/node/components/sticky/partials.js +2 -2
  7. package/dist/node/components/sub-navigation/partials.js +2 -2
  8. package/dist/node/components/svg-components/BrandFtMasthead.js +1 -1
  9. package/dist/node/components/top/partials.d.ts +6 -6
  10. package/dist/node/components/top/partials.js +5 -5
  11. package/dist/node/index.d.ts +2 -2
  12. package/dist/node/index.js +26 -27
  13. package/dist/tsconfig.tsbuildinfo +1 -2983
  14. package/package.json +6 -9
  15. package/src/__test__/components/Drawer.spec.tsx +1 -1
  16. package/src/__test__/components/MainHeader.spec.tsx +2 -2
  17. package/src/__test__/components/NoOutboundLinks.spec.tsx +1 -1
  18. package/src/__test__/components/StickyHeader.spec.tsx +1 -1
  19. package/src/__test__/components/TypeaheadIntegration.test.tsx +1 -1
  20. package/src/__test__/output/component.spec.tsx +1 -1
  21. package/src/__test__/output/drawer.spec.tsx +1 -1
  22. package/src/components/navigation/partials.tsx +0 -1
  23. package/styles.scss +1 -1
  24. package/src/__stories__/demos.scss +0 -28
  25. package/src/__stories__/story.tsx +0 -164
  26. /package/src/{__stories__/story-data → __test__/fixtures}/actionsUK.ts +0 -0
  27. /package/src/{__stories__/story-data → __test__/fixtures}/anon.ts +0 -0
  28. /package/src/{__stories__/story-data → __test__/fixtures}/drawerUK.ts +0 -0
  29. /package/src/{__stories__/story-data → __test__/fixtures}/editionsInternational.ts +0 -0
  30. /package/src/{__stories__/story-data → __test__/fixtures}/editionsUK.ts +0 -0
  31. /package/src/{__stories__/story-data → __test__/fixtures}/index.ts +0 -0
  32. /package/src/{__stories__/story-data → __test__/fixtures}/navbarRight.ts +0 -0
  33. /package/src/{__stories__/story-data → __test__/fixtures}/navbarRightAnon.ts +0 -0
  34. /package/src/{__stories__/story-data → __test__/fixtures}/navbarSimple.ts +0 -0
  35. /package/src/{__stories__/story-data → __test__/fixtures}/navbarTopRight.ts +0 -0
  36. /package/src/{__stories__/story-data → __test__/fixtures}/navbarTopRightAnon.ts +0 -0
  37. /package/src/{__stories__/story-data → __test__/fixtures}/navbarUK.ts +0 -0
  38. /package/src/{__stories__/story-data → __test__/fixtures}/profile.ts +0 -0
  39. /package/src/{__stories__/story-data → __test__/fixtures}/subNavigationProfile.ts +0 -0
  40. /package/src/{__stories__/story-data → __test__/fixtures}/subNavigationUK.ts +0 -0
  41. /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": "11.2.1",
3
+ "version": "12.0.0",
4
4
  "description": "",
5
5
  "browser": "browser.js",
6
6
  "main": "component.js",
@@ -15,33 +15,30 @@
15
15
  "build:node": "tsc",
16
16
  "build:svg-to-react": "node scripts/convertSvgsToReactComponents.js",
17
17
  "build": "npm run build:node",
18
- "dev": "npm run build:node -- --watch",
19
- "preinstall": "[ \"$INIT_CWD\" != \"$PWD\" ] || npm_config_yes=true npx check-engine"
18
+ "dev": "npm run build:node -- --watch"
20
19
  },
21
20
  "keywords": [],
22
21
  "author": "",
23
22
  "license": "MIT",
24
23
  "dependencies": {
25
- "@financial-times/dotcom-types-navigation": "^11.2.1",
26
- "n-topic-search": "^8.0.5"
24
+ "@financial-times/dotcom-types-navigation": "^12.0.0"
27
25
  },
28
26
  "devDependencies": {
29
27
  "@financial-times/logo-images": "^1.10.1",
30
28
  "@svgr/core": "^5.0.0",
31
- "camelcase": "^6.0.0",
32
- "check-engine": "^1.10.1"
29
+ "camelcase": "^6.0.0"
33
30
  },
34
31
  "peerDependencies": {
35
32
  "@financial-times/logo-images": "^1.10.1",
36
33
  "@financial-times/o-header": "^14.0.4",
34
+ "n-topic-search": "^8.0.5",
37
35
  "n-ui-foundations": "^9.0.0 || ^10.0.0",
38
36
  "preact": "^10.23.2",
39
37
  "react": "17.x || 18.x",
40
38
  "react-dom": "17.x || 18.x"
41
39
  },
42
40
  "engines": {
43
- "node": "18.x || 20.x",
44
- "npm": "8.x || 9.x || 10.x"
41
+ "node": "18.x || 20.x || 22.x"
45
42
  },
46
43
  "files": [
47
44
  "dist/",
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
  import renderer from 'react-test-renderer'
3
- import fixture from '../../__stories__/story-data/index'
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 '../../__stories__/story-data/index'
4
- import profileFixture from '../../__stories__/story-data/profile'
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 '../../__stories__/story-data/index'
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 '../../__stories__/story-data/index'
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 '../../__stories__/story-data/index'
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 '../../__stories__/story-data/index'
7
+ import dataFixture from '../fixtures/index'
8
8
  import { Header } from '../../index'
9
9
 
10
10
  // data.currentPath to enable the mobile header
@@ -4,7 +4,7 @@
4
4
  import React from 'react'
5
5
  import { render } from '@testing-library/react'
6
6
 
7
- import navigationData from '../../__stories__/story-data/index'
7
+ import navigationData from '../fixtures/index'
8
8
  import { Drawer as Subject } from '../../'
9
9
 
10
10
  const fixture = {
@@ -22,7 +22,6 @@ const NavMobile = ({ items }: { items: TNavMenuItem[] }) => {
22
22
  <nav
23
23
  id="o-header-nav-mobile"
24
24
  className="o-header__row o-header__nav o-header__nav--mobile"
25
- aria-hidden="true"
26
25
  data-trackable="header-nav:mobile"
27
26
  >
28
27
  <ul className="o-header__nav-list">
package/styles.scss CHANGED
@@ -1,4 +1,4 @@
1
- // This will be overridden by dotcom-ui-layout, it's necessary here for storybook builds
1
+ // This will be overridden by dotcom-ui-layout
2
2
  $system-code: 'page-kit-header' !default;
3
3
 
4
4
  @import 'n-ui-foundations/mixins';
@@ -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
- }