@ons/design-system 72.4.0 → 72.5.0

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 (46) hide show
  1. package/components/button/_button.scss +171 -3
  2. package/components/button/_macro.njk +4 -0
  3. package/components/card/_card.scss +5 -0
  4. package/components/card/_macro.njk +10 -2
  5. package/components/card/_macro.spec.js +58 -0
  6. package/components/card/example-card-set-with-headline-figures.njk +62 -0
  7. package/components/chart/_chart.scss +29 -0
  8. package/components/chart/_macro.njk +101 -0
  9. package/components/chart/_macro.spec.js +437 -0
  10. package/components/chart/bar-chart.js +160 -0
  11. package/components/chart/chart-constants.js +21 -0
  12. package/components/chart/chart.dom.js +8 -0
  13. package/components/chart/chart.js +157 -0
  14. package/components/chart/column-chart.js +48 -0
  15. package/components/chart/common-chart-options.js +200 -0
  16. package/components/chart/example-bar-chart.njk +54 -0
  17. package/components/chart/example-clustered-bar-chart.njk +60 -0
  18. package/components/chart/example-clustered-column-chart.njk +72 -0
  19. package/components/chart/example-column-chart.njk +52 -0
  20. package/components/chart/example-line-chart.njk +219 -0
  21. package/components/chart/example-stacked-bar-chart.njk +60 -0
  22. package/components/chart/example-stacked-column-chart.njk +65 -0
  23. package/components/chart/line-chart.js +47 -0
  24. package/components/chart/specific-chart-options.js +22 -0
  25. package/components/footer/_footer.scss +12 -0
  26. package/components/footer/_macro.njk +38 -17
  27. package/components/header/_header.scss +18 -2
  28. package/components/header/_macro.njk +81 -8
  29. package/components/header/_macro.spec.js +97 -0
  30. package/components/header/example-header-with-search-button.njk +190 -0
  31. package/components/header/header.spec.js +128 -0
  32. package/components/hero/_hero.scss +8 -7
  33. package/components/hero/_macro.njk +45 -26
  34. package/components/hero/example-hero-grey.njk +1 -0
  35. package/components/icon/_macro.njk +8 -8
  36. package/components/input/_input.scss +15 -0
  37. package/components/input/_macro.njk +3 -3
  38. package/components/navigation/navigation.dom.js +17 -0
  39. package/components/navigation/navigation.js +72 -2
  40. package/css/main.css +1 -1
  41. package/js/main.js +2 -0
  42. package/package.json +4 -1
  43. package/scripts/main.es5.js +1 -1
  44. package/scripts/main.js +1 -1
  45. package/scss/main.scss +1 -0
  46. package/scss/utilities/_grid.scss +13 -4
@@ -9,6 +9,7 @@ import { mapAll } from '../../tests/helpers/cheerio';
9
9
  import {
10
10
  EXAMPLE_HEADER_BASIC,
11
11
  EXAMPLE_SERVICE_LINKS_CONFIG,
12
+ EXAMPLE_HEADER_SEARCH_LINKS,
12
13
  EXAMPLE_HEADER_SERVICE_LINKS_MULTIPLE,
13
14
  EXAMPLE_HEADER_SERVICE_LINKS_SINGLE,
14
15
  EXAMPLE_HEADER_LANGUAGE_CONFIG,
@@ -784,4 +785,100 @@ describe('FOR: Macro: Header', () => {
784
785
  });
785
786
  });
786
787
  });
