@ons/design-system 63.0.0 → 65.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.
Files changed (110) hide show
  1. package/components/access-code/_macro.njk +2 -2
  2. package/components/access-code/_macro.spec.js +2 -2
  3. package/components/access-code/access-code.dom.js +11 -0
  4. package/components/access-code/{uac.js → access-code.js} +1 -1
  5. package/components/access-code/{uac.scss → access-code.scss} +1 -1
  6. package/components/access-code/example-access-code-error.njk +6 -6
  7. package/components/access-code/example-access-code.njk +4 -4
  8. package/components/accordion/_macro.njk +2 -2
  9. package/components/accordion/_macro.spec.js +3 -3
  10. package/components/accordion/accordion.dom.js +1 -1
  11. package/components/accordion/accordion.js +1 -1
  12. package/components/breadcrumbs/_breadcrumbs.scss +6 -6
  13. package/components/breadcrumbs/_macro.njk +4 -4
  14. package/components/breadcrumbs/_macro.spec.js +13 -13
  15. package/components/button/_button.scss +27 -27
  16. package/components/button/_macro.spec.js +2 -2
  17. package/components/call-to-action/_macro.njk +1 -1
  18. package/components/char-check-limit/_macro.njk +1 -1
  19. package/components/char-check-limit/_macro.spec.js +1 -1
  20. package/components/char-check-limit/character-check.spec.js +16 -16
  21. package/components/checkboxes/_macro.njk +3 -1
  22. package/components/checkboxes/example-checkboxes-with-descriptions.njk +1 -0
  23. package/components/cookies-banner/_macro.njk +2 -2
  24. package/components/cookies-banner/_macro.spec.js +2 -2
  25. package/components/date-input/_macro.njk +3 -3
  26. package/components/date-input/_macro.spec.js +118 -0
  27. package/components/date-input/example-date-input-error-for-single-field.njk +63 -0
  28. package/components/details/_details.scss +1 -1
  29. package/components/external-link/_external-link.scss +3 -3
  30. package/components/external-link/_macro.njk +1 -1
  31. package/components/footer/_footer.scss +2 -2
  32. package/components/footer/example-footer-with-alternative-organisation.njk +5 -5
  33. package/components/header/_header.scss +8 -8
  34. package/components/icon/_icon.scss +1 -1
  35. package/components/icon/_macro.njk +35 -35
  36. package/components/icon/_macro.spec.js +1 -1
  37. package/components/image/_image.scss +2 -2
  38. package/components/image/_macro.njk +4 -6
  39. package/components/image/_macro.spec.js +10 -10
  40. package/components/input/_input.scss +6 -0
  41. package/components/input/_macro.njk +20 -13
  42. package/components/input/_macro.spec.js +2 -22
  43. package/components/{search/example-search-with-character-check.njk → input/example-input-search-with-character-check.njk} +1 -2
  44. package/components/{search/example-search-with-placeholder.njk → input/example-input-search-with-placeholder.njk} +1 -2
  45. package/components/{search/example-search.njk → input/example-input-search.njk} +1 -2
  46. package/components/mutually-exclusive/_macro.njk +4 -3
  47. package/components/mutually-exclusive/mutually-exclusive.textarea.spec.js +1 -1
  48. package/components/pagination/_macro.njk +2 -2
  49. package/components/pagination/example-pagination-first.njk +0 -2
  50. package/components/pagination/example-pagination-last.njk +0 -2
  51. package/components/pagination/example-pagination-with-no-range-indicator.njk +0 -2
  52. package/components/pagination/example-pagination.njk +0 -2
  53. package/components/panel/_macro.njk +1 -1
  54. package/components/panel/_panel.scss +7 -7
  55. package/components/password/_macro.njk +1 -1
  56. package/components/password/example-password.njk +1 -2
  57. package/components/quote/_quote.scss +1 -1
  58. package/components/radios/_macro.njk +1 -1
  59. package/components/select/_macro.njk +1 -2
  60. package/components/skip-to-content/_macro.njk +2 -1
  61. package/components/skip-to-content/_macro.spec.js +17 -3
  62. package/components/skip-to-content/_skip.scss +1 -1
  63. package/components/skip-to-content/skip-to-content.dom.js +1 -1
  64. package/components/skip-to-content/skip-to-content.spec.js +3 -3
  65. package/components/summary/_macro.njk +1 -2
  66. package/components/summary/_macro.spec.js +7 -22
  67. package/components/summary/_summary.scss +1 -1
  68. package/components/summary/example-summary-grouped-total.njk +0 -2
  69. package/components/summary/example-summary-grouped-with-errors.njk +0 -4
  70. package/components/summary/example-summary-grouped.njk +0 -19
  71. package/components/summary/example-summary-household.njk +0 -5
  72. package/components/summary/example-summary-hub.njk +0 -8
  73. package/components/summary/example-summary-multiple.njk +0 -4
  74. package/components/summary/example-summary.njk +0 -4
  75. package/components/table/_macro.njk +1 -1
  76. package/components/table/_macro.spec.js +16 -0
  77. package/components/table/_table.scss +6 -6
  78. package/components/table/example-table-numeric.njk +6 -3
  79. package/components/table/sortable-table.js +1 -1
  80. package/components/tabs/_macro.njk +4 -3
  81. package/components/tabs/_macro.spec.js +23 -0
  82. package/components/tabs/_tabs.scss +11 -15
  83. package/components/tabs/example-tabs.njk +6 -6
  84. package/components/tabs/tabs.js +24 -8
  85. package/components/tabs/tabs.spec.js +40 -2
  86. package/components/textarea/_macro.njk +2 -2
  87. package/components/textarea/_macro.spec.js +2 -2
  88. package/components/textarea/textarea.spec.js +6 -10
  89. package/components/timeline/_macro.njk +18 -22
  90. package/components/timeline/_macro.spec.js +18 -0
  91. package/components/video/example-video.njk +1 -1
  92. package/components/video/video.js +10 -1
  93. package/components/video/video.spec.js +33 -0
  94. package/css/main.css +3 -3
  95. package/css/print.css +1 -1
  96. package/js/main.js +1 -1
  97. package/package.json +1 -1
  98. package/scripts/main.es5.js +1 -1
  99. package/scripts/main.js +1 -1
  100. package/scss/base/_global.scss +1 -1
  101. package/scss/main.scss +1 -2
  102. package/scss/objects/_spacing.scss +3 -3
  103. package/scss/overrides/hcm.scss +6 -6
  104. package/scss/overrides/rtl.scss +2 -2
  105. package/scss/print.scss +1 -1
  106. package/components/access-code/uac.dom.js +0 -11
  107. package/components/search/_macro.njk +0 -30
  108. package/components/search/_macro.spec.js +0 -69
  109. package/components/search/_search.scss +0 -9
  110. /package/components/access-code/{uac.spec.js → access-code.spec.js} +0 -0
