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
@@ -24,7 +24,8 @@ window.GOVUK = window.GOVUK || {};
24
24
 
25
25
  for (var i = 0; i < $barcharts.length; i++) {
26
26
  var $table = $barcharts[i]
27
- new GOVUK.Modules.MagnaCharta().start($table, { toggleText: 'Change between chart and table' })
27
+ var magna = new GOVUK.Modules.MagnaCharta($table, { toggleText: 'Change between chart and table' })
28
+ magna.init()
28
29
  $table.className = $table.className + ' js-barchart-table-init'
29
30
  }
30
31
  }
@@ -4,10 +4,8 @@ window.GOVUK = window.GOVUK || {}
4
4
  window.GOVUK.Modules = window.GOVUK.Modules || {};
5
5
 
6
6
  (function (Modules) {
7
- function MagnaCharta () { }
8
-
9
- MagnaCharta.prototype.start = function ($module, options) {
10
- this.$module = $module[0]
7
+ function MagnaCharta ($module, options) {
8
+ this.$table = $module
11
9
  this.options = {
12
10
  outOf: 65,
13
11
  applyOnInit: true,
@@ -22,14 +20,14 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
22
20
  }
23
21
 
24
22
  for (var k in options) this.options[k] = options[k]
23
+ }
24
+
25
+ MagnaCharta.prototype.init = function () {
25
26
  this.detectIEVersion()
26
27
 
27
28
  // Magna Charta doesn't work in IE7 or less - so plain tables are shown to those browsers
28
29
  this.ENABLED = !(this.ie && this.ie < 8)
29
30
 
30
- // store a reference to the table in the object
31
- this.$table = $module
32
-
33
31
  // a container around the graph element so that it can be targeted by screen readers, allowing us to inform screen reader users that the graph isn't accessible
34
32
  this.$graphContainer = document.createElement('div')
35
33
  this.$graphContainer.className = 'mc-chart-container'
@@ -47,7 +45,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
47
45
  this.$graph.classList.add('mc-chart')
48
46
 
49
47
  // get the id of the current chart within the page so that it can be used during the generation of the toggleLink
50
- this.chartId = this.getChartId($module)
48
+ this.chartId = this.getChartId()
51
49
 
52
50
  // set the stacked option based on
53
51
  // giving the table a class of mc-stacked
@@ -458,12 +456,12 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
458
456
  }
459
457
  }
460
458
 
461
- MagnaCharta.prototype.getChartId = function (module) {
459
+ MagnaCharta.prototype.getChartId = function () {
462
460
  var allCharts = document.querySelectorAll('table.js-barchart-table')
463
461
  var id = null
464
462
 
465
463
  for (var i = 0; i < allCharts.length; i++) {
466
- if (allCharts[i] === module) {
464
+ if (allCharts[i] === this.$table) {
467
465
  id = i
468
466
  }
469
467
  }
@@ -2,10 +2,11 @@ window.GOVUK = window.GOVUK || {}
2
2
  window.GOVUK.Modules = window.GOVUK.Modules || {};
3
3
 
4
4
  (function (Modules) {
5
- function InitialFocus () { }
5
+ function InitialFocus ($module) {
6
+ this.$module = $module
7
+ }
6
8
 
7
- InitialFocus.prototype.start = function ($module) {
8
- this.$module = $module[0]
9
+ InitialFocus.prototype.init = function () {
9
10
  this.$module.focus()
10
11
  }
11
12
 
@@ -7,10 +7,11 @@ window.GOVUK = window.GOVUK || {}
7
7
  window.GOVUK.Modules = window.GOVUK.Modules || {};
8
8
 
9
9
  (function (Modules) {
10
- function GemToggleInputClassOnFocus () { }
10
+ function GemToggleInputClassOnFocus ($module) {
11
+ this.$module = $module
12
+ }
11
13
 
12
- GemToggleInputClassOnFocus.prototype.start = function ($module) {
13
- this.$module = $module[0]
14
+ GemToggleInputClassOnFocus.prototype.init = function () {
14
15
  this.toggleTarget = this.$module.querySelector('.js-class-toggle')
15
16
  this.$module.addFocusClass = this.addFocusClass.bind(this)
16
17
  this.$module.removeFocusClassFromEmptyInput = this.removeFocusClassFromEmptyInput.bind(this)
@@ -87,10 +87,11 @@ window.GOVUK = window.GOVUK || {}
87
87
  window.GOVUK.Modules = window.GOVUK.Modules || {};
88
88
 
89
89
  (function (Modules) {
90
- function GemToggle () { }
90
+ function GemToggle ($module) {
91
+ this.$module = $module
92
+ }
91
93
 
92
- GemToggle.prototype.start = function ($module) {
93
- this.$module = $module[0]
94
+ GemToggle.prototype.init = function () {
94
95
  this.$module.toggleTrigger = this.$module.querySelector('[data-controls][data-expanded]')
95
96
 
96
97
  if (this.$module.toggleTrigger) {