govuk_publishing_components 32.1.0 → 33.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-core.js +175 -0
  3. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-ecommerce-tracker.js +1 -1
  4. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-event-tracker.js +5 -13
  5. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-link-tracker.js +80 -309
  6. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-page-views.js +2 -2
  7. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-specialist-link-tracker.js +140 -0
  8. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/init-ga4.js +3 -0
  9. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4.js +1 -0
  10. data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +12 -1
  11. data/app/assets/javascripts/govuk_publishing_components/components/single-page-notification-button.js +24 -8
  12. data/app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-reporter.js +83 -86
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_big-number.scss +2 -5
  14. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +1 -5
  15. data/app/assets/stylesheets/govuk_publishing_components/components/_input.scss +3 -5
  16. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +10 -30
  17. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +0 -7
  18. data/app/views/govuk_publishing_components/components/_accordion.html.erb +14 -1
  19. data/app/views/govuk_publishing_components/components/_error_summary.html.erb +27 -26
  20. data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +2 -2
  21. data/app/views/govuk_publishing_components/components/_phase_banner.html.erb +1 -1
  22. data/app/views/govuk_publishing_components/components/_share_links.html.erb +11 -13
  23. data/app/views/govuk_publishing_components/components/_single_page_notification_button.html.erb +1 -1
  24. data/app/views/govuk_publishing_components/components/docs/accordion.yml +15 -3
  25. data/app/views/govuk_publishing_components/components/docs/button.yml +10 -0
  26. data/app/views/govuk_publishing_components/components/docs/share_links.yml +59 -30
  27. data/app/views/govuk_publishing_components/components/docs/single_page_notification_button.yml +10 -1
  28. data/app/views/govuk_publishing_components/components/feedback/_yes_no_banner.html.erb +3 -3
  29. data/lib/govuk_publishing_components/presenters/button_helper.rb +7 -1
  30. data/lib/govuk_publishing_components/presenters/single_page_notification_button_helper.rb +25 -1
  31. data/lib/govuk_publishing_components/version.rb +1 -1
  32. data/node_modules/axe-core/axe.js +4559 -4673
  33. data/node_modules/axe-core/axe.min.js +2 -2
  34. data/node_modules/axe-core/package.json +2 -2
  35. data/node_modules/axe-core/sri-history.json +4 -0
  36. data/node_modules/govuk-frontend/README.md +1 -2
  37. data/node_modules/govuk-frontend/govuk/all.js +1398 -273
  38. data/node_modules/govuk-frontend/govuk/common/closest-attribute-value.js +70 -0
  39. data/node_modules/govuk-frontend/govuk/common/index.js +172 -0
  40. data/node_modules/govuk-frontend/govuk/common/normalise-dataset.js +373 -0
  41. data/node_modules/govuk-frontend/govuk/common.js +138 -3
  42. data/node_modules/govuk-frontend/govuk/components/accordion/accordion.js +753 -25
  43. data/node_modules/govuk-frontend/govuk/components/accordion/fixtures.json +54 -22
  44. data/node_modules/govuk-frontend/govuk/components/accordion/macro-options.json +36 -0
  45. data/node_modules/govuk-frontend/govuk/components/accordion/template.njk +7 -1
  46. data/node_modules/govuk-frontend/govuk/components/back-link/fixtures.json +12 -12
  47. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/fixtures.json +22 -22
  48. data/node_modules/govuk-frontend/govuk/components/button/_index.scss +23 -5
  49. data/node_modules/govuk-frontend/govuk/components/button/button.js +365 -107
  50. data/node_modules/govuk-frontend/govuk/components/button/fixtures.json +85 -66
  51. data/node_modules/govuk-frontend/govuk/components/button/template.njk +1 -1
  52. data/node_modules/govuk-frontend/govuk/components/character-count/_index.scss +9 -0
  53. data/node_modules/govuk-frontend/govuk/components/character-count/character-count.js +1033 -121
  54. data/node_modules/govuk-frontend/govuk/components/character-count/fixtures.json +112 -36
  55. data/node_modules/govuk-frontend/govuk/components/character-count/macro-options.json +42 -0
  56. data/node_modules/govuk-frontend/govuk/components/character-count/template.njk +27 -3
  57. data/node_modules/govuk-frontend/govuk/components/checkboxes/checkboxes.js +30 -2
  58. data/node_modules/govuk-frontend/govuk/components/checkboxes/fixtures.json +96 -93
  59. data/node_modules/govuk-frontend/govuk/components/cookie-banner/fixtures.json +46 -46
  60. data/node_modules/govuk-frontend/govuk/components/date-input/fixtures.json +50 -50
  61. data/node_modules/govuk-frontend/govuk/components/details/details.js +43 -13
  62. data/node_modules/govuk-frontend/govuk/components/details/fixtures.json +20 -20
  63. data/node_modules/govuk-frontend/govuk/components/error-message/fixtures.json +20 -20
  64. data/node_modules/govuk-frontend/govuk/components/error-summary/error-summary.js +268 -6
  65. data/node_modules/govuk-frontend/govuk/components/error-summary/fixtures.json +44 -35
  66. data/node_modules/govuk-frontend/govuk/components/error-summary/template.njk +25 -21
  67. data/node_modules/govuk-frontend/govuk/components/fieldset/fixtures.json +51 -39
  68. data/node_modules/govuk-frontend/govuk/components/file-upload/fixtures.json +26 -26
  69. data/node_modules/govuk-frontend/govuk/components/footer/_index.scss +1 -1
  70. data/node_modules/govuk-frontend/govuk/components/footer/fixtures.json +46 -46
  71. data/node_modules/govuk-frontend/govuk/components/footer/macro-options.json +2 -2
  72. data/node_modules/govuk-frontend/govuk/components/header/fixtures.json +93 -38
  73. data/node_modules/govuk-frontend/govuk/components/header/header.js +6 -0
  74. data/node_modules/govuk-frontend/govuk/components/header/macro-options.json +8 -2
  75. data/node_modules/govuk-frontend/govuk/components/header/template.njk +4 -2
  76. data/node_modules/govuk-frontend/govuk/components/hint/fixtures.json +12 -12
  77. data/node_modules/govuk-frontend/govuk/components/input/fixtures.json +80 -80
  78. data/node_modules/govuk-frontend/govuk/components/inset-text/fixtures.json +12 -12
  79. data/node_modules/govuk-frontend/govuk/components/label/fixtures.json +34 -34
  80. data/node_modules/govuk-frontend/govuk/components/notification-banner/fixtures.json +56 -46
  81. data/node_modules/govuk-frontend/govuk/components/notification-banner/notification-banner.js +252 -2
  82. data/node_modules/govuk-frontend/govuk/components/notification-banner/template.njk +1 -1
  83. data/node_modules/govuk-frontend/govuk/components/pagination/_index.scss +10 -7
  84. data/node_modules/govuk-frontend/govuk/components/pagination/fixtures.json +33 -26
  85. data/node_modules/govuk-frontend/govuk/components/panel/fixtures.json +18 -18
  86. data/node_modules/govuk-frontend/govuk/components/phase-banner/fixtures.json +14 -14
  87. data/node_modules/govuk-frontend/govuk/components/radios/fixtures.json +94 -91
  88. data/node_modules/govuk-frontend/govuk/components/radios/radios.js +30 -2
  89. data/node_modules/govuk-frontend/govuk/components/select/fixtures.json +32 -32
  90. data/node_modules/govuk-frontend/govuk/components/skip-link/fixtures.json +22 -20
  91. data/node_modules/govuk-frontend/govuk/components/skip-link/skip-link.js +10 -4
  92. data/node_modules/govuk-frontend/govuk/components/summary-list/fixtures.json +50 -50
  93. data/node_modules/govuk-frontend/govuk/components/table/_index.scss +1 -1
  94. data/node_modules/govuk-frontend/govuk/components/table/fixtures.json +40 -40
  95. data/node_modules/govuk-frontend/govuk/components/tabs/fixtures.json +29 -29
  96. data/node_modules/govuk-frontend/govuk/components/tabs/tabs.js +28 -0
  97. data/node_modules/govuk-frontend/govuk/components/tag/fixtures.json +28 -28
  98. data/node_modules/govuk-frontend/govuk/components/textarea/fixtures.json +34 -34
  99. data/node_modules/govuk-frontend/govuk/components/warning-text/fixtures.json +14 -14
  100. data/node_modules/govuk-frontend/govuk/core/_section-break.scss +1 -1
  101. data/node_modules/govuk-frontend/govuk/helpers/_colour.scss +2 -2
  102. data/node_modules/govuk-frontend/govuk/helpers/_links.scss +6 -6
  103. data/node_modules/govuk-frontend/govuk/i18n.js +390 -0
  104. data/node_modules/govuk-frontend/govuk/macros/i18n.njk +15 -0
  105. data/node_modules/govuk-frontend/govuk/settings/_all.scss +1 -0
  106. data/node_modules/govuk-frontend/govuk/settings/_colours-palette.scss +12 -0
  107. data/node_modules/govuk-frontend/govuk/settings/_compatibility.scss +26 -0
  108. data/node_modules/govuk-frontend/govuk/settings/_typography-font.scss +23 -0
  109. data/node_modules/govuk-frontend/govuk/settings/_typography-responsive.scss +12 -0
  110. data/node_modules/govuk-frontend/govuk/settings/_warnings.scss +53 -0
  111. data/node_modules/govuk-frontend/govuk/tools/_compatibility.scss +20 -6
  112. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Date/now.js +21 -0
  113. data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/dataset.js +300 -0
  114. data/node_modules/govuk-frontend/govuk/vendor/polyfills/String/prototype/trim.js +21 -0
  115. data/node_modules/govuk-frontend/govuk-esm/all.mjs +50 -27
  116. data/node_modules/govuk-frontend/govuk-esm/common/closest-attribute-value.mjs +15 -0
  117. data/node_modules/govuk-frontend/govuk-esm/common/index.mjs +159 -0
  118. data/node_modules/govuk-frontend/govuk-esm/common/normalise-dataset.mjs +58 -0
  119. data/node_modules/govuk-frontend/govuk-esm/common.mjs +6 -28
  120. data/node_modules/govuk-frontend/govuk-esm/components/accordion/accordion.mjs +113 -43
  121. data/node_modules/govuk-frontend/govuk-esm/components/button/button.mjs +67 -30
  122. data/node_modules/govuk-frontend/govuk-esm/components/character-count/character-count.mjs +325 -123
  123. data/node_modules/govuk-frontend/govuk-esm/components/checkboxes/checkboxes.mjs +9 -3
  124. data/node_modules/govuk-frontend/govuk-esm/components/details/details.mjs +22 -8
  125. data/node_modules/govuk-frontend/govuk-esm/components/error-summary/error-summary.mjs +48 -6
  126. data/node_modules/govuk-frontend/govuk-esm/components/header/header.mjs +6 -0
  127. data/node_modules/govuk-frontend/govuk-esm/components/notification-banner/notification-banner.mjs +32 -2
  128. data/node_modules/govuk-frontend/govuk-esm/components/radios/radios.mjs +9 -3
  129. data/node_modules/govuk-frontend/govuk-esm/components/skip-link/skip-link.mjs +10 -4
  130. data/node_modules/govuk-frontend/govuk-esm/components/tabs/tabs.mjs +8 -2
  131. data/node_modules/govuk-frontend/govuk-esm/i18n.mjs +380 -0
  132. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Date/now.mjs +13 -0
  133. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/dataset.mjs +68 -0
  134. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/String/prototype/trim.mjs +13 -0
  135. data/node_modules/govuk-frontend/govuk-prototype-kit/init.js +7 -0
  136. data/node_modules/govuk-frontend/govuk-prototype-kit/init.scss +12 -0
  137. data/node_modules/govuk-frontend/govuk-prototype-kit.config.json +138 -7
  138. data/node_modules/govuk-frontend/package.json +1 -1
  139. metadata +22 -3