788
+ describe('GIVEN: Params: searchLinks', () => {
789
+ describe('WHEN: searchLinks are provided', () => {
790
+ const faker = templateFaker();
791
+ const buttonSpy = faker.spy('button', { suppressOutput: true });
792
+ faker.renderComponent('header', { ...EXAMPLE_HEADER_SEARCH_LINKS, variants: 'basic' });
793
+
794
+ test('THEN: renders search icon button', () => {
795
+ expect(buttonSpy.occurrences[0]).toEqual({
796
+ iconType: 'search',
797
+ classes: 'ons-u-fs-s--b ons-js-toggle-header-search ons-btn--search ons-btn--search-icon',
798
+ type: 'button',
799
+ variants: 'search',
800
+ attributes: {
801
+ 'aria-label': 'Example aria label',
802
+ 'aria-expanded': 'false',
803
+ 'aria-controls': 'search-links-id',
804
+ },
805
+ });
806
+ });
807
+ });
808
+
809
+ describe('WHEN: itemsList are provided in searchLinks', () => {
810
+ const $ = cheerio.load(renderComponent('header', { ...EXAMPLE_HEADER_SEARCH_LINKS, variants: 'basic' }));
811
+
812
+ test('THEN: renders items list', () => {
813
+ const itemsList = $('.ons-list--bare .ons-list__item').length;
814
+ expect(itemsList).toBeGreaterThan(0);
815
+ });
816
+
817
+ test('THEN: renders correct links for items list', () => {
818
+ const searchItemsLinks = mapAll($('.ons-list--bare .ons-list__item a'), (node) => node.attr('href'));
819
+ expect(searchItemsLinks).toEqual(['#1', '#2', '#3']);
820
+ });
821
+
822
+ test('THEN: renders correct text for items list', () => {
823
+ const searchItemsText = mapAll($('.ons-list--bare .ons-list__item a'), (node) => node.text().trim());
824
+ expect(searchItemsText).toEqual(['Popular Search 1', 'Popular Search 2', 'Popular Search 3']);
825
+ });
826
+ });
827
+
828
+ describe('WHEN: searchLinks parameter is missing', () => {
829
+ const $ = cheerio.load(renderComponent('header', EXAMPLE_HEADER_BASIC));
830
+
831
+ test('THEN: does not render search icon button', () => {
832
+ expect($('.ons-js-toggle-services').length).toBe(0);
833
+ });
834
+
835
+ test('THEN: does not render search input form', () => {
836
+ expect($('.ons-header-nav-search').length).toBe(0);
837
+ });
838
+
839
+ test('THEN: does not render items list', () => {
840
+ expect($('.ons-list--bare').length).toBe(0);
841
+ });
842
+ });
843
+
844
+ describe('WHEN: searchLinks are provided and the header variant is not basic', () => {
845
+ const $ = cheerio.load(renderComponent('header', { ...EXAMPLE_HEADER_SEARCH_LINKS, variants: 'neutral' }));
846
+
847
+ test('THEN: does not render the search icon button', () => {
848
+ expect($('.ons-js-toggle-services').length).toBe(0);
849
+ });
850
+ });
851
+
852
+ describe('WHEN: heading parameter is provided', () => {
853
+ const $ = cheerio.load(renderComponent('header', { ...EXAMPLE_HEADER_SEARCH_LINKS, variants: 'basic' }));
854
+
855
+ test('THEN: it renders heading with provided text', () => {
856
+ expect($('.ons-header-nav-search__heading').text()).toBe('Header Search');
857
+ });
858
+ });
859
+
860
+ describe('WHEN: id parameter is provided', () => {
861
+ const $ = cheerio.load(renderComponent('header', { ...EXAMPLE_HEADER_SEARCH_LINKS, variants: 'basic' }));
862
+
863
+ test('THEN: applies id to search links ', () => {
864
+ expect($('#search-links-id').length).toBe(1);
865
+ });
866
+ });
867
+
868
+ describe('WHEN: ariaLabel parameter is provided', () => {
869
+ const $ = cheerio.load(renderComponent('header', { ...EXAMPLE_HEADER_SEARCH_LINKS, variants: 'basic' }));
870
+
871
+ test('THEN: applies aria label to the search links', () => {
872
+ expect($('.ons-header-nav-search').attr('aria-label')).toBe('Header Search');
873
+ });
874
+ });
875
+
876
+ describe('WHEN: classes parameter is provided', () => {
877
+ const $ = cheerio.load(renderComponent('header', { ...EXAMPLE_HEADER_SEARCH_LINKS, variants: 'basic' }));
878
+
879
+ test('THEN: it renders classes with provided value', () => {
880
+ expect($('.ons-header-nav-search').hasClass('custom-class')).toBe(true);
881
+ });
882
+ });
883
+ });
787
884
  });
