@ons/design-system 70.0.16 → 72.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 (212) hide show
  1. package/README.md +10 -1
  2. package/components/access-code/_macro.njk +4 -4
  3. package/components/access-code/_macro.spec.js +10 -10
  4. package/components/access-code/example-access-code-error.njk +2 -2
  5. package/components/access-code/example-access-code.njk +2 -2
  6. package/components/accordion/_macro.njk +1 -1
  7. package/components/accordion/_macro.spec.js +162 -91
  8. package/components/accordion/_test_examples.js +13 -0
  9. package/components/address-input/_macro.njk +7 -7
  10. package/components/address-input/_macro.spec.js +16 -15
  11. package/components/address-input/autosuggest.address.error.js +1 -1
  12. package/components/address-input/autosuggest.address.js +25 -25
  13. package/components/address-input/autosuggest.address.spec.js +6 -5
  14. package/components/address-input/example-address-input-editable.njk +5 -4
  15. package/components/address-input/example-address-input.njk +4 -5
  16. package/components/autosuggest/_autosuggest.scss +8 -8
  17. package/components/autosuggest/_macro.njk +5 -5
  18. package/components/autosuggest/autosuggest.spec.js +1 -1
  19. package/components/back-to-top/_back-to-top.scss +2 -2
  20. package/components/back-to-top/_macro.spec.js +1 -1
  21. package/components/back-to-top/example-full-page-back-to-top.njk +6 -6
  22. package/components/breadcrumbs/_breadcrumbs.scss +1 -1
  23. package/components/breadcrumbs/_macro.spec.js +121 -115
  24. package/components/breadcrumbs/_test_examples.js +36 -0
  25. package/components/browser-banner/_macro.spec.js +1 -1
  26. package/components/button/_button.scss +24 -16
  27. package/components/button/_macro.njk +5 -5
  28. package/components/button/_macro.spec.js +2 -2
  29. package/components/button/example-button-custom.njk +1 -1
  30. package/components/card/_card.scss +0 -6
  31. package/components/card/_macro.njk +9 -9
  32. package/components/card/_macro.spec.js +57 -24
  33. package/components/card/example-card-set-with-images.njk +30 -18
  34. package/components/card/example-card-set-with-lists.njk +57 -45
  35. package/components/card/example-card-set.njk +27 -15
  36. package/components/card/example-card.njk +9 -5
  37. package/components/char-check-limit/_macro.njk +1 -1
  38. package/components/checkboxes/_checkbox.scss +4 -4
  39. package/components/checkboxes/_checkboxes.scss +1 -1
  40. package/components/checkboxes/example-checkboxes-with-hidden-label.njk +4 -4
  41. package/components/cookies-banner/_cookies-banner.scss +5 -5
  42. package/components/cookies-banner/_macro.njk +15 -13
  43. package/components/cookies-banner/_macro.spec.js +1 -1
  44. package/components/details/_details.scss +5 -6
  45. package/components/details/_macro.njk +4 -4
  46. package/components/details/_macro.spec.js +1 -1
  47. package/components/document-list/_document-list.scss +0 -2
  48. package/components/document-list/_macro.njk +18 -18
  49. package/components/document-list/_macro.spec.js +16 -14
  50. package/components/document-list/example-document-list-article-featured.njk +5 -3
  51. package/components/document-list/example-document-list-articles.njk +15 -9
  52. package/components/document-list/example-document-list-downloads.njk +15 -9
  53. package/components/document-list/example-document-list-search-result-featured.njk +5 -3
  54. package/components/document-list/example-document-list-search-results.njk +20 -12
  55. package/components/download-resources/_download-resources.scss +1 -2
  56. package/components/download-resources/download-resources.spec.js +12 -6
  57. package/components/external-link/_macro.njk +1 -1
  58. package/components/external-link/_macro.spec.js +1 -1
  59. package/components/external-link/example-external-link.njk +1 -1
  60. package/components/feedback/_macro.njk +1 -1
  61. package/components/feedback/_macro.spec.js +3 -3
  62. package/components/feedback/example-feedback-call-to-action.njk +1 -1
  63. package/components/field/_field-group.scss +0 -2
  64. package/components/field/_field.scss +1 -2
  65. package/components/fieldset/_fieldset.scss +2 -2
  66. package/components/fieldset/_macro.njk +1 -1
  67. package/components/fieldset/_macro.spec.js +1 -1
  68. package/components/footer/_footer.scss +12 -7
  69. package/components/footer/_macro.njk +54 -34
  70. package/components/footer/_macro.spec.js +90 -28
  71. package/components/footer/example-footer-cymraeg.njk +1 -1
  72. package/components/footer/example-footer-transactional.njk +1 -1
  73. package/components/footer/example-footer-warning.njk +1 -1
  74. package/components/footer/example-footer-with-alternative-organisation.njk +99 -94
  75. package/components/footer/example-footer-with-coat-of-arms.njk +1 -1
  76. package/components/footer/example-footer-with-copyright.njk +1 -1
  77. package/components/footer/example-footer-with-multiple-logos-and-split-display.njk +173 -0
  78. package/components/footer/example-footer-with-multiple-logos.njk +172 -0
  79. package/components/footer/example-footer.njk +1 -1
  80. package/components/header/_header.scss +7 -14
  81. package/components/header/_macro.njk +19 -19
  82. package/components/header/_macro.spec.js +18 -18
  83. package/components/header/example-header-external-for-surveys.njk +2 -2
  84. package/components/header/example-header-external-welsh.njk +2 -2
  85. package/components/header/example-header-external-with-sub-navigation-removed.njk +1 -1
  86. package/components/header/example-header-external-with-sub-navigation.njk +1 -1
  87. package/components/header/example-header-multiple-logos.njk +4 -4
  88. package/components/hero/_hero.scss +6 -8
  89. package/components/hero/_macro.njk +1 -1
  90. package/components/icon/_icon.scss +4 -4
  91. package/components/icon/_macro.njk +4 -4
  92. package/components/icon/_macro.spec.js +2 -2
  93. package/components/image/_image.scss +1 -1
  94. package/components/image/_macro.njk +1 -1
  95. package/components/image/_macro.spec.js +10 -10
  96. package/components/image/example-image-for-regular-screens.njk +1 -1
  97. package/components/input/_input-type.scss +0 -2
  98. package/components/input/_input.scss +10 -10
  99. package/components/input/_macro.njk +4 -2
  100. package/components/input/example-input-search-with-character-check.njk +1 -1
  101. package/components/input/example-input-search.njk +1 -1
  102. package/components/label/_label.scss +1 -3
  103. package/components/language-selector/_macro.njk +3 -3
  104. package/components/language-selector/_macro.spec.js +7 -7
  105. package/components/list/_list.scss +1 -5
  106. package/components/list/_macro.njk +9 -10
  107. package/components/list/_macro.spec.js +50 -9
  108. package/components/list/example-inline-list-with-social-icon-prefix.njk +1 -1
  109. package/components/message/_macro.njk +3 -3
  110. package/components/message/_macro.spec.js +3 -3
  111. package/components/message-list/_macro.njk +2 -2
  112. package/components/message-list/_macro.spec.js +8 -4
  113. package/components/message-list/_message-list.scss +2 -2
  114. package/components/navigation/_macro.njk +9 -9
  115. package/components/navigation/_macro.spec.js +2 -2
  116. package/components/navigation/_navigation.scss +2 -6
  117. package/components/navigation/navigation.dom.js +1 -1
  118. package/components/navigation/navigation.spec.js +4 -4
  119. package/components/pagination/_macro.njk +2 -2
  120. package/components/pagination/_pagination.scss +1 -7
  121. package/components/panel/_macro.njk +5 -4
  122. package/components/panel/_macro.spec.js +2 -2
  123. package/components/panel/_panel.scss +12 -8
  124. package/components/password/_macro.njk +1 -1
  125. package/components/password/_macro.spec.js +2 -2
  126. package/components/phase-banner/_macro.njk +1 -1
  127. package/components/phase-banner/_phase-banner.scss +3 -4
  128. package/components/phase-banner/example-phase-banner-alpha.njk +1 -1
  129. package/components/phase-banner/example-phase-banner-beta.njk +1 -1
  130. package/components/question/_macro.njk +8 -8
  131. package/components/question/_macro.spec.js +3 -3
  132. package/components/question/_question.scss +3 -3
  133. package/components/radios/_macro.njk +1 -1
  134. package/components/radios/_macro.spec.js +1 -1
  135. package/components/radios/_radios.scss +1 -1
  136. package/components/radios/example-radios-with-clear-button-expanded.njk +1 -1
  137. package/components/radios/example-radios-with-clear-button.njk +1 -1
  138. package/components/related-content/_macro.spec.js +2 -2
  139. package/components/related-content/_related-content.scss +1 -1
  140. package/components/related-content/example-related-content-general.njk +2 -2
  141. package/components/related-content/example-related-content-social-media.njk +1 -1
  142. package/components/reply/_macro.njk +3 -1
  143. package/components/reply/_macro.spec.js +1 -1
  144. package/components/reply/reply.spec.js +1 -1
  145. package/components/section-navigation/_macro.njk +10 -10
  146. package/components/section-navigation/_macro.spec.js +15 -15
  147. package/components/section-navigation/_section-navigation.scss +3 -8
  148. package/components/section-navigation/example-section-navigation-single-vertical-with-title.njk +3 -3
  149. package/components/section-navigation/example-section-navigation-vertical.njk +14 -14
  150. package/components/section-navigation/example-section-navigation.njk +3 -3
  151. package/components/select/example-select-with-inline-label.njk +1 -1
  152. package/components/share-page/_macro.njk +7 -7
  153. package/components/share-page/_macro.spec.js +2 -2
  154. package/components/share-page/example-share-page.njk +1 -1
  155. package/components/status/_status.scss +1 -1
  156. package/components/summary/_macro.njk +33 -33
  157. package/components/summary/_macro.spec.js +34 -34
  158. package/components/summary/_summary.scss +2 -4
  159. package/components/summary/example-summary-card-grouped.njk +34 -34
  160. package/components/summary/example-summary-grouped-total.njk +7 -7
  161. package/components/summary/example-summary-grouped-with-errors.njk +9 -9
  162. package/components/summary/example-summary-grouped.njk +34 -34
  163. package/components/summary/example-summary-household.njk +7 -7
  164. package/components/summary/example-summary-hub-minimal.njk +8 -8
  165. package/components/summary/example-summary-hub.njk +16 -16
  166. package/components/summary/example-summary-multiple.njk +7 -7
  167. package/components/summary/example-summary-no-action.njk +5 -5
  168. package/components/summary/example-summary.njk +9 -9
  169. package/components/table/_table.scss +2 -3
  170. package/components/table-of-contents/_macro.njk +3 -3
  171. package/components/table-of-contents/_macro.spec.js +3 -3
  172. package/components/table-of-contents/example-table-of-contents-sticky-full-page.njk +1 -1
  173. package/components/tabs/_macro.njk +3 -3
  174. package/components/tabs/_macro.spec.js +3 -3
  175. package/components/tabs/_tabs.scss +3 -4
  176. package/components/tabs/example-tabs-details.njk +1 -1
  177. package/components/text-indent/_text-indent.scss +1 -1
  178. package/components/text-indent/example-text-indent.njk +1 -1
  179. package/components/timeline/_macro.njk +4 -4
  180. package/components/timeline/_macro.spec.js +3 -3
  181. package/components/timeline/_timeline.scss +4 -3
  182. package/components/timeline/example-timeline.njk +1 -1
  183. package/components/upload/_upload.scss +2 -2
  184. package/components/video/_macro.njk +4 -4
  185. package/components/video/_macro.spec.js +2 -2
  186. package/components/video/_video.scss +1 -1
  187. package/components/video/example-video.njk +2 -2
  188. package/components/video/video.spec.js +2 -2
  189. package/css/main.css +1 -1
  190. package/layout/_dsTemplate.njk +1 -1
  191. package/layout/_template.njk +31 -31
  192. package/package.json +3 -2
  193. package/scripts/main.es5.js +1 -1
  194. package/scripts/main.js +1 -1
  195. package/scss/base/_global.scss +2 -0
  196. package/scss/base/_typography.scss +0 -2
  197. package/scss/main.scss +0 -1
  198. package/scss/objects/_container.scss +1 -1
  199. package/scss/objects/_page.scss +2 -3
  200. package/scss/overrides/rtl.scss +1 -1
  201. package/scss/utilities/_grid.scss +103 -96
  202. package/scss/utilities/_margin.scss +11 -5
  203. package/scss/utilities/_padding.scss +12 -5
  204. package/scss/utilities/_typography.scss +2 -1
  205. package/scss/vars/_forms.scss +8 -10
  206. package/scss/vars/_grid.scss +4 -4
  207. package/scss/vars/_typography.scss +26 -19
  208. package/components/call-to-action/_call-to-action.scss +0 -8
  209. package/components/call-to-action/_macro.njk +0 -24
  210. package/components/call-to-action/_macro.spec.js +0 -48
  211. package/components/call-to-action/example-call-to-action-default.njk +0 -15
  212. package/components/metadata/_macro.njk +0 -14
