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.
- checksums.yaml +4 -4
- data/app/assets/images/govuk_publishing_components/action-link-arrow--white.png +0 -0
- data/app/assets/images/govuk_publishing_components/action-link-arrow--white.svg +1 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/gtm-page-views.js +5 -3
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/pii-remover.js +135 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4.js +2 -0
- data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +27 -22
- data/app/assets/javascripts/govuk_publishing_components/components/table.js +52 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +7 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_previous-and-next-navigation.scss +1 -92
- data/app/models/govuk_publishing_components/audit_applications.rb +31 -9
- data/app/models/govuk_publishing_components/audit_comparer.rb +15 -9
- data/app/views/govuk_publishing_components/audit/_components.html.erb +20 -2
- data/app/views/govuk_publishing_components/components/_action_link.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb +33 -36
- data/app/views/govuk_publishing_components/components/_table.html.erb +61 -30
- data/app/views/govuk_publishing_components/components/docs/accordion.yml +2 -1
- data/app/views/govuk_publishing_components/components/docs/action_link.yml +8 -0
- data/app/views/govuk_publishing_components/components/docs/back_link.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/big_number.yml +2 -2
- data/app/views/govuk_publishing_components/components/docs/breadcrumbs.yml +2 -2
- data/app/views/govuk_publishing_components/components/docs/button.yml +41 -40
- data/app/views/govuk_publishing_components/components/docs/cards.yml +2 -0
- data/app/views/govuk_publishing_components/components/docs/checkboxes.yml +216 -216
- data/app/views/govuk_publishing_components/components/docs/cookie_banner.yml +2 -1
- data/app/views/govuk_publishing_components/components/docs/copy_to_clipboard.yml +2 -2
- data/app/views/govuk_publishing_components/components/docs/details.yml +5 -1
- data/app/views/govuk_publishing_components/components/docs/document_list.yml +1 -2
- data/app/views/govuk_publishing_components/components/docs/error_alert.yml +4 -0
- data/app/views/govuk_publishing_components/components/docs/error_summary.yml +4 -6
- data/app/views/govuk_publishing_components/components/docs/image_card.yml +2 -1
- data/app/views/govuk_publishing_components/components/docs/intervention.yml +25 -25
- data/app/views/govuk_publishing_components/components/docs/organisation_logo.yml +1 -2
- data/app/views/govuk_publishing_components/components/docs/previous_and_next_navigation.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/print_link.yml +5 -1
- data/app/views/govuk_publishing_components/components/docs/select.yml +101 -98
- data/app/views/govuk_publishing_components/components/docs/table.yml +36 -1
- data/app/views/govuk_publishing_components/components/docs/tabs.yml +4 -0
- data/config/locales/ar.yml +6 -0
- data/config/locales/az.yml +6 -0
- data/config/locales/be.yml +6 -0
- data/config/locales/bg.yml +6 -0
- data/config/locales/bn.yml +6 -0
- data/config/locales/cs.yml +6 -0
- data/config/locales/cy.yml +6 -0
- data/config/locales/da.yml +6 -0
- data/config/locales/de.yml +6 -0
- data/config/locales/dr.yml +6 -0
- data/config/locales/el.yml +6 -0
- data/config/locales/en.yml +6 -0
- data/config/locales/es-419.yml +6 -0
- data/config/locales/es.yml +6 -0
- data/config/locales/et.yml +6 -0
- data/config/locales/fa.yml +6 -0
- data/config/locales/fi.yml +6 -0
- data/config/locales/fr.yml +6 -0
- data/config/locales/gd.yml +6 -0
- data/config/locales/gu.yml +6 -0
- data/config/locales/he.yml +6 -0
- data/config/locales/hi.yml +6 -0
- data/config/locales/hr.yml +6 -0
- data/config/locales/hu.yml +6 -0
- data/config/locales/hy.yml +6 -0
- data/config/locales/id.yml +6 -0
- data/config/locales/is.yml +6 -0
- data/config/locales/it.yml +6 -0
- data/config/locales/ja.yml +6 -0
- data/config/locales/ka.yml +6 -0
- data/config/locales/kk.yml +6 -0
- data/config/locales/ko.yml +6 -0
- data/config/locales/lt.yml +6 -0
- data/config/locales/lv.yml +6 -0
- data/config/locales/ms.yml +6 -0
- data/config/locales/mt.yml +6 -0
- data/config/locales/nl.yml +6 -0
- data/config/locales/no.yml +6 -0
- data/config/locales/pa-pk.yml +6 -0
- data/config/locales/pa.yml +6 -0
- data/config/locales/pl.yml +6 -0
- data/config/locales/ps.yml +6 -0
- data/config/locales/pt.yml +6 -0
- data/config/locales/ro.yml +6 -0
- data/config/locales/ru.yml +6 -0
- data/config/locales/si.yml +6 -0
- data/config/locales/sk.yml +6 -0
- data/config/locales/sl.yml +6 -0
- data/config/locales/so.yml +6 -0
- data/config/locales/sq.yml +6 -0
- data/config/locales/sr.yml +6 -0
- data/config/locales/sv.yml +6 -0
- data/config/locales/sw.yml +6 -0
- data/config/locales/ta.yml +6 -0
- data/config/locales/th.yml +6 -0
- data/config/locales/tk.yml +6 -0
- data/config/locales/tr.yml +6 -0
- data/config/locales/uk.yml +6 -0
- data/config/locales/ur.yml +6 -0
- data/config/locales/uz.yml +6 -0
- data/config/locales/vi.yml +6 -0
- data/config/locales/zh-hk.yml +6 -0
- data/config/locales/zh-tw.yml +6 -0
- data/config/locales/zh.yml +6 -0
- data/lib/govuk_publishing_components/app_helpers/table_helper.rb +4 -2
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/govuk-frontend/govuk/components/_all.scss +1 -0
- data/node_modules/govuk-frontend/govuk/components/accordion/_index.scss +1 -0
- data/node_modules/govuk-frontend/govuk/components/character-count/fixtures.json +2 -1
- data/node_modules/govuk-frontend/govuk/components/checkboxes/fixtures.json +102 -44
- data/node_modules/govuk-frontend/govuk/components/checkboxes/macro-options.json +7 -1
- data/node_modules/govuk-frontend/govuk/components/checkboxes/template.njk +3 -2
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/fixtures.json +10 -10
- data/node_modules/govuk-frontend/govuk/components/fieldset/fixtures.json +92 -1
- data/node_modules/govuk-frontend/govuk/components/file-upload/fixtures.json +2 -1
- data/node_modules/govuk-frontend/govuk/components/header/_index.scss +3 -0
- data/node_modules/govuk-frontend/govuk/components/header/fixtures.json +14 -6
- data/node_modules/govuk-frontend/govuk/components/header/template.njk +9 -3
- data/node_modules/govuk-frontend/govuk/components/input/fixtures.json +2 -1
- data/node_modules/govuk-frontend/govuk/components/input/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/label/fixtures.json +76 -1
- data/node_modules/govuk-frontend/govuk/components/pagination/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/pagination/_index.scss +244 -0
- data/node_modules/govuk-frontend/govuk/components/pagination/_pagination.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/pagination/fixtures.json +300 -0
- data/node_modules/govuk-frontend/govuk/components/pagination/macro-options.json +128 -0
- data/node_modules/govuk-frontend/govuk/components/pagination/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/pagination/template.njk +62 -0
- data/node_modules/govuk-frontend/govuk/components/radios/fixtures.json +147 -43
- data/node_modules/govuk-frontend/govuk/components/radios/macro-options.json +7 -1
- data/node_modules/govuk-frontend/govuk/components/radios/template.njk +3 -2
- data/node_modules/govuk-frontend/govuk/components/select/fixtures.json +56 -2
- data/node_modules/govuk-frontend/govuk/components/select/macro-options.json +7 -1
- data/node_modules/govuk-frontend/govuk/components/select/template.njk +1 -1
- data/node_modules/govuk-frontend/govuk/components/textarea/fixtures.json +2 -1
- data/node_modules/govuk-frontend/govuk-esm/all.mjs +12 -12
- data/node_modules/govuk-frontend/govuk-esm/components/accordion/accordion.mjs +3 -3
- data/node_modules/govuk-frontend/govuk-esm/components/button/button.mjs +2 -2
- data/node_modules/govuk-frontend/govuk-esm/components/character-count/character-count.mjs +3 -3
- data/node_modules/govuk-frontend/govuk-esm/components/checkboxes/checkboxes.mjs +4 -4
- data/node_modules/govuk-frontend/govuk-esm/components/details/details.mjs +3 -3
- data/node_modules/govuk-frontend/govuk-esm/components/error-summary/error-summary.mjs +3 -3
- data/node_modules/govuk-frontend/govuk-esm/components/header/header.mjs +3 -3
- data/node_modules/govuk-frontend/govuk-esm/components/notification-banner/notification-banner.mjs +1 -1
- data/node_modules/govuk-frontend/govuk-esm/components/radios/radios.mjs +4 -4
- data/node_modules/govuk-frontend/govuk-esm/components/skip-link/skip-link.mjs +3 -3
- data/node_modules/govuk-frontend/govuk-esm/components/tabs/tabs.mjs +6 -6
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/{DOMTokenList.js → DOMTokenList.mjs} +0 -0
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/{Document.js → Document.mjs} +0 -0
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/{classList.js → classList.mjs} +4 -4
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/{closest.js → closest.mjs} +1 -1
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/{matches.js → matches.mjs} +0 -0
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/{nextElementSibling.js → nextElementSibling.mjs} +2 -2
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/{previousElementSibling.js → previousElementSibling.mjs} +2 -2
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/{Element.js → Element.mjs} +1 -1
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/{Event.js → Event.mjs} +3 -3
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Function/prototype/{bind.js → bind.mjs} +1 -1
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Object/{defineProperty.js → defineProperty.mjs} +0 -0
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/{Window.js → Window.mjs} +0 -0
- data/node_modules/govuk-frontend/package.json +8 -2
- metadata +26 -15
data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
<% if local_assigns.include?(:next_page) || local_assigns.include?(:previous_page) %>
|
2
|
-
<nav
|
3
|
-
|
4
|
-
|
5
|
-
|
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
|
-
|
11
|
-
link_text_classes
|
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
|
-
<
|
14
|
-
<a
|
15
|
-
|
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
|
-
<
|
24
|
-
<
|
25
|
-
|
26
|
-
|
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="
|
31
|
-
<span class="
|
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
|
-
</
|
32
|
+
</div>
|
35
33
|
<% end %>
|
34
|
+
|
36
35
|
<% if local_assigns.include?(:next_page) %>
|
37
36
|
<%
|
38
|
-
|
39
|
-
link_text_classes
|
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
|
-
<
|
42
|
-
<a
|
43
|
-
|
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
|
-
<
|
52
|
-
<
|
53
|
-
|
54
|
-
|
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="
|
59
|
-
<span class="
|
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
|
-
</
|
60
|
+
</div>
|
63
61
|
<% end %>
|
64
|
-
</
|
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
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
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
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
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
|
@@ -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
|
-
|
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
|
-
|
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:
|
26
|
+
text: Submit
|
27
27
|
link_button:
|
28
28
|
data:
|
29
|
-
text:
|
30
|
-
href:
|
29
|
+
text: I'm really a link sssh
|
30
|
+
href: '#'
|
31
31
|
link_button_target_blank:
|
32
32
|
data:
|
33
|
-
text:
|
34
|
-
href:
|
35
|
-
target:
|
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:
|
40
|
-
type:
|
39
|
+
text: Button type button
|
40
|
+
type: button
|
41
41
|
start_now_button:
|
42
42
|
data:
|
43
|
-
text:
|
44
|
-
href:
|
43
|
+
text: Start now
|
44
|
+
href: '#'
|
45
45
|
start: true
|
46
|
-
rel:
|
46
|
+
rel: external
|
47
47
|
secondary_button:
|
48
48
|
data:
|
49
|
-
text:
|
49
|
+
text: Secondary button
|
50
50
|
secondary: true
|
51
51
|
secondary_quiet_button:
|
52
52
|
data:
|
53
|
-
text:
|
53
|
+
text: Secondary quiet button
|
54
54
|
secondary_quiet: true
|
55
55
|
secondary_solid_button:
|
56
56
|
data:
|
57
|
-
text:
|
57
|
+
text: Secondary solid button
|
58
58
|
secondary_solid: true
|
59
59
|
destructive_button:
|
60
60
|
data:
|
61
|
-
text:
|
61
|
+
text: Destructive button
|
62
62
|
destructive: true
|
63
63
|
start_now_button_with_info_text:
|
64
64
|
data:
|
65
|
-
text:
|
66
|
-
href:
|
65
|
+
text: Start now
|
66
|
+
href: '#'
|
67
67
|
start: true
|
68
|
-
info_text:
|
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:
|
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:
|
78
|
-
href:
|
77
|
+
text: Start now
|
78
|
+
href: '#'
|
79
79
|
start: true
|
80
|
-
info_text:
|
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:
|
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:
|
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:
|
94
|
+
text: Track this!
|
94
95
|
margin_bottom: true
|
95
96
|
data_attributes: {
|
96
|
-
|
97
|
-
|
98
|
-
|
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:
|
103
|
+
text: Click me
|
103
104
|
margin_bottom: true
|
104
|
-
title:
|
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:
|
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:
|
120
|
-
value:
|
121
|
-
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:
|
126
|
-
classes:
|
126
|
+
text: Button
|
127
|
+
classes: js-selector-1 js-selector-2
|
127
128
|
with_aria_label:
|
128
129
|
data:
|
129
|
-
text:
|
130
|
-
aria_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:
|