govuk_publishing_components 68.1.0 → 68.2.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: 4043c16d81a4d408586ba023e10b20c95351be88e3149f3068f768265eee4431
4
- data.tar.gz: df3b994d054d385990f6cdb7fe23676d35f15ac398cb5c7c9ef7d840f15930ee
3
+ metadata.gz: ba5b24da8c7e37b1df6a4f4fec4aff4cd3b099923b888a2c844aef00fc54259f
4
+ data.tar.gz: 39e1a0df6c03ca9cc320ec92a6e07738ab30e05a1b7b3c14f61197f23bd0387c
5
5
  SHA512:
6
- metadata.gz: 908961ea90462179429522aefc6224a35786c5dd630de3a289e9ca952a216d5bd9556b65871ab4f81af074a037af660dc2760eb93558ca2a6a538ac8a1a633a6
7
- data.tar.gz: 3c22900fb4473fcbc267f3ad9a8fe8aab5fe645c9ddb61b835eab2652f6d2492341a992371461f3066599c6a748f0f9c1a3914b19c3c8b281b7218823ddd46c6
6
+ metadata.gz: 1547f4b8b7362ba0105d288a2f484f2a040dba2f7e4955597d040be78dc1b6d891c36856ffab79f88a0b72eb9be616b8b06e8f79c5ca6a5c0c756fec59ae14e9
7
+ data.tar.gz: 35d2a6d741b9ec56ceecc69d311e9490d8c67bee32d4a86a7da37a8f82defe489906e8caa24f921aec4b88eb3fa812b528049bc446ccc36badf653890335edca
@@ -158,10 +158,11 @@
158
158
 
159
159
  .gem-c-cards__sub-heading {
160
160
  margin: 0 govuk-spacing(6) govuk-spacing(2) 0;
161
+ text-wrap: pretty;
161
162
 
162
163
  // Ensure card content width is constrained to two thirds on desktop
163
164
  @include govuk-media-query($from: "desktop") {
164
- max-width: 66.6667%;
165
+ max-width: 640px;
165
166
  }
166
167
  }
167
168
 
@@ -208,10 +209,11 @@
208
209
 
209
210
  .gem-c-cards__description {
210
211
  margin: 0 govuk-spacing(6) 0 0;
212
+ text-wrap: pretty;
211
213
 
212
214
  // Ensure card content width is constrained to two thirds on desktop
213
215
  @include govuk-media-query($from: "desktop") {
214
- max-width: 66.6667%;
216
+ max-width: 640px;
215
217
  }
216
218
  }
217
219
 
@@ -90,7 +90,7 @@
90
90
  display: none;
91
91
  }
92
92
 
93
- .gem-c-metadata--history {
93
+ .gem-c-metadata--border-top {
94
94
  padding-top: govuk-spacing(2);
95
95
  border-top: 1px solid $govuk-border-colour;
96
96
  }
@@ -110,22 +110,30 @@
110
110
  }
111
111
 
112
112
  .gem-c-metadata__change-history {
113
- margin: govuk-spacing(4) 0 0 0;
113
+ margin: 0;
114
114
  padding: 0;
115
115
  list-style: none;
116
116
  }
117
117
 
118
+ .gem-c-metadata__change-history-item {
119
+ margin-bottom: govuk-spacing(4);
120
+
121
+ &:last-child {
122
+ margin: 0;
123
+ }
124
+
125
+ .gem-c-metadata__change-note {
126
+ margin: 0;
127
+ white-space: pre-line;
128
+ }
129
+ }
130
+
118
131
  .gem-c-metadata__change-date {
119
132
  display: block;
120
- margin: govuk-spacing(3) 0;
133
+ margin: 0 0 govuk-spacing(3) 0;
121
134
  @include govuk-font(16, $weight: bold);
122
135
  }
123
136
 
124
- .gem-c-metadata__change-note {
125
- margin: 0;
126
- white-space: pre-line;
127
- }
128
-
129
137
  // stylelint-disable declaration-no-important
