@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
@@ -1,3 +1,5 @@
1
+ import DOMPurify from 'dompurify';
2
+
1
3
  let clearAlertAnnounced;
2
4
  export default class ClearRadios {
3
5
  constructor(inputs, button, otherInput) {
@@ -32,7 +34,7 @@ export default class ClearRadios {
32
34
  setClearAttributes() {
33
35
  this.button.classList.remove('ons-u-db-no-js_enabled');
34
36
  if (clearAlertAnnounced === false) {
35
- this.ariaElement.innerHTML = this.clearAlert;
37
+ this.ariaElement.innerHTML = DOMPurify.sanitize(this.clearAlert);
36
38
  clearAlertAnnounced = true;
37
39
  }
38
40
  }
@@ -49,7 +51,7 @@ export default class ClearRadios {
49
51
  }
50
52
 
51
53
  this.button.classList.add('ons-u-db-no-js_enabled');
52
- this.ariaElement.innerHTML = this.clearedAlert;
54
+ this.ariaElement.innerHTML = DOMPurify.sanitize(this.clearedAlert);
53
55
  clearAlertAnnounced = false;
54
56
  }
55
57
  }
@@ -1,3 +1,5 @@
1
+ import DOMPurify from 'dompurify';
2
+
1
3
  export default class Relationships {
2
4
  constructor(context) {
3
5
  this.context = context;
@@ -20,9 +22,9 @@ export default class Relationships {
20
22
  if (radio) {
21
23
  const title = radio.getAttribute('data-title');
22
24
 
23
- this.legend.innerHTML = title;
25
+ this.legend.innerHTML = DOMPurify.sanitize(title);
24
26
 
25
- this.playback.innerHTML = radio.getAttribute('data-playback');
27
+ this.playback.innerHTML = DOMPurify.sanitize(radio.getAttribute('data-playback'));
26
28
  }
27
29
  }
28
30
  }
@@ -1,3 +1,4 @@
1
+ import DOMPurify from 'dompurify';
1
2
  export default class Video {
2
3
  constructor(component) {
3
4
  this.component = component;
@@ -30,6 +31,7 @@ export default class Video {
30
31
  }
31
32
  addDNTtoVimeoVideos() {
32
33
  let src = this.iframe.getAttribute('data-src');
34
+ src = DOMPurify.sanitize(src);
33
35
  if (src.includes('player.vimeo.com/video') && src.includes('?dnt=1') === false) {
34
36
  src += '?dnt=1';
35
37
  return src;