@ons/design-system 73.0.2 → 73.0.4

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 (49) hide show
  1. package/README.md +3 -1
  2. package/components/accordion/_macro.njk +2 -0
  3. package/components/accordion/_macro.spec.js +39 -0
  4. package/components/accordion/accordion.js +2 -0
  5. package/components/accordion/example-accordion.njk +6 -1
  6. package/components/back-to-top/example-full-page-back-to-top.njk +2 -2
  7. package/components/button/example-button-new-window.njk +1 -0
  8. package/components/chart/chart-constants.js +2 -1
  9. package/components/chart/chart.js +2 -0
  10. package/components/chart/example-area-chart-with-axis-min-and-max-values.njk +1 -1
  11. package/components/chart/example-clustered-column-chart.njk +1 -1
  12. package/components/chart/example-line-chart-with-annotations.njk +1 -1
  13. package/components/chart/example-line-chart-with-axis-min-and-max-values.njk +1 -1
  14. package/components/chart/example-line-chart-with-custom-reference-line-value.njk +1 -1
  15. package/components/chart/example-line-chart-with-markers.njk +1 -37
  16. package/components/chart/example-line-chart-with-range-annotations-inside.njk +1 -1
  17. package/components/chart/example-line-chart-with-range-annotations-outside-left-right.njk +1 -1
  18. package/components/chart/example-line-chart-with-range-annotations-outside-top-bottom.njk +1 -1
  19. package/components/chart/example-line-chart-with-reference-line-annotations.njk +1 -1
  20. package/components/chart/example-line-chart.njk +1 -1
  21. package/components/chart/example-scatter-chart-with-axis-min-and-max-values.njk +1 -1
  22. package/components/chart/example-scatter-chart.njk +1 -1
  23. package/components/chart/example-stacked-column-chart.njk +26 -37
  24. package/components/chart/specific-chart-options.js +16 -1
  25. package/components/cookies-banner/_macro.njk +1 -3
  26. package/components/featured-article/example-featured-article-with-chart.njk +1 -1
  27. package/components/icon/_macro.njk +12 -3
  28. package/components/icon/_macro.spec.js +2 -2
  29. package/components/image/_image.scss +2 -1
  30. package/components/list/example-inline-list-with-social-icon-prefix.njk +2 -2
  31. package/components/pagination/_macro.njk +7 -6
  32. package/components/pagination/_macro.spec.js +44 -44
  33. package/components/panel/_macro.njk +8 -2
  34. package/components/panel/_macro.spec.js +24 -2
  35. package/components/panel/_panel.scss +2 -0
  36. package/components/panel/example-panel-with-pending.njk +9 -0
  37. package/components/radios/_macro.njk +2 -1
  38. package/components/radios/_macro.spec.js +36 -0
  39. package/components/related-content/example-related-content-social-media.njk +2 -2
  40. package/components/share-page/_macro.njk +6 -6
  41. package/components/share-page/_macro.spec.js +9 -9
  42. package/components/share-page/example-share-page.njk +1 -1
  43. package/components/table/_macro.njk +4 -19
  44. package/css/main.css +1 -1
  45. package/layout/_template.njk +9 -9
  46. package/package.json +1 -1
  47. package/scripts/main.es5.js +1 -1
  48. package/scripts/main.js +1 -1
  49. /package/favicons/{twitter.png → x.png} +0 -0
package/README.md CHANGED
@@ -1,7 +1,9 @@
1
1
  # ONS Design System
2
2
 