@@ -9,33 +9,33 @@
9
9
  "title": "Section Title",
10
10
  "itemsList": [
11
11
  {
12
- "title": "Section 1",
12
+ "text": "Section 1",
13
13
  "url": "#section-1",
14
14
  "anchors": [
15
15
  {
16
- "title": "Sub section 1",
16
+ "text": "Sub section 1",
17
17
  "url": "#sub-section-1"
18
18
  },
19
19
  {
20
- "title": "Sub section 2",
20
+ "text": "Sub section 2",
21
21
  "url": "#sub-section-2"
22
22
  },
23
23
  {
24
- "title": "Sub section 3",
24
+ "text": "Sub section 3",
25
25
  "url": "#sub-section-3"
26
26
  }
27
27
  ]
28
28
  },
29
29
  {
30
- "title": "Section 2",
30
+ "text": "Section 2",
31
31
  "url": "#section-2"
32
32
  },
33
33
  {
34
- "title": "Section 3",
34
+ "text": "Section 3",
35
35
  "url": "#section-3"
36
36
  },
37
37
  {
38
- "title": "Section 4",
38
+ "text": "Section 4",
39
39
  "url": "#section-4"
40
40
  }
41
41
  ]
@@ -44,33 +44,33 @@
44
44
  "title": "Section Title",
