govuk_publishing_components 54.0.1 → 55.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 (109) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/lib/sticky-element-container.js +117 -0
  3. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +5 -0
  4. data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +6 -12
  5. data/app/assets/stylesheets/govuk_publishing_components/components/_back-to-top-link.scss +15 -0
  6. data/app/assets/stylesheets/govuk_publishing_components/components/_contents-list-with-body.scss +58 -0
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_figure.scss +46 -0
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +1 -21
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_published-dates.scss +57 -0
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +0 -74
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_summary-banner.scss +33 -0
  12. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_sticky-element-container.scss +23 -0
  13. data/app/models/govuk_publishing_components/component_doc.rb +1 -1
  14. data/app/views/govuk_publishing_components/components/_back_to_top_link.html.erb +19 -0
  15. data/app/views/govuk_publishing_components/components/_contents_list_with_body.html.erb +27 -0
  16. data/app/views/govuk_publishing_components/components/_figure.html.erb +28 -0
  17. data/app/views/govuk_publishing_components/components/_layout_header.html.erb +0 -6
  18. data/app/views/govuk_publishing_components/components/_published_dates.html.erb +50 -0
  19. data/app/views/govuk_publishing_components/components/_search.html.erb +1 -4
  20. data/app/views/govuk_publishing_components/components/_summary_banner.html.erb +27 -0
  21. data/app/views/govuk_publishing_components/components/docs/back_to_top_link.yml +19 -0
  22. data/app/views/govuk_publishing_components/components/docs/contents_list_with_body.yml +90 -0
  23. data/app/views/govuk_publishing_components/components/docs/figure.yml +43 -0
  24. data/app/views/govuk_publishing_components/components/docs/layout_header.yml +0 -3
  25. data/app/views/govuk_publishing_components/components/docs/published_dates.yml +43 -0
  26. data/app/views/govuk_publishing_components/components/docs/search.yml +0 -9
  27. data/app/views/govuk_publishing_components/components/docs/summary_banner.yml +28 -0
  28. data/config/locales/ar.yml +11 -3
  29. data/config/locales/az.yml +11 -3
  30. data/config/locales/be.yml +11 -3
  31. data/config/locales/bg.yml +11 -3
  32. data/config/locales/bn.yml +11 -3
  33. data/config/locales/cs.yml +11 -3
  34. data/config/locales/cy.yml +11 -3
  35. data/config/locales/da.yml +11 -3
  36. data/config/locales/de.yml +11 -3
  37. data/config/locales/dr.yml +11 -3
  38. data/config/locales/el.yml +11 -3
  39. data/config/locales/en.yml +11 -3
  40. data/config/locales/es-419.yml +11 -3
  41. data/config/locales/es.yml +11 -3
  42. data/config/locales/et.yml +11 -3
  43. data/config/locales/fa.yml +11 -3
  44. data/config/locales/fi.yml +11 -3
  45. data/config/locales/fr.yml +11 -3
  46. data/config/locales/gd.yml +11 -3
  47. data/config/locales/gu.yml +11 -3
  48. data/config/locales/he.yml +11 -3
  49. data/config/locales/hi.yml +11 -3
  50. data/config/locales/hr.yml +11 -3
  51. data/config/locales/hu.yml +11 -3
  52. data/config/locales/hy.yml +11 -3
  53. data/config/locales/id.yml +11 -3
  54. data/config/locales/is.yml +11 -3
  55. data/config/locales/it.yml +11 -3
  56. data/config/locales/ja.yml +11 -3
  57. data/config/locales/ka.yml +11 -3
  58. data/config/locales/kk.yml +11 -3
  59. data/config/locales/ko.yml +11 -3
  60. data/config/locales/lt.yml +11 -3
  61. data/config/locales/lv.yml +11 -3
  62. data/config/locales/ms.yml +11 -3
  63. data/config/locales/mt.yml +11 -3
  64. data/config/locales/ne.yml +224 -0
  65. data/config/locales/nl.yml +11 -3
  66. data/config/locales/no.yml +11 -3
  67. data/config/locales/pa-pk.yml +11 -3
  68. data/config/locales/pa.yml +11 -3
  69. data/config/locales/pl.yml +11 -3
  70. data/config/locales/ps.yml +11 -3
  71. data/config/locales/pt.yml +11 -3
  72. data/config/locales/ro.yml +11 -3
  73. data/config/locales/ru.yml +11 -3
  74. data/config/locales/si.yml +11 -3
  75. data/config/locales/sk.yml +11 -3
  76. data/config/locales/sl.yml +11 -3
  77. data/config/locales/so.yml +11 -3
  78. data/config/locales/sq.yml +11 -3
  79. data/config/locales/sr.yml +11 -3
  80. data/config/locales/sv.yml +11 -3
  81. data/config/locales/sw.yml +11 -3
  82. data/config/locales/ta.yml +11 -3
  83. data/config/locales/th.yml +11 -3
  84. data/config/locales/tk.yml +11 -3
  85. data/config/locales/tr.yml +11 -3
  86. data/config/locales/uk.yml +11 -3
  87. data/config/locales/ur.yml +11 -3
  88. data/config/locales/uz.yml +11 -3
  89. data/config/locales/vi.yml +11 -3
  90. data/config/locales/zh-hk.yml +11 -3
  91. data/config/locales/zh-tw.yml +11 -3
  92. data/config/locales/zh.yml +11 -3
  93. data/lib/govuk_publishing_components/version.rb +1 -1
  94. data/node_modules/axe-core/README.md +2 -2
  95. data/node_modules/axe-core/axe.js +63 -46
  96. data/node_modules/axe-core/axe.min.js +3 -3
  97. data/node_modules/axe-core/locales/_template.json +1 -1
  98. data/node_modules/axe-core/locales/de.json +19 -19
  99. data/node_modules/axe-core/locales/ko.json +4 -4
  100. data/node_modules/axe-core/package.json +4 -3
  101. data/node_modules/axe-core/sri-history.json +4 -0
  102. metadata +20 -9
  103. data/app/assets/images/govuk_publishing_components/action-link-arrow--dark.png +0 -0
  104. data/app/assets/images/govuk_publishing_components/action-link-arrow--light.png +0 -0
  105. data/app/assets/images/govuk_publishing_components/action-link-arrow--simple-light.png +0 -0
  106. data/app/assets/images/govuk_publishing_components/action-link-arrow--simple.png +0 -0
  107. data/app/assets/images/govuk_publishing_components/action-link-arrow.png +0 -0
  108. data/app/assets/images/govuk_publishing_components/search-button.png +0 -0
  109. data/app/views/govuk_publishing_components/components/layout_header/_search.html.erb +0 -29
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 86dda672f3ba9aab6652fe7a61262828fcbf325846d677dac46bf3acbee0288d
4
- data.tar.gz: c6fdf3be956c6c65886324672be78cd312f3a2b89f8cc3707410dfa1404e7c8d
3
+ metadata.gz: 532966284434b5003c9404473e6c44aeaa7222f0a5d79a5b463ea20ea7afb420
4
+ data.tar.gz: 4db9c53579d833f627b2e32545a14fbd65defc5df96ac6f3af9c9111cd7e46dc
5
5
  SHA512:
6
- metadata.gz: 4e72340ed40f1523cda2b245a131fb54c042af7d1f2968a5202e8416aef9cc7fa936582df26d4fbb6fa9f9bb422c46cf215cbc9078627a6f3b199f5b6d12d7e7
7
- data.tar.gz: ecbe763dc4259ff481dccfedba4a08827b131f070cacddeab8bd429d3d5af40348906645c23f1a0ff7c6bb51d62f1e5dfeac67ea149375a7f3ee797382d0f171
6
+ metadata.gz: bbd29a8b7db26faa0b0cb0e379bedf18b05133b8d4ea7c8ca16ccd9792cc46fee730d4986f2f69b261ac2a8f10d553d8990a3853e54e6251edfe68bbb04df1a6
7
+ data.tar.gz: 6b02333dca16d573b0d1b373e8d0febe2f17bcf2a6c712fed6ae072c2b296675a499fd98709cc32532dd6590b25724e510175c723cea839605f9ecd5e1374eac
@@ -0,0 +1,117 @@
1
+ /*
2
+ This module will cause a child in the target element to:
3
+ - hide when the top of the target element is visible;
4
+ - stick to the bottom of the window while the parent element is in view;
5
+ - stick to the bottom of the target when the user scrolls past the bottom.
6
+
7
+ Use 'data-module="sticky-element-container"' to instantiate, and add
8
+ `[data-sticky-element]` to the child you want to position.
9
+ */
10
+
11
+ window.GOVUK = window.GOVUK || {}
12
+ window.GOVUK.Modules = window.GOVUK.Modules || {};
13
+
14
+ (function (Modules) {
15
+ function StickyElementContainer (element) {
16
+ this.wrapper = element
17
+ this.stickyElement = this.wrapper.querySelector('[data-sticky-element]')
18
+ this.hasResized = true
19
+ this.hasScrolled = true
20
+ this.interval = 50
21
+ this.windowVerticalPosition = 1
22
+ this.startPosition = 0
23
+ this.stopPosition = 0
24
+ }
25
+
26
+ StickyElementContainer.prototype.init = function () {
27
+ if (!this.stickyElement) return
28
+
29
+ window.onresize = this.onResize.bind(this)
30
+ window.onscroll = this.onScroll.bind(this)
31
+ setInterval(this.checkResize.bind(this), this.interval)
32
+ setInterval(this.checkScroll.bind(this), this.interval)
33
+ this.checkResize()
34
+ this.checkScroll()
35
+ this.stickyElement.classList.add('sticky-element--enabled')
36
+ }
37
+
38
+ StickyElementContainer.prototype.getWindowDimensions = function () {
39
+ return {
40
+ height: window.innerHeight,
41
+ width: window.innerWidth
42
+ }
43
+ }
44
+
45
+ StickyElementContainer.prototype.getWindowPositions = function () {
46
+ return {
47
+ scrollTop: window.scrollY
48
+ }
49
+ }
50
+
51
+ StickyElementContainer.prototype.onResize = function () {
52
+ this.hasResized = true
53
+ }
54
+
55
+ StickyElementContainer.prototype.onScroll = function () {
56
+ this.hasScrolled = true
57
+ }
58
+
59
+ StickyElementContainer.prototype.checkResize = function () {
60
+ if (this.hasResized) {
61
+ this.hasResized = false
62
+ this.hasScrolled = true
63
+
64
+ var windowDimensions = this.getWindowDimensions()
65
+ var elementHeight = this.wrapper.offsetHeight || parseFloat(this.wrapper.style.height.replace('px', ''))
66
+ this.startPosition = this.wrapper.offsetTop
67
+ this.stopPosition = this.wrapper.offsetTop + elementHeight - windowDimensions.height
68
+ }
69
+ }
70
+
71
+ StickyElementContainer.prototype.checkScroll = function () {
72
+ if (this.hasScrolled) {
73
+ this.hasScrolled = false
74
+
75
+ this.windowVerticalPosition = this.getWindowPositions().scrollTop
76
+
77
+ this.updateVisibility()
78
+ this.updatePosition()
79
+ }
80
+ }
81
+
82
+ StickyElementContainer.prototype.updateVisibility = function () {
83
+ var isPastStart = this.startPosition < this.windowVerticalPosition
84
+ if (isPastStart) {
85
+ this.show()
86
+ } else {
87
+ this.hide()
88
+ }
89
+ }
90
+
91
+ StickyElementContainer.prototype.updatePosition = function () {
92
+ var isPastEnd = this.stopPosition < this.windowVerticalPosition
93
+ if (isPastEnd) {
94
+ this.stickToParent()
95
+ } else {
96
+ this.stickToWindow()
97
+ }
98
+ }
99
+
100
+ StickyElementContainer.prototype.stickToWindow = function () {
101
+ this.stickyElement.classList.add('sticky-element--stuck-to-window')
102
+ }
103
+
104
+ StickyElementContainer.prototype.stickToParent = function () {
105
+ this.stickyElement.classList.remove('sticky-element--stuck-to-window')
106
+ }
107
+
108
+ StickyElementContainer.prototype.show = function () {
109
+ this.stickyElement.classList.remove('sticky-element--hidden')
110
+ }
111
+
112
+ StickyElementContainer.prototype.hide = function () {
113
+ this.stickyElement.classList.add('sticky-element--hidden')
114
+ }
115
+
116
+ Modules.StickyElementContainer = StickyElementContainer
117
+ })(window.GOVUK.Modules)
@@ -14,6 +14,7 @@
14
14
  @import "components/attachment";