@@ -6,8 +6,8 @@
6
6
  "options": {
7
7
  "text": "Save and continue"
8
8
  },
9
- "html": "<button class=\"govuk-button\" data-module=\"govuk-button\">\n Save and continue\n</button>",
10
- "hidden": false
9
+ "hidden": false,
10
+ "html": "<button class=\"govuk-button\" data-module=\"govuk-button\">\n Save and continue\n</button>"
11
11
  },
12
12
  {
13
13
  "name": "disabled",
@@ -15,8 +15,8 @@
15
15
  "text": "Disabled button",
16
16
  "disabled": true
17
17
  },
18
- "html": "<button disabled=\"disabled\" aria-disabled=\"true\" class=\"govuk-button govuk-button--disabled\" data-module=\"govuk-button\">\n Disabled button\n</button>",
19
- "hidden": false
18
+ "hidden": false,
19
+ "html": "<button disabled=\"disabled\" aria-disabled=\"true\" class=\"govuk-button govuk-button--disabled\" data-module=\"govuk-button\">\n Disabled button\n</button>"
20
20
  },
21
21
  {
22
22
  "name": "link",
@@ -24,8 +24,8 @@
24
24
  "text": "Link button",
25
25
  "href": "/"
26
26
  },
27
- "html": "<a href=\"/\" role=\"button\" draggable=\"false\" class=\"govuk-button\" data-module=\"govuk-button\">\n Link button\n</a>",
28
- "hidden": false
27
+ "hidden": false,
28
+ "html": "<a href=\"/\" role=\"button\" draggable=\"false\" class=\"govuk-button\" data-module=\"govuk-button\">\n Link button\n</a>"
29
29
  },
