@ons/design-system 65.0.0 → 65.2.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 (77) hide show
  1. package/components/access-code/access-code.scss +3 -3
  2. package/components/address-input/autosuggest.address.error.js +1 -1
  3. package/components/address-input/autosuggest.address.js +2 -2
  4. package/components/address-input/autosuggest.address.spec.js +5 -5
  5. package/components/autosuggest/_autosuggest.scss +9 -9
  6. package/components/autosuggest/_macro.njk +30 -31
  7. package/components/autosuggest/_macro.spec.js +18 -18
  8. package/components/autosuggest/autosuggest.spec.js +31 -31
  9. package/components/autosuggest/autosuggest.ui.js +8 -9
  10. package/components/button/_button.scss +11 -14
  11. package/components/card/_card.scss +14 -0
  12. package/components/card/_macro.njk +7 -8
  13. package/components/checkboxes/_checkbox.scss +1 -4
  14. package/components/checkboxes/example-checkboxes-with-revealed-checkboxes-expanded.njk +88 -0
  15. package/components/checkboxes/example-checkboxes-with-revealed-radios-expanded.njk +70 -0
  16. package/components/checkboxes/example-checkboxes-with-revealed-select-expanded.njk +72 -0
  17. package/components/checkboxes/example-checkboxes-with-revealed-text-input-expanded.njk +60 -0
  18. package/components/content-pagination/_content-pagination.scss +1 -1
  19. package/components/document-list/_macro.njk +5 -7
  20. package/components/document-list/_macro.spec.js +2 -2
  21. package/components/document-list/example-document-list-search-result-featured.njk +1 -1
  22. package/components/document-list/example-document-list-search-results.njk +3 -3
  23. package/components/download-resources/_download-resources.scss +3 -5
  24. package/components/external-link/example-external-link.njk +1 -1
  25. package/components/fieldset/_fieldset.scss +1 -1
  26. package/components/header/_macro.njk +4 -4
  27. package/components/header/example-header-external-with-navigation.njk +5 -5
  28. package/components/header/example-header-external-with-service-links.njk +3 -3
  29. package/components/header/example-header-external-with-sub-navigation.njk +10 -10
  30. package/components/header/example-header-internal.njk +2 -2
  31. package/components/header/example-header-neutral-for-multicoloured-logo.njk +6 -6
  32. package/components/helpers/_grid.scss +6 -0
  33. package/components/helpers/grid.njk +19 -0
  34. package/components/input/_input-type.scss +2 -8
  35. package/components/input/_input.scss +4 -3
  36. package/components/list/_list.scss +5 -2
  37. package/components/list/_macro.njk +22 -10
  38. package/components/list/_macro.spec.js +42 -0
  39. package/components/modal/_modal.scss +3 -6
  40. package/components/navigation/_macro.njk +6 -6
  41. package/components/navigation/_macro.spec.js +4 -4
  42. package/components/navigation/navigation.js +6 -2
  43. package/components/pagination/_macro.njk +17 -2
  44. package/components/pagination/_pagination.scss +14 -0
  45. package/components/phase-banner/example-phase-banner-alpha.njk +13 -2
  46. package/components/phase-banner/example-phase-banner-beta.njk +13 -2
  47. package/components/question/example-question-interviewer-note.njk +1 -1
  48. package/components/radios/example-radios-with-clear-button-expanded.njk +98 -0
  49. package/components/radios/example-radios-with-revealed-checkboxes-expanded.njk +70 -0
  50. package/components/radios/example-radios-with-revealed-radios-expanded.njk +69 -0
  51. package/components/radios/example-radios-with-revealed-select-expanded.njk +70 -0
  52. package/components/radios/example-radios-with-revealed-text-input-expanded.njk +81 -0
  53. package/components/relationships/_macro.spec.js +9 -11
  54. package/components/relationships/example-relationships-error.njk +28 -28
  55. package/components/relationships/example-relationships-you.njk +29 -29
  56. package/components/relationships/example-relationships.njk +28 -28
  57. package/components/relationships/relationships.spec.js +13 -13
  58. package/components/reply/_macro.njk +5 -2
  59. package/components/reply/_macro.spec.js +7 -1
  60. package/components/section-navigation/_macro.njk +2 -1
  61. package/components/section-navigation/_macro.spec.js +2 -13
  62. package/components/table/_table.scss +7 -3
  63. package/components/tabs/_macro.njk +5 -5
  64. package/components/tabs/_macro.spec.js +1 -1
  65. package/components/tabs/example-tabs-details.njk +3 -0
  66. package/components/tabs/example-tabs.njk +0 -1
  67. package/components/textarea/example-textarea-error.njk +4 -4
  68. package/css/main.css +3 -3
  69. package/css/print.css +1 -1
  70. package/js/cookies-settings.js +1 -1
  71. package/package.json +27 -30
  72. package/scripts/main.es5.js +1 -1
  73. package/scripts/main.js +1 -1
  74. package/scss/base/_global.scss +3 -2
  75. package/scss/main.scss +1 -0
  76. package/scss/overrides/hcm.scss +14 -14
  77. package/scss/print.scss +1 -1
