@ons/design-system 55.1.0 → 55.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.
- package/components/access-code/_macro.njk +3 -3
- package/components/accordion/_macro.njk +1 -1
- package/components/address-input/_macro.njk +7 -7
- package/components/address-output/_macro.njk +7 -7
- package/components/autosuggest/_macro.njk +19 -19
- package/components/breadcrumbs/_macro.njk +3 -3
- package/components/button/_button.scss +1 -1
- package/components/button/_macro.njk +24 -24
- package/components/call-to-action/_macro.njk +1 -1
- package/components/card/_macro.njk +10 -10
- package/components/checkboxes/_checkbox-macro.njk +9 -9
- package/components/checkboxes/_macro.njk +10 -10
- package/components/checkboxes/checkbox-with-fieldset.js +6 -5
- package/components/checkboxes/checkboxes.dom.js +6 -9
- package/components/code-highlight/_macro.njk +1 -1
- package/components/collapsible/_macro.njk +7 -7
- package/components/date-input/_macro.njk +5 -5
- package/components/document-list/_macro.njk +29 -29
- package/components/duration/_macro.njk +9 -9
- package/components/duration/_macro.spec.js +0 -3
- package/components/error/_macro.njk +1 -1
- package/components/external-link/_macro.njk +1 -1
- package/components/feedback/_macro.njk +2 -2
- package/components/field/_macro.njk +5 -5
- package/components/fieldset/_macro.njk +8 -8
- package/components/footer/_macro.njk +17 -17
- package/components/header/_macro.njk +33 -33
- package/components/hero/_macro.njk +15 -15
- package/components/icons/_macro.njk +2 -2
- package/components/images/_macro.njk +3 -3
- package/components/input/_input-type.scss +4 -0
- package/components/input/_macro.njk +40 -34
- package/components/input/_macro.spec.js +64 -59
- package/components/label/_macro.njk +1 -1
- package/components/language-selector/_macro.njk +1 -1
- package/components/lists/_macro.njk +22 -22
- package/components/message/_macro.njk +6 -6
- package/components/message-list/_macro.njk +1 -1
- package/components/metadata/_macro.njk +2 -2
- package/components/modal/_macro.njk +4 -4
- package/components/mutually-exclusive/_macro.njk +1 -1
- package/components/mutually-exclusive/mutually-exclusive.js +3 -1
- package/components/navigation/_macro.njk +8 -8
- package/components/pagination/_macro.njk +3 -3
- package/components/panel/_macro.njk +37 -39
- package/components/panel/_macro.spec.js +1 -13
- package/components/promotional-banner/_macro.njk +2 -2
- package/components/question/_macro.njk +18 -18
- package/components/quote/_macro.njk +2 -2
- package/components/radios/_macro.njk +8 -8
- package/components/radios/check-radios.js +5 -1
- package/components/related-content/_macro.njk +2 -2
- package/components/relationships/_macro.njk +2 -2
- package/components/section-navigation/_macro.njk +2 -2
- package/components/select/_macro.njk +8 -8
- package/components/share-page/_macro.njk +2 -2
- package/components/status/_macro.njk +2 -2
- package/components/summary/_macro.njk +25 -25
- package/components/table/_macro.njk +10 -10
- package/components/table-of-contents/_macro.njk +4 -4
- package/components/textarea/_macro.njk +8 -8
- package/components/timeline/_macro.njk +1 -1
- package/components/video/_macro.njk +1 -1
- package/css/census.css +1 -1
- package/css/ids.css +1 -1
- package/css/main.css +1 -1
- package/layout/_template.njk +35 -35
- package/package.json +1 -1
- package/scripts/main.es5.js +1 -1
- package/scripts/main.js +1 -1
package/layout/_template.njk
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
{% set currentLanguageISOCode = "en" %}
|
|
6
6
|
|
|
7
|
-
{% if pageConfig
|
|
7
|
+
{% if pageConfig and pageConfig.language and pageConfig.language.languages %}
|
|
8
8
|
{% set currentLanguage = pageConfig.language.languages | selectattr("current") | first %}
|
|
9
9
|
{% set currentLanguageISOCode = currentLanguage.ISOCode %}
|
|
10
10
|
{% set otherLanguage = pageConfig.language.languages | rejectattr("current") | first %}
|
|
@@ -12,21 +12,21 @@
|
|
|
12
12
|
{% endif %}
|
|
13
13
|
|
|
14
14
|
{# Meta icons #}
|
|
15
|
-
{% if pageConfig
|
|
15
|
+
{% if pageConfig and pageConfig.theme %}
|
|
16
16
|
{% set metaicons = pageConfig.theme + "/" + currentLanguageISOCode + "/" %}
|
|
17
17
|
{% else %}
|
|
18
18
|
{% set metaicons = "" %}
|
|
19
19
|
{% endif %}
|
|
20
20
|
|
|
21
|
-
{% if pageConfig.cdn
|
|
21
|
+
{% if pageConfig.cdn or release_version %}
|
|
22
22
|
{# Production #}
|
|
23
|
-
{% set cdn_url = (pageConfig.cdn.url if pageConfig.cdn
|
|
23
|
+
{% set cdn_url = (pageConfig.cdn.url if pageConfig.cdn and pageConfig.cdn.url) or "https://cdn.ons.gov.uk/sdc/design-system" %}
|
|
24
24
|
{% set slash = "" if cdn_url | last == "/" else "/" %}
|
|
25
|
-
{% set assetsURL = cdn_url + slash + ((pageConfig.cdn.version if pageConfig.cdn
|
|
26
|
-
{% elif pageInfo
|
|
25
|
+
{% set assetsURL = cdn_url + slash + ((pageConfig.cdn.version if pageConfig.cdn and pageConfig.cdn.version) or release_version) %}
|
|
26
|
+
{% elif pageInfo and pageInfo.version %}
|
|
27
27
|
{# Prototype kits #}
|
|
28
28
|
{% set assetsURL = "/" + pageInfo.version %}
|
|
29
|
-
{% elif pageConfig.assetsURL
|
|
29
|
+
{% elif pageConfig.assetsURL %}
|
|
30
30
|
{# Runner Dev #}
|
|
31
31
|
{% set assetsURL = pageConfig.assetsURL %}
|
|
32
32
|
{% else %}
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
{% set assetsURL = "" %}
|
|
35
35
|
{% endif %}
|
|
36
36
|
|
|
37
|
-
{% if pageConfig
|
|
37
|
+
{% if pageConfig and pageConfig.title %}
|
|
38
38
|
{% set page_title = pageConfig.title %}
|
|
39
|
-
{% elif pageInfo
|
|
39
|
+
{% elif pageInfo and pageInfo.title %}
|
|
40
40
|
{% set page_title = pageInfo.title %}
|
|
41
41
|
{% else %}
|
|
42
42
|
{% set page_title = "ONS Design System" %}
|
|
@@ -54,16 +54,16 @@
|
|
|
54
54
|
{# Page columns #}
|
|
55
55
|
{% set mainColNumber = "8" %}
|
|
56
56
|
|
|
57
|
-
{% if pageConfig.mainCol
|
|
58
|
-
{% set mainColNumber = pageConfig.mainCol.columns if pageConfig.mainCol.columns
|
|
59
|
-
{% set mainColClasses = (' ' + pageConfig.mainCol.colClasses) if pageConfig.mainCol.colClasses
|
|
60
|
-
{% set mainClasses = (' ' + pageConfig.mainCol.classes) if pageConfig.mainCol.classes
|
|
57
|
+
{% if pageConfig.mainCol %}
|
|
58
|
+
{% set mainColNumber = pageConfig.mainCol.columns if pageConfig.mainCol.columns %}
|
|
59
|
+
{% set mainColClasses = (' ' + pageConfig.mainCol.colClasses) if pageConfig.mainCol.colClasses %}
|
|
60
|
+
{% set mainClasses = (' ' + pageConfig.mainCol.classes) if pageConfig.mainCol.classes %}
|
|
61
61
|
{% endif %}
|
|
62
62
|
|
|
63
|
-
{% if pageConfig.asideCol
|
|
64
|
-
{% set asideColNumber = 12 - mainColNumber if pageConfig.asideCol.position
|
|
65
|
-
{% set asideColClasses = (' ' + pageConfig.asideCol.colClasses) if pageConfig.asideCol.colClasses
|
|
66
|
-
{% set asideClasses = (' ' + pageConfig.asideCol.classes) if pageConfig.asideCol.classes
|
|
63
|
+
{% if pageConfig.asideCol %}
|
|
64
|
+
{% set asideColNumber = 12 - mainColNumber if pageConfig.asideCol.position %}
|
|
65
|
+
{% set asideColClasses = (' ' + pageConfig.asideCol.colClasses) if pageConfig.asideCol.colClasses %}
|
|
66
|
+
{% set asideClasses = (' ' + pageConfig.asideCol.classes) if pageConfig.asideCol.classes %}
|
|
67
67
|
{% endif %}
|
|
68
68
|
|
|
69
69
|
<!doctype html>
|
|
@@ -77,9 +77,9 @@
|
|
|
77
77
|
<link rel="stylesheet" media="print" href="{{ assetsURL }}/css/print.css">
|
|
78
78
|
<meta name="theme-color" content="{% if pageConfig.theme == 'census' %}#902082{% else %}#206095{% endif %}"/>
|
|
79
79
|
|
|
80
|
-
{% if pageConfig.headMeta
|
|
80
|
+
{% if pageConfig.headMeta %}
|
|
81
81
|
|
|
82
|
-
{% if pageConfig.headMeta.description
|
|
82
|
+
{% if pageConfig.headMeta.description or pageConfig.description %}
|
|
83
83
|
<meta name="description" content="{{ pageConfig.headMeta.description | default(pageConfig.description) }}">
|
|
84
84
|
{% endif %}
|
|
85
85
|
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
<meta property="og:description" content="{{ pageConfig.headMeta.description | default(pageConfig.description) }}">
|
|
95
95
|
<meta property="og:site_name" content="{{ pageConfig.header.title | default(pageConfig.title) }}">
|
|
96
96
|
<meta property="og:locale" content="{{ currentLanguageISOCode }}">
|
|
97
|
-
{% if otherLanguageISOCode
|
|
97
|
+
{% if otherLanguageISOCode %}
|
|
98
98
|
<meta property="og:locale:alternate" content="{{ otherLanguageISOCode }}">
|
|
99
99
|
{% endif %}
|
|
100
100
|
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
<!-- Canonical -->
|
|
110
110
|
<link rel="canonical" href="{{ pageConfig.headMeta.canonicalUrl | default(pageConfig.absoluteUrl) }}">
|
|
111
111
|
|
|
112
|
-
{% if pageConfig.headMeta.hrefLangs
|
|
112
|
+
{% if pageConfig.headMeta.hrefLangs %}
|
|
113
113
|
{% for item in pageConfig.headMeta.hrefLangs %}
|
|
114
114
|
<link rel="alternate" href="{{ item.url }}" hreflang="{{ item.lang }}">
|
|
115
115
|
{% endfor %}
|
|
@@ -131,17 +131,17 @@
|
|
|
131
131
|
{% block head %}{% endblock %}
|
|
132
132
|
|
|
133
133
|
</head>
|
|
134
|
-
<body{% if pageConfig.bodyClasses
|
|
135
|
-
<script{% if pageConfig.cspNonce
|
|
134
|
+
<body{% if pageConfig.bodyClasses %} class="{{ pageConfig.bodyClasses }}"{% endif %}>
|
|
135
|
+
<script{% if pageConfig.cspNonce %} nonce="{{ pageConfig.cspNonce }}"{% elif pageConfig.cspNonce is not defined and csp_nonce %} nonce="{{ csp_nonce() }}"{% endif %}>document.body.className = ((document.body.className) ? document.body.className + ' ons-js-enabled' : 'ons-js-enabled');</script>
|
|
136
136
|
{% block bodyStart %}{% endblock %}
|
|
137
137
|
{% block body %}
|
|
138
138
|
<div class="ons-page">
|
|
139
139
|
<div class="ons-page__content">
|
|
140
|
-
{% if form
|
|
140
|
+
{% if form and form.attributes %}
|
|
141
141
|
<form
|
|
142
|
-
{% if form.classes
|
|
142
|
+
{% if form.classes %}class="{{ form.classes }}"{% endif %}
|
|
143
143
|
method="{{ form.method | default('POST') }}"
|
|
144
|
-
{% if form.attributes
|
|
144
|
+
{% if form.attributes %}{% for attribute, value in (form.attributes.items() if form.attributes is mapping and form.attributes.items else form.attributes) %}{{ attribute }}{% if value %}="{{value}}" {% endif %}{% endfor %}{% endif %}
|
|
145
145
|
>
|
|
146
146
|
{% endif %}
|
|
147
147
|
{% block preHeader %}{% endblock %}
|
|
@@ -188,7 +188,7 @@
|
|
|
188
188
|
{% endblock %}
|
|
189
189
|
{% block pageContent %}
|
|
190
190
|
<div class="ons-page__container ons-container{{ containerClasses }}">
|
|
191
|
-
{% if pageConfig.breadcrumbs
|
|
191
|
+
{% if pageConfig.breadcrumbs %}
|
|
192
192
|
{% from "components/breadcrumbs/_macro.njk" import onsBreadcrumbs %}
|
|
193
193
|
{{
|
|
194
194
|
onsBreadcrumbs({
|
|
@@ -200,16 +200,16 @@
|
|
|
200
200
|
{% endif %}
|
|
201
201
|
{% block preMain %}{% endblock %}
|
|
202
202
|
<div class="ons-grid">
|
|
203
|
-
{% if pageConfig.asideCol
|
|
203
|
+
{% if pageConfig.asideCol %}
|
|
204
204
|
{% set aside %}
|
|
205
205
|
<div class="ons-grid__col ons-col-{{ asideColNumber }}@m{{ asideColClasses }}">
|
|
206
|
-
<aside {% if pageConfig.asideCol.id
|
|
206
|
+
<aside {% if pageConfig.asideCol.id %}id="{{ asideId }}" {% endif %}class="ons-page__aside{{ asideClasses }}">
|
|
207
207
|
{% block aside %}{% endblock %}
|
|
208
208
|
</aside>
|
|
209
209
|
</div>
|
|
210
210
|
{% endset %}
|
|
211
211
|
{% endif %}
|
|
212
|
-
{% if pageConfig.asideCol
|
|
212
|
+
{% if pageConfig.asideCol and pageConfig.asideCol.position == "before" %}
|
|
213
213
|
{{ aside | safe }}
|
|
214
214
|
{% endif %}
|
|
215
215
|
<div class="ons-grid__col ons-col-{{ mainColNumber }}@m{{ mainColClasses }}">
|
|
@@ -217,20 +217,20 @@
|
|
|
217
217
|
{% block main %}{% endblock %}
|
|
218
218
|
</main>
|
|
219
219
|
</div>
|
|
220
|
-
{% if pageConfig.asideCol
|
|
220
|
+
{% if pageConfig.asideCol and pageConfig.asideCol.position == "after" %}
|
|
221
221
|
{{ aside | safe }}
|
|
222
222
|
{% endif %}
|
|
223
223
|
</div>
|
|
224
224
|
</div>
|
|
225
225
|
{% endblock %}
|
|
226
226
|
|
|
227
|
-
{% if form
|
|
227
|
+
{% if form and form.attributes %}
|
|
228
228
|
</form>
|
|
229
229
|
{% endif %}
|
|
230
230
|
</div>
|
|
231
231
|
{% block preFooter %}{% endblock %}
|
|
232
232
|
{% block footer %}
|
|
233
|
-
{% if pageConfig.footer
|
|
233
|
+
{% if pageConfig.footer %}
|
|
234
234
|
{{
|
|
235
235
|
onsFooter({
|
|
236
236
|
"assetsURL": assetsURL,
|
|
@@ -257,13 +257,13 @@
|
|
|
257
257
|
{% block bodyEnd %}{% endblock %}
|
|
258
258
|
{% endblock %}
|
|
259
259
|
|
|
260
|
-
{% if isPatternLib
|
|
260
|
+
{% if isPatternLib %}
|
|
261
261
|
{% set scripts = assetsURL + "/scripts/main.js," + assetsURL + "/scripts/patternlib.js" %}
|
|
262
262
|
{% else %}
|
|
263
263
|
{% set scripts = assetsURL + "/scripts/main.js" %}
|
|
264
264
|
{% endif %}
|
|
265
265
|
|
|
266
|
-
<script{% if pageConfig.cspNonce
|
|
266
|
+
<script{% if pageConfig.cspNonce %} nonce="{{ pageConfig.cspNonce }}"{% elif pageConfig.cspNonce is not defined and csp_nonce %} nonce="{{ csp_nonce() }}"{% endif %}>
|
|
267
267
|
(function() {
|
|
268
268
|
var s = '{{ scripts | safe }}'.split(','),
|
|
269
269
|
c = document.createElement('script');
|