45
45
  "itemsList": [
46
46
  {
47
- "title": "Section 5",
47
+ "text": "Section 5",
48
48
  "url": "#section-5"
49
49
  },
50
50
  {
51
- "title": "Section 6",
51
+ "text": "Section 6",
52
52
  "url": "#section-6",
53
53
  "anchors": [
54
54
  {
55
- "title": "Sub section 1",
55
+ "text": "Sub section 1",
56
56
  "url": "#sub-section-1"
57
57
  },
58
58
  {
59
- "title": "Sub section 2",
59
+ "text": "Sub section 2",
60
60
  "url": "#sub-section-2"
61
61
  },
62
62
  {
63
- "title": "Sub section 3",
63
+ "text": "Sub section 3",
64
64
  "url": "#sub-section-3"
65
65
  }
66
66
  ]
67
67
  },
68
68
  {
69
- "title": "Section 7",
69
+ "text": "Section 7",
70
70
  "url": "#0"
71
71
  },
72
72
  {
73
- "title": "Section 8",
73
+ "text": "Section 8",
74
74
  "url": "#0"
75
75
  }
76
76
  ]
@@ -5,15 +5,15 @@
5
5
  "currentPath": "#section-1",
6
6
  "itemsList": [
7
7
  {
8
- "title": "Section 1",
8
+ "text": "Section 1",
9
9
  "url": "#section-1"
10
10
  },
11
11
  {
12
- "title": "Section 2",
12
+ "text": "Section 2",
13
13
  "url": "#0"
14
14
  },
15
15
  {
16
- "title": "Section 3",
16
+ "text": "Section 3",
17
17
  "url": "#0"
18
18
  }
19
19
  ]