@@ -59,12 +59,12 @@ describe('script: character-check', () => {
59
59
 
60
60
  describe('Given that the char check helper has initialised correctly', () => {
61
61
  it('the char check readout should be invisible', async () => {
62
- const hasClass = await page.$eval('#search-field-check-remaining', element => element.classList.contains('ons-u-d-no'));
62
+ const hasClass = await page.$eval('#search-field-check', element => element.classList.contains('ons-u-d-no'));
63
63
  expect(hasClass).toBe(true);
64
64
  });
65
65
 
66
66
  it('then the character limit readout should reflect the number of characters remaining', async () => {
67
- const innerHtml = await page.$eval('#search-field-check-remaining', element => element.innerHTML);
67
+ const innerHtml = await page.$eval('#search-field-check', element => element.innerHTML);
68
68
  expect(innerHtml.trim()).toBe('You have 11 characters remaining');
69
69
  });
70
70
  });
@@ -76,17 +76,17 @@ describe('script: character-check', () => {
76
76
  });
77
77
 
78
78
  it('then the characters remaining readout reflect the number of characters remaining', async () => {
79
- const innerHtml = await page.$eval('#search-field-check-remaining', element => element.innerHTML);
79
+ const innerHtml = await page.$eval('#search-field-check', element => element.innerHTML);
80
80
  expect(innerHtml.trim()).toBe('You have 10 characters remaining');
81
81
  });
82
82
 
83
83
  it('the char check readout should be visible', async () => {
84
- const hasClass = await page.$eval('#search-field-check-remaining', element => element.classList.contains('ons-u-d-no'));
84
+ const hasClass = await page.$eval('#search-field-check', element => element.classList.contains('ons-u-d-no'));
85
85
  expect(hasClass).toBe(false);
86
86
  });
87
87
 
88
88
  it('then aria-live should be set to polite', async () => {
89
- const ariaLiveAttribute = await page.$eval('#search-field-check-remaining', element => element.getAttribute('aria-live'));
89
+ const ariaLiveAttribute = await page.$eval('#search-field-check', element => element.getAttribute('aria-live'));
90
90
  expect(ariaLiveAttribute).toBe('polite');
91
91
  });
92
92
  });
@@ -97,7 +97,7 @@ describe('script: character-check', () => {
97
97
  });
98
98
 
