govuk_publishing_components 27.14.2 → 27.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics/custom-dimensions.js +52 -26
  3. data/app/assets/javascripts/govuk_publishing_components/analytics/ecommerce.js +25 -25
  4. data/app/assets/javascripts/govuk_publishing_components/analytics/explicit-cross-domain-links.js +49 -48
  5. data/app/assets/javascripts/govuk_publishing_components/analytics/page-content.js +74 -65
  6. data/app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js +0 -1
  7. data/app/assets/javascripts/govuk_publishing_components/components/single-page-notification-button.js +25 -11
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_big-number.scss +10 -2
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +17 -115
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +24 -14
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_single-page-notification-button.scss +8 -0
  12. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss +8 -4
  13. data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_grid-helper.scss +141 -0
  14. data/app/views/govuk_publishing_components/components/_button.html.erb +1 -1
  15. data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +1 -1
  16. data/app/views/govuk_publishing_components/components/_intervention.html.erb +21 -4
  17. data/app/views/govuk_publishing_components/components/_search.html.erb +1 -0
  18. data/app/views/govuk_publishing_components/components/_single_page_notification_button.html.erb +1 -1
  19. data/app/views/govuk_publishing_components/components/_success_alert.html.erb +4 -1
  20. data/app/views/govuk_publishing_components/components/docs/intervention.yml +11 -0
  21. data/app/views/govuk_publishing_components/components/docs/layout_for_public.yml +1 -1
  22. data/app/views/govuk_publishing_components/components/docs/radio.yml +40 -33
  23. data/app/views/govuk_publishing_components/components/docs/search.yml +3 -0
  24. data/app/views/govuk_publishing_components/components/docs/success_alert.yml +6 -0
  25. data/app/views/govuk_publishing_components/components/layout_header/_header_logo.html.erb +1 -1
  26. data/config/i18n-tasks.yml +8 -0
  27. data/config/locales/ar.yml +134 -131
  28. data/config/locales/az.yml +131 -131
  29. data/config/locales/be.yml +136 -130
  30. data/config/locales/bg.yml +135 -131
  31. data/config/locales/bn.yml +132 -131
  32. data/config/locales/cs.yml +136 -131
  33. data/config/locales/cy.yml +129 -125
  34. data/config/locales/da.yml +132 -131
  35. data/config/locales/de.yml +135 -131
  36. data/config/locales/dr.yml +133 -131
  37. data/config/locales/el.yml +131 -131
  38. data/config/locales/en.yml +17 -14
  39. data/config/locales/es-419.yml +131 -131
  40. data/config/locales/es.yml +131 -131
  41. data/config/locales/et.yml +134 -131
  42. data/config/locales/fa.yml +130 -131
  43. data/config/locales/fi.yml +133 -131
  44. data/config/locales/fr.yml +130 -130
  45. data/config/locales/gd.yml +133 -131
  46. data/config/locales/gu.yml +131 -131
  47. data/config/locales/he.yml +131 -131
  48. data/config/locales/hi.yml +131 -131
  49. data/config/locales/hr.yml +133 -131
  50. data/config/locales/hu.yml +134 -131
  51. data/config/locales/hy.yml +135 -131
  52. data/config/locales/id.yml +132 -131
  53. data/config/locales/is.yml +131 -131
  54. data/config/locales/it.yml +131 -131
  55. data/config/locales/ja.yml +128 -131
  56. data/config/locales/ka.yml +134 -131
  57. data/config/locales/kk.yml +131 -131
  58. data/config/locales/ko.yml +13 -17
  59. data/config/locales/lt.yml +136 -131
  60. data/config/locales/lv.yml +135 -131
  61. data/config/locales/ms.yml +131 -131
  62. data/config/locales/mt.yml +133 -131
  63. data/config/locales/nl.yml +131 -131
  64. data/config/locales/no.yml +131 -131
  65. data/config/locales/pa-pk.yml +128 -132
  66. data/config/locales/pa.yml +131 -131
  67. data/config/locales/pl.yml +135 -131
  68. data/config/locales/ps.yml +128 -131
  69. data/config/locales/pt.yml +131 -131
  70. data/config/locales/ro.yml +132 -131
  71. data/config/locales/ru.yml +135 -131
  72. data/config/locales/si.yml +131 -131
  73. data/config/locales/sk.yml +136 -131
  74. data/config/locales/sl.yml +138 -131
  75. data/config/locales/so.yml +131 -131
  76. data/config/locales/sq.yml +131 -131
  77. data/config/locales/sr.yml +133 -131
  78. data/config/locales/sv.yml +131 -131
  79. data/config/locales/sw.yml +131 -131
  80. data/config/locales/ta.yml +132 -131
  81. data/config/locales/th.yml +130 -131
  82. data/config/locales/tk.yml +132 -131
  83. data/config/locales/tr.yml +132 -131
  84. data/config/locales/uk.yml +138 -131
  85. data/config/locales/ur.yml +128 -131
  86. data/config/locales/uz.yml +133 -131
  87. data/config/locales/vi.yml +131 -131
  88. data/config/locales/zh-hk.yml +130 -131
  89. data/config/locales/zh-tw.yml +130 -131
  90. data/config/locales/zh.yml +130 -131
  91. data/lib/govuk_publishing_components/presenters/button_helper.rb +24 -0
  92. data/lib/govuk_publishing_components/presenters/intervention_helper.rb +20 -2
  93. data/lib/govuk_publishing_components/presenters/single_page_notification_button_helper.rb +3 -1
  94. data/lib/govuk_publishing_components/version.rb +1 -1
  95. metadata +3 -2
