@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
@@ -535,26 +535,6 @@ describe('macro: input', () => {
535
535
  });
536
536
 
537
537
  describe('search', () => {
538
- it('renders `search` component', () => {
539
- const faker = templateFaker();
540
- const searchSpy = faker.spy('search');
541
-
542
- faker.renderComponent('input', EXAMPLE_WITH_SEARCH);
543
-
544
- expect(searchSpy.occurrences[0]).toEqual({
545
- accessiblePlaceholder: true,
546
- searchButton: {
547
- type: 'button',
548
- text: 'Search for address',
549
- id: 'search-for-address',
550
- attributes: { a: 42 },
551
- classes: 'extra-search-button-class',
552
- iconType: 'search',
553
- visuallyHideButtonText: true,
554
- },
555
- });
556
- });
557
-
558
538
  it.each('outputs `type` attribute of "search"', () => {
559
539
  const $ = cheerio.load(renderComponent('input', EXAMPLE_WITH_SEARCH));
560
540
 
@@ -621,7 +601,7 @@ describe('macro: input', () => {
621
601
  it('has data attribute which references the character limit component', () => {
622
602
  const $ = cheerio.load(renderComponent('input', EXAMPLE_INPUT_WITH_CHARACTER_LIMIT));
623
603
 
624
- expect($('.ons-input').attr('data-char-check-ref')).toBe('example-id-check-remaining');
604
+ expect($('.ons-input').attr('data-char-check-ref')).toBe('example-id-check');
625
605
  });
626
606
 
627
607
  it('has data attribute which defines limit for character check', () => {
@@ -633,7 +613,7 @@ describe('macro: input', () => {
633
613
  it('has `aria-describedby` attribute which references the character limit component', () => {
634
614
  const $ = cheerio.load(renderComponent('input', EXAMPLE_INPUT_WITH_CHARACTER_LIMIT));
635
615
 
636
- expect($('.ons-input').attr('aria-describedby')).toBe('example-id-check-remaining');
616
+ expect($('.ons-input').attr('aria-describedby')).toBe('example-id-check');
637
617
  });
638
618
 
639
619
  it('renders character limit component', () => {
@@ -1,5 +1,4 @@
1
1
  {% from "components/input/_macro.njk" import onsInput %}
2
-
3
2
  {{
4
3
  onsInput({
5
4
  "id": 'search-field',
@@ -20,4 +19,4 @@
20
19
  "charCountOverLimitPlural": "{x} characters too many"
21
20
  }
22
21
  })
23
- }}
22
+ }}
@@ -1,5 +1,4 @@
1
1
  {% from "components/input/_macro.njk" import onsInput %}
2
-
3
2
  {{
4
3
  onsInput({
5
4
  "id": 'search-field',
@@ -13,4 +12,4 @@
13
12
  "iconType": 'search'
14
13
  }
15
14
  })
16
- }}
15
+ }}
@@ -1,5 +1,4 @@
1
1
  {% from "components/input/_macro.njk" import onsInput %}
2
-
3
2
  {{
4
3
  onsInput({
5
4
  "id": 'search-field',
@@ -13,4 +12,4 @@
13
12
  "iconType": 'search'
14
13
  }
15
14
  })
16
- }}
15
+ }}
@@ -7,6 +7,7 @@
7
7
  {# Resolves caller issue in Jinja: https://github.com/pallets/jinja/issues/371 #}
8
8
  {% set content = caller() %}
9
9
  {% set exclusiveOptionsLength = params.exclusiveOptions | length %}
10
+ {% set or = params.or | default("Or") %}
10
11
 
11
12
  {% call onsFieldset({
12
13
  "id": params.id,
@@ -26,7 +27,7 @@
26
27
  {% endif %}
27
28
  {% if exclusiveOptionsLength == 1 %}
28
29
  <p class="ons-checkboxes--mutually-exclusive__item ons-u-mt-s">
29
- <span class="ons-checkboxes__label ons-u-fs-r--b" aria-hidden="true">{{ params.or }}</span>
30
+ <span class="ons-checkboxes__label ons-u-fs-r--b" aria-hidden="true">{{ or }}</span>
30
31
  {{
31
32
  onsCheckbox({
32
33
  "id": params.exclusiveOptions[0].id,
@@ -38,7 +39,7 @@
38
39
  "deselectMessage": params.deselectMessage,
39
40
  "inputClasses": "ons-js-exclusive-option",
40
41
  "label": {
41
- "text": '<span class="ons-u-vh">' + params.or + ', </span> ' + params.exclusiveOptions[0].label.text,
42
+ "text": '<span class="ons-u-vh">' + or + ', </span> ' + params.exclusiveOptions[0].label.text,
42
43
  "description": params.exclusiveOptions[0].label.description
43
44
  }
44
45
  })
@@ -46,7 +47,7 @@
46
47
  </p>
47
48
  {% elif exclusiveOptionsLength > 1 %}
48
49
  <p class="ons-checkboxes--mutually-exclusive__item ons-u-mt-s">
49
- <span class="ons-checkboxes__label ons-u-fs-r--b" aria-hidden="true">{{ params.or }}</span>
50
+ <span class="ons-checkboxes__label ons-u-fs-r--b" aria-hidden="true">{{ or }}</span>
50
51
  {{
51
52
  onsRadios({
52
53
  "dontWrap": true,
@@ -63,7 +63,7 @@ describe('script: mutually-exclusive', () => {
63
63
  });
64
64
 
65
65
  it('then the characters remaining readout should be reset', async () => {
66
- const limitText = await page.$eval('#feedback-lim-remaining', node => node.textContent);
66
+ const limitText = await page.$eval('#feedback-lim', node => node.textContent);
67
67
  expect(limitText).toBe('You have 200 characters remaining');
68
68
  });
69
69
 
@@ -13,7 +13,7 @@
13
13
  {% if currentPageIndex != 1 %}
14
14
  {% set prevPageIndex = currentPageIndex - 2 %}
15
15
  <li class="ons-pagination__item ons-pagination__item--previous">
16
- <a href="{{ params.pages[prevPageIndex].url }}" class="ons-pagination__link" rel="prev" aria-label="Go to the previous page (Page {{ currentPageIndex - 1 }})">{{ params.previous }}</a>
16
+ <a href="{{ params.pages[prevPageIndex].url }}" class="ons-pagination__link" rel="prev" aria-label="Go to the previous page (Page {{ currentPageIndex - 1 }})">{{ params.previous | default("Previous") }}</a>
17
17
  </li>
18
18
  {% endif %}
19
19
  {% if currentPageIndex > 2 %}
@@ -60,7 +60,7 @@
60
60
  {% endif %}
61
61
  {% if totalPages > 1 and totalPages != currentPageIndex %}
62
62
  <li class="ons-pagination__item ons-pagination__item--next">
63
- <a href="{{ params.pages[currentPageIndex].url }}" class="ons-pagination__link" rel="next" aria-label="Go to the next page (Page {{ currentPageIndex + 1 }})">{{ params.next }}</a>
63
+ <a href="{{ params.pages[currentPageIndex].url }}" class="ons-pagination__link" rel="next" aria-label="Go to the next page (Page {{ currentPageIndex + 1 }})">{{ params.next | default("Next") }}</a>
64
64
  </li>
65
65
  {% endif %}
66
66
  </ul>
@@ -2,8 +2,6 @@
2
2
 
3
3
  {{
4
4
  onsPagination({
5
- "previous": "Previous",
6
- "next": "Next",
7
5
  "hideRangeIndicator": true,
8
6
  "currentPageNumber": 1,
9
7
  "pages": [
@@ -2,8 +2,6 @@
2
2
 
3
3
  {{
4
4
  onsPagination({
5
- "previous": "Previous",
6
- "next": "Next",
7
5
  "hideRangeIndicator": true,
8
6
  "currentPageNumber": 4,
9
7
  "pages": [
@@ -2,8 +2,6 @@
2
2
 
3
3
  {{
4
4
  onsPagination({
5
- "previous": "Previous",
6
- "next": "Next",
7
5
  "hideRangeIndicator": true,
8
6
  "currentPageNumber": 5,
9
7
  "pages": [
@@ -2,8 +2,6 @@
2
2
 
3
3
  {{
4
4
  onsPagination({
5
- "previous": "Previous",
6
- "next": "Next",
7
5
  "currentPageNumber": 5,
8
6
  "pages": [
9
7
  {
@@ -81,7 +81,7 @@
81
81
  </span>
82
82
  {% endif %}
83
83
 
84
- <div class="ons-panel__body{% if params.iconSize %} ons-svg-icon-margin--{{ params.iconSize }}{% endif %}">{{ (params.body if params else "") | safe }}
84
+ <div class="ons-panel__body{% if params.iconSize %} ons-icon-margin--{{ params.iconSize }}{% endif %}">{{ (params.body if params else "") | safe }}
85
85
  {{ caller() if caller }}
86
86
  </div>
87
87
  </div>
@@ -69,42 +69,42 @@
69
69
  margin-bottom: 0;
70
70
  }
71
71
 
72
- &.ons-svg-icon-margin--xxxl {
72
+ &.ons-icon-margin--xxxl {
73
73
  padding-left: 2.7rem !important;
74
74
 
75
75
  @include mq(m) {
76
76
  padding-left: 3.5rem !important;
77
77
  }
78
78
  }
79
- &.ons-svg-icon-margin--xxl {
79
+ &.ons-icon-margin--xxl {
80
80
  padding-left: 2.45rem !important;
81
81
 
82
82
  @include mq(m) {
83
83
  padding-left: 2.9rem !important;
84
84
  }
85
85
  }
86
- &.ons-svg-icon-margin--xl {
86
+ &.ons-icon-margin--xl {
87
87
  padding-left: 2.35rem !important;
88
88
 
89
89
  @include mq(m) {
90
90
  padding-left: 2.55rem !important;
91
91
  }
92
92
  }
93
- &.ons-svg-icon-margin--l {
93
+ &.ons-icon-margin--l {
94
94
  padding-left: 2.25rem !important;
95
95
 
96
96
  @include mq(m) {
97
97
  padding-left: 2.35rem !important;
98
98
  }
99
99
  }
100
- &.ons-svg-icon-margin--m {
100
+ &.ons-icon-margin--m {
101
101
  padding-left: 2.05rem !important;
102
102
 
103
103
  @include mq(m) {
104
104
  padding-left: 2.2rem !important;
105
105
  }
106
106
  }
107
- &.ons-svg-icon-margin--s {
107
+ &.ons-icon-margin--s {
108
108
  padding-left: 1.7rem !important;
109
109
  }
110
110
  }
@@ -216,7 +216,7 @@
216
216
  &__icon {
217
217
  left: 0;
218
218
  padding-left: 1rem;
219
- .ons-svg-icon {
219
+ .ons-icon {
220
220
  fill: var(--ons-color-success) !important;
221
221
  margin-top: -15% !important;
222
222
  }
@@ -24,7 +24,7 @@
24
24
  "inputClasses": "ons-js-password-toggle",
25
25
  "name": "show-password",
26
26
  "label": {
27
- "text": params.showPasswordText
27
+ "text": params.showPasswordText | default("Show password")
28
28
  }
29
29
  })
30
30
  }}
@@ -5,7 +5,6 @@
5
5
  "id": "password",
6
6
  "label": {
7
7
  "text": "Password"
8
- },
9
- "showPasswordText": "Show password"
8
+ }
10
9
  })
11
10
  }}
@@ -17,7 +17,7 @@
17
17
  position: relative;
18
18
  }
19
19
 
20
- .ons-svg-icon {
20
+ .ons-icon {
21
21
  fill: var(--ons-color-grey-75) !important;
22
22
  height: 1.85rem;
23
23
  left: 0;
@@ -2,7 +2,7 @@
2
2
  {% from "components/fieldset/_macro.njk" import onsFieldset %}
3
3
  {% from "components/button/_macro.njk" import onsButton %}
4
4
  {% from "components/label/_macro.njk" import onsLabel %}
5
-
5
+
6
6
  {% call onsFieldset({
7
7
  "id": params.id,
8
8
  "classes": params.classes,
@@ -22,7 +22,6 @@
22
22
  id="{{ params.id }}"
23
23
  name="{{ params.name }}"
24
24
  class="ons-input ons-input--select{% if params.classes %} {{ params.classes }}{% endif %}{% if params.error %} ons-input--error{% endif %}"
25
- {% if params.value %}value="{{ params.value}}" {% endif %}
26
25
  {% if params.attributes %}{% for attribute, value in (params.attributes.items() if params.attributes is mapping and params.attributes.items else params.attributes) %}{{ attribute }}{% if value %}="{{ value }}"{% endif %} {% endfor %}{% endif %}
27
26
  >
28
27
  {% for option in params.options %}
@@ -30,7 +29,7 @@
30
29
  {% if option.id %}id="{{ option.id }}" {% endif %}
31
30
  {% if option.selected %}selected {% endif %}
32
31
  {% if option.disabled %}disabled {% endif %}
33
- {% if params.attributes %}{% for attribute, value in option.attributes %}{{ attribute }}="{{ value }}"{% endfor %}{% endif %}
32
+ {% if option.attributes %}{% for attribute, value in option.attributes %}{{ attribute }}="{{ value }}"{% endfor %}{% endif %}
34
33
  >
35
34
  {{- option.text -}}
36
35
  </option>
@@ -1,3 +1,4 @@
1
1
  {% macro onsSkipToContent(params) %}
2
- <a class="ons-skip-link" href="{{ params.url }}">{{ params.text }}</a>
2
+ {% set text = params.text | default('Skip to content') %}
3
+ <a class="ons-skip-to-content" href="{{ params.url }}">{{ text }}</a>
3
4
  {% endmacro %}
@@ -26,7 +26,7 @@ describe('macro: skip-to-content', () => {
26
26
  }),
27
27
  );
28
28
 
29
- expect($('.ons-skip-link')[0].tagName).toBe('a');
29
+ expect($('.ons-skip-to-content')[0].tagName).toBe('a');
30
30
  });
31
31
 
32
32
  it('has skip link with the provided `url`', async () => {
@@ -37,7 +37,7 @@ describe('macro: skip-to-content', () => {
37
37
  }),
38
38
  );
39
39
 
40
- expect($('.ons-skip-link').attr('href')).toBe('#example-anchor');
40
+ expect($('.ons-skip-to-content').attr('href')).toBe('#example-anchor');
41
41
  });
42
42
 
43
43
  it('has skip link with the provided `text`', async () => {
@@ -49,9 +49,23 @@ describe('macro: skip-to-content', () => {
49
49
  );
50
50
 
51
51
  expect(
52
- $('.ons-skip-link')
52
+ $('.ons-skip-to-content')
53
53
  .text()
54
54
  .trim(),
55
55
  ).toBe('Skip to the content');
56
56
  });
57
+
58
+ it('has skip link with the default text if no text provided`', async () => {
59
+ const $ = cheerio.load(
60
+ renderComponent('skip-to-content', {
61
+ url: '#example-anchor',
62
+ }),
63
+ );
64
+
65
+ expect(
66
+ $('.ons-skip-to-content')
67
+ .text()
68
+ .trim(),
69
+ ).toBe('Skip to content');
70
+ });
57
71
  });
@@ -1,4 +1,4 @@
1
- .ons-skip-link {
1
+ .ons-skip-to-content {
2
2
  clip: rect(0 0 0 0);
3
3
  clip-path: inset(50%);
4
4
  display: block;
@@ -2,7 +2,7 @@ import domready from '../../js/domready';
2
2
  import skipToMain from './skip-to-content';
3
3
 
4
4
  async function initaliseSkipToLink() {
5
- const links = [...document.querySelectorAll('.ons-skip-link')];
5
+ const links = [...document.querySelectorAll('.ons-skip-to-content')];
6
6
  if (links.length) {
7
7
  links.forEach(link => {
8
8
  skipToMain(link);
@@ -15,7 +15,7 @@ describe('script: skip-to-content', () => {
15
15
  it('sets `tabIndex` of target element to -1', async () => {
16
16
  await setTestPage('/test', EXAMPLE_SKIP_TO_LINK_TEMPLATE);
17
17
 
18
- await page.focus('.ons-skip-link');
18
+ await page.focus('.ons-skip-to-content');
19
19
  await page.keyboard.press('Enter');
20
20
 
21
21
  const targetTabIndex = await page.$eval('#target-element', el => el.tabIndex);
@@ -25,7 +25,7 @@ describe('script: skip-to-content', () => {
25
25
  it('removes outline from target element on navigate', async () => {
26
26
  await setTestPage('/test', EXAMPLE_SKIP_TO_LINK_TEMPLATE);
27
27
 
28
- await page.focus('.ons-skip-link');
28
+ await page.focus('.ons-skip-to-content');
29
29
  await page.keyboard.press('Enter');
30
30
 
31
31
  const targetOutline = await page.$eval('#target-element', el => el.style.outline);
@@ -35,7 +35,7 @@ describe('script: skip-to-content', () => {
35
35
  it('focuses target element on navigate', async () => {
36
36
  await setTestPage('/test', EXAMPLE_SKIP_TO_LINK_TEMPLATE);
37
37
 
38
- await page.focus('.ons-skip-link');
38
+ await page.focus('.ons-skip-to-content');
39
39
  await page.keyboard.press('Enter');
40
40
 
41
41
  const focusedElementId = await page.evaluate(() => document.activeElement.id);
@@ -96,9 +96,8 @@
96
96
  <a
97
97
  href="{{ action.url }}"
98
98
  class="ons-summary__button"
99
- {% if action.ariaLabel %} aria-label="{{ action.ariaLabel }}"{% endif %}
100
99
  {% if action.attributes %}{% for attribute, value in (action.attributes.items() if action.attributes is mapping and action.attributes.items else action.attributes) %}{{attribute}}="{{value}}" {% endfor %}{% endif %}
101
- >{{ action.text }}</a>
100
+ >{{ action.text }}<span class="ons-u-vh">answer for {{ row.rowTitle }}</span></a>
102
101
  {% endfor %}
103
102
  </dd>
104
103
  {% endif %}
@@ -49,7 +49,6 @@ const EXAMPLE_SUMMARY_ROWS = {
49
49
  actions: [
50
50
  {
51
51
  text: 'Action 1',
52
- ariaLabel: 'action aria label 1',
53
52
  attributes: {
54
53
  a: 'abc',
55
54
  b: 'def',
@@ -58,7 +57,6 @@ const EXAMPLE_SUMMARY_ROWS = {
58
57
  },
59
58
  {
60
59
  text: 'Action 2',
61
- ariaLabel: 'action aria label 2',
62
60
  url: '#2',
63
61
  },
64
62
  ],
@@ -149,12 +147,10 @@ const EXAMPLE_SUMMARY_HOUSEHOLD_GROUP = {
149
147
  actions: [
150
148
  {
151
149
  text: 'Change',
152
- ariaLabel: 'Change list item',
153
150
  url: '#0',
154
151
  },
155
152
  {
156
153
  text: 'Remove',
157
- ariaLabel: 'Remove list item',
158
154
  url: '#0',
159
155
  },
160
156
  ],
@@ -169,7 +165,6 @@ const EXAMPLE_SUMMARY_HOUSEHOLD_GROUP = {
169
165
  actions: [
170
166
  {
171
167
  text: 'Change',
172
- ariaLabel: 'Remove list item',
173
168
  url: '#0',
174
169
  },
175
170
  ],
@@ -184,7 +179,6 @@ const EXAMPLE_SUMMARY_HOUSEHOLD_GROUP = {
184
179
  actions: [
185
180
  {
186
181
  text: 'Change',
187
- ariaLabel: 'Change list item',
188
182
  url: '#0',
189
183
  },
190
184
  ],
@@ -203,12 +197,10 @@ const EXAMPLE_SUMMARY_HOUSEHOLD_GROUP = {
203
197
  actions: [
204
198
  {
205
199
  text: 'Change',
206
- ariaLabel: 'Change answer',
207
200
  url: '#0',
208
201
  },
209
202
  {
210
203
  text: 'Remove',
211
- ariaLabel: 'Change list item',
212
204
  url: '#0',
213
205
  },
214
206
  ],
@@ -223,7 +215,6 @@ const EXAMPLE_SUMMARY_HOUSEHOLD_GROUP = {
223
215
  actions: [
224
216
  {
225
217
  text: 'Change',
226
- ariaLabel: 'Change list item',
227
218
  url: '#0',
228
219
  },
229
220
  ],
@@ -238,7 +229,6 @@ const EXAMPLE_SUMMARY_HOUSEHOLD_GROUP = {
238
229
  actions: [
239
230
  {
240
231
  text: 'Change',
241
- ariaLabel: 'Change list item',
242
232
  url: '#0',
243
233
  },
244
234
  ],
@@ -487,25 +477,20 @@ describe('macro: summary', () => {
487
477
 
488
478
  expect(
489
479
  $('.ons-summary__items .ons-summary__item:nth-of-type(2) .ons-summary__actions .ons-summary__button:first-child').text(),
490
- ).toBe('Action 1');
480
+ ).toBe('Action 1answer for row title 2');
491
481
  expect(
492
482
  $('.ons-summary__items .ons-summary__item:nth-of-type(2) .ons-summary__actions .ons-summary__button:last-child').text(),
493
- ).toBe('Action 2');
483
+ ).toBe('Action 2answer for row title 2');
494
484
  });
495
485
 
496
- it('has the `aria-label` provided', () => {
486
+ it('has the correct visually hidden <span> text', () => {
497
487
  const $ = cheerio.load(renderComponent('summary', EXAMPLE_SUMMARY_BASIC));
498
488
 
499
489
  expect(
500
- $('.ons-summary__items .ons-summary__item:nth-of-type(2) .ons-summary__actions .ons-summary__button:first-child').attr(
501
- 'aria-label',
502
- ),
503
- ).toBe('action aria label 1');
504
- expect(
505
- $('.ons-summary__items .ons-summary__item:nth-of-type(2) .ons-summary__actions .ons-summary__button:last-child').attr(
506
- 'aria-label',
507
- ),
508
- ).toBe('action aria label 2');
490
+ $(
491
+ '.ons-summary__items .ons-summary__item:nth-of-type(2) .ons-summary__actions .ons-summary__button:first-child .ons-u-vh',
492
+ ).text(),
493
+ ).toBe('answer for row title 2');
509
494
  });
510
495
 
511
496
  it('has custom `attributes`', () => {
@@ -80,7 +80,7 @@ $hub-row-spacing: 1.3rem;
80
80
  left: 0;
81
81
  position: absolute;
82
82
  text-align: center;
83
- &--check .ons-svg-icon {
83
+ &--check .ons-icon {
84
84
  fill: var(--ons-color-leaf-green) !important;
85
85
  }
86
86
  }
@@ -19,7 +19,6 @@
19
19
  "actions": [
20
20
  {
21
21
  "text": "Change",
22
- "ariaLabel": "Change answer",
23
22
  "url": "#0"
24
23
  }
25
24
  ]
@@ -38,7 +37,6 @@
38
37
  "actions": [
39
38
  {
40
39
  "text": "Change",
41
- "ariaLabel": "Change answer",
42
40
  "url": "#0"
43
41
  }
44
42
  ]
@@ -19,7 +19,6 @@
19
19
  "actions": [
20
20
  {
21
21
  "text": "Change",
22
- "ariaLabel": "Change answer",
23
22
  "url": "#0"
24
23
  }
25
24
  ]
@@ -40,7 +39,6 @@
40
39
  "actions": [
41
40
  {
42
41
  "text": "Change",
43
- "ariaLabel": "Change answer",
44
42
  "url": "#0"
45
43
  }
46
44
  ]
@@ -60,7 +58,6 @@
60
58
  "actions": [
61
59
  {
62
60
  "text": "Change",
63
- "ariaLabel": "Change answer",
64
61
  "url": "#0"
65
62
  }
66
63
  ]
@@ -80,7 +77,6 @@
80
77
  "actions": [
81
78
  {
82
79
  "text": "Change",
83
- "ariaLabel": "Change answer",
84
80
  "url": "#0"
85
81
  }
86
82
  ]