govuk_publishing_components 23.3.0 → 23.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/components/copy-to-clipboard.js +16 -14
  3. data/app/assets/javascripts/govuk_publishing_components/components/details.js +38 -34
  4. data/app/assets/javascripts/govuk_publishing_components/components/print-link.js +8 -7
  5. data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/magna-charta.js +10 -9
  6. data/app/assets/javascripts/govuk_publishing_components/lib/initial-focus.js +13 -0
  7. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -0
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-sidebar.scss +2 -0
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +1 -0
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_input.scss +0 -46
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_transition-countdown.scss +125 -0
  12. data/app/views/govuk_publishing_components/component_guide/show.html.erb +1 -2
  13. data/app/views/govuk_publishing_components/components/_attachment.html.erb +5 -4
  14. data/app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb +14 -1
  15. data/app/views/govuk_publishing_components/components/_input.html.erb +6 -6
  16. data/app/views/govuk_publishing_components/components/_transition_countdown.html.erb +34 -0
  17. data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb +5 -3
  18. data/app/views/govuk_publishing_components/components/docs/attachment.yml +10 -0
  19. data/app/views/govuk_publishing_components/components/docs/contextual_sidebar.yml +0 -1
  20. data/app/views/govuk_publishing_components/components/docs/govspeak.yml +55 -0
  21. data/app/views/govuk_publishing_components/components/docs/transition_countdown.yml +17 -0
  22. data/config/locales/cy.yml +9 -1
  23. data/config/locales/en.yml +7 -0
  24. data/lib/govuk_publishing_components.rb +1 -0
  25. data/lib/govuk_publishing_components/app_helpers/countdown_helper.rb +33 -0
  26. data/lib/govuk_publishing_components/version.rb +1 -1
  27. data/node_modules/govuk-frontend/govuk/all.js +31 -37
  28. data/node_modules/govuk-frontend/govuk/components/accordion/README.md +1 -1
  29. data/node_modules/govuk-frontend/govuk/components/accordion/_index.scss +0 -1
  30. data/node_modules/govuk-frontend/govuk/components/accordion/fixtures.json +235 -0
  31. data/node_modules/govuk-frontend/govuk/components/back-link/_index.scss +0 -2
  32. data/node_modules/govuk-frontend/govuk/components/back-link/fixtures.json +56 -0
  33. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/_index.scss +0 -1
  34. data/node_modules/govuk-frontend/govuk/components/breadcrumbs/fixtures.json +172 -0
  35. data/node_modules/govuk-frontend/govuk/components/button/_index.scss +3 -3
  36. data/node_modules/govuk-frontend/govuk/components/button/fixtures.json +275 -0
  37. data/node_modules/govuk-frontend/govuk/components/character-count/fixtures.json +170 -0
  38. data/node_modules/govuk-frontend/govuk/components/checkboxes/_index.scss +13 -13
  39. data/node_modules/govuk-frontend/govuk/components/checkboxes/fixtures.json +1015 -0
  40. data/node_modules/govuk-frontend/govuk/components/date-input/fixtures.json +499 -0
  41. data/node_modules/govuk-frontend/govuk/components/details/_index.scss +0 -1
  42. data/node_modules/govuk-frontend/govuk/components/details/fixtures.json +83 -0
  43. data/node_modules/govuk-frontend/govuk/components/error-message/fixtures.json +66 -0
  44. data/node_modules/govuk-frontend/govuk/components/error-summary/_index.scss +0 -2
  45. data/node_modules/govuk-frontend/govuk/components/error-summary/fixtures.json +181 -0
  46. data/node_modules/govuk-frontend/govuk/components/fieldset/_index.scss +1 -1
  47. data/node_modules/govuk-frontend/govuk/components/fieldset/fixtures.json +93 -0
  48. data/node_modules/govuk-frontend/govuk/components/fieldset/macro-options.json +6 -0
  49. data/node_modules/govuk-frontend/govuk/components/fieldset/template.njk +5 -1
  50. data/node_modules/govuk-frontend/govuk/components/file-upload/fixtures.json +151 -0
  51. data/node_modules/govuk-frontend/govuk/components/footer/_index.scss +0 -1
  52. data/node_modules/govuk-frontend/govuk/components/footer/fixtures.json +482 -0
  53. data/node_modules/govuk-frontend/govuk/components/header/_index.scss +2 -5
  54. data/node_modules/govuk-frontend/govuk/components/header/fixtures.json +360 -0
  55. data/node_modules/govuk-frontend/govuk/components/header/header.js +665 -316
  56. data/node_modules/govuk-frontend/govuk/components/header/macro-options.json +13 -1
  57. data/node_modules/govuk-frontend/govuk/components/header/template.njk +9 -5
  58. data/node_modules/govuk-frontend/govuk/components/hint/_index.scss +0 -2
  59. data/node_modules/govuk-frontend/govuk/components/hint/fixtures.json +50 -0
  60. data/node_modules/govuk-frontend/govuk/components/hint/macro-options.json +1 -1
  61. data/node_modules/govuk-frontend/govuk/components/input/_index.scss +91 -0
  62. data/node_modules/govuk-frontend/govuk/components/input/fixtures.json +538 -0
  63. data/node_modules/govuk-frontend/govuk/components/input/macro-options.json +64 -0
  64. data/node_modules/govuk-frontend/govuk/components/input/template.njk +17 -0
  65. data/node_modules/govuk-frontend/govuk/components/inset-text/fixtures.json +49 -0
  66. data/node_modules/govuk-frontend/govuk/components/label/fixtures.json +75 -0
  67. data/node_modules/govuk-frontend/govuk/components/panel/_index.scss +6 -2
  68. data/node_modules/govuk-frontend/govuk/components/panel/fixtures.json +74 -0
  69. data/node_modules/govuk-frontend/govuk/components/phase-banner/fixtures.json +65 -0
  70. data/node_modules/govuk-frontend/govuk/components/radios/_index.scss +13 -13
  71. data/node_modules/govuk-frontend/govuk/components/radios/fixtures.json +1066 -0
  72. data/node_modules/govuk-frontend/govuk/components/radios/macro-options.json +2 -2
  73. data/node_modules/govuk-frontend/govuk/components/select/_index.scss +0 -1
  74. data/node_modules/govuk-frontend/govuk/components/select/fixtures.json +248 -0
  75. data/node_modules/govuk-frontend/govuk/components/skip-link/fixtures.json +72 -0
  76. data/node_modules/govuk-frontend/govuk/components/summary-list/README.md +1 -1
  77. data/node_modules/govuk-frontend/govuk/components/summary-list/_index.scss +2 -10
  78. data/node_modules/govuk-frontend/govuk/components/summary-list/fixtures.json +991 -0
  79. data/node_modules/govuk-frontend/govuk/components/table/fixtures.json +468 -0
  80. data/node_modules/govuk-frontend/govuk/components/tabs/_index.scss +3 -6
  81. data/node_modules/govuk-frontend/govuk/components/tabs/fixtures.json +229 -0
  82. data/node_modules/govuk-frontend/govuk/components/tag/_index.scss +0 -1
  83. data/node_modules/govuk-frontend/govuk/components/tag/fixtures.json +117 -0
  84. data/node_modules/govuk-frontend/govuk/components/textarea/_index.scss +0 -1
  85. data/node_modules/govuk-frontend/govuk/components/textarea/fixtures.json +199 -0
  86. data/node_modules/govuk-frontend/govuk/components/warning-text/_index.scss +0 -1
  87. data/node_modules/govuk-frontend/govuk/components/warning-text/fixtures.json +68 -0
  88. data/node_modules/govuk-frontend/govuk/helpers/_device-pixels.scss +3 -3
  89. data/node_modules/govuk-frontend/govuk/helpers/_font-faces.scss +9 -11
  90. data/node_modules/govuk-frontend/govuk/helpers/_links.scss +1 -3
  91. data/node_modules/govuk-frontend/govuk/helpers/_media-queries.scss +1 -5
  92. data/node_modules/govuk-frontend/govuk/helpers/_spacing.scss +2 -1
  93. data/node_modules/govuk-frontend/govuk/helpers/_typography.scss +7 -6
  94. data/node_modules/govuk-frontend/govuk/objects/_form-group.scss +0 -1
  95. data/node_modules/govuk-frontend/govuk/objects/_grid.scss +2 -3
  96. data/node_modules/govuk-frontend/govuk/objects/_main-wrapper.scss +0 -1
  97. data/node_modules/govuk-frontend/govuk/overrides/_display.scss +1 -1
  98. data/node_modules/govuk-frontend/govuk/overrides/_width.scss +1 -0
  99. data/node_modules/govuk-frontend/govuk/settings/_colours-applied.scss +0 -3
  100. data/node_modules/govuk-frontend/govuk/settings/_colours-organisations.scss +3 -0
  101. data/node_modules/govuk-frontend/govuk/settings/_colours-palette.scss +9 -2
  102. data/node_modules/govuk-frontend/govuk/settings/_compatibility.scss +0 -1
  103. data/node_modules/govuk-frontend/govuk/settings/_measurements.scss +0 -4
  104. data/node_modules/govuk-frontend/govuk/settings/_typography-font-families.scss +2 -2
  105. data/node_modules/govuk-frontend/govuk/settings/_typography-font.scss +11 -5
  106. data/node_modules/govuk-frontend/govuk/settings/_typography-responsive.scss +6 -2
  107. data/node_modules/govuk-frontend/govuk/tools/_font-url.scss +0 -3
  108. data/node_modules/govuk-frontend/govuk/tools/_image-url.scss +0 -3
  109. data/node_modules/govuk-frontend/govuk/utilities/_visually-hidden.scss +0 -1
  110. data/node_modules/govuk-frontend/govuk/vendor/_sass-mq.scss +0 -4
  111. data/node_modules/govuk-frontend/package.json +1 -1
  112. metadata +36 -3
  113. 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: 023220040cfb5795cd3e6b148e22b442144f18028ef8e09853e764b004a5de0a
