@ons/design-system 72.1.0 → 72.1.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.
- package/README.md +1 -1
- package/components/accordion/_macro.spec.js +2 -2
- package/components/address-input/_macro.spec.js +245 -322
- package/components/address-input/autosuggest.address.spec.js +16 -14
- package/components/address-output/_macro.spec.js +121 -74
- package/components/address-output/_test_examples.js +8 -0
- package/components/autosuggest/_macro.spec.js +373 -184
- package/components/back-to-top/back-to-top.dom.js +4 -4
- package/components/back-to-top/back-to-top.js +1 -1
- package/components/browser-banner/_macro.spec.js +11 -11
- package/components/button/_button.scss +1 -1
- package/components/button/_macro.njk +1 -1
- package/components/button/_macro.spec.js +405 -351
- package/components/button/example-button-group.njk +1 -0
- package/components/checkboxes/_checkbox.scss +3 -3
- package/components/description-list/_description-list.scss +40 -9
- package/components/description-list/_macro.njk +20 -12
- package/components/description-list/_macro.spec.js +11 -1
- package/components/description-list/example-inline-description-list.njk +58 -0
- package/components/details/_details.scss +1 -2
- package/components/details/example-details-open.njk +10 -0
- package/components/external-link/_macro.spec.js +66 -69
- package/components/external-link/_test_examples.js +4 -0
- package/components/feedback/_macro.spec.js +109 -80
- package/components/feedback/_test_examples.js +17 -0
- package/components/field/_macro.spec.js +106 -69
- package/components/header/_macro.njk +92 -90
- package/components/header/_macro.spec.js +10 -0
- package/components/header/example-header-basic.njk +11 -0
- package/components/hero/_hero.scss +239 -2
- package/components/hero/_macro.njk +7 -0
- package/components/hero/_macro.spec.js +5 -0
- package/components/hero/example-hero-navy-blue.njk +14 -0
- package/components/section-navigation/_macro.njk +9 -6
- package/components/table-of-contents/_macro.njk +3 -3
- package/components/table-of-contents/_macro.spec.js +3 -3
- package/components/table-of-contents/{_toc.scss → _table-of-contents.scss} +1 -1
- package/components/table-of-contents/table-of-contents.dom.js +13 -0
- package/components/table-of-contents/{toc.js → table-of-contents.js} +4 -4
- package/components/table-of-contents/{toc.spec.js → table-of-contents.spec.js} +2 -2
- package/components/tabs/_tabs.scss +10 -11
- package/components/tabs/tabs.js +3 -3
- package/components/timeout-modal/timeout-modal.spec.js +1 -1
- package/css/main.css +1 -1
- package/js/main.js +1 -1
- package/package.json +1 -1
- package/scripts/main.es5.js +1 -1
- package/scripts/main.js +1 -1
- package/scss/main.scss +1 -1
- package/scss/utilities/_margin.scss +4 -0
- package/scss/utilities/_padding.scss +4 -0
- package/scss/vars/_colors.scss +2 -0
- package/components/table-of-contents/toc.dom.js +0 -13
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import domready from '../../js/domready';
|
|
2
2
|
|
|
3
3
|
async function backToTop() {
|
|
4
|
-
const
|
|
4
|
+
const backToTop = [...document.querySelectorAll('.ons-js-back-to-top')];
|
|
5
5
|
|
|
6
|
-
if (
|
|
7
|
-
const
|
|
8
|
-
|
|
6
|
+
if (backToTop) {
|
|
7
|
+
const BackToTop = (await import('./back-to-top')).default;
|
|
8
|
+
backToTop.forEach((btn) => new BackToTop(btn));
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
|
|
@@ -10,22 +10,22 @@ describe('FOR: Macro: Browser-banner', () => {
|
|
|
10
10
|
describe('WHEN: params are at default state', () => {
|
|
11
11
|
const $ = cheerio.load(renderComponent('browser-banner', {}));
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
test('THEN: passes jest-axe checks', async () => {
|
|
14
14
|
const results = await axe($.html());
|
|
15
15
|
expect(results).toHaveNoViolations();
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
test('THEN: has the english default bannerLeadingText', () => {
|
|
19
19
|
const bannerLeadingText = $('.ons-browser-banner__lead').text().trim();
|
|
20
20
|
expect(bannerLeadingText).toBe('This website no longer supports your browser.');
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
test('THEN: has the english default bannerCTA', () => {
|
|
24
24
|
const bannerCtaHtml = $('.ons-browser-banner__cta').text().trim();
|
|
25
25
|
expect(bannerCtaHtml).toBe('You can upgrade your browser to the latest version.');
|
|
26
26
|
});
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
test('THEN: has the english default bannerLinkUrl', () => {
|
|
29
29
|
expect($('.ons-browser-banner__link').attr('href')).toBe('https://www.ons.gov.uk/help/browsers');
|
|
30
30
|
});
|
|
31
31
|
});
|
|
@@ -33,17 +33,17 @@ describe('FOR: Macro: Browser-banner', () => {
|
|
|
33
33
|
describe('WHEN: params are at default and language is set to welsh', () => {
|
|
34
34
|
const $ = cheerio.load(renderComponent('browser-banner', { lang: 'cy' }));
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
test('THEN: has the welsh default bannerLeadingText', () => {
|
|
37
37
|
const bannerLeadingText = $('.ons-browser-banner__lead').text().trim();
|
|
38
38
|
expect(bannerLeadingText).toBe('Nid yw’r wefan hon yn cefnogi eich porwr mwyach.');
|
|
39
39
|
});
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
test('THEN: has the welsh default bannerCTA', () => {
|
|
42
42
|
const bannerCtaHtml = $('.ons-browser-banner__cta').text().trim();
|
|
43
43
|
expect(bannerCtaHtml).toBe('Gallwch ddiweddaru eich porwr i’r fersiwn ddiweddaraf.');
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
test('THEN: has the welsh default bannerLinkUrl', () => {
|
|
47
47
|
expect($('.ons-browser-banner__link').attr('href')).toBe('https://cy.ons.gov.uk/help/browsers');
|
|
48
48
|
});
|
|
49
49
|
});
|
|
@@ -51,7 +51,7 @@ describe('FOR: Macro: Browser-banner', () => {
|
|
|
51
51
|
|
|
52
52
|
describe('GIVEN: Params: wide', () => {
|
|
53
53
|
describe('WHEN: wide is set to true', () => {
|
|
54
|
-
|
|
54
|
+
test('THEN: has container--wide class', () => {
|
|
55
55
|
const $ = cheerio.load(
|
|
56
56
|
renderComponent('browser-banner', {
|
|
57
57
|
...{},
|
|
@@ -64,7 +64,7 @@ describe('FOR: Macro: Browser-banner', () => {
|
|
|
64
64
|
});
|
|
65
65
|
|
|
66
66
|
describe('WHEN: wide is not set', () => {
|
|
67
|
-
|
|
67
|
+
test('THEN: does not have container--wide class', () => {
|
|
68
68
|
const $ = cheerio.load(
|
|
69
69
|
renderComponent('browser-banner', {
|
|
70
70
|
...{},
|
|
@@ -78,7 +78,7 @@ describe('FOR: Macro: Browser-banner', () => {
|
|
|
78
78
|
|
|
79
79
|
describe('GIVEN: Params: fullWidth', () => {
|
|
80
80
|
describe('WHEN: fullWidth is set to true', () => {
|
|
81
|
-
|
|
81
|
+
test('THEN: has container--full-width class', () => {
|
|
82
82
|
const $ = cheerio.load(
|
|
83
83
|
renderComponent('browser-banner', {
|
|
84
84
|
...{},
|
|
@@ -91,7 +91,7 @@ describe('FOR: Macro: Browser-banner', () => {
|
|
|
91
91
|
});
|
|
92
92
|
|
|
93
93
|
describe('WHEN: fullWidth is not set', () => {
|
|
94
|
-
|
|
94
|
+
test('THEN: does not have container--full-width class', () => {
|
|
95
95
|
const $ = cheerio.load(
|
|
96
96
|
renderComponent('browser-banner', {
|
|
97
97
|
...{},
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
{# Default icon position before label #}
|
|
12
12
|
{% set iconPosition = "before" %}
|
|
13
13
|
{% endif %}
|
|
14
|
-
{% elif params.iconType is not defined and params.noIcon
|
|
14
|
+
{% elif params.iconType is not defined and params.noIcon != true %}
|
|
15
15
|
{% if params.url and params.newWindow %}
|
|
16
16
|
{# CTA link opening in new tab #}
|
|
17
17
|
{% set iconType = "external-link" %}
|