130
138
  @include govuk-media-query($media-type: print) {
131
139
  .gem-c-metadata {
@@ -13,12 +13,12 @@
13
13
  other ||= nil
14
14
  inverse ||= false
15
15
  inverse_compress ||= false
16
+ border_top ||= false
16
17
 
17
18
  component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
18
19
  component_helper.add_class("gem-c-metadata")
19
20
  component_helper.add_class("direction-#{direction}") if local_assigns.include?(:direction)
20
-
21
- component_helper.add_class("gem-c-metadata--history") if page_history.any?
21
+ component_helper.add_class("gem-c-metadata--border-top") if border_top
22
22
  component_helper.set_id("full-publication-update-history") if page_history.any?
23
23
 
24
24
  if inverse
@@ -49,13 +49,13 @@
49
49
  <dl class="gem-c-metadata__list">
50
50
  <% if from.any? %>
51
51
  <dt class="gem-c-metadata__term"><%= t("components.metadata.from") %>:</dt>
52
- <dd class="gem-c-metadata__definition" data-module="gem-toggle">
52
+ <dd class="gem-c-metadata__definition">
53
53
  <%= render "govuk_publishing_components/components/metadata/sentence", items: from, toggle_id: "from-#{SecureRandom.hex(4)}" %>
54
54
  </dd>
55
55
  <% end %>
56
56
  <% if part_of.any? %>
57
57
  <dt class="gem-c-metadata__term"><%= t("components.metadata.part_of") %>:</dt>
58
- <dd class="gem-c-metadata__definition" data-module="gem-toggle">
58
+ <dd class="gem-c-metadata__definition">
59
59
  <%= render "govuk_publishing_components/components/metadata/sentence", items: part_of, toggle_id: "part-of-#{SecureRandom.hex(4)}" %>
60
60
  </dd>
61
61
  <% end %>
@@ -69,7 +69,7 @@
69
69
  <% end %>
70
70
  <% if local_assigns.include?(:last_updated) && last_updated %>
71
71
  <dt class="gem-c-metadata__term"><%= t("components.metadata.last_updated") %>:</dt>
72
- <dd class="gem-c-metadata__definition" data-module="gem-toggle">
72
+ <dd class="gem-c-metadata__definition">
73
73
  <%= last_updated %>
74
74
  <% if local_assigns.include?(:see_updates_link) %>
75
75
  &#8212; <a href="#full-publication-update-history"
@@ -78,27 +78,19 @@
78
78
  </a>
79
79
  <% end %>
80
80
  <% if page_history.any? %>
81
- <span aria-hidden="true">&#8212; </span>
82
- <% page_history_toggle_id = "page-history-#{SecureRandom.hex(4)}" %>
83
- <a
84
- href="#full-history"
85
- class="gem-c-metadata__toggle govuk-link"
86
- data-controls="<%= page_history_toggle_id %>"
87
- data-expanded="false"
88
- data-toggled-text='<%= t("components.metadata.hide_all_updates", locale: :en) %>'
89
- data-module="ga4-event-tracker"
90
- data-ga4-event='<%= { event_name: "select_content", type: "content history", section: "Footer" }.to_json %>'
91
- data-ga4-expandable>
92
- <%= t("components.metadata.show_all_updates", locale: :en) %>
93
- </a>
94
- <ol class="gem-c-metadata__change-history js-hidden" id="<%= page_history_toggle_id %>">
95
- <% page_history.each do |change| %>
96
- <li>
97
- <time class="gem-c-metadata__change-date timestamp" datetime="<%= change[:timestamp] %>"><%= change[:display_time] %></time>
98
- <p class="gem-c-metadata__change-note"><%= change[:note].strip %></p>
99
- </li>
100
- <% end %>
101
- </ol>
81
+ <%= render "govuk_publishing_components/components/details", {
82
+ title: t("components.metadata.show_all_updates", locale: :en),
83
+ small: true,
84
+ } do %>
85
+ <ol class="gem-c-metadata__change-history">
86
+ <% page_history.each do |change| %>
87
+ <li class="gem-c-metadata__change-history-item">
88
+ <time class="gem-c-metadata__change-date" datetime="<%= change[:timestamp] %>"><%= change[:display_time] %></time>
89
+ <p class="gem-c-metadata__change-note"><%= change[:note].strip %></p>
90
+ </li>
91
+ <% end %>
92
+ </ol>
93
+ <% end %>
102
94
  <% end %>
103
95
  </dd>
104
96
  <% end %>
@@ -111,10 +103,8 @@
111
103
  <% if definition.any? %>
112
104
  <dt class="gem-c-metadata__term"><%= title %>:</dt>
113
105
  <dd class="gem-c-metadata__definition"
114
- <% if disable_ga4 %>
115
- data-module="gem-toggle"
116
- <% else %>
117
- data-module="gem-toggle ga4-link-tracker"
106
+ <% unless disable_ga4 %>
107
+ data-module="ga4-link-tracker"
118
108
  data-ga4-link="<%= ga4_object %>"
119
109
  <% end %>>
120
110
  <%= render "govuk_publishing_components/components/metadata/sentence", items: definition, toggle_id: "#{index}-#{SecureRandom.hex(4)}" %>
@@ -22,6 +22,10 @@ examples:
22
22
  history_only:
23
23
  data:
24
24
  history: Updated 2 weeks ago
25
+ with_border_top:
26
+ data:
27
+ border_top: true
28
+ from: <a href='/government/organisations/ministry-of-defence'>Ministry of Defence</a>
25
29
  published_and_updated:
26
30
  data:
27
31
  first_published: 14 June 2014
@@ -33,6 +37,37 @@ examples:
33
37
  data:
34
38
  last_updated: 10 September 2015
35
39
  see_updates_link: true
40
+ display_page_history:
41
+ description: |
42
+ This will set up an expandable section on the page, with a top border, to let users toggle the display of the page history. It also includes a hidden H2 heading of 'Updates to this page'. This heading will not be included if one is passed to the component using the `title` option.
43
+
44
+ This example includes an expandable 'part of' section to show both toggling elements working together in one component instance.
45
+ data:
46
+ border_top: true
47
+ part_of:
48
+ - <a href="/government/world/afghanistan">Afghanistan</a>
49
+ - <a href="/government/world/albania">Albania</a>
50
+ - <a href="/government/world/algeria">Algeria</a>
51
+ - <a href="/government/world/angola">Angola</a>
52
+ - <a href="/government/world/anguilla">Anguilla</a>
53
+ - <a href="/government/world/argentina">Argentina</a>
54
+ - <a href="/government/world/armenia">Armenia</a>
55
+ - <a href="/government/world/australia">Australia</a>
56
+ - <a href="/government/world/austria">Austria</a>
57
+ - <a href="/government/world/azerbaijan">Azerbaijan</a>
58
+ - <a href="/government/world/bahrain">Bahrain</a>
59
+ first_published: 1st January 1990
60
+ last_updated: 20th October 2016
61
+ page_history:
62
+ - display_time: 1st January 1990
63
+ note: First published
64
+ timestamp: 1990-01-01T15:42:37.000+00:00
65
+ - display_time: 20th July 1995
66
+ note: Updated to include information for 1994
67
+ timestamp: 1995-07-20T15:42:37.000+00:00
68
+ - display_time: 14th October 2000
69
+ note: Updated information on pupil premium reviews and what information schools need to publish on their websites.
70
+ timestamp: 2000-10-14T15:42:37.000+00:00
36
71
  extensive:
37
72
  data:
38
73
  from:
@@ -348,36 +383,6 @@ examples:
348
383
  first_published: 14 June 2014
349
384
  other:
350
385
  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>)
351
- display_page_history:
352
- description: |
353
- This will set up an expandable section on the page, with a top border, to let users toggle the display of the page history. It also includes a hidden H2 heading of 'Updates to this page'. This heading will not be included if one is passed to the component using the `title` option.
354
-
355
- This example includes an expandable 'part of' section to show both toggling elements working together in one component instance.
356
- data:
357
- part_of:
358
- - <a href="/government/world/afghanistan">Afghanistan</a>
359
- - <a href="/government/world/albania">Albania</a>
360
- - <a href="/government/world/algeria">Algeria</a>
361
- - <a href="/government/world/angola">Angola</a>
362
- - <a href="/government/world/anguilla">Anguilla</a>
363
- - <a href="/government/world/argentina">Argentina</a>
364
- - <a href="/government/world/armenia">Armenia</a>
365
- - <a href="/government/world/australia">Australia</a>
366
- - <a href="/government/world/austria">Austria</a>
367
- - <a href="/government/world/azerbaijan">Azerbaijan</a>
368
- - <a href="/government/world/bahrain">Bahrain</a>
369
- first_published: 1st January 1990
370
- last_updated: 20th October 2016
371
- page_history:
372
- - display_time: 1st January 1990
373
- note: First published
374
- timestamp: 1990-01-01T15:42:37.000+00:00
375
- - display_time: 20th July 1995
376
- note: Updated to include information for 1994
377
- timestamp: 1995-07-20T15:42:37.000+00:00
378
- - display_time: 14th October 2000
379
- note: Updated information on pupil premium reviews and what information schools need to publish on their websites.
380
- timestamp: 2000-10-14T15:42:37.000+00:00
381
386
  with_title:
382
387
  data:
383
388
  last_updated: 10 September 2015
@@ -9,16 +9,10 @@
9
9
  %>
10
10
  <%= items.to_sentence(two_words_connector: connector, last_word_connector: connector).html_safe %>
11
11
  <% if remaining.any? %>
12
- <div class="gem-c-metadata__toggle-wrap govuk-!-display-none-print">
13
- <a href="#"
14
- class="gem-c-metadata__definition-link govuk-!-display-none-print"
15
- data-controls="toggle-<%= toggle_id %>"
16
- data-expanded="false"
17
- data-toggled-text="<%= t("common.toggle_less") %>">
18
- <%= t("common.toggle_more",
19
- show: t("common.show"),
20
- number: remaining.length) %>
21
- </a>
22
- </div>
23
- <span id="toggle-<%= toggle_id %>" class="gem-c-metadata__toggle-items js-hidden"><%= remaining.to_sentence.html_safe %></span>
12
+ <%= render "govuk_publishing_components/components/details", {
13
+ title: t("common.toggle_more", show: t("common.show"), number: remaining.length),
14
+ small: true,
15
+ } do %>
16
+ <%= remaining.to_sentence.html_safe %>
17
+ <% end %>
24
18
  <% end %>
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "68.1.0".freeze
2
+ VERSION = "68.2.0".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_publishing_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 68.1.0
4
+ version: 68.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev