govuk_publishing_components 23.1.0 → 23.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics/init.js +56 -0
  3. data/app/assets/javascripts/govuk_publishing_components/components/copy-to-clipboard.js +16 -14
  4. data/app/assets/javascripts/govuk_publishing_components/components/details.js +38 -34
  5. data/app/assets/javascripts/govuk_publishing_components/components/print-link.js +8 -7
  6. data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/magna-charta.js +9 -8
  7. data/app/assets/javascripts/govuk_publishing_components/lib/initial-focus.js +13 -0
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +1 -0
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_input.scss +0 -46
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +5 -0
  11. data/app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak.scss +4 -0
  12. data/app/views/govuk_publishing_components/components/_input.html.erb +6 -6
  13. data/app/views/govuk_publishing_components/components/docs/govspeak.yml +14 -0
  14. data/lib/govuk_publishing_components/version.rb +1 -1
  15. data/node_modules/govuk-frontend/govuk/all.js +31 -37
  16. data/node_modules/govuk-frontend/govuk/components/accordion/README.md +1 -1
  17. data/node_modules/govuk-frontend/govuk/components/accordion/_index.scss +0 -1
  18. data/node_modules/govuk-frontend/govuk/components/accordion/fixtures.json +235 -0
  19. data/node_modules/govuk-frontend/govuk/components/back-link/_index.scss +0 -2
  20. data/node_modules/govuk-frontend/govuk/components/back-link/fixtures.json +56 -0
  21. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/_index.scss +0 -1
  22. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/fixtures.json +172 -0
  23. data/node_modules/govuk-frontend/govuk/components/button/_index.scss +3 -3
  24. data/node_modules/govuk-frontend/govuk/components/button/fixtures.json +275 -0
  25. data/node_modules/govuk-frontend/govuk/components/character-count/fixtures.json +170 -0
  26. data/node_modules/govuk-frontend/govuk/components/checkboxes/_index.scss +13 -13
  27. data/node_modules/govuk-frontend/govuk/components/checkboxes/fixtures.json +1015 -0
  28. data/node_modules/govuk-frontend/govuk/components/date-input/fixtures.json +499 -0
  29. data/node_modules/govuk-frontend/govuk/components/details/_index.scss +0 -1
  30. data/node_modules/govuk-frontend/govuk/components/details/fixtures.json +83 -0
  31. data/node_modules/govuk-frontend/govuk/components/error-message/fixtures.json +66 -0
  32. data/node_modules/govuk-frontend/govuk/components/error-summary/_index.scss +0 -2
  33. data/node_modules/govuk-frontend/govuk/components/error-summary/fixtures.json +181 -0
  34. data/node_modules/govuk-frontend/govuk/components/fieldset/_index.scss +1 -1
  35. data/node_modules/govuk-frontend/govuk/components/fieldset/fixtures.json +93 -0
  36. data/node_modules/govuk-frontend/govuk/components/fieldset/macro-options.json +6 -0
  37. data/node_modules/govuk-frontend/govuk/components/fieldset/template.njk +5 -1
  38. data/node_modules/govuk-frontend/govuk/components/file-upload/fixtures.json +151 -0
  39. data/node_modules/govuk-frontend/govuk/components/footer/_index.scss +0 -1
  40. data/node_modules/govuk-frontend/govuk/components/footer/fixtures.json +482 -0
  41. data/node_modules/govuk-frontend/govuk/components/header/_index.scss +2 -5
  42. data/node_modules/govuk-frontend/govuk/components/header/fixtures.json +360 -0
  43. data/node_modules/govuk-frontend/govuk/components/header/header.js +665 -316
  44. data/node_modules/govuk-frontend/govuk/components/header/macro-options.json +13 -1
  45. data/node_modules/govuk-frontend/govuk/components/header/template.njk +9 -5
  46. data/node_modules/govuk-frontend/govuk/components/hint/_index.scss +0 -2
  47. data/node_modules/govuk-frontend/govuk/components/hint/fixtures.json +50 -0
  48. data/node_modules/govuk-frontend/govuk/components/hint/macro-options.json +1 -1
  49. data/node_modules/govuk-frontend/govuk/components/input/_index.scss +91 -0
  50. data/node_modules/govuk-frontend/govuk/components/input/fixtures.json +538 -0
  51. data/node_modules/govuk-frontend/govuk/components/input/macro-options.json +64 -0
  52. data/node_modules/govuk-frontend/govuk/components/input/template.njk +17 -0
  53. data/node_modules/govuk-frontend/govuk/components/inset-text/fixtures.json +49 -0
  54. data/node_modules/govuk-frontend/govuk/components/label/fixtures.json +75 -0
  55. data/node_modules/govuk-frontend/govuk/components/panel/_index.scss +6 -2
  56. data/node_modules/govuk-frontend/govuk/components/panel/fixtures.json +74 -0
  57. data/node_modules/govuk-frontend/govuk/components/phase-banner/fixtures.json +65 -0
  58. data/node_modules/govuk-frontend/govuk/components/radios/_index.scss +13 -13
  59. data/node_modules/govuk-frontend/govuk/components/radios/fixtures.json +1066 -0
  60. data/node_modules/govuk-frontend/govuk/components/radios/macro-options.json +2 -2
  61. data/node_modules/govuk-frontend/govuk/components/select/_index.scss +0 -1
  62. data/node_modules/govuk-frontend/govuk/components/select/fixtures.json +248 -0
  63. data/node_modules/govuk-frontend/govuk/components/skip-link/fixtures.json +72 -0
  64. data/node_modules/govuk-frontend/govuk/components/summary-list/README.md +1 -1
  65. data/node_modules/govuk-frontend/govuk/components/summary-list/_index.scss +2 -10
  66. data/node_modules/govuk-frontend/govuk/components/summary-list/fixtures.json +991 -0
  67. data/node_modules/govuk-frontend/govuk/components/table/fixtures.json +468 -0
  68. data/node_modules/govuk-frontend/govuk/components/tabs/_index.scss +3 -6
  69. data/node_modules/govuk-frontend/govuk/components/tabs/fixtures.json +229 -0
  70. data/node_modules/govuk-frontend/govuk/components/tag/_index.scss +0 -1
  71. data/node_modules/govuk-frontend/govuk/components/tag/fixtures.json +117 -0
  72. data/node_modules/govuk-frontend/govuk/components/textarea/_index.scss +0 -1
  73. data/node_modules/govuk-frontend/govuk/components/textarea/fixtures.json +199 -0
  74. data/node_modules/govuk-frontend/govuk/components/warning-text/_index.scss +0 -1
  75. data/node_modules/govuk-frontend/govuk/components/warning-text/fixtures.json +68 -0
  76. data/node_modules/govuk-frontend/govuk/helpers/_device-pixels.scss +3 -3
  77. data/node_modules/govuk-frontend/govuk/helpers/_font-faces.scss +9 -11
  78. data/node_modules/govuk-frontend/govuk/helpers/_links.scss +1 -3
  79. data/node_modules/govuk-frontend/govuk/helpers/_media-queries.scss +1 -5
  80. data/node_modules/govuk-frontend/govuk/helpers/_spacing.scss +2 -1
  81. data/node_modules/govuk-frontend/govuk/helpers/_typography.scss +7 -6
  82. data/node_modules/govuk-frontend/govuk/objects/_form-group.scss +0 -1
  83. data/node_modules/govuk-frontend/govuk/objects/_grid.scss +2 -3
  84. data/node_modules/govuk-frontend/govuk/objects/_main-wrapper.scss +0 -1
  85. data/node_modules/govuk-frontend/govuk/overrides/_display.scss +1 -1
  86. data/node_modules/govuk-frontend/govuk/overrides/_width.scss +1 -0
  87. data/node_modules/govuk-frontend/govuk/settings/_colours-applied.scss +0 -3
  88. data/node_modules/govuk-frontend/govuk/settings/_colours-organisations.scss +3 -0
  89. data/node_modules/govuk-frontend/govuk/settings/_colours-palette.scss +9 -2
  90. data/node_modules/govuk-frontend/govuk/settings/_compatibility.scss +0 -1
  91. data/node_modules/govuk-frontend/govuk/settings/_measurements.scss +0 -4
  92. data/node_modules/govuk-frontend/govuk/settings/_typography-font-families.scss +2 -2
  93. data/node_modules/govuk-frontend/govuk/settings/_typography-font.scss +11 -5
  94. data/node_modules/govuk-frontend/govuk/settings/_typography-responsive.scss +6 -2
  95. data/node_modules/govuk-frontend/govuk/tools/_font-url.scss +0 -3
  96. data/node_modules/govuk-frontend/govuk/tools/_image-url.scss +0 -3
  97. data/node_modules/govuk-frontend/govuk/utilities/_visually-hidden.scss +0 -1
  98. data/node_modules/govuk-frontend/govuk/vendor/_sass-mq.scss +0 -4
  99. data/node_modules/govuk-frontend/package.json +1 -1
  100. metadata +33 -4
  101. data/app/assets/javascripts/govuk_publishing_components/analytics/init.js.erb +0 -50
  102. data/app/assets/javascripts/govuk_publishing_components/components/initial-focus.js +0 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 20fcbde55a95f5ca3e7ac5744c94f69b573b563e9c5df919681864c6662dff16
