govuk_publishing_components 21.10.0 → 21.11.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f3b714e4ac16dcb7d35863086c6f857ef31d142bfcc7b80f3fece4a113b96bd7
4
- data.tar.gz: 8268154d670cdcfdc51009609e2724c9695dfa5e2f8a782133917dbdf3ab26cb
3
+ metadata.gz: 2bbeb70eb7086f9fabacb9857824a4a7ba8f11903ff484b2e7556792b593a612
4
+ data.tar.gz: 0cf68605b66f55385c67d90dee67e1cf193ceff4def3c4caa260273f73f93a0a
5
5
  SHA512:
6
- metadata.gz: 98c6cc5de694a0496ff98451e8f7a56317b92747b8c0266ca4fb4f43365731d393008fd17f87a9be00e93efa7d7e53203f9c1bd639c6bf2b28e58885950a0c24
7
- data.tar.gz: 58b9b92e675013a7c65baa7a91e7d5b9c8cd3c673fa22a13b3bfa75429fdbbe527139b2efb88874d0ab0ed7bfc52d83d4a90414a43fbe5d2d1f4004c621fd3cd
6
+ metadata.gz: 12de494131da57503893d764422bc097f0cd5a082bccd35e1e48f8fb234feb48a242dae5ffce964422f5c3577dcbcf89d1567b58b8fd2d2ad21d41afa08973ac
7
+ data.tar.gz: 7fdf11ebf8e5c7bb9e1aae2b4a7f93f8453dfbd0c26053de2673b3b72e11677ae708ef937b7981f66668e6df05f87bb5d3e5b1077dddca675e857abbc68b9b4e
@@ -28,5 +28,8 @@
28
28
  var searchTerm = searchField.value;
29
29
  window.GOVUK.FilterComponents(searchTerm);
30
30
  });
31
+
32
+ // trigger search if search query exists in query string on page load
33
+ window.GOVUK.FilterComponents(searchField.value);
31
34
  }
32
35
  })();
@@ -18,12 +18,15 @@
18
18
  }
19
19
 
20
20
  .gem-c-document-list__item-title {
21
- @include govuk-link-common;
22
- @include govuk-link-style-default;
23
21
  @include govuk-font($size: 19, $weight: bold);
24
22
  display: inline-block;
25
23
  }
26
24
 
25
+ .gem-c-document-list__item-link {
26
+ @include govuk-link-common;
27
+ @include govuk-link-style-default;
28
+ }
29
+
27
30
  .gem-c-document-list--no-underline {
28
31
  .gem-c-document-list__item-title {
29
32
  text-decoration: none;
@@ -22,6 +22,11 @@
22
22
  direction: ltr;
23
23
  }
24
24
 
25
+ .gem-c-organisation-logo__container--inline {
26
+ display: inline-block;
27
+ padding-right: govuk-spacing(1);
28
+ }
29
+
25
30
  // Scale images on smaller viewports
26
31
  .gem-c-organisation-logo__image {
27
32
  max-width: 100%;
@@ -61,7 +66,11 @@
61
66
  }
62
67
 
63
68
  &:focus {
69
+ // Using `@include govuk-focused-text;` would obscure the text. Tweaked
70
+ // spacing needed to prevent overlap of the text and the focus state's thick
71
+ // black line.
64
72
  box-shadow: 0 -2px $govuk-focus-colour, 0 4px $govuk-focus-colour, 0 8px $govuk-focus-text-colour;
73
+ text-decoration: none;
65
74
  }
66
75
  }
67
76
 
@@ -159,11 +159,11 @@ $large-input-size: 50px;
159
159
  .gem-c-search--on-white {
160
160
 
161
161
  .gem-c-search__submit {
162
- background-color: govuk-colour("light-blue");
162
+ background-color: govuk-colour("blue");
163
163
  color: govuk-colour("white");
164
164
 
165
165
  &:hover {
166
- background-color: lighten(govuk-colour("light-blue"), 5%);
166
+ background-color: lighten(govuk-colour("blue"), 5%);
167
167
  }
168
168
  }
169
169
 
@@ -24,13 +24,25 @@
24
24
  <% if item[:highlight] && item[:highlight_text] %>
25
25
  <p class='gem-c-document-list__highlight-text'><%= item[:highlight_text] %></p>
26
26
  <% end %>
27
+
27
28
  <%=
28
- link_to(
29
- item[:link][:text],
30
- item[:link][:path],
31
- data: item[:link][:data_attributes],
32
- class: "gem-c-document-list__item-title #{brand_helper.color_class} #{title_with_context_class if item[:link][:context]}"
33
- )
29
+ item_classes = "gem-c-document-list__item-title #{brand_helper.color_class} #{title_with_context_class if item[:link][:context]}"
30
+
31
+ if item[:link][:path]
32
+ link_to(
33
+ item[:link][:text],
34
+ item[:link][:path],
35
+ data: item[:link][:data_attributes],
36
+ class: "#{item_classes} gem-c-document-list__item-link",
37
+ )
38
+ else
39
+ content_tag(
40
+ "span",
41
+ item[:link][:text],
42
+ data: item[:link][:data_attributes],
43
+ class: item_classes,
44
+ )
45
+ end
34
46
  %>
35
47
 
36
48
  <% if item[:link][:context] %>
@@ -1,21 +1,42 @@
1
1
  <%
2
2
  logo_helper = GovukPublishingComponents::Presenters::OrganisationLogoHelper.new(local_assigns)
3
3
  brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(organisation[:brand])
4
+
4
5
  organisation ||= {}
6
+ heading_level ||= false
7
+ inline ||= false
8
+
9
+ # Check if `heading_level` is a number; if so, check if it's an appropriate
10
+ # number.
11
+ use_heading = heading_level.is_a?(Integer) ?
12
+ (heading_level >= 1 && heading_level <= 6) :
13
+ false
14
+
15
+ # Set the wrapping element to be a heading or a `div`
16
+ wrapping_element = use_heading ? "h#{heading_level}" : "div"
17
+
18
+ wrapper_classes = %w(gem-c-organisation-logo)
19
+ wrapper_classes << brand_helper.brand_class
20
+
21
+ container_classes = [
22
+ logo_helper.logo_container_class,
23
+ brand_helper.border_color_class
24
+ ]
25
+ container_classes << "gem-c-organisation-logo__container--inline" if inline
5
26
  %>
6
- <div
7
- class="gem-c-organisation-logo <%= brand_helper.brand_class %>"
27
+ <<%= wrapping_element %>
28
+ class="<%= wrapper_classes.join(" ") %>"
8
29
  <%= "data-module=track-click" if organisation[:data_attributes] %>
9
30
  >
10
31
  <% if organisation[:url] %>
11
32
  <%= link_to organisation[:url],
12
- class: "#{logo_helper.logo_container_class} #{brand_helper.border_color_class}",
33
+ class: container_classes.join(" "),
13
34
  data: organisation[:data_attributes] do %>
14
35
  <%= logo_helper.logo_content %>
15
36
  <% end %>
16
37
  <% else %>
17
- <div class="<%= logo_helper.logo_container_class %> <%= brand_helper.border_color_class %>">
38
+ <div class="<%= container_classes.join(" ") %>">
18
39
  <%= logo_helper.logo_content %>
19
40
  </div>
20
41
  <% end %>
21
- </div>
42
+ </<%= wrapping_element %>>
@@ -1,10 +1,10 @@
1
1
  name: Document list
2
- description: An ordered list of links to documents including document type and when updated.
2
+ description: An ordered list of documents including a document type, when updated and a link.
3
3
  body: |
4
- Outputs a list of links to documents, based on an array of document data. This must include:
4
+ Outputs a list to documents, based on an array of document data. This may include:
5
5
 
6
- * link text
7
- * link href
6
+ * document title
7
+ * link to the document
8
8
  * last updated date object
9
9
  * document type
10
10
 
@@ -39,6 +39,24 @@ examples:
39
39
  metadata:
40
40
  public_updated_at: 2016-09-05 16:48:27
41
41
  document_type: 'Statutory guidance'
42
+ without_links:
43
+ data:
44
+ items:
45
+ - link:
46
+ text: 'Alternative provision'
47
+ metadata:
48
+ public_updated_at: 2016-06-27 10:29:44
49
+ document_type: 'Statutory guidance'
50
+ - link:
51
+ text: 'Behaviour and discipline in schools: guide for governing bodies'
52
+ metadata:
53
+ public_updated_at: 2015-09-24 16:42:48
54
+ document_type: 'Statutory guidance'
55
+ - link:
56
+ text: 'Children missing education'
57
+ metadata:
58
+ public_updated_at: 2016-09-05 16:48:27
59
+ document_type: 'Statutory guidance'
42
60
  with_data_attributes_on_links:
43
61
  data:
44
62
  items:
@@ -6,8 +6,12 @@ body: |
6
6
 
7
7
  Alternatively a custom organisation logo can be provided as an image.
8
8
 
9
- Data tracking attributes can be provided to add tracking to each organisation logo.
10
- This will only apply to organisations with a link. Example here: [with_data_attributes](/component-guide/organisation_logo/with_data_attributes)
9
+ Data tracking attributes can be provided to add tracking to each organisation logo. This will only apply to organisations with a link. Example here: [with_data_attributes](/component-guide/organisation_logo/with_data_attributes)
10
+
11
+ The logo can optionally be wrapped in a heading.
12
+
13
+ The logo can be set to not take up the full width of the parent container with the `inline` option.
14
+
11
15
  accessibility_criteria: |
12
16
  The crest image itself must be presentational and ignored by screen readers.
13
17
 
@@ -162,3 +166,28 @@ examples:
162
166
  name: Cabinet Office
163
167
  brand: cabinet-office
164
168
  crest: 'single-identity'
169
+ as_a_heading:
170
+ description: The `heading_level` option takes a number from 1 to 6.
171
+ data:
172
+ organisation:
173
+ name: Cabinet Office
174
+ url: '/government/organisations/cabinet-office'
175
+ brand: cabinet-office
176
+ crest: 'single-identity'
177
+ heading_level: 1
178
+ as_a_heading_without_a_link:
179
+ data:
180
+ organisation:
181
+ name: Cabinet Office
182
+ brand: cabinet-office
183
+ crest: 'single-identity'
184
+ heading_level: 1
185
+ inline-block:
186
+ description: This option is useful to stop a large selectable area.
187
+ data:
188
+ organisation:
189
+ name: Cabinet Office
190
+ url: '/government/organisations/cabinet-office'
191
+ brand: cabinet-office
192
+ crest: 'single-identity'
193
+ inline: true
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = '21.10.0'.freeze
2
+ VERSION = '21.11.0'.freeze
3
3
  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: 21.10.0
4
+ version: 21.11.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: 2019-11-06 00:00:00.000000000 Z
11
+ date: 2019-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gds-api-adapters