@ons/design-system 72.10.8 → 72.10.9
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/accordion/accordion.js +3 -2
- package/components/autosuggest/autosuggest.spec.js +2 -0
- package/components/autosuggest/autosuggest.ui.js +12 -7
- package/components/breadcrumbs/_breadcrumbs.scss +53 -0
- package/components/breadcrumbs/_macro.njk +33 -24
- package/components/breadcrumbs/_macro.spec.js +25 -0
- package/components/chart/_chart.scss +85 -0
- package/components/chart/_macro.njk +15 -2
- package/components/chart/_macro.spec.js +41 -11
- package/components/chart/bar-chart.js +8 -1
- package/components/chart/common-chart-options.js +9 -0
- package/components/chart/example-bar-chart-with-axis-min-and-max-values.njk +0 -1
- package/components/chart/example-bar-chart-with-point-range-and-reference-line-annotations.njk +4 -4
- package/components/chart/example-bar-chart.njk +0 -1
- package/components/chart/range-annotations-options.js +1 -1
- package/components/download-resources/download-resources.spec.js +2 -0
- package/components/hero/_hero.scss +17 -22
- package/components/hero/_macro.njk +1 -1
- package/components/hero/_macro.spec.js +1 -1
- package/components/hero/example-hero-dark-with-external-breadcrumbs.njk +194 -0
- package/components/hero/example-hero-default-with-external-breadcrumbs.njk +201 -0
- package/components/hero/example-hero-grey-with-external-breadcrumbs.njk +243 -0
- package/components/hero/example-hero-navy-blue-with-external-breadcrumbs.njk +200 -0
- package/components/hero/example-hero-pale-blue-with-external-breadcrumbs.njk +201 -0
- package/components/icon/_macro.njk +1 -1
- package/components/mutually-exclusive/mutually-exclusive.js +3 -1
- package/components/radios/clear-radios.js +4 -2
- package/components/relationships/relationships.js +4 -2
- package/components/video/video.js +2 -0
- package/css/main.css +1 -1
- package/js/timeout.js +9 -6
- package/package.json +4 -4
- package/scripts/main.es5.js +4 -2
- package/scripts/main.js +4 -2
|
@@ -88,7 +88,8 @@
|
|
|
88
88
|
@extend .ons-u-mb-no;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
&--dark
|
|
91
|
+
&--dark &,
|
|
92
|
+
&--navy-blue & {
|
|
92
93
|
&__details {
|
|
93
94
|
color: var(--ons-color-text-inverse);
|
|
94
95
|
|
|
@@ -97,10 +98,16 @@
|
|
|
97
98
|
}
|
|
98
99
|
|
|
99
100
|
a:hover {
|
|
100
|
-
|
|
101
|
-
|
|
101
|
+
text-decoration: underline solid var(--ons-color-text-inverse-link-hover) 2px;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
a:focus {
|
|
105
|
+
color: var(--ons-color-text);
|
|
102
106
|
}
|
|
103
107
|
|
|
108
|
+
a:focus:hover {
|
|
109
|
+
text-decoration: none;
|
|
110
|
+
}
|
|
104
111
|
.ons-details__heading {
|
|
105
112
|
color: inherit;
|
|
106
113
|
}
|
|
@@ -129,7 +136,7 @@
|
|
|
129
136
|
height: 59px;
|
|
130
137
|
position: absolute;
|
|
131
138
|
right: 289px;
|
|
132
|
-
top:
|
|
139
|
+
top: 58px;
|
|
133
140
|
width: 59px;
|
|
134
141
|
}
|
|
135
142
|
}
|
|
@@ -141,7 +148,7 @@
|
|
|
141
148
|
position: absolute;
|
|
142
149
|
height: 30px;
|
|
143
150
|
right: 193px;
|
|
144
|
-
top:
|
|
151
|
+
top: 65px;
|
|
145
152
|
width: 30px;
|
|
146
153
|
}
|
|
147
154
|
}
|
|
@@ -150,7 +157,7 @@
|
|
|
150
157
|
@include mq(l) {
|
|
151
158
|
height: 60px;
|
|
152
159
|
right: 112px;
|
|
153
|
-
top:
|
|
160
|
+
top: 75px;
|
|
154
161
|
width: 60px;
|
|
155
162
|
background-color: var(--ons-color-white);
|
|
156
163
|
border-radius: 50%;
|
|
@@ -165,7 +172,7 @@
|
|
|
165
172
|
height: 60px;
|
|
166
173
|
position: absolute;
|
|
167
174
|
right: 208px;
|
|
168
|
-
top:
|
|
175
|
+
top: 130px;
|
|
169
176
|
width: 60px;
|
|
170
177
|
}
|
|
171
178
|
|
|
@@ -191,7 +198,7 @@
|
|
|
191
198
|
height: 14px;
|
|
192
199
|
position: absolute;
|
|
193
200
|
right: 222px;
|
|
194
|
-
top:
|
|
201
|
+
top: 237px;
|
|
195
202
|
width: 14px;
|
|
196
203
|
}
|
|
197
204
|
|
|
@@ -217,7 +224,7 @@
|
|
|
217
224
|
height: 15px;
|
|
218
225
|
position: absolute;
|
|
219
226
|
right: 135px;
|
|
220
|
-
top:
|
|
227
|
+
top: 238px;
|
|
221
228
|
width: 15px;
|
|
222
229
|
}
|
|
223
230
|
}
|
|
@@ -342,18 +349,6 @@
|
|
|
342
349
|
}
|
|
343
350
|
|
|
344
351
|
&__circle-1 {
|
|
345
|
-
@include mq(l) {
|
|
346
|
-
background-color: var(--ons-color-soft-blue-grey);
|
|
347
|
-
border-radius: 50%;
|
|
348
|
-
height: 440px;
|
|
349
|
-
position: absolute;
|
|
350
|
-
right: 59px;
|
|
351
|
-
top: -339px;
|
|
352
|
-
width: 440px;
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
&__circle-2 {
|
|
357
352
|
background-color: var(--ons-color-light-orange);
|
|
358
353
|
border-radius: 50%;
|
|
359
354
|
bottom: 4%;
|
|
@@ -379,7 +374,7 @@
|
|
|
379
374
|
}
|
|
380
375
|
}
|
|
381
376
|
|
|
382
|
-
&__circle-
|
|
377
|
+
&__circle-2 {
|
|
383
378
|
background-color: var(--ons-color-ocean-blue);
|
|
384
379
|
border-radius: 50%;
|
|
385
380
|
bottom: 7%;
|
|
@@ -109,7 +109,7 @@ describe('macro: hero', () => {
|
|
|
109
109
|
const $ = cheerio.load(renderComponent('hero', { ...EXAMPLE_HERO, variants: 'grey', officialStatisticsBadge: true }));
|
|
110
110
|
|
|
111
111
|
expect($('.ons-hero__badge').length).toBe(1);
|
|
112
|
-
expect($('.ons-hero__badge svg title').text().trim()).toBe('Official Statistics Badge');
|
|
112
|
+
expect($('.ons-hero__badge svg title').text().trim()).toBe('Official Statistics Badge - Accredited');
|
|
113
113
|
});
|
|
114
114
|
|
|
115
115
|
it('outputs the statistics badge as a link when officialStatisticsBadgeUrl is provided', () => {
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Example: Table of contents on full page'
|
|
3
|
+
layout: ~
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
{% from "components/hero/_macro.njk" import onsHero %}
|
|
7
|
+
{% from "components/breadcrumbs/_macro.njk" import onsBreadcrumbs %}
|
|
8
|
+
{% extends "layout/_template.njk" %}
|
|
9
|
+
{%
|
|
10
|
+
set pageConfig = {
|
|
11
|
+
"header": {
|
|
12
|
+
"variants": 'basic',
|
|
13
|
+
"menuLinks": {
|
|
14
|
+
"id": "menu-links",
|
|
15
|
+
"keyLinks": [
|
|
16
|
+
{
|
|
17
|
+
'heading': 'Taking part in a survey?',
|
|
18
|
+
'description': 'It’s never been more important.'
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
'heading': 'Release calendar',
|
|
22
|
+
'description': 'View our latest and upcoming releases.'
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
'heading': 'Explore local statistics',
|
|
26
|
+
'url': '#0',
|
|
27
|
+
'description': 'Explore statistics across the UK.'
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"columns": [
|
|
31
|
+
{
|
|
32
|
+
"groups": [
|
|
33
|
+
{
|
|
34
|
+
"heading": "People, population and community",
|
|
35
|
+
"groupItems": [
|
|
36
|
+
{
|
|
37
|
+
"text": "Armed forces community"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"text": "Births, deaths and marriages"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"text": "Crime and justice"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"text": "Cultural identity"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"text": "Education and childcare"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"text": "Elections"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"text": "Health and social care"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"text": "Household characteristics"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"text": "Housing"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"text": "Leisure and tourism"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"text": "Personal and household finances"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"text": "Population and migration"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"text": "Well-being"
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"groups": [
|
|
81
|
+
{
|
|
82
|
+
"heading": "Business, industry and trade",
|
|
83
|
+
"groupItems": [
|
|
84
|
+
{
|
|
85
|
+
"text": "Business"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"text": "Changes to business"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"text": "Construction industry"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"text": "International trade"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"text": "IT and internet industry"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"text": "Manufacturing and production industry"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"text": "Retail industry",
|
|
104
|
+
"url": "#0"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"text": "Tourism industry"
|
|
108
|
+
}
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"heading": "Employment and labour market",
|
|
113
|
+
"url": "#0",
|
|
114
|
+
"groupItems":
|
|
115
|
+
[
|
|
116
|
+
{
|
|
117
|
+
"text": "People in work"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"text": "People not in work"
|
|
121
|
+
}
|
|
122
|
+
]
|
|
123
|
+
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"groups": [
|
|
129
|
+
{
|
|
130
|
+
"heading": "Economy",
|
|
131
|
+
"groupItems": [
|
|
132
|
+
{
|
|
133
|
+
"text": "Economic output and productivity"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"text": "Government, public sector and taxes"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"text": "Gross Value Added (GVA)"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"text": "Investments, pensions and trusts"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"text": "Regional accounts"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"text": "Environmental accounts"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"text": "Gross Domestic Product (GDP)"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"text": "Inflation and price indices"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"text": "National accounts"
|
|
158
|
+
}
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
%}
|
|
168
|
+
{% block pageContent %}
|
|
169
|
+
{{
|
|
170
|
+
onsBreadcrumbs({
|
|
171
|
+
"ariaLabel": 'Breadcrumbs',
|
|
172
|
+
"variant": "dark",
|
|
173
|
+
"itemsList": [
|
|
174
|
+
{
|
|
175
|
+
"url": '/',
|
|
176
|
+
"text": 'Home'
|
|
177
|
+
}
|
|
178
|
+
]
|
|
179
|
+
})
|
|
180
|
+
}}
|
|
181
|
+
<main id="main-content">
|
|
182
|
+
{{
|
|
183
|
+
onsHero({
|
|
184
|
+
"title": 'Design and build digital services for the ONS',
|
|
185
|
+
"text": 'Everything you need to make accessible, consistent digital products',
|
|
186
|
+
"button": {
|
|
187
|
+
"url": '#0',
|
|
188
|
+
"text": 'Get started'
|
|
189
|
+
},
|
|
190
|
+
"variants": 'dark'
|
|
191
|
+
})
|
|
192
|
+
}}
|
|
193
|
+
</main>
|
|
194
|
+
{% endblock %}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Example: Table of contents on full page'
|
|
3
|
+
layout: ~
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
{% from "components/hero/_macro.njk" import onsHero %}
|
|
7
|
+
{% from "components/breadcrumbs/_macro.njk" import onsBreadcrumbs %}
|
|
8
|
+
{% extends "layout/_template.njk" %}
|
|
9
|
+
{%
|
|
10
|
+
set pageConfig = {
|
|
11
|
+
"header": {
|
|
12
|
+
"variants": 'basic',
|
|
13
|
+
"menuLinks": {
|
|
14
|
+
"id": "menu-links",
|
|
15
|
+
"keyLinks": [
|
|
16
|
+
{
|
|
17
|
+
'heading': 'Taking part in a survey?',
|
|
18
|
+
'description': 'It’s never been more important.'
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
'heading': 'Release calendar',
|
|
22
|
+
'description': 'View our latest and upcoming releases.'
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
'heading': 'Explore local statistics',
|
|
26
|
+
'url': '#0',
|
|
27
|
+
'description': 'Explore statistics across the UK.'
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"columns": [
|
|
31
|
+
{
|
|
32
|
+
"groups": [
|
|
33
|
+
{
|
|
34
|
+
"heading": "People, population and community",
|
|
35
|
+
"groupItems": [
|
|
36
|
+
{
|
|
37
|
+
"text": "Armed forces community"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"text": "Births, deaths and marriages"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"text": "Crime and justice"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"text": "Cultural identity"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"text": "Education and childcare"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"text": "Elections"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"text": "Health and social care"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"text": "Household characteristics"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"text": "Housing"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"text": "Leisure and tourism"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"text": "Personal and household finances"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"text": "Population and migration"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"text": "Well-being"
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"groups": [
|
|
81
|
+
{
|
|
82
|
+
"heading": "Business, industry and trade",
|
|
83
|
+
"groupItems": [
|
|
84
|
+
{
|
|
85
|
+
"text": "Business"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"text": "Changes to business"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"text": "Construction industry"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"text": "International trade"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"text": "IT and internet industry"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"text": "Manufacturing and production industry"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"text": "Retail industry",
|
|
104
|
+
"url": "#0"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"text": "Tourism industry"
|
|
108
|
+
}
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"heading": "Employment and labour market",
|
|
113
|
+
"url": "#0",
|
|
114
|
+
"groupItems":
|
|
115
|
+
[
|
|
116
|
+
{
|
|
117
|
+
"text": "People in work"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"text": "People not in work"
|
|
121
|
+
}
|
|
122
|
+
]
|
|
123
|
+
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"groups": [
|
|
129
|
+
{
|
|
130
|
+
"heading": "Economy",
|
|
131
|
+
"groupItems": [
|
|
132
|
+
{
|
|
133
|
+
"text": "Economic output and productivity"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"text": "Government, public sector and taxes"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"text": "Gross Value Added (GVA)"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"text": "Investments, pensions and trusts"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"text": "Regional accounts"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"text": "Environmental accounts"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"text": "Gross Domestic Product (GDP)"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"text": "Inflation and price indices"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"text": "National accounts"
|
|
158
|
+
}
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
%}
|
|
168
|
+
{% block pageContent %}
|
|
169
|
+
{{
|
|
170
|
+
onsBreadcrumbs({
|
|
171
|
+
"ariaLabel": 'Breadcrumbs',
|
|
172
|
+
"variant": "pale-blue",
|
|
173
|
+
"itemsList": [
|
|
174
|
+
{
|
|
175
|
+
"url": '/',
|
|
176
|
+
"text": 'Home'
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"url": '/',
|
|
180
|
+
"text": 'Business, industry and trade'
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"url": '/',
|
|
184
|
+
"text": 'Retail industry'
|
|
185
|
+
}
|
|
186
|
+
]
|
|
187
|
+
})
|
|
188
|
+
}}
|
|
189
|
+
<main id="main-content">
|
|
190
|
+
{{
|
|
191
|
+
onsHero({
|
|
192
|
+
"title": 'Design and build digital services for the ONS',
|
|
193
|
+
"text": 'Everything you need to make accessible, consistent digital products',
|
|
194
|
+
"button": {
|
|
195
|
+
"url": '#0',
|
|
196
|
+
"text": 'Get started'
|
|
197
|
+
}
|
|
198
|
+
})
|
|
199
|
+
}}
|
|
200
|
+
</main>
|
|
201
|
+
{% endblock %}
|