4
- data.tar.gz: 5b2a54316ce8efa8ae221bf8dddf3948934a2472838f629abbda0b2d56bc7f42
3
+ metadata.gz: 4a97fad3ed17572d72aa4904dec96a13f48732b2c740f017dd8ac3a8c9ef9d93
4
+ data.tar.gz: 429048afab20b2b89b342024d4681ccccfb4c7706d1e09051cfdf6c47af1066d
5
5
  SHA512:
6
- metadata.gz: 62418105d4b33b8d133b05dcbbf7f440fd0159e07144f8a9c9de272ccb2061c832b54d1233efdbecf91269aa0b98a97fa589ffba74591e86ae9892deef1cfb82
7
- data.tar.gz: 21a872c9340a3f6d8d95dcfa60a4935d1d945d75f24cd5a3427649679d062948d34e8f38a60429ca14f85243bc322beff2c87756ea489b828ca60fcdf714a689
6
+ metadata.gz: f51d92a980b602c69168a506866f2a496c4ea85558de991083ba09a3c7c054a50486dd8169bcb74f61ffa279066bbbf0e6d2a367c6d457f1f89ede11fff78423
7
+ data.tar.gz: d32c3132330f198be910b85ca88fdbf96c061a5fb5e2520eedd741ff03ea1af0072823e45d654ade08a84ae8a9ac9aedfbea80bc1a41156dda99d987a6fbd638
@@ -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
@@ -412,7 +413,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
412
413
  }
