@ons/design-system 51.0.0 → 53.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 (46) hide show
  1. package/README.md +0 -2
  2. package/components/address-input/autosuggest.address.setter.js +6 -2
  3. package/components/button/_button.scss +75 -33
  4. package/components/button/_macro.njk +1 -1
  5. package/components/button/_macro.spec.js +2 -2
  6. package/components/checkboxes/checkbox-with-autoselect.js +2 -1
  7. package/components/external-link/_macro.njk +5 -2
  8. package/components/external-link/_macro.spec.js +18 -1
  9. package/components/footer/_footer.scss +19 -4
  10. package/components/footer/_macro.njk +103 -97
  11. package/components/footer/_macro.spec.js +131 -2
  12. package/components/header/_header.scss +65 -46
  13. package/components/header/_macro.njk +172 -120
  14. package/components/header/_macro.spec.js +85 -29
  15. package/components/hero/_hero.scss +30 -140
  16. package/components/hero/_macro.njk +13 -20
  17. package/components/hero/_macro.spec.js +32 -29
  18. package/components/icons/_macro.njk +257 -29
  19. package/components/icons/_macro.spec.js +6 -6
  20. package/components/input/_input.scss +8 -0
  21. package/components/language-selector/_macro.njk +1 -1
  22. package/components/language-selector/_macro.spec.js +9 -1
  23. package/components/mutually-exclusive/_macro.njk +1 -1
  24. package/components/mutually-exclusive/_macro.spec.js +2 -0
  25. package/components/navigation/_macro.njk +42 -35
  26. package/components/navigation/_macro.spec.js +34 -32
  27. package/components/navigation/_navigation.scss +20 -4
  28. package/components/question/_macro.njk +12 -10
  29. package/components/related-content/_macro.njk +13 -21
  30. package/components/related-content/_macro.spec.js +18 -27
  31. package/components/related-content/_section-macro.njk +10 -0
  32. package/components/related-content/_section-macro.spec.js +43 -0
  33. package/components/share-page/_macro.njk +4 -2
  34. package/css/census.css +3 -1
  35. package/css/ids.css +2 -0
  36. package/css/main.css +1 -1
  37. package/img/dummy-brand-logo.svg +1 -0
  38. package/layout/_template.njk +8 -4
  39. package/package.json +1 -1
  40. package/scripts/main.es5.js +2 -2
  41. package/scripts/main.js +1 -1
  42. package/scss/ids.scss +2 -0
  43. package/scss/settings/_census.scss +141 -0
  44. package/scss/settings/_ids.scss +48 -0
  45. package/scss/utilities/_margin.scss +1 -0
  46. package/scss/vars/_colors.scss +5 -2
package/README.md CHANGED
@@ -2,8 +2,6 @@
2
2
 
3
3
  [![GitHub release](https://img.shields.io/github/release/ONSdigital/design-system.svg)](https://github.com/ONSdigital/design-system/releases)
4
4
  [![Tests](https://github.com/ONSdigital/design-system/actions/workflows/tests.yml/badge.svg)](https://github.com/ONSdigital/design-system/actions/workflows/tests.yml)
5
- [![codecov](https://codecov.io/gh/ONSdigital/design-system/branch/master/graph/badge.svg)](https://codecov.io/gh/ONSdigital/design-system)
6
- [![Codacy Badge](https://api.codacy.com/project/badge/Grade/e8f9a091991d4d5a85d0b0b85e26dde6)](https://www.codacy.com/app/bameyrick/design-system)
7
5
  [![GitHub pull requests](https://img.shields.io/github/issues-pr-raw/ONSdigital/design-system.svg)](https://github.com/ONSdigital/design-system/pulls)
8
6
  [![Github last commit](https://img.shields.io/github/last-commit/ONSdigital/design-system.svg)](https://github.com/ONSdigital/design-system/commits)
9
7
  [![Github contributors](https://img.shields.io/github/contributors/ONSdigital/design-system.svg)](https://github.com/ONSdigital/design-system/graphs/contributors)
@@ -104,14 +104,18 @@ export default class AddressSetter {
104
104
 
105
105
  clearManualInputs() {
106
106
  this.manualInputs.forEach(input => {
107
- input.value = '';
107
+ if (input) {
108
+ input.value = '';
109
+ }
108
110
  });
109
111
  }
110
112
 
111
113
  checkManualInputsValues(onLoad) {
112
114
  if (onLoad) {
113
115
  this.originalValues = this.manualInputs.map(input => {
114
- return input.value;
116
+ if (input) {
117
+ return input.value;
118
+ }
115
119
  });
116
120
  } else if (this.uprn.value !== '' && this.originalValues.length) {
117
121
  this.newValues = this.manualInputs.map(input => {
@@ -230,9 +230,9 @@ $button-shadow-size: 3px;
230
230
 
231
231
  &--text-link-inverse & {
232
232
  &__inner {
233
- color: $color-white;
233
+ color: $color-text-inverse-link;
234
234
  .ons-svg-icon {
235
- fill: $color-white;
235
+ fill: $color-text-inverse-link;
236
236
  }
237
237
  }
238
238
  }
@@ -253,9 +253,9 @@ $button-shadow-size: 3px;
253
253
  &--text-link-inverse:active &,
254
254
  &--text-link-inverse.active & {
255
255
  &__inner {
256
- color: $color-branded-tint;
256
+ color: $color-text-inverse-link-hover;
257
257
  .ons-svg-icon {
258
- fill: $color-branded-tint;
258
+ fill: $color-text-inverse-link-hover;
259
259
  }
260
260
  }
261
261
  }
@@ -279,8 +279,7 @@ $button-shadow-size: 3px;
279
279
  }
280
280
  }
281
281
 
282
- &--ghost &,
283
- &--mobile & {
282
+ &--ghost & {
284
283
  &__inner {
285
284
  background: transparent;
286
285
  border: 2px solid rgba(255, 255, 255, 0.6);
@@ -293,36 +292,51 @@ $button-shadow-size: 3px;
293
292
  }
294
293
 
295
294
  &--ghost-dark & {
296
- @extend .ons-btn--secondary;
297
295
  &__inner {
298
296
  background: transparent;
299
- border: 2px solid rgba(0, 0, 0, 0.6);
297
+ border: 2px solid $color-black;
298
+ box-shadow: none;
300
299
  color: $color-text;
300
+ .ons-svg-icon {
301
+ fill: $color-black;
302
+ }
301
303
  }
302
304
  }
303
305
 
304
306
  &--ghost,
305
- &--text-link,
306
- &--mobile {
307
+ &--ghost-dark,
308
+ &--dropdown,
309
+ &--text-link {
307
310
  &:active,
308
311
  .active {
309
312
  top: 0;
310
313
  }
311
314
  }
312
315
 
313
- &--ghost:active:focus {
316
+ &--ghost:active:focus,
317
+ &--ghost-dark:active:focus {
314
318
  box-shadow: none;
315
319
  outline: 3px solid transparent;
316
320
  }
317
321
 
318
322
  &--ghost:focus:hover,
319
- &--text-link:focus:hover,
320
- &--mobile:focus:hover {
323
+ &--ghost-dark:focus:hover,
324
+ &--dropdown:focus:hover,
325
+ &--text-link:focus:hover {
321
326
  outline: none;
322
327
  }
323
328
 
324
- &--ghost:hover &,
325
- &--mobile:hover & {
329
+ &--ghost-dark:focus:hover &,
330
+ &--dropdown:focus:hover & {
331
+ &__inner {
332
+ color: $color-text;
333
+ .ons-svg-icon {
334
+ fill: $color-text;
335
+ }
336
+ }
337
+ }
338
+
339
+ &--ghost:hover & {
326
340
  &__inner {
327
341
  background: rgba(0, 0, 0, 0.1);
328
342
  border-color: $color-white;
@@ -330,11 +344,8 @@ $button-shadow-size: 3px;
330
344
  }
331
345
 
332
346
  &--ghost:active &,
333
- &--mobile:active &,
334
347
  &--ghost:active:focus &,
335
- &--mobile:active:focus &,
336
- &--ghost.active &,
337
- &--mobile.active & {
348
+ &--ghost.active & {
338
349
  &__inner {
339
350
  background: rgba(0, 0, 0, 0.2);
340
351
  border-color: rgba(255, 255, 255, 0.6);
@@ -345,8 +356,23 @@ $button-shadow-size: 3px;
345
356
  }
346
357
  }
347
358
 
359
+ &--ghost-dark:hover &,
360
+ &--ghost-dark:active &,
361
+ &--ghost-dark:active:focus &,
362
+ &--ghost-dark.active & {
363
+ &__inner {
364
+ background: $color-black;
365
+ border-color: $color-black;
366
+ color: $color-white;
367
+ .ons-svg-icon {
368
+ fill: $color-white;
369
+ }
370
+ }
371
+ }
372
+
348
373
  &--ghost.active:focus &,
349
- &--mobile.active:focus & {
374
+ &--ghost-dark.active:focus &,
375
+ &--dropdown.active:focus & {
350
376
  &__inner {
351
377
  background: $color-focus;
352
378
  color: $color-text-link-focus;
@@ -357,7 +383,8 @@ $button-shadow-size: 3px;
357
383
  }
358
384
 
359
385
  &--ghost:focus &,
360
- &--mobile:focus & {
386
+ &--ghost-dark:focus &,
387
+ &--dropdown:focus & {
361
388
  &__inner {
362
389
  box-shadow: none;
363
390
  .ons-svg-icon {
@@ -395,17 +422,22 @@ $button-shadow-size: 3px;
395
422
  }
396
423
 
397
424
  &--dropdown {
398
- @extend .ons-btn--ghost;
399
425
  @extend .ons-btn--mobile;
400
426
 
401
427
  width: 100%;
428
+ }
402
429
 
403
- .ons-btn__inner {
430
+ &--dropdown & {
431
+ @extend .ons-btn--mobile;
432
+
433
+ width: 100%;
434
+
435
+ &__inner {
404
436
  background: $color-branded-tint;
405
437
  border: none;
406
438
  border-radius: 0;
407
439
  box-shadow: none;
408
- color: $color-text-link;
440
+ color: $color-branded-text;
409
441
  display: block;
410
442
  font-size: 1rem;
411
443
  font-weight: normal;
@@ -413,20 +445,30 @@ $button-shadow-size: 3px;
413
445
  text-align: left;
414
446
 
415
447
  .ons-svg-icon {
416
- fill: $color-text-link;
448
+ fill: $color-branded-text;
417
449
  float: right;
418
450
  margin-top: 3px;
419
451
  }
420
452
  }
453
+ }
421
454
 
422
- &:active,
423
- &:active:focus {
424
- .ons-btn__inner {
425
- background: $color-branded-secondary;
426
- color: $color-white;
427
- .ons-svg-icon {
428
- fill: $color-white;
429
- }
455
+ &--dropdown:hover & {
456
+ &__inner {
457
+ background: $color-branded-secondary;
458
+ color: $color-white;
459
+ .ons-svg-icon {
460
+ fill: $color-white;
461
+ }
462
+ }
463
+ }
464
+
465
+ &--dropdown:active &,
466
+ &--dropdown:active:focus & {
467
+ &__inner {
468
+ background: $color-branded-secondary;
469
+ color: $color-white;
470
+ .ons-svg-icon {
471
+ fill: $color-white;
430
472
  }
431
473
  }
432
474
  }
@@ -86,7 +86,7 @@
86
86
  {% endif -%}
87
87
  </span>
88
88
  {% if params.url is defined and params.url and params.newWindow is defined and params.newWindow %}
89
- <span class="ons-btn__new-window-description ons-u-vh">{{ params.newWindowDescription | default("opens in a new window") }}</span>
89
+ <span class="ons-btn__new-window-description ons-u-vh">({{ params.newWindowDescription | default("opens in a new tab") }})</span>
90
90
  {% endif %}
91
91
  {% if params.buttonContext is defined and params.buttonContext %}
92
92
  <span class="ons-btn__context ons-u-vh">{{ params.buttonContext }}</span>
@@ -407,7 +407,7 @@ describe('macro: button', () => {
407
407
  }),
408
408
  );
409
409
 
410
- expect($('.ons-btn__new-window-description').text()).toBe('opens in a new window');
410
+ expect($('.ons-btn__new-window-description').text()).toBe('(opens in a new tab)');
411
411
  });
412
412
 
413
413
  it('has a custom new window description when `newWindow` is `true` and `newWindowDescription` is provided', () => {
@@ -419,7 +419,7 @@ describe('macro: button', () => {
419
419
  }),
420
420
  );
421
421
 
422
- expect($('.ons-btn__new-window-description').text()).toBe('custom opens in a new window text');
422
+ expect($('.ons-btn__new-window-description').text()).toBe('(custom opens in a new window text)');
423
423
  });
424
424
 
425
425
  it('has the `download` attribute when `buttonStyle` is "download"', () => {
@@ -21,7 +21,8 @@ export default class CheckboxWithAutoSelect {
21
21
  this.unselectAllText = this.button.getAttribute('data-unselect-all');
22
22
  }
23
23
 
24
- handleButtonEvent() {
24
+ handleButtonEvent(event) {
25
+ event.preventDefault();
25
26
  this.checkboxes.forEach(checkbox => {
26
27
  checkbox.checked = this.allChecked === false ? true : false;
27
28
  });
@@ -1,7 +1,10 @@
1
1
  {# Icon needed to be directly put here instead of calling macro to solve an issue with extra space on the end of links being underlined #}
2
2
  {% macro onsExternalLink(params) %}
3
- <a href="{{ params.url }}" class="ons-external-link{% if params.classes is defined and params.classes %} {{ params.classes }}{% endif %}" target="_blank" rel="noopener">{{- params.linkText | safe -}}<span class="ons-external-link__icon">&nbsp;<svg id="external-link" class="ons-svg-icon" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg">
3
+ <a href="{{ params.url }}" class="ons-external-link{% if params.classes is defined and params.classes %} {{ params.classes }}{% endif %}" target="_blank" rel="noopener">
4
+ <span class="ons-external-link__text">
5
+ {{- params.linkText | safe -}}
6
+ </span><span class="ons-external-link__icon">&nbsp;<svg class="ons-svg-icon" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true">
4
7
  <path d="M13.5,9H13a.5.5,0,0,0-.5.5v3h-9v-9h3A.5.5,0,0,0,7,3V2.5A.5.5,0,0,0,6.5,2h-4a.5.5,0,0,0-.5.5v11a.5.5,0,0,0,.5.5h11a.5.5,0,0,0,.5-.5v-4A.5.5,0,0,0,13.5,9Z" transform="translate(-2 -1.99)"/>
5
8
  <path d="M8.83,7.88a.51.51,0,0,0,.71,0l2.31-2.32,1.28,1.28A.51.51,0,0,0,14,6.49v-4a.52.52,0,0,0-.5-.5h-4A.51.51,0,0,0,9,2.52a.58.58,0,0,0,.14.33l1.28,1.28L8.12,6.46a.51.51,0,0,0,0,.71Z" transform="translate(-2 -1.99)"/>
6
- </svg></span></a>
9
+ </svg></span><span class="ons-external-link__new-window-description ons-u-vh">({{- params.newWindowDescription | default("opens in a new tab") -}})</span></a>
7
10
  {% endmacro %}
@@ -47,10 +47,27 @@ describe('macro: external-link', () => {
47
47
  it('has the expected link text', async () => {
48
48
  const $ = cheerio.load(renderComponent('external-link', EXAMPLE_EXTERNAL_LINK));
49
49
 
50
- const $hyperlink = $('a.ons-external-link');
50
+ const $hyperlink = $('a.ons-external-link .ons-external-link__text');
51
51
  expect($hyperlink.text().trim()).toBe('Example link');
52
52
  });
53
53
 
54
+ it('has a default new window description', async () => {
55
+ const $ = cheerio.load(renderComponent('external-link', EXAMPLE_EXTERNAL_LINK));
56
+
57
+ expect($('.ons-external-link__new-window-description').text()).toBe('(opens in a new tab)');
58
+ });
59
+
60
+ it('has a custom new window description when `newWindowDescription` is provided', () => {
61
+ const $ = cheerio.load(
62
+ renderComponent('external-link', {
63
+ ...EXAMPLE_EXTERNAL_LINK,
64
+ newWindowDescription: 'custom opens in a new tab text',
65
+ }),
66
+ );
67
+
68
+ expect($('.ons-external-link__new-window-description').text()).toBe('(custom opens in a new tab text)');
69
+ });
70
+
54
71
  it('has an "external-link" icon', async () => {
55
72
  const $ = cheerio.load(renderComponent('external-link', EXAMPLE_EXTERNAL_LINK));
56
73
 
@@ -19,6 +19,10 @@
19
19
  background-color: $color-banner-bg-dark;
20
20
  }
21
21
 
22
+ &__license {
23
+ @extend .ons-u-fs-s;
24
+ }
25
+
22
26
  &__ogl-img {
23
27
  margin: 0 0.5rem 0.2rem 0;
24
28
  max-width: 100%;
@@ -37,10 +41,6 @@
37
41
  .ons-list__link {
38
42
  margin-right: 0;
39
43
  }
40
-
41
- .ons-poweredbylogo {
42
- min-height: 1.5rem;
43
- }
44
44
  }
45
45
 
46
46
  &--rows {
@@ -48,4 +48,19 @@
48
48
  margin-bottom: 0.5rem !important;
49
49
  }
50
50
  }
51
+
52
+ &__poweredby,
53
+ &__crest,
54
+ &__partnership {
55
+ font-size: 0;
56
+ }
57
+
58
+ &__partnership {
59
+ &-prefix {
60
+ @extend .ons-u-fs-s;
61
+
62
+ margin-bottom: 0.2rem;
63
+ margin-top: -0.3rem;
64
+ }
65
+ }
51
66
  }
@@ -9,33 +9,38 @@
9
9
  {% set lang = 'en' %}
10
10
  {% endif %}
11
11
 
12
+ {% set onsLogo %}
13
+ {% if params.lang == 'cy' %}
14
+ {{
15
+ onsIcon({
16
+ "iconType": 'ons-logo-cy',
17
+ "altText": 'Swyddfa Ystadegau Gwladol',
18
+ "altTextId": 'ons-logo-cy-footer-alt'
19
+ })
20
+ }}
21
+ {% else %}
22
+ {{
23
+ onsIcon({
24
+ "iconType": 'ons-logo-en',
25
+ "altText": 'Office for National Statistics',
26
+ "altTextId": 'ons-logo-en-footer-alt'
27
+ })
28
+ }}
29
+ {% endif %}
30
+ {% endset %}
31
+
12
32
  {% set poweredByLogo %}
13
-
14
33
  {% if params.poweredBy is defined and params.poweredBy and params.poweredBy.logo is defined and params.poweredBy.logo %}
15
34
  {{
16
35
  onsIcon({
17
36
  "iconType": params.poweredBy.logo,
18
- "altText": params.poweredBy.alt | default("Office for National Statistics")
37
+ "altText": params.poweredBy.alt,
38
+ "altTextId": 'poweredby-alt'
19
39
  })
20
40
  }}
21
41
  {% else %}
22
- {% if params.lang == 'cy' %}
23
- {{
24
- onsIcon({
25
- "iconType": 'ons-logo-cy',
26
- "altText": params.poweredBy.alt | default('Swyddfa Ystadegau Gwladol')
27
- })
28
- }}
29
- {% else %}
30
- {{
31
- onsIcon({
32
- "iconType": 'ons-logo-en',
33
- "altText": params.poweredBy.alt | default('Office for National Statistics')
34
- })
35
- }}
36
- {% endif %}
42
+ {{ onsLogo | safe }}
37
43
  {% endif %}
38
-
39
44
  {% endset %}
40
45
 
41
46
  <footer class="ons-footer">
@@ -81,12 +86,6 @@
81
86
  <div class="ons-footer__body{{ ' ' + params.classes if params.classes else '' }}" data-analytics="footer" {% if params.attributes is defined and params.attributes %}{% for attribute, value in (params.attributes) %}{{attribute}}="{{value}}" {% endfor %}{% endif %}>
82
87
  <div class="ons-container{{ ' ons-container--wide' if params.wide }}">
83
88
  <div class="ons-grid">
84
- {% if params.poweredBy is defined and params.poweredBy and params.OGLLink is defined and params.OGLLink %}
85
- <div class="ons-grid__col ons-u-mb-m">
86
- {{ poweredByLogo | safe }}
87
- </div>
88
- {% endif %}
89
-
90
89
  {% if params.newTabWarning is defined and params.newTabWarning %}
91
90
  <div class="ons-grid__col">
92
91
  <p class="ons-u-fs-s ons-u-mb-m ons-footer__new-tab-warning">{{ params.newTabWarning | safe }}</p>
@@ -95,6 +94,7 @@
95
94
 
96
95
  {% if params.cols is defined and params.cols %}
97
96
  {% for col in params.cols %}
97
+ <!-- Full footer columns -->
98
98
  <div class="ons-grid__col ons-col-4@m{{ ' ons-u-mt-m@xxs@m' if loop.index > 1 }}">
99
99
  {% if col.title %}
100
100
  <h2 class="ons-footer__heading ons-u-fs-r--b">{{ col.title }}</h2>
@@ -108,17 +108,9 @@
108
108
  }}
109
109
  </div>
110
110
  {% endfor %}
111
- {% endif %}
112
-
113
- {% if params.cols is defined and params.cols and params.rows is defined and params.rows %}
114
- <div class="ons-grid__col ons-u-mb-m">
115
- <hr class="ons-footer__hr">
116
- </div>
117
- {% endif %}
118
-
119
- {% if params.rows is defined and params.rows %}
111
+ {% elif params.rows is defined and params.rows %}
120
112
  {% for row in params.rows %}
121
- <!-- Rows -->
113
+ <!-- Transactional footer row -->
122
114
  <div class="ons-grid__col">
123
115
  {{
124
116
  onsList({
@@ -128,105 +120,119 @@
128
120
  })
129
121
  }}
130
122
  </div>
131
- {% if loop.length > 1 %}
132
- {% if not loop.last %}
133
- <div class="ons-grid__col ons-u-mb-m">
134
- <hr class="ons-footer__hr">
135
- </div>
136
- {% endif %}
137
- {% endif %}
138
123
  {% endfor %}
139
124
  {% endif %}
140
125
 
141
- {% if params.OGLLink is defined and params.OGLLink %}
142
- <!-- OGL -->
126
+ {% if (params.cols is defined and params.cols) or (params.rows is defined and params.rows) %}
143
127
  <div class="ons-grid__col ons-u-mb-m">
144
128
  <hr class="ons-footer__hr">
145
129
  </div>
146
-
147
- <div class="ons-grid__col">
148
- <div class="ons-footer__license">
149
- {{
150
- onsIcon({
151
- "iconType": 'ogl'
152
- })
153
- }}
154
- {% if params.OGLLink.HTML is defined and params.OGLLink.HTML %}
155
- {{ params.OGLLink.HTML | safe }}
156
- {% else %}
157
- {% from "components/external-link/_macro.njk" import onsExternalLink %}
158
- {{ params.OGLLink.pre }} {{
159
- onsExternalLink({
160
- "url": params.OGLLink.url,
161
- "linkText": params.OGLLink.link
162
- })
163
- }}{{ params.OGLLink.post }}
164
- {% endif %}
165
- </div>
166
- </div>
167
130
  {% endif %}
168
131
 
169
- {% if params.legal is defined and params.legal or params.rows is defined and params.rows and params.OGLLink is not defined or params.OGLLink is not defined and params.legal is not defined and (params.rows is defined and params.rows or params.cols is defined and params.cols) %}
170
- <div class="ons-grid__col ons-u-mb-m">
171
- <hr class="ons-footer__hr">
172
- </div>
173
- {% endif %}
174
-
175
- {% if params.OGLLink is not defined and params.legal is not defined %}
176
- <div class="ons-grid__col">
177
- {{ poweredByLogo | safe }}
178
- </div>
179
- {% endif %}
180
132
  </div>
181
133
 
182
- {% if params.legal is defined and params.legal or params.rows is defined and params.rows and params.OGLLink is not defined or params.cols is defined and params.cols and params.OGLLink is not defined %}
183
134
  <div class="ons-grid ons-grid--flex ons-grid--vertical-top ons-grid--between">
184
- {% if params.legal is defined and params.legal %}
185
- <!-- Legal -->
186
- {% for legal in params.legal %}
187
- <div class="ons-grid__col">
135
+ <div class="ons-grid__col">
136
+ {% if params.legal is defined and params.legal %}
137
+ <!-- Legal -->
138
+ {% for legal in params.legal %}
188
139
  {{
189
140
  onsList({
190
- "classes": 'ons-u-mb-m ons-footer--rows',
141
+ "classes": 'ons-u-mb-s ons-footer--rows',
191
142
  "variants": ['bare', 'inline'],
192
143
  "itemsList": legal.itemsList
193
144
  })
194
145
  }}
195
- {% if params.crest is defined and params.crest %}
196
- <div class="ons-poweredbylogo ons-u-mb-m">{{ poweredByLogo | safe }}</div>
146
+ {% endfor %}
147
+ {% endif %}
148
+
149
+ {% if params.OGLLink == true or params.OGLLink is defined %}
150
+ <!-- OGL -->
151
+ <div class="ons-footer__license ons-u-mb-m">
152
+ {{
153
+ onsIcon({
154
+ "iconType": 'ogl'
155
+ })
156
+ }}
157
+ {% if params.OGLLink.HTML is defined and params.OGLLink.HTML %}
158
+ {{ params.OGLLink.HTML | safe }}
159
+ {% elif params.OGLLink == true or params.OGLLink is defined %}
160
+ {% from "components/external-link/_macro.njk" import onsExternalLink %}
161
+ {% if params.lang == 'cy' %}
162
+ {{ params.OGLLink.pre | default('Mae’r holl gynnwys ar gael o dan y') }} {{
163
+ onsExternalLink({
164
+ "url": params.OGLLink.url | default('https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/'),
165
+ "linkText": params.OGLLink.link | default('Drwydded Llywodraeth Leol v3.0')
166
+ })
167
+ }}{{ params.OGLLink.post | default(', oni bai y nodir fel arall') }}
168
+ {% else %}
169
+ {{ params.OGLLink.pre | default('All content is available under the') }} {{
170
+ onsExternalLink({
171
+ "url": params.OGLLink.url | default('https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/'),
172
+ "linkText": params.OGLLink.link | default('Open Government Licence v3.0')
173
+ })
174
+ }}{{ params.OGLLink.post | default(', except where otherwise stated') }}
175
+ {% endif %}
197
176
  {% endif %}
198
177
  </div>
199
- {% endfor %}
200
- {% endif %}
178
+ {% endif %}
179
+
180
+ {% if not params.poweredBy.partnership %}
181
+ <div class="ons-footer__poweredby ons-u-mb-m">
182
+ {{ poweredByLogo | safe }}
183
+ </div>
184
+ {% endif %}
185
+ </div>
201
186
 
202
187
  {% if params.crest is defined and params.crest %}
203
188
  <!-- Crest -->
204
- <div class="ons-grid__col ons-footer__crest">
189
+ <div class="ons-grid__col ons-footer__crest ons-u-mb-m@xxs@l">
205
190
  {{
206
191
  onsIcon({
207
192
  "iconType": 'crest'
208
193
  })
209
194
  }}
210
195
  </div>
211
- {% elif params.legal is defined and params.legal %}
212
- <!-- Powered by -->
213
- <div class="ons-grid__col">
214
- <div class="ons-poweredbylogo">{{ poweredByLogo | safe }}</div>
215
- </div>
216
196
  {% endif %}
197
+ </div>
198
+
199
+ {% if (params.poweredBy is defined and params.poweredBy) and (params.poweredBy.partnership is defined and params.poweredBy.partnership) %}
200
+ <div class="ons-grid ons-grid--flex ons-grid--vertical-bottom ons-grid--between ons-u-mt-l">
201
+ <div class="ons-grid__col ons-footer__poweredby ons-u-mb-m">
202
+ {{ poweredByLogo | safe }}
203
+ </div>
217
204
 
205
+ <div class="ons-grid__col ons-footer__partnership ons-u-mb-m">
206
+ <div class="ons-footer__partnership-prefix">{{ params.poweredBy.partnership }}</div>
207
+ {% if params.lang == 'cy' %}
208
+ {{
209
+ onsIcon({
210
+ "iconType": 'ons-logo-cy',
211
+ "altText": 'Swyddfa Ystadegau Gwladol',
212
+ "altTextId": 'ons-logo-cy-footer-alt'
213
+ })
214
+ }}
215
+ {% else %}
216
+ {{
217
+ onsIcon({
218
+ "iconType": 'ons-logo-en',
219
+ "altText": 'Office for National Statistics',
220
+ "altTextId": 'ons-logo-en-footer-alt'
221
+ })
222
+ }}
223
+ {% endif %}
224
+ </div>
218
225
  </div>
219
226
  {% endif %}
220
227
 
221
228
  {% if params.copyrightDeclaration is defined and params.copyrightDeclaration %}
222
- <!-- Copyright -->
223
- <div class="ons-grid">
224
- <div class="ons-grid__col ons-u-mt-s">
225
- <p class="ons-u-fs-s ons-u-mb-no ons-footer__copyright">&copy; {{ params.copyrightDeclaration.copyright }} <br> {{ params.copyrightDeclaration.text }}</p>
226
- </div>
229
+ <!-- Copyright -->
230
+ <div class="ons-grid">
231
+ <div class="ons-grid__col">
232
+ <p class="ons-u-fs-s ons-u-mb-no ons-footer__copyright">&copy; {{ params.copyrightDeclaration.copyright }} <br> {{ params.copyrightDeclaration.text }}</p>
227
233
  </div>
234
+ </div>
228
235
  {% endif %}
229
-
230
236
  </div>
231
237
  </div>
232
238
  </footer>