govuk_publishing_components 29.13.0 → 29.15.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (159) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/govuk_publishing_components/action-link-arrow--white.png +0 -0
  3. data/app/assets/images/govuk_publishing_components/action-link-arrow--white.svg +1 -0
  4. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/gtm-page-views.js +5 -3
  5. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/pii-remover.js +135 -0
  6. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4.js +2 -0
  7. data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +27 -22
  8. data/app/assets/javascripts/govuk_publishing_components/components/table.js +52 -0
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +7 -0
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_previous-and-next-navigation.scss +1 -92
  11. data/app/models/govuk_publishing_components/audit_applications.rb +31 -9
  12. data/app/models/govuk_publishing_components/audit_comparer.rb +15 -9
  13. data/app/views/govuk_publishing_components/audit/_components.html.erb +20 -2
  14. data/app/views/govuk_publishing_components/components/_action_link.html.erb +2 -0
  15. data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb +33 -36
  16. data/app/views/govuk_publishing_components/components/_table.html.erb +61 -30
  17. data/app/views/govuk_publishing_components/components/docs/accordion.yml +2 -1
  18. data/app/views/govuk_publishing_components/components/docs/action_link.yml +8 -0
  19. data/app/views/govuk_publishing_components/components/docs/back_link.yml +1 -1
  20. data/app/views/govuk_publishing_components/components/docs/big_number.yml +2 -2
  21. data/app/views/govuk_publishing_components/components/docs/breadcrumbs.yml +2 -2
  22. data/app/views/govuk_publishing_components/components/docs/button.yml +41 -40
  23. data/app/views/govuk_publishing_components/components/docs/cards.yml +2 -0
  24. data/app/views/govuk_publishing_components/components/docs/checkboxes.yml +216 -216
  25. data/app/views/govuk_publishing_components/components/docs/cookie_banner.yml +2 -1
  26. data/app/views/govuk_publishing_components/components/docs/copy_to_clipboard.yml +2 -2
  27. data/app/views/govuk_publishing_components/components/docs/details.yml +5 -1
  28. data/app/views/govuk_publishing_components/components/docs/document_list.yml +1 -2
  29. data/app/views/govuk_publishing_components/components/docs/error_alert.yml +4 -0
  30. data/app/views/govuk_publishing_components/components/docs/error_summary.yml +4 -6
  31. data/app/views/govuk_publishing_components/components/docs/image_card.yml +2 -1
  32. data/app/views/govuk_publishing_components/components/docs/intervention.yml +25 -25
  33. data/app/views/govuk_publishing_components/components/docs/organisation_logo.yml +1 -2
  34. data/app/views/govuk_publishing_components/components/docs/previous_and_next_navigation.yml +1 -1
  35. data/app/views/govuk_publishing_components/components/docs/print_link.yml +5 -1
  36. data/app/views/govuk_publishing_components/components/docs/select.yml +101 -98
  37. data/app/views/govuk_publishing_components/components/docs/table.yml +36 -1
  38. data/app/views/govuk_publishing_components/components/docs/tabs.yml +4 -0
  39. data/config/locales/ar.yml +6 -0
  40. data/config/locales/az.yml +6 -0
  41. data/config/locales/be.yml +6 -0
  42. data/config/locales/bg.yml +6 -0
  43. data/config/locales/bn.yml +6 -0
  44. data/config/locales/cs.yml +6 -0
  45. data/config/locales/cy.yml +6 -0
  46. data/config/locales/da.yml +6 -0
  47. data/config/locales/de.yml +6 -0
  48. data/config/locales/dr.yml +6 -0
  49. data/config/locales/el.yml +6 -0
  50. data/config/locales/en.yml +6 -0
  51. data/config/locales/es-419.yml +6 -0
  52. data/config/locales/es.yml +6 -0
  53. data/config/locales/et.yml +6 -0
  54. data/config/locales/fa.yml +6 -0
  55. data/config/locales/fi.yml +6 -0
  56. data/config/locales/fr.yml +6 -0
  57. data/config/locales/gd.yml +6 -0
  58. data/config/locales/gu.yml +6 -0
  59. data/config/locales/he.yml +6 -0
  60. data/config/locales/hi.yml +6 -0
  61. data/config/locales/hr.yml +6 -0
  62. data/config/locales/hu.yml +6 -0
  63. data/config/locales/hy.yml +6 -0
  64. data/config/locales/id.yml +6 -0
  65. data/config/locales/is.yml +6 -0
  66. data/config/locales/it.yml +6 -0
  67. data/config/locales/ja.yml +6 -0
  68. data/config/locales/ka.yml +6 -0
  69. data/config/locales/kk.yml +6 -0
  70. data/config/locales/ko.yml +6 -0
  71. data/config/locales/lt.yml +6 -0
  72. data/config/locales/lv.yml +6 -0
  73. data/config/locales/ms.yml +6 -0
  74. data/config/locales/mt.yml +6 -0
  75. data/config/locales/nl.yml +6 -0
  76. data/config/locales/no.yml +6 -0
  77. data/config/locales/pa-pk.yml +6 -0
  78. data/config/locales/pa.yml +6 -0
  79. data/config/locales/pl.yml +6 -0
  80. data/config/locales/ps.yml +6 -0
  81. data/config/locales/pt.yml +6 -0
  82. data/config/locales/ro.yml +6 -0
  83. data/config/locales/ru.yml +6 -0
  84. data/config/locales/si.yml +6 -0
  85. data/config/locales/sk.yml +6 -0
  86. data/config/locales/sl.yml +6 -0
  87. data/config/locales/so.yml +6 -0
  88. data/config/locales/sq.yml +6 -0
  89. data/config/locales/sr.yml +6 -0
  90. data/config/locales/sv.yml +6 -0
  91. data/config/locales/sw.yml +6 -0
  92. data/config/locales/ta.yml +6 -0
  93. data/config/locales/th.yml +6 -0
  94. data/config/locales/tk.yml +6 -0
  95. data/config/locales/tr.yml +6 -0
  96. data/config/locales/uk.yml +6 -0
  97. data/config/locales/ur.yml +6 -0
  98. data/config/locales/uz.yml +6 -0
  99. data/config/locales/vi.yml +6 -0
  100. data/config/locales/zh-hk.yml +6 -0
  101. data/config/locales/zh-tw.yml +6 -0
  102. data/config/locales/zh.yml +6 -0
  103. data/lib/govuk_publishing_components/app_helpers/table_helper.rb +4 -2
  104. data/lib/govuk_publishing_components/version.rb +1 -1
  105. data/node_modules/govuk-frontend/govuk/components/_all.scss +1 -0
  106. data/node_modules/govuk-frontend/govuk/components/accordion/_index.scss +1 -0
  107. data/node_modules/govuk-frontend/govuk/components/character-count/fixtures.json +2 -1
  108. data/node_modules/govuk-frontend/govuk/components/checkboxes/fixtures.json +102 -44
  109. data/node_modules/govuk-frontend/govuk/components/checkboxes/macro-options.json +7 -1
  110. data/node_modules/govuk-frontend/govuk/components/checkboxes/template.njk +3 -2
  111. data/node_modules/govuk-frontend/govuk/components/cookie-banner/fixtures.json +10 -10
  112. data/node_modules/govuk-frontend/govuk/components/fieldset/fixtures.json +92 -1
  113. data/node_modules/govuk-frontend/govuk/components/file-upload/fixtures.json +2 -1
  114. data/node_modules/govuk-frontend/govuk/components/header/_index.scss +3 -0
  115. data/node_modules/govuk-frontend/govuk/components/header/fixtures.json +14 -6
  116. data/node_modules/govuk-frontend/govuk/components/header/template.njk +9 -3
  117. data/node_modules/govuk-frontend/govuk/components/input/fixtures.json +2 -1
  118. data/node_modules/govuk-frontend/govuk/components/input/macro-options.json +1 -1
  119. data/node_modules/govuk-frontend/govuk/components/label/fixtures.json +76 -1
  120. data/node_modules/govuk-frontend/govuk/components/pagination/README.md +15 -0
  121. data/node_modules/govuk-frontend/govuk/components/pagination/_index.scss +244 -0
  122. data/node_modules/govuk-frontend/govuk/components/pagination/_pagination.scss +2 -0
  123. data/node_modules/govuk-frontend/govuk/components/pagination/fixtures.json +300 -0
  124. data/node_modules/govuk-frontend/govuk/components/pagination/macro-options.json +128 -0
  125. data/node_modules/govuk-frontend/govuk/components/pagination/macro.njk +3 -0
  126. data/node_modules/govuk-frontend/govuk/components/pagination/template.njk +62 -0
  127. data/node_modules/govuk-frontend/govuk/components/radios/fixtures.json +147 -43
  128. data/node_modules/govuk-frontend/govuk/components/radios/macro-options.json +7 -1
  129. data/node_modules/govuk-frontend/govuk/components/radios/template.njk +3 -2
  130. data/node_modules/govuk-frontend/govuk/components/select/fixtures.json +56 -2
  131. data/node_modules/govuk-frontend/govuk/components/select/macro-options.json +7 -1
  132. data/node_modules/govuk-frontend/govuk/components/select/template.njk +1 -1
  133. data/node_modules/govuk-frontend/govuk/components/textarea/fixtures.json +2 -1
  134. data/node_modules/govuk-frontend/govuk-esm/all.mjs +12 -12
  135. data/node_modules/govuk-frontend/govuk-esm/components/accordion/accordion.mjs +3 -3
  136. data/node_modules/govuk-frontend/govuk-esm/components/button/button.mjs +2 -2
  137. data/node_modules/govuk-frontend/govuk-esm/components/character-count/character-count.mjs +3 -3
  138. data/node_modules/govuk-frontend/govuk-esm/components/checkboxes/checkboxes.mjs +4 -4
  139. data/node_modules/govuk-frontend/govuk-esm/components/details/details.mjs +3 -3
  140. data/node_modules/govuk-frontend/govuk-esm/components/error-summary/error-summary.mjs +3 -3
  141. data/node_modules/govuk-frontend/govuk-esm/components/header/header.mjs +3 -3
  142. data/node_modules/govuk-frontend/govuk-esm/components/notification-banner/notification-banner.mjs +1 -1
  143. data/node_modules/govuk-frontend/govuk-esm/components/radios/radios.mjs +4 -4
  144. data/node_modules/govuk-frontend/govuk-esm/components/skip-link/skip-link.mjs +3 -3
  145. data/node_modules/govuk-frontend/govuk-esm/components/tabs/tabs.mjs +6 -6
  146. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/{DOMTokenList.js → DOMTokenList.mjs} +0 -0
  147. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/{Document.js → Document.mjs} +0 -0
  148. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/{classList.js → classList.mjs} +4 -4
  149. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/{closest.js → closest.mjs} +1 -1
  150. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/{matches.js → matches.mjs} +0 -0
  151. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/{nextElementSibling.js → nextElementSibling.mjs} +2 -2
  152. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/{previousElementSibling.js → previousElementSibling.mjs} +2 -2
  153. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/{Element.js → Element.mjs} +1 -1
  154. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/{Event.js → Event.mjs} +3 -3
  155. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Function/prototype/{bind.js → bind.mjs} +1 -1
  156. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Object/{defineProperty.js → defineProperty.mjs} +0 -0
  157. data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/{Window.js → Window.mjs} +0 -0
  158. data/node_modules/govuk-frontend/package.json +8 -2
  159. metadata +26 -15
@@ -1,18 +1,18 @@
1
1
  <% if local_assigns.include?(:next_page) || local_assigns.include?(:previous_page) %>
2
- <nav
3
- class="gem-c-pagination"
4
- role="navigation"
5
- aria-label="<%= t("components.previous_and_next_navigation.pagination") %>"
6
- >
7
- <ul class="gem-c-pagination__list" data-module="gem-track-click">
2
+ <nav
3
+ class="govuk-pagination govuk-pagination--block"
4
+ role="navigation"
5
+ aria-label="<%= t("components.previous_and_next_navigation.pagination") %>"
6
+ >
8
7
  <% if local_assigns.include?(:previous_page) %>
9
8
  <%
10
- link_text_classes = %w[gem-c-pagination__link-text]
11
- link_text_classes << "gem-c-pagination__link-text--decorated" unless previous_page[:label].present?
9
+ title = previous_page[:title] || t("components.previous_and_next_navigation.previous")
10
+ link_text_classes = %w[govuk-pagination__link-title]
11
+ link_text_classes << "govuk-pagination__link-title--decorated" unless previous_page[:label].present?
12
12
  %>
13
- <li class="gem-c-pagination__item gem-c-pagination__item--previous">
14
- <a href="<%= previous_page[:url] %>"
15
- class="govuk-link gem-c-pagination__link"
13
+ <div class="govuk-pagination__prev">
14
+ <a class="govuk-link govuk-pagination__link"
15
+ href="<%= previous_page[:url] %>"
16
16
  rel="prev"
17
17
  data-track-category="contentsClicked"
18
18
  data-track-action="previous"
@@ -20,27 +20,27 @@
20
20
  data-track-dimension="previous"
21
21
  data-track-dimension-index="29"
22
22
  >
23
- <span class="gem-c-pagination__link-title">
24
- <svg class="gem-c-pagination__link-icon" xmlns="http://www.w3.org/2000/svg" height="13" width="17" viewBox="0 0 17 13">
25
- <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"/>
26
- </svg>
27
- <%= tag.span(previous_page[:title], class: link_text_classes) %>
28
- </span>
23
+ <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">
24
+ <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>
25
+ </svg>
26
+ <%= tag.span(title, class: link_text_classes) %>
29
27
  <% if previous_page[:label].present? %>
30
- <span class="gem-c-pagination__link-divider visually-hidden">:</span>
31
- <span class="gem-c-pagination__link-label"><%= previous_page[:label] %></span>
28
+ <span class="govuk-visually-hidden">:</span>
29
+ <span class="govuk-pagination__link-label"><%= previous_page[:label] %></span>
32
30
  <% end %>
33
31
  </a>
34
- </li>
32
+ </div>
35
33
  <% end %>
34
+
36
35
  <% if local_assigns.include?(:next_page) %>
37
36
  <%
38
- link_text_classes = %w[gem-c-pagination__link-text]
39
- link_text_classes << "gem-c-pagination__link-text--decorated" unless next_page[:label].present?
37
+ title = next_page[:title] || t("components.previous_and_next_navigation.next")
38
+ link_text_classes = %w[govuk-pagination__link-title]
39
+ link_text_classes << "govuk-pagination__link-title--decorated" unless next_page[:label].present?
40
40
  %>
41
- <li class="gem-c-pagination__item gem-c-pagination__item--next">
42
- <a href="<%= next_page[:url] %>"
43
- class="govuk-link gem-c-pagination__link"
41
+ <div class="govuk-pagination__next">
42
+ <a class="govuk-link govuk-pagination__link"
43
+ href="<%= next_page[:url] %>"
44
44
  rel="next"
45
45
  data-track-category="contentsClicked"
46
46
  data-track-action="next"
@@ -48,19 +48,16 @@
48
48
  data-track-dimension="next"
49
49
  data-track-dimension-index="29"
50
50
  >
51
- <span class="gem-c-pagination__link-title">
52
- <svg class="gem-c-pagination__link-icon" xmlns="http://www.w3.org/2000/svg" height="13" width="17" viewBox="0 0 17 13">
53
- <path d="m10.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"/>
54
- </svg>
55
- <%= tag.span(next_page[:title], class: link_text_classes) %>
56
- </span>
51
+ <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">
52
+ <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>
53
+ </svg>
54
+ <%= tag.span(title, class: link_text_classes) %>
57
55
  <% if next_page[:label].present? %>
58
- <span class="gem-c-pagination__link-divider visually-hidden">:</span>
59
- <span class="gem-c-pagination__link-label"><%= next_page[:label] %></span>
56
+ <span class="govuk-visually-hidden">:</span>
57
+ <span class="govuk-pagination__link-label"><%= next_page[:label] %></span>
60
58
  <% end %>
61
59
  </a>
62
- </li>
60
+ </div>
63
61
  <% end %>
64
- </ul>
65
- </nav>
62
+ </nav>
66
63
  <% end %>
@@ -2,46 +2,77 @@
2
2
  caption ||= nil
3
3
  head ||= []
4
4
  rows ||= []
5
- first_cell_is_header ||=false
5
+ first_cell_is_header ||= false
6
6
  caption_classes ||= nil
7
- sortable ||=false
7
+ sortable ||= false
8
+ filterable ||= false
9
+ label ||= t("components.table.filter_label")
10
+
11
+ table_id = "table-id-#{SecureRandom.hex(4)}"
12
+ filter_count_id = "filter-count-id-#{SecureRandom.hex(4)}"
8
13
  %>
9
14
 
10
- <%= GovukPublishingComponents::AppHelpers::TableHelper.helper(self, caption, {
11
- sortable: sortable,
12
- caption_classes: caption_classes
13
- }) do |t| %>
14
-
15
- <% if head.any? %>
16
- <%= t.head do %>
17
- <% head.each_with_index do |item, cellindex| %>
18
- <%= t.header item[:text], {
19
- format: item[:format],
20
- href: item[:href],
21
- data_attributes: item[:data_attributes],
22
- sort_direction: item[:sort_direction]
23
- } %>
15
+ <% @table = capture do %>
16
+ <%= GovukPublishingComponents::AppHelpers::TableHelper.helper(self, caption, {
17
+ sortable: sortable,
18
+ filterable: filterable,
19
+ caption_classes: caption_classes,
20
+ table_id: table_id
21
+ }) do |t| %>
22
+
23
+ <% if head.any? %>
24
+ <%= t.head do %>
25
+ <% head.each_with_index do |item, cellindex| %>
26
+ <%= t.header item[:text], {
27
+ format: item[:format],
28
+ href: item[:href],
29
+ data_attributes: item[:data_attributes],
30
+ sort_direction: item[:sort_direction]
31
+ } %>
32
+ <% end %>
24
33
  <% end %>
25
34
  <% end %>
26
- <% end %>
27
35
 
28
- <%= t.body do %>
29
- <% rows.each_with_index do |row, rowindex| %>
30
- <%= t.row do %>
31
- <% row.each_with_index do |cell, cellindex| %>
32
- <% if cellindex == 0 && first_cell_is_header %>
33
- <%= t.header cell[:text], {
34
- scope: "row",
35
- format: cell[:format]
36
- } %>
37
- <% else %>
38
- <%= t.cell cell[:text], {
39
- format: cell[:format]
40
- } %>
36
+ <%= t.body do %>
37
+ <% rows.each_with_index do |row, rowindex| %>
38
+ <%= t.row do %>
39
+ <% row.each_with_index do |cell, cellindex| %>
40
+ <% if cellindex == 0 && first_cell_is_header %>
41
+ <%= t.header cell[:text], {
42
+ scope: "row",
43
+ format: cell[:format]
44
+ } %>
45
+ <% else %>
46
+ <%= t.cell cell[:text], {
47
+ format: cell[:format]
48
+ } %>
49
+ <% end %>
41
50
  <% end %>
42
51
  <% end %>
43
52
  <% end %>
44
53
  <% end %>
45
54
  <% end %>
55
+ <% end %>
56
+
57
+ <% if filterable %>
58
+ <div data-module="table">
59
+ <div class="js-gem-c-table__filter govuk-!-display-none">
60
+ <%= render "govuk_publishing_components/components/input", {
61
+ label: {
62
+ text: label
63
+ },
64
+ name: "filter",
65
+ controls: table_id,
66
+ aria_described_by: filter_count_id,
67
+ } %>
68
+
69
+ <p id="<%= filter_count_id %>" aria-live="polite" class="js-filter-count govuk-visually-hidden" data-count-text="<%= t("components.table.filter_count") %>"></p>
70
+ </div>
71
+
72
+ <%= @table %>
46
73
 
74
+ <p class="govuk-body govuk-!-display-none js-gem-c-table__message"><%= t("components.table.filter_message") %></p>
75
+ </div>
76
+ <% else %>
77
+ <%= @table %>
47
78
  <% end %>
@@ -189,7 +189,7 @@ examples:
189
189
 
190
190
  Each item can also have a `data_attributes` hash. These `data_attributes` are placed on the `button` that triggers the opening and closing - useful for differentiating between each section of the accordion.
191
191
 
192
- Data attributes can also be added to the 'Show/hide all' link using the `data_attributes_show_all` option, primarily where custom tracking is required. These attributes are read from the accordion markup and then added to the link by JavaScript (which is how the link is created).
192
+ Data attributes can also be added to the 'Show/hide all' link using the `data_attributes_show_all` option, primarily where custom tracking is required. These attributes are read from the accordion markup and then added to the link by JavaScript (which is how the link is created). If `track_options` within `data_attributes_show_all` is set, then it is possible to pass a custom dimension when 'Show/Hide all' is clicked.
193
193
  data:
194
194
  data_attributes:
195
195
  gtm: gtm-accordion
@@ -197,6 +197,7 @@ examples:
197
197
  data_attributes_show_all:
198
198
  gtm-event-name: example
199
199
  gtm-attributes: "{ 'ui': { 'type': 'type value', 'section': 'section value' } }"
200
+ tracking-options: "{ 'dimension114': 1 }"
200
201
  items:
201
202
  - heading:
202
203
  text: Writing well for the web
@@ -78,6 +78,14 @@ examples:
78
78
  light_text: true
79
79
  context:
80
80
  dark_background: true
81
+ white_arrow:
82
+ data:
83
+ text: Find out how to stay safe and help prevent the spread
84
+ href: "/something"
85
+ white_arrow: true
86
+ light_text: true
87
+ context:
88
+ dark_background: true
81
89
  blue_arrow:
82
90
  data:
83
91
  text: Find out how to stay safe and help prevent the spread
@@ -18,4 +18,4 @@ examples:
18
18
  data:
19
19
  href: '#'
20
20
  data_attributes:
21
- tracking: GT-1234
21
+ an_attribute: the value
@@ -36,8 +36,8 @@ examples:
36
36
  with_data_attributes:
37
37
  description: |
38
38
  If a `href` attribute is present, `data_attributes` will apply to the `span` containing the number value (see below).
39
-
40
- This will also not automatically apply a `gem-track-click` module attribute if the data attributes pertain to click tracking. Remember to apply this outside the component call in a surrounding element, if using.
39
+
40
+ Note that the component does not include built in tracking. If this is required consider using the [track click script](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics/track-click.md).
41
41
  data:
42
42
  number: 23
43
43
  label: Ministerial departments
@@ -2,9 +2,9 @@ name: "Breadcrumbs"
2
2
  description: "Navigational breadcrumbs, showing page hierarchy"
3
3
  body: |
4
4
  Accepts an array of breadcrumb objects. Each crumb must have a title and a URL.
5
- Links have tracking data but links to the homepage (any link with a url of `/`) will be tracked separately as `homeLinkClicked`
5
+ Links have tracking data but links to the homepage (any link with a url of `/`) will be tracked separately as `homeLinkClicked`.
6
6
 
7
- We recommend that if using the breadcrumbs for navigation purposes, you set `collapse_on_mobile` to `true` to make things more readable for mobile users. However, you can specify `collapse_on_mobile:``false` or remove the flag completely to stop this behaviour.
7
+ We recommend that if using the breadcrumbs for navigation purposes, you set `collapse_on_mobile` to `true` to make things more readable for mobile users. However, you can specify `collapse_on_mobile:``false` or remove the flag completely to stop this behaviour.
8
8
  shared_accessibility_criteria:
9
9
  - link
10
10
  accessibility_criteria:
@@ -23,92 +23,93 @@ govuk_frontend_components:
23
23
  examples:
24
24
  default:
25
25
  data:
26
- text: "Submit"
26
+ text: Submit
27
27
  link_button:
28
28
  data:
29
- text: "I'm really a link sssh"
30
- href: "#"
29
+ text: I'm really a link sssh
30
+ href: '#'
31
31
  link_button_target_blank:
32
32
  data:
33
- text: "I'm really a link sssh"
34
- href: "http://www.gov.uk"
35
- target: "_blank"
33
+ text: I'm really a link sssh
34
+ href: http://www.gov.uk
35
+ target: _blank
36
36
  with_type:
37
37
  description: Buttons default to having a type of submit, but in some cases it may be desirable to have a different type.
38
38
  data:
39
- text: "Button type button"
40
- type: "button"
39
+ text: Button type button
40
+ type: button
41
41
  start_now_button:
42
42
  data:
43
- text: "Start now"
44
- href: "#"
43
+ text: Start now
44
+ href: '#'
45
45
  start: true
46
- rel: "external"
46
+ rel: external
47
47
  secondary_button:
48
48
  data:
49
- text: "Secondary button"
49
+ text: Secondary button
50
50
  secondary: true
51
51
  secondary_quiet_button:
52
52
  data:
53
- text: "Secondary quiet button"
53
+ text: Secondary quiet button
54
54
  secondary_quiet: true
55
55
  secondary_solid_button:
56
56
  data:
57
- text: "Secondary solid button"
57
+ text: Secondary solid button
58
58
  secondary_solid: true
59
59
  destructive_button:
60
60
  data:
61
- text: "Destructive button"
61
+ text: Destructive button
62
62
  destructive: true
63
63
  start_now_button_with_info_text:
64
64
  data:
65
- text: "Start now"
66
- href: "#"
65
+ text: Start now
66
+ href: '#'
67
67
  start: true
68
- info_text: "Sometimes you want to explain where a user is going to."
68
+ info_text: Sometimes you want to explain where a user is going to.
69
69
  with_margin_bottom:
70
70
  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.
71
71
  data:
72
- text: "Submit"
72
+ text: Submit
73
73
  margin_bottom: 6
74
74
  start_now_button_with_info_text_and_margin_bottom:
75
75
  description: When the component requires margin bottom and has info text, the margin is applied to the info text.
76
76
  data:
77
- text: "Start now"
78
- href: "#"
77
+ text: Start now
78
+ href: '#'
79
79
  start: true
80
- info_text: "Sometimes you want to explain where a user is going to and have a margin bottom"
80
+ info_text: Sometimes you want to explain where a user is going to and have a margin bottom
81
81
  margin_bottom: 6
82
82
  extreme_text:
83
83
  data:
84
- text: "I'm a button with lots of text to test how the component scales at extremes."
85
- href: "#"
84
+ text: I'm a button with lots of text to test how the component scales at extremes.
85
+ href: '#'
86
86
  extreme_text_start_now_button:
87
87
  data:
88
- text: "I'm a start now button with lots of text to test how the component scales at extremes."
88
+ text: I'm a start now button with lots of text to test how the component scales at extremes.
89
89
  start: true
90
- href: "#"
90
+ href: '#'
91
91
  with_data_attributes:
92
+ description: Data attributes can be applied as required. Note that the component does not include built in tracking. If this is required consider using the [track click script](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics/track-click.md).
92
93
  data:
93
- text: "Track this!"
94
+ text: Track this!
94
95
  margin_bottom: true
95
96
  data_attributes: {
96
- "module": "cross-domain-tracking",
97
- "tracking-code": "GA-123ABC",
98
- "tracking-name": "transactionTracker"
97
+ module: cross-domain-tracking,
98
+ tracking-code: GA-123ABC,
99
+ tracking-name: transactionTracker
99
100
  }
100
101
  with_title_attribute:
101
102
  data:
102
- text: "Click me"
103
+ text: Click me
103
104
  margin_bottom: true
104
- title: "A button to click"
105
+ title: A button to click
105
106
  inline_layout:
106
107
  description: Buttons will display adjacent to each other until mobile view, when they will appear on top of each other.
107
108
  embed: |
108
109
  <button class="gem-c-button govuk-button gem-c-button--inline">First button</button>
109
110
  <%= component %>
110
111
  data:
111
- text: "Second button"
112
+ text: Second button
112
113
  inline_layout: true
113
114
  with_name_and_value_set:
114
115
  description: |
@@ -116,15 +117,15 @@ examples:
116
117
 
117
118
  Please note that Internet Explorer 6 and 7 have **breaking bugs** when submitting a form with multiple buttons - this can [change what value is submitted by the button](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Notes). Make sure to check your user needs and browser usage.
118
119
  data:
119
- text: "This is the button text"
120
- value: "this_is_the_value"
121
- name: "this_is_the_name"
120
+ text: This is the button text
121
+ value: this_is_the_value
122
+ name: this_is_the_name
122
123
  with_js_classes:
123
124
  description: Use `js-` prefixed classes only as interaction hooks – to query and operate on elements via JavaScript
124
125
  data:
125
- text: "Button"
126
- classes: "js-selector-1 js-selector-2"
126
+ text: Button
127
+ classes: js-selector-1 js-selector-2
127
128
  with_aria_label:
128
129
  data:
129
- text: "Button"
130
- aria_label: "Button with custom label"
130
+ text: Button
131
+ aria_label: Button with custom label
@@ -119,6 +119,8 @@ examples:
119
119
  with_data_attributes:
120
120
  description: |
121
121
  Data attributes can be passed to individual links within the component as shown.
122
+
123
+ Note that the component does not include built in tracking. If this is required consider using the [track click script](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics/track-click.md).
122
124
  data:
123
125
  items:
124
126
  - link: