govuk_publishing_components 29.15.0 → 29.15.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +17 -22
  3. data/app/models/govuk_publishing_components/audit_applications.rb +31 -9
  4. data/app/models/govuk_publishing_components/audit_comparer.rb +15 -9
  5. data/app/views/govuk_publishing_components/audit/_components.html.erb +20 -2
  6. data/app/views/govuk_publishing_components/components/_table.html.erb +3 -2
  7. data/app/views/govuk_publishing_components/components/docs/back_link.yml +1 -1
  8. data/app/views/govuk_publishing_components/components/docs/big_number.yml +2 -2
  9. data/app/views/govuk_publishing_components/components/docs/breadcrumbs.yml +2 -2
  10. data/app/views/govuk_publishing_components/components/docs/button.yml +41 -40
  11. data/app/views/govuk_publishing_components/components/docs/cards.yml +2 -0
  12. data/app/views/govuk_publishing_components/components/docs/checkboxes.yml +216 -216
  13. data/app/views/govuk_publishing_components/components/docs/cookie_banner.yml +2 -1
  14. data/app/views/govuk_publishing_components/components/docs/copy_to_clipboard.yml +2 -2
  15. data/app/views/govuk_publishing_components/components/docs/details.yml +5 -1
  16. data/app/views/govuk_publishing_components/components/docs/document_list.yml +1 -2
  17. data/app/views/govuk_publishing_components/components/docs/error_alert.yml +4 -0
  18. data/app/views/govuk_publishing_components/components/docs/error_summary.yml +4 -6
  19. data/app/views/govuk_publishing_components/components/docs/image_card.yml +2 -1
  20. data/app/views/govuk_publishing_components/components/docs/intervention.yml +25 -25
  21. data/app/views/govuk_publishing_components/components/docs/organisation_logo.yml +1 -2
  22. data/app/views/govuk_publishing_components/components/docs/print_link.yml +5 -1
  23. data/app/views/govuk_publishing_components/components/docs/select.yml +101 -98
  24. data/app/views/govuk_publishing_components/components/docs/table.yml +6 -1
  25. data/app/views/govuk_publishing_components/components/docs/tabs.yml +4 -0
  26. data/lib/govuk_publishing_components/app_helpers/table_helper.rb +4 -2
  27. data/lib/govuk_publishing_components/version.rb +1 -1
  28. metadata +3 -3
@@ -18,260 +18,260 @@ accessibility_criteria: |
18
18
  examples:
19
19
  default:
20
20
  data:
21
- name: "favourite_colour_default"
21
+ name: favourite_colour_default
22
22
  items:
23
- - label: "Red"
24
- value: "red_colour"
23
+ - label: Red
24
+ value: red_colour
25
25
  with_multiple_checkboxes:
26
26
  description: When more than one checkbox is shown they are wrapped in a fieldset element, which requires a legend. This must be supplied to the component using the heading option.
27
27
  data:
28
- name: "favourite_colour[]"
29
- heading: "What is your favourite colour?"
28
+ name: favourite_colour[]
29
+ heading: What is your favourite colour?
30
30
  items:
31
- - label: "Red"
32
- value: "red"
33
- - label: "Green"
34
- value: "green"
35
- - label: "Blue"
36
- value: "blue"
31
+ - label: Red
32
+ value: red
33
+ - label: Green
34
+ value: green
35
+ - label: Blue
36
+ value: blue
37
37
  with_small_checkboxes:
38
38
  data:
39
- name: "favourite_small_synonym[]"
40
- heading: "What is your favourite synonym for small?"
39
+ name: favourite_small_synonym[]
40
+ heading: What is your favourite synonym for small?
41
41
  small: true
42
42
  items:
43
- - label: "Tiny"
44
- value: "tiny"
45
- - label: "Little"
46
- value: "little"
43
+ - label: Tiny
44
+ value: tiny
45
+ - label: Little
46
+ value: little
47
47
  with_a_heading_on_one_checkbox:
48
48
  description: One checkbox does not require a fieldset and therefore does not require a legend. However, if a heading is supplied, a fieldset will be included in the component and the heading used as the legend, as shown.
49
49
  data:
50
- name: "agree"
51
- heading: "Please tick the box to agree"
50
+ name: agree
51
+ heading: Please tick the box to agree
52
52
  items:
53
- - label: "I agree"
54
- value: "agree"
53
+ - label: I agree
54
+ value: agree
55
55
  with_custom_hint_text:
56
56
  description: Hint text defaults to 'Select all that apply' but can be overridden with this option. Note that a hint (and a heading) is only displayed if there is more than one checkbox.
57
57
  data:
58
- name: "favourite_skittle[]"
59
- heading: "What is your favourite skittle?"
60
- hint_text: "Taste the rainbow"
58
+ name: favourite_skittle[]
59
+ heading: What is your favourite skittle?
60
+ hint_text: Taste the rainbow
61
61
  items:
62
- - label: "Red"
63
- value: "red"
64
- - label: "Green"
65
- value: "green"
66
- - label: "Blue"
67
- value: "blue"
62
+ - label: Red
63
+ value: red
64
+ - label: Green
65
+ value: green
66
+ - label: Blue
67
+ value: blue
68
68
  with_description_text:
69
69
  description: |
70
70
  If a description text is added, it is displayed under the legend but before the hint text.
71
71
  The description text can only render text and not govspeak specific syntax.
72
72
  This is a pattern that is used across GOV.UK where a question is followed by a description.
73
73
  data:
74
- name: "favourite_skittle[]"
75
- heading: "Choose your favourite skittles"
74
+ name: favourite_skittle[]
75
+ heading: Choose your favourite skittles
76
76
  description: |
77
77
  Skittles consist of hard sugar shells imprinted with the letter "S".
78
78
  The interior consists mainly of sugar, corn syrup, and hydrogenated
79
79
  palm kernel oil along with fruit juice, citric acid, natural and artificial flavors.
80
- hint_text: "Taste the rainbow"
80
+ hint_text: Taste the rainbow
81
81
  items:
82
- - label: "Red"
83
- value: "red"
84
- - label: "Green"
85
- value: "green"
86
- - label: "Blue"
87
- value: "blue"
82
+ - label: Red
83
+ value: red
84
+ - label: Green
85
+ value: green
86
+ - label: Blue
87
+ value: blue
88
88
  with_description_text_and_header:
89
89
  description: |
90
90
  If a description text is added with a page heading, it is displayed under the heading but before the hint text.
91
91
  The description text can only render text and not govspeak specific syntax.
92
92
  This is a pattern that is used across GOV.UK where a question is followed by a description.
93
93
  data:
94
- name: "favourite_skittle[]"
95
- heading: "Choose your favourite skittles"
94
+ name: favourite_skittle[]
95
+ heading: Choose your favourite skittles
96
96
  is_page_heading: true
97
97
  description: |
98
98
  Skittles consist of hard sugar shells imprinted with the letter "S".
99
99
  The interior consists mainly of sugar, corn syrup, and hydrogenated
100
100
  palm kernel oil along with fruit juice, citric acid, natural and artificial flavors.
101
- hint_text: "Taste the rainbow"
101
+ hint_text: Taste the rainbow
102
102
  items:
103
- - label: "Red"
104
- value: "red"
105
- - label: "Green"
106
- value: "green"
107
- - label: "Blue"
108
- value: "blue"
103
+ - label: Red
104
+ value: red
105
+ - label: Green
106
+ value: green
107
+ - label: Blue
108
+ value: blue
109
109
  with_page_header_and_caption:
110
110
  description: |
111
111
  If a caption text is provided with a page heading, it will be displayed above the heading.
112
112
  A caption can only be used with a page heading. If a heading is not provided the caption will not render.
113
113
  The pattern is used across GOV.UK to show a high-level section that this page question falls into.
114
114
  data:
115
- name: "favourite_skittle[]"
116
- heading: "Choose your favourite skittles"
117
- heading_caption: "Question 3 of 9"
115
+ name: favourite_skittle[]
116
+ heading: Choose your favourite skittles
117
+ heading_caption: Question 3 of 9
118
118
  is_page_heading: true
119
119
  items:
120
- - label: "Red"
121
- value: "red"
122
- - label: "Green"
123
- value: "green"
124
- - label: "Blue"
125
- value: "blue"
120
+ - label: Red
121
+ value: red
122
+ - label: Green
123
+ value: green
124
+ - label: Blue
125
+ value: blue
126
126
  without_hint_text:
127
127
  description: Hint text can be removed entirely with this option. Note that this option can be combined with the `visually_hide_heading` option.
128
128
  data:
129
- name: "favourite_skittle[]"
130
- heading: "What is your favourite skittle?"
129
+ name: favourite_skittle[]
130
+ heading: What is your favourite skittle?
131
131
  no_hint_text: true
132
132
  items:
133
- - label: "Mauve"
134
- value: "mauve"
135
- - label: "Sunset orange"
136
- value: "sunsetorange"
133
+ - label: Mauve
134
+ value: mauve
135
+ - label: Sunset orange
136
+ value: sunsetorange
137
137
  with_a_hidden_heading:
138
138
  description: If the heading/legend on the checkboxes is not required, it can be visually hidden using this option. It will still be visible to screen readers.
139
139
  data:
140
- name: "favourite_colour[]"
141
- heading: "What is your favourite colour?"
140
+ name: favourite_colour[]
141
+ heading: What is your favourite colour?
142
142
  visually_hide_heading: true
143
143
  items:
144
- - label: "Red"
145
- value: "red"
146
- - label: "Green"
147
- value: "green"
148
- - label: "Blue"
149
- value: "blue"
144
+ - label: Red
145
+ value: red
146
+ - label: Green
147
+ value: green
148
+ - label: Blue
149
+ value: blue
150
150
  with_a_custom_id_attribute:
151
151
  description: Note that if an `id` is not given one is generated automatically. In either case, the `id` is applied to the parent element of the checkboxes, and each checkbox is given the same `id` with an incremented number at the end, e.g. the checkboxes below have ids of `potatoes-0` and `potatoes-1`.
152
152
  data:
153
- name: "potatoes[]"
154
- id: "potatoes"
155
- heading: "What kind of potatoes do you like?"
153
+ name: potatoes[]
154
+ id: potatoes
155
+ heading: What kind of potatoes do you like?
156
156
  items:
157
- - label: "Red"
158
- value: "red"
159
- - label: "Green"
160
- value: "green"
157
+ - label: Red
158
+ value: red
159
+ - label: Green
160
+ value: green
161
161
  with_custom_ids_on_individal_checkboxes:
162
162
  description: Individual checkboxes can be given specific ids if required. Note that the general id option can still be used, but the individual ids will override the general one if it is given.
163
163
  data:
164
- name: "carrots[]"
165
- id: "carrots"
166
- heading: "What kind of carrots do you like?"
164
+ name: carrots[]
165
+ id: carrots
166
+ heading: What kind of carrots do you like?
167
167
  items:
168
- - label: "Orange"
169
- value: "orange"
170
- id: "custom-orange-id"
171
- - label: "Purple"
172
- value: "purple"
168
+ - label: Orange
169
+ value: orange
170
+ id: custom-orange-id
171
+ - label: Purple
172
+ value: purple
173
173
  with_legend_as_page_heading:
174
174
  description: Since the legend/heading is required, if the checkboxes are alone on a page it makes sense to use this element as the H1 on the page rather than duplicate text.
175
175
  data:
176
- name: "favourite_colour[]"
177
- heading: "What is your favourite colour?"
176
+ name: favourite_colour[]
177
+ heading: What is your favourite colour?
178
178
  is_page_heading: true
179
179
  items:
180
- - label: "Red"
181
- value: "red"
182
- - label: "Green"
183
- value: "green"
184
- - label: "Blue"
185
- value: "blue"
180
+ - label: Red
181
+ value: red
182
+ - label: Green
183
+ value: green
184
+ - label: Blue
185
+ value: blue
186
186
  with_custom_heading_size:
187
187
  description: |
188
188
  This allows the size of the legend to be changed. Valid options are `s`, `m`, `l`, `xl`, defaulting to m if no option is passed.
189
189
 
190
190
  If the `is_page_heading` option is `true` and `heading_size` is not set, the text size will be `xl`.
191
191
  data:
192
- name: "favourite_colour[]"
193
- heading: "What is your favourite colour?"
194
- heading_size: "s"
192
+ name: favourite_colour[]
193
+ heading: What is your favourite colour?
194
+ heading_size: s
195
195
  items:
196
- - label: "Red"
197
- value: "red"
198
- - label: "Green"
199
- value: "green"
200
- - label: "Blue"
201
- value: "blue"
196
+ - label: Red
197
+ value: red
198
+ - label: Green
199
+ value: green
200
+ - label: Blue
201
+ value: blue
202
202
  checkboxes_with_data_attributes:
203
- description: Data attributes such as tracking can be applied if required. This will fire tracking identical tracking events on check and uncheck. See below to send different events on uncheck.
203
+ description: Data attributes for tracking can be applied as shown. Custom JavaScript in the component will fire identical tracking events on check and uncheck. See below to send different events on uncheck.
204
204
  data:
205
- name: "With tracking"
205
+ name: With tracking
206
206
  items:
207
- - label: "Tracked"
208
- value: "tracked"
207
+ - label: Tracked
208
+ value: tracked
209
209
  data_attributes: {
210
- track_category: "checkboxClicked",
211
- track_label: "/news-and-communications",
212
- track_action: "news",
210
+ track_category: checkboxClicked,
211
+ track_label: /news-and-communications,
212
+ track_action: news,
213
213
  track_options: {
214
214
  dimension28: 2,
215
- dimension29: "Tracked"
215
+ dimension29: Tracked
216
216
  }
217
217
  }
218
218
  checkboxes_with_data_attributes_and_custom_uncheck_event_category:
219
- description: It can send a different tracking event category for an uncheck. This is handled automatically
219
+ description: Data attributes for tracking can be applied as shown. Custom JavaScript in the component will fire different tracking events on check and uncheck.
220
220
  data:
221
- name: "With tracking and a custom uncheck category"
221
+ name: With tracking and a custom uncheck category
222
222
  items:
223
- - label: "Tracked"
224
- value: "tracked"
223
+ - label: Tracked
224
+ value: tracked
225
225
  data_attributes: {
226
- track_category: "checkboxClicked",
227
- untrack_category: "checkboxUnchecked",
228
- track_label: "/news-and-communications",
229
- track_action: "news",
226
+ track_category: checkboxClicked,
227
+ untrack_category: checkboxUnchecked,
228
+ track_label: /news-and-communications,
229
+ track_action: news,
230
230
  track_options: {
231
231
  dimension28: 2,
232
- dimension29: "Tracked"
232
+ dimension29: Tracked
233
233
  }
234
234
  }
235
235
  with_aria_controls_attributes:
236
236
  description: Aria controls attributes are applied to the checkboxes only if JavaScript is enabled.
237
237
  data:
238
- name: "aria_controls[]"
239
- heading: "What areas are you interested in?"
238
+ name: aria_controls[]
239
+ heading: What areas are you interested in?
240
240
  items:
241
- - label: "Farming and the environment"
242
- value: "farming"
243
- controls: "js-live-results"
244
- - label: "Water recycling"
245
- value: "water"
246
- controls: "js-live-results"
241
+ - label: Farming and the environment
242
+ value: farming
243
+ controls: js-live-results
244
+ - label: Water recycling
245
+ value: water
246
+ controls: js-live-results
247
247
  checkboxes_with_individual_hints:
248
248
  data:
249
- name: "nationality[]"
250
- heading: "What is your nationality?"
251
- hint_text: "If you have dual nationality, select all options that are relevant to you."
249
+ name: nationality[]
250
+ heading: What is your nationality?
251
+ hint_text: If you have dual nationality, select all options that are relevant to you.
252
252
  items:
253
- - label: "British"
254
- value: "british"
255
- hint: "including English, Scottish, Welsh and Northern Irish"
256
- - label: "Irish"
257
- value: "irish"
258
- - label: "Other"
259
- value: "other"
260
- hint: "anything other than the above"
253
+ - label: British
254
+ value: british
255
+ hint: including English, Scottish, Welsh and Northern Irish
256
+ - label: Irish
257
+ value: irish
258
+ - label: Other
259
+ value: other
260
+ hint: anything other than the above
261
261
  checkbox_items_with_error:
262
262
  data:
263
- name: "nationality[]"
264
- heading: "What is your nationality?"
265
- error: "Select if you are British, Irish or a citizen of a different country"
266
- hint_text: "If you have dual nationality, select all options that are relevant to you."
263
+ name: nationality[]
264
+ heading: What is your nationality?
265
+ error: Select if you are British, Irish or a citizen of a different country
266
+ hint_text: If you have dual nationality, select all options that are relevant to you.
267
267
  items:
268
- - label: "British"
269
- value: "british"
270
- hint: "including English, Scottish, Welsh and Northern Irish"
271
- - label: "Irish"
272
- value: "irish"
273
- - label: "Other"
274
- value: "other"
268
+ - label: British
269
+ value: british
270
+ hint: including English, Scottish, Welsh and Northern Irish
271
+ - label: Irish
272
+ value: irish
273
+ - label: Other
274
+ value: other
275
275
  checkbox_with_exclusive_item:
276
276
  description: |
277
277
  Allows an option to become exclusive, as follows:
@@ -281,19 +281,19 @@ examples:
281
281
 
282
282
  This behaviour should be doubled by similar checks on the backend.
283
283
  data:
284
- name: "nationality-exclusive[]"
285
- heading: "What kind of expertise can you offer?"
286
- hint_text: "Select the types of support you can offer."
284
+ name: nationality-exclusive[]
285
+ heading: What kind of expertise can you offer?
286
+ hint_text: Select the types of support you can offer.
287
287
  items:
288
- - label: "Medical"
289
- value: "medical"
290
- - label: "Engineering"
291
- value: "engineering"
292
- - label: "Other"
293
- value: "other"
288
+ - label: Medical
289
+ value: medical
290
+ - label: Engineering
291
+ value: engineering
292
+ - label: Other
293
+ value: other
294
294
  - :or
295
- - label: "I cannot offer expertise"
296
- value: "no-expertise"
295
+ - label: I cannot offer expertise
296
+ value: no-expertise
297
297
  exclusive: true
298
298
  checkbox_items_with_conditional_reveal:
299
299
  description: |
@@ -301,73 +301,73 @@ examples:
301
301
 
302
302
  Note that if you do insert HTML, this may cause accessibility violations if the additional elements have different name attributes to the checkboxes. No styling will be applied to the inserted content by the component.
303
303
  data:
304
- name: "contactingme[]"
305
- id: "contactingme"
306
- heading: "How would you like to be contacted?"
307
- hint_text: "Please select all options that are relevant to you."
304
+ name: contactingme[]
305
+ id: contactingme
306
+ heading: How would you like to be contacted?
307
+ hint_text: Please select all options that are relevant to you.
308
308
  items:
309
- - label: "Email"
310
- value: "email"
311
- conditional: <div class="govuk-form-group"><label class="govuk-label" for="contact-by-email">Email address</label><input class="govuk-input govuk-!-width-one-third" id="contact-by-email" name="contactingme" type="email"></div>
312
- - label: "Phone"
313
- value: "phone"
314
- conditional: <div class="govuk-form-group"><label class="govuk-label" for="contact-by-phone">Phone number</label><input class="govuk-input govuk-!-width-one-third" id="contact-by-phone" name="contactingme" type="tel"></div>
315
- - label: "Text message"
316
- value: "text"
317
- conditional: <div class="govuk-form-group"><label class="govuk-label" for="contact-by-text">Mobile phone number</label><input class="govuk-input govuk-!-width-one-third" id="contact-by-text" name="contactingme" type="tel"></div>
309
+ - label: Email
310
+ value: email
311
+ conditional: <div class="govuk-form-group"><label class="govuk-label" for="contact-by-email-0">Email address</label><input class="govuk-input govuk-!-width-one-third" id="contact-by-email-0" name="contactingme" type="email"></div>
312
+ - label: Phone
313
+ value: phone
314
+ conditional: <div class="govuk-form-group"><label class="govuk-label" for="contact-by-phone-0">Phone number</label><input class="govuk-input govuk-!-width-one-third" id="contact-by-phone-0" name="contactingme" type="tel"></div>
315
+ - label: Text message
316
+ value: text
317
+ conditional: <div class="govuk-form-group"><label class="govuk-label" for="contact-by-text-0">Mobile phone number</label><input class="govuk-input govuk-!-width-one-third" id="contact-by-text-0" name="contactingme" type="tel"></div>
318
318
  checkbox_items_with_conditional_reveal_checked:
319
319
  data:
320
- name: "contacting-checked[]"
321
- id: "contacting-checked"
322
- heading: "How would you like to be contacted?"
323
- hint_text: "Please select all options that are relevant to you."
320
+ name: contacting-checked[]
321
+ id: contacting-checked
322
+ heading: How would you like to be contacted?
323
+ hint_text: Please select all options that are relevant to you.
324
324
  items:
325
- - label: "Email"
326
- value: "email"
327
- conditional: <div class="govuk-form-group"><label class="govuk-label" for="contact-by-email">Email address</label><input class="govuk-input govuk-!-width-one-third" id="contact-by-email" name="contactingme" type="email"></div>
325
+ - label: Email
326
+ value: email
327
+ conditional: <div class="govuk-form-group"><label class="govuk-label" for="contact-by-email-1">Email address</label><input class="govuk-input govuk-!-width-one-third" id="contact-by-email-1" name="contactingme" type="email"></div>
328
328
  checked: true
329
- - label: "Phone"
330
- value: "phone"
331
- conditional: <div class="govuk-form-group"><label class="govuk-label" for="contact-by-phone">Phone number</label><input class="govuk-input govuk-!-width-one-third" id="contact-by-phone" name="contactingme" type="tel"></div>
332
- - label: "Text message"
333
- value: "text"
334
- conditional: <div class="govuk-form-group"><label class="govuk-label" for="contact-by-text">Mobile phone number</label><input class="govuk-input govuk-!-width-one-third" id="contact-by-text" name="contactingme" type="tel"></div>
329
+ - label: Phone
330
+ value: phone
331
+ conditional: <div class="govuk-form-group"><label class="govuk-label" for="contact-by-phone-1">Phone number</label><input class="govuk-input govuk-!-width-one-third" id="contact-by-phone-1" name="contactingme" type="tel"></div>
332
+ - label: Text message
333
+ value: text
334
+ conditional: <div class="govuk-form-group"><label class="govuk-label" for="contact-by-text-1">Mobile phone number</label><input class="govuk-input govuk-!-width-one-third" id="contact-by-text-1" name="contactingme" type="tel"></div>
335
335
  checkbox_items_with_checked_items:
336
336
  data:
337
- name: "nationality[]"
338
- heading: "What is your nationality?"
339
- hint_text: "If you have dual nationality, select all options that are relevant to you."
337
+ name: nationality[]
338
+ heading: What is your nationality?
339
+ hint_text: If you have dual nationality, select all options that are relevant to you.
340
340
  items:
341
- - label: "British"
342
- value: "british"
341
+ - label: British
342
+ value: british
343
343
  checked: true
344
- - label: "Irish"
345
- value: "irish"
346
- - label: "Other"
347
- value: "other"
344
+ - label: Irish
345
+ value: irish
346
+ - label: Other
347
+ value: other
348
348
  checkbox_items_with_nested_checkboxes:
349
349
  data:
350
- name: "favourite_colour[]"
351
- heading: "What is your favourite colour?"
350
+ name: favourite_colour[]
351
+ heading: What is your favourite colour?
352
352
  items:
353
- - label: "Red"
354
- value: "red"
353
+ - label: Red
354
+ value: red
355
355
  items:
356
- - label: "Light Red"
357
- value: "light_red"
358
- - label: "Dark Red"
359
- value: "dark_red"
360
- - label: "Blue"
361
- value: "blue"
356
+ - label: Light Red
357
+ value: light_red
358
+ - label: Dark Red
359
+ value: dark_red
360
+ - label: Blue
361
+ value: blue
362
362
  items:
363
- - label: "Light blue"
364
- value: "light_blue"
365
- - label: "Dark blue"
366
- value: "dark_blue"
367
- - label: "Other"
368
- value: "other"
363
+ - label: Light blue
364
+ value: light_blue
365
+ - label: Dark blue
366
+ value: dark_blue
367
+ - label: Other
368
+ value: other
369
369
  items:
370
- - label: "Orange"
371
- value: "orange"
372
- - label: "Puce"
373
- value: "puce"
370
+ - label: Orange
371
+ value: orange
372
+ - label: Puce
373
+ value: puce
@@ -37,10 +37,11 @@ examples:
37
37
  text: Analytics cookies help us understand how our website is being used.
38
38
  confirmation_message: You’ve accepted all cookies. You can `<a class='govuk-link' href='/cookies'>change your cookie settings</a>` at any time.
39
39
  services_cookies:
40
+ # yes and no must be quoted or are converted into booleans in the guide
40
41
  "yes":
41
42
  text: "Yes"
42
43
  data_attributes:
43
- "track-category": "cookieBanner"
44
+ track-category: cookieBanner
44
45
  "no":
45
46
  text: "No"
46
47
  data_attributes:
@@ -11,9 +11,9 @@ examples:
11
11
  label: Copy and send this link to someone and they’ll be able to preview your draft on GOV.UK.
12
12
  copyable_content: http://www.example.org
13
13
  input_data_attributes:
14
- "tracking-code": GA-123ABC
14
+ an_attribute: for the input
15
15
  button_text: Copy link
16
16
  button_data_attributes:
17
- "tracking-code": GA-123ABC
17
+ another_attribute: for the button
18
18
  accessibility_criteria: |
19
19
  - should be usable with keyboard
@@ -22,7 +22,10 @@ examples:
22
22
  block: |
23
23
  We need to know your nationality so we can work out which elections you’re entitled to vote in. If you can’t provide your nationality, you’ll have to send copies of identity documents through the post.
24
24
  with_data_attributes:
25
- description: Can be used for tracking. Tracking is applied to the summary element when the details element is opened and closed. By default, `track-label` is set to the status (`open` or `closed`) unless a `track_label` is passed into the component.
25
+ description: |
26
+ Data attributes can be applied to the summary element of the component.
27
+
28
+ This can be used for tracking as shown. Custom JavaScript in the component fires tracking events when the details element is opened and closed. By default, `track-label` is set to the status (`open` or `closed`) unless a `track_label` is passed into the component.
26
29
  data:
27
30
  title: Help with nationality
28
31
  data_attributes:
@@ -34,6 +37,7 @@ examples:
34
37
  block: |
35
38
  We need to know your nationality so we can work out which elections you’re entitled to vote in. If you can’t provide your nationality, you’ll have to send copies of identity documents through the post.
36
39
  with_GTM_tracking:
40
+ description: Applies a tracking attribute specifically for use by Google Tag Manager in [Content Publisher](https://github.com/alphagov/content-publisher).
37
41
  data:
38
42
  title: Help with nationality
39
43
  data_attributes:
@@ -9,8 +9,6 @@ body: |
9
9
  * a link to the document
10
10
  * a last updated date object
11
11
  * a document type
12
-
13
- Tracking can be added to the links by supplying optional data attributes for each.
14
12
  accessibility_criteria: |
15
13
  The component must:
16
14
 
@@ -58,6 +56,7 @@ examples:
58
56
  public_updated_at: 2016-09-05 16:48:27
59
57
  document_type: 'Statutory guidance'
60
58
  with_data_attributes_on_links:
59
+ description: Note that the component does not include built in tracking. If this is required consider using the [track click script](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics/track-click.md).
61
60
  data:
62
61
  items:
63
62
  - link:
@@ -22,6 +22,10 @@ examples:
22
22
  Morbi volutpat facilisis libero. Donec posuere eget odio non egestas.
23
23
  Nullam sed neque quis turpis.
24
24
  with_data_attributes:
25
+ description: |
26
+ The example shown applies a tracking attribute specifically for use by Google Tag Manager in [Content Publisher](https://github.com/alphagov/content-publisher).
27
+
28
+ Other data attributes can also be applied as required. Note that the component does not include built in tracking. If this is required consider using the [track click script](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics/track-click.md).
25
29
  data:
26
30
  message: Message to alert the user to a unsuccessful action goes here
27
31
  description: A further description