@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.
Files changed (53) hide show
  1. package/README.md +1 -1
  2. package/components/accordion/_macro.spec.js +2 -2
  3. package/components/address-input/_macro.spec.js +245 -322
  4. package/components/address-input/autosuggest.address.spec.js +16 -14
  5. package/components/address-output/_macro.spec.js +121 -74
  6. package/components/address-output/_test_examples.js +8 -0
  7. package/components/autosuggest/_macro.spec.js +373 -184
  8. package/components/back-to-top/back-to-top.dom.js +4 -4
  9. package/components/back-to-top/back-to-top.js +1 -1
  10. package/components/browser-banner/_macro.spec.js +11 -11
  11. package/components/button/_button.scss +1 -1
  12. package/components/button/_macro.njk +1 -1
  13. package/components/button/_macro.spec.js +405 -351
  14. package/components/button/example-button-group.njk +1 -0
  15. package/components/checkboxes/_checkbox.scss +3 -3
  16. package/components/description-list/_description-list.scss +40 -9
  17. package/components/description-list/_macro.njk +20 -12
  18. package/components/description-list/_macro.spec.js +11 -1
  19. package/components/description-list/example-inline-description-list.njk +58 -0
  20. package/components/details/_details.scss +1 -2
  21. package/components/details/example-details-open.njk +10 -0
  22. package/components/external-link/_macro.spec.js +66 -69
  23. package/components/external-link/_test_examples.js +4 -0
  24. package/components/feedback/_macro.spec.js +109 -80
  25. package/components/feedback/_test_examples.js +17 -0
  26. package/components/field/_macro.spec.js +106 -69
  27. package/components/header/_macro.njk +92 -90
  28. package/components/header/_macro.spec.js +10 -0
  29. package/components/header/example-header-basic.njk +11 -0
  30. package/components/hero/_hero.scss +239 -2
  31. package/components/hero/_macro.njk +7 -0
  32. package/components/hero/_macro.spec.js +5 -0
  33. package/components/hero/example-hero-navy-blue.njk +14 -0
  34. package/components/section-navigation/_macro.njk +9 -6
  35. package/components/table-of-contents/_macro.njk +3 -3
  36. package/components/table-of-contents/_macro.spec.js +3 -3
  37. package/components/table-of-contents/{_toc.scss → _table-of-contents.scss} +1 -1
  38. package/components/table-of-contents/table-of-contents.dom.js +13 -0
  39. package/components/table-of-contents/{toc.js → table-of-contents.js} +4 -4
  40. package/components/table-of-contents/{toc.spec.js → table-of-contents.spec.js} +2 -2
  41. package/components/tabs/_tabs.scss +10 -11
  42. package/components/tabs/tabs.js +3 -3
  43. package/components/timeout-modal/timeout-modal.spec.js +1 -1
  44. package/css/main.css +1 -1
  45. package/js/main.js +1 -1
  46. package/package.json +1 -1
  47. package/scripts/main.es5.js +1 -1
  48. package/scripts/main.js +1 -1
  49. package/scss/main.scss +1 -1
  50. package/scss/utilities/_margin.scss +4 -0
  51. package/scss/utilities/_padding.scss +4 -0
  52. package/scss/vars/_colors.scss +2 -0
  53. 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 bttElement = [...document.querySelectorAll('.ons-js-back-to-top')];
4
+ const backToTop = [...document.querySelectorAll('.ons-js-back-to-top')];
5
5
 
6
- if (bttElement) {
7
- const Btt = (await import('./back-to-top')).default;
8
- bttElement.forEach((btn) => new Btt(btn));
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
 
@@ -1,4 +1,4 @@
1
- export default class backToTop {
1
+ export default class BackToTop {
2
2
  constructor(component) {
3
3
  this.component = component;
4
4
  this.content = this.component.previousElementSibling;
@@ -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
- it('THEN: passes jest-axe checks', async () => {
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
- it('THEN: has the english default bannerLeadingText', () => {
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
- it('THEN: has the english default bannerCTA', () => {
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
- it('THEN: has the english default bannerLinkUrl', () => {
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
- it('THEN: has the welsh default bannerLeadingText', () => {
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
- it('THEN: has the welsh default bannerCTA', () => {
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
- it('THEN: has the welsh default bannerLinkUrl', () => {
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
- it('THEN: has container--wide class', () => {
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
- it('THEN: does not have container--wide class', () => {
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
- it('THEN: has container--full-width class', () => {
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
- it('THEN: does not have container--full-width class', () => {
94
+ test('THEN: does not have container--full-width class', () => {
95
95
  const $ = cheerio.load(
96
96
  renderComponent('browser-banner', {
97
97
  ...{},
@@ -569,6 +569,6 @@ $button-shadow-size: 3px;
569
569
 
570
570
  .ons-btn,
571
571
  a {
572
- margin: 0 1rem 1rem 0;
572
+ margin: 0 1.5rem 1rem 0;
573
573
  }
574
574
  }
@@ -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 is not defined %}
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" %}