30
30
  {
31
31
  "name": "link disabled",
@@ -34,8 +34,8 @@
34
34
  "href": "/",
35
35
  "disabled": true
36
36
  },
37
- "html": "<a href=\"/\" role=\"button\" draggable=\"false\" class=\"govuk-button govuk-button--disabled\" data-module=\"govuk-button\">\n Disabled link button\n</a>",
38
- "hidden": false
37
+ "hidden": false,
38
+ "html": "<a href=\"/\" role=\"button\" draggable=\"false\" class=\"govuk-button govuk-button--disabled\" data-module=\"govuk-button\">\n Disabled link button\n</a>"
39
39
  },
40
40
  {
41
41
  "name": "start",
@@ -43,8 +43,8 @@
43
43
  "text": "Start now button",
44
44
  "isStartButton": true
45
45
  },
46
- "html": "<button class=\"govuk-button govuk-button--start\" data-module=\"govuk-button\">\n Start now button\n <svg class=\"govuk-button__start-icon\" xmlns=\"http://www.w3.org/2000/svg\" width=\"17.5\" height=\"19\" viewBox=\"0 0 33 40\" aria-hidden=\"true\" focusable=\"false\">\n <path fill=\"currentColor\" d=\"M0 0h13l20 20-20 20H0l20-20z\"/>\n </svg></button>",
47
- "hidden": false
46
+ "hidden": false,
47
+ "html": "<button class=\"govuk-button govuk-button--start\" data-module=\"govuk-button\">\n Start now button\n <svg class=\"govuk-button__start-icon\" xmlns=\"http://www.w3.org/2000/svg\" width=\"17.5\" height=\"19\" viewBox=\"0 0 33 40\" aria-hidden=\"true\" focusable=\"false\">\n <path fill=\"currentColor\" d=\"M0 0h13l20 20-20 20H0l20-20z\"/>\n </svg></button>"
48
48
  },
