@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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@financial-times/dotcom-ui-header",
|
|
3
|
-
"version": "7.3.
|
|
3
|
+
"version": "7.3.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"browser": "browser.js",
|
|
6
6
|
"main": "component.js",
|
|
@@ -8,14 +8,13 @@
|
|
|
8
8
|
"styles": "styles.scss",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
11
|
-
"tsc": "../../node_modules/.bin/tsc --incremental",
|
|
12
11
|
"clean": "npm run clean:dist && npm run clean:node_modules",
|
|
13
12
|
"clean:dist": "rm -rf dist",
|
|
14
13
|
"clean:node_modules": "rm -rf node_modules",
|
|
15
14
|
"clean:install": "npm run clean && npm i",
|
|
16
|
-
"build": "
|
|
17
|
-
"build:node": "npm run tsc -- --module commonjs --outDir ./dist/node",
|
|
15
|
+
"build:node": "tsc",
|
|
18
16
|
"build:svg-to-react": "node scripts/convertSvgsToReactComponents.js",
|
|
17
|
+
"build": "npm run build:node",
|
|
19
18
|
"dev": "npm run build:node -- --watch",
|
|
20
19
|
"preinstall": "[ \"$INIT_CWD\" != \"$PWD\" ] || npm_config_yes=true npx check-engine"
|
|
21
20
|
},
|
|
@@ -23,7 +22,7 @@
|
|
|
23
22
|
"author": "",
|
|
24
23
|
"license": "MIT",
|
|
25
24
|
"dependencies": {
|
|
26
|
-
"@financial-times/dotcom-types-navigation": "
|
|
25
|
+
"@financial-times/dotcom-types-navigation": "file:../dotcom-types-navigation",
|
|
27
26
|
"n-topic-search": "^4.0.0",
|
|
28
27
|
"n-ui-foundations": "^9.0.0"
|
|
29
28
|
},
|
|
@@ -44,6 +43,13 @@
|
|
|
44
43
|
"node": ">= 14.0.0",
|
|
45
44
|
"npm": "7.x || 8.x"
|
|
46
45
|
},
|
|
46
|
+
"files": [
|
|
47
|
+
"dist/",
|
|
48
|
+
"src/",
|
|
49
|
+
"browser.js",
|
|
50
|
+
"component.js",
|
|
51
|
+
"styles.scss"
|
|
52
|
+
],
|
|
47
53
|
"repository": {
|
|
48
54
|
"type": "git",
|
|
49
55
|
"repository": "https://github.com/Financial-Times/dotcom-page-kit.git",
|
|
@@ -53,4 +59,4 @@
|
|
|
53
59
|
"volta": {
|
|
54
60
|
"extends": "../../package.json"
|
|
55
61
|
}
|
|
56
|
-
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { TNavMenu } from '@financial-times/dotcom-types-navigation'
|
|
2
|
+
|
|
3
|
+
const data: TNavMenu = {
|
|
4
|
+
label: 'User',
|
|
5
|
+
items: [
|
|
6
|
+
{
|
|
7
|
+
label: 'Help Centre',
|
|
8
|
+
url: 'http://help.ft.com',
|
|
9
|
+
submenu: null
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
label: 'Subscribe',
|
|
13
|
+
url: '/products?segmentId=#',
|
|
14
|
+
submenu: null
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
label: 'Sign In',
|
|
18
|
+
url: '/login?location=#',
|
|
19
|
+
submenu: null
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default data
|