govuk_publishing_components 35.5.0 → 35.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -0
  3. data/app/assets/javascripts/component_guide/audit-filter.js +45 -0
  4. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-auto-tracker.js +0 -3
  5. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-core.js +30 -35
  6. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-event-tracker.js +0 -1
  7. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-link-tracker.js +1 -3
  8. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-page-views.js +1 -1
  9. data/app/assets/stylesheets/component_guide/application.scss +0 -29
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_select.scss +0 -8
  11. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +3 -2
  12. data/app/views/govuk_publishing_components/audit/_component_contents.html.erb +37 -49
  13. data/app/views/govuk_publishing_components/components/_attachment.html.erb +38 -18
  14. data/app/views/govuk_publishing_components/components/_character_count.html.erb +4 -2
  15. data/app/views/govuk_publishing_components/components/_contents_list.html.erb +17 -2
  16. data/app/views/govuk_publishing_components/components/_feedback.html.erb +1 -0
  17. data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +3 -0
  18. data/app/views/govuk_publishing_components/components/_metadata.html.erb +12 -1
  19. data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb +20 -1
  20. data/app/views/govuk_publishing_components/components/_radio.html.erb +1 -0
  21. data/app/views/govuk_publishing_components/components/_search.html.erb +1 -0
  22. data/app/views/govuk_publishing_components/components/_select.html.erb +1 -0
  23. data/app/views/govuk_publishing_components/components/_step_by_step_nav_related.html.erb +1 -1
  24. data/app/views/govuk_publishing_components/components/attachment/_thumbnail_document.html.erb +1 -1
  25. data/app/views/govuk_publishing_components/components/attachment/_thumbnail_generic.html.erb +1 -1
  26. data/app/views/govuk_publishing_components/components/attachment/_thumbnail_html.html.erb +3 -0
  27. data/app/views/govuk_publishing_components/components/attachment/_thumbnail_spreadsheet.html.erb +1 -1
  28. data/app/views/govuk_publishing_components/components/docs/attachment.yml +21 -0
  29. data/app/views/govuk_publishing_components/components/docs/contents_list.yml +19 -0
  30. data/app/views/govuk_publishing_components/components/docs/contextual_guidance.yml +11 -4
  31. data/app/views/govuk_publishing_components/components/docs/fieldset.yml +75 -30
  32. data/app/views/govuk_publishing_components/components/docs/govspeak.yml +43 -0
  33. data/app/views/govuk_publishing_components/components/docs/inverse_header.yml +42 -32
  34. data/app/views/govuk_publishing_components/components/docs/metadata.yml +7 -0
  35. data/app/views/govuk_publishing_components/components/docs/modal_dialogue.yml +35 -5
  36. data/app/views/govuk_publishing_components/components/docs/previous_and_next_navigation.yml +12 -0
  37. data/app/views/govuk_publishing_components/components/docs/textarea.yml +8 -2
  38. data/app/views/layouts/govuk_publishing_components/application.html.erb +23 -20
  39. data/config/locales/ar.yml +1 -0
  40. data/config/locales/az.yml +1 -0
  41. data/config/locales/be.yml +1 -0
  42. data/config/locales/bg.yml +1 -0
  43. data/config/locales/bn.yml +1 -0
  44. data/config/locales/cs.yml +1 -0
  45. data/config/locales/cy.yml +1 -0
  46. data/config/locales/da.yml +1 -0
  47. data/config/locales/de.yml +1 -0
  48. data/config/locales/dr.yml +1 -0
  49. data/config/locales/el.yml +1 -0
  50. data/config/locales/en.yml +1 -0
  51. data/config/locales/es-419.yml +1 -0
  52. data/config/locales/es.yml +1 -0
  53. data/config/locales/et.yml +1 -0
  54. data/config/locales/fa.yml +1 -0
  55. data/config/locales/fi.yml +1 -0
  56. data/config/locales/fr.yml +1 -0
  57. data/config/locales/gd.yml +1 -0
  58. data/config/locales/gu.yml +1 -0
  59. data/config/locales/he.yml +1 -0
  60. data/config/locales/hi.yml +1 -0
  61. data/config/locales/hr.yml +1 -0
  62. data/config/locales/hu.yml +1 -0
  63. data/config/locales/hy.yml +1 -0
  64. data/config/locales/id.yml +1 -0
  65. data/config/locales/is.yml +1 -0
  66. data/config/locales/it.yml +1 -0
  67. data/config/locales/ja.yml +1 -0
  68. data/config/locales/ka.yml +1 -0
  69. data/config/locales/kk.yml +1 -0
  70. data/config/locales/ko.yml +1 -0
  71. data/config/locales/lt.yml +1 -0
  72. data/config/locales/lv.yml +1 -0
  73. data/config/locales/ms.yml +1 -0
  74. data/config/locales/mt.yml +1 -0
  75. data/config/locales/nl.yml +1 -0
  76. data/config/locales/no.yml +1 -0
  77. data/config/locales/pa-pk.yml +1 -0
  78. data/config/locales/pa.yml +1 -0
  79. data/config/locales/pl.yml +1 -0
  80. data/config/locales/ps.yml +1 -0
  81. data/config/locales/pt.yml +1 -0
  82. data/config/locales/ro.yml +1 -0
  83. data/config/locales/ru.yml +1 -0
  84. data/config/locales/si.yml +1 -0
  85. data/config/locales/sk.yml +1 -0
  86. data/config/locales/sl.yml +1 -0
  87. data/config/locales/so.yml +1 -0
  88. data/config/locales/sq.yml +1 -0
  89. data/config/locales/sr.yml +1 -0
  90. data/config/locales/sv.yml +1 -0
  91. data/config/locales/sw.yml +1 -0
  92. data/config/locales/ta.yml +1 -0
  93. data/config/locales/th.yml +1 -0
  94. data/config/locales/tk.yml +1 -0
  95. data/config/locales/tr.yml +1 -0
  96. data/config/locales/uk.yml +1 -0
  97. data/config/locales/ur.yml +1 -0
  98. data/config/locales/uz.yml +1 -0
  99. data/config/locales/vi.yml +1 -0
  100. data/config/locales/zh-hk.yml +1 -0
  101. data/config/locales/zh-tw.yml +1 -0
  102. data/config/locales/zh.yml +1 -0
  103. data/lib/govuk_publishing_components/app_helpers/asset_helper.rb +5 -1
  104. data/lib/govuk_publishing_components/presenters/attachment_helper.rb +15 -3
  105. data/lib/govuk_publishing_components/version.rb +1 -1
  106. data/node_modules/axe-core/README.md +4 -0
  107. data/node_modules/axe-core/axe.js +25 -19
  108. data/node_modules/axe-core/axe.min.js +2 -2
  109. data/node_modules/axe-core/package.json +1 -1
  110. data/node_modules/axe-core/sri-history.json +4 -0
  111. metadata +4 -3
