govuk_publishing_components 23.0.0 → 23.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/analytics/init.js +56 -0
- data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/magna-charta.js +9 -8
- data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_input.scss +0 -46
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +5 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_print-link.scss +0 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +7 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak.scss +4 -0
- data/app/views/govuk_publishing_components/components/_input.html.erb +6 -6
- data/app/views/govuk_publishing_components/components/_print_link.html.erb +18 -11
- data/app/views/govuk_publishing_components/components/docs/govspeak.yml +14 -0
- data/app/views/govuk_publishing_components/components/docs/print_link.yml +5 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/govuk-frontend/govuk/all.js +31 -37
- data/node_modules/govuk-frontend/govuk/components/accordion/README.md +1 -1
- data/node_modules/govuk-frontend/govuk/components/accordion/_index.scss +0 -1
- data/node_modules/govuk-frontend/govuk/components/accordion/fixtures.json +235 -0
- data/node_modules/govuk-frontend/govuk/components/back-link/_index.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/back-link/fixtures.json +56 -0
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/_index.scss +0 -1
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/fixtures.json +172 -0
- data/node_modules/govuk-frontend/govuk/components/button/_index.scss +3 -3
- data/node_modules/govuk-frontend/govuk/components/button/fixtures.json +275 -0
- data/node_modules/govuk-frontend/govuk/components/character-count/fixtures.json +170 -0
- data/node_modules/govuk-frontend/govuk/components/checkboxes/_index.scss +13 -13
- data/node_modules/govuk-frontend/govuk/components/checkboxes/fixtures.json +1015 -0
- data/node_modules/govuk-frontend/govuk/components/date-input/fixtures.json +499 -0
- data/node_modules/govuk-frontend/govuk/components/details/_index.scss +0 -1
- data/node_modules/govuk-frontend/govuk/components/details/fixtures.json +83 -0
- data/node_modules/govuk-frontend/govuk/components/error-message/fixtures.json +66 -0
- data/node_modules/govuk-frontend/govuk/components/error-summary/_index.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/error-summary/fixtures.json +181 -0
- data/node_modules/govuk-frontend/govuk/components/fieldset/_index.scss +1 -1
- data/node_modules/govuk-frontend/govuk/components/fieldset/fixtures.json +93 -0
- data/node_modules/govuk-frontend/govuk/components/fieldset/macro-options.json +6 -0
- data/node_modules/govuk-frontend/govuk/components/fieldset/template.njk +5 -1
- data/node_modules/govuk-frontend/govuk/components/file-upload/fixtures.json +151 -0
- data/node_modules/govuk-frontend/govuk/components/footer/_index.scss +0 -1
- data/node_modules/govuk-frontend/govuk/components/footer/fixtures.json +482 -0
- data/node_modules/govuk-frontend/govuk/components/header/_index.scss +2 -5
- data/node_modules/govuk-frontend/govuk/components/header/fixtures.json +360 -0
- data/node_modules/govuk-frontend/govuk/components/header/header.js +665 -316
- data/node_modules/govuk-frontend/govuk/components/header/macro-options.json +13 -1
- data/node_modules/govuk-frontend/govuk/components/header/template.njk +9 -5
- data/node_modules/govuk-frontend/govuk/components/hint/_index.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/hint/fixtures.json +50 -0
- data/node_modules/govuk-frontend/govuk/components/hint/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/input/_index.scss +91 -0
- data/node_modules/govuk-frontend/govuk/components/input/fixtures.json +538 -0
- data/node_modules/govuk-frontend/govuk/components/input/macro-options.json +64 -0
- data/node_modules/govuk-frontend/govuk/components/input/template.njk +17 -0
- data/node_modules/govuk-frontend/govuk/components/inset-text/fixtures.json +49 -0
- data/node_modules/govuk-frontend/govuk/components/label/fixtures.json +75 -0
- data/node_modules/govuk-frontend/govuk/components/panel/_index.scss +6 -2
- data/node_modules/govuk-frontend/govuk/components/panel/fixtures.json +74 -0
- data/node_modules/govuk-frontend/govuk/components/phase-banner/fixtures.json +65 -0
- data/node_modules/govuk-frontend/govuk/components/radios/_index.scss +13 -13
- data/node_modules/govuk-frontend/govuk/components/radios/fixtures.json +1066 -0
- data/node_modules/govuk-frontend/govuk/components/radios/macro-options.json +2 -2
- data/node_modules/govuk-frontend/govuk/components/select/_index.scss +0 -1
- data/node_modules/govuk-frontend/govuk/components/select/fixtures.json +248 -0
- data/node_modules/govuk-frontend/govuk/components/skip-link/fixtures.json +72 -0
- data/node_modules/govuk-frontend/govuk/components/summary-list/README.md +1 -1
- data/node_modules/govuk-frontend/govuk/components/summary-list/_index.scss +2 -10
- data/node_modules/govuk-frontend/govuk/components/summary-list/fixtures.json +991 -0
- data/node_modules/govuk-frontend/govuk/components/table/fixtures.json +468 -0
- data/node_modules/govuk-frontend/govuk/components/tabs/_index.scss +3 -6
- data/node_modules/govuk-frontend/govuk/components/tabs/fixtures.json +229 -0
- data/node_modules/govuk-frontend/govuk/components/tag/_index.scss +0 -1
- data/node_modules/govuk-frontend/govuk/components/tag/fixtures.json +117 -0
- data/node_modules/govuk-frontend/govuk/components/textarea/_index.scss +0 -1
- data/node_modules/govuk-frontend/govuk/components/textarea/fixtures.json +199 -0
- data/node_modules/govuk-frontend/govuk/components/warning-text/_index.scss +0 -1
- data/node_modules/govuk-frontend/govuk/components/warning-text/fixtures.json +68 -0
- data/node_modules/govuk-frontend/govuk/helpers/_device-pixels.scss +3 -3
- data/node_modules/govuk-frontend/govuk/helpers/_font-faces.scss +9 -11
- data/node_modules/govuk-frontend/govuk/helpers/_links.scss +1 -3
- data/node_modules/govuk-frontend/govuk/helpers/_media-queries.scss +1 -5
- data/node_modules/govuk-frontend/govuk/helpers/_spacing.scss +2 -1
- data/node_modules/govuk-frontend/govuk/helpers/_typography.scss +7 -6
- data/node_modules/govuk-frontend/govuk/objects/_form-group.scss +0 -1
- data/node_modules/govuk-frontend/govuk/objects/_grid.scss +2 -3
- data/node_modules/govuk-frontend/govuk/objects/_main-wrapper.scss +0 -1
- data/node_modules/govuk-frontend/govuk/overrides/_display.scss +1 -1
- data/node_modules/govuk-frontend/govuk/overrides/_width.scss +1 -0
- data/node_modules/govuk-frontend/govuk/settings/_colours-applied.scss +0 -3
- data/node_modules/govuk-frontend/govuk/settings/_colours-organisations.scss +3 -0
- data/node_modules/govuk-frontend/govuk/settings/_colours-palette.scss +9 -2
- data/node_modules/govuk-frontend/govuk/settings/_compatibility.scss +0 -1
- data/node_modules/govuk-frontend/govuk/settings/_measurements.scss +0 -4
- data/node_modules/govuk-frontend/govuk/settings/_typography-font-families.scss +2 -2
- data/node_modules/govuk-frontend/govuk/settings/_typography-font.scss +11 -5
- data/node_modules/govuk-frontend/govuk/settings/_typography-responsive.scss +6 -2
- data/node_modules/govuk-frontend/govuk/tools/_font-url.scss +0 -3
- data/node_modules/govuk-frontend/govuk/tools/_image-url.scss +0 -3
- data/node_modules/govuk-frontend/govuk/utilities/_visually-hidden.scss +0 -1
- data/node_modules/govuk-frontend/govuk/vendor/_sass-mq.scss +0 -4
- data/node_modules/govuk-frontend/package.json +1 -1
- metadata +32 -3
- data/app/assets/javascripts/govuk_publishing_components/analytics/init.js.erb +0 -50
@@ -74,7 +74,7 @@
|
|
74
74
|
}
|
75
75
|
|
76
76
|
// [ ] Check box
|
77
|
-
.govuk-checkboxes__label
|
77
|
+
.govuk-checkboxes__label:before {
|
78
78
|
content: "";
|
79
79
|
box-sizing: border-box;
|
80
80
|
position: absolute;
|
@@ -90,7 +90,7 @@
|
|
90
90
|
//
|
91
91
|
// The check mark is a box with a border on the left and bottom side (└──),
|
92
92
|
// rotated 45 degrees
|
93
|
-
.govuk-checkboxes__label
|
93
|
+
.govuk-checkboxes__label:after {
|
94
94
|
content: "";
|
95
95
|
box-sizing: border-box;
|
96
96
|
|
@@ -123,13 +123,13 @@
|
|
123
123
|
}
|
124
124
|
|
125
125
|
// Focused state
|
126
|
-
.govuk-checkboxes__input:focus + .govuk-checkboxes__label
|
126
|
+
.govuk-checkboxes__input:focus + .govuk-checkboxes__label:before {
|
127
127
|
border-width: 4px;
|
128
128
|
box-shadow: 0 0 0 $govuk-focus-width $govuk-focus-colour;
|
129
129
|
}
|
130
130
|
|
131
131
|
// Selected state
|
132
|
-
.govuk-checkboxes__input:checked + .govuk-checkboxes__label
|
132
|
+
.govuk-checkboxes__input:checked + .govuk-checkboxes__label:after {
|
133
133
|
opacity: 1;
|
134
134
|
}
|
135
135
|
|
@@ -227,7 +227,7 @@
|
|
227
227
|
//
|
228
228
|
// Reduce the size of the check box [1], vertically center it within the
|
229
229
|
// touch target [2]
|
230
|
-
.govuk-checkboxes__label
|
230
|
+
.govuk-checkboxes__label:before {
|
231
231
|
top: $input-offset - $govuk-border-width-form-element; // 2
|
232
232
|
width: $govuk-small-checkboxes-size; // 1
|
233
233
|
height: $govuk-small-checkboxes-size; // 1
|
@@ -236,7 +236,7 @@
|
|
236
236
|
// ✔ Check mark
|
237
237
|
//
|
238
238
|
// Reduce the size of the check mark and re-align within the checkbox
|
239
|
-
.govuk-checkboxes__label
|
239
|
+
.govuk-checkboxes__label:after {
|
240
240
|
top: 15px;
|
241
241
|
left: 6px;
|
242
242
|
width: 12px;
|
@@ -271,7 +271,7 @@
|
|
271
271
|
// is so much larger than their visible size, and so we need to provide
|
272
272
|
// feedback to the user as to which checkbox they will select when their
|
273
273
|
// cursor is outside of the visible area.
|
274
|
-
.govuk-checkboxes__item:hover .govuk-checkboxes__input:not(:disabled) + .govuk-checkboxes__label
|
274
|
+
.govuk-checkboxes__item:hover .govuk-checkboxes__input:not(:disabled) + .govuk-checkboxes__label:before {
|
275
275
|
box-shadow: 0 0 0 $govuk-hover-width $govuk-hover-colour;
|
276
276
|
}
|
277
277
|
|
@@ -280,10 +280,10 @@
|
|
280
280
|
//
|
281
281
|
// We use two box shadows, one that restores the original focus state [1]
|
282
282
|
// and another that then applies the hover state [2].
|
283
|
-
.govuk-checkboxes__item:hover .govuk-checkboxes__input:focus + .govuk-checkboxes__label
|
284
|
-
|
285
|
-
|
286
|
-
|
283
|
+
.govuk-checkboxes__item:hover .govuk-checkboxes__input:focus + .govuk-checkboxes__label:before {
|
284
|
+
box-shadow:
|
285
|
+
0 0 0 $govuk-focus-width $govuk-focus-colour, // 1
|
286
|
+
0 0 0 $govuk-hover-width $govuk-hover-colour; // 2
|
287
287
|
}
|
288
288
|
|
289
289
|
// For devices that explicitly don't support hover, don't provide a hover
|
@@ -293,11 +293,11 @@
|
|
293
293
|
// state in browsers that don't support `@media (hover)` (like Internet
|
294
294
|
// Explorer) – so we have to 'undo' the hover state instead.
|
295
295
|
@media (hover: none), (pointer: coarse) {
|
296
|
-
.govuk-checkboxes__item:hover .govuk-checkboxes__input:not(:disabled) + .govuk-checkboxes__label
|
296
|
+
.govuk-checkboxes__item:hover .govuk-checkboxes__input:not(:disabled) + .govuk-checkboxes__label:before {
|
297
297
|
box-shadow: initial;
|
298
298
|
}
|
299
299
|
|
300
|
-
.govuk-checkboxes__item:hover .govuk-checkboxes__input:focus + .govuk-checkboxes__label
|
300
|
+
.govuk-checkboxes__item:hover .govuk-checkboxes__input:focus + .govuk-checkboxes__label:before {
|
301
301
|
box-shadow: 0 0 0 $govuk-focus-width $govuk-focus-colour;
|
302
302
|
}
|
303
303
|
}
|
@@ -0,0 +1,1015 @@
|
|
1
|
+
{
|
2
|
+
"component": "checkboxes",
|
3
|
+
"fixtures": [
|
4
|
+
{
|
5
|
+
"name": "default",
|
6
|
+
"options": {
|
7
|
+
"name": "nationality",
|
8
|
+
"items": [
|
9
|
+
{
|
10
|
+
"value": "british",
|
11
|
+
"text": "British"
|
12
|
+
},
|
13
|
+
{
|
14
|
+
"value": "irish",
|
15
|
+
"text": "Irish"
|
16
|
+
},
|
17
|
+
{
|
18
|
+
"value": "other",
|
19
|
+
"text": "Citizen of another country"
|
20
|
+
}
|
21
|
+
]
|
22
|
+
},
|
23
|
+
"html": "<div class=\"govuk-form-group\">\n\n <div class=\"govuk-checkboxes\">\n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"nationality\" name=\"nationality\" type=\"checkbox\" value=\"british\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"nationality\">\n British\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"nationality-2\" name=\"nationality\" type=\"checkbox\" value=\"irish\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"nationality-2\">\n Irish\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"nationality-3\" name=\"nationality\" type=\"checkbox\" value=\"other\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"nationality-3\">\n Citizen of another country\n </label>\n \n </div>\n \n \n \n </div>\n\n</div>"
|
24
|
+
},
|
25
|
+
{
|
26
|
+
"name": "with id and name",
|
27
|
+
"options": {
|
28
|
+
"name": "with-id-and-name",
|
29
|
+
"fieldset": {
|
30
|
+
"legend": {
|
31
|
+
"text": "What is your nationality?"
|
32
|
+
}
|
33
|
+
},
|
34
|
+
"hint": {
|
35
|
+
"text": "If you have dual nationality, select all options that are relevant to you."
|
36
|
+
},
|
37
|
+
"items": [
|
38
|
+
{
|
39
|
+
"name": "british",
|
40
|
+
"id": "item_british",
|
41
|
+
"value": "yes",
|
42
|
+
"text": "British"
|
43
|
+
},
|
44
|
+
{
|
45
|
+
"name": "irish",
|
46
|
+
"id": "item_irish",
|
47
|
+
"value": "irish",
|
48
|
+
"text": "Irish"
|
49
|
+
},
|
50
|
+
{
|
51
|
+
"name": "custom-name-scottish",
|
52
|
+
"text": "Scottish",
|
53
|
+
"value": "scottish"
|
54
|
+
}
|
55
|
+
]
|
56
|
+
},
|
57
|
+
"html": "<div class=\"govuk-form-group\">\n\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"with-id-and-name-hint\">\n \n <legend class=\"govuk-fieldset__legend\">\n \n What is your nationality?\n \n </legend>\n \n\n <div id=\"with-id-and-name-hint\" class=\"govuk-hint\">\n If you have dual nationality, select all options that are relevant to you.\n </div>\n\n\n <div class=\"govuk-checkboxes\">\n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"item_british\" name=\"british\" type=\"checkbox\" value=\"yes\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"item_british\">\n British\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"item_irish\" name=\"irish\" type=\"checkbox\" value=\"irish\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"item_irish\">\n Irish\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"with-id-and-name-3\" name=\"custom-name-scottish\" type=\"checkbox\" value=\"scottish\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"with-id-and-name-3\">\n Scottish\n </label>\n \n </div>\n \n \n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
58
|
+
},
|
59
|
+
{
|
60
|
+
"name": "with hints on items",
|
61
|
+
"options": {
|
62
|
+
"fieldset": {
|
63
|
+
"legend": {
|
64
|
+
"text": "How do you want to sign in?",
|
65
|
+
"isPageHeading": true
|
66
|
+
}
|
67
|
+
},
|
68
|
+
"items": [
|
69
|
+
{
|
70
|
+
"name": "gateway",
|
71
|
+
"id": "government-gateway",
|
72
|
+
"value": "gov-gateway",
|
73
|
+
"text": "Sign in with Government Gateway",
|
74
|
+
"hint": {
|
75
|
+
"text": "You'll have a user ID if you've registered for Self Assessment or filed a tax return online before."
|
76
|
+
}
|
77
|
+
},
|
78
|
+
{
|
79
|
+
"name": "verify",
|
80
|
+
"id": "govuk-verify",
|
81
|
+
"value": "gov-verify",
|
82
|
+
"text": "Sign in with GOV.UK Verify",
|
83
|
+
"hint": {
|
84
|
+
"text": "You'll have an account if you've already proved your identity with either Barclays, CitizenSafe, Digidentity, Experian, Post Office, Royal Mail or SecureIdentity."
|
85
|
+
}
|
86
|
+
}
|
87
|
+
]
|
88
|
+
},
|
89
|
+
"html": "<div class=\"govuk-form-group\">\n\n <fieldset class=\"govuk-fieldset\">\n \n <legend class=\"govuk-fieldset__legend\">\n \n <h1 class=\"govuk-fieldset__heading\">\n How do you want to sign in?\n </h1>\n \n </legend>\n \n\n <div class=\"govuk-checkboxes\">\n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"government-gateway\" name=\"gateway\" type=\"checkbox\" value=\"gov-gateway\" aria-describedby=\"government-gateway-item-hint\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"government-gateway\">\n Sign in with Government Gateway\n </label>\n \n <div id=\"government-gateway-item-hint\" class=\"govuk-hint govuk-checkboxes__hint\">\n You'll have a user ID if you've registered for Self Assessment or filed a tax return online before.\n </div>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"govuk-verify\" name=\"verify\" type=\"checkbox\" value=\"gov-verify\" aria-describedby=\"govuk-verify-item-hint\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"govuk-verify\">\n Sign in with GOV.UK Verify\n </label>\n \n <div id=\"govuk-verify-item-hint\" class=\"govuk-hint govuk-checkboxes__hint\">\n You'll have an account if you've already proved your identity with either Barclays, CitizenSafe, Digidentity, Experian, Post Office, Royal Mail or SecureIdentity.\n </div>\n \n </div>\n \n \n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
90
|
+
},
|
91
|
+
{
|
92
|
+
"name": "with disabled item",
|
93
|
+
"options": {
|
94
|
+
"name": "colours",
|
95
|
+
"items": [
|
96
|
+
{
|
97
|
+
"value": "red",
|
98
|
+
"text": "Red"
|
99
|
+
},
|
100
|
+
{
|
101
|
+
"value": "green",
|
102
|
+
"text": "Green"
|
103
|
+
},
|
104
|
+
{
|
105
|
+
"value": "blue",
|
106
|
+
"text": "Blue",
|
107
|
+
"disabled": true
|
108
|
+
}
|
109
|
+
]
|
110
|
+
},
|
111
|
+
"html": "<div class=\"govuk-form-group\">\n\n <div class=\"govuk-checkboxes\">\n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"colours\" name=\"colours\" type=\"checkbox\" value=\"red\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"colours\">\n Red\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"colours-2\" name=\"colours\" type=\"checkbox\" value=\"green\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"colours-2\">\n Green\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"colours-3\" name=\"colours\" type=\"checkbox\" value=\"blue\" disabled>\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"colours-3\">\n Blue\n </label>\n \n </div>\n \n \n \n </div>\n\n</div>"
|
112
|
+
},
|
113
|
+
{
|
114
|
+
"name": "with legend as a page heading",
|
115
|
+
"options": {
|
116
|
+
"name": "waste",
|
117
|
+
"fieldset": {
|
118
|
+
"legend": {
|
119
|
+
"text": "Which types of waste do you transport regularly?",
|
120
|
+
"classes": "govuk-fieldset__legend--l",
|
121
|
+
"isPageHeading": true
|
122
|
+
}
|
123
|
+
},
|
124
|
+
"hint": {
|
125
|
+
"text": "Select all that apply"
|
126
|
+
},
|
127
|
+
"items": [
|
128
|
+
{
|
129
|
+
"value": "animal",
|
130
|
+
"text": "Waste from animal carcasses"
|
131
|
+
},
|
132
|
+
{
|
133
|
+
"value": "mines",
|
134
|
+
"text": "Waste from mines or quarries"
|
135
|
+
},
|
136
|
+
{
|
137
|
+
"value": "farm",
|
138
|
+
"text": "Farm or agricultural waste"
|
139
|
+
}
|
140
|
+
]
|
141
|
+
},
|
142
|
+
"html": "<div class=\"govuk-form-group\">\n\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"waste-hint\">\n \n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--l\">\n \n <h1 class=\"govuk-fieldset__heading\">\n Which types of waste do you transport regularly?\n </h1>\n \n </legend>\n \n\n <div id=\"waste-hint\" class=\"govuk-hint\">\n Select all that apply\n </div>\n\n\n <div class=\"govuk-checkboxes\">\n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"waste\" name=\"waste\" type=\"checkbox\" value=\"animal\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"waste\">\n Waste from animal carcasses\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"waste-2\" name=\"waste\" type=\"checkbox\" value=\"mines\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"waste-2\">\n Waste from mines or quarries\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"waste-3\" name=\"waste\" type=\"checkbox\" value=\"farm\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"waste-3\">\n Farm or agricultural waste\n </label>\n \n </div>\n \n \n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
143
|
+
},
|
144
|
+
{
|
145
|
+
"name": "with a medium legend",
|
146
|
+
"options": {
|
147
|
+
"name": "waste",
|
148
|
+
"fieldset": {
|
149
|
+
"legend": {
|
150
|
+
"text": "Which types of waste do you transport regularly?",
|
151
|
+
"classes": "govuk-fieldset__legend--m"
|
152
|
+
}
|
153
|
+
},
|
154
|
+
"hint": {
|
155
|
+
"text": "Select all that apply"
|
156
|
+
},
|
157
|
+
"errorMessage": {
|
158
|
+
"text": "Select which types of waste you transport regularly"
|
159
|
+
},
|
160
|
+
"items": [
|
161
|
+
{
|
162
|
+
"value": "animal",
|
163
|
+
"text": "Waste from animal carcasses"
|
164
|
+
},
|
165
|
+
{
|
166
|
+
"value": "mines",
|
167
|
+
"text": "Waste from mines or quarries"
|
168
|
+
},
|
169
|
+
{
|
170
|
+
"value": "farm",
|
171
|
+
"text": "Farm or agricultural waste"
|
172
|
+
}
|
173
|
+
]
|
174
|
+
},
|
175
|
+
"html": "<div class=\"govuk-form-group govuk-form-group--error\">\n\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"waste-hint waste-error\">\n \n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n \n Which types of waste do you transport regularly?\n \n </legend>\n \n\n <div id=\"waste-hint\" class=\"govuk-hint\">\n Select all that apply\n </div>\n\n\n \n \n <span id=\"waste-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error:</span> Select which types of waste you transport regularly\n </span>\n\n <div class=\"govuk-checkboxes\">\n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"waste\" name=\"waste\" type=\"checkbox\" value=\"animal\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"waste\">\n Waste from animal carcasses\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"waste-2\" name=\"waste\" type=\"checkbox\" value=\"mines\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"waste-2\">\n Waste from mines or quarries\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"waste-3\" name=\"waste\" type=\"checkbox\" value=\"farm\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"waste-3\">\n Farm or agricultural waste\n </label>\n \n </div>\n \n \n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
176
|
+
},
|
177
|
+
{
|
178
|
+
"name": "without fieldset",
|
179
|
+
"options": {
|
180
|
+
"name": "colours",
|
181
|
+
"items": [
|
182
|
+
{
|
183
|
+
"value": "red",
|
184
|
+
"text": "Red"
|
185
|
+
},
|
186
|
+
{
|
187
|
+
"value": "green",
|
188
|
+
"text": "Green"
|
189
|
+
},
|
190
|
+
{
|
191
|
+
"value": "blue",
|
192
|
+
"text": "Blue"
|
193
|
+
}
|
194
|
+
]
|
195
|
+
},
|
196
|
+
"html": "<div class=\"govuk-form-group\">\n\n <div class=\"govuk-checkboxes\">\n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"colours\" name=\"colours\" type=\"checkbox\" value=\"red\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"colours\">\n Red\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"colours-2\" name=\"colours\" type=\"checkbox\" value=\"green\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"colours-2\">\n Green\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"colours-3\" name=\"colours\" type=\"checkbox\" value=\"blue\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"colours-3\">\n Blue\n </label>\n \n </div>\n \n \n \n </div>\n\n</div>"
|
197
|
+
},
|
198
|
+
{
|
199
|
+
"name": "with single option set 'aria-describedby' on input",
|
200
|
+
"options": {
|
201
|
+
"name": "t-and-c",
|
202
|
+
"errorMessage": {
|
203
|
+
"text": "Please accept the terms and conditions"
|
204
|
+
},
|
205
|
+
"items": [
|
206
|
+
{
|
207
|
+
"value": "yes",
|
208
|
+
"text": "I agree to the terms and conditions"
|
209
|
+
}
|
210
|
+
]
|
211
|
+
},
|
212
|
+
"html": "<div class=\"govuk-form-group govuk-form-group--error\">\n\n <span id=\"t-and-c-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error:</span> Please accept the terms and conditions\n </span>\n\n <div class=\"govuk-checkboxes\">\n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"t-and-c\" name=\"t-and-c\" type=\"checkbox\" value=\"yes\" aria-describedby=\"t-and-c-error\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"t-and-c\">\n I agree to the terms and conditions\n </label>\n \n </div>\n \n \n \n </div>\n\n</div>"
|
213
|
+
},
|
214
|
+
{
|
215
|
+
"name": "with single option (and hint) set 'aria-describedby' on input",
|
216
|
+
"options": {
|
217
|
+
"name": "t-and-c-with-hint",
|
218
|
+
"errorMessage": {
|
219
|
+
"text": "Please accept the terms and conditions"
|
220
|
+
},
|
221
|
+
"items": [
|
222
|
+
{
|
223
|
+
"value": "yes",
|
224
|
+
"text": "I agree to the terms and conditions",
|
225
|
+
"hint": {
|
226
|
+
"text": "Go on, you know you want to!"
|
227
|
+
}
|
228
|
+
}
|
229
|
+
]
|
230
|
+
},
|
231
|
+
"html": "<div class=\"govuk-form-group govuk-form-group--error\">\n\n <span id=\"t-and-c-with-hint-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error:</span> Please accept the terms and conditions\n </span>\n\n <div class=\"govuk-checkboxes\">\n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"t-and-c-with-hint\" name=\"t-and-c-with-hint\" type=\"checkbox\" value=\"yes\" aria-describedby=\"t-and-c-with-hint-error t-and-c-with-hint-item-hint\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"t-and-c-with-hint\">\n I agree to the terms and conditions\n </label>\n \n <div id=\"t-and-c-with-hint-item-hint\" class=\"govuk-hint govuk-checkboxes__hint\">\n Go on, you know you want to!\n </div>\n \n </div>\n \n \n \n </div>\n\n</div>"
|
232
|
+
},
|
233
|
+
{
|
234
|
+
"name": "with fieldset and error message",
|
235
|
+
"options": {
|
236
|
+
"name": "colours",
|
237
|
+
"errorMessage": {
|
238
|
+
"text": "Please accept the terms and conditions"
|
239
|
+
},
|
240
|
+
"fieldset": {
|
241
|
+
"legend": {
|
242
|
+
"text": "What is your nationality?"
|
243
|
+
}
|
244
|
+
},
|
245
|
+
"items": [
|
246
|
+
{
|
247
|
+
"value": "british",
|
248
|
+
"text": "British"
|
249
|
+
},
|
250
|
+
{
|
251
|
+
"value": "irish",
|
252
|
+
"text": "Irish"
|
253
|
+
},
|
254
|
+
{
|
255
|
+
"value": "other",
|
256
|
+
"text": "Citizen of another country"
|
257
|
+
}
|
258
|
+
]
|
259
|
+
},
|
260
|
+
"html": "<div class=\"govuk-form-group govuk-form-group--error\">\n\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"colours-error\">\n \n <legend class=\"govuk-fieldset__legend\">\n \n What is your nationality?\n \n </legend>\n \n\n <span id=\"colours-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error:</span> Please accept the terms and conditions\n </span>\n\n <div class=\"govuk-checkboxes\">\n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"colours\" name=\"colours\" type=\"checkbox\" value=\"british\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"colours\">\n British\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"colours-2\" name=\"colours\" type=\"checkbox\" value=\"irish\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"colours-2\">\n Irish\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"colours-3\" name=\"colours\" type=\"checkbox\" value=\"other\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"colours-3\">\n Citizen of another country\n </label>\n \n </div>\n \n \n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
261
|
+
},
|
262
|
+
{
|
263
|
+
"name": "with error message",
|
264
|
+
"options": {
|
265
|
+
"name": "waste",
|
266
|
+
"errorMessage": {
|
267
|
+
"text": "Please select an option"
|
268
|
+
},
|
269
|
+
"fieldset": {
|
270
|
+
"legend": {
|
271
|
+
"text": "Which types of waste do you transport regularly?"
|
272
|
+
}
|
273
|
+
},
|
274
|
+
"items": [
|
275
|
+
{
|
276
|
+
"value": "animal",
|
277
|
+
"text": "Waste from animal carcasses"
|
278
|
+
},
|
279
|
+
{
|
280
|
+
"value": "mines",
|
281
|
+
"text": "Waste from mines or quarries"
|
282
|
+
},
|
283
|
+
{
|
284
|
+
"value": "farm",
|
285
|
+
"text": "Farm or agricultural waste"
|
286
|
+
}
|
287
|
+
]
|
288
|
+
},
|
289
|
+
"html": "<div class=\"govuk-form-group govuk-form-group--error\">\n\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"waste-error\">\n \n <legend class=\"govuk-fieldset__legend\">\n \n Which types of waste do you transport regularly?\n \n </legend>\n \n\n <span id=\"waste-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error:</span> Please select an option\n </span>\n\n <div class=\"govuk-checkboxes\">\n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"waste\" name=\"waste\" type=\"checkbox\" value=\"animal\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"waste\">\n Waste from animal carcasses\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"waste-2\" name=\"waste\" type=\"checkbox\" value=\"mines\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"waste-2\">\n Waste from mines or quarries\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"waste-3\" name=\"waste\" type=\"checkbox\" value=\"farm\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"waste-3\">\n Farm or agricultural waste\n </label>\n \n </div>\n \n \n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
290
|
+
},
|
291
|
+
{
|
292
|
+
"name": "with error message and hints on items",
|
293
|
+
"options": {
|
294
|
+
"name": "waste",
|
295
|
+
"errorMessage": {
|
296
|
+
"text": "Please select an option"
|
297
|
+
},
|
298
|
+
"fieldset": {
|
299
|
+
"legend": {
|
300
|
+
"text": "Which types of waste do you transport regularly?"
|
301
|
+
}
|
302
|
+
},
|
303
|
+
"items": [
|
304
|
+
{
|
305
|
+
"value": "animal",
|
306
|
+
"text": "Waste from animal carcasses",
|
307
|
+
"hint": {
|
308
|
+
"text": "Nullam id dolor id nibh ultricies vehicula ut id elit."
|
309
|
+
}
|
310
|
+
},
|
311
|
+
{
|
312
|
+
"value": "mines",
|
313
|
+
"text": "Waste from mines or quarries",
|
314
|
+
"hint": {
|
315
|
+
"text": "Nullam id dolor id nibh ultricies vehicula ut id elit."
|
316
|
+
}
|
317
|
+
},
|
318
|
+
{
|
319
|
+
"value": "farm",
|
320
|
+
"text": "Farm or agricultural waste",
|
321
|
+
"hint": {
|
322
|
+
"text": "Nullam id dolor id nibh ultricies vehicula ut id elit."
|
323
|
+
}
|
324
|
+
}
|
325
|
+
]
|
326
|
+
},
|
327
|
+
"html": "<div class=\"govuk-form-group govuk-form-group--error\">\n\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"waste-error\">\n \n <legend class=\"govuk-fieldset__legend\">\n \n Which types of waste do you transport regularly?\n \n </legend>\n \n\n <span id=\"waste-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error:</span> Please select an option\n </span>\n\n <div class=\"govuk-checkboxes\">\n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"waste\" name=\"waste\" type=\"checkbox\" value=\"animal\" aria-describedby=\"waste-item-hint\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"waste\">\n Waste from animal carcasses\n </label>\n \n <div id=\"waste-item-hint\" class=\"govuk-hint govuk-checkboxes__hint\">\n Nullam id dolor id nibh ultricies vehicula ut id elit.\n </div>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"waste-2\" name=\"waste\" type=\"checkbox\" value=\"mines\" aria-describedby=\"waste-2-item-hint\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"waste-2\">\n Waste from mines or quarries\n </label>\n \n <div id=\"waste-2-item-hint\" class=\"govuk-hint govuk-checkboxes__hint\">\n Nullam id dolor id nibh ultricies vehicula ut id elit.\n </div>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"waste-3\" name=\"waste\" type=\"checkbox\" value=\"farm\" aria-describedby=\"waste-3-item-hint\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"waste-3\">\n Farm or agricultural waste\n </label>\n \n <div id=\"waste-3-item-hint\" class=\"govuk-hint govuk-checkboxes__hint\">\n Nullam id dolor id nibh ultricies vehicula ut id elit.\n </div>\n \n </div>\n \n \n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
328
|
+
},
|
329
|
+
{
|
330
|
+
"name": "with very long option text",
|
331
|
+
"options": {
|
332
|
+
"name": "waste",
|
333
|
+
"hint": {
|
334
|
+
"text": "Nullam id dolor id nibh ultricies vehicula ut id elit."
|
335
|
+
},
|
336
|
+
"errorMessage": {
|
337
|
+
"text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
|
338
|
+
},
|
339
|
+
"fieldset": {
|
340
|
+
"legend": {
|
341
|
+
"text": "Maecenas faucibus mollis interdum?"
|
342
|
+
}
|
343
|
+
},
|
344
|
+
"items": [
|
345
|
+
{
|
346
|
+
"value": "nullam",
|
347
|
+
"text": "Nullam id dolor id nibh ultricies vehicula ut id elit. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Maecenas faucibus mollis interdum. Donec id elit non mi porta gravida at eget metus."
|
348
|
+
},
|
349
|
+
{
|
350
|
+
"value": "aenean",
|
351
|
+
"text": "Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Donec sed odio dui. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Cras mattis consectetur purus sit amet fermentum."
|
352
|
+
},
|
353
|
+
{
|
354
|
+
"value": "fusce",
|
355
|
+
"text": "Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Etiam porta sem malesuada magna mollis euismod. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. Sed posuere consectetur est at lobortis."
|
356
|
+
}
|
357
|
+
]
|
358
|
+
},
|
359
|
+
"html": "<div class=\"govuk-form-group govuk-form-group--error\">\n\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"waste-hint waste-error\">\n \n <legend class=\"govuk-fieldset__legend\">\n \n Maecenas faucibus mollis interdum?\n \n </legend>\n \n\n <div id=\"waste-hint\" class=\"govuk-hint\">\n Nullam id dolor id nibh ultricies vehicula ut id elit.\n </div>\n\n\n \n \n <span id=\"waste-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error:</span> Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n </span>\n\n <div class=\"govuk-checkboxes\">\n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"waste\" name=\"waste\" type=\"checkbox\" value=\"nullam\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"waste\">\n Nullam id dolor id nibh ultricies vehicula ut id elit. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Maecenas faucibus mollis interdum. Donec id elit non mi porta gravida at eget metus.\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"waste-2\" name=\"waste\" type=\"checkbox\" value=\"aenean\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"waste-2\">\n Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Donec sed odio dui. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Cras mattis consectetur purus sit amet fermentum.\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"waste-3\" name=\"waste\" type=\"checkbox\" value=\"fusce\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"waste-3\">\n Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Etiam porta sem malesuada magna mollis euismod. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. Sed posuere consectetur est at lobortis.\n </label>\n \n </div>\n \n \n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
360
|
+
},
|
361
|
+
{
|
362
|
+
"name": "with conditional items",
|
363
|
+
"options": {
|
364
|
+
"name": "with-conditional-items",
|
365
|
+
"idPrefix": "how-contacted",
|
366
|
+
"fieldset": {
|
367
|
+
"legend": {
|
368
|
+
"text": "How do you want to be contacted?"
|
369
|
+
}
|
370
|
+
},
|
371
|
+
"items": [
|
372
|
+
{
|
373
|
+
"value": "email",
|
374
|
+
"text": "Email",
|
375
|
+
"conditional": {
|
376
|
+
"html": "<label class=\"govuk-label\" for=\"context-email\">Mobile phone number</label>\n<input class=\"govuk-input govuk-!-width-one-third\" name=\"context-email\" type=\"text\" id=\"context-email\">\n"
|
377
|
+
}
|
378
|
+
},
|
379
|
+
{
|
380
|
+
"value": "phone",
|
381
|
+
"text": "Phone",
|
382
|
+
"conditional": {
|
383
|
+
"html": "<label class=\"govuk-label\" for=\"contact-phone\">Phone number</label>\n<input class=\"govuk-input govuk-!-width-one-third\" name=\"contact-phone\" type=\"text\" id=\"contact-phone\">\n"
|
384
|
+
}
|
385
|
+
},
|
386
|
+
{
|
387
|
+
"value": "text",
|
388
|
+
"text": "Text message",
|
389
|
+
"conditional": {
|
390
|
+
"html": "<label class=\"govuk-label\" for=\"contact-text-message\">Mobile phone number</label>\n<input class=\"govuk-input govuk-!-width-one-third\" name=\"contact-text-message\" type=\"text\" id=\"contact-text-message\">\n"
|
391
|
+
}
|
392
|
+
}
|
393
|
+
]
|
394
|
+
},
|
395
|
+
"html": "<div class=\"govuk-form-group\">\n\n <fieldset class=\"govuk-fieldset\">\n \n <legend class=\"govuk-fieldset__legend\">\n \n How do you want to be contacted?\n \n </legend>\n \n\n <div class=\"govuk-checkboxes\" data-module=\"govuk-checkboxes\">\n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"how-contacted\" name=\"with-conditional-items\" type=\"checkbox\" value=\"email\" data-aria-controls=\"conditional-how-contacted\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"how-contacted\">\n Email\n </label>\n \n </div>\n \n <div class=\"govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden\" id=\"conditional-how-contacted\">\n <label class=\"govuk-label\" for=\"context-email\">Mobile phone number</label>\n<input class=\"govuk-input govuk-!-width-one-third\" name=\"context-email\" type=\"text\" id=\"context-email\">\n\n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"how-contacted-2\" name=\"with-conditional-items\" type=\"checkbox\" value=\"phone\" data-aria-controls=\"conditional-how-contacted-2\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"how-contacted-2\">\n Phone\n </label>\n \n </div>\n \n <div class=\"govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden\" id=\"conditional-how-contacted-2\">\n <label class=\"govuk-label\" for=\"contact-phone\">Phone number</label>\n<input class=\"govuk-input govuk-!-width-one-third\" name=\"contact-phone\" type=\"text\" id=\"contact-phone\">\n\n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"how-contacted-3\" name=\"with-conditional-items\" type=\"checkbox\" value=\"text\" data-aria-controls=\"conditional-how-contacted-3\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"how-contacted-3\">\n Text message\n </label>\n \n </div>\n \n <div class=\"govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden\" id=\"conditional-how-contacted-3\">\n <label class=\"govuk-label\" for=\"contact-text-message\">Mobile phone number</label>\n<input class=\"govuk-input govuk-!-width-one-third\" name=\"contact-text-message\" type=\"text\" id=\"contact-text-message\">\n\n </div>\n \n \n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
396
|
+
},
|
397
|
+
{
|
398
|
+
"name": "with conditional item checked",
|
399
|
+
"options": {
|
400
|
+
"name": "how-contacted-checked",
|
401
|
+
"idPrefix": "how-contacted-checked",
|
402
|
+
"fieldset": {
|
403
|
+
"legend": {
|
404
|
+
"text": "How do you want to be contacted?"
|
405
|
+
}
|
406
|
+
},
|
407
|
+
"items": [
|
408
|
+
{
|
409
|
+
"value": "email",
|
410
|
+
"text": "Email",
|
411
|
+
"checked": true,
|
412
|
+
"conditional": {
|
413
|
+
"html": "<label class=\"govuk-label\" for=\"context-email\">Mobile phone number</label>\n<input class=\"govuk-input govuk-!-width-one-third\" name=\"context-email\" type=\"text\" id=\"context-email\">\n"
|
414
|
+
}
|
415
|
+
},
|
416
|
+
{
|
417
|
+
"value": "phone",
|
418
|
+
"text": "Phone",
|
419
|
+
"conditional": {
|
420
|
+
"html": "<label class=\"govuk-label\" for=\"contact-phone\">Phone number</label>\n<input class=\"govuk-input govuk-!-width-one-third\" name=\"contact-phone\" type=\"text\" id=\"contact-phone\">\n"
|
421
|
+
}
|
422
|
+
},
|
423
|
+
{
|
424
|
+
"value": "text",
|
425
|
+
"text": "Text message",
|
426
|
+
"conditional": {
|
427
|
+
"html": "<label class=\"govuk-label\" for=\"contact-text-message\">Mobile phone number</label>\n<input class=\"govuk-input govuk-!-width-one-third\" name=\"contact-text-message\" type=\"text\" id=\"contact-text-message\">\n"
|
428
|
+
}
|
429
|
+
}
|
430
|
+
]
|
431
|
+
},
|
432
|
+
"html": "<div class=\"govuk-form-group\">\n\n <fieldset class=\"govuk-fieldset\">\n \n <legend class=\"govuk-fieldset__legend\">\n \n How do you want to be contacted?\n \n </legend>\n \n\n <div class=\"govuk-checkboxes\" data-module=\"govuk-checkboxes\">\n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"how-contacted-checked\" name=\"how-contacted-checked\" type=\"checkbox\" value=\"email\" checked data-aria-controls=\"conditional-how-contacted-checked\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"how-contacted-checked\">\n Email\n </label>\n \n </div>\n \n <div class=\"govuk-checkboxes__conditional\" id=\"conditional-how-contacted-checked\">\n <label class=\"govuk-label\" for=\"context-email\">Mobile phone number</label>\n<input class=\"govuk-input govuk-!-width-one-third\" name=\"context-email\" type=\"text\" id=\"context-email\">\n\n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"how-contacted-checked-2\" name=\"how-contacted-checked\" type=\"checkbox\" value=\"phone\" data-aria-controls=\"conditional-how-contacted-checked-2\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"how-contacted-checked-2\">\n Phone\n </label>\n \n </div>\n \n <div class=\"govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden\" id=\"conditional-how-contacted-checked-2\">\n <label class=\"govuk-label\" for=\"contact-phone\">Phone number</label>\n<input class=\"govuk-input govuk-!-width-one-third\" name=\"contact-phone\" type=\"text\" id=\"contact-phone\">\n\n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"how-contacted-checked-3\" name=\"how-contacted-checked\" type=\"checkbox\" value=\"text\" data-aria-controls=\"conditional-how-contacted-checked-3\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"how-contacted-checked-3\">\n Text message\n </label>\n \n </div>\n \n <div class=\"govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden\" id=\"conditional-how-contacted-checked-3\">\n <label class=\"govuk-label\" for=\"contact-text-message\">Mobile phone number</label>\n<input class=\"govuk-input govuk-!-width-one-third\" name=\"contact-text-message\" type=\"text\" id=\"contact-text-message\">\n\n </div>\n \n \n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
433
|
+
},
|
434
|
+
{
|
435
|
+
"name": "with optional form-group classes showing group error",
|
436
|
+
"options": {
|
437
|
+
"name": "how-contacted-checked",
|
438
|
+
"idPrefix": "how-contacted-checked",
|
439
|
+
"formGroup": {
|
440
|
+
"classes": "govuk-form-group--error"
|
441
|
+
},
|
442
|
+
"fieldset": {
|
443
|
+
"legend": {
|
444
|
+
"text": "How do you want to be contacted?"
|
445
|
+
}
|
446
|
+
},
|
447
|
+
"items": [
|
448
|
+
{
|
449
|
+
"value": "email",
|
450
|
+
"text": "Email",
|
451
|
+
"conditional": {
|
452
|
+
"html": "<label class=\"govuk-label\" for=\"context-email\">Mobile phone number</label>\n<input class=\"govuk-input govuk-!-width-one-third\" name=\"context-email\" type=\"text\" id=\"context-email\">\n"
|
453
|
+
}
|
454
|
+
},
|
455
|
+
{
|
456
|
+
"value": "phone",
|
457
|
+
"text": "Phone",
|
458
|
+
"checked": true,
|
459
|
+
"conditional": {
|
460
|
+
"html": "<label class=\"govuk-label\" for=\"contact-phone\">Phone number</label>\n<span id=\"contact-phone-error\" class=\"govuk-error-message\">Problem with input</span>\n<input class=\"govuk-input govuk-input--error govuk-!-width-one-third\" name=\"contact-phone\" type=\"text\" id=\"contact-phone\" aria-describedby=\"contact-phone-error\">\n"
|
461
|
+
}
|
462
|
+
},
|
463
|
+
{
|
464
|
+
"value": "text",
|
465
|
+
"text": "Text message",
|
466
|
+
"conditional": {
|
467
|
+
"html": "<label class=\"govuk-label\" for=\"contact-text-message\">Mobile phone number</label>\n<input class=\"govuk-input govuk-!-width-one-third\" name=\"contact-text-message\" type=\"text\" id=\"contact-text-message\">\n"
|
468
|
+
}
|
469
|
+
}
|
470
|
+
]
|
471
|
+
},
|
472
|
+
"html": "<div class=\"govuk-form-group govuk-form-group--error\">\n\n <fieldset class=\"govuk-fieldset\">\n \n <legend class=\"govuk-fieldset__legend\">\n \n How do you want to be contacted?\n \n </legend>\n \n\n <div class=\"govuk-checkboxes\" data-module=\"govuk-checkboxes\">\n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"how-contacted-checked\" name=\"how-contacted-checked\" type=\"checkbox\" value=\"email\" data-aria-controls=\"conditional-how-contacted-checked\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"how-contacted-checked\">\n Email\n </label>\n \n </div>\n \n <div class=\"govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden\" id=\"conditional-how-contacted-checked\">\n <label class=\"govuk-label\" for=\"context-email\">Mobile phone number</label>\n<input class=\"govuk-input govuk-!-width-one-third\" name=\"context-email\" type=\"text\" id=\"context-email\">\n\n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"how-contacted-checked-2\" name=\"how-contacted-checked\" type=\"checkbox\" value=\"phone\" checked data-aria-controls=\"conditional-how-contacted-checked-2\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"how-contacted-checked-2\">\n Phone\n </label>\n \n </div>\n \n <div class=\"govuk-checkboxes__conditional\" id=\"conditional-how-contacted-checked-2\">\n <label class=\"govuk-label\" for=\"contact-phone\">Phone number</label>\n<span id=\"contact-phone-error\" class=\"govuk-error-message\">Problem with input</span>\n<input class=\"govuk-input govuk-input--error govuk-!-width-one-third\" name=\"contact-phone\" type=\"text\" id=\"contact-phone\" aria-describedby=\"contact-phone-error\">\n\n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"how-contacted-checked-3\" name=\"how-contacted-checked\" type=\"checkbox\" value=\"text\" data-aria-controls=\"conditional-how-contacted-checked-3\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"how-contacted-checked-3\">\n Text message\n </label>\n \n </div>\n \n <div class=\"govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden\" id=\"conditional-how-contacted-checked-3\">\n <label class=\"govuk-label\" for=\"contact-text-message\">Mobile phone number</label>\n<input class=\"govuk-input govuk-!-width-one-third\" name=\"contact-text-message\" type=\"text\" id=\"contact-text-message\">\n\n </div>\n \n \n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
473
|
+
},
|
474
|
+
{
|
475
|
+
"name": "small",
|
476
|
+
"options": {
|
477
|
+
"idPrefix": "nationality",
|
478
|
+
"name": "nationality",
|
479
|
+
"classes": "govuk-checkboxes--small",
|
480
|
+
"fieldset": {
|
481
|
+
"legend": {
|
482
|
+
"text": "Filter by"
|
483
|
+
}
|
484
|
+
},
|
485
|
+
"items": [
|
486
|
+
{
|
487
|
+
"value": "a",
|
488
|
+
"text": "a thing"
|
489
|
+
},
|
490
|
+
{
|
491
|
+
"value": "b",
|
492
|
+
"text": "another thing"
|
493
|
+
},
|
494
|
+
{
|
495
|
+
"value": "c",
|
496
|
+
"text": "this thing"
|
497
|
+
}
|
498
|
+
]
|
499
|
+
},
|
500
|
+
"html": "<div class=\"govuk-form-group\">\n\n <fieldset class=\"govuk-fieldset\">\n \n <legend class=\"govuk-fieldset__legend\">\n \n Filter by\n \n </legend>\n \n\n <div class=\"govuk-checkboxes govuk-checkboxes--small\">\n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"nationality\" name=\"nationality\" type=\"checkbox\" value=\"a\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"nationality\">\n a thing\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"nationality-2\" name=\"nationality\" type=\"checkbox\" value=\"b\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"nationality-2\">\n another thing\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"nationality-3\" name=\"nationality\" type=\"checkbox\" value=\"c\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"nationality-3\">\n this thing\n </label>\n \n </div>\n \n \n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
501
|
+
},
|
502
|
+
{
|
503
|
+
"name": "small with long text",
|
504
|
+
"options": {
|
505
|
+
"idPrefix": "nationality",
|
506
|
+
"name": "nationality",
|
507
|
+
"classes": "govuk-checkboxes--small",
|
508
|
+
"fieldset": {
|
509
|
+
"legend": {
|
510
|
+
"text": "Filter by"
|
511
|
+
}
|
512
|
+
},
|
513
|
+
"items": [
|
514
|
+
{
|
515
|
+
"value": "nullam",
|
516
|
+
"text": "Nullam id dolor id nibh ultricies vehicula ut id elit. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Maecenas faucibus mollis interdum. Donec id elit non mi porta gravida at eget metus."
|
517
|
+
},
|
518
|
+
{
|
519
|
+
"value": "aenean",
|
520
|
+
"text": "Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Donec sed odio dui. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Cras mattis consectetur purus sit amet fermentum."
|
521
|
+
},
|
522
|
+
{
|
523
|
+
"value": "fusce",
|
524
|
+
"text": "Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Etiam porta sem malesuada magna mollis euismod. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. Sed posuere consectetur est at lobortis."
|
525
|
+
}
|
526
|
+
]
|
527
|
+
},
|
528
|
+
"html": "<div class=\"govuk-form-group\">\n\n <fieldset class=\"govuk-fieldset\">\n \n <legend class=\"govuk-fieldset__legend\">\n \n Filter by\n \n </legend>\n \n\n <div class=\"govuk-checkboxes govuk-checkboxes--small\">\n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"nationality\" name=\"nationality\" type=\"checkbox\" value=\"nullam\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"nationality\">\n Nullam id dolor id nibh ultricies vehicula ut id elit. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Maecenas faucibus mollis interdum. Donec id elit non mi porta gravida at eget metus.\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"nationality-2\" name=\"nationality\" type=\"checkbox\" value=\"aenean\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"nationality-2\">\n Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Donec sed odio dui. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Cras mattis consectetur purus sit amet fermentum.\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"nationality-3\" name=\"nationality\" type=\"checkbox\" value=\"fusce\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"nationality-3\">\n Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Etiam porta sem malesuada magna mollis euismod. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. Sed posuere consectetur est at lobortis.\n </label>\n \n </div>\n \n \n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
529
|
+
},
|
530
|
+
{
|
531
|
+
"name": "small with error",
|
532
|
+
"options": {
|
533
|
+
"idPrefix": "nationality",
|
534
|
+
"name": "nationality",
|
535
|
+
"classes": "govuk-checkboxes--small",
|
536
|
+
"errorMessage": {
|
537
|
+
"text": "Select a thing"
|
538
|
+
},
|
539
|
+
"fieldset": {
|
540
|
+
"legend": {
|
541
|
+
"text": "Filter by"
|
542
|
+
}
|
543
|
+
},
|
544
|
+
"items": [
|
545
|
+
{
|
546
|
+
"value": "a",
|
547
|
+
"text": "a thing"
|
548
|
+
},
|
549
|
+
{
|
550
|
+
"value": "b",
|
551
|
+
"text": "another thing"
|
552
|
+
},
|
553
|
+
{
|
554
|
+
"value": "c",
|
555
|
+
"text": "this thing"
|
556
|
+
}
|
557
|
+
]
|
558
|
+
},
|
559
|
+
"html": "<div class=\"govuk-form-group govuk-form-group--error\">\n\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"nationality-error\">\n \n <legend class=\"govuk-fieldset__legend\">\n \n Filter by\n \n </legend>\n \n\n <span id=\"nationality-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error:</span> Select a thing\n </span>\n\n <div class=\"govuk-checkboxes govuk-checkboxes--small\">\n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"nationality\" name=\"nationality\" type=\"checkbox\" value=\"a\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"nationality\">\n a thing\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"nationality-2\" name=\"nationality\" type=\"checkbox\" value=\"b\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"nationality-2\">\n another thing\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"nationality-3\" name=\"nationality\" type=\"checkbox\" value=\"c\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"nationality-3\">\n this thing\n </label>\n \n </div>\n \n \n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
560
|
+
},
|
561
|
+
{
|
562
|
+
"name": "small with hint",
|
563
|
+
"options": {
|
564
|
+
"idPrefix": "nationality",
|
565
|
+
"name": "nationality",
|
566
|
+
"classes": "govuk-checkboxes--small",
|
567
|
+
"fieldset": {
|
568
|
+
"legend": {
|
569
|
+
"text": "Filter by"
|
570
|
+
}
|
571
|
+
},
|
572
|
+
"items": [
|
573
|
+
{
|
574
|
+
"value": "a",
|
575
|
+
"text": "a thing",
|
576
|
+
"hint": {
|
577
|
+
"text": "hint for a thing"
|
578
|
+
}
|
579
|
+
},
|
580
|
+
{
|
581
|
+
"value": "b",
|
582
|
+
"text": "another thing"
|
583
|
+
},
|
584
|
+
{
|
585
|
+
"value": "c",
|
586
|
+
"text": "this thing"
|
587
|
+
}
|
588
|
+
]
|
589
|
+
},
|
590
|
+
"html": "<div class=\"govuk-form-group\">\n\n <fieldset class=\"govuk-fieldset\">\n \n <legend class=\"govuk-fieldset__legend\">\n \n Filter by\n \n </legend>\n \n\n <div class=\"govuk-checkboxes govuk-checkboxes--small\">\n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"nationality\" name=\"nationality\" type=\"checkbox\" value=\"a\" aria-describedby=\"nationality-item-hint\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"nationality\">\n a thing\n </label>\n \n <div id=\"nationality-item-hint\" class=\"govuk-hint govuk-checkboxes__hint\">\n hint for a thing\n </div>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"nationality-2\" name=\"nationality\" type=\"checkbox\" value=\"b\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"nationality-2\">\n another thing\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"nationality-3\" name=\"nationality\" type=\"checkbox\" value=\"c\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"nationality-3\">\n this thing\n </label>\n \n </div>\n \n \n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
591
|
+
},
|
592
|
+
{
|
593
|
+
"name": "small with disabled",
|
594
|
+
"options": {
|
595
|
+
"idPrefix": "nationality",
|
596
|
+
"name": "nationality",
|
597
|
+
"classes": "govuk-checkboxes--small",
|
598
|
+
"fieldset": {
|
599
|
+
"legend": {
|
600
|
+
"text": "Filter by"
|
601
|
+
}
|
602
|
+
},
|
603
|
+
"items": [
|
604
|
+
{
|
605
|
+
"value": "a",
|
606
|
+
"text": "a thing"
|
607
|
+
},
|
608
|
+
{
|
609
|
+
"value": "b",
|
610
|
+
"text": "another thing"
|
611
|
+
},
|
612
|
+
{
|
613
|
+
"value": "c",
|
614
|
+
"text": "this thing",
|
615
|
+
"disabled": true
|
616
|
+
}
|
617
|
+
]
|
618
|
+
},
|
619
|
+
"html": "<div class=\"govuk-form-group\">\n\n <fieldset class=\"govuk-fieldset\">\n \n <legend class=\"govuk-fieldset__legend\">\n \n Filter by\n \n </legend>\n \n\n <div class=\"govuk-checkboxes govuk-checkboxes--small\">\n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"nationality\" name=\"nationality\" type=\"checkbox\" value=\"a\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"nationality\">\n a thing\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"nationality-2\" name=\"nationality\" type=\"checkbox\" value=\"b\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"nationality-2\">\n another thing\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"nationality-3\" name=\"nationality\" type=\"checkbox\" value=\"c\" disabled>\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"nationality-3\">\n this thing\n </label>\n \n </div>\n \n \n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
620
|
+
},
|
621
|
+
{
|
622
|
+
"name": "small with conditional reveal",
|
623
|
+
"options": {
|
624
|
+
"name": "how-contacted",
|
625
|
+
"idPrefix": "how-contacted",
|
626
|
+
"classes": "govuk-checkboxes--small",
|
627
|
+
"fieldset": {
|
628
|
+
"legend": {
|
629
|
+
"text": "How do you want to be contacted?"
|
630
|
+
}
|
631
|
+
},
|
632
|
+
"items": [
|
633
|
+
{
|
634
|
+
"value": "a",
|
635
|
+
"text": "a thing",
|
636
|
+
"conditional": {
|
637
|
+
"html": "<label class=\"govuk-label\" for=\"context-email\">Foo</label>\n<input class=\"govuk-input govuk-!-width-one-third\" name=\"context-email\" type=\"text\" id=\"context-email\">\n"
|
638
|
+
}
|
639
|
+
},
|
640
|
+
{
|
641
|
+
"value": "b",
|
642
|
+
"text": "another thing"
|
643
|
+
}
|
644
|
+
]
|
645
|
+
},
|
646
|
+
"html": "<div class=\"govuk-form-group\">\n\n <fieldset class=\"govuk-fieldset\">\n \n <legend class=\"govuk-fieldset__legend\">\n \n How do you want to be contacted?\n \n </legend>\n \n\n <div class=\"govuk-checkboxes govuk-checkboxes--small\" data-module=\"govuk-checkboxes\">\n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"how-contacted\" name=\"how-contacted\" type=\"checkbox\" value=\"a\" data-aria-controls=\"conditional-how-contacted\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"how-contacted\">\n a thing\n </label>\n \n </div>\n \n <div class=\"govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden\" id=\"conditional-how-contacted\">\n <label class=\"govuk-label\" for=\"context-email\">Foo</label>\n<input class=\"govuk-input govuk-!-width-one-third\" name=\"context-email\" type=\"text\" id=\"context-email\">\n\n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"how-contacted-2\" name=\"how-contacted\" type=\"checkbox\" value=\"b\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"how-contacted-2\">\n another thing\n </label>\n \n </div>\n \n \n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
647
|
+
},
|
648
|
+
{
|
649
|
+
"name": "with idPrefix",
|
650
|
+
"options": {
|
651
|
+
"name": "example-name",
|
652
|
+
"idPrefix": "nationality",
|
653
|
+
"items": [
|
654
|
+
{
|
655
|
+
"value": 1,
|
656
|
+
"text": "Option 1"
|
657
|
+
},
|
658
|
+
{
|
659
|
+
"value": 2,
|
660
|
+
"text": "Option 2"
|
661
|
+
}
|
662
|
+
]
|
663
|
+
},
|
664
|
+
"html": "<div class=\"govuk-form-group\">\n\n <div class=\"govuk-checkboxes\">\n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"nationality\" name=\"example-name\" type=\"checkbox\" value=\"1\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"nationality\">\n Option 1\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"nationality-2\" name=\"example-name\" type=\"checkbox\" value=\"2\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"nationality-2\">\n Option 2\n </label>\n \n </div>\n \n \n \n </div>\n\n</div>"
|
665
|
+
},
|
666
|
+
{
|
667
|
+
"name": "with falsey values",
|
668
|
+
"options": {
|
669
|
+
"name": "example-name",
|
670
|
+
"items": [
|
671
|
+
{
|
672
|
+
"value": 1,
|
673
|
+
"text": "Option 1"
|
674
|
+
},
|
675
|
+
false,
|
676
|
+
null,
|
677
|
+
"",
|
678
|
+
{
|
679
|
+
"value": 2,
|
680
|
+
"text": "Option 2"
|
681
|
+
}
|
682
|
+
]
|
683
|
+
},
|
684
|
+
"html": "<div class=\"govuk-form-group\">\n\n <div class=\"govuk-checkboxes\">\n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"example-name\" name=\"example-name\" type=\"checkbox\" value=\"1\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"example-name\">\n Option 1\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"example-name-5\" name=\"example-name\" type=\"checkbox\" value=\"2\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"example-name-5\">\n Option 2\n </label>\n \n </div>\n \n \n \n </div>\n\n</div>"
|
685
|
+
},
|
686
|
+
{
|
687
|
+
"name": "classes",
|
688
|
+
"options": {
|
689
|
+
"name": "example-name",
|
690
|
+
"classes": "app-checkboxes--custom-modifier",
|
691
|
+
"items": [
|
692
|
+
{
|
693
|
+
"value": 1,
|
694
|
+
"text": "Option 1"
|
695
|
+
},
|
696
|
+
{
|
697
|
+
"value": 2,
|
698
|
+
"text": "Option 2"
|
699
|
+
}
|
700
|
+
]
|
701
|
+
},
|
702
|
+
"html": "<div class=\"govuk-form-group\">\n\n <div class=\"govuk-checkboxes app-checkboxes--custom-modifier\">\n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"example-name\" name=\"example-name\" type=\"checkbox\" value=\"1\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"example-name\">\n Option 1\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"example-name-2\" name=\"example-name\" type=\"checkbox\" value=\"2\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"example-name-2\">\n Option 2\n </label>\n \n </div>\n \n \n \n </div>\n\n</div>"
|
703
|
+
},
|
704
|
+
{
|
705
|
+
"name": "with fieldset describedBy",
|
706
|
+
"options": {
|
707
|
+
"name": "example-name",
|
708
|
+
"fieldset": {
|
709
|
+
"describedBy": "some-id"
|
710
|
+
},
|
711
|
+
"items": [
|
712
|
+
{
|
713
|
+
"value": 1,
|
714
|
+
"text": "Option 1"
|
715
|
+
},
|
716
|
+
{
|
717
|
+
"value": 2,
|
718
|
+
"text": "Option 2"
|
719
|
+
}
|
720
|
+
],
|
721
|
+
"hint": {
|
722
|
+
"text": "If you have dual nationality, select all options that are relevant to you."
|
723
|
+
}
|
724
|
+
},
|
725
|
+
"html": "<div class=\"govuk-form-group\">\n\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"some-id example-name-hint\">\n \n\n <div id=\"example-name-hint\" class=\"govuk-hint\">\n If you have dual nationality, select all options that are relevant to you.\n </div>\n\n\n <div class=\"govuk-checkboxes\">\n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"example-name\" name=\"example-name\" type=\"checkbox\" value=\"1\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"example-name\">\n Option 1\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"example-name-2\" name=\"example-name\" type=\"checkbox\" value=\"2\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"example-name-2\">\n Option 2\n </label>\n \n </div>\n \n \n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
726
|
+
},
|
727
|
+
{
|
728
|
+
"name": "attributes",
|
729
|
+
"options": {
|
730
|
+
"name": "example-name",
|
731
|
+
"attributes": {
|
732
|
+
"data-attribute": "value",
|
733
|
+
"data-second-attribute": "second-value"
|
734
|
+
},
|
735
|
+
"items": [
|
736
|
+
{
|
737
|
+
"value": 1,
|
738
|
+
"text": "Option 1"
|
739
|
+
},
|
740
|
+
{
|
741
|
+
"value": 2,
|
742
|
+
"text": "Option 2"
|
743
|
+
}
|
744
|
+
]
|
745
|
+
},
|
746
|
+
"html": "<div class=\"govuk-form-group\">\n\n <div class=\"govuk-checkboxes\" data-attribute=\"value\" data-second-attribute=\"second-value\">\n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"example-name\" name=\"example-name\" type=\"checkbox\" value=\"1\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"example-name\">\n Option 1\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"example-name-2\" name=\"example-name\" type=\"checkbox\" value=\"2\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"example-name-2\">\n Option 2\n </label>\n \n </div>\n \n \n \n </div>\n\n</div>"
|
747
|
+
},
|
748
|
+
{
|
749
|
+
"name": "with checked item",
|
750
|
+
"options": {
|
751
|
+
"name": "example-name",
|
752
|
+
"items": [
|
753
|
+
{
|
754
|
+
"value": 1,
|
755
|
+
"text": "Option 1"
|
756
|
+
},
|
757
|
+
{
|
758
|
+
"value": 2,
|
759
|
+
"text": "Option 2",
|
760
|
+
"checked": true
|
761
|
+
},
|
762
|
+
{
|
763
|
+
"value": 3,
|
764
|
+
"text": "Option 3",
|
765
|
+
"checked": true
|
766
|
+
}
|
767
|
+
]
|
768
|
+
},
|
769
|
+
"html": "<div class=\"govuk-form-group\">\n\n <div class=\"govuk-checkboxes\">\n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"example-name\" name=\"example-name\" type=\"checkbox\" value=\"1\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"example-name\">\n Option 1\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"example-name-2\" name=\"example-name\" type=\"checkbox\" value=\"2\" checked>\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"example-name-2\">\n Option 2\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"example-name-3\" name=\"example-name\" type=\"checkbox\" value=\"3\" checked>\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"example-name-3\">\n Option 3\n </label>\n \n </div>\n \n \n \n </div>\n\n</div>"
|
770
|
+
},
|
771
|
+
{
|
772
|
+
"name": "items with attributes",
|
773
|
+
"options": {
|
774
|
+
"name": "example-name",
|
775
|
+
"items": [
|
776
|
+
{
|
777
|
+
"value": 1,
|
778
|
+
"text": "Option 1",
|
779
|
+
"attributes": {
|
780
|
+
"data-attribute": "ABC",
|
781
|
+
"data-second-attribute": "DEF"
|
782
|
+
}
|
783
|
+
},
|
784
|
+
{
|
785
|
+
"value": 2,
|
786
|
+
"text": "Option 2",
|
787
|
+
"attributes": {
|
788
|
+
"data-attribute": "GHI",
|
789
|
+
"data-second-attribute": "JKL"
|
790
|
+
}
|
791
|
+
}
|
792
|
+
]
|
793
|
+
},
|
794
|
+
"html": "<div class=\"govuk-form-group\">\n\n <div class=\"govuk-checkboxes\">\n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"example-name\" name=\"example-name\" type=\"checkbox\" value=\"1\" data-attribute=\"ABC\" data-second-attribute=\"DEF\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"example-name\">\n Option 1\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"example-name-2\" name=\"example-name\" type=\"checkbox\" value=\"2\" data-attribute=\"GHI\" data-second-attribute=\"JKL\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"example-name-2\">\n Option 2\n </label>\n \n </div>\n \n \n \n </div>\n\n</div>"
|
795
|
+
},
|
796
|
+
{
|
797
|
+
"name": "empty conditional",
|
798
|
+
"options": {
|
799
|
+
"name": "example-conditional",
|
800
|
+
"items": [
|
801
|
+
{
|
802
|
+
"value": "foo",
|
803
|
+
"text": "Foo",
|
804
|
+
"conditional": {
|
805
|
+
"html": false
|
806
|
+
}
|
807
|
+
}
|
808
|
+
]
|
809
|
+
},
|
810
|
+
"html": "<div class=\"govuk-form-group\">\n\n <div class=\"govuk-checkboxes\">\n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"example-conditional\" name=\"example-conditional\" type=\"checkbox\" value=\"foo\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"example-conditional\">\n Foo\n </label>\n \n </div>\n \n \n \n </div>\n\n</div>"
|
811
|
+
},
|
812
|
+
{
|
813
|
+
"name": "with label classes",
|
814
|
+
"options": {
|
815
|
+
"name": "example-label-classes",
|
816
|
+
"items": [
|
817
|
+
{
|
818
|
+
"value": "yes",
|
819
|
+
"text": "Yes",
|
820
|
+
"label": {
|
821
|
+
"classes": "bold"
|
822
|
+
}
|
823
|
+
}
|
824
|
+
]
|
825
|
+
},
|
826
|
+
"html": "<div class=\"govuk-form-group\">\n\n <div class=\"govuk-checkboxes\">\n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"example-label-classes\" name=\"example-label-classes\" type=\"checkbox\" value=\"yes\">\n <label class=\"govuk-label govuk-checkboxes__label bold\" for=\"example-label-classes\">\n Yes\n </label>\n \n </div>\n \n \n \n </div>\n\n</div>"
|
827
|
+
},
|
828
|
+
{
|
829
|
+
"name": "multiple hints",
|
830
|
+
"options": {
|
831
|
+
"name": "example-multiple-hints",
|
832
|
+
"hint": {
|
833
|
+
"text": "If you have dual nationality, select all options that are relevant to you."
|
834
|
+
},
|
835
|
+
"items": [
|
836
|
+
{
|
837
|
+
"value": "british",
|
838
|
+
"text": "British",
|
839
|
+
"hint": {
|
840
|
+
"text": "Hint for british option here"
|
841
|
+
}
|
842
|
+
},
|
843
|
+
{
|
844
|
+
"value": "irish",
|
845
|
+
"text": "Irish"
|
846
|
+
},
|
847
|
+
{
|
848
|
+
"hint": {
|
849
|
+
"text": "Hint for other option here"
|
850
|
+
}
|
851
|
+
}
|
852
|
+
]
|
853
|
+
},
|
854
|
+
"html": "<div class=\"govuk-form-group\">\n\n <div id=\"example-multiple-hints-hint\" class=\"govuk-hint\">\n If you have dual nationality, select all options that are relevant to you.\n </div>\n\n\n <div class=\"govuk-checkboxes\">\n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"example-multiple-hints\" name=\"example-multiple-hints\" type=\"checkbox\" value=\"british\" aria-describedby=\"example-multiple-hints-hint example-multiple-hints-item-hint\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"example-multiple-hints\">\n British\n </label>\n \n <div id=\"example-multiple-hints-item-hint\" class=\"govuk-hint govuk-checkboxes__hint\">\n Hint for british option here\n </div>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"example-multiple-hints-2\" name=\"example-multiple-hints\" type=\"checkbox\" value=\"irish\" aria-describedby=\"example-multiple-hints-hint\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"example-multiple-hints-2\">\n Irish\n </label>\n \n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"example-multiple-hints-3\" name=\"example-multiple-hints\" type=\"checkbox\" value=\"\" aria-describedby=\"example-multiple-hints-hint example-multiple-hints-3-item-hint\">\n \n \n <div id=\"example-multiple-hints-3-item-hint\" class=\"govuk-hint govuk-checkboxes__hint\">\n Hint for other option here\n </div>\n \n </div>\n \n \n \n </div>\n\n</div>"
|
855
|
+
},
|
856
|
+
{
|
857
|
+
"name": "with error message and hint",
|
858
|
+
"options": {
|
859
|
+
"name": "example",
|
860
|
+
"errorMessage": {
|
861
|
+
"text": "Please select an option"
|
862
|
+
},
|
863
|
+
"fieldset": {
|
864
|
+
"legend": {
|
865
|
+
"text": "What is your nationality?"
|
866
|
+
}
|
867
|
+
},
|
868
|
+
"hint": {
|
869
|
+
"text": "If you have dual nationality, select all options that are relevant to you."
|
870
|
+
}
|
871
|
+
},
|
872
|
+
"html": "<div class=\"govuk-form-group govuk-form-group--error\">\n\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"example-hint example-error\">\n \n <legend class=\"govuk-fieldset__legend\">\n \n What is your nationality?\n \n </legend>\n \n\n <div id=\"example-hint\" class=\"govuk-hint\">\n If you have dual nationality, select all options that are relevant to you.\n </div>\n\n\n \n \n <span id=\"example-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error:</span> Please select an option\n </span>\n\n <div class=\"govuk-checkboxes\">\n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
873
|
+
},
|
874
|
+
{
|
875
|
+
"name": "with error, hint and fieldset describedBy",
|
876
|
+
"options": {
|
877
|
+
"name": "example",
|
878
|
+
"errorMessage": {
|
879
|
+
"text": "Please select an option"
|
880
|
+
},
|
881
|
+
"fieldset": {
|
882
|
+
"describedBy": "some-id",
|
883
|
+
"legend": {
|
884
|
+
"text": "What is your nationality?"
|
885
|
+
}
|
886
|
+
},
|
887
|
+
"hint": {
|
888
|
+
"text": "If you have dual nationality, select all options that are relevant to you."
|
889
|
+
}
|
890
|
+
},
|
891
|
+
"html": "<div class=\"govuk-form-group govuk-form-group--error\">\n\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"some-id example-hint example-error\">\n \n <legend class=\"govuk-fieldset__legend\">\n \n What is your nationality?\n \n </legend>\n \n\n <div id=\"example-hint\" class=\"govuk-hint\">\n If you have dual nationality, select all options that are relevant to you.\n </div>\n\n\n \n \n <span id=\"example-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error:</span> Please select an option\n </span>\n\n <div class=\"govuk-checkboxes\">\n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
892
|
+
},
|
893
|
+
{
|
894
|
+
"name": "label with attributes",
|
895
|
+
"options": {
|
896
|
+
"name": "example-name",
|
897
|
+
"items": [
|
898
|
+
{
|
899
|
+
"value": 1,
|
900
|
+
"html": "<b>Option 1</b>",
|
901
|
+
"label": {
|
902
|
+
"attributes": {
|
903
|
+
"data-attribute": "value",
|
904
|
+
"data-second-attribute": "second-value"
|
905
|
+
}
|
906
|
+
}
|
907
|
+
}
|
908
|
+
]
|
909
|
+
},
|
910
|
+
"html": "<div class=\"govuk-form-group\">\n\n <div class=\"govuk-checkboxes\">\n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"example-name\" name=\"example-name\" type=\"checkbox\" value=\"1\">\n <label class=\"govuk-label govuk-checkboxes__label\" data-attribute=\"value\" data-second-attribute=\"second-value\" for=\"example-name\">\n <b>Option 1</b>\n </label>\n \n </div>\n \n \n \n </div>\n\n</div>"
|
911
|
+
},
|
912
|
+
{
|
913
|
+
"name": "fieldset params",
|
914
|
+
"options": {
|
915
|
+
"name": "example-name",
|
916
|
+
"errorMessage": {
|
917
|
+
"text": "Please select an option"
|
918
|
+
},
|
919
|
+
"legend": {
|
920
|
+
"text": "What is your nationality?"
|
921
|
+
},
|
922
|
+
"fieldset": {
|
923
|
+
"classes": "app-fieldset--custom-modifier",
|
924
|
+
"attributes": {
|
925
|
+
"data-attribute": "value",
|
926
|
+
"data-second-attribute": "second-value"
|
927
|
+
}
|
928
|
+
}
|
929
|
+
},
|
930
|
+
"html": "<div class=\"govuk-form-group govuk-form-group--error\">\n\n <fieldset class=\"govuk-fieldset app-fieldset--custom-modifier\" aria-describedby=\"example-name-error\" data-attribute=\"value\" data-second-attribute=\"second-value\">\n \n\n <span id=\"example-name-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error:</span> Please select an option\n </span>\n\n <div class=\"govuk-checkboxes\">\n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
931
|
+
},
|
932
|
+
{
|
933
|
+
"name": "fieldset html params",
|
934
|
+
"options": {
|
935
|
+
"name": "example-name",
|
936
|
+
"fieldset": {
|
937
|
+
"legend": {
|
938
|
+
"html": "What is your <b>nationality</b>?"
|
939
|
+
}
|
940
|
+
}
|
941
|
+
},
|
942
|
+
"html": "<div class=\"govuk-form-group\">\n\n <fieldset class=\"govuk-fieldset\">\n \n <legend class=\"govuk-fieldset__legend\">\n \n What is your <b>nationality</b>?\n \n </legend>\n \n\n <div class=\"govuk-checkboxes\">\n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
943
|
+
},
|
944
|
+
{
|
945
|
+
"name": "with single option set 'aria-describedby' on input, and describedBy",
|
946
|
+
"options": {
|
947
|
+
"describedBy": "some-id",
|
948
|
+
"name": "t-and-c",
|
949
|
+
"errorMessage": {
|
950
|
+
"text": "Please accept the terms and conditions"
|
951
|
+
},
|
952
|
+
"items": [
|
953
|
+
{
|
954
|
+
"value": "yes",
|
955
|
+
"text": "I agree to the terms and conditions"
|
956
|
+
}
|
957
|
+
]
|
958
|
+
},
|
959
|
+
"html": "<div class=\"govuk-form-group govuk-form-group--error\">\n\n <span id=\"t-and-c-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error:</span> Please accept the terms and conditions\n </span>\n\n <div class=\"govuk-checkboxes\">\n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"t-and-c\" name=\"t-and-c\" type=\"checkbox\" value=\"yes\" aria-describedby=\"some-id t-and-c-error\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"t-and-c\">\n I agree to the terms and conditions\n </label>\n \n </div>\n \n \n \n </div>\n\n</div>"
|
960
|
+
},
|
961
|
+
{
|
962
|
+
"name": "with single option (and hint) set 'aria-describedby' on input, and describedBy",
|
963
|
+
"options": {
|
964
|
+
"describedBy": "some-id",
|
965
|
+
"name": "t-and-c-with-hint",
|
966
|
+
"errorMessage": {
|
967
|
+
"text": "Please accept the terms and conditions"
|
968
|
+
},
|
969
|
+
"items": [
|
970
|
+
{
|
971
|
+
"value": "yes",
|
972
|
+
"text": "I agree to the terms and conditions",
|
973
|
+
"hint": {
|
974
|
+
"text": "Go on, you know you want to!"
|
975
|
+
}
|
976
|
+
}
|
977
|
+
]
|
978
|
+
},
|
979
|
+
"html": "<div class=\"govuk-form-group govuk-form-group--error\">\n\n <span id=\"t-and-c-with-hint-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error:</span> Please accept the terms and conditions\n </span>\n\n <div class=\"govuk-checkboxes\">\n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"t-and-c-with-hint\" name=\"t-and-c-with-hint\" type=\"checkbox\" value=\"yes\" aria-describedby=\"some-id t-and-c-with-hint-error t-and-c-with-hint-item-hint\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"t-and-c-with-hint\">\n I agree to the terms and conditions\n </label>\n \n <div id=\"t-and-c-with-hint-item-hint\" class=\"govuk-hint govuk-checkboxes__hint\">\n Go on, you know you want to!\n </div>\n \n </div>\n \n \n \n </div>\n\n</div>"
|
980
|
+
},
|
981
|
+
{
|
982
|
+
"name": "with error and idPrefix",
|
983
|
+
"options": {
|
984
|
+
"name": "name-of-checkboxes",
|
985
|
+
"errorMessage": {
|
986
|
+
"text": "Please select an option"
|
987
|
+
},
|
988
|
+
"idPrefix": "id-prefix",
|
989
|
+
"items": [
|
990
|
+
{
|
991
|
+
"value": "animal",
|
992
|
+
"text": "Waste from animal carcasses"
|
993
|
+
}
|
994
|
+
]
|
995
|
+
},
|
996
|
+
"html": "<div class=\"govuk-form-group govuk-form-group--error\">\n\n <span id=\"id-prefix-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error:</span> Please select an option\n </span>\n\n <div class=\"govuk-checkboxes\">\n \n \n \n \n \n \n \n \n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"id-prefix\" name=\"name-of-checkboxes\" type=\"checkbox\" value=\"animal\" aria-describedby=\"id-prefix-error\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"id-prefix\">\n Waste from animal carcasses\n </label>\n \n </div>\n \n \n \n </div>\n\n</div>"
|
997
|
+
},
|
998
|
+
{
|
999
|
+
"name": "with error message and fieldset describedBy",
|
1000
|
+
"options": {
|
1001
|
+
"name": "example",
|
1002
|
+
"errorMessage": {
|
1003
|
+
"text": "Please select an option"
|
1004
|
+
},
|
1005
|
+
"fieldset": {
|
1006
|
+
"describedBy": "some-id",
|
1007
|
+
"legend": {
|
1008
|
+
"text": "What is your nationality?"
|
1009
|
+
}
|
1010
|
+
}
|
1011
|
+
},
|
1012
|
+
"html": "<div class=\"govuk-form-group govuk-form-group--error\">\n\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"some-id example-error\">\n \n <legend class=\"govuk-fieldset__legend\">\n \n What is your nationality?\n \n </legend>\n \n\n <span id=\"example-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error:</span> Please select an option\n </span>\n\n <div class=\"govuk-checkboxes\">\n \n </div>\n \n\n</fieldset>\n\n\n</div>"
|
1013
|
+
}
|
1014
|
+
]
|
1015
|
+
}
|