@ons/design-system 72.10.8 → 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 (34) 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 +85 -0
  8. package/components/chart/_macro.njk +15 -2
  9. package/components/chart/_macro.spec.js +41 -11
  10. package/components/chart/bar-chart.js +8 -1
  11. package/components/chart/common-chart-options.js +9 -0
  12. package/components/chart/example-bar-chart-with-axis-min-and-max-values.njk +0 -1
  13. package/components/chart/example-bar-chart-with-point-range-and-reference-line-annotations.njk +4 -4
  14. package/components/chart/example-bar-chart.njk +0 -1
  15. package/components/chart/range-annotations-options.js +1 -1
  16. package/components/download-resources/download-resources.spec.js +2 -0
  17. package/components/hero/_hero.scss +17 -22
  18. package/components/hero/_macro.njk +1 -1
  19. package/components/hero/_macro.spec.js +1 -1
  20. package/components/hero/example-hero-dark-with-external-breadcrumbs.njk +194 -0
  21. package/components/hero/example-hero-default-with-external-breadcrumbs.njk +201 -0
  22. package/components/hero/example-hero-grey-with-external-breadcrumbs.njk +243 -0
  23. package/components/hero/example-hero-navy-blue-with-external-breadcrumbs.njk +200 -0
  24. package/components/hero/example-hero-pale-blue-with-external-breadcrumbs.njk +201 -0
  25. package/components/icon/_macro.njk +1 -1
  26. package/components/mutually-exclusive/mutually-exclusive.js +3 -1
  27. package/components/radios/clear-radios.js +4 -2
  28. package/components/relationships/relationships.js +4 -2
  29. package/components/video/video.js +2 -0
  30. package/css/main.css +1 -1
  31. package/js/timeout.js +9 -6
  32. package/package.json +4 -4
  33. package/scripts/main.es5.js +4 -2
  34. package/scripts/main.js +4 -2
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() {
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.8",
4
+ "version": "72.10.9",
5
5
  "main": "index.js",
6
6
  "license": "MIT",
7
7
  "author": {
@@ -82,7 +82,7 @@
82
82
  "eslint-config-prettier": "^9.0.0",
83
83
  "eslint-plugin-prettier": "^5.0.0",
84
84
  "eslint-plugin-unused-imports": "^3.1.0",
85
- "express": "^4.17.1",
85
+ "express": "^5.0.0",
86
86
  "front-matter": "^4.0.2",
87
87
  "fs-extra": "^11.1.1",
88
88
  "fuse.js": "^7.0.0",
@@ -100,7 +100,7 @@
100
100
  "jest": "^29.6.1",
101
101
  "jest-axe": "^8.0.0",
102
102
  "jest-environment-jsdom": "^29.6.1",
103
- "jest-puppeteer": "^10.0.0",
103
+ "jest-puppeteer": "^11.0.0",
104
104
  "jsdom": "^26.1.0",
105
105
  "lighthouse": "^11.0.0",
106
106
  "lint-staged": "^15.2.0",
@@ -114,7 +114,7 @@
114
114
  "prepend-file": "^2.0.1",
115
115
  "prettier": "^3.2.5",
116
116
  "prettier-plugin-jinja-template": "^1.4.0",
117
- "puppeteer": "^22.0.0",
117
+ "puppeteer": "^24.0.0",
118
118
  "remark-cli": "^12.0.0",
119
119
  "remark-lint": "^9.1.2",
120
120
  "remark-preset-lint-recommended": "^6.1.3",