govuk_publishing_components 27.10.5 → 27.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/components/layout-super-navigation-header.js +1 -1
  3. data/app/assets/javascripts/govuk_publishing_components/components/single-page-notification-button.js +48 -0
  4. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -0
  5. data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +6 -4
  6. data/app/assets/stylesheets/govuk_publishing_components/components/_govspeak.scss +0 -1
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +246 -113
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_single-page-notification-button.scss +30 -0
  9. data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_margins.scss +2 -2
  10. data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_prefixed-transform.scss +5 -0
  11. data/app/assets/stylesheets/govuk_publishing_components/govuk_frontend_support.scss +9 -0
  12. data/app/models/govuk_publishing_components/shared_accessibility_criteria.rb +17 -0
  13. data/app/views/govuk_publishing_components/components/_input.html.erb +35 -22
  14. data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +31 -43
  15. data/app/views/govuk_publishing_components/components/_metadata.html.erb +2 -0
  16. data/app/views/govuk_publishing_components/components/_search.html.erb +2 -1
  17. data/app/views/govuk_publishing_components/components/_single_page_notification_button.html.erb +17 -0
  18. data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb +4 -5
  19. data/app/views/govuk_publishing_components/components/docs/govspeak.yml +0 -6
  20. data/app/views/govuk_publishing_components/components/docs/input.yml +10 -0
  21. data/app/views/govuk_publishing_components/components/docs/metadata.yml +7 -0
  22. data/app/views/govuk_publishing_components/components/docs/single_page_notification_button.yml +50 -0
  23. data/app/views/govuk_publishing_components/components/search/_search_icon.html.erb +5 -5
  24. data/config/locales/ar.yml +0 -3
  25. data/config/locales/az.yml +0 -3
  26. data/config/locales/be.yml +0 -3
  27. data/config/locales/bg.yml +0 -3
  28. data/config/locales/bn.yml +0 -3
  29. data/config/locales/cs.yml +0 -3
  30. data/config/locales/cy.yml +0 -3
  31. data/config/locales/da.yml +0 -3
  32. data/config/locales/de.yml +0 -3
  33. data/config/locales/dr.yml +0 -3
  34. data/config/locales/el.yml +0 -3
  35. data/config/locales/en.yml +8 -9
  36. data/config/locales/es-419.yml +0 -3
  37. data/config/locales/es.yml +0 -3
  38. data/config/locales/et.yml +0 -3
  39. data/config/locales/fa.yml +0 -3
  40. data/config/locales/fi.yml +0 -3
  41. data/config/locales/fr.yml +0 -3
  42. data/config/locales/gd.yml +0 -3
  43. data/config/locales/gu.yml +0 -3
  44. data/config/locales/he.yml +0 -3
  45. data/config/locales/hi.yml +0 -3
  46. data/config/locales/hr.yml +0 -3
  47. data/config/locales/hu.yml +0 -3
  48. data/config/locales/hy.yml +0 -3
  49. data/config/locales/id.yml +0 -3
  50. data/config/locales/is.yml +0 -3
  51. data/config/locales/it.yml +0 -3
  52. data/config/locales/ja.yml +0 -3
  53. data/config/locales/ka.yml +0 -3
  54. data/config/locales/kk.yml +0 -3
  55. data/config/locales/ko.yml +0 -3
  56. data/config/locales/lt.yml +0 -3
  57. data/config/locales/lv.yml +0 -3
  58. data/config/locales/ms.yml +0 -3
  59. data/config/locales/mt.yml +0 -3
  60. data/config/locales/nl.yml +0 -3
  61. data/config/locales/no.yml +0 -3
  62. data/config/locales/pa-pk.yml +0 -3
  63. data/config/locales/pa.yml +0 -3
  64. data/config/locales/pl.yml +0 -3
  65. data/config/locales/ps.yml +0 -3
  66. data/config/locales/pt.yml +0 -3
  67. data/config/locales/ro.yml +0 -3
  68. data/config/locales/ru.yml +0 -3
  69. data/config/locales/si.yml +0 -3
  70. data/config/locales/sk.yml +0 -3
  71. data/config/locales/sl.yml +0 -3
  72. data/config/locales/so.yml +0 -3
  73. data/config/locales/sq.yml +0 -3
  74. data/config/locales/sr.yml +0 -3
  75. data/config/locales/sv.yml +0 -3
  76. data/config/locales/sw.yml +0 -3
  77. data/config/locales/ta.yml +0 -3
  78. data/config/locales/th.yml +0 -3
  79. data/config/locales/tk.yml +0 -3
  80. data/config/locales/tr.yml +0 -3
  81. data/config/locales/uk.yml +0 -3
  82. data/config/locales/ur.yml +0 -3
  83. data/config/locales/uz.yml +0 -3
  84. data/config/locales/vi.yml +0 -3
  85. data/config/locales/zh-hk.yml +0 -3
  86. data/config/locales/zh-tw.yml +0 -3
  87. data/config/locales/zh.yml +0 -3
  88. data/lib/govuk_publishing_components/presenters/button_helper.rb +1 -0
  89. data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +15 -4
  90. data/lib/govuk_publishing_components/presenters/single_page_notification_button_helper.rb +40 -0
  91. data/lib/govuk_publishing_components/version.rb +1 -1
  92. data/lib/govuk_publishing_components.rb +1 -1
  93. data/node_modules/govuk-frontend/govuk/components/accordion/macro-options.json +2 -2
  94. data/node_modules/govuk-frontend/govuk/components/back-link/macro-options.json +3 -3
  95. data/node_modules/govuk-frontend/govuk/components/button/_index.scss +3 -4
  96. data/node_modules/govuk-frontend/govuk/components/button/fixtures.json +9 -0
  97. data/node_modules/govuk-frontend/govuk/components/character-count/macro-options.json +6 -6
  98. data/node_modules/govuk-frontend/govuk/components/checkboxes/_index.scss +14 -0
  99. data/node_modules/govuk-frontend/govuk/components/checkboxes/macro-options.json +8 -8
  100. data/node_modules/govuk-frontend/govuk/components/cookie-banner/macro-options.json +1 -1
  101. data/node_modules/govuk-frontend/govuk/components/date-input/macro-options.json +5 -5
  102. data/node_modules/govuk-frontend/govuk/components/details/_index.scss +2 -1
  103. data/node_modules/govuk-frontend/govuk/components/details/macro-options.json +2 -2
  104. data/node_modules/govuk-frontend/govuk/components/error-message/macro-options.json +3 -3
  105. data/node_modules/govuk-frontend/govuk/components/fieldset/macro-options.json +1 -1
  106. data/node_modules/govuk-frontend/govuk/components/file-upload/_index.scss +1 -0
  107. data/node_modules/govuk-frontend/govuk/components/file-upload/macro-options.json +4 -4
  108. data/node_modules/govuk-frontend/govuk/components/footer/_index.scss +3 -0
  109. data/node_modules/govuk-frontend/govuk/components/footer/macro-options.json +2 -2
  110. data/node_modules/govuk-frontend/govuk/components/header/macro-options.json +6 -6
  111. data/node_modules/govuk-frontend/govuk/components/hint/macro-options.json +1 -1
  112. data/node_modules/govuk-frontend/govuk/components/input/macro-options.json +7 -7
  113. data/node_modules/govuk-frontend/govuk/components/inset-text/macro-options.json +1 -1
  114. data/node_modules/govuk-frontend/govuk/components/label/macro-options.json +1 -1
  115. data/node_modules/govuk-frontend/govuk/components/panel/_index.scss +13 -1
  116. data/node_modules/govuk-frontend/govuk/components/panel/macro-options.json +1 -1
  117. data/node_modules/govuk-frontend/govuk/components/radios/_index.scss +14 -0
  118. data/node_modules/govuk-frontend/govuk/components/radios/macro-options.json +8 -8
  119. data/node_modules/govuk-frontend/govuk/components/select/macro-options.json +3 -3
  120. data/node_modules/govuk-frontend/govuk/components/summary-list/fixtures.json +2 -2
  121. data/node_modules/govuk-frontend/govuk/components/summary-list/macro-options.json +7 -7
  122. data/node_modules/govuk-frontend/govuk/components/tabs/macro-options.json +4 -4
  123. data/node_modules/govuk-frontend/govuk/components/textarea/macro-options.json +5 -5
  124. data/node_modules/govuk-frontend/govuk/helpers/_colour.scss +2 -2
  125. data/node_modules/govuk-frontend/govuk/helpers/_spacing.scss +22 -4
  126. data/node_modules/govuk-frontend/govuk/overrides/_all.scss +1 -0
  127. data/node_modules/govuk-frontend/govuk/overrides/_text-align.scss +20 -0
  128. data/node_modules/govuk-frontend/package.json +1 -1
  129. metadata +9 -18
  130. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_summary.scss +0 -27
  131. data/lib/govuk_publishing_components/presenters/brexit_cta_helper.rb +0 -33
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7cf2ebcbfd20fc146d07f7edcacf06c2c0dec708408c27217ff04e9475bbedc1
4
- data.tar.gz: b03ddc5f4e26590d295a75aaca6f97f18659e3ceeec6a7714d9fe093ea617eb9
3
+ metadata.gz: 59c59e65f1434263c7e36d4d89029083fe241185daba81730010af5b865ccabc
4
+ data.tar.gz: c4b9a4d0a73f9e0dd3068aeade2e04565e2d69b4739c9dc00c3a820c631089b3
5
5
  SHA512:
6
- metadata.gz: 94559c60b8dd1124dd1096ec430a87f6c601efcb6a9f02af1ba85f705d1dd22971d2626f1b46627152a2c4e75b832c9a88ca664eac84a3534297688ab9ff2469
7
- data.tar.gz: 534dc11dadc43079d31f952ce41a51615209367cbd48850f1f02b7f1af12402d06aca99c586fcdeb5464645cc226a8713f13b850eb9409677ac931b733cb60fc
6
+ metadata.gz: 46b643cba9fcd36653300e4a11679f882eb1f1b5482e4811c38f580e6ad4526c60a3d2f61ecf9a4df13f5abef2c9d4b954ae4cec959159efced1c011b9dd458f
7
+ data.tar.gz: cd46ecdd5268be36578fecef171b2b86e7b000c750fbcc9e9000a51485e58559d14d9c9a32e9e623fff757f58559a90bab99f68aa87159bedc9737e3b29d082b
@@ -102,7 +102,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
102
102
  // either `desktop` or `mobile` so it can be interpolated to access the
103
103
  // `data-toggle-{desktop|mobile}-group` attribute.
104
104
  var windowSize = function () {
105
- return window.innerWidth >= SETTINGS.breakpoint.desktop ? 'desktop' : 'mobile'
105
+ return document.documentElement.clientWidth >= SETTINGS.breakpoint.desktop ? 'desktop' : 'mobile'
106
106
  }
