@financial-times/dotcom-ui-header 9.3.4 → 9.4.1
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/README.md +1 -0
- package/dist/node/components/ask-ft/askFtButton.d.ts +7 -0
- package/dist/node/components/ask-ft/askFtButton.js +10 -0
- package/dist/node/components/drawer/topLevelPartials.js +5 -3
- package/dist/node/components/navigation/partials.js +4 -8
- package/dist/node/components/sticky/partials.d.ts +1 -1
- package/dist/node/components/sticky/partials.js +4 -2
- package/dist/node/components/top/partials.d.ts +2 -3
- package/dist/node/components/top/partials.js +16 -29
- package/dist/node/index.d.ts +1 -1
- package/dist/node/index.js +4 -3
- package/dist/tsconfig.tsbuildinfo +27 -12
- package/package.json +2 -2
- package/src/__stories__/story-data/index.ts +4 -0
- package/src/__stories__/story-data/navbarRight.ts +2 -2
- package/src/__stories__/story-data/navbarTopRight.ts +19 -0
- package/src/__stories__/story-data/navbarTopRightAnon.ts +19 -0
- package/src/__stories__/story-data/profile.ts +4 -0
- package/src/__stories__/story.tsx +7 -43
- package/src/__test__/components/Drawer.spec.tsx +6 -0
- package/src/__test__/components/MainHeader.spec.tsx +6 -0
- package/src/__test__/components/StickyHeader.spec.tsx +6 -0
- package/src/__test__/components/__snapshots__/Drawer.spec.tsx.snap +1377 -0
- package/src/__test__/components/__snapshots__/MainHeader.spec.tsx.snap +1873 -35
- package/src/__test__/components/__snapshots__/StickyHeader.spec.tsx.snap +318 -0
- package/src/__test__/output/component.spec.tsx +13 -10
- package/src/components/ask-ft/askFtButton.tsx +19 -0
- package/src/components/drawer/topLevelPartials.tsx +10 -2
- package/src/components/navigation/partials.tsx +0 -14
- package/src/components/sticky/partials.tsx +10 -6
- package/src/components/top/partials.tsx +23 -85
- package/src/header.scss +43 -1
- package/src/index.tsx +4 -3
- package/src/interfaces.d.ts +1 -6
package/src/header.scss
CHANGED
|
@@ -62,4 +62,46 @@
|
|
|
62
62
|
$size: 32
|
|
63
63
|
);
|
|
64
64
|
vertical-align: middle;
|
|
65
|
-
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.o-header__drawer-search-term {
|
|
68
|
+
width: 100%;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.ft-header__ask-ft-button {
|
|
72
|
+
@include oTypographySans(-1, $weight: 'semibold');
|
|
73
|
+
color: oColorsByName('ft-grey');
|
|
74
|
+
background-color: oColorsMix('black', 'paper', 5);
|
|
75
|
+
border-radius: 4px;
|
|
76
|
+
padding-right: 8px;
|
|
77
|
+
text-transform: uppercase;
|
|
78
|
+
text-decoration: none;
|
|
79
|
+
white-space: nowrap;
|
|
80
|
+
|
|
81
|
+
&::before {
|
|
82
|
+
content: '';
|
|
83
|
+
display: block;
|
|
84
|
+
@include oIconsContent(
|
|
85
|
+
$icon-name: 'sparkles',
|
|
86
|
+
$color: oColorsByName('black'),
|
|
87
|
+
$size: 32
|
|
88
|
+
);
|
|
89
|
+
vertical-align: top;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.ft-header__ask-ft-button-label {
|
|
93
|
+
display: inline-block;
|
|
94
|
+
padding: 8px 0;
|
|
95
|
+
line-height: 15px;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.ft-header__top-ask-ft-button {
|
|
100
|
+
@include oGridRespondTo($until: 'L') {
|
|
101
|
+
display: none;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.ft-header__drawer-ask-ft-button {
|
|
106
|
+
margin-left: 16px;
|
|
107
|
+
}
|
package/src/index.tsx
CHANGED
|
@@ -33,7 +33,8 @@ const defaultProps: Partial<THeaderOptions> = {
|
|
|
33
33
|
userIsAnonymous: true,
|
|
34
34
|
userIsLoggedIn: false,
|
|
35
35
|
showStickyHeader: true,
|
|
36
|
-
showMegaNav: true
|
|
36
|
+
showMegaNav: true,
|
|
37
|
+
showAskButton: false
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
function MainHeader(props: THeaderProps) {
|
|
@@ -44,7 +45,7 @@ function MainHeader(props: THeaderProps) {
|
|
|
44
45
|
<HeaderWrapper {...props}>
|
|
45
46
|
{includeUserActionsNav ? <UserActionsNav {...props} /> : null}
|
|
46
47
|
<TopWrapper>
|
|
47
|
-
<TopColumnLeft />
|
|
48
|
+
<TopColumnLeft {...props} />
|
|
48
49
|
{props.showLogoLink ? <TopColumnCenter /> : <TopColumnCenterNoLink />}
|
|
49
50
|
<TopColumnRight {...props} />
|
|
50
51
|
</TopWrapper>
|
|
@@ -65,7 +66,7 @@ function StickyHeader(props: THeaderProps) {
|
|
|
65
66
|
return props.showStickyHeader ? (
|
|
66
67
|
<StickyHeaderWrapper {...props}>
|
|
67
68
|
<TopWrapperSticky>
|
|
68
|
-
<TopColumnLeftSticky />
|
|
69
|
+
<TopColumnLeftSticky {...props} />
|
|
69
70
|
<TopColumnCenterSticky {...props} />
|
|
70
71
|
<TopColumnRightSticky {...props} />
|
|
71
72
|
</TopWrapperSticky>
|
package/src/interfaces.d.ts
CHANGED
|
@@ -10,12 +10,7 @@ export type THeaderOptions = {
|
|
|
10
10
|
showStickyHeader?: boolean
|
|
11
11
|
showMegaNav?: boolean
|
|
12
12
|
showLogoLink?: boolean
|
|
13
|
-
|
|
14
|
-
* experimentalAccountEntryTest is an experimental feature switch
|
|
15
|
-
* This is being run as an AB test and should be removed afterwards
|
|
16
|
-
* This option shouldn't be used by anyone without consulting the CP Retention team first
|
|
17
|
-
*/
|
|
18
|
-
experimentalAccountEntryTest?: boolean
|
|
13
|
+
showAskButton?: boolean
|
|
19
14
|
}
|
|
20
15
|
|
|
21
16
|
export type THeaderProps = THeaderOptions & {
|