govuk_publishing_components 28.9.2 → 29.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/assets/config/govuk_publishing_components_manifest.js +15 -3
- data/app/assets/javascripts/govuk_publishing_components/dependencies.js +2 -5
- data/app/assets/javascripts/govuk_publishing_components/modules.js +15 -18
- data/app/assets/javascripts/govuk_publishing_components/{rum-loader.js.erb → rum-loader.js} +13 -10
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +1 -0
- data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +7 -1
- data/app/views/govuk_publishing_components/components/docs/big_number.yml +3 -3
- data/app/views/govuk_publishing_components/components/docs/breadcrumbs.yml +3 -3
- data/app/views/govuk_publishing_components/components/docs/button.yml +2 -2
- data/app/views/govuk_publishing_components/components/docs/checkboxes.yml +5 -5
- data/app/views/govuk_publishing_components/components/docs/contents_list.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/contextual_breadcrumbs.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/contextual_guidance.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/cookie_banner.yml +2 -2
- data/app/views/govuk_publishing_components/components/docs/date_input.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/details.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/devolved_nations.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/document_list.yml +2 -2
- data/app/views/govuk_publishing_components/components/docs/error_alert.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/error_summary.yml +2 -2
- data/app/views/govuk_publishing_components/components/docs/feedback.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/fieldset.yml +4 -4
- data/app/views/govuk_publishing_components/components/docs/heading.yml +4 -4
- data/app/views/govuk_publishing_components/components/docs/hint.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/input.yml +3 -3
- data/app/views/govuk_publishing_components/components/docs/inset_text.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/label.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/layout_footer.yml +2 -2
- data/app/views/govuk_publishing_components/components/docs/lead_paragraph.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/metadata.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/notice.yml +2 -2
- data/app/views/govuk_publishing_components/components/docs/print_link.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/search.yml +4 -4
- data/app/views/govuk_publishing_components/components/docs/select.yml +5 -5
- data/app/views/govuk_publishing_components/components/docs/show_password.yml +3 -3
- data/app/views/govuk_publishing_components/components/docs/signup_link.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/single_page_notification_button.yml +2 -2
- data/app/views/govuk_publishing_components/components/docs/step_by_step_nav.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/step_by_step_nav_header.yml +3 -3
- data/app/views/govuk_publishing_components/components/docs/subscription_links.yml +3 -3
- data/app/views/govuk_publishing_components/components/docs/success_alert.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/table.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/textarea.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/title.yml +1 -1
- data/config/initializers/assets.rb +15 -45
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +10 -117
- data/node_modules/jquery/AUTHORS.txt +0 -266
- data/node_modules/jquery/LICENSE.txt +0 -36
- data/node_modules/jquery/README.md +0 -65
- data/node_modules/jquery/bower.json +0 -14
- data/node_modules/jquery/dist/jquery.js +0 -11008
- data/node_modules/jquery/dist/jquery.min.js +0 -5
- data/node_modules/jquery/dist/jquery.min.map +0 -1
- data/node_modules/jquery/external/sizzle/LICENSE.txt +0 -36
- data/node_modules/jquery/external/sizzle/dist/sizzle.js +0 -2143
- data/node_modules/jquery/external/sizzle/dist/sizzle.min.js +0 -3
- data/node_modules/jquery/external/sizzle/dist/sizzle.min.map +0 -1
- data/node_modules/jquery/package.json +0 -85
- data/node_modules/jquery/src/ajax/jsonp.js +0 -100
- data/node_modules/jquery/src/ajax/load.js +0 -83
- data/node_modules/jquery/src/ajax/parseJSON.js +0 -53
- data/node_modules/jquery/src/ajax/parseXML.js +0 -31
- data/node_modules/jquery/src/ajax/script.js +0 -95
- data/node_modules/jquery/src/ajax/var/location.js +0 -3
- data/node_modules/jquery/src/ajax/var/nonce.js +0 -5
- data/node_modules/jquery/src/ajax/var/rquery.js +0 -3
- data/node_modules/jquery/src/ajax/xhr.js +0 -229
- data/node_modules/jquery/src/ajax.js +0 -842
- data/node_modules/jquery/src/attributes/attr.js +0 -281
- data/node_modules/jquery/src/attributes/classes.js +0 -174
- data/node_modules/jquery/src/attributes/prop.js +0 -156
- data/node_modules/jquery/src/attributes/support.js +0 -70
- data/node_modules/jquery/src/attributes/val.js +0 -191
- data/node_modules/jquery/src/attributes.js +0 -11
- data/node_modules/jquery/src/callbacks.js +0 -232
- data/node_modules/jquery/src/core/access.js +0 -65
- data/node_modules/jquery/src/core/init.js +0 -140
- data/node_modules/jquery/src/core/parseHTML.js +0 -41
- data/node_modules/jquery/src/core/ready.js +0 -163
- data/node_modules/jquery/src/core/var/rsingleTag.js +0 -5
- data/node_modules/jquery/src/core.js +0 -529
- data/node_modules/jquery/src/css/addGetHookIf.js +0 -24
- data/node_modules/jquery/src/css/adjustCSS.js +0 -65
- data/node_modules/jquery/src/css/curCSS.js +0 -137
- data/node_modules/jquery/src/css/defaultDisplay.js +0 -72
- data/node_modules/jquery/src/css/hiddenVisibleSelectors.js +0 -42
- data/node_modules/jquery/src/css/showHide.js +0 -45
- data/node_modules/jquery/src/css/support.js +0 -184
- data/node_modules/jquery/src/css/var/cssExpand.js +0 -3
- data/node_modules/jquery/src/css/var/isHidden.js +0 -16
- data/node_modules/jquery/src/css/var/rmargin.js +0 -3
- data/node_modules/jquery/src/css/var/rnumnonpx.js +0 -5
- data/node_modules/jquery/src/css/var/swap.js +0 -24
- data/node_modules/jquery/src/css.js +0 -563
- data/node_modules/jquery/src/data/support.js +0 -23
- data/node_modules/jquery/src/data/var/acceptData.js +0 -20
- data/node_modules/jquery/src/data.js +0 -342
- data/node_modules/jquery/src/deferred.js +0 -159
- data/node_modules/jquery/src/deprecated.js +0 -34
- data/node_modules/jquery/src/dimensions.js +0 -56
- data/node_modules/jquery/src/effects/Tween.js +0 -121
- data/node_modules/jquery/src/effects/animatedSelector.js +0 -13
- data/node_modules/jquery/src/effects/support.js +0 -58
- data/node_modules/jquery/src/effects.js +0 -640
- data/node_modules/jquery/src/event/ajax.js +0 -20
- data/node_modules/jquery/src/event/alias.js +0 -25
- data/node_modules/jquery/src/event/support.js +0 -28
- data/node_modules/jquery/src/event.js +0 -1134
- data/node_modules/jquery/src/exports/amd.js +0 -24
- data/node_modules/jquery/src/exports/global.js +0 -26
- data/node_modules/jquery/src/intro.js +0 -44
- data/node_modules/jquery/src/jquery.js +0 -37
- data/node_modules/jquery/src/manipulation/_evalUrl.js +0 -21
- data/node_modules/jquery/src/manipulation/buildFragment.js +0 -157
- data/node_modules/jquery/src/manipulation/createSafeFragment.js +0 -20
- data/node_modules/jquery/src/manipulation/getAll.js +0 -33
- data/node_modules/jquery/src/manipulation/setGlobalEval.js +0 -19
- data/node_modules/jquery/src/manipulation/support.js +0 -72
- data/node_modules/jquery/src/manipulation/var/nodeNames.js +0 -5
- data/node_modules/jquery/src/manipulation/var/rcheckableType.js +0 -3
- data/node_modules/jquery/src/manipulation/var/rleadingWhitespace.js +0 -3
- data/node_modules/jquery/src/manipulation/var/rscriptType.js +0 -3
- data/node_modules/jquery/src/manipulation/var/rtagName.js +0 -3
- data/node_modules/jquery/src/manipulation/wrapMap.js +0 -30
- data/node_modules/jquery/src/manipulation.js +0 -585
- data/node_modules/jquery/src/offset.js +0 -219
- data/node_modules/jquery/src/outro.js +0 -2
- data/node_modules/jquery/src/queue/delay.js +0 -22
- data/node_modules/jquery/src/queue.js +0 -144
- data/node_modules/jquery/src/selector-sizzle.js +0 -14
- data/node_modules/jquery/src/selector.js +0 -1
- data/node_modules/jquery/src/serialize.js +0 -125
- data/node_modules/jquery/src/support.js +0 -63
- data/node_modules/jquery/src/traversing/findFilter.js +0 -100
- data/node_modules/jquery/src/traversing/var/dir.js +0 -20
- data/node_modules/jquery/src/traversing/var/rneedsContext.js +0 -6
- data/node_modules/jquery/src/traversing/var/siblings.js +0 -15
- data/node_modules/jquery/src/traversing.js +0 -179
- data/node_modules/jquery/src/var/class2type.js +0 -5
- data/node_modules/jquery/src/var/concat.js +0 -5
- data/node_modules/jquery/src/var/deletedIds.js +0 -3
- data/node_modules/jquery/src/var/document.js +0 -3
- data/node_modules/jquery/src/var/documentElement.js +0 -5
- data/node_modules/jquery/src/var/hasOwn.js +0 -5
- data/node_modules/jquery/src/var/indexOf.js +0 -5
- data/node_modules/jquery/src/var/pnum.js +0 -3
- data/node_modules/jquery/src/var/push.js +0 -5
- data/node_modules/jquery/src/var/rcssNum.js +0 -7
- data/node_modules/jquery/src/var/rnotwhite.js +0 -3
- data/node_modules/jquery/src/var/slice.js +0 -5
- data/node_modules/jquery/src/var/support.js +0 -5
- data/node_modules/jquery/src/var/toString.js +0 -5
- data/node_modules/jquery/src/wrap.js +0 -77
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2a6d452bad04acba831509df0a7ed9a45222ec20c745985beb49af0f9e7fd7a
|
4
|
+
data.tar.gz: 73e0d20cac3a9214e0c3c9dc052e419e52c41580578e87f1fdbf768b82d22e71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88203478b10e3b75f0c6b3aecf161c72102cf27978c9ee67ff129bc7b1e0c9798792165ec637855f2057458b2e5bae49fb6b6ac62e17cdd96466c755b06f9b33
|
7
|
+
data.tar.gz: 76d93abedcb28c9cea6983364fe0410067c895364c50d51b672e8a40df4d4fb42d8793502e8c9dd9719b205a94b0e668c45c3a5d992a21a95785eced6d389693
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# GOV.UK Publishing Components
|
2
2
|
|
3
|
-
[![status](https://badgen.net/github/status/alphagov/govuk_publishing_components/
|
3
|
+
[![status](https://badgen.net/github/status/alphagov/govuk_publishing_components/main)](https://github.com/alphagov/govuk_publishing_components/actions?query=branch%3Amain)
|
4
4
|
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
|
5
5
|
[![Stylelint Style Guide](https://img.shields.io/badge/code_style-stylelint-brightgreen.svg)](https://github.com/alphagov/stylelint-config-gds/)
|
6
6
|
|
@@ -1,3 +1,15 @@
|
|
1
|
-
//
|
2
|
-
//=
|
3
|
-
//=
|
1
|
+
// Pre-compile image and font assets from here and govuk-frontend
|
2
|
+
//= link_tree ../images
|
3
|
+
//= link_tree ../../../node_modules/govuk-frontend/govuk/assets/images
|
4
|
+
//= link_tree ../../../node_modules/govuk-frontend/govuk/assets/fonts
|
5
|
+
|
6
|
+
// Create asset files of each of the files in these directory
|
7
|
+
//= link_directory ../javascripts/component_guide
|
8
|
+
//= link_directory ../javascripts/govuk_publishing_components
|
9
|
+
|
10
|
+
// Pre-compile these specific files
|
11
|
+
//= link govuk_publishing_components/vendor/modernizr.js
|
12
|
+
//= link govuk_publishing_components/vendor/lux/lux-reporter.js
|
13
|
+
//= link govuk_publishing_components/vendor/lux/lux-measurer.js
|
14
|
+
//= link component_guide/application.css
|
15
|
+
//= link component_guide/print.css
|
@@ -1,12 +1,9 @@
|
|
1
|
-
/* eslint-env
|
1
|
+
/* eslint-env */
|
2
2
|
|
3
3
|
// This adds in javascript that initialises components and dependencies
|
4
4
|
// that are provided by Slimmer in public frontend applications.
|
5
|
-
// = require jquery/dist/jquery
|
6
5
|
// = require ./modules.js
|
7
6
|
|
8
|
-
|
9
|
-
'use strict'
|
10
|
-
|
7
|
+
document.addEventListener('DOMContentLoaded', function () {
|
11
8
|
window.GOVUK.modules.start()
|
12
9
|
})
|
@@ -1,49 +1,46 @@
|
|
1
1
|
;(function (global) {
|
2
2
|
'use strict'
|
3
3
|
|
4
|
-
var $ = global.jQuery
|
5
4
|
var GOVUK = global.GOVUK || {}
|
6
5
|
GOVUK.Modules = GOVUK.Modules || {}
|
7
6
|
|
8
7
|
GOVUK.modules = {
|
9
8
|
find: function (container) {
|
10
|
-
container =
|
9
|
+
container = container || document
|
11
10
|
|
12
11
|
var modules
|
13
12
|
var moduleSelector = '[data-module]'
|
14
13
|
|
15
|
-
modules = container.
|
14
|
+
modules = container.querySelectorAll(moduleSelector)
|
15
|
+
var modulesArray = []
|
16
|
+
// convert nodelist of modules to array
|
17
|
+
for (var i = 0; i < modules.length; i++) {
|
18
|
+
modulesArray.push(modules[i])
|
19
|
+
}
|
16
20
|
|
17
21
|
// Container could be a module too
|
18
|
-
if (container.
|
19
|
-
|
22
|
+
if (container !== document && container.getAttribute('data-module')) {
|
23
|
+
modulesArray.push(container)
|
20
24
|
}
|
21
|
-
|
22
|
-
return modules
|
25
|
+
return modulesArray
|
23
26
|
},
|
24
27
|
|
25
28
|
start: function (container) {
|
26
29
|
var modules = this.find(container)
|
27
30
|
|
28
31
|
for (var i = 0, l = modules.length; i < l; i++) {
|
29
|
-
var element =
|
30
|
-
var moduleNames = element.
|
32
|
+
var element = modules[i]
|
33
|
+
var moduleNames = element.getAttribute('data-module').split(' ')
|
31
34
|
|
32
35
|
for (var j = 0, k = moduleNames.length; j < k; j++) {
|
33
36
|
var moduleName = camelCaseAndCapitalise(moduleNames[j])
|
34
|
-
var started = element.data
|
37
|
+
var started = element.getAttribute('data-' + moduleNames[j] + '-module-started')
|
35
38
|
|
36
39
|
if (typeof GOVUK.Modules[moduleName] === 'function' && !started) {
|
37
|
-
// GOV.UK Legacy Modules using jQuery
|
38
|
-
if (!GOVUK.Modules[moduleName].prototype.init) {
|
39
|
-
new GOVUK.Modules[moduleName]().start(element)
|
40
|
-
element.data(moduleNames[j] + '-module-started', true)
|
41
|
-
}
|
42
|
-
|
43
40
|
// Vanilla JavaScript GOV.UK Modules and GOV.UK Frontend Modules
|
44
41
|
if (GOVUK.Modules[moduleName].prototype.init) {
|
45
|
-
new GOVUK.Modules[moduleName](element
|
46
|
-
element.data
|
42
|
+
new GOVUK.Modules[moduleName](element).init()
|
43
|
+
element.setAttribute('data-' + moduleNames[j] + '-module-started', true)
|
47
44
|
}
|
48
45
|
}
|
49
46
|
}
|
@@ -1,7 +1,5 @@
|
|
1
|
-
(function() {
|
2
|
-
var
|
3
|
-
|
4
|
-
var parsedCookie = (function() {
|
1
|
+
(function () {
|
2
|
+
var parsedCookie = (function () {
|
5
3
|
try {
|
6
4
|
var cookies = document.cookie.split(';')
|
7
5
|
|
@@ -20,11 +18,16 @@
|
|
20
18
|
return {}
|
21
19
|
})()
|
22
20
|
|
23
|
-
var insertScript = function(
|
24
|
-
var marker = document.
|
21
|
+
var insertScript = function () {
|
22
|
+
var marker = document.querySelector('script[data-lux-reporter-script]')
|
23
|
+
|
24
|
+
if (!marker) {
|
25
|
+
console.error("Failed to configure real-user-monitoring because couldn't the lux-reporter script path wasn't available")
|
26
|
+
return
|
27
|
+
}
|
25
28
|
|
26
29
|
var script = document.createElement('script')
|
27
|
-
script.src =
|
30
|
+
script.src = marker.getAttribute('data-lux-reporter-script')
|
28
31
|
script.async = true
|
29
32
|
script.defer = true
|
30
33
|
|
@@ -32,10 +35,10 @@
|
|
32
35
|
}
|
33
36
|
|
34
37
|
if (parsedCookie.usage === true) {
|
35
|
-
insertScript(
|
38
|
+
insertScript()
|
36
39
|
} else {
|
37
|
-
window.addEventListener('cookie-consent', function() {
|
38
|
-
insertScript(
|
40
|
+
window.addEventListener('cookie-consent', function () {
|
41
|
+
insertScript()
|
39
42
|
})
|
40
43
|
}
|
41
44
|
})()
|
@@ -474,6 +474,7 @@ $button-pipe-colour: darken(govuk-colour("mid-grey"), 20%);
|
|
474
474
|
&:visited {
|
475
475
|
@include govuk-media-query($from: "desktop") {
|
476
476
|
background: $govuk-brand-colour;
|
477
|
+
border-bottom: 1px solid govuk-colour("dark-blue");
|
477
478
|
|
478
479
|
&:hover {
|
479
480
|
background: govuk-colour("black");
|
@@ -51,7 +51,13 @@
|
|
51
51
|
<title><%= title %></title>
|
52
52
|
|
53
53
|
<%= javascript_include_tag "govuk_publishing_components/vendor/lux/lux-measurer", { async: true } %>
|
54
|
-
<%= javascript_include_tag "govuk_publishing_components/rum-loader",
|
54
|
+
<%= javascript_include_tag "govuk_publishing_components/rum-loader",
|
55
|
+
{
|
56
|
+
async: true,
|
57
|
+
data: {
|
58
|
+
"lux-reporter-script": path_to_javascript("govuk_publishing_components/vendor/lux/lux-reporter")
|
59
|
+
}
|
60
|
+
} %>
|
55
61
|
|
56
62
|
<%= csrf_meta_tags %>
|
57
63
|
|
@@ -19,7 +19,7 @@ examples:
|
|
19
19
|
number: 119
|
20
20
|
label: Open consultations
|
21
21
|
passing_extra_symbols:
|
22
|
-
description: "In some cases, we want to communicate more than just the flat numeric value eg: 400
|
22
|
+
description: "In some cases, we want to communicate more than just the flat numeric value eg: `400+`, `90%`, `-20`, `1M` etc. This is why we allow values to be passed as flat strings."
|
23
23
|
data:
|
24
24
|
number: "400+"
|
25
25
|
label: Other agencies and public bodies
|
@@ -35,7 +35,7 @@ examples:
|
|
35
35
|
href: "/government/organisations#ministerial_departments"
|
36
36
|
with_data_attributes:
|
37
37
|
description: |
|
38
|
-
If a `href` attribute is present,
|
38
|
+
If a `href` attribute is present, `data_attributes` will apply to the `span` containing the number value (see below).
|
39
39
|
|
40
40
|
This will also not automatically apply a `gem-track-click` module attribute if the data attributes pertain to click tracking. Remember to apply this outside the component call in a surrounding element, if using.
|
41
41
|
data:
|
@@ -62,7 +62,7 @@ examples:
|
|
62
62
|
aria:
|
63
63
|
hidden: true
|
64
64
|
with_bottom_margin:
|
65
|
-
description: The component accepts a number for margin bottom from 0 to 9 (0px to 60px) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). The default big number margin bottom is 15px (govuk
|
65
|
+
description: The component accepts a number for margin bottom from `0` to `9` (`0px` to `60px`) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). The default big number margin bottom is `15px` (`govuk-spacing(3)`).
|
66
66
|
data:
|
67
67
|
number: 119
|
68
68
|
label: Open consultations
|
@@ -2,9 +2,9 @@ name: "Breadcrumbs"
|
|
2
2
|
description: "Navigational breadcrumbs, showing page hierarchy"
|
3
3
|
body: |
|
4
4
|
Accepts an array of breadcrumb objects. Each crumb must have a title and a URL.
|
5
|
-
Links have tracking data but links to the homepage (any link with a url of
|
5
|
+
Links have tracking data but links to the homepage (any link with a url of `/`) will be tracked separately as `homeLinkClicked`
|
6
6
|
|
7
|
-
We recommend that if using the breadcrumbs for navigation purposes, you set collapse_on_mobile to true to make things more readable for mobile users. However, you can specify `collapse_on_mobile
|
7
|
+
We recommend that if using the breadcrumbs for navigation purposes, you set `collapse_on_mobile` to `true` to make things more readable for mobile users. However, you can specify `collapse_on_mobile:``false` or remove the flag completely to stop this behaviour.
|
8
8
|
shared_accessibility_criteria:
|
9
9
|
- link
|
10
10
|
accessibility_criteria:
|
@@ -87,7 +87,7 @@ examples:
|
|
87
87
|
- title: 'Education of disadvantaged children appended with some extra long content to make this a very very very very long taxon'
|
88
88
|
url: '/education'
|
89
89
|
stop_collapsing_on_mobile:
|
90
|
-
description: We recommend that if using the breadcrumbs for navigation purposes, you set collapse_on_mobile to true to make things more readable for mobile users. However, you can specify `collapse_on_mobile
|
90
|
+
description: We recommend that if using the breadcrumbs for navigation purposes, you set `collapse_on_mobile` to `true` to make things more readable for mobile users. However, you can specify `collapse_on_mobile:``false` or remove the flag completely to stop this behaviour.
|
91
91
|
data:
|
92
92
|
collapse_on_mobile: false
|
93
93
|
breadcrumbs:
|
@@ -67,12 +67,12 @@ examples:
|
|
67
67
|
start: true
|
68
68
|
info_text: "Sometimes you want to explain where a user is going to."
|
69
69
|
with_margin_bottom:
|
70
|
-
description:
|
70
|
+
description: The component accepts a number for margin bottom from `0` to `9` (`0px` to `60px`) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to having no margin bottom.
|
71
71
|
data:
|
72
72
|
text: "Submit"
|
73
73
|
margin_bottom: 6
|
74
74
|
start_now_button_with_info_text_and_margin_bottom:
|
75
|
-
description:
|
75
|
+
description: When the component requires margin bottom and has info text, the margin is applied to the info text.
|
76
76
|
data:
|
77
77
|
text: "Start now"
|
78
78
|
href: "#"
|
@@ -124,7 +124,7 @@ examples:
|
|
124
124
|
- label: "Blue"
|
125
125
|
value: "blue"
|
126
126
|
without_hint_text:
|
127
|
-
description: Hint text can be removed entirely with this option. Note that this option can be combined with the visually_hide_heading option.
|
127
|
+
description: Hint text can be removed entirely with this option. Note that this option can be combined with the `visually_hide_heading` option.
|
128
128
|
data:
|
129
129
|
name: "favourite_skittle[]"
|
130
130
|
heading: "What is your favourite skittle?"
|
@@ -148,7 +148,7 @@ examples:
|
|
148
148
|
- label: "Blue"
|
149
149
|
value: "blue"
|
150
150
|
with_a_custom_id_attribute:
|
151
|
-
description: Note that if an id is not given one is generated automatically. In either case, the id is applied to the parent element of the checkboxes, and each checkbox is given the same id with an incremented number at the end, e.g. the checkboxes below have ids of potatoes-0 and potatoes-1
|
151
|
+
description: Note that if an `id` is not given one is generated automatically. In either case, the `id` is applied to the parent element of the checkboxes, and each checkbox is given the same `id` with an incremented number at the end, e.g. the checkboxes below have ids of `potatoes-0` and `potatoes-1`.
|
152
152
|
data:
|
153
153
|
name: "potatoes[]"
|
154
154
|
id: "potatoes"
|
@@ -185,9 +185,9 @@ examples:
|
|
185
185
|
value: "blue"
|
186
186
|
with_custom_heading_size:
|
187
187
|
description: |
|
188
|
-
This allows the size of the legend to be changed. Valid options are s
|
188
|
+
This allows the size of the legend to be changed. Valid options are `s`, `m`, `l`, `xl`, defaulting to m if no option is passed.
|
189
189
|
|
190
|
-
If the is_page_heading option is true and heading_size is not set, the text size will be xl
|
190
|
+
If the `is_page_heading` option is `true` and `heading_size` is not set, the text size will be `xl`.
|
191
191
|
data:
|
192
192
|
name: "favourite_colour[]"
|
193
193
|
heading: "What is your favourite colour?"
|
@@ -233,7 +233,7 @@ examples:
|
|
233
233
|
}
|
234
234
|
}
|
235
235
|
with_aria_controls_attributes:
|
236
|
-
description: Aria controls attributes are applied to the checkboxes only if
|
236
|
+
description: Aria controls attributes are applied to the checkboxes only if JavaScript is enabled.
|
237
237
|
data:
|
238
238
|
name: "aria_controls[]"
|
239
239
|
heading: "What areas are you interested in?"
|
@@ -66,7 +66,7 @@ examples:
|
|
66
66
|
- href: "#third-thing"
|
67
67
|
text: Third thing
|
68
68
|
with_custom_aria_label:
|
69
|
-
description: 'An aria-label string should be used to contextualise the navigation for assistive technology. Defaults to
|
69
|
+
description: 'An `aria-label` string should be used to contextualise the navigation for assistive technology. Defaults to `Contents` if `aria-label` is not passed.'
|
70
70
|
data:
|
71
71
|
aria_label: "Pages in this guide"
|
72
72
|
contents:
|
@@ -25,7 +25,7 @@ examples:
|
|
25
25
|
content_item:
|
26
26
|
title: "A content item"
|
27
27
|
inverse:
|
28
|
-
description: Passes the
|
28
|
+
description: Passes the `inverse` option to the breadcrumbs, if shown.
|
29
29
|
data:
|
30
30
|
content_item:
|
31
31
|
title: "Another content item"
|
@@ -15,7 +15,7 @@ shared_accessibility_criteria:
|
|
15
15
|
- link
|
16
16
|
examples:
|
17
17
|
default:
|
18
|
-
description: Reveals a
|
18
|
+
description: Reveals a contextual guidance on the side overflowing the container
|
19
19
|
data:
|
20
20
|
html_for: news-title
|
21
21
|
title: Writing a news title
|
@@ -1,7 +1,7 @@
|
|
1
1
|
name: Cookie banner
|
2
2
|
description: Help users manage their personal data by telling them when you store cookies on their device.
|
3
3
|
body: |
|
4
|
-
By default the cookie banner is shown to all users with just a link to the settings page. If
|
4
|
+
By default the cookie banner is shown to all users with just a link to the settings page. If JavaScript is on this is enhanced to show accept/reject buttons if preferences aren't set, or to hide the banner if they are.
|
5
5
|
|
6
6
|
Setting `data-hide-cookie-banner="true"` on any link inside the banner will overwrite the default action and when clicked will dismiss the cookie banner for a period of 365 days (approx. 1 year).
|
7
7
|
|
@@ -35,7 +35,7 @@ examples:
|
|
35
35
|
data:
|
36
36
|
title: Can we store analytics cookies on your device?
|
37
37
|
text: Analytics cookies help us understand how our website is being used.
|
38
|
-
confirmation_message: You’ve accepted all cookies. You can
|
38
|
+
confirmation_message: You’ve accepted all cookies. You can `<a class='govuk-link' href='/cookies'>change your cookie settings</a>` at any time.
|
39
39
|
services_cookies:
|
40
40
|
"yes":
|
41
41
|
text: "Yes"
|
@@ -14,7 +14,7 @@ accessibility_criteria: |
|
|
14
14
|
|
15
15
|
Labels use the [label component](/component-guide/label).
|
16
16
|
|
17
|
-
Avoid using autofocus and tabindex unless you have user research to support this behaviour.
|
17
|
+
Avoid using [`autofocus`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus) and `tabindex` unless you have user research to support this behaviour.
|
18
18
|
govuk_frontend_components:
|
19
19
|
- date-input
|
20
20
|
examples:
|
@@ -22,7 +22,7 @@ examples:
|
|
22
22
|
block: |
|
23
23
|
We need to know your nationality so we can work out which elections you’re entitled to vote in. If you can’t provide your nationality, you’ll have to send copies of identity documents through the post.
|
24
24
|
with_data_attributes:
|
25
|
-
description: Can be used for tracking. Tracking is applied to the summary element when the details element is opened and closed. By default, `track-label` is set to the status (
|
25
|
+
description: Can be used for tracking. Tracking is applied to the summary element when the details element is opened and closed. By default, `track-label` is set to the status (`open` or `closed`) unless a `track_label` is passed into the component.
|
26
26
|
data:
|
27
27
|
title: Help with nationality
|
28
28
|
data_attributes:
|
@@ -83,7 +83,7 @@ examples:
|
|
83
83
|
alternative_url: /
|
84
84
|
type: detailed_guide
|
85
85
|
specific_heading level:
|
86
|
-
description: Use a different heading level for the main link title. Defaults to `
|
86
|
+
description: Use a different heading level for the main link title. Defaults to `h2` if not passed.
|
87
87
|
data:
|
88
88
|
heading_level: 3
|
89
89
|
national_applicability:
|
@@ -254,7 +254,7 @@ examples:
|
|
254
254
|
context:
|
255
255
|
right_to_left: true
|
256
256
|
with_parts:
|
257
|
-
description: Display child items, such as parts of guides or travel advice. Child items accept the same
|
257
|
+
description: Display child items, such as parts of guides or travel advice. Child items accept the same parameters as parent items.
|
258
258
|
data:
|
259
259
|
items:
|
260
260
|
- link:
|
@@ -285,7 +285,7 @@ examples:
|
|
285
285
|
|
286
286
|
Locales can be set separately for the document link text and individual metadata items. To set link text locale, pass a locale attribute along with the link object. To set metadata locale, pass a locale attribute containing a parallel object to your metadata (depending on which metadata have translations and which need a lang attribute to specify that they are in a different language).
|
287
287
|
|
288
|
-
The lang attribute must be set to a [valid BCP47 string](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang#Language_tag_syntax). A valid code can be the two or three letter language code - for example, English is en or eng
|
288
|
+
The lang attribute must be set to a [valid BCP47 string](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang#Language_tag_syntax). A valid code can be the two or three letter language code - for example, English is `en` or `eng`, Korean is `ko` or `kor` - but if in doubt please check.
|
289
289
|
data:
|
290
290
|
items:
|
291
291
|
- link:
|
@@ -3,7 +3,7 @@ description: Used at the top of the page, to summarise a unsuccessful user actio
|
|
3
3
|
accessibility_criteria: |
|
4
4
|
- should be focused on page load, to ensure the message is noticed by
|
5
5
|
assistive tech
|
6
|
-
- Should have a role of
|
6
|
+
- Should have a role of `alert` to communicate that is a important and
|
7
7
|
time sensitive message
|
8
8
|
examples:
|
9
9
|
default:
|
@@ -45,9 +45,9 @@ examples:
|
|
45
45
|
title: Message to alert the user to a problem goes here
|
46
46
|
description: Optional description of the errors and how to correct them
|
47
47
|
items:
|
48
|
-
- text: Descriptive link to the question with an error
|
48
|
+
- text: Descriptive link to the question with an error opening in a new window
|
49
49
|
href: '#example-error-1'
|
50
50
|
target: '_blank'
|
51
|
-
- text: Descriptive link to the question with an error
|
51
|
+
- text: Descriptive link to the question with an error opening in the same window
|
52
52
|
href: '#example-error-2'
|
53
53
|
target: '_self'
|
@@ -19,7 +19,7 @@ accessibility_criteria: |
|
|
19
19
|
* indicate when they have focus
|
20
20
|
* be recognisable as form input elements
|
21
21
|
* have correctly associated labels
|
22
|
-
* be of the appropriate type for their use, e.g. password inputs should be of type
|
22
|
+
* be of the appropriate type for their use, e.g. password inputs should be of type `password`
|
23
23
|
shared_accessibility_criteria:
|
24
24
|
- link
|
25
25
|
examples:
|
@@ -3,7 +3,7 @@ description: The fieldset element is used to group several controls within a web
|
|
3
3
|
body: |
|
4
4
|
[Using the fieldset and legend elements](https://accessibility.blog.gov.uk/2016/07/22/using-the-fieldset-and-legend-elements/)
|
5
5
|
|
6
|
-
You can use the
|
6
|
+
You can use the `text` property or pass `text` as a block.
|
7
7
|
accessibility_criteria: |
|
8
8
|
- must give inputs within the fieldset context with legend text
|
9
9
|
examples:
|
@@ -29,7 +29,7 @@ examples:
|
|
29
29
|
<input type="radio" id="passport-no" name="default">
|
30
30
|
<label for="passport-no">No</label>
|
31
31
|
with_heading:
|
32
|
-
description: Make the legend different sizes. Valid options are
|
32
|
+
description: Make the legend different sizes. Valid options are `s`, `m`, `l` and `xl`.
|
33
33
|
data:
|
34
34
|
legend_text: 'Do you have a driving license?'
|
35
35
|
heading_level: 2
|
@@ -42,7 +42,7 @@ examples:
|
|
42
42
|
<input type="radio" id="level-no" name="default">
|
43
43
|
<label for="level-no">No</label>
|
44
44
|
with_custom_legend_size:
|
45
|
-
description: Make the legend different sizes. Valid options are
|
45
|
+
description: Make the legend different sizes. Valid options are `s`, `m`, `l` and `xl`.
|
46
46
|
data:
|
47
47
|
legend_text: 'Do you have a driving license?'
|
48
48
|
heading_size: 'l'
|
@@ -54,7 +54,7 @@ examples:
|
|
54
54
|
<input type="radio" id="size-no" name="default">
|
55
55
|
<label for="size-no">No</label>
|
56
56
|
with_error_message:
|
57
|
-
description: The component also accepts an error_id
|
57
|
+
description: The component also accepts an `error_id`, or generates one automatically.
|
58
58
|
data:
|
59
59
|
legend_text: 'Do you have a passport?'
|
60
60
|
error_message: 'Please choose an option'
|
@@ -27,7 +27,7 @@ examples:
|
|
27
27
|
description: |
|
28
28
|
Set a different font size for the heading. Uses the [GOV.UK Frontend heading sizes](https://design-system.service.gov.uk/styles/typography/#headings) but defaults to 27px for legacy reasons. Valid options are `xl`, `l`, `m` and `s`.
|
29
29
|
|
30
|
-
This option is not tied to the heading_level option in order to give flexibility.
|
30
|
+
This option is not tied to the `heading_level` option in order to give flexibility.
|
31
31
|
data:
|
32
32
|
text: 'One big heading'
|
33
33
|
font_size: "xl"
|
@@ -46,7 +46,7 @@ examples:
|
|
46
46
|
text: 'Padded'
|
47
47
|
padding: true
|
48
48
|
with_margin:
|
49
|
-
description: The component accepts a number for margin bottom from 0 to 9 (0px to 60px) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to having no margin bottom.
|
49
|
+
description: The component accepts a number for margin bottom from `0` to `9` (`0px` to `60px`) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to having no margin bottom.
|
50
50
|
data:
|
51
51
|
text: 'Really big bottom margin'
|
52
52
|
margin_bottom: 9
|
@@ -59,7 +59,7 @@ examples:
|
|
59
59
|
text: 'Consultation description'
|
60
60
|
mobile_top_margin: true
|
61
61
|
with_border:
|
62
|
-
description: A top border can be applied to the component of different thicknesses. Accepted values are 1 (1px), 2 (2px) and 5 (5px). Note that this works best with padding applied.
|
62
|
+
description: A top border can be applied to the component of different thicknesses. Accepted values are `1` (`1px`), `2` (`2px`) and `5` (`5px`). Note that this works best with padding applied.
|
63
63
|
data:
|
64
64
|
text: 'With a border'
|
65
65
|
padding: true
|
@@ -81,7 +81,7 @@ examples:
|
|
81
81
|
description: |
|
82
82
|
The component is used on translated pages that don’t have a translation for the text strings. This means that it could display the fallback English string if the translate method can’t find an appropriate translation. This makes sure that the lang can be set to ensure that browsers understand which parts of the page are in each language.
|
83
83
|
|
84
|
-
The lang attribute must be set to a [valid BCP47 string](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang#Language_tag_syntax). A valid code can be the two or three letter language code - for example, English is en or eng
|
84
|
+
The lang attribute must be set to a [valid BCP47 string](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang#Language_tag_syntax). A valid code can be the two or three letter language code - for example, English is `en` or `eng`, Korean is `ko` or `kor` - but if in doubt please check.
|
85
85
|
data:
|
86
86
|
text: "Ein gweinidogion"
|
87
87
|
lang: "cy"
|
@@ -15,7 +15,7 @@ examples:
|
|
15
15
|
data:
|
16
16
|
text: "It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’."
|
17
17
|
with_margin_bottom:
|
18
|
-
description: The component accepts a number for margin bottom from 0 to 9 (0px to 60px) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to a margin bottom of 3 (15px).
|
18
|
+
description: The component accepts a number for margin bottom from `0` to `9` (`0px` to `60px`) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to a margin bottom of `3` (`15px`).
|
19
19
|
data:
|
20
20
|
text: "You qualify if you were born in the UK before June 1960."
|
21
21
|
margin_bottom: 9
|
@@ -14,7 +14,7 @@ accessibility_criteria: |
|
|
14
14
|
|
15
15
|
Labels use the [label component](/component-guide/label).
|
16
16
|
|
17
|
-
Avoid using autofocus and tabindex unless you have user research to support this behaviour.
|
17
|
+
Avoid using `autofocus` and `tabindex` unless you have user research to support this behaviour.
|
18
18
|
govuk_frontend_components:
|
19
19
|
- text-input
|
20
20
|
examples:
|
@@ -45,7 +45,7 @@ examples:
|
|
45
45
|
name: "account-number"
|
46
46
|
type: "number"
|
47
47
|
with_an_identifier:
|
48
|
-
description: Give the input a specific ID
|
48
|
+
description: Give the input a specific `ID`.
|
49
49
|
data:
|
50
50
|
label:
|
51
51
|
text: "Has an id"
|
@@ -120,7 +120,7 @@ examples:
|
|
120
120
|
width: 10
|
121
121
|
with_search_icon:
|
122
122
|
description: |
|
123
|
-
Adds a search icon, [spellcheck](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/spellcheck) can also be added to indicate that the element should be, if possible, checked for spelling errors.
|
123
|
+
Adds a search icon, [`spellcheck`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/spellcheck) can also be added to indicate that the element should be, if possible, checked for spelling errors.
|
124
124
|
data:
|
125
125
|
label:
|
126
126
|
text: "Search the internet"
|
@@ -19,7 +19,7 @@ examples:
|
|
19
19
|
<a class="govuk-link" href='/foo'>Check for broken links</a>
|
20
20
|
</div>
|
21
21
|
with_custom_margins:
|
22
|
-
description: The component accepts a number for margin bottom from 0 to 9 (0px to 60px) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to having margin of 6 (30px) top and bottom.
|
22
|
+
description: The component accepts a number for margin bottom from `0` to `9` (`0px` to `60px`) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to having margin of `6` (`30px`) top and bottom.
|
23
23
|
data:
|
24
24
|
text: "When a failure occurs, you must submit logbook, landing and transhipment data manually to the UK Fisheries Call Centre each day and by no later than 23.59 UTC"
|
25
25
|
margin_top: 0
|
@@ -13,7 +13,7 @@ accessibility_criteria: |
|
|
13
13
|
|
14
14
|
- be associated with an input. The `hint_id` must match the `aria-describedby` property on the input your label is associated with.
|
15
15
|
|
16
|
-
If hint text is within a label it will be announced in its
|
16
|
+
If hint text is within a label it will be announced in its entirety by screen readers. By putting the hint alongside labels and associating hints with inputs using `aria-describedby`, then screen readers will read the label, describe the type of input (eg radio) and then read additional text. It means users of screen readers can scan and skip options as easy as people making choices with sight. [A discussion of this approach](https://github.com/alphagov/govuk_elements/issues/574).
|
17
17
|
govuk_frontend_components:
|
18
18
|
- label
|
19
19
|
examples:
|
@@ -15,12 +15,12 @@ accessibility_criteria: |
|
|
15
15
|
|
16
16
|
- avoid navigation landmarks or roles
|
17
17
|
|
18
|
-
The footer element alone is sufficient for such cases; while a [nav element](https://www.w3.org/TR/html52/sections.html#the-nav-element) can be used, it is usually unnecessary.
|
18
|
+
The footer element alone is sufficient for such cases; while a [`nav` element](https://www.w3.org/TR/html52/sections.html#the-nav-element) can be used, it is usually unnecessary.
|
19
19
|
|
20
20
|
Note: This decision has been made based on prior experience seeing removal of overuse of `<nav>` elements from www.GOV.UK, which made it confusing for users of assistive technologies to know what were the most important navigation aspects of GOV.UK.
|
21
21
|
Should be challenged if user research indicates this is an issue.
|
22
22
|
|
23
|
-
- have a role of [`contentinfo`](https://www.w3.org/TR/wai-aria-1.1/#contentinfo) at the root of the component (
|
23
|
+
- have a role of [`contentinfo`](https://www.w3.org/TR/wai-aria-1.1/#contentinfo) at the root of the component (`<footer>`)
|
24
24
|
|
25
25
|
Note: This decision has been made given that most uses of this role tend to be used directly on a `<footer>` element.
|
26
26
|
Assumption made is that is most predictable for users of assistive technologies.
|
@@ -21,7 +21,7 @@ examples:
|
|
21
21
|
context:
|
22
22
|
dark_background: true
|
23
23
|
custom_margin_bottom:
|
24
|
-
description: The component accepts a number for margin bottom from 0 to 9 (0px to 60px) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to having a margin bottom of 45px
|
24
|
+
description: The component accepts a number for margin bottom from `0` to `9` (`0px` to `60px`) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to having a margin bottom of `45px`.
|
25
25
|
data:
|
26
26
|
text: This is some example text for a lead paragraph
|
27
27
|
margin_bottom: 6
|
@@ -359,7 +359,7 @@ examples:
|
|
359
359
|
dark_background: true
|
360
360
|
with_custom_margin_bottom:
|
361
361
|
description: |
|
362
|
-
The component accepts a number for margin bottom from 0 to 9 (0px to 60px) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to the `margin-bottom` values defined in the [responsive-bottom-margin mixin](https://github.com/alphagov/govuk_publishing_components/blob/master/app/assets/stylesheets/govuk_publishing_components/components/mixins/_margins.scss#L1)
|
362
|
+
The component accepts a number for margin bottom from `0` to `9` (`0px` to `60px`) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to the `margin-bottom` values defined in the [responsive-bottom-margin mixin](https://github.com/alphagov/govuk_publishing_components/blob/master/app/assets/stylesheets/govuk_publishing_components/components/mixins/_margins.scss#L1)
|
363
363
|
data:
|
364
364
|
first_published: 14 June 2014
|
365
365
|
last_updated: 10 September 2015
|