govuk_publishing_components 28.4.0 → 28.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (207) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -3
  3. data/app/assets/javascripts/govuk_publishing_components/analytics/track-select-change.js +4 -3
  4. data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +21 -291
  5. data/app/assets/javascripts/govuk_publishing_components/components/button.js +1 -1
  6. data/app/assets/javascripts/govuk_publishing_components/components/character-count.js +1 -1
  7. data/app/assets/javascripts/govuk_publishing_components/components/checkboxes.js +1 -1
  8. data/app/assets/javascripts/govuk_publishing_components/components/details.js +1 -1
  9. data/app/assets/javascripts/govuk_publishing_components/components/error-summary.js +1 -1
  10. data/app/assets/javascripts/govuk_publishing_components/components/feedback.js +7 -6
  11. data/app/assets/javascripts/govuk_publishing_components/components/layout-header.js +1 -1
  12. data/app/assets/javascripts/govuk_publishing_components/components/radio.js +1 -1
  13. data/app/assets/javascripts/govuk_publishing_components/components/skip-link.js +5 -0
  14. data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +40 -37
  15. data/app/assets/javascripts/govuk_publishing_components/components/tabs.js +1 -1
  16. data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/barchart-enhancement.js +2 -1
  17. data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/magna-charta.js +8 -10
  18. data/app/assets/javascripts/govuk_publishing_components/lib/initial-focus.js +4 -3
  19. data/app/assets/javascripts/govuk_publishing_components/lib/toggle-input-class-on-focus.js +4 -3
  20. data/app/assets/javascripts/govuk_publishing_components/lib/toggle.js +4 -3
  21. data/app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-reporter.js +1796 -911
  22. data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +1 -329
  23. data/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +1 -1
  24. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +95 -56
  25. data/app/assets/stylesheets/govuk_publishing_components/components/print/_accordion.scss +6 -17
  26. data/app/assets/stylesheets/govuk_publishing_components/govuk_frontend_support.scss +0 -9
  27. data/app/models/govuk_publishing_components/component_docs.rb +1 -1
  28. data/app/views/govuk_publishing_components/components/_accordion.html.erb +30 -15
  29. data/app/views/govuk_publishing_components/components/_action_link.html.erb +1 -1
  30. data/app/views/govuk_publishing_components/components/_button.html.erb +4 -4
  31. data/app/views/govuk_publishing_components/components/_character_count.html.erb +2 -2
  32. data/app/views/govuk_publishing_components/components/_checkboxes.html.erb +2 -2
  33. data/app/views/govuk_publishing_components/components/_details.html.erb +1 -1
  34. data/app/views/govuk_publishing_components/components/_error_message.html.erb +1 -1
  35. data/app/views/govuk_publishing_components/components/_error_summary.html.erb +0 -1
  36. data/app/views/govuk_publishing_components/components/_heading.html.erb +1 -1
  37. data/app/views/govuk_publishing_components/components/_hint.html.erb +1 -1
  38. data/app/views/govuk_publishing_components/components/_input.html.erb +3 -3
  39. data/app/views/govuk_publishing_components/components/_inset_text.html.erb +12 -1
  40. data/app/views/govuk_publishing_components/components/_intervention.html.erb +2 -2
  41. data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +1 -1
  42. data/app/views/govuk_publishing_components/components/_list.html.erb +1 -1
  43. data/app/views/govuk_publishing_components/components/_modal_dialogue.html.erb +1 -1
  44. data/app/views/govuk_publishing_components/components/_notice.html.erb +1 -1
  45. data/app/views/govuk_publishing_components/components/_print_link.html.erb +2 -2
  46. data/app/views/govuk_publishing_components/components/_radio.html.erb +1 -1
  47. data/app/views/govuk_publishing_components/components/_search.html.erb +4 -6
  48. data/app/views/govuk_publishing_components/components/_select.html.erb +20 -30
  49. data/app/views/govuk_publishing_components/components/_skip_link.html.erb +1 -1
  50. data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +8 -9
  51. data/app/views/govuk_publishing_components/components/_textarea.html.erb +1 -1
  52. data/app/views/govuk_publishing_components/components/_title.html.erb +3 -3
  53. data/app/views/govuk_publishing_components/components/docs/accordion.yml +2 -97
  54. data/app/views/govuk_publishing_components/components/docs/govspeak.yml +1 -1
  55. data/app/views/govuk_publishing_components/components/docs/inset_text.yml +6 -0
  56. data/app/views/govuk_publishing_components/components/docs/select.yml +12 -0
  57. data/app/views/govuk_publishing_components/components/docs/share_links.yml +1 -1
  58. data/app/views/govuk_publishing_components/components/docs/step_by_step_nav.yml +13 -13
  59. data/app/views/govuk_publishing_components/components/docs/tabs.yml +1 -1
  60. data/app/views/govuk_publishing_components/components/docs/textarea.yml +1 -1
  61. data/app/views/govuk_publishing_components/components/feedback/_problem_form.html.erb +3 -3
  62. data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +11 -11
  63. data/config/initializers/assets.rb +1 -0
  64. data/config/locales/ar.yml +2 -0
  65. data/config/locales/az.yml +2 -1
  66. data/config/locales/be.yml +2 -0
  67. data/config/locales/bg.yml +2 -0
  68. data/config/locales/bn.yml +2 -0
  69. data/config/locales/cs.yml +2 -0
  70. data/config/locales/cy.yml +2 -0
  71. data/config/locales/da.yml +2 -0
  72. data/config/locales/de.yml +2 -0
  73. data/config/locales/dr.yml +2 -0
  74. data/config/locales/el.yml +2 -0
  75. data/config/locales/es-419.yml +2 -0
  76. data/config/locales/es.yml +2 -0
  77. data/config/locales/et.yml +2 -0
  78. data/config/locales/fa.yml +2 -1
  79. data/config/locales/fi.yml +2 -0
  80. data/config/locales/fr.yml +2 -0
  81. data/config/locales/gd.yml +2 -0
  82. data/config/locales/gu.yml +2 -0
  83. data/config/locales/he.yml +2 -0
  84. data/config/locales/hi.yml +2 -0
  85. data/config/locales/hr.yml +2 -0
  86. data/config/locales/hu.yml +2 -0
  87. data/config/locales/hy.yml +2 -0
  88. data/config/locales/id.yml +2 -1
  89. data/config/locales/is.yml +2 -0
  90. data/config/locales/it.yml +2 -0
  91. data/config/locales/ja.yml +2 -1
  92. data/config/locales/ka.yml +2 -0
  93. data/config/locales/kk.yml +2 -0
  94. data/config/locales/ko.yml +2 -1
  95. data/config/locales/lt.yml +2 -0
  96. data/config/locales/lv.yml +2 -0
  97. data/config/locales/ms.yml +2 -1
  98. data/config/locales/mt.yml +2 -0
  99. data/config/locales/nl.yml +2 -0
  100. data/config/locales/no.yml +2 -0
  101. data/config/locales/pa-pk.yml +2 -0
  102. data/config/locales/pa.yml +2 -0
  103. data/config/locales/pl.yml +2 -0
  104. data/config/locales/ps.yml +2 -0
  105. data/config/locales/pt.yml +2 -0
  106. data/config/locales/ro.yml +2 -0
  107. data/config/locales/ru.yml +2 -0
  108. data/config/locales/si.yml +2 -0
  109. data/config/locales/sk.yml +2 -0
  110. data/config/locales/sl.yml +2 -0
  111. data/config/locales/so.yml +2 -0
  112. data/config/locales/sq.yml +2 -0
  113. data/config/locales/sr.yml +2 -1
  114. data/config/locales/sv.yml +2 -0
  115. data/config/locales/sw.yml +2 -0
  116. data/config/locales/ta.yml +2 -0
  117. data/config/locales/th.yml +2 -1
  118. data/config/locales/tk.yml +2 -0
  119. data/config/locales/tr.yml +2 -0
  120. data/config/locales/uk.yml +2 -0
  121. data/config/locales/ur.yml +2 -0
  122. data/config/locales/uz.yml +2 -0
  123. data/config/locales/vi.yml +2 -1
  124. data/config/locales/zh-hk.yml +2 -1
  125. data/config/locales/zh-tw.yml +2 -1
  126. data/config/locales/zh.yml +2 -1
  127. data/lib/govuk_publishing_components/presenters/select_helper.rb +85 -0
  128. data/lib/govuk_publishing_components/version.rb +1 -1
  129. data/lib/govuk_publishing_components.rb +1 -1
  130. data/node_modules/govuk-frontend/govuk/all.js +294 -76
  131. data/node_modules/govuk-frontend/govuk/components/accordion/_index.scss +274 -99
  132. data/node_modules/govuk-frontend/govuk/components/accordion/accordion.js +169 -65
  133. data/node_modules/govuk-frontend/govuk/components/accordion/fixtures.json +37 -5
  134. data/node_modules/govuk-frontend/govuk/components/accordion/macro-options.json +4 -4
  135. data/node_modules/govuk-frontend/govuk/components/button/button.js +2 -2
  136. data/node_modules/govuk-frontend/govuk/components/character-count/character-count.js +3 -3
  137. data/node_modules/govuk-frontend/govuk/components/character-count/fixtures.json +15 -2
  138. data/node_modules/govuk-frontend/govuk/components/checkboxes/checkboxes.js +8 -10
  139. data/node_modules/govuk-frontend/govuk/components/checkboxes/fixtures.json +52 -15
  140. data/node_modules/govuk-frontend/govuk/components/cookie-banner/_index.scss +0 -2
  141. data/node_modules/govuk-frontend/govuk/components/cookie-banner/fixtures.json +31 -0
  142. data/node_modules/govuk-frontend/govuk/components/date-input/fixtures.json +25 -25
  143. data/node_modules/govuk-frontend/govuk/components/details/details.js +2 -2
  144. data/node_modules/govuk-frontend/govuk/components/error-message/_index.scss +1 -0
  145. data/node_modules/govuk-frontend/govuk/components/error-message/fixtures.json +8 -8
  146. data/node_modules/govuk-frontend/govuk/components/error-message/template.njk +2 -2
  147. data/node_modules/govuk-frontend/govuk/components/error-summary/error-summary.js +24 -3
  148. data/node_modules/govuk-frontend/govuk/components/error-summary/fixtures.json +25 -16
  149. data/node_modules/govuk-frontend/govuk/components/error-summary/macro-options.json +6 -0
  150. data/node_modules/govuk-frontend/govuk/components/error-summary/template.njk +2 -1
  151. data/node_modules/govuk-frontend/govuk/components/file-upload/fixtures.json +4 -4
  152. data/node_modules/govuk-frontend/govuk/components/footer/_index.scss +3 -37
  153. data/node_modules/govuk-frontend/govuk/components/footer/fixtures.json +119 -15
  154. data/node_modules/govuk-frontend/govuk/components/footer/macro-options.json +6 -0
  155. data/node_modules/govuk-frontend/govuk/components/footer/template.njk +1 -1
  156. data/node_modules/govuk-frontend/govuk/components/header/_index.scss +10 -4
  157. data/node_modules/govuk-frontend/govuk/components/header/fixtures.json +11 -11
  158. data/node_modules/govuk-frontend/govuk/components/header/header.js +4 -4
  159. data/node_modules/govuk-frontend/govuk/components/header/template.njk +4 -3
  160. data/node_modules/govuk-frontend/govuk/components/hint/_index.scss +1 -3
  161. data/node_modules/govuk-frontend/govuk/components/input/_index.scss +1 -1
  162. data/node_modules/govuk-frontend/govuk/components/input/fixtures.json +40 -40
  163. data/node_modules/govuk-frontend/govuk/components/input/template.njk +4 -3
  164. data/node_modules/govuk-frontend/govuk/components/notification-banner/notification-banner.js +499 -2
  165. data/node_modules/govuk-frontend/govuk/components/phase-banner/fixtures.json +2 -2
  166. data/node_modules/govuk-frontend/govuk/components/radios/_index.scss +0 -8
  167. data/node_modules/govuk-frontend/govuk/components/radios/fixtures.json +44 -45
  168. data/node_modules/govuk-frontend/govuk/components/radios/radios.js +4 -4
  169. data/node_modules/govuk-frontend/govuk/components/radios/template.njk +2 -9
  170. data/node_modules/govuk-frontend/govuk/components/select/_index.scss +6 -1
  171. data/node_modules/govuk-frontend/govuk/components/select/fixtures.json +3 -3
  172. data/node_modules/govuk-frontend/govuk/components/skip-link/_index.scss +13 -0
  173. data/node_modules/govuk-frontend/govuk/components/skip-link/fixtures.json +9 -9
  174. data/node_modules/govuk-frontend/govuk/components/skip-link/skip-link.js +1108 -0
  175. data/node_modules/govuk-frontend/govuk/components/skip-link/template.njk +1 -1
  176. data/node_modules/govuk-frontend/govuk/components/summary-list/_index.scss +20 -23
  177. data/node_modules/govuk-frontend/govuk/components/summary-list/fixtures.json +86 -1
  178. data/node_modules/govuk-frontend/govuk/components/summary-list/template.njk +1 -4
  179. data/node_modules/govuk-frontend/govuk/components/tabs/_index.scss +2 -2
  180. data/node_modules/govuk-frontend/govuk/components/tabs/tabs.js +2 -2
  181. data/node_modules/govuk-frontend/govuk/components/tag/_index.scss +0 -5
  182. data/node_modules/govuk-frontend/govuk/components/tag/fixtures.json +2 -2
  183. data/node_modules/govuk-frontend/govuk/components/textarea/_index.scss +1 -1
  184. data/node_modules/govuk-frontend/govuk/components/textarea/fixtures.json +4 -4
  185. data/node_modules/govuk-frontend/govuk/core/_all.scss +0 -1
  186. data/node_modules/govuk-frontend/govuk/core/_global-styles.scss +0 -6
  187. data/node_modules/govuk-frontend/govuk/core/_links.scss +0 -6
  188. data/node_modules/govuk-frontend/govuk/core/_lists.scss +0 -6
  189. data/node_modules/govuk-frontend/govuk/core/_section-break.scss +0 -6
  190. data/node_modules/govuk-frontend/govuk/core/_typography.scss +0 -6
  191. data/node_modules/govuk-frontend/govuk/objects/_all.scss +1 -0
  192. data/node_modules/govuk-frontend/govuk/objects/_main-wrapper.scss +15 -30
  193. data/node_modules/govuk-frontend/govuk/{core → objects}/_template.scss +1 -5
  194. data/node_modules/govuk-frontend/govuk/overrides/_display.scss +0 -6
  195. data/node_modules/govuk-frontend/govuk/overrides/_spacing.scss +0 -6
  196. data/node_modules/govuk-frontend/govuk/overrides/_text-align.scss +0 -6
  197. data/node_modules/govuk-frontend/govuk/overrides/_typography.scss +0 -6
  198. data/node_modules/govuk-frontend/govuk/overrides/_width.scss +0 -6
  199. data/node_modules/govuk-frontend/govuk/settings/_colours-organisations.scss +3 -0
  200. data/node_modules/govuk-frontend/govuk/settings/_measurements.scss +0 -10
  201. data/node_modules/govuk-frontend/govuk/tools/_all.scss +0 -1
  202. data/node_modules/govuk-frontend/package.json +1 -1
  203. metadata +24 -45
  204. data/app/assets/javascripts/govuk_publishing_components/lib/header-navigation.js +0 -100
  205. data/lib/govuk_publishing_components/presenters/select.rb +0 -43
  206. data/lib/tasks/govuk_publishing_components_tasks.rake +0 -49
  207. data/node_modules/govuk-frontend/govuk/tools/_iff.scss +0 -17
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_publishing_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 28.4.0
4
+ version: 28.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-25 00:00:00.000000000 Z
11
+ date: 2022-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: psych
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '4'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '4'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: rails
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -192,54 +206,20 @@ dependencies:
192
206
  - - ">="
