govuk_publishing_components 9.5.1 → 9.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +11 -6
  3. data/app/assets/javascripts/govuk_publishing_components/vendor/modernizr.js +3 -0
  4. data/app/assets/stylesheets/govuk_publishing_components/admin_styles_ie8.scss +2 -0
  5. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +2 -0
  6. data/app/views/govuk_publishing_components/components/_layout_for_admin.html.erb +7 -1
  7. data/app/views/govuk_publishing_components/components/_step_by_step_nav.html.erb +3 -5
  8. data/app/views/layouts/govuk_publishing_components/application.html.erb +6 -0
  9. data/config/initializers/assets.rb +2 -0
  10. data/lib/govuk_publishing_components/version.rb +1 -1
  11. data/node_modules/govuk-frontend/README.md +1 -1
  12. data/node_modules/govuk-frontend/all.js +3 -1
  13. data/node_modules/govuk-frontend/components/back-link/README.md +23 -7
  14. data/node_modules/govuk-frontend/components/breadcrumbs/README.md +26 -26
  15. data/node_modules/govuk-frontend/components/button/README.md +22 -22
  16. data/node_modules/govuk-frontend/components/checkboxes/README.md +115 -27
  17. data/node_modules/govuk-frontend/components/checkboxes/_checkboxes.scss +7 -1
  18. data/node_modules/govuk-frontend/components/date-input/README.md +141 -61
  19. data/node_modules/govuk-frontend/components/date-input/_date-input.scss +0 -5
  20. data/node_modules/govuk-frontend/components/date-input/template.njk +40 -17
  21. data/node_modules/govuk-frontend/components/details/README.md +10 -10
  22. data/node_modules/govuk-frontend/components/error-message/README.md +4 -4
  23. data/node_modules/govuk-frontend/components/error-summary/README.md +5 -5
  24. data/node_modules/govuk-frontend/components/fieldset/README.md +7 -7
  25. data/node_modules/govuk-frontend/components/file-upload/README.md +16 -16
  26. data/node_modules/govuk-frontend/components/footer/README.md +5 -5
  27. data/node_modules/govuk-frontend/components/footer/template.njk +1 -1
  28. data/node_modules/govuk-frontend/components/header/README.md +26 -18
  29. data/node_modules/govuk-frontend/components/header/_header.scss +3 -2
  30. data/node_modules/govuk-frontend/components/header/template.njk +5 -3
  31. data/node_modules/govuk-frontend/components/hint/README.md +14 -10
  32. data/node_modules/govuk-frontend/components/input/README.md +166 -30
  33. data/node_modules/govuk-frontend/components/input/_input.scss +20 -3
  34. data/node_modules/govuk-frontend/components/inset-text/README.md +6 -6
  35. data/node_modules/govuk-frontend/components/label/README.md +9 -9
  36. data/node_modules/govuk-frontend/components/panel/README.md +43 -4
  37. data/node_modules/govuk-frontend/components/panel/template.njk +4 -2
  38. data/node_modules/govuk-frontend/components/phase-banner/README.md +4 -4
  39. data/node_modules/govuk-frontend/components/phase-banner/_phase-banner.scss +3 -3
  40. data/node_modules/govuk-frontend/components/radios/README.md +100 -29
  41. data/node_modules/govuk-frontend/components/radios/_radios.scss +12 -3
  42. data/node_modules/govuk-frontend/components/select/README.md +12 -12
  43. data/node_modules/govuk-frontend/components/skip-link/README.md +4 -4
  44. data/node_modules/govuk-frontend/components/table/README.md +12 -12
  45. data/node_modules/govuk-frontend/components/table/_table.scss +2 -2
  46. data/node_modules/govuk-frontend/components/tabs/README.md +4 -4
  47. data/node_modules/govuk-frontend/components/tabs/_tabs.scss +1 -0
  48. data/node_modules/govuk-frontend/components/tag/README.md +7 -7
  49. data/node_modules/govuk-frontend/components/tag/_tag.scss +6 -0
  50. data/node_modules/govuk-frontend/components/textarea/README.md +16 -16
  51. data/node_modules/govuk-frontend/components/warning-text/README.md +4 -4
  52. data/node_modules/govuk-frontend/components/warning-text/_warning-text.scss +14 -4
  53. data/node_modules/govuk-frontend/core/_template.scss +7 -3
  54. data/node_modules/govuk-frontend/helpers/_typography.scss +44 -10
  55. data/node_modules/govuk-frontend/objects/_main-wrapper.scss +4 -0
  56. data/node_modules/govuk-frontend/package.json +18 -12
  57. data/node_modules/govuk-frontend/settings/_typography-responsive.scss +35 -0
  58. data/node_modules/govuk-frontend/tools/_all.scss +1 -0
  59. data/node_modules/govuk-frontend/tools/_px-to-rem.scss +20 -0
  60. data/node_modules/govuk-frontend/utilities/_visually-hidden.scss +6 -0
  61. metadata +5 -28
  62. data/node_modules/govuk-frontend/components/back-link/back-link.njk +0 -3
  63. data/node_modules/govuk-frontend/components/breadcrumbs/breadcrumbs.njk +0 -14
  64. data/node_modules/govuk-frontend/components/button/button.njk +0 -3
  65. data/node_modules/govuk-frontend/components/checkboxes/checkboxes.njk +0 -27
  66. data/node_modules/govuk-frontend/components/date-input/date-input.njk +0 -23
  67. data/node_modules/govuk-frontend/components/details/details.njk +0 -7
  68. data/node_modules/govuk-frontend/components/error-message/error-message.njk +0 -7
  69. data/node_modules/govuk-frontend/components/error-summary/error-summary.njk +0 -17
  70. data/node_modules/govuk-frontend/components/fieldset/fieldset.njk +0 -13
  71. data/node_modules/govuk-frontend/components/file-upload/file-upload.njk +0 -9
  72. data/node_modules/govuk-frontend/components/footer/footer.njk +0 -3
  73. data/node_modules/govuk-frontend/components/header/header.njk +0 -3
  74. data/node_modules/govuk-frontend/components/hint/hint.njk +0 -7
  75. data/node_modules/govuk-frontend/components/input/input.njk +0 -9
  76. data/node_modules/govuk-frontend/components/inset-text/inset-text.njk +0 -7
  77. data/node_modules/govuk-frontend/components/label/label.njk +0 -6
  78. data/node_modules/govuk-frontend/components/panel/panel.njk +0 -7
  79. data/node_modules/govuk-frontend/components/phase-banner/phase-banner.njk +0 -7
  80. data/node_modules/govuk-frontend/components/radios/radios.njk +0 -27
  81. data/node_modules/govuk-frontend/components/select/select.njk +0 -24
  82. data/node_modules/govuk-frontend/components/skip-link/skip-link.njk +0 -3
  83. data/node_modules/govuk-frontend/components/table/table.njk +0 -45
  84. data/node_modules/govuk-frontend/components/tabs/tabs.njk +0 -3
  85. data/node_modules/govuk-frontend/components/tag/tag.njk +0 -7
  86. data/node_modules/govuk-frontend/components/textarea/textarea.njk +0 -11
  87. data/node_modules/govuk-frontend/components/warning-text/warning-text.njk +0 -9
