govuk_publishing_components 12.17.0 → 12.18.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: daf83cc27bbb44657c8193582e9f26cfd1e36301a24ba5ed2ba92ac461577905
4
- data.tar.gz: 59ac08cf3f8ead780a03d649fcef1ce65cb4b514af1ea557961764b24968accc
3
+ metadata.gz: 9637ab77188a87e3315641594e6b9b8658353730fdad44ec14e8b4883cb79a0b
4
+ data.tar.gz: eb41ede84098dc57a10a1401239f1d8766f66680256f9b9e8b18dc6ff0bb82b2
5
5
  SHA512:
6
- metadata.gz: 4d90669dad89315ddadc53669ea3bb668e56661efb7bb2e3ad048fbc1723b65dab49e1b83d1988cc954c2d7b23058470def9c78a4527226467a1527c7dfa834c
7
- data.tar.gz: a248d29a9794f949b176059d65e10b48a78a892f39d1d664d0ede520aaeee34be262e46997ae3924a0ff8817fb85602057e34ac2e428d86e334801dc5aa274c8
6
+ metadata.gz: 71b761c24f67ac9dd032dddaef4ff3bffc03423d376ed786176446fe1c44072c8aa41518a59d81301641190fc5534b2cc113f39e48e8d3ef786b0fc675a3f2e7
7
+ data.tar.gz: 1bee91ed89443c0d31e09597b5f56c8d56a329ecf763eb8ea0ac15d3442ea721087e1b0f85f29f26c6c1c60327033d4e928a5a8119666622e705810949bc9947
@@ -3,6 +3,11 @@
3
3
  @include core-16;
4
4
  @include responsive-bottom-margin;
5
5
  @extend %contain-floats;
6
+
7
+ a {
8
+ @include govuk-link-common;
9
+ @include govuk-link-style-default;
10
+ }
6
11
  }
7
12
 
8
13
  .gem-c-metadata.direction-rtl {
@@ -10,6 +15,20 @@
10
15
  text-align: start;
11
16
  }
12
17
 
18
+ .gem-c-metadata--inverse {
19
+ color: govuk-colour('white');
20
+
21
+ a:link,
22
+ a:active,
23
+ a:visited {
24
+ color: govuk-colour('white');
25
+ }
26
+
27
+ a:focus {
28
+ color: govuk-colour('black');
29
+ }
30
+ }
31
+
13
32
  .gem-c-metadata__term {
14
33
  margin-top: 0.5em;
15
34
  line-height: normal;
@@ -43,14 +62,9 @@
43
62
  float: left;
44
63
  width: 70%;
45
64
  }
46
-
47
- a {
48
- @extend %govuk-link;
49
- }
50
65
  }
51
66
 
52
67
  .gem-c-metadata__definition-link {
53
- @extend %govuk-link;
54
68
  text-decoration: none;
55
69
  }
56
70
 
@@ -1,2 +1,15 @@
1
1
  @import "helpers/govuk-frontend-settings";
2
2
  @import "govuk-frontend/components/warning-text/warning-text";
3
+
4
+ .gem-c-warning-text__text--no-indent {
5
+ padding-left: 0;
6
+ margin-left: 0;
7
+ }
8
+
9
+ .gem-c-warning-text__text--large {
10
+ @include govuk-font($size: 24, $weight: bold);
11
+ }
12
+
13
+ .gem-c-warning-text__text--highlight {
14
+ color: $govuk-error-colour;
15
+ }
@@ -6,22 +6,27 @@
6
6
  part_of = Array(part_of)
7
7
 
8
8
  other ||= nil
9
+ inverse ||= false
9
10
 
10
11
  direction_class = ""
11
12
  direction_class = " direction-#{direction}" if local_assigns.include?(:direction)
13
+
14
+ classes = %w(gem-c-metadata)
15
+ classes << "direction-#{direction}" if local_assigns.include?(:direction)
16
+ classes << "gem-c-metadata--inverse" if inverse
12
17
  %>
13
- <div class="gem-c-metadata<%= direction_class %>" data-module="gem-toggle">
18
+ <%= content_tag :div, class: classes, data: { module: "gem-toggle" } do %>
14
19
  <dl data-module="track-click">
15
20
  <% if from.any? %>
16
21
  <dt class="gem-c-metadata__term"><%= t("govuk_component.metadata.from", default: "From") %>:</dt>
17
22
  <dd class="gem-c-metadata__definition">
18
- <%= render 'govuk_publishing_components/components/metadata/sentence', items: from, toggle_id: "from" %>
23
+ <%= render 'govuk_publishing_components/components/metadata/sentence', items: from, toggle_id: "from-#{SecureRandom.hex(4)}" %>
19
24
  </dd>
20
25
  <% end %>
21
26
  <% if part_of.any? %>
22
27
  <dt class="gem-c-metadata__term"><%= t("govuk_component.metadata.part_of", default: "Part of") %>:</dt>
23
28
  <dd class="gem-c-metadata__definition">