193
207
  - !ruby/object:Gem::Version
194
208
  version: '0'
195
- - !ruby/object:Gem::Dependency
196
- name: jasmine
197
- requirement: !ruby/object:Gem::Requirement
198
- requirements:
199
- - - "~>"
200
- - !ruby/object:Gem::Version
201
- version: 3.10.0
202
- type: :development
203
- prerelease: false
204
- version_requirements: !ruby/object:Gem::Requirement
205
- requirements:
206
- - - "~>"
207
- - !ruby/object:Gem::Version
208
- version: 3.10.0
209
- - !ruby/object:Gem::Dependency
210
- name: jasmine_selenium_runner
211
- requirement: !ruby/object:Gem::Requirement
212
- requirements:
213
- - - "~>"
214
- - !ruby/object:Gem::Version
215
- version: 3.0.0
216
- type: :development
217
- prerelease: false
218
- version_requirements: !ruby/object:Gem::Requirement
219
- requirements:
220
- - - "~>"
221
- - !ruby/object:Gem::Version
222
- version: 3.0.0
223
209
  - !ruby/object:Gem::Dependency
224
210
  name: percy-capybara
225
211
  requirement: !ruby/object:Gem::Requirement
226
212
  requirements:
227
213
  - - "~>"
228
214
  - !ruby/object:Gem::Version
