@ons/design-system 72.10.8 → 72.10.10
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/README.md +9 -5
- package/components/accordion/accordion.js +3 -2
- package/components/announcement-banner/_announcement-banner.scss +24 -0
- package/components/announcement-banner/_macro.njk +33 -0
- package/components/announcement-banner/_macro.spec.js +106 -0
- package/components/announcement-banner/_test_examples.js +22 -0
- package/components/announcement-banner/example-banner-black.njk +12 -0
- package/components/announcement-banner/example-banner-red.njk +13 -0
- package/components/announcement-banner/example-banner-teal.njk +13 -0
- 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/button/_button.scss +29 -1
- package/components/chart/_chart.scss +88 -0
- package/components/chart/_macro.njk +25 -6
- package/components/chart/_macro.spec.js +1178 -640
- package/components/chart/bar-chart.js +8 -1
- package/components/chart/chart-iframe-resize.js +2 -2
- 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/example-iframe-chart.njk +1 -1
- package/components/chart/range-annotations-options.js +1 -1
- package/components/download-resources/download-resources.spec.js +2 -0
- package/components/duration/example-duration-error-for-single-field.njk +0 -1
- package/components/duration/example-duration-error.njk +0 -1
- package/components/footer/_macro.spec.js +2 -2
- package/components/header/_macro.njk +5 -16
- package/components/header/example-header-button-and-navigation.njk +133 -0
- package/components/header/example-header-external-with-navigation-and-search.njk +1 -1
- 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/navigation/_macro.njk +11 -16
- package/components/navigation/_navigation.scss +24 -0
- package/components/radios/clear-radios.js +4 -2
- package/components/relationships/relationships.js +4 -2
- package/components/table/_macro.njk +107 -112
- package/components/table/_macro.spec.js +35 -44
- package/components/table/_table.scss +0 -12
- package/components/table/example-table-sortable.njk +1 -1
- package/components/tabs/example-tabs-details.njk +1 -1
- package/components/textarea/_macro.njk +1 -0
- package/components/textarea/_macro.spec.js +1 -0
- package/components/timeout-panel/timeout-panel.spec.js +1 -1
- package/components/video/video.js +2 -0
- package/css/main.css +1 -1
- package/js/timeout.js +9 -6
- package/layout/_template.njk +13 -0
- package/package.json +6 -6
- package/scripts/main.es5.js +4 -2
- package/scripts/main.js +4 -2
- package/scss/main.scss +1 -0
- package/scss/vars/_colors.scss +3 -0
- package/scss/vars/_forms.scss +11 -0
- package/components/table/example-table-scrollable.njk +0 -158
|
@@ -0,0 +1,200 @@
|
|
|
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": "navy-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": 'Welcome to the ONS Beta',
|
|
193
|
+
"text": 'Thank you for participating in our beta test. This limited preview of the ONS website focuses on our
|
|
194
|
+
new design and navigation for the retail insutry section. Please be aware that greyed-out links indicate sections still under development.
|
|
195
|
+
The active links will take you through the journey to test the new design features.',
|
|
196
|
+
"variants": 'navy-blue'
|
|
197
|
+
})
|
|
198
|
+
}}
|
|
199
|
+
</main>
|
|
200
|
+
{% 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
|
+
"topic": 'Topic',
|
|
193
|
+
"title": 'Retail Industry',
|
|
194
|
+
"text": 'Sales by retailers in Great Britain directly to end consumers, including spending on goods (in store and online)
|
|
195
|
+
(Retail Sales Index) and spending on services (Index of Services). The industry as a whole is used as an indicator
|
|
196
|
+
of how the wider economy is performing and the strength of consumer spending.',
|
|
197
|
+
"variants": 'pale-blue'
|
|
198
|
+
})
|
|
199
|
+
}}
|
|
200
|
+
</main>
|
|
201
|
+
{% endblock %}
|
|
@@ -701,7 +701,7 @@
|
|
|
701
701
|
class="ons-icon--logo{{ iconClasses }}"
|
|
702
702
|
>
|
|
703
703
|
<title id="{{ params.altTextId | default ('official-statistics-alt') }}">
|
|
704
|
-
{{ params.altText | default ('Official Statistics Badge') }}
|
|
704
|
+
{{ params.altText | default ('Official Statistics Badge - Accredited') }}
|
|
705
705
|
</title>
|
|
706
706
|
<path
|
|
707
707
|
d="M12.4999 92.59C7.18988 92.59 2.87988 88.27 2.87988 82.97C2.87988 77.67 7.19988 73.35 12.4999 73.35H64.4999C69.8099 73.35 74.1199 77.67 74.1199 82.97C74.1199 88.27 69.7999 92.59 64.4999 92.59H12.4999Z"
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import DOMPurify from 'dompurify';
|
|
2
|
+
|
|
1
3
|
const exclusiveGroupItemClass = 'ons-js-exclusive-group-item';
|
|
2
4
|
const optionClass = 'ons-js-exclusive-option';
|
|
3
5
|
const voiceOverAlertClass = 'ons-js-exclusive-alert';
|
|
@@ -133,7 +135,7 @@ export default class MutuallyExclusive {
|
|
|
133
135
|
|
|
134
136
|
// Only update aria-live if value changes to prevent typing from clearing the message before it's read
|
|
135
137
|
if (deselectionMessage) {
|
|
136
|
-
this.voiceOverAlertElement.innerHTML = deselectionMessage;
|
|
138
|
+
this.voiceOverAlertElement.innerHTML = DOMPurify.sanitize(deselectionMessage);
|
|
137
139
|
}
|
|
138
140
|
}
|
|
139
141
|
|
|
@@ -7,25 +7,18 @@
|
|
|
7
7
|
>
|
|
8
8
|
{% if params.siteSearchAutosuggest %}
|
|
9
9
|
<div class="ons-navigation-search ons-js-navigation-search">
|
|
10
|
-
{% set autosuggestClasses = "ons-input-search ons-input-search--icon" %}
|
|
11
|
-
{% set autosuggestLabelClasses = "ons-u-pl-xl" %}
|
|
12
|
-
{% if params.variants == "neutral" %}
|
|
13
|
-
{% set autosuggestClasses = autosuggestClasses + ' ons-input-search--dark' %}
|
|
14
|
-
{% else %}
|
|
15
|
-
{% set autosuggestLabelClasses = autosuggestLabelClasses + ' ons-label--white' %}
|
|
16
|
-
{% endif %}
|
|
17
10
|
{{
|
|
18
11
|
onsAutosuggest({
|
|
19
12
|
"id": "ons-site-search",
|
|
20
13
|
"containerClasses": "ons-autosuggest--header",
|
|
21
14
|
"input": {
|
|
22
|
-
"classes":
|
|
15
|
+
"classes": "ons-input-search ons-input-search--icon",
|
|
23
16
|
"accessiblePlaceholder": true,
|
|
24
17
|
"autocomplete": "off",
|
|
25
18
|
"label": {
|
|
26
19
|
"text": params.siteSearchAutosuggest.label,
|
|
27
20
|
"id": "ons-site-search-label",
|
|
28
|
-
"classes":
|
|
21
|
+
"classes": "ons-u-pl-xl ons-label--white"
|
|
29
22
|
}
|
|
30
23
|
},
|
|
31
24
|
"instructions": params.siteSearchAutosuggest.instructions,
|
|
@@ -48,13 +41,13 @@
|
|
|
48
41
|
<nav
|
|
49
42
|
class="ons-navigation ons-navigation--main ons-js-navigation"
|
|
50
43
|
id="{{ params.navigation.id }}"
|
|
51
|
-
aria-label="{{ params.navigation.ariaLabel | default(
|
|
44
|
+
aria-label="{{ params.navigation.ariaLabel | default('Main menu') }}"
|
|
52
45
|
data-analytics="header-navigation"
|
|
53
46
|
>
|
|
54
47
|
<ul class="ons-navigation__list">
|
|
55
48
|
{% for item in params.navigation.itemsList %}
|
|
56
49
|
<li
|
|
57
|
-
class="ons-navigation__item
|
|
50
|
+
class="ons-navigation__item{{ ' ' + item.classes if item.classes }}{{ ' ons-navigation__item--active' if (item.url == params.navigation.currentPath) or (params.navigation.currentPath is not string and item.url in params.navigation.currentPath) }}"
|
|
58
51
|
>
|
|
59
52
|
<a
|
|
60
53
|
class="ons-navigation__link"
|
|
@@ -76,7 +69,7 @@
|
|
|
76
69
|
{% if params.navigation.subNavigation %}
|
|
77
70
|
{% if not params.navigation.subNavigation.removeHorizontalSubNav %}
|
|
78
71
|
<nav
|
|
79
|
-
class="ons-navigation ons-
|
|
72
|
+
class="ons-navigation ons-u-d-no@2xs@l{{ ' ons-navigation--sub-neutral' if params.variants == 'neutral' else ' ons-navigation--sub' }}{{ ' ' + params.navigation.subNavigation.classes if params.navigation.subNavigation.classes else '' }}"
|
|
80
73
|
id="{{ params.navigation.subNavigation.id }}"
|
|
81
74
|
aria-label="{{ params.navigation.subNavigation.ariaLabel | default('Section menu') }}"
|
|
82
75
|
data-analytics="header-section-navigation"
|
|
@@ -90,7 +83,7 @@
|
|
|
90
83
|
class="ons-navigation__item{{ ' ' + item.classes if item.classes else '' }}{{ ' ons-navigation__item--active' if (item.url == params.navigation.currentPath) or (params.navigation.currentPath is not string and item.url in params.navigation.currentPath) }}"
|
|
91
84
|
>
|
|
92
85
|
<a
|
|
93
|
-
class="ons-navigation__link
|
|
86
|
+
class="ons-navigation__link"
|
|
94
87
|
href="{{ item.url }}"
|
|
95
88
|
{% if item.ariaLabel %}aria-label="{{ item.ariaLabel }}"{% endif %}
|
|
96
89
|
{% if item.id %}id="{{ item.id }}"{% endif %}
|
|
@@ -107,7 +100,9 @@
|
|
|
107
100
|
</div>
|
|
108
101
|
</nav>
|
|
109
102
|
{% endif %}
|
|
110
|
-
<div
|
|
103
|
+
<div
|
|
104
|
+
class="ons-u-d-no@l{{ ' ons-navigation--neutral' if params.variants == 'neutral' else '' }}{{ ' ' + params.navigation.subNavigation.classes if params.navigation.subNavigation.classes else '' }}"
|
|
105
|
+
>
|
|
111
106
|
{{
|
|
112
107
|
onsButton({
|
|
113
108
|
"text": params.navigation.currentPageTitle,
|
|
@@ -122,10 +117,10 @@
|
|
|
122
117
|
})
|
|
123
118
|
}}
|
|
124
119
|
<nav
|
|
125
|
-
class="ons-navigation ons-navigation--sub-mobile ons-u-d-no ons-js-secondary-nav ons-u-mt-2xs"
|
|
120
|
+
class="ons-navigation ons-navigation--sub-mobile ons-u-d-no ons-js-secondary-nav ons-u-mt-2xs{{ ' ons-navigation--sub-neutral' if params.variants == 'neutral' else '' }}"
|
|
126
121
|
id="{{ params.navigation.subNavigation.id }}--mobile"
|
|
127
122
|
aria-hidden="true"
|
|
128
|
-
aria-label="{{ params.navigation.subNavigation.ariaLabel | default(
|
|
123
|
+
aria-label="{{ params.navigation.subNavigation.ariaLabel | default('Section menu') }}"
|
|
129
124
|
data-analytics="header-section-navigation"
|
|
130
125
|
>
|
|
131
126
|
<div
|
|
@@ -14,6 +14,11 @@
|
|
|
14
14
|
padding-top: 0.5rem;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
&--sub-neutral {
|
|
18
|
+
background: var(--ons-color-grey-15);
|
|
19
|
+
padding-top: 0.5rem;
|
|
20
|
+
}
|
|
21
|
+
|
|
17
22
|
&--sub-mobile {
|
|
18
23
|
border-bottom: 4px solid var(--ons-color-branded-tint);
|
|
19
24
|
}
|
|
@@ -125,6 +130,25 @@
|
|
|
125
130
|
}
|
|
126
131
|
}
|
|
127
132
|
|
|
133
|
+
&--sub-neutral & {
|
|
134
|
+
&__link,
|
|
135
|
+
&__link:hover,
|
|
136
|
+
&__link:focus {
|
|
137
|
+
color: var(--ons-color-black);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&__item {
|
|
141
|
+
&:hover,
|
|
142
|
+
&--active {
|
|
143
|
+
border-color: var(--ons-color-black);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&--sub-mobile.ons-navigation--sub-neutral {
|
|
149
|
+
background: var(--ons-color-white);
|
|
150
|
+
}
|
|
151
|
+
|
|
128
152
|
&__item--active > &__link {
|
|
129
153
|
font-weight: $font-weight-bold;
|
|
130
154
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import DOMPurify from 'dompurify';
|
|
2
|
+
|
|
1
3
|
let clearAlertAnnounced;
|
|
2
4
|
export default class ClearRadios {
|
|
3
5
|
constructor(inputs, button, otherInput) {
|
|
@@ -32,7 +34,7 @@ export default class ClearRadios {
|
|
|
32
34
|
setClearAttributes() {
|
|
33
35
|
this.button.classList.remove('ons-u-db-no-js_enabled');
|
|
34
36
|
if (clearAlertAnnounced === false) {
|
|
35
|
-
this.ariaElement.innerHTML = this.clearAlert;
|
|
37
|
+
this.ariaElement.innerHTML = DOMPurify.sanitize(this.clearAlert);
|
|
36
38
|
clearAlertAnnounced = true;
|
|
37
39
|
}
|
|
38
40
|
}
|
|
@@ -49,7 +51,7 @@ export default class ClearRadios {
|
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
this.button.classList.add('ons-u-db-no-js_enabled');
|
|
52
|
-
this.ariaElement.innerHTML = this.clearedAlert;
|
|
54
|
+
this.ariaElement.innerHTML = DOMPurify.sanitize(this.clearedAlert);
|
|
53
55
|
clearAlertAnnounced = false;
|
|
54
56
|
}
|
|
55
57
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import DOMPurify from 'dompurify';
|
|
2
|
+
|
|
1
3
|
export default class Relationships {
|
|
2
4
|
constructor(context) {
|
|
3
5
|
this.context = context;
|
|
@@ -20,9 +22,9 @@ export default class Relationships {
|
|
|
20
22
|
if (radio) {
|
|
21
23
|
const title = radio.getAttribute('data-title');
|
|
22
24
|
|
|
23
|
-
this.legend.innerHTML = title;
|
|
25
|
+
this.legend.innerHTML = DOMPurify.sanitize(title);
|
|
24
26
|
|
|
25
|
-
this.playback.innerHTML = radio.getAttribute('data-playback');
|
|
27
|
+
this.playback.innerHTML = DOMPurify.sanitize(radio.getAttribute('data-playback'));
|
|
26
28
|
}
|
|
27
29
|
}
|
|
28
30
|
}
|