@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.
- package/components/access-code/_macro.njk +4 -4
- package/components/access-code/_macro.spec.js +8 -8
- package/components/access-code/example-access-code-error.njk +2 -2
- package/components/access-code/example-access-code.njk +2 -2
- package/components/accordion/_macro.njk +1 -1
- package/components/accordion/_macro.spec.js +1 -1
- package/components/address-input/_macro.njk +7 -7
- package/components/address-input/_macro.spec.js +16 -15
- package/components/address-input/autosuggest.address.error.js +1 -1
- package/components/address-input/autosuggest.address.js +25 -25
- package/components/address-input/autosuggest.address.spec.js +6 -5
- package/components/address-input/example-address-input-editable.njk +5 -4
- package/components/address-input/example-address-input.njk +4 -5
- package/components/autosuggest/_autosuggest.scss +8 -8
- package/components/autosuggest/_macro.njk +5 -5
- package/components/autosuggest/autosuggest.spec.js +1 -1
- package/components/back-to-top/_back-to-top.scss +2 -2
- package/components/back-to-top/example-full-page-back-to-top.njk +6 -6
- package/components/breadcrumbs/_breadcrumbs.scss +1 -1
- package/components/button/_button.scss +24 -16
- package/components/button/_macro.njk +3 -3
- package/components/button/example-button-custom.njk +1 -1
- package/components/card/_card.scss +0 -6
- package/components/card/_macro.njk +9 -9
- package/components/card/_macro.spec.js +57 -24
- package/components/card/example-card-set-with-images.njk +30 -18
- package/components/card/example-card-set-with-lists.njk +57 -45
- package/components/card/example-card-set.njk +27 -15
- package/components/card/example-card.njk +9 -5
- package/components/char-check-limit/_macro.njk +1 -1
- package/components/checkboxes/_checkbox.scss +4 -4
- package/components/checkboxes/_checkboxes.scss +1 -1
- package/components/checkboxes/example-checkboxes-with-hidden-label.njk +4 -4
- package/components/cookies-banner/_cookies-banner.scss +5 -5
- package/components/cookies-banner/_macro.njk +15 -13
- package/components/cookies-banner/_macro.spec.js +1 -1
- package/components/details/_details.scss +5 -6
- package/components/details/_macro.njk +4 -4
- package/components/details/_macro.spec.js +1 -1
- package/components/document-list/_document-list.scss +0 -2
- package/components/document-list/_macro.njk +18 -18
- package/components/document-list/_macro.spec.js +16 -14
- package/components/document-list/example-document-list-article-featured.njk +5 -3
- package/components/document-list/example-document-list-articles.njk +15 -9
- package/components/document-list/example-document-list-downloads.njk +15 -9
- package/components/document-list/example-document-list-search-result-featured.njk +5 -3
- package/components/document-list/example-document-list-search-results.njk +20 -12
- package/components/download-resources/_download-resources.scss +1 -2
- package/components/download-resources/download-resources.spec.js +12 -6
- package/components/external-link/_macro.njk +1 -1
- package/components/external-link/_macro.spec.js +1 -1
- package/components/external-link/example-external-link.njk +1 -1
- package/components/feedback/_macro.njk +1 -1
- package/components/feedback/_macro.spec.js +3 -3
- package/components/feedback/example-feedback-call-to-action.njk +1 -1
- package/components/field/_field-group.scss +0 -2
- package/components/field/_field.scss +1 -2
- package/components/fieldset/_fieldset.scss +2 -2
- package/components/fieldset/_macro.njk +1 -1
- package/components/fieldset/_macro.spec.js +1 -1
- package/components/footer/_footer.scss +12 -7
- package/components/footer/_macro.njk +54 -34
- package/components/footer/_macro.spec.js +90 -28
- package/components/footer/example-footer-cymraeg.njk +1 -1
- package/components/footer/example-footer-transactional.njk +1 -1
- package/components/footer/example-footer-warning.njk +1 -1
- package/components/footer/example-footer-with-alternative-organisation.njk +99 -94
- package/components/footer/example-footer-with-coat-of-arms.njk +1 -1
- package/components/footer/example-footer-with-copyright.njk +1 -1
- package/components/footer/example-footer-with-multiple-logos-and-split-display.njk +173 -0
- package/components/footer/example-footer-with-multiple-logos.njk +172 -0
- package/components/footer/example-footer.njk +1 -1
- package/components/header/_header.scss +7 -14
- package/components/header/_macro.njk +19 -19
- package/components/header/_macro.spec.js +17 -17
- package/components/header/example-header-external-for-surveys.njk +2 -2
- package/components/header/example-header-external-welsh.njk +2 -2
- package/components/header/example-header-external-with-sub-navigation-removed.njk +1 -1
- package/components/header/example-header-external-with-sub-navigation.njk +1 -1
- package/components/header/example-header-multiple-logos.njk +4 -4
- package/components/hero/_hero.scss +6 -8
- package/components/hero/_macro.njk +1 -1
- package/components/icon/_icon.scss +4 -4
- package/components/icon/_macro.njk +4 -4
- package/components/icon/_macro.spec.js +2 -2
- package/components/image/_image.scss +1 -1
- package/components/image/_macro.njk +1 -1
- package/components/image/_macro.spec.js +10 -10
- package/components/image/example-image-for-regular-screens.njk +1 -1
- package/components/input/_input-type.scss +0 -2
- package/components/input/_input.scss +10 -10
- package/components/input/_macro.njk +4 -2
- package/components/input/example-input-search-with-character-check.njk +1 -1
- package/components/input/example-input-search.njk +1 -1
- package/components/label/_label.scss +1 -3
- package/components/language-selector/_macro.njk +3 -3
- package/components/language-selector/_macro.spec.js +7 -7
- package/components/list/_list.scss +1 -5
- package/components/list/_macro.njk +9 -10
- package/components/list/_macro.spec.js +50 -9
- package/components/list/example-inline-list-with-social-icon-prefix.njk +1 -1
- package/components/message/_macro.njk +3 -3
- package/components/message/_macro.spec.js +3 -3
- package/components/message-list/_macro.njk +2 -2
- package/components/message-list/_macro.spec.js +8 -4
- package/components/message-list/_message-list.scss +2 -2
- package/components/navigation/_macro.njk +9 -9
- package/components/navigation/_macro.spec.js +2 -2
- package/components/navigation/_navigation.scss +2 -6
- package/components/navigation/navigation.dom.js +1 -1
- package/components/navigation/navigation.spec.js +4 -4
- package/components/pagination/_macro.njk +2 -2
- package/components/pagination/_pagination.scss +1 -7
- package/components/panel/_macro.njk +5 -4
- package/components/panel/_macro.spec.js +2 -2
- package/components/panel/_panel.scss +12 -8
- package/components/password/_macro.njk +1 -1
- package/components/password/_macro.spec.js +2 -2
- package/components/phase-banner/_macro.njk +1 -1
- package/components/phase-banner/_phase-banner.scss +3 -4
- package/components/phase-banner/example-phase-banner-alpha.njk +1 -1
- package/components/phase-banner/example-phase-banner-beta.njk +1 -1
- package/components/question/_macro.njk +8 -8
- package/components/question/_macro.spec.js +3 -3
- package/components/question/_question.scss +3 -3
- package/components/radios/_macro.njk +1 -1
- package/components/radios/_macro.spec.js +1 -1
- package/components/radios/_radios.scss +1 -1
- package/components/radios/example-radios-with-clear-button-expanded.njk +1 -1
- package/components/radios/example-radios-with-clear-button.njk +1 -1
- package/components/related-content/_macro.spec.js +2 -2
- package/components/related-content/_related-content.scss +1 -1
- package/components/related-content/example-related-content-general.njk +2 -2
- package/components/related-content/example-related-content-social-media.njk +1 -1
- package/components/reply/_macro.njk +3 -1
- package/components/reply/_macro.spec.js +1 -1
- package/components/reply/reply.spec.js +1 -1
- package/components/section-navigation/_macro.njk +10 -10
- package/components/section-navigation/_macro.spec.js +15 -15
- package/components/section-navigation/_section-navigation.scss +4 -10
- package/components/section-navigation/example-section-navigation-single-vertical-with-title.njk +3 -3
- package/components/section-navigation/example-section-navigation-vertical.njk +14 -14
- package/components/section-navigation/example-section-navigation.njk +3 -3
- package/components/select/example-select-with-inline-label.njk +1 -1
- package/components/share-page/_macro.njk +7 -7
- package/components/share-page/_macro.spec.js +2 -2
- package/components/share-page/example-share-page.njk +1 -1
- package/components/status/_status.scss +1 -1
- package/components/summary/_macro.njk +33 -33
- package/components/summary/_macro.spec.js +34 -34
- package/components/summary/_summary.scss +2 -4
- package/components/summary/example-summary-card-grouped.njk +34 -34
- package/components/summary/example-summary-grouped-total.njk +7 -7
- package/components/summary/example-summary-grouped-with-errors.njk +9 -9
- package/components/summary/example-summary-grouped.njk +34 -34
- package/components/summary/example-summary-household.njk +7 -7
- package/components/summary/example-summary-hub-minimal.njk +8 -8
- package/components/summary/example-summary-hub.njk +16 -16
- package/components/summary/example-summary-multiple.njk +7 -7
- package/components/summary/example-summary-no-action.njk +5 -5
- package/components/summary/example-summary.njk +9 -9
- package/components/table/_table.scss +2 -3
- package/components/table-of-contents/_macro.njk +3 -3
- package/components/table-of-contents/_macro.spec.js +3 -3
- package/components/table-of-contents/example-table-of-contents-sticky-full-page.njk +1 -1
- package/components/tabs/_macro.njk +3 -3
- package/components/tabs/_macro.spec.js +3 -3
- package/components/tabs/_tabs.scss +3 -4
- package/components/tabs/example-tabs-details.njk +1 -1
- package/components/text-indent/_text-indent.scss +1 -1
- package/components/timeline/_macro.njk +4 -4
- package/components/timeline/_macro.spec.js +3 -3
- package/components/timeline/_timeline.scss +4 -3
- package/components/timeline/example-timeline.njk +1 -1
- package/components/upload/_upload.scss +2 -2
- package/components/video/_macro.njk +4 -4
- package/components/video/_macro.spec.js +2 -2
- package/components/video/_video.scss +1 -1
- package/components/video/example-video.njk +2 -2
- package/components/video/video.spec.js +2 -2
- package/css/main.css +1 -1
- package/layout/_dsTemplate.njk +1 -1
- package/layout/_template.njk +31 -31
- package/package.json +4 -5
- package/scripts/main.es5.js +1 -1
- package/scripts/main.js +1 -1
- package/scss/base/_global.scss +2 -0
- package/scss/base/_typography.scss +0 -2
- package/scss/main.scss +0 -1
- package/scss/objects/_container.scss +1 -1
- package/scss/objects/_page.scss +2 -3
- package/scss/overrides/rtl.scss +1 -1
- package/scss/utilities/_grid.scss +103 -96
- package/scss/utilities/_margin.scss +11 -5
- package/scss/utilities/_padding.scss +12 -5
- package/scss/utilities/_typography.scss +2 -1
- package/scss/vars/_forms.scss +8 -10
- package/scss/vars/_grid.scss +4 -4
- package/scss/vars/_typography.scss +26 -19
- package/components/call-to-action/_call-to-action.scss +0 -8
- package/components/call-to-action/_macro.njk +0 -24
- package/components/call-to-action/_macro.spec.js +0 -48
- package/components/call-to-action/example-call-to-action-default.njk +0 -15
- package/components/metadata/_macro.njk +0 -14
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
$checkbox-input-width: 22px;
|
|
2
|
-
$checkbox-padding:
|
|
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
|
|
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.
|
|
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
|
|
173
|
+
margin: 0 1rem 0.5rem;
|
|
174
174
|
padding: 0 $checkbox-padding $checkbox-padding $checkbox-padding * 2 - 1;
|
|
175
175
|
}
|
|
176
176
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{% from "components/checkboxes/_checkbox-macro.njk" import onsCheckbox %}
|
|
2
2
|
|
|
3
|
-
<div class="ons-grid ons-grid
|
|
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-
|
|
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
|
|
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-
|
|
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(
|
|
17
|
-
font-size: 0.
|
|
18
|
-
line-height: 1.
|
|
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:
|
|
24
|
+
line-height: 2rem;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
&__btn {
|
|
28
|
-
margin: 0 0 0.
|
|
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
|
|
17
|
-
{% set
|
|
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
|
|
33
|
-
{% set
|
|
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
|
|
39
|
+
{% set settingsLinkUrl = params.settingsLinkUrl | default(defaultCookiesLink) %}
|
|
40
40
|
{% else %}
|
|
41
|
-
{% set
|
|
41
|
+
{% set settingsLinkUrl = '#0' %}
|
|
42
42
|
{% endif %}
|
|
43
|
-
{% set statementText = beforeLinkStatementText + ' <a href="' +
|
|
44
|
-
{% set preferencesText =
|
|
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-
|
|
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
|
|
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="{{
|
|
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
|
|
94
|
-
|
|
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
|
-
|
|
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.
|
|
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.
|
|
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:
|
|
90
|
-
padding-top:
|
|
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.
|
|
16
|
-
{% set openingTag = "<"
|
|
17
|
-
{% set closingTag = "</"
|
|
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
|
{{-
|
|
@@ -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.
|
|
8
|
-
{% set openingTag = "<"
|
|
9
|
-
{% set closingTag = "</"
|
|
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-
|
|
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-
|
|
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.
|
|
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
|
|
68
|
+
{% set metadataObject %}
|
|
69
69
|
<span
|
|
70
|
-
{% if not document.metadata.file and not document.metadata.
|
|
71
|
-
>{{ document.metadata.
|
|
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.
|
|
75
|
-
<a class="ons-document-list__attribute-link" href="{{ document.metadata.
|
|
76
|
-
{{
|
|
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
|
-
{{
|
|
79
|
+
{{ metadataObject | safe }}
|
|
80
80
|
{% endif %}
|
|
81
|
-
{%- if document.metadata.
|
|
82
|
-
<span>{{ document.metadata.
|
|
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
|
-
|
|
10
|
-
|
|
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
|
|
35
|
+
const EXAMPLE_DOCUMENT_LIST_WITH_METADATA_OBJECT = {
|
|
34
36
|
...EXAMPLE_DOCUMENT_LIST_BASIC,
|
|
35
37
|
metadata: {
|
|
36
|
-
|
|
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
|
-
|
|
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 `
|
|
159
|
+
it('overrides the heading title tag when `headingLevel` is provided', () => {
|
|
158
160
|
const $ = cheerio.load(
|
|
159
161
|
renderComponent('document-list', {
|
|
160
|
-
|
|
162
|
+
headingLevel: 1,
|
|
161
163
|
documents: [EXAMPLE_DOCUMENT_LIST_BASIC],
|
|
162
164
|
}),
|
|
163
165
|
);
|
|
164
|
-
const
|
|
165
|
-
expect(
|
|
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 `
|
|
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: [
|
|
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: [
|
|
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: [
|
|
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: [
|
|
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
|
-
"
|
|
18
|
-
|
|
17
|
+
"title": {
|
|
18
|
+
"text": 'Landmarks are lighting up purple to mark Census Day',
|
|
19
|
+
"url": '#0'
|
|
20
|
+
},
|
|
19
21
|
"metadata": {
|
|
20
|
-
"
|
|
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
|
-
"
|
|
12
|
-
|
|
11
|
+
"title": {
|
|
12
|
+
"text": 'Landmarks are lighting up purple to mark Census Day',
|
|
13
|
+
"url": '#0'
|
|
14
|
+
},
|
|
13
15
|
"metadata": {
|
|
14
|
-
"
|
|
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
|
-
"
|
|
31
|
-
|
|
32
|
+
"title": {
|
|
33
|
+
"text": 'Office for National Statistics win top Royal Statistical Society award',
|
|
34
|
+
"url": '#0'
|
|
35
|
+
},
|
|
32
36
|
"metadata": {
|
|
33
|
-
"
|
|
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
|
-
"
|
|
47
|
-
|
|
50
|
+
"title": {
|
|
51
|
+
"text": 'Five Office for National Statistics names in New Year’s Honours',
|
|
52
|
+
"url": '#0'
|
|
53
|
+
},
|
|
48
54
|
"metadata": {
|
|
49
|
-
"
|
|
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
|
-
"
|
|
8
|
-
|
|
7
|
+
"title": {
|
|
8
|
+
"text": 'Including everyone in Census 2021',
|
|
9
|
+
"url": '#0'
|
|
10
|
+
},
|
|
9
11
|
"metadata": {
|
|
10
|
-
"
|
|
12
|
+
"object": {
|
|
11
13
|
"text": 'Poster'
|
|
12
14
|
},
|
|
13
15
|
"file": {
|
|
@@ -20,10 +22,12 @@
|
|
|
20
22
|
},
|
|
21
23
|
{
|
|
22
24
|
"thumbnail": true,
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
+
"title": {
|
|
26
|
+
"text": 'Community handbook for Census 2021',
|
|
27
|
+
"url": '#0'
|
|
28
|
+
},
|
|
25
29
|
"metadata": {
|
|
26
|
-
"
|
|
30
|
+
"object": {
|
|
27
31
|
"text": 'Booklet'
|
|
28
32
|
},
|
|
29
33
|
"file": {
|
|
@@ -36,10 +40,12 @@
|
|
|
36
40
|
},
|
|
37
41
|
{
|
|
38
42
|
"thumbnail": true,
|
|
39
|
-
"
|
|
40
|
-
|
|
43
|
+
"title": {
|
|
44
|
+
"text": 'Census 2021 matters to everyone',
|
|
45
|
+
"url": '#0'
|
|
46
|
+
},
|
|
41
47
|
"metadata": {
|
|
42
|
-
"
|
|
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
|
-
"
|
|
10
|
-
|
|
9
|
+
"title": {
|
|
10
|
+
"text": 'Crime and justice',
|
|
11
|
+
"url": '#0'
|
|
12
|
+
},
|
|
11
13
|
"metadata": {
|
|
12
|
-
"
|
|
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
|
-
"
|
|
21
|
-
|
|
22
|
+
"title": {
|
|
23
|
+
"text": 'Disability and crime',
|
|
24
|
+
"url": '#0'
|
|
25
|
+
},
|
|
22
26
|
"metadata": {
|
|
23
|
-
"
|
|
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
|
-
"
|
|
37
|
-
|
|
40
|
+
"title": {
|
|
41
|
+
"text": 'Disability and crime, UK: 2019 (Latest release)',
|
|
42
|
+
"url": '#0'
|
|
43
|
+
},
|
|
38
44
|
"metadata": {
|
|
39
|
-
"
|
|
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
|
-
"
|
|
53
|
-
|
|
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
|
-
"
|
|
63
|
+
"object": {
|
|
56
64
|
"text": 'User requested data',
|
|
57
65
|
"ref": 'Ref 008052'
|
|
58
66
|
},
|