govuk_publishing_components 21.57.1 → 21.58.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/Rakefile +6 -1
- data/app/assets/javascripts/govuk_publishing_components/components/details.js +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_list.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +7 -2
- data/app/controllers/govuk_publishing_components/component_guide_controller.rb +1 -0
- data/app/views/govuk_publishing_components/component_guide/index.html.erb +5 -6
- data/app/views/govuk_publishing_components/components/_list.html.erb +26 -0
- data/app/views/govuk_publishing_components/components/docs/list.yml +64 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +19 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e165b9cdf4f92f02644b2e82c82c8c6b116379b86d5d4508437dc8ccfd25bd81
|
|
4
|
+
data.tar.gz: 2be44d5b0942debce73048f3bec3786cc9398ae37de322016b253ccfe220442a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9a3a06af1b35ecdc351c4d1da7b65ac95bd601a9b2f6f0049e17a84b15768872e478b44c170d2e9579992fd0ca092d60c4c91c049ed2edf48c0e0a1e9f9e7b44
|
|
7
|
+
data.tar.gz: 457fceebbb07d07f8afa3c0ab11c7057659a7df2e6d7a409a472ecfdb5a821147cd6918c4568ded4a063a9c53ef5a9764543c0de507085f62b33f1f0aca91df1
|
data/Rakefile
CHANGED
|
@@ -20,7 +20,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
|
20
20
|
var detailsClick = detailsComponent.querySelector('[data-details-track-click]')
|
|
21
21
|
var that = this
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
detailsClick.addEventListener('click', function (event) {
|
|
24
24
|
that.trackDefault(detailsComponent)
|
|
25
25
|
})
|
|
26
26
|
}
|
|
@@ -37,7 +37,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
|
37
37
|
trackOptions = {}
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
trackOptions
|
|
40
|
+
trackOptions.label = componentStatus
|
|
41
41
|
|
|
42
42
|
if (trackAction && trackCategory) {
|
|
43
43
|
window.GOVUK.analytics.trackEvent(trackCategory, trackAction, trackOptions)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "govuk/components/list/list";
|
|
@@ -9,6 +9,7 @@ $large-input-size: 50px;
|
|
|
9
9
|
.gem-c-search__label {
|
|
10
10
|
@include govuk-font($size: 19, $line-height: $input-size);
|
|
11
11
|
display: block;
|
|
12
|
+
background: govuk-colour("white");
|
|
12
13
|
|
|
13
14
|
h1 {
|
|
14
15
|
@include govuk-font($size: 19, $line-height: $input-size);
|
|
@@ -17,8 +18,10 @@ $large-input-size: 50px;
|
|
|
17
18
|
|
|
18
19
|
.js-enabled & {
|
|
19
20
|
position: absolute;
|
|
20
|
-
left:
|
|
21
|
-
top:
|
|
21
|
+
left: 2px;
|
|
22
|
+
top: 2px;
|
|
23
|
+
bottom: 2px;
|
|
24
|
+
padding-left: govuk-spacing(3);
|
|
22
25
|
z-index: 1;
|
|
23
26
|
color: $govuk-secondary-text-colour;
|
|
24
27
|
}
|
|
@@ -201,6 +204,8 @@ $large-input-size: 50px;
|
|
|
201
204
|
.gem-c-search--separate-label {
|
|
202
205
|
.gem-c-search__label {
|
|
203
206
|
position: relative;
|
|
207
|
+
top: auto;
|
|
204
208
|
left: auto;
|
|
209
|
+
padding-left: 0;
|
|
205
210
|
}
|
|
206
211
|
}
|
|
@@ -85,6 +85,7 @@ module GovukPublishingComponents
|
|
|
85
85
|
|
|
86
86
|
files = Dir["#{@application_path}/app/views/**/*.html.erb"]
|
|
87
87
|
files.concat Dir["#{@application_path}/app/**/*.rb"]
|
|
88
|
+
files.concat Dir["#{@application_path}/lib/**/*.rb"]
|
|
88
89
|
|
|
89
90
|
files.each do |file|
|
|
90
91
|
data = File.read(file)
|
|
@@ -2,12 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<div class="component-markdown">
|
|
4
4
|
<p>Components are packages of template, style, behaviour and documentation that live in your application.</p>
|
|
5
|
-
<p>
|
|
6
|
-
<ul>
|
|
7
|
-
<li><a href="https://github.com/alphagov/govuk_publishing_components/blob/master/docs/component_principles.md">meet the component principles</a></li>
|
|
8
|
-
<li><a href="https://github.com/alphagov/govuk_publishing_components/blob/master/docs/component_conventions.md">follow component conventions</a></li>
|
|
9
|
-
</ul>
|
|
10
|
-
<p>See the <a href="https://github.com/alphagov/govuk_publishing_components">govuk_publishing_components gem</a> for further details, or <a href="https://docs.publishing.service.gov.uk/manual/components.html#component-guides">a list of all component guides</a>.</p>
|
|
5
|
+
<p>See the <a href="https://github.com/alphagov/govuk_publishing_components">govuk_publishing_components gem</a> for further details, or <a href="https://docs.publishing.service.gov.uk/manual/components.html#component-guides">a list of all component guides</a>. Read about how to <a href="https://github.com/alphagov/govuk_publishing_components/blob/master/docs/publishing-to-rubygems.md">release a new version of the gem</a>.</p>
|
|
11
6
|
</div>
|
|
12
7
|
|
|
13
8
|
<form role="search" data-module="filter-components" class="component-search">
|
|
@@ -86,3 +81,7 @@
|
|
|
86
81
|
</li>
|
|
87
82
|
<% end %>
|
|
88
83
|
</ul>
|
|
84
|
+
|
|
85
|
+
<div class="component-markdown">
|
|
86
|
+
<p class="govuk-body">If you cannot find a suitable component consider extending an existing component or <a href="https://github.com/alphagov/govuk_publishing_components/blob/master/docs/develop-component.md">creating a new one</a>.</p>
|
|
87
|
+
</div>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<%
|
|
2
|
+
id ||= nil
|
|
3
|
+
extra_spacing ||= nil
|
|
4
|
+
list_type ||= "unordered"
|
|
5
|
+
visible_counters ||= nil
|
|
6
|
+
items ||= []
|
|
7
|
+
aria_label ||= nil
|
|
8
|
+
|
|
9
|
+
classes = %w(gem-c-list govuk-list)
|
|
10
|
+
classes << "govuk-list--bullet" if visible_counters && list_type === "unordered"
|
|
11
|
+
classes << "govuk-list--number" if visible_counters && list_type === "number"
|
|
12
|
+
classes << "govuk-list--spaced" if extra_spacing
|
|
13
|
+
|
|
14
|
+
# Default list type is unordered list.
|
|
15
|
+
list_tag = "ul"
|
|
16
|
+
|
|
17
|
+
# Set to ordered list to override default.
|
|
18
|
+
list_tag = "ol" if list_type === "number"
|
|
19
|
+
%>
|
|
20
|
+
<% if items.any? %>
|
|
21
|
+
<%= content_tag list_tag, class: classes, id: id, "aria-label": aria_label do %>
|
|
22
|
+
<% items.each do |item| %>
|
|
23
|
+
<li><%= sanitize(item) %></li>
|
|
24
|
+
<% end %>
|
|
25
|
+
<% end %>
|
|
26
|
+
<% end %>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
name: List
|
|
2
|
+
description: A list - unordered or ordered, with or without counters / bullet points.
|
|
3
|
+
body: |
|
|
4
|
+
This is an ordered or unordered list, with or without visible bullets / numbers.
|
|
5
|
+
|
|
6
|
+
The `items` parameter can include HTML to display - such as links or another
|
|
7
|
+
list. This HTML can either be directly coded or come from another component.
|
|
8
|
+
accessibility_criteria: |
|
|
9
|
+
The list must:
|
|
10
|
+
|
|
11
|
+
- inform the user how many items are in the list
|
|
12
|
+
- convey the content structure
|
|
13
|
+
- indicate the current page when contents span different pages, and not link to itself
|
|
14
|
+
|
|
15
|
+
The list may:
|
|
16
|
+
|
|
17
|
+
- include an `aria-label` to contextualise the list if helpful
|
|
18
|
+
govuk_frontend_components:
|
|
19
|
+
- list
|
|
20
|
+
examples:
|
|
21
|
+
default:
|
|
22
|
+
description: "The default is an unordered list with no bullet points or numbers."
|
|
23
|
+
data: &default-example-data
|
|
24
|
+
items:
|
|
25
|
+
- "Tony’s Chocolonely"
|
|
26
|
+
- '<a href="https://en.wikipedia.org/wiki/Cherry_Ripe_(chocolate_bar)" rel="noopener" class="govuk-link">Cherry Ripe</a>'
|
|
27
|
+
- "Snickers"
|
|
28
|
+
- "Chomp"
|
|
29
|
+
- "Penguin"
|
|
30
|
+
- "Boost"
|
|
31
|
+
unordered_list_with_aria-label:
|
|
32
|
+
description: "A list with an aria-label"
|
|
33
|
+
data:
|
|
34
|
+
aria_label: "A list of delicious chocolate bars."
|
|
35
|
+
<<: *default-example-data
|
|
36
|
+
unordered_list_with_bullet_points:
|
|
37
|
+
description: "An unordered list with visible bullet points."
|
|
38
|
+
data:
|
|
39
|
+
visible_counters: true
|
|
40
|
+
<<: *default-example-data
|
|
41
|
+
ordered_list_without_numbers:
|
|
42
|
+
description: "This is an ordered list where the numbers aren't visible."
|
|
43
|
+
data:
|
|
44
|
+
list_type: "number"
|
|
45
|
+
<<: *default-example-data
|
|
46
|
+
ordered_list_with_numbers:
|
|
47
|
+
description: |
|
|
48
|
+
This is an ordered list with the numbers visible.
|
|
49
|
+
data:
|
|
50
|
+
list_type: "number"
|
|
51
|
+
visible_counters: true
|
|
52
|
+
<<: *default-example-data
|
|
53
|
+
with_extra_spacing:
|
|
54
|
+
description: |
|
|
55
|
+
Increases the amount of spacing between the list items.
|
|
56
|
+
data:
|
|
57
|
+
extra_spacing: true
|
|
58
|
+
<<: *default-example-data
|
|
59
|
+
with_id_attribute:
|
|
60
|
+
description: |
|
|
61
|
+
Sets the `id` on the `ul` or `ol` element.
|
|
62
|
+
data:
|
|
63
|
+
id: 'super-fantastic-chocolate-list'
|
|
64
|
+
<<: *default-example-data
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: govuk_publishing_components
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 21.
|
|
4
|
+
version: 21.58.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- GOV.UK Dev
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-
|
|
11
|
+
date: 2020-07-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: gds-api-adapters
|
|
@@ -206,6 +206,20 @@ dependencies:
|
|
|
206
206
|
- - "~>"
|
|
207
207
|
- !ruby/object:Gem::Version
|
|
208
208
|
version: 3.5.1
|
|
209
|
+
- !ruby/object:Gem::Dependency
|
|
210
|
+
name: jasmine_selenium_runner
|
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
|
212
|
+
requirements:
|
|
213
|
+
- - "~>"
|
|
214
|
+
- !ruby/object:Gem::Version
|
|
215
|
+
version: 3.0.0
|
|
216
|
+
type: :development
|
|
217
|
+
prerelease: false
|
|
218
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
219
|
+
requirements:
|
|
220
|
+
- - "~>"
|
|
221
|
+
- !ruby/object:Gem::Version
|
|
222
|
+
version: 3.0.0
|
|
209
223
|
- !ruby/object:Gem::Dependency
|
|
210
224
|
name: pry-byebug
|
|
211
225
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -498,6 +512,7 @@ files:
|
|
|
498
512
|
- app/assets/stylesheets/govuk_publishing_components/components/_layout-for-admin.scss
|
|
499
513
|
- app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss
|
|
500
514
|
- app/assets/stylesheets/govuk_publishing_components/components/_lead-paragraph.scss
|
|
515
|
+
- app/assets/stylesheets/govuk_publishing_components/components/_list.scss
|
|
501
516
|
- app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss
|
|
502
517
|
- app/assets/stylesheets/govuk_publishing_components/components/_modal-dialogue.scss
|
|
503
518
|
- app/assets/stylesheets/govuk_publishing_components/components/_notice.scss
|
|
@@ -640,6 +655,7 @@ files:
|
|
|
640
655
|
- app/views/govuk_publishing_components/components/_layout_for_admin.html.erb
|
|
641
656
|
- app/views/govuk_publishing_components/components/_layout_header.html.erb
|
|
642
657
|
- app/views/govuk_publishing_components/components/_lead_paragraph.html.erb
|
|
658
|
+
- app/views/govuk_publishing_components/components/_list.html.erb
|
|
643
659
|
- app/views/govuk_publishing_components/components/_machine_readable_metadata.html.erb
|
|
644
660
|
- app/views/govuk_publishing_components/components/_meta_tags.html.erb
|
|
645
661
|
- app/views/govuk_publishing_components/components/_metadata.html.erb
|
|
@@ -716,6 +732,7 @@ files:
|
|
|
716
732
|
- app/views/govuk_publishing_components/components/docs/layout_for_admin.yml
|
|
717
733
|
- app/views/govuk_publishing_components/components/docs/layout_header.yml
|
|
718
734
|
- app/views/govuk_publishing_components/components/docs/lead_paragraph.yml
|
|
735
|
+
- app/views/govuk_publishing_components/components/docs/list.yml
|
|
719
736
|
- app/views/govuk_publishing_components/components/docs/machine_readable_metadata.yml
|
|
720
737
|
- app/views/govuk_publishing_components/components/docs/meta_tags.yml
|
|
721
738
|
- app/views/govuk_publishing_components/components/docs/metadata.yml
|