govuk_publishing_components 24.21.1 → 25.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) 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/{lib → analytics}/track-click.js +0 -0
  4. data/app/assets/javascripts/govuk_publishing_components/{lib/select.js → analytics/track-select-change.js} +0 -0
  5. data/app/assets/javascripts/govuk_publishing_components/components/intervention.js +16 -0
  6. data/app/assets/stylesheets/govuk_publishing_components/component_support.scss +0 -1
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_intervention.scss +12 -10
  8. data/app/views/govuk_publishing_components/components/_intervention.html.erb +26 -8
  9. data/app/views/govuk_publishing_components/components/_radio.html.erb +2 -3
  10. data/app/views/govuk_publishing_components/components/_title.html.erb +1 -4
  11. data/app/views/govuk_publishing_components/components/docs/radio.yml +4 -15
  12. data/app/views/govuk_publishing_components/components/docs/title.yml +0 -12
  13. data/config/locales/en.yml +2 -1
  14. data/lib/govuk_publishing_components/version.rb +1 -1
  15. metadata +5 -16
  16. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_px-to-em.scss +0 -12
  17. data/app/assets/stylesheets/govuk_publishing_components/components/print/_attachment.scss +0 -2
  18. data/app/assets/stylesheets/govuk_publishing_components/components/print/_back-link.scss +0 -2
  19. data/app/assets/stylesheets/govuk_publishing_components/components/print/_feedback.scss +0 -2
  20. data/app/assets/stylesheets/govuk_publishing_components/components/print/_layout-footer.scss +0 -2
  21. data/app/assets/stylesheets/govuk_publishing_components/components/print/_layout-header.scss +0 -2
  22. data/app/assets/stylesheets/govuk_publishing_components/components/print/_metadata.scss +0 -2
  23. data/app/assets/stylesheets/govuk_publishing_components/components/print/_search.scss +0 -2
  24. data/app/assets/stylesheets/govuk_publishing_components/components/print/_share-links.scss +0 -2
  25. data/app/assets/stylesheets/govuk_publishing_components/components/print/_skip-link.scss +0 -2
  26. data/app/assets/stylesheets/govuk_publishing_components/components/print/_subscription-links.scss +0 -2
  27. 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: 44ddb25e4dea29d5e7be3b46f3285066ee9b4b4d82fb32adef948fe0c9c6689a
4
- data.tar.gz: abf6448ae9381da77edba07cdda15ccc2228485cfbdf53812946920fa51a7fa5
3
+ metadata.gz: 4930037fb8d76aa6cf75218fbed6498b61d7c2cc6ff88510a3dce4e149b3fee0
4
+ data.tar.gz: 206843c301aa7361c39e7453b2e944eb119c3ecbbb81c5b274978c8117439073
5
5
  SHA512:
6
- metadata.gz: a8f8b390856e99383a5d93254437de57a229a8d55774f751a2b1f0bd915ceed8122edf440d4ee6f9687d10aaeedac04e0c0f4cc6ef8bcc501ccd8b401c69beb9
7
- data.tar.gz: 6d5c6d8e570e8ad75d92dab36f9d3af804c63060bfbbb19eb3a7307f2f5f61ab713477743247f5805784578093dec65a19ba58e2e04b60783472718abbc4ecb1
6
+ metadata.gz: 5ed7f1b00624cf90d8f1f75dfd7351968f358b4c9be1f3ec3c1f8715d315772ad6e9fcd3adb020cc01a87cd058992f4492bcbddd7677af74e5b378fe7ea037e1
7
+ data.tar.gz: 73fb36e36733e1b6652276c309e161979255976a913863a77d5245385180fb1daf0ed154d5edbfeb98711304ef307daf5b3df85b0aacabe3b1cb04720ac62dc9
@@ -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
@@ -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)
@@ -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";
@@ -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,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 %>
@@ -11,14 +11,13 @@
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
18
  if ['s', 'm', 'l', 'xl'].include?(heading_size)
20
19
  size = heading_size
21
- elsif is_page_heading
20
+ elsif heading_level == 'h1'
22
21
  size = 'xl'
23
22
  else
24
23
  size = 'm'
@@ -3,9 +3,6 @@
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
9
6
 
10
7
  inverse ||= false
11
8
  local_assigns[:margin_top] ||= 8
@@ -24,7 +21,7 @@
24
21
  <%= content_tag(:div, class: classes) do %>
25
22
  <% if context %>
26
23
  <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 %>
24
+ <%= context %>
28
25
  </span>
29
26
  <% end %>
30
27
  <h1 class="<%= heading_classes.join(" ") %>">
@@ -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?"
@@ -33,18 +33,6 @@ examples:
33
33
  context: Publication
34
34
  context_locale: en
35
35
  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
36
  long_title_with_context:
49
37
  data:
50
38
  context: Publication
@@ -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
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "24.21.1".freeze
2
+ VERSION = "25.0.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.21.1
4
+ version: 25.0.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-23 00:00:00.000000000 Z
11
+ date: 2021-07-29 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