govuk_publishing_components 61.0.2 → 61.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/pii-remover.js +0 -14
- data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +39 -32
- data/app/assets/stylesheets/govuk_publishing_components/components/_print-link.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_content-block.scss +5 -9
- data/app/assets/stylesheets/govuk_publishing_components/lib/_print_support.scss +4 -4
- data/app/views/govuk_publishing_components/components/_action_link.html.erb +5 -3
- data/app/views/govuk_publishing_components/components/_cards.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_contents_list.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_devolved_nations.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_document_list.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_image_card.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_inset_text.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_intervention.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_print_link.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_step_by_step_nav_related.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/docs/action_link.yml +7 -0
- data/lib/govuk_publishing_components/presenters/component_wrapper_helper.rb +1 -1
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34fc86f0b6984bcd2bb2d4669470ff8268cdc8fedb85addeef526236c3f5abcf
|
4
|
+
data.tar.gz: db1347382632d01113fe792d9b2b4b42758417ea2b2a6aeb8fec94dc73d9c8ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe96b53f6e688e0b36555eaeda6ac50b7c9760d4db8db8519920b5d3e07fc59046ec8bdb9a4477f671182ac9820ec4ed16006e4edb9552dd5b3f68b09a2cff9c
|
7
|
+
data.tar.gz: 735c8823a24e2d7de30b3874886bb0a21b39cce18c9bb02daa197834ae4e8912ce9671b64b03c1e3d5d94420ea79037ce35df4768e8deb15fb4343110b898027
|
@@ -36,13 +36,6 @@
|
|
36
36
|
// e.g. 'AB123456A', 'AB 12 34 56 A', 'ab 123456 a', 'ab 12 34 56 a', 'AB+12+34+56+A'
|
37
37
|
var NATIONAL_INSURANCE_NUMBER = /[A-CEGHJ-OPR-TW-Z]{2}(\s+|\++)?(\d{2}(\s+|\++)?){3}[A-D]/gi
|
38
38
|
|
39
|
-
var UK_MOBILE_NUMBER = /07\d{3}[\s%20+]?\d{6,8}/g // 07123 123456 or 07123123456 or 07123+123456 or 07123%20123456
|
40
|
-
var UK_MOBILE_NUMBER_INTERNATIONAL = /(\+|%2B)?447\d{3}[\s%20+]?\d{6,8}/gi // +447123 123456 or +447123123456 or +447123%20123456 or +447123+123456 or %2B447123123456. Plus at start is optional.
|
41
|
-
var UK_LANDLINE_NUMBER = /0[1246]\d{1}[\s%20+]?\d{3,6}[\s%20+]?\d{4,6}/g // 020 123 1234 or 020 1234 1234 or 0201231234 or 02012341234 or 020+123+1234 or 020+1234+1234 or 020%20123%201234 or 020%201234%201234
|
42
|
-
var UK_LANDLINE_NUMBER_2 = /0[1246]\d{3}[\s%20+]\d{6,8}/g // 02123 123456 or 02123+123456 or 02123%20123456
|
43
|
-
var UK_LANDLINE_NUMBER_INTERNATIONAL = /(\+|%2B)?44[1246]\d{1}[\s%20+]?\d{3,6}[\s%20+]?\d{4,6}/g // // +4420 123 1234 or +4420 1234 1234 or +4420+123+1234 or +4420%20123%201234 or %2B4420 123 1234. Plus at start is optional.
|
44
|
-
var UK_LANDLINE_NUMBER_INTERNATIONAL_2 = /(\+|%2B)?44[1246]\d{3}[\s%20+]\d{6,8}/g // +442123 123456 or +442123%20123456 or +442123+123456 or %2B442123+123456. Plus at start is optional.
|
45
|
-
|
46
39
|
function shouldStripDates () {
|
47
40
|
var metas = document.querySelectorAll('meta[name="govuk:ga4-strip-dates"]')
|
48
41
|
return metas.length > 0
|
@@ -116,13 +109,6 @@
|
|
116
109
|
stripped = stripped.replace(VISA_PATTERN_GWF, '[gwf number]')
|
117
110
|
stripped = stripped.replace(VISA_PATTERN_GB, '[gb eori number]')
|
118
111
|
stripped = stripped.replace(NATIONAL_INSURANCE_NUMBER, '[ni number]')
|
119
|
-
stripped = stripped.replace(UK_LANDLINE_NUMBER, '[phone number]')
|
120
|
-
stripped = stripped.replace(UK_LANDLINE_NUMBER_2, '[phone number]')
|
121
|
-
stripped = stripped.replace(UK_LANDLINE_NUMBER_INTERNATIONAL, '[phone number]')
|
122
|
-
stripped = stripped.replace(UK_LANDLINE_NUMBER_INTERNATIONAL_2, '[phone number]')
|
123
|
-
stripped = stripped.replace(UK_MOBILE_NUMBER, '[phone number]')
|
124
|
-
stripped = stripped.replace(UK_MOBILE_NUMBER_INTERNATIONAL, '[phone number]')
|
125
|
-
|
126
112
|
stripped = this.stripQueryStringParameters(stripped)
|
127
113
|
|
128
114
|
if (this.stripDatePII === true) {
|
@@ -12,40 +12,37 @@
|
|
12
12
|
display: table-cell;
|
13
13
|
line-height: 1;
|
14
14
|
width: 36px;
|
15
|
+
vertical-align: middle;
|
15
16
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
@include govuk-media-query($from: tablet) {
|
18
|
+
width: 45px;
|
19
|
+
}
|
20
|
+
}
|
20
21
|
|
21
|
-
|
22
|
-
|
22
|
+
.gem-c-action-link__svg {
|
23
|
+
height: 28px;
|
24
|
+
vertical-align: middle;
|
25
|
+
width: 28px;
|
26
|
+
|
27
|
+
.gem-c-action-link__icon__circle {
|
28
|
+
fill: #eeefef;
|
23
29
|
|
24
|
-
|
25
|
-
|
26
|
-
fill: LinkText;
|
27
|
-
}
|
28
|
-
// stylelint-enable max-nesting-depth
|
30
|
+
@media (forced-colors: active) {
|
31
|
+
fill: LinkText;
|
29
32
|
}
|
33
|
+
}
|
30
34
|
|
31
|
-
|
32
|
-
|
35
|
+
.gem-c-action-link__icon__arrow {
|
36
|
+
fill: #000000;
|
33
37
|
|
34
|
-
|
35
|
-
|
36
|
-
fill: Canvas;
|
37
|
-
}
|
38
|
-
// stylelint-enable max-nesting-depth
|
38
|
+
@media (forced-colors: active) {
|
39
|
+
fill: Canvas;
|
39
40
|
}
|
40
41
|
}
|
41
42
|
|
42
43
|
@include govuk-media-query($from: tablet) {
|
43
|
-
|
44
|
-
|
45
|
-
svg {
|
46
|
-
height: 35px;
|
47
|
-
width: 35px;
|
48
|
-
}
|
44
|
+
height: 35px;
|
45
|
+
width: 35px;
|
49
46
|
}
|
50
47
|
}
|
51
48
|
|
@@ -53,18 +50,16 @@
|
|
53
50
|
padding-top: 2px;
|
54
51
|
width: 30px;
|
55
52
|
|
56
|
-
|
53
|
+
.gem-c-action-link__svg {
|
57
54
|
height: 25px;
|
58
55
|
width: 25px;
|
56
|
+
}
|
59
57
|
|
60
|
-
|
61
|
-
|
58
|
+
.gem-c-action-link__icon__arrow {
|
59
|
+
fill: #272828;
|
62
60
|
|
63
|
-
|
64
|
-
|
65
|
-
fill: currentcolor;
|
66
|
-
}
|
67
|
-
// stylelint-enable max-nesting-depth
|
61
|
+
@media (forced-colors: active) {
|
62
|
+
fill: currentcolor;
|
68
63
|
}
|
69
64
|
}
|
70
65
|
}
|
@@ -75,6 +70,18 @@
|
|
75
70
|
@include govuk-font(19, $weight: bold, $line-height: 1.3);
|
76
71
|
}
|
77
72
|
|
73
|
+
.gem-c-action-link--large {
|
74
|
+
.gem-c-action-link__icon {
|
75
|
+
height: 40px;
|
76
|
+
width: 56px;
|
77
|
+
}
|
78
|
+
|
79
|
+
.gem-c-action-link__svg {
|
80
|
+
height: 40px;
|
81
|
+
width: 40px;
|
82
|
+
}
|
83
|
+
}
|
84
|
+
|
78
85
|
@include govuk-media-query($media-type: print) {
|
79
86
|
.gem-c-action-link {
|
80
87
|
* {
|
data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_content-block.scss
CHANGED
@@ -1,6 +1,3 @@
|
|
1
|
-
@import "govuk/core/lists";
|
2
|
-
@import "govuk/core/typography";
|
3
|
-
|
4
1
|
.content-block,
|
5
2
|
.content-block__contact-key,
|
6
3
|
.content-block__contact-value,
|
@@ -9,19 +6,18 @@
|
|
9
6
|
padding: 0;
|
10
7
|
}
|
11
8
|
|
12
|
-
.content-block__contact-
|
13
|
-
|
14
|
-
|
15
|
-
}
|
9
|
+
.content-block__contact-key {
|
10
|
+
@include govuk-responsive-margin(4, "bottom");
|
11
|
+
@include govuk-font(24, $weight: "bold");
|
16
12
|
}
|
17
13
|
|
18
14
|
.content-block__contact-list--nested {
|
19
15
|
.content-block__contact-key {
|
20
|
-
@
|
16
|
+
@include govuk-font(19, $weight: "bold");
|
21
17
|
}
|
22
18
|
}
|
23
19
|
|
24
20
|
.content-block .content-block__list {
|
25
|
-
@extend %govuk-list;
|
26
21
|
margin-left: 0;
|
22
|
+
list-style: none;
|
27
23
|
}
|
@@ -36,13 +36,13 @@
|
|
36
36
|
// to black, reduce the font size, and improve the layout
|
37
37
|
// of the printed href.
|
38
38
|
//
|
39
|
-
// .gem-
|
39
|
+
// .gem-print-force-link-styles
|
40
40
|
// ----------------------------------------------------------
|
41
41
|
// Typically this class will be applied to existing
|
42
42
|
// elements that have the `govuk-link` class but it can
|
43
43
|
// also be used on other link elements.
|
44
44
|
//
|
45
|
-
// .gem-
|
45
|
+
// .gem-print-force-link-styles-within
|
46
46
|
// ----------------------------------------------------------
|
47
47
|
// A variation of the previous print style, to be used on
|
48
48
|
// parent elements that contain links with the `govuk-link`
|
@@ -52,8 +52,8 @@
|
|
52
52
|
|
53
53
|
// stylelint-disable declaration-no-important
|
54
54
|
@include govuk-media-query($media-type: print) {
|
55
|
-
.gem-
|
56
|
-
.gem-
|
55
|
+
.gem-print-force-link-styles,
|
56
|
+
.gem-print-force-link-styles-within .govuk-link {
|
57
57
|
&,
|
58
58
|
&:link,
|
59
59
|
&:visited {
|
@@ -7,20 +7,22 @@
|
|
7
7
|
inverse ||= false
|
8
8
|
simple ||= false
|
9
9
|
simple_light ||= false
|
10
|
+
large ||= false
|
10
11
|
|
11
|
-
link_classes = %w(govuk-link gem-c-action-link__link gem-
|
12
|
+
link_classes = %w(govuk-link gem-c-action-link__link gem-print-force-link-styles)
|
12
13
|
link_classes << "govuk-link--inverse" if inverse
|
13
14
|
|
14
15
|
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
15
16
|
component_helper.add_class("gem-c-action-link")
|
16
17
|
component_helper.add_class("gem-c-action-link--inverse") if inverse
|
17
18
|
component_helper.add_class("gem-c-action-link--simple") if simple
|
19
|
+
component_helper.add_class("gem-c-action-link--large") if large
|
18
20
|
%>
|
19
21
|
<% if text.present? %>
|
20
22
|
<%= tag.div(**component_helper.all_attributes) do %>
|
21
23
|
<% if simple || simple_light %>
|
22
24
|
<span class="gem-c-action-link__icon gem-c-action-link__icon--simple" hidden>
|
23
|
-
<svg xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true" viewBox="0 0 23 23">
|
25
|
+
<svg xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true" viewBox="0 0 23 23" class="gem-c-action-link__svg">
|
24
26
|
<g class="gem-c-action-link__icon__arrow">
|
25
27
|
<path d="M14.943 11.795 10.44 7.292 11.733 6l5.795 5.795-5.795 5.795-1.293-1.292 4.503-4.503Z" />
|
26
28
|
<path d="M3.956 10.881h11.485v1.828H3.956v-1.828Z" />
|
@@ -29,7 +31,7 @@
|
|
29
31
|
</span>
|
30
32
|
<% elsif %>
|
31
33
|
<span class="gem-c-action-link__icon" hidden>
|
32
|
-
<svg xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true" viewBox="0 0 27 27">
|
34
|
+
<svg xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true" viewBox="0 0 27 27" class="gem-c-action-link__svg">
|
33
35
|
<circle class="gem-c-action-link__icon__circle" cx="13.5" cy="13.5" r="13.5" />
|
34
36
|
<g class="gem-c-action-link__icon__arrow">
|
35
37
|
<path d="m17.701 13.526-3.827-3.828L14.973 8.6l4.926 4.926-4.926 4.926-1.099-1.099 3.827-3.827Z" />
|
@@ -38,7 +38,7 @@
|
|
38
38
|
<%= content_tag("h#{sub_heading_level}", class: "gem-c-cards__sub-heading govuk-heading-s") do %>
|
39
39
|
<%=
|
40
40
|
link_to link[:text], link[:path],
|
41
|
-
class: "govuk-link gem-c-cards__link gem-
|
41
|
+
class: "govuk-link gem-c-cards__link gem-print-force-link-styles",
|
42
42
|
data: link[:data_attributes]
|
43
43
|
%>
|
44
44
|
<% end %>
|
@@ -12,7 +12,7 @@
|
|
12
12
|
cl_helper = GovukPublishingComponents::Presenters::ContentsListHelper.new(local_assigns)
|
13
13
|
brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand)
|
14
14
|
|
15
|
-
link_classes = %w[gem-c-contents-list__link govuk-link gem-
|
15
|
+
link_classes = %w[gem-c-contents-list__link govuk-link gem-print-force-link-styles]
|
16
16
|
link_classes << brand_helper.color_class
|
17
17
|
link_classes << "govuk-link--no-underline" unless underline_links
|
18
18
|
|
@@ -36,7 +36,7 @@
|
|
36
36
|
<% if devolved_nations_helper.nations_with_urls.any? %>
|
37
37
|
<%= content_tag :ul, class: "govuk-list govuk-!-margin-top-1 govuk-!-margin-bottom-0" do -%>
|
38
38
|
<% devolved_nations_helper.nations_with_urls.each do |k, v| %>
|
39
|
-
<%= content_tag(:li, link_to(devolved_nations_helper.alternative_content_text(k), v[:alternative_url], class: "govuk-link gem-
|
39
|
+
<%= content_tag(:li, link_to(devolved_nations_helper.alternative_content_text(k), v[:alternative_url], class: "govuk-link gem-print-force-link-styles")) %>
|
40
40
|
<% end %>
|
41
41
|
<% end %>
|
42
42
|
<% end %>
|
@@ -55,7 +55,7 @@
|
|
55
55
|
item[:link][:text],
|
56
56
|
item[:link][:path],
|
57
57
|
data: item[:link][:data_attributes],
|
58
|
-
class: "#{item_classes} govuk-link gem-
|
58
|
+
class: "#{item_classes} govuk-link gem-print-force-link-styles #{extra_link_classes}",
|
59
59
|
lang: item[:link][:locale].presence,
|
60
60
|
rel: rel,
|
61
61
|
)
|
@@ -116,7 +116,7 @@
|
|
116
116
|
part[:link][:text],
|
117
117
|
part[:link][:path],
|
118
118
|
data: part[:link][:data_attributes],
|
119
|
-
class: "gem-c-document-list-child__heading gem-c-document-list-child__link #{brand_helper.color_class} govuk-link gem-
|
119
|
+
class: "gem-c-document-list-child__heading gem-c-document-list-child__link #{brand_helper.color_class} govuk-link gem-print-force-link-styles #{extra_link_classes}",
|
120
120
|
)
|
121
121
|
else
|
122
122
|
content_tag(
|
@@ -25,14 +25,14 @@
|
|
25
25
|
heading_link_classes = %w[
|
26
26
|
gem-c-image-card__title-link
|
27
27
|
govuk-link
|
28
|
-
gem-
|
28
|
+
gem-print-force-link-styles
|
29
29
|
]
|
30
30
|
heading_link_classes << brand_helper.color_class
|
31
31
|
heading_link_classes << "gem-c-image-card__title-link--large-font-size-mobile" if card_helper.large_mobile_font_size?
|
32
32
|
extra_link_classes = %w[
|
33
33
|
gem-c-image-card__list-item-link
|
34
34
|
govuk-link
|
35
|
-
gem-
|
35
|
+
gem-print-force-link-styles
|
36
36
|
]
|
37
37
|
extra_link_classes << brand_helper.color_class
|
38
38
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
local_assigns[:margin_bottom] ||= 6
|
6
6
|
|
7
7
|
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
8
|
-
component_helper.add_class("gem-c-inset-text gem-
|
8
|
+
component_helper.add_class("gem-c-inset-text gem-print-force-link-styles-within")
|
9
9
|
component_helper.set_id(id)
|
10
10
|
%>
|
11
11
|
<%= tag.div(**component_helper.all_attributes) do %>
|
@@ -32,7 +32,7 @@
|
|
32
32
|
suggestion_data_attributes[:ga4_link] = { event_name: "navigation", type: "intervention", section: suggestion_text, index_link: 1, index_total: 1 }.to_json unless disable_ga4
|
33
33
|
|
34
34
|
suggestion_tag_options = {
|
35
|
-
class: "govuk-link gem-
|
35
|
+
class: "govuk-link gem-print-force-link-styles",
|
36
36
|
href: suggestion_link_url,
|
37
37
|
data: suggestion_data_attributes,
|
38
38
|
}
|
@@ -10,7 +10,7 @@
|
|
10
10
|
((child_data_attributes[:module] ||= "") << " " << (require_js ? "print-link" : "button")).strip!
|
11
11
|
|
12
12
|
child_classes = %w[govuk-link]
|
13
|
-
child_classes << "
|
13
|
+
child_classes << "gem-c-print-link__button" if href.nil?
|
14
14
|
child_classes << "gem-c-print-link__link govuk-link--no-visited-state" if href.present?
|
15
15
|
|
16
16
|
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
@@ -32,7 +32,7 @@
|
|
32
32
|
<strong class="gem-c-step-nav-header__part-of">Part of</strong>
|
33
33
|
<% if path %>
|
34
34
|
<a href="<%= path %>"
|
35
|
-
class="gem-c-step-nav-header__title govuk-link gem-
|
35
|
+
class="gem-c-step-nav-header__title govuk-link gem-print-force-link-styles"
|
36
36
|
<% unless disable_ga4 %>
|
37
37
|
data-ga4-link='<%= ga4_data %>'
|
38
38
|
<% end %>>
|
@@ -16,7 +16,7 @@
|
|
16
16
|
<span class="gem-c-step-nav-related__pretitle"><%= pretitle %></span>
|
17
17
|
<% if links.length == 1 && !always_display_as_list %>
|
18
18
|
<a href="<%= links[0][:href] %>"
|
19
|
-
class="govuk-link gem-
|
19
|
+
class="govuk-link gem-print-force-link-styles"
|
20
20
|
<% unless disable_ga4
|
21
21
|
ga4_attributes = {
|
22
22
|
event_name: "navigation",
|
@@ -36,7 +36,7 @@
|
|
36
36
|
<% links.each_with_index do |link, index| %>
|
37
37
|
<li class="gem-c-step-nav-related__link-item">
|
38
38
|
<a href="<%= link[:href] %>"
|
39
|
-
class="govuk-link gem-
|
39
|
+
class="govuk-link gem-print-force-link-styles"
|
40
40
|
<% unless disable_ga4
|
41
41
|
ga4_attributes = {
|
42
42
|
event_name: "navigation",
|
@@ -25,3 +25,10 @@ examples:
|
|
25
25
|
text: Getting financial help and keeping your business safe
|
26
26
|
href: "/financial-help"
|
27
27
|
simple: true
|
28
|
+
large:
|
29
|
+
description: For use on the GOV.UK homepage popular links.
|
30
|
+
data:
|
31
|
+
text: This way for cookies
|
32
|
+
href: "/cookies"
|
33
|
+
large: true
|
34
|
+
|
@@ -151,7 +151,7 @@ module GovukPublishingComponents
|
|
151
151
|
return if classes.blank?
|
152
152
|
|
153
153
|
class_array = classes.split(" ")
|
154
|
-
unless class_array.all? { |c| c.start_with?("js-", "gem-c-", "govuk-", "app-c-", "brand--", "brand__") || c == "direction-rtl" }
|
154
|
+
unless class_array.all? { |c| c.start_with?("js-", "gem-c-", "govuk-", "app-c-", "brand--", "brand__", "gem-print-") || c == "direction-rtl" }
|
155
155
|
raise(ArgumentError, "Classes (#{classes}) must be prefixed with `js-`")
|
156
156
|
end
|
157
157
|
end
|