107
107
 
108
108
  function SuperNavigationMegaMenu ($module) {
@@ -0,0 +1,48 @@
1
+ /* global XMLHttpRequest */
2
+ window.GOVUK = window.GOVUK || {}
3
+ window.GOVUK.Modules = window.GOVUK.Modules || {};
4
+
5
+ (function (Modules) {
6
+ function SinglePageNotificationButton ($module) {
7
+ this.$module = $module
8
+ this.basePath = this.$module.querySelector('input[name="base_path"]').value
9
+ this.buttonLocation = this.$module.getAttribute('data-button-location')
10
+
11
+ this.personalisationEndpoint = '/api/personalisation/check-email-subscription?base_path=' + this.basePath
12
+ // This attribute is passed through to the personalisation API to ensure the updated button has the same button_location for analytics
13
+ if (this.buttonLocation) this.personalisationEndpoint += '&button_location=' + this.buttonLocation
14
+ }
15
+
16
+ SinglePageNotificationButton.prototype.init = function () {
17
+ var xhr = new XMLHttpRequest()
18
+ xhr.open('GET', this.personalisationEndpoint, true)
19
+
20
+ xhr.onreadystatechange = function () {
21
+ if (xhr.readyState === 4 && xhr.status === 200) {
22
+ var responseText = xhr.responseText
23
+ // if response text exists and is JSON parse-able, parse the response and get the button html
24
+ if (responseText && this.responseIsJSON(responseText)) {
25
+ var newButton = JSON.parse(responseText).button_html
26
+ var html = document.createElement('div')
27
+ html.innerHTML = newButton
28
+ // test that the html returned contains the button component; if yes, swap the button for the updated version
29
+ var responseHasButton = html.querySelector('form.gem-c-single-page-notification-button .gem-c-single-page-notification-button__submit')
30
+ if (responseHasButton) {
31
+ this.$module.outerHTML = newButton
32
+ }
33
+ }
34
+ }
35
+ }.bind(this)
36
+ xhr.send()
37
+ }
38
+
39
+ SinglePageNotificationButton.prototype.responseIsJSON = function (string) {
40
+ try {
41
+ JSON.parse(string)
42
+ } catch (e) {
43
+ return false
44
+ }
45
+ return true
46
+ }
47
+ Modules.SinglePageNotificationButton = SinglePageNotificationButton
48
+ })(window.GOVUK.Modules)
@@ -68,6 +68,7 @@ $govuk-new-link-styles: true;
68
68
  @import "components/select";
69
69
  @import "components/share-links";
70
70
  @import "components/show-password";
71
+ @import "components/single-page-notification-button";
71
72
  @import "components/skip-link";
72
73
  @import "components/step-by-step-nav-header";
73
74
  @import "components/step-by-step-nav-related";
@@ -1,3 +1,5 @@
1
+ @import "mixins/prefixed-transform";
2
+
1
3
  $gem-c-accordion-border-width: 3px;
2
4
  $gem-c-accordion-bottom-border-width: 1px;
3
5
 
@@ -69,6 +71,7 @@ $gem-c-accordion-bottom-border-width: 1px;
69
71
  }