99
99
  it('the char check readout should be invisible', async () => {
100
- const hasClass = await page.$eval('#search-field-check-remaining', element => element.classList.contains('ons-u-d-no'));
100
+ const hasClass = await page.$eval('#search-field-check', element => element.classList.contains('ons-u-d-no'));
101
101
  expect(hasClass).toBe(true);
102
102
  });
103
103
  });
@@ -108,7 +108,7 @@ describe('script: character-check', () => {
108
108
  });
109
109
 
110
110
  it('then the characters remaining readout reflect the number of characters remaining', async () => {
111
- const innerHtml = await page.$eval('#search-field-check-remaining', element => element.innerHTML);
111
+ const innerHtml = await page.$eval('#search-field-check', element => element.innerHTML);
112
112
  expect(innerHtml.trim()).toBe('You have 1 character remaining');
113
113
  });
114
114
  });
@@ -120,24 +120,24 @@ describe('script: character-check', () => {
120
120
  });
121
121
 
122
122
  it('the char check readout should be visible', async () => {
123
- const hasClass = await page.$eval('#search-field-check-remaining', element => element.classList.contains('ons-u-d-no'));
123
+ const hasClass = await page.$eval('#search-field-check', element => element.classList.contains('ons-u-d-no'));
124
124
  expect(hasClass).toBe(false);
125
125
  });
126
126
 
127
127
  it('then the characters remaining readout reflect the number of characters exceeded', async () => {
128
- const innerHtml = await page.$eval('#search-field-check-remaining', element => element.innerHTML);
128
+ const innerHtml = await page.$eval('#search-field-check', element => element.innerHTML);
129
129
  expect(innerHtml.trim()).toBe('1 number too many');
130
130
  });
131
131
 
132
132
  it('then aria-live should be set to assertive', async () => {
133
- const ariaLiveAttribute = await page.$eval('#search-field-check-remaining', element => element.getAttribute('aria-live'));
133
+ const ariaLiveAttribute = await page.$eval('#search-field-check', element => element.getAttribute('aria-live'));
134
134
  expect(ariaLiveAttribute).toBe('assertive');
135
135
  });
136
136
 