@@ -3,7 +3,7 @@
3
3
  onsSelect({
4
4
  "id": "select-example-with-inline-label",
5
5
  "name": "select",
6
- "classes": "ons-u-wa--@xxs",
6
+ "classes": "ons-u-wa--@2xs",
7
7
  "label": {
8
8
  "text": "Sort by",
9
9
  "inline": true
@@ -2,18 +2,18 @@
2
2
  {% from "components/list/_macro.njk" import onsList %}
3
3
 
4
4
  {% if params.title %}
5
- {% set titleTag = params.titleTag | default("h2") %}
6
- {% set openingTag = "<" + titleTag %}
7
- {% set closingTag = "</" + titleTag + ">" %}
5
+ {% set titleTag = params.headingLevel | default(2) %}
6
+ {% set openingTag = "<h" ~ titleTag %}
7
+ {% set closingTag = "</h" ~ titleTag ~ ">" %}
8
8
  {{ openingTag | safe }}
9
- class="ons-u-fs-r--b ons-u-mb-xs">{{ params.title }}{{ closingTag | safe }}
9
+ class="ons-u-fs-r--b ons-u-mb-2xs">{{ params.title }}{{ closingTag | safe }}
10
10
  {% endif %}
11
11
 
12
12
  {% if params.facebook and params.facebook == true %}
13
13
  {%
14
14
  set facebook =
15
15
  {
16
- "url": 'https://www.facebook.com/sharer/sharer.php?u=' ~ params.pageURL|urlencode,
16
+ "url": 'https://www.facebook.com/sharer/sharer.php?u=' ~ params.pageUrl|urlencode,
17
17
  "text": 'Facebook',
18
18
  "iconType": 'facebook',
19
19
  "rel": 'noreferrer external',
@@ -25,7 +25,7 @@
25
25
  {%
26
26
  set twitter =
27
27
  {
28
- "url": 'https://twitter.com/intent/tweet?original_referer&text=' ~ params.pageTitle|urlencode ~ '&url=' ~ params.pageURL|urlencode,
28
+ "url": 'https://twitter.com/intent/tweet?original_referer&text=' ~ params.pageTitle|urlencode ~ '&url=' ~ params.pageUrl|urlencode,
29
29
  "text": 'Twitter',
30
30
  "iconType": 'twitter',
31
31
  "rel": 'noreferrer external',
@@ -37,7 +37,7 @@
37
37
  onsList({
38
38
  "variants": 'inline',
39
39
  "iconPosition": 'before',
40
- "iconSize": params.iconSize | default("xxl"),
40
+ "iconSize": params.iconSize | default("2xl"),
41
41
  "itemsList": [facebook, twitter]
42
42
  })
43
43
  }}
@@ -8,7 +8,7 @@ import { renderComponent, templateFaker } from '../../tests/helpers/rendering';
8
8
  const EXAMPLE_SHARE_PAGE = {
9
9
  title: 'Share page',
10
10
  pageTitle: 'An example page',
11
- pageURL: 'https://example.com/an-example-page',
11
+ pageUrl: 'https://example.com/an-example-page',
12
12
  facebook: true,
13
13
  twitter: true,
14
14
  };
@@ -31,7 +31,7 @@ describe('macro: share-page', () => {
31
31
  const $ = cheerio.load(
32
32
  renderComponent('share-page', {
33
33
  ...EXAMPLE_SHARE_PAGE,
34
- titleTag: 'h4',
34
+ headingLevel: 4,
35
35
  }),
36
36
  );
37
37
 
@@ -4,7 +4,7 @@
4
4
  onsSharePage({
5
5
  "title": 'Share this post',
6
6
  "pageTitle": 'A page to share',
7
- "pageURL": 'https://example.com/a-page-to-share',
7
+ "pageUrl": 'https://example.com/a-page-to-share',
8
8
  "facebook": true,
9
9
  "twitter": true
10
10
  })
@@ -17,7 +17,7 @@
17
17
  box-sizing: border-box;
18
18
  content: '';
19
19
  display: inline-block;
20
- margin-right: 0.391rem;
20
+ margin-right: 0.5rem;
21
21
  }
22
22
 
23
23
  /* Small status indicators for information dense situations */
@@ -15,17 +15,17 @@
15
15
 
16
16
  <div class="{{ className }}">
17
17
  {% for summary in params.summaries %}
18
- {% if summary.summaryTitle %}
19
- <h2 class="ons-summary__title ons-u-mb-m{{ ' ons-u-mt-m' if loop.index > 1 }}">{{ summary.summaryTitle }}</h2>
18
+ {% if summary.title %}
19
+ <h2 class="ons-summary__title ons-u-mb-l{{ ' ons-u-mt-l' if loop.index > 1 else "" }}">{{ summary.title }}</h2>
20
20
  {% set headingLevel = "3" %}
21
21
  {% endif %}
22
22
  {% for group in summary.groups %}
23
- <div {% if group.id %}id="{{ group.id }}"{{ ' ' }}{% endif %}class="ons-summary__group{{ variantClasses }}">
24
- {% if group.groupTitle %}
25
- {% set openingHeadingTag = "<h" + headingLevel %}
26
- {% set closingHeadingTag = "</h" + headingLevel + ">" %}
23
+ <div {% if group.id %}id="{{ group.id }}"{% endif %} class="ons-summary__group{{ variantClasses }}">
24
+ {% if group.title %}
25
+ {% set openingHeadingTag = "<h" ~ headingLevel %}
26
+ {% set closingHeadingTag = "</h" ~ headingLevel ~ ">" %}
27
27
  {{ openingHeadingTag | safe }}
28
- class="ons-summary__group-title">{{ group.groupTitle }}{{ closingHeadingTag | safe }}
28
+ class="ons-summary__group-title">{{ group.title }}{{ closingHeadingTag | safe }}
29
29
  {% endif %}
30
30
  {% if group.rows %}
31
31
  <dl class="ons-summary__items">
@@ -37,63 +37,63 @@
37
37
  {% if row.errorMessage %}
38
38
  <div class="ons-summary__row-title--error ons-u-fs-r">{{ row.errorMessage }}</div>
39
39
  {% endif %}
40
- {% if row.rowItems | length > 1 and row.rowTitle %}
40
+ {% if row.itemsList | length > 1 and row.title %}
41
41
  <div class="ons-summary__row-title ons-summary__row-title--no-group-title ons-u-fs-r">
42
- {{- row.rowTitle -}}
42
+ {{- row.title -}}
43
43
  </div>
44
44
  {% endif %}
45
45
 
46
- {% for rowItem in row.rowItems %}
46
+ {% for item in row.itemsList %}
47
47
  <div
48
- class="ons-summary__row{{ ' ons-summary__row--has-values' if rowItem.valueList }}"
49
- {% if rowItem.id %}id="{{ rowItem.id }}"{% endif %}
48
+ class="ons-summary__row{{ ' ons-summary__row--has-values' if item.valueList else "" }}"
49
+ {% if item.id %}id="{{ item.id }}"{% endif %}
50
50
  >
51
51
  <dt
52
52
  class="ons-summary__item-title"
53
- {% if rowItem.rowTitleAttributes %}{% for attribute, value in (rowItem.rowTitleAttributes.items() if rowItem.rowTitleAttributes is mapping and rowItem.rowTitleAttributes.items else rowItem.rowTitleAttributes) %}{{ ' ' }}{{ attribute }}="{{ value }}"{% endfor %}{% endif %}
53
+ {% if item.titleAttributes %}{% for attribute, value in (item.titleAttributes.items() if item.titleAttributes is mapping and item.titleAttributes.items else item.titleAttributes) %}{{ attribute }}="{{ value }}"{% endfor %}{% endif %}
54
54
  >
55
- {% if rowItem.iconType %}
55
+ {% if item.iconType %}
56
56
  {% from "components/icon/_macro.njk" import onsIcon %}
57
57
  <span
58
- class="ons-summary__item-title-icon{{ ' ons-summary__item-title-icon--check' if rowItem.iconType == 'check' }}"
58
+ class="ons-summary__item-title-icon{{ ' ons-summary__item-title-icon--check' if item.iconType == 'check' else "" }}"
59
59
  >
60
60
  {{-
61
61
  onsIcon({
62
- "iconType": rowItem.iconType
62
+ "iconType": item.iconType
63
63
  })
64
64
  -}}
65
- {% if rowItem.iconVisuallyHiddenText %}
66
- <span class="ons-u-vh">{{ rowItem.iconVisuallyHiddenText }}</span>
65
+ {% if item.iconVisuallyHiddenText %}
66
+ <span class="ons-u-vh">{{ item.iconVisuallyHiddenText }}</span>
67
67
  {% endif %}
68
68
  </span>
69
69
  {% endif %}
70
70
 
71
71
  <div
72
- class="ons-summary__item--text{{ ' ons-summary__item-title--text' if rowItem.iconType }}"
72
+ class="ons-summary__item--text{{ ' ons-summary__item-title--text' if item.iconType else "" }}"
73
73
  >
74
- {{- rowItem.rowTitle | default(row.rowTitle) | safe -}}
74
+ {{- item.title | default(row.title) | safe -}}
75
75
  </div>
76
76
 
77
77
  {# Render section status for mobile if is hub #}
78
- {% if variantHub and rowItem.valueList %}
79
- <span class="ons-u-d-no@m ons-u-fs-r"> — {{ rowItem.valueList[0].text | safe }}</span>
78
+ {% if variantHub and item.valueList %}
79
+ <span class="ons-u-d-no@m ons-u-fs-r"> — {{ item.valueList[0].text | safe }}</span>
80
80
  {% endif %}
81
81
  </dt>
82
- {% if rowItem.valueList %}
82
+ {% if item.valueList %}
83
83
  <dd
84
- class="ons-summary__values{{ ' ons-summary__values--2' if not rowItem.actions }}"
85
- {% if rowItem.attributes %}{% for attribute, value in (rowItem.attributes.items() if rowItem.attributes is mapping and rowItem.attributes.items else rowItem.attributes) %}{{ ' ' }}{{ attribute }}="{{ value }}"{% endfor %}{% endif %}
84
+ class="ons-summary__values{{ ' ons-summary__values--2' if not item.actions }}"
85
+ {% if item.attributes %}{% for attribute, value in (item.attributes.items() if item.attributes is mapping and item.attributes.items else item.attributes) %}{{ attribute }}="{{ value }}"{% endfor %}{% endif %}
86
86
  >
87
- {% if rowItem.valueList | length == 1 %}
88
- <span class="ons-summary__text">{{ rowItem.valueList[0].text | safe }}</span>
89
- {% if rowItem.valueList[0].other or rowItem.valueList[0].other == 0 %}
87
+ {% if item.valueList | length == 1 %}
88
+ <span class="ons-summary__text">{{ item.valueList[0].text | safe }}</span>
89
+ {% if item.valueList[0].other or item.valueList[0].other == 0 %}
90
90
  <ul class="ons-u-mb-no">
91
- <li>{{ rowItem.valueList[0].other | safe }}</li>
91
+ <li>{{ item.valueList[0].other | safe }}</li>
92
92
  </ul>
93
93
  {% endif %}
94
94
  {% else %}
95
95
  <ul class="ons-u-mb-no">
96
- {% for value in rowItem.valueList %}
96
+ {% for value in item.valueList %}
97
97
  <li>
98
98
  <span class="ons-summary__text">{{ value.text | safe }}</span>
99
99
  {% if value.other or value.other == 0 %}
@@ -107,9 +107,9 @@
107
107
  {% endif %}
108
108
  </dd>
109
109
  {% endif %}
110
- {% if rowItem.actions %}
110
+ {% if item.actions %}
111
111
  <dd class="ons-summary__actions">
112
- {% for action in rowItem.actions %}
112
+ {% for action in item.actions %}
113
113
  {% if loop.index > 1 %}<span class="ons-summary__spacer"></span>{% endif %}
114
114
  <a
115
115
  href="{{ action.url }}"
@@ -135,7 +135,7 @@
135
135
 
136
136
  {% if group.summaryLink %}
137
137
  <div
138
- class="ons-summary__link{{ ' ons-u-pt-s' if params.variant != 'card' and (group.placeholderText or group.rows) }}{{ ' ons-u-bt' if group.placeholderText is not defined and group.rows | length > 1 and params.variant != 'card' }}{{ ' ons-u-mb-xl' if not group.last }}"
138
+ class="ons-summary__link{{ ' ons-u-pt-s' if params.variant != 'card' and (group.placeholderText or group.rows) }}{{ ' ons-u-bt' if group.placeholderText is not defined and group.rows | length > 1 and params.variant != 'card' }}{{ ' ons-u-mb-3xl' if not group.last }}"
139
139
  >
140
140
  {% set link %}
141
141
  <a
@@ -8,12 +8,12 @@ import { renderComponent, templateFaker } from '../../tests/helpers/rendering';
8
8
  const EXAMPLE_SUMMARY_ROWS = {
9
9
  rows: [
10
10
  {
11
- // Contains - row with icon, attributes and rowTitleAttributes, other value, no action
11
+ // Contains - row with icon, attributes and titleAttributes, other value, no action
12
12
  id: 'row-id-1',
13
- rowTitle: 'row title 1',
14
- rowItems: [
13
+ title: 'row title 1',
14
+ itemsList: [
15
15
  {
16
- rowTitleAttributes: {
16
+ titleAttributes: {
17
17
  a: 123,
18
18
  b: 456,
19
19
  },
@@ -36,10 +36,10 @@ const EXAMPLE_SUMMARY_ROWS = {
36
36
  {
37
37
  // Contains - row with error and multiple actions
38
38
  id: 'row-id-2',
39
- rowTitle: 'row title 2',
39
+ title: 'row title 2',
40
40
  error: true,
41
41
  errorMessage: 'there are errors',
42
- rowItems: [
42
+ itemsList: [
43
43
  {
44
44
  id: 'item-id-2',
45
45
  valueList: [
@@ -69,8 +69,8 @@ const EXAMPLE_SUMMARY_ROWS = {
69
69
  {
70
70
  // Contains - row with multiple rows and multiple values
71
71
  id: 'row-id-3',
72
- rowTitle: 'row title 3',
73
- rowItems: [
72
+ title: 'row title 3',
73
+ itemsList: [
74
74
  {
75
75
  id: 'item-id-3',
76
76
  valueList: [
@@ -95,9 +95,9 @@ const EXAMPLE_SUMMARY_ROWS = {
95
95
  {
96
96
  // Contains - row with total
97
97
  id: 'row-id-4',
98
- rowTitle: 'row title 4',
98
+ title: 'row title 4',
99
99
  total: true,
100
- rowItems: [
100
+ itemsList: [
101
101
  {
102
102
  id: 'item-id-5',
103
103
  valueList: [
@@ -115,7 +115,7 @@ const EXAMPLE_SUMMARY_GROUPS = {
115
115
  groups: [
116
116
  {
117
117
  id: 'group-id-1',
118
- groupTitle: 'group title',
118
+ title: 'group title',
119
119
  ...EXAMPLE_SUMMARY_ROWS,
120
120
  },
121
121
  ],
@@ -139,9 +139,9 @@ const EXAMPLE_SUMMARY_GROUPS_NO_ROWS = {
139
139
  const EXAMPLE_SUMMARY_HOUSEHOLD_GROUP = {
140
140
  rows: [
141
141
  {
142
- rowItems: [
142
+ itemsList: [
143
143
  {
144
- rowTitle: 'row item 1',
144
+ title: 'row item 1',
145
145
  valueList: [
146
146
  {
147
147
  text: 'list item 1',
@@ -161,7 +161,7 @@ const EXAMPLE_SUMMARY_HOUSEHOLD_GROUP = {
161
161
  ],
162
162
  },
163
163
  {
164
- rowTitle: 'row item 2',
164
+ title: 'row item 2',
165
165
  valueList: [
166
166
  {
167
167
  text: 'list item 2',
@@ -176,7 +176,7 @@ const EXAMPLE_SUMMARY_HOUSEHOLD_GROUP = {
176
176
  ],
177
177
  },
178
178
  {
179
- rowTitle: 'row item 3',
179
+ title: 'row item 3',
180
180
  valueList: [
181
181
  {
182
182
  text: 'list item 3',
@@ -193,9 +193,9 @@ const EXAMPLE_SUMMARY_HOUSEHOLD_GROUP = {
193
193
  ],
194
194
  },
195
195
  {
196
- rowItems: [
196
+ itemsList: [
197
197
  {
198
- rowTitle: 'row item 4',
198
+ title: 'row item 4',
199
199
  valueList: [
200
200
  {
201
201
  text: 'list item 4',
@@ -215,7 +215,7 @@ const EXAMPLE_SUMMARY_HOUSEHOLD_GROUP = {
215
215
  ],
216
216
  },
217
217
  {
218
- rowTitle: 'row item 5',
218
+ title: 'row item 5',
219
219
  valueList: [
220
220
  {
221
221
  text: 'list item 5',
@@ -230,7 +230,7 @@ const EXAMPLE_SUMMARY_HOUSEHOLD_GROUP = {
230
230
  ],
231
231
  },
232
232
  {
233
- rowTitle: 'row item 6',
233
+ title: 'row item 6',
234
234
  valueList: [
235
235
  {
236
236
  text: 'list item 6',
@@ -264,7 +264,7 @@ const EXAMPLE_SUMMARY_BASIC = {
264
264
  const EXAMPLE_SUMMARY_WITH_TITLE = {
265
265
  summaries: [
266
266
  {
267
- summaryTitle: 'summary title',
267
+ title: 'summary title',
268
268
  ...EXAMPLE_SUMMARY_GROUPS,
269
269
  },
270
270
  ],
@@ -273,7 +273,7 @@ const EXAMPLE_SUMMARY_WITH_TITLE = {
273
273
  const EXAMPLE_SUMMARY_WITH_NO_ROWS = {
274
274
  summaries: [
275
275
  {
276
- summaryTitle: 'summary title',
276
+ title: 'summary title',
277
277
  ...EXAMPLE_SUMMARY_GROUPS_NO_ROWS,
278
278
  },
279
279
  ],
@@ -282,21 +282,21 @@ const EXAMPLE_SUMMARY_WITH_NO_ROWS = {
282
282
  const EXAMPLE_SUMMARY_MULTIPLE_GROUPS = {
283
283
  summaries: [
284
284
  {
285
- summaryTitle: 'summary title',
285
+ title: 'summary title',
286
286
  groups: [
287
287
  {
288
288
  id: 'group-id-1',
289
- groupTitle: 'group title',
289
+ title: 'group title',
290
290
  ...EXAMPLE_SUMMARY_ROWS,
291
291
  },
292
292
  {
293
293
  id: 'group-id-2',
294
- groupTitle: 'group title',
294
+ title: 'group title',
295
295
  ...EXAMPLE_SUMMARY_HOUSEHOLD_GROUP,
296
296
  },
297
297
  {
298
298
  id: 'group-id-3',
299
- groupTitle: 'group title',
299
+ title: 'group title',
300
300
  ...EXAMPLE_SUMMARY_ROWS,
301
301
  },
302
302
  ],
@@ -345,13 +345,13 @@ describe('macro: summary', () => {
345
345
  expect($('#group-id-1').length).toBe(1);
346
346
  });
347
347
 
348
- it('has the correct `groupTitle` tag', () => {
348
+ it('has the correct group `title` tag', () => {
349
349
  const $ = cheerio.load(renderComponent('summary', EXAMPLE_SUMMARY_BASIC));
350
350
 
351
351
  expect($('.ons-summary__group-title')[0].tagName).toBe('h2');
352
352
  });
353
353
 
354
- it('has the `groupTitle` text', () => {
354
+ it('has the group `title` text', () => {
355
355
  const $ = cheerio.load(renderComponent('summary', EXAMPLE_SUMMARY_BASIC));
356
356
 
357
357
  expect($('.ons-summary__group-title').text()).toBe('group title');
@@ -360,7 +360,7 @@ describe('macro: summary', () => {
360
360
  it('has larger margin between groups if the top one is a household style summary', () => {
361
361
  const $ = cheerio.load(renderComponent('summary', EXAMPLE_SUMMARY_MULTIPLE_GROUPS));
362
362
 
363
- expect($('.ons-summary__group:nth-last-of-type(2) .ons-summary__link').hasClass('ons-u-mb-xl')).toBe(true);
363
+ expect($('.ons-summary__group:nth-last-of-type(2) .ons-summary__link').hasClass('ons-u-mb-3xl')).toBe(true);
364
364
  });
365
365
  });
366
366
 
@@ -377,13 +377,13 @@ describe('macro: summary', () => {
377
377
  expect($('.ons-summary__items .ons-summary__item:nth-of-type(4)').hasClass('ons-summary__item--total')).toBe(true);
378
378
  });
379
379
 
380
- it('displays the `rowTitle` text', () => {
380
+ it('displays the row `title` text', () => {
381
381
  const $ = cheerio.load(renderComponent('summary', EXAMPLE_SUMMARY_BASIC));
382
382
 
383
383
  expect($('.ons-summary__items .ons-summary__item:nth-of-type(3) .ons-summary__row-title').text()).toBe('row title 3');
384
384
  });
385
385
 
386
- it('overrides the `rowTitle` with the `errorMessage` if provided', () => {
386
+ it('overrides the row `title` with the `errorMessage` if provided', () => {
387
387
  const $ = cheerio.load(renderComponent('summary', EXAMPLE_SUMMARY_WITH_TITLE));
388
388
 
389
389
  expect($('.ons-summary__items .ons-summary__item:nth-of-type(2) .ons-summary__row-title--error').text()).toBe(
@@ -405,7 +405,7 @@ describe('macro: summary', () => {
405
405
  expect($('.ons-summary__row--has-values').length).toBe(5);
406
406
  });
407
407
 
408
- it('has custom `rowTitleAttributes`', () => {
408
+ it('has custom row `titleAttributes`', () => {
409
409
  const $ = cheerio.load(renderComponent('summary', EXAMPLE_SUMMARY_BASIC));
410
410
 
411
411
  expect($('.ons-summary__item-title').attr('a')).toBe('123');
@@ -414,7 +414,7 @@ describe('macro: summary', () => {
414
414
  });
415
415
 
416
416
  describe('part: item title', () => {
417
- it('displays the `rowTitle` text', () => {
417
+ it('displays the row `title` text', () => {
418
418
  const $ = cheerio.load(renderComponent('summary', EXAMPLE_SUMMARY_BASIC));
419
419
 
420
420
  expect($('.ons-summary__items .ons-summary__item:nth-of-type(1) .ons-summary__item--text').text().trim()).toBe(
@@ -562,7 +562,7 @@ describe('macro: summary', () => {
562
562
  expect(results).toHaveNoViolations();
563
563
  });
564
564
 
565
- it('displays the `summaryTitle`', () => {
565
+ it('displays the summary `title`', () => {
566
566
  const $ = cheerio.load(renderComponent('summary', EXAMPLE_SUMMARY_WITH_TITLE));
567
567
 
568
568
  expect($('.ons-summary__title').text()).toBe('summary title');
@@ -593,7 +593,7 @@ describe('macro: summary', () => {
593
593
  expect($('.ons-summary').hasClass('ons-summary--hub')).toBe(true);
594
594
  });
595
595
 
596
- it('has the value rendered after the `rowTitle` that shows on mobile', () => {
596
+ it('has the value rendered after the row `title` that shows on mobile', () => {
597
597
  const $ = cheerio.load(
598
598
  renderComponent('summary', {
599
599
  ...EXAMPLE_SUMMARY_BASIC,
@@ -24,8 +24,6 @@ $hub-row-spacing: 1.3rem;
24
24
  }
25
25
 
26
26
  &__item {
27
- line-height: 1.4;
28
-
29
27
  &:not(:last-child),
30
28
  &:not(.ons-summary__group--card .ons-summary__item):nth-of-type(1) {
31
29
  border-bottom: 1px solid var(--ons-color-borders);
@@ -92,7 +90,7 @@ $hub-row-spacing: 1.3rem;
92
90
  background: var(--ons-color-black);
93
91
  display: inline-block;
94
92
  height: 1.15rem;
95
- margin: 0.18rem 0.25rem 0;
93
+ margin: 0.25rem 0.25rem 0;
96
94
  vertical-align: middle;
97
95
  width: 1px;
98
96
  }
@@ -148,7 +146,7 @@ $hub-row-spacing: 1.3rem;
148
146
  }
149
147
 
150
148
  // Breakpoints
151
- @include mq(xxs, m, none, '<') {
149
+ @include mq('2xs', m, none, '<') {
152
150
  &__item-title,
153
151
  &__values,
154
152
  &__actions {