govuk_publishing_components 24.18.3 → 24.20.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/analytics/custom-dimensions.js +2 -1
- data/app/assets/javascripts/govuk_publishing_components/analytics/scroll-tracker.js +14 -0
- data/app/assets/javascripts/govuk_publishing_components/components/details.js +6 -4
- data/app/assets/javascripts/govuk_publishing_components/components/layout-super-navigation-header.js +71 -0
- data/app/assets/javascripts/govuk_publishing_components/lib/trigger-event.js +13 -2
- data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/_all_components_print.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +5 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_intervention.scss +16 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +0 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +125 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_typography.scss +9 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_layout-super-navigation-header.scss +3 -0
- data/app/views/govuk_publishing_components/component_guide/index.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_contextual_breadcrumbs.html.erb +5 -5
- data/app/views/govuk_publishing_components/components/_details.html.erb +7 -4
- data/app/views/govuk_publishing_components/components/_govspeak.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_intervention.html.erb +15 -0
- data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +17 -12
- data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +121 -0
- data/app/views/govuk_publishing_components/components/docs/checkboxes.yml +22 -22
- data/app/views/govuk_publishing_components/components/docs/details.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/govspeak.yml +9 -0
- data/app/views/govuk_publishing_components/components/docs/intervention.yml +24 -0
- data/app/views/govuk_publishing_components/components/docs/layout_header.yml +4 -1
- data/app/views/govuk_publishing_components/components/docs/layout_super_navigation_header.yml +22 -0
- data/app/views/govuk_publishing_components/components/layout_header/_header_logo.html.erb +3 -4
- data/config/locales/ar.yml +8 -0
- data/config/locales/az.yml +8 -0
- data/config/locales/be.yml +8 -0
- data/config/locales/bg.yml +8 -0
- data/config/locales/bn.yml +8 -0
- data/config/locales/cs.yml +8 -0
- data/config/locales/cy.yml +14 -6
- data/config/locales/da.yml +8 -0
- data/config/locales/de.yml +8 -0
- data/config/locales/dr.yml +8 -0
- data/config/locales/el.yml +8 -0
- data/config/locales/en.yml +89 -0
- data/config/locales/es-419.yml +8 -0
- data/config/locales/es.yml +8 -0
- data/config/locales/et.yml +8 -0
- data/config/locales/fa.yml +8 -0
- data/config/locales/fi.yml +8 -0
- data/config/locales/fr.yml +8 -0
- data/config/locales/gd.yml +8 -0
- data/config/locales/gu.yml +8 -0
- data/config/locales/he.yml +8 -0
- data/config/locales/hi.yml +8 -0
- data/config/locales/hr.yml +8 -0
- data/config/locales/hu.yml +8 -0
- data/config/locales/hy.yml +8 -0
- data/config/locales/id.yml +8 -0
- data/config/locales/is.yml +8 -0
- data/config/locales/it.yml +8 -0
- data/config/locales/ja.yml +8 -0
- data/config/locales/ka.yml +8 -0
- data/config/locales/kk.yml +8 -0
- data/config/locales/ko.yml +8 -0
- data/config/locales/lt.yml +8 -0
- data/config/locales/lv.yml +8 -0
- data/config/locales/ms.yml +8 -0
- data/config/locales/mt.yml +8 -0
- data/config/locales/nl.yml +8 -0
- data/config/locales/no.yml +8 -0
- data/config/locales/pa-pk.yml +8 -0
- data/config/locales/pa.yml +8 -0
- data/config/locales/pl.yml +8 -0
- data/config/locales/ps.yml +8 -0
- data/config/locales/pt.yml +8 -0
- data/config/locales/ro.yml +8 -0
- data/config/locales/ru.yml +8 -0
- data/config/locales/si.yml +8 -0
- data/config/locales/sk.yml +8 -0
- data/config/locales/sl.yml +8 -0
- data/config/locales/so.yml +8 -0
- data/config/locales/sq.yml +8 -0
- data/config/locales/sr.yml +8 -0
- data/config/locales/sv.yml +8 -0
- data/config/locales/sw.yml +8 -0
- data/config/locales/ta.yml +8 -0
- data/config/locales/th.yml +8 -0
- data/config/locales/tk.yml +8 -0
- data/config/locales/tr.yml +8 -0
- data/config/locales/uk.yml +8 -0
- data/config/locales/ur.yml +8 -0
- data/config/locales/uz.yml +8 -0
- data/config/locales/vi.yml +8 -0
- data/config/locales/zh-hk.yml +8 -0
- data/config/locales/zh-tw.yml +8 -0
- data/config/locales/zh.yml +8 -0
- data/lib/govuk_publishing_components/app_helpers/environment.rb +3 -8
- data/lib/govuk_publishing_components/presenters/meta_tags.rb +11 -4
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +10 -2
@@ -1,10 +1,12 @@
|
|
1
1
|
<%
|
2
|
+
inverse ||= false
|
2
3
|
direction_class = "direction-#{direction}" if local_assigns.include?(:direction)
|
3
4
|
disable_youtube_expansions = local_assigns.fetch(:disable_youtube_expansions) if local_assigns.include?(:disable_youtube_expansions)
|
4
5
|
|
5
6
|
classes = []
|
6
7
|
classes << direction_class if direction_class
|
7
8
|
classes << "disable-youtube" if disable_youtube_expansions
|
9
|
+
classes << "gem-c-govspeak--inverse" if inverse
|
8
10
|
%>
|
9
11
|
|
10
12
|
<div class="gem-c-govspeak govuk-govspeak <%= classes.join(" ") %>" data-module="govspeak">
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<%= tag.section class: "gem-c-intervention", role: "region" do %>
|
2
|
+
<h2 class="gem-c-intervention__title">
|
3
|
+
<a class="govuk-link" href="/next-steps-for-your-business">
|
4
|
+
<%= t("components.intervention.title") %>
|
5
|
+
</a>
|
6
|
+
</h2>
|
7
|
+
|
8
|
+
<p class="gem-c-intervention__paragraph">
|
9
|
+
<%= t("components.intervention.description") %>
|
10
|
+
</p>
|
11
|
+
|
12
|
+
<p class="gem-c-intervention__paragraph">
|
13
|
+
<%= t("components.intervention.dismiss_html") %>
|
14
|
+
</p>
|
15
|
+
<% end %>
|
@@ -1,14 +1,15 @@
|
|
1
1
|
<%
|
2
|
-
omit_feedback_form ||= false
|
3
2
|
emergency_banner ||= nil
|
4
3
|
full_width ||= false
|
5
4
|
global_bar ||= nil
|
6
|
-
product_name ||= nil
|
7
5
|
html_lang ||= "en"
|
8
6
|
layout_helper = GovukPublishingComponents::Presenters::PublicLayoutHelper.new(local_assigns)
|
9
7
|
logo_link ||= "/"
|
10
8
|
navigation_items ||= []
|
9
|
+
omit_feedback_form ||= false
|
11
10
|
omit_header ||= false
|
11
|
+
product_name ||= nil
|
12
|
+
show_explore_header ||= false
|
12
13
|
show_search = local_assigns.include?(:show_search) ? local_assigns[:show_search] : true
|
13
14
|
title ||= "GOV.UK - The best place to find government services and information"
|
14
15
|
|
@@ -75,16 +76,20 @@
|
|
75
76
|
<%= render "govuk_publishing_components/components/cookie_banner" %>
|
76
77
|
|
77
78
|
<% unless omit_header %>
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
79
|
+
<% if show_explore_header %>
|
80
|
+
<%= render "govuk_publishing_components/components/layout_super_navigation_header" %>
|
81
|
+
<% else %>
|
82
|
+
<%= render "govuk_publishing_components/components/layout_header", {
|
83
|
+
search: show_search,
|
84
|
+
logo_link: logo_link,
|
85
|
+
navigation_items: navigation_items,
|
86
|
+
product_name: product_name,
|
87
|
+
|
88
|
+
# The (blue) bottom border needs to be underneath the emergency banner -
|
89
|
+
# so it has been turned off and added in manually.
|
90
|
+
remove_bottom_border: true,
|
91
|
+
} %>
|
92
|
+
<% end %>
|
88
93
|
<% end %>
|
89
94
|
|
90
95
|
<%= raw(emergency_banner) %>
|
data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb
ADDED
@@ -0,0 +1,121 @@
|
|
1
|
+
<%
|
2
|
+
logo_link = "https://www.gov.uk/"
|
3
|
+
logo_link_title = t("components.layout_super_navigation_header.logo_link_title")
|
4
|
+
logo_text = t("components.layout_super_navigation_header.logo_text")
|
5
|
+
navigation_links = t("components.layout_super_navigation_header.navigation_links")
|
6
|
+
navigation_menu_heading = t("components.layout_super_navigation_header.navigation_menu_heading")
|
7
|
+
popular_links = t("components.layout_super_navigation_header.popular_links")
|
8
|
+
popular_links_heading = t("components.layout_super_navigation_header.popular_links_heading")
|
9
|
+
search_text= t("components.layout_super_navigation_header.search_text")
|
10
|
+
%>
|
11
|
+
<header role="banner" class="gem-c-layout-super-navigation-header">
|
12
|
+
<div class="gem-c-layout-super-navigation-header__container govuk-width-container govuk-clearfix">
|
13
|
+
<div class="gem-c-layout-super-navigation-header__header-logo">
|
14
|
+
<a class="govuk-header__link govuk-header__link--homepage"
|
15
|
+
data-module="gem-track-click"
|
16
|
+
data-track-action="homeHeader"
|
17
|
+
data-track-category="homeLinkClicked"
|
18
|
+
href="<%= logo_link %>"
|
19
|
+
id="logo"
|
20
|
+
title="<%= logo_link_title %>">
|
21
|
+
<span class="govuk-header__logotype">
|
22
|
+
<svg aria-hidden="true"
|
23
|
+
class="govuk-header__logotype-crown gem-c-layout-super-navigation-header__logotype-crown"
|
24
|
+
focusable="false"
|
25
|
+
height="30"
|
26
|
+
viewBox="0 0 132 97"
|
27
|
+
xmlns="http://www.w3.org/2000/svg"
|
28
|
+
width="36">
|
29
|
+
<path fill="currentColor"
|
30
|
+
fill-rule="evenodd"
|
31
|
+
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">
|
32
|
+
</path>
|
33
|
+
<image class="govuk-header__logotype-crown-fallback-image"
|
34
|
+
height="30"
|
35
|
+
src="<%= asset_path('govuk-logotype-crown.png') %>"
|
36
|
+
width="36"
|
37
|
+
xlink:href="">
|
38
|
+
</image>
|
39
|
+
</svg>
|
40
|
+
<span class="govuk-header__logotype-text">
|
41
|
+
<%= logo_text %>
|
42
|
+
</span>
|
43
|
+
</span>
|
44
|
+
</a>
|
45
|
+
</div>
|
46
|
+
<nav
|
47
|
+
aria-labelledby="super-navigation-menu-heading"
|
48
|
+
class="gem-c-layout-super-navigation-header__content"
|
49
|
+
data-module="super-navigation-toggle"
|
50
|
+
data-text-for-button="Menu"
|
51
|
+
data-text-for-show-menu="Show navigation menu"
|
52
|
+
data-text-for-hide-menu="Hide navigation menu"
|
53
|
+
>
|
54
|
+
<h2 id="super-navigation-menu-heading" class="govuk-visually-hidden"><%= navigation_menu_heading %></h2>
|
55
|
+
<ul id="super-navigation-menu" class="gem-c-layout-super-navigation-header__items">
|
56
|
+
<% navigation_links.each do | link | %>
|
57
|
+
<li class="govuk-header__navigation-item gem-c-layout-super-navigation-header__item">
|
58
|
+
<a class="govuk-header__link gem-c-layout-super-navigation-header__item-link" href="<%= link[:href] %>">
|
59
|
+
<%= link[:label] %>
|
60
|
+
</a>
|
61
|
+
<% if link[:menu_contents].present? or link[:footer_links].present? %>
|
62
|
+
<div class="gem-c-layout-super-navigation-header__dropdown-menu">
|
63
|
+
<% if link[:menu_contents].present? %>
|
64
|
+
<ul class="govuk-list">
|
65
|
+
<% link[:menu_contents].each do | item | %>
|
66
|
+
<li class="gem-c-layout-super-navigation-header__dropdown-list-item">
|
67
|
+
<a class="govuk-link gem-c-layout-super-navigation-header__dropdown-list-item-link" href="<%= item[:href] %>">
|
68
|
+
<%= item[:label] %>
|
69
|
+
</a>
|
70
|
+
<%= tag.p item[:description], class: "govuk-body-s gem-c-layout-super-navigation-header__dropdown-list-item-description" if item[:description].present? %>
|
71
|
+
</li>
|
72
|
+
<% end %>
|
73
|
+
</ul>
|
74
|
+
<% end %>
|
75
|
+
<% if link[:footer_links].present? %>
|
76
|
+
<ul class="govuk-list">
|
77
|
+
<% link[:footer_links].each do | item | %>
|
78
|
+
<li class="gem-c-layout-super-navigation-header__dropdown-list-item">
|
79
|
+
<a class="govuk-link gem-c-layout-super-navigation-header__dropdown-list-item-link" href="<%= item[:href] %>">
|
80
|
+
<%= item[:label] %>
|
81
|
+
</a>
|
82
|
+
</li>
|
83
|
+
<% end %>
|
84
|
+
</ul>
|
85
|
+
<% end %>
|
86
|
+
</div>
|
87
|
+
<% end %>
|
88
|
+
</li>
|
89
|
+
<% end %>
|
90
|
+
<li class="govuk-header__navigation-item gem-c-layout-super-navigation-header__item gem-c-layout-super-navigation-header__item--search">
|
91
|
+
<a class="govuk-header__link gem-c-layout-super-navigation-header__item-link gem-c-layout-super-navigation-header__item-link--search" href="/search">
|
92
|
+
<span class="gem-c-layout-super-navigation-header__item-link-text--search"><%= search_text %></span>
|
93
|
+
<svg class="gem-c-layout-super-navigation-header__item-link-icon--search" width="27" height="27" viewBox="0 0 27 27" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
|
94
|
+
<circle cx="10.0161" cy="10.0161" r="8.51613" stroke="currentColor" stroke-width="3" />
|
95
|
+
<line x1="15.8668" y1="16.3587" x2="25.4475" y2="25.9393" stroke="currentColor" stroke-width="3" />
|
96
|
+
</svg>
|
97
|
+
</a>
|
98
|
+
<div class="gem-c-layout-super-navigation-header__dropdown-menu">
|
99
|
+
<form id="search" action="/search" method="get" role="search" aria-label="Site-wide">
|
100
|
+
<%= render "govuk_publishing_components/components/search", {
|
101
|
+
inline_label: false,
|
102
|
+
label_text: raw("<h2 class=\"govuk-heading-m\">#{search_text}</h2>"),
|
103
|
+
size: "large",
|
104
|
+
} %>
|
105
|
+
</form>
|
106
|
+
<h2 class="govuk-heading-m"><%= popular_links_heading %></h2>
|
107
|
+
<ul class="govuk-list">
|
108
|
+
<% popular_links.each do | popular_link | %>
|
109
|
+
<li class="gem-c-layout-super-navigation-header__dropdown-list-item">
|
110
|
+
<a class="govuk-link gem-c-layout-super-navigation-header__dropdown-list-item-link" href="<%= popular_link[:href] %>">
|
111
|
+
<%= popular_link[:label] %>
|
112
|
+
</a>
|
113
|
+
</li>
|
114
|
+
<% end %>
|
115
|
+
</ul>
|
116
|
+
</div>
|
117
|
+
</li>
|
118
|
+
</ul>
|
119
|
+
</nav>
|
120
|
+
</div>
|
121
|
+
</header>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
name: Form checkboxes
|
2
2
|
description: Let users select one or more options with checkboxes.
|
3
3
|
body: |
|
4
|
-
If there is more than one checkbox they are rendered in a list. If there is only one, the markup is simplified to a single div and a heading attribute is not required.
|
4
|
+
If there is more than one checkbox they are rendered in a list. If there is only one, the markup is simplified to a single div and a heading attribute is not required. A `[]` needs to be appended to the name for Rails to treat the checkbox value as an array, otherwise only the last selected item is captured.
|
5
5
|
govuk_frontend_components:
|
6
6
|
- checkboxes
|
7
7
|
accessibility_criteria: |
|
@@ -25,7 +25,7 @@ examples:
|
|
25
25
|
with_multiple_checkboxes:
|
26
26
|
description: When more than one checkbox is shown they are wrapped in a fieldset element, which requires a legend. This must be supplied to the component using the heading option.
|
27
27
|
data:
|
28
|
-
name: "favourite_colour"
|
28
|
+
name: "favourite_colour[]"
|
29
29
|
heading: "What is your favourite colour?"
|
30
30
|
items:
|
31
31
|
- label: "Red"
|
@@ -36,7 +36,7 @@ examples:
|
|
36
36
|
value: "blue"
|
37
37
|
with_small_checkboxes:
|
38
38
|
data:
|
39
|
-
name: "favourite_small_synonym"
|
39
|
+
name: "favourite_small_synonym[]"
|
40
40
|
heading: "What is your favourite synonym for small?"
|
41
41
|
small: true
|
42
42
|
items:
|
@@ -55,7 +55,7 @@ examples:
|
|
55
55
|
with_custom_hint_text:
|
56
56
|
description: Hint text defaults to 'Select all that apply' but can be overridden with this option. Note that a hint (and a heading) is only displayed if there is more than one checkbox.
|
57
57
|
data:
|
58
|
-
name: "favourite_skittle"
|
58
|
+
name: "favourite_skittle[]"
|
59
59
|
heading: "What is your favourite skittle?"
|
60
60
|
hint_text: "Taste the rainbow"
|
61
61
|
items:
|
@@ -71,7 +71,7 @@ examples:
|
|
71
71
|
The description text can only render text and not govspeak specific syntax.
|
72
72
|
This is a pattern that is used across GOV.UK where a question is followed by a description.
|
73
73
|
data:
|
74
|
-
name: "favourite_skittle"
|
74
|
+
name: "favourite_skittle[]"
|
75
75
|
heading: "Choose your favourite skittles"
|
76
76
|
description: |
|
77
77
|
Skittles consist of hard sugar shells imprinted with the letter "S".
|
@@ -91,7 +91,7 @@ examples:
|
|
91
91
|
The description text can only render text and not govspeak specific syntax.
|
92
92
|
This is a pattern that is used across GOV.UK where a question is followed by a description.
|
93
93
|
data:
|
94
|
-
name: "favourite_skittle"
|
94
|
+
name: "favourite_skittle[]"
|
95
95
|
heading: "Choose your favourite skittles"
|
96
96
|
is_page_heading: true
|
97
97
|
description: |
|
@@ -112,7 +112,7 @@ examples:
|
|
112
112
|
A caption can only be used with a page heading. If a heading is not provided the caption will not render.
|
113
113
|
The pattern is used across GOV.UK to show a high-level section that this page question falls into.
|
114
114
|
data:
|
115
|
-
name: "favourite_skittle"
|
115
|
+
name: "favourite_skittle[]"
|
116
116
|
heading: "Choose your favourite skittles"
|
117
117
|
heading_caption: "Question 3 of 9"
|
118
118
|
is_page_heading: true
|
@@ -126,7 +126,7 @@ examples:
|
|
126
126
|
without_hint_text:
|
127
127
|
description: Hint text can be removed entirely with this option. Note that this option can be combined with the visually_hide_heading option.
|
128
128
|
data:
|
129
|
-
name: "favourite_skittle"
|
129
|
+
name: "favourite_skittle[]"
|
130
130
|
heading: "What is your favourite skittle?"
|
131
131
|
no_hint_text: true
|
132
132
|
items:
|
@@ -137,7 +137,7 @@ examples:
|
|
137
137
|
with_a_hidden_heading:
|
138
138
|
description: If the heading/legend on the checkboxes is not required, it can be visually hidden using this option. It will still be visible to screen readers.
|
139
139
|
data:
|
140
|
-
name: "favourite_colour"
|
140
|
+
name: "favourite_colour[]"
|
141
141
|
heading: "What is your favourite colour?"
|
142
142
|
visually_hide_heading: true
|
143
143
|
items:
|
@@ -150,7 +150,7 @@ examples:
|
|
150
150
|
with_a_custom_id_attribute:
|
151
151
|
description: Note that if an id is not given one is generated automatically. In either case, the id is applied to the parent element of the checkboxes, and each checkbox is given the same id with an incremented number at the end, e.g. the checkboxes below have ids of potatoes-0 and potatoes-1.
|
152
152
|
data:
|
153
|
-
name: "potatoes"
|
153
|
+
name: "potatoes[]"
|
154
154
|
id: "potatoes"
|
155
155
|
heading: "What kind of potatoes do you like?"
|
156
156
|
items:
|
@@ -161,7 +161,7 @@ examples:
|
|
161
161
|
with_custom_ids_on_individal_checkboxes:
|
162
162
|
description: Individual checkboxes can be given specific ids if required. Note that the general id option can still be used, but the individual ids will override the general one if it is given.
|
163
163
|
data:
|
164
|
-
name: "carrots"
|
164
|
+
name: "carrots[]"
|
165
165
|
id: "carrots"
|
166
166
|
heading: "What kind of carrots do you like?"
|
167
167
|
items:
|
@@ -173,7 +173,7 @@ examples:
|
|
173
173
|
with_legend_as_page_heading:
|
174
174
|
description: Since the legend/heading is required, if the checkboxes are alone on a page it makes sense to use this element as the H1 on the page rather than duplicate text.
|
175
175
|
data:
|
176
|
-
name: "favourite_colour"
|
176
|
+
name: "favourite_colour[]"
|
177
177
|
heading: "What is your favourite colour?"
|
178
178
|
is_page_heading: true
|
179
179
|
items:
|
@@ -185,11 +185,11 @@ examples:
|
|
185
185
|
value: "blue"
|
186
186
|
with_custom_heading_size:
|
187
187
|
description: |
|
188
|
-
This allows the size of the legend to be changed. Valid options are s, m, l, xl, defaulting to m if no option is passed.
|
188
|
+
This allows the size of the legend to be changed. Valid options are s, m, l, xl, defaulting to m if no option is passed.
|
189
189
|
|
190
190
|
If the is_page_heading option is true and heading_size is not set, the text size will be xl.
|
191
191
|
data:
|
192
|
-
name: "favourite_colour"
|
192
|
+
name: "favourite_colour[]"
|
193
193
|
heading: "What is your favourite colour?"
|
194
194
|
heading_size: "s"
|
195
195
|
items:
|
@@ -235,7 +235,7 @@ examples:
|
|
235
235
|
with_aria_controls_attributes:
|
236
236
|
description: Aria controls attributes are applied to the checkboxes only if Javascript is enabled.
|
237
237
|
data:
|
238
|
-
name: "aria_controls"
|
238
|
+
name: "aria_controls[]"
|
239
239
|
heading: "What areas are you interested in?"
|
240
240
|
items:
|
241
241
|
- label: "Farming and the environment"
|
@@ -246,7 +246,7 @@ examples:
|
|
246
246
|
controls: "js-live-results"
|
247
247
|
checkboxes_with_individual_hints:
|
248
248
|
data:
|
249
|
-
name: "nationality"
|
249
|
+
name: "nationality[]"
|
250
250
|
heading: "What is your nationality?"
|
251
251
|
hint_text: "If you have dual nationality, select all options that are relevant to you."
|
252
252
|
items:
|
@@ -260,7 +260,7 @@ examples:
|
|
260
260
|
hint: "anything other than the above"
|
261
261
|
checkbox_items_with_error:
|
262
262
|
data:
|
263
|
-
name: "nationality"
|
263
|
+
name: "nationality[]"
|
264
264
|
heading: "What is your nationality?"
|
265
265
|
error: "Select if you are British, Irish or a citizen of a different country"
|
266
266
|
hint_text: "If you have dual nationality, select all options that are relevant to you."
|
@@ -281,7 +281,7 @@ examples:
|
|
281
281
|
|
282
282
|
This behaviour should be doubled by similar checks on the backend.
|
283
283
|
data:
|
284
|
-
name: "nationality-exclusive"
|
284
|
+
name: "nationality-exclusive[]"
|
285
285
|
heading: "What kind of expertise can you offer?"
|
286
286
|
hint_text: "Select the types of support you can offer."
|
287
287
|
items:
|
@@ -301,7 +301,7 @@ examples:
|
|
301
301
|
|
302
302
|
Note that if you do insert HTML, this may cause accessibility violations if the additional elements have different name attributes to the checkboxes. No styling will be applied to the inserted content by the component.
|
303
303
|
data:
|
304
|
-
name: "contactingme"
|
304
|
+
name: "contactingme[]"
|
305
305
|
id: "contactingme"
|
306
306
|
heading: "How would you like to be contacted?"
|
307
307
|
hint_text: "Please select all options that are relevant to you."
|
@@ -317,7 +317,7 @@ examples:
|
|
317
317
|
conditional: <div class="govuk-form-group"><label class="govuk-label" for="contact-by-text">Mobile phone number</label><input class="govuk-input govuk-!-width-one-third" id="contact-by-text" name="contactingme" type="tel"></div>
|
318
318
|
checkbox_items_with_conditional_reveal_checked:
|
319
319
|
data:
|
320
|
-
name: "contacting-checked"
|
320
|
+
name: "contacting-checked[]"
|
321
321
|
id: "contacting-checked"
|
322
322
|
heading: "How would you like to be contacted?"
|
323
323
|
hint_text: "Please select all options that are relevant to you."
|
@@ -334,7 +334,7 @@ examples:
|
|
334
334
|
conditional: <div class="govuk-form-group"><label class="govuk-label" for="contact-by-text">Mobile phone number</label><input class="govuk-input govuk-!-width-one-third" id="contact-by-text" name="contactingme" type="tel"></div>
|
335
335
|
checkbox_items_with_checked_items:
|
336
336
|
data:
|
337
|
-
name: "nationality"
|
337
|
+
name: "nationality[]"
|
338
338
|
heading: "What is your nationality?"
|
339
339
|
hint_text: "If you have dual nationality, select all options that are relevant to you."
|
340
340
|
items:
|
@@ -347,7 +347,7 @@ examples:
|
|
347
347
|
value: "other"
|
348
348
|
checkbox_items_with_nested_checkboxes:
|
349
349
|
data:
|
350
|
-
name: "favourite_colour"
|
350
|
+
name: "favourite_colour[]"
|
351
351
|
heading: "What is your favourite colour?"
|
352
352
|
items:
|
353
353
|
- label: "Red"
|
@@ -22,7 +22,7 @@ examples:
|
|
22
22
|
block: |
|
23
23
|
We need to know your nationality so we can work out which elections you’re entitled to vote in. If you can’t provide your nationality, you’ll have to send copies of identity documents through the post.
|
24
24
|
with_data_attributes:
|
25
|
-
description: Can be used for tracking. By default, `track-label` is set to the status ("open" or "closed") unless a track_label is passed into the component.
|
25
|
+
description: Can be used for tracking. Tracking is applied to the summary element when the details element is opened and closed. By default, `track-label` is set to the status ("open" or "closed") unless a track_label is passed into the component.
|
26
26
|
data:
|
27
27
|
title: Help with nationality
|
28
28
|
data_attributes:
|
@@ -25,6 +25,15 @@ examples:
|
|
25
25
|
block: |
|
26
26
|
<h2>This is a title</h2>
|
27
27
|
<p>This is some body text with <a href="https://example.com">a link</a>.</p>
|
28
|
+
inverted:
|
29
|
+
description: This option currently supports basic inversion of only headings, paragraphs and links.
|
30
|
+
data:
|
31
|
+
inverse: true
|
32
|
+
block: |
|
33
|
+
<h2>This is a title</h2>
|
34
|
+
<p>This is some body text with <a href="https://example.com">a link</a>.</p>
|
35
|
+
context:
|
36
|
+
dark_background: true
|
28
37
|
heading_levels:
|
29
38
|
data:
|
30
39
|
block: |
|
@@ -0,0 +1,24 @@
|
|
1
|
+
name: Intervention
|
2
|
+
description: An area that contains personalised content to the user
|
3
|
+
body: |
|
4
|
+
The intervention is used to show personalised content. For instance, if the user has visited multiple
|
5
|
+
pages in the same area of the site, we might want let them know that there are other pages on GOV.UK
|
6
|
+
that would be useful to them. This component would be used to add this personalised content and would
|
7
|
+
indicate to the user that this is not normally part of the page, but has been added for them specifically.
|
8
|
+
|
9
|
+
Right now the contents of the component are static, as the MVP of personalised content is only for Start a Business.
|
10
|
+
Since many pages will use this component with the same text, we hard-code it here for now.
|
11
|
+
|
12
|
+
The dismiss link will reload the page but the `hide-intervention` query string parameter will cause the
|
13
|
+
backed not to show the intervention again. Some progressive enhancement will be added in later to avoid
|
14
|
+
reloading the page if JavaScript is available.
|
15
|
+
accessibility_criteria: |
|
16
|
+
The intervention component must:
|
17
|
+
|
18
|
+
- have a border colour contrast ratio of more than 4.5:1 with its background to be visually distinct
|
19
|
+
|
20
|
+
- always render headings with associated description content, so there are no isolated heading elements inside the component
|
21
|
+
shared_accessibility_criteria:
|
22
|
+
- link
|
23
|
+
examples:
|
24
|
+
default:
|
@@ -105,7 +105,10 @@ examples:
|
|
105
105
|
with_search_bar:
|
106
106
|
data:
|
107
107
|
search: true
|
108
|
-
|
108
|
+
with_custom_logo_link:
|
109
|
+
description: The header logo links to root by default. This option allows us to override that in certain instances.
|
110
|
+
data:
|
111
|
+
logo_link: "/account/home"
|
109
112
|
accessibility_criteria: |
|
110
113
|
The component must:
|
111
114
|
|