govuk_publishing_components 55.0.1 → 56.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/{lib/sticky-element-container.js → components/contents-list-with-body.js} +21 -21
  3. data/app/assets/javascripts/govuk_publishing_components/components/file-upload.js +5 -0
  4. data/app/assets/javascripts/govuk_publishing_components/lib/cookie-settings.js +13 -15
  5. data/app/assets/javascripts/govuk_publishing_components/lib/toggle.js +2 -2
  6. data/app/assets/stylesheets/govuk_publishing_components/components/_contents-list-with-body.scss +25 -2
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +1 -0
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_organisation-logo.scss +5 -2
  9. data/app/models/govuk_publishing_components/audit_comparer.rb +0 -1
  10. data/app/views/govuk_publishing_components/components/_contents_list_with_body.html.erb +1 -1
  11. data/app/views/govuk_publishing_components/components/_figure.html.erb +19 -18
  12. data/app/views/govuk_publishing_components/components/_file_upload.html.erb +13 -1
  13. data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +0 -1
  14. data/app/views/govuk_publishing_components/components/_published_dates.html.erb +5 -5
  15. data/app/views/govuk_publishing_components/components/_select.html.erb +2 -1
  16. data/app/views/govuk_publishing_components/components/docs/file_upload.yml +6 -0
  17. data/app/views/govuk_publishing_components/components/docs/select.yml +16 -1
  18. data/app/views/govuk_publishing_components/components/feedback/_survey_signup_form.html.erb +1 -1
  19. data/lib/govuk_publishing_components/version.rb +1 -1
  20. data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +313 -47
  21. data/node_modules/govuk-frontend/dist/govuk/all.bundle.js.map +1 -1
  22. data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +312 -47
  23. data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs.map +1 -1
  24. data/node_modules/govuk-frontend/dist/govuk/all.mjs +2 -1
  25. data/node_modules/govuk-frontend/dist/govuk/all.mjs.map +1 -1
  26. data/node_modules/govuk-frontend/dist/govuk/common/configuration.mjs +21 -16
  27. data/node_modules/govuk-frontend/dist/govuk/common/configuration.mjs.map +1 -1
  28. data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +1 -1
  29. data/node_modules/govuk-frontend/dist/govuk/common/index.mjs +3 -0
  30. data/node_modules/govuk-frontend/dist/govuk/common/index.mjs.map +1 -1
  31. data/node_modules/govuk-frontend/dist/govuk/{govuk-frontend-component.mjs → component.mjs} +5 -5
  32. data/node_modules/govuk-frontend/dist/govuk/component.mjs.map +1 -0
  33. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js +27 -19
  34. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js.map +1 -1
  35. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs +27 -19
  36. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs.map +1 -1
  37. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.mjs +1 -1
  38. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.mjs.map +1 -1
  39. data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.js +27 -19
  40. data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.js.map +1 -1
  41. data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.mjs +27 -19
  42. data/node_modules/govuk-frontend/dist/govuk/components/button/button.bundle.mjs.map +1 -1
  43. data/node_modules/govuk-frontend/dist/govuk/components/button/button.mjs +1 -1
  44. data/node_modules/govuk-frontend/dist/govuk/components/button/button.mjs.map +1 -1
  45. data/node_modules/govuk-frontend/dist/govuk/components/button/macro-options.json +2 -1
  46. data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.scss +8 -0
  47. data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.scss.map +1 -1
  48. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js +28 -20
  49. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js.map +1 -1
  50. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs +28 -20
  51. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs.map +1 -1
  52. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs +2 -2
  53. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs.map +1 -1
  54. data/node_modules/govuk-frontend/dist/govuk/components/character-count/fixtures.json +16 -1
  55. data/node_modules/govuk-frontend/dist/govuk/components/character-count/macro-options.json +2 -2
  56. data/node_modules/govuk-frontend/dist/govuk/components/character-count/template.njk +5 -4
  57. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.js +8 -5
  58. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.js.map +1 -1
  59. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.mjs +8 -5
  60. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.bundle.mjs.map +1 -1
  61. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.mjs +2 -2
  62. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/checkboxes.mjs.map +1 -1
  63. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.js +27 -19
  64. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.js.map +1 -1
  65. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.mjs +27 -19
  66. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.mjs.map +1 -1
  67. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.mjs +1 -1
  68. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/error-summary.mjs.map +1 -1
  69. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js +27 -19
  70. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js.map +1 -1
  71. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs +27 -19
  72. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs.map +1 -1
  73. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.mjs +1 -1
  74. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.mjs.map +1 -1
  75. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss +167 -0
  76. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss.map +1 -1
  77. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js +754 -0
  78. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js.map +1 -0
  79. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs +746 -0
  80. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs.map +1 -0
  81. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs +267 -0
  82. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs.map +1 -0
  83. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/fixtures.json +207 -16
  84. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/macro-options.json +52 -3
  85. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-allows-direct-media-capture.html +6 -0
  86. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-allows-image-files-only.html +6 -0
  87. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-allows-multiple-files.html +6 -0
  88. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-disabled.html +6 -0
  89. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced-disabled.html +13 -0
  90. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced-with-error-message-and-hint.html +16 -0
  91. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-enhanced.html +10 -0
  92. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-translated.html +10 -0
  93. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template.njk +42 -5
  94. data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss +14 -10
  95. data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss.map +1 -1
  96. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.js +8 -5
  97. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.js.map +1 -1
  98. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.mjs +8 -5
  99. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.mjs.map +1 -1
  100. data/node_modules/govuk-frontend/dist/govuk/components/header/header.mjs +2 -2
  101. data/node_modules/govuk-frontend/dist/govuk/components/header/header.mjs.map +1 -1
  102. data/node_modules/govuk-frontend/dist/govuk/components/header/macro-options.json +25 -12
  103. data/node_modules/govuk-frontend/dist/govuk/components/input/fixtures.json +16 -2
  104. data/node_modules/govuk-frontend/dist/govuk/components/input/macro-options.json +2 -2
  105. data/node_modules/govuk-frontend/dist/govuk/components/input/template-default.html +2 -2
  106. data/node_modules/govuk-frontend/dist/govuk/components/input/template.njk +5 -4
  107. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.js +27 -19
  108. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.js.map +1 -1
  109. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.mjs +27 -19
  110. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.mjs.map +1 -1
  111. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.mjs +1 -1
  112. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.mjs.map +1 -1
  113. data/node_modules/govuk-frontend/dist/govuk/components/password-input/fixtures.json +16 -2
  114. data/node_modules/govuk-frontend/dist/govuk/components/password-input/macro-options.json +2 -2
  115. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js +27 -20
  116. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js.map +1 -1
  117. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs +27 -20
  118. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs.map +1 -1
  119. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.mjs +1 -2
  120. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.mjs.map +1 -1
  121. data/node_modules/govuk-frontend/dist/govuk/components/password-input/template-default.html +3 -3
  122. data/node_modules/govuk-frontend/dist/govuk/components/password-input/template.njk +4 -2
  123. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.js +8 -5
  124. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.js.map +1 -1
  125. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.mjs +8 -5
  126. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.bundle.mjs.map +1 -1
  127. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.mjs +2 -2
  128. data/node_modules/govuk-frontend/dist/govuk/components/radios/radios.mjs.map +1 -1
  129. data/node_modules/govuk-frontend/dist/govuk/components/select/fixtures.json +16 -1
  130. data/node_modules/govuk-frontend/dist/govuk/components/select/macro-options.json +2 -2
  131. data/node_modules/govuk-frontend/dist/govuk/components/select/template-id.html +7 -0
  132. data/node_modules/govuk-frontend/dist/govuk/components/select/template.njk +6 -4
  133. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.js +8 -5
  134. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.js.map +1 -1
  135. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.mjs +8 -5
  136. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.mjs.map +1 -1
  137. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.mjs +2 -2
  138. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.mjs.map +1 -1
  139. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.js +9 -6
  140. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.js.map +1 -1
  141. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.mjs +9 -6
  142. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.bundle.mjs.map +1 -1
  143. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.mjs +3 -3
  144. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/skip-link.mjs.map +1 -1
  145. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss +12 -21
  146. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss.map +1 -1
  147. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/fixtures.json +142 -0
  148. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/template-as-a-summary-card-extreme.html +106 -0
  149. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.js +8 -5
  150. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.js.map +1 -1
  151. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.mjs +8 -5
  152. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.bundle.mjs.map +1 -1
  153. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.mjs +2 -2
  154. data/node_modules/govuk-frontend/dist/govuk/components/tabs/tabs.mjs.map +1 -1
  155. data/node_modules/govuk-frontend/dist/govuk/components/textarea/fixtures.json +15 -1
  156. data/node_modules/govuk-frontend/dist/govuk/components/textarea/macro-options.json +2 -2
  157. data/node_modules/govuk-frontend/dist/govuk/components/textarea/template.njk +6 -4
  158. data/node_modules/govuk-frontend/dist/govuk/core/_govuk-frontend-properties.scss +1 -1
  159. data/node_modules/govuk-frontend/dist/govuk/errors/index.mjs +1 -1
  160. data/node_modules/govuk-frontend/dist/govuk/errors/index.mjs.map +1 -1
  161. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css +2 -2
  162. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css.map +1 -1
  163. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -1
  164. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js.map +1 -1
  165. data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss +2 -2
  166. data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss.map +1 -1
  167. data/node_modules/govuk-frontend/dist/govuk/init.mjs +11 -11
  168. data/node_modules/govuk-frontend/dist/govuk/init.mjs.map +1 -1
  169. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss +18 -5
  170. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss.map +1 -1
  171. data/node_modules/govuk-frontend/dist/govuk-prototype-kit/init.scss +1 -1
  172. data/node_modules/govuk-frontend/dist/govuk-prototype-kit/init.scss.map +1 -1
  173. data/node_modules/govuk-frontend/govuk-prototype-kit.config.json +1 -1
  174. data/node_modules/govuk-frontend/package.json +7 -7
  175. metadata +22 -7
  176. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_sticky-element-container.scss +0 -23
  177. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template-with-value.html +0 -6
  178. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend-component.mjs.map +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 00edb5d25e23e74f551a4e86904f15149be137d0792b8e2b066d7af747fedbc5
