dxw_govuk_frontend_rails 3.10.2 → 3.11.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b45f829ef6c112b8acdc675c702ea6c5b2ed784f67afd8c46fb5fd1ab9e6515f
4
- data.tar.gz: cac2861100bd6e495f63cbf61792428d6dd86260ba6ac8a6499d7d4ddd7efcc8
3
+ metadata.gz: 53ce04369f5585d9d7e25d250a3e346746bf5b8541387d23b9debfa85996d034
4
+ data.tar.gz: 50c7eedd8c1c126a6f55873bdb8e9955747de10048909861a086c81b2ae0bef4
5
5
  SHA512:
6
- metadata.gz: 2bbc39c25ed2bb297c569524f56b4dd998d4363b27f6a861ffd888c2dd5babcb07f9722d72cc7c54c9604522591a8ac2eefed5527137bd11833ea00bcf8777b7
7
- data.tar.gz: 38df5dbcd807f25710609517b7aa8458824b09b0b7e33c04713adb18e9d3613fad3f63574ff2d450f32fbb8d51b8e950f767b3ce4ad3cd983e7026b4b5f2cf22
6
+ metadata.gz: 82eba76e269590ae83f405a02c03c76177d9d9bf35610e9f4a8b34a4e3550e5ab63f7d66c919744b5b404e08568af98924085f2c18fb17c1a38e8d33e96c958b
7
+ data.tar.gz: 68f8c51f435994ece6f8d8e219e3c369cfa4579e42cc2fb5f55d272cfd4504563c44f742c23595a7673d74ea6bdc0d05c34105d9d0a38054e31001468458f403
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dxw_govuk_frontend_rails (3.10.2)
4
+ dxw_govuk_frontend_rails (3.11.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -1,91 +1,112 @@
1
- # GOVUK Frontend for Rails
1
+ # GOV.UK Frontend for Rails
2
2
 
3
3
  ## Read this first
4
4
 
5
- Although this gem makes it super easy to add the GOVUK Frontend to your
6
- Rails applications, we would recommend using it as a guide to add the
7
- GOVUK Frontend yourself.
5
+ Although this gem makes it super easy to add the GOV.UK Frontend to your Rails
6
+ applications, we would recommend using it as a guide to add the GOV.UK Frontend
7
+ yourself.
8
8
 
9
- ## About Adds the GOVUK Frontend for Rails using the asset pipeline.
9
+ ## About
10
+
11
+ Adds the GOV.UK Frontend for Rails using the asset pipeline.
10
12
 
11
13
  https://github.com/alphagov/govuk-frontend
12
14
 
13
15
  ## Breaking Changes in v3.0.0
14
16
 
15
- This release of the GOVUK Frontend has breaking changes! Do not update to this
17
+ This release of the GOV.UK Frontend has breaking changes! Do not update to this
16
18
  version until you have read and understood:
17
19
 
18
- You will not be required to updated any file paths with govuk as we take care of
19
- that for you, all others changes will need to be managed:
20
+ You will not be required to updated any file paths with `govuk` as we take care
21
+ of that for you, all others changes will need to be managed:
20
22
 
21
23
  https://github.com/alphagov/govuk-frontend/releases/tag/v3.0.0
22
24
 
23
25
  ## Limitations
24
26
 
25
- This gem does not include the ie8 version of GOVUK Frontend, as the service
26
- standard no longer requires it:
27
+ This gem does not include the `ie8` version of GOV.UK Frontend, as the service
28
+ standard no longer requires support for Internet Explorer versions less than 11:
27
29
 
28
30
  https://www.gov.uk/service-manual/technology/designing-for-different-browsers-and-devices
29
31
 
30
- This gem and its documentation cannot tell you how to use the GOVUK effectively,
31
- see the GOVUK Design System documentation for that:
32
+ This gem and its documentation cannot tell you how to use the GOV.UK patterns
33
+ effectively, see the GOV.UK Design System documentation for that:
34
+
35
+ https://design-system.service.gov.uk/
32
36
 
33
- https://design-system.service.gov.uk/ ## Installation
37
+ ## Installation
34
38
 
35
39
  Add this line to your application's Gemfile:
36
40
 
37
- ```ruby gem 'dxw_govuk_frontend_rails' ```
41
+ ```ruby
42
+ gem 'dxw_govuk_frontend_rails'
43
+ ```
38
44
 
39
45
  And then execute:
40
46
 
41
- $ bundle
47
+ ```
48
+ $ bundle
49
+ ```
50
+
51
+ ## Usage
42
52
 
43
- ## Usage Your Rails app will need to have sass enabled.
53
+ Your Rails app will need to have SCSS enabled.
54
+
55
+ **IMPORTANT: You must not use this library without changes if the service you
56
+ are building is not on GOV.UK. Read and understand the guidance here:**
57
+
58
+ https://www.gov.uk/service-manual/design/making-your-service-look-like-govuk#if-your-service-isnt-on-govuk
44
59
 
45
60
  ### Basic usage
46
61
 
47
- If the service you are building does not need to modify or extend the GOVUK
48
- Frontend all you need to do is import the main sass and javascript files into
62
+ If the service you are building does not need to modify or extend the GOV.UK
63
+ Frontend, all you need to do is import the main SCSS and JavaScript files into
49
64
  your Rails app:
50
65
 
51
- - create a sass file in your application: ```
52
- app/assets/stylesheets/govuk_frontend_rails.scss ```
53
- - import the styles into `govuk_frontend_rails.scss`: ```sass @import
54
- "govuk-frontend-rails"; ```
55
- - require the `govuk-frontend-rails.scss` file in `application.css` or
56
- equivalent:
66
+ - create a SCSS file in your application:
57
67
 
58
- ``` *= require govuk_frontend_rails ```
68
+ `app/assets/stylesheets/govuk_frontend_rails.scss`
59
69
 
60
- - require the javascript into `app/assets/javascripts/application.js`:
70
+ - import the styles into `govuk_frontend_rails.scss`:
61
71
 
62
- ``` //= require govuk_frontend_rails ```
63
- - initialise the GOVUK Frontend either in a .js file on in your application
72
+ `@import "govuk-frontend-rails";`
73
+
74
+ - import the `govuk-frontend-rails.scss` file in the comment block in
75
+ `app/assets/stylesheets/application.css` or equivalent:
76
+
77
+ `*= require govuk_frontend_rails`
78
+
79
+ - import the JavaScript in the comment block of
80
+ `app/assets/javascripts/application.js`:
81
+
82
+ `//= require govuk_frontend_rails`
83
+
84
+ - initialise the GOV.UK Frontend either in a .js file or in your application
64
85
  layout:
65
86
 
66
- ```javascript window.onload = function() { window.GOVUKFrontend.initAll() }; ```
67
- - update your application markup to use the GOVUK Frontend class names
87
+ `window.onload = function() { window.GOVUKFrontend.initAll() };`
68
88
 
69
- IMPORTANT: You cannot use the GOVUK Frontend without changes if the service you
70
- are building is not on GOV.UK, read and understand the guidance here:
89
+ - update your application markup to use the GOV.UK Frontend class names
71
90
 
72
- https://www.gov.uk/service-manual/design/making-your-service-look-like-govuk#if-your-service-isnt-on-govuk
91
+ ## Tracking GOV.UK Frontend versions
73
92
 
74
- ## Tracking version We aim to tracking the version of GOVUK Frontend.
93
+ We aim to track the latest version of GOV.UK Frontend but we may fall behind.
94
+ Opening an issue if we are behind on a new release would be helpful, or open a
95
+ PR to update to the latest release!
75
96
 
76
- ## Updating to a new Version of GOVUK Frontend
97
+ ## Updating to a new version of GOV.UK Frontend
77
98
 
78
- When a new version of the GOVUK Frontend is released:
99
+ When a new version of the GOV.UK Frontend is released:
79
100
 
80
- - make a new branch with the GOVUK Frontend version number
101
+ - make a new branch with the GOV.UK Frontend version number
81
102
  - set the new version number in `package.json` and
82
103
  `lib/dxw_govuk_frontend_rails/version.rb`
83
- - run `npm update` to get the new release of the GOVUK Frontend
104
+ - run `npm update` to get the new release of the GOV.UK Frontend
84
105
  - run `bundle exec rake` to compile the new assets
85
106
  - commit the changes
86
- - tag with the same release number as GOVUK Frontend
107
+ - tag with the same release number as GOV.UK Frontend
87
108
  - push the change
88
109
  - push the tag
89
110
  - merge your branch
90
111
  - make a new release of the tag on GitHub
91
- - GitHub acitons will build the gem and push to Rubygems
112
+ - GitHub actions will build the gem and push to RubyGems
@@ -1,3 +1,3 @@
1
1
  module DxwGovukFrontendRails
2
- VERSION = "3.10.2"
2
+ VERSION = "3.11.0"
3
3
  end
data/package-lock.json CHANGED
@@ -5,9 +5,9 @@
5
5
  "requires": true,
6
6
  "dependencies": {
7
7
  "govuk-frontend": {
8
- "version": "3.10.2",
9
- "resolved": "https://registry.npmjs.org/govuk-frontend/-/govuk-frontend-3.10.2.tgz",
10
- "integrity": "sha512-MpMymgLsKoMw40MggZ0XLCAj1FY5N2s8Pf3aQR+k0cZOsegjLsnejxNfEB9qEl9jcma2fiiVcvsEZ+Ipo+Oo2g=="
8
+ "version": "3.11.0",
9
+ "resolved": "https://registry.npmjs.org/govuk-frontend/-/govuk-frontend-3.11.0.tgz",
10
+ "integrity": "sha512-1hW/3etYBtKPM+PNdWVOijvWVI3mpYL8eb7WLTtlh/Qxf2mCp6LkCsZk9I034n4EJBYQ5jlUWsUlTOOIypftpg=="
11
11
  }
12
12
  }
13
13
  }
data/package.json CHANGED
@@ -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.10.2"
24
+ "govuk-frontend": "3.11.0"
25
25
  }
26
26
  }
@@ -1498,7 +1498,7 @@ function CharacterCount ($module) {
1498
1498
  this.$module = $module;
1499
1499
  this.$textarea = $module.querySelector('.govuk-js-character-count');
1500
1500
  if (this.$textarea) {
1501
- this.$countMessage = $module.querySelector('[id=' + this.$textarea.id + '-info]');
1501
+ this.$countMessage = $module.querySelector('[id="' + this.$textarea.id + '-info"]');
1502
1502
  }
1503
1503
  }
1504
1504
 
@@ -6,6 +6,7 @@
6
6
  @import "button/index";
7
7
  @import "checkboxes/index";
8
8
  @import "character-count/index";
9
+ @import "cookie-banner/index";
9
10
  @import "summary-list/index";
10
11
  @import "date-input/index";
11
12
  @import "details/index";
@@ -29,6 +29,8 @@
29
29
  position: relative;
30
30
  width: 100%;
31
31
  margin-top: 0;
32
+ margin-right: 0;
33
+ margin-left: 0;
32
34
  @include govuk-responsive-margin(6, "bottom", $adjustment: $button-shadow-size); // s2
33
35
  padding: (govuk-spacing(2) - $govuk-border-width-form-element) govuk-spacing(2) (govuk-spacing(2) - $govuk-border-width-form-element - ($button-shadow-size / 2)); // s1
34
36
  border: $govuk-border-width-form-element solid transparent;
@@ -14,6 +14,7 @@
14
14
  }
15
15
 
16
16
  .govuk-character-count__message {
17
+ @include govuk-font($size: false, $tabular: true);
17
18
  margin-top: 0;
18
19
  margin-bottom: 0;
19
20
  }
@@ -0,0 +1,2 @@
1
+ @import "../../base";
2
+ @import "./index";
@@ -0,0 +1,51 @@
1
+ @include govuk-exports("govuk/component/cookie-banner") {
2
+
3
+ // This needs to be kept in sync with the header component's styles
4
+ $border-bottom-width: govuk-spacing(2);
5
+
6
+ .govuk-cookie-banner {
7
+ @include govuk-font($size: 19);
8
+
9
+ padding-top: govuk-spacing(4);
10
+ // The component does not set bottom spacing.
11
+ // The bottom spacing should be created by the items inside the component.
12
+
13
+ // Visually separate the cookie banner from content underneath
14
+ // when user changes colours in their browser.
15
+ border-bottom: $border-bottom-width solid transparent;
16
+
17
+ background-color: govuk-colour("light-grey", $legacy: "grey-3");
18
+ }
19
+
20
+ // Support older browsers which don't hide elements with the `hidden` attribute
21
+ // when user hides the whole cookie banner with a 'Hide' button.
22
+ .govuk-cookie-banner[hidden] {
23
+ display: none;
24
+ }
25
+
26
+ .govuk-cookie-banner__message {
27
+ // Remove the extra height added by the separator border.
28
+ margin-bottom: -$border-bottom-width;
29
+
30
+ &[hidden] {
31
+ // Support older browsers which don't hide elements with the `hidden` attribute
32
+ // when the visibility of cookie and replacement messages is toggled.
33
+ display: none;
34
+ }
35
+
36
+ &:focus {
37
+ // Remove the native visible focus indicator when the element is programmatically focused.
38
+ //
39
+ // The focused cookie banner is the first element on the page and the last thing the user
40
+ // interacted with prior to it gaining focus.
41
+ // We therefore assume that moving focus to it is not going to surprise users, and that giving
42
+ // it a visible focus indicator could be more confusing than helpful, especially as the
43
+ // element is not normally keyboard operable.
44
+ //
45
+ // We have flagged this in the research section of the guidance as something to monitor.
46
+ //
47
+ // A related discussion: https://github.com/w3c/wcag/issues/1001
48
+ outline: none;
49
+ }
50
+ }
51
+ }
@@ -47,4 +47,25 @@
47
47
  display: table-caption;
48
48
  text-align: left;
49
49
  }
50
+
51
+ // Modifiers that make captions look more like their equivalent headings
52
+
53
+ .govuk-table__caption--xl {
54
+ @include govuk-font($size: 48, $weight: bold);
55
+ margin-bottom: govuk-spacing(3);
56
+ }
57
+
58
+ .govuk-table__caption--l {
59
+ @include govuk-font($size: 36, $weight: bold);
60
+ margin-bottom: govuk-spacing(3);
61
+ }
62
+
63
+ .govuk-table__caption--m {
64
+ @include govuk-font($size: 24, $weight: bold);
65
+ margin-bottom: govuk-spacing(3);
66
+ }
67
+
68
+ .govuk-table__caption--s {
69
+ @include govuk-font($size: 19, $weight: bold);
70
+ }
50
71
  }
@@ -1,3 +1,4 @@
1
+ @import "button-group";
1
2
  @import "form-group";
2
3
  @import "grid";
3
4
  @import "main-wrapper";
@@ -0,0 +1,94 @@
1
+ @import "../base";
2
+
3
+ @include govuk-exports("govuk/objects/button-group") {
4
+ // Button groups can be used to group buttons and links together as a group.
5
+ //
6
+ // Within a button group:
7
+ //
8
+ // - links are styled to line up visually with the buttons, including being
9
+ // centre-aligned on mobile
10
+ // - spacing between the buttons and links is handled automatically, including
11
+ // when they wrap across multiple lines
12
+ .govuk-button-group {
13
+ $horizontal-gap: govuk-spacing(3);
14
+ $vertical-gap: govuk-spacing(3);
15
+
16
+ // These need to be kept in sync with the button component's styles
17
+ $button-padding: govuk-spacing(2);
18
+ $button-shadow-size: $govuk-border-width-form-element;
19
+
20
+ $link-spacing: govuk-spacing(1);
21
+
22
+ @include govuk-responsive-margin(6, "bottom", $adjustment: $vertical-gap * -1);
23
+
24
+ // Flexbox is used to center-align links on mobile, align everything along
25
+ // the baseline on tablet and above, and to removes extra whitespace that
26
+ // we'd get between the buttons and links because they're inline-blocks.
27
+ //
28
+ // Ideally we'd use `gap` with flexbox rather than having to do it all with
29
+ // margins, but unfortunately the support isn't there (yet) and @supports
30
+ // doesn't play nicely with it
31
+ // (https://github.com/w3c/csswg-drafts/issues/3559)
32
+ display: -webkit-box;
33
+ display: -ms-flexbox;
34
+ display: flex;
35
+ -webkit-box-orient: vertical;
36
+ -webkit-box-direction: normal;
37
+ -ms-flex-direction: column;
38
+ flex-direction: column;
39
+ -webkit-box-align: center;
40
+ -ms-flex-align: center;
41
+ align-items: center;
42
+
43
+ // Give links within the button group the same font-size and line-height
44
+ // as buttons.
45
+ //
46
+ // Because we want the focus state to be tight around the link text, we use
47
+ // margins where the buttons would use padding.
48
+ .govuk-link {
49
+ @include govuk-font($size: 19, $line-height: 19px);
50
+ display: inline-block;
51
+ // Prevent links overflowing their container in IE10/11 because of bug
52
+ // with align-items: center
53
+ max-width: 100%;
54
+ margin-top: $link-spacing;
55
+ margin-bottom: $link-spacing + $vertical-gap;
56
+ text-align: center;
57
+ }
58
+
59
+ // Reduce the bottom margin to the size of the vertical gap (accommodating
60
+ // the button shadow) – the 'lost' margin is moved to the button-group.
61
+ .govuk-button {
62
+ margin-bottom: $vertical-gap + $button-shadow-size;
63
+ }
64
+
65
+ // On tablet and above, we also introduce a 'column gap' between the
66
+ // buttons and links in each row and left align links
67
+ @include govuk-media-query($from: tablet) {
68
+ // Cancel out the column gap for the last item in each row
69
+ margin-right: ($horizontal-gap * -1);
70
+
71
+ -webkit-box-orient: horizontal;
72
+
73
+ -webkit-box-direction: normal;
74
+
75
+ -ms-flex-direction: row;
76
+
77
+ flex-direction: row;
78
+ -ms-flex-wrap: wrap;
79
+ flex-wrap: wrap;
80
+ -webkit-box-align: baseline;
81
+ -ms-flex-align: baseline;
82
+ align-items: baseline;
83
+
84
+ .govuk-button,
85
+ .govuk-link {
86
+ margin-right: $horizontal-gap;
87
+ }
88
+
89
+ .govuk-link {
90
+ text-align: left;
91
+ }
92
+ }
93
+ }
94
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dxw_govuk_frontend_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.10.2
4
+ version: 3.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - mec
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2020-12-23 00:00:00.000000000 Z
12
+ date: 2021-04-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -93,6 +93,8 @@ files:
93
93
  - vendor/assets/stylesheets/components/character-count/_index.scss
94
94
  - vendor/assets/stylesheets/components/checkboxes/_checkboxes.scss
95
95
  - vendor/assets/stylesheets/components/checkboxes/_index.scss
96
+ - vendor/assets/stylesheets/components/cookie-banner/_cookie-banner.scss
97
+ - vendor/assets/stylesheets/components/cookie-banner/_index.scss
96
98
  - vendor/assets/stylesheets/components/date-input/_date-input.scss
97
99
  - vendor/assets/stylesheets/components/date-input/_index.scss
98
100
  - vendor/assets/stylesheets/components/details/_details.scss
@@ -163,6 +165,7 @@ files:
163
165
  - vendor/assets/stylesheets/helpers/_typography.scss
164
166
  - vendor/assets/stylesheets/helpers/_visually-hidden.scss
165
167
  - vendor/assets/stylesheets/objects/_all.scss
168
+ - vendor/assets/stylesheets/objects/_button-group.scss
166
169
  - vendor/assets/stylesheets/objects/_form-group.scss
167
170
  - vendor/assets/stylesheets/objects/_grid.scss
168
171
  - vendor/assets/stylesheets/objects/_main-wrapper.scss
@@ -218,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
218
221
  - !ruby/object:Gem::Version
219
222
  version: '0'
220
223
  requirements: []
221
- rubygems_version: 3.1.4
224
+ rubygems_version: 3.2.15
222
225
  signing_key:
223
226
  specification_version: 4
224
227
  summary: Adds the GOVUK frontend to a Rails application that uses the Asset Pipeline.