@@ -1,107 +1,11 @@
1
1
  @import "mixins/prefixed-transform";
2
-
3
- /// Set grid row or column value using the fraction unit.
4
- ///
5
- /// @param {Integer} $number - number of fractions that the grid row or column
6
- /// needs to be divided into.
7
- /// @returns {String} - the value
8
- ///
9
- /// @example scss - Five fractions will return `1fr 1fr 1fr 1fr 1fr`.
10
- /// .container {
11
- /// grid-template-rows: fractions(5);
12
- /// }
13
- ///
14
- @function fractions($number) {
15
- $fractions: "1fr";
16
-
17
- @for $i from 1 to $number {
18
- $fractions: $fractions + " 1fr";
19
- }
20
-
21
- @return unquote($fractions);
22
- }
23
-
24
- /// Arrange items into vertical columns
25
- ///
26
- /// @param {Integer} $items - number of items that need to be arranged
27
- /// @param {Integer} $columns - number of columns required
28
- /// @param {String} $selector - (optional) the inner element to be targeted.
29
- ///
30
- /// @example scss - A 7 item 2 column layout.
31
- /// .container {
32
- /// @include columns(7, 2);
33
- /// }
34
-
35
- /// @example scss - A 9 item 3 column layout that has `div`s as the inner
36
- /// elements.
37
- /// .container {
38
- /// @include columns(9, 3, "div");
39
- /// }
40
- ///
41
- @mixin columns($items, $columns, $selector: "*") {
42
- $rows: ceil($items / $columns);
43
-
44
- display: -ms-grid;
45
- display: grid;
46
- grid-auto-flow: column;
47
- -ms-grid-columns: fractions($columns);
48
- grid-template-columns: fractions($columns);
49
- -ms-grid-rows: fractions($rows);
50
- grid-template-rows: fractions($rows);
51
- }
52
-
53
- @mixin columns-children($items, $columns, $selector: "*") {
54
- $rows: ceil($items / $columns);
55
-
56
- // Internet Explorer 10-11 require each element to be placed in the grid -
57
- // the `grid-auto-flow` property isn't supported. This means that both the
58
- // column and row needs to be set for every element.
59
-
60
- // This creates a list of lists to represent the columns and rows; for
61
- // example, a 7 item 2 column list would create this:
62
- // [
63
- // [1, 2, 3, 4 ] // column one
64
- // [5, 6, 7] // column two
65
- // ]
66
- $grid: ();
67
- $counter: 0;
68
-
69
- @for $column from 1 through $columns {
70
- $this-row: ();
71
-
72
- @for $row from 1 through $rows {
73
- $counter: $counter + 1;
74
-
75
- @if $counter <= $items {
76
- $this-row: append($this-row, $counter);
77
- }
78
- }
79
-
80
- $grid: append($grid, $this-row, "comma");
81
- }
82
-
83
- // Now we can loop through the list of lists to create the rules needed for
84
- // the older grid syntax; fist looping through the list to get the number
85
- // needed for the column, then looping again to get the number for the grid
86
- // row:
87
- @for $column_index from 1 through length($grid) {
88
- $this-row: nth($grid, $column_index);
89
-
90
- @for $item-index from 1 through length($this-row) {
91
- $this-item: nth($this-row, $item-index);
92
-
93
- & > #{$selector}:nth-child(#{$this-item}) {
94
- -ms-grid-column: $column_index;
95
- -ms-grid-row: $item-index;
96
- }
97
- }
98
- }
99
- }
2
+ @import "mixins/grid-helper";
100
3
 
101
4
  $icon-size: 20px;
102
5
  $chevron-indent-spacing: 7px;
103
6
  $black-bar-height: 50px;
104
7
  $search-width-or-height: $black-bar-height;
8
+ $pseudo-underline-height: 3px;
105
9
 
106
10
  @mixin chevron($colour, $update: false) {
107
11
  @if ($update == true) {
@@ -111,7 +15,7 @@ $search-width-or-height: $black-bar-height;
111
15
  @include prefixed-transform($rotate: 45deg, $translateY: -35%);
112
16
  border-bottom: 2px solid $colour;
113
17
  border-right: 2px solid $colour;
114
- content: " ";
18
+ content: "";
115
19
  display: inline-block;
116
20
  height: 8px;
117
21
  margin: 0 8px 0 2px;
@@ -123,21 +27,21 @@ $search-width-or-height: $black-bar-height;
123
27
  @mixin make-selectable-area-bigger {
124
28
  background: none;
125
29
  bottom: 0;
126
- content: " ";
30
+ content: "";
127
31
  left: 0;
128
32
  position: absolute;
129
33
  right: 0;
130
34
  top: 0;
131
35
  }
132
36
 
133
- @mixin pseudo-underline {
37
+ @mixin pseudo-underline($left: govuk-spacing(4), $right: govuk-spacing(4)) {
134
38
  background: none;
135
39
  bottom: 0;
136
- content: " ";
137
- height: 3px;
138
- left: govuk-spacing(3);
40
+ content: "";
41
+ height: $pseudo-underline-height;
42
+ left: $left;
139
43
  position: absolute;
140
- right: govuk-spacing(3);
44
+ right: $right;
141
45
  top: auto;
142
46
  }
143
47
 
@@ -384,7 +288,7 @@ $search-width-or-height: $black-bar-height;
384
288
  // stylelint-enable max-nesting-depth
385
289
 
386
290
  &:after {
387
- @include pseudo-underline;
291
+ @include pseudo-underline($left: govuk-spacing(5), $right: govuk-spacing(6));
388
292
  }
389
293
  }
390
294
  }
@@ -430,7 +334,7 @@ $search-width-or-height: $black-bar-height;
430
334
 
431
335
  @include govuk-media-query($from: "desktop") {
432
336
  &:after {
433
- @include pseudo-underline;
337
+ @include pseudo-underline($left: govuk-spacing(5), $right: govuk-spacing(6));
434
338
  }
435
339
 
436
340
  @include focus-not-focus-visible {
@@ -441,7 +345,7 @@ $search-width-or-height: $black-bar-height;
441
345
  font-size: govuk-px-to-rem(16px);
442
346
  }
443
347
  height: $black-bar-height;
444
- padding: govuk-spacing(3);
348
+ padding: govuk-spacing(3) govuk-spacing(6) govuk-spacing(3) govuk-spacing(5);
445
349
  position: relative;
446
350
  text-decoration: none;
447
351
 
@@ -762,7 +666,7 @@ $search-width-or-height: $black-bar-height;
762
666
 
763
667
  &:hover {
764
668
  background: govuk-colour("black");
765
- border-bottom: govuk-spacing(1) solid govuk-colour("mid-grey");
669
+ border-bottom: $pseudo-underline-height solid govuk-colour("mid-grey");
766
670
  color: govuk-colour("mid-grey");
767
671
  }
768
672
 
@@ -865,15 +769,13 @@ $search-width-or-height: $black-bar-height;
865
769
 
866
770
  .gem-c-layout-super-navigation-header__navigation-second-items--topics {
867
771
  @include govuk-media-query($from: "desktop") {
868
- @include columns(17, 2, "li");
869
- @include columns-children(17, 2, "li");
772
+ @include columns($items: 17, $columns: 2, $selector: "li", $flow: column);
870
773
  }
871
774
  }
872
775
 
873
776
  .gem-c-layout-super-navigation-header__navigation-second-items--government-activity {
874
777
  @include govuk-media-query($from: "desktop") {
875
- @include columns(6, 2, "li");
876
- @include columns-children(6, 2, "li");
778
+ @include columns($items: 6, $columns: 2, $selector: "li", $flow: column);
877
779
  padding-bottom: 0;
878
780
 
879
781
  & > li {
@@ -923,8 +825,7 @@ $search-width-or-height: $black-bar-height;
923
825
  padding: 0 0 govuk-spacing(8) govuk-spacing(4);
924
826
 
925
827
  @include govuk-media-query($from: "desktop") {
926
- @include columns(2, 2, "li");
927
- @include columns-children(2, 2, "li");
828
+ @include columns($items: 2, $columns: 2, $selector: "li");
928
829
  margin: 0 (0 - govuk-spacing(3));
929
830
  padding: govuk-spacing(6) 0 govuk-spacing(7) 0;
930
831
  }
@@ -962,6 +863,7 @@ $search-width-or-height: $black-bar-height;
962
863
  }
963
864
 
964
865
  .gem-c-layout-super-navigation-header__navigation-second-item-description {
866
+ @include govuk-typography-common;
965
867
  font-size: 16px;
966
868
  @if $govuk-typography-use-rem {
967
869
  font-size: govuk-px-to-rem(16px);
@@ -1,6 +1,25 @@
1
1
  $input-size: 40px;
2
2
  $large-input-size: 50px;
3
3
 
4
+ @mixin large-mode {
5
+ .gem-c-search__label {
6
+ @include govuk-font($size: 19, $line-height: $large-input-size);
7
+ }
8
+
9
+ .gem-c-search__input[type="search"] {
10
+ height: $large-input-size;
11
+ }
12
+
13
+ .gem-c-search__submit {
14
+ width: $large-input-size;
15
+ height: $large-input-size;
16
+
17
+ .gem-c-search__icon {
18
+ @include icon-positioning($large-input-size);
19
+ }
20
+ }
21
+ }
22
+
4
23
  .gem-c-search {
5
24
  position: relative;
6
25
  margin-bottom: 30px;
@@ -220,21 +239,12 @@ $large-input-size: 50px;
220
239
  }
221
240
 
222
241
  .gem-c-search--large {
223
- .gem-c-search__label {
224
- @include govuk-font($size: 19, $line-height: $large-input-size);
225
- }
226
-
227
- .gem-c-search__input[type="search"] {
228
- height: $large-input-size;
229
- }
230
-
231
- .gem-c-search__submit {
232
- width: $large-input-size;
233
- height: $large-input-size;
242
+ @include large-mode;
243
+ }
234
244
 
235
- .gem-c-search__icon {
236
- @include icon-positioning($large-input-size);
237
- }
245
+ .gem-c-search--large-on-mobile {
246
+ @include govuk-media-query($until: "tablet") {
247
+ @include large-mode;
238
248
  }
239
249
  }
240
250
 
@@ -28,3 +28,11 @@
28
28
  vertical-align: top;
29
29
  margin-right: govuk-spacing(1);
30
30
  }
31
+
32
+ .js-enabled .gem-c-single-page-notification-button.js-personalisation-enhancement {
33
+ opacity: 0;
34
+
35
+ &.gem-c-single-page-notification-button--visible {
36
+ opacity: 1;
37
+ }
38
+ }
@@ -14,7 +14,7 @@
14
14
  margin: govuk-spacing(6) 0;
15
15
  overflow-x: auto;
16
16
  width: 100%;
17
- @include govuk-font($size: 14);
17
+ @include govuk-font($size: 19);
18
18
 
19
19
  caption {
20
20
  text-align: left;
@@ -24,12 +24,16 @@
24
24
  th,
25
25
  td {
26
26
  vertical-align: top;
27
- padding: govuk-spacing(2) govuk-spacing(2) govuk-spacing(2) 0;
28
- border-bottom: solid 1px govuk-colour("mid-grey", $legacy: "grey-2");
27
+ padding: govuk-spacing(2) govuk-spacing(4) govuk-spacing(2) 0;
28
+ border-bottom: 1px solid govuk-colour("mid-grey", $legacy: "grey-2");
29
+
30
+ &:last-child {
31
+ padding: govuk-spacing(2) 0 govuk-spacing(2) 0;
32
+ }
29
33
  }
30
34
 
31
35
  th {
32
- @include govuk-font($size: 14, $weight: bold);
36
+ @include govuk-font($size: 19, $weight: bold);
33
37
  text-align: left;
34
38
  color: $govuk-text-colour;
35
39
  }
@@ -0,0 +1,141 @@
1
+ /// Set grid row or column value using the fraction unit.
2
+ ///
3
+ /// @param {Integer} $number - number of fractions that the grid row or column
4
+ /// needs to be divided into.
5
+ /// @returns {String} - the value
6
+ ///
7
+ /// @example scss - Five fractions will return `1fr 1fr 1fr 1fr 1fr`.
8
+ /// .container {
9
+ /// grid-template-rows: fractions(5);
10
+ /// }
11
+ ///
12
+ @function fractions($number) {
13
+ $fractions: "1fr";
14
+
15
+ @for $i from 1 to $number {
16
+ $fractions: $fractions + " 1fr";
17
+ }
18
+
19
+ @return unquote($fractions);
20
+ }
21
+
22
+ /// Arrange items into columns
23
+ ///
24
+ /// The items can flow from horizontally or vertically.
25
+ ///
26
+ /// @param {Integer} $items - number of items that need to be arranged
27
+ /// @param {Integer} $columns - number of columns required
28
+ /// @param {String} $selector - (optional) the inner element to be targeted.
29
+ /// @param {String} $direction - (optional) the flow of the items in the grid:
30
+ /// * `row` goes from the left to right, top to bottom one row at a time
31
+ /// * `column` goes from the top to bottom, left to right one column at a time
32
+ ///
33
+ /// @example scss - A 7 item 2 column layout going left to right, top to bottom.
34
+ /// .container {
35
+ /// @include columns($items: 7, $columns: 2);
36
+ /// }
37
+ ///
38
+ /// @example scss - A 9 item 3 column layout that has `div`s as the inner
39
+ /// elements.
40
+ /// .container {
41
+ /// @include columns($items: 9, $columns: 3, $selector:"div");
42
+ /// }
43
+ ///
44
+ /// @example scss - A 16 item 2 column layout going from top to bottom
45
+ /// elements.
46
+ /// .container {
47
+ /// @include columns($items: 9, $columns: 3, $flow:"column");
48
+ /// }
49
+ ///
50
+ @mixin columns($items, $columns, $selector: "*", $flow: row) {
51
+ $rows: ceil($items / $columns);
52
+
53
+ display: -ms-grid;
54
+ display: grid;
55
+ grid-auto-flow: $flow;
56
+ -ms-grid-columns: fractions($columns);
57
+ grid-template-columns: fractions($columns);
58
+ -ms-grid-rows: fractions($rows);
59
+ grid-template-rows: fractions($rows);
60
+
61
+ // Internet Explorer 10-11 require each element to be placed in the grid -
62
+ // the `grid-auto-flow` property isn't supported. This means that both the
63
+ // column and row needs to be set for every child element.
64
+ @if $flow == "row" {
65
+ $grid: ();
66
+ $counter: 0;
67
+
68
+ @for $row from 1 through $rows {
69
+ $this-row: ();
70
+
71
+ @for $column from 1 through $columns {
72
+ $counter: $counter + 1;
73
+
74
+ // stylelint-disable max-nesting-depth
75
+ @if $counter <= $items {
76
+ $this-row: append($this-row, $counter);
77
+ }
78
+ // stylelint-enable max-nesting-depth
79
+ }
80
+
81
+ $grid: append($grid, $this-row, "comma");
82
+ }
83
+
84
+ @for $row-count from 1 through length($grid) {
85
+ $this-column: nth($grid, $row-count);
86
+
87
+ @for $item-index from 1 through length($this-column) {
88
+ $this-item: nth($this-column, $item-index);
89
+
90
+ & > #{$selector}:nth-child(#{$this-item}) {
91
+ -ms-grid-column: $item-index;
92
+ -ms-grid-row: $row-count;
93
+ }
94
+ }
95
+ }
96
+ }
97
+
98
+ @if $flow == "column" {
99
+ // This creates a list of lists to represent the columns and rows; for
100
+ // example, a 7 item 2 column list would create this:
101
+ // [
102
+ // [1, 2, 3, 4 ] // column one
103
+ // [5, 6, 7] // column two
104
+ // ]
105
+ $grid: ();
106
+ $counter: 0;
107
+
108
+ @for $column from 1 through $columns {
109
+ $this-row: ();
110
+
111
+ @for $row from 1 through $rows {
112
+ $counter: $counter + 1;
113
+
114
+ // stylelint-disable max-nesting-depth
115
+ @if $counter <= $items {
116
+ $this-row: append($this-row, $counter);
117
+ }
118
+ // stylelint-enable max-nesting-depth
119
+ }
120
+
121
+ $grid: append($grid, $this-row, "comma");
122
+ }
123
+
124
+ // Now we can loop through the list of lists to create the rules needed for
125
+ // the older grid syntax; fist looping through the list to get the number
126
+ // needed for the column, then looping again to get the number for the grid
127
+ // row:
128
+ @for $column_index from 1 through length($grid) {
129
+ $this-row: nth($grid, $column_index);
130
+
131
+ @for $item-index from 1 through length($this-row) {
132
+ $this-item: nth($this-row, $item-index);
133
+
134
+ & > #{$selector}:nth-child(#{$this-item}) {
135
+ -ms-grid-column: $column_index;
136
+ -ms-grid-row: $item-index;
137
+ }
138
+ }
139
+ }
140
+ }
141
+ }
@@ -27,5 +27,5 @@
27
27
  <% end %>
28
28
 
29
29
  <% if button.info_text %>
30
- <%= tag.span button.info_text, class: button.info_text_classes %>
30
+ <%= tag.span button.info_text, button.info_text_options %>
31
31
  <% end %>
@@ -14,7 +14,7 @@
14
14
  text = raw(text)
15
15
 
16
16
  cookie_preferences_href ||= "/help/cookies"
17
- confirmation_message ||= raw(t("components.cookie_banner.confirmation_message",
17
+ confirmation_message ||= raw(t("components.cookie_banner.confirmation_message_html",
18
18
  link: link_to(
19
19
  t("components.cookie_banner.confirmation_message_link"),
20
20
  cookie_preferences_href,
@@ -3,6 +3,7 @@
3
3
  suggestion_link_text ||= false
4
4
  suggestion_link_url ||= false
5
5
  suggestion_text ||= nil
6
+ new_tab ||= false
6
7
 
7
8
  data_attributes ||= {}
8
9
  data_attributes[:module] = 'intervention'
@@ -13,17 +14,33 @@
13
14
  aria_attributes[:label] = 'Intervention'
14
15
 
15
16
  local_assigns[:query_string] ||= request.query_string
17
+ local_assigns[:suggestion_link_text] = suggestion_link_text
18
+ local_assigns[:suggestion_link_url] = suggestion_link_url
16
19
 
17
20
  intervention_helper = GovukPublishingComponents::Presenters::InterventionHelper.new(local_assigns)
18
21
  dismiss_href = intervention_helper.dismiss_link
22
+
23
+ suggestion_tag_options = {
24
+ class: "govuk-link gem-c-intervention__suggestion-link",
25
+ href: suggestion_link_url,
26
+ data: suggestion_data_attributes,
27
+ }
28
+
29
+ if new_tab && (suggestion_link_text && suggestion_link_url)
30
+ target = "_blank"
31
+ rel = intervention_helper.security_attr
32
+
33
+ suggestion_tag_options.merge!({ target: target, rel: rel })
34
+
35
+ suggestion_link_text = intervention_helper.accessible_text
36
+ end
19
37
  %>
20
- <% if suggestion_text or (suggestion_link_text and suggestion_link_text) %>
38
+ <% if suggestion_text || (suggestion_link_text && suggestion_link_url) %>
21
39
  <%= tag.section class: "gem-c-intervention", role: "region", aria: aria_attributes, data: data_attributes do %>
22
40
  <p class="govuk-body">
23
41
  <%= tag.span suggestion_text, class: "gem-c-intervention__textwrapper" if suggestion_text %>
24
- <% if suggestion_link_text and suggestion_link_url %>
25
- <%= tag.a suggestion_link_text, class: "govuk-link gem-c-intervention__suggestion-link", href: suggestion_link_url, data: suggestion_data_attributes %>
26
-
42
+ <% if suggestion_link_text && suggestion_link_url %>
43
+ <%= tag.a suggestion_link_text, suggestion_tag_options %>
27
44
  <% end %>
28
45
  </p>
29
46
 
@@ -21,6 +21,7 @@
21
21
  classes << (shared_helper.get_margin_top)
22
22
  classes << (shared_helper.get_margin_bottom) if local_assigns[:margin_bottom]
23
23
  classes << "gem-c-search--large" if size == "large"
24
+ classes << "gem-c-search--large-on-mobile" if size == "large-mobile"
24
25
  classes << "gem-c-search--no-border" if no_border
25
26
  if local_assigns[:on_govuk_blue].eql?(true)
26
27
  classes << "gem-c-search--on-govuk-blue"
@@ -9,7 +9,7 @@
9
9
  <svg class="gem-c-single-page-notification-button__icon" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" height="18" width="18" viewBox="0 0 459.334 459.334"><path fill="currentColor" d="M177.216 404.514c-.001.12-.009.239-.009.359 0 30.078 24.383 54.461 54.461 54.461s54.461-24.383 54.461-54.461c0-.12-.008-.239-.009-.359H175.216zM403.549 336.438l-49.015-72.002v-89.83c0-60.581-43.144-111.079-100.381-122.459V24.485C254.152 10.963 243.19 0 229.667 0s-24.485 10.963-24.485 24.485v27.663c-57.237 11.381-100.381 61.879-100.381 122.459v89.83l-49.015 72.002a24.76 24.76 0 0 0 20.468 38.693H383.08a24.761 24.761 0 0 0 20.469-38.694z"/></svg><%= component_helper.button_text %>
10
10
  <% end %>
11
11
  <%= tag.div class: wrapper_classes, data: { module: "gem-track-click"} do %>
12
- <%= tag.form class: "gem-c-single-page-notification-button", action: "/email/subscriptions/single-page/new", method: "POST", data: component_helper.data do %>
12
+ <%= tag.form class: component_helper.classes, action: "/email/subscriptions/single-page/new", method: "POST", data: component_helper.data do %>
13
13
  <input type="hidden" name="base_path" value="<%= component_helper.base_path %>">
14
14
  <%= content_tag(:button, button_text, {
15
15
  class: "govuk-body-s gem-c-single-page-notification-button__submit",
@@ -1,9 +1,12 @@
1
1
  <%
2
2
  description ||= nil
3
3
  title_id ||= "govuk-notification-banner-title-#{SecureRandom.hex(4)}"
4
+ shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
5
+ classes = %w(gem-c-success-alert govuk-notification-banner govuk-notification-banner--success)
6
+ classes << shared_helper.get_margin_bottom if local_assigns[:margin_bottom]
4
7
  %>
5
8
 
6
- <%= tag.div class: "gem-c-success-alert govuk-notification-banner govuk-notification-banner--success",
9
+ <%= tag.div class: classes,
7
10
  role: "alert",
8
11
  tabindex: "-1",
9
12
  aria: {
@@ -38,6 +38,17 @@ examples:
38
38
  suggestion_link_text: "You can now apply for a permit online."
39
39
  suggestion_link_url: "/permit"
40
40
 
41
+ open_suggestion_link_in_new_tab:
42
+ description: |
43
+ When sending users to another online task, you don't want to completely hijack
44
+ their original flow on GOV.UK. Adding the option to open links in a new tab helps to address this.
45
+ Link text should tell the user that the link opens in a new tab.
46
+ Note: "(opens in a new tab)" is added to link text if the phrase isn't included.
47
+ data:
48
+ suggestion_link_text: "You can now apply for a permit online"
49
+ suggestion_link_url: "www.google.com/permit"
50
+ new_tab: true
51
+
41
52
  with_data_attributes:
42
53
  description: |
43
54
  This example shows the use of `suggestion_data_attributes` and
@@ -69,7 +69,7 @@ examples:
69
69
  <h2 class="govuk-heading-l">This is a title</h2>
70
70
  <p class="govuk-body">This is some body text with <a href="https://example.com">a link</a>.
71
71
  with_current_account_navigation:
72
- description: "The account layout renders with an account-specific nav to help users navigate different areas of their account. This flag is here to allow control over which option in the nav is highlighted as `current`. Valid options are currently `your-account`, `manage`, and `security`."
72
+ description: "The account layout renders with an account-specific nav to help users navigate different areas of their account. This flag is here to allow control over which option in the nav is highlighted as `current`. Valid options are currently `your-account` and `manage`."
73
73
  data:
74
74
  show_account_layout: true
75
75
  account_nav_location: "manage"