15
15
  @import "components/attachment-link";
16
16
  @import "components/back-link";
17
+ @import "components/back-to-top-link";
17
18
  @import "components/big-number";
18
19
  @import "components/breadcrumbs";
19
20
  @import "components/button";
@@ -21,6 +22,7 @@
21
22
  @import "components/character-count";
22
23
  @import "components/checkboxes";
23
24
  @import "components/contents-list";
25
+ @import "components/contents-list-with-body";
24
26
  @import "components/contextual-guidance";
25
27
  @import "components/contextual-sidebar";
26
28
  @import "components/cookie-banner";
@@ -37,6 +39,7 @@
37
39
  @import "components/feedback";
38
40
  @import "components/fieldset";
39
41
  @import "components/file-upload";
42
+ @import "components/figure";
40
43
  @import "components/glance-metric";
41
44
  @import "components/global-banner";
42
45
  @import "components/govspeak-html-publication";
@@ -65,6 +68,7 @@
65
68
  @import "components/phase-banner";
66
69
  @import "components/previous-and-next-navigation";
67
70
  @import "components/print-link";
71
+ @import "components/published-dates";
68
72
  @import "components/radio";
69
73
  @import "components/related-navigation";
70
74
  @import "components/reorderable-list";
@@ -80,6 +84,7 @@
80
84
  @import "components/step-by-step-nav";