@@ -1,13 +1,16 @@
1
1
  <%
2
2
  add_gem_component_stylesheet("previous-and-next-navigation")
3
+ ga4_tracking ||= false
3
4
 
4
5
  if local_assigns.include?(:next_page) || local_assigns.include?(:previous_page)
5
6
  %>
6
-
7
7
  <nav
8
8
  class="govuk-pagination govuk-pagination--block"
9
9
  role="navigation"
10
10
  aria-label="<%= t("components.previous_and_next_navigation.pagination") %>"
11
+ <% if ga4_tracking %>
12
+ data-module="ga4-link-tracker"
13
+ <% end %>
11
14
  >
12
15
  <% if local_assigns.include?(:previous_page) %>
13
16
  <%
@@ -24,6 +27,14 @@
24
27
  data-track-label="<%= previous_page[:url] %>"
25
28
  data-track-dimension="previous"
26
29
  data-track-dimension-index="29"
30
+ <% if ga4_tracking %>
31
+ data-ga4-link = "<%= {
32
+ event_name: "navigation",
33
+ type: "content",
34
+ text: previous_page[:label] || title,
35
+ section: "Previous",
36
+ }.to_json %>"
37
+ <% end %>
27
38
  >
28
39
  <svg class="govuk-pagination__icon govuk-pagination__icon--prev" xmlns="http://www.w3.org/2000/svg" height="13" width="15" aria-hidden="true" focusable="false" viewBox="0 0 15 13">
29
40
  <path d="m6.5938-0.0078125-6.7266 6.7266 6.7441 6.4062 1.377-1.449-4.1856-3.9768h12.896v-2h-12.984l4.2931-4.293-1.414-1.414z"></path>
@@ -52,6 +63,14 @@
52
63
  data-track-label="<%= next_page[:url] %>"
53
64
  data-track-dimension="next"
54
65
  data-track-dimension-index="29"
66
+ <% if ga4_tracking %>
67
+ data-ga4-link = "<%= {
68
+ event_name: "navigation",
69
+ type: "content",
70
+ text: next_page[:label] || title,
71
+ section: "Next",
72
+ }.to_json %>"
73
+ <% end %>
55
74
  >
