govuk_publishing_components 27.17.0 → 28.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/govuk_publishing_components/image-card-srcset/cop26-170.jpg +0 -0
  3. data/app/assets/images/govuk_publishing_components/image-card-srcset/cop26-240.jpg +0 -0
  4. data/app/assets/images/govuk_publishing_components/image-card-srcset/cop26-320.jpg +0 -0
  5. data/app/assets/images/govuk_publishing_components/image-card-srcset/cop26-480.jpg +0 -0
  6. data/app/assets/images/govuk_publishing_components/image-card-srcset/cop26.jpg +0 -0
  7. data/app/assets/javascripts/govuk_publishing_components/analytics/download-link-tracker.js +21 -16
  8. data/app/assets/javascripts/govuk_publishing_components/analytics/explicit-cross-domain-links.js +1 -1
  9. data/app/assets/javascripts/govuk_publishing_components/analytics/external-link-tracker.js +46 -32
  10. data/app/assets/javascripts/govuk_publishing_components/analytics/google-analytics-universal-tracker.js +20 -7
  11. data/app/assets/javascripts/govuk_publishing_components/analytics/page-content.js +74 -65
  12. data/app/assets/javascripts/govuk_publishing_components/analytics/scroll-tracker.js +1 -126
  13. data/app/assets/javascripts/govuk_publishing_components/components/feedback.js +18 -18
  14. data/app/assets/javascripts/govuk_publishing_components/components/single-page-notification-button.js +25 -11
  15. data/app/assets/javascripts/govuk_publishing_components/lib/extend-object.js +22 -0
  16. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -2
  17. data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-sidebar.scss +19 -14
  18. data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +6 -35
  19. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +17 -7
  20. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +5 -104
  21. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +24 -14
  22. data/app/assets/stylesheets/govuk_publishing_components/components/_signup-link.scss +34 -0
  23. data/app/assets/stylesheets/govuk_publishing_components/components/_single-page-notification-button.scss +8 -0
  24. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_warning-callout.scss +7 -0
  25. data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_grid-helper.scss +141 -0
  26. data/app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb +5 -1
  27. data/app/views/govuk_publishing_components/components/_image_card.html.erb +1 -0
  28. data/app/views/govuk_publishing_components/components/_intervention.html.erb +10 -1
  29. data/app/views/govuk_publishing_components/components/_search.html.erb +1 -0
  30. data/app/views/govuk_publishing_components/components/_signup_link.html.erb +30 -0
  31. data/app/views/govuk_publishing_components/components/_single_page_notification_button.html.erb +1 -1
  32. data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb +3 -3
  33. data/app/views/govuk_publishing_components/components/contextual_sidebar/_covid_cta.html.erb +27 -0
  34. data/app/views/govuk_publishing_components/components/docs/contextual_sidebar.yml +15 -87
  35. data/app/views/govuk_publishing_components/components/docs/feedback.yml +5 -0
  36. data/app/views/govuk_publishing_components/components/docs/image_card.yml +29 -0
  37. data/app/views/govuk_publishing_components/components/docs/intervention.yml +9 -0
  38. data/app/views/govuk_publishing_components/components/docs/search.yml +3 -0
  39. data/app/views/govuk_publishing_components/components/docs/signup_link.yml +39 -0
  40. data/app/views/govuk_publishing_components/components/feedback/_problem_form.html.erb +9 -6
  41. data/app/views/govuk_publishing_components/components/feedback/_survey_signup_form.html.erb +4 -3
  42. data/app/views/govuk_publishing_components/components/feedback/_yes_no_banner.html.erb +4 -4
  43. data/app/views/govuk_publishing_components/components/layout_header/_header_logo.html.erb +1 -1
  44. data/config/locales/ar.yml +0 -8
  45. data/config/locales/az.yml +0 -8
  46. data/config/locales/be.yml +0 -8
  47. data/config/locales/bg.yml +0 -8
  48. data/config/locales/bn.yml +0 -8
  49. data/config/locales/cs.yml +0 -8
  50. data/config/locales/cy.yml +0 -8
  51. data/config/locales/da.yml +0 -8
  52. data/config/locales/de.yml +0 -8
  53. data/config/locales/dr.yml +0 -8
  54. data/config/locales/el.yml +0 -8
  55. data/config/locales/en.yml +9 -13
  56. data/config/locales/es-419.yml +0 -8
  57. data/config/locales/es.yml +0 -8
  58. data/config/locales/et.yml +0 -8
  59. data/config/locales/fa.yml +0 -8
  60. data/config/locales/fi.yml +0 -8
  61. data/config/locales/fr.yml +0 -8
  62. data/config/locales/gd.yml +0 -8
  63. data/config/locales/gu.yml +0 -8
  64. data/config/locales/he.yml +0 -8
  65. data/config/locales/hi.yml +0 -8
  66. data/config/locales/hr.yml +0 -8
  67. data/config/locales/hu.yml +0 -8
  68. data/config/locales/hy.yml +0 -8
  69. data/config/locales/id.yml +0 -8
  70. data/config/locales/is.yml +0 -8
  71. data/config/locales/it.yml +0 -8
  72. data/config/locales/ja.yml +0 -8
  73. data/config/locales/ka.yml +0 -8
  74. data/config/locales/kk.yml +0 -8
  75. data/config/locales/ko.yml +0 -8
  76. data/config/locales/lt.yml +0 -8
  77. data/config/locales/lv.yml +0 -8
  78. data/config/locales/ms.yml +0 -8
  79. data/config/locales/mt.yml +0 -8
  80. data/config/locales/nl.yml +0 -8
  81. data/config/locales/no.yml +0 -8
  82. data/config/locales/pa-pk.yml +0 -8
  83. data/config/locales/pa.yml +0 -8
  84. data/config/locales/pl.yml +0 -8
  85. data/config/locales/ps.yml +0 -8
  86. data/config/locales/pt.yml +0 -8
  87. data/config/locales/ro.yml +0 -8
  88. data/config/locales/ru.yml +0 -8
  89. data/config/locales/si.yml +0 -8
  90. data/config/locales/sk.yml +0 -8
  91. data/config/locales/sl.yml +0 -8
  92. data/config/locales/so.yml +0 -8
  93. data/config/locales/sq.yml +0 -8
  94. data/config/locales/sr.yml +0 -8
  95. data/config/locales/sv.yml +0 -8
  96. data/config/locales/sw.yml +0 -8
  97. data/config/locales/ta.yml +0 -8
  98. data/config/locales/th.yml +0 -8
  99. data/config/locales/tk.yml +0 -8
  100. data/config/locales/tr.yml +0 -8
  101. data/config/locales/uk.yml +0 -8
  102. data/config/locales/ur.yml +0 -8
  103. data/config/locales/uz.yml +0 -8
  104. data/config/locales/vi.yml +0 -8
  105. data/config/locales/zh-hk.yml +0 -8
  106. data/config/locales/zh-tw.yml +0 -8
  107. data/config/locales/zh.yml +0 -8
  108. data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +42 -170
  109. data/lib/govuk_publishing_components/presenters/image_card_helper.rb +11 -1
  110. data/lib/govuk_publishing_components/presenters/single_page_notification_button_helper.rb +3 -1
  111. data/lib/govuk_publishing_components/version.rb +1 -1
  112. data/lib/govuk_publishing_components.rb +0 -2
  113. metadata +13 -14
  114. data/app/assets/stylesheets/govuk_publishing_components/components/_highlight-boxes.scss +0 -84
  115. data/app/assets/stylesheets/govuk_publishing_components/components/_taxonomy-list.scss +0 -21
  116. data/app/views/govuk_publishing_components/components/_admin_analytics.html.erb +0 -20
  117. data/app/views/govuk_publishing_components/components/_government_navigation.html.erb +0 -86
  118. data/app/views/govuk_publishing_components/components/_highlight_boxes.html.erb +0 -47
  119. data/app/views/govuk_publishing_components/components/_taxonomy_list.html.erb +0 -30
  120. data/app/views/govuk_publishing_components/components/docs/admin_analytics.yml +0 -10
  121. data/app/views/govuk_publishing_components/components/docs/government_navigation.yml +0 -20
  122. data/app/views/govuk_publishing_components/components/docs/highlight_boxes.yml +0 -171
  123. data/app/views/govuk_publishing_components/components/docs/taxonomy_list.yml +0 -112
  124. data/lib/govuk_publishing_components/presenters/highlight_boxes_helper.rb +0 -13
  125. data/lib/govuk_publishing_components/presenters/taxonomy_list_helper.rb +0 -23
@@ -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
+ }
@@ -24,7 +24,11 @@
24
24
  } %>
25
25
  <% end %>
26
26
 
27
- <% if navigation.show_brexit_cta? || navigation.show_brexit_related_links? %>
27
+ <% if navigation.show_brexit_cta? %>
28
28
  <%= render 'govuk_publishing_components/components/contextual_sidebar/brexit_cta', content_item: content_item %>
29
29
  <% end %>
30
+
31
+ <% if navigation.show_covid_booster_cta? %>
32
+ <%= render 'govuk_publishing_components/components/contextual_sidebar/covid_cta', content_item: content_item %>
33
+ <% end %>
30
34
  </div>
@@ -1,4 +1,5 @@
1
1
  <%
2
+ sizes ||= false
2
3
  brand ||= false
3
4
  brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand)
4
5
  card_helper = GovukPublishingComponents::Presenters::ImageCardHelper.new(local_assigns)
@@ -3,8 +3,10 @@
3
3
  suggestion_link_text ||= false
4
4
  suggestion_link_url ||= false
5
5
  suggestion_text ||= nil
6
+ hide ||= false
6
7
  new_tab ||= false
7
8
 
9
+
8
10
  data_attributes ||= {}
9
11
  data_attributes[:module] = 'intervention'
10
12
  suggestion_data_attributes ||= {}
