@ons/design-system 72.10.7 → 72.10.9

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 (45) hide show
  1. package/components/accordion/accordion.js +3 -2
  2. package/components/autosuggest/autosuggest.spec.js +2 -0
  3. package/components/autosuggest/autosuggest.ui.js +12 -7
  4. package/components/breadcrumbs/_breadcrumbs.scss +53 -0
  5. package/components/breadcrumbs/_macro.njk +33 -24
  6. package/components/breadcrumbs/_macro.spec.js +25 -0
  7. package/components/chart/_chart.scss +91 -0
  8. package/components/chart/_macro.njk +38 -7
  9. package/components/chart/_macro.spec.js +102 -13
  10. package/components/chart/bar-chart.js +9 -1
  11. package/components/chart/chart-iframe-resize.js +1 -1
  12. package/components/chart/chart.dom.js +5 -3
  13. package/components/chart/chart.js +8 -2
  14. package/components/chart/common-chart-options.js +9 -0
  15. package/components/chart/example-area-chart.njk +2 -1
  16. package/components/chart/example-bar-chart-with-axis-min-and-max-values.njk +0 -1
  17. package/components/chart/example-bar-chart-with-point-range-and-reference-line-annotations.njk +4 -4
  18. package/components/chart/example-bar-chart.njk +0 -1
  19. package/components/chart/example-iframe-chart.njk +2 -1
  20. package/components/chart/example-line-chart.njk +2 -1
  21. package/components/chart/range-annotations-options.js +1 -1
  22. package/components/download-resources/download-resources.spec.js +2 -0
  23. package/components/hero/_hero.scss +17 -22
  24. package/components/hero/_macro.njk +1 -1
  25. package/components/hero/_macro.spec.js +1 -1
  26. package/components/hero/example-hero-dark-with-external-breadcrumbs.njk +194 -0
  27. package/components/hero/example-hero-default-with-external-breadcrumbs.njk +201 -0
  28. package/components/hero/example-hero-grey-with-external-breadcrumbs.njk +243 -0
  29. package/components/hero/example-hero-navy-blue-with-external-breadcrumbs.njk +200 -0
  30. package/components/hero/example-hero-pale-blue-with-external-breadcrumbs.njk +201 -0
  31. package/components/icon/_macro.njk +1 -1
  32. package/components/mutually-exclusive/mutually-exclusive.js +3 -1
  33. package/components/radios/clear-radios.js +4 -2
  34. package/components/relationships/relationships.js +4 -2
  35. package/components/tabs/tabs.js +2 -2
  36. package/components/video/video.js +2 -0
  37. package/css/main.css +1 -1
  38. package/img/small/area-chart-screenshot.png +0 -0
  39. package/img/small/line-chart-screenshot.png +0 -0
  40. package/js/timeout.js +9 -6
  41. package/layout/_template.njk +4 -1
  42. package/package.json +7 -5
  43. package/scripts/main.es5.js +4 -2
  44. package/scripts/main.js +4 -2
  45. package/scss/objects/_page.scss +1 -1
