govuk_publishing_components 35.11.0 → 35.12.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.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-core.js +2 -48
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-form-tracker.js +5 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-link-tracker.js +2 -2
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-schemas.js +51 -5
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-scroll-tracker.js +225 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/init-ga4.js +0 -5
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4.js +1 -0
- data/app/views/govuk_publishing_components/components/_attachment.html.erb +3 -1
- data/app/views/govuk_publishing_components/components/_tabs.html.erb +30 -14
- data/app/views/govuk_publishing_components/components/docs/tabs.yml +25 -2
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/govuk-frontend/govuk/all.js +406 -1
- data/node_modules/govuk-frontend/govuk/all.js.map +1 -1
- data/node_modules/govuk-frontend/govuk/common/govuk-frontend-version.js +1 -1
- data/node_modules/govuk-frontend/govuk/components/_all.scss +2 -1
- data/node_modules/govuk-frontend/govuk/components/back-link/_index.scss +8 -0
- data/node_modules/govuk-frontend/govuk/components/back-link/fixtures.json +9 -0
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/_index.scss +12 -0
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/fixtures.json +21 -0
- data/node_modules/govuk-frontend/govuk/components/button/_index.scss +41 -3
- data/node_modules/govuk-frontend/govuk/components/button/fixtures.json +44 -0
- data/node_modules/govuk-frontend/govuk/components/checkboxes/macro-options.json +9 -8
- data/node_modules/govuk-frontend/govuk/components/exit-this-page/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/exit-this-page/_exit-this-page.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/exit-this-page/_index.scss +97 -0
- data/node_modules/govuk-frontend/govuk/components/exit-this-page/exit-this-page.js +2120 -0
- data/node_modules/govuk-frontend/govuk/components/exit-this-page/exit-this-page.js.map +1 -0
- data/node_modules/govuk-frontend/govuk/components/exit-this-page/fixtures.json +50 -0
- data/node_modules/govuk-frontend/govuk/components/exit-this-page/macro-options.json +62 -0
- data/node_modules/govuk-frontend/govuk/components/exit-this-page/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/exit-this-page/template.njk +16 -0
- data/node_modules/govuk-frontend/govuk/components/radios/macro-options.json +9 -8
- data/node_modules/govuk-frontend/govuk/core/_govuk-frontend-version.scss +1 -1
- data/node_modules/govuk-frontend/govuk/helpers/_visually-hidden.scss +12 -0
- data/node_modules/govuk-frontend/govuk/objects/_template.scss +20 -0
- data/node_modules/govuk-frontend/govuk-esm/all.mjs +8 -0
- data/node_modules/govuk-frontend/govuk-esm/all.mjs.map +1 -1
- data/node_modules/govuk-frontend/govuk-esm/common/govuk-frontend-version.mjs +1 -1
- data/node_modules/govuk-frontend/govuk-esm/components/exit-this-page/exit-this-page.mjs +406 -0
- data/node_modules/govuk-frontend/govuk-esm/components/exit-this-page/exit-this-page.mjs.map +1 -0
- data/node_modules/govuk-frontend/govuk-prototype-kit.config.json +4 -0
- data/node_modules/govuk-frontend/package.json +4 -2
- metadata +14 -2
|
@@ -11,11 +11,12 @@
|
|
|
11
11
|
@import "details/index";
|
|
12
12
|
@import "error-message/index";
|
|
13
13
|
@import "error-summary/index";
|
|
14
|
+
@import "exit-this-page/index";
|
|
14
15
|
@import "fieldset/index";
|
|
15
16
|
@import "file-upload/index";
|
|
16
17
|
@import "footer/index";
|
|
17
|
-
@import "hint/index";
|
|
18
18
|
@import "header/index";
|
|
19
|
+
@import "hint/index";
|
|
19
20
|
@import "input/index";
|
|
20
21
|
@import "inset-text/index";
|
|
21
22
|
@import "label/index";
|
|
@@ -18,6 +18,15 @@
|
|
|
18
18
|
"hidden": false,
|
|
19
19
|
"html": "<a href=\"#\" class=\"govuk-back-link\">Back to home</a>"
|
|
20
20
|
},
|
|
21
|
+
{
|
|
22
|
+
"name": "with inverted colours",
|
|
23
|
+
"options": {
|
|
24
|
+
"classes": "govuk-back-link--inverse",
|
|
25
|
+
"href": "#"
|
|
26
|
+
},
|
|
27
|
+
"hidden": false,
|
|
28
|
+
"html": "<a href=\"#\" class=\"govuk-back-link govuk-back-link--inverse\">Back</a>"
|
|
29
|
+
},
|
|
21
30
|
{
|
|
22
31
|
"name": "classes",
|
|
23
32
|
"options": {
|
|
@@ -144,4 +144,16 @@
|
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
|
+
|
|
148
|
+
.govuk-breadcrumbs--inverse {
|
|
149
|
+
color: govuk-colour("white");
|
|
150
|
+
|
|
151
|
+
.govuk-breadcrumbs__link {
|
|
152
|
+
@include govuk-link-style-inverse;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.govuk-breadcrumbs__list-item:before {
|
|
156
|
+
border-color: currentcolor;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
147
159
|
}
|
|
@@ -115,6 +115,27 @@
|
|
|
115
115
|
"hidden": false,
|
|
116
116
|
"html": "<div class=\"govuk-breadcrumbs govuk-breadcrumbs--collapse-on-mobile\">\n <ol class=\"govuk-breadcrumbs__list\">\n <li class=\"govuk-breadcrumbs__list-item\">\n <a class=\"govuk-breadcrumbs__link\" href=\"/\">Home</a>\n </li>\n <li class=\"govuk-breadcrumbs__list-item\">\n <a class=\"govuk-breadcrumbs__link\" href=\"/education\">Education, training and skills</a>\n </li>\n <li class=\"govuk-breadcrumbs__list-item\">\n <a class=\"govuk-breadcrumbs__link\" href=\"/education/special-educational-needs-and-disability-send-and-high-needs\">Special educational needs and disability (SEND) and high needs</a>\n </li>\n </ol>\n</div>"
|
|
117
117
|
},
|
|
118
|
+
{
|
|
119
|
+
"name": "with inverted colours",
|
|
120
|
+
"options": {
|
|
121
|
+
"classes": "govuk-breadcrumbs--inverse",
|
|
122
|
+
"items": [
|
|
123
|
+
{
|
|
124
|
+
"text": "Home",
|
|
125
|
+
"href": "/"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"text": "Passports, travel and living abroad",
|
|
129
|
+
"href": "/browse/abroad"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"text": "Travel abroad"
|
|
133
|
+
}
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
"hidden": false,
|
|
137
|
+
"html": "<div class=\"govuk-breadcrumbs govuk-breadcrumbs--inverse\">\n <ol class=\"govuk-breadcrumbs__list\">\n <li class=\"govuk-breadcrumbs__list-item\">\n <a class=\"govuk-breadcrumbs__link\" href=\"/\">Home</a>\n </li>\n <li class=\"govuk-breadcrumbs__list-item\">\n <a class=\"govuk-breadcrumbs__link\" href=\"/browse/abroad\">Passports, travel and living abroad</a>\n </li>\n <li class=\"govuk-breadcrumbs__list-item\" aria-current=\"page\">Travel abroad</li>\n </ol>\n</div>"
|
|
138
|
+
},
|
|
118
139
|
{
|
|
119
140
|
"name": "classes",
|
|
120
141
|
"options": {
|
|
@@ -18,21 +18,27 @@ $govuk-button-text-colour: govuk-colour("white") !default;
|
|
|
18
18
|
|
|
19
19
|
@include govuk-exports("govuk/component/button") {
|
|
20
20
|
$govuk-button-colour: $govuk-button-background-colour;
|
|
21
|
+
$govuk-button-text-colour: $govuk-button-text-colour;
|
|
21
22
|
$govuk-button-hover-colour: govuk-shade($govuk-button-colour, 20%);
|
|
22
23
|
$govuk-button-shadow-colour: govuk-shade($govuk-button-colour, 60%);
|
|
23
|
-
$govuk-button-text-colour: $govuk-button-text-colour;
|
|
24
24
|
|
|
25
25
|
// Secondary button variables
|
|
26
26
|
$govuk-secondary-button-colour: govuk-colour("light-grey", $legacy: "grey-3");
|
|
27
|
+
$govuk-secondary-button-text-colour: govuk-colour("black");
|
|
27
28
|
$govuk-secondary-button-hover-colour: govuk-shade($govuk-secondary-button-colour, 10%);
|
|
28
29
|
$govuk-secondary-button-shadow-colour: govuk-shade($govuk-secondary-button-colour, 40%);
|
|
29
|
-
$govuk-secondary-button-text-colour: govuk-colour("black");
|
|
30
30
|
|
|
31
31
|
// Warning button variables
|
|
32
32
|
$govuk-warning-button-colour: govuk-colour("red");
|
|
33
|
+
$govuk-warning-button-text-colour: govuk-colour("white");
|
|
33
34
|
$govuk-warning-button-hover-colour: govuk-shade($govuk-warning-button-colour, 20%);
|
|
34
35
|
$govuk-warning-button-shadow-colour: govuk-shade($govuk-warning-button-colour, 60%);
|
|
35
|
-
|
|
36
|
+
|
|
37
|
+
// Inverse button variables
|
|
38
|
+
$govuk-inverse-button-colour: govuk-colour("white");
|
|
39
|
+
$govuk-inverse-button-text-colour: govuk-colour("blue");
|
|
40
|
+
$govuk-inverse-button-hover-colour: govuk-tint($govuk-inverse-button-text-colour, 90%);
|
|
41
|
+
$govuk-inverse-button-shadow-colour: govuk-shade($govuk-inverse-button-text-colour, 30%);
|
|
36
42
|
|
|
37
43
|
// Because the shadow (s0) is visually 'part of' the button, we need to reduce
|
|
38
44
|
// the height of the button to compensate by adjusting its padding (s1) and
|
|
@@ -251,6 +257,38 @@ $govuk-button-text-colour: govuk-colour("white") !default;
|
|
|
251
257
|
}
|
|
252
258
|
}
|
|
253
259
|
|
|
260
|
+
.govuk-button--inverse {
|
|
261
|
+
background-color: $govuk-inverse-button-colour;
|
|
262
|
+
box-shadow: 0 $button-shadow-size 0 $govuk-inverse-button-shadow-colour;
|
|
263
|
+
|
|
264
|
+
&,
|
|
265
|
+
&:link,
|
|
266
|
+
&:visited,
|
|
267
|
+
&:active,
|
|
268
|
+
&:hover {
|
|
269
|
+
color: $govuk-inverse-button-text-colour;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// alphagov/govuk_template includes a specific a:link:focus selector
|
|
273
|
+
// designed to make unvisited links a slightly darker blue when focussed, so
|
|
274
|
+
// we need to override the text colour for that combination of selectors so
|
|
275
|
+
// so that unvisited links styled as buttons do not end up with dark blue
|
|
276
|
+
// text when focussed.
|
|
277
|
+
@include _govuk-compatibility(govuk_template) {
|
|
278
|
+
&:link:focus {
|
|
279
|
+
color: $govuk-inverse-button-text-colour;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
&:hover {
|
|
284
|
+
background-color: $govuk-inverse-button-hover-colour;
|
|
285
|
+
|
|
286
|
+
&[disabled] {
|
|
287
|
+
background-color: $govuk-inverse-button-colour;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
254
292
|
.govuk-button--start {
|
|
255
293
|
@include govuk-typography-weight-bold;
|
|
256
294
|
@include govuk-typography-responsive($size: 24, $override-line-height: 1);
|
|
@@ -179,6 +179,50 @@
|
|
|
179
179
|
"hidden": false,
|
|
180
180
|
"html": "<a href=\"/\" role=\"button\" draggable=\"false\" class=\"govuk-button govuk-button--warning\" data-module=\"govuk-button\">\n Warning button\n</a>"
|
|
181
181
|
},
|
|
182
|
+
{
|
|
183
|
+
"name": "Inverse",
|
|
184
|
+
"options": {
|
|
185
|
+
"name": "Inverse",
|
|
186
|
+
"text": "Inverse button",
|
|
187
|
+
"classes": "govuk-button--inverse"
|
|
188
|
+
},
|
|
189
|
+
"hidden": false,
|
|
190
|
+
"html": "<button name=\"Inverse\" class=\"govuk-button govuk-button--inverse\" data-module=\"govuk-button\">\n Inverse button\n</button>"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"name": "Inverse disabled",
|
|
194
|
+
"options": {
|
|
195
|
+
"name": "Inverse",
|
|
196
|
+
"text": "Inverse button disabled",
|
|
197
|
+
"classes": "govuk-button--inverse",
|
|
198
|
+
"disabled": true
|
|
199
|
+
},
|
|
200
|
+
"hidden": false,
|
|
201
|
+
"html": "<button name=\"Inverse\" disabled=\"disabled\" aria-disabled=\"true\" class=\"govuk-button govuk-button--inverse govuk-button--disabled\" data-module=\"govuk-button\">\n Inverse button disabled\n</button>"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"name": "Inverse link",
|
|
205
|
+
"options": {
|
|
206
|
+
"name": "Inverse",
|
|
207
|
+
"text": "Inverse button",
|
|
208
|
+
"href": "/",
|
|
209
|
+
"classes": "govuk-button--inverse"
|
|
210
|
+
},
|
|
211
|
+
"hidden": false,
|
|
212
|
+
"html": "<a href=\"/\" role=\"button\" draggable=\"false\" class=\"govuk-button govuk-button--inverse\" data-module=\"govuk-button\">\n Inverse button\n</a>"
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"name": "Inverse start button",
|
|
216
|
+
"options": {
|
|
217
|
+
"name": "Inverse",
|
|
218
|
+
"text": "Inverse start button",
|
|
219
|
+
"href": "/",
|
|
220
|
+
"classes": "govuk-button--inverse",
|
|
221
|
+
"isStartButton": true
|
|
222
|
+
},
|
|
223
|
+
"hidden": false,
|
|
224
|
+
"html": "<a href=\"/\" role=\"button\" draggable=\"false\" class=\"govuk-button govuk-button--inverse govuk-button--start\" data-module=\"govuk-button\">\n Inverse start button\n <svg class=\"govuk-button__start-icon\" xmlns=\"http://www.w3.org/2000/svg\" width=\"17.5\" height=\"19\" viewBox=\"0 0 33 40\" aria-hidden=\"true\" focusable=\"false\">\n <path fill=\"currentColor\" d=\"M0 0h13l20 20-20 20H0l20-20z\"/>\n </svg></a>"
|
|
225
|
+
},
|
|
182
226
|
{
|
|
183
227
|
"name": "attributes",
|
|
184
228
|
"options": {
|
|
@@ -116,15 +116,16 @@
|
|
|
116
116
|
},
|
|
117
117
|
{
|
|
118
118
|
"name": "conditional",
|
|
119
|
-
"type": "
|
|
120
|
-
"required": false,
|
|
121
|
-
"description": "If `true`, content provided will be revealed when the item is checked."
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
"name": "conditional.html",
|
|
125
|
-
"type": "string",
|
|
119
|
+
"type": "object",
|
|
126
120
|
"required": false,
|
|
127
|
-
"description": "Provide content
|
|
121
|
+
"description": "Provide additional content to reveal when the checkbox is checked.",
|
|
122
|
+
"params": [
|
|
123
|
+
{
|
|
124
|
+
"name": "html",
|
|
125
|
+
"type": "string",
|
|
126
|
+
"description": "The HTML to reveal when the checkbox is checked"
|
|
127
|
+
}
|
|
128
|
+
]
|
|
128
129
|
},
|
|
129
130
|
{
|
|
130
131
|
"name": "behaviour",
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Exit this page
|
|
2
|
+
|
|
3
|
+
## Installation
|
|
4
|
+
|
|
5
|
+
See the [main README quick start guide](https://github.com/alphagov/govuk-frontend#quick-start) for how to install this component.
|
|
6
|
+
|
|
7
|
+
## Guidance and Examples
|
|
8
|
+
|
|
9
|
+
Find out when to use the exit this page component in your service in the [GOV.UK Design System](https://design-system.service.gov.uk/components/exit-this-page).
|
|
10
|
+
|
|
11
|
+
## Component options
|
|
12
|
+
|
|
13
|
+
Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
|
|
14
|
+
|
|
15
|
+
See [options table](https://design-system.service.gov.uk/components/exit-this-page/#options-exit-this-page-example) for details.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
@import "../button/index";
|
|
2
|
+
|
|
3
|
+
@include govuk-exports("govuk/component/exit-this-page") {
|
|
4
|
+
$indicator-size: .75em;
|
|
5
|
+
|
|
6
|
+
.govuk-exit-this-page {
|
|
7
|
+
@include govuk-responsive-margin(8, "bottom");
|
|
8
|
+
position: -webkit-sticky;
|
|
9
|
+
position: sticky;
|
|
10
|
+
z-index: 1000;
|
|
11
|
+
top: 0;
|
|
12
|
+
left: 0;
|
|
13
|
+
width: 100%;
|
|
14
|
+
|
|
15
|
+
@include govuk-media-query($from: tablet) {
|
|
16
|
+
display: inline-block;
|
|
17
|
+
right: 0;
|
|
18
|
+
left: auto;
|
|
19
|
+
width: auto;
|
|
20
|
+
float: right;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.govuk-exit-this-page__button {
|
|
25
|
+
margin-bottom: 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.govuk-exit-this-page__indicator {
|
|
29
|
+
@include govuk-responsive-padding(2);
|
|
30
|
+
display: none;
|
|
31
|
+
padding-bottom: 0;
|
|
32
|
+
color: inherit;
|
|
33
|
+
line-height: 0; // removes extra negative space below the indicators
|
|
34
|
+
text-align: center;
|
|
35
|
+
pointer-events: none;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.govuk-exit-this-page__indicator--visible {
|
|
39
|
+
display: block;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.govuk-exit-this-page__indicator-light {
|
|
43
|
+
box-sizing: border-box;
|
|
44
|
+
display: inline-block;
|
|
45
|
+
width: $indicator-size;
|
|
46
|
+
height: $indicator-size;
|
|
47
|
+
margin: 0 .125em;
|
|
48
|
+
border-width: 2px;
|
|
49
|
+
border-style: solid;
|
|
50
|
+
border-radius: 50%;
|
|
51
|
+
|
|
52
|
+
@include _govuk-not-ie8 {
|
|
53
|
+
border-color: currentcolor;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@include _govuk-if-ie8 {
|
|
57
|
+
border-color: govuk-colour("white");
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.govuk-exit-this-page__indicator-light--on {
|
|
62
|
+
border-width: $indicator-size / 2;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@media only print {
|
|
66
|
+
.govuk-exit-this-page {
|
|
67
|
+
display: none;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.govuk-exit-this-page-overlay {
|
|
72
|
+
position: fixed;
|
|
73
|
+
z-index: 9999;
|
|
74
|
+
top: 0;
|
|
75
|
+
right: 0;
|
|
76
|
+
bottom: 0;
|
|
77
|
+
left: 0;
|
|
78
|
+
background-color: govuk-colour("white");
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// This class is added to the body when the Exit This Page button is activated
|
|
82
|
+
// in addition to the overlay to both block the entire screen and hide everything
|
|
83
|
+
// underneath it.
|
|
84
|
+
//
|
|
85
|
+
// We do this to ensure that users don't risk interacting with the page underneath
|
|
86
|
+
// the overlay between activating the button and navigating to the next page.
|
|
87
|
+
.govuk-exit-this-page-hide-content {
|
|
88
|
+
// stylelint-disable declaration-no-important
|
|
89
|
+
* {
|
|
90
|
+
display: none !important;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.govuk-exit-this-page-overlay {
|
|
94
|
+
display: block !important;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|