81
85
  @import "components/subscription-links";
82
86
  @import "components/success-alert";
87
+ @import "components/summary-banner";
83
88
  @import "components/summary-card";
84
89
  @import "components/summary-list";
85
90
  @import "components/tabs";
@@ -8,8 +8,7 @@
8
8
  display: table-cell;
9
9
  width: 60px;
10
10
  height: 45px;
11
- background: url("govuk_publishing_components/action-link-arrow.png");
12
- background: url("govuk_publishing_components/action-link-arrow.svg"), linear-gradient(transparent, transparent);
11
+ background: url("govuk_publishing_components/action-link-arrow.svg");
13
12
  background-repeat: no-repeat;
14
13
  background-position: 0 50%;
15
14
  background-size: 45px auto;
@@ -97,8 +96,7 @@
97
96
  &::before {
98
97
  width: 30px;
99
98
  height: 30px;
100
- background: url("govuk_publishing_components/action-link-arrow--simple.png");
101
- background: url("govuk_publishing_components/action-link-arrow--simple.svg"), linear-gradient(transparent, transparent);
99
+ background: url("govuk_publishing_components/action-link-arrow--simple.svg");
102
100
  background-repeat: no-repeat;
103
101
  background-size: 25px auto;
104
102
  background-position: 0 2px;
@@ -109,8 +107,7 @@
109
107
  &::before {
110
108
  width: 30px;
111
109
  height: 30px;
112
- background: url("govuk_publishing_components/action-link-arrow--simple-light.png");
113
- background: url("govuk_publishing_components/action-link-arrow--simple-light.svg"), linear-gradient(transparent, transparent);
110
+ background: url("govuk_publishing_components/action-link-arrow--simple-light.svg");
114
111
  background-repeat: no-repeat;
115
112
  background-size: 25px auto;
116
113
  background-position: 0 2px;
@@ -119,8 +116,7 @@
119
116
 
120
117
  .gem-c-action-link--dark-large-icon {
121
118
  &::before {
122
- background: url("govuk_publishing_components/action-link-arrow--dark.png");
123
- background: url("govuk_publishing_components/action-link-arrow--dark.svg"), linear-gradient(transparent, transparent);
119
+ background: url("govuk_publishing_components/action-link-arrow--dark.svg");
124
120
  height: 34px;
125
121
  width: 40px;
126
122
  background-repeat: no-repeat;
@@ -137,8 +133,7 @@
137
133
  &::before {
138
134
  width: 36px;
139
135
  height: 28px;
140
- background: url("govuk_publishing_components/action-link-arrow--light.png");
141
- background: url("govuk_publishing_components/action-link-arrow--light.svg"), linear-gradient(transparent, transparent);
136
+ background: url("govuk_publishing_components/action-link-arrow--light.svg");
142
137
  background-repeat: no-repeat;
143
138
  background-size: 28px auto;
144
139
  background-position: 0 0;
@@ -161,8 +156,7 @@
161
156
  &::before {
162
157
  height: 30px;
163
158
  width: 35px;
164
- background: url("govuk_publishing_components/action-link-arrow--dark.png");
165
- background: url("govuk_publishing_components/action-link-arrow--dark.svg"), linear-gradient(transparent, transparent);
159
+ background: url("govuk_publishing_components/action-link-arrow--dark.svg");
166
160
  background-repeat: no-repeat;
167
161
  background-size: 25px auto;
168
162
  background-position: 0 2px;
@@ -0,0 +1,15 @@
1
+ @import "govuk_publishing_components/individual_component_support";
2
+
3
+ .gem-c-back-to-top-link {
4
+ display: inline-block;
5
+ margin-bottom: govuk-spacing(2);
6
+ margin-left: govuk-spacing(3);
7
+ margin-right: govuk-spacing(3);
8
+ }
9
+
10
+ .gem-c-back-to-top-link__icon {
11
+ float: left;
12
+ margin-right: .3em;
13
+ width: .8em;
14
+ height: .968em;
15
+ }
@@ -0,0 +1,58 @@
1
+ @import "govuk_publishing_components/individual_component_support";
2
+ @import "helpers/sticky-element-container";
3
+
4
+ .gem-c-contents-list-with-body__link-container {
5
+ margin: 0 auto;
6
+ padding: 0;
7
+
8
+ @include govuk-media-query($from: tablet) {
9
+ max-width: 1024px;
10
+ }
11
+
12
+ .gem-c-back-to-top-link {
13
+ margin-left: 0;
14
+ margin-right: 0;
15
+ }
16
+ }
17
+
18
+ .gem-c-contents-list-with-body__list-container {
19
+ margin-bottom: govuk-spacing(3);
20
+
21
+ @include govuk-media-query($from: tablet) {
22
+ margin-bottom: govuk-spacing(8);
23
+ }
24
+ }
25
+
26
+ .gem-c-contents-list-with-body__link-wrapper {
27
+ padding-bottom: govuk-spacing(2);
28
+
29
+ .gem-c-back-to-top-link {
30
+ padding-bottom: govuk-spacing(2);
31
+ }
32
+ }
33
+
34
+ .gem-c-contents-list-with-body__link-wrapper.sticky-element--stuck-to-window {
35
+ background-color: govuk-colour("light-grey");
36
+ bottom: -1px; // 'Fix' for anomalous 1px margin which sporadically appears below this element.
37
+ left: 0;
38
+ margin: 0;
39
+ padding: 0;
40
+ padding-left: 0;
41
+ position: fixed;
42
+ width: 100%;
43
+ z-index: 10;
44
+
45
+ @include govuk-media-query($from: tablet) {
46
+ padding-left: govuk-spacing(2);
47
+ }
48
+
49
+ .gem-c-back-to-top-link {
50
+ margin-bottom: 0;
51
+ padding: govuk-spacing(3);
52
+ width: 66%;
53
+
54
+ @include govuk-media-query($from: tablet) {
55
+ padding: govuk-spacing(4);
56
+ }
57
+ }
58
+ }
@@ -0,0 +1,46 @@
1
+ @import "govuk_publishing_components/individual_component_support";
2
+
3
+ .gem-c-figure {
4
+ border-top: 1px solid $govuk-border-colour;
5
+ padding-top: govuk-spacing(3);
6
+ margin: 0;
7
+ margin-bottom: govuk-spacing(8);
8
+ @include govuk-clearfix;
9
+
10
+ @include govuk-media-query($until: tablet) {
11
+ margin-bottom: govuk-spacing(6);
12
+ }
13
+ }
14
+
15
+ .gem-c-figure__image {
16
+ display: block;
17
+ width: 100%;
18
+
19
+ @include govuk-media-query($from: tablet) {
20
+ float: inline-start;
21
+ width: 50%;
22
+ }
23
+ }
24
+
25
+ .gem-c-figure__figcaption {
26
+ @include govuk-font(16);
27
+
28
+ @include govuk-media-query($from: tablet) {
29
+ display: block;
30
+ vertical-align: top;
31
+ box-sizing: border-box;
32
+ float: inline-end;
33
+ padding-inline-start: govuk-spacing(3);
34
+ width: 50%;
35
+ }
36
+
37
+ @include govuk-media-query($until: tablet) {
38
+ margin-top: govuk-spacing(2);
39
+ }
40
+ }
41
+
42
+ .gem-c-figure__figcaption-text {
43
+ margin: 0;
44
+ margin-bottom: govuk-spacing(2);
45
+ @include govuk-font(16);
46
+ }
@@ -47,11 +47,6 @@
47
47
  text-align: left;
48
48
  }
49
49
 
50
- .gem-c-layout-header__search {
51
- margin-bottom: govuk-spacing(2);
52
- padding-bottom: govuk-spacing(5);
53
- }
54
-
55
50
  .gem-c-header__content {
56
51
  position: relative;
57
52
  width: 100%;
@@ -59,10 +54,6 @@
59
54
  }
60
55
 
61
56
  @include govuk-media-query($from: desktop) {
62
- .gem-c-layout-header__search {
63
- padding-bottom: govuk-spacing(1);
64
- }
65
-
66
57
  .govuk-header__navigation-item {
67
58
  padding: 0 0 govuk-spacing(1) 0;
68
59
  }
@@ -79,8 +70,7 @@
79
70
  }
80
71
  }
81
72
 
82
- .gem-c-layout-header__logo,
83
- .gem-c-layout-header__search {
73
+ .gem-c-layout-header__logo {
84
74
  @include govuk-media-query($until: "tablet") {
85
75
  margin-bottom: govuk-spacing(3);
86
76
  }
@@ -147,16 +137,6 @@
147
137
  }
148
138
  }
149
139
 
150
- .gem-c-layout-header__search-form {
151
- &.js-visible {
152
- display: block;
153
- }
154
-
155
- @include govuk-media-query($from: tablet) {
156
- display: block;
157
- }
158
- }
159
-
160
140
  .govuk-header__menu-button.gem-c-header__menu-button {
161
141
  top: govuk-spacing(4);
162
142
  right: 0;
@@ -0,0 +1,57 @@
1
+ @import "govuk_publishing_components/individual_component_support";
2
+
3
+ .gem-c-published-dates {
4
+ direction: ltr;
5
+ line-height: 1.45em;
6
+ color: govuk-colour("black");
7
+
8
+ .direction-rtl & {
9
+ direction: rtl;
10
+ }
11
+ }
12
+
13
+ .gem-c-published-dates__toggle {
14
+ display: none;
15
+
16
+ .govuk-frontend-supported & {
17
+ display: inline-block;
18
+ }
19
+ }
20
+
21
+ .gem-c-published-dates__change-history {
22
+ margin: govuk-spacing(4) 0;
23
+ }
24
+
25
+ .gem-c-published-dates__list {
26
+ padding: 0;
27
+ }
28
+
29
+ .gem-c-published-dates__change-item {
30
+ list-style-type: none;
31
+ margin-bottom: govuk-spacing(2);
32
+ }
33
+
34
+ .gem-c-published-dates__change-date {
35
+ display: block;
36
+ @include govuk-font(16, $weight: bold);
37
+ }
38
+
39
+ .gem-c-published-dates__change-note {
40
+ white-space: pre-line;
41
+ }
42
+
43
+ .gem-c-published-dates--history {
44
+ padding-top: govuk-spacing(2);
45
+ border-top: 1px solid $govuk-border-colour;
46
+ }
47
+
48
+ .govuk-frontend-supported .gem-c-published-dates .js-hidden {
49
+ display: none;
50
+ visibility: hidden;
51
+ }
52
+
53
+ @include govuk-media-query($media-type: print) {
54
+ .gem-c-published-dates {
55
+ margin-top: 10mm;
56
+ }
57
+ }
@@ -232,37 +232,10 @@ $large-input-size: 50px;
232
232
  color: govuk-colour("white");
233
233
  }
234
234
 
235
- .gem-c-search--no-border {
236
- .gem-c-search__label {
237
- color: govuk-colour("white");
238
- }
239
-
240
- .gem-c-search__input[type="search"] {
241
- border: 0;
242
-
243
- &:focus {
244
- @include gem-c-search-input-focus;
245
- box-shadow: inset 0 0 0 4px;
246
- }
247
- }
248
-
249
- .govuk-frontend-supported & {
250
- .gem-c-search__label {
251
- color: $govuk-secondary-text-colour;
252
- }
253
- }
254
- }
255
-
256
235
  .gem-c-search--large {
257
236
  @include large-mode;
258
237
  }
259
238
 
260
- .gem-c-search--large-on-mobile {
261
- @include govuk-media-query($until: "tablet") {
262
- @include large-mode;
263
- }
264
- }
265
-
266
239
  .gem-c-search--separate-label {
267
240
  .gem-c-search__label {
268
241
  position: relative;
@@ -271,50 +244,3 @@ $large-input-size: 50px;
271
244
  padding-left: 0;
272
245
  }
273
246
  }
274
-
275
- .search-toggle {
276
- display: none;
277
- background-color: govuk-colour("blue");
278
- background-image: url("govuk_publishing_components/search-button.png");
279
- background-position: 0 50%;
280
- background-repeat: no-repeat;
281
- float: right;
282
- height: 30px;
283
- margin: -46px 0;
284
- overflow: hidden;
285
- padding: 0;
286
- text-indent: -5000px;
287
- width: 36px;
288
- border: 0;
289
-
290
- &:focus {
291
- border-width: 0;
292
- box-shadow: inset 0 0 0 4px $govuk-input-border-colour;
293
- outline: $govuk-focus-width solid $govuk-focus-colour;
294
- outline-offset: 0;
295
- }
296
-
297
- &:focus,
298
- &:hover {
299
- background-color: lighten(govuk-colour("blue"), 5%);
300
- }
301
-
302
- &.js-hidden {
303
- display: none;
304
- }
305
-
306
- @include govuk-device-pixel-ratio {
307
- background-size: 52.5px 35px;
308
- background-position: 100% 50%;
309
- }
310
-
311
- @include govuk-media-query($from: tablet) {
312
- display: none;
313
- }
314
-
315
- @include govuk-media-query($until: tablet) {
316
- .govuk-frontend-supported & {
317
- display: block;
318
- }
319
- }
320
- }
@@ -0,0 +1,33 @@
1
+ @import "govuk_publishing_components/individual_component_support";
2
+
3
+ .gem-c-summary-banner {
4
+ direction: ltr;
5
+ background: $govuk-brand-colour;
6
+ color: govuk-colour("white");
7
+ padding: govuk-spacing(6) govuk-spacing(3) govuk-spacing(3);
8
+ clear: both;
9
+ @include govuk-font(19);
10
+
11
+ @include govuk-media-query($from: tablet) {
12
+ padding: govuk-spacing(7) govuk-spacing(6) govuk-spacing(5);
13
+ }
14
+
15
+ a {
16
+ @include govuk-link-common;
17
+ @include govuk-link-style-inverse;
18
+ }
19
+ }
20
+
21
+ .gem-c-summary-banner__title {
22
+ margin-bottom: govuk-spacing(6);
23
+ color: govuk-colour("white");
24
+ @include govuk-font(27, $weight: bold);
25
+ }
26
+
27
+ .gem-c-summary-banner__text {
28
+ // Ensure the text has a line-length of around 60 characters
29
+ max-width: 30em;
30
+ padding: 0;
31
+ margin-bottom: govuk-spacing(4);
32
+ @include govuk-font(19);
33
+ }
@@ -0,0 +1,23 @@
1
+ .govuk-frontend-supported .sticky-element {
2
+ position: absolute;
3
+ bottom: 0;
4
+
5
+ &--stuck-to-window {
6
+ bottom: 0;
7
+ position: fixed;
8
+ }
9
+
10
+ &--enabled {
11
+ transition: opacity, .3s, ease;
12
+ opacity: 1;
13
+
14
+ @include govuk-media-query($until: tablet) {
15
+ position: static;
16
+ }
17
+ }
18
+
19
+ &--hidden {
20
+ opacity: 0;
21
+ pointer-events: none;
22
+ }
23
+ }
@@ -51,7 +51,7 @@ module GovukPublishingComponents
51
51
  end
52
52
 
53
53
  def display_preview?
54
- component[:display_preview].nil? ? true : component[:display_preview]
54
+ component[:display_preview].nil? || component[:display_preview]
55
55
  end
56
56
 
57
57
  def uses_component_wrapper_helper?
@@ -0,0 +1,19 @@
1
+ <%
2
+ add_gem_component_stylesheet("back-to-top-link")
3
+
4
+ text ||= t("components.back_to_top_link.contents", default: "Contents")
5
+
6
+ if href.blank? || text.blank?
7
+ raise ArgumentError, "The back_to_top_link component requires text and a href"
8
+ end
9
+
10
+ component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
11
+ component_helper.add_class("govuk-link gem-c-back-to-top-link govuk-!-display-none-print")
12
+ %>
13
+
14
+ <%= link_to href, **component_helper.all_attributes do %>
15
+ <svg class="gem-c-back-to-top-link__icon" xmlns="http://www.w3.org/2000/svg" width="13" height="17" viewBox="0 0 13 17" aria-hidden="true" focusable="false">
16
+ <path fill="currentColor" d="M6.5 0L0 6.5 1.4 8l4-4v12.7h2V4l4.3 4L13 6.4z"/>
17
+ </svg>
18
+ <%= text %>
19
+ <% end %>
@@ -0,0 +1,27 @@
1
+ <% add_gem_component_stylesheet("contents-list-with-body") %>
2
+ <% block = yield %>
3
+ <% unless block.empty? %>
4
+ <%
5
+ contents ||= []
6
+ id ||= "contents"
7
+ component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
8
+ component_helper.set_id(id)
9
+ component_helper.add_class("gem-c-contents-list-with-body")
10
+ component_helper.add_data_attribute({ module: "sticky-element-container" }) if contents.any?
11
+ %>
12
+ <%= tag.div(**component_helper.all_attributes) do %>
13
+ <% if contents.any? %>
14
+ <div class="gem-c-contents-list-with-body__list-container">
15
+ <%= render 'govuk_publishing_components/components/contents_list', contents: contents %>
16
+ </div>
17
+ <% end %>
18
+ <%= block %>
19
+ <% if contents.any? %>
20
+ <div data-sticky-element class="gem-c-contents-list-with-body__link-wrapper">
21
+ <div class="gem-c-contents-list-with-body__link-container">
22
+ <%= render 'govuk_publishing_components/components/back_to_top_link', href: "#contents" %>
23
+ </div>
24
+ </div>
25
+ <% end %>
26
+ <% end %>
27
+ <% end %>
@@ -0,0 +1,28 @@
1
+ <%
2
+ add_gem_component_stylesheet("figure")
3
+ alt ||= ""
4
+ caption ||= ""
5
+ credit ||= ""
6
+ local_assigns[:lang] ||= "en"
7
+ component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
8
+ component_helper.add_class("gem-c-figure")
9
+ %>
10
+ <%= tag.figure(**component_helper.all_attributes) do %>
11
+ <% if src.present? %>
12
+ <img class="gem-c-figure__image" src="<%= src %>" alt="<%= alt %>">
13
+ <% 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 %>