@ons/design-system 70.0.17 → 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 (204) hide show
  1. package/components/access-code/_macro.njk +4 -4
  2. package/components/access-code/_macro.spec.js +8 -8
  3. package/components/access-code/example-access-code-error.njk +2 -2
  4. package/components/access-code/example-access-code.njk +2 -2
  5. package/components/accordion/_macro.njk +1 -1
  6. package/components/accordion/_macro.spec.js +1 -1
  7. package/components/address-input/_macro.njk +7 -7
  8. package/components/address-input/_macro.spec.js +16 -15
  9. package/components/address-input/autosuggest.address.error.js +1 -1
  10. package/components/address-input/autosuggest.address.js +25 -25
  11. package/components/address-input/autosuggest.address.spec.js +6 -5
  12. package/components/address-input/example-address-input-editable.njk +5 -4
  13. package/components/address-input/example-address-input.njk +4 -5
  14. package/components/autosuggest/_autosuggest.scss +8 -8
  15. package/components/autosuggest/_macro.njk +5 -5
  16. package/components/autosuggest/autosuggest.spec.js +1 -1
  17. package/components/back-to-top/_back-to-top.scss +2 -2
  18. package/components/back-to-top/example-full-page-back-to-top.njk +6 -6
  19. package/components/breadcrumbs/_breadcrumbs.scss +1 -1
  20. package/components/button/_button.scss +24 -16
  21. package/components/button/_macro.njk +3 -3
  22. package/components/button/example-button-custom.njk +1 -1
  23. package/components/card/_card.scss +0 -6
  24. package/components/card/_macro.njk +9 -9
  25. package/components/card/_macro.spec.js +57 -24
  26. package/components/card/example-card-set-with-images.njk +30 -18
  27. package/components/card/example-card-set-with-lists.njk +57 -45
  28. package/components/card/example-card-set.njk +27 -15
  29. package/components/card/example-card.njk +9 -5
  30. package/components/char-check-limit/_macro.njk +1 -1
  31. package/components/checkboxes/_checkbox.scss +4 -4
  32. package/components/checkboxes/_checkboxes.scss +1 -1
  33. package/components/checkboxes/example-checkboxes-with-hidden-label.njk +4 -4
  34. package/components/cookies-banner/_cookies-banner.scss +5 -5
  35. package/components/cookies-banner/_macro.njk +15 -13
  36. package/components/cookies-banner/_macro.spec.js +1 -1
  37. package/components/details/_details.scss +5 -6
  38. package/components/details/_macro.njk +4 -4
  39. package/components/details/_macro.spec.js +1 -1
  40. package/components/document-list/_document-list.scss +0 -2
  41. package/components/document-list/_macro.njk +18 -18
  42. package/components/document-list/_macro.spec.js +16 -14
  43. package/components/document-list/example-document-list-article-featured.njk +5 -3
  44. package/components/document-list/example-document-list-articles.njk +15 -9
  45. package/components/document-list/example-document-list-downloads.njk +15 -9
  46. package/components/document-list/example-document-list-search-result-featured.njk +5 -3
  47. package/components/document-list/example-document-list-search-results.njk +20 -12
  48. package/components/download-resources/_download-resources.scss +1 -2
  49. package/components/download-resources/download-resources.spec.js +12 -6
  50. package/components/external-link/_macro.njk +1 -1
  51. package/components/external-link/_macro.spec.js +1 -1
  52. package/components/external-link/example-external-link.njk +1 -1
  53. package/components/feedback/_macro.njk +1 -1
  54. package/components/feedback/_macro.spec.js +3 -3
  55. package/components/feedback/example-feedback-call-to-action.njk +1 -1
  56. package/components/field/_field-group.scss +0 -2
  57. package/components/field/_field.scss +1 -2
  58. package/components/fieldset/_fieldset.scss +2 -2
  59. package/components/fieldset/_macro.njk +1 -1
  60. package/components/fieldset/_macro.spec.js +1 -1
  61. package/components/footer/_footer.scss +12 -7
  62. package/components/footer/_macro.njk +54 -34
  63. package/components/footer/_macro.spec.js +90 -28
  64. package/components/footer/example-footer-cymraeg.njk +1 -1
  65. package/components/footer/example-footer-transactional.njk +1 -1
  66. package/components/footer/example-footer-warning.njk +1 -1
  67. package/components/footer/example-footer-with-alternative-organisation.njk +99 -94
  68. package/components/footer/example-footer-with-coat-of-arms.njk +1 -1
  69. package/components/footer/example-footer-with-copyright.njk +1 -1
  70. package/components/footer/example-footer-with-multiple-logos-and-split-display.njk +173 -0
  71. package/components/footer/example-footer-with-multiple-logos.njk +172 -0
  72. package/components/footer/example-footer.njk +1 -1
  73. package/components/header/_header.scss +7 -14
  74. package/components/header/_macro.njk +19 -19
  75. package/components/header/_macro.spec.js +17 -17
  76. package/components/header/example-header-external-for-surveys.njk +2 -2
  77. package/components/header/example-header-external-welsh.njk +2 -2
  78. package/components/header/example-header-external-with-sub-navigation-removed.njk +1 -1
  79. package/components/header/example-header-external-with-sub-navigation.njk +1 -1
  80. package/components/header/example-header-multiple-logos.njk +4 -4
  81. package/components/hero/_hero.scss +6 -8
  82. package/components/hero/_macro.njk +1 -1
  83. package/components/icon/_icon.scss +4 -4
  84. package/components/icon/_macro.njk +4 -4
  85. package/components/icon/_macro.spec.js +2 -2
  86. package/components/image/_image.scss +1 -1
  87. package/components/image/_macro.njk +1 -1
  88. package/components/image/_macro.spec.js +10 -10
  89. package/components/image/example-image-for-regular-screens.njk +1 -1
  90. package/components/input/_input-type.scss +0 -2
  91. package/components/input/_input.scss +10 -10
  92. package/components/input/_macro.njk +4 -2
  93. package/components/input/example-input-search-with-character-check.njk +1 -1
  94. package/components/input/example-input-search.njk +1 -1
  95. package/components/label/_label.scss +1 -3
  96. package/components/language-selector/_macro.njk +3 -3
  97. package/components/language-selector/_macro.spec.js +7 -7
  98. package/components/list/_list.scss +1 -5
  99. package/components/list/_macro.njk +9 -10
  100. package/components/list/_macro.spec.js +50 -9
  101. package/components/list/example-inline-list-with-social-icon-prefix.njk +1 -1
  102. package/components/message/_macro.njk +3 -3
  103. package/components/message/_macro.spec.js +3 -3
  104. package/components/message-list/_macro.njk +2 -2
  105. package/components/message-list/_macro.spec.js +8 -4
  106. package/components/message-list/_message-list.scss +2 -2
  107. package/components/navigation/_macro.njk +9 -9
  108. package/components/navigation/_macro.spec.js +2 -2
  109. package/components/navigation/_navigation.scss +2 -6
  110. package/components/navigation/navigation.dom.js +1 -1
  111. package/components/navigation/navigation.spec.js +4 -4
  112. package/components/pagination/_macro.njk +2 -2
  113. package/components/pagination/_pagination.scss +1 -7
  114. package/components/panel/_macro.njk +5 -4
  115. package/components/panel/_macro.spec.js +2 -2
  116. package/components/panel/_panel.scss +12 -8
  117. package/components/password/_macro.njk +1 -1
  118. package/components/password/_macro.spec.js +2 -2
  119. package/components/phase-banner/_macro.njk +1 -1
  120. package/components/phase-banner/_phase-banner.scss +3 -4
  121. package/components/phase-banner/example-phase-banner-alpha.njk +1 -1
  122. package/components/phase-banner/example-phase-banner-beta.njk +1 -1
  123. package/components/question/_macro.njk +8 -8
  124. package/components/question/_macro.spec.js +3 -3
  125. package/components/question/_question.scss +3 -3
  126. package/components/radios/_macro.njk +1 -1
  127. package/components/radios/_macro.spec.js +1 -1
  128. package/components/radios/_radios.scss +1 -1
  129. package/components/radios/example-radios-with-clear-button-expanded.njk +1 -1
  130. package/components/radios/example-radios-with-clear-button.njk +1 -1
  131. package/components/related-content/_macro.spec.js +2 -2
  132. package/components/related-content/_related-content.scss +1 -1
  133. package/components/related-content/example-related-content-general.njk +2 -2
  134. package/components/related-content/example-related-content-social-media.njk +1 -1
  135. package/components/reply/_macro.njk +3 -1
  136. package/components/reply/_macro.spec.js +1 -1
  137. package/components/reply/reply.spec.js +1 -1
  138. package/components/section-navigation/_macro.njk +10 -10
  139. package/components/section-navigation/_macro.spec.js +15 -15
  140. package/components/section-navigation/_section-navigation.scss +3 -8
  141. package/components/section-navigation/example-section-navigation-single-vertical-with-title.njk +3 -3
  142. package/components/section-navigation/example-section-navigation-vertical.njk +14 -14
  143. package/components/section-navigation/example-section-navigation.njk +3 -3
  144. package/components/select/example-select-with-inline-label.njk +1 -1
  145. package/components/share-page/_macro.njk +7 -7
  146. package/components/share-page/_macro.spec.js +2 -2
  147. package/components/share-page/example-share-page.njk +1 -1
  148. package/components/status/_status.scss +1 -1
  149. package/components/summary/_macro.njk +33 -33
  150. package/components/summary/_macro.spec.js +34 -34
  151. package/components/summary/_summary.scss +2 -4
  152. package/components/summary/example-summary-card-grouped.njk +34 -34
  153. package/components/summary/example-summary-grouped-total.njk +7 -7
  154. package/components/summary/example-summary-grouped-with-errors.njk +9 -9
  155. package/components/summary/example-summary-grouped.njk +34 -34
  156. package/components/summary/example-summary-household.njk +7 -7
  157. package/components/summary/example-summary-hub-minimal.njk +8 -8
  158. package/components/summary/example-summary-hub.njk +16 -16
  159. package/components/summary/example-summary-multiple.njk +7 -7
  160. package/components/summary/example-summary-no-action.njk +5 -5
  161. package/components/summary/example-summary.njk +9 -9
  162. package/components/table/_table.scss +2 -3
  163. package/components/table-of-contents/_macro.njk +3 -3
  164. package/components/table-of-contents/_macro.spec.js +3 -3
  165. package/components/table-of-contents/example-table-of-contents-sticky-full-page.njk +1 -1
  166. package/components/tabs/_macro.njk +3 -3
  167. package/components/tabs/_macro.spec.js +3 -3
  168. package/components/tabs/_tabs.scss +3 -4
  169. package/components/tabs/example-tabs-details.njk +1 -1
  170. package/components/text-indent/_text-indent.scss +1 -1
  171. package/components/timeline/_macro.njk +4 -4
  172. package/components/timeline/_macro.spec.js +3 -3
  173. package/components/timeline/_timeline.scss +4 -3
  174. package/components/timeline/example-timeline.njk +1 -1
  175. package/components/upload/_upload.scss +2 -2
  176. package/components/video/_macro.njk +4 -4
  177. package/components/video/_macro.spec.js +2 -2
  178. package/components/video/_video.scss +1 -1
  179. package/components/video/example-video.njk +2 -2
  180. package/components/video/video.spec.js +2 -2
  181. package/css/main.css +1 -1
  182. package/layout/_dsTemplate.njk +1 -1
  183. package/layout/_template.njk +31 -31
  184. package/package.json +1 -1
  185. package/scripts/main.es5.js +1 -1
  186. package/scripts/main.js +1 -1
  187. package/scss/base/_global.scss +2 -0
  188. package/scss/base/_typography.scss +0 -2
  189. package/scss/main.scss +0 -1
  190. package/scss/objects/_container.scss +1 -1
  191. package/scss/objects/_page.scss +2 -3
  192. package/scss/overrides/rtl.scss +1 -1
  193. package/scss/utilities/_grid.scss +103 -96
  194. package/scss/utilities/_margin.scss +11 -5
  195. package/scss/utilities/_padding.scss +12 -5
  196. package/scss/utilities/_typography.scss +2 -1
  197. package/scss/vars/_forms.scss +8 -10
  198. package/scss/vars/_grid.scss +4 -4
  199. package/scss/vars/_typography.scss +26 -19
  200. package/components/call-to-action/_call-to-action.scss +0 -8
  201. package/components/call-to-action/_macro.njk +0 -24
  202. package/components/call-to-action/_macro.spec.js +0 -48
  203. package/components/call-to-action/example-call-to-action-default.njk +0 -15
  204. package/components/metadata/_macro.njk +0 -14
