govuk_publishing_components 43.0.1 → 43.1.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.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/component_guide/application.js +1 -0
  3. data/app/assets/javascripts/govuk_publishing_components/components/password-input.js +5 -0
  4. data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js +10 -17
  5. data/app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-reporter.js +39 -17
  6. data/app/assets/stylesheets/component_guide/application.scss +1 -1
  7. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +2 -0
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_cross-service-header.scss +3 -1
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_intervention.scss +1 -1
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_inverse-header.scss +3 -1
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-footer.scss +32 -3
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +1 -3
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +1 -1
  14. data/app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss +1 -1
  15. data/app/assets/stylesheets/govuk_publishing_components/components/_password-input.scss +2 -0
  16. data/app/assets/stylesheets/govuk_publishing_components/components/_phase-banner.scss +1 -1
  17. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-header.scss +1 -1
  18. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-related.scss +1 -1
  19. data/app/assets/stylesheets/govuk_publishing_components/components/_success-alert.scss +1 -1
  20. data/app/assets/stylesheets/govuk_publishing_components/components/_summary-card.scss +16 -0
  21. data/app/assets/stylesheets/govuk_publishing_components/components/_table.scss +1 -1
  22. data/app/assets/stylesheets/govuk_publishing_components/components/_warning-text.scss +1 -1
  23. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_button.scss +1 -1
  24. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_highlight-answer.scss +2 -4
  25. data/app/assets/stylesheets/govuk_publishing_components/govuk_frontend_support.scss +4 -0
  26. data/app/views/govuk_publishing_components/components/_chat_entry.html.erb +13 -1
  27. data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +1 -1
  28. data/app/views/govuk_publishing_components/components/_password_input.html.erb +78 -0
  29. data/app/views/govuk_publishing_components/components/_summary_card.html.erb +62 -0
  30. data/app/views/govuk_publishing_components/components/docs/chat_entry.yml +5 -0
  31. data/app/views/govuk_publishing_components/components/docs/password_input.yml +45 -0
  32. data/app/views/govuk_publishing_components/components/docs/summary_card.yml +93 -0
  33. data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +6 -3
  34. data/app/views/govuk_publishing_components/components/layout_header/_search.html.erb +7 -2
  35. data/config/locales/ar.yml +5 -0
  36. data/config/locales/az.yml +5 -0
  37. data/config/locales/be.yml +5 -0
  38. data/config/locales/bg.yml +5 -0
  39. data/config/locales/bn.yml +5 -0
  40. data/config/locales/cs.yml +5 -0
  41. data/config/locales/cy.yml +5 -0
  42. data/config/locales/da.yml +5 -0
  43. data/config/locales/de.yml +5 -0
  44. data/config/locales/dr.yml +5 -0
  45. data/config/locales/el.yml +5 -0
  46. data/config/locales/en.yml +5 -0
  47. data/config/locales/es-419.yml +5 -0
  48. data/config/locales/es.yml +5 -0
  49. data/config/locales/et.yml +5 -0
  50. data/config/locales/fa.yml +5 -0
  51. data/config/locales/fi.yml +5 -0
  52. data/config/locales/fr.yml +5 -0
  53. data/config/locales/gd.yml +5 -0
  54. data/config/locales/gu.yml +5 -0
  55. data/config/locales/he.yml +5 -0
  56. data/config/locales/hi.yml +5 -0
  57. data/config/locales/hr.yml +5 -0
  58. data/config/locales/hu.yml +5 -0
  59. data/config/locales/hy.yml +5 -0
  60. data/config/locales/id.yml +5 -0
  61. data/config/locales/is.yml +5 -0
  62. data/config/locales/it.yml +5 -0
  63. data/config/locales/ja.yml +5 -0
  64. data/config/locales/ka.yml +5 -0
  65. data/config/locales/kk.yml +5 -0
  66. data/config/locales/ko.yml +5 -0
  67. data/config/locales/lt.yml +5 -0
  68. data/config/locales/lv.yml +5 -0
  69. data/config/locales/ms.yml +5 -0
  70. data/config/locales/mt.yml +5 -0
  71. data/config/locales/nl.yml +5 -0
  72. data/config/locales/no.yml +5 -0
  73. data/config/locales/pa-pk.yml +5 -0
  74. data/config/locales/pa.yml +5 -0
  75. data/config/locales/pl.yml +5 -0
  76. data/config/locales/ps.yml +5 -0
  77. data/config/locales/pt.yml +5 -0
  78. data/config/locales/ro.yml +5 -0
  79. data/config/locales/ru.yml +5 -0
  80. data/config/locales/si.yml +5 -0
  81. data/config/locales/sk.yml +5 -0
  82. data/config/locales/sl.yml +5 -0
  83. data/config/locales/so.yml +5 -0
  84. data/config/locales/sq.yml +5 -0
  85. data/config/locales/sr.yml +5 -0
  86. data/config/locales/sv.yml +5 -0
  87. data/config/locales/sw.yml +5 -0
  88. data/config/locales/ta.yml +5 -0
  89. data/config/locales/th.yml +5 -0
  90. data/config/locales/tk.yml +5 -0
  91. data/config/locales/tr.yml +5 -0
  92. data/config/locales/uk.yml +5 -0
  93. data/config/locales/ur.yml +5 -0
  94. data/config/locales/uz.yml +5 -0
  95. data/config/locales/vi.yml +5 -0
  96. data/config/locales/zh-hk.yml +5 -0
  97. data/config/locales/zh-tw.yml +5 -0
  98. data/config/locales/zh.yml +5 -0
  99. data/lib/govuk_publishing_components/version.rb +1 -1
  100. data/node_modules/sortablejs/README.md +3 -2
  101. data/node_modules/sortablejs/Sortable.js +5 -4
  102. data/node_modules/sortablejs/Sortable.min.js +2 -2
  103. data/node_modules/sortablejs/modular/sortable.complete.esm.js +5 -4
  104. data/node_modules/sortablejs/modular/sortable.core.esm.js +5 -4
  105. data/node_modules/sortablejs/modular/sortable.esm.js +5 -4
  106. data/node_modules/sortablejs/package.json +3 -2
  107. data/node_modules/sortablejs/src/Animation.js +175 -0
  108. data/node_modules/sortablejs/src/BrowserInfo.js +12 -0
  109. data/node_modules/sortablejs/src/EventDispatcher.js +57 -0
  110. data/node_modules/sortablejs/src/PluginManager.js +94 -0
  111. data/node_modules/sortablejs/src/Sortable.js +2011 -0
  112. data/node_modules/sortablejs/src/utils.js +595 -0
  113. metadata +15 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4ee692ce9fb25200d425b34aa5f0637ca4d0632fdbcf46d3b3ae3483662d1d29