@@ -0,0 +1,190 @@
1
+ ---
2
+ 'fullWidth': true
3
+ ---
4
+
5
+ {% from "components/header/_macro.njk" import onsHeader %}
6
+
7
+ {{
8
+ onsHeader({
9
+ "variants": 'basic',
10
+ "menuLinks": {
11
+ "keyLinks": [
12
+ {
13
+ 'heading': 'Taking part in a survey?',
14
+ 'description': 'It’s never been more important.'
15
+ },
16
+ {
17
+ 'heading': 'Release calendar',
18
+ 'description': 'View our latest and upcoming releases.'
19
+ },
20
+ {
21
+ 'heading': 'Explore local statistics',
22
+ 'url': '#0',
23
+ 'description': 'Explore statistics across the UK.'
24
+ }
25
+ ],
26
+ "columns": [
27
+ {
28
+ "groups": [
29
+ {
30
+ "heading": "People, population and community",
31
+ "groupItems": [
32
+ {
33
+ "text": "Armed forces community"
34
+ },
35
+ {
36
+ "text": "Births, deaths and marriages"
37
+ },
38
+ {
39
+ "text": "Crime and justice"
40
+ },
41
+ {
42
+ "text": "Cultural identity"
43
+ },
44
+ {
45
+ "text": "Education and childcare"
46
+ },
47
+ {
48
+ "text": "Elections"
49
+ },
50
+ {
51
+ "text": "Health and social care"
52
+ },
53
+ {
54
+ "text": "Household characteristics"
55
+ },
56
+ {
57
+ "text": "Housing"
58
+ },
59
+ {
60
+ "text": "Leisure and tourism"
61
+ },
62
+ {
63
+ "text": "Personal and household finances"
64
+ },
65
+ {
66
+ "text": "Population and migration"
67
+ },
68
+ {
69
+ "text": "Well-being"
70
+ }
71
+ ]
72
+ }
73
+ ]
74
+ },
75
+ {
76
+ "groups": [
77
+ {
78
+ "heading": "Business, industry and trade",
79
+ "groupItems": [
80
+ {
81
+ "text": "Business"
82
+ },
83
+ {
84
+ "text": "Changes to business"
85
+ },
86
+ {
87
+ "text": "Construction industry"
88
+ },
89
+ {
90
+ "text": "International trade"
91
+ },
92
+ {
93
+ "text": "IT and internet industry"
94
+ },
95
+ {
96
+ "text": "Manufacturing and production industry"
97
+ },
98
+ {
99
+ "text": "Retail industry",
100
+ "url": "#0"
101
+ },
102
+ {
103
+ "text": "Tourism industry"
104
+ }
105
+ ]
106
+ },
107
+ {
108
+ "heading": "Employment and labour market",
109
+ "url": "#0",
110
+ "groupItems":
111
+ [
112
+ {
113
+ "text": "People in work"
114
+ },
115
+ {
116
+ "text": "People not in work"
117
+ }
118
+ ]
119
+
120
+ }
121
+ ]
122
+ },
123
+ {
124
+ "groups": [
125
+ {
126
+ "heading": "Economy",
127
+ "groupItems": [
128
+ {
129
+ "text": "Economic output and productivity"
130
+ },
131
+ {
132
+ "text": "Government, public sector and taxes"
133
+ },
134
+ {
135
+ "text": "Gross Value Added (GVA)"
136
+ },
137
+ {
138
+ "text": "Investments, pensions and trusts"
139
+ },
140
+ {
141
+ "text": "Regional accounts"
142
+ },
143
+ {
144
+ "text": "Environmental accounts"
145
+ },
146
+ {
147
+ "text": "Gross Domestic Product (GDP)"
148
+ },
149
+ {
150
+ "text": "Inflation and price indices"
151
+ },
152
+ {
153
+ "text": "National accounts"
154
+ }
155
+ ]
156
+ }
157
+ ]
158
+ }
159
+ ]
160
+ },
161
+ "searchLinks": {
162
+ "id": "search-links",
163
+ "searchNavigationAriaLabel": 'Nav Search',
164
+ "searchButtonAriaLabel": 'Toggle search',
165
+ 'heading': 'Popular searches',
166
+ "itemsList": [
167
+ {
168
+ "url": '#1',
169
+ "text": 'Cost of living'
170
+ },
171
+ {
172
+ "url": '#1',
173
+ "text": 'Inflation'
174
+ },
175
+ {
176
+ "url": '#3',
177
+ "text": 'NHS waiting times'
178
+ },
179
+ {
180
+ "url": '#0',
181
+ "text": 'Wellbeing'
182
+ },
183
+ {
184
+ "url": '#0',
185
+ "text": 'Baby names'
186
+ }
187
+ ]
188
+ }
189
+ })
190
+ }}
@@ -0,0 +1,128 @@
1
+ import { renderComponent, setTestPage } from '../../tests/helpers/rendering';
2
+ import { EXAMPLE_HEADER_SEARCH_AND_MENU_LINKS } from './_test-examples';
3
+ import { getNodeAttributes } from '../../tests/helpers/puppeteer';
4
+
5
+ describe('script: header', () => {
6
+ beforeEach(async () => {
7
+ await setTestPage('/test', renderComponent('header', { ...EXAMPLE_HEADER_SEARCH_AND_MENU_LINKS, variants: 'basic' }));
8
+ });
9
+
10
+ describe('when the search button is clicked', () => {
11
+ beforeEach(async () => {
12
+ await page.click('.ons-js-toggle-header-search');
13
+ });
14
+
15
+ it('then the search input form is visible and does not have the ons-u-d-no class', async () => {
16
+ await page.waitForSelector('.ons-header-nav-search');
17
+ const isSearchNavVisible = await page.$eval('.ons-header-nav-search', (el) => !el.classList.contains('ons-u-d-no'));
18
+ expect(isSearchNavVisible).toBe(true);
19
+ });
20
+
21
+ it('then the button switches to the close icon', async () => {
22
+ const hasCloseIcon = await page.$eval('.ons-js-toggle-header-search svg', (el) => el.classList.contains('ons-icon--close'));
23
+ expect(hasCloseIcon).toBe(true);
24
+ });
25
+
26
+ it('then the button has aria-expanded="true"', async () => {
27
+ const attributes = await getNodeAttributes(page, '.ons-js-toggle-header-search');
28
+ expect(attributes['aria-expanded']).toBe('true');
29
+ });
30
+
31
+ it('then the button has aria-hidden="false"', async () => {
32
+ const attributes = await getNodeAttributes(page, '.ons-js-header-search');
33
+ expect(attributes['aria-hidden']).toBe('false');
34
+ });
35
+
36
+ it('then the search field has full width', async () => {
37
+ await page.waitForSelector('.ons-header-nav-search__input .ons-input');
38
+ const isFullWidth = await page.$eval('.ons-header-nav-search__input .ons-input', (el) =>
39
+ el.classList.contains('ons-input--w-full'),
40
+ );
41
+ expect(isFullWidth).toBe(true);
42
+ });
43
+ });
44
+
45
+ describe('when the search button is not clicked', () => {
46
+ it('then the search form is hidden', async () => {
47
+ const isSearchNavHidden = await page.$eval('.ons-header-nav-search', (el) => el.classList.contains('ons-u-d-no'));
48
+ expect(isSearchNavHidden).toBe(true);
49
+ });
50
+
51
+ it('then the button displays the search icon', async () => {
52
+ const hasSearchIcon = await page.$eval('.ons-js-toggle-header-search svg', (el) => el.classList.contains('ons-icon--search'));
53
+ expect(hasSearchIcon).toBe(true);
54
+ });
55
+
56
+ it('then the button has aria-expanded="false"', async () => {
57
+ const attributes = await getNodeAttributes(page, '.ons-js-toggle-header-search');
58
+ expect(attributes['aria-expanded']).toBe('false');
59
+ });
60
+
61
+ it('then the button has aria-hidden="true"', async () => {
62
+ const attributes = await getNodeAttributes(page, '.ons-js-header-search');
63
+ expect(attributes['aria-hidden']).toBe('true');
64
+ });
65
+ });
66
+
67
+ describe('when the search button is clicked again (to close)', () => {
68
+ beforeEach(async () => {
69
+ await page.click('.ons-js-toggle-header-search'); // Open
70
+ await page.waitForSelector('.ons-header-nav-search');
71
+ await page.click('.ons-js-toggle-header-search'); // Close
72
+ });
73
+
74
+ it('then the search form is hidden', async () => {
75
+ const isSearchNavHidden = await page.$eval('.ons-header-nav-search', (el) => el.classList.contains('ons-u-d-no'));
76
+ expect(isSearchNavHidden).toBe(true);
77
+ });
78
+
79
+ it('then the button switches back to the search icon', async () => {
80
+ const hasSearchIcon = await page.$eval('.ons-js-toggle-header-search svg', (el) => el.classList.contains('ons-icon--search'));
81
+ expect(hasSearchIcon).toBe(true);
82
+ });
83
+
84
+ it('then the button has aria-expanded="false"', async () => {
85
+ const attributes = await getNodeAttributes(page, '.ons-js-toggle-header-search');
86
+ expect(attributes['aria-expanded']).toBe('false');
87
+ });
88
+ });
89
+
90
+ describe('when the menu button is clicked', () => {
91
+ beforeEach(async () => {
92
+ await page.click('.ons-btn--menu');
93
+ });
94
+
95
+ it('then the navigation menu is displayed', async () => {
96
+ await page.waitForSelector('.ons-header-nav-menu');
97
+ const isMenuNavVisible = await page.$eval('.ons-header-nav-menu', (el) => !el.classList.contains('ons-u-d-no'));
98
+ expect(isMenuNavVisible).toBe(true);
99
+ });
100
+
101
+ it('then the menu button is marked as expanded', async () => {
102
+ const menuButtonAriaExpanded = await page.$eval('.ons-btn--menu', (el) => el.getAttribute('aria-expanded'));
103
+ expect(menuButtonAriaExpanded).toBe('true');
104
+ });
105
+
106
+ it('then the navigation menu aria-hidden attribute is set to false', async () => {
107
+ const isAriaHiddenFalse = await page.$eval('.ons-header-nav-menu', (el) => el.getAttribute('aria-hidden') === 'false');
108
+ expect(isAriaHiddenFalse).toBe(true);
109
+ });
110
+ });
111
+
112
+ describe('when the menu button is not clicked', () => {
113
+ it('then the navigation menu is hidden', async () => {
114
+ const isMenuNavHidden = await page.$eval('.ons-header-nav-menu', (el) => el.classList.contains('ons-u-d-no'));
115
+ expect(isMenuNavHidden).toBe(true);
116
+ });
117
+
118
+ it('then the menu button is marked as not expanded', async () => {
119
+ const menuButtonAriaExpanded = await page.$eval('.ons-btn--menu', (el) => el.getAttribute('aria-expanded'));
120
+ expect(menuButtonAriaExpanded).toBe('false');
121
+ });
122
+
123
+ it('then the navigation menu aria-hidden attribute is set to true', async () => {
124
+ const isAriaHiddenTrue = await page.$eval('.ons-header-nav-menu', (el) => el.getAttribute('aria-hidden') === 'true');
125
+ expect(isAriaHiddenTrue).toBe(true);
126
+ });
127
+ });
128
+ });
@@ -70,12 +70,9 @@
70
70
  }
71
71
  }
72
72
  }
73
- &__badge {
74
- @include mq(l) {
75
- position: absolute;
76
- right: 0;
77
- top: 85px;
78
- }
73
+
74
+ &__badge-link {
75
+ display: block;
79
76
  }
80
77
 
81
78
  &--topic {
@@ -95,7 +92,11 @@
95
92
  }
96
93
 
97
94
  &__content {
98
- height: 100%;
95
+ @include mq(l) {
96
+ display: flex;
97
+ justify-content: space-between;
98
+ align-items: flex-start;
99
+ }
99
100
  }
100
101
 
101
102
  &__pre-title {
@@ -37,36 +37,55 @@
37
37
  {% if params.topic %}
38
38
  <h2 class="ons-hero--topic">{{ params.topic | safe }}</h2>
39
39
  {% endif %}
40
- <div class="ons-hero__title-container">
41
- <header>
42
- <h1 class="ons-hero__title ons-u-fs-3xl">{{ params.title }}</h1>
43
- {% if params.subtitle %}
44
- <h2 class="ons-hero__subtitle ons-u-fs-r--b">{{ params.subtitle }}</h2>
40
+
41
+ <div class="ons-hero__content">
42
+ <div class="ons-hero__title-container">
43
+ <header>
44
+ <h1 class="ons-hero__title ons-u-fs-3xl">{{ params.title }}</h1>
45
+ {% if params.subtitle %}
46
+ <h2 class="ons-hero__subtitle ons-u-fs-r--b">{{ params.subtitle }}</h2>
47
+ {% endif %}
48
+ </header>
49
+
50
+ {% if params.text %}
51
+ <p class="ons-hero__text">{{ params.text | safe }}</p>
45
52
  {% endif %}
46
- </header>
47
- {% if params.text %}
48
- <p class="ons-hero__text">{{ params.text | safe }}</p>
49
- {% endif %}
50
- </div>
51
- {% if params.variants == "grey" %}
52
- {% if params.officialStatisticsBadge == true %}
53
+ </div>
54
+
55
+ {% if params.variants == "grey" and params.officialStatisticsBadge == true %}
53
56
  <div class="ons-hero__badge ons-u-mb-s">
54
- {{-
55
- onsIcon({
56
- "iconType": 'official-statistics'
57
- })
58
- -}}
59
- </div>
60
- {% endif %}
61
- {% if params.censusLogo == true %}
62
- <div class="ons-hero__census-logo">
63
- {{-
64
- onsIcon({
65
- "iconType": 'census-logo'
66
- })
67
- -}}
57
+ {% if params.officialStatisticsBadgeUrl %}
58
+ <a
59
+ href="{{ params.officialStatisticsBadgeUrl }}"
60
+ target="_blank"
61
+ rel="noopener noreferrer"
62
+ class="ons-hero__badge-link"
63
+ >
64
+ {{-
65
+ onsIcon({
66
+ "iconType": 'official-statistics'
67
+ })
68
+ -}}
69
+ </a>
70
+ {% else %}
71
+ {{-
72
+ onsIcon({
73
+ "iconType": 'official-statistics'
74
+ })
75
+ -}}
76
+ {% endif %}
68
77
  </div>
69
78
  {% endif %}
79
+ </div>
80
+
81
+ {% if params.variants == "grey" and params.censusLogo == true %}
82
+ <div class="ons-hero__census-logo">
83
+ {{-
84
+ onsIcon({
85
+ "iconType": 'census-logo'
86
+ })
87
+ -}}
88
+ </div>
70
89
  {% endif %}
71
90
 
72
91
  {% if params.button %}
@@ -8,6 +8,7 @@
8
8
  "variants": 'grey',
9
9
  "detailsColumns": '12',
10
10
  "officialStatisticsBadge": true,
11
+ "officialStatisticsBadgeUrl": 'https://uksa.statisticsauthority.gov.uk/about-the-authority/uk-statistical-system/types-of-official-statistics/',
11
12
  "topic": 'Statistical article',
12
13
  "title": 'Retail sales rise amid summer discounts and sporting events, according to a first estimate',
13
14
  "text": 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum id mattis ligula, nec sollicitudin arcu. Donec non tristique tellus. Donec eget malesuada lorem.',
@@ -203,7 +203,7 @@
203
203
  </svg>
204
204
  {%- elif params.iconType == "search" -%}
205
205
  <svg
206
- class="{% if params.iconSize %}ons-icon ons-icon--{{ params.iconSize }}{% else %}ons-icon{% endif %}{{ iconClasses }}"
206
+ class="{% if params.iconSize %}ons-icon ons-icon--search ons-icon--{{ params.iconSize }}{% else %}ons-icon{% endif %}{{ iconClasses }}"
207
207
  viewBox="0 0 12 12"
208
208
  xmlns="http://www.w3.org/2000/svg"
209
209
  aria-hidden="true"
@@ -345,8 +345,8 @@
345
345
  <svg
346
346
  class="ons-icon--logo{{ iconClasses }}"
347
347
  xmlns="http://www.w3.org/2000/svg"
348
- width="208"
349
- height="20"
348
+ width="250"
349
+ height="24"
350
350
  viewBox="33 2 552 60"
351
351
  aria-labelledby="{{ params.altTextId | default ('ons-logo-en-alt') }}"
352
352
  role="img"
@@ -442,8 +442,8 @@
442
442
  <svg
443
443
  class="ons-icon--logo{{ iconClasses }}"
444
444
  xmlns="http://www.w3.org/2000/svg"
445
- width="218"
446
- height="20"
445
+ width="262"
446
+ height="24"
447
447
  viewBox="15 2 620 60"
448
448
  aria-labelledby="{{ params.altTextId | default ('ons-logo-cy-alt') }}"
449
449
  role="img"
@@ -701,9 +701,9 @@
701
701
  {%- elif params.iconType == "official-statistics" -%}
702
702
  <svg
703
703
  xmlns="http://www.w3.org/2000/svg"
704
- width="77"
705
- height="93"
706
- viewBox="0 0 77 93"
704
+ width="75"
705
+ height="90"
706
+ viewBox="-5 0 90 90"
707
707
  fill="none"
708
708
  title="ons-official-statistics-badge"
709
709
  focusable="false"
@@ -86,6 +86,16 @@
86
86
  margin-top: 0.25rem;
87
87
  }
88
88
 
89
+ .ons-input--header-search {
90
+ border-radius: 0;
91
+ height: 56px;
92
+ border: 2px solid var(--ons-color-ocean-blue);
93
+
94
+ &:focus {
95
+ border: 2px solid var(--ons-color-input-border);
96
+ }
97
+ }
98
+
89
99
  .ons-input--select {
90
100
  appearance: none;
91
101
  background: var(--ons-color-input-bg)
@@ -149,6 +159,11 @@
149
159
  height: 2.5rem;
150
160
  }
151
161
 
162
+ .ons-input__button--header-search {
163
+ gap: 0;
164
+ height: 100%;
165
+ }
166
+
152
167
  .ons-input-search {
153
168
  @extend .ons-input--block;
154
169
  @extend .ons-input--ghost;
@@ -25,7 +25,7 @@
25
25
  <input
26
26
  type="{{ type }}"
27
27
  id="{{ params.id }}"
28
- class="ons-input ons-input--text ons-input-type__input{{ ' ons-input--error' if params.error }}{{ ' ons-search__input' if params.searchButton }}{{ ' ' + params.classes if params.classes else '' }}{% if params.width %}{{ ' ' }}ons-input{% if params.type == 'number' or params.type == 'tel' %}-number{% endif %}--w-{{ params.width }}{% endif %}{{ exclusiveClass }}{{ inputPlaceholder }}"
28
+ class="ons-input ons-input--text ons-input-type__input{{ ' ons-input--error' if params.error }}{{ ' ons-search__input' if params.searchButton }}{{ ' ons-input--header-search' if params.searchButton.variant == 'header' }}{{ ' ' + params.classes if params.classes else '' }}{% if params.width %}{{ ' ' }}ons-input{% if params.type == 'number' or params.type == 'tel' %}-number{% endif %}--w-{{ params.width }}{% endif %}{{ exclusiveClass }}{{ inputPlaceholder }}"
29
29
  {% if params.prefix and params.prefix.id and not params.prefix.title %}aria-labelledby="{{ params.prefix.id }}"{% elif params.suffix and params.suffix.id and not params.suffix.title %}aria-labelledby="{{ params.suffix.id }}"{% endif %}
30
30
  {% if params.prefix and params.prefix.id %}
31
31
  aria-labelledby="{{ params.id }} {{ params.prefix.id }}"
@@ -110,7 +110,7 @@
110
110
  {% endif %}
111
111
  {% elif params.searchButton %}
112
112
  <span
113
- class="ons-grid-flex ons-grid-flex--vertical-top ons-input_search-button{{ ' ons-input--with-text-description' if params.label.description }}"
113
+ class="ons-grid-flex ons-grid-flex--vertical-top ons-input_search-button{{ ' ons-input__button--header-search' if params.searchButton.variant == 'header' }}{{ ' ons-input--with-text-description' if params.label.description }}"
114
114
  >
115
115
  {% if params.accessiblePlaceholder %}
116
116
  {{
@@ -142,7 +142,7 @@
142
142
  "html": buttonLabel,
143
143
  "text": params.searchButton.text,
144
144
  "id": params.searchButton.id,
145
- "variants": 'small',
145
+ "variants": 'header-search' if params.searchButton.variant == 'header' else 'small',
146
146
  "classes": 'ons-search__btn' + (" " + params.searchButton.classes if params.searchButton.classes else ""),
147
147
  "attributes": params.searchButton.attributes,
148
148
  "iconType": params.searchButton.iconType,