govuk_publishing_components 45.4.0 → 45.5.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: e70f401f5700ff05fbb8aa5d30b0ac28a18637c226160d47b0a3599f42cecdd7
4
- data.tar.gz: 590046d25488a0d116d890e67a121a332de72e33e37bff3984494b36c5688dc8
3
+ metadata.gz: e4609ce45817837b00359ee2799de40d7c65d25f0e3980db4af6f2da14cae010
4
+ data.tar.gz: 0b38ffa5529b9cf6ecc95ecc25fc9bb2c2929c5a036c37baace13931a919e04a
5
5
  SHA512:
6
- metadata.gz: 1f344d92d3381bd7de370a6a4e06ca9dabbcd98ed3058eb8e64042e7d014e2aea06d006fa71f00151896200ffe5b5bf29e9bc41b677af27739c299d26c30c464
7
- data.tar.gz: e7ca6ab122f792cc8570f1e60ffbf73a08dec8ef1e3b618a1cf3085d9557bde2df4303410bf2472081889e1383b0e0dd1c25cd5a30e7f4e037abb2409254ca8f
6
+ metadata.gz: ee5ecdc7c7a3bd7ef8630d383f71a646e164956e3959ca7a44df145116a7a626a6e622682a149bc24a14cce8092e8a0120ff8c53c050ceb056f403459b87e334
7
+ data.tar.gz: d715613daa240e57363b618cf5bcc19b30160b03fd776b3185519a3afe05e671dfb3565d0699b97bbfb156b59dd683cc90bfc1d06c425c703094078fae6e6858
@@ -259,7 +259,7 @@
259
259
  PostBeaconCancelled: 85,
260
260
  PostBeaconStopRecording: 86,
261
261
  PostBeaconMetricRejected: 87,
262
- PostBeaconDisabled: 88,
262
+ // PostBeaconDisabled: 88, // Not used
263
263
  PostBeaconSendFailed: 89,
264
264
  PostBeaconCSPViolation: 90,
265
265
  };
@@ -336,7 +336,7 @@
336
336
  return str;
337
337
  }
338
338
 
339
- var VERSION = "4.0.27";
339
+ var VERSION = "4.0.28";
340
340
  /**
341
341
  * Returns the version of the script as a float to be stored in legacy systems that do not support
342
342
  * string versions.
@@ -360,7 +360,10 @@
360
360
  * was prerendered or restored from BF cache
361
361
  */
362
362
  function shouldReportValue(value) {
363
- return value > 0 || getPageRestoreTime() || wasPrerendered();
363
+ if (getPageRestoreTime() || wasPrerendered()) {
364
+ return value >= 0;
365
+ }
366
+ return value > 0;
364
367
  }
