@ons/design-system 72.9.1 → 72.9.2

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.
@@ -40,7 +40,7 @@
40
40
  .ons-document-list__item-image {
41
41
  width: 248px;
42
42
 
43
- & &__image-link {
43
+ & &__image {
44
44
  &--placeholder {
45
45
  height: 96px;
46
46
  }
@@ -50,7 +50,7 @@
50
50
  margin-right: 2.5rem;
51
51
  width: 379px;
52
52
 
53
- & &__image-link {
53
+ & &__image {
54
54
  &--placeholder {
55
55
  height: 248px;
56
56
  }
@@ -100,7 +100,7 @@
100
100
  }
101
101
 
102
102
  &__item-image & {
103
- &__image-link {
103
+ &__image {
104
104
  &--placeholder {
105
105
  height: 96px;
106
106
  }
@@ -112,7 +112,7 @@
112
112
  }
113
113
 
114
114
  &__item-image--file & {
115
- &__image-link {
115
+ &__image {
116
116
  border-color: var(--ons-color-borders);
117
117
 
118
118
  &--placeholder {
@@ -121,20 +121,12 @@
121
121
  }
122
122
  }
123
123
 
124
- &__image-link {
124
+ &__image {
125
125
  border: 2px solid transparent;
126
126
  box-sizing: content-box;
127
127
  display: block;
128
128
  width: 100%;
129
129
 
130
- &:focus {
131
- background-color: var(--ons-color-placeholder) !important;
132
- border: 2px solid var(--ons-color-borders-document-image-focus);
133
- box-shadow: none;
134
- outline: 4px solid var(--ons-color-focus) !important;
135
- outline-offset: 0 !important;
136
- }
137
-
138
130
  &--placeholder {
139
131
  background-clip: padding-box;
140
132
  background-color: var(--ons-color-placeholder);
@@ -1,32 +1,29 @@
1
1
  {% macro onsDocumentList(params) %}
2
+ {% set titleTag = params.headingLevel | default(2) %}
3
+ {% set openingTag = "<h" ~ titleTag %}
4
+ {% set closingTag = "</h" ~ titleTag ~ ">" %}
2
5
  <ul
3
6
  {% if params.id %}id="{{ params.id }}"{% endif %}class="ons-document-list{{ ' ' + params.classes if params.classes else '' }}"
4
7
  {% if params.attributes %}{% for attribute, value in (params.attributes.items() if params.attributes is mapping and params.attributes.items else params.attributes) %}{{ ' ' }}{{ attribute }}="{{ value }}"{% endfor %}{% endif %}
5
8
  >
6
9
  {% for document in params.documents %}
7
- {% set titleTag = params.headingLevel | default(2) %}
8
- {% set openingTag = "<h" ~ titleTag %}
9
- {% set closingTag = "</h" ~ titleTag ~ ">" %}
10
10
  {% set documentItem %}
11
11
  {% if document.thumbnail %}
12
12
  <div
13
13
  class="ons-document-list__item-image{{ ' ons-document-list__item-image--file' if document.metadata.file }}"
14
14
  aria-hidden="true"
15
15
  >
16
- <a
17
- class="ons-document-list__image-link{{ ' ons-document-list__image-link--placeholder' if not document.thumbnail.smallSrc }}"
18
- href="{{ document.title.url }}"
19
- tabindex="-1"
20
- >
21
- {% if document.thumbnail.smallSrc and document.thumbnail.largeSrc %}
22
- <img
23
- srcset="{{ document.thumbnail.smallSrc }} 1x, {{ document.thumbnail.largeSrc }} 2x"
24
- src="{{ document.thumbnail.smallSrc }}"
25
- alt=""
26
- loading="lazy"
27
- />
28
- {% endif %}
29
- </a>
16
+ {% if document.thumbnail.smallSrc and document.thumbnail.largeSrc %}
17
+ <img
18
+ class="ons-document-list__image"
19
+ srcset="{{ document.thumbnail.smallSrc }} 1x, {{ document.thumbnail.largeSrc }} 2x"
20
+ src="{{ document.thumbnail.smallSrc }}"
21
+ alt=""
22
+ loading="lazy"
23
+ />
24
+ {% else %}
25
+ <span class="ons-document-list__image ons-document-list__image--placeholder"> </span>
26
+ {% endif %}
30
27
  </div>
31
28
  {% endif %}
32
29
 
@@ -232,12 +232,12 @@ describe('FOR: Macro: Document list', () => {
232
232
  });
233
233
 
234
234
  test('THEN: has expected srcset attribute', () => {
235
- const srcset = $('.ons-document-list__image-link img').attr('srcset');
235
+ const srcset = $('.ons-document-list__image').attr('srcset');
236
236
  expect(srcset).toBe('/example-small.png 1x, /example-large.png 2x');
237
237
  });
238
238
 
239
239
  test('THEN: has expected src attribute', () => {
240
- const src = $('.ons-document-list__image-link img').attr('src');
240
+ const src = $('.ons-document-list__image').attr('src');
241
241
  expect(src).toBe('/example-small.png');
242
242
  });
243
243
  });
@@ -249,7 +249,7 @@ describe('FOR: Macro: Document list', () => {
249
249
  documents: [{ ...EXAMPLE_DOCUMENT_LIST_BASIC, thumbnail: true }],
250
250
  }),
251
251
  );
252
- expect($('.ons-document-list__image-link').hasClass('ons-document-list__image-link--placeholder')).toBe(true);
252
+ expect($('.ons-document-list__image').hasClass('ons-document-list__image--placeholder')).toBe(true);
253
253
  });
254
254
  });
255
255
  });
@@ -1,189 +1,269 @@
1
1
  /** @jest-environment jsdom */
2
2
 
3
3
  import * as cheerio from 'cheerio';
4
-
5
4
  import axe from '../../tests/helpers/axe';
6
5
  import { renderComponent, templateFaker } from '../../tests/helpers/rendering';
6
+ import { EXAMPLE_FIELDSET, EXAMPLE_FIELDSET_NO_ID, EXAMPLE_FIELDSET_NO_LEGEND } from './_test_examples';
7
7
 
8
- const EXAMPLE_FIELDSET_BASIC = {
9
- id: 'example-fieldset',
10
- legend: 'Fieldset legend',
11
- description: 'A fieldset description',
12
- };
8
+ describe('FOR: Macro: Fieldset', () => {
9
+ describe('GIVEN: Params: id', () => {
10
+ describe('WHEN: id is provided', () => {
11
+ const $ = cheerio.load(renderComponent('fieldset', EXAMPLE_FIELDSET));
13
12
 
14
- describe('macro: fieldset', () => {
15
- it('passes jest-axe checks', async () => {
16
- const $ = cheerio.load(renderComponent('fieldset', EXAMPLE_FIELDSET_BASIC));
13
+ test('THEN: renders fieldset with provided id', () => {
14
+ expect($('.ons-fieldset').attr('id')).toBe('example-fieldset');
15
+ });
17
16
 
18
- const results = await axe($.html());
19
- expect(results).toHaveNoViolations();
20
- });
17
+ test('THEN: legend has correct aria-describedby attribute', () => {
18
+ const ariaDescByVal = $('.ons-fieldset__legend').attr('aria-describedby');
19
+ expect(ariaDescByVal).toBe('example-fieldset-legend-description');
20
+ });
21
+ });
21
22
 
22
- it('has the provided `id` attribute', () => {
23
- const $ = cheerio.load(renderComponent('fieldset', EXAMPLE_FIELDSET_BASIC));
23
+ describe('WHEN: id is not provided', () => {
24
+ const $ = cheerio.load(renderComponent('fieldset', EXAMPLE_FIELDSET_NO_ID));
24
25
 
25
- expect($('.ons-fieldset').attr('id')).toBe('example-fieldset');
26
- });
26
+ test('THEN: description has default id', () => {
27
+ const id = $('.ons-fieldset__description').attr('id');
28
+ expect(id).toBe('legend-description');
29
+ });
27
30
 
28
- it('has the `legend` text', () => {
29
- const $ = cheerio.load(renderComponent('fieldset', EXAMPLE_FIELDSET_BASIC));
30
-
31
- const title = $('.ons-fieldset__legend-title').text();
32
- expect(title).toBe('Fieldset legend');
31
+ test('THEN: legend has correct aria-describedby attribute', () => {
32
+ const ariaDescByVal = $('.ons-fieldset__legend').attr('aria-describedby');
33
+ expect(ariaDescByVal).toBe('legend-description');
34
+ });
35
+ });
33
36
  });
34
37
 
35
- it('has the correct `aria-decribedby` value', () => {
36
- const $ = cheerio.load(renderComponent('fieldset', EXAMPLE_FIELDSET_BASIC));
38
+ describe('GIVEN: Params: legend', () => {
39
+ describe('WHEN: legend is provided', () => {
40
+ const $ = cheerio.load(renderComponent('fieldset', EXAMPLE_FIELDSET));
37
41
 
38
- const ariaDescByVal = $('.ons-fieldset__legend').attr('aria-describedby');
39
- expect(ariaDescByVal).toBe('example-fieldset-legend-description');
40
- });
42
+ test('THEN: jest-axe checks pass', async () => {
43
+ const results = await axe($.html());
44
+ expect(results).toHaveNoViolations();
45
+ });
41
46
 
42
- it('has the `description` text', () => {
43
- const $ = cheerio.load(renderComponent('fieldset', EXAMPLE_FIELDSET_BASIC));
47
+ test('THEN: renders legend with provided text', () => {
48
+ const title = $('.ons-fieldset__legend-title').text().trim();
49
+ expect(title).toBe('Fieldset legend');
50
+ });
44
51
 
45
- const title = $('.ons-fieldset__description').html().trim();
46
- expect(title).toBe('A fieldset description');
47
- });
52
+ test('THEN: legend has correct aria-describedby attribute', () => {
53
+ const ariaDescByVal = $('.ons-fieldset__legend').attr('aria-describedby');
54
+ expect(ariaDescByVal).toBe('example-fieldset-legend-description');
55
+ });
56
+
57
+ test('THEN: legend has the legend with description class', () => {
58
+ expect($('.ons-fieldset__legend').hasClass('ons-fieldset__legend--with-description')).toBe(true);
59
+ });
60
+ });
48
61
 
49
- it('has the correct `description` `id` when no `fieldset `id` is provided', () => {
50
- const $ = cheerio.load(renderComponent('fieldset', { ...EXAMPLE_FIELDSET_BASIC, id: undefined }));
62
+ describe('WHEN: legend is not provided and legendIsQuestionTitle is not set', () => {
63
+ const $ = cheerio.load(renderComponent('fieldset', EXAMPLE_FIELDSET_NO_LEGEND));
51
64
 
52
- const id = $('.ons-fieldset__description').attr('id');
53
- expect(id).toBe('legend-description');
65
+ test('THEN: does not render fieldset or legend', () => {
66
+ expect($('.ons-fieldset').length).toBe(0);
67
+ expect($('.ons-fieldset__legend').length).toBe(0);
68
+ });
69
+ });
54
70
  });
55
71
 
56
- it('has the correct `description` `id` when `fieldset `id` is provided', () => {
57
- const $ = cheerio.load(renderComponent('fieldset', EXAMPLE_FIELDSET_BASIC));
72
+ describe('GIVEN: Params: classes', () => {
73
+ describe('WHEN: classes are provided', () => {
74
+ const $ = cheerio.load(
75
+ renderComponent('fieldset', {
76
+ ...EXAMPLE_FIELDSET,
77
+ classes: 'extra-class another-extra-class',
78
+ }),
79
+ );
58
80
 
59
- const id = $('.ons-fieldset__description').attr('id');
60
- expect(id).toBe('example-fieldset-legend-description');
81
+ test('THEN: renders fieldset with provided classes', () => {
82
+ expect($('.ons-fieldset').hasClass('extra-class')).toBe(true);
83
+ expect($('.ons-fieldset').hasClass('another-extra-class')).toBe(true);
84
+ });
85
+ });
61
86
  });
62
87
 
63
- it('has the correct `legend` class when `description` is provided', () => {
64
- const $ = cheerio.load(renderComponent('fieldset', EXAMPLE_FIELDSET_BASIC));
88
+ describe('GIVEN: Params: legendClasses', () => {
89
+ describe('WHEN: legendClasses are provided', () => {
90
+ const $ = cheerio.load(
91
+ renderComponent('fieldset', {
92
+ ...EXAMPLE_FIELDSET,
93
+ legendClasses: 'extra-class another-extra-class',
94
+ }),
95
+ );
65
96
 
66
- expect($('.ons-fieldset__legend').hasClass('ons-fieldset__legend--with-description')).toBe(true);
97
+ test('THEN: renders legend with provided classes', () => {
98
+ expect($('.ons-fieldset__legend').hasClass('extra-class')).toBe(true);
99
+ expect($('.ons-fieldset__legend').hasClass('another-extra-class')).toBe(true);
100
+ });
101
+ });
67
102
  });
68
103
 
69
- it('has additionally provided style classes', () => {
70
- const $ = cheerio.load(
71
- renderComponent('fieldset', {
72
- ...EXAMPLE_FIELDSET_BASIC,
73
- classes: 'extra-class another-extra-class',
74
- }),
75
- );
104
+ describe('GIVEN: Params: attributes', () => {
105
+ describe('WHEN: attributes are provided', () => {
106
+ const $ = cheerio.load(
107
+ renderComponent('fieldset', {
108
+ ...EXAMPLE_FIELDSET,
109
+ attributes: {
110
+ a: 123,
111
+ b: 456,
112
+ },
113
+ }),
114
+ );
76
115
 
77
- expect($('.ons-fieldset').hasClass('extra-class')).toBe(true);
78
- expect($('.ons-fieldset').hasClass('another-extra-class')).toBe(true);
116
+ test('THEN: renders fieldset with provided attributes', () => {
117
+ expect($('.ons-fieldset').attr('a')).toBe('123');
118
+ expect($('.ons-fieldset').attr('b')).toBe('456');
119
+ });
120
+ });
79
121
  });
80
122
 
81
- it('has additionally provided `legendClasses`', () => {
82
- const $ = cheerio.load(
83
- renderComponent('fieldset', {
84
- ...EXAMPLE_FIELDSET_BASIC,
85
- legendClasses: 'extra-class another-extra-class',
86
- }),
87
- );
123
+ describe('GIVEN: Params: dontWrap', () => {
124
+ describe('WHEN: dontWrap is set to true', () => {
125
+ const $ = cheerio.load(
126
+ renderComponent(
127
+ 'fieldset',
128
+ {
129
+ ...EXAMPLE_FIELDSET,
130
+ dontWrap: true,
131
+ },
132
+ 'Example content...',
133
+ ),
134
+ );
88
135
 
89
- expect($('.ons-fieldset__legend').hasClass('extra-class')).toBe(true);
90
- expect($('.ons-fieldset__legend').hasClass('another-extra-class')).toBe(true);
91
- });
136
+ test('THEN: renders without fieldset wrapper', () => {
137
+ expect($('.ons-fieldset').length).toBe(0);
138
+ expect($('.ons-input-items').length).toBe(1);
139
+ });
92
140
 
93
- it('has additionally provided `attributes`', () => {
94
- const $ = cheerio.load(
95
- renderComponent('fieldset', {
96
- ...EXAMPLE_FIELDSET_BASIC,
97
- attributes: {
98
- a: 123,
99
- b: 456,
100
- },
101
- }),
102
- );
103
-
104
- expect($('.ons-fieldset').attr('a')).toBe('123');
105
- expect($('.ons-fieldset').attr('b')).toBe('456');
106
- });
141
+ test('THEN: renders content inside ons-input-items div', () => {
142
+ expect($('.ons-input-items').html()).toBe('Example content...');
143
+ });
144
+ });
107
145
 
108
- it('has the correct element with `dontWrap`', () => {
109
- const $ = cheerio.load(
110
- renderComponent('fieldset', {
111
- ...EXAMPLE_FIELDSET_BASIC,
112
- dontWrap: true,
113
- }),
114
- );
146
+ describe('WHEN: dontWrap is set to true and legend is not provided', () => {
147
+ const $ = cheerio.load(renderComponent('fieldset', { ...EXAMPLE_FIELDSET_NO_LEGEND, dontWrap: true }));
115
148
 
116
- expect($('.ons-input-items').length).toBe(1);
117
- expect($('.ons-fieldset').length).toBe(0);
149
+ test('THEN: renders ons-input-items div without fieldset or legend', () => {
150
+ expect($('.ons-fieldset').length).toBe(0);
151
+ expect($('.ons-fieldset__legend').length).toBe(0);
152
+ expect($('.ons-input-items').length).toBe(1);
153
+ });
154
+ });
118
155
  });
119
156
 
120
- it('calls with content', () => {
121
- const $ = cheerio.load(renderComponent('fieldset', EXAMPLE_FIELDSET_BASIC, 'Example content...'));
157
+ describe('GIVEN: Content', () => {
158
+ describe('WHEN: content is provided', () => {
159
+ const $ = cheerio.load(renderComponent('fieldset', EXAMPLE_FIELDSET, 'Example content...'));
122
160
 
123
- const content = $('.ons-fieldset').html().trim();
124
- expect(content).toEqual(expect.stringContaining('Example content...'));
161
+ test('THEN: renders fieldset with provided content', () => {
162
+ const content = $('.ons-fieldset').html();
163
+ expect(content).toContain('Example content...');
164
+ });
165
+ });
125
166
  });
126
167
 
127
- it('calls the error component when `error` is provided', () => {
128
- const faker = templateFaker();
129
- const errorSpy = faker.spy('error');
168
+ describe('GIVEN: Params: error', () => {
169
+ describe('WHEN: error is provided', () => {
170
+ const faker = templateFaker();
171
+ const errorSpy = faker.spy('error');
130
172
 
131
- faker.renderComponent('fieldset', {
132
- ...EXAMPLE_FIELDSET_BASIC,
133
- error: { text: 'There is an error' },
134
- });
173
+ faker.renderComponent('fieldset', {
174
+ ...EXAMPLE_FIELDSET,
175
+ error: { text: 'Error message' },
176
+ });
135
177
 
136
- expect(errorSpy.occurrences[0]).toEqual({
137
- text: 'There is an error',
178
+ test('THEN: wraps fieldset with error component', () => {
179
+ expect(errorSpy.occurrences.length).toBe(1);
180
+ expect(errorSpy.occurrences[0]).toEqual({ text: 'Error message' });
181
+ });
138
182
  });
139
183
  });
140
184
 
141
- describe('with `legendIsQuestionTitle`', () => {
142
- it('passes jest-axe checks', async () => {
143
- const $ = cheerio.load(renderComponent('fieldset', { ...EXAMPLE_FIELDSET_BASIC, legendIsQuestionTitle: true }));
185
+ describe('GIVEN: Params: legendIsQuestionTitle', () => {
186
+ describe('WHEN: legendIsQuestionTitle is set to true and legend is provided', () => {
187
+ const $ = cheerio.load(
188
+ renderComponent('fieldset', {
189
+ ...EXAMPLE_FIELDSET,
190
+ legendIsQuestionTitle: true,
191
+ }),
192
+ );
144
193
 
145
- const results = await axe($.html());
146
- expect(results).toHaveNoViolations();
194
+ test('THEN: jest-axe checks pass', async () => {
195
+ const results = await axe($.html());
196
+ expect(results).toHaveNoViolations();
197
+ });
198
+
199
+ test('THEN: description has correct classes', () => {
200
+ expect($('.ons-fieldset__description').hasClass('ons-fieldset__description--title')).toBe(true);
201
+ expect($('.ons-fieldset__description').hasClass('ons-u-mb-l')).toBe(true);
202
+ });
147
203
  });
148
204
 
149
- it('renders the legend in a H1', () => {
150
- const $ = cheerio.load(renderComponent('fieldset', { ...EXAMPLE_FIELDSET_BASIC, legendIsQuestionTitle: true }));
151
- const titleTag = $('.ons-fieldset__legend-title')[0].tagName;
205
+ describe('WHEN: legendIsQuestionTitle is not set and legend is provided', () => {
206
+ const $ = cheerio.load(renderComponent('fieldset', EXAMPLE_FIELDSET));
152
207
 
153
- expect(titleTag).toBe('h1');
208
+ test('THEN: renders legend title in a span', () => {
209
+ const titleTag = $('.ons-fieldset__legend-title')[0].tagName;
210
+ expect(titleTag).toBe('span');
211
+ });
154
212
  });
213
+ });
155
214
 
156
- it('has additionally provided `legendTitleClasses`', () => {
215
+ describe('GIVEN: Params: legendTitleClasses', () => {
216
+ describe('WHEN: legendTitleClasses are provided with legendIsQuestionTitle set to true', () => {
157
217
  const $ = cheerio.load(
158
218
  renderComponent('fieldset', {
159
- ...EXAMPLE_FIELDSET_BASIC,
160
- legendTitleClasses: 'extra-class another-extra-class',
219
+ ...EXAMPLE_FIELDSET,
161
220
  legendIsQuestionTitle: true,
221
+ legendTitleClasses: 'extra-class another-extra-class',
162
222
  }),
163
223
  );
164
224
 
165
- expect($('.ons-fieldset__legend-title').hasClass('extra-class')).toBe(true);
166
- expect($('.ons-fieldset__legend-title').hasClass('another-extra-class')).toBe(true);
225
+ test('THEN: renders legend title with provided classes', () => {
226
+ expect($('.ons-fieldset__legend-title').hasClass('extra-class')).toBe(true);
227
+ expect($('.ons-fieldset__legend-title').hasClass('another-extra-class')).toBe(true);
228
+ });
167
229
  });
168
230
 
169
- it('has the `legend` text', () => {
231
+ describe('WHEN: legendTitleClasses are provided without legendIsQuestionTitle', () => {
170
232
  const $ = cheerio.load(
171
233
  renderComponent('fieldset', {
172
- ...EXAMPLE_FIELDSET_BASIC,
234
+ ...EXAMPLE_FIELDSET,
173
235
  legendTitleClasses: 'extra-class another-extra-class',
174
- legendIsQuestionTitle: true,
175
236
  }),
176
237
  );
177
238
 
178
- const title = $('.ons-fieldset__legend-title').html().trim();
179
- expect(title).toBe('Fieldset legend');
239
+ test('THEN: legend title does not have additional classes', () => {
240
+ expect($('.ons-fieldset__legend-title').hasClass('extra-class')).toBe(false);
241
+ expect($('.ons-fieldset__legend-title').hasClass('another-extra-class')).toBe(false);
242
+ });
180
243
  });
244
+ });
245
+
246
+ describe('GIVEN: Params: description', () => {
247
+ describe('WHEN: description is not provided', () => {
248
+ const $ = cheerio.load(
249
+ renderComponent('fieldset', {
250
+ ...EXAMPLE_FIELDSET,
251
+ description: undefined,
252
+ }),
253
+ );
254
+
255
+ test('THEN: fieldset renders without description', () => {
256
+ expect($('.ons-fieldset__description').length).toBe(0);
257
+ });
181
258
 
182
- it('has the correct `description` classes', () => {
183
- const $ = cheerio.load(renderComponent('fieldset', { ...EXAMPLE_FIELDSET_BASIC, legendIsQuestionTitle: true }));
259
+ test('THEN: legend does not have aria-describedby attribute', () => {
260
+ const ariaDescByVal = $('.ons-fieldset__legend').attr('aria-describedby');
261
+ expect(ariaDescByVal).toBeUndefined();
262
+ });
184
263
 
185
- expect($('.ons-fieldset__description').hasClass('ons-fieldset__description--title')).toBe(true);
186
- expect($('.ons-fieldset__description').hasClass('ons-u-mb-l')).toBe(true);
264
+ test('THEN: legend does not have ons-fieldset__legend--with-description class', () => {
265
+ expect($('.ons-fieldset__legend').hasClass('ons-fieldset__legend--with-description')).toBe(false);
266
+ });
187
267
  });
188
268
  });
189
269
  });
@@ -0,0 +1,15 @@
1
+ export const EXAMPLE_FIELDSET = {
2
+ id: 'example-fieldset',
3
+ legend: 'Fieldset legend',
4
+ description: 'A fieldset description',
5
+ };
6
+
7
+ export const EXAMPLE_FIELDSET_NO_LEGEND = {
8
+ id: 'example-fieldset',
9
+ description: 'A fieldset description',
10
+ };
11
+
12
+ export const EXAMPLE_FIELDSET_NO_ID = {
13
+ legend: 'Fieldset legend',
14
+ description: 'A fieldset description',
15
+ };
@@ -243,8 +243,19 @@
243
243
  }
244
244
 
245
245
  &-nav-menu {
246
+ // applies styles for non-js variant
246
247
  background-color: var(--ons-color-branded-tint);
248
+ border-bottom: 1px solid var(--ons-color-ocean-blue);
247
249
  width: 100%;
250
+ margin-bottom: 0;
251
+ padding-bottom: 1rem;
252
+
253
+ // updates styles when js is enabled
254
+ .ons-js-enabled & {
255
+ border-bottom: 0;
256
+ margin-bottom: 1rem;
257
+ padding-bottom: 0;
258
+ }
248
259
 
249
260
  &__key-list {
250
261
  border-bottom: 1px solid var(--ons-color-ocean-blue);
@@ -188,7 +188,7 @@
188
188
  {{
189
189
  onsButton({
190
190
  "text": params.menuLinks.toggleMenuButton.text | default("Menu"),
191
- "classes": "ons-u-fs-s--b ons-js-toggle-nav-menu button-nav",
191
+ "classes": "ons-u-fs-s--b ons-js-toggle-nav-menu button-nav active disabled",
192
192
  "type": "button",
193
193
  "variants": "menu",
194
194
  "iconType": "chevron",
@@ -196,24 +196,27 @@
196
196
  "attributes": {
197
197
  "aria-label": params.menuLinks.toggleMenuButton.ariaLabel | default("Toggle menu"),
198
198
  "aria-controls": params.menuLinks.id,
199
- "aria-expanded": "false"
199
+ "aria-expanded": "true",
200
+ "aria-disabled": "true"
200
201
  }
201
202
  })
202
203
  }}
203
204
  </div>
204
205
  {% endif %}
206
+
205
207
  {% if params.searchLinks %}
206
208
  <div class="ons-header__links ons-grid__col">
207
209
  {{
208
210
  onsButton({
209
- "classes": "ons-u-fs-s--b ons-js-toggle-header-search ons-btn--search ons-btn--search-icon",
211
+ "classes": "ons-u-fs-s--b ons-js-toggle-header-search ons-btn--close ons-btn--search-icon active disabled",
210
212
  "type": "button",
211
213
  "variants": "search",
212
214
  "iconType": "search",
213
215
  "attributes": {
214
216
  "aria-label": params.searchLinks.searchButtonAriaLabel | default("Toggle search"),
215
217
  "aria-controls": params.searchLinks.id,
216
- "aria-expanded": "false"
218
+ "aria-expanded": "true",
219
+ "aria-disabled": "true"
217
220
  }
218
221
  })
219
222
  }}
@@ -261,9 +264,10 @@
261
264
 
262
265
  {% if params.variants == "basic" and params.menuLinks %}
263
266
  <nav
264
- class="ons-u-d-no ons-js-nav-menu ons-header-nav-menu ons-u-mb-s ons-u-pt-2xl"
267
+ class="ons-js-nav-menu ons-header-nav-menu ons-u-pt-2xl"
265
268
  id="{{ params.menuLinks.id }}"
266
269
  aria-label="{{ params.menuLinks.ariaLabel | default("Menu navigation") }}"
270
+ aria-hidden="false"
267
271
  >
268
272
  {% if params.menuLinks.keyLinks %}
269
273
  <div class="ons-container">
@@ -334,9 +338,10 @@
334
338
 
335
339
  {% if params.variants == "basic" and params.searchLinks %}
336
340
  <nav
337
- class="ons-u-d-no ons-js-header-search ons-header-nav-search {{ params.searchLinks.classes }}"
341
+ class="ons-js-header-search ons-header-nav-search {{ params.searchLinks.classes }}"
338
342
  id="{{ params.searchLinks.id }}"
339
343
  aria-label="{{ params.searchLinks.searchNavigationAriaLabel | default('Search navigation') }}"
344
+ aria-hidden="false"
340
345
  >
341
346
  <div class="ons-container">
342
347
  <div class="ons-header-nav-search__input">