govuk_publishing_components 23.14.0 → 23.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +6 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +35 -44
- data/app/models/govuk_publishing_components/component_doc.rb +1 -1
- data/app/views/govuk_publishing_components/components/_document_list.html.erb +1 -0
- data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +5 -2
- data/app/views/govuk_publishing_components/components/docs/document_list.yml +24 -7
- data/app/views/govuk_publishing_components/components/docs/layout_header.yml +11 -0
- data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +9 -4
- 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: dcb27613b799a95856f3a2125b6e5a95a0a6ef79dbb0b51b3c96abbcafbcc8ae
|
4
|
+
data.tar.gz: ce5e6a4c647af7b0260ad3e3258d1edae02607a129d1de4153cb89b8fdc24eb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c581512609cf6841314030d6d2ad34a930208b84cd769561b80913579e788b6b964f2b1c4feec07087ee8f5075cbda98b31dda749fc21606315ba34d0b46200d
|
7
|
+
data.tar.gz: 5b11f1c74f5045f23afc9e393b77892eb2089953dfc402157cd39efbcf72b876b491a6897c51d08d54e3575f7651b7e4ef63dec194bf50975532b3c1868fc35c
|
@@ -8,41 +8,6 @@
|
|
8
8
|
}
|
9
9
|
}
|
10
10
|
|
11
|
-
// hide without js
|
12
|
-
// show with js, unless also has the js-hidden class
|
13
|
-
.gem-c-feedback__js-show,
|
14
|
-
.gem-c-feedback__prompt-success,
|
15
|
-
.gem-c-feedback__prompt-questions,
|
16
|
-
.gem-c-feedback__error-summary {
|
17
|
-
display: none;
|
18
|
-
|
19
|
-
.js-enabled & {
|
20
|
-
display: block;
|
21
|
-
|
22
|
-
&.js-hidden {
|
23
|
-
display: none;
|
24
|
-
}
|
25
|
-
}
|
26
|
-
}
|
27
|
-
|
28
|
-
// maintain table display for prompt and prompt-questions
|
29
|
-
.js-enabled .gem-c-feedback__prompt {
|
30
|
-
@include govuk-media-query($from: tablet) {
|
31
|
-
display: table;
|
32
|
-
}
|
33
|
-
}
|
34
|
-
|
35
|
-
.js-enabled .gem-c-feedback__prompt-questions {
|
36
|
-
@include govuk-media-query($from: tablet) {
|
37
|
-
display: table-cell;
|
38
|
-
}
|
39
|
-
}
|
40
|
-
|
41
|
-
// show the default feedback form without js
|
42
|
-
.js-enabled .gem-c-feedback__form.js-hidden {
|
43
|
-
display: none;
|
44
|
-
}
|
45
|
-
|
46
11
|
.gem-c-feedback__prompt-questions {
|
47
12
|
text-align: center;
|
48
13
|
border-bottom: 1px solid govuk-colour("white");
|
@@ -137,15 +102,6 @@
|
|
137
102
|
.gem-c-feedback__email-link,
|
138
103
|
.gem-c-feedback__prompt-link {
|
139
104
|
position: relative;
|
140
|
-
|
141
|
-
&:after {
|
142
|
-
content: "";
|
143
|
-
position: absolute;
|
144
|
-
top: -14px;
|
145
|
-
right: -14px;
|
146
|
-
left: -14px;
|
147
|
-
bottom: -14px;
|
148
|
-
}
|
149
105
|
}
|
150
106
|
|
151
107
|
.gem-c-feedback__prompt-link:link,
|
@@ -282,3 +238,38 @@
|
|
282
238
|
outline: $govuk-focus-width solid $govuk-focus-colour;
|
283
239
|
}
|
284
240
|
}
|
241
|
+
|
242
|
+
// hide without js
|
243
|
+
// show with js, unless also has the js-hidden class
|
244
|
+
.gem-c-feedback__js-show,
|
245
|
+
.gem-c-feedback__prompt-success,
|
246
|
+
.gem-c-feedback__prompt-questions,
|
247
|
+
.gem-c-feedback__error-summary {
|
248
|
+
display: none;
|
249
|
+
|
250
|
+
.js-enabled & {
|
251
|
+
display: block;
|
252
|
+
|
253
|
+
&.js-hidden {
|
254
|
+
display: none;
|
255
|
+
}
|
256
|
+
}
|
257
|
+
}
|
258
|
+
|
259
|
+
// maintain table display for prompt and prompt-questions
|
260
|
+
.js-enabled .gem-c-feedback__prompt {
|
261
|
+
@include govuk-media-query($from: tablet) {
|
262
|
+
display: table;
|
263
|
+
}
|
264
|
+
}
|
265
|
+
|
266
|
+
.js-enabled .gem-c-feedback__prompt-questions {
|
267
|
+
@include govuk-media-query($from: tablet) {
|
268
|
+
display: table-cell;
|
269
|
+
}
|
270
|
+
}
|
271
|
+
|
272
|
+
// show the default feedback form without js
|
273
|
+
.js-enabled .gem-c-feedback__form.js-hidden {
|
274
|
+
display: none;
|
275
|
+
}
|
@@ -69,7 +69,7 @@ module GovukPublishingComponents
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def github_search_url
|
72
|
-
params = { q: "org:alphagov
|
72
|
+
params = { q: "org:alphagov components/components/#{id}", type: "Code" }
|
73
73
|
"https://github.com/search?#{params.to_query}"
|
74
74
|
end
|
75
75
|
|
@@ -5,6 +5,7 @@
|
|
5
5
|
classes << " gem-c-document-list--top-margin" if local_assigns[:margin_top]
|
6
6
|
classes << " gem-c-document-list--bottom-margin" if local_assigns[:margin_bottom]
|
7
7
|
classes << " gem-c-document-list--no-underline" if local_assigns[:remove_underline]
|
8
|
+
classes << " gem-c-document-list--no-top-border" if local_assigns[:remove_top_border]
|
8
9
|
|
9
10
|
within_multitype_list ||= false
|
10
11
|
within_multitype_list_class = " gem-c-document-list__multi-list" if within_multitype_list
|
@@ -6,7 +6,7 @@
|
|
6
6
|
classes << "gem-c-layout-footer--border" if with_border
|
7
7
|
%>
|
8
8
|
<%= tag.footer class: classes, role: "contentinfo" do %>
|
9
|
-
<div class="govuk-width-container ">
|
9
|
+
<div class="govuk-width-container" data-module="track-click">
|
10
10
|
<% if navigation.any? %>
|
11
11
|
<div class="govuk-footer__navigation">
|
12
12
|
<% navigation.each do |item| %>
|
@@ -31,7 +31,10 @@
|
|
31
31
|
<% if item[:href] && item[:text] %>
|
32
32
|
<li class="govuk-footer__list-item">
|
33
33
|
<%
|
34
|
-
attributes = {
|
34
|
+
attributes = {
|
35
|
+
class: "govuk-footer__link",
|
36
|
+
"data-track-category": "footerClicked"
|
37
|
+
}.merge(item.fetch(:attributes, {}))
|
35
38
|
attributes[:rel] = "noopener" if attributes[:target] == "_blank" && !attributes[:rel]
|
36
39
|
%>
|
37
40
|
<%= link_to item[:text], item[:href], attributes %>
|
@@ -1,16 +1,16 @@
|
|
1
1
|
name: Document list
|
2
2
|
description: An ordered list of documents including a document type, when updated and a link.
|
3
3
|
body: |
|
4
|
-
Outputs a list to documents, based on an array of document data.
|
4
|
+
Outputs a list to documents, based on an array of document data. A "document" in this context can be an asset (such as a ODT or other downloadable document) or a web page.
|
5
|
+
|
6
|
+
The component can display:
|
5
7
|
|
6
|
-
* document title
|
7
|
-
* link to the document
|
8
|
-
* last updated date object
|
9
|
-
* document type
|
8
|
+
* a document title
|
9
|
+
* a link to the document
|
10
|
+
* a last updated date object
|
11
|
+
* a document type
|
10
12
|
|
11
13
|
Tracking can be added to the links by supplying optional data attributes for each.
|
12
|
-
|
13
|
-
Documents are presented in an ordered list as the component expects that the ordering of the documents is relevant.
|
14
14
|
accessibility_criteria: |
|
15
15
|
The component must:
|
16
16
|
|
@@ -195,6 +195,23 @@ examples:
|
|
195
195
|
public_updated_at: 2017-07-19 15:01:48
|
196
196
|
document_type: 'Statistical data set'
|
197
197
|
subtext: 'First published during the 1996 Conservative Government'
|
198
|
+
without_top_border_on_list_element:
|
199
|
+
description: Several interfaces across GOV.UK benefit from the semantics of the document list but have their own bespoke designs, sometimes meaning that the visual border element doesn't gel with said interface. Removing it using the below attribute allows for cleaner visual fidelity in this instances.
|
200
|
+
data:
|
201
|
+
remove_top_border: true
|
202
|
+
items:
|
203
|
+
- link:
|
204
|
+
text: 'Department for Education – Statistics at DfE'
|
205
|
+
path: '/government/organisations/department-for-education/about/statistics'
|
206
|
+
metadata:
|
207
|
+
public_updated_at: 2017-07-19 15:01:48
|
208
|
+
document_type: 'Corporate information'
|
209
|
+
- link:
|
210
|
+
text: 'State-funded school inspections and outcomes: management information'
|
211
|
+
path: '/government/organisations/department-for-education/about/statistics'
|
212
|
+
metadata:
|
213
|
+
public_updated_at: 2017-07-19 15:01:48
|
214
|
+
document_type: 'Statistical data set'
|
198
215
|
highlighted_result:
|
199
216
|
description: Highlight one or more of the items in the list. This is used on finders to provide a 'top result' for a search. The `highlight_text` parameter is optional.
|
200
217
|
data:
|
@@ -81,6 +81,17 @@ examples:
|
|
81
81
|
- text: News and communications
|
82
82
|
href: "item-6"
|
83
83
|
active: true
|
84
|
+
with_navigation_link_data_attributes:
|
85
|
+
description: Supports adding data attributes i.e for tracking
|
86
|
+
data:
|
87
|
+
navigation_items:
|
88
|
+
- text: Departments
|
89
|
+
href: "item-1"
|
90
|
+
data:
|
91
|
+
module: "a custom attribute"
|
92
|
+
something_else: "some other custom attribute"
|
93
|
+
- text: Worldwide
|
94
|
+
href: "item-2"
|
84
95
|
full_width:
|
85
96
|
description: |
|
86
97
|
This is difficult to preview because the preview windows are constrained, but the header will stretch to the size of its container.
|
data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
CHANGED
@@ -1,16 +1,21 @@
|
|
1
1
|
<% if navigation_items.any? %>
|
2
2
|
<button role="button" class="govuk-header__menu-button gem-c-header__menu-button govuk-js-header-toggle" aria-controls="navigation" aria-label="Show or hide Top Level Navigation">Menu</button>
|
3
|
-
<%= tag.nav
|
3
|
+
<%= tag.nav class: "gem-c-header__nav", aria: { label: navigation_aria_label } do %>
|
4
4
|
<ul id="navigation" class="govuk-header__navigation govuk-header__navigation--end">
|
5
5
|
<% navigation_items.each_with_index do |item, index| %>
|
6
|
-
|
7
|
-
|
6
|
+
<%
|
7
|
+
li_classes = %w(govuk-header__navigation-item)
|
8
|
+
li_classes << "govuk-header__navigation-item--active" if item[:active]
|
9
|
+
li_classes << "govuk-header__navigation-item--collapsed-menu-only" if item[:show_only_in_collapsed_menu]
|
10
|
+
%>
|
11
|
+
<%= tag.li class: li_classes do %>
|
8
12
|
<%= link_to(
|
9
13
|
item[:text],
|
10
14
|
item[:href],
|
11
15
|
class: 'govuk-header__link',
|
16
|
+
data: item[:data],
|
12
17
|
) %>
|
13
|
-
|
18
|
+
<% end %>
|
14
19
|
<% end %>
|
15
20
|
</ul>
|
16
21
|
<% end %>
|
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: 23.
|
4
|
+
version: 23.15.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: 2021-02-
|
11
|
+
date: 2021-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: govuk_app_config
|