49
49
  {
50
50
  "name": "start link",
@@ -53,8 +53,8 @@
53
53
  "href": "/",
54
54
  "isStartButton": true
55
55
  },
56
- "html": "<a href=\"/\" role=\"button\" draggable=\"false\" class=\"govuk-button govuk-button--start\" data-module=\"govuk-button\">\n Start now link button\n <svg class=\"govuk-button__start-icon\" xmlns=\"http://www.w3.org/2000/svg\" width=\"17.5\" height=\"19\" viewBox=\"0 0 33 40\" aria-hidden=\"true\" focusable=\"false\">\n <path fill=\"currentColor\" d=\"M0 0h13l20 20-20 20H0l20-20z\"/>\n </svg></a>",
57
- "hidden": false
56
+ "hidden": false,
57
+ "html": "<a href=\"/\" role=\"button\" draggable=\"false\" class=\"govuk-button govuk-button--start\" data-module=\"govuk-button\">\n Start now link button\n <svg class=\"govuk-button__start-icon\" xmlns=\"http://www.w3.org/2000/svg\" width=\"17.5\" height=\"19\" viewBox=\"0 0 33 40\" aria-hidden=\"true\" focusable=\"false\">\n <path fill=\"currentColor\" d=\"M0 0h13l20 20-20 20H0l20-20z\"/>\n </svg></a>"
58
58
  },
59
59
  {
60
60
  "name": "input",
@@ -63,8 +63,8 @@
63
63
  "name": "start-now",
64
64
  "text": "Start now"
65
65
  },