4
- data.tar.gz: f674647263528f6eba8ef3549d710093947d6650fb6fb66722a94faaf33d24b7
3
+ metadata.gz: 5bd7ea7301bfc4ad16b432de2454f8557703f0da104df7238390c0898e9d71da
4
+ data.tar.gz: 8558af085431866c26875ef71548ac8dd1918e61ef5c42ca13978b9866e0274c
5
5
  SHA512:
6
- metadata.gz: 18b9cd1e21c514e57d5770348f4a9ce39a1e1a8282cd911666835f4818bd8cab79b8a3d8bbe5390346861870f3fcb3065cf028ed5952d2296099b24e3c51e452
7
- data.tar.gz: a885507b322d134001ecc1e053af8dad5b224bf7553a222d474d728a4bb26824e550163bdc0a3ca3f757d8580328bfcb1b0778c38920334301c3a9205d97fefd
6
+ metadata.gz: 5d5024063bd18beaae519aabf8c9e1e04a07c3492d1150e38179cc677954d1ed8481b10e35b39f5588d14208c6939ff1199b5a215d29fdb394c1c165d119899b
7
+ data.tar.gz: e34384803cbf5b6b9b507aa88700248ecb0d61b7eee230acfcac87b17d0be706cf400c35d49bd5659647758eccf4fb1ae7761ad0e510715a6855791faed6ffc9
@@ -4,7 +4,7 @@
4
4
  - stick to the bottom of the window while the parent element is in view;