229
- version: '4.0'
230
- - - ">="
231
- - !ruby/object:Gem::Version
232
- version: 4.0.2
215
+ version: 5.0.0
233
216
  type: :development
234
217
  prerelease: false
235
218
  version_requirements: !ruby/object:Gem::Requirement
236
219
  requirements:
237
220
  - - "~>"
238
221
  - !ruby/object:Gem::Version
239
- version: '4.0'
240
- - - ">="
241
- - !ruby/object:Gem::Version
242
- version: 4.0.2
222
+ version: 5.0.0
243
223
  - !ruby/object:Gem::Dependency
244
224
  name: pry-byebug
245
225
  requirement: !ruby/object:Gem::Requirement
@@ -507,6 +487,7 @@ files:
507
487
  - app/assets/javascripts/govuk_publishing_components/components/reorderable-list.js
508
488
  - app/assets/javascripts/govuk_publishing_components/components/show-password.js
509
489
  - app/assets/javascripts/govuk_publishing_components/components/single-page-notification-button.js
490
+ - app/assets/javascripts/govuk_publishing_components/components/skip-link.js
510
491
  - app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js
511
492
  - app/assets/javascripts/govuk_publishing_components/components/tabs.js
512
493
  - app/assets/javascripts/govuk_publishing_components/dependencies.js
