govuk_publishing_components 12.8.0 → 12.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/app/views/govuk_publishing_components/components/_checkboxes.html.erb +1 -0
  3. data/app/views/govuk_publishing_components/components/docs/checkboxes.yml +13 -0
  4. data/lib/govuk_publishing_components/version.rb +1 -1
  5. data/node_modules/govuk-frontend/all.js +161 -1
  6. data/node_modules/govuk-frontend/components/back-link/README.md +3 -77
  7. data/node_modules/govuk-frontend/components/breadcrumbs/README.md +3 -101
  8. data/node_modules/govuk-frontend/components/button/README.md +3 -137
  9. data/node_modules/govuk-frontend/components/character-count/README.md +3 -149
  10. data/node_modules/govuk-frontend/components/character-count/character-count.js +1 -1
  11. data/node_modules/govuk-frontend/components/checkboxes/README.md +3 -257
  12. data/node_modules/govuk-frontend/components/checkboxes/checkboxes.js +1 -1
  13. data/node_modules/govuk-frontend/components/checkboxes/template.njk +5 -0
  14. data/node_modules/govuk-frontend/components/date-input/README.md +3 -173
  15. data/node_modules/govuk-frontend/components/date-input/macro-options.json +14 -0
  16. data/node_modules/govuk-frontend/components/date-input/template.njk +1 -1
  17. data/node_modules/govuk-frontend/components/details/README.md +3 -101
  18. data/node_modules/govuk-frontend/components/error-message/README.md +3 -77
  19. data/node_modules/govuk-frontend/components/error-summary/README.md +3 -125
  20. data/node_modules/govuk-frontend/components/error-summary/error-summary.js +405 -87
  21. data/node_modules/govuk-frontend/components/fieldset/README.md +3 -113
  22. data/node_modules/govuk-frontend/components/file-upload/README.md +3 -125
  23. data/node_modules/govuk-frontend/components/file-upload/macro-options.json +14 -0
  24. data/node_modules/govuk-frontend/components/file-upload/template.njk +1 -1
  25. data/node_modules/govuk-frontend/components/footer/README.md +3 -233
  26. data/node_modules/govuk-frontend/components/header/README.md +3 -197
  27. data/node_modules/govuk-frontend/components/hint/README.md +3 -77
  28. data/node_modules/govuk-frontend/components/input/README.md +3 -137
  29. data/node_modules/govuk-frontend/components/input/macro-options.json +14 -0
  30. data/node_modules/govuk-frontend/components/input/template.njk +1 -1
  31. data/node_modules/govuk-frontend/components/inset-text/README.md +7 -77
  32. data/node_modules/govuk-frontend/components/label/README.md +3 -89
  33. data/node_modules/govuk-frontend/components/panel/README.md +3 -89
  34. data/node_modules/govuk-frontend/components/phase-banner/README.md +3 -77
  35. data/node_modules/govuk-frontend/components/radios/README.md +3 -269
  36. data/node_modules/govuk-frontend/components/radios/radios.js +1 -1
  37. data/node_modules/govuk-frontend/components/select/README.md +3 -185
  38. data/node_modules/govuk-frontend/components/select/macro-options.json +14 -0
  39. data/node_modules/govuk-frontend/components/select/template.njk +1 -1
  40. data/node_modules/govuk-frontend/components/skip-link/README.md +3 -77
  41. data/node_modules/govuk-frontend/components/table/README.md +3 -233
  42. data/node_modules/govuk-frontend/components/tabs/README.md +3 -149
  43. data/node_modules/govuk-frontend/components/tabs/tabs.js +111 -111
  44. data/node_modules/govuk-frontend/components/tag/README.md +3 -65
  45. data/node_modules/govuk-frontend/components/textarea/README.md +3 -149
  46. data/node_modules/govuk-frontend/components/textarea/macro-options.json +14 -0
  47. data/node_modules/govuk-frontend/components/textarea/template.njk +1 -1
  48. data/node_modules/govuk-frontend/components/warning-text/README.md +3 -77
  49. data/node_modules/govuk-frontend/package.json +11 -11
  50. data/node_modules/govuk-frontend/vendor/polyfills/Element/prototype/classList.js +141 -1
  51. data/node_modules/govuk-frontend/vendor/polyfills/Element/prototype/closest.js +54 -0
  52. data/node_modules/govuk-frontend/vendor/polyfills/Element/prototype/matches.js +31 -0
  53. metadata +4 -2
@@ -337,205 +337,11 @@ In order to include the images used in the components, you need to configure you
337
337
 
338
338
  app.use('/assets', express.static(path.join(__dirname, '/node_modules/govuk-frontend/assets')))
339
339
 
340
- ## Component arguments
340
+ ## Component options
341
341
 
342
- If you are using Nunjucks,then macros take the following arguments
342
+ Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
343
343
 
344
- **If you’re using Nunjucks macros in production be aware that using `html` arguments, or ones ending with `Html` can be a [security risk](https://en.wikipedia.org/wiki/Cross-site_scripting). More about it in the [Nunjucks documentation](https://mozilla.github.io/nunjucks/api.html#user-defined-templates-warning).**
345
-
346
- <table class="govuk-table">
347
-
348
- <thead class="govuk-table__head">
349
-
350
- <tr class="govuk-table__row">
351
-
352
- <th class="govuk-table__header" scope="col">Name</th>
353
-
354
- <th class="govuk-table__header" scope="col">Type</th>
355
-
356
- <th class="govuk-table__header" scope="col">Required</th>
357
-
358
- <th class="govuk-table__header" scope="col">Description</th>
359
-
360
- </tr>
361
-
362
- </thead>
363
-
364
- <tbody class="govuk-table__body">
365
-
366
- <tr class="govuk-table__row">
367
-
368
- <th class="govuk-table__header" scope="row">homepageUrl</th>
369
-
370
- <td class="govuk-table__cell">string</td>
371
-
372
- <td class="govuk-table__cell">No</td>
373
-
374
- <td class="govuk-table__cell">The url of the homepage. Defaults to /</td>
375
-
376
- </tr>
377
-
378
- <tr class="govuk-table__row">
379
-
380
- <th class="govuk-table__header" scope="row">assetsPath</th>
381
-
382
- <td class="govuk-table__cell">string</td>
383
-
384
- <td class="govuk-table__cell">No</td>
385
-
386
- <td class="govuk-table__cell">The public path for the assets folder. If not provided it defaults to /assets/images</td>
387
-
388
- </tr>
389
-
390
- <tr class="govuk-table__row">
391
-
392
- <th class="govuk-table__header" scope="row">productName</th>
393
-
394
- <td class="govuk-table__cell">string</td>
395
-
396
- <td class="govuk-table__cell">No</td>
397
-
398
- <td class="govuk-table__cell">Header title that is placed next to GOV.UK. Used for product names (i.e. Pay, Verify)</td>
399
-
400
- </tr>
401
-
402
- <tr class="govuk-table__row">
403
-
404
- <th class="govuk-table__header" scope="row">serviceName</th>
405
-
406
- <td class="govuk-table__cell">string</td>
407
-
408
- <td class="govuk-table__cell">No</td>
409
-
410
- <td class="govuk-table__cell">Header title that is placed next to GOV.UK. Used for product names (i.e. Pay, Verify)</td>
411
-
412
- </tr>
413
-
414
- <tr class="govuk-table__row">
415
-
416
- <th class="govuk-table__header" scope="row">serviceUrl</th>
417
-
418
- <td class="govuk-table__cell">string</td>
419
-
420
- <td class="govuk-table__cell">No</td>
421
-
422
- <td class="govuk-table__cell">Url for the service name anchor.</td>
423
-
424
- </tr>
425
-
426
- <tr class="govuk-table__row">
427
-
428
- <th class="govuk-table__header" scope="row">navigation</th>
429
-
430
- <td class="govuk-table__cell">array</td>
431
-
432
- <td class="govuk-table__cell">No</td>
433
-
434
- <td class="govuk-table__cell">An array of navigation item objects.</td>
435
-
436
- </tr>
437
-
438
- <tr class="govuk-table__row">
439
-
440
- <th class="govuk-table__header" scope="row">navigation.{}.text</th>
441
-
442
- <td class="govuk-table__cell">string</td>
443
-
444
- <td class="govuk-table__cell">No</td>
445
-
446
- <td class="govuk-table__cell">Text of the navigation item.</td>
447
-
448
- </tr>
449
-
450
- <tr class="govuk-table__row">
451
-
452
- <th class="govuk-table__header" scope="row">navigation.{}.href</th>
453
-
454
- <td class="govuk-table__cell">string</td>
455
-
456
- <td class="govuk-table__cell">No</td>
457
-
458
- <td class="govuk-table__cell">Url of the navigation item anchor. Both `href` and `text` attributes for navigation items need to be provided to create an item.</td>
459
-
460
- </tr>
461
-
462
- <tr class="govuk-table__row">
463
-
464
- <th class="govuk-table__header" scope="row">navigation.{}.active</th>
465
-
466
- <td class="govuk-table__cell">boolean</td>
467
-
468
- <td class="govuk-table__cell">No</td>
469
-
470
- <td class="govuk-table__cell">Flag to mark the navigation item as active or not.</td>
471
-
472
- </tr>
473
-
474
- <tr class="govuk-table__row">
475
-
476
- <th class="govuk-table__header" scope="row">navigation.{}.attributes</th>
477
-
478
- <td class="govuk-table__cell">object</td>
479
-
480
- <td class="govuk-table__cell">No</td>
481
-
482
- <td class="govuk-table__cell">Any extra HTML attributes (for example data attributes) to add to the navigation item anchor.</td>
483
-
484
- </tr>
485
-
486
- <tr class="govuk-table__row">
487
-
488
- <th class="govuk-table__header" scope="row">navigationClasses</th>
489
-
490
- <td class="govuk-table__cell">string</td>
491
-
492
- <td class="govuk-table__cell">No</td>
493
-
494
- <td class="govuk-table__cell">Optional classes that can be added to the navigation section of the header.</td>
495
-
496
- </tr>
497
-
498
- <tr class="govuk-table__row">
499
-
500
- <th class="govuk-table__header" scope="row">containerClasses</th>
501
-
502
- <td class="govuk-table__cell">string</td>
503
-
504
- <td class="govuk-table__cell">No</td>
505
-
506
- <td class="govuk-table__cell">Optional classes that can be added to the container, useful if you want to make the header fixed width.</td>
507
-
508
- </tr>
509
-
510
- <tr class="govuk-table__row">
511
-
512
- <th class="govuk-table__header" scope="row">classes</th>
513
-
514
- <td class="govuk-table__cell">string</td>
515
-
516
- <td class="govuk-table__cell">No</td>
517
-
518
- <td class="govuk-table__cell">Optional additional classes to add to the header container.</td>
519
-
520
- </tr>
521
-
522
- <tr class="govuk-table__row">
523
-
524
- <th class="govuk-table__header" scope="row">attributes</th>
525
-
526
- <td class="govuk-table__cell">object</td>
527
-
528
- <td class="govuk-table__cell">No</td>
529
-
530
- <td class="govuk-table__cell">Any extra HTML attributes (for example data attributes) to add to the header container.</td>
531
-
532
- </tr>
533
-
534
- </tbody>
535
-
536
- </table>
537
-
538
- **If you’re using Nunjucks macros in production be aware that using `html` arguments, or ones ending with `Html` can be a [security risk](https://en.wikipedia.org/wiki/Cross-site_scripting). More about it in the [Nunjucks documentation](https://mozilla.github.io/nunjucks/api.html#user-defined-templates-warning).**
344
+ See [options table](https://design-system.service.gov.uk/components/header/#options-example-default) for details.
539
345
 
540
346
  ### Setting up Nunjucks views and paths
541
347
 
@@ -62,85 +62,11 @@ In order to include the images used in the components, you need to configure you
62
62
 
63
63
  app.use('/assets', express.static(path.join(__dirname, '/node_modules/govuk-frontend/assets')))
64
64
 
65
- ## Component arguments
65
+ ## Component options
66
66
 
67
- If you are using Nunjucks,then macros take the following arguments
67
+ Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
68
68
 
69
- **If you’re using Nunjucks macros in production be aware that using `html` arguments, or ones ending with `Html` can be a [security risk](https://en.wikipedia.org/wiki/Cross-site_scripting). More about it in the [Nunjucks documentation](https://mozilla.github.io/nunjucks/api.html#user-defined-templates-warning).**
70
-
71
- <table class="govuk-table">
72
-
73
- <thead class="govuk-table__head">
74
-
75
- <tr class="govuk-table__row">
76
-
77
- <th class="govuk-table__header" scope="col">Name</th>
78
-
79
- <th class="govuk-table__header" scope="col">Type</th>
80
-
81
- <th class="govuk-table__header" scope="col">Required</th>
82
-
83
- <th class="govuk-table__header" scope="col">Description</th>
84
-
85
- </tr>
86
-
87
- </thead>
88
-
89
- <tbody class="govuk-table__body">
90
-
91
- <tr class="govuk-table__row">
92
-
93
- <th class="govuk-table__header" scope="row">text or (html) html</th>
94
-
95
- <td class="govuk-table__cell">string</td>
96
-
97
- <td class="govuk-table__cell">Yes</td>
98
-
99
- <td class="govuk-table__cell">Text or HTML to use within the hint. If `html` is provided, the `text` argument will be ignored.</td>
100
-
101
- </tr>
102
-
103
- <tr class="govuk-table__row">
104
-
105
- <th class="govuk-table__header" scope="row">id</th>
106
-
107
- <td class="govuk-table__cell">string</td>
108
-
109
- <td class="govuk-table__cell">Yes</td>
110
-
111
- <td class="govuk-table__cell">Optional id attribute o add to the hint span tag.</td>
112
-
113
- </tr>
114
-
115
- <tr class="govuk-table__row">
116
-
117
- <th class="govuk-table__header" scope="row">classes</th>
118
-
119
- <td class="govuk-table__cell">string</td>
120
-
121
- <td class="govuk-table__cell">No</td>
122
-
123
- <td class="govuk-table__cell">Optional additional classes to add to the hint span tag.</td>
124
-
125
- </tr>
126
-
127
- <tr class="govuk-table__row">
128
-
129
- <th class="govuk-table__header" scope="row">attributes</th>
130
-
131
- <td class="govuk-table__cell">object</td>
132
-
133
- <td class="govuk-table__cell">No</td>
134
-
135
- <td class="govuk-table__cell">Any extra HTML attributes (for example data attributes) to add to the hint span tag.</td>
136
-
137
- </tr>
138
-
139
- </tbody>
140
-
141
- </table>
142
-
143
- **If you’re using Nunjucks macros in production be aware that using `html` arguments, or ones ending with `Html` can be a [security risk](https://en.wikipedia.org/wiki/Cross-site_scripting). More about it in the [Nunjucks documentation](https://mozilla.github.io/nunjucks/api.html#user-defined-templates-warning).**
69
+ See [options table](https://design-system.service.gov.uk/components/file-upload/#options-example-default--hint) for details.
144
70
 
145
71
  ### Setting up Nunjucks views and paths
146
72
 
@@ -393,145 +393,11 @@ In order to include the images used in the components, you need to configure you
393
393
 
394
394
  app.use('/assets', express.static(path.join(__dirname, '/node_modules/govuk-frontend/assets')))
395
395
 
396
- ## Component arguments
396
+ ## Component options
397
397
 
398
- If you are using Nunjucks,then macros take the following arguments
398
+ Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
399
399
 
400
- **If you’re using Nunjucks macros in production be aware that using `html` arguments, or ones ending with `Html` can be a [security risk](https://en.wikipedia.org/wiki/Cross-site_scripting). More about it in the [Nunjucks documentation](https://mozilla.github.io/nunjucks/api.html#user-defined-templates-warning).**
401
-
402
- <table class="govuk-table">
403
-
404
- <thead class="govuk-table__head">
405
-
406
- <tr class="govuk-table__row">
407
-
408
- <th class="govuk-table__header" scope="col">Name</th>
409
-
410
- <th class="govuk-table__header" scope="col">Type</th>
411
-
412
- <th class="govuk-table__header" scope="col">Required</th>
413
-
414
- <th class="govuk-table__header" scope="col">Description</th>
415
-
416
- </tr>
417
-
418
- </thead>
419
-
420
- <tbody class="govuk-table__body">
421
-
422
- <tr class="govuk-table__row">
423
-
424
- <th class="govuk-table__header" scope="row">id</th>
425
-
426
- <td class="govuk-table__cell">string</td>
427
-
428
- <td class="govuk-table__cell">Yes</td>
429
-
430
- <td class="govuk-table__cell">The id of the input.</td>
431
-
432
- </tr>
433
-
434
- <tr class="govuk-table__row">
435
-
436
- <th class="govuk-table__header" scope="row">name</th>
437
-
438
- <td class="govuk-table__cell">string</td>
439
-
440
- <td class="govuk-table__cell">Yes</td>
441
-
442
- <td class="govuk-table__cell">The name of the input, which is submitted with the form data.</td>
443
-
444
- </tr>
445
-
446
- <tr class="govuk-table__row">
447
-
448
- <th class="govuk-table__header" scope="row">type</th>
449
-
450
- <td class="govuk-table__cell">string</td>
451
-
452
- <td class="govuk-table__cell">No</td>
453
-
454
- <td class="govuk-table__cell">Type of input control to render. Defaults to "text".</td>
455
-
456
- </tr>
457
-
458
- <tr class="govuk-table__row">
459
-
460
- <th class="govuk-table__header" scope="row">value</th>
461
-
462
- <td class="govuk-table__cell">string</td>
463
-
464
- <td class="govuk-table__cell">No</td>
465
-
466
- <td class="govuk-table__cell">Optional initial value of the input.</td>
467
-
468
- </tr>
469
-
470
- <tr class="govuk-table__row">
471
-
472
- <th class="govuk-table__header" scope="row">label</th>
473
-
474
- <td class="govuk-table__cell">object</td>
475
-
476
- <td class="govuk-table__cell">No</td>
477
-
478
- <td class="govuk-table__cell">Arguments for the label component. See <a href="../label/README.md#component-arguments">label</a> component.</td>
479
-
480
- </tr>
481
-
482
- <tr class="govuk-table__row">
483
-
484
- <th class="govuk-table__header" scope="row">hint</th>
485
-
486
- <td class="govuk-table__cell">object</td>
487
-
488
- <td class="govuk-table__cell">No</td>
489
-
490
- <td class="govuk-table__cell">Arguments for the hint component (e.g. text). See <a href="../hint/README.md#component-arguments">hint</a> component.</td>
491
-
492
- </tr>
493
-
494
- <tr class="govuk-table__row">
495
-
496
- <th class="govuk-table__header" scope="row">errorMessage</th>
497
-
498
- <td class="govuk-table__cell">object</td>
499
-
500
- <td class="govuk-table__cell">No</td>
501
-
502
- <td class="govuk-table__cell">Arguments for the errorMessage component (e.g. text). See <a href="../error-message/README.md#component-arguments">errorMessage</a> component.</td>
503
-
504
- </tr>
505
-
506
- <tr class="govuk-table__row">
507
-
508
- <th class="govuk-table__header" scope="row">classes</th>
509
-
510
- <td class="govuk-table__cell">string</td>
511
-
512
- <td class="govuk-table__cell">No</td>
513
-
514
- <td class="govuk-table__cell">Optional additional classes add to the input component.</td>
515
-
516
- </tr>
517
-
518
- <tr class="govuk-table__row">
519
-
520
- <th class="govuk-table__header" scope="row">attributes</th>
521
-
522
- <td class="govuk-table__cell">object</td>
523
-
524
- <td class="govuk-table__cell">No</td>
525
-
526
- <td class="govuk-table__cell">Any extra HTML attributes (for example data attributes) to add to the input component.</td>
527
-
528
- </tr>
529
-
530
- </tbody>
531
-
532
- </table>
533
-
534
- **If you’re using Nunjucks macros in production be aware that using `html` arguments, or ones ending with `Html` can be a [security risk](https://en.wikipedia.org/wiki/Cross-site_scripting). More about it in the [Nunjucks documentation](https://mozilla.github.io/nunjucks/api.html#user-defined-templates-warning).**
400
+ See [options table](https://design-system.service.gov.uk/components/text-input/#options-example-default) for details.
535
401
 
536
402
  ### Setting up Nunjucks views and paths
537
403
 
@@ -37,6 +37,20 @@
37
37
  "description": "Options for the errorMessage component.",
38
38
  "isComponent": true
39
39
  },
40
+ {
41
+ "name": "formGroup",
42
+ "type": "object",
43
+ "required": false,
44
+ "description": "Options for the form-group wrapper",
45
+ "params": [
46
+ {
47
+ "name": "classes",
48
+ "type": "string",
49
+ "required": false,
50
+ "description": "Optional classes to add to the form group (e.g. to show error state for the whole group)"
51
+ }
52
+ ]
53
+ },
40
54
  {
41
55
  "name": "classes",
42
56
  "type": "string",