package/js/timeout.js CHANGED
@@ -1,3 +1,5 @@
1
+ import DOMPurify from 'dompurify';
2
+
1
3
  export default class Timeout {
2
4
  constructor(context, sessionExpiryEndpoint, initialExpiryTime, enableTimeoutReset, startOnLoad) {
3
5
  this.context = context;
@@ -77,23 +79,23 @@ export default class Timeout {
77
79
  ($this.endWithFullStop ? '.' : '');
78
80
 
79
81
  if (timerExpired) {
80
- $this.countdown.innerHTML = '<span class="ons-u-fw-b">' + $this.countdownExpiredText + '</span>';
81
- $this.accessibleCountdown.innerHTML = $this.countdownExpiredText;
82
+ $this.countdown.innerHTML = DOMPurify.sanitize('<span class="ons-u-fw-b">' + $this.countdownExpiredText + '</span>');
83
+ $this.accessibleCountdown.innerHTML = DOMPurify.sanitize($this.countdownExpiredText);
82
84
  setTimeout($this.redirect.bind($this), 2000);
83
85
  } else {
84
86
  seconds--;
85
87
  $this.expiryTimeInMilliseconds = seconds * 1000;
86
- $this.countdown.innerHTML = timeLeftText;
88
+ $this.countdown.innerHTML = DOMPurify.sanitize(timeLeftText);
87
89
 
88
90
  if (minutesLeft < 1 && secondsLeft < 20) {
89
91
  $this.accessibleCountdown.setAttribute('aria-live', 'assertive');
90
92
  }
91
93
 
92
94
  if (!$this.timerRunOnce) {
93
- $this.accessibleCountdown.innerHTML = timeLeftText;
95
+ $this.accessibleCountdown.innerHTML = DOMPurify.sanitize(timeLeftText);
94
96
  $this.timerRunOnce = true;
95
97
  } else if (secondsLeft % 15 === 0) {
96
- $this.accessibleCountdown.innerHTML = timeLeftText;
98
+ $this.accessibleCountdown.innerHTML = DOMPurify.sanitize(timeLeftText);
97
99
  }
98
100
 
99
101
  timers.push(setTimeout(runTimer.bind($this), 1000));
@@ -165,7 +167,8 @@ export default class Timeout {
165
167
  }
166
168
 
167
169
  redirect() {
168
- window.location.replace(this.timeOutRedirectUrl);
170
+ const sanitizedUrl = DOMPurify.sanitize(this.timeOutRedirectUrl);
171
+ window.location.replace(sanitizedUrl);
169
172
  }
170
173
 
171
174
  clearTimers() {
@@ -167,7 +167,10 @@
167
167
  "title": pageConfig.header.title | default(pageConfig.title),
168
168
  "description": pageConfig.header.description,
169
169
  "titleAsH1": pageConfig.header.titleAsH1,
170
- "titleLogo": pageConfig.header.titleLogo
170
+ "titleLogo": pageConfig.header.titleLogo,
171
+ "mastheadLogoAltText": pageConfig.header.mastheadLogoAltText,
172
+ "menuLinks": pageConfig.header.menuLinks,
173
+ "searchLinks": pageConfig.header.searchLinks
171
174
  })
172
175
  }}
173
176
  {% endblock %}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ons/design-system",
3
3
  "description": "ONS Design System built CSS, JS, and Nunjucks templates",
4
- "version": "72.10.7",
4
+ "version": "72.10.9",
5
5
  "main": "index.js",
6
6
  "license": "MIT",
7
7
  "author": {
@@ -69,19 +69,20 @@
69
69
  "babel-plugin-istanbul": "^7.0.0",
70
70
  "babelify": "^10.0.0",
71
71
  "backstopjs": "^6.1.4",
72
- "browser-sync": "^2.27.3",
72
+ "browser-sync": "^3.0.4",
73
73
  "browserify": "^17.0.1",
74
74
  "chalk": "^4.1.2",
75
75
  "cheerio": "^1.0.0-rc.10",
76
76
  "core-js": "^3.21.1",
77
77
  "cors": "^2.8.5",
78
78
  "dialog-polyfill": "^0.5.6",
79
+ "dompurify": "^3.2.6",
79
80
  "eslint": "^8.45.0",
80
81
  "eslint-cli": "^1.1.1",
81
82
  "eslint-config-prettier": "^9.0.0",
82
83
  "eslint-plugin-prettier": "^5.0.0",
83
84
  "eslint-plugin-unused-imports": "^3.1.0",
84
- "express": "^4.17.1",
85
+ "express": "^5.0.0",
85
86
  "front-matter": "^4.0.2",
86
87
  "fs-extra": "^11.1.1",
87
88
  "fuse.js": "^7.0.0",
@@ -99,7 +100,8 @@
99
100
  "jest": "^29.6.1",
100
101
  "jest-axe": "^8.0.0",
101
102
  "jest-environment-jsdom": "^29.6.1",
102
- "jest-puppeteer": "^10.0.0",
103
+ "jest-puppeteer": "^11.0.0",
104
+ "jsdom": "^26.1.0",
103
105
  "lighthouse": "^11.0.0",
104
106
  "lint-staged": "^15.2.0",
105
107
  "lodash": "^4.17.21",
@@ -112,7 +114,7 @@
112
114
  "prepend-file": "^2.0.1",
113
115
  "prettier": "^3.2.5",
114
116
  "prettier-plugin-jinja-template": "^1.4.0",
115
- "puppeteer": "^22.0.0",
117
+ "puppeteer": "^24.0.0",
116
118
  "remark-cli": "^12.0.0",
117
119
  "remark-lint": "^9.1.2",
118
120
  "remark-preset-lint-recommended": "^6.1.3",