govuk_publishing_components 51.0.0 → 51.1.1
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/vendor/lux/lux-reporter.js +30 -30
- data/app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss +3 -19
- data/app/views/govuk_publishing_components/components/docs/big_number.yml +1 -0
- data/app/views/govuk_publishing_components/components/docs/button.yml +9 -0
- data/app/views/govuk_publishing_components/components/docs/title.yml +0 -10
- data/lib/govuk_publishing_components/presenters/button_helper.rb +4 -1
- data/lib/govuk_publishing_components/presenters/shared_helper.rb +1 -6
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b340b1565779a9e7ae1a1c56063a386e1083cad425b65b5b77313233767bf48
|
4
|
+
data.tar.gz: ee7fd33d63fd4a00e2d8820637c859153d49047040df417453274eec0a81f048
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20d167ef2111b13c7e9c97b6e2171cd85c426a713269e32c5cdc5b51459b1c14782a3975f1481e29046656461aa74f819f198e9edfb73750afd3a9774339d960
|
7
|
+
data.tar.gz: 185782d6c5e7b10409bdd9a6dfc60c063bde552d9ecf2d3c8eede100a230feb189e1add437a927786dce35ad667a503b9f835153286a145fb5aea05358700ac8
|
@@ -336,7 +336,7 @@
|
|
336
336
|
return str;
|
337
337
|
}
|
338
338
|
|
339
|
-
var VERSION = "4.0.
|
339
|
+
var VERSION = "4.0.29";
|
340
340
|
/**
|
341
341
|
* Returns the version of the script as a float to be stored in legacy systems that do not support
|
342
342
|
* string versions.
|
@@ -626,36 +626,36 @@
|
|
626
626
|
try {
|
627
627
|
if (selector &&
|
628
628
|
(node.nodeType === 9 || selector.length > MAX_SELECTOR_LENGTH || !node.parentNode)) {
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
}
|
650
|
-
var currentSelector = name_1 + classes + (selector ? ">" + selector : "");
|
651
|
-
if (el.parentNode) {
|
652
|
-
var selectorWithParent = getNodeSelector(el.parentNode, currentSelector);
|
653
|
-
if (selectorWithParent.length < MAX_SELECTOR_LENGTH) {
|
654
|
-
return selectorWithParent;
|
629
|
+
// Final selector.
|
630
|
+
return selector;
|
631
|
+
}
|
632
|
+
var el = node;
|
633
|
+
// Our first preference is to use the data-sctrack attribute from anywhere in the tree
|
634
|
+
var trackId = getClosestScTrackAttribute(el);
|
635
|
+
if (trackId) {
|
636
|
+
return trackId;
|
637
|
+
}
|
638
|
+
if (el.id) {
|
639
|
+
// Once we've found an element with ID we return the selector.
|
640
|
+
return "#" + el.id + (selector ? ">" + selector : "");
|
641
|
+
}
|
642
|
+
else if (el) {
|
643
|
+
// Otherwise attempt to get parent elements recursively
|
644
|
+
var name_1 = el.nodeType === 1 ? el.nodeName.toLowerCase() : el.nodeName.toUpperCase();
|
645
|
+
var classes = el.className ? "." + el.className.replace(/\s+/g, ".") : "";
|
646
|
+
// Remove classes until the selector is short enough
|
647
|
+
while ((name_1 + classes).length > MAX_SELECTOR_LENGTH) {
|
648
|
+
classes = classes.split(".").slice(0, -1).join(".");
|
655
649
|
}
|
650
|
+
var currentSelector = name_1 + classes + (selector ? ">" + selector : "");
|
651
|
+
if (el.parentNode) {
|
652
|
+
var selectorWithParent = getNodeSelector(el.parentNode, currentSelector);
|
653
|
+
if (selectorWithParent.length < MAX_SELECTOR_LENGTH) {
|
654
|
+
return selectorWithParent;
|
655
|
+
}
|
656
|
+
}
|
657
|
+
return currentSelector;
|
656
658
|
}
|
657
|
-
return currentSelector;
|
658
|
-
}
|
659
659
|
}
|
660
660
|
catch (error) {
|
661
661
|
// Do nothing.
|
@@ -1963,7 +1963,7 @@
|
|
1963
1963
|
].join("");
|
1964
1964
|
}
|
1965
1965
|
function getCustomerId() {
|
1966
|
-
return String(_thisCustomerId)
|
1966
|
+
return String(_thisCustomerId);
|
1967
1967
|
}
|
1968
1968
|
function avgDomDepth() {
|
1969
1969
|
var aElems = document.getElementsByTagName("*");
|
@@ -57,24 +57,13 @@
|
|
57
57
|
|
58
58
|
@include govuk-media-query($from: tablet) {
|
59
59
|
box-sizing: border-box;
|
60
|
-
float:
|
61
|
-
|
62
|
-
padding-
|
60
|
+
float: inline-start;
|
61
|
+
padding-inline-start: 0;
|
62
|
+
padding-inline-end: govuk-spacing(1);
|
63
63
|
margin-top: 0;
|
64
64
|
}
|
65
65
|
}
|
66
66
|
|
67
|
-
.direction-rtl .gem-c-metadata .gem-c-metadata__term,
|
68
|
-
.gem-c-metadata.direction-rtl .gem-c-metadata__term {
|
69
|
-
float: inline-start;
|
70
|
-
clear: inline-start;
|
71
|
-
|
72
|
-
@include govuk-media-query($from: tablet) {
|
73
|
-
padding-left: govuk-spacing(1);
|
74
|
-
padding-right: 0;
|
75
|
-
}
|
76
|
-
}
|
77
|
-
|
78
67
|
.gem-c-metadata__definition {
|
79
68
|
margin: 0;
|
80
69
|
|
@@ -85,11 +74,6 @@
|
|
85
74
|
}
|
86
75
|
}
|
87
76
|
|
88
|
-
.direction-rtl .gem-c-metadata .gem-c-metadata__definition,
|
89
|
-
.gem-c-metadata.direction-rtl .gem-c-metadata__definition {
|
90
|
-
float: inline-start;
|
91
|
-
}
|
92
|
-
|
93
77
|
.gem-c-metadata__toggle-wrap {
|
94
78
|
display: none;
|
95
79
|
}
|
@@ -147,3 +147,12 @@ examples:
|
|
147
147
|
data:
|
148
148
|
text: Button
|
149
149
|
aria_describedby: with_aria_describedby
|
150
|
+
with_form_attribute:
|
151
|
+
description: |
|
152
|
+
Buttons will usually be contained within their containing form, but sometimes it is desirable to have the button
|
153
|
+
outside the form with the `form` attribute pointing to the ID of the form. See
|
154
|
+
[The Mozilla dev docs on a button's `form` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#form)
|
155
|
+
for more information.
|
156
|
+
data:
|
157
|
+
text: With `form` argument
|
158
|
+
form: some_form_id
|
@@ -62,13 +62,3 @@ examples:
|
|
62
62
|
margin_bottom: 0
|
63
63
|
context:
|
64
64
|
dark_background: true
|
65
|
-
using_design_system_template:
|
66
|
-
description: |
|
67
|
-
This option allows the removal of top margin from the component so that it works within a [Design System page template](https://design-system.service.gov.uk/styles/page-template/default/index.html), where spacing above the title is already provided by padding on the wrapping div.
|
68
|
-
embed: |
|
69
|
-
<main class="govuk-main-wrapper">
|
70
|
-
<%= component %>
|
71
|
-
</main>
|
72
|
-
data:
|
73
|
-
title: My page title
|
74
|
-
margin_top: 0
|
@@ -25,7 +25,8 @@ module GovukPublishingComponents
|
|
25
25
|
:classes,
|
26
26
|
:aria_label,
|
27
27
|
:aria_controls,
|
28
|
-
:aria_describedby
|
28
|
+
:aria_describedby,
|
29
|
+
:form
|
29
30
|
|
30
31
|
def initialize(local_assigns)
|
31
32
|
@disable_ga4 = local_assigns[:disable_ga4]
|
@@ -58,6 +59,7 @@ module GovukPublishingComponents
|
|
58
59
|
@button_id = "button-id-#{SecureRandom.hex(4)}"
|
59
60
|
@aria_controls = local_assigns[:aria_controls]
|
60
61
|
@aria_describedby = local_assigns[:aria_describedby]
|
62
|
+
@form = local_assigns[:form]
|
61
63
|
|
62
64
|
if local_assigns.include?(:classes)
|
63
65
|
@classes = local_assigns[:classes].split(" ")
|
@@ -106,6 +108,7 @@ module GovukPublishingComponents
|
|
106
108
|
options[:aria][:controls] = aria_controls if aria_controls
|
107
109
|
options[:aria][:describedby] = aria_describedby if aria_describedby
|
108
110
|
options[:draggable] = false if link?
|
111
|
+
options[:form] = form if form
|
109
112
|
options
|
110
113
|
end
|
111
114
|
|
@@ -1,11 +1,10 @@
|
|
1
1
|
module GovukPublishingComponents
|
2
2
|
module Presenters
|
3
3
|
class SharedHelper
|
4
|
-
attr_reader :options, :
|
4
|
+
attr_reader :options, :margin_bottom, :heading_level, :classes
|
5
5
|
|
6
6
|
def initialize(local_assigns)
|
7
7
|
@options = local_assigns
|
8
|
-
@margin_top = @options[:margin_top] || nil
|
9
8
|
@margin_bottom = @options[:margin_bottom] || 3
|
10
9
|
@heading_level = @options[:heading_level] || 2
|
11
10
|
|
@@ -17,10 +16,6 @@ module GovukPublishingComponents
|
|
17
16
|
end
|
18
17
|
end
|
19
18
|
|
20
|
-
def get_margin_top
|
21
|
-
[*0..9].include?(@margin_top) ? "govuk-!-margin-top-#{margin_top}" : ""
|
22
|
-
end
|
23
|
-
|
24
19
|
def get_margin_bottom
|
25
20
|
[*0..9].include?(@margin_bottom) ? "govuk-!-margin-bottom-#{margin_bottom}" : "govuk-!-margin-bottom-3"
|
26
21
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk_publishing_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 51.
|
4
|
+
version: 51.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GOV.UK Dev
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-02-03 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: govuk_app_config
|