3
3
  [![GitHub release](https://img.shields.io/github/release/ONSdigital/design-system.svg)](https://github.com/ONSdigital/design-system/releases)
4
- [![Tests](https://github.com/ONSdigital/design-system/actions/workflows/tests.yml/badge.svg)](https://github.com/ONSdigital/design-system/actions/workflows/tests.yml)
4
+ [![Macro and script tests](https://github.com/ONSdigital/design-system/actions/workflows/macro-and-script-tests.yml/badge.svg)](https://github.com/ONSdigital/design-system/actions/workflows/macro-and-script-tests.yml)
5
+ [![Visual regression tests](https://github.com/ONSdigital/design-system/actions/workflows/visual-regression-tests.yml/badge.svg)](https://github.com/ONSdigital/design-system/actions/workflows/visual-regression-tests.yml)
6
+ [![Lighthouse tests](https://github.com/ONSdigital/design-system/actions/workflows/lighthouse-ci.yml/badge.svg)](https://github.com/ONSdigital/design-system/actions/workflows/lighthouse-ci.yml)
5
7
  [![GitHub pull requests](https://img.shields.io/github/issues-pr-raw/ONSdigital/design-system.svg)](https://github.com/ONSdigital/design-system/pulls)
6
8
  [![Github last commit](https://img.shields.io/github/last-commit/ONSdigital/design-system.svg)](https://github.com/ONSdigital/design-system/commits)
7
9
  [![Github contributors](https://img.shields.io/github/contributors/ONSdigital/design-system.svg)](https://github.com/ONSdigital/design-system/graphs/contributors)
@@ -8,6 +8,8 @@
8
8
  {%
9
9
  set attributes = attributes | setAttributes({
10
10
  "data-close-all": params.allButton.close,
11
+ "data-open-aria-label": params.allButton.openAriaLabel | default("Show all buttons"),
12
+ "data-close-aria-label": params.allButton.closeAriaLabel | default("Hide all buttons"),
11
13
  "data-group": params.id
12
14
  })
13
15
  %}
@@ -202,7 +202,46 @@ describe('FOR: Macro: Accordion', () => {
202
202
  expect($('button.ons-accordion__toggle-all').attr('b')).toBe('456');
203
203
  });
204
204
  });
205
+
206
+ describe('WHEN: openAriaLabel and closeAriaLabel are provided', () => {
207
+ const $ = cheerio.load(
208
+ renderComponent('accordion', {
209
+ ...EXAMPLE_ACCORDION,
210
+ allButton: {
211
+ open: 'Open label',
212
+ close: 'Close label',
213
+ openAriaLabel: 'Open all sections',
214
+ closeAriaLabel: 'Close all sections',
215
+ },
216
+ }),
217
+ );
218
+ test('THEN: renders toggle all button with provided openAriaLabel', () => {
219
+ expect($('button.ons-accordion__toggle-all').attr('data-open-aria-label')).toBe('Open all sections');
220
+ });
221
+ test('THEN: renders toggle all button with provided closeAriaLabel', () => {
222
+ expect($('button.ons-accordion__toggle-all').attr('data-close-aria-label')).toBe('Close all sections');
223
+ });
224
+ });
225
+
226
+ describe('WHEN: openAriaLabel and closeAriaLabel are NOT provided', () => {
227
+ const $ = cheerio.load(
228
+ renderComponent('accordion', {
229
+ ...EXAMPLE_ACCORDION,
230
+ allButton: {
231
+ open: 'Open label',
232
+ close: 'Close label',
233
+ },
234
+ }),
235
+ );
236
+ test('THEN: renders toggle all button with default openAriaLabel', () => {
237
+ expect($('button.ons-accordion__toggle-all').attr('data-open-aria-label')).toBe('Show all buttons');
238
+ });
239
+ test('THEN: renders toggle all button with default closeAriaLabel', () => {
240
+ expect($('button.ons-accordion__toggle-all').attr('data-close-aria-label')).toBe('Hide all buttons');
241
+ });
242
+ });
205
243
  });
244
+
206
245
  describe('GIVEN: Params: saveState', () => {
207
246
  describe('WHEN: saveState param is not provided', () => {
208
247
  const $ = cheerio.load(
@@ -55,9 +55,11 @@ export default class Accordion {
55
55
  if (this.canClose()) {
56
56
  this.buttonInner.innerHTML = DOMPurify.sanitize(this.closeButton);
57
57
  this.button.setAttribute('data-ga-label', this.buttonOpen);
58
+ this.button.setAttribute('aria-label', this.button.getAttribute('data-close-aria-label'));
58
59
  this.button.setAttribute('aria-expanded', 'true');
59
60
  } else {
60
61
  this.buttonInner.innerHTML = DOMPurify.sanitize(this.buttonOpen);
62
+ this.button.setAttribute('aria-label', this.button.getAttribute('data-open-aria-label'));
61
63
  this.button.setAttribute('data-ga-label', this.closeButton);
62
64
  this.button.setAttribute('aria-expanded', 'false');
63
65
  }
@@ -5,7 +5,12 @@
5
5
  "id": "accordion-example",
6
6
  "allButton": {
7
7
  "open": "Show all",
8
- "close": "Hide all"
8
+ "close": "Hide all",
9
+ "openAriaLabel": "Show all sections",
10
+ "closeAriaLabel": "Hide all sections",
11
+ "attributes": {
12
+ "data-toggle-button": "accordion-toggle-all"
13
+ }
9
14
  },
10
15
  "itemsList": [
11
16
  {
@@ -189,8 +189,8 @@ layout: ~
189
189
  },
190
190
  {
191
191
  "url": '#0',
192
- "text": 'Twitter',
193
- "iconType": 'twitter',
192
+ "text": 'X',
193
+ "iconType": 'x',
194
194
  "rel": 'noreferrer external'
195
195
  }
196
196
  ]
@@ -1,4 +1,5 @@
1
1
  {% from "components/button/_macro.njk" import onsButton %}
2
+
2
3
  {{
3
4
  onsButton({
4
5
  "text": 'Web chat',
@@ -1,7 +1,8 @@
1
1
  class ChartConstants {
2
2
  static constants() {
3
3
  const constants = {
4
- primaryTheme: ['#206095', '#27a0cc', '#003c57', '#118c7b', '#a8bd3a', '#871a5b', '#f66068', '#746cb1', '#22d0b6'],
4
+ primaryTheme: ['#206095', '#a8bd3a', '#871a5b', '#f66068', '#05341a', '#27a0cc'],
5
+ linePrimaryTheme: ['#206095', '#a8bd3a', '#871a5b', '#f66068', '#27a0cc', '#05341a'],
5
6
  // Alternate theme colours from https://service-manual.ons.gov.uk/data-visualisation/colours/using-colours-in-charts
6
7
  alternateTheme: ['#206095', '#27A0CC', '#871A5B', '#A8BD3A', '#F66068'],
7
8
  labelColor: '#414042',
@@ -187,6 +187,8 @@ class HighchartsBaseChart {
187
187
  }
188
188
  }
189
189
 
190
+ this.specificChartOptions.limitSeriesToThemeLength();
191
+
190
192
  // Disable the legend for single series charts
191
193
  this.specificChartOptions.disableLegendForSingleSeries(this.config);
192
194
  };
@@ -4,7 +4,7 @@
4
4
  onsChart({
5
5
  "chartType": "area",
6
6
  "description": "Area chart showing the annual rate of inflation for the Consumer Prices Index including owner occupiers’ housing costs (CPIH) and its components.",
7
- "theme": "alternate",
7
+ "theme": "primary",
8
8
  "title": "Sales volumes and values saw moderate growth in July 2024",
9
9
  "subtitle": "Figure 6: Upward contribution from housing and household services (including energy) saw the annual CPIH inflation rate rise",
10
10
  "id": "id",
@@ -4,7 +4,7 @@
4
4
  onsChart({
5
5
  "chartType": "column",
6
6
  "description": "Volume sales, monthly percentage change, seasonally adjusted, Great Britain, October 2024",
7
- "theme": "alternate",
7
+ "theme": "primary",
8
8
  "title": "Clothing stores fell back, following three months of growth",
9
9
  "subtitle": "Volume sales, monthly percentage change, seasonally adjusted, Great Britain, October 2024",
10
10
  "id": "uuid",
@@ -4,7 +4,7 @@
4
4
  onsChart({
5
5
  "chartType": "line",
6
6
  "description": "Line chart showing the annual rate of inflation for the Consumer Prices Index including owner occupiers’ housing costs (CPIH) and its components.",
7
- "theme": "alternate",
7
+ "theme": "primary",
8
8
  "title": "Sales volumes and values saw moderate growth in July 2024",
9
9
  "subtitle": "Figure 6: Upward contribution from housing and household services (including energy) saw the annual CPIH inflation rate rise",
10
10
  "id": "id",
@@ -4,7 +4,7 @@
4
4
  onsChart({
5
5
  "chartType": "line",
6
6
  "description": "Line chart showing the annual rate of inflation for the Consumer Prices Index including owner occupiers’ housing costs (CPIH) and its components.",
7
- "theme": "alternate",
7
+ "theme": "primary",
8
8
  "title": "Sales volumes and values saw moderate growth in July 2024",
9
9
  "subtitle": "Figure 6: Upward contribution from housing and household services (including energy) saw the annual CPIH inflation rate rise",
10
10
  "id": "id",
@@ -4,7 +4,7 @@
4
4
  onsChart({
5
5
  "chartType": "line",
6
6
  "description": "Line chart showing the annual rate of inflation for the Consumer Prices Index including owner occupiers’ housing costs (CPIH) and its components.",
7
- "theme": "alternate",
7
+ "theme": "primary",
8
8
  "title": "Sales volumes and values saw moderate growth in July 2024",
9
9
  "subtitle": "Figure 6: Upward contribution from housing and household services (including energy) saw the annual CPIH inflation rate rise",
10
10
  "id": "id",
@@ -38,11 +38,7 @@
38
38
  'Dec 2014',
39
39
  'Jan 2015',
40
40
  'Feb 2015',
41
- 'Mar 2015',
42
- 'Apr 2015',
43
- 'May 2015',
44
- 'Jun 2015',
45
- 'Jul 2015'
41
+ 'Mar 2015'
46
42
  ]
47
43
  },
48
44
  "yAxis": {
@@ -98,38 +94,6 @@
98
94
  ],
99
95
  "marker": true,
100
96
  "connectNulls": true
101
- },
102
- {
103
- "name": 'Extra test series 3',
104
- "data": [
105
- 5.5, 5.3, 5.4, 5.5, 5.4, 5.2, 5.1, 5.2, 5.0, 5.3
106
- ],
107
- "marker": true,
108
- "connectNulls": true
109
- },
110
- {
111
- "name": 'Extra test series 4',
112
- "data": [
113
- -3.5, -3.3, -3.4, -3.5, -3.4, -3.2, -3.1, -3.2, -3.0, -3.3
114
- ],
115
- "marker": true,
116
- "connectNulls": true
117
- },
118
- {
119
- "name": 'Extra test series 5',
120
- "data": [
121
- -4.5, -4.3, -4.4, -4.5, -4.4, -4.2, -4.1, -4.2, -4.0, -4.3
122
- ],
123
- "marker": true,
124
- "connectNulls": true
125
- },
126
- {
127
- "name": 'Extra test series 6',
128
- "data": [
129
- -5.5, -5.3, -5.4, -5.5, -5.4, -5.2, -5.1, -5.2, -5.0, -5.3
130
- ],
131
- "marker": true,
132
- "connectNulls": true
133
97
  }
134
98
  ],
135
99
  "percentageHeightDesktop": 35,
@@ -4,7 +4,7 @@
4
4
  onsChart({
5
5
  "chartType": "line",
6
6
  "description": "Line chart showing the annual rate of inflation for the Consumer Prices Index including owner occupiers’ housing costs (CPIH) and its components.",
7
- "theme": "alternate",
7
+ "theme": "primary",
8
8
  "title": "Sales volumes and values saw moderate growth in July 2024",
9
9
  "subtitle": "Figure 6: Upward contribution from housing and household services (including energy) saw the annual CPIH inflation rate rise",
10
10
  "id": "id",
@@ -4,7 +4,7 @@
4
4
  onsChart({
5
5
  "chartType": "line",
6
6
  "description": "Line chart showing the annual rate of inflation for the Consumer Prices Index including owner occupiers’ housing costs (CPIH) and its components.",
7
- "theme": "alternate",
7
+ "theme": "primary",
8
8
  "title": "Sales volumes and values saw moderate growth in July 2024",
9
9
  "subtitle": "Figure 6: Upward contribution from housing and household services (including energy) saw the annual CPIH inflation rate rise",
10
10
  "id": "id",
@@ -4,7 +4,7 @@
4
4
  onsChart({
5
5
  "chartType": "line",
6
6
  "description": "Line chart showing the annual rate of inflation for the Consumer Prices Index including owner occupiers’ housing costs (CPIH) and its components.",
7
- "theme": "alternate",
7
+ "theme": "primary",
8
8
  "title": "Sales volumes and values saw moderate growth in July 2024",
9
9
  "subtitle": "Figure 6: Upward contribution from housing and household services (including energy) saw the annual CPIH inflation rate rise",
10
10
  "id": "id",
@@ -4,7 +4,7 @@
4
4
  onsChart({
5
5
  "chartType": "line",
6
6
  "description": "Line chart showing the annual rate of inflation for the Consumer Prices Index including owner occupiers’ housing costs (CPIH) and its components.",
7
- "theme": "alternate",
7
+ "theme": "primary",
8
8
  "title": "Sales volumes and values saw moderate growth in July 2024",
9
9
  "subtitle": "Figure 6: Upward contribution from housing and household services (including energy) saw the annual CPIH inflation rate rise",
10
10
  "id": "id",
@@ -4,7 +4,7 @@
4
4
  onsChart({
5
5
  "chartType": "line",
6
6
  "description": "Line chart showing the annual rate of inflation for the Consumer Prices Index including owner occupiers’ housing costs (CPIH) and its components.",
7
- "theme": "alternate",
7
+ "theme": "primary",
8
8
  "title": "Sales volumes and values saw moderate growth in July 2024",
9
9
  "subtitle": "Figure 6: Upward contribution from housing and household services (including energy) saw the annual CPIH inflation rate rise",
10
10
  "id": "id",
@@ -4,7 +4,7 @@
4
4
  onsChart({
5
5
  "chartType": "scatter",
6
6
  "description": "Example scatter chart",
7
- "theme": "alternate",
7
+ "theme": "primary",
8
8
  "title": "Example scatter chart",
9
9
  "subtitle": "Scatter chart subtitle",
10
10
  "id": "id",
@@ -4,7 +4,7 @@
4
4
  onsChart({
5
5
  "chartType": "scatter",
6
6
  "description": "Example scatter chart",
7
- "theme": "alternate",
7
+ "theme": "primary",
8
8
  "title": "Example scatter chart",
9
9
  "subtitle": "Scatter chart subtitle",
10
10
  "id": "id",
@@ -2,66 +2,55 @@
2
2
  {{
3
3
  onsChart({
4
4
  "chartType": "column",
5
- "description": "Volume sales, seasonally adjusted, Great Britain, January 2022 to January 2025",
5
+ "description": "Monthly percentage change in retail sales volume by store type, Great Britain, January to June 2025",
6
6
  "theme": "primary",
7
7
  "title": "Food stores showed a strong rise on the month, while non-food stores fell",
8
- "subtitle": "Figure 6: Upward contribution from housing and household services (including energy) saw the annual CPIH inflation rate rise",
8
+ "subtitle": "Figure 6: Upward contribution to monthly percentage change in total retail sales",
9
9
  "id": "uuid",
10
10
  "useStackedLayout": true,
11
11
  "caption": "Source: Monthly Business Survey, Retail Sales Inquiry from the Office for National Statistics",
12
12
  "download": {
13
- 'title': 'Download Figure 1 data',
14
- 'itemsList': [
15
- {
16
- "text": "Excel spreadsheet (XLSX format, 18KB)",
17
- "url": "#"
18
- },
19
- {
20
- "text": "Simple text file (CSV format, 25KB)",
21
- "url": "#"
22
- },
23
- {
24
- "text": "Image (PNG format, 25KB)",
25
- "url": "#"
26
- }
13
+ "title": "Download Figure 6 data",
14
+ "itemsList": [
15
+ { "text": "Excel spreadsheet (XLSX format, 22KB)", "url": "#" },
16
+ { "text": "Simple text file (CSV format, 28KB)", "url": "#" },
17
+ { "text": "Image (PNG format, 32KB)", "url": "#" }
27
18
  ]
28
19
  },
29
20
  "legend": true,
30
21
  "series": [
31
22
  {
32
- "data": [5, 3, 4, 6, 2, 2, 3, 7],
33
- "dataLabels": false,
34
- "name": "2022"
23
+ "name": "Food stores",
24
+ "data": [1.5, 0.8, 1.2, 0.9, 1.1, 1.4]
35
25
  },
36
26
  {
37
- "data": [2, 2, 3, 7, 3, 4, 4, 1],
38
- "dataLabels": false,
39
- "name": "2023"
27
+ "name": "Non-food stores",
28
+ "data": [0.5, -0.2, 0.6, 0.8, 0.3, 0.4]
40
29
  },
41
30
  {
42
- "data": [3, 4, 4, 1, 5, 3, 4, 6],
43
- "dataLabels": false,
44
- "name": "2024"
31
+ "name": "Non-store retailing",
32
+ "data": [0.2, 0.1, 0.3, 0.2, 0.4, 0.3]
33
+ },
34
+ {
35
+ "name": "Automotive fuel",
36
+ "data": [0.3, 0.2, -0.1, 0.4, 0.2, 0.5]
45
37
  }
46
38
  ],
47
39
  "xAxis": {
48
40
  "categories": [
49
- "Food stores",
50
- "Non-food stores",
51
- "Non-store retailing ",
52
- "Automotive fuel",
53
- "Household goods stores",
54
- "Clothing stores",
55
- "Other stores",
56
- "All retailing"
41
+ "Jan 2025",
42
+ "Feb 2025",
43
+ "Mar 2025",
44
+ "Apr 2025",
45
+ "May 2025",
46
+ "Jun 2025"
57
47
  ],
58
- "title": "Items",
59
- "type": "linear"
48
+ "title": "Month"
60
49
  },
61
50
  "yAxis": {
62
- "title": "Percentage of GDP (%)"
51
+ "title": "Monthly percentage change (%)"
63
52
  },
64
- "percentageHeightDesktop": 35,
53
+ "percentageHeightDesktop": 40,
65
54
  "percentageHeightMobile": 90
66
55
  })
67
56
  }}
@@ -8,7 +8,12 @@ class SpecificChartOptions {
8
8
  this.config = config;
9
9
 
10
10
  this.options = {
11
- colors: this.theme === 'alternate' ? this.constants.alternateTheme : this.constants.primaryTheme,
11
+ colors:
12
+ this.theme === 'alternate'
13
+ ? this.constants.alternateTheme
14
+ : type == 'line'
15
+ ? this.constants.linePrimaryTheme
16
+ : this.constants.primaryTheme,
12
17
  chart: {
13
18
  type: type,
14
19
  marginTop: this.config.legend.enabled ? (type === 'boxplot' ? 50 : undefined) : 50,
@@ -41,6 +46,16 @@ class SpecificChartOptions {
41
46
  };
42
47
  }
43
48
 
49
+ limitSeriesToThemeLength = () => {
50
+ // Get the theme array from ChartConstants based on the theme name
51
+ const themeArray = this.theme === 'alternate' ? this.constants.alternateTheme : this.constants.primaryTheme;
52
+
53
+ // Limit the series to the theme array length
54
+ if (this.config.series.length > themeArray.length) {
55
+ this.config.series.length = themeArray.length;
56
+ }
57
+ };
58
+
44
59
  getOptions = () => this.options;
45
60
 
46
61
  getMobileOptions = (xAxisTickInterval, yAxisTickInterval) => {
@@ -4,7 +4,6 @@
4
4
  {% if params.lang == 'cy' %}
5
5
  {% set ariaLabel = 'Cwcis' %}
6
6
  {% set serviceName = 'ons.gov.uk' %}
7
- {% set defaultCookiesLink = '/cwics' %}
8
7
  {% set statementTitle = 'Cwcis ar' %}
9
8
  {% set settingsLinkText = 'Gweld cwcis' %}
10
9
  {% set acceptButtonText = 'Derbyn cwcis ychwanegol' %}
@@ -20,7 +19,6 @@
20
19
  {% else %}
21
20
  {% set ariaLabel = 'Cookies banner' %}
22
21
  {% set serviceName = 'ons.gov.uk' %}
23
- {% set defaultCookiesLink = '/cookies' %}
24
22
  {% set statementTitle = 'Cookies on' %}
25
23
  {% set settingsLinkText = 'View cookies' %}
26
24
  {% set acceptButtonText = 'Accept additional cookies' %}
@@ -36,7 +34,7 @@
36
34
  {% endif %}
37
35
 
38
36
  {% if not isDesignSystemExample %}
39
- {% set settingsLinkUrl = params.settingsLinkUrl | default(defaultCookiesLink) %}
37
+ {% set settingsLinkUrl = params.settingsLinkUrl | default('/cookies') %}
40
38
  {% else %}
41
39
  {% set settingsLinkUrl = '#0' %}
42
40
  {% endif %}
@@ -18,7 +18,7 @@
18
18
  "chart": {
19
19
  "chartType": "line",
20
20
  "description": "Line chart showing the annual rate of inflation for the Consumer Prices Index including owner occupiers’ housing costs (CPIH) and its components.",
21
- "theme": "alternate",
21
+ "theme": "primary",
22
22
  "title": "Sales volumes and values saw moderate growth in July 2024",
23
23
  "subtitle": "Figure 6: Upward contribution from housing and household services (including energy) saw the annual CPIH inflation rate rise",
24
24
  "id": "id",
@@ -241,10 +241,10 @@
241
241
  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"
242
242
  />
243
243
  </svg>
244
- {%- elif params.iconType == "twitter" -%}
244
+ {%- elif params.iconType == "x" -%}
245
245
  <svg
246
246
  class="{% if params.iconSize %}ons-icon ons-icon--{{ params.iconSize }}{% else %}ons-icon{% endif %}{{ iconClasses }}"
247
- id="icon-twitter"
247
+ id="icon-x"
248
248
  viewBox="0 0 90.01 90.01"
249
249
  xmlns="http://www.w3.org/2000/svg"
250
250
  focusable="false"
@@ -649,6 +649,7 @@
649
649
  viewBox="0 0 115 96"
650
650
  focusable="false"
651
651
  role="img"
652
+ aria-hidden="true"
652
653
  >
653
654
  <title id="{{ params.altTextId | default ('crest-alt') }}">
654
655
  {{ params.altText | default ('Royal coat of arms of the United Kingdom') }}
@@ -835,7 +836,15 @@
835
836
  />
836
837
  </svg>
837
838
  {%- elif params.iconType == "census-logo" -%}
838
- <svg xmlns="http://www.w3.org/2000/svg" class="ons-icon--logo{{ iconClasses }}" width="152" height="16" viewBox="0 0 171 18">
839
+ <svg
840
+ xmlns="http://www.w3.org/2000/svg"
841
+ class="ons-icon--logo{{ iconClasses }}"
842
+ width="152"
843
+ height="16"
844
+ viewBox="0 0 171 18"
845
+ aria-hidden="true"
846
+ focusable="false"
847
+ >
839
848
  <title id="{{ params.altTextId | default ('census-logo-alt') }}">{{ params.altText | default ('Census 2021 Logo') }}</title>
840
849
  <path
841
850
  d="M22.9246 6.96226H31.8567C31.0755 5.26415 29.3774 4.09245 27.3906 4.09245C25.4038 4.09245 23.7057 5.26415 22.9246 6.96226ZM27.3906 18C22.4321 18 18.3906 13.9585 18.3906 9C18.3906 4.04151 22.4321 0 27.3906 0C32.3491 0 36.3906 4.04151 36.3906 9C36.3906 10.1208 35.4736 11.0377 34.3529 11.0377H22.9246C23.7057 12.7358 25.4038 13.9076 27.3906 13.9076C28.5114 13.9076 29.4284 14.8245 29.4284 15.9453C29.4284 17.083 28.5114 18 27.3906 18Z"
@@ -22,7 +22,7 @@ describe('macro: icon', () => {
22
22
  'search',
23
23
  'sort-sprite',
24
24
  'facebook',
25
- 'twitter',
25
+ 'x',
26
26
  'instagram',
27
27
  'linkedin',
28
28
  'loader',
@@ -80,7 +80,7 @@ describe('macro: icon', () => {
80
80
  'quote',
81
81
  'search',
82
82
  'facebook',
83
- 'twitter',
83
+ 'x',
84
84
  'instagram',
85
85
  'linkedin',
86
86
  ])('icon type: %s', (iconType) => {
@@ -9,8 +9,9 @@
9
9
  }
10
10
 
11
11
  &__caption {
12
+ @extend .ons-u-fs-s;
13
+
12
14
  display: block;
13
- font-size: 0.8rem;
14
15
  padding: 0.5rem 0 0;
15
16
  }
16
17
  }
@@ -7,8 +7,8 @@
7
7
  "itemsList": [
8
8
  {
9
9
  "url": '#0',
10
- "text": 'Twitter',
11
- "iconType": 'twitter',
10
+ "text": 'X',
11
+ "iconType": 'x',
12
12
  "attributes": {
13
13
  "rel": 'noreferrer external'
14
14
  }
@@ -7,8 +7,8 @@
7
7
  {% set firstPage = params.pages | first %}
8
8
  {% set prevPageIndex = currentPageIndex - 1 %}
9
9
  {% set nextPageIndex = currentPageIndex + 1 %}
10
- {% set prevPageAriaLabel = (params.previousAriaLabel or 'Go to the previous page') %}
11
- {% set nextPageAriaLabel = (params.nextAriaLabel or 'Go to the next page') %}
10
+ {% set prevPageAriaLabel = (params.previousAriaLabel or 'Previous page') %}
11
+ {% set nextPageAriaLabel = (params.nextAriaLabel or 'Next page') %}
12
12
 
13
13
  <nav
14
14
  class="ons-pagination{{ ' ' + params.classes if params.classes else '' }}{{ ' ons-pagination--no-indicator' if params.hideRangeIndicator }}"
@@ -41,7 +41,7 @@
41
41
  <a
42
42
  href="{{ firstPage.url }}"
43
43
  class="ons-pagination__link"
44
- aria-label="{{ params.firstAriaLabel | default('Go to the first page') }}"
44
+ aria-label="{{ params.firstAriaLabel | default('First page') }}"
45
45
  >1</a
46
46
  >
47
47
  </li>
@@ -63,9 +63,10 @@
63
63
  href="{{ page.url }}"
64
64
  class="ons-pagination__link"
65
65
  {%- if loop.index == currentPageIndex -%}
66
- aria-current="true" aria-label="{{ params.currentAriaLabel | default('Current page') }} ({{ position }})"
66
+ aria-current="true"
67
+ aria-label="{% if params.currentAriaLabel %}{{ params.currentAriaLabel }} ({{ position }}){% else %}{{ position }}{% endif %}"
67
68
  {%- else -%}
68
- aria-label="{{ params.goToAriaLabel | default('Go to page') }} {{ loop.index }}"
69
+ aria-label="{{ params.goToAriaLabel | default('Page') }} {{ loop.index }}"
69
70
  {%- endif -%}
70
71
  {%- if loop.index == currentPageIndex - 1 -%}
71
72
  rel="prev"
@@ -86,7 +87,7 @@
86
87
  <a
87
88
  href="{{ lastPage.url }}"
88
89
  class="ons-pagination__link"
89
- aria-label="{{ params.lastAriaLabel | default('Go to the last page') }} ({{ totalPages }})"
90
+ aria-label="{{ params.lastAriaLabel | default('Last page') }} ({{ totalPages }})"
90
91
  >{{ totalPages }}</a
91
92
  >
92
93
  </li>