@@ -34,9 +36,16 @@
34
36
 
35
37
  suggestion_link_text = intervention_helper.accessible_text
36
38
  end
39
+
40
+ section_options = {
41
+ class: "gem-c-intervention",
42
+ role: "region", aria: aria_attributes,
43
+ data: data_attributes,
44
+ }
45
+ section_options.merge!({ hidden: true }) if hide
37
46
  %>
38
47
  <% if suggestion_text || (suggestion_link_text && suggestion_link_url) %>
39
- <%= tag.section class: "gem-c-intervention", role: "region", aria: aria_attributes, data: data_attributes do %>
48
+ <%= tag.section section_options do %>
40
49
  <p class="govuk-body">
41
50
  <%= tag.span suggestion_text, class: "gem-c-intervention__textwrapper" if suggestion_text %>
42
51
  <% if suggestion_link_text && suggestion_link_url %>
@@ -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"
@@ -0,0 +1,30 @@
1
+ <%
2
+ local_assigns[:heading_level] ||= 3
3
+ local_assigns[:margin_bottom] ||= 0
4
+ link_text ||= false
5
+ link_href ||= false
6
+ heading ||= false
7
+ background ||= false
8
+ data ||= false
9
+
10
+ shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
11
+
12
+ classes = %w(gem-c-signup-link govuk-!-display-none-print)
13
+ classes << shared_helper.get_margin_bottom
14
+ classes << "gem-c-signup-link--link-only" unless heading
15
+ classes << "gem-c-signup-link--with-background-and-border" if background
16
+ %>
17
+ <% if link_text && link_href %>
18
+ <div class="<%= classes.join(' ') %>">
19
+ <div class="gem-c-signup-link__inner govuk-width-container">
20
+ <svg class="gem-c-signup-link__icon" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" height="18" width="18" viewBox="0 0 459.334 459.334">
21
+ <path fill="black" 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"/>
22
+ </svg>
23
+ <%= content_tag(shared_helper.get_heading_level, heading, class: "govuk-heading-s gem-c-signup-link__title") if heading %>
24
+ <%= link_to( link_text, link_href, {
25
+ class: "govuk-link gem-c-signup-link__link",
26
+ data: data
27
+ }) %>
28
+ </div>
29
+ </div>
30
+ <% end %>
@@ -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",
@@ -15,9 +15,9 @@
15
15
  "track-dimension-index": "29",
16
16
  } %>
17
17
 
18
- <%= tag.div class: "gem-c-contextual-sidebar__brexit-cta" do %>
19
- <%= tag.h2 title, class: "gem-c-contextual-sidebar__brexit-heading govuk-heading-s" %>
20
- <%= tag.p class: "gem-c-contextual-sidebar__brexit-text govuk-body" do %>
18
+ <%= tag.div class: "gem-c-contextual-sidebar__cta gem-c-contextual-sidebar__cta--brexit" do %>
19
+ <%= tag.h2 title, class: "gem-c-contextual-sidebar__heading govuk-heading-s" %>
20
+ <%= tag.p class: "gem-c-contextual-sidebar__text govuk-body" do %>
21
21
  <%= link_to link_text,
22
22
  link_path,
23
23
  class: "govuk-link",
@@ -0,0 +1,27 @@
1
+ <% shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns) %>
2
+ <%
3
+ title = t("components.related_navigation.covid_booster.title")
4
+ link_text = t("components.related_navigation.covid_booster.link_text")
5
+ link_path = t("components.related_navigation.covid_booster.link_path")
6
+ lang = shared_helper.t_locale("components.related_navigation.covid_booster.title")
7
+ %>
8
+
9
+ <% data_attributes = {
10
+ "module": "gem-track-click",
11
+ "track-category": "relatedLinkClicked",
12
+ "track-action": "1.0 Coronavirus",
13
+ "track-label": link_path,
14
+ "track-dimension": link_text,
15
+ "track-dimension-index": "29",
16
+ } %>
17
+
18
+ <%= tag.div class: "gem-c-contextual-sidebar__cta gem-c-contextual-sidebar__cta--covid" do %>
19
+ <%= tag.h2 title, class: "gem-c-contextual-sidebar__heading govuk-heading-s" %>
20
+ <%= tag.p class: "gem-c-contextual-sidebar__text govuk-body" do %>
21
+ <%= link_to link_text,
22
+ link_path,
23
+ class: "govuk-link",
24
+ data: data_attributes,
25
+ lang: lang %>
26
+ <% end %>
27
+ <% end %>
@@ -11,6 +11,8 @@ body: |
11
11
 
