@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.
Files changed (34) hide show
  1. package/README.md +1 -0
  2. package/dist/node/components/ask-ft/askFtButton.d.ts +7 -0
  3. package/dist/node/components/ask-ft/askFtButton.js +10 -0
  4. package/dist/node/components/drawer/topLevelPartials.js +5 -3
  5. package/dist/node/components/navigation/partials.js +4 -8
  6. package/dist/node/components/sticky/partials.d.ts +1 -1
  7. package/dist/node/components/sticky/partials.js +4 -2
  8. package/dist/node/components/top/partials.d.ts +2 -3
  9. package/dist/node/components/top/partials.js +16 -29
  10. package/dist/node/index.d.ts +1 -1
  11. package/dist/node/index.js +4 -3
  12. package/dist/tsconfig.tsbuildinfo +27 -12
  13. package/package.json +2 -2
  14. package/src/__stories__/story-data/index.ts +4 -0
  15. package/src/__stories__/story-data/navbarRight.ts +2 -2
  16. package/src/__stories__/story-data/navbarTopRight.ts +19 -0
  17. package/src/__stories__/story-data/navbarTopRightAnon.ts +19 -0
  18. package/src/__stories__/story-data/profile.ts +4 -0
  19. package/src/__stories__/story.tsx +7 -43
  20. package/src/__test__/components/Drawer.spec.tsx +6 -0
  21. package/src/__test__/components/MainHeader.spec.tsx +6 -0
  22. package/src/__test__/components/StickyHeader.spec.tsx +6 -0
  23. package/src/__test__/components/__snapshots__/Drawer.spec.tsx.snap +1377 -0
  24. package/src/__test__/components/__snapshots__/MainHeader.spec.tsx.snap +1873 -35
  25. package/src/__test__/components/__snapshots__/StickyHeader.spec.tsx.snap +318 -0
  26. package/src/__test__/output/component.spec.tsx +13 -10
  27. package/src/components/ask-ft/askFtButton.tsx +19 -0
  28. package/src/components/drawer/topLevelPartials.tsx +10 -2
  29. package/src/components/navigation/partials.tsx +0 -14
  30. package/src/components/sticky/partials.tsx +10 -6
  31. package/src/components/top/partials.tsx +23 -85
  32. package/src/header.scss +43 -1
  33. package/src/index.tsx +4 -3
  34. 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>
@@ -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 & {