4
- data.tar.gz: 517faafdb589e9cc379af61414487579107050a3e3d01545956c0913202da2b8
3
+ metadata.gz: 0cd528b4f8f215e98dc668b8aebbc8a70830275d42df7aadae6d26d8763ea932
4
+ data.tar.gz: 9406315ea8c87a29bbfe16c9243f8e05e6fb6f418ec10b41d16493891c92d9b4
5
5
  SHA512:
6
- metadata.gz: 621e5b66172186ca65e58aedfb29f6271f65ea7f888b7b2aa85f20e3c385b6528bec15168df542d40cd260d8d2453651ad7d595b8e9974baaac69e2c5ecaeffd
7
- data.tar.gz: 267b3aa8d271d5a84c6b529c476f61122c43e9161c89245086ef7e170a9c0fd50805af45305639d7b8360e38765cdf63454468e6f465cce2a99dbf4869053698
6
+ metadata.gz: 5bd32ba843de584bfb07f87df4c3dc7624b3fb65d7cd6f46e6f21cc711950c102edc302cc2004570908e7f18a425315983c516f97d0a370654281803a9b7b394
7
+ data.tar.gz: d4deba88fd859ddce5ecec74087f169b45a305f84af32a3be12b3666a70c179d6d75901f22c1f7e7dde7b788f98db806fdcf929f3f9809ec649dfd100f06198e
@@ -3,4 +3,5 @@
3
3
  //= require ../govuk_publishing_components/dependencies