413
414
  } else {
414
415
  // if it's a stacked graph
415
- if (spanWidth > cellWidth && cellVal > 0) {
416
+ if ((spanWidth > cellWidth && cellVal > 0) || (cellVal < 1)) {
416
417
  $cell.classList.add('mc-value-overflow')
417
418
  }
418
419
  }
@@ -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)
@@ -73,4 +73,5 @@
73
73
  @import "components/textarea";
74
74
  @import "components/title";
75
75
  @import "components/translation-nav";
76
+ @import "components/transition-countdown";
76
77
  @import "components/warning-text";
@@ -1,3 +1,5 @@
1
+ @import 'transition-countdown';
2
+
1
3
  .gem-c-contextual-sidebar__brexit-cta {
2
4
  border-top: 2px solid $govuk-brand-colour;
3
5
  }
@@ -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
- }
@@ -0,0 +1,125 @@
1
+ $transition-campaign-red: #ff003b;
2
+ $transition-campaign-dark-blue: #1e1348;
3
+
4
+ .gem-c-transition-countdown {
5
+ @include govuk-font(19);
6
+ margin-bottom: govuk-spacing(6);
7
+ }
8
+
9
+ .gem-c-transition-countdown--cta {
10
+ background-color: govuk-colour('light-grey', $legacy: 'grey-4');
11
+ border-top: 4px solid $transition-campaign-red;
12
+ display: block;
13
+ padding: govuk-spacing(3);
14
+ text-decoration: none;
15
+ }
16
+
17
+ .gem-c-transition-countdown__title {
18
+ @extend %govuk-heading-m;
19
+ color: $transition-campaign-dark-blue;
20
+ }
21
+
22
+ .gem-c-transition-countdown__countdown {
23
+ margin-top: 0;
24
+ margin-bottom: govuk-spacing(2);
25
+
26
+ @include govuk-media-query($from: tablet) {
27
+ margin-bottom: govuk-spacing(0);
28
+ }
29
+ }
30
+
31
+ .gem-c-transition-countdown__countdown-number {
32
+ @include govuk-font($size: 80, $weight: bold, $line-height: 60px);
33
+
34
+ min-width: 50px;
35
+ text-align: center;
36
+ display: inline-block;
37
+ background: $transition-campaign-dark-blue;
38
+ color: govuk-colour('white');
39
+ position: relative;
40
+ margin-bottom: govuk-spacing(2);
41
+
42
+ @include govuk-media-query($from: tablet) {
43
+ padding: govuk-spacing(2) govuk-spacing(1);
44
+ }
45
+
46
+ &:after {
47
+ position: absolute;
48
+ left: 0;
49
+ top: 50%;
50
+ margin-top: -1px;
51
+ height: 3px;
52
+ background: govuk-colour('white');
53
+ content: '';
54
+ width: 100%;
55
+ display: block;
56
+ }
57
+
58
+ &:first-child {
59
+ margin-right: 3px;
60
+ }
61
+
62
+ &:nth-child(2) {
63
+ margin-right: govuk-spacing(2);
64
+ }
65
+ }
66
+
67
+ .gem-c-transition-countdown__countdown-text {
68
+ @extend %govuk-heading-m;
69
+
70
+ display: inline-block;
71
+ margin-bottom: 0;
72
+ height: 45px;
73
+ vertical-align: middle;
74
+ color: $transition-campaign-dark-blue;
75
+
76
+ @include govuk-media-query($from: tablet) {
77
+ height: 80px;
78
+ }
79
+
80
+ &:after {
81
+ content: '' / '.'; // Wrap up the countdown-text element in a statement for screen readers
82
+ }
83
+ }
84
+
85
+ .gem-c-transition-countdown__text {
86
+ @extend %govuk-link;
87
+
88
+ margin-top: 0;
89
+ margin-bottom: 0;
90
+ text-decoration: underline;
91
+
92
+ @include govuk-media-query($from: tablet) {
93
+ margin-bottom: govuk-spacing(2);
94
+ }
95
+ }
96
+
97
+ .gem-c-transition-countdown:focus {
98
+ .gem-c-transition-countdown__countdown-number:after {
99
+ background-color: $govuk-focus-colour;
100
+ }
101
+
102
+ .gem-c-transition-countdown__text {
103
+ text-decoration: none;
104
+ }
105
+ }
106
+
107
+ @include govuk-compatibility(govuk_template) {
108
+ .gem-c-transition-countdown__title {
109
+ margin-bottom: govuk-spacing(3);
110
+ }
111
+
112
+ .gem-c-transition-countdown__countdown-number {
113
+ padding: govuk-spacing(1) 0 0;
114
+
115
+ @include govuk-media-query($from: tablet) {
116
+ padding: govuk-spacing(3) govuk-spacing(1) govuk-spacing(1);
117
+ }
118
+ }
119
+
120
+ .gem-c-transition-countdown__countdown-text {
121
+ @include govuk-media-query($from: tablet) {
122
+ height: 75px;
123
+ }
124
+ }
125
+ }
@@ -22,10 +22,9 @@
22
22
  <div class="component-markdown">
