@financial-times/dotcom-ui-header 9.0.0-beta.3 → 9.0.0-beta.4
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@financial-times/dotcom-ui-header",
|
|
3
|
-
"version": "9.0.0-beta.
|
|
3
|
+
"version": "9.0.0-beta.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"browser": "browser.js",
|
|
6
6
|
"main": "component.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"author": "",
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@financial-times/dotcom-types-navigation": "^9.0.0-beta.
|
|
25
|
+
"@financial-times/dotcom-types-navigation": "^9.0.0-beta.4",
|
|
26
26
|
"n-topic-search": "^4.0.0",
|
|
27
27
|
"n-ui-foundations": "^9.0.0"
|
|
28
28
|
},
|
|
@@ -12,21 +12,19 @@ class CustomSuggestionList extends BaseRenderer {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
renderSuggestionChip = (term) => {
|
|
15
|
-
const WORD_LIMIT = 60
|
|
16
15
|
return `<a
|
|
17
16
|
data-trackable="link"
|
|
18
17
|
data-suggestion-id="${term}"
|
|
19
18
|
href="${this.enhancedSearchUrl}${term}"
|
|
20
19
|
class="n-topic-search__target enhanced-search__chip">
|
|
21
|
-
|
|
22
|
-
${term.length > WORD_LIMIT ? '...' : ''}</span>
|
|
20
|
+
<span class="enhanced-search__chip-text">${term}</span>
|
|
23
21
|
</a>`
|
|
24
22
|
}
|
|
25
23
|
|
|
26
24
|
renderDefaultSuggestionsChips() {
|
|
27
25
|
return `
|
|
28
26
|
<div class="enhanced-search__default-results">
|
|
29
|
-
${['
|
|
27
|
+
${['Will Trump win the next election?', 'Investing in AI', 'Ukraine counteroffensive']
|
|
30
28
|
.map(this.renderSuggestionChip)
|
|
31
29
|
.join('')}
|
|
32
30
|
</div>`
|
|
@@ -107,11 +105,13 @@ class CustomSuggestionList extends BaseRenderer {
|
|
|
107
105
|
: ''
|
|
108
106
|
}
|
|
109
107
|
<div
|
|
110
|
-
class="n-topic-search n-topic-search__suggestions"
|
|
108
|
+
class="n-topic-search n-topic-search__suggestions enhanced-search enhanced-search__suggestions"
|
|
111
109
|
data-trackable="typeahead"
|
|
112
110
|
>
|
|
113
111
|
<div class="enhanced-search__wrapper">
|
|
114
|
-
<h3 class="enhanced-search__title"
|
|
112
|
+
<h3 class="enhanced-search__title">${
|
|
113
|
+
term ? 'Get top results for...' : 'Search tip: Try using questions or phrases like...'
|
|
114
|
+
}</h3>
|
|
115
115
|
${term ? this.renderSuggestionChip(term) : this.renderDefaultSuggestionsChips()}
|
|
116
116
|
<div class="o-normalise-visually-hidden">Suggestions include</div>
|
|
117
117
|
${
|
|
@@ -22,9 +22,7 @@ class EnhancedSearch extends TopicSearch {
|
|
|
22
22
|
|
|
23
23
|
form.setAttribute('data-attribute-enhanced-search', 'true')
|
|
24
24
|
form.setAttribute('action', options?.enhancedSearchUrl ?? '/search')
|
|
25
|
-
inputs.forEach((input) =>
|
|
26
|
-
input.setAttribute('placeholder', 'Search the FT using questions, topics or article titles')
|
|
27
|
-
)
|
|
25
|
+
inputs.forEach((input) => input.setAttribute('placeholder', 'Search for stories, topics or securities'))
|
|
28
26
|
}
|
|
29
27
|
|
|
30
28
|
onFocus(ev) {
|
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
@mixin enhancedSearch {
|
|
6
6
|
.enhanced-search {
|
|
7
|
+
&__suggestions {
|
|
8
|
+
max-width: 540px;
|
|
9
|
+
left: - spacing.oSpacingByName('s3');
|
|
10
|
+
}
|
|
11
|
+
|
|
7
12
|
&__wrapper {
|
|
8
13
|
display: flex;
|
|
9
14
|
flex-direction: column;
|
|
@@ -20,7 +25,7 @@
|
|
|
20
25
|
&__suggestions {
|
|
21
26
|
display: flex;
|
|
22
27
|
gap: spacing.oSpacingByName('m16');
|
|
23
|
-
padding-top: spacing.oSpacingByName('
|
|
28
|
+
padding-top: spacing.oSpacingByName('s4');
|
|
24
29
|
flex-direction: column;
|
|
25
30
|
|
|
26
31
|
@include oGridRespondTo('L') {
|