5
5
  - stick to the bottom of the target when the user scrolls past the bottom.
6
6
 
7
- Use 'data-module="sticky-element-container"' to instantiate, and add
7
+ Use 'data-module="contents-list-with-body"' to instantiate, and add
8
8
  `[data-sticky-element]` to the child you want to position.
9
9
  */
10
10
 
@@ -12,7 +12,7 @@ window.GOVUK = window.GOVUK || {}
12
12
  window.GOVUK.Modules = window.GOVUK.Modules || {};
13
13
 
14
14
  (function (Modules) {
15
- function StickyElementContainer (element) {
15
+ function ContentsListWithBody (element) {
16
16
  this.wrapper = element
17
17
  this.stickyElement = this.wrapper.querySelector('[data-sticky-element]')
18
18
  this.hasResized = true
@@ -23,7 +23,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
23
23
  this.stopPosition = 0
24
24
  }
25
25
 
26
- StickyElementContainer.prototype.init = function () {
26
+ ContentsListWithBody.prototype.init = function () {
27
27
  if (!this.stickyElement) return
28
28
 
29
29
  window.onresize = this.onResize.bind(this)
@@ -32,31 +32,31 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
32
32
  setInterval(this.checkScroll.bind(this), this.interval)
33
33
  this.checkResize()
34
34
  this.checkScroll()
35
- this.stickyElement.classList.add('sticky-element--enabled')
35
+ this.stickyElement.classList.add('gem-c-contents-list-with-body__sticky-element--enabled')
36
36
  }
37
37
 
38
- StickyElementContainer.prototype.getWindowDimensions = function () {
38
+ ContentsListWithBody.prototype.getWindowDimensions = function () {
39
39
  return {
40
40
  height: window.innerHeight,
41
41
  width: window.innerWidth
42
42
  }
43
43
  }
44
44
 
45
- StickyElementContainer.prototype.getWindowPositions = function () {
45
+ ContentsListWithBody.prototype.getWindowPositions = function () {
46
46
  return {
47
47
  scrollTop: window.scrollY
48
48
  }
49
49
  }
50
50
 
51
- StickyElementContainer.prototype.onResize = function () {
51
+ ContentsListWithBody.prototype.onResize = function () {
52
52
  this.hasResized = true
53
53
  }
54
54
 
55
- StickyElementContainer.prototype.onScroll = function () {
55
+ ContentsListWithBody.prototype.onScroll = function () {
56
56
  this.hasScrolled = true
57
57
  }
58
58
 
59
- StickyElementContainer.prototype.checkResize = function () {
59
+ ContentsListWithBody.prototype.checkResize = function () {
60
60
  if (this.hasResized) {
61
61
  this.hasResized = false
62
62
  this.hasScrolled = true
@@ -68,7 +68,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
68
68
  }
69
69
  }
70
70
 
71
- StickyElementContainer.prototype.checkScroll = function () {
71
+ ContentsListWithBody.prototype.checkScroll = function () {
72
72
  if (this.hasScrolled) {
73
73
  this.hasScrolled = false
74
74
 
@@ -79,7 +79,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
79
79
  }
80
80
  }
81
81
 
82
- StickyElementContainer.prototype.updateVisibility = function () {
82
+ ContentsListWithBody.prototype.updateVisibility = function () {
83
83
  var isPastStart = this.startPosition < this.windowVerticalPosition
84
84
  if (isPastStart) {
85
85
  this.show()
@@ -88,7 +88,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
88
88
  }
89
89
  }
90
90
 
91
- StickyElementContainer.prototype.updatePosition = function () {
91
+ ContentsListWithBody.prototype.updatePosition = function () {
92
92
  var isPastEnd = this.stopPosition < this.windowVerticalPosition
93
93
  if (isPastEnd) {
94
94
  this.stickToParent()
@@ -97,21 +97,21 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
97
97
  }
98
98
  }
99
99
 
100
- StickyElementContainer.prototype.stickToWindow = function () {
101
- this.stickyElement.classList.add('sticky-element--stuck-to-window')
100
+ ContentsListWithBody.prototype.stickToWindow = function () {
101
+ this.stickyElement.classList.add('gem-c-contents-list-with-body__sticky-element--stuck-to-window')
102
102
  }
103
103
 
104
- StickyElementContainer.prototype.stickToParent = function () {
105
- this.stickyElement.classList.remove('sticky-element--stuck-to-window')
104
+ ContentsListWithBody.prototype.stickToParent = function () {
105
+ this.stickyElement.classList.remove('gem-c-contents-list-with-body__sticky-element--stuck-to-window')
106
106
  }
107
107
 
108
- StickyElementContainer.prototype.show = function () {
109
- this.stickyElement.classList.remove('sticky-element--hidden')
108
+ ContentsListWithBody.prototype.show = function () {
109
+ this.stickyElement.classList.remove('gem-c-contents-list-with-body__sticky-element--hidden')
110
110
  }
111
111
 
112
- StickyElementContainer.prototype.hide = function () {
113
- this.stickyElement.classList.add('sticky-element--hidden')
112
+ ContentsListWithBody.prototype.hide = function () {
113
+ this.stickyElement.classList.add('gem-c-contents-list-with-body__sticky-element--hidden')
114
114
  }
115
115
 
116
- Modules.StickyElementContainer = StickyElementContainer
116
+ Modules.ContentsListWithBody = ContentsListWithBody
117
117
  })(window.GOVUK.Modules)
@@ -0,0 +1,5 @@
1
+ // This component relies on JavaScript from GOV.UK Frontend
2
+ // = require govuk/components/file-upload/file-upload.bundle.js
3
+ window.GOVUK = window.GOVUK || {}
4
+ window.GOVUK.Modules = window.GOVUK.Modules || {}
5
+ window.GOVUK.Modules.GovukFileUpload = window.GOVUKFrontend.FileUpload
@@ -29,21 +29,19 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
29
29
  var currentConsentCookie = window.GOVUK.cookie('cookies_policy')
30
30
  if (currentConsentCookie) {
31
31
  var currentConsentCookieJSON = JSON.parse(currentConsentCookie)
32
-
33
- // We don't need the essential value as this cannot be changed by the user
34
- delete currentConsentCookieJSON.essential
35
-
36
- for (var cookieType in currentConsentCookieJSON) {
37
- var radioButton
38
-
39
- if (currentConsentCookieJSON[cookieType]) {
40
- radioButton = document.querySelector('input[name=cookies-' + cookieType + '][value=on]')
41
- } else {
42
- radioButton = document.querySelector('input[name=cookies-' + cookieType + '][value=off]')
43
- }
44
-
45
- if (radioButton) {
46
- radioButton.checked = true
32
+ if (currentConsentCookieJSON) {
33
+ // We don't need the essential value as this cannot be changed by the user
34
+ delete currentConsentCookieJSON.essential
35
+ for (var cookieType in currentConsentCookieJSON) {
36
+ var radioButton
37
+ if (currentConsentCookieJSON[cookieType]) {
38
+ radioButton = document.querySelector('input[name=cookies-' + cookieType + '][value=on]')
39
+ } else {
40
+ radioButton = document.querySelector('input[name=cookies-' + cookieType + '][value=off]')
41
+ }
42
+ if (radioButton) {
43
+ radioButton.checked = true
44
+ }
47
45
  }
48
46
  }
49
47
  }
@@ -129,8 +129,8 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
129
129
  var toggledText = this.getAttribute('data-toggled-text')
130
130
 
131
131
  if (typeof toggledText === 'string') {
132
- this.setAttribute('data-toggled-text', this.innerText)
133
- this.innerText = toggledText
132
+ this.setAttribute('data-toggled-text', this.innerHTML)
133
+ this.innerHTML = toggledText
134
134
  }
135
135
  })
136
136
  }
@@ -1,5 +1,28 @@
1
1
  @import "govuk_publishing_components/individual_component_support";
2
- @import "helpers/sticky-element-container";
2
+
3
+ .govuk-frontend-supported .gem-c-contents-list-with-body__sticky-element {
4
+ position: absolute;
5
+ bottom: 0;
6
+
7
+ &--stuck-to-window {
8
+ bottom: 0;
9
+ position: fixed;
10
+ }
11
+
12
+ &--enabled {
13
+ transition: opacity, .3s, ease;
14
+ opacity: 1;
15
+
16
+ @include govuk-media-query($until: tablet) {
17
+ position: static;
18
+ }
19
+ }
20
+
21
+ &--hidden {
22
+ opacity: 0;
23
+ pointer-events: none;
24
+ }
25
+ }
3
26
 
4
27
  .gem-c-contents-list-with-body__link-container {
5
28
  margin: 0 auto;
@@ -31,7 +54,7 @@
31
54
  }
32
55
  }
33
56
 
34
- .gem-c-contents-list-with-body__link-wrapper.sticky-element--stuck-to-window {
57
+ .gem-c-contents-list-with-body__link-wrapper.gem-c-contents-list-with-body__sticky-element--stuck-to-window {
35
58
  background-color: govuk-colour("light-grey");
36
59
  bottom: -1px; // 'Fix' for anomalous 1px margin which sporadically appears below this element.
37
60
  left: 0;
@@ -1,4 +1,5 @@
1
1
  @import "govuk_publishing_components/individual_component_support";
2
+ @import "govuk/components/header/header";
2
3
  @import "mixins/prefixed-transform";
3
4
  @import "mixins/grid-helper";
4
5
 
@@ -33,9 +33,12 @@
33
33
  padding-right: govuk-spacing(1);
34
34
  }
35
35
 
36
- // Scale images on smaller viewports
37
36
  .gem-c-organisation-logo__image {
38
- max-width: 100%;
37
+ max-width: 320px;
38
+ @include govuk-media-query($until: tablet) {
39
+ width: 100%;
40
+ max-width: 240px;
41
+ }
39
42
  }
40
43
 
41
44
  .gem-c-organisation-logo__crest {
@@ -6,7 +6,6 @@ module GovukPublishingComponents
6
6
  if gem_data[:gem_found]
7
7
  @applications_using_static = %w[
8
8
  collections
9
- email-alert-frontend
10
9
  feedback
11
10
  finder-frontend
12
11
  frontend
@@ -7,7 +7,7 @@
7
7
  component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
8
8
  component_helper.set_id(id)
9
9
  component_helper.add_class("gem-c-contents-list-with-body")
10
- component_helper.add_data_attribute({ module: "sticky-element-container" }) if contents.any?
10
+ component_helper.add_data_attribute({ module: "contents-list-with-body" }) if contents.any?
11
11
  %>
12
12
  <%= tag.div(**component_helper.all_attributes) do %>
13
13
  <% if contents.any? %>
@@ -3,26 +3,27 @@
3
3
  alt ||= ""
4
4
  caption ||= ""
5
5
  credit ||= ""
6
+ src ||= nil
6
7
  local_assigns[:lang] ||= "en"
7
8
  component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
8
9
  component_helper.add_class("gem-c-figure")
9
10
  %>
10
- <%= tag.figure(**component_helper.all_attributes) do %>
11
- <% if src.present? %>
12
- <img class="gem-c-figure__image" src="<%= src %>" alt="<%= alt %>">
11
+ <% if src.present? %>
12
+ <%= tag.figure(**component_helper.all_attributes) do %>
13
+ <%= tag.img(class: "gem-c-figure__image", src: src, alt: alt) %>
14
+ <% if caption.present? || credit.present? %>
15
+ <figcaption class="gem-c-figure__figcaption">
16
+ <% if caption.present? %>
17
+ <p class="gem-c-figure__figcaption-text">
18
+ <%= caption %>
19
+ </p>
20
+ <% end %>
21
+ <% if credit.present? %>
22
+ <p class="gem-c-figure__figcaption-text">
23
+ <%= I18n.t("components.figure.image_credit", credit: credit) %>
24
+ </p>
25
+ <% end %>
26
+ </figcaption>
27
+ <% end %>
13
28
  <% end %>
14
- <% if caption.present? || credit.present? %>
15
- <figcaption class="gem-c-figure__figcaption">
16
- <% if caption.present? %>
17
- <p class="gem-c-figure__figcaption-text">
18
- <%= caption %>
19
- </p>
20
- <% end %>
21
- <% if credit.present? %>
22
- <p class="gem-c-figure__figcaption-text">
23
- <%= I18n.t("components.figure.image_credit", credit: credit) %>
24
- </p>
25
- <% end %>
26
- </figcaption>
27
- <% end %>
28
- <% end %>
29
+ <% end %>
@@ -1,4 +1,5 @@
1
1
  <%
2
+ add_gem_component_stylesheet("button")
2
3
  add_gem_component_stylesheet("file-upload")
3
4
 
4
5
  shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
@@ -17,6 +18,7 @@
17
18
  error_id = "error-#{SecureRandom.hex(4)}"
18
19
  heading_size = false unless shared_helper.valid_heading_size?(heading_size)
19
20
  heading_level ||= nil
21
+ javascript ||= false
20
22
 
21
23
  css_classes = %w(gem-c-file-upload govuk-file-upload)
22
24
  css_classes << "govuk-file-upload--error" if has_error
@@ -65,7 +67,8 @@
65
67
  } %>
66
68
  <% end %>
67
69
 
68
- <%= tag.input name: name,
70
+ <% file_upload_element = capture do %>
71
+ <%= tag.input name: name,
69
72
  type: "file",
70
73
  value: value,
71
74
  class: css_classes,
@@ -75,4 +78,13 @@
75
78
  aria: {
76
79
  describedby: aria_described_by
77
80
  } %>
81
+ <% end %>
82
+
83
+ <% if javascript %>
84
+ <%= content_tag :div, class: "govuk-drop-zone", data: { module: "govuk-file-upload" } do %>
85
+ <%= file_upload_element %>
86
+ <% end %>
87
+ <% else %>
88
+ <%= file_upload_element %>
89
+ <% end %>
78
90
  <% end %>
@@ -1,5 +1,4 @@
1
1
  <%
2
- add_gem_component_stylesheet("layout-header")
3
2
  add_gem_component_stylesheet("layout-super-navigation-header")
4
3
 
5
4
  logo_link ||= "https://www.gov.uk/"
@@ -18,22 +18,22 @@
18
18
  <%= tag.div(**component_helper.all_attributes) do %>
19
19
  <h2 class="govuk-visually-hidden"><%= t('components.published_dates.hidden_heading') %></h2>
20
20
  <% if published %>
21
- <%= t('components.published_dates.published', date: published) %>
21
+ <div><%= t('components.published_dates.published', date: published) %></div>
22
22
  <% end %>
23
23
  <% if last_updated %>
24
- <% if published %><br /><% end %><%= t('components.published_dates.last_updated', date: last_updated) %>
24
+ <%= t('components.published_dates.last_updated', date: last_updated) %>
25
25
  <% if link_to_history && history.empty? %>
26
- &mdash; <a href="#history" class="gem-c-published-dates__history-link govuk-link"><%= t('components.published_dates.see_all_updates', locale: :en) %></a>
26
+ <span aria-hidden="true">— </span><a href="#history" class="gem-c-published-dates__history-link govuk-link"><%= t('components.published_dates.see_all_updates', locale: :en) %></a>
27
27
  <% elsif history.any? %>
28
28
  <a href="#full-history"
29
29
  class="gem-c-published-dates__toggle govuk-link"
30
30
  data-controls="full-history"
31
31
  data-expanded="false"
32
- data-toggled-text="&#45;&nbsp;<%= t('components.published_dates.hide_all_updates', locale: :en) %>"
32
+ data-toggled-text="<span aria-hidden='true'>‐ </span><%= t('components.published_dates.hide_all_updates', locale: :en) %>"
33
33
  data-module="ga4-event-tracker"
34
34
  data-ga4-event="<%= {event_name: "select_content", type: "content history", section: "Footer"}.to_json %>"
35
35
  data-ga4-expandable
36
- >&#43;&nbsp;<%= t('components.published_dates.show_all_updates', locale: :en) %></a>
36
+ ><span aria-hidden="true">+ </span><%= t('components.published_dates.show_all_updates', locale: :en) %></a>
37
37
  <div class="gem-c-published-dates__change-history js-hidden" id="full-history">
38
38
  <ol class="gem-c-published-dates__list">
39
39
  <% history.each do |change| %>
@@ -6,6 +6,7 @@
6
6
  label ||= false
7
7
  name ||= id
8
8
  is_page_heading ||= false
9
+ data_attributes ||= {}
9
10
 
10
11
  shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
11
12
  heading_size = false unless shared_helper.valid_heading_size?(heading_size)
@@ -39,6 +40,6 @@
39
40
  } %>
40
41
  <% end %>
41
42
 
42
- <%= select_tag name, options_for_select(select_helper.option_markup, select_helper.selected_option), id: id, class: select_helper.select_classes, aria: aria_describedby %>
43
+ <%= select_tag name, options_for_select(select_helper.option_markup, select_helper.selected_option), id: id, class: select_helper.select_classes, aria: aria_describedby, data: data_attributes %>
43
44
  <% end %>
44
45
  <% end %>
@@ -20,6 +20,12 @@ examples:
20
20
  label:
21
21
  text: "Upload a file"
22
22
  name: "file-upload"
23
+ with_javascript:
24
+ data:
25
+ label:
26
+ text: "Upload a file"
27
+ name: "file-upload"
28
+ javascript: true
23
29
  with_hint:
24
30
  data:
25
31
  label:
@@ -55,7 +55,22 @@ examples:
55
55
  - text: Something else
56
56
  value: option2
57
57
  with_data_attributes:
58
- description: Other data attributes can be passed to the component if needed.
58
+ description: Data attributes can be passed to the select component if needed.
59
+ data:
60
+ id: dropdown4-3
61
+ label: With data attributes
62
+ data_attributes:
63
+ another_attribute: attribute 1
64
+ something_else: attribute 2
65
+ options:
66
+ - text: Option one
67
+ value: option1
68
+ - text: Option two
69
+ value: option2
70
+ - text: Option three
71
+ value: option3
72
+ with_data_attributes_for_options:
73
+ description: Other data attributes can be passed to the select component options if needed.
59
74
  data:
60
75
  id: dropdown4
61
76
  label: With data attributes
@@ -6,7 +6,7 @@
6
6
  <h3 class="gem-c-feedback__form-heading"><%= t("components.feedback.help_us_improve_govuk") %></h3>
7
7
  <p id="survey_explanation" class="gem-c-feedback__form-paragraph">
8
8
  <%= t("components.feedback.more_about_visit") %>
9
- <a href="https://www.smartsurvey.co.uk/s/gov-uk-banner/?c=no-js" class="govuk-link" target="_blank" rel="noopener noreferrer external">Please fill in this survey (opens in a new tab)</a>.
9
+ <a href="https://www.smartsurvey.co.uk/s/gov-uk-banner/?c=no-js" class="govuk-link" target="_blank" rel="noopener noreferrer external">Please fill in this survey (opens in a new tab<noscript> and requires JavaScript</noscript>)</a>.
10
10
  </p>
11
11
  <button
12
12
  class="govuk-button govuk-button--secondary js-close-form"
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "55.0.1".freeze
2
+ VERSION = "56.0.0".freeze
3
3
  end