@ons/design-system 70.0.17 → 72.0.1

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 +4 -10
  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 +4 -5
  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
@@ -147,8 +147,10 @@ const EXAMPLE_PAGE = `
147
147
  'data-filter': 'general-public booklet',
148
148
  'data-sort-index': '1',
149
149
  },
150
- url: '/example-booklet-1',
151
- title: 'Example booklet 1',
150
+ title: {
151
+ url: '/example-booklet-1',
152
+ text: 'Example booklet 1',
153
+ },
152
154
  description: 'The first example booklet.',
153
155
  },
154
156
  {
@@ -157,8 +159,10 @@ const EXAMPLE_PAGE = `
157
159
  'data-filter': 'general-public booklet logo',
158
160
  'data-sort-index': '2',
159
161
  },
160
- url: '/example-booklet-2',
161
- title: 'Example booklet 2 with logo',
162
+ title: {
163
+ url: '/example-booklet-2',
164
+ text: 'Example booklet 2 with logo',
165
+ },
162
166
  description: 'The second example booklet with a logo.',
163
167
  },
164
168
  {
@@ -167,8 +171,10 @@ const EXAMPLE_PAGE = `
167
171
  'data-filter': 'logo',
168
172
  'data-sort-index': '3',
169
173
  },
170
- url: '/example-logo',
171
- title: 'Example logo',
174
+ title: {
175
+ url: '/example-logo',
176
+ text: 'Example logo',
177
+ },
172
178
  description: 'An example logo.',
173
179
  },
174
180
  ],
@@ -2,7 +2,7 @@
2
2
 
3
3
  {% macro onsExternalLink(params) %}
4
4
  <a href="{{ params.url }}" class="ons-external-link{{ ' ' + params.classes if params.classes else '' }}" target="_blank" rel="noopener">
5
- <span class="ons-external-link__text"> {{- params.linkText | safe -}} </span
5
+ <span class="ons-external-link__text"> {{- params.text | safe -}} </span
6
6
  ><span class="ons-external-link__icon">&nbsp;{{- onsIcon({"iconType": 'external-link'}) -}} </span
7
7
  ><span class="ons-external-link__new-window-description ons-u-vh"
8
8
  >({{- params.newWindowDescription | default("opens in a new tab") -}})</span
@@ -7,7 +7,7 @@ import { renderComponent, templateFaker } from '../../tests/helpers/rendering';
7
7
 
8
8
  const EXAMPLE_EXTERNAL_LINK = {
9
9
  url: 'http://example.com',
10
- linkText: 'Example link',
10
+ text: 'Example link',
11
11
  };
12
12
 
13
13
  describe('macro: external-link', () => {
@@ -5,7 +5,7 @@
5
5
  {{
6
6
  onsExternalLink({
7
7
  "url": "#0",
8
- "linkText": "link to an external website"
8
+ "text": "link to an external website"
9
9
  })
10
10
  }}
11
11
  </p>
@@ -7,6 +7,6 @@
7
7
  {{ params.heading }}
8
8
  {{ closingHeadingTag | safe }}
9
9
  <p class="ons-feedback__content">{{- params.content | safe -}}</p>
10
- <a href="{{ params.url }}" class="ons-feedback__link">{{- params.linkText -}}</a>
10
+ <a href="{{ params.linkUrl }}" class="ons-feedback__link">{{- params.linkText -}}</a>
11
11
  </div>
12
12
  {% endmacro %}
@@ -8,7 +8,7 @@ import { renderComponent } from '../../tests/helpers/rendering';
8
8
  const EXAMPLE_FEEDBACK_MINIMAL = {
9
9
  heading: 'Feedback heading',
10
10
  content: 'Feedback content...',
11
- url: 'http://example.com',
11
+ linkUrl: 'http://example.com',
12
12
  linkText: 'Feedback link text',
13
13
  };
14
14
 
@@ -19,7 +19,7 @@ const EXAMPLE_FEEDBACK_FULL = {
19
19
  headingLevel: 5,
20
20
  headingClasses: 'extra-heading-class another-extra-heading-class',
21
21
  content: 'Feedback content...',
22
- url: 'http://example.com',
22
+ linkUrl: 'http://example.com',
23
23
  linkText: 'Feedback link text',
24
24
  };
25
25
 
@@ -92,7 +92,7 @@ describe('macro: feedback', () => {
92
92
  expect($('p').text().trim()).toBe('Feedback content...');
93
93
  });
94
94
 
95
- it('has a link with the provided `url`', () => {
95
+ it('has a link with the provided `linkUrl`', () => {
96
96
  const $ = cheerio.load(renderComponent('feedback', EXAMPLE_FEEDBACK_MINIMAL));
97
97
 
98
98
  expect($('.ons-feedback__link').attr('href')).toBe('http://example.com');
@@ -6,7 +6,7 @@
6
6
  "heading": "What do you think about this service?",
7
7
  "headingClasses": 'test',
8
8
  "content": "Your comments will help us make improvements",
9
- "url": "#0",
9
+ "linkUrl": "#0",
10
10
  "linkText": "Give feedback"
11
11
  })
12
12
  }}
@@ -1,12 +1,10 @@
1
1
  .ons-field-group {
2
- font-size: 0;
3
2
  display: flex;
4
3
  flex-wrap: wrap;
5
4
  gap: 1rem;
6
5
 
7
6
  .ons-field {
8
7
  display: inline-block;
9
- font-size: 1rem;
10
8
  margin-top: 0;
11
9
  vertical-align: top;
12
10
  }
@@ -17,8 +17,7 @@
17
17
  display: flex;
18
18
 
19
19
  .ons-label {
20
- margin-bottom: 0;
21
- margin-right: 0.5rem;
20
+ margin: 0 0.5rem 0 0;
22
21
  }
23
22
  }
24
23
  }
@@ -3,7 +3,7 @@
3
3
  font-weight: $font-weight-bold;
4
4
  margin: 0;
5
5
  &:not(&--with-description) {
6
- margin-bottom: 0.55rem;
6
+ margin-bottom: 0.5rem;
7
7
  }
8
8
  &-title {
9
9
  display: block;
@@ -19,7 +19,7 @@
19
19
  &__description:not(&__description--title) {
20
20
  @extend .ons-label__description;
21
21
 
22
- margin-bottom: 0.55rem;
22
+ margin-bottom: 0.5rem;
23
23
  }
24
24
 
25
25
  &__description--title {
@@ -29,7 +29,7 @@
29
29
  {%- if params.description -%}
30
30
  <div
31
31
  id="{{ descriptionId }}"
32
- class="ons-fieldset__description{{ ' ons-fieldset__description--title ons-u-mb-m' if params.legendIsQuestionTitle }}"
32
+ class="ons-fieldset__description{{ ' ons-fieldset__description--title ons-u-mb-l' if params.legendIsQuestionTitle }}"
33
33
  >
34
34
  {{- params.description | safe -}}
35
35
  </div>
@@ -183,7 +183,7 @@ describe('macro: fieldset', () => {
183
183
  const $ = cheerio.load(renderComponent('fieldset', { ...EXAMPLE_FIELDSET_BASIC, legendIsQuestionTitle: true }));
184
184
 
185
185
  expect($('.ons-fieldset__description').hasClass('ons-fieldset__description--title')).toBe(true);
186
- expect($('.ons-fieldset__description').hasClass('ons-u-mb-m')).toBe(true);
186
+ expect($('.ons-fieldset__description').hasClass('ons-u-mb-l')).toBe(true);
187
187
  });
188
188
  });
189
189
  });
@@ -13,6 +13,9 @@
13
13
  background-clip: border-box;
14
14
  background-color: var(--ons-color-header);
15
15
  padding: 1rem;
16
+ a {
17
+ text-decoration: none;
18
+ }
16
19
  }
17
20
 
18
21
  &__warning {
@@ -25,16 +28,18 @@
25
28
  }
26
29
 
27
30
  &__ogl-img {
28
- margin: 0 0.5rem 0.2rem 0;
31
+ margin: 0 0.5rem 0.25rem 0;
29
32
  max-width: 100%;
30
33
  vertical-align: middle;
31
34
  }
32
35
 
33
- &__poweredBy-link {
34
- &:focus {
35
- .ons-icon--logo {
36
- @extend %a-focus;
37
- }
36
+ &__logo-container {
37
+ gap: 1rem;
38
+
39
+ svg,
40
+ img {
41
+ max-height: 30px;
42
+ width: auto;
38
43
  }
39
44
  }
40
45
 
@@ -54,7 +59,7 @@
54
59
 
55
60
  &--rows {
56
61
  li {
57
- margin-bottom: 0.5rem !important;
62
+ @extend .ons-u-mb-2xs;
58
63
  }
59
64
  }
60
65
  }
@@ -7,12 +7,12 @@
7
7
  {% else %}
8
8
  {% set lang = 'en' %}
9
9
  {% endif %}
10
-
10
+ {% set extraLogo = params.footerLogo.logos.logo2 %}
11
11
  {% set onsLogo %}
12
12
  {% if params.lang == 'cy' %}
13
13
  {{-
14
14
  onsIcon({
15
- "iconType": 'ons-logo-cy',
15
+ "iconType": 'ons-logo-stacked-cy' if extraLogo else 'ons-logo-cy',
16
16
  "altText": 'Swyddfa Ystadegau Gwladol',
17
17
  "altTextId": 'ons-logo-cy-footer-alt'
18
18
  })
@@ -20,7 +20,7 @@
20
20
  {% else %}
21
21
  {{-
22
22
  onsIcon({
23
- "iconType": 'ons-logo-en',
23
+ "iconType": 'ons-logo-stacked-en' if extraLogo else 'ons-logo-en' ,
24
24
  "altText": 'Office for National Statistics',
25
25
  "altTextId": 'ons-logo-en-footer-alt'
26
26
  })
@@ -69,18 +69,20 @@
69
69
  data-analytics="footer"
70
70
  {% if params.attributes %}{% for attribute, value in (params.attributes) %}{{ ' ' }}{{ attribute }}="{{ value }}"{% endfor %}{% endif %}
71
71
  >
72
- <div class="ons-container{{ ' ons-container--full-width' if params.fullWidth }}{{ ' ons-container--wide' if params.wide }}">
72
+ <div
73
+ class="ons-container{{ ' ons-container--full-width' if params.fullWidth else "" }}{{ ' ons-container--wide' if params.wide else "" }}"
74
+ >
73
75
  <div class="ons-grid">
74
76
  {% if params.newTabWarning %}
75
77
  <div class="ons-grid__col">
76
- <p class="ons-u-fs-s ons-u-mb-m ons-footer__new-tab-warning">{{ params.newTabWarning | safe }}</p>
78
+ <p class="ons-u-fs-s ons-u-mb-l ons-footer__new-tab-warning">{{ params.newTabWarning | safe }}</p>
77
79
  </div>
78
80
  {% endif %}
79
81
 
80
82
  {% if params.cols %}
81
83
  {% for col in params.cols %}
82
84
  <!-- Full footer columns -->
83
- <div class="ons-grid__col ons-col-4@m{{ ' ons-u-mt-m@xxs@m' if loop.index > 1 }}">
85
+ <div class="ons-grid__col ons-col-4@m{{ ' ons-u-mt-l@2xs@m' if loop.index > 1 }}">
84
86
  {% if col.title %}
85
87
  <h2 class="ons-footer__heading ons-u-fs-r--b">{{ col.title }}</h2>
86
88
  {% endif %}
@@ -109,13 +111,13 @@
109
111
  {% endif %}
110
112
 
111
113
  {% if (params.cols) or (params.rows) %}
112
- <div class="ons-grid__col ons-u-mb-m">
114
+ <div class="ons-grid__col ons-u-mb-l">
113
115
  <hr class="ons-footer__hr" />
114
116
  </div>
115
117
  {% endif %}
116
118
  </div>
117
119
 
118
- <div class="ons-grid ons-grid--flex ons-grid--vertical-top ons-grid--between">
120
+ <div class="ons-grid{{ ' ons-grid-flex' if params.crest else "" }} ons-grid-flex--vertical-top ons-grid-flex--between">
119
121
  <div class="ons-grid__col">
120
122
  {% if params.legal %}
121
123
  <!-- Legal -->
@@ -130,50 +132,71 @@
130
132
  {% endfor %}
131
133
  {% endif %}
132
134
 
133
- {% if params.OGLLink %}
135
+ {% if params.oglLink %}
134
136
  <!-- OGL -->
135
- <div class="ons-footer__license ons-u-mb-m">
137
+ <div class="ons-footer__license ons-u-mb-l">
136
138
  {{-
137
139
  onsIcon({
138
140
  "iconType": 'ogl'
139
141
  })
140
142
  -}}
141
- {% if params.OGLLink.HTML %}
142
- {{ params.OGLLink.HTML | safe }}
143
- {% elif params.OGLLink %}
143
+ {% if params.oglLink.html %}
144
+ {{ params.oglLink.html | safe }}
145
+ {% elif params.oglLink %}
144
146
  {% from "components/external-link/_macro.njk" import onsExternalLink %}
145
147
  {% if params.lang == 'cy' %}
146
- {{ params.OGLLink.pre | default('Mae’r holl gynnwys ar gael o dan y') }}
148
+ {{ params.oglLink.pre | default('Mae’r holl gynnwys ar gael o dan y') }}
147
149
  {{
148
150
  onsExternalLink({
149
- "url": params.OGLLink.url | default('https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/'),
150
- "linkText": params.OGLLink.link | default('Drwydded Llywodraeth Leol v3.0')
151
+ "url": params.oglLink.url | default('https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/'),
152
+ "text": params.oglLink.text | default('Drwydded Llywodraeth Leol v3.0')
151
153
  })
152
- }}{{ params.OGLLink.post | default(', oni bai y nodir fel arall') }}
154
+ }}{{ params.oglLink.post | default(', oni bai y nodir fel arall') }}
153
155
  {% else %}
154
- {{ params.OGLLink.pre | default('All content is available under the') }}
156
+ {{ params.oglLink.pre | default('All content is available under the') }}
155
157
  {{
156
158
  onsExternalLink({
157
- "url": params.OGLLink.url | default('https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/'),
158
- "linkText": params.OGLLink.link | default('Open Government Licence v3.0')
159
+ "url": params.oglLink.url | default('https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/'),
160
+ "text": params.oglLink.text | default('Open Government Licence v3.0')
159
161
  })
160
- }}{{ params.OGLLink.post | default(', except where otherwise stated') }}
162
+ }}{{ params.oglLink.post | default(', except where otherwise stated') }}
161
163
  {% endif %}
162
164
  {% endif %}
163
165
  </div>
164
166
  {% endif %}
165
- {% if not params.poweredBy %}
166
- <a
167
- class="ons-footer__poweredBy-link"
168
- {% if lang == "cy" %}href="https://cy.ons.gov.uk/"{% else %}href="https://www.ons.gov.uk/"{% endif %}
169
- >
170
- <div class="ons-footer__poweredby-logo ons-u-mb-m">{{ onsLogo | safe }}</div>
171
- </a>
167
+
168
+ {% if not params.footerLogo.logos.logo1 %}
169
+ {%
170
+ set logo1 = {
171
+ 'logoUrl': 'https://cy.ons.gov.uk/' if lang == 'cy' else 'https://www.ons.gov.uk/',
172
+ 'logoImage': onsLogo | safe
173
+ }
174
+ %}
175
+ {% set logos = [logo1, params.footerLogo.logos.logo2] %}
176
+ {% else %}
177
+ {% set logos = [params.footerLogo.logos.logo1, params.footerLogo.logos.logo2] %}
172
178
  {% endif %}
179
+
180
+ <div
181
+ class="ons-footer__logo-container ons-u-mb-l ons-grid-flex ons-grid-flex--vertical-top{{ ' ons-grid-flex--between' if params.footerLogo.display == 'split' else "" }}"
182
+ >
183
+ {% for logo in logos %}
184
+ {%- if logo.logoUrl -%}
185
+ <a
186
+ class="ons-footer__logo-link{{ ' ons-u-mr-s' if extraLogo and loop.index == 1 else "" }}"
187
+ href="{{ logo.logoUrl }}"
188
+ >{{ logo.logoImage | safe }}</a
189
+ >
190
+ {%- else -%}
191
+
192
+ {{ logo.logoImage | safe }}
193
+ {% endif %}
194
+ {% endfor %}
195
+ </div>
173
196
  </div>
174
197
  {% if params.crest %}
175
198
  <!-- Crest -->
176
- <div class="ons-grid__col ons-footer__crest ons-u-mb-m@xxs@l">
199
+ <div class="ons-grid__col ons-footer__crest ons-u-mb-l@2xs@l">
177
200
  {{-
178
201
  onsIcon({
179
202
  "iconType": 'crest'
@@ -182,15 +205,12 @@
182
205
  </div>
183
206
  {% endif %}
184
207
  </div>
185
- {% if params.poweredBy %}
186
- {{ params.poweredBy | safe }}
187
- {% endif %}
188
208
  {% if params.copyrightDeclaration %}
189
209
  <!-- Copyright -->
190
210
  {% set copyrightDeclaration = '&copy; ' + params.copyrightDeclaration.copyright + '<br /> ' + params.copyrightDeclaration.text %}
191
- <div class="ons-grid ons-grid--flex ons-grid--vertical-bottom ons-grid--between">
211
+ <div class="ons-grid ons-grid-flex ons-grid-flex--between">
192
212
  <div class="ons-grid__col">
193
- <p class="ons-u-fs-s ons-u-mb-no ons-footer__copyright">{{- copyrightDeclaration | safe -}}</p>
213
+ <p class="ons-u-fs-s ons-u-mb-l ons-footer__copyright">{{- copyrightDeclaration | safe -}}</p>
194
214
  </div>
195
215
  </div>
196
216
  {% endif %}
@@ -8,7 +8,7 @@ import { renderComponent, templateFaker } from '../../tests/helpers/rendering';
8
8
 
9
9
  const EXAMPLE_OGL_LINK_PARAM = {
10
10
  pre: 'All content is available under the',
11
- link: 'Open Government Licence v3.0',
11
+ text: 'Open Government Licence v3.0',
12
12
  url: 'https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/',
13
13
  post: ', except where otherwise stated',
14
14
  };
@@ -125,7 +125,7 @@ describe('macro: footer', () => {
125
125
 
126
126
  describe('OGL link', () => {
127
127
  const params = {
128
- OGLLink: EXAMPLE_OGL_LINK_PARAM,
128
+ oglLink: EXAMPLE_OGL_LINK_PARAM,
129
129
  };
130
130
 
131
131
  it('passes jest-axe checks', async () => {
@@ -144,12 +144,12 @@ describe('macro: footer', () => {
144
144
  expect(iconsSpy.occurrences).toContainEqual(expect.objectContaining({ iconType: 'ogl' }));
145
145
  });
146
146
 
147
- it('renders raw HTML when `HTML` is provided', () => {
147
+ it('renders raw HTML when `html` is provided', () => {
148
148
  const $ = cheerio.load(
149
149
  renderComponent('footer', {
150
- OGLLink: {
151
- ...params.OGLLink,
152
- HTML: '<strong>Bold text.</strong>',
150
+ oglLink: {
151
+ ...params.oglLink,
152
+ html: '<strong>Bold text.</strong>',
153
153
  },
154
154
  }),
155
155
  );
@@ -167,7 +167,7 @@ describe('macro: footer', () => {
167
167
  expect(externalLinkSpy.occurrences).toContainEqual(
168
168
  expect.objectContaining({
169
169
  url: 'https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/',
170
- linkText: 'Open Government Licence v3.0',
170
+ text: 'Open Government Licence v3.0',
171
171
  }),
172
172
  );
173
173
  });
@@ -179,11 +179,11 @@ describe('macro: footer', () => {
179
179
  expect(licenseHtml).toContain(', except where otherwise stated');
180
180
  });
181
181
 
182
- it('renders welsh `post` content when `lang:cy` provided and `OGLLink` is "true"', () => {
182
+ it('renders welsh `post` content when `lang:cy` provided and `oglLink` is "true"', () => {
183
183
  const $ = cheerio.load(
184
184
  renderComponent('footer', {
185
185
  lang: 'cy',
186
- OGLLink: true,
186
+ oglLink: true,
187
187
  }),
188
188
  );
189
189
 
@@ -354,8 +354,8 @@ describe('macro: footer', () => {
354
354
  });
355
355
  });
356
356
 
357
- describe('poweredBy logo', () => {
358
- describe('default poweredBy logo', () => {
357
+ describe('Footer logo', () => {
358
+ describe('default footer logo', () => {
359
359
  describe.each([
360
360
  [
361
361
  'the `lang` parameter is not provided',
@@ -387,7 +387,7 @@ describe('macro: footer', () => {
387
387
  });
388
388
  });
389
389
  });
390
- describe('provided poweredBy logo', () => {
390
+ describe('provided footer logo', () => {
391
391
  describe.each([
392
392
  [
393
393
  'the `lang` parameter is "cy"',
@@ -415,54 +415,74 @@ describe('macro: footer', () => {
415
415
  it('has the Welsh lang link when the default Welsh lang ons icon is present', () => {
416
416
  const $ = cheerio.load(renderComponent('footer', { lang: 'cy' }));
417
417
 
418
- expect($('.ons-footer__poweredBy-link').attr('href')).toBe('https://cy.ons.gov.uk/');
418
+ expect($('.ons-footer__logo-link').attr('href')).toBe('https://cy.ons.gov.uk/');
419
419
  });
420
420
  it('has the English lang link when the default English lang ons icon is present', () => {
421
421
  const $ = cheerio.load(renderComponent('footer', { lang: 'en' }));
422
422
 
423
- expect($('.ons-footer__poweredBy-link').attr('href')).toBe('https://www.ons.gov.uk/');
423
+ expect($('.ons-footer__logo-link').attr('href')).toBe('https://www.ons.gov.uk/');
424
424
  });
425
425
  });
426
- describe('provided poweredBy logo', () => {
426
+ describe('provided footer logo', () => {
427
427
  describe.each([
428
428
  [
429
- 'the `poweredBy` and `OGLLink` parameters are provided',
429
+ 'the `footerLogo` and `oglLink` parameters are provided',
430
430
  {
431
- poweredBy: '<img src="logo.svg" class="custom-logo" alt="logo">',
432
- OGLLink: EXAMPLE_OGL_LINK_PARAM,
431
+ footerLogo: {
432
+ logos: {
433
+ logo1: { logoImage: '<img src="logo.svg" class="custom-logo" alt="logo">' },
434
+ },
435
+ },
436
+ oglLink: EXAMPLE_OGL_LINK_PARAM,
433
437
  },
434
438
  ],
435
439
  [
436
- 'the `poweredBy` and `legal` parameters are provided',
440
+ 'the `footerLogo` and `legal` parameters are provided',
437
441
  {
438
- poweredBy: '<img src="logo.svg" class="custom-logo" alt="logo">',
442
+ footerLogo: {
443
+ logos: {
444
+ logo1: { logoImage: '<img src="logo.svg" class="custom-logo" alt="logo">' },
445
+ },
446
+ },
439
447
  legal: EXAMPLE_LEGAL_PARAM,
440
448
  },
441
449
  ],
442
450
  [
443
- 'the `poweredBy` and `crest` parameters are provided',
451
+ 'the `footerLogo` and `crest` parameters are provided',
444
452
  {
445
- poweredBy: '<img src="logo.svg" class="custom-logo" alt="logo">',
453
+ footerLogo: {
454
+ logos: {
455
+ logo1: { logoImage: '<img src="logo.svg" class="custom-logo" alt="logo">' },
456
+ },
457
+ },
446
458
  crest: true,
447
459
  },
448
460
  ],
449
461
  [
450
- 'the `poweredBy`, `legal` and `crest` parameters are provided',
462
+ 'the `footerLogo`, `legal` and `crest` parameters are provided',
451
463
  {
452
- poweredBy: '<img src="logo.svg" class="custom-logo" alt="logo">',
464
+ footerLogo: {
465
+ logos: {
466
+ logo1: { logoImage: '<img src="logo.svg" class="custom-logo" alt="logo">' },
467
+ },
468
+ },
453
469
  legal: EXAMPLE_LEGAL_PARAM,
454
470
  crest: true,
455
471
  },
456
472
  ],
457
473
  [
458
- 'the `poweredBy` parameter is provided but the `legal` and `crest` parameters are not provided',
474
+ 'the `footerLogo` parameter is provided but the `legal` and `crest` parameters are not provided',
459
475
  {
460
- poweredBy: '<img src="logo.svg" class="custom-logo" alt="logo">',
476
+ footerLogo: {
477
+ logos: {
478
+ logo1: { logoImage: '<img src="logo.svg" class="custom-logo" alt="logo">' },
479
+ },
480
+ },
461
481
  },
462
482
  ],
463
- ])('where %s', (_, poweredByParams) => {
483
+ ])('where %s', (_, footerLogoParams) => {
464
484
  const params = {
465
- ...poweredByParams,
485
+ ...footerLogoParams,
466
486
  };
467
487
 
468
488
  it('passes jest-axe checks', async () => {
@@ -478,6 +498,48 @@ describe('macro: footer', () => {
478
498
  expect($('.custom-logo').length).toBe(1);
479
499
  });
480
500
  });
501
+
502
+ it('has the extra footer logo image and link', () => {
503
+ const $ = cheerio.load(
504
+ renderComponent('footer', {
505
+ footerLogo: {
506
+ logos: {
507
+ logo1: { logoImage: '<img src="logo.svg" class="custom-logo" alt="logo">' },
508
+ logo2: {
509
+ logoUrl: '#0',
510
+ logoImage: '<img src="a-logo.svg">',
511
+ },
512
+ },
513
+ },
514
+ legal: EXAMPLE_LEGAL_PARAM,
515
+ crest: true,
516
+ }),
517
+ );
518
+
519
+ expect($('.ons-footer__logo-link').attr('href')).toBe('#0');
520
+ expect($('.ons-footer__logo-link > img').attr('src')).toBe('a-logo.svg');
521
+ });
522
+
523
+ it('has the correct class applied for opposite display of logos', () => {
524
+ const $ = cheerio.load(
525
+ renderComponent('footer', {
526
+ footerLogo: {
527
+ logos: {
528
+ logo1: { logoImage: '<img src="logo.svg" class="custom-logo" alt="logo">' },
529
+ logo2: {
530
+ logoUrl: '#0',
531
+ logoImage: '<img src="a-logo.svg">',
532
+ },
533
+ },
534
+ display: 'split',
535
+ },
536
+ legal: EXAMPLE_LEGAL_PARAM,
537
+ crest: true,
538
+ }),
539
+ );
540
+
541
+ expect($('.ons-footer__logo-container').attr('class')).toContain('ons-grid-flex--between');
542
+ });
481
543
  });
482
544
  });
483
545
 
@@ -50,6 +50,6 @@
50
50
  ]
51
51
  }
52
52
  ],
53
- "OGLLink": true
53
+ "oglLink": true
54
54
  })
55
55
  }}
@@ -58,6 +58,6 @@
58
58
  ]
59
59
  }
60
60
  ],
61
- "OGLLink": true
61
+ "oglLink": true
62
62
  })
63
63
  }}
@@ -28,6 +28,6 @@
28
28
  ]
29
29
  }
30
30
  ],
31
- "OGLLink": true
31
+ "oglLink": true
32
32
  })
33
33
  }}