66
- "html": "<input value=\"Start now\" type=\"submit\" name=\"start-now\" class=\"govuk-button\" data-module=\"govuk-button\">",
67
- "hidden": false
66
+ "hidden": false,
67
+ "html": "<input value=\"Start now\" type=\"submit\" name=\"start-now\" class=\"govuk-button\" data-module=\"govuk-button\">"
68
68
  },
69
69
  {
70
70
  "name": "input disabled",
@@ -73,8 +73,8 @@
73
73
  "text": "Explicit input button disabled",
74
74
  "disabled": true
75
75
  },
76
- "html": "<input value=\"Explicit input button disabled\" type=\"submit\" disabled=\"disabled\" aria-disabled=\"true\" class=\"govuk-button govuk-button--disabled\" data-module=\"govuk-button\">",
77
- "hidden": false
76
+ "hidden": false,
77
+ "html": "<input value=\"Explicit input button disabled\" type=\"submit\" disabled=\"disabled\" aria-disabled=\"true\" class=\"govuk-button govuk-button--disabled\" data-module=\"govuk-button\">"
78
78
  },
79
79
  {
80
80
  "name": "prevent double click",
@@ -82,8 +82,8 @@
82
82
  "text": "Submit",
83
83
  "preventDoubleClick": true
84
84
  },
85
- "html": "<button data-prevent-double-click=\"true\" class=\"govuk-button\" data-module=\"govuk-button\">\n Submit\n</button>",
86
- "hidden": false
85
+ "hidden": false,
86
+ "html": "<button data-prevent-double-click=\"true\" class=\"govuk-button\" data-module=\"govuk-button\">\n Submit\n</button>"
87
87
  },
88
88
  {
89
89
  "name": "with active state",
@@ -92,8 +92,8 @@
92
92
  "text": "Active",
93
93
  "classes": ":active"
94
94
  },
95
- "html": "<button name=\"active\" class=\"govuk-button :active\" data-module=\"govuk-button\">\n Active\n</button>",
96
- "hidden": false
95
+ "hidden": false,
96
+ "html": "<button name=\"active\" class=\"govuk-button :active\" data-module=\"govuk-button\">\n Active\n</button>"
97
97
  },
98
98
  {
99
99
  "name": "with hover state",
@@ -102,8 +102,8 @@
102
102
  "text": "Hovered",
103
103
  "classes": ":hover"
104
104
  },
105
- "html": "<button name=\"hover\" class=\"govuk-button :hover\" data-module=\"govuk-button\">\n Hovered\n</button>",
106
- "hidden": false
105
+ "hidden": false,
106
+ "html": "<button name=\"hover\" class=\"govuk-button :hover\" data-module=\"govuk-button\">\n Hovered\n</button>"
107
107
  },
108
108
  {
109
109
  "name": "with focus state",
@@ -112,8 +112,8 @@
112
112
  "text": "Focussed",
113
113
  "classes": ":focus"
114
114
  },
115
- "html": "<button name=\"focus\" class=\"govuk-button :focus\" data-module=\"govuk-button\">\n Focussed\n</button>",
116
- "hidden": false
115
+ "hidden": false,
116
+ "html": "<button name=\"focus\" class=\"govuk-button :focus\" data-module=\"govuk-button\">\n Focussed\n</button>"
117
117
  },
118
118
  {
119
119
  "name": "Secondary",
@@ -122,8 +122,8 @@
122
122
  "text": "Secondary button",
123
123
  "classes": "govuk-button--secondary"
124
124
  },
125
- "html": "<button name=\"secondary\" class=\"govuk-button govuk-button--secondary\" data-module=\"govuk-button\">\n Secondary button\n</button>",
126
- "hidden": false
125
+ "hidden": false,
126
+ "html": "<button name=\"secondary\" class=\"govuk-button govuk-button--secondary\" data-module=\"govuk-button\">\n Secondary button\n</button>"
127
127
  },
128
128
  {
129
129
  "name": "Secondary disabled",
@@ -133,8 +133,8 @@
133
133
  "classes": "govuk-button--secondary",
134
134
  "disabled": true
135
135
  },
136
- "html": "<button name=\"secondary\" disabled=\"disabled\" aria-disabled=\"true\" class=\"govuk-button govuk-button--secondary govuk-button--disabled\" data-module=\"govuk-button\">\n Secondary button disabled\n</button>",
137
- "hidden": false
136
+ "hidden": false,
137
+ "html": "<button name=\"secondary\" disabled=\"disabled\" aria-disabled=\"true\" class=\"govuk-button govuk-button--secondary govuk-button--disabled\" data-module=\"govuk-button\">\n Secondary button disabled\n</button>"
138
138
  },