@@ -6,13 +6,13 @@ Let users select one or more options.
6
6
 
7
7
  ## Guidance
8
8
 
9
- Find out when to use the Checkboxes component in your service in the [GOV.UK Design System](https://govuk-design-system-production.cloudapps.digital/components/checkboxes).
9
+ Find out when to use the checkboxes component in your service in the [GOV.UK Design System](https://design-system.service.gov.uk/components/checkboxes).
10
10
 
11
11
  ## Quick start examples
12
12
 
13
- ### Component default
13
+ ### Checkboxes
14
14
 
15
- [Preview the checkboxes component](http://govuk-frontend-review.herokuapp.com/components/checkboxes/preview)
15
+ [Preview this example in the Frontend review app](http://govuk-frontend-review.herokuapp.com/components/checkboxes/preview)
16
16
 
17
17
  #### Markup
18
18
 
@@ -58,7 +58,7 @@ Find out when to use the Checkboxes component in your service in the [GOV.UK Des
58
58
 
59
59
  #### Macro
60
60
 
61
- {% from 'checkboxes/macro.njk' import govukCheckboxes %}
61
+ {% from "checkboxes/macro.njk" import govukCheckboxes %}
62
62
 
63
63
  {{ govukCheckboxes({
64
64
  "idPrefix": "nationality",
@@ -87,9 +87,9 @@ Find out when to use the Checkboxes component in your service in the [GOV.UK Des
87
87
  ]
88
88
  }) }}
89
89
 
90
- ### Checkboxes--with-id-plus-name
90
+ ### Checkboxes with id and name
91
91
 
92
- [Preview the checkboxes--with-id-plus-name example](http://govuk-frontend-review.herokuapp.com/components/checkboxes/with-id-plus-name/preview)
92
+ [Preview this example in the Frontend review app](http://govuk-frontend-review.herokuapp.com/components/checkboxes/with-id-and-name/preview)
93
93
 
94
94
  #### Markup
95
95
 
@@ -128,7 +128,7 @@ Find out when to use the Checkboxes component in your service in the [GOV.UK Des
128
128
 
129
129
  #### Macro
130
130
 
131
- {% from 'checkboxes/macro.njk' import govukCheckboxes %}
131
+ {% from "checkboxes/macro.njk" import govukCheckboxes %}
132
132
 
133
133
  {{ govukCheckboxes({
134
134
  "fieldset": {
@@ -155,9 +155,9 @@ Find out when to use the Checkboxes component in your service in the [GOV.UK Des
155
155
  ]
156
156
  }) }}
157
157
 
158
- ### Checkboxes--with-disabled
158
+ ### Checkboxes with disabled item
159
159
 
160
- [Preview the checkboxes--with-disabled example](http://govuk-frontend-review.herokuapp.com/components/checkboxes/with-disabled/preview)
160
+ [Preview this example in the Frontend review app](http://govuk-frontend-review.herokuapp.com/components/checkboxes/with-disabled-item/preview)
161
161
 
162
162
  #### Markup
163
163
 
@@ -192,7 +192,7 @@ Find out when to use the Checkboxes component in your service in the [GOV.UK Des
192
192
 
193
193
  #### Macro
194
194
 
195
- {% from 'checkboxes/macro.njk' import govukCheckboxes %}
195
+ {% from "checkboxes/macro.njk" import govukCheckboxes %}
196
196
 
197
197
  {{ govukCheckboxes({
198
198
  "name": "colours",
@@ -213,9 +213,9 @@ Find out when to use the Checkboxes component in your service in the [GOV.UK Des
213
213
  ]
214
214
  }) }}
215
215
 
216
- ### Checkboxes--with-html
216
+ ### Checkboxes with legend as a page heading
217
217
 
218
- [Preview the checkboxes--with-html example](http://govuk-frontend-review.herokuapp.com/components/checkboxes/with-html/preview)
218
+ [Preview this example in the Frontend review app](http://govuk-frontend-review.herokuapp.com/components/checkboxes/with-legend-as-a-page-heading/preview)
219
219
 
220
220
  #### Markup
221
221
 
@@ -223,8 +223,10 @@ Find out when to use the Checkboxes component in your service in the [GOV.UK Des
223
223
 
224
224
  <fieldset class="govuk-fieldset" aria-describedby="waste-hint">
225
225
 
226
- <legend class="govuk-fieldset__legend">
227
- <h3 class="govuk-heading-m">Which types of waste do you transport regularly?</h3>
226
+ <legend class="govuk-fieldset__legend govuk-fieldset__legend--l">
227
+ <h1 class="govuk-fieldset__heading">
228
+ Which types of waste do you transport regularly?
229
+ </h1>
228
230
  </legend>
229
231
 
230
232
  <span id="waste-hint" class="govuk-hint">
@@ -261,13 +263,15 @@ Find out when to use the Checkboxes component in your service in the [GOV.UK Des
261
263
 
262
264
  #### Macro
263
265
 
264
- {% from 'checkboxes/macro.njk' import govukCheckboxes %}
266
+ {% from "checkboxes/macro.njk" import govukCheckboxes %}
265
267
 
266
268
  {{ govukCheckboxes({
267
269
  "name": "waste",
268
270
  "fieldset": {
269
271
  "legend": {
270
- "html": "<h3 class=\"govuk-heading-m\">Which types of waste do you transport regularly?</h3>"
272
+ "text": "Which types of waste do you transport regularly?",
273
+ "classes": "govuk-fieldset__legend--l",
274
+ "isPageHeading": true
271
275
  }
272
276
  },
273
277
  "hint": {
@@ -289,9 +293,93 @@ Find out when to use the Checkboxes component in your service in the [GOV.UK Des
289
293
  ]
290
294
  }) }}
291
295
 
292
- ### Checkboxes--without-fieldset
296
+ ### Checkboxes with a medium legend
297
+
298
+ [Preview this example in the Frontend review app](http://govuk-frontend-review.herokuapp.com/components/checkboxes/with-a-medium-legend/preview)
299
+
300
+ #### Markup
301
+
302
+ <div class="govuk-form-group govuk-form-group--error">
303
+
304
+ <fieldset class="govuk-fieldset" aria-describedby="waste-hint waste-error">
305
+
306
+ <legend class="govuk-fieldset__legend govuk-fieldset__legend--m">
307
+ Which types of waste do you transport regularly?
308
+ </legend>
309
+
310
+ <span id="waste-hint" class="govuk-hint">
311
+ Select all that apply
312
+ </span>
313
+
314
+ <span id="waste-error" class="govuk-error-message">
315
+ Select which types of waste you transport regularly
316
+ </span>
317
+
318
+ <div class="govuk-checkboxes">
319
+
320
+ <div class="govuk-checkboxes__item">
321
+ <input class="govuk-checkboxes__input" id="waste-1" name="waste" type="checkbox" value="animal">
322
+ <label class="govuk-label govuk-checkboxes__label" for="waste-1">
323
+ Waste from animal carcasses
324
+ </label>
325
+ </div>
326
+
327
+ <div class="govuk-checkboxes__item">
328
+ <input class="govuk-checkboxes__input" id="waste-2" name="waste" type="checkbox" value="mines">
329
+ <label class="govuk-label govuk-checkboxes__label" for="waste-2">
330
+ Waste from mines or quarries
331
+ </label>
332
+ </div>
333
+
334
+ <div class="govuk-checkboxes__item">
335
+ <input class="govuk-checkboxes__input" id="waste-3" name="waste" type="checkbox" value="farm">
336
+ <label class="govuk-label govuk-checkboxes__label" for="waste-3">
337
+ Farm or agricultural waste
338
+ </label>
339
+ </div>
340
+
341
+ </div>
342
+ </fieldset>
343
+
344
+ </div>
345
+
346
+ #### Macro
347
+
348
+ {% from "checkboxes/macro.njk" import govukCheckboxes %}
349
+
350
+ {{ govukCheckboxes({
351
+ "name": "waste",
352
+ "fieldset": {
353
+ "legend": {
354
+ "text": "Which types of waste do you transport regularly?",
355
+ "classes": "govuk-fieldset__legend--m"
356
+ }
357
+ },
358
+ "hint": {
359
+ "text": "Select all that apply"
360
+ },
361
+ "errorMessage": {
362
+ "text": "Select which types of waste you transport regularly"
363
+ },
364
+ "items": [
365
+ {
366
+ "value": "animal",
367
+ "text": "Waste from animal carcasses"
368
+ },
369
+ {
370
+ "value": "mines",
371
+ "text": "Waste from mines or quarries"
372
+ },
373
+ {
374
+ "value": "farm",
375
+ "text": "Farm or agricultural waste"
376
+ }
377
+ ]
378
+ }) }}
379
+
380
+ ### Checkboxes without fieldset
293
381
 
294
- [Preview the checkboxes--without-fieldset example](http://govuk-frontend-review.herokuapp.com/components/checkboxes/without-fieldset/preview)
382
+ [Preview this example in the Frontend review app](http://govuk-frontend-review.herokuapp.com/components/checkboxes/without-fieldset/preview)
295
383
 
296
384
  #### Markup
297
385
 
@@ -326,7 +414,7 @@ Find out when to use the Checkboxes component in your service in the [GOV.UK Des
326
414
 
327
415
  #### Macro
328
416
 
329
- {% from 'checkboxes/macro.njk' import govukCheckboxes %}
417
+ {% from "checkboxes/macro.njk" import govukCheckboxes %}
330
418
 
331
419
  {{ govukCheckboxes({
332
420
  "name": "colours",
@@ -346,9 +434,9 @@ Find out when to use the Checkboxes component in your service in the [GOV.UK Des
346
434
  ]
347
435
  }) }}
348
436
 
349
- ### Checkboxes--with-extreme-fieldset
437
+ ### Checkboxes with all fieldset attributes
350
438
 
351
- [Preview the checkboxes--with-extreme-fieldset example](http://govuk-frontend-review.herokuapp.com/components/checkboxes/with-extreme-fieldset/preview)
439
+ [Preview this example in the Frontend review app](http://govuk-frontend-review.herokuapp.com/components/checkboxes/with-all-fieldset-attributes/preview)
352
440
 
353
441
  #### Markup
354
442
 
@@ -398,7 +486,7 @@ Find out when to use the Checkboxes component in your service in the [GOV.UK Des
398
486
 
399
487
  #### Macro
400
488
 
401
- {% from 'checkboxes/macro.njk' import govukCheckboxes %}
489
+ {% from "checkboxes/macro.njk" import govukCheckboxes %}
402
490
 
403
491
  {{ govukCheckboxes({
404
492
  "idPrefix": "example",
@@ -435,9 +523,9 @@ Find out when to use the Checkboxes component in your service in the [GOV.UK Des
435
523
  ]
436
524
  }) }}
437
525
 
438
- ### Checkboxes--with-error
526
+ ### Checkboxes with error message
439
527
 
440
- [Preview the checkboxes--with-error example](http://govuk-frontend-review.herokuapp.com/components/checkboxes/with-error/preview)
528
+ [Preview this example in the Frontend review app](http://govuk-frontend-review.herokuapp.com/components/checkboxes/with-error-message/preview)
441
529
 
442
530
  #### Markup
443
531
 
@@ -446,7 +534,7 @@ Find out when to use the Checkboxes component in your service in the [GOV.UK Des
446
534
  <fieldset class="govuk-fieldset" aria-describedby="waste-error">
447
535
 
448
536
  <legend class="govuk-fieldset__legend">
449
- <h3 class="govuk-heading-m">Which types of waste do you transport regularly?</h3>
537
+ Which types of waste do you transport regularly?
450
538
  </legend>
451
539
 
452
540
  <span id="waste-error" class="govuk-error-message">
@@ -483,7 +571,7 @@ Find out when to use the Checkboxes component in your service in the [GOV.UK Des
483
571
 
484
572
  #### Macro
485
573
 
486
- {% from 'checkboxes/macro.njk' import govukCheckboxes %}
574
+ {% from "checkboxes/macro.njk" import govukCheckboxes %}
487
575
 
488
576
  {{ govukCheckboxes({
489
577
  "name": "waste",
@@ -492,7 +580,7 @@ Find out when to use the Checkboxes component in your service in the [GOV.UK Des
492
580
  },
493
581
  "fieldset": {
494
582
  "legend": {
495
- "html": "<h3 class=\"govuk-heading-m\">Which types of waste do you transport regularly?</h3>"
583
+ "text": "Which types of waste do you transport regularly?"
496
584
  }
497
585
  },
498
586
  "items": [
@@ -57,7 +57,8 @@
57
57
  }
58
58
 
59
59
  .govuk-checkboxes__label {
60
- display: block;
60
+ display: inline-block;
61
+ margin-bottom: 0;
61
62
  padding: 8px $govuk-checkboxes-label-padding-left-right govuk-spacing(1);
62
63
  cursor: pointer;
63
64
  // remove 300ms pause on mobile
@@ -107,6 +108,11 @@
107
108
 
108
109
  // Focused state
109
110
  .govuk-checkboxes__input:focus + .govuk-checkboxes__label::before {
111
+ // Since box-shadows are removed when users customise their colours
112
+ // We set a transparent outline that is shown instead.
113
+ // https://accessibility.blog.gov.uk/2017/03/27/how-users-change-colours-on-websites/
114
+ outline: $govuk-focus-width solid transparent;
115
+ outline-offset: $govuk-focus-width;
110
116
  -webkit-box-shadow: 0 0 0 $govuk-focus-width $govuk-focus-colour;
111
117
  box-shadow: 0 0 0 $govuk-focus-width $govuk-focus-colour;
112
118
  }
@@ -6,13 +6,13 @@ A component for entering dates, for example - date of birth.
6
6
 
7
7
  ## Guidance
8
8
 
9
- Find out when to use the Date input component in your service in the [GOV.UK Design System](https://govuk-design-system-production.cloudapps.digital/components/date-input).
9
+ Find out when to use the date input component in your service in the [GOV.UK Design System](https://design-system.service.gov.uk/components/date-input).
10
10
 
11
11
  ## Quick start examples
12
12
 
13
- ### Component default
13
+ ### Date input
14
14
 
15
- [Preview the date-input component](http://govuk-frontend-review.herokuapp.com/components/date-input/preview)
15
+ [Preview this example in the Frontend review app](http://govuk-frontend-review.herokuapp.com/components/date-input/preview)
16
16
 
17
17
  #### Markup
18
18
 
@@ -29,33 +29,33 @@ Find out when to use the Date input component in your service in the [GOV.UK Des
29
29
 
30
30
  <div class="govuk-date-input" id="dob">
31
31
 
32
- <div class="govuk-date-input__item govuk-date-input__item--day">
32
+ <div class="govuk-date-input__item">
33
33
  <div class="govuk-form-group">
34
34
  <label class="govuk-label govuk-date-input__label" for="dob-day">
35
35
  Day
36
36
  </label>
37
37
 
38
- <input class="govuk-input govuk-date-input__input" id="dob-day" name="dob-day" type="number" pattern="[0-9]*">
38
+ <input class="govuk-input govuk-date-input__input govuk-input--width-2 govuk-input--width-2" id="dob-day" name="dob-day" type="number" pattern="[0-9]*">
39
39
  </div>
40
40
  </div>
41
41
 
42
- <div class="govuk-date-input__item govuk-date-input__item--month">
42
+ <div class="govuk-date-input__item">
43
43
  <div class="govuk-form-group">
44
44
  <label class="govuk-label govuk-date-input__label" for="dob-month">
45
45
  Month
46
46
  </label>
47
47
 
48
- <input class="govuk-input govuk-date-input__input" id="dob-month" name="dob-month" type="number" pattern="[0-9]*">
48
+ <input class="govuk-input govuk-date-input__input govuk-input--width-2 govuk-input--width-2" id="dob-month" name="dob-month" type="number" pattern="[0-9]*">
49
49
  </div>
50
50
  </div>
51
51
 
52
- <div class="govuk-date-input__item govuk-date-input__item--year">
52
+ <div class="govuk-date-input__item">
53
53
  <div class="govuk-form-group">
54
54
  <label class="govuk-label govuk-date-input__label" for="dob-year">
55
55
  Year
56
56
  </label>
57
57
 
58
- <input class="govuk-input govuk-date-input__input" id="dob-year" name="dob-year" type="number" pattern="[0-9]*">
58
+ <input class="govuk-input govuk-date-input__input govuk-input--width-4 govuk-input--width-4" id="dob-year" name="dob-year" type="number" pattern="[0-9]*">
59
59
  </div>
60
60
  </div>
61
61
 
@@ -66,7 +66,7 @@ Find out when to use the Date input component in your service in the [GOV.UK Des
66
66
 
67
67
  #### Macro
68
68
 
69
- {% from 'date-input/macro.njk' import govukDateInput %}
69
+ {% from "date-input/macro.njk" import govukDateInput %}
70
70
 
71
71
  {{ govukDateInput({
72
72
  "id": "dob",
@@ -81,20 +81,23 @@ Find out when to use the Date input component in your service in the [GOV.UK Des
81
81
  },
82
82
  "items": [
83
83
  {
84
- "name": "day"
84
+ "name": "day",
85
+ "classes": "govuk-input--width-2"
85
86
  },
86
87
  {
87
- "name": "month"
88
+ "name": "month",
89
+ "classes": "govuk-input--width-2"
88
90
  },
89
91
  {
90
- "name": "year"
92
+ "name": "year",
93
+ "classes": "govuk-input--width-4"
91
94
  }
92
95
  ]
93
96
  }) }}
94
97
 
95
- ### Date-input--with-errors
98
+ ### Date input with errors
96
99
 
97
- [Preview the date-input--with-errors example](http://govuk-frontend-review.herokuapp.com/components/date-input/with-errors/preview)
100
+ [Preview this example in the Frontend review app](http://govuk-frontend-review.herokuapp.com/components/date-input/with-errors/preview)
98
101
 
99
102
  #### Markup
100
103
 
@@ -115,33 +118,33 @@ Find out when to use the Date input component in your service in the [GOV.UK Des
115
118
 
116
119
  <div class="govuk-date-input" id="dob-errors">
117
120
 
118
- <div class="govuk-date-input__item govuk-date-input__item--day">
121
+ <div class="govuk-date-input__item">
119
122
  <div class="govuk-form-group">
120
123
  <label class="govuk-label govuk-date-input__label" for="dob-errors-day">
121
124
  Day
122
125
  </label>
123
126
 
124
- <input class="govuk-input govuk-date-input__input govuk-input--error" id="dob-errors-day" name="undefined-day" type="number" pattern="[0-9]*">
127
+ <input class="govuk-input govuk-date-input__input govuk-input--width-2 govuk-input--width-2 govuk-input--error" id="dob-errors-day" name="day" type="number" pattern="[0-9]*">
125
128
  </div>
126
129
  </div>
127
130
 
128
- <div class="govuk-date-input__item govuk-date-input__item--month">
131
+ <div class="govuk-date-input__item">
129
132
  <div class="govuk-form-group">
130
133
  <label class="govuk-label govuk-date-input__label" for="dob-errors-month">
131
134
  Month
132
135
  </label>
133
136
 
134
- <input class="govuk-input govuk-date-input__input govuk-input--error" id="dob-errors-month" name="undefined-month" type="number" pattern="[0-9]*">
137
+ <input class="govuk-input govuk-date-input__input govuk-input--width-2 govuk-input--width-2 govuk-input--error" id="dob-errors-month" name="month" type="number" pattern="[0-9]*">
135
138
  </div>
136
139
  </div>
137
140
 
138
- <div class="govuk-date-input__item govuk-date-input__item--year">
141
+ <div class="govuk-date-input__item">
139
142
  <div class="govuk-form-group">
140
143
  <label class="govuk-label govuk-date-input__label" for="dob-errors-year">
141
144
  Year
142
145
  </label>
143
146
 
144
- <input class="govuk-input govuk-date-input__input govuk-input--error" id="dob-errors-year" name="undefined-year" type="number" pattern="[0-9]*">
147
+ <input class="govuk-input govuk-date-input__input govuk-input--width-4 govuk-input--width-4 govuk-input--error" id="dob-errors-year" name="year" type="number" pattern="[0-9]*">
145
148
  </div>
146
149
  </div>
147
150
 
@@ -152,7 +155,7 @@ Find out when to use the Date input component in your service in the [GOV.UK Des
152
155
 
153
156
  #### Macro
154
157
 
155
- {% from 'date-input/macro.njk' import govukDateInput %}
158
+ {% from "date-input/macro.njk" import govukDateInput %}
156
159
 
157
160
  {{ govukDateInput({
158
161
  "id": "dob-errors",
@@ -170,22 +173,22 @@ Find out when to use the Date input component in your service in the [GOV.UK Des
170
173
  "items": [
171
174
  {
172
175
  "name": "day",
173
- "classes": "govuk-input--error"
176
+ "classes": "govuk-input--width-2 govuk-input--error"
174
177
  },
175
178
  {
176
179
  "name": "month",
177
- "classes": "govuk-input--error"
180
+ "classes": "govuk-input--width-2 govuk-input--error"
178
181
  },
179
182
  {
180
183
  "name": "year",
181
- "classes": "govuk-input--error"
184
+ "classes": "govuk-input--width-4 govuk-input--error"
182
185
  }
183
186
  ]
184
187
  }) }}
185
188
 
186
- ### Date-input--with-day-error
189
+ ### Date input with error on day input
187
190
 
188
- [Preview the date-input--with-day-error example](http://govuk-frontend-review.herokuapp.com/components/date-input/with-day-error/preview)
191
+ [Preview this example in the Frontend review app](http://govuk-frontend-review.herokuapp.com/components/date-input/with-error-on-day-input/preview)
189
192
 
190
193
  #### Markup
191
194
 
@@ -206,33 +209,33 @@ Find out when to use the Date input component in your service in the [GOV.UK Des
206
209
 
207
210
  <div class="govuk-date-input" id="dob-day-error">
208
211
 
209
- <div class="govuk-date-input__item govuk-date-input__item--day">
212
+ <div class="govuk-date-input__item">
210
213
  <div class="govuk-form-group">
211
214
  <label class="govuk-label govuk-date-input__label" for="dob-day-error-day">
212
215
  Day
213
216
  </label>
214
217
 
215
- <input class="govuk-input govuk-date-input__input govuk-input--error" id="dob-day-error-day" name="dob-day-error-day" type="number" pattern="[0-9]*">
218
+ <input class="govuk-input govuk-date-input__input govuk-input--width-2 govuk-input--width-2 govuk-input--error" id="dob-day-error-day" name="dob-day-error-day" type="number" pattern="[0-9]*">
216
219
  </div>
217
220
  </div>
218
221
 
219
- <div class="govuk-date-input__item govuk-date-input__item--month">
222
+ <div class="govuk-date-input__item">
220
223
  <div class="govuk-form-group">
221
224
  <label class="govuk-label govuk-date-input__label" for="dob-day-error-month">
222
225
  Month
223
226
  </label>
224
227
 
225
- <input class="govuk-input govuk-date-input__input" id="dob-day-error-month" name="dob-day-error-month" type="number" pattern="[0-9]*">
228
+ <input class="govuk-input govuk-date-input__input govuk-input--width-2 govuk-input--width-2" id="dob-day-error-month" name="dob-day-error-month" type="number" pattern="[0-9]*">
226
229
  </div>
227
230
  </div>
228
231
 
229
- <div class="govuk-date-input__item govuk-date-input__item--year">
232
+ <div class="govuk-date-input__item">
230
233
  <div class="govuk-form-group">
231
234
  <label class="govuk-label govuk-date-input__label" for="dob-day-error-year">
232
235
  Year
233
236
  </label>
234
237
 
235
- <input class="govuk-input govuk-date-input__input" id="dob-day-error-year" name="dob-day-error-year" type="number" pattern="[0-9]*">
238
+ <input class="govuk-input govuk-date-input__input govuk-input--width-4 govuk-input--width-4" id="dob-day-error-year" name="dob-day-error-year" type="number" pattern="[0-9]*">
236
239
  </div>
237
240
  </div>
238
241
 
@@ -243,7 +246,7 @@ Find out when to use the Date input component in your service in the [GOV.UK Des
243
246
 
244
247
  #### Macro
245
248
 
246
- {% from 'date-input/macro.njk' import govukDateInput %}
249
+ {% from "date-input/macro.njk" import govukDateInput %}
247
250
 
248
251
  {{ govukDateInput({
249
252
  "id": "dob-day-error",
@@ -262,20 +265,22 @@ Find out when to use the Date input component in your service in the [GOV.UK Des
262
265
  "items": [
263
266
  {
264
267
  "name": "day",
265
- "classes": "govuk-input--error"
268
+ "classes": "govuk-input--width-2 govuk-input--error"
266
269
  },
267
270
  {
268
- "name": "month"
271
+ "name": "month",
272
+ "classes": "govuk-input--width-2"
269
273
  },
270
274
  {
271
- "name": "year"
275
+ "name": "year",
276
+ "classes": "govuk-input--width-4"
272
277
  }
273
278
  ]
274
279
  }) }}
275
280
 
276
- ### Date-input--with-month-error
281
+ ### Date input with error on month input
277
282
 
278
- [Preview the date-input--with-month-error example](http://govuk-frontend-review.herokuapp.com/components/date-input/with-month-error/preview)
283
+ [Preview this example in the Frontend review app](http://govuk-frontend-review.herokuapp.com/components/date-input/with-error-on-month-input/preview)
279
284
 
280
285
  #### Markup
281
286
 
@@ -296,33 +301,33 @@ Find out when to use the Date input component in your service in the [GOV.UK Des
296
301
 
297
302
  <div class="govuk-date-input" id="dob-month-error">
298
303
 
299
- <div class="govuk-date-input__item govuk-date-input__item--day">
304
+ <div class="govuk-date-input__item">
300
305
  <div class="govuk-form-group">
301
306
  <label class="govuk-label govuk-date-input__label" for="dob-month-error-day">
302
307
  Day
303
308
  </label>
304
309
 
305
- <input class="govuk-input govuk-date-input__input" id="dob-month-error-day" name="dob-month-error-day" type="number" pattern="[0-9]*">
310
+ <input class="govuk-input govuk-date-input__input govuk-input--width-2 govuk-input--width-2" id="dob-month-error-day" name="dob-month-error-day" type="number" pattern="[0-9]*">
306
311
  </div>
307
312
  </div>
308
313
 
309
- <div class="govuk-date-input__item govuk-date-input__item--month">
314
+ <div class="govuk-date-input__item">
310
315
  <div class="govuk-form-group">
311
316
  <label class="govuk-label govuk-date-input__label" for="dob-month-error-month">
312
317
  Month
313
318
  </label>
314
319
 
315
- <input class="govuk-input govuk-date-input__input govuk-input--error" id="dob-month-error-month" name="dob-month-error-month" type="number" pattern="[0-9]*">
320
+ <input class="govuk-input govuk-date-input__input govuk-input--width-2 govuk-input--width-2 govuk-input--error" id="dob-month-error-month" name="dob-month-error-month" type="number" pattern="[0-9]*">
316
321
  </div>
317
322
  </div>
318
323
 
319
- <div class="govuk-date-input__item govuk-date-input__item--year">
324
+ <div class="govuk-date-input__item">
320
325
  <div class="govuk-form-group">
321
326
  <label class="govuk-label govuk-date-input__label" for="dob-month-error-year">
322
327
  Year
323
328
  </label>
324
329
 
325
- <input class="govuk-input govuk-date-input__input" id="dob-month-error-year" name="dob-month-error-year" type="number" pattern="[0-9]*">
330
+ <input class="govuk-input govuk-date-input__input govuk-input--width-4 govuk-input--width-4" id="dob-month-error-year" name="dob-month-error-year" type="number" pattern="[0-9]*">
326
331
  </div>
327
332
  </div>
328
333
 
@@ -333,7 +338,7 @@ Find out when to use the Date input component in your service in the [GOV.UK Des
333
338
 
334
339
  #### Macro
335
340
 
336
- {% from 'date-input/macro.njk' import govukDateInput %}
341
+ {% from "date-input/macro.njk" import govukDateInput %}
337
342
 
338
343
  {{ govukDateInput({
339
344
  "id": "dob-month-error",
@@ -351,21 +356,23 @@ Find out when to use the Date input component in your service in the [GOV.UK Des
351
356
  },
352
357
  "items": [
353
358
  {
354
- "name": "day"
359
+ "name": "day",
360
+ "classes": "govuk-input--width-2"
355
361
  },
356
362
  {
357
363
  "name": "month",
358
- "classes": "govuk-input--error"
364
+ "classes": "govuk-input--width-2 govuk-input--error"
359
365
  },
360
366
  {
361
- "name": "year"
367
+ "name": "year",
368
+ "classes": "govuk-input--width-4"
362
369
  }
363
370
  ]
364
371
  }) }}
365
372
 
366
- ### Date-input--with-year-error
373
+ ### Date input with error on year input
367
374
 
368
- [Preview the date-input--with-year-error example](http://govuk-frontend-review.herokuapp.com/components/date-input/with-year-error/preview)
375
+ [Preview this example in the Frontend review app](http://govuk-frontend-review.herokuapp.com/components/date-input/with-error-on-year-input/preview)
369
376
 
370
377
  #### Markup
371
378
 
@@ -386,33 +393,33 @@ Find out when to use the Date input component in your service in the [GOV.UK Des
386
393
 
387
394
  <div class="govuk-date-input" id="dob-year-error">
388
395
 
389
- <div class="govuk-date-input__item govuk-date-input__item--day">
396
+ <div class="govuk-date-input__item">
390
397
  <div class="govuk-form-group">
391
398
  <label class="govuk-label govuk-date-input__label" for="dob-year-error-day">
392
399
  Day
393
400
  </label>
394
401
 
395
- <input class="govuk-input govuk-date-input__input" id="dob-year-error-day" name="dob-year-error-day" type="number" pattern="[0-9]*">
402
+ <input class="govuk-input govuk-date-input__input govuk-input--width-2 govuk-input--width-2" id="dob-year-error-day" name="dob-year-error-day" type="number" pattern="[0-9]*">
396
403
  </div>
397
404
  </div>
398
405
 
399
- <div class="govuk-date-input__item govuk-date-input__item--month">
406
+ <div class="govuk-date-input__item">
400
407
  <div class="govuk-form-group">
401
408
  <label class="govuk-label govuk-date-input__label" for="dob-year-error-month">
402
409
  Month
403
410
  </label>
404
411
 
405
- <input class="govuk-input govuk-date-input__input" id="dob-year-error-month" name="dob-year-error-month" type="number" pattern="[0-9]*">
412
+ <input class="govuk-input govuk-date-input__input govuk-input--width-2 govuk-input--width-2" id="dob-year-error-month" name="dob-year-error-month" type="number" pattern="[0-9]*">
406
413
  </div>
407
414
  </div>
408
415
 
409
- <div class="govuk-date-input__item govuk-date-input__item--year">
416
+ <div class="govuk-date-input__item">
410
417
  <div class="govuk-form-group">
411
418
  <label class="govuk-label govuk-date-input__label" for="dob-year-error-year">
412
419
  Year
413
420
  </label>
414
421
 
415
- <input class="govuk-input govuk-date-input__input govuk-input--error" id="dob-year-error-year" name="dob-year-error-year" type="number" pattern="[0-9]*">
422
+ <input class="govuk-input govuk-date-input__input govuk-input--width-4 govuk-input--width-4 govuk-input--error" id="dob-year-error-year" name="dob-year-error-year" type="number" pattern="[0-9]*">
416
423
  </div>
417
424
  </div>
418
425
 
@@ -423,7 +430,7 @@ Find out when to use the Date input component in your service in the [GOV.UK Des
423
430
 
424
431
  #### Macro
425
432
 
426
- {% from 'date-input/macro.njk' import govukDateInput %}
433
+ {% from "date-input/macro.njk" import govukDateInput %}
427
434
 
428
435
  {{ govukDateInput({
429
436
  "id": "dob-year-error",
@@ -441,18 +448,91 @@ Find out when to use the Date input component in your service in the [GOV.UK Des
441
448
  },
442
449
  "items": [
443
450
  {
444
- "name": "day"
451
+ "name": "day",
452
+ "classes": "govuk-input--width-2"
445
453
  },
446
454
  {
447
- "name": "month"
455
+ "name": "month",
456
+ "classes": "govuk-input--width-2"
448
457
  },
449
458
  {
450
459
  "name": "year",
451
- "classes": "govuk-input--error"
460
+ "classes": "govuk-input--width-4 govuk-input--error"
452
461
  }
453
462
  ]
454
463
  }) }}
455
464
 
465
+ ### Date input with default items
466
+
467
+ [Preview this example in the Frontend review app](http://govuk-frontend-review.herokuapp.com/components/date-input/with-default-items/preview)
468
+
469
+ #### Markup
470
+
471
+ <div class="govuk-form-group">
472
+ <fieldset class="govuk-fieldset" aria-describedby="dob-hint" role="group">
473
+
474
+ <legend class="govuk-fieldset__legend">
475
+ What is your date of birth?
476
+ </legend>
477
+
478
+ <span id="dob-hint" class="govuk-hint">
479
+ For example, 31 3 1980
480
+ </span>
481
+
482
+ <div class="govuk-date-input" id="dob">
483
+
484
+ <div class="govuk-date-input__item">
485
+ <div class="govuk-form-group">
486
+ <label class="govuk-label govuk-date-input__label" for="dob-day">
487
+ Day
488
+ </label>
489
+
490
+ <input class="govuk-input govuk-date-input__input govuk-input--width-2 govuk-input--width-2" id="dob-day" name="dob-day" type="number" pattern="[0-9]*">
491
+ </div>
492
+ </div>
493
+
494
+ <div class="govuk-date-input__item">
495
+ <div class="govuk-form-group">
496
+ <label class="govuk-label govuk-date-input__label" for="dob-month">
497
+ Month
498
+ </label>
499
+
500
+ <input class="govuk-input govuk-date-input__input govuk-input--width-2 govuk-input--width-2" id="dob-month" name="dob-month" type="number" pattern="[0-9]*">
501
+ </div>
502
+ </div>
503
+
504
+ <div class="govuk-date-input__item">
505
+ <div class="govuk-form-group">
506
+ <label class="govuk-label govuk-date-input__label" for="dob-year">
507
+ Year
508
+ </label>
509
+
510
+ <input class="govuk-input govuk-date-input__input govuk-input--width-4 govuk-input--width-4" id="dob-year" name="dob-year" type="number" pattern="[0-9]*">
511
+ </div>
512
+ </div>
513
+
514
+ </div>
515
+ </fieldset>
516
+
517
+ </div>
518
+
519
+ #### Macro
520
+
521
+ {% from "date-input/macro.njk" import govukDateInput %}
522
+
523
+ {{ govukDateInput({
524
+ "id": "dob",
525
+ "name": "dob",
526
+ "fieldset": {
527
+ "legend": {
528
+ "text": "What is your date of birth?"
529
+ }
530
+ },
531
+ "hint": {
532
+ "text": "For example, 31 3 1980"
533
+ }
534
+ }) }}
535
+
456
536
  ## Requirements
457
537
 
458
538
  ### Build tool configuration