dxw_govuk_frontend_rails 3.2.0 → 3.3.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/Gemfile.lock +1 -1
- data/lib/dxw_govuk_frontend_rails/version.rb +1 -1
- data/package-lock.json +3 -3
- data/package.json +2 -2
- data/vendor/assets/javascripts/govuk_frontend_rails.js +29 -2
- data/vendor/assets/stylesheets/components/header/_header.scss +1 -0
- data/vendor/assets/stylesheets/components/input/_input.scss +3 -0
- data/vendor/assets/stylesheets/components/select/_select.scss +3 -0
- data/vendor/assets/stylesheets/components/warning-text/_warning-text.scss +10 -9
- data/vendor/assets/stylesheets/overrides/_display.scss +4 -0
- 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: 4d4acfd39c6602f72f50fd8e2747ac3f99708422eb74c9083f968d05d735135d
|
4
|
+
data.tar.gz: 8696f9c16710bedbe45ceef93cebcfce11579a42a30ffb5cabc39e00f6d7f78b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79005a142ab72a650b9a8259faa9106c7e0aeda3ae180df70ced6732ff4d794ce23effd8e85f89d7f3c9a2880b347b04e006507b91cfa3626836a1bddaa77103
|
7
|
+
data.tar.gz: 74ab6084a3189937c9825bceeb4a9ddf0c94603a32579733f396bbc9cb8061d24bb4e009c431d294afd08c15612918bd370841a1181c9020cb5e2ddd602ebcaf
|
data/Gemfile.lock
CHANGED
data/package-lock.json
CHANGED
@@ -5,9 +5,9 @@
|
|
5
5
|
"requires": true,
|
6
6
|
"dependencies": {
|
7
7
|
"govuk-frontend": {
|
8
|
-
"version": "3.
|
9
|
-
"resolved": "https://registry.npmjs.org/govuk-frontend/-/govuk-frontend-3.
|
10
|
-
"integrity": "sha512-
|
8
|
+
"version": "3.3.0",
|
9
|
+
"resolved": "https://registry.npmjs.org/govuk-frontend/-/govuk-frontend-3.3.0.tgz",
|
10
|
+
"integrity": "sha512-ncOGTAV6mzz1CPBlr/UGETiG3IO6P3b0CvSI0wxBz7Uo0A/6jttLoxkvuYXju2oNA2yqRh2NjD1zJUOP3Q32CQ=="
|
11
11
|
}
|
12
12
|
}
|
13
13
|
}
|
data/package.json
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
"lib": "lib"
|
8
8
|
},
|
9
9
|
"scripts": {
|
10
|
-
"test": "
|
10
|
+
"test": "npx node-sass ./vendor/assets/stylesheets/govuk-frontend-rails.scss /tmp/govuk-frontend-rails.css"
|
11
11
|
},
|
12
12
|
"repository": {
|
13
13
|
"type": "git",
|
@@ -21,6 +21,6 @@
|
|
21
21
|
},
|
22
22
|
"homepage": "https://github.com/mec/dxw_govuk_frontend_rails#readme",
|
23
23
|
"dependencies": {
|
24
|
-
"govuk-frontend": "3.
|
24
|
+
"govuk-frontend": "3.3.0"
|
25
25
|
}
|
26
26
|
}
|
@@ -1873,7 +1873,9 @@ ErrorSummary.prototype.getFragmentFromUrl = function (url) {
|
|
1873
1873
|
*
|
1874
1874
|
* Returns the first element that exists from this list:
|
1875
1875
|
*
|
1876
|
-
* - The `<legend>` associated with the closest `<fieldset>` ancestor
|
1876
|
+
* - The `<legend>` associated with the closest `<fieldset>` ancestor, as long
|
1877
|
+
* as the top of it is no more than half a viewport height away from the
|
1878
|
+
* bottom of the input
|
1877
1879
|
* - The first `<label>` that is associated with the input using for="inputId"
|
1878
1880
|
* - The closest parent `<label>`
|
1879
1881
|
*
|
@@ -1888,7 +1890,32 @@ ErrorSummary.prototype.getAssociatedLegendOrLabel = function ($input) {
|
|
1888
1890
|
var legends = $fieldset.getElementsByTagName('legend');
|
1889
1891
|
|
1890
1892
|
if (legends.length) {
|
1891
|
-
|
1893
|
+
var $candidateLegend = legends[0];
|
1894
|
+
|
1895
|
+
// If the input type is radio or checkbox, always use the legend if there
|
1896
|
+
// is one.
|
1897
|
+
if ($input.type === 'checkbox' || $input.type === 'radio') {
|
1898
|
+
return $candidateLegend
|
1899
|
+
}
|
1900
|
+
|
1901
|
+
// For other input types, only scroll to the fieldset’s legend (instead of
|
1902
|
+
// the label associated with the input) if the input would end up in the
|
1903
|
+
// top half of the screen.
|
1904
|
+
//
|
1905
|
+
// This should avoid situations where the input either ends up off the
|
1906
|
+
// screen, or obscured by a software keyboard.
|
1907
|
+
var legendTop = $candidateLegend.getBoundingClientRect().top;
|
1908
|
+
var inputRect = $input.getBoundingClientRect();
|
1909
|
+
|
1910
|
+
// If the browser doesn't support Element.getBoundingClientRect().height
|
1911
|
+
// or window.innerHeight (like IE8), bail and just link to the label.
|
1912
|
+
if (inputRect.height && window.innerHeight) {
|
1913
|
+
var inputBottom = inputRect.top + inputRect.height;
|
1914
|
+
|
1915
|
+
if (inputBottom - legendTop < window.innerHeight / 2) {
|
1916
|
+
return $candidateLegend
|
1917
|
+
}
|
1918
|
+
}
|
1892
1919
|
}
|
1893
1920
|
}
|
1894
1921
|
|
@@ -13,6 +13,9 @@
|
|
13
13
|
box-sizing: border-box; // should this be global?
|
14
14
|
max-width: 100%;
|
15
15
|
height: 40px;
|
16
|
+
@if $govuk-typography-use-rem {
|
17
|
+
height: govuk-px-to-rem(40px);
|
18
|
+
}
|
16
19
|
padding: govuk-spacing(1); // was 5px 4px 4px - size of it should be adjusted to match other form elements
|
17
20
|
border: $govuk-border-width-form-element solid $govuk-input-border-colour;
|
18
21
|
|
@@ -5,9 +5,6 @@
|
|
5
5
|
@include govuk-exports("govuk/component/warning-text") {
|
6
6
|
|
7
7
|
.govuk-warning-text {
|
8
|
-
@include govuk-font($size: 19);
|
9
|
-
@include govuk-text-colour;
|
10
|
-
|
11
8
|
position: relative;
|
12
9
|
@include govuk-responsive-margin(6, "bottom");
|
13
10
|
padding: govuk-spacing(2) 0;
|
@@ -23,13 +20,15 @@
|
|
23
20
|
display: inline-block;
|
24
21
|
|
25
22
|
position: absolute;
|
26
|
-
top: 50%;
|
27
23
|
left: 0;
|
28
24
|
|
29
|
-
min-width:
|
25
|
+
min-width: 29px;
|
30
26
|
min-height: 29px;
|
31
|
-
margin-top: -
|
32
|
-
|
27
|
+
margin-top: -7px;
|
28
|
+
|
29
|
+
@include govuk-media-query($from: tablet) {
|
30
|
+
margin-top: -5px;
|
31
|
+
}
|
33
32
|
|
34
33
|
// When a user customises their colours the background colour will often be removed.
|
35
34
|
// Adding a border to the component keeps it's shape as a circle.
|
@@ -39,7 +38,7 @@
|
|
39
38
|
color: govuk-colour("white");
|
40
39
|
background: govuk-colour("black");
|
41
40
|
|
42
|
-
font-size:
|
41
|
+
font-size: 30px;
|
43
42
|
line-height: 29px;
|
44
43
|
|
45
44
|
text-align: center;
|
@@ -53,7 +52,9 @@
|
|
53
52
|
}
|
54
53
|
|
55
54
|
.govuk-warning-text__text {
|
55
|
+
@include govuk-font($size: 19, $weight: bold);
|
56
|
+
@include govuk-text-colour;
|
56
57
|
display: block;
|
57
|
-
padding-left:
|
58
|
+
padding-left: 45px;
|
58
59
|
}
|
59
60
|
}
|