@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
@@ -61,7 +61,7 @@ a {
61
61
  color: var(--ons-color-text-link-hover);
62
62
  text-decoration: underline solid var(--ons-color-text-link-hover) 2px;
63
63
  }
64
- &:focus:not(.ons-btn--link):not(.ons-btn--ghost):not(.ons-js-clear-btn):not(.ons-download__thumbnail--link):not(.ons-tab--row):not(.ons-skip-link) {
64
+ &:focus:not(.ons-btn--link):not(.ons-btn--ghost):not(.ons-js-clear-btn):not(.ons-download__thumbnail--link):not(.ons-tab--row):not(.ons-skip-to-content) {
65
65
  @extend %a-focus;
66
66
  }
67
67
  }
package/scss/main.scss CHANGED
@@ -3,7 +3,7 @@
3
3
  @import 'helpers/index';
4
4
  @import 'base/index';
5
5
  @import 'objects/index';
6
- @import '../components/access-code/uac';
6
+ @import '../components/access-code/access-code';
7
7
  @import '../components/address-output/address-output';
8
8
  @import '../components/autosuggest/autosuggest';
9
9
  @import '../components/breadcrumbs/breadcrumbs';
@@ -47,7 +47,6 @@
47
47
  @import '../components/radios/radios';
48
48
  @import '../components/related-content/related-content';
49
49
  @import '../components/relationships/relationships';
50
- @import '../components/search/search';
51
50
  @import '../components/section-navigation/section-navigation';
52
51
  @import '../components/skip-to-content/skip';
53
52
  @import '../components/status/status';
@@ -2,11 +2,11 @@
2
2
  .ons-field-group +,
3
3
  .ons-fieldset +,
4
4
  .ons-input-items +,
5
- .ons-figure +,
5
+ .ons-image +,
6
6
  .ons-panel +,
7
7
  .ons-summary__group +,
8
8
  .ons-details:not(.ons-details--accordion) + {
9
- .ons-figure,
9
+ .ons-image,
10
10
  .ons-panel,
11
11
  .ons-field,
12
12
  .ons-field-group,
@@ -17,6 +17,6 @@
17
17
  }
18
18
  }
19
19
 