@@ -1,5 +1,5 @@
1
1
  $checkbox-input-width: 22px;
2
- $checkbox-padding: 11px;
2
+ $checkbox-padding: 10px;
3
3
 
4
4
  .ons-checkbox {
5
5
  display: inline-block;
@@ -74,7 +74,7 @@ $checkbox-padding: 11px;
74
74
 
75
75
  &--no-border {
76
76
  > .ons-checkbox__label {
77
- padding: 0 0 0 1.85rem;
77
+ padding: 0 0 0 2rem;
78
78
 
79
79
  &::before {
80
80
  background: none !important;
@@ -89,7 +89,7 @@ $checkbox-padding: 11px;
89
89
 
90
90
  > .ons-checkbox__input {
91
91
  left: 0.05rem;
92
- top: 0.15rem;
92
+ top: 0.22rem;
93
93
 
94
94
  &:checked,
95
95
  &:focus {
@@ -170,7 +170,7 @@ $checkbox-padding: 11px;
170
170
  &__other {
171
171
  border-left: 4px solid var(--ons-color-borders-indent);
172
172
  display: block;
173
- margin: 0 1rem 0.5rem 1.1rem;
173
+ margin: 0 1rem 0.5rem;
174
174
  padding: 0 $checkbox-padding $checkbox-padding $checkbox-padding * 2 - 1;
175
175
  }
176
176
 
@@ -1,7 +1,7 @@
1
1
  .ons-checkboxes {
2
2
  &__label {
3
3
  display: block;
4
- margin: 0 0 1rem;
4
+ margin: 0 0 0.5rem;
5
5
  }
6
6
 
7
7
  &__items {
@@ -1,14 +1,14 @@
1
1
  {% from "components/checkboxes/_checkbox-macro.njk" import onsCheckbox %}
2
2
 
3
- <div class="ons-grid ons-grid--flex ons-grid--between">
3
+ <div class="ons-grid ons-grid-flex ons-grid-flex--between">
4
4
  <div class="ons-grid__col">
5
- <h1 class="ons-u-fs-l u-mb-xs" name="page-manage-account-title">{{ name }}</h1>
5
+ <h1 class="ons-u-fs-l u-mb-2xs" name="page-manage-account-title">{{ name }}</h1>
6
6
  </div>
7
7
  </div>
8
8
 
9
- <div class="ons-grid ons-grid--flex ons-grid--between">
9
+ <div class="ons-grid ons-grid-flex ons-grid-flex--between">
10
10
  <div class="ons-grid__col">
11
- <h2 class="ons-u-fs-m u-mb-xs" name="page-manage-account-subtitle">Select user permissions</h2>
11
+ <h2 class="ons-u-fs-m u-mb-2xs" name="page-manage-account-subtitle">Select user permissions</h2>
12
12
  </div>
13
13
  </div>
14
14
 
@@ -13,18 +13,18 @@
13
13
  p {
14
14
  margin: 0 0 0.5rem;
15
15
 
16
- @include mq(xxs, s) {
17
- font-size: 0.9rem;
18
- line-height: 1.4;
16
+ @include mq('2xs', s) {
17
+ font-size: 0.875rem;
18
+ line-height: 1.25rem;
19
19
  }
20
20
  }
21
21
  }
22
22
 
23
23
  &__link {
24
- line-height: 2.1rem;
24
+ line-height: 2rem;
25
25
  }
26
26
 
27
27
  &__btn {
28
- margin: 0 0 0.8rem;
28
+ margin: 0 0 0.75rem;
29
29
  }
30
30
  }
@@ -13,8 +13,8 @@
13
13
  {% set rejectedText = 'Rydych chi wedi gwrthod yr holl gwcis ychwanegol.' %}
14
14
  {% set confirmationButtonText = 'Cuddio' %}
15
15
  {% set contextSuffix = 'neges hon' %}
16
- {% set beforeLinkPreferencesURL = 'Gallwch chi' %}
17
- {% set afterLinkPreferencesURL = '"newid eich dewisiadau o ran cwcis</a> ar unrhyw adeg.' %}
16
+ {% set beforeLinkPreferencesUrl = 'Gallwch chi' %}
17
+ {% set afterLinkPreferencesUrl = '"newid eich dewisiadau o ran cwcis</a> ar unrhyw adeg.' %}
18
18
  {% set beforeLinkStatementText = '<p>Ffeiliau bach a gaiff eu storio ar eich dyfais pan fyddwch yn mynd ar wefan yw cwcis. Rydym ni’n defnyddio rhai cwcis hanfodol i wneud i’r wefan hon weithio.</p><p>Hoffem osod' %}
19
19
  {% set afterLinkStatementText = 'cwcis ychwanegol</a> er mwyn cofio eich gosodiadau a deall sut rydych chi’n defnyddio’r wefan. Mae hyn yn ein helpu ni i wella ein gwasanaethau.</p>' %}
20
20
  {% else %}
@@ -29,19 +29,19 @@
29
29
  {% set rejectedText = 'You have rejected all additional cookies.' %}
30
30
  {% set confirmationButtonText = 'Hide' %}
31
31
  {% set contextSuffix = 'cookie message' %}
32
- {% set beforeLinkPreferencesURL = 'You can' %}
33
- {% set afterLinkPreferencesURL = 'change your cookie preferences</a> at any time.' %}
32
+ {% set beforeLinkPreferencesUrl = 'You can' %}
33
+ {% set afterLinkPreferencesUrl = 'change your cookie preferences</a> at any time.' %}
34
34
  {% set beforeLinkStatementText = '<p>Cookies are small files stored on your device when you visit a website. We use some essential cookies to make this website work.</p><p>We would like to set' %}
35
35
  {% set afterLinkStatementText = 'additional cookies</a> to remember your settings and understand how you use the site. This helps us to improve our services. </p>' %}
36
36
  {% endif %}
37
37
 
38
38
  {% if not isDesignSystemExample %}
39
- {% set settingsLinkURL = params.settingsLinkTextURL | default(defaultCookiesLink) %}
39
+ {% set settingsLinkUrl = params.settingsLinkUrl | default(defaultCookiesLink) %}
40
40
  {% else %}
41
- {% set settingsLinkURL = '#0' %}
41
+ {% set settingsLinkUrl = '#0' %}
42
42
  {% endif %}
43
- {% set statementText = beforeLinkStatementText + ' <a href="' + settingsLinkURL + '">' + afterLinkStatementText %}
44
- {% set preferencesText = beforeLinkPreferencesURL + ' <a href="' + settingsLinkURL + '">' + afterLinkPreferencesURL %}
43
+ {% set statementText = beforeLinkStatementText + ' <a href="' + settingsLinkUrl + '">' + afterLinkStatementText %}
44
+ {% set preferencesText = beforeLinkPreferencesUrl + ' <a href="' + settingsLinkUrl + '">' + afterLinkPreferencesUrl %}
45
45
 
46
46
  <div class="ons-cookies-banner" role="region" aria-label="{{ params.ariaLabel | default(ariaLabel) }}">
47
47
  <div
@@ -49,13 +49,13 @@
49
49
  >
50
50
  <div class="ons-grid">
51
51
  <div class="ons-grid__col ons-col-8@m">
52
- <h2 class="ons-cookies-banner__title ons-u-mb-xs">
52
+ <h2 class="ons-cookies-banner__title ons-u-mb-2xs">
53
53
  {{ params.statementTitle | default(statementTitle) }} {{ params.serviceName | default(serviceName) }}
54
54
  </h2>
55
55
  <div class="ons-cookies-banner__statement">{{ params.statementText | default(statementText) | safe }}</div>
56
56
  </div>
57
57
  </div>
58
- <div class="ons-grid ons-grid--flex ons-u-mt-s">
58
+ <div class="ons-grid ons-grid-flex ons-u-mt-s">
59
59
  <div class="ons-grid__col">
60
60
  {{
61
61
  onsButton({
@@ -81,7 +81,7 @@
81
81
  }}
82
82
  </div>
83
83
  <div class="ons-grid__col">
84
- <a class="ons-cookies-banner__link" href="{{ settingsLinkURL }}"
84
+ <a class="ons-cookies-banner__link" href="{{ settingsLinkUrl }}"
85
85
  >{{ params.settingsLinkText | default(settingsLinkText) }}</a
86
86
  >
87
87
  </div>
@@ -90,8 +90,10 @@
90
90
  <div
91
91
  class="ons-container{{ ' ons-container--full-width' if params.fullWidth }}{{ ' ons-container--wide' if params.wide }} ons-cookies-banner__confirmation ons-u-d-no"
92
92
  >
93
- <div class="ons-grid ons-grid--flex ons-grid--between ons-grid--gutterless ons-grid--no-wrap@s ons-grid--vertical-center">
94
- <div class="ons-grid__col ons-grid__col--flex ons-col-auto ons-u-flex-shrink@s">
93
+ <div
94
+ class="ons-grid ons-grid-flex ons-grid-flex--between ons-grid--gutterless ons-grid-flex--no-wrap@s ons-grid-flex--vertical-center"
95
+ >
96
+ <div class="ons-grid__col ons-grid__col-flex ons-col-auto ons-u-flex-shrink@s">
95
97
  <p class="ons-cookies-banner__desc ons-u-mb-no@s ons-u-mr-s@s">
96
98
  <span class="ons-js-accepted-text ons-u-d-no">{{ params.acceptedText | default(acceptedText) | safe }} </span
97
99
  ><span class="ons-js-rejected-text ons-u-d-no">{{ params.rejectedText | default(rejectedText) | safe }} </span
@@ -10,7 +10,7 @@ const EXAMPLE_COOKIES_BANNER_PARAMS = {
10
10
  serviceName: 'ons.gov.uk override',
11
11
  statementTitle: 'Cookies on override',
12
12
  settingsLinkText: 'Cookie settings override',
13
- settingsLinkTextURL: '/cookiesoverride',
13
+ settingsLinkUrl: '/cookiesoverride',
14
14
  statementText: 'Statement override',
15
15
  acceptButtonText: 'Accept additional cookies override',
16
16
  rejectButtonText: 'Reject additional cookies override',
@@ -1,4 +1,4 @@
1
- $details-caret-width: 1.5rem;
1
+ $details-caret-width: 1.75rem;
2
2
 
3
3
  .ons-details {
4
4
  &--initialised & {
@@ -58,7 +58,6 @@ $details-caret-width: 1.5rem;
58
58
 
59
59
  &__title {
60
60
  display: inline-block;
61
- font-size: 1rem;
62
61
  font-weight: $font-weight-bold;
63
62
  margin-bottom: 0;
64
63
  text-underline-position: under;
@@ -78,7 +77,7 @@ $details-caret-width: 1.5rem;
78
77
  border-left: 4px solid var(--ons-color-borders-indent);
79
78
  display: block;
80
79
  margin: 1rem 0 0;
81
- padding: 0 0 0 1.3em;
80
+ padding: 0 0 0 1.5rem;
82
81
  }
83
82
  }
84
83
 
@@ -86,8 +85,8 @@ $details-caret-width: 1.5rem;
86
85
  &__heading {
87
86
  border-top: 1px solid var(--ons-color-borders);
88
87
  margin: 0;
89
- padding-bottom: 0.9rem;
90
- padding-top: 1rem;
88
+ padding-bottom: 1rem;
89
+ padding-top: 15px; // set to 15px to allow for the 1px border top
91
90
  width: 100%;
92
91
 
93
92
  &:focus {
@@ -117,7 +116,7 @@ $details-caret-width: 1.5rem;
117
116
  &__content {
118
117
  border-left: 0;
119
118
  margin: 0;
120
- padding: 0;
119
+ padding: 0 0 1rem;
121
120
  }
122
121
  }
123
122
 
@@ -12,11 +12,11 @@
12
12
  role="button"
13
13
  {% if params.headingAttributes %}{% for attribute, value in (params.headingAttributes.items() if params.headingAttributes is mapping and params.headingAttributes.items else params.headingAttributes) %}{{ ' ' }}{{ attribute }}{% if value %}="{{ value }}"{% endif %}{% endfor %}{% endif %}
14
14
  >
15
- {% set titleTag = params.titleTag | default("h2") %}
16
- {% set openingTag = "<" + titleTag %}
17
- {% set closingTag = "</" + titleTag + ">" %}
15
+ {% set titleTag = params.headingLevel | default(2) %}
16
+ {% set openingTag = "<h" ~ titleTag %}
17
+ {% set closingTag = "</h" ~ titleTag ~ ">" %}
18
18
  {{ openingTag | safe }}
19
- class="ons-details__title">{{ params.title }}{{ closingTag | safe }}
19
+ class="ons-details__title ons-u-fs-r--b">{{ params.title }}{{ closingTag | safe }}
20
20
  <span class="ons-details__icon">
21
21
  {% from "components/icon/_macro.njk" import onsIcon %}
22
22
  {{-
@@ -48,7 +48,7 @@ describe('macro: details', () => {
48
48
  const $ = cheerio.load(
49
49
  renderComponent('details', {
50
50
  ...EXAMPLE_DETAILS_BASIC,
51
- titleTag: 'h4',
51
+ headingLevel: 4,
52
52
  }),
53
53
  );
54
54
 
@@ -148,8 +148,6 @@
148
148
 
149
149
  &__item-metadata {
150
150
  @extend .ons-list--bare;
151
-
152
- line-height: 1.2 !important;
153
151
  }
154
152
 
155
153
  &__item-attribute {
@@ -4,9 +4,9 @@
4
4
  {% if params.attributes %}{% for attribute, value in (params.attributes.items() if params.attributes is mapping and params.attributes.items else params.attributes) %}{{ ' ' }}{{ attribute }}="{{ value }}"{% endfor %}{% endif %}
5
5
  >
6
6
  {% for document in params.documents %}
7
- {% set titleTag = params.titleTag | default("h2") %}
8
- {% set openingTag = "<" + titleTag %}
9
- {% set closingTag = "</" + titleTag + ">" %}
7
+ {% set titleTag = params.headingLevel | default(2) %}
8
+ {% set openingTag = "<h" ~ titleTag %}
9
+ {% set closingTag = "</h" ~ titleTag ~ ">" %}
10
10
  {% set documentItem %}
11
11
  {% if document.thumbnail %}
12
12
  <div
@@ -15,7 +15,7 @@
15
15
  >
16
16
  <a
17
17
  class="ons-document-list__image-link{{ ' ons-document-list__image-link--placeholder' if not document.thumbnail.smallSrc }}"
18
- href="{{ document.url }}"
18
+ href="{{ document.title.url }}"
19
19
  tabindex="-1"
20
20
  >
21
21
  {% if document.thumbnail.smallSrc and document.thumbnail.largeSrc %}
@@ -34,9 +34,9 @@
34
34
  <div
35
35
  class="ons-document-list__item-header{{ ' ons-document-list__item-header--reverse' if document.showMetadataFirst == true }}"
36
36
  >
37
- {{ openingTag | safe }} class="ons-document-list__item-title ons-u-fs-m ons-u-mt-no ons-u-mb-xs">
38
- <a href="{{ document.url }}"
39
- >{{ document.title }}
37
+ {{ openingTag | safe }} class="ons-document-list__item-title ons-u-fs-m ons-u-mt-no ons-u-mb-2xs">
38
+ <a href="{{ document.title.url }}"
39
+ >{{ document.title.text }}
40
40
  {%- if document.metadata and document.metadata.file -%}
41
41
  <span class="ons-u-vh">
42
42
  {%
@@ -52,7 +52,7 @@
52
52
  {{ closingTag | safe }}
53
53
 
54
54
  {%- if document.metadata -%}
55
- <ul class="ons-document-list__item-metadata{{ ' ons-u-mb-xs' if document.description else ' ons-u-mb-no' }}">
55
+ <ul class="ons-document-list__item-metadata{{ ' ons-u-mb-2xs' if document.description else ' ons-u-mb-no' }}">
56
56
  {%- if document.metadata.date -%}
57
57
  <li class="ons-document-list__item-attribute">
58
58
  {% set prefixClass = "ons-u-fw-b" if document.metadata.date.showPrefix == true else "ons-u-vh" %}
@@ -63,23 +63,23 @@
63
63
  </li>
64
64
  {% endif %}
65
65
 
66
- {%- if document.metadata.type and document.metadata.type.text -%}
66
+ {%- if document.metadata.object and document.metadata.object.text -%}
67
67
  <li class="ons-document-list__item-attribute{{ ' ons-u-mr-no' if document.metadata.file }}">
68
- {% set metadataType %}
68
+ {% set metadataObject %}
69
69
  <span
70
- {% if not document.metadata.file and not document.metadata.type.url %}class="ons-u-fw-b"{% endif %}
71
- >{{ document.metadata.type.text }}{%- if document.metadata.type.ref -%}:{% elif document.metadata.file %},{% endif %}</span
70
+ {% if not document.metadata.file and not document.metadata.object.url %}class="ons-u-fw-b"{% endif %}
71
+ >{{ document.metadata.object.text }}{%- if document.metadata.object.ref -%}:{% elif document.metadata.file %},{% endif %}</span
72
72
  >
73
73
  {% endset %}
74
- {%- if document.metadata.type.url -%}
75
- <a class="ons-document-list__attribute-link" href="{{ document.metadata.type.url }}">
76
- {{ metadataType | safe }}
74
+ {%- if document.metadata.object.url -%}
75
+ <a class="ons-document-list__attribute-link" href="{{ document.metadata.object.url }}">
76
+ {{ metadataObject | safe }}
77
77
  </a>
78
78
  {% else %}
79
- {{ metadataType | safe }}
79
+ {{ metadataObject | safe }}
80
80
  {% endif %}
81
- {%- if document.metadata.type.ref -%}
82
- <span>{{ document.metadata.type.ref }}</span>
81
+ {%- if document.metadata.object.ref -%}
82
+ <span>{{ document.metadata.object.ref }}</span>
83
83
  {% endif %}
84
84
  </li>
85
85
  {% endif %}
@@ -6,8 +6,10 @@ import axe from '../../tests/helpers/axe';
6
6
  import { renderComponent } from '../../tests/helpers/rendering';
7
7
 
8
8
  const EXAMPLE_DOCUMENT_LIST_BASIC = {
9
- url: '#0',
10
- title: 'Crime and justice',
9
+ title: {
10
+ text: 'Crime and justice',
11
+ url: '#0',
12
+ },
11
13
  description: 'Some description',
12
14
  };
13
15
 
@@ -30,10 +32,10 @@ const EXAMPLE_DOCUMENT_LIST_WITH_METADATA_FILE = {
30
32
  },
31
33
  };
32
34
 
33
- const EXAMPLE_DOCUMENT_LIST_WITH_METADATA_TYPE = {
35
+ const EXAMPLE_DOCUMENT_LIST_WITH_METADATA_OBJECT = {
34
36
  ...EXAMPLE_DOCUMENT_LIST_BASIC,
35
37
  metadata: {
36
- type: {
38
+ object: {
37
39
  text: 'Poster',
38
40
  url: '#0',
39
41
  ref: 'some ref',
@@ -49,7 +51,7 @@ const EXAMPLE_DOCUMENT_LIST_WITH_MULTIPLE = {
49
51
  largeSrc: '/example-large.png',
50
52
  },
51
53
  metadata: {
52
- type: {
54
+ object: {
53
55
  text: 'Poster',
54
56
  url: '#0',
55
57
  ref: 'some ref',
@@ -154,15 +156,15 @@ describe('macro: document list', () => {
154
156
  expect($('.ons-document-list__item-header--reverse').length).toBe(1);
155
157
  });
156
158
 
157
- it('overrides the heading title tag when `titleTag` is provided', () => {
159
+ it('overrides the heading title tag when `headingLevel` is provided', () => {
158
160
  const $ = cheerio.load(
159
161
  renderComponent('document-list', {
160
- titleTag: 'h1',
162
+ headingLevel: 1,
161
163
  documents: [EXAMPLE_DOCUMENT_LIST_BASIC],
162
164
  }),
163
165
  );
164
- const titleTag = $('.ons-document-list__item-title')[0].tagName;
165
- expect(titleTag).toBe('h1');
166
+ const headingLevel = $('.ons-document-list__item-title')[0].tagName;
167
+ expect(headingLevel).toBe('h1');
166
168
  });
167
169
 
168
170
  it('has expected `title`', () => {
@@ -256,11 +258,11 @@ describe('macro: document list', () => {
256
258
  });
257
259
  });
258
260
 
259
- describe('mode: with metadata `type` configuration', () => {
261
+ describe('mode: with metadata `object` configuration', () => {
260
262
  it('passes jest-axe checks', async () => {
261
263
  const $ = cheerio.load(
262
264
  renderComponent('document-list', {
263
- documents: [EXAMPLE_DOCUMENT_LIST_WITH_METADATA_TYPE],
265
+ documents: [EXAMPLE_DOCUMENT_LIST_WITH_METADATA_OBJECT],
264
266
  }),
265
267
  );
266
268
 
@@ -271,7 +273,7 @@ describe('macro: document list', () => {
271
273
  it('has the provided `url`', () => {
272
274
  const $ = cheerio.load(
273
275
  renderComponent('document-list', {
274
- documents: [EXAMPLE_DOCUMENT_LIST_WITH_METADATA_TYPE],
276
+ documents: [EXAMPLE_DOCUMENT_LIST_WITH_METADATA_OBJECT],
275
277
  }),
276
278
  );
277
279
 
@@ -280,13 +282,13 @@ describe('macro: document list', () => {
280
282
  });
281
283
 
282
284
  it('has expected `text`', () => {
283
- const $ = cheerio.load(renderComponent('document-list', { documents: [EXAMPLE_DOCUMENT_LIST_WITH_METADATA_TYPE] }));
285
+ const $ = cheerio.load(renderComponent('document-list', { documents: [EXAMPLE_DOCUMENT_LIST_WITH_METADATA_OBJECT] }));
284
286
  const text = $('.ons-document-list__attribute-link > span').text().trim();
285
287
  expect(text).toBe('Poster:');
286
288
  });
287
289
 
288
290
  it('has expected `ref`', () => {
289
- const $ = cheerio.load(renderComponent('document-list', { documents: [EXAMPLE_DOCUMENT_LIST_WITH_METADATA_TYPE] }));
291
+ const $ = cheerio.load(renderComponent('document-list', { documents: [EXAMPLE_DOCUMENT_LIST_WITH_METADATA_OBJECT] }));
290
292
  const text = $('.ons-document-list__attribute-link + span').text().trim();
291
293
  expect(text).toBe('some ref');
292
294
  });
@@ -14,10 +14,12 @@
14
14
  "smallSrc": '/img/small/census-monuments-lights-featured.jpg',
15
15
  "largeSrc": '/img/large/census-monuments-lights-featured.jpg'
16
16
  },
17
- "url": '#0',
18
- "title": 'Landmarks are lighting up purple to mark Census Day',
17
+ "title": {
18
+ "text": 'Landmarks are lighting up purple to mark Census Day',
19
+ "url": '#0'
20
+ },
19
21
  "metadata": {
20
- "type": {
22
+ "object": {
21
23
  "text": 'Press releases',
22
24
  "url": '#0'
23
25
  },
@@ -8,10 +8,12 @@
8
8
  "smallSrc": '/img/small/census-monuments-lights.jpg',
9
9
  "largeSrc": '/img/large/census-monuments-lights.jpg'
10
10
  },
11
- "url": '#0',
12
- "title": 'Landmarks are lighting up purple to mark Census Day',
11
+ "title": {
12
+ "text": 'Landmarks are lighting up purple to mark Census Day',
13
+ "url": '#0'
14
+ },
13
15
  "metadata": {
14
- "type": {
16
+ "object": {
15
17
  "text": 'Press releases',
16
18
  "url": '#0'
17
19
  },
@@ -27,10 +29,12 @@
27
29
  "smallSrc": '/img/small/ons-award-winners.jpg',
28
30
  "largeSrc": '/img/large/ons-award-winners.jpg'
29
31
  },
30
- "url": '#0',
31
- "title": 'Office for National Statistics win top Royal Statistical Society award',
32
+ "title": {
33
+ "text": 'Office for National Statistics win top Royal Statistical Society award',
34
+ "url": '#0'
35
+ },
32
36
  "metadata": {
33
- "type": {
37
+ "object": {
34
38
  "text": 'Press releases',
35
39
  "url": '#0'
36
40
  },
@@ -43,10 +47,12 @@
43
47
  },
44
48
  {
45
49
  "thumbnail": true,
46
- "url": '#0',
47
- "title": 'Five Office for National Statistics names in New Year’s Honours',
50
+ "title": {
51
+ "text": 'Five Office for National Statistics names in New Year’s Honours',
52
+ "url": '#0'
53
+ },
48
54
  "metadata": {
49
- "type": {
55
+ "object": {
50
56
  "text": 'Press releases',
51
57
  "url": '#0'
52
58
  },
@@ -4,10 +4,12 @@
4
4
  "documents": [
5
5
  {
6
6
  "thumbnail": true,
7
- "url": '#',
8
- "title": 'Including everyone in Census 2021',
7
+ "title": {
8
+ "text": 'Including everyone in Census 2021',
9
+ "url": '#0'
10
+ },
9
11
  "metadata": {
10
- "type": {
12
+ "object": {
11
13
  "text": 'Poster'
12
14
  },
13
15
  "file": {
@@ -20,10 +22,12 @@
20
22
  },
21
23
  {
22
24
  "thumbnail": true,
23
- "url": '#',
24
- "title": 'Community handbook for Census 2021',
25
+ "title": {
26
+ "text": 'Community handbook for Census 2021',
27
+ "url": '#0'
28
+ },
25
29
  "metadata": {
26
- "type": {
30
+ "object": {
27
31
  "text": 'Booklet'
28
32
  },
29
33
  "file": {
@@ -36,10 +40,12 @@
36
40
  },
37
41
  {
38
42
  "thumbnail": true,
39
- "url": '#',
40
- "title": 'Census 2021 matters to everyone',
43
+ "title": {
44
+ "text": 'Census 2021 matters to everyone',
45
+ "url": '#0'
46
+ },
41
47
  "metadata": {
42
- "type": {
48
+ "object": {
43
49
  "text": 'Poster'
44
50
  },
45
51
  "file": {
@@ -6,10 +6,12 @@
6
6
  {
7
7
  "featured": true,
8
8
  "showMetadataFirst": true,
9
- "url": '#0',
10
- "title": 'Crime and justice',
9
+ "title": {
10
+ "text": 'Crime and justice',
11
+ "url": '#0'
12
+ },
11
13
  "metadata": {
12
- "type": {
14
+ "object": {
13
15
  "text": 'Topic'
14
16
  }
15
17
  },
@@ -6,10 +6,12 @@
6
6
  {
7
7
  "featured": true,
8
8
  "showMetadataFirst": true,
9
- "url": '#0',
10
- "title": 'Crime and justice',
9
+ "title": {
10
+ "text": 'Crime and justice',
11
+ "url": '#0'
12
+ },
11
13
  "metadata": {
12
- "type": {
14
+ "object": {
13
15
  "text": 'Topic'
14
16
  }
15
17
  },
@@ -17,10 +19,12 @@
17
19
  <p>View all <a href="#0">datasets</a> or <a href="#0">publications</a> related to <a href="#0">Crime and justice</a></p>'
18
20
  },
19
21
  {
20
- "url": '#0',
21
- "title": 'Disability and crime',
22
+ "title": {
23
+ "text": 'Disability and crime',
24
+ "url": '#0'
25
+ },
22
26
  "metadata": {
23
- "type": {
27
+ "object": {
24
28
  "text": 'Dataset'
25
29
  },
26
30
  "date": {
@@ -33,10 +37,12 @@
33
37
  "description": '<p>Domestic abuse and sexual assault outcomes for disabled people in England and Wales aged 16 to 59 years, with analysis by age, sex, impairment type, impairment severity, country and region using the <mark>Crime</mark> Survey for England and Wales (CSEW) data.</p>'
34
38
  },
35
39
  {
36
- "url": '#0',
37
- "title": 'Disability and crime, UK: 2019 (Latest release)',
40
+ "title": {
41
+ "text": 'Disability and crime, UK: 2019 (Latest release)',
42
+ "url": '#0'
43
+ },
38
44
  "metadata": {
39
- "type": {
45
+ "object": {
40
46
  "text": 'Statistical bulletin'
41
47
  },
42
48
  "date": {
@@ -49,10 +55,12 @@
49
55
  "description": '<p>An overview of published data on disability and <mark>crime</mark> in the UK and analysis of the experience of domestic abuse and sexual assault for disabled adults aged 16 to 59 years in England and Wales. Analysis by age, sex and impairment type.</p>'
50
56
  },
51
57
  {
52
- "url": '#0',
53
- "title": 'Hate crime by disability status, Crime Survey for England and Wales (CSEW) combined years 2013 and 2014 to 2015 and 2016',
58
+ "title": {
59
+ "text": 'Hate crime by disability status, Crime Survey for England and Wales (CSEW) combined years 2013 and 2014 to 2015 and 2016',
60
+ "url": '#0'
61
+ },
54
62
  "metadata": {
55
- "type": {
63
+ "object": {
56
64
  "text": 'User requested data',
57
65
  "ref": 'Ref 008052'
58
66
  },
@@ -34,8 +34,7 @@
34
34
 
35
35
  .ons-label {
36
36
  font-weight: $font-weight-regular;
37
- margin-bottom: 0;
38
- margin-right: 0.5rem;
37
+ margin: 0 0.5rem 0 0;
39
38
  }
40
39
 
41
40
  .ons-input--select {