139
139
  {
140
140
  "name": "Secondary link",
@@ -144,8 +144,8 @@
144
144
  "href": "/",
145
145
  "classes": "govuk-button--secondary"
146
146
  },
147
- "html": "<a href=\"/\" role=\"button\" draggable=\"false\" class=\"govuk-button govuk-button--secondary\" data-module=\"govuk-button\">\n Secondary button\n</a>",
148
- "hidden": false
147
+ "hidden": false,
148
+ "html": "<a href=\"/\" role=\"button\" draggable=\"false\" class=\"govuk-button govuk-button--secondary\" data-module=\"govuk-button\">\n Secondary button\n</a>"
149
149
  },
150
150
  {
151
151
  "name": "Warning",
@@ -154,8 +154,8 @@
154
154
  "text": "Warning button",
155
155
  "classes": "govuk-button--warning"
156
156
  },
157
- "html": "<button name=\"Warning\" class=\"govuk-button govuk-button--warning\" data-module=\"govuk-button\">\n Warning button\n</button>",
158
- "hidden": false
157
+ "hidden": false,
158
+ "html": "<button name=\"Warning\" class=\"govuk-button govuk-button--warning\" data-module=\"govuk-button\">\n Warning button\n</button>"
159
159
  },
160
160
  {
161
161
  "name": "Warning disabled",
@@ -165,8 +165,8 @@
165
165
  "classes": "govuk-button--warning",
166
166
  "disabled": true
167
167
  },
168
- "html": "<button name=\"warning\" disabled=\"disabled\" aria-disabled=\"true\" class=\"govuk-button govuk-button--warning govuk-button--disabled\" data-module=\"govuk-button\">\n Warning button disabled\n</button>",
169
- "hidden": false
168
+ "hidden": false,
169
+ "html": "<button name=\"warning\" disabled=\"disabled\" aria-disabled=\"true\" class=\"govuk-button govuk-button--warning govuk-button--disabled\" data-module=\"govuk-button\">\n Warning button disabled\n</button>"
170
170
  },
171
171
  {
172
172
  "name": "Warning link",
@@ -176,8 +176,8 @@
176
176
  "href": "/",
177
177
  "classes": "govuk-button--warning"
178
178
  },
179
- "html": "<a href=\"/\" role=\"button\" draggable=\"false\" class=\"govuk-button govuk-button--warning\" data-module=\"govuk-button\">\n Warning button\n</a>",
180
- "hidden": false
179
+ "hidden": false,
180
+ "html": "<a href=\"/\" role=\"button\" draggable=\"false\" class=\"govuk-button govuk-button--warning\" data-module=\"govuk-button\">\n Warning button\n</a>"
181
181
  },
182
182
  {
183
183
  "name": "attributes",
@@ -189,8 +189,8 @@
189
189
  "data-tracking-dimension": 123
190
190
  }
191
191
  },
192
- "html": "<button class=\"govuk-button\" data-module=\"govuk-button\" aria-controls=\"example-id\" data-tracking-dimension=\"123\">\n Submit\n</button>",
193
- "hidden": true
192
+ "hidden": true,
193
+ "html": "<button class=\"govuk-button\" data-module=\"govuk-button\" aria-controls=\"example-id\" data-tracking-dimension=\"123\">\n Submit\n</button>"
194
194
  },
195
195
  {
196
196
  "name": "link attributes",
@@ -202,8 +202,8 @@
202
202
  "data-tracking-dimension": 123
203
203
  }
204
204
  },
205
- "html": "<a href=\"#\" role=\"button\" draggable=\"false\" class=\"govuk-button\" data-module=\"govuk-button\" aria-controls=\"example-id\" data-tracking-dimension=\"123\">\n Submit\n</a>",
206
- "hidden": true
205
+ "hidden": true,
206
+ "html": "<a href=\"#\" role=\"button\" draggable=\"false\" class=\"govuk-button\" data-module=\"govuk-button\" aria-controls=\"example-id\" data-tracking-dimension=\"123\">\n Submit\n</a>"
207
207
  },
208
208
  {
209
209
  "name": "input attributes",
@@ -215,8 +215,8 @@
215
215
  "data-tracking-dimension": 123
216
216
  }
