@ons/design-system 66.0.1 → 67.0.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.
- package/components/accordion/_macro.spec.js +2 -8
- package/components/accordion/accordion.dom.js +2 -2
- package/components/accordion/accordion.spec.js +22 -19
- package/components/accordion/example-accordion-open.njk +3 -3
- package/components/autosuggest/_macro.spec.js +2 -10
- package/components/button/_button.scss +23 -12
- package/components/button/button.js +12 -3
- package/components/card/_card.scss +1 -1
- package/components/checkboxes/_macro.njk +1 -1
- package/components/checkboxes/example-checkboxes-with-revealed-checkboxes-expanded.njk +1 -1
- package/components/checkboxes/example-checkboxes-with-revealed-checkboxes.njk +1 -1
- package/components/cookies-banner/_macro.njk +1 -1
- package/components/cookies-banner/_macro.spec.js +1 -1
- package/components/details/_details.scss +66 -57
- package/components/details/_macro.njk +4 -4
- package/components/details/_macro.spec.js +3 -10
- package/components/details/details.dom.js +1 -1
- package/components/details/details.js +13 -1
- package/components/details/details.spec.js +43 -11
- package/components/details/example-details-with-warning.njk +1 -2
- package/components/footer/_macro.njk +1 -1
- package/components/header/_macro.njk +2 -2
- package/components/header/_macro.spec.js +128 -5
- package/components/header/example-header-external-with-navigation-and-search.njk +57 -0
- package/components/icon/_macro.njk +4 -3
- package/components/label/_macro.njk +2 -2
- package/components/list/_list.scss +1 -1
- package/components/navigation/_macro.njk +3 -1
- package/components/related-content/_macro.njk +28 -30
- package/components/section-navigation/_macro.njk +56 -55
- package/components/video/_macro.njk +11 -11
- package/css/main.css +1 -1
- package/css/print.css +1 -1
- package/layout/_template.njk +29 -30
- package/package.json +1 -1
- package/scripts/main.es5.js +1 -1
- package/scripts/main.js +1 -1
- package/scss/objects/_page.scss +3 -5
- package/scss/print.scss +28 -5
- package/components/collapsible/_macro.njk +0 -22
- package/components/collapsible/_macro.spec.js +0 -151
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { renderComponent, setTestPage } from '../../tests/helpers/rendering';
|
|
1
|
+
import { renderComponent, renderTemplate, setTestPage } from '../../tests/helpers/rendering';
|
|
2
2
|
|
|
3
3
|
const EXAMPLE_DETAILS_BASIC = {
|
|
4
4
|
id: 'details-id',
|
|
@@ -6,6 +6,22 @@ const EXAMPLE_DETAILS_BASIC = {
|
|
|
6
6
|
content: 'Content for details',
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
+
const EXAMPLE_PAGE = `
|
|
10
|
+
${renderComponent('details', {
|
|
11
|
+
id: 'details-id',
|
|
12
|
+
title: 'Title for details',
|
|
13
|
+
content: 'Content for details',
|
|
14
|
+
})}
|
|
15
|
+
|
|
16
|
+
${renderComponent('details', {
|
|
17
|
+
id: 'details-id-2',
|
|
18
|
+
title: 'Title for details',
|
|
19
|
+
content: 'Content for details',
|
|
20
|
+
})}
|
|
21
|
+
`;
|
|
22
|
+
|
|
23
|
+
const RENDERED_EXAMPLE_PAGE = renderTemplate(EXAMPLE_PAGE);
|
|
24
|
+
|
|
9
25
|
describe('script: details', () => {
|
|
10
26
|
it('begins open when specified', async () => {
|
|
11
27
|
await setTestPage(
|
|
@@ -16,8 +32,8 @@ describe('script: details', () => {
|
|
|
16
32
|
}),
|
|
17
33
|
);
|
|
18
34
|
|
|
19
|
-
const
|
|
20
|
-
expect(
|
|
35
|
+
const detailsOpenClass = await page.$eval('.ons-js-details', (node) => node.classList.contains('ons-details--open'));
|
|
36
|
+
expect(detailsOpenClass).toBe(true);
|
|
21
37
|
});
|
|
22
38
|
|
|
23
39
|
describe('when the details heading is clicked to open the details', () => {
|
|
@@ -26,18 +42,34 @@ describe('script: details', () => {
|
|
|
26
42
|
await page.click('.ons-js-details-heading');
|
|
27
43
|
});
|
|
28
44
|
|
|
29
|
-
it('sets the `open` attribute', async () => {
|
|
30
|
-
const
|
|
31
|
-
|
|
45
|
+
it('sets the `open` attribute and adds the correct class', async () => {
|
|
46
|
+
const detailsOpenClass = await page.$eval('.ons-js-details', (node) => node.classList.contains('ons-details--open'));
|
|
47
|
+
|
|
48
|
+
expect(detailsOpenClass).toBe(true);
|
|
32
49
|
});
|
|
33
50
|
|
|
34
51
|
it('sets the `ga` attributes', async () => {
|
|
35
|
-
const gaHeadingAttribute = await page.$eval('.ons-js-details-heading', element => element.getAttribute('data-ga-action'));
|
|
52
|
+
const gaHeadingAttribute = await page.$eval('.ons-js-details-heading', (element) => element.getAttribute('data-ga-action'));
|
|
36
53
|
|
|
37
54
|
expect(gaHeadingAttribute).toBe('Open panel');
|
|
38
55
|
});
|
|
39
56
|
});
|
|
40
57
|
|
|
58
|
+
describe('when there is more than one details component and a details heading is clicked to open the details', () => {
|
|
59
|
+
beforeEach(async () => {
|
|
60
|
+
await setTestPage('/test', RENDERED_EXAMPLE_PAGE);
|
|
61
|
+
await page.click('#details-id > .ons-js-details-heading');
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it('sets the `open` attribute and open class on the right component', async () => {
|
|
65
|
+
const detailsOpenClass = await page.$eval('#details-id', (node) => node.classList.contains('ons-details--open'));
|
|
66
|
+
const detailsOpenClass2 = await page.$eval('#details-id-2', (node) => node.classList.contains('ons-details--open'));
|
|
67
|
+
|
|
68
|
+
expect(detailsOpenClass).toBe(true);
|
|
69
|
+
expect(detailsOpenClass2).toBe(false);
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
|
|
41
73
|
describe('when the details heading is focused', () => {
|
|
42
74
|
beforeEach(async () => {
|
|
43
75
|
await setTestPage('/test', renderComponent('details', EXAMPLE_DETAILS_BASIC));
|
|
@@ -50,8 +82,8 @@ describe('script: details', () => {
|
|
|
50
82
|
});
|
|
51
83
|
|
|
52
84
|
it('opens the details content', async () => {
|
|
53
|
-
const
|
|
54
|
-
expect(
|
|
85
|
+
const detailsOpenClass = await page.$eval('.ons-js-details', (node) => node.classList.contains('ons-details--open'));
|
|
86
|
+
expect(detailsOpenClass).toBe(true);
|
|
55
87
|
});
|
|
56
88
|
});
|
|
57
89
|
|
|
@@ -61,8 +93,8 @@ describe('script: details', () => {
|
|
|
61
93
|
});
|
|
62
94
|
|
|
63
95
|
it('opens the details content', async () => {
|
|
64
|
-
const
|
|
65
|
-
expect(
|
|
96
|
+
const detailsOpenClass = await page.$eval('.ons-js-details', (node) => node.classList.contains('ons-details--open'));
|
|
97
|
+
expect(detailsOpenClass).toBe(true);
|
|
66
98
|
});
|
|
67
99
|
});
|
|
68
100
|
});
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{% from "components/details/_macro.njk" import onsDetails %}
|
|
2
2
|
{% from "components/panel/_macro.njk" import onsPanel %}
|
|
3
3
|
|
|
4
|
-
{%
|
|
5
|
-
call onsDetails({
|
|
4
|
+
{% call onsDetails({
|
|
6
5
|
"id": "details-example-with-warning",
|
|
7
6
|
"title": "Need to answer separately from your household?"
|
|
8
7
|
})
|
|
@@ -179,7 +179,7 @@
|
|
|
179
179
|
{% endif %}
|
|
180
180
|
{% if params.copyrightDeclaration %}
|
|
181
181
|
<!-- Copyright -->
|
|
182
|
-
<div class="ons-grid ons-grid--flex ons-grid--vertical-bottom ons-grid--between">
|
|
182
|
+
<div class="ons-grid ons-grid--flex ons-grid--vertical-bottom ons-grid--between">
|
|
183
183
|
<div class="ons-grid__col">
|
|
184
184
|
<p class="ons-u-fs-s ons-u-mb-no ons-footer__copyright">© {{ params.copyrightDeclaration.copyright }} <br> {{ params.copyrightDeclaration.text }}</p>
|
|
185
185
|
</div>
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
<div class="ons-grid__col ons-col-auto{% if controlVisibility == true %} ons-u-d-no@xxs@{{ breakpoint }}{% endif %}">
|
|
89
89
|
<nav class="ons-header-service-nav ons-header-service-nav--main {{ params.serviceLinks.classes }}" aria-label="{{ params.serviceLinks.ariaLabel | default("Service links navigation") }}">
|
|
90
90
|
<ul class="ons-header-service-nav__list">
|
|
91
|
-
{% for item in params.serviceLinks.itemsList %}
|
|
91
|
+
{% for item in params.serviceLinks.itemsList %}
|
|
92
92
|
<li class="ons-header-service-nav__item">
|
|
93
93
|
{% if item.iconType %}
|
|
94
94
|
{{
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
{% if params.serviceLinks %}
|
|
140
140
|
<nav class="ons-header-service-nav ons-header-service-nav--mobile ons-u-d-no ons-js-services-mobile-nav" id="{{ params.serviceLinks.id }}" aria-label="{{ params.serviceLinks.ariaLabel | default("Service links navigation") }}">
|
|
141
141
|
<ul class="ons-header-service-nav__list">
|
|
142
|
-
{% for item in params.serviceLinks.itemsList %}
|
|
142
|
+
{% for item in params.serviceLinks.itemsList %}
|
|
143
143
|
<li class="ons-header-service-nav__item ons-header-service-nav__item--mobile">
|
|
144
144
|
{% if item.iconType %}
|
|
145
145
|
{{
|
|
@@ -161,6 +161,45 @@ const EXAMPLE_HEADER_NAVIGATION_WITH_SUBNAVIGATION_CONFIG = {
|
|
|
161
161
|
},
|
|
162
162
|
};
|
|
163
163
|
|
|
164
|
+
const EXAMPLE_HEADER_NAVIGATION_WITH_SITESEARCHAUTOSUGGEST = {
|
|
165
|
+
navigation: {
|
|
166
|
+
id: 'main-nav',
|
|
167
|
+
ariaLabel: 'Main menu',
|
|
168
|
+
currentPath: '#home',
|
|
169
|
+
itemsList: [
|
|
170
|
+
{
|
|
171
|
+
title: 'Home',
|
|
172
|
+
url: '#home',
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
title: 'Guidance',
|
|
176
|
+
url: '#0',
|
|
177
|
+
},
|
|
178
|
+
],
|
|
179
|
+
toggleNavigationButton: {
|
|
180
|
+
text: 'Menu',
|
|
181
|
+
ariaLabel: 'Toggle main menu',
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
siteSearchAutosuggest: {
|
|
185
|
+
label: 'label',
|
|
186
|
+
instructions: 'Use up and down keys to navigate.',
|
|
187
|
+
ariaYouHaveSelected: 'You have selected',
|
|
188
|
+
ariaMinChars: 'Enter 3 or more characters for suggestions.',
|
|
189
|
+
minChars: 3,
|
|
190
|
+
ariaResultsLabel: 'Country suggestions',
|
|
191
|
+
ariaOneResult: 'There is one suggestion available.',
|
|
192
|
+
ariaNResults: 'There are {n} suggestions available.',
|
|
193
|
+
ariaLimitedResults: 'Type more characters to improve your search',
|
|
194
|
+
moreResults: 'Continue entering to improve suggestions',
|
|
195
|
+
resultsTitle: 'Suggestions',
|
|
196
|
+
resultsTitleId: 'country-of-birth-suggestions',
|
|
197
|
+
noResults: 'No suggestions found.',
|
|
198
|
+
typeMore: 'Continue entering to get suggestions',
|
|
199
|
+
language: 'en-gb',
|
|
200
|
+
},
|
|
201
|
+
};
|
|
202
|
+
|
|
164
203
|
describe('macro: header', () => {
|
|
165
204
|
describe('mode: basic', () => {
|
|
166
205
|
it('passes jest-axe checks', async () => {
|
|
@@ -453,21 +492,21 @@ describe('macro: header', () => {
|
|
|
453
492
|
it('has the text for each list item', () => {
|
|
454
493
|
const $ = cheerio.load(renderComponent('header', EXAMPLE_HEADER_SERVICE_LIST_ITEMS));
|
|
455
494
|
|
|
456
|
-
const values = mapAll($('.ons-header-service-nav--main .ons-header-service-nav__item'), node => node.text().trim());
|
|
495
|
+
const values = mapAll($('.ons-header-service-nav--main .ons-header-service-nav__item'), (node) => node.text().trim());
|
|
457
496
|
expect(values).toEqual(['Title 1', 'Title 2', 'Title 3']);
|
|
458
497
|
});
|
|
459
498
|
|
|
460
499
|
it('has the link text for each list item', () => {
|
|
461
500
|
const $ = cheerio.load(renderComponent('header', EXAMPLE_HEADER_SERVICE_LINKS_MULTIPLE));
|
|
462
501
|
|
|
463
|
-
const values = mapAll($('.ons-header-service-nav--main .ons-header-service-nav__link'), node => node.text().trim());
|
|
502
|
+
const values = mapAll($('.ons-header-service-nav--main .ons-header-service-nav__link'), (node) => node.text().trim());
|
|
464
503
|
expect(values).toEqual(['Title 1', 'Title 2', 'Title 3']);
|
|
465
504
|
});
|
|
466
505
|
|
|
467
506
|
it('has the link href for each list item', () => {
|
|
468
507
|
const $ = cheerio.load(renderComponent('header', EXAMPLE_HEADER_SERVICE_LINKS_MULTIPLE));
|
|
469
508
|
|
|
470
|
-
const values = mapAll($('.ons-header-service-nav--main .ons-header-service-nav__link'), node => node.attr('href'));
|
|
509
|
+
const values = mapAll($('.ons-header-service-nav--main .ons-header-service-nav__link'), (node) => node.attr('href'));
|
|
471
510
|
expect(values).toEqual(['#1', '#2', '#3']);
|
|
472
511
|
});
|
|
473
512
|
|
|
@@ -486,14 +525,14 @@ describe('macro: header', () => {
|
|
|
486
525
|
it('has the link text for each list item for mobile', () => {
|
|
487
526
|
const $ = cheerio.load(renderComponent('header', EXAMPLE_HEADER_SERVICE_LINKS_MULTIPLE));
|
|
488
527
|
|
|
489
|
-
const values = mapAll($('.ons-header-service-nav--mobile .ons-header-service-nav__link'), node => node.text().trim());
|
|
528
|
+
const values = mapAll($('.ons-header-service-nav--mobile .ons-header-service-nav__link'), (node) => node.text().trim());
|
|
490
529
|
expect(values).toEqual(['Title 1', 'Title 2', 'Title 3']);
|
|
491
530
|
});
|
|
492
531
|
|
|
493
532
|
it('has the link href for each list item for mobile', () => {
|
|
494
533
|
const $ = cheerio.load(renderComponent('header', EXAMPLE_HEADER_SERVICE_LINKS_MULTIPLE));
|
|
495
534
|
|
|
496
|
-
const values = mapAll($('.ons-header-service-nav--mobile .ons-header-service-nav__link'), node => node.attr('href'));
|
|
535
|
+
const values = mapAll($('.ons-header-service-nav--mobile .ons-header-service-nav__link'), (node) => node.attr('href'));
|
|
497
536
|
expect(values).toEqual(['#1', '#2', '#3']);
|
|
498
537
|
});
|
|
499
538
|
|
|
@@ -742,3 +781,87 @@ describe('macro: header', () => {
|
|
|
742
781
|
});
|
|
743
782
|
});
|
|
744
783
|
});
|
|
784
|
+
|
|
785
|
+
describe('mode: with site search autosuggest', () => {
|
|
786
|
+
it('renders the search with expected parameters', () => {
|
|
787
|
+
const faker = templateFaker();
|
|
788
|
+
const buttonSpy = faker.spy('autosuggest');
|
|
789
|
+
|
|
790
|
+
faker.renderComponent('header', EXAMPLE_HEADER_NAVIGATION_WITH_SITESEARCHAUTOSUGGEST);
|
|
791
|
+
|
|
792
|
+
expect(buttonSpy.occurrences[0]).toEqual({
|
|
793
|
+
ariaLimitedResults: 'Type more characters to improve your search',
|
|
794
|
+
minChars: 3,
|
|
795
|
+
language: 'en-gb',
|
|
796
|
+
ariaMinChars: 'Enter 3 or more characters for suggestions.',
|
|
797
|
+
ariaNResults: 'There are {n} suggestions available.',
|
|
798
|
+
ariaOneResult: 'There is one suggestion available.',
|
|
799
|
+
ariaResultsLabel: 'Country suggestions',
|
|
800
|
+
ariaYouHaveSelected: 'You have selected',
|
|
801
|
+
containerClasses: 'ons-autosuggest--header',
|
|
802
|
+
id: 'ons-site-search',
|
|
803
|
+
input: {
|
|
804
|
+
accessiblePlaceholder: true,
|
|
805
|
+
autocomplete: 'off',
|
|
806
|
+
classes: 'ons-input-search ons-input-search--icon',
|
|
807
|
+
label: {
|
|
808
|
+
classes: 'ons-u-pl-m ons-label--white',
|
|
809
|
+
id: 'ons-site-search-label',
|
|
810
|
+
text: 'label',
|
|
811
|
+
},
|
|
812
|
+
},
|
|
813
|
+
instructions: 'Use up and down keys to navigate.',
|
|
814
|
+
moreResults: 'Continue entering to improve suggestions',
|
|
815
|
+
noResults: 'No suggestions found.',
|
|
816
|
+
resultsTitle: 'Suggestions',
|
|
817
|
+
typeMore: 'Continue entering to get suggestions',
|
|
818
|
+
});
|
|
819
|
+
});
|
|
820
|
+
|
|
821
|
+
describe('when the user inputs text', () => {
|
|
822
|
+
let $; // Initialize a Cheerio instance
|
|
823
|
+
|
|
824
|
+
const mockData = [
|
|
825
|
+
{ en: 'England' },
|
|
826
|
+
{ en: 'Wales' },
|
|
827
|
+
{ en: 'Scotland' },
|
|
828
|
+
{ en: 'United States of America' },
|
|
829
|
+
{ en: 'United States Virgin Islands' },
|
|
830
|
+
{ en: 'Åland Islands' },
|
|
831
|
+
];
|
|
832
|
+
|
|
833
|
+
beforeEach(() => {
|
|
834
|
+
$ = cheerio.load(
|
|
835
|
+
renderComponent('header', {
|
|
836
|
+
...EXAMPLE_HEADER_NAVIGATION_WITH_SITESEARCHAUTOSUGGEST,
|
|
837
|
+
autosuggestData: mockData,
|
|
838
|
+
}),
|
|
839
|
+
);
|
|
840
|
+
});
|
|
841
|
+
|
|
842
|
+
it('does not show suggestions when input length < minimum characters', () => {
|
|
843
|
+
$('.ons-js-autosuggest-input').val('En');
|
|
844
|
+
|
|
845
|
+
setTimeout(() => {
|
|
846
|
+
const suggestionCount = $('.ons-autosuggest__option').length;
|
|
847
|
+
expect(suggestionCount).toBe(0);
|
|
848
|
+
}, 20);
|
|
849
|
+
});
|
|
850
|
+
|
|
851
|
+
it('shows suggestions when input length >= minimum characters', () => {
|
|
852
|
+
$('.ons-js-autosuggest-input').val('Eng');
|
|
853
|
+
|
|
854
|
+
setTimeout(() => {
|
|
855
|
+
const suggestionCount = $('.ons-autosuggest__option').length;
|
|
856
|
+
expect(suggestionCount).toBe(1);
|
|
857
|
+
}, 20);
|
|
858
|
+
});
|
|
859
|
+
|
|
860
|
+
it('gets the language if set', () => {
|
|
861
|
+
$('.ons-js-autosuggest-input').val('Eng');
|
|
862
|
+
|
|
863
|
+
const autosuggestElement = $('.ons-js-autosuggest').attr('data-lang');
|
|
864
|
+
expect(autosuggestElement).toBe('en-gb');
|
|
865
|
+
});
|
|
866
|
+
});
|
|
867
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
"fullWidth": true
|
|
3
|
+
---
|
|
4
|
+
{% from "components/header/_macro.njk" import onsHeader %}
|
|
5
|
+
|
|
6
|
+
{{
|
|
7
|
+
onsHeader({
|
|
8
|
+
"title": 'Design system',
|
|
9
|
+
"titleUrl": '#0',
|
|
10
|
+
"navigation": {
|
|
11
|
+
"id": 'main-nav',
|
|
12
|
+
"ariaLabel": 'Main menu',
|
|
13
|
+
"currentPath": '#home',
|
|
14
|
+
"itemsList": [
|
|
15
|
+
{
|
|
16
|
+
"text": 'Home',
|
|
17
|
+
"url": '#home'
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"text": 'Guidance',
|
|
21
|
+
"url": '#0'
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"text": 'Foundations',
|
|
25
|
+
"url": '#0'
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"text": 'Components',
|
|
29
|
+
"url": '#0'
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"text": 'Patterns',
|
|
33
|
+
"url": '#0'
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"toggleNavigationButton": {
|
|
37
|
+
"text": 'Menu',
|
|
38
|
+
"ariaLabel": 'Toggle main menu'
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
'siteSearchAutosuggest': {
|
|
42
|
+
"autosuggestData": "/examples/data/country-of-birth.json",
|
|
43
|
+
"label": "search",
|
|
44
|
+
"instructions": "instructions",
|
|
45
|
+
"ariaYouHaveSelected": "ariaYouHaveSelected",
|
|
46
|
+
"ariaMinChars": "ariaMinChars",
|
|
47
|
+
"ariaResultsLabel": "ariaResultsLabel",
|
|
48
|
+
"ariaOneResult": "ariaOneResult",
|
|
49
|
+
"ariaNResults": "ariaNResults",
|
|
50
|
+
"ariaLimitedResults": "ariaLimitedResults",
|
|
51
|
+
"moreResults": "moreResults",
|
|
52
|
+
"resultsTitle": "resultsTitle",
|
|
53
|
+
"noResults": "noResults",
|
|
54
|
+
"typeMore": "typeMore"
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
}}
|
|
@@ -72,9 +72,10 @@
|
|
|
72
72
|
<path d="M32,16.0986285 C32.0009185,7.5342974 25.337417,0.468462963 16.8372092,0.0203294753 C8.33700136,-0.427804013 0.97607758,5.89865855 0.0874346352,14.4161886 C-0.801208309,22.9337186 5.09355054,30.6602611 13.5009524,31.9979281 L13.5009524,20.7518951 L9.44,20.7518951 L9.44,16.0986285 L13.5009524,16.0986285 L13.5009524,12.549267 C13.5009524,8.5169471 15.8857143,6.28613892 19.5428571,6.28613892 C20.742535,6.30277426 21.9393895,6.40782423 23.1238095,6.60044523 L23.1238095,10.5637711 L21.1047619,10.5637711 C19.1161905,10.5637711 18.4990476,11.8056643 18.4990476,13.0782216 L18.4990476,16.0986285 L22.9409524,16.0986285 L22.2247619,20.7518951 L18.4990476,20.7518951 L18.4990476,31.9979281 C26.2735701,30.760956 31.9991507,24.0182672 32,16.0986285 L32,16.0986285 Z"/>
|
|
73
73
|
</svg>
|
|
74
74
|
{% elif params.iconType == "twitter" %}
|
|
75
|
-
<svg class="{% if params.iconSize %}ons-icon ons-icon--{{ params.iconSize }}{% else %}ons-icon{% endif %}{{ iconClasses }}" id="icon-twitter" viewBox="0 0
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
<svg class="{% if params.iconSize %}ons-icon ons-icon--{{ params.iconSize }}{% else %}ons-icon{% endif %}{{ iconClasses }}" id="icon-twitter" viewBox="0 0 90.01 90.01" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true">
|
|
76
|
+
<polygon points="24.89,23.01 57.79,66.99 65.24,66.99 32.34,23.01"/>
|
|
77
|
+
<path d="M 45 0 L 45 0 C 20.147 0 0 20.147 0 45 v 0 c 0 24.853 20.147 45 45 45 h 0 c 24.853 0 45 -20.147 45 -45 v 0 C 90 20.147 69.853 0 45 0 z M 56.032 70.504 L 41.054 50.477 L 22.516 70.504 h -4.765 L 38.925 47.63 L 17.884 19.496 h 16.217 L 47.895 37.94 l 17.072 -18.444 h 4.765 L 50.024 40.788 l 22.225 29.716 H 56.032 z"/>
|
|
78
|
+
</svg>
|
|
78
79
|
{% elif params.iconType == "instagram" %}
|
|
79
80
|
<svg class="{% if params.iconSize %}ons-icon ons-icon--{{ params.iconSize }}{% else %}ons-icon{% endif %}{{ iconClasses }}" id="icon-instagram" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true">
|
|
80
81
|
<path d="M21.34,9.46c0.66,0,1.2,0.54,1.2,1.2c0,0.66-0.54,1.2-1.2,1.2c-0.66,0-1.2-0.54-1.2-1.2C20.14,10,20.68,9.46,21.34,9.46z M16,12.67c-1.84,0-3.33,1.49-3.33,3.33c0,1.84,1.49,3.33,3.33,3.33c1.84,0,3.33-1.49,3.33-3.33C19.33,14.16,17.84,12.67,16,12.67z M16,10.86c2.84,0,5.14,2.3,5.14,5.14c0,2.84-2.3,5.14-5.14,5.14c-2.84,0-5.14-2.3-5.14-5.14C10.86,13.16,13.16,10.86,16,10.86z M16.56,7.8h-1.11c-2.17,0-2.51,0.01-3.49,0.06c-0.97,0.04-1.5,0.21-1.86,0.34C9.64,8.39,9.3,8.6,8.95,8.95C8.6,9.3,8.39,9.64,8.2,10.1c-0.14,0.35-0.3,0.88-0.34,1.86c-0.04,0.98-0.06,1.32-0.06,3.49v1.11c0,2.17,0.01,2.51,0.06,3.49c0.04,0.97,0.21,1.5,0.34,1.86c0.18,0.47,0.4,0.8,0.75,1.15c0.35,0.35,0.68,0.57,1.15,0.75c0.35,0.14,0.88,0.3,1.86,0.34c0.94,0.04,1.29,0.06,3.23,0.06h1.61c1.94,0,2.3-0.02,3.23-0.06c0.97-0.04,1.5-0.21,1.86-0.34c0.47-0.18,0.8-0.4,1.15-0.75c0.35-0.35,0.57-0.68,0.75-1.15c0.14-0.35,0.3-0.88,0.34-1.86c0.04-0.94,0.06-1.29,0.06-3.23v-1.61c0-1.94-0.02-2.3-0.06-3.23c-0.04-0.97-0.21-1.5-0.34-1.86c-0.18-0.47-0.4-0.8-0.75-1.15C22.7,8.6,22.36,8.39,21.9,8.2c-0.35-0.14-0.88-0.3-1.86-0.34C19.06,7.82,18.72,7.8,16.56,7.8z M17.03,6c1.8,0,2.18,0.02,3.1,0.06c1.06,0.05,1.79,0.22,2.43,0.46c0.66,0.26,1.22,0.6,1.77,1.15c0.56,0.56,0.9,1.11,1.15,1.77c0.25,0.64,0.42,1.36,0.46,2.43c0.05,0.99,0.06,1.35,0.06,3.58v1.09c0,2.22-0.01,2.59-0.06,3.58c-0.05,1.06-0.22,1.79-0.46,2.43c-0.26,0.66-0.6,1.22-1.15,1.77c-0.56,0.56-1.11,0.9-1.77,1.15c-0.64,0.25-1.36,0.42-2.43,0.46C19.13,25.99,18.77,26,16.55,26h-1.09c-2.22,0-2.59-0.01-3.58-0.06c-1.06-0.05-1.79-0.22-2.43-0.46c-0.66-0.26-1.22-0.6-1.77-1.15c-0.56-0.56-0.9-1.11-1.15-1.77c-0.25-0.64-0.42-1.36-0.46-2.43C6.02,19.21,6,18.83,6,17.03v-2.06c0-1.8,0.02-2.18,0.06-3.1c0.05-1.06,0.22-1.79,0.46-2.43c0.26-0.66,0.6-1.22,1.15-1.77c0.56-0.56,1.11-0.9,1.77-1.15c0.64-0.25,1.36-0.42,2.43-0.46C12.79,6.02,13.17,6,14.97,6H17.03z M16,0C7.16,0,0,7.16,0,16s7.16,16,16,16s16-7.16,16-16c0-4.24-1.69-8.31-4.69-11.31S20.24,0,16,0z"/>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{% macro onsLabel(params) %}
|
|
2
2
|
{% if params.id %}
|
|
3
|
-
{% set descriptionID = params.id ~ "-description-hint" %}
|
|
3
|
+
{% set descriptionID = params.id ~ "-description-hint" %}
|
|
4
4
|
{% else %}
|
|
5
|
-
{% set descriptionID = "description-hint" %}
|
|
5
|
+
{% set descriptionID = "description-hint" %}
|
|
6
6
|
{% endif %}
|
|
7
7
|
|
|
8
8
|
{% if params.inputType == "checkbox" or params.inputType == "radio" %}
|
|
@@ -77,6 +77,7 @@
|
|
|
77
77
|
&--icons {
|
|
78
78
|
margin-bottom: 0;
|
|
79
79
|
.ons-list__item {
|
|
80
|
+
margin-top: 0;
|
|
80
81
|
margin-bottom: 0.5rem;
|
|
81
82
|
}
|
|
82
83
|
}
|
|
@@ -99,7 +100,6 @@
|
|
|
99
100
|
.ons-list__item {
|
|
100
101
|
display: inline-block;
|
|
101
102
|
margin: 0 1rem 0 0;
|
|
102
|
-
vertical-align: top;
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"instructions": params.siteSearchAutosuggest.instructions,
|
|
29
29
|
"ariaYouHaveSelected":params.siteSearchAutosuggest.ariaYouHaveSelected,
|
|
30
|
+
"minChars": params.siteSearchAutosuggest.minChars,
|
|
30
31
|
"ariaMinChars": params.siteSearchAutosuggest.ariaMinChars,
|
|
31
32
|
"ariaResultsLabel": params.siteSearchAutosuggest.ariaResultsLabel,
|
|
32
33
|
"ariaOneResult": params.siteSearchAutosuggest.ariaOneResult,
|
|
@@ -36,7 +37,8 @@
|
|
|
36
37
|
"resultsTitle": params.siteSearchAutosuggest.resultsTitle,
|
|
37
38
|
"autosuggestData": params.siteSearchAutosuggest.autosuggestData,
|
|
38
39
|
"noResults": params.siteSearchAutosuggest.noResults,
|
|
39
|
-
"typeMore": params.siteSearchAutosuggest.typeMore
|
|
40
|
+
"typeMore": params.siteSearchAutosuggest.typeMore,
|
|
41
|
+
"language": params.siteSearchAutosuggest.language
|
|
40
42
|
}) }}
|
|
41
43
|
</div>
|
|
42
44
|
{% endif %}
|
|
@@ -1,36 +1,34 @@
|
|
|
1
1
|
{% macro onsRelatedContent(params) %}
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
{% if params.classes %}
|
|
4
|
+
{% set classes = ' ' + params.classes %}
|
|
5
|
+
{% endif %}
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
{% from "components/related-content/_section-macro.njk" import onsRelatedContentSection %}
|
|
11
|
-
{% call onsRelatedContentSection(
|
|
12
|
-
{
|
|
13
|
-
"title": row.title,
|
|
14
|
-
"id": row.id
|
|
15
|
-
}
|
|
16
|
-
) %}
|
|
17
|
-
<nav class="ons-related-content__navigation" aria-labelledby="{{ row.id }}">
|
|
7
|
+
<aside class="ons-related-content{{ classes }}" aria-label="{{ params.ariaLabel | default("Related content") }}">
|
|
8
|
+
{% if params.rows %}
|
|
9
|
+
{% from "components/related-content/_section-macro.njk" import onsRelatedContentSection %}
|
|
18
10
|
{% from "components/list/_macro.njk" import onsList %}
|
|
19
|
-
{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
11
|
+
{% for row in params.rows %}
|
|
12
|
+
{% call onsRelatedContentSection({
|
|
13
|
+
"title": row.title,
|
|
14
|
+
"id": row.id
|
|
15
|
+
}) %}
|
|
16
|
+
<nav class="ons-related-content__navigation" aria-labelledby="{{ row.id }}">
|
|
17
|
+
{{
|
|
18
|
+
onsList({
|
|
19
|
+
"variants": 'bare',
|
|
20
|
+
"iconType": row.iconType,
|
|
21
|
+
"iconPosition": row.iconPosition,
|
|
22
|
+
"iconSize": row.iconSize,
|
|
23
|
+
"itemsList": row.itemsList
|
|
24
|
+
})
|
|
25
|
+
}}
|
|
26
|
+
</nav>
|
|
27
|
+
{% endcall %}
|
|
28
|
+
{% endfor %}
|
|
29
|
+
{% else %}
|
|
30
|
+
{{ caller() if caller }}
|
|
31
|
+
{% endif %}
|
|
32
|
+
</aside>
|
|
35
33
|
|
|
36
34
|
{% endmacro %}
|
|
@@ -1,59 +1,60 @@
|
|
|
1
1
|
{% macro onsSectionNavigation(params) %}
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
{%
|
|
34
|
-
|
|
35
|
-
|
|
2
|
+
<nav class="ons-section-nav{% if params.variants == 'vertical' %} ons-section-nav--vertical{% endif %} {% if params.classes %} {{ params.classes }} {% endif %}"{% if params.id %} id="{{ params.id }}"{% endif %} aria-labelledby="{{ params.hiddenTitleId | default("section-menu-nav-title")}}">
|
|
3
|
+
<h2 class="ons-u-vh" id="{{ params.hiddenTitleId | default("section-menu-nav-title") }}">{{ params.hiddenTitle | default("Pages in this section") }}</h2>
|
|
4
|
+
{% if params.sections %}
|
|
5
|
+
{% for section in params.sections %}
|
|
6
|
+
<div class="ons-section-nav__sub">
|
|
7
|
+
{% if section.title %}
|
|
8
|
+
<h3 class="ons-u-fs-r--b ons-u-mb-s">{{ section.title }}</h3>
|
|
9
|
+
{% endif %}
|
|
10
|
+
<ul class="ons-section-nav__list">
|
|
11
|
+
{% for item in section.itemsList %}
|
|
12
|
+
{% if (params.currentPath and item.url == params.currentPath) or (params.tabQuery and params.tabQuery == item.title|lower) %}
|
|
13
|
+
{% set isCurrent = true %}
|
|
14
|
+
{% else %}
|
|
15
|
+
{% set isCurrent = false %}
|
|
16
|
+
{% endif %}
|
|
17
|
+
<li class="ons-section-nav__item{% if item.classes %} ' ' + {{ item.classes }}{% endif %}{% if isCurrent == true %} ons-section-nav__item--active{% endif %}">
|
|
18
|
+
<a class="ons-section-nav__link" href="{{ item.url }}"{% if isCurrent == true %} aria-current="location"{% endif %}>{{ item.title }}</a>
|
|
19
|
+
{% if item.anchors and isCurrent == true %}
|
|
20
|
+
<ul class="ons-section-nav__sub-items ons-list ons-list--dashed ons-u-mt-xs ons-u-mb-xs">
|
|
21
|
+
{% for anchor in item.anchors %}
|
|
22
|
+
<li class="ons-section-nav__item ons-list__item">
|
|
23
|
+
<a href="{{ anchor.url }}" class="ons-section-nav__link ons-list__link">{{ anchor.title }}</a>
|
|
24
|
+
</li>
|
|
25
|
+
{% endfor %}
|
|
26
|
+
</ul>
|
|
27
|
+
{% endif %}
|
|
28
|
+
</li>
|
|
29
|
+
{% endfor %}
|
|
30
|
+
</ul>
|
|
31
|
+
</div>
|
|
32
|
+
{% endfor %}
|
|
33
|
+
{% else %}
|
|
34
|
+
{% if params.title %}
|
|
35
|
+
<h3 class="ons-u-fs-r--b ons-u-mb-s">{{ params.title }}</h3>
|
|
36
|
+
{% endif %}
|
|
36
37
|
<ul class="ons-section-nav__list">
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
{% endif %}
|
|
43
|
-
<li class="ons-section-nav__item{% if item.classes %} ' ' + {{ item.classes }}{% endif %}{% if isCurrent == true %} ons-section-nav__item--active{% endif %}">
|
|
44
|
-
<a class="ons-section-nav__link" href="{{ item.url }}"{% if isCurrent == true %} aria-current="location"{% endif %}>{{ item.title }}</a>
|
|
45
|
-
{% if item.anchors %}
|
|
46
|
-
<ul class="ons-section-nav__sub-items ons-list ons-list--dashed ons-u-mt-xs ons-u-mb-xs">
|
|
47
|
-
{% for anchor in item.anchors %}
|
|
48
|
-
<li class="ons-section-nav__item ons-list__item">
|
|
49
|
-
<a href="{{ anchor.url }}" class="ons-section-nav__link ons-list__link">{{ anchor.title }}</a>
|
|
50
|
-
</li>
|
|
51
|
-
{% endfor %}
|
|
52
|
-
</ul>
|
|
38
|
+
{% for item in params.itemsList %}
|
|
39
|
+
{% if (params.currentPath and item.url == params.currentPath) or (params.tabQuery and params.tabQuery == item.title|lower) %}
|
|
40
|
+
{% set isCurrent = true %}
|
|
41
|
+
{% else %}
|
|
42
|
+
{% set isCurrent = false %}
|
|
53
43
|
{% endif %}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
44
|
+
<li class="ons-section-nav__item{% if item.classes %} ' ' + {{ item.classes }}{% endif %}{% if isCurrent == true %} ons-section-nav__item--active{% endif %}">
|
|
45
|
+
<a class="ons-section-nav__link" href="{{ item.url }}"{% if isCurrent == true %} aria-current="location"{% endif %}>{{ item.title }}</a>
|
|
46
|
+
{% if item.anchors %}
|
|
47
|
+
<ul class="ons-section-nav__sub-items ons-list ons-list--dashed ons-u-mt-xs ons-u-mb-xs">
|
|
48
|
+
{% for anchor in item.anchors %}
|
|
49
|
+
<li class="ons-section-nav__item ons-list__item">
|
|
50
|
+
<a href="{{ anchor.url }}" class="ons-section-nav__link ons-list__link">{{ anchor.title }}</a>
|
|
51
|
+
</li>
|
|
52
|
+
{% endfor %}
|
|
53
|
+
</ul>
|
|
54
|
+
{% endif %}
|
|
55
|
+
</li>
|
|
56
|
+
{% endfor %}
|
|
57
|
+
</ul>
|
|
58
|
+
{% endif %}
|
|
59
|
+
</nav>
|
|
59
60
|
{% endmacro %}
|