4
- data.tar.gz: 9d65b762cc90d4e8bfa3ba37b2c811778af94f55a3d88d0e45ca0ed7f0d0161a
3
+ metadata.gz: ccb3ff988da8eed7ce14013d8f0a0f054661b7ee9322a2caa75ab49a5b064162
4
+ data.tar.gz: b115615020b7694cab625d98ee0abe11e98306d8776c7afb3ffd400d642fe32c
5
5
  SHA512:
6
- metadata.gz: 10d6c20ed45850b0bc92826e009dd10d8cbc5a6e09368ad9822e33d97a7bf6b8b59b43c50b18cf630e109455df35e4b993b6c1e497d0eeb94adc2081b128da41
7
- data.tar.gz: b3fdb29493b563ef3893f1c2d33f21feb2f9817d38952cff97091e6b318bd0d11c2ddd3c85ba08f0baf80560a30150651ed283fbaf06700b4045d161cb187740
6
+ metadata.gz: cfb2771a84017aca9fc781ea5d650a1402cbf1a88770993e222e42cfe0aa946e14569c14add10ae41dd5ee7619ce028dcfaf501049b7738e56d71afe65f7d2d0
7
+ data.tar.gz: 571a20b867d372fefc21d4dcf451fd59c56530146fb7c7e258a878320c905ff408f60ce793675a2fba6fbbdedc94fea17adc310eff84529d34b0529193a7f58c
@@ -0,0 +1,56 @@
1
+ var analyticsInit = function () {
2
+ 'use strict'
3
+
4
+ var analyticsVars = window.GOVUK.analyticsVars || false
5
+ if (analyticsVars) {
6
+ var gaProperty = window.GOVUK.analyticsVars.gaProperty || false
7
+ var gaPropertyCrossDomain = window.GOVUK.analyticsVars.gaPropertyCrossDomain || false
8
+ var linkedDomains = window.GOVUK.analyticsVars.linkedDomains || false
9
+ }
10
+
11
+ var consentCookie = window.GOVUK.getConsentCookie()
12
+ var dummyAnalytics = {
13
+ addLinkedTrackerDomain: function () {},
14
+ setDimension: function () {},
15
+ setOptionsForNextPageView: function () {},
16
+ trackEvent: function () {},
17
+ trackPageview: function () {},
18
+ trackShare: function () {}
19
+ }
20
+
21
+ // Disable analytics by default
22
+ // This will be reversed below, if the consent cookie says usage cookies are allowed
23
+ var disabler = 'ga-disable-' + gaProperty
24
+ window[disabler] = true
25
+
26
+ if (consentCookie && consentCookie.usage) {
27
+ window[disabler] = false
28
+
29
+ // Load Google Analytics libraries
30
+ window.GOVUK.StaticAnalytics.load()
31
+
32
+ if (gaProperty) {
33
+ // Use document.domain in dev, preview and staging so that tracking works
34
+ // Otherwise explicitly set the domain as www.gov.uk (and not gov.uk).
35
+ var cookieDomain = (document.domain === 'www.gov.uk') ? '.www.gov.uk' : document.domain
36
+
37
+ // Configure profiles, setup custom vars, track initial pageview
38
+ var analytics = new window.GOVUK.StaticAnalytics({
39
+ universalId: gaProperty,
40
+ cookieDomain: cookieDomain,
41
+ allowLinker: true
42
+ })
43
+
44
+ // Make interface public for virtual pageviews and events
45
+ window.GOVUK.analytics = analytics
46
+
47
+ if (linkedDomains && linkedDomains.length > 0) {
48
+ window.GOVUK.analytics.addLinkedTrackerDomain(gaPropertyCrossDomain, 'govuk', linkedDomains)
49
+ }
50
+ }
51
+ } else {
52
+ window.GOVUK.analytics = dummyAnalytics
53
+ }
54
+ }
55
+
56
+ window.GOVUK.analyticsInit = analyticsInit
@@ -2,22 +2,24 @@ window.GOVUK = window.GOVUK || {}
2
2
  window.GOVUK.Modules = window.GOVUK.Modules || {};
