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.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/analytics.js +2 -0
- data/app/assets/javascripts/govuk_publishing_components/{lib → analytics}/track-click.js +0 -0
- data/app/assets/javascripts/govuk_publishing_components/{lib/select.js → analytics/track-select-change.js} +0 -0
- data/app/assets/javascripts/govuk_publishing_components/components/intervention.js +16 -0
- data/app/assets/stylesheets/govuk_publishing_components/component_support.scss +0 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_intervention.scss +12 -10
- data/app/views/govuk_publishing_components/components/_intervention.html.erb +26 -8
- data/app/views/govuk_publishing_components/components/_radio.html.erb +2 -3
- data/app/views/govuk_publishing_components/components/_title.html.erb +1 -4
- data/app/views/govuk_publishing_components/components/docs/radio.yml +4 -15
- data/app/views/govuk_publishing_components/components/docs/title.yml +0 -12
- data/config/locales/en.yml +2 -1
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +5 -16
- data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_px-to-em.scss +0 -12
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_attachment.scss +0 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_back-link.scss +0 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_feedback.scss +0 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_layout-footer.scss +0 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_layout-header.scss +0 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_metadata.scss +0 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_search.scss +0 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_share-links.scss +0 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_skip-link.scss +0 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_subscription-links.scss +0 -2
- 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4930037fb8d76aa6cf75218fbed6498b61d7c2cc6ff88510a3dce4e149b3fee0
|
4
|
+
data.tar.gz: 206843c301aa7361c39e7453b2e944eb119c3ecbbb81c5b274978c8117439073
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ed7f1b00624cf90d8f1f75dfd7351968f358b4c9be1f3ec3c1f8715d315772ad6e9fcd3adb020cc01a87cd058992f4492bcbddd7677af74e5b378fe7ea037e1
|
7
|
+
data.tar.gz: 73fb36e36733e1b6652276c309e161979255976a913863a77d5245385180fb1daf0ed154d5edbfeb98711304ef307daf5b3df85b0aacabe3b1cb04720ac62dc9
|
File without changes
|
File without changes
|
@@ -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
|
-
@include govuk-responsive-
|
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
|
-
|
10
|
-
|
11
|
-
|
12
|
-
}
|
10
|
+
.gem-c-intervention__title {
|
11
|
+
@include govuk-responsive-margin(0);
|
12
|
+
@include govuk-responsive-padding(4, "bottom");
|
13
|
+
}
|
13
14
|
|
14
|
-
.
|
15
|
-
|
15
|
+
.govuk-body:last-of-type {
|
16
|
+
@include govuk-responsive-margin(0, "bottom");
|
17
|
+
}
|
16
18
|
}
|
@@ -1,15 +1,33 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
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="
|
18
|
+
<p class="govuk-body">
|
9
19
|
<%= t("components.intervention.description") %>
|
10
20
|
</p>
|
11
21
|
|
12
|
-
<p class="
|
13
|
-
|
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
|
-
|
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
|
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
|
-
<%=
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
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
|
data/config/locales/en.yml
CHANGED
@@ -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
|
-
|
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
|
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:
|
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-
|
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/govuk-account-manager-prototype/blob/7858b55afcddc2f855d909abd051838d95f21f13/app/assets/stylesheets/print.scss#L2
|
data/app/assets/stylesheets/govuk_publishing_components/components/print/_layout-footer.scss
DELETED
@@ -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
|
data/app/assets/stylesheets/govuk_publishing_components/components/print/_layout-header.scss
DELETED
@@ -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/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/govuk-account-manager-prototype/blob/7858b55afcddc2f855d909abd051838d95f21f13/app/assets/stylesheets/print.scss#L8
|