20
- .ons-breadcrumb + .ons-grid {
20
+ .ons-breadcrumbs + .ons-grid {
21
21
  margin-top: -1rem;
22
22
  }
@@ -3,7 +3,7 @@
3
3
  // Brightness makes all images black, except transparent parts, which remain transparent
4
4
  // Then, invert(1) makes the black parts white
5
5
  .ons-footer__ogl-img,
6
- .ons-quote .ons-svg-icon,
6
+ .ons-quote .ons-icon,
7
7
  .ons-footer img {
8
8
  filter: brightness(0) invert(1);
9
9
  }
@@ -36,7 +36,7 @@
36
36
  // Select - Overrides custom background image icon
37
37
  .ons-input--select {
38
38
  background: var(--ons-color-input-bg)
39
- url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='ons-svg-icon' viewBox='0 0 12 8'%3E%3Cpath fill='%23fff' d='M1.5.3 6 5.4 10.5.3c.2-.2.4-.2.6 0l.7.7c.1.2.1.4 0 .5L6.3 7.7c-.2.2-.4.2-.6 0L.2 1.6C.1 1.4.1 1.2.2 1L.9.3c.2-.1.4-.1.6 0z'/%3E%3C/svg%3E")
39
+ url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='ons-icon' viewBox='0 0 12 8'%3E%3Cpath fill='%23fff' d='M1.5.3 6 5.4 10.5.3c.2-.2.4-.2.6 0l.7.7c.1.2.1.4 0 .5L6.3 7.7c-.2.2-.4.2-.6 0L.2 1.6C.1 1.4.1 1.2.2 1L.9.3c.2-.1.4-.1.6 0z'/%3E%3C/svg%3E")
40
40
  no-repeat center right 10px;
41
41
  background-size: 1rem;
42
42
  }
@@ -48,12 +48,12 @@
48
48
 
49
49
  // Element icons – matches icon with the link colour
50
50
  .ons-details,
51
- .ons-breadcrumb__item,
51
+ .ons-breadcrumbs__item,
52
52
  .ons-panel,
53
53
  .ons-btn__inner,
54
54
  .ons-external-link,
55
55
  .ons-list--icons {
56
- & .ons-svg-icon {
56
+ & .ons-icon {
57
57
  fill: currentColor !important;
58
58
  forced-color-adjust: auto;
59
59
  }
@@ -63,7 +63,7 @@
63
63
  .ons-header__org-logo,
64
64
  .ons-header__title-logo,
65
65
  .ons-footer {
66
- & .ons-svg-logo {
66
+ & .ons-icon--logo {
67
67
  fill: currentColor !important;
68
68
  forced-color-adjust: auto;
69
69
  }
@@ -115,7 +115,7 @@
115
115
  }
116
116
 
117
117
  // Add borders to separate banners with no backgrounds
118
- .ons-skip-link,
118
+ .ons-skip-to-content,
119
119
  .ons-browser-banner,
120
120
  .ons-cookies-banner,
121
121
  .ons-header,
@@ -63,7 +63,7 @@
63
63
 
64
64
  // Buttons
65
65
  .ons-btn {
66
- .ons-svg-icon {
66
+ .ons-icon {
67
67
  margin: 0 0.5rem 0.1rem 0;
68
68
  transform: rotate(180deg);
69
69
  }
@@ -83,7 +83,7 @@
83
83
  margin: 0 2rem 0 0;
84
84
  }
85
85
 
86
- .ons-svg-icon {
86
+ .ons-icon {
87
87
  transform: rotate(180deg);
88
88
  }
89
89
  }
package/scss/print.scss CHANGED
@@ -4,7 +4,7 @@
4
4
  .ons-footer,
5
5
  .ons-cookies-banner,
6
6
  .ons-language-links,
7
- .ons-breadcrumb,
7
+ .ons-breadcrumbs,
8
8
  .ons-u-ph {
9
9
  display: none !important;
10
10
  }
@@ -1,11 +0,0 @@
1
- import domready from '../../js/domready';
2
-
3
- domready(async () => {
4
- const uacInputs = [...document.querySelectorAll('.ons-js-uac')];
5
-
6
- if (uacInputs.length) {
7
- const UAC = (await import('./uac')).default;
8
-
9
- uacInputs.forEach(element => new UAC(element));
10
- }
11
- });
@@ -1,30 +0,0 @@
1
- {% macro onsSearch(params) %}
2
- {% from "components/button/_macro.njk" import onsButton %}
3
-
4
- {% set content = caller() %}
5
-
6
- <div class="ons-search-component">
7
- {{ content | safe }}
8
-
9
- {%- set buttonLabel -%}
10
- {%- if params.searchButton.visuallyHideButtonText == true -%}
11
- <span class="ons-u-vh">{{ params.searchButton.text }}</span>
12
- {%- else -%}
13
- {{ params.searchButton.text }}
14
- {%- endif -%}
15
- {%- endset -%}
16
-
17
- {{
18
- onsButton({
19
- "type": params.searchButton.type,
20
- "html": buttonLabel,
21
- "id": params.searchButton.id,
22
- "variants": 'small',
23
- "classes": 'ons-search__btn' + (" " + params.searchButton.classes if params.searchButton.classes else ""),
24
- "attributes": params.searchButton.attributes,
25
- "iconType": params.searchButton.iconType,
26
- "iconPosition": 'only' if params.searchButton.visuallyHideButtonText == true else 'before'
27
- })
28
- }}
29
- </div>
30
- {% endmacro %}
@@ -1,69 +0,0 @@
1
- /** @jest-environment jsdom */
2
-
3
- import * as cheerio from 'cheerio';
4
-
5
- import { renderComponent, templateFaker } from '../../tests/helpers/rendering';
6
-
7
- const EXAMPLE_SEARCH = {
8
- searchButton: {
9
- id: 'search-button-id',
10
- type: 'button',
11
- text: 'Search for address',
12
- iconType: 'search',
13
- classes: 'extra-search-button-class',
14
- attributes: { a: 42 },
15
- },
16
- };
17
-
18
- const FAKE_NESTED_CONTENT = '<span class="test--nested">Nested content...</span>';
19
-
20
- describe('macro: search', () => {
21
- it('renders expected nested content', () => {
22
- const $ = cheerio.load(renderComponent('search', EXAMPLE_SEARCH, FAKE_NESTED_CONTENT));
23
-
24
- expect($('.ons-search-component .test--nested').text()).toBe('Nested content...');
25
- });
26
-
27
- it('renders button component', () => {
28
- const faker = templateFaker();
29
- const buttonSpy = faker.spy('button');
30
-
31
- faker.renderComponent('input', EXAMPLE_SEARCH);
32
-
33
- expect(buttonSpy.occurrences[0]).toEqual({
34
- id: 'search-button-id',
35
- type: 'button',
36
- html: 'Search for address',
37
- variants: 'small',
38
- classes: 'ons-search__btn extra-search-button-class',
39
- attributes: EXAMPLE_SEARCH.searchButton.attributes,
40
- iconType: 'search',
41
- iconPosition: 'before',
42
- });
43
- });
44
-
45
- it('renders button component with a visibly hidden label when specified', () => {
46
- const faker = templateFaker();
47
- const buttonSpy = faker.spy('button');
48
-
49
- faker.renderComponent('input', {
50
- searchButton: {
51
- id: 'search-button-id',
52
- type: 'button',
53
- text: 'Search for address',
54
- iconType: 'search',
55
- visuallyHideButtonText: true,
56
- },
57
- });
58
-
59
- expect(buttonSpy.occurrences[0]).toEqual({
60
- id: 'search-button-id',
61
- type: 'button',
62
- html: '<span class="ons-u-vh">Search for address</span>',
63
- variants: 'small',
64
- classes: 'ons-search__btn',
65
- iconPosition: 'only',
66
- iconType: 'search',
67
- });
68
- });
69
- });
@@ -1,9 +0,0 @@
1
- .ons-search-component {
2
- display: flex;
3
- flex-flow: row wrap;
4
- gap: 0.5rem;
5
-
6
- @include mq(s) {
7
- flex-flow: row nowrap !important;
8
- }
9
- }