govuk_publishing_components 29.13.0 → 29.15.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/images/govuk_publishing_components/action-link-arrow--white.png +0 -0
- data/app/assets/images/govuk_publishing_components/action-link-arrow--white.svg +1 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/gtm-page-views.js +5 -3
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/pii-remover.js +135 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4.js +2 -0
- data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +27 -22
- data/app/assets/javascripts/govuk_publishing_components/components/table.js +52 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +7 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_previous-and-next-navigation.scss +1 -92
- data/app/models/govuk_publishing_components/audit_applications.rb +31 -9
- data/app/models/govuk_publishing_components/audit_comparer.rb +15 -9
- data/app/views/govuk_publishing_components/audit/_components.html.erb +20 -2
- data/app/views/govuk_publishing_components/components/_action_link.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb +33 -36
- data/app/views/govuk_publishing_components/components/_table.html.erb +61 -30
- data/app/views/govuk_publishing_components/components/docs/accordion.yml +2 -1
- data/app/views/govuk_publishing_components/components/docs/action_link.yml +8 -0
- data/app/views/govuk_publishing_components/components/docs/back_link.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/big_number.yml +2 -2
- data/app/views/govuk_publishing_components/components/docs/breadcrumbs.yml +2 -2
- data/app/views/govuk_publishing_components/components/docs/button.yml +41 -40
- data/app/views/govuk_publishing_components/components/docs/cards.yml +2 -0
- data/app/views/govuk_publishing_components/components/docs/checkboxes.yml +216 -216
- data/app/views/govuk_publishing_components/components/docs/cookie_banner.yml +2 -1
- data/app/views/govuk_publishing_components/components/docs/copy_to_clipboard.yml +2 -2
- data/app/views/govuk_publishing_components/components/docs/details.yml +5 -1
- data/app/views/govuk_publishing_components/components/docs/document_list.yml +1 -2
- data/app/views/govuk_publishing_components/components/docs/error_alert.yml +4 -0
- data/app/views/govuk_publishing_components/components/docs/error_summary.yml +4 -6
- data/app/views/govuk_publishing_components/components/docs/image_card.yml +2 -1
- data/app/views/govuk_publishing_components/components/docs/intervention.yml +25 -25
- data/app/views/govuk_publishing_components/components/docs/organisation_logo.yml +1 -2
- data/app/views/govuk_publishing_components/components/docs/previous_and_next_navigation.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/print_link.yml +5 -1
- data/app/views/govuk_publishing_components/components/docs/select.yml +101 -98
- data/app/views/govuk_publishing_components/components/docs/table.yml +36 -1
- data/app/views/govuk_publishing_components/components/docs/tabs.yml +4 -0
- data/config/locales/ar.yml +6 -0
- data/config/locales/az.yml +6 -0
- data/config/locales/be.yml +6 -0
- data/config/locales/bg.yml +6 -0
- data/config/locales/bn.yml +6 -0
- data/config/locales/cs.yml +6 -0
- data/config/locales/cy.yml +6 -0
- data/config/locales/da.yml +6 -0
- data/config/locales/de.yml +6 -0
- data/config/locales/dr.yml +6 -0
- data/config/locales/el.yml +6 -0
- data/config/locales/en.yml +6 -0
- data/config/locales/es-419.yml +6 -0
- data/config/locales/es.yml +6 -0
- data/config/locales/et.yml +6 -0
- data/config/locales/fa.yml +6 -0
- data/config/locales/fi.yml +6 -0
- data/config/locales/fr.yml +6 -0
- data/config/locales/gd.yml +6 -0
- data/config/locales/gu.yml +6 -0
- data/config/locales/he.yml +6 -0
- data/config/locales/hi.yml +6 -0
- data/config/locales/hr.yml +6 -0
- data/config/locales/hu.yml +6 -0
- data/config/locales/hy.yml +6 -0
- data/config/locales/id.yml +6 -0
- data/config/locales/is.yml +6 -0
- data/config/locales/it.yml +6 -0
- data/config/locales/ja.yml +6 -0
- data/config/locales/ka.yml +6 -0
- data/config/locales/kk.yml +6 -0
- data/config/locales/ko.yml +6 -0
- data/config/locales/lt.yml +6 -0
- data/config/locales/lv.yml +6 -0
- data/config/locales/ms.yml +6 -0
- data/config/locales/mt.yml +6 -0
- data/config/locales/nl.yml +6 -0
- data/config/locales/no.yml +6 -0
- data/config/locales/pa-pk.yml +6 -0
- data/config/locales/pa.yml +6 -0
- data/config/locales/pl.yml +6 -0
- data/config/locales/ps.yml +6 -0
- data/config/locales/pt.yml +6 -0
- data/config/locales/ro.yml +6 -0
- data/config/locales/ru.yml +6 -0
- data/config/locales/si.yml +6 -0
- data/config/locales/sk.yml +6 -0
- data/config/locales/sl.yml +6 -0
- data/config/locales/so.yml +6 -0
- data/config/locales/sq.yml +6 -0
- data/config/locales/sr.yml +6 -0
- data/config/locales/sv.yml +6 -0
- data/config/locales/sw.yml +6 -0
- data/config/locales/ta.yml +6 -0
- data/config/locales/th.yml +6 -0
- data/config/locales/tk.yml +6 -0
- data/config/locales/tr.yml +6 -0
- data/config/locales/uk.yml +6 -0
- data/config/locales/ur.yml +6 -0
- data/config/locales/uz.yml +6 -0
- data/config/locales/vi.yml +6 -0
- data/config/locales/zh-hk.yml +6 -0
- data/config/locales/zh-tw.yml +6 -0
- data/config/locales/zh.yml +6 -0
- data/lib/govuk_publishing_components/app_helpers/table_helper.rb +4 -2
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/govuk-frontend/govuk/components/_all.scss +1 -0
- data/node_modules/govuk-frontend/govuk/components/accordion/_index.scss +1 -0
- data/node_modules/govuk-frontend/govuk/components/character-count/fixtures.json +2 -1
- data/node_modules/govuk-frontend/govuk/components/checkboxes/fixtures.json +102 -44
- data/node_modules/govuk-frontend/govuk/components/checkboxes/macro-options.json +7 -1
- data/node_modules/govuk-frontend/govuk/components/checkboxes/template.njk +3 -2
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/fixtures.json +10 -10
- data/node_modules/govuk-frontend/govuk/components/fieldset/fixtures.json +92 -1
- data/node_modules/govuk-frontend/govuk/components/file-upload/fixtures.json +2 -1
- data/node_modules/govuk-frontend/govuk/components/header/_index.scss +3 -0
- data/node_modules/govuk-frontend/govuk/components/header/fixtures.json +14 -6
- data/node_modules/govuk-frontend/govuk/components/header/template.njk +9 -3
- data/node_modules/govuk-frontend/govuk/components/input/fixtures.json +2 -1
- data/node_modules/govuk-frontend/govuk/components/input/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/label/fixtures.json +76 -1
- data/node_modules/govuk-frontend/govuk/components/pagination/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/pagination/_index.scss +244 -0
- data/node_modules/govuk-frontend/govuk/components/pagination/_pagination.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/pagination/fixtures.json +300 -0
- data/node_modules/govuk-frontend/govuk/components/pagination/macro-options.json +128 -0
- data/node_modules/govuk-frontend/govuk/components/pagination/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/pagination/template.njk +62 -0
- data/node_modules/govuk-frontend/govuk/components/radios/fixtures.json +147 -43
- data/node_modules/govuk-frontend/govuk/components/radios/macro-options.json +7 -1
- data/node_modules/govuk-frontend/govuk/components/radios/template.njk +3 -2
- data/node_modules/govuk-frontend/govuk/components/select/fixtures.json +56 -2
- data/node_modules/govuk-frontend/govuk/components/select/macro-options.json +7 -1
- data/node_modules/govuk-frontend/govuk/components/select/template.njk +1 -1
- data/node_modules/govuk-frontend/govuk/components/textarea/fixtures.json +2 -1
- data/node_modules/govuk-frontend/govuk-esm/all.mjs +12 -12
- data/node_modules/govuk-frontend/govuk-esm/components/accordion/accordion.mjs +3 -3
- data/node_modules/govuk-frontend/govuk-esm/components/button/button.mjs +2 -2
- data/node_modules/govuk-frontend/govuk-esm/components/character-count/character-count.mjs +3 -3
- data/node_modules/govuk-frontend/govuk-esm/components/checkboxes/checkboxes.mjs +4 -4
- data/node_modules/govuk-frontend/govuk-esm/components/details/details.mjs +3 -3
- data/node_modules/govuk-frontend/govuk-esm/components/error-summary/error-summary.mjs +3 -3
- data/node_modules/govuk-frontend/govuk-esm/components/header/header.mjs +3 -3
- data/node_modules/govuk-frontend/govuk-esm/components/notification-banner/notification-banner.mjs +1 -1
- data/node_modules/govuk-frontend/govuk-esm/components/radios/radios.mjs +4 -4
- data/node_modules/govuk-frontend/govuk-esm/components/skip-link/skip-link.mjs +3 -3
- data/node_modules/govuk-frontend/govuk-esm/components/tabs/tabs.mjs +6 -6
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/{DOMTokenList.js → DOMTokenList.mjs} +0 -0
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/{Document.js → Document.mjs} +0 -0
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/{classList.js → classList.mjs} +4 -4
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/{closest.js → closest.mjs} +1 -1
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/{matches.js → matches.mjs} +0 -0
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/{nextElementSibling.js → nextElementSibling.mjs} +2 -2
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/{previousElementSibling.js → previousElementSibling.mjs} +2 -2
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/{Element.js → Element.mjs} +1 -1
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/{Event.js → Event.mjs} +3 -3
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Function/prototype/{bind.js → bind.mjs} +1 -1
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Object/{defineProperty.js → defineProperty.mjs} +0 -0
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/{Window.js → Window.mjs} +0 -0
- data/node_modules/govuk-frontend/package.json +8 -2
- metadata +26 -15
@@ -18,260 +18,260 @@ accessibility_criteria: |
|
|
18
18
|
examples:
|
19
19
|
default:
|
20
20
|
data:
|
21
|
-
name:
|
21
|
+
name: favourite_colour_default
|
22
22
|
items:
|
23
|
-
- label:
|
24
|
-
value:
|
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:
|
29
|
-
heading:
|
28
|
+
name: favourite_colour[]
|
29
|
+
heading: What is your favourite colour?
|
30
30
|
items:
|
31
|
-
- label:
|
32
|
-
value:
|
33
|
-
- label:
|
34
|
-
value:
|
35
|
-
- label:
|
36
|
-
value:
|
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:
|
40
|
-
heading:
|
39
|
+
name: favourite_small_synonym[]
|
40
|
+
heading: What is your favourite synonym for small?
|
41
41
|
small: true
|
42
42
|
items:
|
43
|
-
- label:
|
44
|
-
value:
|
45
|
-
- label:
|
46
|
-
value:
|
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:
|
51
|
-
heading:
|
50
|
+
name: agree
|
51
|
+
heading: Please tick the box to agree
|
52
52
|
items:
|
53
|
-
- label:
|
54
|
-
value:
|
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:
|
59
|
-
heading:
|
60
|
-
hint_text:
|
58
|
+
name: favourite_skittle[]
|
59
|
+
heading: What is your favourite skittle?
|
60
|
+
hint_text: Taste the rainbow
|
61
61
|
items:
|
62
|
-
- label:
|
63
|
-
value:
|
64
|
-
- label:
|
65
|
-
value:
|
66
|
-
- label:
|
67
|
-
value:
|
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:
|
75
|
-
heading:
|
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:
|
80
|
+
hint_text: Taste the rainbow
|
81
81
|
items:
|
82
|
-
- label:
|
83
|
-
value:
|
84
|
-
- label:
|
85
|
-
value:
|
86
|
-
- label:
|
87
|
-
value:
|
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:
|
95
|
-
heading:
|
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:
|
101
|
+
hint_text: Taste the rainbow
|
102
102
|
items:
|
103
|
-
- label:
|
104
|
-
value:
|
105
|
-
- label:
|
106
|
-
value:
|
107
|
-
- label:
|
108
|
-
value:
|
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:
|
116
|
-
heading:
|
117
|
-
heading_caption:
|
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:
|
121
|
-
value:
|
122
|
-
- label:
|
123
|
-
value:
|
124
|
-
- label:
|
125
|
-
value:
|
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:
|
130
|
-
heading:
|
129
|
+
name: favourite_skittle[]
|
130
|
+
heading: What is your favourite skittle?
|
131
131
|
no_hint_text: true
|
132
132
|
items:
|
133
|
-
- label:
|
134
|
-
value:
|
135
|
-
- label:
|
136
|
-
value:
|
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:
|
141
|
-
heading:
|
140
|
+
name: favourite_colour[]
|
141
|
+
heading: What is your favourite colour?
|
142
142
|
visually_hide_heading: true
|
143
143
|
items:
|
144
|
-
- label:
|
145
|
-
value:
|
146
|
-
- label:
|
147
|
-
value:
|
148
|
-
- label:
|
149
|
-
value:
|
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:
|
154
|
-
id:
|
155
|
-
heading:
|
153
|
+
name: potatoes[]
|
154
|
+
id: potatoes
|
155
|
+
heading: What kind of potatoes do you like?
|
156
156
|
items:
|
157
|
-
- label:
|
158
|
-
value:
|
159
|
-
- label:
|
160
|
-
value:
|
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:
|
165
|
-
id:
|
166
|
-
heading:
|
164
|
+
name: carrots[]
|
165
|
+
id: carrots
|
166
|
+
heading: What kind of carrots do you like?
|
167
167
|
items:
|
168
|
-
- label:
|
169
|
-
value:
|
170
|
-
id:
|
171
|
-
- label:
|
172
|
-
value:
|
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:
|
177
|
-
heading:
|
176
|
+
name: favourite_colour[]
|
177
|
+
heading: What is your favourite colour?
|
178
178
|
is_page_heading: true
|
179
179
|
items:
|
180
|
-
- label:
|
181
|
-
value:
|
182
|
-
- label:
|
183
|
-
value:
|
184
|
-
- label:
|
185
|
-
value:
|
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:
|
193
|
-
heading:
|
194
|
-
heading_size:
|
192
|
+
name: favourite_colour[]
|
193
|
+
heading: What is your favourite colour?
|
194
|
+
heading_size: s
|
195
195
|
items:
|
196
|
-
- label:
|
197
|
-
value:
|
198
|
-
- label:
|
199
|
-
value:
|
200
|
-
- label:
|
201
|
-
value:
|
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
|
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:
|
205
|
+
name: With tracking
|
206
206
|
items:
|
207
|
-
- label:
|
208
|
-
value:
|
207
|
+
- label: Tracked
|
208
|
+
value: tracked
|
209
209
|
data_attributes: {
|
210
|
-
track_category:
|
211
|
-
track_label:
|
212
|
-
track_action:
|
210
|
+
track_category: checkboxClicked,
|
211
|
+
track_label: /news-and-communications,
|
212
|
+
track_action: news,
|
213
213
|
track_options: {
|
214
214
|
dimension28: 2,
|
215
|
-
dimension29:
|
215
|
+
dimension29: Tracked
|
216
216
|
}
|
217
217
|
}
|
218
218
|
checkboxes_with_data_attributes_and_custom_uncheck_event_category:
|
219
|
-
description:
|
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:
|
221
|
+
name: With tracking and a custom uncheck category
|
222
222
|
items:
|
223
|
-
- label:
|
224
|
-
value:
|
223
|
+
- label: Tracked
|
224
|
+
value: tracked
|
225
225
|
data_attributes: {
|
226
|
-
track_category:
|
227
|
-
untrack_category:
|
228
|
-
track_label:
|
229
|
-
track_action:
|
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:
|
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:
|
239
|
-
heading:
|
238
|
+
name: aria_controls[]
|
239
|
+
heading: What areas are you interested in?
|
240
240
|
items:
|
241
|
-
- label:
|
242
|
-
value:
|
243
|
-
controls:
|
244
|
-
- label:
|
245
|
-
value:
|
246
|
-
controls:
|
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:
|
250
|
-
heading:
|
251
|
-
hint_text:
|
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:
|
254
|
-
value:
|
255
|
-
hint:
|
256
|
-
- label:
|
257
|
-
value:
|
258
|
-
- label:
|
259
|
-
value:
|
260
|
-
hint:
|
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:
|
264
|
-
heading:
|
265
|
-
error:
|
266
|
-
hint_text:
|
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:
|
269
|
-
value:
|
270
|
-
hint:
|
271
|
-
- label:
|
272
|
-
value:
|
273
|
-
- label:
|
274
|
-
value:
|
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:
|
285
|
-
heading:
|
286
|
-
hint_text:
|
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:
|
289
|
-
value:
|
290
|
-
- label:
|
291
|
-
value:
|
292
|
-
- label:
|
293
|
-
value:
|
288
|
+
- label: Medical
|
289
|
+
value: medical
|
290
|
+
- label: Engineering
|
291
|
+
value: engineering
|
292
|
+
- label: Other
|
293
|
+
value: other
|
294
294
|
- :or
|
295
|
-
- label:
|
296
|
-
value:
|
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:
|
305
|
-
id:
|
306
|
-
heading:
|
307
|
-
hint_text:
|
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:
|
310
|
-
value:
|
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:
|
313
|
-
value:
|
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:
|
316
|
-
value:
|
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:
|
321
|
-
id:
|
322
|
-
heading:
|
323
|
-
hint_text:
|
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:
|
326
|
-
value:
|
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:
|
330
|
-
value:
|
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:
|
333
|
-
value:
|
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:
|
338
|
-
heading:
|
339
|
-
hint_text:
|
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:
|
342
|
-
value:
|
341
|
+
- label: British
|
342
|
+
value: british
|
343
343
|
checked: true
|
344
|
-
- label:
|
345
|
-
value:
|
346
|
-
- label:
|
347
|
-
value:
|
344
|
+
- label: Irish
|
345
|
+
value: irish
|
346
|
+
- label: Other
|
347
|
+
value: other
|
348
348
|
checkbox_items_with_nested_checkboxes:
|
349
349
|
data:
|
350
|
-
name:
|
351
|
-
heading:
|
350
|
+
name: favourite_colour[]
|
351
|
+
heading: What is your favourite colour?
|
352
352
|
items:
|
353
|
-
- label:
|
354
|
-
value:
|
353
|
+
- label: Red
|
354
|
+
value: red
|
355
355
|
items:
|
356
|
-
- label:
|
357
|
-
value:
|
358
|
-
- label:
|
359
|
-
value:
|
360
|
-
- label:
|
361
|
-
value:
|
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:
|
364
|
-
value:
|
365
|
-
- label:
|
366
|
-
value:
|
367
|
-
- label:
|
368
|
-
value:
|
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:
|
371
|
-
value:
|
372
|
-
- label:
|
373
|
-
value:
|
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
|
-
|
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
|
-
|
14
|
+
an_attribute: for the input
|
15
15
|
button_text: Copy link
|
16
16
|
button_data_attributes:
|
17
|
-
|
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:
|
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
|