137
137
  it('then the input and readout should be given limit reached classes', async () => {
138
138
  const hasClassOnSearchInput = await page.$eval('#search-field', element => element.classList.contains('ons-input--limit-reached'));
139
139
  expect(hasClassOnSearchInput).toBe(true);
140
- const hasClassOnLimitReadout = await page.$eval('#search-field-check-remaining', element =>
140
+ const hasClassOnLimitReadout = await page.$eval('#search-field-check', element =>
141
141
  element.classList.contains('ons-input__limit--reached'),
142
142
  );
143
143
  expect(hasClassOnLimitReadout).toBe(true);
@@ -150,24 +150,24 @@ describe('script: character-check', () => {
150
150
  });
151
151
 
152
152
  it('the char check readout should be visible', async () => {
153
- const hasClass = await page.$eval('#search-field-check-remaining', element => element.classList.contains('ons-u-d-no'));
153
+ const hasClass = await page.$eval('#search-field-check', element => element.classList.contains('ons-u-d-no'));
154
154
  expect(hasClass).toBe(false);
155
155
  });
156
156
 
157
157
  it('then the characters remaining readout reflect the number of characters exceeded', async () => {
158
- const innerHtml = await page.$eval('#search-field-check-remaining', element => element.innerHTML);
158
+ const innerHtml = await page.$eval('#search-field-check', element => element.innerHTML);
159
159
  expect(innerHtml.trim()).toBe('2 numbers too many');
160
160
  });
161
161
 
162
162
  it('then aria-live should be set to assertive', async () => {
163
- const ariaLiveAttribute = await page.$eval('#search-field-check-remaining', element => element.getAttribute('aria-live'));
163
+ const ariaLiveAttribute = await page.$eval('#search-field-check', element => element.getAttribute('aria-live'));
164
164
  expect(ariaLiveAttribute).toBe('assertive');
165
165
  });
166
166
 
167
167
  it('then the input and readout should be given limit reached classes', async () => {
168
168
  const hasClassOnSearchInput = await page.$eval('#search-field', element => element.classList.contains('ons-input--limit-reached'));
169
169
  expect(hasClassOnSearchInput).toBe(true);
170
- const hasClassOnLimitReadout = await page.$eval('#search-field-check-remaining', element =>
170
+ const hasClassOnLimitReadout = await page.$eval('#search-field-check', element =>
171
171
  element.classList.contains('ons-input__limit--reached'),
172
172
  );
173
173
  expect(hasClassOnLimitReadout).toBe(true);
@@ -188,7 +188,7 @@ describe('script: character-check', () => {
188
188
  });
189
189
 
190
190
  it('then aria-live attribute should removed', async () => {
191
- const hasAriaLiveAttribute = await page.$eval('#feedback-lim-remaining', element => element.hasAttribute('aria-live'));
191
+ const hasAriaLiveAttribute = await page.$eval('#feedback-lim', element => element.hasAttribute('aria-live'));
192
192
  expect(hasAriaLiveAttribute).toBe(false);
193
193
  });
194
194
  });
@@ -5,7 +5,9 @@
5
5
  {% from "components/button/_macro.njk" import onsButton %}
6
6
 
7
7
  {% set fields %}
8
+ {% if params.checkboxesLabel is defined %}
8
9
  <p class="ons-checkboxes__label{{ " " + params.checkboxesLabelClasses if params.checkboxesLabelClasses }}">{{ params.checkboxesLabel }}</p>
10
+ {% endif %}
9
11
  {% set hasOther = false %}
10
12
  {% for checkbox in params.checkboxes %}
11
13
  {% if checkbox.other %}
@@ -15,7 +17,7 @@
15
17
  {% if hasOther == false and params.autoSelect and params.autoSelect.selectAllText %}
16
18
  {% set btnClasses = ['small', 'secondary'] %}
17
19
  {% if params.borderlessParent == false %}
18
- {% set btnClasses = ['small', 'secondary', 'ghost-dark'] %}
20
+ {% set btnClasses = ['small', 'secondary', 'ghost', 'ghost-dark'] %}
19
21
  {% endif %}
20
22
  {{
21
23
  onsButton({
@@ -8,6 +8,7 @@
8
8
  }) %}
9
9
  {{
10
10
  onsCheckboxes({
11
+ "checkboxesLabel": "Select all that apply",
11
12
  "dontWrap": true,
12
13
  "name": "central-heating",
13
14
  "checkboxes": [
@@ -26,7 +26,7 @@
26
26
  {% set rejectedText = 'You have rejected all additional cookies.' %}
27
27
  {% set preferencesText = 'You can <a href="' + settingsLinkURL + '">change your cookie preferences</a> at any time.' %}
28
28
  {% set confirmationButtonText = 'Hide' %}
29
- {% set confirmationButtonTextAria = 'this message' %}
29
+ {% set contextSuffix = 'this message' %}
30
30
  {% endif %}
31
31
 
32
32
  <div class="ons-cookies-banner" role="region" aria-label="{{ params.ariaLabel | default(ariaLabel)}}">
@@ -78,7 +78,7 @@
78
78
  onsButton({
79
79
  "type": 'button',
80
80
  "text": params.confirmationButtonText | default(confirmationButtonText),
81
- "buttonContext": params.confirmationButtonTextAria | default(confirmationButtonTextAria),
81
+ "buttonContext": params.contextSuffix | default(contextSuffix),
82
82
  "classes": 'ons-btn--secondary ons-btn--small ons-js-hide-button'
83
83
  })
84
84
  }}
@@ -16,7 +16,7 @@ const EXAMPLE_COOKIES_BANNER_PARAMS = {
16
16
  rejectButtonText: 'Reject additional cookies override',
17
17
  preferencesText: 'Text override',
18
18
  confirmationButtonText: 'Hide override',
19
- confirmationButtonTextAria: 'the cookie message override',
19
+ contextSuffix: 'the cookie message override',
20
20
  };
21
21
 
22
22
  describe('macro: cookies-banner', () => {
@@ -112,7 +112,7 @@ describe('macro: cookies-banner', () => {
112
112
  expect(buttonSpy.occurrences[2].text).toBe('Hide override');
113
113
  });
114
114
 
115
- it('has the correct `confirmationButtonTextAria` for `buttonContext`', () => {
115
+ it('has the correct `contextSuffix` for `buttonContext`', () => {
116
116
  const faker = templateFaker();
117
117
  const buttonSpy = faker.spy('button');
118
118
 
@@ -26,7 +26,7 @@
26
26
  "id": params.id + "-day",
27
27
  "type": "number",
28
28
  "name": params.day.name,
29
- "classes": (" ons-input--error" if params.error else "") + exclusiveClass | default(""),
29
+ "classes": (" ons-input--error" if (params.error and params.day.error) or (params.error and not params.day.error and not params.month.error and not params.year.error) else "") + exclusiveClass | default(""),
30
30
  "width": "2",
31
31
  "min": 1,
32
32
  "max": 31,
@@ -46,7 +46,7 @@
46
46
  "id": params.id + "-month",
47
47
  "type": "number",
48
48
  "name": params.month.name,
49
- "classes": (" ons-input--error" if params.error else "") + exclusiveClass | default(""),
49
+ "classes": (" ons-input--error" if (params.error and params.month.error) or (params.error and not params.day.error and not params.month.error and not params.year.error) else "") + exclusiveClass | default(""),
50
50
  "width": "2",
51
51
  "min": 1,
52
52
  "max": 12,
@@ -66,7 +66,7 @@
66
66
  "id": params.id + "-year",
67
67
  "type": "number",
68
68
  "name": params.year.name,
69
- "classes": (" ons-input--error" if params.error else "") + exclusiveClass | default(""),
69
+ "classes": (" ons-input--error" if (params.error and params.year.error) or (params.error and not params.day.error and not params.month.error and not params.year.error) else "") + exclusiveClass | default(""),
70
70
  "width": "4",
71
71
  "min": 1000,
72
72
  "max": 3000,
@@ -11,6 +11,15 @@ const EXAMPLE_DATE_INPUT_BASE = {
11
11
  description: 'For example, 31 3 1980',
12
12
  };
13
13
 
14
+ const EXAMPLE_DATE_INPUT_BASE_WITH_ERROR = {
15
+ id: 'date',
16
+ legendOrLabel: 'Date of birth',
17
+ description: 'For example, 31 3 1980',
18
+ error: {
19
+ text: 'Enter a date that is after 1 January 2019',
20
+ },
21
+ };
22
+
14
23
  const EXAMPLE_DAY_FIELD = {
15
24
  day: {
16
25
  label: {
@@ -53,6 +62,66 @@ const EXAMPLE_YEAR_FIELD = {
53
62
  },
54
63
  };
55
64
 
65
+ const EXAMPLE_DAY_FIELD_WITH_ERROR = {
66
+ day: {
67
+ label: {
68
+ text: 'Day',
69
+ description: 'The day',
70
+ },
71
+ value: 'Day',
72
+ error: true,
73
+ name: 'day',
74
+ attributes: {
75
+ autocomplete: 'bday-day',
76
+ },
77
+ },
78
+ };
79
+
80
+ const EXAMPLE_MONTH_FIELD_WITH_ERROR = {
81
+ month: {
82
+ label: {
83
+ text: 'Month',
84
+ description: 'The month',
85
+ },
86
+ value: 'Month',
87
+ error: true,
88
+ name: 'month',
89
+ attributes: {
90
+ autocomplete: 'bday-month',
91
+ },
92
+ },
93
+ };
94
+
95
+ const EXAMPLE_YEAR_FIELD_WITH_ERROR = {
96
+ year: {
97
+ label: {
98
+ text: 'Year',
99
+ description: 'The year',
100
+ },
101
+ value: 'Year',
102
+ error: true,
103
+ name: 'year',
104
+ attributes: {
105
+ autocomplete: 'bday-year',
106
+ },
107
+ },
108
+ };
109
+
110
+ const EXAMPLE_YEAR_FIELD_WITH_NO_ERROR = {
111
+ year: {
112
+ label: {
113
+ text: 'Year',
114
+ description: 'The year',
115
+ },
116
+ value: 'Year',
117
+ name: 'year',
118
+ error: false,
119
+ attributes: {
120
+ autocomplete: 'bday-year',
121
+ },
122
+ },
123
+ };
124
+
56
125
  const EXAMPLE_DATE_SINGLE_FIELD = {
57
126
  ...EXAMPLE_DATE_INPUT_BASE,
58
127
  ...EXAMPLE_YEAR_FIELD,
@@ -65,6 +134,25 @@ const EXAMPLE_DATE_MULTIPLE_FIELDS = {
65
134
  ...EXAMPLE_YEAR_FIELD,
66
135
  };
67
136
 
137
+ const EXAMPLE_DATE_MULTIPLE_FIELDS_WITH_SINGLE_ERROR = {
138
+ ...EXAMPLE_DATE_INPUT_BASE_WITH_ERROR,
139
+ ...EXAMPLE_DAY_FIELD,
140
+ ...EXAMPLE_MONTH_FIELD,
141
+ ...EXAMPLE_YEAR_FIELD_WITH_ERROR,
142
+ };
143
+
144
+ const EXAMPLE_DATE_MULTIPLE_FIELDS_WITH_ERROR = {
145
+ ...EXAMPLE_DATE_INPUT_BASE_WITH_ERROR,
146
+ ...EXAMPLE_DAY_FIELD_WITH_ERROR,
147
+ ...EXAMPLE_MONTH_FIELD_WITH_ERROR,
148
+ ...EXAMPLE_YEAR_FIELD_WITH_ERROR,
149
+ };
150
+
151
+ const EXAMPLE_DATE_MULTIPLE_FIELDS_WITH_NO_ERROR = {
152
+ ...EXAMPLE_DATE_INPUT_BASE,
153
+ ...EXAMPLE_YEAR_FIELD_WITH_NO_ERROR,
154
+ };
155
+
68
156
  describe('macro: date input', () => {
69
157
  describe('mode: multiple fields', () => {
70
158
  it('passes jest-axe checks', async () => {
@@ -282,4 +370,34 @@ describe('macro: date input', () => {
282
370
  });
283
371
  });
284
372
  });
373
+
374
+ describe('mode: multiple fields with single field error', () => {
375
+ it('passes jest-axe checks', async () => {
376
+ const $ = cheerio.load(renderComponent('date-input', EXAMPLE_DATE_MULTIPLE_FIELDS_WITH_SINGLE_ERROR));
377
+
378
+ const results = await axe($.html());
379
+ expect(results).toHaveNoViolations();
380
+ });
381
+
382
+ it('has the provided error class on one input', async () => {
383
+ const $ = cheerio.load(renderComponent('date-input', EXAMPLE_DATE_MULTIPLE_FIELDS_WITH_SINGLE_ERROR));
384
+ const $errorContent = $('.ons-input--error');
385
+
386
+ expect($errorContent.length).toBe(1);
387
+ });
388
+
389
+ it('has the provided error class on multiple inputs', async () => {
390
+ const $ = cheerio.load(renderComponent('date-input', EXAMPLE_DATE_MULTIPLE_FIELDS_WITH_ERROR));
391
+ const $errorContent = $('.ons-input--error');
392
+
393
+ expect($errorContent.length).toBe(3);
394
+ });
395
+
396
+ it('does not provide error class when error parameter set to false', async () => {
397
+ const $ = cheerio.load(renderComponent('date-input', EXAMPLE_DATE_MULTIPLE_FIELDS_WITH_NO_ERROR));
398
+ const $errorContent = $('.ons-input--error');
399
+
400
+ expect($errorContent.length).toBe(0);
401
+ });
402
+ });
285
403
  });
@@ -0,0 +1,63 @@
1
+
2
+ {% from "components/date-input/_macro.njk" import onsDateInput %}
3
+ {{
4
+ onsDateInput({
5
+ "id": "period-from-date",
6
+ "legendOrLabel": "Period from:",
7
+ "description": "For example, 31 3 2019",
8
+ "day": {
9
+ "label": {
10
+ "text": "Day"
11
+ },
12
+ "name": "day",
13
+ "value": "1"
14
+ },
15
+ "month": {
16
+ "label": {
17
+ "text": "Month"
18
+ },
19
+ "name": "month",
20
+ "value": "1"
21
+ },
22
+ "year": {
23
+ "label": {
24
+ "text": "Year"
25
+ },
26
+ "name": "year",
27
+ "value": "2019"
28
+ }
29
+ })
30
+ }}
31
+
32
+ {{
33
+ onsDateInput({
34
+ "id": "period-to-date",
35
+ "legendOrLabel": "Period to:",
36
+ "description": "For example, 31 3 2020",
37
+ "day": {
38
+ "label": {
39
+ "text": "Day"
40
+ },
41
+ "name": "day",
42
+ "value": "31"
43
+ },
44
+ "month": {
45
+ "label": {
46
+ "text": "Month"
47
+ },
48
+ "name": "month",
49
+ "value": "12"
50
+ },
51
+ "year": {
52
+ "label": {
53
+ "text": "Year"
54
+ },
55
+ "name": "year",
56
+ "value": "2018",
57
+ "error": true
58
+ },
59
+ "error": {
60
+ "text": "Enter a date that is after 1 January 2019"
61
+ }
62
+ })
63
+ }}
@@ -22,7 +22,7 @@ $details-caret-width: 1.5rem;
22
22
  margin-left: -$details-caret-width;
23
23
  padding-left: $details-caret-width;
24
24
  }
25
- .ons-details__icon .ons-svg-icon {
25
+ .ons-details__icon .ons-icon {
26
26
  fill: var(--ons-color-text-link-focus);
27
27
  }
28
28
  }
@@ -3,19 +3,19 @@
3
3
  visibility: hidden;
4
4
  white-space: nowrap;
5
5
  }
6
- .ons-svg-icon {
6
+ .ons-icon {
7
7
  fill: var(--ons-color-grey-100);
8
8
  margin: 0 0 0 0.25rem;
9
9
  padding-bottom: 0.1rem;
10
10
  visibility: visible;
11
11
  }
12
12
  &:focus {
13
- .ons-svg-icon {
13
+ .ons-icon {
14
14
  fill: var(--ons-color-black);
15
15
  }
16
16
  }
17
17
  &:hover {
18
- .ons-svg-icon {
18
+ .ons-icon {
19
19
  fill: var(--ons-color-text-link-hover);
20
20
  .ons-footer & {
21
21
  fill: var(--ons-color-black);
@@ -3,7 +3,7 @@
3
3
  <a href="{{ params.url }}" class="ons-external-link{% if params.classes %} {{ params.classes }}{% endif %}" target="_blank" rel="noopener">
4
4
  <span class="ons-external-link__text">
5
5
  {{- params.linkText | safe -}}
6
- </span><span class="ons-external-link__icon">&nbsp;<svg class="ons-svg-icon" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true">
6
+ </span><span class="ons-external-link__icon">&nbsp;<svg class="ons-icon" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true">
7
7
  <path d="M13.5,9H13a.5.5,0,0,0-.5.5v3h-9v-9h3A.5.5,0,0,0,7,3V2.5A.5.5,0,0,0,6.5,2h-4a.5.5,0,0,0-.5.5v11a.5.5,0,0,0,.5.5h11a.5.5,0,0,0,.5-.5v-4A.5.5,0,0,0,13.5,9Z" transform="translate(-2 -1.99)"/>
8
8
  <path d="M8.83,7.88a.51.51,0,0,0,.71,0l2.31-2.32,1.28,1.28A.51.51,0,0,0,14,6.49v-4a.52.52,0,0,0-.5-.5h-4A.51.51,0,0,0,9,2.52a.58.58,0,0,0,.14.33l1.28,1.28L8.12,6.46a.51.51,0,0,0,0,.71Z" transform="translate(-2 -1.99)"/>
9
9
  </svg></span><span class="ons-external-link__new-window-description ons-u-vh"> ({{- params.newWindowDescription | default("opens in a new tab") -}})</span></a>
@@ -30,8 +30,8 @@
30
30
  vertical-align: middle;
31
31
  }
32
32
 
33
- .ons-svg-logo,
34
- .ons-svg-logo__group {
33
+ .ons-icon--logo,
34
+ .ons-icon--logo__group {
35
35
  fill: var(--ons-color-black) !important;
36
36
  }
37
37
 
@@ -4,18 +4,18 @@
4
4
  {% from "components/footer/_macro.njk" import onsFooter %}
5
5
  {{
6
6
  onsFooter({
7
- "poweredBy": '<svg class="ons-svg-logo ons-svg-logo--nisra" xmlns="http://www.w3.org/2000/svg" width="170" height="56" viewBox="0 1 170 54" aria-labelledby="poweredby-alt">
7
+ "poweredBy": '<svg class="ons-icon--logo ons-icon--logo--nisra" xmlns="http://www.w3.org/2000/svg" width="170" height="56" viewBox="0 1 170 54" aria-labelledby="poweredby-alt">
8
8
  <title id="poweredby-alt">NISRA - Northern Ireland Statistics and Research Agency</title>
9
- <g class="ons-svg-logo__group" fill="#3d7cc9">
9
+ <g class="ons-icon--logo__group" fill="#3d7cc9">
10
10
  <path d="M0,39.3c2.7,4.7,6.1,8.1,10.8,10.8c4.6,2.7,9.7,4,14.7,4c7,0,13.8-2.5,19.2-7.1c0.3-0.3,0.6-0.5,0.9-0.8 c2.1-2,3.9-4.2,5.5-6.9l-15.2-8.8l-1.2-0.7l-8.6-4.9l-0.6-0.4L25,24.8L6.4,35.6l-1.1,0.6L0,39.3L0,39.3z"></path>
11
11
  </g>
12
- <g class="ons-svg-logo__group" fill="#cddb00">
12
+ <g class="ons-icon--logo__group" fill="#cddb00">
13
13
  <path d="M36.4,7.2c-0.4-0.1-0.8-0.3-1.2-0.4c-2.9-0.9-5.9-1.4-9.1-1.4v18.1l9.1,5.3l1.2,0.7l15.2,8.8l1,0.6l-0.6,1 c-1.5,2.6-3.3,4.9-5.4,6.9l5,2.9c2.7-4.7,3.9-9.3,3.9-14.7C55.6,22.2,47.6,11.4,36.4,7.2L36.4,7.2z"></path>
14
14
  </g>
15
- <g class="ons-svg-logo__group" fill="#00205c">
15
+ <g class="ons-icon--logo__group" fill="#00205c">
16
16
  <path d="M6.2,34.4L25,23.5V4.2h1.2c3.1,0,6.2,0.5,9.1,1.4V0c-5.4,0-10,1.2-14.7,4C9.5,10.3,4.2,22.6,6.2,34.4z"></path>
17
17
  </g>
18
- <g class="ons-svg-logo__group ons-svg-logo__group--text" fill="#00205c">
18
+ <g class="ons-icon--logo__group ons-icon--logo__group--text" fill="#00205c">
19
19
  <path d="M94.5,48.4l-1-0.2c-0.4-0.1-0.7-0.2-0.7-0.5s0.3-0.5,0.8-0.5c0.7,0,0.8,0.4,0.8,0.5l0.9-0.2c-0.3-0.9-1.2-1.1-1.8-1.1 c-1.5,0-1.7,1-1.7,1.5c0,1.1,1,1.3,1.4,1.3l0.8,0.2c0.2,0,0.5,0.2,0.5,0.5c0,0.5-0.7,0.6-1,0.6c-0.7,0-0.9-0.3-1-0.6l-0.8,0.2 c0.2,0.7,0.9,1.1,1.9,1.1c0.6,0,2-0.2,2-1.5C95.6,49,95.2,48.5,94.5,48.4z M91.2,49c0-1.3-0.6-2.5-2.1-2.5c-1.3,0-2.1,1-2.1,2.4 c0,1.1,0.6,2.4,2.1,2.4c0.9,0,1.7-0.4,2-1.4l-0.9-0.2c-0.1,0.2-0.3,0.7-1,0.7c-0.4,0-0.7-0.1-0.9-0.4c-0.3-0.4-0.2-0.7-0.2-1H91.2z M88.3,47.7c0.2-0.3,0.5-0.4,0.8-0.4c0.4,0,0.6,0.2,0.8,0.4c0.2,0.3,0.2,0.5,0.2,0.7h-2C88.1,48.2,88.2,48,88.3,47.7z M148.6,49.6l-1.1-3h-1.1l1.6,4.3l0.1,0.3c0,0.1-0.1,0.5-0.3,0.7c-0.2,0.2-0.4,0.1-1,0.1v0.8h0.6c0.4,0,0.9-0.1,1.2-1l1.8-5.2
20
20
  h-0.8L148.6,49.6z M100.4,49c0-1.3-0.6-2.5-2.1-2.5c-1.3,0-2.1,1-2.1,2.4c0,1.1,0.6,2.4,2.1,2.4c0.9,0,1.7-0.4,2-1.4l-0.9-0.2
21
21
  c-0.1,0.2-0.3,0.7-1,0.7c-0.4,0-0.7-0.1-0.9-0.4c-0.3-0.4-0.2-0.7-0.2-1H100.4z M97.5,47.7c0.2-0.3,0.5-0.4,0.8-0.4
@@ -79,10 +79,10 @@
79
79
  &--neutral & {
80
80
  &__top {
81
81
  background: var(--ons-color-header-masthead-internal);
82
- .ons-svg-logo {
82
+ .ons-icon--logo {
83
83
  display: block;
84
- .ons-svg-logo__group--text,
85
- .ons-svg-logo__group--primary {
84
+ .ons-icon--logo__group--text,
85
+ .ons-icon--logo__group--primary {
86
86
  fill: var(--ons-color-white);
87
87
  }
88
88
  }
@@ -91,7 +91,7 @@
91
91
  background-color: transparent;
92
92
  box-shadow: none;
93
93
  outline: 3px solid var(--ons-color-focus);
94
- .ons-svg-logo {
94
+ .ons-icon--logo {
95
95
  fill: var(--ons-color-text-link-focus);
96
96
  }
97
97
  }
@@ -140,7 +140,7 @@
140
140
  }
141
141
  }
142
142
 
143
- .ons-svg-logo {
143
+ .ons-icon--logo {
144
144
  display: block;
145
145
  }
146
146
 
@@ -155,9 +155,9 @@
155
155
 
156
156
  &__org-logo-link {
157
157
  &:focus {
158
- .ons-svg-logo {
158
+ .ons-icon--logo {
159
159
  fill: var(--ons-color-black) !important;
160
- .ons-svg-logo__group {
160
+ .ons-icon--logo__group {
161
161
  fill: var(--ons-color-black) !important;
162
162
  }
163
163
  }
@@ -207,7 +207,7 @@
207
207
  &:first-child {
208
208
  margin-left: 0;
209
209
  }
210
- .ons-svg-icon {
210
+ .ons-icon {
211
211
  clip-path: circle(9px at center);
212
212
  margin-right: 0.5rem;
213
213
  }
@@ -1,4 +1,4 @@
1
- .ons-svg-icon {
1
+ .ons-icon {
2
2
  height: 1rem;
3
3
  vertical-align: middle;
4
4
  width: 1rem;