govuk-components 3.1.3 → 3.2.0b1
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/README.md +10 -1
- data/app/components/govuk_component/breadcrumbs_component.rb +1 -1
- data/app/components/govuk_component/footer_component.rb +8 -3
- data/app/components/govuk_component/header_component.html.erb +1 -1
- data/app/components/govuk_component/header_component.rb +1 -0
- data/app/helpers/govuk_link_helper.rb +1 -5
- data/lib/govuk/components/version.rb +1 -1
- metadata +6 -7
- data/MIT-LICENSE +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: baf575169df70b76806ee48f46c1043b2923df01f0f03c60fe80b6a2ed7b2e47
|
4
|
+
data.tar.gz: 9cfdb4dc1d0fbd2e1bed77df6efc633f2f1a33ee068664e1562e523e4088f761
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e27fccc13b9c2d7d590f75f0617037ad9be59598d38a7422d7b93e61ec5c1ca021b31f8bf4ad075ebe9e3869038cff7696e19c119398c7aa58890a585e1e976c
|
7
|
+
data.tar.gz: 55d4ac92ddab808a1c33d360172f318bf56eb801c0b44532920c1b91f57efe7d625cf0ab31828443c96e1568d59eb8909f44cc290093f823a3e6c4b6be69d7bd
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
[](https://rubygems.org/gems/govuk-components)
|
7
7
|
[](https://codeclimate.com/github/DFE-Digital/govuk-components/test_coverage)
|
8
8
|
[](https://github.com/DFE-Digital/govuk-components/blob/main/LICENSE)
|
9
|
-
[](https://design-system.service.gov.uk)
|
10
10
|
[](https://weblog.rubyonrails.org/releases/)
|
11
11
|
[](https://www.ruby-lang.org/en/downloads/)
|
12
12
|
|
@@ -14,6 +14,15 @@ This gem provides a suite of reusable components for the [GOV.UK Design System](
|
|
14
14
|
|
15
15
|
It aims to implement the functionality from the original Nunjucks macros in a way that will feel more familiar to Rails developers. Blocks are preferred over strings of HTML, beneath the surface each component is just a Ruby object, everything is inheritable and overrideable.
|
16
16
|
|
17
|
+
## Documentation
|
18
|
+
|
19
|
+
The gem comes with [a full guide](https://govuk-components.netlify.app/) that
|
20
|
+
covers most aspects of day-to-day use, along with code and output examples. The
|
21
|
+
examples in the guide (and the guide itself) are built using the components,
|
22
|
+
so it will always be up to date.
|
23
|
+
|
24
|
+
[](https://app.netlify.com/sites/govuk-components/deploys)
|
25
|
+
|
17
26
|
## What’s included?
|
18
27
|
|
19
28
|
All of the non-form components from the GOV.UK Design System are implemented by this library as ViewComponents. Form components are implemented by the [GOV.UK Form Builder](https://govuk-form-builder.netlify.app/).
|
@@ -65,9 +65,14 @@ private
|
|
65
65
|
def build_meta_links(links)
|
66
66
|
return [] if links.blank?
|
67
67
|
|
68
|
-
|
69
|
-
|
70
|
-
|
68
|
+
case links
|
69
|
+
when Array
|
70
|
+
links.map { |link| raw(link_to(link[:text], link[:href], class: %w(govuk-footer__link), **link.fetch(:attr, {}))) }
|
71
|
+
when Hash
|
72
|
+
links.map { |text, href| raw(link_to(text, href, class: %w(govuk-footer__link))) }
|
73
|
+
else
|
74
|
+
fail(ArgumentError, 'meta links must be a hash or array of hashes') unless links.is_a?(Hash)
|
75
|
+
end
|
71
76
|
end
|
72
77
|
|
73
78
|
def default_licence
|
@@ -37,7 +37,7 @@
|
|
37
37
|
|
38
38
|
<% if navigation_items.any? %>
|
39
39
|
<%= tag.nav(**navigation_html_attributes) do %>
|
40
|
-
<%= tag.button("Menu", type: "button", class: %w(govuk-header__menu-button govuk-js-header-toggle), aria: { controls: "navigation", label: menu_button_label }) %>
|
40
|
+
<%= tag.button("Menu", type: "button", class: %w(govuk-header__menu-button govuk-js-header-toggle), hidden: true, aria: { controls: "navigation", label: menu_button_label }) %>
|
41
41
|
<ul id="navigation" class="govuk-header__navigation-list">
|
42
42
|
<% navigation_items.each do |item| %>
|
43
43
|
<%= item %>
|
@@ -56,11 +56,7 @@ module GovukLinkHelper
|
|
56
56
|
html_options = build_html_options(extra_options, style: :button)
|
57
57
|
|
58
58
|
if block_given?
|
59
|
-
|
60
|
-
button_to(name.merge(html_options), &block)
|
61
|
-
else
|
62
|
-
button_to(name, html_options, &block)
|
63
|
-
end
|
59
|
+
button_to(options, html_options, &block)
|
64
60
|
else
|
65
61
|
button_to(name, options, html_options)
|
66
62
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk-components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.2.0b1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DfE developers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|
@@ -260,14 +260,14 @@ dependencies:
|
|
260
260
|
requirements:
|
261
261
|
- - "~>"
|
262
262
|
- !ruby/object:Gem::Version
|
263
|
-
version: 3.
|
263
|
+
version: 3.30.0
|
264
264
|
type: :development
|
265
265
|
prerelease: false
|
266
266
|
version_requirements: !ruby/object:Gem::Requirement
|
267
267
|
requirements:
|
268
268
|
- - "~>"
|
269
269
|
- !ruby/object:Gem::Version
|
270
|
-
version: 3.
|
270
|
+
version: 3.30.0
|
271
271
|
- !ruby/object:Gem::Dependency
|
272
272
|
name: rubypants
|
273
273
|
requirement: !ruby/object:Gem::Requirement
|
@@ -360,7 +360,6 @@ executables: []
|
|
360
360
|
extensions: []
|
361
361
|
extra_rdoc_files: []
|
362
362
|
files:
|
363
|
-
- MIT-LICENSE
|
364
363
|
- README.md
|
365
364
|
- Rakefile
|
366
365
|
- app/components/govuk_component.rb
|
@@ -439,9 +438,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
439
438
|
version: '0'
|
440
439
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
441
440
|
requirements:
|
442
|
-
- - "
|
441
|
+
- - ">"
|
443
442
|
- !ruby/object:Gem::Version
|
444
|
-
version:
|
443
|
+
version: 1.3.1
|
445
444
|
requirements: []
|
446
445
|
rubygems_version: 3.1.6
|
447
446
|
signing_key:
|
data/MIT-LICENSE
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
Copyright 2020 Peter Yates
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|