@@ -4,12 +4,12 @@ import runFuse from './fuse-config';
4
4
 
5
5
  export const baseClass = 'ons-js-autosuggest';
6
6
 
7
- export const classAutosuggestOption = 'ons-autosuggest-input__option';
7
+ export const classAutosuggestOption = 'ons-autosuggest__option';
8
8
  export const classAutosuggestOptionFocused = `${classAutosuggestOption}--focused`;
9
9
  export const classAutosuggestOptionNoResults = `${classAutosuggestOption}--no-results`;
10
10
  export const classAutosuggestOptionMoreResults = `${classAutosuggestOption}--more-results ons-u-fs-s`;
11
- export const classAutosuggestHasResults = 'ons-autosuggest-input--has-results';
12
- export const classAutosuggestResultsTitle = 'ons-autosuggest-input__results-title';
11
+ export const classAutosuggestHasResults = 'ons-autosuggest--has-results';
12
+ export const classAutosuggestResultsTitle = 'ons-autosuggest__results-title';
13
13
 
14
14
  export default class AutosuggestUI {
15
15
  constructor({
@@ -117,7 +117,7 @@ export default class AutosuggestUI {
117
117
  this.input.setAttribute('autocomplete', this.input.getAttribute('autocomplete') || 'off');
118
118
  this.input.setAttribute('role', 'combobox');
119
119
 
120
- this.context.classList.add('ons-autosuggest-input--initialised');
120
+ this.context.classList.add('ons-autosuggest--initialised');
121
121
 
122
122
  this.bindEventListeners();
123
123
  }
@@ -350,8 +350,7 @@ export default class AutosuggestUI {
350
350
  listElement.setAttribute('id', `${this.listboxId}__option--${index}`);
351
351
  listElement.setAttribute('role', 'option');
352
352
  if (result.category) {
353
- innerHTML =
354
- innerHTML + `<span class="ons-autosuggest-input__category ons-u-lighter ons-u-fs-s ons-u-db">${result.category}</span>`;
353
+ innerHTML = innerHTML + `<span class="ons-autosuggest__category ons-u-lighter ons-u-fs-s ons-u-db">${result.category}</span>`;
355
354
  }
356
355
  listElement.innerHTML = innerHTML;
357
356
  listElement.addEventListener('click', () => {
@@ -434,7 +433,7 @@ export default class AutosuggestUI {
434
433
  option.classList.add(classAutosuggestOptionFocused);
435
434
  option.setAttribute('aria-selected', true);
436
435
  this.input.setAttribute('aria-activedescendant', option.getAttribute('id'));
437
- const groupedResult = option.querySelector('.ons-autosuggest-input__group');
436
+ const groupedResult = option.querySelector('.ons-autosuggest__group');
438
437
  const optionText = option.innerHTML.replace('<strong>', '').replace('</strong>', '');
439
438
  if (groupedResult) {
440
439
  let groupedAriaMsg = this.ariaGroupedResults.replace('{n}', groupedResult.innerHTML);
@@ -503,8 +502,8 @@ export default class AutosuggestUI {
503
502
  const warningBodyElement = document.createElement('div');
504
503
 
505
504
  warningListElement.setAttribute('aria-hidden', 'true');
506
- warningListElement.className = 'ons-autosuggest-input__warning';
507
- warningElement.className = 'ons-panel ons-panel--warn ons-autosuggest-input__panel';
505
+ warningListElement.className = 'ons-autosuggest__warning';
506
+ warningElement.className = 'ons-panel ons-panel--warn ons-autosuggest__panel';
508
507
 
509
508
  warningSpanElement.className = 'ons-panel__icon';
510
509
  warningSpanElement.setAttribute('aria-hidden', 'true');
@@ -15,19 +15,16 @@ $button-shadow-size: 3px;
15
15
  position: relative;
16
16
  text-align: center;
17
17
  text-decoration: none;
18
- text-rendering: optimizeLegibility;
18
+ text-rendering: optimizelegibility;
19
19
  vertical-align: top;
20
20
  white-space: nowrap;
21
21
 
22
22
  // Transparent border for IE11 High Contrast mode support due to 'border: 0' on buttons
23
23
  &::after {
24
24
  border: ems($button-shadow-size) solid transparent;
25
- bottom: -(ems($button-shadow-size)); // makes sure button shadow is selectable
25
+ inset: 0 0 - (ems($button-shadow-size)) 0; // makes sure button shadow is selectable
26
26
  content: '';
27
- left: 0;
28
27
  position: absolute;
29
- right: 0;
30
- top: 0;
31
28
  }
32
29
 
33
30
  &--search {
@@ -172,8 +169,8 @@ $button-shadow-size: 3px;
172
169
  text-decoration: none;
173
170
  }
174
171
 
175
- &--link:focus:not(:active):not(&--secondary) &,
176
- &--link:focus:hover:not(:active):not(&--secondary) & {
172
+ &--link:focus:not(:active, &--secondary) &,
173
+ &--link:focus:hover:not(:active, &--secondary) & {
177
174
  outline: inherit;
178
175
 
179
176
  &__inner {
@@ -245,7 +242,8 @@ $button-shadow-size: 3px;
245
242
  &--text-link:active:focus & {
246
243
  &__inner {
247
244
  background-color: var(--ons-color-focus);
248
- box-shadow: 0 -2px var(--ons-color-focus), 0 4px var(--ons-color-text-link-focus) !important;
245
+ box-shadow: 0 -2px var(--ons-color-focus),
246
+ 0 4px var(--ons-color-text-link-focus) !important;
249
247
  color: var(--ons-color-text-link-focus);
250
248
  .ons-icon {
251
249
  fill: var(--ons-color-text-link-focus);
@@ -256,7 +254,7 @@ $button-shadow-size: 3px;
256
254
  &--ghost & {
257
255
  &__inner {
258
256
  background: transparent;
259
- border: 2px solid rgba(255, 255, 255, 0.6);
257
+ border: 2px solid rgb(255 255 255 / 60%);
260
258
  box-shadow: none;
261
259
  color: var(--ons-color-text-inverse);
262
260
  .ons-icon {
@@ -314,7 +312,7 @@ $button-shadow-size: 3px;
314
312
 
315
313
  &--ghost:hover & {
316
314
  &__inner {
317
- background: rgba(0, 0, 0, 0.1);
315
+ background: rgb(0 0 0 / 10%);
318
316
  border-color: var(--ons-color-white);
319
317
  }
320
318
  }
@@ -323,8 +321,8 @@ $button-shadow-size: 3px;
323
321
  &--ghost:active:focus &,
324
322
  &--ghost.active & {
325
323
  &__inner {
326
- background: rgba(0, 0, 0, 0.2);
327
- border-color: rgba(255, 255, 255, 0.6);
324
+ background: rgb(0 0 0 / 20%);
325
+ border-color: rgb(255 255 255 / 60%);
328
326
  color: var(--ons-color-text-inverse);
329
327
  .ons-icon {
330
328
  fill: var(--ons-color-text-inverse);
@@ -514,8 +512,7 @@ $button-shadow-size: 3px;
514
512
 
515
513
  align-items: baseline;
516
514
  display: flex;
517
- flex-direction: row;
518
- flex-wrap: wrap;
515
+ flex-flow: row wrap;
519
516
 
520
517
  & .ons-btn,
521
518
  & a {
@@ -1,6 +1,20 @@
1
1
  .ons-card {
2
2
  margin: 0 0 2rem;
3
3
  width: 100%;
4
+
5
+ &__link {
6
+ display: flex;
7
+ flex-direction: column;
8
+ }
9
+
10
+ &__image--reorder {
11
+ order: 1;
12
+ }
13
+
14
+ &__title--reorder {
15
+ order: 2;
16
+ }
17
+
4
18
  &__link:hover {
5
19
  text-decoration-thickness: 3px;
6
20
  }
@@ -4,21 +4,20 @@
4
4
 
5
5
  {% set titleSize = params.titleSize | default('2') %}
6
6
 
7
- <div class="ons-card" aria-describedBy="{{ params.textId }}">
7
+ <div class="ons-card">
8
8
 
9
9
  {%- if params.image -%}
10
10
  {%- if params.url -%}
11
- <a href="{{ params.url }}" class="ons-card__link ons-u-db">
11
+ <a href="{{ params.url }}" class="ons-card__link">
12
12
  {%- endif -%}
13
+ <h{{ titleSize }} class="ons-card__title ons-card__title--reorder {{ params.titleClasses | default('ons-u-fs-m')}}" id="{{ params.id }}">
14
+ {{ params.title }}
15
+ </h{{ titleSize }}>
13
16
  {% if params.image.smallSrc %}
14
- <img class="ons-card__image ons-u-mb-s" height="200" width="303"{% if params.image.largeSrc %} srcset="{{ params.image.smallSrc }} 1x, {{ params.image.largeSrc }} 2x"{% endif %} src="{{ params.image.smallSrc }}" alt="{{ params.image.alt }}" loading="lazy">
17
+ <img class="ons-card__image ons-u-mb-s ons-card__image--reorder" height="200" width="303"{% if params.image.largeSrc %} srcset="{{ params.image.smallSrc }} 1x, {{ params.image.largeSrc }} 2x"{% endif %} src="{{ params.image.smallSrc }}" alt="{{ params.image.alt }}" loading="lazy">
15
18
  {% elif params.image == true or params.image.placeholderURL %}
16
- <img class="ons-card__image ons-u-mb-s" height="100" width="303" srcset="{{ params.image.placeholderURL if params.image.placeholderURL }}/img/small/placeholder-card.png 1x, {{ params.image.placeholderURL if params.image.placeholderURL }}/img/large/placeholder-card.png 2x" src="{{ params.image.placeholderURL if params.image.placeholderURL }}/img/small/placeholder-card.png" alt="" loading="lazy">
19
+ <img class="ons-card__image ons-u-mb-s ons-card__image--reorder" height="100" width="303" srcset="{{ params.image.placeholderURL if params.image.placeholderURL }}/img/small/placeholder-card.png 1x, {{ params.image.placeholderURL if params.image.placeholderURL }}/img/large/placeholder-card.png 2x" src="{{ params.image.placeholderURL if params.image.placeholderURL }}/img/small/placeholder-card.png" alt="" loading="lazy">
17
20
  {% endif %}
18
-
19
- <h{{ titleSize }} class="ons-card__title {{ params.titleClasses | default('ons-u-fs-m')}}" id="{{ params.id }}">
20
- {{ params.title }}
21
- </h{{ titleSize }}>
22
21
  {%- if params.url -%}
23
22
  </a>
24
23
  {%- endif -%}
@@ -156,12 +156,9 @@ $checkbox-padding: 11px;
156
156
  background: var(--ons-color-white);
157
157
  border: 1px solid var(--ons-color-input-border);
158
158
  border-radius: 3px;
159
- bottom: 0;
159
+ inset: 0;
160
160
  content: '';
161
- left: 0;
162
161
  position: absolute;
163
- right: 0;
164
- top: 0;
165
162
  z-index: -1;
166
163
  }
167
164
 
@@ -0,0 +1,88 @@
1
+ {% from "components/checkboxes/_macro.njk" import onsCheckboxes %}
2
+
3
+ {{
4
+ onsCheckboxes({
5
+ "legend": "Content type",
6
+ "checkboxesLabel": "Show only:",
7
+ "borderless": true,
8
+ "name": "dietary",
9
+ "checkboxes": [
10
+ {
11
+ "id": "data",
12
+ "label": {
13
+ "text": "Data (309)"
14
+ },
15
+ "value": "data",
16
+ "checked": true,
17
+ "other": {
18
+ "otherType": "checkboxes",
19
+ "selectAllChildren": true,
20
+ "legend": "Data type",
21
+ "legendClasses": "ons-u-vh",
22
+ "name": "name",
23
+ "checkboxes": [
24
+ {
25
+ "id": "datasets",
26
+ "label": {
27
+ "text": "Datasets (100)"
28
+ },
29
+ "value": "datasets"
30
+ },
31
+ {
32
+ "id": "timeseries",
33
+ "label": {
34
+ "text": "Timeseries (20)"
35
+ },
36
+ "value": "timeseries"
37
+ },
38
+ {
39
+ "id": "requested",
40
+ "label": {
41
+ "text": "User requested data (17)"
42
+ },
43
+ "value": "requested"
44
+ }
45
+ ]
46
+ }
47
+ },
48
+ {
49
+ "id": "publications",
50
+ "label": {
51
+ "text": "Publications (137)"
52
+ },
53
+ "value": "publications",
54
+ "checked": true,
55
+ "other": {
56
+ "otherType": "checkboxes",
57
+ "selectAllChildren": true,
58
+ "legend": "Publication type",
59
+ "legendClasses": "ons-u-vh",
60
+ "name": "name",
61
+ "checkboxes": [
62
+ {
63
+ "id": "press-release",
64
+ "label": {
65
+ "text": "Press release (100)"
66
+ },
67
+ "value": "pressrelease"
68
+ },
69
+ {
70
+ "id": "bulletin",
71
+ "label": {
72
+ "text": "Bulletin (20)"
73
+ },
74
+ "value": "bulletin"
75
+ }
76
+ ]
77
+ }
78
+ },
79
+ {
80
+ "id": "areas",
81
+ "label": {
82
+ "text": "Areas (0)"
83
+ },
84
+ "value": "areas"
85
+ }
86
+ ]
87
+ })
88
+ }}
@@ -0,0 +1,70 @@
1
+ {% from "components/checkboxes/_macro.njk" import onsCheckboxes %}
2
+
3
+ {{
4
+ onsCheckboxes({
5
+ "checkboxesLabel": "Select all that apply",
6
+ "legend": "How would you like us to contact you?",
7
+ "name": "contact",
8
+ "borderless": true,
9
+ "checkboxes": [
10
+ {
11
+ "id": "post",
12
+ "label": {
13
+ "text": "By post"
14
+ },
15
+ "value": "post"
16
+ },
17
+ {
18
+ "id": "email",
19
+ "label": {
20
+ "text": "By email"
21
+ },
22
+ "value": "email"
23
+ },
24
+ {
25
+ "id": "phone",
26
+ "label": {
27
+ "text": "By phone"
28
+ },
29
+ "value": "phone",
30
+ "checked": true,
31
+ "other": {
32
+ "otherType": "radios",
33
+ "id": "phone-time",
34
+ "name": "phone-time",
35
+ "legend": "Choose preferred time of day",
36
+ "radios": [
37
+ {
38
+ "value": "anytime",
39
+ "id": "anytime",
40
+ "label": {
41
+ "text": "Any time of day"
42
+ }
43
+ },
44
+ {
45
+ "value": "morning",
46
+ "id": "morning",
47
+ "label": {
48
+ "text": "Morning"
49
+ }
50
+ },
51
+ {
52
+ "value": "afternoon",
53
+ "id": "afternoon",
54
+ "label": {
55
+ "text": "Afternoon"
56
+ }
57
+ },
58
+ {
59
+ "value": "evening",
60
+ "id": "evening",
61
+ "label": {
62
+ "text": "Evening"
63
+ }
64
+ }
65
+ ]
66
+ }
67
+ }
68
+ ]
69
+ })
70
+ }}
@@ -0,0 +1,72 @@
1
+ {% from "components/question/_macro.njk" import onsQuestion %}
2
+ {% from "components/checkboxes/_macro.njk" import onsCheckboxes %}
3
+
4
+ {% call onsQuestion({
5
+ "title": "How would you like us to contact you?",
6
+ "legendIsQuestionTitle": true,
7
+ "classes": "ons-u-mt-no"
8
+ }) %}
9
+ {{
10
+ onsCheckboxes({
11
+ "checkboxesLabel": "Select all that apply",
12
+ "dontWrap": true,
13
+ "name": "contact",
14
+ "checkboxes": [
15
+ {
16
+ "id": "post",
17
+ "label": {
18
+ "text": "By post"
19
+ },
20
+ "value": "post"
21
+ },
22
+ {
23
+ "id": "email",
24
+ "label": {
25
+ "text": "By email"
26
+ },
27
+ "value": "email"
28
+ },
29
+ {
30
+ "id": "phone",
31
+ "label": {
32
+ "text": "By phone"
33
+ },
34
+ "value": "phone",
35
+ "checked": true,
36
+ "other": {
37
+ "otherType": "select",
38
+ "id": "phone-time",
39
+ "name": "phone-time",
40
+ "label": {
41
+ "text": "Choose preferred time of day"
42
+ },
43
+ "options": [
44
+ {
45
+ "value": "",
46
+ "text": "Select an option",
47
+ "disabled": true,
48
+ "selected": true
49
+ },
50
+ {
51
+ "value": "anytime",
52
+ "text": "Anytime of day"
53
+ },
54
+ {
55
+ "value": "morning",
56
+ "text": "Morning"
57
+ },
58
+ {
59
+ "value": "afternoon",
60
+ "text": "Afternoon"
61
+ },
62
+ {
63
+ "value": "evening",
64
+ "text": "Evening"
65
+ }
66
+ ]
67
+ }
68
+ }
69
+ ]
70
+ })
71
+ }}
72
+ {% endcall %}
@@ -0,0 +1,60 @@
1
+ {% from "components/question/_macro.njk" import onsQuestion %}
2
+ {% from "components/checkboxes/_macro.njk" import onsCheckboxes %}
3
+
4
+ {% call onsQuestion({
5
+ "title": "Do you have any dietary requirements?",
6
+ "legendIsQuestionTitle": true,
7
+ "classes": "ons-u-mt-no"
8
+ }) %}
9
+ {{
10
+ onsCheckboxes({
11
+ "checkboxesLabel": "Select all that apply",
12
+ "dontWrap": true,
13
+ "checkboxes": [
14
+ {
15
+ "id": "gluten-free",
16
+ "label": {
17
+ "text": "Gluten free"
18
+ },
19
+ "value": "gluten-free"
20
+ },
21
+ {
22
+ "id": "lactose-intolerant",
23
+ "label": {
24
+ "text": "Lactose intolerant"
25
+ },
26
+ "value": "lactose-intolerant"
27
+ },
28
+ {
29
+ "id": "vegan",
30
+ "label": {
31
+ "text": "Vegan"
32
+ },
33
+ "value": "vegan"
34
+ },
35
+ {
36
+ "id": "vegetarian",
37
+ "label": {
38
+ "text": "Vegetarian"
39
+ },
40
+ "value": "vegetarian"
41
+ },
42
+ {
43
+ "id": "other-checkbox",
44
+ "label": {
45
+ "text": "Other"
46
+ },
47
+ "value": "other",
48
+ "checked": true,
49
+ "other": {
50
+ "id": "other-textbox",
51
+ "name": "other-answer",
52
+ "label": {
53
+ "text": "Enter dietary requirements"
54
+ }
55
+ }
56
+ }
57
+ ]
58
+ })
59
+ }}
60
+ {% endcall %}
@@ -37,7 +37,7 @@
37
37
  }
38
38
 
39
39
  &__link-text {
40
- @extend .ons-u-fs-m;
40
+ @extend .ons-u-fs-r--b;
41
41
 
42
42
  margin: 0 0 0 0.5rem;
43
43
  vertical-align: middle;
@@ -2,9 +2,9 @@
2
2
  <ul{% if params.id %} id="{{ params.id }}"{% endif %} class="ons-document-list{{ ' ' + params.classes if params.classes else '' }}"{% 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 %}>
3
3
  {% for document in params.documents %}
4
4
 
5
- <li class="ons-document-list__item{{ ' ons-document-list__item--featured' if document.featured }}{{ ' ons-document-list__item--full-width' if document.fullWidth == true }}{{ ' ' + document.classes if document.classes else '' }}"{% if document.attributes %}{% for attribute, value in (document.attributes.items() if document.attributes is mapping and document.attributes.items else document.attributes) %} {{attribute}}="{{value}}"{% endfor %}{% endif %}>
5
+ <li class="ons-document-list__item{{ ' ons-document-list__item--featured' if document.featured }}{{ ' ons-document-list__item--full-width' if document.featured and document.fullWidth == true }}{{ ' ' + document.classes if document.classes else '' }}"{% if document.attributes %}{% for attribute, value in (document.attributes.items() if document.attributes is mapping and document.attributes.items else document.attributes) %} {{attribute}}="{{value}}"{% endfor %}{% endif %}>
6
6
 
7
- {% if document.fullWidth == true %}
7
+ {% if document.featured and document.fullWidth == true %}
8
8
 
9
9
  <div class="ons-container{{ ' ons-container--wide' if document.wide == true }}">
10
10
 
@@ -50,10 +50,8 @@
50
50
 
51
51
  {%- if document.metadata.date %}
52
52
  <li class="ons-document-list__item-attribute">
53
- {% if document.metadata.date -%}
54
- {% set prefixClasses = "ons-u-fw-b" if document.metadata.date.showPrefix == true else "ons-u-vh" %}
55
- <span class="{{ prefixClasses }}">{{ document.metadata.date.prefix | default("Published") }}: </span>
56
- {%- endif -%}
53
+ {% set prefixClasses = "ons-u-fw-b" if document.metadata.date.showPrefix == true else "ons-u-vh" %}
54
+ <span class="{{ prefixClasses }}">{{ document.metadata.date.prefix | default("Published") }}: </span>
57
55
  {% if document.metadata.date.iso -%}
58
56
  <time datetime="{{ document.metadata.date.iso }}">{{ document.metadata.date.short }}</time>
59
57
  {%- endif %}
@@ -99,7 +97,7 @@
99
97
 
100
98
  </div>
101
99
 
102
- {% if document.fullWidth == true %}
100
+ {% if document.featured and document.fullWidth == true %}
103
101
 
104
102
  </div>
105
103
 
@@ -117,7 +117,7 @@ describe('macro: document list', () => {
117
117
  it('has the correct container if `fullWidth`', () => {
118
118
  const $ = cheerio.load(
119
119
  renderComponent('document-list', {
120
- documents: [{ ...EXAMPLE_DOCUMENT_LIST_BASIC, fullWidth: true }],
120
+ documents: [{ ...EXAMPLE_DOCUMENT_LIST_BASIC, featured: true, fullWidth: true }],
121
121
  }),
122
122
  );
123
123
 
@@ -127,7 +127,7 @@ describe('macro: document list', () => {
127
127
  it('has the correct container class if `fullWidth` and `wide`', () => {
128
128
  const $ = cheerio.load(
129
129
  renderComponent('document-list', {
130
- documents: [{ ...EXAMPLE_DOCUMENT_LIST_BASIC, fullWidth: true, wide: true }],
130
+ documents: [{ ...EXAMPLE_DOCUMENT_LIST_BASIC, featured: true, fullWidth: true, wide: true }],
131
131
  }),
132
132
  );
133
133
 
@@ -12,7 +12,7 @@
12
12
  "text": 'Topic'
13
13
  }
14
14
  },
15
- "description": '<p>Figures on <em class="ons-highlight">crime</em> levels and trends for England and Wales based primarily on two sets of statistics: the <em class="ons-highlight">Crime</em> Survey for England and Wales (CSEW) and police recorded crime data.</p>
15
+ "description": '<p>Figures on <strong class="ons-highlight">crime</strong> levels and trends for England and Wales based primarily on two sets of statistics: the <strong class="ons-highlight">Crime</strong> Survey for England and Wales (CSEW) and police recorded crime data.</p>
16
16
  <p>View all <a href="#0">datasets</a> or <a href="#0">publications</a> related to <a href="#0">Crime and justice</a></p>'
17
17
  }
18
18
  ]
@@ -12,7 +12,7 @@
12
12
  "text": 'Topic'
13
13
  }
14
14
  },
15
- "description": '<p>Figures on <em class="ons-highlight">crime</em> levels and trends for England and Wales based primarily on two sets of statistics: the <em class="ons-highlight">Crime</em> Survey for England and Wales (CSEW) and police recorded <em class="ons-highlight">crime</em> data.</p>
15
+ "description": '<p>Figures on <strong class="ons-highlight">crime</strong> levels and trends for England and Wales based primarily on two sets of statistics: the <strong class="ons-highlight">Crime</strong> Survey for England and Wales (CSEW) and police recorded <strong class="ons-highlight">crime</strong> data.</p>
16
16
  <p>View all <a href="#0">datasets</a> or <a href="#0">publications</a> related to <a href="#0">Crime and justice</a></p>'
17
17
  },
18
18
  {
@@ -29,7 +29,7 @@
29
29
  "short": '18 February 2021'
30
30
  }
31
31
  },
32
- "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 <em class="ons-highlight">Crime</em> Survey for England and Wales (CSEW) data.</p>'
32
+ "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 <strong class="ons-highlight">Crime</strong> Survey for England and Wales (CSEW) data.</p>'
33
33
  },
34
34
  {
35
35
  "url": '#0',
@@ -45,7 +45,7 @@
45
45
  "short": '2 December 2019'
46
46
  }
47
47
  },
48
- "description": '<p>An overview of published data on disability and <em class="ons-highlight">crime</em> 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>'
48
+ "description": '<p>An overview of published data on disability and <strong class="ons-highlight">crime</strong> 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>'
49
49
  },
50
50
  {
51
51
  "url": '#0',
@@ -49,22 +49,20 @@
49
49
 
50
50
  &__panel--is-visible {
51
51
  background-color: var(--ons-color-white);
52
- bottom: 0;
52
+ inset: 0;
53
53
  display: block;
54
54
  height: calc(100% - 76px); // Height of action buttons
55
- left: 0;
56
55
  overflow-y: scroll;
57
56
  padding: 1rem;
58
57
  position: fixed;
59
- right: 0;
60
- top: 0;
61
58
  z-index: 10;
62
59
  }
63
60
 
64
61
  &__actions {
65
62
  background-color: var(--ons-color-white);
66
63
  bottom: 0;
67
- box-shadow: 0 0 5px 0 rgba(34, 34, 34, 0.5), 0 -1px 0 0 rgba(65, 64, 66, 0.5);
64
+ box-shadow: 0 0 5px 0 rgb(34 34 34 / 50%),
65
+ 0 -1px 0 0 rgb(65 64 66 / 50%);
68
66
  display: flex;
69
67
  left: 0;
70
68
  padding: 1rem;
@@ -2,7 +2,7 @@
2
2
 
3
3
  <p>This is a paragraph of text with a {{
4
4
  onsExternalLink({
5
- "url": "#1",
5
+ "url": "#0",
6
6
  "linkText": "link to an external website"
7
7
  })
8
8
  }}</p>
@@ -10,7 +10,7 @@
10
10
  margin: 0;
11
11
  padding: 0 0 1.5rem;
12
12
 
13
- em,
13
+ strong,
14
14
  .ons-highlight {
15
15
  @extend .ons-highlight;
16
16
  }