govuk_publishing_components 23.2.1 → 23.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics/init.js +23 -15
  3. data/app/assets/javascripts/govuk_publishing_components/components/copy-to-clipboard.js +16 -14
  4. data/app/assets/javascripts/govuk_publishing_components/components/details.js +38 -34
  5. data/app/assets/javascripts/govuk_publishing_components/components/print-link.js +8 -7
  6. data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/magna-charta.js +10 -9
  7. data/app/assets/javascripts/govuk_publishing_components/lib/initial-focus.js +13 -0
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +1 -0
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_input.scss +0 -46
  10. data/app/views/govuk_publishing_components/component_guide/show.html.erb +1 -2
  11. data/app/views/govuk_publishing_components/components/_attachment.html.erb +5 -4
  12. data/app/views/govuk_publishing_components/components/_input.html.erb +6 -6
  13. data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb +5 -3
  14. data/app/views/govuk_publishing_components/components/docs/attachment.yml +10 -0
  15. data/app/views/govuk_publishing_components/components/docs/govspeak.yml +55 -0
  16. data/config/locales/cy.yml +4 -1
  17. data/config/locales/en.yml +4 -0
  18. data/lib/govuk_publishing_components/version.rb +1 -1
  19. data/node_modules/govuk-frontend/govuk/all.js +31 -37
  20. data/node_modules/govuk-frontend/govuk/components/accordion/README.md +1 -1
  21. data/node_modules/govuk-frontend/govuk/components/accordion/_index.scss +0 -1
  22. data/node_modules/govuk-frontend/govuk/components/accordion/fixtures.json +235 -0
  23. data/node_modules/govuk-frontend/govuk/components/back-link/_index.scss +0 -2
  24. data/node_modules/govuk-frontend/govuk/components/back-link/fixtures.json +56 -0
  25. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/_index.scss +0 -1
  26. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/fixtures.json +172 -0
  27. data/node_modules/govuk-frontend/govuk/components/button/_index.scss +3 -3
  28. data/node_modules/govuk-frontend/govuk/components/button/fixtures.json +275 -0
  29. data/node_modules/govuk-frontend/govuk/components/character-count/fixtures.json +170 -0
  30. data/node_modules/govuk-frontend/govuk/components/checkboxes/_index.scss +13 -13
  31. data/node_modules/govuk-frontend/govuk/components/checkboxes/fixtures.json +1015 -0
  32. data/node_modules/govuk-frontend/govuk/components/date-input/fixtures.json +499 -0
  33. data/node_modules/govuk-frontend/govuk/components/details/_index.scss +0 -1
  34. data/node_modules/govuk-frontend/govuk/components/details/fixtures.json +83 -0
  35. data/node_modules/govuk-frontend/govuk/components/error-message/fixtures.json +66 -0
  36. data/node_modules/govuk-frontend/govuk/components/error-summary/_index.scss +0 -2
  37. data/node_modules/govuk-frontend/govuk/components/error-summary/fixtures.json +181 -0
  38. data/node_modules/govuk-frontend/govuk/components/fieldset/_index.scss +1 -1
  39. data/node_modules/govuk-frontend/govuk/components/fieldset/fixtures.json +93 -0
  40. data/node_modules/govuk-frontend/govuk/components/fieldset/macro-options.json +6 -0
  41. data/node_modules/govuk-frontend/govuk/components/fieldset/template.njk +5 -1
  42. data/node_modules/govuk-frontend/govuk/components/file-upload/fixtures.json +151 -0
  43. data/node_modules/govuk-frontend/govuk/components/footer/_index.scss +0 -1
  44. data/node_modules/govuk-frontend/govuk/components/footer/fixtures.json +482 -0
  45. data/node_modules/govuk-frontend/govuk/components/header/_index.scss +2 -5
  46. data/node_modules/govuk-frontend/govuk/components/header/fixtures.json +360 -0
  47. data/node_modules/govuk-frontend/govuk/components/header/header.js +665 -316
  48. data/node_modules/govuk-frontend/govuk/components/header/macro-options.json +13 -1
  49. data/node_modules/govuk-frontend/govuk/components/header/template.njk +9 -5
  50. data/node_modules/govuk-frontend/govuk/components/hint/_index.scss +0 -2
  51. data/node_modules/govuk-frontend/govuk/components/hint/fixtures.json +50 -0
  52. data/node_modules/govuk-frontend/govuk/components/hint/macro-options.json +1 -1
  53. data/node_modules/govuk-frontend/govuk/components/input/_index.scss +91 -0
  54. data/node_modules/govuk-frontend/govuk/components/input/fixtures.json +538 -0
  55. data/node_modules/govuk-frontend/govuk/components/input/macro-options.json +64 -0
  56. data/node_modules/govuk-frontend/govuk/components/input/template.njk +17 -0
  57. data/node_modules/govuk-frontend/govuk/components/inset-text/fixtures.json +49 -0
  58. data/node_modules/govuk-frontend/govuk/components/label/fixtures.json +75 -0
  59. data/node_modules/govuk-frontend/govuk/components/panel/_index.scss +6 -2
  60. data/node_modules/govuk-frontend/govuk/components/panel/fixtures.json +74 -0
  61. data/node_modules/govuk-frontend/govuk/components/phase-banner/fixtures.json +65 -0
  62. data/node_modules/govuk-frontend/govuk/components/radios/_index.scss +13 -13
  63. data/node_modules/govuk-frontend/govuk/components/radios/fixtures.json +1066 -0
  64. data/node_modules/govuk-frontend/govuk/components/radios/macro-options.json +2 -2
  65. data/node_modules/govuk-frontend/govuk/components/select/_index.scss +0 -1
  66. data/node_modules/govuk-frontend/govuk/components/select/fixtures.json +248 -0
  67. data/node_modules/govuk-frontend/govuk/components/skip-link/fixtures.json +72 -0
  68. data/node_modules/govuk-frontend/govuk/components/summary-list/README.md +1 -1
  69. data/node_modules/govuk-frontend/govuk/components/summary-list/_index.scss +2 -10
  70. data/node_modules/govuk-frontend/govuk/components/summary-list/fixtures.json +991 -0
  71. data/node_modules/govuk-frontend/govuk/components/table/fixtures.json +468 -0
  72. data/node_modules/govuk-frontend/govuk/components/tabs/_index.scss +3 -6
  73. data/node_modules/govuk-frontend/govuk/components/tabs/fixtures.json +229 -0
  74. data/node_modules/govuk-frontend/govuk/components/tag/_index.scss +0 -1
  75. data/node_modules/govuk-frontend/govuk/components/tag/fixtures.json +117 -0
  76. data/node_modules/govuk-frontend/govuk/components/textarea/_index.scss +0 -1
  77. data/node_modules/govuk-frontend/govuk/components/textarea/fixtures.json +199 -0
  78. data/node_modules/govuk-frontend/govuk/components/warning-text/_index.scss +0 -1
  79. data/node_modules/govuk-frontend/govuk/components/warning-text/fixtures.json +68 -0
  80. data/node_modules/govuk-frontend/govuk/helpers/_device-pixels.scss +3 -3
  81. data/node_modules/govuk-frontend/govuk/helpers/_font-faces.scss +9 -11
  82. data/node_modules/govuk-frontend/govuk/helpers/_links.scss +1 -3
  83. data/node_modules/govuk-frontend/govuk/helpers/_media-queries.scss +1 -5
  84. data/node_modules/govuk-frontend/govuk/helpers/_spacing.scss +2 -1
  85. data/node_modules/govuk-frontend/govuk/helpers/_typography.scss +7 -6
  86. data/node_modules/govuk-frontend/govuk/objects/_form-group.scss +0 -1
  87. data/node_modules/govuk-frontend/govuk/objects/_grid.scss +2 -3
  88. data/node_modules/govuk-frontend/govuk/objects/_main-wrapper.scss +0 -1
  89. data/node_modules/govuk-frontend/govuk/overrides/_display.scss +1 -1
  90. data/node_modules/govuk-frontend/govuk/overrides/_width.scss +1 -0
  91. data/node_modules/govuk-frontend/govuk/settings/_colours-applied.scss +0 -3
  92. data/node_modules/govuk-frontend/govuk/settings/_colours-organisations.scss +3 -0
  93. data/node_modules/govuk-frontend/govuk/settings/_colours-palette.scss +9 -2
  94. data/node_modules/govuk-frontend/govuk/settings/_compatibility.scss +0 -1
  95. data/node_modules/govuk-frontend/govuk/settings/_measurements.scss +0 -4
  96. data/node_modules/govuk-frontend/govuk/settings/_typography-font-families.scss +2 -2
  97. data/node_modules/govuk-frontend/govuk/settings/_typography-font.scss +11 -5
  98. data/node_modules/govuk-frontend/govuk/settings/_typography-responsive.scss +6 -2
  99. data/node_modules/govuk-frontend/govuk/tools/_font-url.scss +0 -3
  100. data/node_modules/govuk-frontend/govuk/tools/_image-url.scss +0 -3
  101. data/node_modules/govuk-frontend/govuk/utilities/_visually-hidden.scss +0 -1
  102. data/node_modules/govuk-frontend/govuk/vendor/_sass-mq.scss +0 -4
  103. data/node_modules/govuk-frontend/package.json +1 -1
  104. metadata +32 -3
  105. data/app/assets/javascripts/govuk_publishing_components/components/initial-focus.js +0 -12