@@ -519,7 +500,6 @@ files:
519
500
  - app/assets/javascripts/govuk_publishing_components/lib/govspeak/barchart-enhancement.js
520
501
  - app/assets/javascripts/govuk_publishing_components/lib/govspeak/magna-charta.js
521
502
  - app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js
522
- - app/assets/javascripts/govuk_publishing_components/lib/header-navigation.js
523
503
  - app/assets/javascripts/govuk_publishing_components/lib/initial-focus.js
524
504
  - app/assets/javascripts/govuk_publishing_components/lib/primary-links.js
525
505
  - app/assets/javascripts/govuk_publishing_components/lib/toggle-input-class-on-focus.js
@@ -967,14 +947,13 @@ files:
967
947
  - lib/govuk_publishing_components/presenters/public_layout_helper.rb
968
948
  - lib/govuk_publishing_components/presenters/related_navigation_helper.rb
969
949
  - lib/govuk_publishing_components/presenters/schema_org.rb
970
- - lib/govuk_publishing_components/presenters/select.rb
950
+ - lib/govuk_publishing_components/presenters/select_helper.rb
971
951
  - lib/govuk_publishing_components/presenters/shared_helper.rb
972
952
  - lib/govuk_publishing_components/presenters/single_page_notification_button_helper.rb