365
368
  /**
366
369
  * Fit an array of user timing delimited strings into a URL and return both the entries that fit and
@@ -457,10 +460,6 @@
457
460
  };
458
461
  Beacon.prototype.send = function () {
459
462
  this.logger.logEvent(LogEvent.PostBeaconSendCalled);
460
- if (!this.config.enablePostBeacon) {
461
- this.logger.logEvent(LogEvent.PostBeaconDisabled);
462
- return;
463
- }
464
463
  for (var _i = 0, _a = this.onBeforeSendCbs; _i < _a.length; _i++) {
465
464
  var cb = _a[_i];
466
465
  cb();
@@ -531,7 +530,6 @@
531
530
  conversions: getProperty(obj, "conversions"),
532
531
  cookieDomain: getProperty(obj, "cookieDomain"),
533
532
  customerid: getProperty(obj, "customerid"),
534
- enablePostBeacon: getProperty(obj, "enablePostBeacon", true),
535
533
  errorBeaconUrl: getProperty(obj, "errorBeaconUrl", luxOrigin + "/error/"),
536
534
  interactionBeaconDelay: getProperty(obj, "interactionBeaconDelay", 200),
537
535
  jspagelabel: getProperty(obj, "jspagelabel"),
@@ -743,6 +741,9 @@
743
741
  function processEntry$1(entry) {
744
742
  if (entry.interactionId || (entry.entryType === "first-input" && !entryExists(entry))) {
745
743
  var duration = entry.duration, startTime = entry.startTime, interactionId = entry.interactionId, name_1 = entry.name, processingStart = entry.processingStart, processingEnd = entry.processingEnd, target = entry.target;
744
+ if (duration < 0) {
745
+ return;
746
+ }
746
747
  var processingTime = processingEnd - processingStart;
747
748
  var existingEntry = slowestEntriesMap[interactionId];
748
749
  var selector = target ? getNodeSelector(target) : null;
@@ -858,14 +859,14 @@
858
859
  };
859
860
  }
860
861
  }
861
- var value = processTimeMetric(lcpEntry.startTime);
862
+ var value = lcpEntry.startTime;
862
863
  if (!shouldReportValue(value)) {
863
864
  // It's possible the LCP entry we have occurred before the current page was initialised. In
864
865
  // this case, we don't want to report the LCP value.
865
866
  return undefined;
866
867
  }
867
868
  return {
868
- value: value,
869
+ value: processTimeMetric(value),
869
870
  subParts: subParts,
870
871
  attribution: lcpEntry.element
871
872
  ? {
@@ -128,25 +128,12 @@ $column-width: 9.5em;
128
128
 
129
129
  .gem-c-share-links--square-icons {
130
130
  .gem-c-share-links__link-icon {
131
- background-color: govuk-colour("dark-blue");
132
- color: govuk-colour("white");
131
+ background-color: govuk-colour("light-grey");
132
+ color: govuk-colour("black");
133
133
  padding: govuk-spacing(2);
134
134
  }
135
135
 
136
- .gem-c-share-links__link:hover {
137
- .gem-c-share-links__link-icon {
138
- background-color: govuk-colour("black");
139
- }
140
- }
141
-
142
- .gem-c-share-links__link:focus {
143
- .gem-c-share-links__link-icon {
144
- background-color: govuk-colour("black");
145
- }
146
- }
147
-
148
136
  .gem-c-share-links__label {
149
- color: govuk-colour("black");
150
137
  @include govuk-font(19, $weight: bold);
151
138
  }
152
139
  }
@@ -36,13 +36,13 @@
36
36
  // to black, reduce the font size, and improve the layout
37
37
  // of the printed href.
38
38
  //
39
- // .gem-c-print-link
39
+ // .gem-c-force-print-link-styles
40
40
  // ----------------------------------------------------------
41
41
  // Typically this class will be applied to existing
42
42
  // elements that have the `govuk-link` class but it can
43
43
  // also be used on other link elements.
44
44
  //
45
- // .gem-c-print-links-within
45
+ // .gem-c-force-print-link-styles-within
46
46
  // ----------------------------------------------------------
47
47
  // A variation of the previous print style, to be used on
48
48
  // parent elements that contain links with the `govuk-link`
@@ -52,8 +52,8 @@
52
52
 
53
53
  // stylelint-disable declaration-no-important
54
54
  @include govuk-media-query($media-type: print) {
55
- .gem-c-print-link,
56
- .gem-c-print-links-within .govuk-link {
55
+ .gem-c-force-print-link-styles,
56
+ .gem-c-force-print-link-styles-within .govuk-link {
57
57
  &,
58
58
  &:link,
59
59
  &:visited {
@@ -28,7 +28,7 @@
28
28
  css_classes << "gem-c-action-link--mobile-subtext" if mobile_subtext
29
29
  css_classes << shared_helper.get_margin_bottom
30
30
 
31
- link_classes = %w(govuk-link gem-c-action-link__link gem-c-print-link)
31
+ link_classes = %w(govuk-link gem-c-action-link__link gem-c-force-print-link-styles)
32
32
  link_classes << "govuk-link--inverse" if inverse
33
33
 
34
34
  component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
@@ -38,7 +38,7 @@
38
38
  <%= content_tag("h#{sub_heading_level}", class: "gem-c-cards__sub-heading govuk-heading-s") do %>
39
39
  <%=
40
40
  link_to link[:text], link[:path],
41
- class: "govuk-link gem-c-cards__link gem-c-print-link",
41
+ class: "govuk-link gem-c-cards__link gem-c-force-print-link-styles",
42
42
  data: link[:data_attributes]
43
43
  %>
44
44
  <% end %>
@@ -19,6 +19,8 @@
19
19
  link ||= false
20
20
  height ||= 400
21
21
  padding ||= false
22
+ point_size ||= 10
23
+ y_axis_auto_adjust ||= false
22
24
 
23
25
  chart_id = "chart-id-#{SecureRandom.hex(4)}"
24
26
  table_id = "table-id-#{SecureRandom.hex(4)}"
@@ -39,12 +41,13 @@
39
41
  font_19 = { color: '#000', fontName: 'GDS Transport', fontSize: '19', italic: false }
40
42
  legend = 'none'
41
43
  legend = { position: 'top', textStyle: font_16 } unless hide_legend
42
- pointSize = 10
43
- pointSize = 0 if minimal
44
+ point_size = 0 if minimal
44
45
  enableInteractivity = true
45
46
  enableInteractivity = false if minimal
46
47
  textPosition = nil
47
48
  textPosition = 'none' if minimal
49
+ y_axis_view_window_min = 0
50
+ y_axis_view_window_min = "auto" if y_axis_auto_adjust
48
51
 
49
52
  if !minimal && !chart_heading
50
53
  raise ArgumentError, "A chart heading must be provided for accessibility purposes."
@@ -56,22 +59,23 @@
56
59
  curveType: 'none',
57
60
  enableInteractivity: enableInteractivity,
58
61
  legend: legend,
59
- pointSize: pointSize,
62
+ pointSize: point_size,
60
63
  height: height,
61
64
  tooltip: { isHtml: true },
62
65
  hAxis: {
63
66
  textStyle: font_16,
64
- format: 'd MMM Y', # https://developers.google.com/chart/interactive/docs/reference#dateformatter
65
67
  title: h_axis_title,
66
68
  titleTextStyle: font_19,
67
69
  textPosition: textPosition,
68
70
  },
69
71
  vAxis: {
70
- format: '#,###,###',
71
72
  textStyle: font_16,
72
73
  title: v_axis_title,
73
74
  titleTextStyle: font_19,
74
75
  textPosition: textPosition,
76
+ viewWindow: {
77
+ min: y_axis_view_window_min
78
+ }
75
79
  },
76
80
  }
77
81
 
@@ -13,7 +13,7 @@
13
13
  cl_helper = GovukPublishingComponents::Presenters::ContentsListHelper.new(local_assigns)
14
14
  brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand)
15
15
 
16
- link_classes = %w[gem-c-contents-list__link govuk-link gem-c-print-link]
16
+ link_classes = %w[gem-c-contents-list__link govuk-link gem-c-force-print-link-styles]
17
17
  link_classes << brand_helper.color_class
18
18
  link_classes << "govuk-link--no-underline" unless underline_links
19
19
 
@@ -35,7 +35,7 @@
35
35
  <% if devolved_nations_helper.nations_with_urls.any? %>
36
36
  <%= content_tag :ul, class: "govuk-list govuk-!-margin-top-1 govuk-!-margin-bottom-0" do -%>
37
37
  <% devolved_nations_helper.nations_with_urls.each do |k, v| %>
38
- <%= content_tag(:li, link_to(devolved_nations_helper.alternative_content_text(k), v[:alternative_url], class: "govuk-link gem-c-print-link")) %>
38
+ <%= content_tag(:li, link_to(devolved_nations_helper.alternative_content_text(k), v[:alternative_url], class: "govuk-link gem-c-force-print-link-styles")) %>
39
39
  <% end %>
40
40
  <% end %>
41
41
  <% end %>
@@ -57,7 +57,7 @@
57
57
  item[:link][:text],
58
58
  item[:link][:path],
59
59
  data: item[:link][:data_attributes],
60
- class: "#{item_classes} govuk-link gem-c-print-link #{extra_link_classes}",
60
+ class: "#{item_classes} govuk-link gem-c-force-print-link-styles #{extra_link_classes}",
61
61
  lang: item[:link][:locale].presence,
62
62
  rel: rel,
63
63
  )
@@ -118,7 +118,7 @@
118
118
  part[:link][:text],
119
119
  part[:link][:path],
120
120
  data: part[:link][:data_attributes],
121
- class: "gem-c-document-list-child__heading gem-c-document-list-child__link #{brand_helper.color_class} govuk-link gem-c-print-link #{extra_link_classes}",
121
+ class: "gem-c-document-list-child__heading gem-c-document-list-child__link #{brand_helper.color_class} govuk-link gem-c-force-print-link-styles #{extra_link_classes}",
122
122
  )
123
123
  else
124
124
  content_tag(
@@ -25,14 +25,14 @@
25
25
  heading_link_classes = %w[
26
26
  gem-c-image-card__title-link
27
27
  govuk-link
28
- gem-c-print-link
28
+ gem-c-force-print-link-styles
29
29
  ]
30
30
  heading_link_classes << brand_helper.color_class
31
31
  heading_link_classes << "gem-c-image-card__title-link--large-font-size-mobile" if card_helper.large_mobile_font_size?
32
32
  extra_link_classes = %w[
33
33
  gem-c-image-card__list-item-link
34
34
  govuk-link
35
- gem-c-print-link
35
+ gem-c-force-print-link-styles
36
36
  ]
37
37
  extra_link_classes << brand_helper.color_class
38
38
 
@@ -11,7 +11,7 @@
11
11
  })
12
12
 
13
13
  component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
14
- component_helper.add_class("gem-c-inset-text govuk-inset-text gem-c-print-links-within")
14
+ component_helper.add_class("gem-c-inset-text govuk-inset-text gem-c-force-print-link-styles-within")
15
15
  component_helper.add_class(shared_helper.get_margin_top)
16
16
  component_helper.add_class(shared_helper.get_margin_bottom)
17
17
  component_helper.set_id(id)
@@ -38,7 +38,7 @@
38
38
  data_attributes[:ga4_intervention_banner] = "" unless disable_ga4 # Added to the parent element for the GA4 pageview object to use
39
39
 
40
40
  suggestion_tag_options = {
41
- class: "govuk-link gem-c-print-link",
41
+ class: "govuk-link gem-c-force-print-link-styles",
42
42
  href: suggestion_link_url,
43
43
  data: suggestion_data_attributes,
44
44
  }
@@ -35,7 +35,7 @@
35
35
  <strong class="gem-c-step-nav-header__part-of">Part of</strong>
36
36
  <% if path %>
37
37
  <a href="<%= path %>"
38
- class="gem-c-step-nav-header__title govuk-link gem-c-print-link"
38
+ class="gem-c-step-nav-header__title govuk-link gem-c-force-print-link-styles"
39
39
  <% unless disable_ga4 %>
40
40
  data-ga4-link='<%= ga4_data %>'
41
41
  <% end %>
@@ -15,7 +15,7 @@
15
15
  <span class="gem-c-step-nav-related__pretitle"><%= pretitle %></span>
16
16
  <% if links.length == 1 && !always_display_as_list %>
17
17
  <a href="<%= links[0][:href] %>"
18
- class="govuk-link gem-c-print-link"
18
+ class="govuk-link gem-c-force-print-link-styles"
19
19
  <% unless disable_ga4
20
20
  ga4_attributes = {
21
21
  event_name: "navigation",
@@ -37,7 +37,7 @@
37
37
  <% links.each_with_index do |link, index| %>
38
38
  <li class="gem-c-step-nav-related__link-item">
39
39
  <a href="<%= link[:href] %>"
40
- class="govuk-link gem-c-print-link"
40
+ class="govuk-link gem-c-force-print-link-styles"
41
41
  <% unless disable_ga4
42
42
  ga4_attributes = {
43
43
  event_name: "navigation",
@@ -6,7 +6,7 @@ body: |
6
6
  The chart relies upon chartkick and renders using JavaScript, so the table is provided as a fallback for a lack of JavaScript,
7
7
  an accessible view on the data for screenreaders, and a simple view of the raw data for all users.
8
8
 
9
- The `chart_overview` option can be used to provide an explanation for screen reader users of what the graph shows.
9
+ The `chart_overview` option can be used to provide an explanation for screen reader users of what the chart shows.
10
10
  accessibility_criteria: |
11
11
  Charts must:
12
12
 
@@ -137,6 +137,80 @@ examples:
137
137
  - 118
138
138
  - 85
139
139
  - 80
140
+ with_a_different_point_size:
141
+ description: For some charts it may be better to reduce the point size so that the line is clearer. However it is recommended that the point size is larger to make it easier for users to move the mouse over them.
142
+ data:
143
+ chart_heading: Page views chart
144
+ h_axis_title: Day
145
+ v_axis_title: Views
146
+ chart_overview: This chart shows page views for January 2015.
147
+ point_size: 0
148
+ keys:
149
+ - "2015-01-01"
150
+ - "2015-01-02"
151
+ - "2015-01-03"
152
+ - "2015-01-04"
153
+ - "2015-01-05"
154
+ - "2015-01-06"
155
+ - "2015-01-07"
156
+ - "2015-01-08"
157
+ - "2015-01-09"
158
+ - "2015-01-10"
159
+ rows:
160
+ - label: January 2015
161
+ values:
162
+ - 600
163
+ - 690
164
+ - 740
165
+ - 820
166
+ - 570
167
+ - 950
168
+ - 810
169
+ - 610
170
+ - 770
171
+ - 530
172
+ scale_y_axis_based_on_data:
173
+ description: |
174
+ By default the Y-axis will always start at zero, but this may not always be required.
175
+
176
+ If there are empty items in the data the chart line will either discontinue or leave a gap, as shown.
177
+ data:
178
+ chart_heading: Page views chart
179
+ h_axis_title: Day
180
+ v_axis_title: Views
181
+ chart_overview: This chart shows page views for January 2015.
182
+ hide_legend: true
183
+ y_axis_auto_adjust: true
184
+ keys:
185
+ - "2015-01-01"
186
+ - "2015-01-02"
187
+ - "2015-01-03"
188
+ - "2015-01-04"
189
+ - "2015-01-05"
190
+ - "2015-01-06"
191
+ - "2015-01-07"
192
+ - "2015-01-08"
193
+ - "2015-01-09"
194
+ - "2015-01-10"
195
+ - "2015-01-11"
196
+ - "2015-01-12"
197
+ - "2015-01-13"
198
+ rows:
199
+ - label: January 2015
200
+ values:
201
+ - 1500
202
+ - 1190
203
+ - 1740
204
+ - 1820
205
+ - 1270
206
+ -
207
+ -
208
+ - 1450
209
+ - 1110
210
+ - 1210
211
+ - 1670
212
+ - 1430
213
+ - 1352
140
214
  with_a_different_heading_level:
141
215
  description: Use a different heading level for the chart heading. It defaults to a H2.
142
216
  data:
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "45.4.0".freeze
2
+ VERSION = "45.5.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: 45.4.0
4
+ version: 45.5.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: 2024-11-15 00:00:00.000000000 Z
11
+ date: 2024-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chartkick