4
4
  //= require ../govuk_publishing_components/components/accordion
5
5
  //= require ../govuk_publishing_components/components/intervention
6
+ //= require ../govuk_publishing_components/components/password-input
6
7
  //= require ../govuk_publishing_components/components/tabs
@@ -0,0 +1,5 @@
1
+ // This component relies on JavaScript from GOV.UK Frontend
2
+ // = require govuk/components/password-input/password-input.bundle.js
3
+ window.GOVUK = window.GOVUK || {}
4
+ window.GOVUK.Modules = window.GOVUK.Modules || {}
5
+ window.GOVUK.Modules.GovukPasswordInput = window.GOVUKFrontend.PasswordInput
@@ -32,7 +32,7 @@
32
32
  link: $link
33
33
  }
34
34
 
35
- if (href.indexOf('/live_stream') >= 0) {
35
+ if (href.includes('/live_stream')) {
36
36
  var channelId = YoutubeLinkEnhancement.parseLivestream(href)
37
37
 
38
38
  if (!this.hasDisabledEmbed($link) && channelId) {
@@ -175,23 +175,16 @@
175
175
  // This is a public class method so it can be used outside of this embed to
176
176
  // check that user input for videos will be supported in govspeak
177
177
  YoutubeLinkEnhancement.parseVideoId = function (url) {
178
- var parts
178
+ var u
179
179
 
180
- if (url.indexOf('youtube.com') > -1) {
181
- var params = {}
182
- parts = url.split('?')
183
- if (parts.length === 1) {
184
- return
185
- }
186
- parts = parts[1].split('&')
187
- for (var i = 0; i < parts.length; i++) {
188
- var part = parts[i].split('=')
189
- params[part[0]] = part[1]
190
- }
191
- return params.v
192
- } else if (url.indexOf('youtu.be') > -1) {
193
- parts = url.split('/')
194
- return parts.pop()
180
+ try {
181
+ u = new URL(url)
182
+ } catch (e) { return undefined }
183
+
184
+ if (u.host === 'www.youtube.com' || u.host === 'youtube.com') {
185
+ return u.searchParams.get('v') || undefined
186
+ } else if (u.host === 'youtu.be') {
187
+ return u.pathname.slice(1) // Trim the leading /
195
188
  }
196
189
  }
197
190
 
@@ -60,6 +60,21 @@
60
60
  }
61
61
  return "";
62
62
  }
63
+ /**
64
+ * Returns the delivery type for the current document. To differentiate between the valid empty
65
+ * string value and browsers that don't support PerformanceResourceTiming.deliveryType, we convert
66
+ * the empty string value to "(empty string)". Browsers that don't support deliveryType will return
67
+ * null. Despite straying from the spec, this allows us to differentiate between the two cases.
68
+ *
69
+ * @see https://w3c.github.io/resource-timing/#dom-performanceresourcetiming-deliverytype
70
+ */
71
+ function deliveryType() {
72
+ var navEntry = getNavigationEntry();
73
+ if ("deliveryType" in navEntry) {
74
+ return navEntry.deliveryType || "(empty string)";
75
+ }
76
+ return undefined;
77
+ }
63
78
  function getNavigationEntry() {
64
79
  var navEntries = getEntriesByType("navigation");
65
80
  if (navEntries.length) {
@@ -321,7 +336,7 @@
321
336
  return str;
322
337
  }
323
338
 
324
- var VERSION = "4.0.25";
339
+ var VERSION = "4.0.26";
325
340
  /**
326
341
  * Returns the version of the script as a float to be stored in legacy systems that do not support
327
342
  * string versions.
@@ -666,25 +681,25 @@
666
681
  startTime: processTimeMetric(entry.startTime),
667
682
  elementSelector: getNodeSelector(source.node),
668
683
  elementType: source.node.nodeName,
669
- }); })
684
+ }); })
670
685
  : [];
671
686
  if (sessionEntries.length &&
672
687
  (entry.startTime - latestEntry.startTime >= 1000 ||
673
688
  entry.startTime - firstEntry.startTime >= 5000)) {
674
- sessionValue = entry.value;
675
- sessionEntries = [entry];
676
- sessionAttributions = sources;
689
+ sessionValue = entry.value;
690
+ sessionEntries = [entry];
691
+ sessionAttributions = sources;
692
+ largestEntry = entry;
693
+ }
694
+ else {
695
+ sessionValue += entry.value;
696
+ sessionEntries.push(entry);
697
+ sessionAttributions = sessionAttributions.concat(sources);
698
+ if (!largestEntry || entry.value > largestEntry.value) {
677
699
  largestEntry = entry;
678
700
  }
679
- else {
680
- sessionValue += entry.value;
681
- sessionEntries.push(entry);
682
- sessionAttributions = sessionAttributions.concat(sources);
683
- if (!largestEntry || entry.value > largestEntry.value) {
684
- largestEntry = entry;
685
- }
686
- }
687
- maximumSessionValue = max(maximumSessionValue, sessionValue);
701
+ }
702
+ maximumSessionValue = max(maximumSessionValue, sessionValue);
688
703
  }
689
704
  }
690
705
  function reset$2() {
@@ -1946,7 +1961,7 @@
1946
1961
  ].join("");
1947
1962
  }
1948
1963
  function getCustomerId() {
1949
- return LUX.customerid || "";
1964
+ return String(_thisCustomerId) || "";
1950
1965
  }
1951
1966
  function avgDomDepth() {
1952
1967
  var aElems = document.getElementsByTagName("*");
@@ -2184,6 +2199,12 @@
2184
2199
  var baseUrl = _getBeaconUrl(getAllCustomData());
2185
2200
  var is = inlineTagSize("script");
2186
2201
  var ic = inlineTagSize("style");
2202
+ var ds = docSize();
2203
+ var ct = connectionType();
2204
+ var dt = deliveryType();
2205
+ // Note some page stat values (the `PS` query string) are non-numeric. To make extracting these
2206
+ // values easier, we append an underscore "_" to the value. Values this is used for include
2207
+ // connection type (ct) and delivery type (dt).
2187
2208
  var metricsQueryString =
2188
2209
  // only send Nav Timing and lux.js metrics on initial pageload (not for SPA page views)
2189
2210
  (gbNavSent ? "" : "&NT=" + getNavTiming()) +
@@ -2216,8 +2237,9 @@
2216
2237
  docHeight(document) +
2217
2238
  "dw" +
2218
2239
  docWidth(document) +
2219
- (docSize() ? "ds" + docSize() : "") + // document HTTP transfer size (bytes)
2220
- (connectionType() ? "ct" + connectionType() + "_" : "") + // delimit with "_" since values can be non-numeric so need a way to extract with regex in VCL
2240
+ (ds ? "ds" + ds : "") + // document HTTP transfer size (bytes)
2241
+ (ct ? "ct" + ct + "_" : "") + // connection type
2242
+ (typeof dt !== "undefined" ? "dt" + dt + "_" : "") + // delivery type
2221
2243
  "er" +
2222
2244
  nErrors +
2223
2245
  "nt" +
@@ -139,7 +139,7 @@ $gem-guide-border-width: 1px;
139
139
 
140
140
  @include govuk-media-query($media-type: print) {
141
141
  &[class*="-background"] {
142
- background-color: unset;
142
+ background: none;
143
143
  }
144
144
  }
145
145
  }
@@ -59,6 +59,7 @@
59
59
  @import "components/option-select";
60
60
  @import "components/organisation-logo";
61
61
  @import "components/panel";
62
+ @import "components/password-input";
62
63
  @import "components/phase-banner";
63
64
  @import "components/previous-and-next-navigation";
64
65
  @import "components/print-link";
@@ -76,6 +77,7 @@
76
77
  @import "components/step-by-step-nav";
77
78
  @import "components/subscription-links";
78
79
  @import "components/success-alert";
80
+ @import "components/summary-card";
79
81
  @import "components/summary-list";
80
82
  @import "components/tabs";
81
83
  @import "components/table";
@@ -443,7 +443,7 @@ $govuk-header-link-underline-thickness: 3px;
443
443
  }
444
444
 
445
445
  .gem-c-one-login-header {
446
- background-color: initial;
446
+ background: none;
447
447
  border-bottom: 2pt solid $govuk-print-text-colour;
448
448
 
449
449
  * {
@@ -456,6 +456,8 @@ $govuk-header-link-underline-thickness: 3px;
456
456
  }
457
457
 
458
458
  .gem-c-service-header {
459
+ background: none;
460
+
459
461
  .govuk-width-container {
460
462
  margin: 0;
461
463
  }
@@ -26,7 +26,7 @@
26
26
  @include govuk-media-query($media-type: print) {
27
27
  .gem-c-intervention {
28
28
  break-inside: avoid;
29
- background-color: transparent;
29
+ background: none;
30
30
  border-color: $govuk-print-text-colour;
31
31
 
32
32
  .govuk-body {
@@ -30,7 +30,9 @@
30
30
 
31
31
  @include govuk-media-query($media-type: print) {
32
32
  .gem-c-inverse-header {
33
- background-color: unset;
33
+ background: none;
34
+ padding-left: 0;
35
+ padding-right: 0;
34
36
  border-bottom: 2pt solid $govuk-print-text-colour;
35
37
 
36
38
  &,
@@ -21,10 +21,39 @@
21
21
  margin-bottom: 20px;
22
22
  }
23
23
 
24
- // stylelint-disable declaration-no-important
25
24
  @include govuk-media-query($media-type: print) {
25
+ .govuk-footer {
26
+ background: none;
27
+ margin: 25mm 0 0;
28
+ padding: 5mm 0 0;
29
+ border-top: 2pt solid $govuk-print-text-colour;
30
+
31
+ .govuk-width-container {
32
+ margin: 0;
33
+ }
34
+ }
35
+
36
+ .govuk-footer__meta,
37
+ .govuk-footer__meta-item {
38
+ border: 0;
39
+ padding: 0;
40
+ margin: 0;
41
+ }
42
+
43
+ .govuk-footer__licence-description {
44
+ padding-right: 10mm;
45
+ }
46
+
47
+ .govuk-footer__copyright-logo {
48
+ min-width: auto;
49
+ padding-top: 13mm;
50
+ background-size: 15mm;
51
+ background-position: center top;
52
+ print-color-adjust: exact;
53
+ -webkit-print-color-adjust: exact;
54
+ }
55
+
26
56
  .gem-c-layout-footer {
27
- font-size: 12pt !important;
57
+ font-size: 10pt !important; // stylelint-disable-line declaration-no-important
28
58
  }
29
59
  }
30
- // stylelint-enable declaration-no-important
@@ -148,8 +148,6 @@
148
148
  }
149
149
 
150
150
  .gem-c-layout-header__search-form {
151
- display: none;
152
-
153
151
  &.js-visible {
154
152
  display: block;
155
153
  }
@@ -185,7 +183,7 @@
185
183
  .gem-c-header__product-name,
186
184
  .gem-c-environment-tag {
187
185
  color: $govuk-print-text-colour;
188
- background-color: unset;
186
+ background: none;
189
187
  }
190
188
  }
191
189
  }
@@ -989,7 +989,7 @@ $after-button-padding-left: govuk-spacing(4);
989
989
  border-top: 0;
990
990
  border-bottom: 2pt solid $govuk-print-text-colour;
991
991
  margin: 0 0 5mm;
992
- background-color: transparent;
992
+ background: none;
993
993
 
994
994
  &:has(.gem-c-layout-super-navigation-header__header-logo .govuk-visually-hidden) {
995
995
  border: 0;
@@ -100,7 +100,7 @@
100
100
  .gem-c-metadata {
101
101
  break-inside: avoid;
102
102
  color: $govuk-print-text-colour !important;
103
- background-color: unset;
103
+ background: none;
104
104
  margin-bottom: 5mm;
105
105
 
106
106
  a,
@@ -0,0 +1,2 @@
1
+ @import "govuk_publishing_components/individual_component_support";
2
+ @import "govuk/components/password-input/password-input";
@@ -32,7 +32,7 @@
32
32
  .gem-c-phase-banner {
33
33
  &,
34
34
  & * {
35
- background-color: unset !important;
35
+ background: none !important;
36
36
  color: $govuk-print-text-colour !important;
37
37
  }
38
38
 
@@ -22,7 +22,7 @@
22
22
  @include govuk-media-query($media-type: print) {
23
23
  .gem-c-step-nav-header {
24
24
  padding: 0 0 govuk-spacing(4) 0;
25
- background: unset;
25
+ background: none;
26
26
  border-color: $govuk-print-text-colour;
27
27
  }
28
28
 
@@ -48,7 +48,7 @@
48
48
  // stylelint-disable declaration-no-important
49
49
  @include govuk-media-query($media-type: print) {
50
50
  .gem-c-step-nav-related {
51
- background: unset;
51
+ background: none;
52
52
  border-color: $govuk-print-text-colour;
53
53
  }
54
54
 
@@ -9,7 +9,7 @@
9
9
  @include govuk-media-query($media-type: print) {
10
10
  .gem-c-success-alert {
11
11
  break-inside: avoid;
12
- background-color: initial;
12
+ background: none;
13
13
  border-color: $govuk-print-text-colour;
14
14
 
15
15
  * {
@@ -0,0 +1,16 @@
1
+ @import "govuk_publishing_components/individual_component_support";
2
+ @import "govuk/components/summary-list/summary-list";
3
+
4
+ .gem-c-summary-card {
5
+ .govuk-summary-list__key {
6
+ vertical-align: top;
7
+ }
8
+
9
+ .govuk-summary-list__actions {
10
+ width: auto;
11
+ }
12
+
13
+ img {
14
+ display: block;
15
+ }
16
+ }
@@ -133,7 +133,7 @@ $table-row-even-background-colour: govuk-colour("light-grey");
133
133
 
134
134
  * {
135
135
  color: $govuk-print-text-colour !important;
136
- background-color: initial !important;
136
+ background: none !important;
137
137
  }
138
138
 
139
139
  .govuk-table__header,
@@ -28,7 +28,7 @@
28
28
  }
29
29
 
30
30
  .govuk-warning-text__icon {
31
- background-color: transparent;
31
+ background: none;
32
32
  color: $govuk-print-text-colour;
33
33
  }
34
34
  }
@@ -32,7 +32,7 @@
32
32
 
33
33
  &,
34
34
  & * {
35
- background-color: unset;
35
+ background: none;
36
36
  color: $govuk-print-text-colour !important; // stylelint-disable-line declaration-no-important
37
37
  }
38
38
 
@@ -44,15 +44,13 @@ $highlight-answer-color: govuk-colour("white");
44
44
  }
45
45
  }
46
46
 
47
- // stylelint-disable declaration-no-important
48
47
  @include govuk-media-query($media-type: print) {
49
- background-color: unset;
48
+ background: none;
50
49
 
51
50
  &,
52
51
  & * {
53
- color: $govuk-print-text-colour !important;
52
+ color: $govuk-print-text-colour !important; // stylelint-disable-line declaration-no-important
54
53
  }
55
54
  }
56
- // stylelint-enable declaration-no-important
57
55
  }
58
56
  }
@@ -8,6 +8,10 @@
8
8
  @import "components/mixins/govuk-template-link-focus-override";
9
9
  @import "components/mixins/css3";
10
10
 
11
+ $govuk-suppressed-warnings: (
12
+ organisation-colours
13
+ );
14
+
11
15
  $gem-secondary-button-colour: #00823b;
12
16
  $gem-secondary-button-hover-colour: darken($gem-secondary-button-colour, 5%);
13
17
  $gem-secondary-button-background-colour: govuk-colour("white");
@@ -7,12 +7,24 @@
7
7
  description_text ||= t("components.chat_entry.description")
8
8
  border_top ||= false
9
9
  border_bottom ||= false
10
+ disable_ga4 ||= false
10
11
 
11
12
  component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
12
13
  component_helper.add_class("gem-c-chat-entry")
13
14
  component_helper.add_class("gem-c-chat-entry--border-top") if border_top
14
15
  component_helper.add_class("gem-c-chat-entry--border-bottom") if border_bottom
15
16
  component_helper.add_class(shared_helper.get_margin_bottom)
17
+ component_helper.add_data_attribute({ module: "ga4-link-tracker" }) unless disable_ga4
18
+
19
+ unless disable_ga4
20
+ ga4_link_data = {
21
+ ga4_link: {
22
+ event_name: "navigation",
23
+ type: "callout",
24
+ section: "GOV.UK Chat entry",
25
+ }.to_json
26
+ }
27
+ end
16
28
  %>
17
29
 
18
30
  <%= tag.div(**component_helper.all_attributes) do %>
@@ -36,7 +48,7 @@
36
48
 
37
49
  <div class="gem-c-chat-entry__description">
38
50
  <%= content_tag(shared_helper.get_heading_level, class: "gem-c-chat-entry__heading") do %>
39
- <%= link_to heading_text, href, class: "govuk-link" %>
51
+ <%= link_to heading_text, href, class: "govuk-link", data: ga4_link_data %>
40
52
  <% end %>
41
53
 
42
54
  <% if description_text %>
@@ -63,7 +63,7 @@
63
63
  <% end %>
64
64
  </div>
65
65
 
66
- <hr class="govuk-footer__section-break">
66
+ <hr class="govuk-footer__section-break govuk-!-display-none-print">
67
67
  <% end %>
68
68
  <div class="govuk-footer__meta">
69
69
  <div class="govuk-footer__meta-item govuk-footer__meta-item--grow">
@@ -0,0 +1,78 @@
1
+ <%
2
+ add_gem_component_stylesheet("password-input")
3
+
4
+ label_text ||= t("components.password_input.label")
5
+
6
+ error_text ||= nil
7
+ error_text_prefix ||= t("components.password_input.error_text_prefix")
8
+
9
+ shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
10
+ component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
11
+ component_helper.add_data_attribute({ module: "govuk-password-input" })
12
+ component_helper.add_class('govuk-form-group')
13
+ component_helper.add_class('govuk-form-group--error') if error_text
14
+ component_helper.add_class('govuk-password-input')
15
+ component_helper.add_class('gem-c-password-input')
16
+ component_helper.add_class(shared_helper.get_margin_bottom)
17
+
18
+ uid = SecureRandom.hex(4)
19
+
20
+ label_for = uid + '-password-input'
21
+
22
+ input_name = 'password'
23
+ input_id = uid + '-password-input'
24
+
25
+ aria_controls = uid + '-password-input'
26
+
27
+ input_classes = %w(govuk-input govuk-password-input__input govuk-js-password-input-input)
28
+
29
+ if error_text
30
+ label_for << '-with-error-message'
31
+ input_id << '-with-error-message'
32
+ input_name << '-input-with-error-message'
33
+ input_classes << 'govuk-input--error'
34
+ aria_controls << '-with-error-message'
35
+ paragraph_id = uid + '-password-input-with-error-message-error'
36
+ end
37
+
38
+ %>
39
+
40
+ <%= tag.div(**component_helper.all_attributes) do %>
41
+ <%= render "govuk_publishing_components/components/label", {
42
+ text: label_text,
43
+ html_for: label_for
44
+ } %>
45
+ <% if error_text %>
46
+ <p id="<%= paragraph_id %>" class="govuk-error-message">
47
+ <span class="govuk-visually-hidden"><%= error_text_prefix %>:</span> <%= error_text %>
48
+ </p>
49
+ <% end %>
50
+
51
+ <div class="govuk-input__wrapper govuk-password-input__wrapper">
52
+ <%= tag.input(
53
+ name: input_name,
54
+ type: "password",
55
+ class: input_classes,
56
+ id: input_id,
57
+ spellcheck: false,
58
+ autocomplete: "current-password",
59
+ autocapitalize: "none",
60
+ aria: {
61
+ describedby: paragraph_id
62
+ }) %>
63
+
64
+ <%= tag.button(
65
+ type: "button",
66
+ class: "govuk-button govuk-button--secondary govuk-password-input__toggle govuk-js-password-input-toggle",
67
+ data: {
68
+ module: "govuk-button"
69
+ },
70
+ hidden: true,
71
+ aria: {
72
+ controls: aria_controls,
73
+ label: t("components.password_input.button_aria_label")
74
+ }) do %>
75
+ <%= t("components.password_input.button") %>
76
+ <% end %>
77
+ </div>
78
+ <% end %>
@@ -0,0 +1,62 @@
1
+ <%
2
+ add_gem_component_stylesheet("summary-card")
3
+
4
+ id ||= nil
5
+ title ||= nil
6
+ data_attributes ||= {}
7
+ summary_card_actions ||= []
8
+ rows ||=[]
9
+ %>
10
+ <% if title || rows.any? %>
11
+ <%= tag.div class: "gem-c-summary-card", id: id, data: data_attributes do %>
12
+ <%= tag.div class: "govuk-summary-card" do %>
13
+ <%= tag.div class: "govuk-summary-card__title-wrapper" do %>
14
+ <%= tag.h2 class: "govuk-summary-card__title" do %>
15
+ <%= title %>
16
+ <% end %>
17
+
18
+ <%= tag.ul class: "govuk-summary-card__actions" do %>
19
+ <% summary_card_actions.each do |action| %>
20
+ <%= tag.li class: "govuk-summary-card__action" do %>
21
+ <%= link_to sanitize(action[:label] + tag.span(" #{title}", class: "govuk-visually-hidden")), action[:href], class: "govuk-link govuk-link--no-visited-state #{"gem-link--destructive govuk-!-font-weight-bold" if action[:destructive]}".strip %>
22
+ <% end %>
23
+ <% end %>
24
+ <% end %>
25
+ <% end %>
26
+
27
+ <% if rows.present? %>
28
+ <%= tag.div class: "govuk-summary-card__content" do %>
29
+ <%= tag.dl class: "govuk-summary-list" do %>
30
+ <% rows.each do |row| %>
31
+ <%= tag.div class: "govuk-summary-list__row" do %>
32
+ <%= tag.dt class: "govuk-summary-list__key" do %>
33
+ <%= row[:key] %>
34
+ <% end %>
35
+
36
+ <%= tag.dt class: "govuk-summary-list__value" do %>
37
+ <%= row[:value] %>
38
+ <% end %>
39
+
40
+ <% if row[:actions].present? %>
41
+ <%= tag.dd class: "govuk-summary-list__actions" do %>
42
+ <%= tag.ul class: "govuk-summary-list__actions-list" do %>
43
+ <% row[:actions].each do |action| %>
44
+ <%= tag.li class: "govuk-summary-list__actions-list-item" do %>
45
+ <% if action[:opens_in_new_tab] %>
46
+ <%= link_to sanitize(action[:label] + tag.span(" #{row[:key]} (opens in new tab)", class: "govuk-visually-hidden")), action[:href], class: "govuk-link govuk-link--no-visited-state", rel: "noreferrer noopener", target: "_blank" %>
47
+ <% else %>
48
+ <%= link_to sanitize(action[:label] + tag.span(" #{row[:key]}", class: "govuk-visually-hidden")), action[:href], class: "govuk-link govuk-link--no-visited-state #{"gem-link--destructive" if action[:destructive]}".strip %>
49
+ <% end %>
50
+ <% end %>
51
+ <% end %>
52
+ <% end %>
53
+ <% end %>
54
+ <% end %>
55
+ <% end %>
56
+ <% end %>
57
+ <% end %>
58
+ <% end %>
59
+ <% end %>
60
+ <% end %>
61
+ <% end %>
62
+ <% end %>
@@ -34,3 +34,8 @@ examples:
34
34
  with_margin_bottom:
35
35
  data:
36
36
  margin_bottom: 3
37
+ without_ga4_tracking:
38
+ description: |
39
+ Disables GA4 tracking on the component. Tracking is enabled by default. This adds a data module and data-attributes with JSON data. See the [ga4-link-tracker documentation](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics-ga4/ga4-link-tracker.md) for more information.
40
+ data:
41
+ disable_ga4: true