12
12
  It must always be used [with the contextual breadcrumbs component][contextual_breadcrumbs].
13
13
 
14
+ The COVID CTA will displayed on all pages except for a few exemptions documented below.
15
+
14
16
  [preview]: /contextual-navigation
15
17
  [step-by-step]: /component-guide/step_by_step_nav
16
18
  [related_navigation]: /component-guide/related_navigation
@@ -86,69 +88,6 @@ examples:
86
88
  - text: The Highway Code
87
89
  href: "/guidance/the-highway-code"
88
90
  optional: false
89
- with_brexit_and_other_related_links:
90
- data:
91
- content_item:
92
- title: "A content item"
93
- links:
94
- taxons:
95
- - content_id: "test"
96
- title: "Not Brexit"
97
- phase: "live"
98
- links:
99
- parent_taxons:
100
- - content_id: "d6c2de5d-ef90-45d1-82d4-5f2438369eea"
101
- title: "Brexit"
102
- ordered_related_items:
103
- - title: Find an apprenticeship
104
- base_path: /apply-apprenticeship
105
- - title: Training and study at work
106
- base_path: /training-study-work-your-rights
107
- - title: Careers helpline for teenagers
108
- base_path: /careers-helpline-for-teenagers
109
- document_collections:
110
- - title: Recruit an apprentice (formerly apprenticeship vacancies)
111
- base_path: /government/collections/apprenticeship-vacancies
112
- document_type: document_collection
113
- - title: The future of jobs and skills
114
- base_path: /government/collections/the-future-of-jobs-and-skills
115
- document_type: document_collection
116
- with_brexit_related_links_and_step_by_steps:
117
- data:
118
- content_item:
119
- title: "A content item"
120
- links:
121
- taxons:
122
- - content_id: "d6c2de5d-ef90-45d1-82d4-5f2438369eea"
123
- title: "Brexit"
124
- phase: "live"
125
- part_of_step_navs:
126
- - title: "Choosing a micropig or micropug: step by step"
127
- base_path: "/micropigs-vs-micropugs"
128
- details:
129
- step_by_step_nav:
130
- title: 'Stay in the UK after it leaves the EU (''settled status''): step by step'
131
- steps:
132
- - title: Check if you need to apply to the EU Settlement Scheme
133
- contents:
134
- - type: paragraph
135
- text: 'You may need to apply to the EU Settlement Scheme to continue living
136
- in the UK. '
137
- - type: list
138
- contents:
139
- - text: Check if you need to apply
140
- href: "/settled-status-eu-citizens-families/eligibility"
141
- optional: false
142
- - title: Find out what status you’ll get
143
- contents:
144
- - type: paragraph
145
- text: You’ll get settled or pre-settled status depending on how long you’ve
146
- been living in the UK. This might affect when you choose to apply.
147
- - type: list
148
- contents:
149
- - text: Find out what you’ll get
150
- href: "/settled-status-eu-citizens-families/what-settled-and-presettled-status-means"
151
- optional: false
152
91
  with_brexit_cta:
153
92
  description: For documents tagged with certain taxons defined in `brexit_cta_taxon_allow_list` we show a custom Brexit call to action element.
154
93
  data:
@@ -172,17 +111,19 @@ examples:
172
111
  base_path: /government/collections/the-future-of-jobs-and-skills
173
112
  document_type: document_collection
174
113
  taxons:
175
- - content_id: "a4038b29-b332-4f13-98b1-1c9709e216bc"
176
- title: "Transport"
114
+ - content_id: "2f8b848d-23c8-4f42-a41a-df1f81c64d0f"
115
+ title: "Exporting"
177
116
  phase: "live"
178
- with_brexit_cta_document_exception:
179
- description: Illustrates an exception to showing the custom Brexit call to action element as defined in `brexit_cta_document_type_exceptions`.
117
+ with_covid_cta_taxon_exception:
118
+ description: The COVID Booster call to action element is not displayed on content tagged to taxons in `covid_booster_cta_taxon_exception_list`.
180
119
  data:
181
120
  content_item:
182
- title: "30 creative teams awarded up to £100,000 each for Festival UK* 2022 R&D project"
183
- content_id: "c3752802-f091-43a9-ba90-33568fccf391"
184
- locale: "en"
121
+ title: "A content item"
185
122
  links:
123
+ taxons:
124
+ - content_id: ac7b8472-5d09-4679-9551-87847b0ac827
125
+ title: "Not Covid"
126
+ phase: "live"
186
127
  ordered_related_items:
187
128
  - title: Find an apprenticeship
188
129
  base_path: /apply-apprenticeship
@@ -197,17 +138,12 @@ examples:
197
138
  - title: The future of jobs and skills
198
139
  base_path: /government/collections/the-future-of-jobs-and-skills
199
140
  document_type: document_collection
200
- taxons:
201
- - content_id: "e2ca2f1a-0ff3-43ce-b813-16645ff27904"
202
- title: "Society and culture"
203
- phase: "live"
204
- with_brexit_cta_taxon_exception:
205
- description: Illustrates an exception to showing the custom Brexit call to action element as defined in `brexit_cta_taxon_exception_list`.
141
+ with_covid_cta_document_type_exception:
142
+ description: Illustrates an exception to showing the custom COVID Booster call to action element as defined in `covid_booster_cta_document_type_exceptions`.
206
143
  data:
207
144
  content_item:
208
- title: "Local transport news story"
209
- content_id: "5c82db20-7631-11e4-a3cb-005056011aef"
210
- locale: "en"
145
+ title: "A content item"
146
+ document_type: smart_answer
211
147
  links:
212
148
  ordered_related_items:
213
149
  - title: Find an apprenticeship
@@ -223,11 +159,3 @@ examples:
223
159
  - title: The future of jobs and skills
224
160
  base_path: /government/collections/the-future-of-jobs-and-skills
225
161
  document_type: document_collection
226
- taxons:
227
- - content_id: "3b4d6319-fcef-4637-b35a-e3df76321894"
228
- title: "Local transport"
229
- phase: "live"
230
- links:
231
- parent_taxons:
232
- - content_id: "a4038b29-b332-4f13-98b1-1c9709e216bc"
233
- title: "Transport"
@@ -5,6 +5,11 @@ body: |
5
5
 
6
6
  This component uses JavaScript for expanding and collapsing and also for submitting form responses. This code is not compatible with Internet Explorer, so IE11 and down do not use JavaScript to submit the forms, instead falling back to a normal form submission.
7
7
  accessibility_criteria: |
8
+ The form must:
9
+
10
+ * be functional and accessible with JavaScript disabled
11
+ * be usable and accessible with stylesheets disabled
12
+
8
13
  Form elements in the component must:
9
14
 
10
15
  * accept focus
@@ -253,3 +253,32 @@ examples:
253
253
  image_alt: "some meaningful alt text please"
254
254
  heading_text: Yr hyn rydym ni'n ei wneud
255
255
  lang: cy
256
+ with_sizes_attribute:
257
+ description: |
258
+ `sizes` is an attribute that makes use of html's native responsive images functionality.
259
+
260
+ [Read more about responsive images](https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images)
261
+ data:
262
+ href: "/not-a-page"
263
+ image_src: "https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/62756/s300_courts-of-justice.JPG"
264
+ image_alt: "some meaningful alt text please"
265
+ heading_text: "News headline"
266
+ sizes: "(max-width: 640px) 100vw, (max-width: 1020px) 33vw, 300px"
267
+ with_srcset:
268
+ description: |
269
+ `srcset` is another responsive images attribute (see `sizes` section above for info on how responsive images work).
270
+
271
+ `srcset` strings typically pull from the `asset/images` directory of a repo so use this as a starting point when writing paths for your `srcset` image keys.
272
+
273
+ Note that the below example will appear to render incorrectly as we don't want to include `srcset` example images in our component guide as this will get served to frontend apps, adding weight to the user to download.
274
+ data:
275
+ href: "/not-a-page"
276
+ image_src: "/assets/govuk_publishing_components/image-card-srcset/afghan-image-promo.jpg"
277
+ image_alt: "some meaningful alt text please"
278
+ heading_text: "News headline"
279
+ srcset:
280
+ /assets/govuk_publishing_components/image-card-srcset/cop26.jpg: 610w
281
+ /assets/govuk_publishing_components/image-card-srcset/cop26-480.jpg: 480w
282
+ /assets/govuk_publishing_components/image-card-srcset/cop26-320.jpg: 320w
283
+ /assets/govuk_publishing_components/image-card-srcset/cop26-240.jpg: 240w
284
+ /assets/govuk_publishing_components/image-card-srcset/cop26-170.jpg: 170w
@@ -38,6 +38,15 @@ examples:
38
38
  suggestion_link_text: "You can now apply for a permit online."
39
39
  suggestion_link_url: "/permit"
40
40
 
41
+ with_hide:
42
+ description: |
43
+ This example is for when we want to hide by default and display to the user based on some logic,
44
+ either in the backend or with Javascript.
45
+ data:
46
+ suggestion_link_text: "You may be invited to fill in a questionnaire"
47
+ suggestion_link_url: "/questionnaire"
48
+ hide: true
49
+
41
50
  open_suggestion_link_in_new_tab:
42
51
  description: |
43
52
  When sending users to another online task, you don't want to completely hijack
@@ -44,6 +44,9 @@ examples:
44
44
  large_version:
45
45
  data:
46
46
  size: "large"
47
+ large_version_on_mobile_only:
48
+ data:
49
+ size: "large-mobile"
47
50
  change_field_name:
48
51
  description: To be used if you need to change the default name 'q'
49
52
  data:
@@ -0,0 +1,39 @@
1
+ name: Signup link
2
+ description: Renders a box with a link to sign up for email notifications
3
+ accessibility_criteria: |
4
+ - the component must use the correct heading level for the page
5
+ - text should have a text contrast ratio higher than 4.5:1 against the background colour to meet WCAG AA
6
+ - the icon must not be focusable or shown to screenreaders
7
+ shared_accessibility_criteria:
8
+ - link
9
+ examples:
10
+ default:
11
+ data:
12
+ heading: 'Sign up for email notifications'
13
+ link_text: 'Click right here to sign up!!'
14
+ link_href: '/this-signs-you-up'
15
+ with_background_and_border:
16
+ data:
17
+ heading: 'Sign up for email notifications'
18
+ link_text: 'Click right here to sign up!!'
19
+ link_href: '/this-signs-you-up'
20
+ background: true
21
+ link_only:
22
+ description: If no heading text is passed through, a more compact, link only version is rendered.
23
+ data:
24
+ link_text: 'Click right here to sign up!!'
25
+ link_href: '/this-signs-you-up'
26
+ with_custom_margin_bottom:
27
+ description: The component accepts a number for margin bottom from 0 to 9 (0px to 60px) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to having no margin bottom.
28
+ data:
29
+ heading: 'Sign up for email notifications'
30
+ link_text: 'Click right here to sign up!!'
31
+ link_href: '/this-signs-you-up'
32
+ margin_bottom: 8
33
+ with_custom_heading_level:
34
+ description: Override default heading level by passing through `heading_level` parameter (defaults to `h3`).
35
+ data:
36
+ heading: 'Sign up for email notifications'
37
+ link_text: 'Click right here to sign up!!'
38
+ link_href: '/this-signs-you-up'
39
+ heading_level: 1
@@ -1,9 +1,10 @@
1
1
  <form action="/contact/govuk/problem_reports"
2
2
  id="something-is-wrong"
3
- class="gem-c-feedback__form js-feedback-form js-hidden"
3
+ class="gem-c-feedback__form js-feedback-form"
4
4
  data-track-category="Onsite Feedback"
5
5
  data-track-action="GOV.UK Send Form"
6
- method="post">
6
+ method="post"
7
+ hidden>
7
8
  <button
8
9
  class="govuk-button govuk-button--secondary gem-c-feedback__close gem-c-feedback__js-show js-close-form"
9
10
  data-track-category="Onsite Feedback"
@@ -15,26 +16,28 @@
15
16
 
16
17
  <div class="govuk-grid-row">
17
18
  <div class="govuk-grid-column-two-thirds">
18
- <div class="gem-c-feedback__error-summary gem-c-feedback__js-show js-hidden js-errors" tabindex="-1"></div>
19
+ <div class="gem-c-feedback__error-summary gem-c-feedback__js-show js-errors" tabindex="-1" hidden></div>
19
20
 
20
21
  <input type="hidden" name="url" value="<%= url_without_pii %>">
21
22
 
22
23
  <h3 class="gem-c-feedback__form-heading"><%= t("components.feedback.help_us_improve_govuk") %></h3>
23
24
  <p id="feedback_explanation" class="gem-c-feedback__form-paragraph"><%= t("components.feedback.dont_include_personal_info") %></p>
24
25
 
25
- <%= render "govuk_publishing_components/components/input", {
26
+ <%= render "govuk_publishing_components/components/textarea", {
26
27
  label: {
27
28
  text: t("components.feedback.what_doing")
28
29
  },
29
30
  name: "what_doing",
31
+ rows: 3,
30
32
  describedby: "feedback_explanation"
31
33
  } %>
32
34
 
33
- <%= render "govuk_publishing_components/components/input", {
35
+ <%= render "govuk_publishing_components/components/textarea", {
34
36
  label: {
35
37
  text: t("components.feedback.what_wrong")
36
38
  },
37
- name: "what_wrong"
39
+ name: "what_wrong",
40
+ rows: 3
38
41
  } %>
39
42
 
40
43
  <%= render "govuk_publishing_components/components/button", {
@@ -1,6 +1,6 @@
1
1
  <form action="/contact/govuk/email-survey-signup"
2
2
  id="page-is-not-useful"
3
- class="gem-c-feedback__form gem-c-feedback__form--email gem-c-feedback__js-show js-feedback-form js-hidden"
3
+ class="gem-c-feedback__form gem-c-feedback__form--email gem-c-feedback__js-show js-feedback-form"
4
4
  data-track-category="yesNoFeedbackForm"
5
5
  data-track-action="Send Form"
6
6
  method="post">
@@ -9,13 +9,14 @@
9
9
  data-track-category="yesNoFeedbackForm"
10
10
  data-track-action="ffFormClose"
11
11
  aria-controls="page-is-not-useful"
12
- aria-expanded="true">
12
+ aria-expanded="true"
13
+ hidden>
13
14
  <%= t("components.feedback.close") %>
14
15
  </button>
15
16
 
16
17
  <div class="govuk-grid-row">
17
18
  <div class="govuk-grid-column-two-thirds" id="survey-wrapper">
18
- <div class="gem-c-feedback__error-summary js-hidden js-errors" tabindex="-1"></div>
19
+ <div class="gem-c-feedback__error-summary js-errors" tabindex="-1" hidden></div>
19
20
 
20
21
  <input name="email_survey_signup[survey_id]" type="hidden" value="footer_satisfaction_survey">
21
22
  <input name="email_survey_signup[survey_source]" type="hidden" value="<%= path_without_pii %>">
@@ -3,10 +3,10 @@
3
3
  %>
4
4
 
5
5
  <div class="gem-c-feedback__prompt gem-c-feedback__js-show js-prompt" tabindex="-1">
6
- <div class="gem-c-feedback__prompt-questions js-prompt-questions">
6
+ <div class="gem-c-feedback__prompt-questions js-prompt-questions" hidden>
7
7
  <h2 class="gem-c-feedback__prompt-question"><%= t("components.feedback.is_this_page_useful") %></h2>
8
8
  <!-- Maybe button exists only to try and capture clicks by bots -->
9
- <button data-track-category="yesNoFeedbackForm" data-track-action="ffMaybeClick" aria-expanded="false" style="display: none" hidden="hidden" aria-hidden="true">
9
+ <button data-track-category="yesNoFeedbackForm" data-track-action="ffMaybeClick" aria-expanded="false" hidden>
10
10
  <%= t("components.feedback.maybe") %>
11
11
  </button>
12
12
 
@@ -23,10 +23,10 @@
23
23
  </li>
24
24
  </ul>
25
25
  </div>
26
- <div class="gem-c-feedback__prompt-questions gem-c-feedback__prompt-success js-prompt-success js-hidden" role="alert">
26
+ <div class="gem-c-feedback__prompt-questions gem-c-feedback__prompt-success js-prompt-success" role="alert" hidden>
27
27
  <%= t("components.feedback.thank_you_for_feedback") %>
28
28
  </div>
29
- <div class="gem-c-feedback__prompt-questions gem-c-feedback__prompt-questions--something-is-wrong js-prompt-questions">
29
+ <div class="gem-c-feedback__prompt-questions gem-c-feedback__prompt-questions--something-is-wrong js-prompt-questions" hidden>
30
30
  <button class="govuk-button gem-c-feedback__prompt-link js-toggle-form js-something-is-wrong" data-track-category="Onsite Feedback" data-track-action="GOV-UK Open Form" aria-controls="something-is-wrong" aria-expanded="false">
31
31
  <%= t("components.feedback.something_wrong") %>
32
32
  </button>
@@ -1,6 +1,6 @@
1
1
  <div class="govuk-header__logo gem-c-header__logo">
2
2
  <a href="<%= logo_link %>" class="govuk-header__link govuk-header__link--homepage" data-module="gem-track-click" data-track-category="homeLinkClicked" data-track-action="homeHeader">
3
- <span class="govuk-header__logotype gem-c-header__logotype">
3
+ <span class="govuk-header__logotype gem-c-header__logotype header-logo">
4
4
  <!--[if gt IE 8]><!-->
5
5
  <svg aria-hidden="true" focusable="false" class="govuk-header__logotype-crown" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 132 97" height="30" width="36">
6
6
  <path fill="currentColor" fill-rule="evenodd" d="M25 30.2c3.5 1.5 7.7-.2 9.1-3.7 1.5-3.6-.2-7.8-3.9-9.2-3.6-1.4-7.6.3-9.1 3.9-1.4 3.5.3 7.5 3.9 9zM9 39.5c3.6 1.5 7.8-.2 9.2-3.7 1.5-3.6-.2-7.8-3.9-9.1-3.6-1.5-7.6.2-9.1 3.8-1.4 3.5.3 7.5 3.8 9zM4.4 57.2c3.5 1.5 7.7-.2 9.1-3.8 1.5-3.6-.2-7.7-3.9-9.1-3.5-1.5-7.6.3-9.1 3.8-1.4 3.5.3 7.6 3.9 9.1zm38.3-21.4c3.5 1.5 7.7-.2 9.1-3.8 1.5-3.6-.2-7.7-3.9-9.1-3.6-1.5-7.6.3-9.1 3.8-1.3 3.6.4 7.7 3.9 9.1zm64.4-5.6c-3.6 1.5-7.8-.2-9.1-3.7-1.5-3.6.2-7.8 3.8-9.2 3.6-1.4 7.7.3 9.2 3.9 1.3 3.5-.4 7.5-3.9 9zm15.9 9.3c-3.6 1.5-7.7-.2-9.1-3.7-1.5-3.6.2-7.8 3.7-9.1 3.6-1.5 7.7.2 9.2 3.8 1.5 3.5-.3 7.5-3.8 9zm4.7 17.7c-3.6 1.5-7.8-.2-9.2-3.8-1.5-3.6.2-7.7 3.9-9.1 3.6-1.5 7.7.3 9.2 3.8 1.3 3.5-.4 7.6-3.9 9.1zM89.3 35.8c-3.6 1.5-7.8-.2-9.2-3.8-1.4-3.6.2-7.7 3.9-9.1 3.6-1.5 7.7.3 9.2 3.8 1.4 3.6-.3 7.7-3.9 9.1zM69.7 17.7l8.9 4.7V9.3l-8.9 2.8c-.2-.3-.5-.6-.9-.9L72.4 0H59.6l3.5 11.2c-.3.3-.6.5-.9.9l-8.8-2.8v13.1l8.8-4.7c.3.3.6.7.9.9l-5 15.4v.1c-.2.8-.4 1.6-.4 2.4 0 4.1 3.1 7.5 7 8.1h.2c.3 0 .7.1 1 .1.4 0 .7 0 1-.1h.2c4-.6 7.1-4.1 7.1-8.1 0-.8-.1-1.7-.4-2.4V34l-5.1-15.4c.4-.2.7-.6 1-.9zM66 92.8c16.9 0 32.8 1.1 47.1 3.2 4-16.9 8.9-26.7 14-33.5l-9.6-3.4c1 4.9 1.1 7.2 0 10.2-1.5-1.4-3-4.3-4.2-8.7L108.6 76c2.8-2 5-3.2 7.5-3.3-4.4 9.4-10 11.9-13.6 11.2-4.3-.8-6.3-4.6-5.6-7.9 1-4.7 5.7-5.9 8-.5 4.3-8.7-3-11.4-7.6-8.8 7.1-7.2 7.9-13.5 2.1-21.1-8 6.1-8.1 12.3-4.5 20.8-4.7-5.4-12.1-2.5-9.5 6.2 3.4-5.2 7.9-2 7.2 3.1-.6 4.3-6.4 7.8-13.5 7.2-10.3-.9-10.9-8-11.2-13.8 2.5-.5 7.1 1.8 11 7.3L80.2 60c-4.1 4.4-8 5.3-12.3 5.4 1.4-4.4 8-11.6 8-11.6H55.5s6.4 7.2 7.9 11.6c-4.2-.1-8-1-12.3-5.4l1.4 16.4c3.9-5.5 8.5-7.7 10.9-7.3-.3 5.8-.9 12.8-11.1 13.8-7.2.6-12.9-2.9-13.5-7.2-.7-5 3.8-8.3 7.1-3.1 2.7-8.7-4.6-11.6-9.4-6.2 3.7-8.5 3.6-14.7-4.6-20.8-5.8 7.6-5 13.9 2.2 21.1-4.7-2.6-11.9.1-7.7 8.8 2.3-5.5 7.1-4.2 8.1.5.7 3.3-1.3 7.1-5.7 7.9-3.5.7-9-1.8-13.5-11.2 2.5.1 4.7 1.3 7.5 3.3l-4.7-15.4c-1.2 4.4-2.7 7.2-4.3 8.7-1.1-3-.9-5.3 0-10.2l-9.5 3.4c5 6.9 9.9 16.7 14 33.5 14.8-2.1 30.8-3.2 47.7-3.2z"></path>