govuk_publishing_components 12.8.0 → 12.9.0

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -78,121 +78,11 @@ In order to include the images used in the components, you need to configure you
78
78
 
79
79
  app.use('/assets', express.static(path.join(__dirname, '/node_modules/govuk-frontend/assets')))
80
80
 
81
- ## Component arguments
81
+ ## Component options
82
82
 
83
- If you are using Nunjucks,then macros take the following arguments
83
+ Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
84
84
 
85
- **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).**
86
-
87
- <table class="govuk-table">
88
-
89
- <thead class="govuk-table__head">
90
-
91
- <tr class="govuk-table__row">
92
-
93
- <th class="govuk-table__header" scope="col">Name</th>
94
-
95
- <th class="govuk-table__header" scope="col">Type</th>
96
-
97
- <th class="govuk-table__header" scope="col">Required</th>
98
-
99
- <th class="govuk-table__header" scope="col">Description</th>
100
-
101
- </tr>
102
-
103
- </thead>
104
-
105
- <tbody class="govuk-table__body">
106
-
107
- <tr class="govuk-table__row">
108
-
109
- <th class="govuk-table__header" scope="row">describedBy</th>
110
-
111
- <td class="govuk-table__cell">string</td>
112
-
113
- <td class="govuk-table__cell">No</td>
114
-
115
- <td class="govuk-table__cell">Text or element id to add to the `aria-describedby` attribute to provide description of the group of fields for screenreader users.</td>
116
-
117
- </tr>
118
-
119
- <tr class="govuk-table__row">
120
-
121
- <th class="govuk-table__header" scope="row">legend</th>
122
-
123
- <td class="govuk-table__cell">object</td>
124
-
125
- <td class="govuk-table__cell">No</td>
126
-
127
- <td class="govuk-table__cell">Arguments for the legend</td>
128
-
129
- </tr>
130
-
131
- <tr class="govuk-table__row">
132
-
133
- <th class="govuk-table__header" scope="row">legend.{}.text (or) legend.{}.html</th>
134
-
135
- <td class="govuk-table__cell">string</td>
136
-
137
- <td class="govuk-table__cell">No</td>
138
-
139
- <td class="govuk-table__cell">Legend text or HTML. If `html` is provided, the `text` argument will be ignored.</td>
140
-
141
- </tr>
142
-
143
- <tr class="govuk-table__row">
144
-
145
- <th class="govuk-table__header" scope="row">legend.{}.classes</th>
146
-
147
- <td class="govuk-table__cell">string</td>
148
-
149
- <td class="govuk-table__cell">No</td>
150
-
151
- <td class="govuk-table__cell">Optional additional classes to add to the legend container.</td>
152
-
153
- </tr>
154
-
155
- <tr class="govuk-table__row">
156
-
157
- <th class="govuk-table__header" scope="row">legend.{}.isPageHeading</th>
158
-
159
- <td class="govuk-table__cell">boolean</td>
160
-
161
- <td class="govuk-table__cell">No</td>
162
-
163
- <td class="govuk-table__cell">Whether the legend also acts as the heading for the page.</td>
164
-
165
- </tr>
166
-
167
- <tr class="govuk-table__row">
168
-
169
- <th class="govuk-table__header" scope="row">classes</th>
170
-
171
- <td class="govuk-table__cell">string</td>
172
-
173
- <td class="govuk-table__cell">No</td>
174
-
175
- <td class="govuk-table__cell">Optional additional classes to add to the fieldset container.</td>
176
-
177
- </tr>
178
-
179
- <tr class="govuk-table__row">
180
-
181
- <th class="govuk-table__header" scope="row">attributes</th>
182
-
183
- <td class="govuk-table__cell">object</td>
184
-
185
- <td class="govuk-table__cell">No</td>
186
-
187
- <td class="govuk-table__cell">Any extra HTML attributes (for example data attributes) to add to the fieldset container.</td>
188
-
189
- </tr>
190
-
191
- </tbody>
192
-
193
- </table>
194
-
195
- **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).**
85
+ See [options table](https://design-system.service.gov.uk/components/fieldset/#options-example-default) for details.
196
86
 
197
87
  ### Setting up Nunjucks views and paths
198
88
 
@@ -185,133 +185,11 @@ In order to include the images used in the components, you need to configure you
185
185
 
186
186
  app.use('/assets', express.static(path.join(__dirname, '/node_modules/govuk-frontend/assets')))
187
187
 
188
- ## Component arguments
188
+ ## Component options
189
189
 
190
- If you are using Nunjucks,then macros take the following arguments
190
+ Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
191
191
 
192
- **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).**
193
-
194
- <table class="govuk-table">
195
-
196
- <thead class="govuk-table__head">
197
-
198
- <tr class="govuk-table__row">
199
-
200
- <th class="govuk-table__header" scope="col">Name</th>
201
-
202
- <th class="govuk-table__header" scope="col">Type</th>
203
-
204
- <th class="govuk-table__header" scope="col">Required</th>
205
-
206
- <th class="govuk-table__header" scope="col">Description</th>
207
-
208
- </tr>
209
-
210
- </thead>
211
-
212
- <tbody class="govuk-table__body">
213
-
214
- <tr class="govuk-table__row">
215
-
216
- <th class="govuk-table__header" scope="row">name</th>
217
-
218
- <td class="govuk-table__cell">string</td>
219
-
220
- <td class="govuk-table__cell">Yes</td>
221
-
222
- <td class="govuk-table__cell">The name of the input, which is submitted with the form data.</td>
223
-
224
- </tr>
225
-
226
- <tr class="govuk-table__row">
227
-
228
- <th class="govuk-table__header" scope="row">id</th>
229
-
230
- <td class="govuk-table__cell">string</td>
231
-
232
- <td class="govuk-table__cell">Yes</td>
233
-
234
- <td class="govuk-table__cell">The id of the input</td>
235
-
236
- </tr>
237
-
238
- <tr class="govuk-table__row">
239
-
240
- <th class="govuk-table__header" scope="row">value</th>
241
-
242
- <td class="govuk-table__cell">string</td>
243
-
244
- <td class="govuk-table__cell">No</td>
245
-
246
- <td class="govuk-table__cell">Optional initial value of the input</td>
247
-
248
- </tr>
249
-
250
- <tr class="govuk-table__row">
251
-
252
- <th class="govuk-table__header" scope="row">label</th>
253
-
254
- <td class="govuk-table__cell">object</td>
255
-
256
- <td class="govuk-table__cell">Yes</td>
257
-
258
- <td class="govuk-table__cell">Arguments for the label component. See <a href="../label/README.md#component-arguments">label</a> component.</td>
259
-
260
- </tr>
261
-
262
- <tr class="govuk-table__row">
263
-
264
- <th class="govuk-table__header" scope="row">hint</th>
265
-
266
- <td class="govuk-table__cell">object</td>
267
-
268
- <td class="govuk-table__cell">No</td>
269
-
270
- <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>
271
-
272
- </tr>
273
-
274
- <tr class="govuk-table__row">
275
-
276
- <th class="govuk-table__header" scope="row">errorMessage</th>
277
-
278
- <td class="govuk-table__cell">object</td>
279
-
280
- <td class="govuk-table__cell">No</td>
281
-
282
- <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>
283
-
284
- </tr>
285
-
286
- <tr class="govuk-table__row">
287
-
288
- <th class="govuk-table__header" scope="row">classes</th>
289
-
290
- <td class="govuk-table__cell">string</td>
291
-
292
- <td class="govuk-table__cell">No</td>
293
-
294
- <td class="govuk-table__cell">Optional additional classes to add to the input tag.</td>
295
-
296
- </tr>
297
-
298
- <tr class="govuk-table__row">
299
-
300
- <th class="govuk-table__header" scope="row">attributes</th>
301
-
302
- <td class="govuk-table__cell">object</td>
303
-
304
- <td class="govuk-table__cell">No</td>
305
-
306
- <td class="govuk-table__cell">Any extra HTML attributes (for example accept or data attributes) to add to the input tag.</td>
307
-
308
- </tr>
309
-
310
- </tbody>
311
-
312
- </table>
313
-
314
- **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).**
192
+ See [options table](https://design-system.service.gov.uk/components/file-upload/#options-example-default) for details.
315
193
 
316
194
  ### Setting up Nunjucks views and paths
317
195
 
@@ -38,6 +38,20 @@
38
38
  "description": "Options for the errorMessage component.",
39
39
  "isComponent": true
40
40
  },
41
+ {
42
+ "name": "formGroup",
43
+ "type": "object",
44
+ "required": false,
45
+ "description": "Options for the form-group wrapper",
46
+ "params": [
47
+ {
48
+ "name": "classes",
49
+ "type": "string",
50
+ "required": false,
51
+ "description": "Optional classes to add to the form group (e.g. to show error state for the whole group)"
52
+ }
53
+ ]
54
+ },
41
55
  {
42
56
  "name": "classes",
43
57
  "type": "string",
@@ -5,7 +5,7 @@
5
5
  {#- a record of other elements that we need to associate with the input using
6
6
  aria-describedby – for example hints or error messages -#}
7
7
  {% set describedBy = "" %}
8
- <div class="govuk-form-group {%- if params.errorMessage %} govuk-form-group--error{% endif %}">
8
+ <div class="govuk-form-group {%- if params.errorMessage %} govuk-form-group--error{% endif %} {%- if params.formGroup.classes %} {{ params.formGroup.classes }}{% endif %}">
9
9
  {{ govukLabel({
10
10
  html: params.label.html,
11
11
  text: params.label.text,
@@ -77,241 +77,11 @@ In order to include the images used in the components, you need to configure you
77
77
 
78
78
  app.use('/assets', express.static(path.join(__dirname, '/node_modules/govuk-frontend/assets')))
79
79
 
80
- ## Component arguments
80
+ ## Component options
81
81
 
82
- If you are using Nunjucks,then macros take the following arguments
82
+ Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
83
83
 
84
- **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).**
85
-
86
- <table class="govuk-table">
87
-
88
- <thead class="govuk-table__head">
89
-
90
- <tr class="govuk-table__row">
91
-
92
- <th class="govuk-table__header" scope="col">Name</th>
93
-
94
- <th class="govuk-table__header" scope="col">Type</th>
95
-
96
- <th class="govuk-table__header" scope="col">Required</th>
97
-
98
- <th class="govuk-table__header" scope="col">Description</th>
99
-
100
- </tr>
101
-
102
- </thead>
103
-
104
- <tbody class="govuk-table__body">
105
-
106
- <tr class="govuk-table__row">
107
-
108
- <th class="govuk-table__header" scope="row">meta</th>
109
-
110
- <td class="govuk-table__cell">object</td>
111
-
112
- <td class="govuk-table__cell">No</td>
113
-
114
- <td class="govuk-table__cell">Object containing parameters for the meta navigation.</td>
115
-
116
- </tr>
117
-
118
- <tr class="govuk-table__row">
119
-
120
- <th class="govuk-table__header" scope="row">meta.text</th>
121
-
122
- <td class="govuk-table__cell">string</td>
123
-
124
- <td class="govuk-table__cell">No</td>
125
-
126
- <td class="govuk-table__cell">Text to add to the meta section of the footer, which will appear below any links specified using meta.items. If meta.html is specified, this option is ignored.</td>
127
-
128
- </tr>
129
-
130
- <tr class="govuk-table__row">
131
-
132
- <th class="govuk-table__header" scope="row">meta.html</th>
133
-
134
- <td class="govuk-table__cell">string</td>
135
-
136
- <td class="govuk-table__cell">No</td>
137
-
138
- <td class="govuk-table__cell">HTML to add to the meta section of the footer, which will appear below any links specified using meta.items. If you do not need to use HTML, use meta.text instead.</td>
139
-
140
- </tr>
141
-
142
- <tr class="govuk-table__row">
143
-
144
- <th class="govuk-table__header" scope="row">meta.items</th>
145
-
146
- <td class="govuk-table__cell">array</td>
147
-
148
- <td class="govuk-table__cell">No</td>
149
-
150
- <td class="govuk-table__cell">Array of items for use in the meta section of the footer.</td>
151
-
152
- </tr>
153
-
154
- <tr class="govuk-table__row">
155
-
156
- <th class="govuk-table__header" scope="row">meta.items.{}.text</th>
157
-
158
- <td class="govuk-table__cell">string</td>
159
-
160
- <td class="govuk-table__cell">No</td>
161
-
162
- <td class="govuk-table__cell">List item text in the meta section of the footer.</td>
163
-
164
- </tr>
165
-
166
- <tr class="govuk-table__row">
167
-
168
- <th class="govuk-table__header" scope="row">meta.items.{}.href</th>
169
-
170
- <td class="govuk-table__cell">string</td>
171
-
172
- <td class="govuk-table__cell">No</td>
173
-
174
- <td class="govuk-table__cell">List item href attribute in the meta section of the footer.</td>
175
-
176
- </tr>
177
-
178
- <tr class="govuk-table__row">
179
-
180
- <th class="govuk-table__header" scope="row">meta.items.{}.attributes</th>
181
-
182
- <td class="govuk-table__cell">object</td>
183
-
184
- <td class="govuk-table__cell">No</td>
185
-
186
- <td class="govuk-table__cell">Any extra HTML attributes (for example data attributes) to add to the anchor in the footer meta section.</td>
187
-
188
- </tr>
189
-
190
- <tr class="govuk-table__row">
191
-
192
- <th class="govuk-table__header" scope="row">navigation</th>
193
-
194
- <td class="govuk-table__cell">array</td>
195
-
196
- <td class="govuk-table__cell">No</td>
197
-
198
- <td class="govuk-table__cell">Array of items for use in the navigation section of the footer.</td>
199
-
200
- </tr>
201
-
202
- <tr class="govuk-table__row">
203
-
204
- <th class="govuk-table__header" scope="row">navigation.{}.title</th>
205
-
206
- <td class="govuk-table__cell">string</td>
207
-
208
- <td class="govuk-table__cell">No</td>
209
-
210
- <td class="govuk-table__cell">Title for a section</td>
211
-
212
- </tr>
213
-
214
- <tr class="govuk-table__row">
215
-
216
- <th class="govuk-table__header" scope="row">navigation.{}.columns</th>
217
-
218
- <td class="govuk-table__cell">integer</td>
219
-
220
- <td class="govuk-table__cell">No</td>
221
-
222
- <td class="govuk-table__cell">Amount of columns to display items in navigation section of the footer.</td>
223
-
224
- </tr>
225
-
226
- <tr class="govuk-table__row">
227
-
228
- <th class="govuk-table__header" scope="row">navigation.items</th>
229
-
230
- <td class="govuk-table__cell">array</td>
231
-
232
- <td class="govuk-table__cell">No</td>
233
-
234
- <td class="govuk-table__cell">Array of items to display in the list in navigation section of the footer.</td>
235
-
236
- </tr>
237
-
238
- <tr class="govuk-table__row">
239
-
240
- <th class="govuk-table__header" scope="row">navigation.items.{}.text</th>
241
-
242
- <td class="govuk-table__cell">string</td>
243
-
244
- <td class="govuk-table__cell">No</td>
245
-
246
- <td class="govuk-table__cell">List item text in the navigation section of the footer.</td>
247
-
248
- </tr>
249
-
250
- <tr class="govuk-table__row">
251
-
252
- <th class="govuk-table__header" scope="row">navigation.items.{}.href</th>
253
-
254
- <td class="govuk-table__cell">string</td>
255
-
256
- <td class="govuk-table__cell">No</td>
257
-
258
- <td class="govuk-table__cell">List item href attribute in the navigation section of the footer. Both `text` and `href` attributes need to be present to create a link.</td>
259
-
260
- </tr>
261
-
262
- <tr class="govuk-table__row">
263
-
264
- <th class="govuk-table__header" scope="row">navigation.items.{}.attributes</th>
265
-
266
- <td class="govuk-table__cell">object</td>
267
-
268
- <td class="govuk-table__cell">No</td>
269
-
270
- <td class="govuk-table__cell">Any extra HTML attributes (for example data attributes) to add to the anchor in the footer navigation section.</td>
271
-
272
- </tr>
273
-
274
- <tr class="govuk-table__row">
275
-
276
- <th class="govuk-table__header" scope="row">containerClasses</th>
277
-
278
- <td class="govuk-table__cell">string</td>
279
-
280
- <td class="govuk-table__cell">No</td>
281
-
282
- <td class="govuk-table__cell">Classes that can be added to the inner container, useful if you want to make the footer full width.</td>
283
-
284
- </tr>
285
-
286
- <tr class="govuk-table__row">
287
-
288
- <th class="govuk-table__header" scope="row">classes</th>
289
-
290
- <td class="govuk-table__cell">string</td>
291
-
292
- <td class="govuk-table__cell">No</td>
293
-
294
- <td class="govuk-table__cell">Optional additional classes to add to the footer component container.</td>
295
-
296
- </tr>
297
-
298
- <tr class="govuk-table__row">
299
-
300
- <th class="govuk-table__header" scope="row">attributes</th>
301
-
302
- <td class="govuk-table__cell">object</td>
303
-
304
- <td class="govuk-table__cell">No</td>
305
-
306
- <td class="govuk-table__cell">Any extra HTML attributes (for example data attributes) to add to the footer component container.</td>
307
-
308
- </tr>
309
-
310
- </tbody>
311
-
312
- </table>
313
-
314
- **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).**
84
+ See [options table](https://design-system.service.gov.uk/components/footer/#options-example-default) for details.
315
85
 
316
86
  ### Setting up Nunjucks views and paths
317
87