3
3
 
4
4
  (function (Modules) {
5
- 'use strict'
5
+ function CopyToClipboard () { }
6
6
 
7
- Modules.CopyToClipboard = function () {
8
- this.start = function (element) {
9
- var input = element[0].querySelector('.gem-c-input')
10
- var copyButton = element[0].querySelector('.gem-c-button')
7
+ CopyToClipboard.prototype.start = function ($module) {
8
+ this.$module = $module[0]
11
9
 
12
- input.addEventListener('click', function () {
13
- input.select()
14
- })
10
+ var input = this.$module.querySelector('.gem-c-input')
11
+ var copyButton = this.$module.querySelector('.gem-c-button')
15
12
 
16
- copyButton.addEventListener('click', function (event) {
17
- event.preventDefault()
18
- input.select()
19
- document.execCommand('copy')
20
- })
21
- }
13
+ input.addEventListener('click', function () {
14
+ input.select()
15
+ })
16
+
17
+ copyButton.addEventListener('click', function (event) {
18
+ event.preventDefault()
19
+ input.select()
20
+ document.execCommand('copy')
21
+ })
22
22
  }
23
+
24
+ Modules.CopyToClipboard = CopyToClipboard
23
25
  })(window.GOVUK.Modules)
@@ -4,47 +4,51 @@ window.GOVUK = window.GOVUK || {}
4
4
  window.GOVUK.Modules = window.GOVUK.Modules || {};
5
5
 
6
6
  (function (Modules) {
7
- 'use strict'
8
-
9
- Modules.GovukDetails = function () {
10
- this.start = function (element) {
11
- var customTrackLabel = element[0].getAttribute('data-track-label')
12
-
13
- // If a custom label has been provided, we can simply call the tracking module
14
- if (customTrackLabel) {
15
- var trackDetails = new window.GOVUK.Modules.TrackClick()
16
- trackDetails.start(element)
17
- } else {
18
- // If no custom label is set, we use the open/close status as the label
19
- var detailsComponent = element[0]
20
- var detailsClick = detailsComponent.querySelector('[data-details-track-click]')
21
- var that = this
22
-
23
- if (detailsClick) {
24
- detailsClick.addEventListener('click', function (event) {
25
- that.trackDefault(detailsComponent)
26
- })
27
- }
7
+ function GovukDetails () { }
8
+
9
+ GovukDetails.prototype.start = function ($module) {
10
+ this.$module = $module[0]
11
+
12
+ var customTrackLabel = this.$module.getAttribute('data-track-label')
13
+
14
+ // If a custom label has been provided, we can simply call the tracking module
15
+ if (customTrackLabel) {
16
+ var trackDetails = new window.GOVUK.Modules.TrackClick()
17
+ trackDetails.start($module)
18
+ } else {
19
+ // If no custom label is set, we use the open/close status as the label
20
+ var detailsClick = this.$module.querySelector('[data-details-track-click]')
21
+
22
+ if (detailsClick) {
23
+ detailsClick.addEventListener('click', function (event) {
24
+ this.trackDefault(this.$module)
25
+ }.bind(this))
28
26
  }
29
27
  }
28
+ }
30
29
 
31
- this.trackDefault = function (element) {
32
- if (window.GOVUK.analytics && window.GOVUK.analytics.trackEvent) {
33
- var componentStatus = (element.getAttribute('open') == null) ? 'open' : 'closed'
34
- var trackCategory = element.getAttribute('data-track-category')
35
- var trackAction = element.getAttribute('data-track-action')
36
- var trackOptions = element.getAttribute('data-track-options')
30
+ GovukDetails.prototype.trackDefault = function (element) {
31
+ if (window.GOVUK.analytics && window.GOVUK.analytics.trackEvent) {
32
+ var componentStatus = (element.getAttribute('open') == null) ? 'open' : 'closed'
33
+ var trackCategory = element.getAttribute('data-track-category')
34
+ var trackAction = element.getAttribute('data-track-action')
35
+ var trackOptions = element.getAttribute('data-track-options')
37
36
 
38
- if (typeof trackOptions !== 'object' || trackOptions === null) {
39
- trackOptions = {}
40
- }
37
+ if (trackOptions) {
38
+ trackOptions = JSON.parse(trackOptions)
39
+ }
40
+
41
+ if (typeof trackOptions !== 'object' || trackOptions === null) {
42
+ trackOptions = {}
43
+ }
41
44
 
42
- trackOptions.label = componentStatus
45
+ trackOptions.label = componentStatus
43
46
 
44
- if (trackAction && trackCategory) {
45
- window.GOVUK.analytics.trackEvent(trackCategory, trackAction, trackOptions)
46
- }
47
+ if (trackAction && trackCategory) {
48
+ window.GOVUK.analytics.trackEvent(trackCategory, trackAction, trackOptions)
47
49
  }
48
50
  }
49
51
  }
52
+
53
+ Modules.GovukDetails = GovukDetails
50
54
  })(window.GOVUK.Modules)
@@ -2,13 +2,14 @@ window.GOVUK = window.GOVUK || {}
2
2
  window.GOVUK.Modules = window.GOVUK.Modules || {};
3
3
 
4
4
  (function (Modules) {
5
- 'use strict'
5
+ function PrintLink () { }
6
6
 
7
- Modules.PrintLink = function () {
8
- this.start = function (element) {
9
- element[0].addEventListener('click', function () {
10
- window.print()
11
- })
12
- }
7
+ PrintLink.prototype.start = function ($module) {
8
+ this.$module = $module[0]
9
+ this.$module.addEventListener('click', function () {
10
+ window.print()
11
+ })
13
12
  }
13
+
14
+ Modules.PrintLink = PrintLink
14
15
  })(window.GOVUK.Modules)
@@ -49,8 +49,9 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
49
49
 
50
50
  // true if it's a 'multiple' table
51
51
  // this means multiple bars per rows, but not stacked.
52
- var moreThanTwoTDs = this.$table.querySelectorAll('tbody tr')[0].querySelectorAll('td').length > 2
53
- this.options.multiple = !this.options.stacked && (this.$table.classList.contains('mc-multiple') || moreThanTwoTDs)
52
+ var moreThanTwoCells = this.$table.querySelectorAll('tbody tr')[0].querySelectorAll('th, td').length > 2
53
+
54
+ this.options.multiple = !this.options.stacked && (this.$table.classList.contains('mc-multiple') || moreThanTwoCells)
54
55
 
55
56
  // set the outdent options
56
57
  // which can be set via classes or overriden by setting the value to true
@@ -118,11 +119,11 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
118
119
  tr.classList.add('mc-tr')
119
120
 
120
121
  var output = ''
121
- var allTheTHs = this.$table.querySelectorAll('th')
122
+ var allTheTHsInTableHead = this.$table.querySelectorAll('thead th')
122
123
 
123
- for (var i = 0; i < allTheTHs.length; i++) {
124
+ for (var i = 0; i < allTheTHsInTableHead.length; i++) {
124
125
  output += '<div class="mc-th">'
125
- output += allTheTHs[i].innerHTML
126
+ output += allTheTHsInTableHead[i].innerHTML
126
127
  output += '</div>'
127
128
  }
128
129
 
@@ -143,11 +144,11 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
143
144
  tr.classList.add('mc-tr')
144
145
 
145
146
  var cellsOutput = ''
146
- var allTheTds = allTheTbodyTrs[i].querySelectorAll('td')
147
+ var allTheTableBodyCells = allTheTbodyTrs[i].querySelectorAll('th, td')
147
148
 
148
- for (var j = 0; j < allTheTds.length; j++) {
149
+ for (var j = 0; j < allTheTableBodyCells.length; j++) {
149
150
  cellsOutput += '<div class="mc-td">'
150
- cellsOutput += allTheTds[j].innerHTML
151
+ cellsOutput += allTheTableBodyCells[j].innerHTML
151
152
  cellsOutput += '</div>'
152
153
  }
153
154
  tr.innerHTML = cellsOutput
@@ -0,0 +1,13 @@
1
+ window.GOVUK = window.GOVUK || {}
2
+ window.GOVUK.Modules = window.GOVUK.Modules || {};
3
+
4
+ (function (Modules) {
5
+ function InitialFocus () { }
6
+
7
+ InitialFocus.prototype.start = function ($module) {
8
+ this.$module = $module[0]
9
+ this.$module.focus()
10
+ }
11
+
12
+ Modules.InitialFocus = InitialFocus
13
+ })(window.GOVUK.Modules)
@@ -88,6 +88,7 @@
88
88
  height: 100%;
89
89
  $ie-background: rgba(255, 255, 255, 0);
90
90
  background: $ie-background; // because internet explorer
91
+ -ms-high-contrast-adjust: none;
91
92
  }
92
93
 
93
94
  @include govuk-media-query($from: mobile, $until: tablet) {
@@ -18,49 +18,3 @@
18
18
  padding-left: govuk-spacing(6);
19
19
  }
20
20
  }
21
-
22
- .gem-c-input__wrapper {
23
- display: flex;
24
- display: -ms-flexbox;
25
-
26
- .gem-c-input {
27
- display: inline-block;
28
- flex: 0 1 auto;
29
- }
30
-
31
- .gem-c-input:focus {
32
- z-index: 1; // increase z-index on focus so it appears over the suffix
33
- }
34
- }
35
-
36
- .gem-c-input__prefix,
37
- .gem-c-input__suffix {
38
- @include govuk-font($size: 19);
39
-
40
- background-color: govuk-colour("light-grey", $legacy: "grey-3");
41
- border: $govuk-border-width-form-element solid $govuk-input-border-colour;
42
- box-sizing: border-box;
43
- cursor: default; // emphasise non-editable status of prefixes and suffixes
44
- display: inline-block;
45
- flex: 0 0 auto;
46
- height: 40px;
47
- margin-top: 0;
48
- min-width: 40px;
49
- padding: govuk-spacing(1);
50
- text-align: center;
51
- white-space: nowrap;
52
- width: auto;
53
-
54
- @if $govuk-typography-use-rem {
55
- height: govuk-px-to-rem(40px);
56
- min-width: govuk-px-to-rem(40px);
57
- }
58
- }
59
-
60
- .gem-c-input__prefix {
61
- border-right: 0;
62
- }
63
-
64
- .gem-c-input__suffix {
65
- border-left: 0;
66
- }
@@ -104,11 +104,16 @@
104
104
  }
105
105
  }
106
106
 
107
+ .govuk-header__logotype {
108
+ vertical-align: middle;
109
+ }
110
+
107
111
  .gem-c-header__product-name {
108
112
  display: none;
109
113
 
110
114
  @include govuk-media-query($from: tablet) {
111
115
  display: inline-block;
116
+ vertical-align: middle;
112
117
  }
113
118
  }
114
119
 
@@ -58,6 +58,10 @@
58
58
 
59
59
  .footnotes {
60
60
  border-top: 1px solid $govuk-text-colour;
61
+
62
+ a[role="doc-backlink"] {
63
+ display: none;
64
+ }
61
65
  }
62
66
 
63
67
  .legislative-list {
@@ -107,17 +107,17 @@
107
107
  %>
108
108
 
109
109
  <% if prefix && suffix %>
110
- <%= tag.div class: "gem-c-input__wrapper" do %>
110
+ <%= tag.div class: "govuk-input__wrapper" do %>
111
111
  <% # The line below relies on in-line styling for legacy browsers and it's whitespace-sensitive %>
112
- <%= tag.span prefix, class: "gem-c-input__prefix", aria: { hidden: true } %><%= input_tag %><%= tag.span suffix, class: "gem-c-input__suffix", aria: { hidden: true } %>
112
+ <%= tag.span prefix, class: "govuk-input__prefix", aria: { hidden: true } %><%= input_tag %><%= tag.span suffix, class: "govuk-input__suffix", aria: { hidden: true } %>
113
113
  <% end %>
114
114
  <% elsif prefix %>
115
- <%= tag.div class: "gem-c-input__wrapper" do %>
116
- <%= tag.span prefix, class: "gem-c-input__prefix", aria: { hidden: true } %><%= input_tag %>
115
+ <%= tag.div class: "govuk-input__wrapper" do %>
116
+ <%= tag.span prefix, class: "govuk-input__prefix", aria: { hidden: true } %><%= input_tag %>
117
117
  <% end %>
118
118
  <% elsif suffix %>
119
- <%= tag.div class: "gem-c-input__wrapper" do %>
120
- <%= input_tag %><%= tag.span suffix, class: "gem-c-input__suffix", aria: { hidden: true } %>
119
+ <%= tag.div class: "govuk-input__wrapper" do %>
120
+ <%= input_tag %><%= tag.span suffix, class: "govuk-input__suffix", aria: { hidden: true } %>
121
121
  <% end %>
122
122
  <% else %>
123
123
  <%= input_tag %>
@@ -236,6 +236,20 @@ examples:
236
236
  </tr>
237
237
  </tbody>
238
238
  </table>
239
+ chart_with_multiple_headings:
240
+ data:
241
+ block: |
242
+ <table id="multiple-table-chart" class="js-barchart-table mc-multiple">
243
+ <caption>Multiple Table</caption>
244
+ <thead>
245
+ <tr><th>Some Data</th><th>YES</th><th>NO</th><th>MAYBE</th></tr>
246
+ </thead>
247
+ <tbody>
248
+ <tr><th>Testing One</th><td>5</td><td>6</td><td>11</td></tr>
249
+ <tr><th>Testing Two</th><td>6</td><td>2</td><td>8</td></tr>
250
+ <tr><th>Testing Three</th><td>3</td><td>9</td><td>12</td></tr>
251
+ </tbody>
252
+ </table>
239
253
  address:
240
254
  data:
241
255
  block: |
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "23.1.0".freeze
2
+ VERSION = "23.5.0".freeze
3
3
  end
@@ -1961,55 +1961,49 @@ ErrorSummary.prototype.getAssociatedLegendOrLabel = function ($input) {
1961
1961
 
1962
1962
  function Header ($module) {
1963
1963
  this.$module = $module;
1964
+ this.$menuButton = $module && $module.querySelector('.govuk-js-header-toggle');
1965
+ this.$menu = this.$menuButton && $module.querySelector(
1966
+ '#' + this.$menuButton.getAttribute('aria-controls')
1967
+ );
1964
1968
  }
1965
1969
 
1970
+ /**
1971
+ * Initialise header
1972
+ *
1973
+ * Check for the presence of the header, menu and menu button – if any are
1974
+ * missing then there's nothing to do so return early.
1975
+ */
1966
1976
  Header.prototype.init = function () {
1967
- // Check for module
1968
- var $module = this.$module;
1969
- if (!$module) {
1977
+ if (!this.$module || !this.$menuButton || !this.$menu) {
1970
1978
  return
1971
1979
  }
1972
1980
 
1973
- // Check for button
1974
- var $toggleButton = $module.querySelector('.govuk-js-header-toggle');
1975
- if (!$toggleButton) {
1976
- return
1977
- }
1978
-
1979
- // Handle $toggleButton click events
1980
- $toggleButton.addEventListener('click', this.handleClick.bind(this));
1981
+ this.syncState(this.$menu.classList.contains('govuk-header__navigation--open'));
1982
+ this.$menuButton.addEventListener('click', this.handleMenuButtonClick.bind(this));
1981
1983
  };
1982
1984
 
1983
1985
  /**
1984
- * Toggle class
1985
- * @param {object} node element
1986
- * @param {string} className to toggle
1987
- */
1988
- Header.prototype.toggleClass = function (node, className) {
1989
- if (node.className.indexOf(className) > 0) {
1990
- node.className = node.className.replace(' ' + className, '');
1991
- } else {
1992
- node.className += ' ' + className;
1993
- }
1986
+ * Sync menu state
1987
+ *
1988
+ * Sync the menu button class and the accessible state of the menu and the menu
1989
+ * button with the visible state of the menu
1990
+ *
1991
+ * @param {boolean} isVisible Whether the menu is currently visible
1992
+ */
1993
+ Header.prototype.syncState = function (isVisible) {
1994
+ this.$menuButton.classList.toggle('govuk-header__menu-button--open', isVisible);
1995
+ this.$menuButton.setAttribute('aria-expanded', isVisible);
1994
1996
  };
1995
1997
 
1996
1998
  /**
1997
- * An event handler for click event on $toggleButton
1998
- * @param {object} event event
1999
- */
2000
- Header.prototype.handleClick = function (event) {
2001
- var $module = this.$module;
2002
- var $toggleButton = event.target || event.srcElement;
2003
- var $target = $module.querySelector('#' + $toggleButton.getAttribute('aria-controls'));
2004
-
2005
- // If a button with aria-controls, handle click
2006
- if ($toggleButton && $target) {
2007
- this.toggleClass($target, 'govuk-header__navigation--open');
2008
- this.toggleClass($toggleButton, 'govuk-header__menu-button--open');
2009
-
2010
- $toggleButton.setAttribute('aria-expanded', $toggleButton.getAttribute('aria-expanded') !== 'true');
2011
- $target.setAttribute('aria-hidden', $target.getAttribute('aria-hidden') === 'false');
2012
- }
1999
+ * Handle menu button click
2000
+ *
2001
+ * When the menu button is clicked, change the visibility of the menu and then
2002
+ * sync the accessibility state and menu button state
2003
+ */
2004
+ Header.prototype.handleMenuButtonClick = function () {
2005
+ var isVisible = this.$menu.classList.toggle('govuk-header__navigation--open');
2006
+ this.syncState(isVisible);
2013
2007
  };
2014
2008
 
2015
2009
  function Radios ($module) {