@financial-times/dotcom-ui-header 8.0.0 → 9.0.0-beta.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/dist/node/components/drawer/topLevelPartials.js +2 -1
- package/dist/node/index.d.ts +1 -0
- package/dist/node/index.js +3 -2
- package/dist/tsconfig.tsbuildinfo +22 -5
- package/package.json +6 -5
- package/src/components/drawer/topLevelPartials.tsx +6 -1
- package/src/index.tsx +11 -2
- package/src/interfaces.d.ts +2 -0
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.IncludeDrawer = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const additionalPartials_1 = require("./additionalPartials");
|
|
9
|
+
const enhanced_search_suggestions_1 = require("@financial-times/enhanced-search-suggestions");
|
|
9
10
|
const IncludeDrawer = (props) => react_1.default.createElement(Drawer, Object.assign({}, props));
|
|
10
11
|
exports.IncludeDrawer = IncludeDrawer;
|
|
11
12
|
const Drawer = (props) => {
|
|
@@ -17,7 +18,7 @@ const Drawer = (props) => {
|
|
|
17
18
|
react_1.default.createElement("div", { className: "o-header__drawer-inner" },
|
|
18
19
|
react_1.default.createElement(DrawerTools, Object.assign({}, editions)),
|
|
19
20
|
!props.userIsSubscribed && subscribeAction && react_1.default.createElement(additionalPartials_1.SubscribeButton, Object.assign({}, subscribeAction)),
|
|
20
|
-
react_1.default.createElement(Search, null),
|
|
21
|
+
props.enhancedSearchProps ? (react_1.default.createElement(enhanced_search_suggestions_1.EnhancedSearchBar, Object.assign({ instance: "primary", type: "drawer" }, props.enhancedSearchProps))) : (react_1.default.createElement(Search, null)),
|
|
21
22
|
react_1.default.createElement("nav", { className: "o-header__drawer-menu", "aria-label": "Edition switcher" }, editions && react_1.default.createElement(additionalPartials_1.EditionsSwitcher, Object.assign({}, editions))),
|
|
22
23
|
react_1.default.createElement("nav", { className: "o-header__drawer-menu o-header__drawer-menu--primary" },
|
|
23
24
|
primary ? react_1.default.createElement(SectionPrimary, Object.assign({}, primary)) : null,
|
package/dist/node/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ declare namespace MainHeader {
|
|
|
12
12
|
showUserNavigation?: boolean | undefined;
|
|
13
13
|
showStickyHeader?: boolean | undefined;
|
|
14
14
|
showMegaNav?: boolean | undefined;
|
|
15
|
+
enhancedSearchProps?: Pick<import("@financial-times/enhanced-search-suggestions").EnhancedSearchBarProps, "suggestionsApiUrl" | "searchUrl"> | undefined;
|
|
15
16
|
};
|
|
16
17
|
}
|
|
17
18
|
declare function StickyHeader(props: THeaderProps): JSX.Element | null;
|
package/dist/node/index.js
CHANGED
|
@@ -11,6 +11,7 @@ const partials_3 = require("./components/sticky/partials");
|
|
|
11
11
|
const partials_4 = require("./components/sub-navigation/partials");
|
|
12
12
|
const topLevelPartials_1 = require("./components/drawer/topLevelPartials");
|
|
13
13
|
const partials_5 = require("./components/search/partials");
|
|
14
|
+
const enhanced_search_suggestions_1 = require("@financial-times/enhanced-search-suggestions");
|
|
14
15
|
const defaultProps = {
|
|
15
16
|
showSubNavigation: true,
|
|
16
17
|
showUserNavigation: true,
|
|
@@ -28,7 +29,7 @@ function MainHeader(props) {
|
|
|
28
29
|
react_1.default.createElement(partials_1.TopColumnLeft, null),
|
|
29
30
|
props.showLogoLink ? react_1.default.createElement(partials_1.TopColumnCenter, null) : react_1.default.createElement(partials_1.TopColumnCenterNoLink, null),
|
|
30
31
|
react_1.default.createElement(partials_1.TopColumnRight, Object.assign({}, props))),
|
|
31
|
-
react_1.default.createElement(partials_5.Search, { instance: "primary" }),
|
|
32
|
+
props.enhancedSearchProps ? (react_1.default.createElement(enhanced_search_suggestions_1.EnhancedSearchBar, Object.assign({ instance: "primary", type: "header" }, props.enhancedSearchProps))) : (react_1.default.createElement(partials_5.Search, { instance: "primary" })),
|
|
32
33
|
react_1.default.createElement(partials_2.MobileNav, Object.assign({}, props)),
|
|
33
34
|
react_1.default.createElement(partials_2.NavDesktop, null,
|
|
34
35
|
react_1.default.createElement(partials_2.NavListLeft, Object.assign({}, props)),
|
|
@@ -43,7 +44,7 @@ function StickyHeader(props) {
|
|
|
43
44
|
react_1.default.createElement(partials_3.TopColumnLeftSticky, null),
|
|
44
45
|
react_1.default.createElement(partials_3.TopColumnCenterSticky, Object.assign({}, props)),
|
|
45
46
|
react_1.default.createElement(partials_3.TopColumnRightSticky, Object.assign({}, props))),
|
|
46
|
-
react_1.default.createElement(partials_5.Search, { instance: "sticky" }))) : null;
|
|
47
|
+
props.enhancedSearchProps ? (react_1.default.createElement(enhanced_search_suggestions_1.EnhancedSearchBar, Object.assign({ instance: "sticky", type: "header" }, props.enhancedSearchProps))) : (react_1.default.createElement(partials_5.Search, { instance: "sticky" })))) : null;
|
|
47
48
|
}
|
|
48
49
|
exports.StickyHeader = StickyHeader;
|
|
49
50
|
StickyHeader.defaultProps = defaultProps;
|
|
@@ -171,9 +171,14 @@
|
|
|
171
171
|
"signature": "bffb85db88033fc6b1f63493b6d02a53d212402475bd73da2bd12bc72d855461",
|
|
172
172
|
"affectsGlobalScope": false
|
|
173
173
|
},
|
|
174
|
+
"../../../node_modules/@financial-times/enhanced-search-suggestions/dist/index.d.ts": {
|
|
175
|
+
"version": "87cbb0fb2444c913d8b29ee793a20d6dc2cfd9f8d849b4a3442d19008cc53e74",
|
|
176
|
+
"signature": "87cbb0fb2444c913d8b29ee793a20d6dc2cfd9f8d849b4a3442d19008cc53e74",
|
|
177
|
+
"affectsGlobalScope": false
|
|
178
|
+
},
|
|
174
179
|
"../src/interfaces.d.ts": {
|
|
175
|
-
"version": "
|
|
176
|
-
"signature": "
|
|
180
|
+
"version": "75cd13ff0ea5997d5849b307951bdeb0713a325e2ef320c3a4166862cb1a2455",
|
|
181
|
+
"signature": "75cd13ff0ea5997d5849b307951bdeb0713a325e2ef320c3a4166862cb1a2455",
|
|
177
182
|
"affectsGlobalScope": false
|
|
178
183
|
},
|
|
179
184
|
"../src/components/svg-components/BrandFtMasthead.tsx": {
|
|
@@ -212,7 +217,7 @@
|
|
|
212
217
|
"affectsGlobalScope": false
|
|
213
218
|
},
|
|
214
219
|
"../src/components/drawer/topLevelPartials.tsx": {
|
|
215
|
-
"version": "
|
|
220
|
+
"version": "7d9adb633949a95809a048a318c7c09faad5629333fa6d36dc7adc4592ee6f9b",
|
|
216
221
|
"signature": "f17ff70e5ae4102301f30373d2ae6a03c923259e00c0299e44b12054130d952a",
|
|
217
222
|
"affectsGlobalScope": false
|
|
218
223
|
},
|
|
@@ -222,8 +227,8 @@
|
|
|
222
227
|
"affectsGlobalScope": false
|
|
223
228
|
},
|
|
224
229
|
"../src/index.tsx": {
|
|
225
|
-
"version": "
|
|
226
|
-
"signature": "
|
|
230
|
+
"version": "96719ba0089eae68435feb7c1a48330bc30e92a826b3c6228564743ca9731d41",
|
|
231
|
+
"signature": "a77b63e712e886f9f5de8486b3230a5c1d60a18a61a0a8a9b54d68fa7af43a2b",
|
|
227
232
|
"affectsGlobalScope": false
|
|
228
233
|
},
|
|
229
234
|
"../node_modules/@types/parse-json/index.d.ts": {
|
|
@@ -863,6 +868,9 @@
|
|
|
863
868
|
"../../../node_modules/@babel/parser/typings/babel-parser.d.ts": [
|
|
864
869
|
"../../../node_modules/@babel/types/lib/index.d.ts"
|
|
865
870
|
],
|
|
871
|
+
"../../../node_modules/@financial-times/enhanced-search-suggestions/dist/index.d.ts": [
|
|
872
|
+
"../../../node_modules/@types/react/index.d.ts"
|
|
873
|
+
],
|
|
866
874
|
"../../../node_modules/@types/babel__core/index.d.ts": [
|
|
867
875
|
"../../../node_modules/@babel/parser/typings/babel-parser.d.ts",
|
|
868
876
|
"../../../node_modules/@babel/types/lib/index.d.ts",
|
|
@@ -1369,6 +1377,7 @@
|
|
|
1369
1377
|
"../src/utils.ts"
|
|
1370
1378
|
],
|
|
1371
1379
|
"../src/components/drawer/topLevelPartials.tsx": [
|
|
1380
|
+
"../../../node_modules/@financial-times/enhanced-search-suggestions/dist/index.d.ts",
|
|
1372
1381
|
"../../../node_modules/@types/react/index.d.ts",
|
|
1373
1382
|
"../../dotcom-types-navigation/index.d.ts",
|
|
1374
1383
|
"../src/components/drawer/additionalPartials.tsx",
|
|
@@ -1404,6 +1413,7 @@
|
|
|
1404
1413
|
"../src/interfaces.d.ts"
|
|
1405
1414
|
],
|
|
1406
1415
|
"../src/index.tsx": [
|
|
1416
|
+
"../../../node_modules/@financial-times/enhanced-search-suggestions/dist/index.d.ts",
|
|
1407
1417
|
"../../../node_modules/@types/react/index.d.ts",
|
|
1408
1418
|
"../src/components/drawer/topLevelPartials.tsx",
|
|
1409
1419
|
"../src/components/navigation/partials.tsx",
|
|
@@ -1414,6 +1424,7 @@
|
|
|
1414
1424
|
"../src/interfaces.d.ts"
|
|
1415
1425
|
],
|
|
1416
1426
|
"../src/interfaces.d.ts": [
|
|
1427
|
+
"../../../node_modules/@financial-times/enhanced-search-suggestions/dist/index.d.ts",
|
|
1417
1428
|
"../../dotcom-types-navigation/index.d.ts"
|
|
1418
1429
|
],
|
|
1419
1430
|
"../src/utils.ts": [
|
|
@@ -1424,6 +1435,9 @@
|
|
|
1424
1435
|
"../../../node_modules/@babel/parser/typings/babel-parser.d.ts": [
|
|
1425
1436
|
"../../../node_modules/@babel/types/lib/index.d.ts"
|
|
1426
1437
|
],
|
|
1438
|
+
"../../../node_modules/@financial-times/enhanced-search-suggestions/dist/index.d.ts": [
|
|
1439
|
+
"../../../node_modules/@types/react/index.d.ts"
|
|
1440
|
+
],
|
|
1427
1441
|
"../../../node_modules/@types/babel__core/index.d.ts": [
|
|
1428
1442
|
"../../../node_modules/@babel/parser/typings/babel-parser.d.ts",
|
|
1429
1443
|
"../../../node_modules/@babel/types/lib/index.d.ts",
|
|
@@ -1942,9 +1956,11 @@
|
|
|
1942
1956
|
"../src/interfaces.d.ts"
|
|
1943
1957
|
],
|
|
1944
1958
|
"../src/index.tsx": [
|
|
1959
|
+
"../../../node_modules/@financial-times/enhanced-search-suggestions/dist/index.d.ts",
|
|
1945
1960
|
"../src/interfaces.d.ts"
|
|
1946
1961
|
],
|
|
1947
1962
|
"../src/interfaces.d.ts": [
|
|
1963
|
+
"../../../node_modules/@financial-times/enhanced-search-suggestions/dist/index.d.ts",
|
|
1948
1964
|
"../../dotcom-types-navigation/index.d.ts"
|
|
1949
1965
|
],
|
|
1950
1966
|
"../src/utils.ts": [
|
|
@@ -1954,6 +1970,7 @@
|
|
|
1954
1970
|
"semanticDiagnosticsPerFile": [
|
|
1955
1971
|
"../../../node_modules/@babel/parser/typings/babel-parser.d.ts",
|
|
1956
1972
|
"../../../node_modules/@babel/types/lib/index.d.ts",
|
|
1973
|
+
"../../../node_modules/@financial-times/enhanced-search-suggestions/dist/index.d.ts",
|
|
1957
1974
|
"../../../node_modules/@types/babel__core/index.d.ts",
|
|
1958
1975
|
"../../../node_modules/@types/babel__generator/index.d.ts",
|
|
1959
1976
|
"../../../node_modules/@types/babel__template/index.d.ts",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@financial-times/dotcom-ui-header",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0-beta.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"browser": "browser.js",
|
|
6
6
|
"main": "component.js",
|
|
@@ -22,9 +22,10 @@
|
|
|
22
22
|
"author": "",
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@financial-times/dotcom-types-navigation": "^
|
|
25
|
+
"@financial-times/dotcom-types-navigation": "^9.0.0-beta.1",
|
|
26
26
|
"n-topic-search": "^4.0.0",
|
|
27
|
-
"n-ui-foundations": "^9.0.0"
|
|
27
|
+
"n-ui-foundations": "^9.0.0",
|
|
28
|
+
"@financial-times/enhanced-search-suggestions": "1.0.5"
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
|
30
31
|
"@financial-times/logo-images": "^1.10.1",
|
|
@@ -40,8 +41,8 @@
|
|
|
40
41
|
"react": "16.x || 17.x"
|
|
41
42
|
},
|
|
42
43
|
"engines": {
|
|
43
|
-
"node": "16.x",
|
|
44
|
-
"npm": "7.x || 8.x"
|
|
44
|
+
"node": "16.x || 18.x",
|
|
45
|
+
"npm": "7.x || 8.x || 9.x"
|
|
45
46
|
},
|
|
46
47
|
"files": [
|
|
47
48
|
"dist/",
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
} from './additionalPartials'
|
|
9
9
|
import { THeaderProps } from '../../interfaces'
|
|
10
10
|
import { TNavMenuItem, TNavMenu, TNavEditions } from '@financial-times/dotcom-types-navigation'
|
|
11
|
+
import { EnhancedSearchBar } from '@financial-times/enhanced-search-suggestions'
|
|
11
12
|
|
|
12
13
|
const IncludeDrawer = (props) => <Drawer {...props} />
|
|
13
14
|
|
|
@@ -32,7 +33,11 @@ const Drawer = (props: THeaderProps) => {
|
|
|
32
33
|
<div className="o-header__drawer-inner">
|
|
33
34
|
<DrawerTools {...editions} />
|
|
34
35
|
{!props.userIsSubscribed && subscribeAction && <SubscribeButton {...subscribeAction} />}
|
|
35
|
-
|
|
36
|
+
{props.enhancedSearchProps ? (
|
|
37
|
+
<EnhancedSearchBar instance="primary" type="drawer" {...props.enhancedSearchProps} />
|
|
38
|
+
) : (
|
|
39
|
+
<Search />
|
|
40
|
+
)}
|
|
36
41
|
<nav className="o-header__drawer-menu" aria-label="Edition switcher">
|
|
37
42
|
{editions && <EditionsSwitcher {...editions} />}
|
|
38
43
|
</nav>
|
package/src/index.tsx
CHANGED
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
import { SubNavigation } from './components/sub-navigation/partials'
|
|
25
25
|
import { IncludeDrawer } from './components/drawer/topLevelPartials'
|
|
26
26
|
import { Search } from './components/search/partials'
|
|
27
|
+
import { EnhancedSearchBar } from '@financial-times/enhanced-search-suggestions'
|
|
27
28
|
|
|
28
29
|
import { THeaderProps, THeaderOptions } from './interfaces'
|
|
29
30
|
|
|
@@ -48,7 +49,11 @@ function MainHeader(props: THeaderProps) {
|
|
|
48
49
|
{props.showLogoLink ? <TopColumnCenter /> : <TopColumnCenterNoLink />}
|
|
49
50
|
<TopColumnRight {...props} />
|
|
50
51
|
</TopWrapper>
|
|
51
|
-
|
|
52
|
+
{props.enhancedSearchProps ? (
|
|
53
|
+
<EnhancedSearchBar instance="primary" type="header" {...props.enhancedSearchProps} />
|
|
54
|
+
) : (
|
|
55
|
+
<Search instance="primary" />
|
|
56
|
+
)}
|
|
52
57
|
<MobileNav {...props} />
|
|
53
58
|
<NavDesktop>
|
|
54
59
|
<NavListLeft {...props} />
|
|
@@ -69,7 +74,11 @@ function StickyHeader(props: THeaderProps) {
|
|
|
69
74
|
<TopColumnCenterSticky {...props} />
|
|
70
75
|
<TopColumnRightSticky {...props} />
|
|
71
76
|
</TopWrapperSticky>
|
|
72
|
-
|
|
77
|
+
{props.enhancedSearchProps ? (
|
|
78
|
+
<EnhancedSearchBar instance="sticky" type="header" {...props.enhancedSearchProps} />
|
|
79
|
+
) : (
|
|
80
|
+
<Search instance="sticky" />
|
|
81
|
+
)}
|
|
73
82
|
</StickyHeaderWrapper>
|
|
74
83
|
) : null
|
|
75
84
|
}
|
package/src/interfaces.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TNavigationData } from '@financial-times/dotcom-types-navigation'
|
|
2
|
+
import type { EnhancedSearchBarProps } from '@financial-times/enhanced-search-suggestions'
|
|
2
3
|
|
|
3
4
|
export type THeaderOptions = {
|
|
4
5
|
variant?: THeaderVariant
|
|
@@ -10,6 +11,7 @@ export type THeaderOptions = {
|
|
|
10
11
|
showStickyHeader?: boolean
|
|
11
12
|
showMegaNav?: boolean
|
|
12
13
|
showLogoLink?: boolean
|
|
14
|
+
enhancedSearchProps?: Omit<EnhancedSearchBarProps, 'type' | 'instance'>
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
export type THeaderProps = THeaderOptions & {
|