govuk_publishing_components 16.29.0 → 17.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (185) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js +46 -23
  3. data/app/assets/javascripts/govuk_publishing_components/components/feedback.js +8 -2
  4. data/app/assets/javascripts/govuk_publishing_components/lib/cookie-functions.js +101 -21
  5. data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js +9 -2
  6. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +0 -1
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_button.scss +4 -6
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_cookie-banner.scss +36 -5
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_heading.scss +14 -14
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_highlight-boxes.scss +23 -23
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_inverse-header.scss +8 -8
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_lead-paragraph.scss +2 -2
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss +8 -8
  14. data/app/assets/stylesheets/govuk_publishing_components/components/_organisation-logo.scss +10 -10
  15. data/app/assets/stylesheets/govuk_publishing_components/components/_previous-and-next-navigation.scss +11 -14
  16. data/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss +14 -14
  17. data/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +8 -8
  18. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-header.scss +7 -7
  19. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-related.scss +20 -16
  20. data/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss +4 -4
  21. data/app/assets/stylesheets/govuk_publishing_components/components/_success-alert.scss +5 -5
  22. data/app/assets/stylesheets/govuk_publishing_components/components/_taxonomy-list.scss +5 -5
  23. data/app/assets/stylesheets/govuk_publishing_components/components/_title.scss +8 -8
  24. data/app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav-header.scss +1 -1
  25. data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +33 -25
  26. data/app/views/govuk_publishing_components/components/_error_summary.html.erb +4 -2
  27. data/app/views/govuk_publishing_components/components/_notice.html.erb +4 -1
  28. data/app/views/govuk_publishing_components/components/docs/cookie_banner.yml +2 -0
  29. data/app/views/govuk_publishing_components/components/docs/error_summary.yml +6 -0
  30. data/app/views/govuk_publishing_components/components/docs/notice.yml +6 -0
  31. data/app/views/govuk_publishing_components/components/docs/success_alert.yml +1 -1
  32. data/lib/govuk_publishing_components/presenters/cookie_banner_helper.rb +0 -4
  33. data/lib/govuk_publishing_components/version.rb +1 -1
  34. data/node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.js +1 -1
  35. data/node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.js.map +1 -1
  36. data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.preact.min.js +1 -1
  37. data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.preact.min.js.map +1 -1
  38. data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.react.min.js +1 -1
  39. data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.react.min.js.map +1 -1
  40. data/node_modules/accessible-autocomplete/package.json +3 -3
  41. data/node_modules/accessible-autocomplete/src/autocomplete.js +4 -2
  42. data/node_modules/accessible-autocomplete/src/wrapper.js +5 -1
  43. data/node_modules/d/CHANGELOG.md +9 -0
  44. data/node_modules/d/CHANGES +4 -0
  45. data/node_modules/d/LICENSE +12 -16
  46. data/node_modules/d/README.md +49 -19
  47. data/node_modules/d/auto-bind.js +11 -10
  48. data/node_modules/d/index.js +23 -24
  49. data/node_modules/d/lazy.js +21 -23
  50. data/node_modules/d/package.json +63 -16
  51. data/node_modules/d/test/auto-bind.js +6 -7
  52. data/node_modules/d/test/index.js +78 -51
  53. data/node_modules/d/test/lazy.js +65 -50
  54. data/node_modules/es6-weak-map/CHANGELOG.md +5 -0
  55. data/node_modules/es6-weak-map/LICENSE +12 -16
  56. data/node_modules/es6-weak-map/README.md +34 -19
  57. data/node_modules/es6-weak-map/implement.js +9 -5
  58. data/node_modules/es6-weak-map/index.js +2 -2
  59. data/node_modules/es6-weak-map/is-implemented.js +10 -9
  60. data/node_modules/es6-weak-map/is-native-implemented.js +3 -3
  61. data/node_modules/es6-weak-map/is-weak-map.js +8 -8
  62. data/node_modules/es6-weak-map/package.json +30 -19
  63. data/node_modules/es6-weak-map/polyfill.js +31 -32
  64. data/node_modules/es6-weak-map/test/implement.js +4 -2
  65. data/node_modules/es6-weak-map/test/index.js +4 -3
  66. data/node_modules/es6-weak-map/test/is-implemented.js +9 -8
  67. data/node_modules/es6-weak-map/test/is-native-implemented.js +4 -2
  68. data/node_modules/es6-weak-map/test/is-weak-map.js +4 -4
  69. data/node_modules/es6-weak-map/test/polyfill.js +13 -13
  70. data/node_modules/es6-weak-map/test/valid-weak-map.js +22 -9
  71. data/node_modules/es6-weak-map/valid-weak-map.js +5 -5
  72. data/node_modules/resolve/lib/async.js +1 -1
  73. data/node_modules/resolve/lib/node-modules-paths.js +1 -1
  74. data/node_modules/resolve/lib/sync.js +0 -2
  75. data/node_modules/resolve/package.json +13 -13
  76. data/node_modules/resolve/test/node-modules-paths.js +0 -22
  77. data/node_modules/resolve/test/resolver.js +11 -0
  78. data/node_modules/resolve/test/resolver_sync.js +11 -0
  79. data/node_modules/standard/node_modules/ms/index.js +2 -2
  80. data/node_modules/standard/node_modules/ms/package.json +205 -16
  81. data/node_modules/standard/node_modules/ms/readme.md +1 -1
  82. data/node_modules/type/CHANGELOG.md +62 -0
  83. data/node_modules/type/README.md +743 -0
  84. data/node_modules/type/array-length/coerce.js +10 -0
  85. data/node_modules/type/array-length/ensure.js +10 -0
  86. data/node_modules/type/array-like/ensure.js +9 -0
  87. data/node_modules/type/array-like/is.js +21 -0
  88. data/node_modules/type/array/ensure.js +9 -0
  89. data/node_modules/type/array/is.js +27 -0
  90. data/node_modules/type/date/ensure.js +9 -0
  91. data/node_modules/type/date/is.js +26 -0
  92. data/node_modules/type/error/ensure.js +9 -0
  93. data/node_modules/type/error/is.js +24 -0
  94. data/node_modules/type/finite/coerce.js +8 -0
  95. data/node_modules/type/finite/ensure.js +10 -0
  96. data/node_modules/type/function/ensure.js +9 -0
  97. data/node_modules/type/function/is.js +19 -0
  98. data/node_modules/type/integer/coerce.js +11 -0
  99. data/node_modules/type/integer/ensure.js +10 -0
  100. data/node_modules/type/iterable/ensure.js +9 -0
  101. data/node_modules/type/iterable/is.js +20 -0
  102. data/node_modules/type/lib/is-to-string-tag-supported.js +3 -0
  103. data/node_modules/type/lib/resolve-exception.js +21 -0
  104. data/node_modules/type/lib/safe-to-string.js +10 -0
  105. data/node_modules/type/lib/to-short-string.js +29 -0
  106. data/node_modules/type/natural-number/coerce.js +10 -0
  107. data/node_modules/type/natural-number/ensure.js +10 -0
  108. data/node_modules/type/number/coerce.js +14 -0
  109. data/node_modules/type/number/ensure.js +10 -0
  110. data/node_modules/type/object/ensure.js +9 -0
  111. data/node_modules/type/object/is.js +11 -0
  112. data/node_modules/type/package.json +159 -0
  113. data/node_modules/type/plain-function/ensure.js +9 -0
  114. data/node_modules/type/plain-function/is.js +11 -0
  115. data/node_modules/type/plain-object/ensure.js +9 -0
  116. data/node_modules/type/plain-object/is.js +28 -0
  117. data/node_modules/type/promise/ensure.js +9 -0
  118. data/node_modules/type/promise/is.js +27 -0
  119. data/node_modules/type/prototype/is.js +13 -0
  120. data/node_modules/type/reg-exp/ensure.js +9 -0
  121. data/node_modules/type/reg-exp/is.js +37 -0
  122. data/node_modules/type/safe-integer/coerce.js +13 -0
  123. data/node_modules/type/safe-integer/ensure.js +10 -0
  124. data/node_modules/type/string/coerce.js +23 -0
  125. data/node_modules/type/string/ensure.js +10 -0
  126. data/node_modules/type/test/_lib/arrow-function-if-supported.js +4 -0
  127. data/node_modules/type/test/_lib/class-if-supported.js +4 -0
  128. data/node_modules/type/test/array-length/coerce.js +47 -0
  129. data/node_modules/type/test/array-length/ensure.js +19 -0
  130. data/node_modules/type/test/array-like/ensure.js +24 -0
  131. data/node_modules/type/test/array-like/is.js +47 -0
  132. data/node_modules/type/test/array/ensure.js +20 -0
  133. data/node_modules/type/test/array/is.js +41 -0
  134. data/node_modules/type/test/date/ensure.js +20 -0
  135. data/node_modules/type/test/date/is.js +46 -0
  136. data/node_modules/type/test/error/ensure.js +20 -0
  137. data/node_modules/type/test/error/is.js +42 -0
  138. data/node_modules/type/test/finite/coerce.js +40 -0
  139. data/node_modules/type/test/finite/ensure.js +17 -0
  140. data/node_modules/type/test/function/ensure.js +20 -0
  141. data/node_modules/type/test/function/is.js +46 -0
  142. data/node_modules/type/test/integer/coerce.js +49 -0
  143. data/node_modules/type/test/integer/ensure.js +17 -0
  144. data/node_modules/type/test/iterable/ensure.js +24 -0
  145. data/node_modules/type/test/iterable/is.js +50 -0
  146. data/node_modules/type/test/lib/is-to-string-tag-supported.js +10 -0
  147. data/node_modules/type/test/lib/resolve-exception.js +39 -0
  148. data/node_modules/type/test/lib/safe-to-string.js +32 -0
  149. data/node_modules/type/test/lib/to-short-string.js +41 -0
  150. data/node_modules/type/test/natural-number/coerce.js +47 -0
  151. data/node_modules/type/test/natural-number/ensure.js +19 -0
  152. data/node_modules/type/test/number/coerce.js +40 -0
  153. data/node_modules/type/test/number/ensure.js +17 -0
  154. data/node_modules/type/test/object/ensure.js +20 -0
  155. data/node_modules/type/test/object/is.js +30 -0
  156. data/node_modules/type/test/plain-function/ensure.js +20 -0
  157. data/node_modules/type/test/plain-function/is.js +56 -0
  158. data/node_modules/type/test/plain-object/ensure.js +20 -0
  159. data/node_modules/type/test/plain-object/is.js +47 -0
  160. data/node_modules/type/test/promise/ensure.js +20 -0
  161. data/node_modules/type/test/promise/is.js +39 -0
  162. data/node_modules/type/test/prototype/is.js +39 -0
  163. data/node_modules/type/test/reg-exp/ensure.js +20 -0
  164. data/node_modules/type/test/reg-exp/is.js +47 -0
  165. data/node_modules/type/test/safe-integer/coerce.js +49 -0
  166. data/node_modules/type/test/safe-integer/ensure.js +19 -0
  167. data/node_modules/type/test/string/coerce.js +36 -0
  168. data/node_modules/type/test/string/ensure.js +17 -0
  169. data/node_modules/type/test/thenable/ensure.js +20 -0
  170. data/node_modules/type/test/thenable/is.js +44 -0
  171. data/node_modules/type/test/time-value/coerce.js +47 -0
  172. data/node_modules/type/test/time-value/ensure.js +17 -0
  173. data/node_modules/type/test/value/ensure.js +20 -0
  174. data/node_modules/type/test/value/is.js +29 -0
  175. data/node_modules/type/thenable/ensure.js +9 -0
  176. data/node_modules/type/thenable/is.js +9 -0
  177. data/node_modules/type/time-value/coerce.js +12 -0
  178. data/node_modules/type/time-value/ensure.js +10 -0
  179. data/node_modules/type/value/ensure.js +9 -0
  180. data/node_modules/type/value/is.js +6 -0
  181. metadata +118 -21
  182. data/app/assets/stylesheets/govuk_publishing_components/components/_taxonomy-navigation.scss +0 -94
  183. data/node_modules/resolve/reaf +0 -0
  184. data/node_modules/resolve/test/shadowed_core.js +0 -38
  185. data/node_modules/resolve/test/shadowed_core/node_modules/util/index.js +0 -0
@@ -2,19 +2,19 @@
2
2
  @include govuk-text-colour;
3
3
  position: relative;
4
4
  padding: 10px;
5
- background: $grey-4;
6
- border-top: solid 1px $grey-2;
7
- border-bottom: solid 1px $grey-2;
5
+ background: govuk-colour("grey-4");
6
+ border-top: solid 1px govuk-colour("grey-2");
7
+ border-bottom: solid 1px govuk-colour("grey-2");
8
8
 
9
- @include media(tablet) {
10
- padding: $gutter-half;
9
+ @include govuk-media-query($from: tablet) {
10
+ padding: govuk-spacing(3);
11
11
  }
12
12
  }
13
13
 
14
14
  // scss-lint:disable SelectorFormat
15
15
 
16
16
  .gem-c-step-nav-header__part-of {
17
- @include bold-16;
17
+ @include govuk-font(16, $weight: bold);
18
18
 
19
19
  display: block;
20
20
  padding-bottom: .2em;
@@ -22,7 +22,7 @@
22
22
 
23
23
  .gem-c-step-nav-header__title {
24
24
  @extend %govuk-link;
25
- @include bold-24;
25
+ @include govuk-font(24, $weight: bold);
26
26
  }
27
27
 
28
28
  // scss-lint:enable SelectorFormat
@@ -1,40 +1,44 @@
1
1
  .gem-c-step-nav-related {
2
2
  @include govuk-text-colour;
3
- border-top: 2px solid $govuk-blue;
4
- margin-bottom: $gutter;
3
+ border-top: 2px solid govuk-colour("blue");
4
+ margin-bottom: govuk-spacing(6);
5
5
  }
6
6
 
7
7
  .gem-c-step-nav-related__heading {
8
- margin-top: $gutter-half;
9
- margin-bottom: $gutter-one-third;
10
- @include bold-19;
8
+ margin-top: govuk-spacing(3);
9
+ margin-bottom: govuk-spacing(2);
10
+ @include govuk-font(19, $weight: bold);
11
11
  }
12
12
 
13
13
  .gem-c-step-nav-related__links {
14
- @include bold-16;
14
+ @include govuk-font(16, $weight: bold);
15
15
  margin: 0;
16
16
  padding: 0;
17
17
  }
18
18
 
19
19
  .gem-c-step-nav-related--singular {
20
- margin-bottom: $gutter-one-third + 3;
20
+ margin-bottom: govuk-spacing(2) + 3;
21
21
 
22
22
  .gem-c-step-nav-related__heading {
23
- @include _core-font-generator(19px, 19px, 19px, 1.4, 1.4, false, bold);
24
- margin-top: $gutter-two-thirds;
23
+ @include govuk-font(19, $weight: bold, $line-height: 1.4);
24
+ margin-top: govuk-spacing(4);
25
+
26
+ @include govuk-media-query($until: tablet) {
27
+ font-size: 19px;
28
+ }
25
29
  }
26
30
 
27
31
  .gem-c-step-nav-related__pretitle {
28
- margin-bottom: $gutter-one-quarter;
32
+ margin-bottom: govuk-spacing(6) / 4;
29
33
  }
30
34
  }
31
35
 
32
36
  .gem-c-step-nav-related__pretitle {
33
37
  display: block;
34
- margin-bottom: $gutter-half;
38
+ margin-bottom: govuk-spacing(3);
35
39
 
36
- @include media(tablet) {
37
- margin-bottom: 5px;
40
+ @include govuk-media-query($from: tablet) {
41
+ margin-bottom: govuk-spacing(1);
38
42
  }
39
43
  }
40
44
 
@@ -43,10 +47,10 @@
43
47
  }
44
48
 
45
49
  .gem-c-step-nav-related__link-item {
46
- margin-top: $gutter-half;
50
+ margin-top: govuk-spacing(3);
47
51
 
48
- @include media(tablet) {
49
- margin-top: 5px;
52
+ @include govuk-media-query($from: tablet) {
53
+ margin-top: govuk-spacing(1);
50
54
  }
51
55
  }
52
56
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  .gem-c-subscription-links__list {
10
10
  list-style: none;
11
- margin: 0 (-govuk-spacing(3) / 2);
11
+ margin: 0 (- govuk-spacing(3) / 2);
12
12
  padding: 0;
13
13
  }
14
14
 
@@ -44,7 +44,7 @@
44
44
  background-repeat: no-repeat;
45
45
  background-position: 0 20%;
46
46
 
47
- @include media(tablet) {
47
+ @include govuk-media-query($from: tablet) {
48
48
  background-position: 0 35%;
49
49
  }
50
50
  }
@@ -67,7 +67,7 @@
67
67
  background-image: image-url("govuk_publishing_components/mail-icon.png");
68
68
  padding-left: govuk-spacing(5);
69
69
 
70
- @include device-pixel-ratio {
70
+ @include govuk-device-pixel-ratio {
71
71
  background-image: image-url("govuk_publishing_components/mail-icon-x2.png");
72
72
  background-size: govuk-spacing(4) govuk-spacing(3);
73
73
  }
@@ -76,7 +76,7 @@
76
76
  .gem-c-subscription-links__feed-box {
77
77
  padding: govuk-spacing(3);
78
78
  margin-bottom: govuk-spacing(3);
79
- background: $grey-3;
79
+ background: govuk-colour("grey-3");
80
80
 
81
81
  .js-enabled &.js-hidden {
82
82
  display: none;
@@ -4,14 +4,14 @@
4
4
  border: $gem-border-width-mobile solid $gem-success-colour;
5
5
  @include govuk-responsive-margin(8, "bottom");
6
6
 
7
- @include media(tablet) {
7
+ @include govuk-media-query($from: tablet) {
8
8
  padding: $gem-spacing-scale-4;
9
9
  border-width: $gem-border-width-tablet;
10
10
  }
11
11
  }
12
12
 
13
13
  .gem-c-success-alert__message {
14
- @include bold-19;
14
+ @include govuk-font(19, $weight: bold);
15
15
  margin: 0;
16
16
  }
17
17
 
@@ -19,15 +19,15 @@
19
19
  margin-top: 0;
20
20
  margin-bottom: $gem-spacing-scale-3;
21
21
 
22
- @include media(tablet) {
22
+ @include govuk-media-query($from: tablet) {
23
23
  margin-bottom: $gem-spacing-scale-4;
24
24
  }
25
25
 
26
- @include bold-24;
26
+ @include govuk-font(24, $weight: bold);
27
27
  }
28
28
 
29
29
  .gem-c-success-summary__body {
30
- @include core-19;
30
+ @include govuk-font(19);
31
31
  margin: 0;
32
32
  }
33
33
 
@@ -1,10 +1,10 @@
1
1
  .gem-c-taxonomy-list {
2
2
  display: flex;
3
3
  flex-wrap: wrap;
4
- margin: $gutter-half 0 0 0;
4
+ margin: govuk-spacing(3) 0 0 0;
5
5
  padding: 0;
6
6
 
7
- @include media(tablet) {
7
+ @include govuk-media-query($from: tablet) {
8
8
  margin-right: -25px;
9
9
  }
10
10
  }
@@ -12,10 +12,10 @@
12
12
  .gem-c-taxonomy-list__item {
13
13
  list-style: none;
14
14
 
15
- @include media(tablet) {
16
- @include box-sizing(border-box);
15
+ @include govuk-media-query($from: tablet) {
16
+ box-sizing: border-box;
17
17
  width: 33%;
18
- padding-right: $gutter-one-third;
18
+ padding-right: govuk-spacing(2);
19
19
  vertical-align: top;
20
20
  }
21
21
  }
@@ -6,10 +6,10 @@
6
6
  // but we don't have one yet, so this is in anticipation of that
7
7
  // suggested scale is as follows, not fully implemented
8
8
  // no margin = 0
9
- // $gutter = 4
9
+ // govuk-spacing(6)= 4
10
10
  // responsive-bottom-margin = 5
11
11
  .gem-c-title--margin-bottom-4 {
12
- margin-bottom: $gutter;
12
+ margin-bottom: govuk-spacing(6);
13
13
  }
14
14
 
15
15
  .gem-c-title--margin-bottom-5 {
@@ -17,7 +17,7 @@
17
17
  }
18
18
 
19
19
  .gem-c-title--inverse {
20
- color: $white;
20
+ color: govuk-colour("white");
21
21
 
22
22
  .gem-c-title__text,
23
23
  .gem-c-title__context {
@@ -26,8 +26,8 @@
26
26
  }
27
27
 
28
28
  .gem-c-title__context {
29
- @include core-24;
30
- color: $secondary-text-colour;
29
+ @include govuk-font(24);
30
+ color: $govuk-secondary-text-colour;
31
31
  margin: 0;
32
32
  }
33
33
 
@@ -39,7 +39,7 @@
39
39
  color: inherit;
40
40
 
41
41
  &:focus {
42
- color: $black;
42
+ color: $govuk-text-colour;
43
43
  }
44
44
  }
45
45
 
@@ -51,10 +51,10 @@
51
51
 
52
52
  .gem-c-title__text {
53
53
  @include govuk-text-colour;
54
- @include bold-48;
54
+ @include govuk-font(48, $weight: bold);
55
55
  margin: 0;
56
56
  }
57
57
 
58
58
  .gem-c-title__text--long {
59
- @include bold-36;
59
+ @include govuk-font(36, $weight: bold);
60
60
  }
@@ -5,7 +5,7 @@
5
5
  }
6
6
 
7
7
  .gem-c-step-nav-header__title {
8
- @include bold-24;
8
+ @include govuk-font(24, $weight: bold);
9
9
  }
10
10
 
11
11
  .gem-c-step-nav-header__skip-link {
@@ -7,43 +7,51 @@
7
7
  cookie_banner_helper = GovukPublishingComponents::Presenters::CookieBannerHelper.new(local_assigns)
8
8
 
9
9
  message = cookie_banner_helper.message
10
- confirmation_message = cookie_banner_helper.confirmation_message
11
10
  %>
12
11
 
13
- <div id="<%= id %>" class="<%= cookie_banner_class %>" data-module="cookie-banner">
12
+ <div id="<%= id %>" class="<%= cookie_banner_class %>" data-module="cookie-banner" aria-live="polite">
14
13
  <div class="gem-c-cookie-banner__wrapper govuk-width-container">
15
14
  <p class="gem-c-cookie-banner__message"><%= message %></p>
16
15
  <% if new_cookie_banner %>
17
16
  <div class="gem-c-cookie-banner__buttons">
18
- <%= render "govuk_publishing_components/components/button", {
19
- text: "Accept cookies",
20
- secondary: true,
21
- inline_layout: true,
22
- data_attributes: {
23
- module: "track-click",
24
- "accept-cookies": "true",
25
- "track-category": "cookieBanner",
26
- "track-action": "Cookie banner accepted"
27
- }
28
- } %>
29
- <%= render "govuk_publishing_components/components/button", {
30
- text: "Cookie settings",
31
- href: "/help/cookies",
32
- secondary: true,
33
- inline_layout: true,
34
- data_attributes: {
35
- module: "track-click",
36
- "track-category": "cookieBanner",
37
- "track-action": "Cookie banner settings clicked"
38
- }
39
- } %>
17
+ <div class="gem-c-cookie-banner__button gem-c-cookie-banner__button-accept">
18
+ <%= render "govuk_publishing_components/components/button", {
19
+ text: "Accept cookies",
20
+ secondary: true,
21
+ inline_layout: true,
22
+ data_attributes: {
23
+ module: "track-click",
24
+ "accept-cookies": "true",
25
+ "track-category": "cookieBanner",
26
+ "track-action": "Cookie banner accepted"
27
+ }
28
+ } %>
29
+ </div>
30
+ <div class="gem-c-cookie-banner__button gem-c-cookie-banner__button-settings">
31
+ <%= render "govuk_publishing_components/components/button", {
32
+ text: "Cookie settings",
33
+ href: "/help/cookies",
34
+ secondary: true,
35
+ inline_layout: true,
36
+ data_attributes: {
37
+ module: "track-click",
38
+ "track-category": "cookieBanner",
39
+ "track-action": "Cookie banner settings clicked"
40
+ }
41
+ } %>
42
+ </div>
40
43
  </div>
41
44
  <% end %>
42
45
  </div>
43
46
 
44
47
  <% if new_cookie_banner %>
45
48
  <div class="gem-c-cookie-banner__confirmation govuk-width-container">
46
- <p class="gem-c-cookie-banner__confirmation-message"><%= confirmation_message %></p>
49
+ <p class="gem-c-cookie-banner__confirmation-message">
50
+ You&#8217;ve accepted all cookies. You can
51
+ <a class="govuk-link" href="/help/cookies" data-module="track-click" data-track-category="cookieBanner" data-track-action="Cookie banner settings clicked from confirmation">
52
+ change your cookie settings
53
+ </a> at any time.
54
+ </p>
47
55
  <button class="gem-c-cookie-banner__hide-button" data-hide-cookie-banner="true">Hide</button>
48
56
  </div>
49
57
  <% end %>
@@ -31,9 +31,11 @@
31
31
  <% items.each_with_index do |item, index| %>
32
32
  <li class="gem-c-error-summary__list-item">
33
33
  <% if item[:href] %>
34
- <%= link_to item[:text], item[:href], target: item[:target] %>
34
+ <%= link_to item[:text], item[:href], target: item[:target], data: item[:data_attributes] %>
35
35
  <% else %>
36
- <%= item[:text] %>
36
+ <%= tag.span data: item[:data_attributes] do %>
37
+ <%= item[:text] %>
38
+ <% end %>
37
39
  <% end %>
38
40
  </li>
39
41
  <% end %>
@@ -3,6 +3,7 @@
3
3
  description_text ||= false
4
4
  description_govspeak ||= false
5
5
  description ||= yield || false
6
+ aria_live ||= false
6
7
  local_assigns[:margin_bottom] ||= 8
7
8
  local_assigns[:margin_bottom] = 8 if local_assigns[:margin_bottom] > 9
8
9
 
@@ -11,10 +12,12 @@
11
12
  css_classes = %w(gem-c-notice)
12
13
  css_classes << (shared_helper.get_margin_bottom)
13
14
 
15
+ aria_attributes = aria_live ? {label: 'Notice', live: 'polite'} : {label: 'Notice'}
16
+
14
17
  description_present = description.present? || description_text.present? || description_govspeak.present?
15
18
  %>
16
19
  <% if title || description_present %>
17
- <%= tag.section class: css_classes, aria: { label: "Notice" }, role: "region" do %>
20
+ <%= tag.section class: css_classes, aria: aria_attributes, role: "region" do %>
18
21
  <% if title %>
19
22
  <% if description_present %>
20
23
  <%= tag.h2 title, class: "gem-c-notice__title" %>
@@ -2,6 +2,8 @@ name: Cookie banner
2
2
  description: Help users manage their personal data by telling them when you store cookies on their device.
3
3
  body: |
4
4
  Setting `data-hide-cookie-banner="true"` on any link inside the banner will overwrite the default action and when clicked will dismiss the cookie banner for a period of 365 days (approx. 1 year).
5
+
6
+ If the examples below are not showing the banner, make sure the `seen_cookie_message` cookie is not present or is set to false.
5
7
  accessibility_criteria: |
6
8
  Text in the cookie banner must be clear and unambiguous and should provide a way to dismiss the message.
7
9
 
@@ -21,9 +21,15 @@ examples:
21
21
  items:
22
22
  - text: Descriptive link to the question with an error 1
23
23
  href: '#example-error-1'
24
+ data_attributes:
25
+ tracking: GTM-123AA
24
26
  - text: Descriptive link to the question with an error 2
25
27
  href: '#example-error-2'
28
+ data_attributes:
29
+ tracking: GTM-123AB
26
30
  - text: Description of error without link
31
+ data_attributes:
32
+ tracking: GTM-123AC
27
33
  with_data_attributes:
28
34
  data:
29
35
  title: Message to alert the user to a problem goes here
@@ -36,3 +36,9 @@ examples:
36
36
  without_title:
37
37
  data:
38
38
  description_govspeak: '<p>Scheduled to publish at 8am on 25 April 2019<br/><a href="change-date">Change date</a><br/><a href="stop-scheduled-publishing">Stop scheduled publishing</a></p>'
39
+ with_aria_live:
40
+ description: Passing the aria live flag to the notice component will read the notice out to users if the notice changes, e.g on form submission the notice may go from hidden to visible.
41
+ data:
42
+ title: 'Your settings have been saved'
43
+ description_govspeak: <p>This is a confirmation message to tell you your settings have been saved</p>
44
+ aria_live: true
@@ -1,4 +1,4 @@
1
- name: Success Alert
1
+ name: Success alert
2
2
  description: Used at the top of the page, to summarise a successful user action.
3
3
  accessibility_criteria: |
4
4
  - should be focused on page load, to ensure the message is noticed by
@@ -9,10 +9,6 @@ module GovukPublishingComponents
9
9
  @local_assigns = local_assigns
10
10
  end
11
11
 
12
- def confirmation_message
13
- 'You\'ve accepted all cookies. You can <a class="govuk-link" href="/help/cookies" data-module="track-click" data-track-category="cookieBanner" data-track-action="Cookie banner settings clicked from confirmation">change your cookie settings</a> at any time.'.html_safe
14
- end
15
-
16
12
  def message
17
13
  return @message if @message.present?
18
14
 
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = '16.29.0'.freeze
2
+ VERSION = '17.0.0'.freeze
3
3
  end