24
- <%= render 'govuk_publishing_components/components/metadata/sentence', items: part_of, toggle_id: "part-of" %>
29
+ <%= render 'govuk_publishing_components/components/metadata/sentence', items: part_of, toggle_id: "part-of-#{SecureRandom.hex(4)}" %>
25
30
  </dd>
26
31
  <% end %>
27
32
  <% if local_assigns.include?(:history) %>
@@ -54,10 +59,10 @@
54
59
  <% if definition.any? %>
55
60
  <dt class="gem-c-metadata__term"><%= title %>:</dt>
56
61
  <dd class="gem-c-metadata__definition">
57
- <%= render 'govuk_publishing_components/components/metadata/sentence', items: definition, toggle_id: index %>
62
+ <%= render 'govuk_publishing_components/components/metadata/sentence', items: definition, toggle_id: "#{index}-#{SecureRandom.hex(4)}" %>
58
63
  </dd>
59
64
  <% end %>
60
65
  <% end %>
61
66
  <% end %>
62
67
  </dl>
63
- </div>
68
+ <% end %>
@@ -1,15 +1,25 @@
1
1
  <%
2
2
  id ||= "warning-text-#{SecureRandom.hex(4)}"
3
3
  classes ||= ''
4
- css_classes = %w(gem-c-warning-text govuk-warning-text)
5
- css_classes << classes if classes
6
4
  text_assistive ||= 'Warning'
7
5
  text_icon ||= '!'
6
+ large_font ||= false
7
+ highlight_text ||= false
8
+
9
+ css_classes = %w(gem-c-warning-text govuk-warning-text)
10
+ css_classes << classes if classes
11
+
12
+ text_classes = %w(govuk-warning-text__text)
13
+ text_classes << "gem-c-warning-text__text--no-indent" if text_icon.empty?
14
+ text_classes << "gem-c-warning-text__text--large" if large_font
15
+ text_classes << "gem-c-warning-text__text--highlight" if highlight_text
8
16
  %>
9
17
 
10
18
  <%= tag.div id: id, class: css_classes do %>
11
- <%= tag.span text_icon, class: "govuk-warning-text__icon", "aria-hidden": "true" %>
12
- <%= tag.strong class: "govuk-warning-text__text" do %>
19
+ <% unless text_icon.empty? %>
20
+ <%= tag.span text_icon, class: "govuk-warning-text__icon", "aria-hidden": "true" %>
21
+ <% end %>
22
+ <%= tag.strong class: text_classes do %>
13
23
  <%= tag.span text_assistive, class: "govuk-warning-text__assistive" %>
14
24
  <%= text %>
15
25
  <% end %>
@@ -335,3 +335,23 @@ examples:
335
335
  first_published: 14 June 2014
336
336
  other:
337
337
  Applies to: England, Scotland, and Wales (see detailed guidance for <a href="http://www.dardni.gov.uk/news-dard-pa022-a-13-new-procedure-for" rel="external">Northern Ireland</a>)
338
+ on_a_dark_background:
339
+ data:
340
+ inverse: true
341
+ from: [
342
+ "<a href='/government/organisations/ministry-of-defence'>Ministry of Defence</a>",
343
+ "<a href='/government/organisations/cabinet-office'>Cabinet Office</a>",
344
+ "<a href=\"/government/organisations/department-for-business-energy-and-industrial-strategy\">Department for Business, Energy &amp; Industrial Strategy</a>",
345
+ "<a href=\"/government/organisations/foreign-commonwealth-office\">Foreign &amp; Commonwealth Office</a>",
346
+ "<a href=\"/government/people/william-hague\">The Rt Hon William Hague</a>",
347
+ "<a href=\"/government/organisations/department-for-environment-food-rural-affairs\">Department for Environment, Food &amp; Rural Affairs</a>",
348
+ "<a href=\"/government/organisations/department-for-work-pensions\">Department for work and pensions</a>",
349
+ "<a href=\"/government/organisations/foreign-commonwealth-office\">Foreign and Commonwealth Office</a>"
350
+ ]
351
+ first_published: 14 June 2014
352
+ last_updated: 10 September 2015
353
+ see_updates_link: true
354
+ other:
355
+ Applies to: England, Scotland, and Wales (see detailed guidance for <a href="http://www.dardni.gov.uk/news-dard-pa022-a-13-new-procedure-for" rel="external">Northern Ireland</a>)
356
+ context:
357
+ dark_background: true
@@ -17,3 +17,15 @@ examples:
17
17
  data:
18
18
  text_icon: "£"
19
19
  text: "You can be fined up to £5,000 if you don’t register."
20
+ without_icon:
21
+ data:
22
+ text_icon: ""
23
+ text: "You can be fined up to £320 if you don't register."
24
+ with_larger_font:
25
+ data:
26
+ text: "This content was updated on the 24th of November 2018"
27
+ large_font: true
28
+ with_red_font:
29
+ data:
30
+ text: "This content has changed"
31
+ highlight_text: true
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = '12.17.0'.freeze
2
+ VERSION = '12.18.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: 12.17.0
4
+ version: 12.18.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: 2018-12-03 00:00:00.000000000 Z
11
+ date: 2018-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govspeak