217
217
  },
218
- "html": "<input value=\"Submit\" type=\"submit\" class=\"govuk-button\" data-module=\"govuk-button\" aria-controls=\"example-id\" data-tracking-dimension=\"123\">",
219
- "hidden": true
218
+ "hidden": true,
219
+ "html": "<input value=\"Submit\" type=\"submit\" class=\"govuk-button\" data-module=\"govuk-button\" aria-controls=\"example-id\" data-tracking-dimension=\"123\">"
220
220
  },
221
221
  {
222
222
  "name": "classes",
@@ -225,8 +225,8 @@
225
225
  "element": "button",
226
226
  "classes": "app-button--custom-modifier"
227
227
  },
228
- "html": "<button class=\"govuk-button app-button--custom-modifier\" data-module=\"govuk-button\">\n Submit\n</button>",
229
- "hidden": true
228
+ "hidden": true,
229
+ "html": "<button class=\"govuk-button app-button--custom-modifier\" data-module=\"govuk-button\">\n Submit\n</button>"
230
230
  },
231
231
  {
232
232
  "name": "link classes",
@@ -235,8 +235,8 @@
235
235
  "element": "a",
236
236
  "classes": "app-button--custom-modifier"
237
237
  },
238
- "html": "<a href=\"#\" role=\"button\" draggable=\"false\" class=\"govuk-button app-button--custom-modifier\" data-module=\"govuk-button\">\n Submit\n</a>",
239
- "hidden": true
238
+ "hidden": true,
239
+ "html": "<a href=\"#\" role=\"button\" draggable=\"false\" class=\"govuk-button app-button--custom-modifier\" data-module=\"govuk-button\">\n Submit\n</a>"
240
240
  },
241
241
  {
242
242
  "name": "input classes",
@@ -245,8 +245,8 @@
245
245
  "element": "input",
246
246
  "classes": "app-button--custom-modifier"
247
247
  },
248
- "html": "<input value=\"Submit\" type=\"submit\" class=\"govuk-button app-button--custom-modifier\" data-module=\"govuk-button\">",
249
- "hidden": true
248
+ "hidden": true,
249
+ "html": "<input value=\"Submit\" type=\"submit\" class=\"govuk-button app-button--custom-modifier\" data-module=\"govuk-button\">"
250
250
  },
251
251
  {
252
252
  "name": "name",
@@ -255,8 +255,8 @@
255
255
  "element": "button",
256
256
  "name": "start-now"
257
257
  },
258
- "html": "<button name=\"start-now\" class=\"govuk-button\" data-module=\"govuk-button\">\n Submit\n</button>",
259
- "hidden": true
258
+ "hidden": true,
259
+ "html": "<button name=\"start-now\" class=\"govuk-button\" data-module=\"govuk-button\">\n Submit\n</button>"
260
260
  },
261
261
  {
262
262
  "name": "type",
@@ -265,8 +265,8 @@
265
265
  "element": "button",
266
266
  "type": "button"
267
267
  },
268
- "html": "<button type=\"button\" class=\"govuk-button\" data-module=\"govuk-button\">\n Submit\n</button>",
269
- "hidden": true
268
+ "hidden": true,
269
+ "html": "<button type=\"button\" class=\"govuk-button\" data-module=\"govuk-button\">\n Submit\n</button>"
270
270
  },
271
271
  {
272
272
  "name": "input type",
@@ -275,8 +275,8 @@
275
275
  "element": "input",
276
276
  "type": "button"
277
277
  },
278
- "html": "<input value=\"Submit\" type=\"button\" class=\"govuk-button\" data-module=\"govuk-button\">",
279
- "hidden": true
278
+ "hidden": true,
279
+ "html": "<input value=\"Submit\" type=\"button\" class=\"govuk-button\" data-module=\"govuk-button\">"
280
280
  },
281
281
  {
282
282
  "name": "explicit link",
@@ -285,8 +285,8 @@
285
285
  "href": "/",
286
286
  "text": "Continue"
287
287
  },
288
- "html": "<a href=\"/\" role=\"button\" draggable=\"false\" class=\"govuk-button\" data-module=\"govuk-button\">\n Continue\n</a>",
289
- "hidden": true
288
+ "hidden": true,
289
+ "html": "<a href=\"/\" role=\"button\" draggable=\"false\" class=\"govuk-button\" data-module=\"govuk-button\">\n Continue\n</a>"
290
290
  },