70
72
 
71
73
  &:after {
74
+ @include prefixed-transform($rotate: -45deg);
72
75
  content: "";
73
76
  display: block;
74
77
  box-sizing: border-box;
@@ -78,7 +81,6 @@ $gem-c-accordion-bottom-border-width: 1px;
78
81
  height: govuk-em(6, 14);
79
82
  border-top: govuk-em(2, 14) solid;
80
83
  border-right: govuk-em(2, 14) solid;
81
- transform: rotate(-45deg);
82
84
  left: govuk-em(6, 14);
83
85
  bottom: govuk-em(5, 14);
84
86
 
@@ -111,7 +113,7 @@ $gem-c-accordion-bottom-border-width: 1px;
111
113
 
112
114
  // Rotate icon to create "Down" version
113
115
  .gem-c-accordion-nav__chevron--down {
114
- transform: rotate(180deg);
116
+ @include prefixed-transform($rotate: 180deg);
115
117
  }
116
118
 
117
119
  .gem-c-accordion__section-heading {
@@ -296,12 +298,12 @@ $gem-c-accordion-bottom-border-width: 1px;
296
298
 
297
299
  // Reduce Chevron size
298
300
  .gem-c-accordion-nav__chevron {
301
+ @include prefixed-transform($scale: .875);
299
302
  width: govuk-em(20, 14);
300
303
  height: govuk-em(20, 14);
301
304
  margin-left: govuk-em(5, 14);
302
305
  border: govuk-em(1, 14) solid;
303
306
  border-radius: govuk-em(100, 14);
304
- transform: scale(.875);
305
307
 
306
308
  &:after {
307
309
  width: govuk-em(6, 14);
@@ -314,7 +316,7 @@ $gem-c-accordion-bottom-border-width: 1px;
314
316
  }
315
317
 
316
318
  .gem-c-accordion-nav__chevron--down {
317
- transform: scale(.875) rotate(180deg);
319
+ @include prefixed-transform($rotate: 180deg, $scale: .875);
318
320
  }
319
321
 
320
322
  .gem-c-accordion__section-summary {
@@ -16,7 +16,6 @@
16
16
  @import "govspeak/place";
17
17
  @import "govspeak/stat-headline";
18
18
  @import "govspeak/steps";
19
- @import "govspeak/summary";
20
19
  @import "govspeak/tables";
21
20
  @import "govspeak/typography";
22
21
  @import "govspeak/warning-callout";