973
953
  - lib/govuk_publishing_components/presenters/step_by_step_nav_helper.rb
974
954
  - lib/govuk_publishing_components/presenters/subscription_links_helper.rb
975
955
  - lib/govuk_publishing_components/presenters/translation_nav_helper.rb
976
956
  - lib/govuk_publishing_components/version.rb
977
- - lib/tasks/govuk_publishing_components_tasks.rake
978
957
  - node_modules/axe-core/CHANGELOG.md
979
958
  - node_modules/axe-core/CONTRIBUTING.md
980
959
  - node_modules/axe-core/LICENSE
@@ -1777,6 +1756,7 @@ files:
1777
1756
  - node_modules/govuk-frontend/govuk/components/skip-link/fixtures.json
1778
1757
  - node_modules/govuk-frontend/govuk/components/skip-link/macro-options.json
1779
1758
  - node_modules/govuk-frontend/govuk/components/skip-link/macro.njk
1759
+ - node_modules/govuk-frontend/govuk/components/skip-link/skip-link.js
1780
1760
  - node_modules/govuk-frontend/govuk/components/skip-link/template.njk
1781
1761
  - node_modules/govuk-frontend/govuk/components/summary-list/README.md
1782
1762
  - node_modules/govuk-frontend/govuk/components/summary-list/_index.scss
@@ -1826,7 +1806,6 @@ files:
1826
1806
  - node_modules/govuk-frontend/govuk/core/_links.scss
1827
1807
  - node_modules/govuk-frontend/govuk/core/_lists.scss
1828
1808
  - node_modules/govuk-frontend/govuk/core/_section-break.scss
1829
- - node_modules/govuk-frontend/govuk/core/_template.scss
1830
1809
  - node_modules/govuk-frontend/govuk/core/_typography.scss
1831
1810
  - node_modules/govuk-frontend/govuk/helpers/_all.scss
1832
1811
  - node_modules/govuk-frontend/govuk/helpers/_clearfix.scss
@@ -1846,6 +1825,7 @@ files:
1846
1825
  - node_modules/govuk-frontend/govuk/objects/_form-group.scss
1847
1826
  - node_modules/govuk-frontend/govuk/objects/_grid.scss
1848
1827
  - node_modules/govuk-frontend/govuk/objects/_main-wrapper.scss
1828
+ - node_modules/govuk-frontend/govuk/objects/_template.scss
1849
1829
  - node_modules/govuk-frontend/govuk/objects/_width-container.scss
1850
1830
  - node_modules/govuk-frontend/govuk/overrides/_all.scss
1851
1831
  - node_modules/govuk-frontend/govuk/overrides/_display.scss
@@ -1874,7 +1854,6 @@ files:
1874
1854
  - node_modules/govuk-frontend/govuk/tools/_exports.scss
1875
1855
  - node_modules/govuk-frontend/govuk/tools/_font-url.scss
1876
1856
  - node_modules/govuk-frontend/govuk/tools/_ie8.scss
1877
- - node_modules/govuk-frontend/govuk/tools/_iff.scss
1878
1857
  - node_modules/govuk-frontend/govuk/tools/_image-url.scss
1879
1858
  - node_modules/govuk-frontend/govuk/tools/_px-to-em.scss
1880
1859
  - node_modules/govuk-frontend/govuk/tools/_px-to-rem.scss
@@ -2022,14 +2001,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
2022
2001
  requirements:
2023
2002
  - - ">="
2024
2003
  - !ruby/object:Gem::Version
2025
- version: '2.6'
2004
+ version: '2.7'
2026
2005
  required_rubygems_version: !ruby/object:Gem::Requirement
2027
2006
  requirements:
2028
2007
  - - ">="
2029
2008
  - !ruby/object:Gem::Version
2030
2009
  version: '0'
2031
2010
  requirements: []
2032
- rubygems_version: 3.0.3
2011
+ rubygems_version: 3.3.8
2033
2012
  signing_key:
2034
2013
  specification_version: 4
2035
2014
  summary: A gem to document components in GOV.UK frontend applications