@@ -0,0 +1,468 @@
1
+ {
2
+ "component": "table",
3
+ "fixtures": [
4
+ {
5
+ "name": "default",
6
+ "options": {
7
+ "rows": [
8
+ [
9
+ {
10
+ "text": "January"
11
+ },
12
+ {
13
+ "text": "£85",
14
+ "format": "numeric"
15
+ },
16
+ {
17
+ "text": "£95",
18
+ "format": "numeric"
19
+ }
20
+ ],
21
+ [
22
+ {
23
+ "text": "February"
24
+ },
25
+ {
26
+ "text": "£75",
27
+ "format": "numeric"
28
+ },
29
+ {
30
+ "text": "£55",
31
+ "format": "numeric"
32
+ }
33
+ ],
34
+ [
35
+ {
36
+ "text": "March"
37
+ },
38
+ {
39
+ "text": "£165",
40
+ "format": "numeric"
41
+ },
42
+ {
43
+ "text": "£125",
44
+ "format": "numeric"
45
+ }
46
+ ]
47
+ ]
48
+ },
49
+ "html": "<table class=\"govuk-table\">\n \n \n <tbody class=\"govuk-table__body\">\n \n \n <tr class=\"govuk-table__row\">\n \n \n \n <td class=\"govuk-table__cell\"\n >January</td>\n \n \n \n \n <td class=\"govuk-table__cell govuk-table__cell--numeric\"\n >£85</td>\n \n \n \n \n <td class=\"govuk-table__cell govuk-table__cell--numeric\"\n >£95</td>\n \n \n </tr>\n \n \n \n <tr class=\"govuk-table__row\">\n \n \n \n <td class=\"govuk-table__cell\"\n >February</td>\n \n \n \n \n <td class=\"govuk-table__cell govuk-table__cell--numeric\"\n >£75</td>\n \n \n \n \n <td class=\"govuk-table__cell govuk-table__cell--numeric\"\n >£55</td>\n \n \n </tr>\n \n \n \n <tr class=\"govuk-table__row\">\n \n \n \n <td class=\"govuk-table__cell\"\n >March</td>\n \n \n \n \n <td class=\"govuk-table__cell govuk-table__cell--numeric\"\n >£165</td>\n \n \n \n \n <td class=\"govuk-table__cell govuk-table__cell--numeric\"\n >£125</td>\n \n \n </tr>\n \n \n </tbody>\n</table>"
50
+ },
51
+ {
52
+ "name": "table with head",
53
+ "options": {
54
+ "head": [
55
+ {
56
+ "text": "Month you apply"
57
+ },
58
+ {
59
+ "text": "Rate for bicycles",
60
+ "format": "numeric"
61
+ },
62
+ {
63
+ "text": "Rate for vehicles",
64
+ "format": "numeric"
65
+ }
66
+ ],
67
+ "rows": [
68
+ [
69
+ {
70
+ "text": "January"
71
+ },
72
+ {
73
+ "text": "£85",
74
+ "format": "numeric"
75
+ },
76
+ {
77
+ "text": "£95",
78
+ "format": "numeric"
79
+ }
80
+ ],
81
+ [
82
+ {
83
+ "text": "February"
84
+ },
85
+ {
86
+ "text": "£75",
87
+ "format": "numeric"
88
+ },
89
+ {
90
+ "text": "£55",
91
+ "format": "numeric"
92
+ }
93
+ ],
94
+ [
95
+ {
96
+ "text": "March"
97
+ },
98
+ {
99
+ "text": "£165",
100
+ "format": "numeric"
101
+ },
102
+ {
103
+ "text": "£125",
104
+ "format": "numeric"
105
+ }
106
+ ]
107
+ ]
108
+ },
109
+ "html": "<table class=\"govuk-table\">\n \n \n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n \n <th scope=\"col\" class=\"govuk-table__header\">Month you apply</th>\n \n <th scope=\"col\" class=\"govuk-table__header govuk-table__header--numeric\">Rate for bicycles</th>\n \n <th scope=\"col\" class=\"govuk-table__header govuk-table__header--numeric\">Rate for vehicles</th>\n \n </tr>\n </thead>\n \n <tbody class=\"govuk-table__body\">\n \n \n <tr class=\"govuk-table__row\">\n \n \n \n <td class=\"govuk-table__cell\"\n >January</td>\n \n \n \n \n <td class=\"govuk-table__cell govuk-table__cell--numeric\"\n >£85</td>\n \n \n \n \n <td class=\"govuk-table__cell govuk-table__cell--numeric\"\n >£95</td>\n \n \n </tr>\n \n \n \n <tr class=\"govuk-table__row\">\n \n \n \n <td class=\"govuk-table__cell\"\n >February</td>\n \n \n \n \n <td class=\"govuk-table__cell govuk-table__cell--numeric\"\n >£75</td>\n \n \n \n \n <td class=\"govuk-table__cell govuk-table__cell--numeric\"\n >£55</td>\n \n \n </tr>\n \n \n \n <tr class=\"govuk-table__row\">\n \n \n \n <td class=\"govuk-table__cell\"\n >March</td>\n \n \n \n \n <td class=\"govuk-table__cell govuk-table__cell--numeric\"\n >£165</td>\n \n \n \n \n <td class=\"govuk-table__cell govuk-table__cell--numeric\"\n >£125</td>\n \n \n </tr>\n \n \n </tbody>\n</table>"
110
+ },
111
+ {
112
+ "name": "table with head and caption",
113
+ "options": {
114
+ "caption": "Caption 1: Months and rates",
115
+ "captionClasses": "govuk-heading-m",
116
+ "firstCellIsHeader": true,
117
+ "head": [
118
+ {
119
+ "text": "Month you apply"
120
+ },
121
+ {
122
+ "text": "Rate for bicycles",
123
+ "format": "numeric"
124
+ },
125
+ {
126
+ "text": "Rate for vehicles",
127
+ "format": "numeric"
128
+ }
129
+ ],
130
+ "rows": [
131
+ [
132
+ {
133
+ "text": "January"
134
+ },
135
+ {
136
+ "text": "£85",
137
+ "format": "numeric"
138
+ },
139
+ {
140
+ "text": "£95",
141
+ "format": "numeric"
142
+ }
143
+ ],
144
+ [
145
+ {
146
+ "text": "February"
147
+ },
148
+ {
149
+ "text": "£75",
150
+ "format": "numeric"
151
+ },
152
+ {
153
+ "text": "£55",
154
+ "format": "numeric"
155
+ }
156
+ ],
157
+ [
158
+ {
159
+ "text": "March"
160
+ },
161
+ {
162
+ "text": "£165",
163
+ "format": "numeric"
164
+ },
165
+ {
166
+ "text": "£125",
167
+ "format": "numeric"
168
+ }
169
+ ]
170
+ ]
171
+ },
172
+ "html": "<table class=\"govuk-table\">\n \n <caption class=\"govuk-table__caption govuk-heading-m\">Caption 1: Months and rates</caption>\n \n \n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n \n <th scope=\"col\" class=\"govuk-table__header\">Month you apply</th>\n \n <th scope=\"col\" class=\"govuk-table__header govuk-table__header--numeric\">Rate for bicycles</th>\n \n <th scope=\"col\" class=\"govuk-table__header govuk-table__header--numeric\">Rate for vehicles</th>\n \n </tr>\n </thead>\n \n <tbody class=\"govuk-table__body\">\n \n \n <tr class=\"govuk-table__row\">\n \n \n \n <th scope=\"row\" class=\"govuk-table__header\"\n >January</th>\n \n \n \n \n <td class=\"govuk-table__cell govuk-table__cell--numeric\"\n >£85</td>\n \n \n \n \n <td class=\"govuk-table__cell govuk-table__cell--numeric\"\n >£95</td>\n \n \n </tr>\n \n \n \n <tr class=\"govuk-table__row\">\n \n \n \n <th scope=\"row\" class=\"govuk-table__header\"\n >February</th>\n \n \n \n \n <td class=\"govuk-table__cell govuk-table__cell--numeric\"\n >£75</td>\n \n \n \n \n <td class=\"govuk-table__cell govuk-table__cell--numeric\"\n >£55</td>\n \n \n </tr>\n \n \n \n <tr class=\"govuk-table__row\">\n \n \n \n <th scope=\"row\" class=\"govuk-table__header\"\n >March</th>\n \n \n \n \n <td class=\"govuk-table__cell govuk-table__cell--numeric\"\n >£165</td>\n \n \n \n \n <td class=\"govuk-table__cell govuk-table__cell--numeric\"\n >£125</td>\n \n \n </tr>\n \n \n </tbody>\n</table>"
173
+ },
174
+ {
175
+ "name": "classes",
176
+ "options": {
177
+ "classes": "custom-class-goes-here"
178
+ },
179
+ "html": "<table class=\"govuk-table custom-class-goes-here\">\n \n \n <tbody class=\"govuk-table__body\">\n \n </tbody>\n</table>"
180
+ },
181
+ {
182
+ "name": "attributes",
183
+ "options": {
184
+ "attributes": {
185
+ "data-foo": "bar"
186
+ }
187
+ },
188
+ "html": "<table class=\"govuk-table\" data-foo=\"bar\">\n \n \n <tbody class=\"govuk-table__body\">\n \n </tbody>\n</table>"
189
+ },
190
+ {
191
+ "name": "html as text",
192
+ "options": {
193
+ "head": [
194
+ {
195
+ "text": "Foo <script>hacking.do(1337)</script>"
196
+ }
197
+ ],
198
+ "rows": [
199
+ [
200
+ {
201
+ "text": "Foo <script>hacking.do(1337)</script>"
202
+ }
203
+ ]
204
+ ]
205
+ },
206
+ "html": "<table class=\"govuk-table\">\n \n \n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n \n <th scope=\"col\" class=\"govuk-table__header\">Foo &lt;script&gt;hacking.do(1337)&lt;/script&gt;</th>\n \n </tr>\n </thead>\n \n <tbody class=\"govuk-table__body\">\n \n \n <tr class=\"govuk-table__row\">\n \n \n \n <td class=\"govuk-table__cell\"\n >Foo &lt;script&gt;hacking.do(1337)&lt;/script&gt;</td>\n \n \n </tr>\n \n \n </tbody>\n</table>"
207
+ },
208
+ {
209
+ "name": "html",
210
+ "options": {
211
+ "head": [
212
+ {
213
+ "html": "Foo <span>bar</span>"
214
+ }
215
+ ],
216
+ "rows": [
217
+ [
218
+ {
219
+ "html": "Foo <span>bar</span>"
220
+ }
221
+ ]
222
+ ]
223
+ },
224
+ "html": "<table class=\"govuk-table\">\n \n \n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n \n <th scope=\"col\" class=\"govuk-table__header\">Foo <span>bar</span></th>\n \n </tr>\n </thead>\n \n <tbody class=\"govuk-table__body\">\n \n \n <tr class=\"govuk-table__row\">\n \n \n \n <td class=\"govuk-table__cell\"\n >Foo <span>bar</span></td>\n \n \n </tr>\n \n \n </tbody>\n</table>"
225
+ },
226
+ {
227
+ "name": "head with classes",
228
+ "options": {
229
+ "head": [
230
+ {
231
+ "text": "Foo",
232
+ "classes": "my-custom-class"
233
+ }
234
+ ]
235
+ },
236
+ "html": "<table class=\"govuk-table\">\n \n \n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n \n <th scope=\"col\" class=\"govuk-table__header my-custom-class\">Foo</th>\n \n </tr>\n </thead>\n \n <tbody class=\"govuk-table__body\">\n \n </tbody>\n</table>"
237
+ },
238
+ {
239
+ "name": "head with rowspan and colspan",
240
+ "options": {
241
+ "head": [
242
+ {
243
+ "text": "Foo",
244
+ "rowspan": 2,
245
+ "colspan": 2
246
+ }
247
+ ]
248
+ },
249
+ "html": "<table class=\"govuk-table\">\n \n \n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n \n <th scope=\"col\" class=\"govuk-table__header\" colspan=\"2\" rowspan=\"2\">Foo</th>\n \n </tr>\n </thead>\n \n <tbody class=\"govuk-table__body\">\n \n </tbody>\n</table>"
250
+ },
251
+ {
252
+ "name": "head with attributes",
253
+ "options": {
254
+ "head": [
255
+ {
256
+ "attributes": {
257
+ "data-fizz": "buzz"
258
+ }
259
+ }
260
+ ]
261
+ },
262
+ "html": "<table class=\"govuk-table\">\n \n \n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n \n <th scope=\"col\" class=\"govuk-table__header\" data-fizz=\"buzz\"></th>\n \n </tr>\n </thead>\n \n <tbody class=\"govuk-table__body\">\n \n </tbody>\n</table>"
263
+ },
264
+ {
265
+ "name": "with firstCellIsHeader true",
266
+ "options": {
267
+ "firstCellIsHeader": true,
268
+ "rows": [
269
+ [
270
+ {
271
+ "text": "January"
272
+ },
273
+ {
274
+ "text": "£85",
275
+ "format": "numeric"
276
+ },
277
+ {
278
+ "text": "£95",
279
+ "format": "numeric"
280
+ }
281
+ ],
282
+ [
283
+ {
284
+ "text": "February"
285
+ },
286
+ {
287
+ "text": "£75",
288
+ "format": "numeric"
289
+ },
290
+ {
291
+ "text": "£55",
292
+ "format": "numeric"
293
+ }
294
+ ],
295
+ [
296
+ {
297
+ "text": "March"
298
+ },
299
+ {
300
+ "text": "£165",
301
+ "format": "numeric"
302
+ },
303
+ {
304
+ "text": "£125",
305
+ "format": "numeric"
306
+ }
307
+ ]
308
+ ]
309
+ },
310
+ "html": "<table class=\"govuk-table\">\n \n \n <tbody class=\"govuk-table__body\">\n \n \n <tr class=\"govuk-table__row\">\n \n \n \n <th scope=\"row\" class=\"govuk-table__header\"\n >January</th>\n \n \n \n \n <td class=\"govuk-table__cell govuk-table__cell--numeric\"\n >£85</td>\n \n \n \n \n <td class=\"govuk-table__cell govuk-table__cell--numeric\"\n >£95</td>\n \n \n </tr>\n \n \n \n <tr class=\"govuk-table__row\">\n \n \n \n <th scope=\"row\" class=\"govuk-table__header\"\n >February</th>\n \n \n \n \n <td class=\"govuk-table__cell govuk-table__cell--numeric\"\n >£75</td>\n \n \n \n \n <td class=\"govuk-table__cell govuk-table__cell--numeric\"\n >£55</td>\n \n \n </tr>\n \n \n \n <tr class=\"govuk-table__row\">\n \n \n \n <th scope=\"row\" class=\"govuk-table__header\"\n >March</th>\n \n \n \n \n <td class=\"govuk-table__cell govuk-table__cell--numeric\"\n >£165</td>\n \n \n \n \n <td class=\"govuk-table__cell govuk-table__cell--numeric\"\n >£125</td>\n \n \n </tr>\n \n \n </tbody>\n</table>"
311
+ },
312
+ {
313
+ "name": "firstCellIsHeader with classes",
314
+ "options": {
315
+ "firstCellIsHeader": true,
316
+ "rows": [
317
+ [
318
+ {
319
+ "text": "Foo",
320
+ "classes": "my-custom-class"
321
+ }
322
+ ]
323
+ ]
324
+ },
325
+ "html": "<table class=\"govuk-table\">\n \n \n <tbody class=\"govuk-table__body\">\n \n \n <tr class=\"govuk-table__row\">\n \n \n \n <th scope=\"row\" class=\"govuk-table__header my-custom-class\"\n >Foo</th>\n \n \n </tr>\n \n \n </tbody>\n</table>"
326
+ },
327
+ {
328
+ "name": "firstCellIsHeader with html",
329
+ "options": {
330
+ "firstCellIsHeader": true,
331
+ "rows": [
332
+ [
333
+ {
334
+ "html": "Foo <span>bar</span>"
335
+ }
336
+ ]
337
+ ]
338
+ },
339
+ "html": "<table class=\"govuk-table\">\n \n \n <tbody class=\"govuk-table__body\">\n \n \n <tr class=\"govuk-table__row\">\n \n \n \n <th scope=\"row\" class=\"govuk-table__header\"\n >Foo <span>bar</span></th>\n \n \n </tr>\n \n \n </tbody>\n</table>"
340
+ },
341
+ {
342
+ "name": "firstCellIsHeader with html as text",
343
+ "options": {
344
+ "firstCellIsHeader": true,
345
+ "rows": [
346
+ [
347
+ {
348
+ "text": "Foo <script>hacking.do(1337)</script>"
349
+ }
350
+ ]
351
+ ]
352
+ },
353
+ "html": "<table class=\"govuk-table\">\n \n \n <tbody class=\"govuk-table__body\">\n \n \n <tr class=\"govuk-table__row\">\n \n \n \n <th scope=\"row\" class=\"govuk-table__header\"\n >Foo &lt;script&gt;hacking.do(1337)&lt;/script&gt;</th>\n \n \n </tr>\n \n \n </tbody>\n</table>"
354
+ },
355
+ {
356
+ "name": "firstCellIsHeader with rowspan and colspan",
357
+ "options": {
358
+ "firstCellIsHeader": true,
359
+ "rows": [
360
+ [
361
+ {
362
+ "text": "Foo",
363
+ "rowspan": 2,
364
+ "colspan": 2
365
+ }
366
+ ]
367
+ ]
368
+ },
369
+ "html": "<table class=\"govuk-table\">\n \n \n <tbody class=\"govuk-table__body\">\n \n \n <tr class=\"govuk-table__row\">\n \n \n \n <th scope=\"row\" class=\"govuk-table__header\" colspan=\"2\" rowspan=\"2\"\n >Foo</th>\n \n \n </tr>\n \n \n </tbody>\n</table>"
370
+ },
371
+ {
372
+ "name": "firstCellIsHeader with attributes",
373
+ "options": {
374
+ "firstCellIsHeader": true,
375
+ "rows": [
376
+ [
377
+ {
378
+ "text": "Foo",
379
+ "attributes": {
380
+ "data-fizz": "buzz"
381
+ }
382
+ }
383
+ ]
384
+ ]
385
+ },
386
+ "html": "<table class=\"govuk-table\">\n \n \n <tbody class=\"govuk-table__body\">\n \n \n <tr class=\"govuk-table__row\">\n \n \n \n <th scope=\"row\" class=\"govuk-table__header\" data-fizz=\"buzz\"\n >Foo</th>\n \n \n </tr>\n \n \n </tbody>\n</table>"
387
+ },
388
+ {
389
+ "name": "with falsey items",
390
+ "options": {
391
+ "rows": [
392
+ [
393
+ {
394
+ "text": "A"
395
+ },
396
+ {
397
+ "text": 1
398
+ }
399
+ ],
400
+ false,
401
+ null,
402
+ [
403
+ {
404
+ "text": "B"
405
+ },
406
+ {
407
+ "text": 2
408
+ }
409
+ ],
410
+ [
411
+ {
412
+ "text": "C"
413
+ },
414
+ {
415
+ "text": 3
416
+ }
417
+ ]
418
+ ]
419
+ },
420
+ "html": "<table class=\"govuk-table\">\n \n \n <tbody class=\"govuk-table__body\">\n \n \n <tr class=\"govuk-table__row\">\n \n \n \n <td class=\"govuk-table__cell\"\n >A</td>\n \n \n \n \n <td class=\"govuk-table__cell\"\n >1</td>\n \n \n </tr>\n \n \n \n \n \n \n \n <tr class=\"govuk-table__row\">\n \n \n \n <td class=\"govuk-table__cell\"\n >B</td>\n \n \n \n \n <td class=\"govuk-table__cell\"\n >2</td>\n \n \n </tr>\n \n \n \n <tr class=\"govuk-table__row\">\n \n \n \n <td class=\"govuk-table__cell\"\n >C</td>\n \n \n \n \n <td class=\"govuk-table__cell\"\n >3</td>\n \n \n </tr>\n \n \n </tbody>\n</table>"
421
+ },
422
+ {
423
+ "name": "rows with classes",
424
+ "options": {
425
+ "rows": [
426
+ [
427
+ {
428
+ "text": "Foo",
429
+ "classes": "my-custom-class"
430
+ }
431
+ ]
432
+ ]
433
+ },
434
+ "html": "<table class=\"govuk-table\">\n \n \n <tbody class=\"govuk-table__body\">\n \n \n <tr class=\"govuk-table__row\">\n \n \n \n <td class=\"govuk-table__cell my-custom-class\"\n >Foo</td>\n \n \n </tr>\n \n \n </tbody>\n</table>"
435
+ },
436
+ {
437
+ "name": "rows with rowspan and colspan",
438
+ "options": {
439
+ "rows": [
440
+ [
441
+ {
442
+ "text": "Foo",
443
+ "rowspan": 2,
444
+ "colspan": 2
445
+ }
446
+ ]
447
+ ]
448
+ },
449
+ "html": "<table class=\"govuk-table\">\n \n \n <tbody class=\"govuk-table__body\">\n \n \n <tr class=\"govuk-table__row\">\n \n \n \n <td class=\"govuk-table__cell\" colspan=\"2\" rowspan=\"2\"\n >Foo</td>\n \n \n </tr>\n \n \n </tbody>\n</table>"
450
+ },
451
+ {
452
+ "name": "rows with attributes",
453
+ "options": {
454
+ "rows": [
455
+ [
456
+ {
457
+ "text": "Foo",
458
+ "attributes": {
459
+ "data-fizz": "buzz"
460
+ }
461
+ }
462
+ ]
463
+ ]
464
+ },
465
+ "html": "<table class=\"govuk-table\">\n \n \n <tbody class=\"govuk-table__body\">\n \n \n <tr class=\"govuk-table__row\">\n \n \n \n <td class=\"govuk-table__cell\" data-fizz=\"buzz\"\n >Foo</td>\n \n \n </tr>\n \n \n </tbody>\n</table>"
466
+ }
467
+ ]
468
+ }