23
23
  <%= raw(@component_doc.html_body) %>
24
24
  </div>
25
-
26
- <p class="govuk-body"><%= link_to "Search for usage of this component on GitHub", @component_doc.github_search_url, class: "govuk-link" %></p>
27
25
  </div>
28
26
  <% end %>
27
+ <p class="govuk-body"><%= link_to "Search for usage of this component on GitHub", @component_doc.github_search_url, class: "govuk-link" %></p>
29
28
  </div>
30
29
  </div>
31
30
 
@@ -5,6 +5,7 @@
5
5
  hide_order_copy_link ||= false
6
6
  attributes = []
7
7
  data_attributes ||= {}
8
+ shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
8
9
 
9
10
  if attachment.content_type_name
10
11
  content = if attachment.content_type_abbr
@@ -50,11 +51,11 @@
50
51
  <% end %>
51
52
 
52
53
  <%= tag.div class: "gem-c-attachment__details" do %>
53
- <%= tag.h2 class: "gem-c-attachment__title" do %>
54
+ <%= content_tag(shared_helper.get_heading_level, class: "gem-c-attachment__title") do %>
54
55
  <%= link_to attachment.title, attachment.url,
55
- class: "govuk-link gem-c-attachment__link",
56
- target: target,
57
- data: data_attributes %>
56
+ class: "govuk-link gem-c-attachment__link",
57
+ target: target,
58
+ data: data_attributes %>
58
59
  <% end %>
59
60
 
60
61
  <% if attachment.reference.present? %>