291
291
  {
292
292
  "name": "no href",
@@ -294,8 +294,8 @@
294
294
  "text": "Submit",
295
295
  "element": "a"
296
296
  },
297
- "html": "<a href=\"#\" role=\"button\" draggable=\"false\" class=\"govuk-button\" data-module=\"govuk-button\">\n Submit\n</a>",
298
- "hidden": true
297
+ "hidden": true,
298
+ "html": "<a href=\"#\" role=\"button\" draggable=\"false\" class=\"govuk-button\" data-module=\"govuk-button\">\n Submit\n</a>"
299
299
  },
300
300
  {
301
301
  "name": "value",
@@ -304,8 +304,8 @@
304
304
  "element": "button",
305
305
  "value": "start"
306
306
  },
307
- "html": "<button value=\"start\" class=\"govuk-button\" data-module=\"govuk-button\">\n Submit\n</button>",
308
- "hidden": true
307
+ "hidden": true,
308
+ "html": "<button value=\"start\" class=\"govuk-button\" data-module=\"govuk-button\">\n Submit\n</button>"
309
309
  },
310
310
  {
311
311
  "name": "html",
@@ -314,14 +314,33 @@
314
314
  "element": "button",
315
315
  "html": "Start <em>now</em>"
316
316
  },
317
- "html": "<button class=\"govuk-button\" data-module=\"govuk-button\">\n Start <em>now</em>\n</button>",
318
- "hidden": true
317
+ "hidden": true,
318
+ "html": "<button class=\"govuk-button\" data-module=\"govuk-button\">\n Start <em>now</em>\n</button>"
319
319
  },
320
320
  {
321
- "name": "no data",
322
- "options": {},
323
- "html": "<button class=\"govuk-button\" data-module=\"govuk-button\">\n \n</button>",
324
- "hidden": true
321
+ "name": "no type",
322
+ "options": {
323
+ "text": "Button!"
324
+ },
325
+ "hidden": true,
326
+ "html": "<button class=\"govuk-button\" data-module=\"govuk-button\">\n Button!\n</button>"
327
+ },
328
+ {
329
+ "name": "no data-prevent-double-click",
330
+ "options": {
331
+ "text": "Submit"
332
+ },
333
+ "hidden": true,
334
+ "html": "<button class=\"govuk-button\" data-module=\"govuk-button\">\n Submit\n</button>"
335
+ },
336
+ {
337
+ "name": "don't prevent double click",
338
+ "options": {
339
+ "text": "Submit",
340
+ "preventDoubleClick": false
341
+ },
342
+ "hidden": true,
343
+ "html": "<button data-prevent-double-click=\"false\" class=\"govuk-button\" data-module=\"govuk-button\">\n Submit\n</button>"
325
344
  }
326
345
  ]
327
346
  }
@@ -37,7 +37,7 @@ treat it as an interactive element - without this it will be
37
37
 
38
38
  {#- Define common attributes we can use for both button and input types #}
39
39
 
40
- {%- set buttonAttributes %}{% if params.name %} name="{{ params.name }}"{% endif %}{% if params.disabled %} disabled="disabled" aria-disabled="true"{% endif %}{% if params.preventDoubleClick %} data-prevent-double-click="true"{% endif %}{% endset %}
40
+ {%- set buttonAttributes %}{% if params.name %} name="{{ params.name }}"{% endif %}{% if params.disabled %} disabled="disabled" aria-disabled="true"{% endif %}{% if params.preventDoubleClick !== undefined %} data-prevent-double-click="{{params.preventDoubleClick}}"{% endif %}{% endset %}
41
41
 
42
42
  {#- Actually create a button... or a link! #}
43
43
 
@@ -17,6 +17,15 @@
17
17
  @include govuk-font($size: false, $tabular: true);
18
18
  margin-top: 0;
19
19
  margin-bottom: 0;
20
+
21
+ &:after {
22
+ // Zero-width space that will reserve vertical space when no hint is provided
23
+ // as:
24
+ // - setting a min-height is not possible without a magic number
25
+ // because the line-height is set by the `govuk-font` call above
26
+ // - using `:empty` is not possible as the hint macro outputs line breaks
27
+ content: "\200B";
28
+ }
20
29
  }
21
30
 
22
31
  .govuk-character-count__message--disabled {