@@ -1,100 +0,0 @@
1
- /* eslint-disable no-var */
2
-
3
- // used by the header navigation from govuk_template
4
-
5
- (function () {
6
- 'use strict'
7
-
8
- if (document.querySelectorAll && document.addEventListener) {
9
- var els = document.querySelectorAll('.js-header-toggle')
10
- for (var i = 0; i < els.length; i++) {
11
- // Reassign current index to bypass rules in Chrome and Firefox around indexed property setting
12
- var thisEl = els[i]
13
-
14
- // If the element is an a tag, convert it to a button
15
- // This is to target instances where we want to change behaviour between a js and a no-js view eg: the search button on the mobile menu for some government pages. On no-js it's just a link to /search
16
- // This swaps a link for no-js to a button, making it interactable. Using a link for interactivity is poor accessibility as it's a misuse of the link tag and can be confusing to assistive tech users
17
-
18
- if (thisEl.tagName === 'A') {
19
- var attributes = thisEl.attributes
20
- var button = document.createElement('button')
21
-
22
- for (var k = 0; k < attributes.length; k++) {
23
- var thisAttr = attributes[k].name
24
-
25
- if (thisAttr === 'href') {
26
- if (button.getAttribute('data-search-toggle-for')) {
27
- continue
28
- } else {
29
- button.setAttribute('data-search-toggle-for', thisEl.getAttribute('href').substr(1))
30
- }
31
- } else if (thisAttr !== 'data-button-text') {
32
- button.setAttribute(thisAttr, thisEl.getAttribute(thisAttr))
33
- }
34
- }
35
-
36
- button.innerText = thisEl.getAttribute('data-button-text') || thisEl.innerText
37
-
38
- thisEl.parentNode.replaceChild(button, thisEl)
39
- thisEl = button
40
- }
41
-
42
- thisEl.addEventListener('click', function (e) {
43
- e.preventDefault()
44
- var target = document.getElementById(this.getAttribute('data-search-toggle-for'))
45
- var targetClass = target.getAttribute('class') || ''
46
- var sourceClass = this.getAttribute('class') || ''
47
- var isSearchToggle = sourceClass.match('search-toggle')
48
- var showText = this.getAttribute('data-show-text') || 'Show search'
49
- var hideText = this.getAttribute('data-hide-text') || 'Hide search'
50
- var buttonName = this.getAttribute('data-button-name') || 'menu'
51
-
52
- if (targetClass.indexOf('js-visible') !== -1) {
53
- target.setAttribute('class', targetClass.replace(/(^|\s)js-visible(\s|$)/, ''))
54
- if (window.GOVUK.analytics && window.GOVUK.analytics.trackEvent) {
55
- window.GOVUK.analytics.trackEvent('headerClicked', buttonName + 'Closed', { label: 'none' })
56
- }
57
- } else {
58
- target.setAttribute('class', targetClass + ' js-visible')
59
- if (window.GOVUK.analytics && window.GOVUK.analytics.trackEvent) {
60
- window.GOVUK.analytics.trackEvent('headerClicked', buttonName + 'Opened', { label: 'none' })
61
- }
62
- }
63
- if (sourceClass.indexOf('js-visible') !== -1) {
64
- this.setAttribute('class', sourceClass.replace(/(^|\s)js-visible(\s|$)/, ''))
65
- if (isSearchToggle) {
66
- this.innerText = showText
67
- }
68
- } else {
69
- this.setAttribute('class', sourceClass + ' js-visible')
70
- if (isSearchToggle) {
71
- this.innerText = hideText
72
- }
73
- }
74
- this.setAttribute('aria-expanded', this.getAttribute('aria-expanded') !== 'true')
75
- target.setAttribute('aria-hidden', target.getAttribute('aria-hidden') === 'false')
76
- })
77
- }
78
- }
79
- }).call(this)
80
-
81
- ;(function () {
82
- var $menuToggleButtons = document.querySelectorAll('.govuk-js-header-toggle')
83
-
84
- for (var j = 0; j < $menuToggleButtons.length; j++) {
85
- var element = $menuToggleButtons[j]
86
-
87
- element.addEventListener('click', function (event) {
88
- var buttonName = event.target.getAttribute('data-button-name') || 'menu'
89
- var expanded = event.target.getAttribute('aria-expanded')
90
-
91
- if (window.GOVUK.analytics && window.GOVUK.analytics.trackEvent) {
92
- if (expanded === 'true') {
93
- window.GOVUK.analytics.trackEvent('headerClicked', buttonName + 'Closed', { label: 'none' })
94
- } else {
95
- window.GOVUK.analytics.trackEvent('headerClicked', buttonName + 'Opened', { label: 'none' })
96
- }
97
- }
98
- })
99
- }
100
- })()
@@ -1,43 +0,0 @@
1
- module GovukPublishingComponents
2
- module Presenters
3
- class SelectHelper
4
- attr_reader :options, :option_markup, :selected_option
5
-
6
- def initialize(options)
7
- @options = options
8
- @option_markup = get_options
9
- end
10
-
11
- def data_tracking?
12
- @options.any? { |item| item[:data_attributes] && item[:data_attributes][:track_category] && item[:data_attributes][:track_action] }
13
- end
14
-
15
- private
16
-
17
- def get_options
18
- return if options.nil?
19
-
20
- options.map do |option|
21
- @selected_option = option[:value] if option[:selected]
22
- [
23
- option[:text],
24
- option[:value],
25
- options_data_attribute(option[:data_attributes]),
26
- ]
27
- end
28
- end
29
-
30
- def options_data_attribute(attributes)
31
- return {} if attributes.nil?
32
-
33
- attrs = {}
34
- attributes.each do |key, value|
35
- key_name = "data-#{key.to_s.split('_').join('-')}"
36
- attrs[key_name] = value.is_a?(Hash) ? value.to_json : value
37
- end
38
-
39
- attrs
40
- end
41
- end
42
- end
43
- end
@@ -1,49 +0,0 @@
1
- namespace :component do
2
- desc "warns if component view files exist without corresponding documentation"
3
- task :validate_documentation_exists do
4
- print "Validating that each component has documentation... "
5
- components_missing_docs = []
6
- component_views = Dir["app/views/#{GovukPublishingComponents::Config.component_directory_name}/**/*.html.erb"]
7
- component_views.each do |partial|
8
- expected_component_docs_file = partial.split("/")[-1].gsub("html.erb", "yml")
9
- expected_component_docs_file.sub!(/^_/, "")
10
-
11
- expected_component_docs_path = "app/views/#{GovukPublishingComponents::Config.component_directory_name}/docs/#{expected_component_docs_file}"
12
- components_missing_docs << partial unless File.exist?(expected_component_docs_path)
13
- end
14
-
15
- if components_missing_docs.any?
16
- error = "You have components which are missing documentation. These components will not be displayed in the component guide:\n"
17
- components_missing_docs.each { |component| error += "\t#{component}\n" }
18
- error += "\n"
19
- raise NotImplementedError, error
20
- end
21
- puts "✔︎"
22
- end
23
-
24
- desc "warns if component is missing accessibility criteria"
25
- task :validate_accessibility_criteria_exist do
26
- print "Validating that each component has accessibility criteria... "
27
- errors = []
28
-
29
- component_docs = Dir["app/views/#{GovukPublishingComponents::Config.component_directory_name}/**/*.yml"]
30
- component_docs.each do |doc_file|
31
- file = YAML.load_file(doc_file)
32
-
33
- if file["accessibility_criteria"].nil? && file["shared_accessibility_criteria"].nil?
34
- errors << file["name"]
35
- end
36
- end
37
- if errors.any?
38
- error = "The following components need accessibility criteria:\n#{errors.join("\n")}"
39
- raise NotImplementedError, error
40
- end
41
- puts "✔︎"
42
- end
43
-
44
- desc "warns if component view files exist without corresponding documentation or accessibility critera"
45
- task :validate_documentation do
46
- Rake::Task["component:validate_documentation_exists"].invoke
47
- Rake::Task["component:validate_accessibility_criteria_exist"].invoke
48
- end
49
- end
@@ -1,17 +0,0 @@
1
- ////
2
- /// @group tools
3
- ////
4
-
5
- /// Syntactic sugar around Sass' built-in `if` function that does not require
6
- /// you to pass a value for `$if-false`.
7
- ///
8
- /// @param {Boolean} $condition - Whether to return the value of `$if-true`
9
- /// @param {Mixed} $if-true - Value to return if `$condition` is truthy
10
- /// @return {Mixed} Value of `$if-true` if `$condition` is truthy, else null
11
- /// @access private
12
- /// @deprecated We will be removing this function in a future release, use `if($condition, $if-true, null);` instead.
13
-
14
- @function iff($condition, $if-true) {
15
- @warn "The `iff` function will be removed in a future release, use `if($condition, $if-true, null);` instead.";
16
- @return if($condition, $if-true, null);
17
- }