56
75
  <svg class="govuk-pagination__icon govuk-pagination__icon--next" xmlns="http://www.w3.org/2000/svg" height="13" width="15" aria-hidden="true" focusable="false" viewBox="0 0 15 13">
57
76
  <path d="m8.107-0.0078125-1.4136 1.414 4.2926 4.293h-12.986v2h12.896l-4.1855 3.9766 1.377 1.4492 6.7441-6.4062-6.7246-6.7266z"></path>
@@ -1,4 +1,5 @@
1
1
  <%
2
+ add_gem_component_stylesheet("label")
2
3
  add_gem_component_stylesheet("radio")
3
4
 
4
5
  local_assigns[:margin_bottom] ||= 6
@@ -49,6 +49,7 @@
49
49
 
50
50
  <div class="<%= classes.join(" ") %>" data-module="gem-toggle-input-class-on-focus">
51
51
  <% if wrap_label_in_a_heading %>
52
+ <% add_gem_component_stylesheet("label") %>
52
53
  <%= content_tag(shared_helper.get_heading_level, class: "govuk-!-margin-0") do %>
53
54
  <%= tag_label %>
54
55
  <% end %>
@@ -17,6 +17,7 @@
17
17
  <% if select_helper.options.any? && id && label %>
18
18
  <%= content_tag :div, class: select_helper.css_classes do %>
19
19
  <% if is_page_heading %>
20
+ <% add_gem_component_stylesheet("title") %>
20
21
  <%= tag.h1 label_tag(id, label, class: select_helper.label_classes), class: "gem-c-title__text" %>
21
22
  <% else %>
22
23
  <%= label_tag(id, label, class: select_helper.label_classes) %>
@@ -61,7 +61,7 @@
61
61
  "index_link": (index + 1).to_s
62
62
  },
63
63
  index_total: (links.length).to_s,
64
- section: "Part of",
64
+ section: pretitle,
65
65
  }.to_json
66
66
  %>
67
67
  data-ga4-link="<%= ga4_attributes %>"
@@ -1,3 +1,3 @@
1
- <svg class="gem-c-attachment__thumbnail-image" version="1.1" viewBox="0 0 99 140" width="99" height="140" aria-hidden="true">
1
+ <svg class="gem-c-attachment__thumbnail-image gem-c-attachment__thumbnail-image--document" version="1.1" viewBox="0 0 99 140" width="99" height="140" aria-hidden="true">
2
2
  <path d="M12 12h75v27H12zM12 59h9v9h-9zM12 77h9v9h-9zM12 95h9v9h-9zM12 113h9v9h-9zM30 59h57v9H30zM30 77h39v9H30zM30 95h57v9H30zM30 113h48v9H30z" stroke-width="0"/>
3
3
  </svg>
@@ -1,4 +1,4 @@
1
- <svg class="gem-c-attachment__thumbnail-image" version="1.1" viewBox="0 0 84 120" width="84" height="120" aria-hidden="true">
1
+ <svg class="gem-c-attachment__thumbnail-image gem-c-attachment__thumbnail-image--generic" version="1.1" viewBox="0 0 84 120" width="84" height="120" aria-hidden="true">
2
2
  <path d="M74.85 5v106H5" fill="none" stroke-miterlimit="10" stroke-width="2"/>
3
3
  <path d="M79.85 10v106H10" fill="none" stroke-miterlimit="10" stroke-width="2"/>
4
4
  </svg>
@@ -0,0 +1,3 @@
1
+ <svg class="gem-c-attachment__thumbnail-image gem-c-attachment__thumbnail-image--html" version="1.1" viewBox="0 0 99 140" width="99" height="140" aria-hidden="true">
2
+ <path d="M30,95h57v9H30V95z M30,77v9h39v-9H30z M30,122h48v-9H30V122z M12,68h9v-9h-9V68z M12,104h9v-9h-9V104z M12,86h9v-9h-9V86z M12,122h9v-9h-9V122z M87,12v27H12V12H87z M33,17h-4v8h-6v-8h-4v18h4v-7l6,0v7l4,0V17z M49,17H35l0,3h5v15h4V20l5,0V17z M68,17h-4 l-5,6l-5-6h-4v18h4l0-12l5,6l5-6l0,12h4V17z M81,32h-6V17h-4v18h10V32z M30,68h57v-9H30V68z" stroke-width="0"/>
3
+ </svg>
@@ -1,4 +1,4 @@
1
- <svg class="gem-c-attachment__thumbnail-image" version="1.1" viewBox="0 0 99 140" width="99" height="140" aria-hidden="true">
1
+ <svg class="gem-c-attachment__thumbnail-image gem-c-attachment__thumbnail-image--spreadsheet" version="1.1" viewBox="0 0 99 140" width="99" height="140" aria-hidden="true">
2
2
  <path d="M12 12h75v27H12zm0 47h18.75v63H12zm55 2v59H51V61h16m2-2H49v63h20V59z" stroke-width="0"/>
3
3
  <path d="M49 61.05V120H32.8V61.05H49m2-2H30.75v63H51V59zm34 2V120H69.05V61.05H85m2-2H67v63h20V59z" stroke-width="0"/>
4
4
  <path d="M30 68.5h56.5M30 77.34h56.5M30 112.7h56.5M30 95.02h56.5M30 86.18h56.5M30 103.86h56.5" fill="none" stroke-miterlimit="10" stroke-width="2"/>
@@ -177,3 +177,24 @@ examples:
177
177
  content_type: application/pdf
178
178
  file_size: 20000
179
179
  thumbnail_url: "https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/791567/thumbnail_the_government_financial_reporting_review_web.pdf.png"
180
+ with_preview_link:
181
+ data:
182
+ attachment:
183
+ title: "Consular data: February 2018"
184
+ url: https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/687542/February_2018_Consular_MI.csv
185
+ filename: February_2018_Consular_MI.csv
186
+ content_type: text/csv
187
+ file_size: 51496
188
+ preview_url: https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/687542/February_2018_Consular_MI.csv/preview
189
+ html_attachment:
190
+ data:
191
+ attachment:
192
+ title: "Smart meters: unlocking the future"
193
+ url: https://www.gov.uk/government/publications/smart-meters-unlocking-the-future/smart-meters-unlocking-the-future
194
+ type: html
195
+ external_attachment:
196
+ data:
197
+ attachment:
198
+ title: "Architects Registration Board annual report 2021"
199
+ url: https://arb.org.uk/wp-content/uploads/ARB-Annual-Report-and-Financial-Statement-2021-published.pdf
200
+ type: external
@@ -192,3 +192,22 @@ examples:
192
192
  text: 2. Numbers not parsed
193
193
  - href: "#third-thing"
194
194
  text: 3. Numbers are just text
195
+ with_ga4_tracking:
196
+ description: Enables the GA4 link tracker on the list.
197
+ data:
198
+ ga4_tracking: true
199
+ contents:
200
+ - href: "#first-thing"
201
+ text: 1. First thing
202
+ items:
203
+ - href: "#second-thing"
204
+ text: 1. Nested Item
205
+ - href: "#third-thing"
206
+ text: 2. Nested Item
207
+ - href: "#first-thing"
208
+ text: 2. Second thing
209
+ items:
210
+ - href: "#second-thing"
211
+ text: 1. Nested Item
212
+ - href: "#third-thing"
213
+ text: 2. Nested Item
@@ -23,7 +23,14 @@ examples:
23
23
  content: |
24
24
  <p>The title must make clear what the content offers users. Use the words your users do to help them find this. Avoid wordplay or teases.</p>
25
25
  block: |
26
- <div class="govuk-form-group">
27
- <label class="gem-c-label govuk-label" for="news-title">News title</label>
28
- <input id="news-title" type="text" class="gem-c-input govuk-input" aria-describedby="news-title-guidance">
29
- </div>
26
+ <!-- example content -->
27
+ <%= render "govuk_publishing_components/components/input", {
28
+ label: {
29
+ text: "News title"
30
+ },
31
+ name: "news-title",
32
+ id: "news-title",
33
+ describedby: "news-title-guidance"
34
+ }
35
+ %>
36
+ <!-- end of example content -->
@@ -11,23 +11,41 @@ examples:
11
11
  data:
12
12
  legend_text: 'Do you have a passport?'
13
13
  block: |
14
- <!-- Use the radio component, this is hardcoded only for this example -->
15
- <input type="radio" id="default-yes" name="default">
16
- <label for="default-yes">Yes</label>
17
-
18
- <input type="radio" id="default-no" name="default">
19
- <label for="default-no">No</label>
14
+ <!-- example content -->
15
+ <%= render "govuk_publishing_components/components/radio", {
16
+ name: "default",
17
+ items: [
18
+ {
19
+ value: "default-yes",
20
+ text: "Yes"
21
+ },
22
+ {
23
+ value: "default-no",
24
+ text: "No"
25
+ }
26
+ ]
27
+ } %>
28
+ <!-- end of example content -->
20
29
  with_id_attribute:
21
30
  data:
22
31
  legend_text: 'Do you have a passport?'
23
32
  id: passports
24
33
  block: |
25
- <!-- Use the radio component, this is hardcoded only for this example -->
26
- <input type="radio" id="passport-yes" name="default">
27
- <label for="passport-yes">Yes</label>
28
-
29
- <input type="radio" id="passport-no" name="default">
30
- <label for="passport-no">No</label>
34
+ <!-- example content -->
35
+ <%= render "govuk_publishing_components/components/radio", {
36
+ name: "passport",
37
+ items: [
38
+ {
39
+ value: "passport-yes",
40
+ text: "Yes"
41
+ },
42
+ {
43
+ value: "passport-no",
44
+ text: "No"
45
+ }
46
+ ]
47
+ } %>
48
+ <!-- end of example content -->
31
49
  with_heading:
32
50
  description: Make the legend different sizes. Valid options are `s`, `m`, `l` and `xl`.
33
51
  data:
@@ -35,33 +53,60 @@ examples:
35
53
  heading_level: 2
36
54
  heading_size: 'm'
37
55
  block: |
38
- <!-- Use the radio component, this is hardcoded only for this example -->
39
- <input type="radio" id="level-yes" name="default">
40
- <label for="level-yes">Yes</label>
41
-
42
- <input type="radio" id="level-no" name="default">
43
- <label for="level-no">No</label>
56
+ <!-- example content -->
57
+ <%= render "govuk_publishing_components/components/radio", {
58
+ name: "level",
59
+ items: [
60
+ {
61
+ value: "level-yes",
62
+ text: "Yes"
63
+ },
64
+ {
65
+ value: "level-no",
66
+ text: "No"
67
+ }
68
+ ]
69
+ } %>
70
+ <!-- end of example content -->
44
71
  with_custom_legend_size:
45
72
  description: Make the legend different sizes. Valid options are `s`, `m`, `l` and `xl`.
46
73
  data:
47
74
  legend_text: 'Do you have a driving license?'
48
75
  heading_size: 'l'
49
76
  block: |
50
- <!-- Use the radio component, this is hardcoded only for this example -->
51
- <input type="radio" id="size-yes" name="default">
52
- <label for="size-yes">Yes</label>
53
-
54
- <input type="radio" id="size-no" name="default">
55
- <label for="size-no">No</label>
77
+ <!-- example content -->
78
+ <%= render "govuk_publishing_components/components/radio", {
79
+ name: "size",
80
+ items: [
81
+ {
82
+ value: "size-yes",
83
+ text: "Yes"
84
+ },
85
+ {
86
+ value: "size-no",
87
+ text: "No"
88
+ }
89
+ ]
90
+ } %>
91
+ <!-- end of example content -->
56
92
  with_error_message:
57
93
  description: The component also accepts an `error_id`, or generates one automatically.
58
94
  data:
59
95
  legend_text: 'Do you have a passport?'
60
96
  error_message: 'Please choose an option'
61
97
  block: |
62
- <!-- Use the radio component, this is hardcoded only for this example -->
63
- <input type="radio" id="default2-yes" name="default2">
64
- <label for="default2-yes">Yes</label>
65
-
66
- <input type="radio" id="default2-no" name="default2">
67
- <label for="default2-no">No</label>
98
+ <!-- example content -->
99
+ <%= render "govuk_publishing_components/components/radio", {
100
+ name: "default2",
101
+ items: [
102
+ {
103
+ value: "default2-yes",
104
+ text: "Yes"
105
+ },
106
+ {
107
+ value: "default2-no",
108
+ text: "No"
109
+ }
110
+ ]
111
+ } %>
112
+ <!-- end of example content -->
@@ -80,6 +80,49 @@ examples:
80
80
  </li>
81
81
  <li>three</li>
82
82
  </ul>
83
+ ordered_lists_types:
84
+ description: |
85
+ Govspeak/markdown does not generate HTML with type and start attributes,
86
+ however we still provide support for them as some advanced users write
87
+ HTML directly to achieve the list formatting.
88
+ data:
89
+ block: |
90
+ <h2>Lowercase alphabetical list</h2>
91
+ <ol type="a">
92
+ <li>one</li>
93
+ <li>two</li>
94
+ </ol>
95
+
96
+ <h2>Uppercase alphabetical list</h2>
97
+ <ol type="A">
98
+ <li>one</li>
99
+ <li>two</li>
100
+ </ol>
101
+
102
+ <h2>Lowercase Roman numeral list</h2>
103
+ <ol type="i">
104
+ <li>one</li>
105
+ <li>two</li>
106
+ </ol>
107
+
108
+ <h2>Uppercase Roman numberal list</h2>
109
+ <ol type="I">
110
+ <li>one</li>
111
+ <li>two</li>
112
+ </ol>
113
+
114
+ <h2>Numerical list starting at 3</h2>
115
+ <ol start="3">
116
+ <li>three</li>
117
+ <li>four</li>
118
+ </ol>
119
+
120
+ <h2>Lowercase alphabetical list, starting at 3</h2>
121
+ <ol type="a" start="3">
122
+ <li>three</li>
123
+ <li>four</li>
124
+ </ol>
125
+
83
126
  legislative_lists:
84
127
  data:
85
128
  block: |
@@ -16,49 +16,59 @@ examples:
16
16
  default:
17
17
  data:
18
18
  block: |
19
- <div class="gem-c-title gem-c-title--inverse">
20
- <h1 class="gem-c-title__text govuk-heading-l">
21
- Education, Training and Skills
22
- </h1>
23
- </div>
19
+ <!-- example content -->
20
+ <%= render "govuk_publishing_components/components/title", {
21
+ title: "Education, Training and Skills",
22
+ inverse: true
23
+ } %>
24
+ <!-- end of example content -->
24
25
  for_full_page_width:
25
26
  description: "Used when the header covers the full width of the page, but it's content is in the grid layout. The left-right padding is removed to make the contents line up with the other items on the page."
26
27
  data:
27
- full_width: true
28
- block: |
29
- <div class="gem-c-title gem-c-title--inverse">
30
- <h1 class="gem-c-title__text govuk-heading-l">
31
- Education, Training and Skills
32
- </h1>
33
- </div>
28
+ full_width: true
29
+ block: |
30
+ <!-- example content -->
31
+ <%= render "govuk_publishing_components/components/title", {
32
+ title: "Education, Training and Skills",
33
+ inverse: true
34
+ } %>
35
+ <!-- end of example content -->
34
36
  html_publication_header:
35
37
  description: "The inverse header component is used on HTML publications. [See example on GOV.UK here](https://www.gov.uk/government/publications/ln5-0at-jackson-homes-scopwick-ltd-environmental-permit-application-advertisement/ln5-0at-jackson-homes-scopwick-ltd-environmental-permit-application)"
36
38
  data:
37
39
  block: |
38
- <div class="gem-c-title gem-c-title--inverse gem-c-title--bottom-margin">
39
- <p class="gem-c-title__context govuk-caption-m">Notice</p>
40
- <h1 class="gem-c-title__text govuk-heading-l">
41
- LN5 0AT, Jackson Homes (Scopwick) Ltd: environmental permit application
42
- </h1>
43
- </div>
44
- <p class="publication-header__last-changed">Published 22 April 2016</p>
40
+ <!-- example content -->
41
+ <%= render "govuk_publishing_components/components/title", {
42
+ title: "LN5 0AT, Jackson Homes (Scopwick) Ltd: environmental permit application",
43
+ inverse: true,
44
+ context: "Notice",
45
+ } %>
46
+ <p class="publication-header__last-changed">Published 22 April 2016</p>
47
+ <!-- end of example content -->
45
48
  with_breadcrumbs_and_paragraph:
46
49
  data:
47
50
  padding_top: false
48
51
  block: |
49
- <div class="gem-c-breadcrumbs govuk-breadcrumbs govuk-breadcrumbs--collapse-on-mobile gem-c-breadcrumbs--inverse">
50
- <ol class="govuk-breadcrumbs__list">
51
- <li class="govuk-breadcrumbs__list-item">
52
- <a href="/section" class="govuk-breadcrumbs__link">Section</a>
53
- </li>
54
- <li class="govuk-breadcrumbs__list-item">
55
- <a href="/section/sub-section" class="govuk-breadcrumbs__link">Education of disadvantaged children</a>
56
- </li>
57
- </ol>
58
- </div>
59
- <p class="gem-c-lead-paragraph gem-c-lead-paragraph--inverse">
60
- Schools and academies, further and higher education, apprenticeships and other skills training, student funding, early years.
61
- </p>
52
+ <!-- example content -->
53
+ <%= render "govuk_publishing_components/components/breadcrumbs", {
54
+ collapse_on_mobile: true,
55
+ breadcrumbs: [
56
+ {
57
+ title: "Section",
58
+ url: "/section"
59
+ },
60
+ {
61
+ title: "Education of disadvantaged children",
62
+ url: "/section/sub-section"
63
+ }
64
+ ],
65
+ inverse: true
66
+ } %>
67
+ <%= render "govuk_publishing_components/components/lead_paragraph", {
68
+ text: "Schools and academies, further and higher education, apprenticeships and other skills training, student funding, early years.",
69
+ inverse: true
70
+ } %>
71
+ <!-- end of example content -->
62
72
  with_link:
63
73
  data:
64
74
  block: |
@@ -362,3 +362,10 @@ examples:
362
362
  first_published: 14 June 2014
363
363
  last_updated: 10 September 2015
364
364
  margin_bottom: 2
365
+ with_ga4_tracking:
366
+ description: |
367
+ Enables the GA4 link tracker on the 'See all updates' link.
368
+ data:
369
+ last_updated: 10 September 2015
370
+ see_updates_link: true
371
+ ga4_tracking: true
@@ -27,7 +27,13 @@ display_preview: false
27
27
  examples:
28
28
  default:
29
29
  embed: |
30
- <button class="govuk-button" data-toggle="modal" data-target="modal-default">Open modal</button>
30
+ <%= render "govuk_publishing_components/components/button", {
31
+ text: "Open modal",
32
+ data_attributes: {
33
+ toggle: "modal",
34
+ target: "modal-default"
35
+ }
36
+ } %>
31
37
  <%= component %>
32
38
  data:
33
39
  id: modal-default
@@ -38,7 +44,13 @@ examples:
38
44
  description: |
39
45
  A wide version of the modal dialogue will provide the same width with the main container
40
46
  embed: |
41
- <button class="govuk-button" data-toggle="modal" data-target="modal-wide">Open wide modal</button>
47
+ <%= render "govuk_publishing_components/components/button", {
48
+ text: "Open wide modal",
49
+ data_attributes: {
50
+ toggle: "modal",
51
+ target: "modal-wide"
52
+ }
53
+ } %>
42
54
  <%= component %>
43
55
  data:
44
56
  id: modal-wide
@@ -50,7 +62,13 @@ examples:
50
62
  description: |
51
63
  Modal dialogue with form elements inside to show how it prevents tabbing to outside the dialogue when open while preserving the tabindex on focusable elements
52
64
  embed: |
53
- <button class="govuk-button" data-toggle="modal" data-target="modal-with-form">Open modal with form</button>
65
+ <%= render "govuk_publishing_components/components/button", {
66
+ text: "Open modal with form",
67
+ data_attributes: {
68
+ toggle: "modal",
69
+ target: "modal-with-form"
70
+ }
71
+ } %>
54
72
  <%= component %>
55
73
  data:
56
74
  id: modal-with-form
@@ -65,7 +83,13 @@ examples:
65
83
  description: |
66
84
  Modal dialogue with a large block content to show how the modal scrolls withing the page and how it prevents scrolling the page while the dialogue is open
67
85
  embed: |
68
- <button class="govuk-button" data-toggle="modal" data-target="modal-with-large-content">Open modal with large content</button>
86
+ <%= render "govuk_publishing_components/components/button", {
87
+ text: "Open modal with large content",
88
+ data_attributes: {
89
+ toggle: "modal",
90
+ target: "modal-with-large-content"
91
+ }
92
+ } %>
69
93
  <%= component %>
70
94
  data:
71
95
  id: modal-with-large-content
@@ -78,7 +102,13 @@ examples:
78
102
  <p class="govuk-body">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed imperdiet fringilla dictum. Morbi at vehicula augue. Pellentesque varius orci et augue pellentesque, sed elementum massa posuere. Curabitur egestas consectetur arcu, in porta lorem sagittis eu. Nulla facilisi. Sed scelerisque ligula lectus. Nulla et ligula a eros laoreet lacinia nec et ipsum. Ut sagittis sapien est, ut blandit risus laoreet at. Vestibulum vitae erat sed dolor ultricies efficitur.</p>
79
103
  with_data_attributes:
80
104
  embed: |
81
- <button class="govuk-button" data-toggle="modal" data-target="modal-with-data-attributes">Open modal with data attributes</button>
105
+ <%= render "govuk_publishing_components/components/button", {
106
+ text: "Open modal with data attributes",
107
+ data_attributes: {
108
+ toggle: "modal",
109
+ target: "modal-with-data-attributes"
110
+ }
111
+ } %>
82
112
  <%= component %>
83
113
  data:
84
114
  id: modal-with-data-attributes
@@ -64,3 +64,15 @@ examples:
64
64
  url: next-page
65
65
  title: Next
66
66
  label: 'Driver CPC part 1 test: theory'
67
+ with_ga4_tracking:
68
+ description: Enables the GA4 link tracker on the links.
69
+ data:
70
+ ga4_tracking: true
71
+ previous_page:
72
+ url: previous-page
73
+ title: Previous
74
+ label: Applying for a provisional lorry or bus licence
75
+ next_page:
76
+ url: next-page
77
+ title: Next
78
+ label: 'Driver CPC part 1 test: theory'
@@ -94,9 +94,15 @@ examples:
94
94
  with_aria_attributes:
95
95
  description: Use `describedby` when the textarea is described by an element outside the component; for example, when used in conjunction with a [contextual guidance](/component-guide/contextual_guidance).
96
96
  embed: |
97
- <%= component %>
98
- <p class="govuk-body" id="contextual-guidance">The title must make clear what the content offers users. Use the words your users do to help them find this. Avoid wordplay or teases.</p>
97
+ <%= render "govuk_publishing_components/components/contextual_guidance", {
98
+ html_for: "contextual-guidance-id",
99
+ guidance_id: "contextual-guidance",
100
+ content: sanitize("<p>The title must make clear what the content offers users. Use the words your users do to help them find this. Avoid wordplay or teases.</p>")
101
+ } do %>
102
+ <%= component %>
103
+ <% end %>
99
104
  data:
105
+ id: "contextual-guidance-id"
100
106
  label:
101
107
  text: "Title"
102
108
  bold: true
@@ -1,3 +1,25 @@
1
+ <% content_for :body do %>
2
+ <% if @preview %>
3
+ <main id="wrapper" class="govuk-width-container">
4
+ <%= yield %>
5
+ </main>
6
+ <% else %>
7
+ <%= render "govuk_publishing_components/components/layout_header", {
8
+ environment: GovukPublishingComponents::AppHelpers::Environment.current_acceptance_environment,
9
+ product_name: GovukPublishingComponents::Config.component_guide_title,
10
+ href: component_guide_path
11
+ } %>
12
+ <div class="govuk-width-container app-width-container--wide">
13
+ <% if @guide_breadcrumbs %>
14
+ <%= render 'govuk_publishing_components/components/breadcrumbs', breadcrumbs: @guide_breadcrumbs %>
15
+ <% end %>
16
+ <main id="wrapper" class="govuk-main-wrapper">
17
+ <%= yield %>
18
+ </main>
19
+ </div>
20
+ <%= render "govuk_publishing_components/components/layout_footer" %>
21
+ <% end %>
22
+ <% end %>
1
23
  <!DOCTYPE html>
2
24
  <html lang="en" class="<%= "govuk-template" unless @preview %>">
3
25
  <head>
@@ -27,26 +49,7 @@
27
49
  <%= javascript_tag nonce: true do -%>
28
50
  document.body.className = ((document.body.className) ? document.body.className + ' js-enabled' : 'js-enabled');
29
51
  <% end -%>
30
- <% if @preview %>
31
- <main id="wrapper" class="govuk-width-container">
32
- <%= yield %>
33
- </main>
34
- <% else %>
35
- <%= render "govuk_publishing_components/components/layout_header", {
36
- environment: GovukPublishingComponents::AppHelpers::Environment.current_acceptance_environment,
37
- product_name: GovukPublishingComponents::Config.component_guide_title,
38
- href: component_guide_path
39
- } %>
40
- <div class="govuk-width-container app-width-container--wide">
41
- <% if @guide_breadcrumbs %>
42
- <%= render 'govuk_publishing_components/components/breadcrumbs', breadcrumbs: @guide_breadcrumbs %>
43
- <% end %>
44
- <main id="wrapper" class="govuk-main-wrapper">
45
- <%= yield %>
46
- </main>
47
- </div>
48
- <%= render "govuk_publishing_components/components/layout_footer" %>
49
- <% end %>
52
+ <%= yield :body %>
50
53
 
51
54
  <%= javascript_include_tag "component_guide/application" %>
52
55
  <%= javascript_include_tag "#{GovukPublishingComponents::Config.application_javascript}" %>
@@ -23,6 +23,7 @@ ar:
23
23
  other: "%{count} صفحات"
24
24
  two:
25
25
  zero:
26
+ preview_link:
26
27
  reference: 'مرجع: %{reference}'
27
28
  request_format_cta: طلب تنسيق يمكن الاطلاع عليه.
28
29
  request_format_details_html: إذا كنت تستخدم تكنولوجيا مساعِدة (مثل قارئ للشاشة) وتحتاج إلى إصدار من هذا المستند بتنسيق يسهل الاطلاع عليه، فيُرجى التواصل عبر البريد الإلكتروني <a href='mailto:%{alternative_format_contact_email}' target='_blank' class='govuk-link'>%{alternative_format_contact_email}</a>. من فضلك أخبرنا بالتنسيق الذي تحتاجه. إذا أخبرتنا بالتكنولوجيا المساعدة التي تستخدمها، فهذا سيساعدنا.