govuk_publishing_components 24.20.0 → 25.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics.js +2 -0
  3. data/app/assets/javascripts/govuk_publishing_components/analytics/scroll-tracker.js +59 -91
  4. data/app/assets/javascripts/govuk_publishing_components/{lib → analytics}/track-click.js +0 -0
  5. data/app/assets/javascripts/govuk_publishing_components/{lib/select.js → analytics/track-select-change.js} +0 -0
  6. data/app/assets/javascripts/govuk_publishing_components/components/intervention.js +16 -0
  7. data/app/assets/javascripts/govuk_publishing_components/lib/header-navigation.js +34 -5
  8. data/app/assets/javascripts/govuk_publishing_components/modules.js +11 -17
  9. data/app/assets/stylesheets/govuk_publishing_components/component_support.scss +0 -1
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +7 -9
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_intervention.scss +12 -10
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_notice.scss +2 -17
  13. data/app/views/govuk_publishing_components/components/_document_list.html.erb +3 -3
  14. data/app/views/govuk_publishing_components/components/_fieldset.html.erb +1 -1
  15. data/app/views/govuk_publishing_components/components/_input.html.erb +1 -1
  16. data/app/views/govuk_publishing_components/components/_intervention.html.erb +26 -8
  17. data/app/views/govuk_publishing_components/components/_label.html.erb +6 -4
  18. data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +2 -1
  19. data/app/views/govuk_publishing_components/components/_notice.html.erb +19 -13
  20. data/app/views/govuk_publishing_components/components/_radio.html.erb +5 -6
  21. data/app/views/govuk_publishing_components/components/_search.html.erb +11 -3
  22. data/app/views/govuk_publishing_components/components/_select.html.erb +3 -1
  23. data/app/views/govuk_publishing_components/components/_summary_list.html.erb +1 -1
  24. data/app/views/govuk_publishing_components/components/_title.html.erb +14 -7
  25. data/app/views/govuk_publishing_components/components/docs/layout_for_public.yml +4 -0
  26. data/app/views/govuk_publishing_components/components/docs/notice.yml +15 -0
  27. data/app/views/govuk_publishing_components/components/docs/radio.yml +4 -15
  28. data/app/views/govuk_publishing_components/components/docs/search.yml +5 -0
  29. data/app/views/govuk_publishing_components/components/docs/title.yml +7 -12
  30. data/config/initializers/assets.rb +0 -1
  31. data/config/locales/en.yml +4 -1
  32. data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_priority.rb +32 -11
  33. data/lib/govuk_publishing_components/presenters/meta_tags.rb +11 -4
  34. data/lib/govuk_publishing_components/presenters/shared_helper.rb +5 -1
  35. data/lib/govuk_publishing_components/version.rb +1 -1
  36. metadata +5 -16
  37. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_px-to-em.scss +0 -12
  38. data/app/assets/stylesheets/govuk_publishing_components/components/print/_attachment.scss +0 -2
  39. data/app/assets/stylesheets/govuk_publishing_components/components/print/_back-link.scss +0 -2
  40. data/app/assets/stylesheets/govuk_publishing_components/components/print/_feedback.scss +0 -2
  41. data/app/assets/stylesheets/govuk_publishing_components/components/print/_layout-footer.scss +0 -2
  42. data/app/assets/stylesheets/govuk_publishing_components/components/print/_layout-header.scss +0 -2
  43. data/app/assets/stylesheets/govuk_publishing_components/components/print/_metadata.scss +0 -2
  44. data/app/assets/stylesheets/govuk_publishing_components/components/print/_search.scss +0 -2
  45. data/app/assets/stylesheets/govuk_publishing_components/components/print/_share-links.scss +0 -2
  46. data/app/assets/stylesheets/govuk_publishing_components/components/print/_skip-link.scss +0 -2
  47. data/app/assets/stylesheets/govuk_publishing_components/components/print/_subscription-links.scss +0 -2
  48. data/app/assets/stylesheets/govuk_publishing_components/components/print/_translation-nav.scss +0 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 50a7296ca62da87133989dc55c692649132efeee4d4a2eedbb253291ea489459
4
- data.tar.gz: 026f82dfb2d8b86abd040d5a69ccae280190e345247404e7621aeea89f30eca2
3
+ metadata.gz: 83542c59d80d443eb01ea0451640ef185c26104d231d603a9842fb05b55bb26c
4
+ data.tar.gz: e9cd38b7ca3a3430c63c212a12b1a9444579175d6c9ef55693d5b0c373c8108b
5
5
  SHA512:
6
- metadata.gz: 45190fd0137cd36e04523ce5d97783cda446256a4089646b317404a410be28f7e6c96798ec9d5a56fdd130cbfa0f47630ade875dfe8af61a2b9c52f0111f4abb
7
- data.tar.gz: bc733b83f05ba2520729a23ecb56788bc8552ef082babc9b0743317cf0808fefc7baab2199dfa1fb77e168b4c38cf72d8b9068e38e67889682b088b2b707641f
6
+ metadata.gz: fcabb52ef323f944b938498968946e797e6c3b868393768fa42bd5fa350206e381d0d612bf9d158f6d6c00ed226aa7f89a4b737ba7a6acc32a390d4ef967d3a6
7
+ data.tar.gz: 1c79526993a09351120f3459a5096e9e95974fc35557e031607e52babdb9099115b61462adc6e7b712d04300688a19ce35478d217323d60beae29ad839cc38a6
@@ -15,3 +15,5 @@
15
15
  //= require ./analytics/init
16
16
  //= require ./analytics/scroll-tracker
17
17
  //= require ./analytics/explicit-cross-domain-links
18
+ //= require ./analytics/track-click
19
+ //= require ./analytics/track-select-change
@@ -5,21 +5,17 @@
5
5
 
6
6
  window.GOVUK = window.GOVUK || {}
7
7
 
8
+ var percentages = [
9
+ ['Percent', 20],
10
+ ['Percent', 40],
11
+ ['Percent', 60],
12
+ ['Percent', 80],
13
+ ['Percent', 100]
14
+ ]
15
+
8
16
  var CONFIG = {
9
- '/brexit': [
10
- ['Percent', 20],
11
- ['Percent', 40],
12
- ['Percent', 60],
13
- ['Percent', 80],
14
- ['Percent', 100]
15
- ],
16
- '/guidance/coronavirus-covid-19-information-for-the-public': [
17
- ['Percent', 20],
18
- ['Percent', 40],
19
- ['Percent', 60],
20
- ['Percent', 80],
21
- ['Percent', 100]
22
- ],
17
+ '/brexit': percentages,
18
+ '/guidance/coronavirus-covid-19-information-for-the-public': percentages,
23
19
  '/government/publications/the-essential-trustee-what-you-need-to-know-cc3/the-essential-trustee-what-you-need-to-know-what-you-need-to-do': [
24
20
  ['Heading', '1. About this guidance'],
25
21
  ['Heading', '2. Trustees’ duties at a glance'],
@@ -151,89 +147,61 @@
151
147
  '/wood-packaging-import-export': [
152
148
  ['Heading', 'Export solid wood packaging']
153
149
  ],
154
- '/guidance/answers-to-the-most-common-topics-asked-about-by-the-public-for-the-coronavirus-press-conference': [
155
- ['Percent', 20],
156
- ['Percent', 40],
157
- ['Percent', 60],
158
- ['Percent', 80],
159
- ['Percent', 100]
160
- ],
161
- '/coronavirus': [
162
- ['Percent', 20],
163
- ['Percent', 40],
164
- ['Percent', 60],
165
- ['Percent', 80],
166
- ['Percent', 100]
167
- ],
168
- '/coronavirus/education-and-childcare': [
169
- ['Percent', 20],
170
- ['Percent', 40],
171
- ['Percent', 60],
172
- ['Percent', 80],
173
- ['Percent', 100]
174
- ],
175
- '/coronavirus/worker-support': [
176
- ['Percent', 20],
177
- ['Percent', 40],
178
- ['Percent', 60],
179
- ['Percent', 80],
180
- ['Percent', 100]
181
- ],
182
- '/coronavirus/business-support': [
183
- ['Percent', 20],
184
- ['Percent', 40],
185
- ['Percent', 60],
186
- ['Percent', 80],
187
- ['Percent', 100]
188
- ],
189
- '/get-coronavirus-test': [
190
- ['Percent', 20],
191
- ['Percent', 40],
192
- ['Percent', 60],
193
- ['Percent', 80],
194
- ['Percent', 100]
195
- ],
150
+ '/guidance/answers-to-the-most-common-topics-asked-about-by-the-public-for-the-coronavirus-press-conference': percentages,
151
+ '/coronavirus': percentages,
152
+ '/coronavirus/education-and-childcare': percentages,
153
+ '/coronavirus/worker-support': percentages,
154
+ '/coronavirus/business-support': percentages,
155
+ '/get-coronavirus-test': percentages,
196
156
  '/next-steps-for-your-business/results': [
197
157
  ['Heading', 'Things you need to do next'],
198
158
  ['Heading', 'Rules to follow'],
199
159
  ['Heading', 'Good to know'],
200
160
  ['Heading', 'Change your answers']
201
161
  ],
202
- '/guidance/brexit-guidance-for-businesses': [
203
- ['Percent', 20],
204
- ['Percent', 40],
205
- ['Percent', 60],
206
- ['Percent', 80],
207
- ['Percent', 100]
208
- ],
209
- '/guidance/brexit-guidance-for-businesses.cy': [
210
- ['Percent', 20],
211
- ['Percent', 40],
212
- ['Percent', 60],
213
- ['Percent', 80],
214
- ['Percent', 100]
215
- ],
216
- '/guidance/brexit-guidance-for-individuals-and-families': [
217
- ['Percent', 20],
218
- ['Percent', 40],
219
- ['Percent', 60],
220
- ['Percent', 80],
221
- ['Percent', 100]
222
- ],
223
- '/guidance/brexit-guidance-for-individuals-and-families.cy': [
224
- ['Percent', 20],
225
- ['Percent', 40],
226
- ['Percent', 60],
227
- ['Percent', 80],
228
- ['Percent', 100]
229
- ],
230
- '/guidance/import-and-export-goods-using-preference-agreements': [
231
- ['Percent', 20],
232
- ['Percent', 40],
233
- ['Percent', 60],
234
- ['Percent', 80],
235
- ['Percent', 100]
236
- ]
162
+ '/guidance/brexit-guidance-for-businesses': percentages,
163
+ '/guidance/brexit-guidance-for-businesses.cy': percentages,
164
+ '/guidance/brexit-guidance-for-individuals-and-families': percentages,
165
+ '/guidance/brexit-guidance-for-individuals-and-families.cy': percentages,
166
+ '/guidance/import-and-export-goods-using-preference-agreements': percentages,
167
+ '/guidance/red-amber-and-green-list-rules-for-entering-england': [
168
+ ['Heading', 'Stay up-to-date'],
169
+ ['Heading', 'Red list of countries and territories'],
170
+ ['Heading', 'Amber list of countries and territories'],
171
+ ['Heading', 'Amber list rules if you are fully UK vaccinated'],
172
+ ['Heading', 'Amber list rules if you are not fully UK vaccinated'],
173
+ ['Heading', 'Green list countries and territories'],
174
+ ['Heading', 'Green list rules'],
175
+ ['Heading', 'Ireland, the UK, the Channel Islands and the Isle of Man'],
176
+ ['Heading', 'Transit stops in amber or red list countries'],
177
+ ['Heading', 'Job and medical exemptions'],
178
+ ['Heading', 'Travelling abroad from England'],
179
+ ['Heading', 'Demonstrating your COVID-19 vaccination status when travelling abroad'],
180
+ ['Heading', 'Foreign, Commonwealth & Development Office travel advice']
181
+ ],
182
+ '/guidance/travel-abroad-from-england-during-coronavirus-covid-19': [
183
+ ['Heading', 'Before you travel abroad'],
184
+ ['Heading', '1. Check the rules for the country you’re going to'],
185
+ ['Heading', '2. Find out what you need to do when you return'],
186
+ ['Heading', '3. Book any COVID-19 tests or quarantine hotel packages you need for your return'],
187
+ ['Heading', 'Before you return'],
188
+ ['Heading', 'After you return'],
189
+ ['Heading', 'Travelling with children'],
190
+ ['Heading', 'Ireland, the UK, the Channel Islands and the Isle of Man'],
191
+ ['Heading', 'Exemptions for work, medical or compassionate reasons']
192
+ ],
193
+ '/guidance/travel-to-england-from-another-country-during-coronavirus-covid-19': [
194
+ ['Heading', 'Before you travel'],
195
+ ['Heading', '1. Check the rules for the country you’re coming from or have travelled through'],
196
+ ['Heading', '2. Book any COVID-19 tests or quarantine hotel packages you need for your arrival'],
197
+ ['Heading', '3. Get tested and complete documents'],
198
+ ['Heading', 'When you arrive in England'],
199
+ ['Heading', 'Leaving England'],
200
+ ['Heading', 'Travelling with children'],
201
+ ['Heading', 'Ireland, the UK, the Channel Islands and the Isle of Man'],
202
+ ['Heading', 'Exemptions for work, medical or compassionate reasons']
203
+ ],
204
+ '/find-travel-test-provider': percentages
237
205
  }
238
206
 
239
207
  function ScrollTracker (sitewideConfig) {
@@ -0,0 +1,16 @@
1
+ window.GOVUK = window.GOVUK || {}
2
+ window.GOVUK.Modules = window.GOVUK.Modules || {};
3
+
4
+ (function (Modules) {
5
+ function Intervention ($module) {
6
+ this.$module = $module
7
+ }
8
+
9
+ Intervention.prototype.init = function () {
10
+ if (window.GOVUK.analytics && window.GOVUK.analytics.trackEvent) {
11
+ window.GOVUK.analytics.trackEvent('interventionBanner', 'interventionShown')
12
+ }
13
+ }
14
+
15
+ Modules.Intervention = Intervention
16
+ })(window.GOVUK.Modules)
@@ -7,12 +7,41 @@
7
7
 
8
8
  if (document.querySelectorAll && document.addEventListener) {
9
9
  var els = document.querySelectorAll('.js-header-toggle')
10
- var i
11
- var _i
12
- for (i = 0, _i = els.length; i < _i; i++) {
13
- els[i].addEventListener('click', function (e) {
10
+ for (var i = 0; i < els.length; i++) {
11
+ // Reassign current index to bypass rules in Chrome and Firefox around indexed property setting
12
+ var thisEl = els[i]
13
+
14
+ // If the element is an a tag, convert it to a button
15
+ // This is to target instances where we want to change behaviour between a js and a no-js view eg: the search button on the mobile menu for some government pages. On no-js it's just a link to /search
16
+ // This swaps a link for no-js to a button, making it interactable. Using a link for interactivity is poor accessibility as it's a misuse of the link tag and can be confusing to assistive tech users
17
+
18
+ if (thisEl.tagName === 'A') {
19
+ var attributes = thisEl.attributes
20
+ var button = document.createElement('button')
21
+
22
+ for (var k = 0; k < attributes.length; k++) {
23
+ var thisAttr = attributes[k].name
24
+
25
+ if (thisAttr === 'href') {
26
+ if (button.getAttribute('data-search-toggle-for')) {
27
+ continue
28
+ } else {
29
+ button.setAttribute('data-search-toggle-for', thisEl.getAttribute('href').substr(1))
30
+ }
31
+ } else if (thisAttr !== 'data-button-text') {
32
+ button.setAttribute(thisAttr, thisEl.getAttribute(thisAttr))
33
+ }
34
+ }
35
+
36
+ button.innerText = thisEl.getAttribute('data-button-text') || thisEl.innerText
37
+
38
+ thisEl.parentNode.replaceChild(button, thisEl)
39
+ thisEl = button
40
+ }
41
+
42
+ thisEl.addEventListener('click', function (e) {
14
43
  e.preventDefault()
15
- var target = this.getAttribute('href') ? document.getElementById(this.getAttribute('href').substr(1)) : document.getElementById(this.getAttribute('data-search-toggle-for'))
44
+ var target = document.getElementById(this.getAttribute('data-search-toggle-for'))
16
45
  var targetClass = target.getAttribute('class') || ''
17
46
  var sourceClass = this.getAttribute('class') || ''
18
47
  var isSearchToggle = sourceClass.match('search-toggle')
@@ -30,27 +30,21 @@
30
30
  var moduleNames = element.data('module').split(' ')
31
31
 
32
32
  for (var j = 0, k = moduleNames.length; j < k; j++) {
33
- var module
34
33
  var moduleName = camelCaseAndCapitalise(moduleNames[j])
35
34
  var started = element.data(moduleNames[j] + '-module-started')
36
35
 
37
- if ( // GOV.UK Publishing & Legacy Modules
38
- typeof GOVUK.Modules[moduleName] === 'function' &&
39
- !GOVUK.Modules[moduleName].prototype.init &&
40
- !started
41
- ) {
42
- module = new GOVUK.Modules[moduleName]()
43
- module.start(element)
44
- element.data(moduleNames[j] + '-module-started', true)
45
- }
36
+ if (typeof GOVUK.Modules[moduleName] === 'function' && !started) {
37
+ // GOV.UK Legacy Modules using jQuery
38
+ if (!GOVUK.Modules[moduleName].prototype.init) {
39
+ new GOVUK.Modules[moduleName]().start(element)
40
+ element.data(moduleNames[j] + '-module-started', true)
41
+ }
46
42
 
47
- if ( // GOV.UK Frontend Modules
48
- typeof GOVUK.Modules[moduleName] === 'function' &&
49
- GOVUK.Modules[moduleName].prototype.init &&
50
- !started
51
- ) {
52
- module = new GOVUK.Modules[moduleName](element[0]).init()
53
- element.data(moduleNames[j] + '-module-started', true)
43
+ // Vanilla JavaScript GOV.UK Modules and GOV.UK Frontend Modules
44
+ if (GOVUK.Modules[moduleName].prototype.init) {
45
+ new GOVUK.Modules[moduleName](element[0]).init()
46
+ element.data(moduleNames[j] + '-module-started', true)
47
+ }
54
48
  }
55
49
  }
56
50
  }
@@ -8,7 +8,6 @@
8
8
 
9
9
  @import "govuk_publishing_components/components/helpers/brand-colours";
10
10
  @import "govuk_publishing_components/components/helpers/link";
11
- @import "govuk_publishing_components/components/helpers/px-to-em";
12
11
  @import "govuk_publishing_components/components/mixins/govuk-template-link-focus-override";
13
12
  @import "govuk_publishing_components/components/mixins/media-down";
14
13
  @import "govuk_publishing_components/components/mixins/margins";
@@ -6,7 +6,6 @@
6
6
  }
7
7
 
8
8
  .gem-c-document-list__item {
9
- overflow: hidden;
10
9
  margin-bottom: govuk-spacing(5);
11
10
  padding-top: govuk-spacing(2);
12
11
  border-top: 1px solid $govuk-border-colour;
@@ -18,11 +17,6 @@
18
17
  display: inline-block;
19
18
  }
20
19
 
21
- .gem-c-document-list__item-link {
22
- @include govuk-link-common;
23
- @include govuk-link-style-default;
24
- }
25
-
26
20
  .gem-c-document-list--no-underline {
27
21
  .gem-c-document-list__item-title {
28
22
  text-decoration: none;
@@ -156,18 +150,22 @@
156
150
  }
157
151
 
158
152
  .gem-c-document-list-child__link {
159
- @include govuk-link-common;
160
- @include govuk-link-style-default;
161
153
  text-decoration: none;
162
154
 
163
155
  &:hover {
164
156
  text-decoration: underline;
157
+ text-underline-offset: .1em;
158
+ @include govuk-link-hover-decoration;
159
+ }
160
+
161
+ &:focus {
162
+ text-decoration: none;
165
163
  }
166
164
  }
167
165
 
168
166
  .gem-c-document-list-child__description {
169
167
  @include govuk-text-colour;
170
- margin-top: 0;
168
+ margin-top: govuk-spacing(1);
171
169
  margin-bottom: govuk-spacing(1);
172
170
 
173
171
  @include govuk-media-query($until: tablet) {
@@ -1,16 +1,18 @@
1
1
  .gem-c-intervention {
2
2
  @include govuk-text-colour;
3
- @include govuk-responsive-padding(4);
4
- @include govuk-responsive-margin(4, "bottom");
3
+ @include govuk-responsive-padding(6, "left");
4
+ @include govuk-responsive-padding(6, "right");
5
+ @include govuk-responsive-padding(4, "top");
6
+ @include govuk-responsive-padding(4, "bottom");
7
+ @include govuk-responsive-margin(6, "bottom");
5
8
  background-color: govuk-colour("light-grey", $legacy: "grey-4");
6
- }
7
9
 
8
- .gem-c-intervention__title {
9
- @include govuk-font(24, $weight: bold);
10
- margin-top: 0;
11
- @include govuk-responsive-margin(4, "bottom");
12
- }
10
+ .gem-c-intervention__title {
11
+ @include govuk-responsive-margin(0);
12
+ @include govuk-responsive-padding(4, "bottom");
13
+ }
13
14
 
14
- .gem-c-intervention__paragraph {
15
- @include govuk-font(19);
15
+ .govuk-body:last-of-type {
16
+ @include govuk-responsive-margin(0, "bottom");
17
+ }
16
18
  }
@@ -1,10 +1,8 @@
1
+ @import "govuk/components/notification-banner/notification-banner";
2
+
1
3
  .gem-c-notice {
2
- @include govuk-text-colour;
3
- @include govuk-responsive-padding(4);
4
4
  @include govuk-responsive-margin(8, "bottom");
5
-
6
5
  clear: both;
7
- border: $govuk-border-width solid govuk-colour("blue");
8
6
 
9
7
  .govuk-govspeak {
10
8
  p:last-child {
@@ -18,22 +16,9 @@
18
16
  }
19
17
 
20
18
  .gem-c-notice__title {
21
- @include govuk-font(24, $weight: bold);
22
- margin-top: 0;
23
- @include govuk-responsive-margin(4, "bottom");
24
-
25
- &:last-child {
26
- margin-bottom: 0;
27
- }
28
-
29
19
  a {
30
20
  @include govuk-link-common;
31
21
  @include govuk-link-style-default;
32
22
  @include govuk-link-print-friendly;
33
23
  }
34
24
  }
35
-
36
- .gem-c-notice__description {
37
- @include govuk-font(19);
38
- margin: 0;
39
- }
@@ -41,7 +41,7 @@
41
41
  item[:link][:text],
42
42
  item[:link][:path],
43
43
  data: item[:link][:data_attributes],
44
- class: "#{item_classes} gem-c-document-list__item-link",
44
+ class: "#{item_classes} govuk-link",
45
45
  lang: item[:link][:locale].presence,
46
46
  rel: rel,
47
47
  )
@@ -65,7 +65,7 @@
65
65
 
66
66
  <% if item[:metadata] %>
67
67
  <ul class="gem-c-document-list__item-metadata">
68
- <% item[:metadata].compact.each do |item_metadata_key, item_metadata_value| %>
68
+ <% item[:metadata].compact.each do |item_metadata_key, item_metadata_value| %>
69
69
  <% if !item_metadata_key.to_s.eql?("locale") %>
70
70
  <% lang = item[:metadata][:locale].present? && item[:metadata][:locale][item_metadata_key].present? ? item[:metadata][:locale][item_metadata_key] : nil %>
71
71
 
@@ -101,7 +101,7 @@
101
101
  part[:link][:text],
102
102
  part[:link][:path],
103
103
  data: part[:link][:data_attributes],
104
- class: "gem-c-document-list-child__heading #{brand_helper.color_class} gem-c-document-list-child__link",
104
+ class: "gem-c-document-list-child__heading #{brand_helper.color_class} govuk-link gem-c-document-list-child__link",
105
105
  )
106
106
  else
107
107
  content_tag(
@@ -5,7 +5,7 @@
5
5
  describedby ||= nil
6
6
  role ||= nil
7
7
  heading_level ||= nil
8
- heading_size = false unless ['s', 'm', 'l', 'xl'].include?(heading_size)
8
+ heading_size = false unless shared_helper.valid_heading_size?(heading_size)
9
9
  error_message ||= nil
10
10
  error_id ||= nil
11
11
  id ||= nil
@@ -23,7 +23,7 @@
23
23
  hint_id = "hint-#{SecureRandom.hex(4)}"
24
24
  error_id = "error-#{SecureRandom.hex(4)}"
25
25
  search_icon ||= nil
26
- heading_size = false unless ['s', 'm', 'l', 'xl'].include?(heading_size)
26
+ heading_size = false unless shared_helper.valid_heading_size?(heading_size)
27
27
  heading_level ||= nil
28
28
  prefix ||= nil
29
29
  suffix ||= nil
@@ -1,15 +1,33 @@
1
- <%= tag.section class: "gem-c-intervention", role: "region" do %>
2
- <h2 class="gem-c-intervention__title">
3
- <a class="govuk-link" href="/next-steps-for-your-business">
4
- <%= t("components.intervention.title") %>
5
- </a>
1
+ <%
2
+ data_attributes ||= {}
3
+ data_attributes[:module] = 'intervention'
4
+ %>
5
+
6
+ <%= tag.section class: "gem-c-intervention", role: "region", data: data_attributes do %>
7
+ <h2 class="gem-c-intervention__title govuk-heading-s">
8
+ <a class="govuk-link" href="/next-steps-for-your-business"
9
+ data-module="gem-track-click"
10
+ data-track-category="interventionBanner"
11
+ data-track-action="interventionClicked"
12
+ data-track-dimension="<%= t("components.intervention.title") %>"
13
+ data-track-dimension-index="29"
14
+ data-track-label="/next-steps-for-your-business">
15
+ <%= t("components.intervention.title") %></a>
6
16
  </h2>
7
17
 
8
- <p class="gem-c-intervention__paragraph">
18
+ <p class="govuk-body">
9
19
  <%= t("components.intervention.description") %>
10
20
  </p>
11
21
 
12
- <p class="gem-c-intervention__paragraph">
13
- <%= t("components.intervention.dismiss_html") %>
22
+ <p class="govuk-body">
23
+ <a class="govuk-link" href="?hide-intervention=true"
24
+ data-module="gem-track-click"
25
+ data-track-category="interventionBanner"
26
+ data-track-action="interventionDismissed"
27
+ data-track-label="?hide-intervention=true"
28
+ data-track-dimension="<%= t("components.intervention.dismiss_link_text") %>"
29
+ data-track-dimension-index="29">
30
+ <%= t("components.intervention.dismiss_link_text") %></a>
31
+ <%= t("components.intervention.dismiss_post_link") %>
14
32
  </p>
15
33
  <% end %>
@@ -1,16 +1,18 @@
1
1
  <%
2
- hint_text ||= ''
2
+ shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
3
+
4
+ hint_text ||= ""
3
5
  is_radio_label ||= false
4
6
  bold ||= false
5
- heading_size = false unless ['s', 'm', 'l', 'xl'].include?(heading_size)
7
+ heading_size = false unless shared_helper.valid_heading_size?(heading_size)
6
8
  is_page_heading ||= false
7
9
 
8
- css_classes = %w( gem-c-label govuk-label )
10
+ css_classes = %w[gem-c-label govuk-label]
9
11
  css_classes << "govuk-label--s" if bold
10
12
  css_classes << "govuk-radios__label" if is_radio_label
11
13
  css_classes << "govuk-label--#{heading_size}" if heading_size
12
14
 
13
- hint_text_css_classes = %w( govuk-hint )
15
+ hint_text_css_classes = %w[govuk-hint]
14
16
  hint_text_css_classes << "govuk-radios__hint" if is_radio_label
15
17
  %>
16
18
 
@@ -7,6 +7,7 @@
7
7
  logo_link ||= "/"
8
8
  navigation_items ||= []
9
9
  omit_feedback_form ||= false
10
+ omit_footer_navigation ||= false
10
11
  omit_header ||= false
11
12
  product_name ||= nil
12
13
  show_explore_header ||= false
@@ -122,7 +123,7 @@
122
123
  <% unless local_assigns[:hide_footer_links] %>
123
124
  <%= render "govuk_publishing_components/components/layout_footer", {
124
125
  with_border: true,
125
- navigation: layout_helper.footer_navigation,
126
+ navigation: omit_footer_navigation ? nil : layout_helper.footer_navigation,
126
127
  meta: layout_helper.footer_meta,
127
128
  } %>
128
129
  <% end %>
@@ -8,29 +8,35 @@
8
8
  local_assigns[:margin_bottom] ||= 8
9
9
  local_assigns[:margin_bottom] = 8 if local_assigns[:margin_bottom] > 9
10
10
 
11
+ banner_title ||= t("components.notice.banner_title")
12
+ banner_title_id ||= "govuk-notification-banner-title-#{SecureRandom.hex(4)}"
13
+ show_banner_title ||= false
14
+ heading_level = show_banner_title ? "h3" : "h2"
15
+
11
16
  shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
12
17
 
13
- css_classes = %w[gem-c-notice]
18
+ css_classes = %w[govuk-notification-banner gem-c-notice]
14
19
  css_classes << (shared_helper.get_margin_bottom)
15
20
 
16
- aria_attributes = aria_live ? {label: 'Notice', live: 'polite'} : {label: 'Notice'}
21
+ aria_attributes = {label: 'Notice'}
22
+ aria_attributes[:live] = 'polite' if aria_live
23
+ aria_attributes[:labelledby] = banner_title_id if show_banner_title
17
24
 
18
25
  description_present = description.present? || description_text.present? || description_govspeak.present?
19
26
  %>
20
27
  <% if title || description_present %>
21
28
  <%= tag.section class: css_classes, aria: aria_attributes, lang: lang, role: "region" do %>
22
- <% if title %>
23
- <% if description_present %>
24
- <%= tag.h2 title, class: "gem-c-notice__title" %>
25
- <% else %>
26
- <%= tag.span title, class: "gem-c-notice__title" %>
27
- <% end %>
28
- <% end %>
29
+ <%= tag.div class: "govuk-notification-banner__header" do %>
30
+ <%= tag.h2 banner_title, class: "govuk-notification-banner__title", id: banner_title_id %>
31
+ <% end if show_banner_title %>
32
+ <%= tag.div class: "govuk-notification-banner__content" do %>
33
+ <%= content_tag(heading_level, title, class: "gem-c-notice__title govuk-notification-banner__heading") if description_present && title %>
34
+ <%= tag.span title, class: "gem-c-notice__title govuk-notification-banner__heading" if !description_present && title %>
35
+ <%= tag.p description_text, class: "gem-c-notice__description" if description_text %>
29
36
 
30
- <%= tag.p description_text, class: "gem-c-notice__description" if description_text %>
37
+ <%= description if description %>
31
38
 
32
- <%= description if description %>
33
-
34
- <%= render 'govuk_publishing_components/components/govspeak', content: description_govspeak if description_govspeak %>
39
+ <%= render 'govuk_publishing_components/components/govspeak', content: description_govspeak if description_govspeak %>
40
+ <% end %>
35
41
  <% end %>
36
42
  <% end %>
@@ -11,17 +11,16 @@
11
11
  heading_size ||= nil
12
12
  small ||= false
13
13
  inline ||= false
14
- is_page_heading ||= false
15
- heading_level = is_page_heading ? 'h1' : shared_helper.get_heading_level
14
+ heading_level = shared_helper.get_heading_level
16
15
  heading_classes = %w(govuk-fieldset__heading)
17
16
  heading_classes << "gem-c-radio__heading-text" if heading_level == 'h1'
18
17
 
19
- if ['s', 'm', 'l', 'xl'].include?(heading_size)
18
+ if (shared_helper.valid_heading_size?(heading_size))
20
19
  size = heading_size
21
- elsif is_page_heading
22
- size = 'xl'
20
+ elsif heading_level == "h1"
21
+ size = "xl"
23
22
  else
24
- size = 'm'
23
+ size = "m"
25
24
  end
26
25
 
27
26
  description ||= nil
@@ -4,6 +4,7 @@
4
4
  aria_controls ||= nil
5
5
  button_text ||= t("components.search_box.search_button")
6
6
  id ||= "search-main-" + SecureRandom.hex(4)
7
+ label_size ||= nil
7
8
  label_text ||= t("components.search_box.label")
8
9
  name ||= "q"
9
10
  no_border ||= false
@@ -13,6 +14,13 @@
13
14
  data_attributes ||= {}
14
15
  data_attributes[:module] = 'gem-track-click'
15
16
 
17
+ label_classes = []
18
+ if (shared_helper.valid_heading_size?(label_size))
19
+ label_classes << "govuk-label govuk-label--#{label_size}"
20
+ else
21
+ label_classes << "gem-c-search__label"
22
+ end
23
+
16
24
  classes = %w[gem-c-search govuk-!-display-none-print]
17
25
  classes << (shared_helper.get_margin_top)
18
26
  classes << (shared_helper.get_margin_bottom) if local_assigns[:margin_bottom]
@@ -23,13 +31,13 @@
23
31
  else
24
32
  classes << "gem-c-search--on-white"
25
33
  end
26
- classes << "gem-c-search--separate-label" if local_assigns.include?(:inline_label)
34
+ classes << "gem-c-search--separate-label" if local_assigns.include?(:inline_label) or local_assigns.include?(:label_size)
27
35
  %>
28
36
 
29
37
  <div class="<%= classes.join(" ") %>" data-module="gem-toggle-input-class-on-focus">
30
- <label for="<%= id %>" class="gem-c-search__label">
38
+ <%= tag.label({ for: id, class: label_classes }) do %>
31
39
  <%= label_text %>
32
- </label>
40
+ <% end %>
33
41
  <div class="gem-c-search__item-wrapper">
34
42
  <%= tag.input(
35
43
  aria: {
@@ -1,11 +1,13 @@
1
1
  <%
2
+ shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
3
+
2
4
  options ||= []
3
5
  id ||= false
4
6
  label ||= false
5
7
  full_width ||= false
6
8
  name ||= id
7
9
  is_page_heading ||= false
8
- heading_size = false unless ['s', 'm', 'l', 'xl'].include?(heading_size)
10
+ heading_size = false unless shared_helper.valid_heading_size?(heading_size)
9
11
  error_message ||= nil
10
12
  error_id ||= nil
11
13
 
@@ -1,7 +1,7 @@
1
1
  <%
2
2
  local_assigns[:heading_level] ||= 3
3
- heading_size = 'm' unless ['s', 'm', 'l', 'xl'].include?(heading_size)
4
3
  shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
4
+ heading_size = "m" unless shared_helper.valid_heading_size?(heading_size)
5
5
 
6
6
  id ||= nil
7
7
  title ||= nil
@@ -3,9 +3,7 @@
3
3
 
4
4
  context ||= false
5
5
  context_locale ||= false
6
- context_text = context.is_a?(Hash) ? context[:text] : context
7
- context_href = context.is_a?(Hash) ? context[:href] : false
8
- context_data = context.is_a?(Hash) ? context[:data] : false
6
+ context_inside ||= false
9
7
 
10
8
  inverse ||= false
11
9
  local_assigns[:margin_top] ||= 8
@@ -21,13 +19,22 @@
21
19
  heading_classes = %w[gem-c-title__text]
22
20
  heading_classes << (average_title_length.present? ? 'govuk-heading-l' : 'govuk-heading-xl')
23
21
  %>
22
+
23
+ <% @context_block = capture do %>
24
+ <span class="govuk-caption-xl gem-c-title__context" <%= "lang=#{context_locale}" if context_locale.present? %>>
25
+ <%= context %>
26
+ </span>
27
+ <% end %>
28
+
24
29
  <%= content_tag(:div, class: classes) do %>
25
- <% if context %>
26
- <span class="govuk-caption-xl gem-c-title__context" <%= "lang=#{context_locale}" if context_locale.present? %>>
27
- <%= context_href ? link_to(context_text, context_href, class: 'gem-c-title__context-link govuk-link', data: context_data) : context_text %>
28
- </span>
30
+ <% if context && !context_inside %>
31
+ <%= @context_block %>
29
32
  <% end %>
33
+
30
34
  <h1 class="<%= heading_classes.join(" ") %>">
35
+ <% if context && context_inside %>
36
+ <%= @context_block %>
37
+ <% end %>
31
38
  <%= title %>
32
39
  </h1>
33
40
  <% end %>
@@ -31,6 +31,10 @@ examples:
31
31
  description: This allows the feedback form to be omitted
32
32
  data:
33
33
  omit_feedback_form: true
34
+ omit_footer_navigation:
35
+ description: This allows the footer navigation to be omitted
36
+ data:
37
+ omit_footer_navigation: true
34
38
  navigation:
35
39
  description: Passes the navigation through to the [header component](/component-guide/layout_header/).
36
40
  data:
@@ -50,3 +50,18 @@ examples:
50
50
  title: 'This publication was withdrawn on 30 September 2015'
51
51
  description_govspeak: <p>This document is no longer current. We published a new version on 30 September 2015.</p>
52
52
  lang: 'en'
53
+ with_banner_title:
54
+ description: |
55
+ By default, the notice component renders with a banner title of "Important" if `show_banner_title` is `true`.
56
+ data:
57
+ title: 'This publication was withdrawn on 30 September 2015'
58
+ description_govspeak: <p>This document is no longer current. We published a new version on 30 September 2015.</p>
59
+ show_banner_title: true
60
+ with_custom_banner_title:
61
+ description: |
62
+ The default banner title can be overruled by specifying a `banner_title` option.
63
+ data:
64
+ title: 'This publication was withdrawn on 30 September 2015'
65
+ description_govspeak: <p>This document is no longer current. We published a new version on 30 September 2015.</p>
66
+ show_banner_title: true
67
+ banner_title: "Information"
@@ -107,17 +107,6 @@ examples:
107
107
  text: "Green"
108
108
  - value: "blue"
109
109
  text: "Blue"
110
- with_page_heading:
111
- description: This adds a H1 element containing the text supplied.
112
- data:
113
- name: "radio-group-heading"
114
- heading: "Is it raining?"
115
- is_page_heading: true
116
- items:
117
- - value: "yes"
118
- text: "Yes"
119
- - value: "no"
120
- text: "No"
121
110
  with_page_header_and_caption:
122
111
  description: |
123
112
  If a caption text is provided with a page heading, it will be displayed above the heading.
@@ -127,7 +116,7 @@ examples:
127
116
  name: "radio-group-heading"
128
117
  heading: "Is it snowing?"
129
118
  heading_caption: "Question 3 of 9"
130
- is_page_heading: true
119
+ heading_level: 1
131
120
  items:
132
121
  - value: "yes"
133
122
  text: "Yes"
@@ -137,7 +126,7 @@ examples:
137
126
  data:
138
127
  name: "radio-group-heading"
139
128
  heading: "Is it snowing?"
140
- is_page_heading: true
129
+ heading_level: 1
141
130
  hint: "Sleet or hail doesn’t count."
142
131
  items:
143
132
  - value: "yes"
@@ -179,7 +168,7 @@ examples:
179
168
  data:
180
169
  name: "radio-group-description"
181
170
  heading: "What is your favourite colour?"
182
- is_page_heading: true
171
+ heading_level: 1
183
172
  description: |
184
173
  Skittles consist of hard sugar shells imprinted with the letter "S".
185
174
  The interior consists mainly of sugar, corn syrup, and hydrogenated
@@ -196,7 +185,7 @@ examples:
196
185
  description: |
197
186
  This allows the size of the legend to be changed. Valid options are s, m, l, xl, defaulting to m if no option is passed.
198
187
 
199
- If the is_page_heading option is true and heading_size is not set, the text size will be xl.
188
+ If heading_level is 1 and heading_size is not set, the text size will be xl.
200
189
  data:
201
190
  name: "radio-group-description"
202
191
  heading: "What is your favourite colour?"
@@ -64,3 +64,8 @@ examples:
64
64
  This is visually hidden text -- to check for changes use a screen reader or inspect the button element.
65
65
  data:
66
66
  button_text: "Search absolutely everywhere"
67
+ with_set_label_size:
68
+ description: |
69
+ Allows the label text size to be set to `xl`, `l`, `m`, or `s`. If this is set, then `inline_label` is automatically set to `false`.
70
+ data:
71
+ label_size: "xl"
@@ -24,6 +24,13 @@ examples:
24
24
  data:
25
25
  context: Publication
26
26
  title: My page title
27
+ with_context_inside:
28
+ description: |
29
+ If the context should be considered part of the page heading, you can nest the context within the <code><h1></code>.
30
+ data:
31
+ context: Publication
32
+ title: My page title
33
+ context_inside: true
27
34
  with_context_language_labelled:
28
35
  description: |
29
36
  Sometimes this component appears on a page that has been translated. The title will naturally be supplied in the required language but the context string may fall back to the default. In these instances we need to label the language so the page remains semantic and screenreaders can handle the switch.
@@ -33,18 +40,6 @@ examples:
33
40
  context: Publication
34
41
  context_locale: en
35
42
  title: My page title
36
- with_context_link:
37
- description: |
38
- It’s unclear if links in the context of a title are useful and are being clicked by users. Data attributes are included to track this behaviour.
39
-
40
- Context links are used on [topic pages](https://www.gov.uk/topic/business-tax/vat) where there is also a breadcrumb.
41
- data:
42
- context:
43
- text: Publication
44
- href: '/link'
45
- data:
46
- some_tracking_parameter: 'tracking-param'
47
- title: My page title
48
43
  long_title_with_context:
49
44
  data:
50
45
  context: Publication
@@ -5,7 +5,6 @@ Rails.application.config.assets.precompile += %w[
5
5
  component_guide/accessibility-test.js
6
6
  component_guide/application.js
7
7
  component_guide/filter-components.js
8
- component_guide/visual-regression.js
9
8
  component_guide/print.css
10
9
  govuk_publishing_components/rum-loader.js
11
10
  govuk_publishing_components/vendor/lux/lux-reporter.js
@@ -75,7 +75,8 @@ en:
75
75
  intervention:
76
76
  title: Check the next steps for your limited company
77
77
  description: You might be interested in this because you’ve been browsing guidance relevant to starting a limited company.
78
- dismiss_html: <a class="govuk-link" href="?hide-intervention=true">Hide this suggestion</a> if it’s not relevant to you
78
+ dismiss_link_text: Hide this suggestion
79
+ dismiss_post_link: if it’s not relevant to you
79
80
  layout_footer:
80
81
  copyright_html: <a class="govuk-footer__link govuk-footer__copyright-logo" href="http://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/copyright-and-re-use/crown-copyright/">© Crown copyright</a>
81
82
  licence_html: All content is available under the <a class="govuk-footer__link" href="https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/" rel="license">Open Government Licence v3.0</a>, except where otherwise stated
@@ -182,6 +183,8 @@ en:
182
183
  toggle_more: "+ %{number} more"
183
184
  modal_dialogue:
184
185
  close_modal: Close modal dialogue
186
+ notice:
187
+ banner_title: Important
185
188
  organisation_schema:
186
189
  all_content_search_description: Find all content from %{organisation}
187
190
  previous_and_next_navigation:
@@ -4,15 +4,18 @@ module GovukPublishingComponents
4
4
  # keys are labels, values are the content_ids for the matching taxons
5
5
  # Where multiple matching taxons are present, the top most one is the highest priority
6
6
  # and the bottom one the lowest priority
7
- PRIORITY_TAXONS = {
8
- education_coronavirus: "272308f4-05c8-4d0d-abc7-b7c2e3ccd249",
9
- worker_coronavirus: "b7f57213-4b16-446d-8ded-81955d782680",
10
- business_coronavirus: "65666cdf-b177-4d79-9687-b9c32805e450",
7
+ BREXIT_TAXONS = {
11
8
  brexit_business: "634fd193-8039-4a70-a059-919c34ff4bfc",
12
9
  brexit_individuals: "614b2e65-56ac-4f8d-bb9c-d1a14167ba25",
13
10
  brexit_taxon: "d6c2de5d-ef90-45d1-82d4-5f2438369eea",
14
11
  }.freeze
15
12
 
13
+ PRIORITY_TAXONS = {
14
+ education_coronavirus: "272308f4-05c8-4d0d-abc7-b7c2e3ccd249",
15
+ worker_coronavirus: "b7f57213-4b16-446d-8ded-81955d782680",
16
+ business_coronavirus: "65666cdf-b177-4d79-9687-b9c32805e450",
17
+ }.merge(BREXIT_TAXONS).freeze
18
+
16
19
  # Returns the highest priority taxon that has a content_id matching those in PRIORITY_TAXONS
17
20
  def self.call(content_item, query_parameters = nil)
18
21
  new(content_item, query_parameters).breadcrumbs
@@ -25,16 +28,24 @@ module GovukPublishingComponents
25
28
  @query_parameters = query_parameters
26
29
  end
27
30
 
28
- def taxon
29
- @taxon ||= begin
31
+ def priority_taxon
32
+ @priority_taxon ||= begin
30
33
  default_taxon = priority_taxons.min_by { |t| PRIORITY_TAXONS.values.index(t["content_id"]) }
31
34
  preferred_taxon || default_taxon
32
35
  end
33
36
  end
34
37
 
38
+ def priority_brexit_taxon
39
+ if tagged_to_both_brexit_child_taxons?
40
+ priority_brexit_taxons.find { |t| t["content_id"] == BREXIT_TAXONS[:brexit_taxon] }
41
+ else
42
+ priority_brexit_taxons.min_by { |t| BREXIT_TAXONS.values.index(t["content_id"]) }
43
+ end
44
+ end
45
+
35
46
  def breadcrumbs
36
- taxon && {
37
- title: taxon["title"],
47
+ priority_taxon && {
48
+ title: priority_taxon["title"],
38
49
  path: breadcrumb_path,
39
50
  tracking_category: "breadcrumbClicked",
40
51
  tracking_action: tracking_action,
@@ -43,7 +54,9 @@ module GovukPublishingComponents
43
54
  }
44
55
  end
45
56
 
46
- def brexit_audience
57
+ def brexit_audience(taxon)
58
+ return nil unless taxon
59
+
47
60
  {
48
61
  PRIORITY_TAXONS[:brexit_business] => "Brexitbusiness",
49
62
  PRIORITY_TAXONS[:brexit_individuals] => "Brexitcitizen",
@@ -70,6 +83,10 @@ module GovukPublishingComponents
70
83
  end
71
84
  end
72
85
 
86
+ def priority_brexit_taxons
87
+ priority_taxons.select { |t| priority_brexit_taxon?(t) }
88
+ end
89
+
73
90
  def taxon_tree(taxons)
74
91
  return [] if taxons.blank?
75
92
 
@@ -80,6 +97,10 @@ module GovukPublishingComponents
80
97
  PRIORITY_TAXONS.values.include?(taxon["content_id"])
81
98
  end
82
99
 
100
+ def priority_brexit_taxon?(taxon)
101
+ BREXIT_TAXONS.values.include?(taxon["content_id"])
102
+ end
103
+
83
104
  def brexit_child_taxon?(taxon)
84
105
  brexit_child_taxons.include?(taxon["content_id"])
85
106
  end
@@ -94,7 +115,7 @@ module GovukPublishingComponents
94
115
 
95
116
  def tracking_action
96
117
  action = %w[superBreadcrumb]
97
- action << brexit_audience
118
+ action << brexit_audience(priority_taxon)
98
119
  action.compact.join(" ")
99
120
  end
100
121
 
@@ -104,7 +125,7 @@ module GovukPublishingComponents
104
125
  end
105
126
 
106
127
  def breadcrumb_path
107
- taxon.dig("details", "url_override").present? ? taxon.dig("details", "url_override") : taxon["base_path"]
128
+ priority_taxon.dig("details", "url_override").present? ? priority_taxon.dig("details", "url_override") : priority_taxon["base_path"]
108
129
  end
109
130
  end
110
131
  end
@@ -123,21 +123,28 @@ module GovukPublishingComponents
123
123
  return meta_tags if taxons.blank?
124
124
  return meta_tags unless tagged_to_priority_taxon?
125
125
 
126
- meta_tags[tag_key] = brexit_audience if brexit_audience.present?
126
+ taxon =
127
+ tag_key == "govuk:brexit-audience" ? priority_brexit_taxon : priority_taxon
127
128
 
129
+ brexit_audience = priority_taxon_helper.brexit_audience(taxon)
130
+ meta_tags[tag_key] = brexit_audience if brexit_audience.present?
128
131
  meta_tags
129
132
  end
130
133
 
131
134
  def tagged_to_priority_taxon?
132
- priority_taxon_helper.taxon.present?
135
+ priority_taxon_helper.priority_taxon.present?
133
136
  end
134
137
 
135
138
  def priority_taxon_helper
136
139
  @priority_taxon_helper ||= ContentBreadcrumbsBasedOnPriority.new(content_item.deep_stringify_keys, request.query_parameters)
137
140
  end
138
141
 
139
- def brexit_audience
140
- priority_taxon_helper.brexit_audience
142
+ def priority_taxon
143
+ priority_taxon_helper.priority_taxon
144
+ end
145
+
146
+ def priority_brexit_taxon
147
+ priority_taxon_helper.priority_brexit_taxon
141
148
  end
142
149
 
143
150
  def has_content_history?
@@ -31,10 +31,14 @@ module GovukPublishingComponents
31
31
  "span"
32
32
  end
33
33
 
34
+ def valid_heading_size?(size)
35
+ %w[xl l m s].include?(size)
36
+ end
37
+
34
38
  def get_heading_size(option, fallback)
35
39
  govuk_class = "govuk-heading-"
36
40
 
37
- if %w[xl l m s].include? option
41
+ if valid_heading_size?(option)
38
42
  "#{govuk_class}#{option}"
39
43
  else
40
44
  "#{govuk_class}#{fallback}"
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "24.20.0".freeze
2
+ VERSION = "25.1.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_publishing_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 24.20.0
4
+ version: 25.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-13 00:00:00.000000000 Z
11
+ date: 2021-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config
@@ -463,6 +463,8 @@ files:
463
463
  - app/assets/javascripts/govuk_publishing_components/analytics/print-intent.js
464
464
  - app/assets/javascripts/govuk_publishing_components/analytics/scroll-tracker.js
465
465
  - app/assets/javascripts/govuk_publishing_components/analytics/static-analytics.js
466
+ - app/assets/javascripts/govuk_publishing_components/analytics/track-click.js
467
+ - app/assets/javascripts/govuk_publishing_components/analytics/track-select-change.js
466
468
  - app/assets/javascripts/govuk_publishing_components/components/accordion.js
467
469
  - app/assets/javascripts/govuk_publishing_components/components/button.js
468
470
  - app/assets/javascripts/govuk_publishing_components/components/character-count.js
@@ -474,6 +476,7 @@ files:
474
476
  - app/assets/javascripts/govuk_publishing_components/components/error-summary.js
475
477
  - app/assets/javascripts/govuk_publishing_components/components/feedback.js
476
478
  - app/assets/javascripts/govuk_publishing_components/components/govspeak.js
479
+ - app/assets/javascripts/govuk_publishing_components/components/intervention.js
477
480
  - app/assets/javascripts/govuk_publishing_components/components/layout-header.js
478
481
  - app/assets/javascripts/govuk_publishing_components/components/layout-super-navigation-header.js
479
482
  - app/assets/javascripts/govuk_publishing_components/components/modal-dialogue.js
@@ -495,10 +498,8 @@ files:
495
498
  - app/assets/javascripts/govuk_publishing_components/lib/header-navigation.js
496
499
  - app/assets/javascripts/govuk_publishing_components/lib/initial-focus.js
497
500
  - app/assets/javascripts/govuk_publishing_components/lib/primary-links.js
498
- - app/assets/javascripts/govuk_publishing_components/lib/select.js
499
501
  - app/assets/javascripts/govuk_publishing_components/lib/toggle-input-class-on-focus.js
500
502
  - app/assets/javascripts/govuk_publishing_components/lib/toggle.js
501
- - app/assets/javascripts/govuk_publishing_components/lib/track-click.js
502
503
  - app/assets/javascripts/govuk_publishing_components/lib/trigger-event.js
503
504
  - app/assets/javascripts/govuk_publishing_components/modules.js
504
505
  - app/assets/javascripts/govuk_publishing_components/rum-loader.js.erb
@@ -612,32 +613,20 @@ files:
612
613
  - app/assets/stylesheets/govuk_publishing_components/components/helpers/_govuk-frontend-settings.scss
613
614
  - app/assets/stylesheets/govuk_publishing_components/components/helpers/_link.scss
614
615
  - app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss
615
- - app/assets/stylesheets/govuk_publishing_components/components/helpers/_px-to-em.scss
616
616
  - app/assets/stylesheets/govuk_publishing_components/components/mixins/_css3.scss
617
617
  - app/assets/stylesheets/govuk_publishing_components/components/mixins/_govuk-template-link-focus-override.scss
618
618
  - app/assets/stylesheets/govuk_publishing_components/components/mixins/_margins.scss
619
619
  - app/assets/stylesheets/govuk_publishing_components/components/mixins/_media-down.scss
620
620
  - app/assets/stylesheets/govuk_publishing_components/components/print/_accordion.scss
621
- - app/assets/stylesheets/govuk_publishing_components/components/print/_attachment.scss
622
- - app/assets/stylesheets/govuk_publishing_components/components/print/_back-link.scss
623
621
  - app/assets/stylesheets/govuk_publishing_components/components/print/_button.scss
624
622
  - app/assets/stylesheets/govuk_publishing_components/components/print/_contents-list.scss
625
- - app/assets/stylesheets/govuk_publishing_components/components/print/_feedback.scss
626
623
  - app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak-html-publication.scss
627
624
  - app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak.scss
628
- - app/assets/stylesheets/govuk_publishing_components/components/print/_layout-footer.scss
629
- - app/assets/stylesheets/govuk_publishing_components/components/print/_layout-header.scss
630
625
  - app/assets/stylesheets/govuk_publishing_components/components/print/_layout-super-navigation-header.scss
631
- - app/assets/stylesheets/govuk_publishing_components/components/print/_metadata.scss
632
- - app/assets/stylesheets/govuk_publishing_components/components/print/_search.scss
633
- - app/assets/stylesheets/govuk_publishing_components/components/print/_share-links.scss
634
- - app/assets/stylesheets/govuk_publishing_components/components/print/_skip-link.scss
635
626
  - app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav-header.scss
636
627
  - app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav.scss
637
- - app/assets/stylesheets/govuk_publishing_components/components/print/_subscription-links.scss
638
628
  - app/assets/stylesheets/govuk_publishing_components/components/print/_textarea.scss
639
629
  - app/assets/stylesheets/govuk_publishing_components/components/print/_title.scss
640
- - app/assets/stylesheets/govuk_publishing_components/components/print/_translation-nav.scss
641
630
  - app/assets/stylesheets/govuk_publishing_components/govuk_frontend_support.scss
642
631
  - app/controllers/govuk_publishing_components/application_controller.rb
643
632
  - app/controllers/govuk_publishing_components/audit_controller.rb
@@ -1,12 +0,0 @@
1
- // Convert pixels to em
2
- @function em($value, $gem-context-font-size) {
3
- @warn "This function is deprecated and will be removed in the next major version release - use GOV.UK Frontend's `govuk-em()` instead.";
4
-
5
- @if (unitless($value)) {
6
- $value: $value * 1px;
7
- }
8
- @if (unitless($gem-context-font-size)) {
9
- $gem-context-font-size: $gem-context-font-size * 1px;
10
- }
11
- @return $value / $gem-context-font-size * 1em;
12
- }
@@ -1,2 +0,0 @@
1
- // Left this as an empty file as opposed to deleting it because it is @imported in application print stylesheets for example here:
2
- // https://github.com/alphagov/government-frontend/blob/7a0b068a0faa1da07f58acf0b1d3a0aa3e1daf56/app/assets/stylesheets/print.scss#L2
@@ -1,2 +0,0 @@
1
- // Left this as an empty file as opposed to deleting it because it is @imported in application print stylesheets for example here:
2
- // https://github.com/alphagov/govuk-account-manager-prototype/blob/7858b55afcddc2f855d909abd051838d95f21f13/app/assets/stylesheets/print.scss#L2
@@ -1,2 +0,0 @@
1
- // Left this as an empty file as opposed to deleting it because it is @imported in application print stylesheets for example here:
2
- // https://github.com/alphagov/government-frontend/blob/7a0b068a0faa1da07f58acf0b1d3a0aa3e1daf56/app/assets/stylesheets/print.scss#L6
@@ -1,2 +0,0 @@
1
- // Left this as an empty file as opposed to deleting it because it is @imported in application print stylesheets for example here:
2
- // https://github.com/alphagov/govuk-account-manager-prototype/blob/7858b55afcddc2f855d909abd051838d95f21f13/app/assets/stylesheets/print.scss#L5
@@ -1,2 +0,0 @@
1
- // Left this as an empty file as opposed to deleting it because it is @imported in application print stylesheets for example here:
2
- // https://github.com/alphagov/govuk-account-manager-prototype/blob/7858b55afcddc2f855d909abd051838d95f21f13/app/assets/stylesheets/print.scss#L6
@@ -1,2 +0,0 @@
1
- // Left this as an empty file as opposed to deleting it because it is @imported in application print stylesheets for example here:
2
- // https://github.com/alphagov/manuals-frontend/blob/466b4c7a6507a3d76818e26612f174616f5cdf94/app/assets/stylesheets/print.scss#L15
@@ -1,2 +0,0 @@
1
- // Left this as an empty file as opposed to deleting it because it is @imported in application print stylesheets for example here:
2
- // https://github.com/alphagov/govuk-account-manager-prototype/blob/7858b55afcddc2f855d909abd051838d95f21f13/app/assets/stylesheets/print.scss#L7
@@ -1,2 +0,0 @@
1
- // Left this as an empty file as opposed to deleting it because it is @imported in application print stylesheets for example here:
2
- // https://github.com/alphagov/collections/blob/fc9db4ef6d87ad52d0ac795d1dd05d5fa116dde1/app/assets/stylesheets/print.scss#L9
@@ -1,2 +0,0 @@
1
- // Left this as an empty file as opposed to deleting it because it is @imported in application print stylesheets for example here:
2
- // https://github.com/alphagov/govuk-account-manager-prototype/blob/7858b55afcddc2f855d909abd051838d95f21f13/app/assets/stylesheets/print.scss#L8
@@ -1,2 +0,0 @@
1
- // Left this as an empty file as opposed to deleting it because it is @imported in application print stylesheets for example here:
2
- // https://github.com/alphagov/frontend/blob/34e84c7d6dc22bd4b06ce4c18a3d00b29fdcee83/app/assets/stylesheets/print.scss#L12
@@ -1,2 +0,0 @@
1
- // Left this as an empty file as opposed to deleting it because it is @imported in application print stylesheets for example here:
2
- // https://github.com/alphagov/government-frontend/blob/7a0b068a0faa1da07f58acf0b1d3a0aa3e1daf56/app/assets/stylesheets/print.scss#L16