govuk_publishing_components 23.12.0 → 23.13.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/javascripts/govuk_publishing_components/components/header.js +3 -0
- data/app/assets/javascripts/govuk_publishing_components/components/layout-header.js +5 -0
- data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +32 -36
- data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/magna-charta.js +66 -14
- data/app/assets/javascripts/govuk_publishing_components/modules.js +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +0 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-footer.scss +5 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_show-password.scss +4 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +19 -7
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_charts.scss +17 -6
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak.scss +5 -0
- data/app/views/govuk_publishing_components/components/_button.html.erb +1 -0
- data/app/views/govuk_publishing_components/components/_layout_header.html.erb +3 -2
- data/app/views/govuk_publishing_components/components/_machine_readable_metadata.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_step_by_step_nav.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_subscription-links.html.erb +3 -0
- data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +82 -0
- data/app/views/govuk_publishing_components/components/_translation-nav.html.erb +3 -0
- data/app/views/govuk_publishing_components/components/_translation_nav.html.erb +30 -0
- data/app/views/govuk_publishing_components/components/docs/layout_header.yml +21 -0
- data/app/views/govuk_publishing_components/components/docs/meta_tags.yml +99 -1
- data/app/views/govuk_publishing_components/components/docs/subscription-links.yml +3 -0
- data/app/views/govuk_publishing_components/components/docs/subscription_links.yml +100 -0
- data/app/views/govuk_publishing_components/components/docs/translation-nav.yml +3 -1
- data/app/views/govuk_publishing_components/components/docs/translation_nav.yml +137 -0
- data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +3 -3
- data/config/locales/en.yml +2 -2
- data/lib/govuk_publishing_components/presenters/meta_tags.rb +2 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/govuk-frontend/govuk/all.js +57 -0
- data/node_modules/govuk-frontend/govuk/components/_all.scss +1 -0
- data/node_modules/govuk-frontend/govuk/components/accordion/fixtures.json +25 -10
- data/node_modules/govuk-frontend/govuk/components/back-link/fixtures.json +12 -6
- data/node_modules/govuk-frontend/govuk/components/back-link/macro-options.json +4 -4
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/fixtures.json +34 -13
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/macro-options.json +1 -0
- data/node_modules/govuk-frontend/govuk/components/button/fixtures.json +74 -31
- data/node_modules/govuk-frontend/govuk/components/character-count/fixtures.json +72 -15
- data/node_modules/govuk-frontend/govuk/components/character-count/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/checkboxes/fixtures.json +145 -52
- data/node_modules/govuk-frontend/govuk/components/checkboxes/macro-options.json +2 -2
- data/node_modules/govuk-frontend/govuk/components/date-input/fixtures.json +84 -34
- data/node_modules/govuk-frontend/govuk/components/date-input/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/date-input/template.njk +1 -1
- data/node_modules/govuk-frontend/govuk/components/details/fixtures.json +34 -14
- data/node_modules/govuk-frontend/govuk/components/error-message/fixtures.json +21 -10
- data/node_modules/govuk-frontend/govuk/components/error-message/macro-options.json +1 -0
- data/node_modules/govuk-frontend/govuk/components/error-summary/_index.scss +2 -12
- data/node_modules/govuk-frontend/govuk/components/error-summary/fixtures.json +86 -25
- data/node_modules/govuk-frontend/govuk/components/fieldset/fixtures.json +20 -10
- data/node_modules/govuk-frontend/govuk/components/file-upload/fixtures.json +60 -13
- data/node_modules/govuk-frontend/govuk/components/footer/fixtures.json +37 -18
- data/node_modules/govuk-frontend/govuk/components/footer/macro-options.json +8 -5
- data/node_modules/govuk-frontend/govuk/components/header/fixtures.json +36 -18
- data/node_modules/govuk-frontend/govuk/components/header/macro-options.json +2 -2
- data/node_modules/govuk-frontend/govuk/components/hint/fixtures.json +17 -8
- data/node_modules/govuk-frontend/govuk/components/input/fixtures.json +130 -40
- data/node_modules/govuk-frontend/govuk/components/input/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/inset-text/fixtures.json +17 -8
- data/node_modules/govuk-frontend/govuk/components/label/fixtures.json +20 -11
- data/node_modules/govuk-frontend/govuk/components/label/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/notification-banner/README.md +15 -0
- data/node_modules/govuk-frontend/govuk/components/notification-banner/_index.scss +89 -0
- data/node_modules/govuk-frontend/govuk/components/notification-banner/_notification-banner.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/notification-banner/fixtures.json +212 -0
- data/node_modules/govuk-frontend/govuk/components/notification-banner/macro-options.json +68 -0
- data/node_modules/govuk-frontend/govuk/components/notification-banner/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/notification-banner/notification-banner.js +61 -0
- data/node_modules/govuk-frontend/govuk/components/notification-banner/template.njk +47 -0
- data/node_modules/govuk-frontend/govuk/components/panel/fixtures.json +30 -13
- data/node_modules/govuk-frontend/govuk/components/phase-banner/fixtures.json +20 -9
- data/node_modules/govuk-frontend/govuk/components/radios/fixtures.json +167 -50
- data/node_modules/govuk-frontend/govuk/components/select/fixtures.json +97 -18
- data/node_modules/govuk-frontend/govuk/components/select/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/skip-link/fixtures.json +21 -9
- data/node_modules/govuk-frontend/govuk/components/summary-list/fixtures.json +118 -25
- data/node_modules/govuk-frontend/govuk/components/table/fixtures.json +92 -22
- data/node_modules/govuk-frontend/govuk/components/tabs/fixtures.json +75 -18
- data/node_modules/govuk-frontend/govuk/components/tabs/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/tag/fixtures.json +28 -14
- data/node_modules/govuk-frontend/govuk/components/textarea/fixtures.json +68 -17
- data/node_modules/govuk-frontend/govuk/components/warning-text/fixtures.json +19 -14
- data/node_modules/govuk-frontend/govuk/helpers/_links.scss +94 -0
- data/node_modules/govuk-frontend/govuk/settings/_colours-applied.scss +9 -0
- data/node_modules/govuk-frontend/govuk/settings/_typography-font.scss +3 -0
- data/node_modules/govuk-frontend/package.json +1 -1
- metadata +15 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_transition-countdown.scss +0 -125
@@ -1,3 +1,6 @@
|
|
1
|
+
# DO NOT MAKE CHANGES TO THIS FILE
|
2
|
+
# It is a temporary copy of translation_nav.yml and will be deleted shortly
|
3
|
+
|
1
4
|
name: Translation navigation
|
2
5
|
description: A list of links to available translations
|
3
6
|
body: The active property indicates the current language.
|
@@ -134,4 +137,3 @@ examples:
|
|
134
137
|
dimension29: 'dimension29Welsh'
|
135
138
|
context:
|
136
139
|
dark_background: true
|
137
|
-
|
@@ -0,0 +1,137 @@
|
|
1
|
+
name: Translation navigation
|
2
|
+
description: A list of links to available translations
|
3
|
+
body: The active property indicates the current language.
|
4
|
+
accessibility_criteria: |
|
5
|
+
The component must:
|
6
|
+
|
7
|
+
- be [a landmark with a navigation role](https://accessibility.blog.gov.uk/2016/05/27/using-navigation-landmarks/)
|
8
|
+
- have an accessible name in the current language, eg "Translations"
|
9
|
+
|
10
|
+
The translation links must:
|
11
|
+
|
12
|
+
- [identify the language of the text](https://www.w3.org/TR/UNDERSTANDING-WCAG20/meaning-other-lang-id.html#meaning-other-lang-id-examples-head)
|
13
|
+
|
14
|
+
[Watch a screen reader pronounce text differently based on lang attribute](https://bit.ly/screenreaderpronunciation)
|
15
|
+
shared_accessibility_criteria:
|
16
|
+
- link
|
17
|
+
examples:
|
18
|
+
default:
|
19
|
+
data:
|
20
|
+
translations:
|
21
|
+
- locale: 'en'
|
22
|
+
base_path: '/en'
|
23
|
+
text: 'English'
|
24
|
+
active: true
|
25
|
+
- locale: 'hi'
|
26
|
+
base_path: '/hi'
|
27
|
+
text: 'हिंदी'
|
28
|
+
multiple_translations:
|
29
|
+
data:
|
30
|
+
translations:
|
31
|
+
- locale: 'en'
|
32
|
+
base_path: '/en'
|
33
|
+
text: 'English'
|
34
|
+
active: true
|
35
|
+
- locale: 'fr'
|
36
|
+
base_path: '/fr'
|
37
|
+
text: 'Français'
|
38
|
+
- locale: 'hi'
|
39
|
+
base_path: '/hi'
|
40
|
+
text: 'हिंदी'
|
41
|
+
- locale: 'ja'
|
42
|
+
base_path: '/ja'
|
43
|
+
text: '日本語'
|
44
|
+
- locale: 'ur'
|
45
|
+
base_path: '/ur'
|
46
|
+
text: 'اردو'
|
47
|
+
- locale: 'zh'
|
48
|
+
base_path: '/zh'
|
49
|
+
text: '中文'
|
50
|
+
right_to_left:
|
51
|
+
data:
|
52
|
+
translations:
|
53
|
+
- locale: 'en'
|
54
|
+
base_path: '/en'
|
55
|
+
text: 'English'
|
56
|
+
- locale: 'ar'
|
57
|
+
base_path: '/ar'
|
58
|
+
text: 'العربية'
|
59
|
+
active: true
|
60
|
+
context:
|
61
|
+
right_to_left: true
|
62
|
+
with_branding:
|
63
|
+
description: Organisation [colour branding](https://github.com/alphagov/govuk_publishing_components/blob/master/docs/component_branding.md) can be added to the component as shown.
|
64
|
+
data:
|
65
|
+
brand: 'wales-office'
|
66
|
+
translations:
|
67
|
+
- locale: 'en'
|
68
|
+
base_path: '/en'
|
69
|
+
text: 'English'
|
70
|
+
active: true
|
71
|
+
- locale: 'cy'
|
72
|
+
base_path: '/cy'
|
73
|
+
text: 'Cymraeg'
|
74
|
+
with_no_top_margin:
|
75
|
+
data:
|
76
|
+
no_margin_top: true
|
77
|
+
translations:
|
78
|
+
- locale: 'en'
|
79
|
+
base_path: '/en'
|
80
|
+
text: 'English'
|
81
|
+
active: true
|
82
|
+
- locale: 'cy'
|
83
|
+
base_path: '/cy'
|
84
|
+
text: 'Cymraeg'
|
85
|
+
with_tracking:
|
86
|
+
description: Data attributes can be passed for each link as shown.
|
87
|
+
data:
|
88
|
+
translations:
|
89
|
+
- locale: 'en'
|
90
|
+
base_path: '/en'
|
91
|
+
text: 'English'
|
92
|
+
active: true
|
93
|
+
data_attributes:
|
94
|
+
track_category: 'categoryEnglish'
|
95
|
+
track_action: 1.1
|
96
|
+
track_label: 'labelEnglish'
|
97
|
+
track_options:
|
98
|
+
dimension28: 1
|
99
|
+
dimension29: 'dimension29English'
|
100
|
+
- locale: 'cy'
|
101
|
+
base_path: '/cy'
|
102
|
+
text: 'Cymraeg'
|
103
|
+
data_attributes:
|
104
|
+
track_category: 'categoryWelsh'
|
105
|
+
track_action: 1.2
|
106
|
+
track_label: 'labelWelsh'
|
107
|
+
track_options:
|
108
|
+
dimension28: 1
|
109
|
+
dimension29: 'dimension29Welsh'
|
110
|
+
inverse:
|
111
|
+
data:
|
112
|
+
inverse: true
|
113
|
+
translations:
|
114
|
+
- locale: 'en'
|
115
|
+
base_path: '/en'
|
116
|
+
text: 'English'
|
117
|
+
active: true
|
118
|
+
data_attributes:
|
119
|
+
track_category: 'categoryEnglish'
|
120
|
+
track_action: 1.1
|
121
|
+
track_label: 'labelEnglish'
|
122
|
+
track_options:
|
123
|
+
dimension28: 1
|
124
|
+
dimension29: 'dimension29English'
|
125
|
+
- locale: 'cy'
|
126
|
+
base_path: '/cy'
|
127
|
+
text: 'Cymraeg'
|
128
|
+
data_attributes:
|
129
|
+
track_category: 'categoryWelsh'
|
130
|
+
track_action: 1.2
|
131
|
+
track_label: 'labelWelsh'
|
132
|
+
track_options:
|
133
|
+
dimension28: 1
|
134
|
+
dimension29: 'dimension29Welsh'
|
135
|
+
context:
|
136
|
+
dark_background: true
|
137
|
+
|
data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
<% if navigation_items.any? %>
|
2
2
|
<button role="button" class="govuk-header__menu-button gem-c-header__menu-button govuk-js-header-toggle" aria-controls="navigation" aria-label="Show or hide Top Level Navigation">Menu</button>
|
3
|
-
|
4
|
-
<ul id="navigation" class="govuk-header__navigation govuk-header__navigation--end"
|
3
|
+
<%= tag.nav(class: "gem-c-header__nav", 'aria-label': navigation_aria_label ? navigation_aria_label : nil ) do %>
|
4
|
+
<ul id="navigation" class="govuk-header__navigation govuk-header__navigation--end">
|
5
5
|
<% navigation_items.each_with_index do |item, index| %>
|
6
6
|
<li class="govuk-header__navigation-item <%= "govuk-header__navigation-item--active" if item[:active] %>
|
7
7
|
<%= "govuk-header__navigation-item--collapsed-menu-only" if item[:show_only_in_collapsed_menu] %>">
|
@@ -13,5 +13,5 @@
|
|
13
13
|
</li>
|
14
14
|
<% end %>
|
15
15
|
</ul>
|
16
|
-
|
16
|
+
<% end %>
|
17
17
|
<% end %>
|
data/config/locales/en.yml
CHANGED
@@ -31,6 +31,8 @@ module GovukPublishingComponents
|
|
31
31
|
meta_tags["govuk:publishing-application"] = content_item[:publishing_app] if content_item[:publishing_app]
|
32
32
|
meta_tags["govuk:schema-name"] = content_item[:schema_name] if content_item[:schema_name]
|
33
33
|
meta_tags["govuk:content-id"] = content_item[:content_id] if content_item[:content_id]
|
34
|
+
meta_tags["govuk:navigation-page-type"] = content_item[:navigation_page_type] if content_item[:navigation_page_type]
|
35
|
+
meta_tags["govuk:section"] = content_item[:section] if content_item[:section]
|
34
36
|
meta_tags["govuk:withdrawn"] = "withdrawn" if content_item[:withdrawn_notice].present?
|
35
37
|
meta_tags["govuk:content-has-history"] = "true" if has_content_history?
|
36
38
|
meta_tags["govuk:static-analytics:strip-dates"] = "true" if should_strip_dates_pii?(content_item, local_assigns)
|
@@ -1959,6 +1959,58 @@ ErrorSummary.prototype.getAssociatedLegendOrLabel = function ($input) {
|
|
1959
1959
|
$input.closest('label')
|
1960
1960
|
};
|
1961
1961
|
|
1962
|
+
function NotificationBanner ($module) {
|
1963
|
+
this.$module = $module;
|
1964
|
+
}
|
1965
|
+
|
1966
|
+
/**
|
1967
|
+
* Initialise the component
|
1968
|
+
*/
|
1969
|
+
NotificationBanner.prototype.init = function () {
|
1970
|
+
var $module = this.$module;
|
1971
|
+
// Check for module
|
1972
|
+
if (!$module) {
|
1973
|
+
return
|
1974
|
+
}
|
1975
|
+
|
1976
|
+
this.setFocus();
|
1977
|
+
};
|
1978
|
+
|
1979
|
+
/**
|
1980
|
+
* Focus the element
|
1981
|
+
*
|
1982
|
+
* If `role="alert"` is set, focus the element to help some assistive technologies
|
1983
|
+
* prioritise announcing it.
|
1984
|
+
*
|
1985
|
+
* You can turn off the auto-focus functionality by setting `data-disable-auto-focus="true"` in the
|
1986
|
+
* component HTML. You might wish to do this based on user research findings, or to avoid a clash
|
1987
|
+
* with another element which should be focused when the page loads.
|
1988
|
+
*/
|
1989
|
+
NotificationBanner.prototype.setFocus = function () {
|
1990
|
+
var $module = this.$module;
|
1991
|
+
|
1992
|
+
if ($module.getAttribute('data-disable-auto-focus') === 'true') {
|
1993
|
+
return
|
1994
|
+
}
|
1995
|
+
|
1996
|
+
if ($module.getAttribute('role') !== 'alert') {
|
1997
|
+
return
|
1998
|
+
}
|
1999
|
+
|
2000
|
+
// Set tabindex to -1 to make the element focusable with JavaScript.
|
2001
|
+
// Remove the tabindex on blur as the component doesn't need to be focusable after the page has
|
2002
|
+
// loaded.
|
2003
|
+
if (!$module.getAttribute('tabindex')) {
|
2004
|
+
$module.setAttribute('tabindex', '-1');
|
2005
|
+
|
2006
|
+
$module.addEventListener('blur', function () {
|
2007
|
+
$module.removeAttribute('tabindex');
|
2008
|
+
});
|
2009
|
+
}
|
2010
|
+
|
2011
|
+
$module.focus();
|
2012
|
+
};
|
2013
|
+
|
1962
2014
|
function Header ($module) {
|
1963
2015
|
this.$module = $module;
|
1964
2016
|
this.$menuButton = $module && $module.querySelector('.govuk-js-header-toggle');
|
@@ -2476,6 +2528,11 @@ function initAll (options) {
|
|
2476
2528
|
var $toggleButton = scope.querySelector('[data-module="govuk-header"]');
|
2477
2529
|
new Header($toggleButton).init();
|
2478
2530
|
|
2531
|
+
var $notificationBanners = scope.querySelectorAll('[data-module="govuk-notification-banner"]');
|
2532
|
+
nodeListForEach($notificationBanners, function ($notificationBanner) {
|
2533
|
+
new NotificationBanner($notificationBanner).init();
|
2534
|
+
});
|
2535
|
+
|
2479
2536
|
var $radios = scope.querySelectorAll('[data-module="govuk-radios"]');
|
2480
2537
|
nodeListForEach($radios, function ($radio) {
|
2481
2538
|
new Radios($radio).init();
|
@@ -24,7 +24,8 @@
|
|
24
24
|
}
|
25
25
|
]
|
26
26
|
},
|
27
|
-
"html": "<div class=\"govuk-accordion\" data-module=\"govuk-accordion\" id=\"default-example\">\n \n \n <div class=\"govuk-accordion__section \">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"default-example-heading-1\">\n Section A\n </span>\n </h2>\n \n </div>\n <div id=\"default-example-content-1\" class=\"govuk-accordion__section-content\" aria-labelledby=\"default-example-heading-1\">\n <ul class=\"govuk-list govuk-list--bullet\">\n <li>Example item 1</li>\n</ul>\n\n </div>\n </div>\n \n \n \n <div class=\"govuk-accordion__section \">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"default-example-heading-2\">\n Section B\n </span>\n </h2>\n \n </div>\n <div id=\"default-example-content-2\" class=\"govuk-accordion__section-content\" aria-labelledby=\"default-example-heading-2\">\n <ul class=\"govuk-list govuk-list--bullet\">\n <li>Example item 2</li>\n</ul>\n\n </div>\n </div>\n \n \n</div>"
|
27
|
+
"html": "<div class=\"govuk-accordion\" data-module=\"govuk-accordion\" id=\"default-example\">\n \n \n <div class=\"govuk-accordion__section \">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"default-example-heading-1\">\n Section A\n </span>\n </h2>\n \n </div>\n <div id=\"default-example-content-1\" class=\"govuk-accordion__section-content\" aria-labelledby=\"default-example-heading-1\">\n <ul class=\"govuk-list govuk-list--bullet\">\n <li>Example item 1</li>\n</ul>\n\n </div>\n </div>\n \n \n \n <div class=\"govuk-accordion__section \">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"default-example-heading-2\">\n Section B\n </span>\n </h2>\n \n </div>\n <div id=\"default-example-content-2\" class=\"govuk-accordion__section-content\" aria-labelledby=\"default-example-heading-2\">\n <ul class=\"govuk-list govuk-list--bullet\">\n <li>Example item 2</li>\n</ul>\n\n </div>\n </div>\n \n \n</div>",
|
28
|
+
"hidden": false
|
28
29
|
},
|
29
30
|
{
|
30
31
|
"name": "with additional descriptions",
|
@@ -55,7 +56,8 @@
|
|
55
56
|
}
|
56
57
|
]
|
57
58
|
},
|
58
|
-
"html": "<div class=\"govuk-accordion\" data-module=\"govuk-accordion\" id=\"with-descriptions\">\n \n \n <div class=\"govuk-accordion__section \">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"with-descriptions-heading-1\">\n Test\n </span>\n </h2>\n \n <div class=\"govuk-accordion__section-summary govuk-body\" id=\"with-descriptions-summary-1\">\n Additional description\n </div>\n \n </div>\n <div id=\"with-descriptions-content-1\" class=\"govuk-accordion__section-content\" aria-labelledby=\"with-descriptions-heading-1\">\n <ul class=\"govuk-list govuk-list--bullet\">\n <li>Example item 1</li>\n</ul>\n\n </div>\n </div>\n \n \n \n <div class=\"govuk-accordion__section \">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"with-descriptions-heading-2\">\n Test 2\n </span>\n </h2>\n \n <div class=\"govuk-accordion__section-summary govuk-body\" id=\"with-descriptions-summary-2\">\n <span class=\"govuk-!-font-weight-regular\">Additional description</span>\n </div>\n \n </div>\n <div id=\"with-descriptions-content-2\" class=\"govuk-accordion__section-content\" aria-labelledby=\"with-descriptions-heading-2\">\n <ul class=\"govuk-list govuk-list--bullet\">\n <li>Example item 2</li>\n</ul>\n\n </div>\n </div>\n \n \n</div>"
|
59
|
+
"html": "<div class=\"govuk-accordion\" data-module=\"govuk-accordion\" id=\"with-descriptions\">\n \n \n <div class=\"govuk-accordion__section \">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"with-descriptions-heading-1\">\n Test\n </span>\n </h2>\n \n <div class=\"govuk-accordion__section-summary govuk-body\" id=\"with-descriptions-summary-1\">\n Additional description\n </div>\n \n </div>\n <div id=\"with-descriptions-content-1\" class=\"govuk-accordion__section-content\" aria-labelledby=\"with-descriptions-heading-1\">\n <ul class=\"govuk-list govuk-list--bullet\">\n <li>Example item 1</li>\n</ul>\n\n </div>\n </div>\n \n \n \n <div class=\"govuk-accordion__section \">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"with-descriptions-heading-2\">\n Test 2\n </span>\n </h2>\n \n <div class=\"govuk-accordion__section-summary govuk-body\" id=\"with-descriptions-summary-2\">\n <span class=\"govuk-!-font-weight-regular\">Additional description</span>\n </div>\n \n </div>\n <div id=\"with-descriptions-content-2\" class=\"govuk-accordion__section-content\" aria-labelledby=\"with-descriptions-heading-2\">\n <ul class=\"govuk-list govuk-list--bullet\">\n <li>Example item 2</li>\n</ul>\n\n </div>\n </div>\n \n \n</div>",
|
60
|
+
"hidden": false
|
59
61
|
},
|
60
62
|
{
|
61
63
|
"name": "with one section open",
|
@@ -81,7 +83,8 @@
|
|
81
83
|
}
|
82
84
|
]
|
83
85
|
},
|
84
|
-
"html": "<div class=\"govuk-accordion\" data-module=\"govuk-accordion\" id=\"one-section-open-example\">\n \n \n <div class=\"govuk-accordion__section govuk-accordion__section--expanded\">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"one-section-open-example-heading-1\">\n Section A\n </span>\n </h2>\n \n </div>\n <div id=\"one-section-open-example-content-1\" class=\"govuk-accordion__section-content\" aria-labelledby=\"one-section-open-example-heading-1\">\n <ul class=\"govuk-list govuk-list--bullet\">\n <li>Example item 1</li>\n</ul>\n\n </div>\n </div>\n \n \n \n <div class=\"govuk-accordion__section \">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"one-section-open-example-heading-2\">\n Section B\n </span>\n </h2>\n \n </div>\n <div id=\"one-section-open-example-content-2\" class=\"govuk-accordion__section-content\" aria-labelledby=\"one-section-open-example-heading-2\">\n <ul class=\"govuk-list govuk-list--bullet\">\n <li>Example item 2</li>\n</ul>\n\n </div>\n </div>\n \n \n</div>"
|
86
|
+
"html": "<div class=\"govuk-accordion\" data-module=\"govuk-accordion\" id=\"one-section-open-example\">\n \n \n <div class=\"govuk-accordion__section govuk-accordion__section--expanded\">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"one-section-open-example-heading-1\">\n Section A\n </span>\n </h2>\n \n </div>\n <div id=\"one-section-open-example-content-1\" class=\"govuk-accordion__section-content\" aria-labelledby=\"one-section-open-example-heading-1\">\n <ul class=\"govuk-list govuk-list--bullet\">\n <li>Example item 1</li>\n</ul>\n\n </div>\n </div>\n \n \n \n <div class=\"govuk-accordion__section \">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"one-section-open-example-heading-2\">\n Section B\n </span>\n </h2>\n \n </div>\n <div id=\"one-section-open-example-content-2\" class=\"govuk-accordion__section-content\" aria-labelledby=\"one-section-open-example-heading-2\">\n <ul class=\"govuk-list govuk-list--bullet\">\n <li>Example item 2</li>\n</ul>\n\n </div>\n </div>\n \n \n</div>",
|
87
|
+
"hidden": false
|
85
88
|
},
|
86
89
|
{
|
87
90
|
"name": "with all sections already open",
|
@@ -108,7 +111,8 @@
|
|
108
111
|
}
|
109
112
|
]
|
110
113
|
},
|
111
|
-
"html": "<div class=\"govuk-accordion\" data-module=\"govuk-accordion\" id=\"all-sections-open-example\">\n \n \n <div class=\"govuk-accordion__section govuk-accordion__section--expanded\">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"all-sections-open-example-heading-1\">\n Section A\n </span>\n </h2>\n \n </div>\n <div id=\"all-sections-open-example-content-1\" class=\"govuk-accordion__section-content\" aria-labelledby=\"all-sections-open-example-heading-1\">\n <ul class=\"govuk-list govuk-list--bullet\">\n <li>Example item 1</li>\n</ul>\n\n </div>\n </div>\n \n \n \n <div class=\"govuk-accordion__section govuk-accordion__section--expanded\">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"all-sections-open-example-heading-2\">\n Section B\n </span>\n </h2>\n \n </div>\n <div id=\"all-sections-open-example-content-2\" class=\"govuk-accordion__section-content\" aria-labelledby=\"all-sections-open-example-heading-2\">\n <ul class=\"govuk-list govuk-list--bullet\">\n <li>Example item 2</li>\n</ul>\n\n </div>\n </div>\n \n \n</div>"
|
114
|
+
"html": "<div class=\"govuk-accordion\" data-module=\"govuk-accordion\" id=\"all-sections-open-example\">\n \n \n <div class=\"govuk-accordion__section govuk-accordion__section--expanded\">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"all-sections-open-example-heading-1\">\n Section A\n </span>\n </h2>\n \n </div>\n <div id=\"all-sections-open-example-content-1\" class=\"govuk-accordion__section-content\" aria-labelledby=\"all-sections-open-example-heading-1\">\n <ul class=\"govuk-list govuk-list--bullet\">\n <li>Example item 1</li>\n</ul>\n\n </div>\n </div>\n \n \n \n <div class=\"govuk-accordion__section govuk-accordion__section--expanded\">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"all-sections-open-example-heading-2\">\n Section B\n </span>\n </h2>\n \n </div>\n <div id=\"all-sections-open-example-content-2\" class=\"govuk-accordion__section-content\" aria-labelledby=\"all-sections-open-example-heading-2\">\n <ul class=\"govuk-list govuk-list--bullet\">\n <li>Example item 2</li>\n</ul>\n\n </div>\n </div>\n \n \n</div>",
|
115
|
+
"hidden": false
|
112
116
|
},
|
113
117
|
{
|
114
118
|
"name": "with focusable elements inside",
|
@@ -133,11 +137,13 @@
|
|
133
137
|
}
|
134
138
|
]
|
135
139
|
},
|
136
|
-
"html": "<div class=\"govuk-accordion\" data-module=\"govuk-accordion\" id=\"with-focusable-elements\">\n \n \n <div class=\"govuk-accordion__section \">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"with-focusable-elements-heading-1\">\n Section A\n </span>\n </h2>\n \n </div>\n <div id=\"with-focusable-elements-content-1\" class=\"govuk-accordion__section-content\" aria-labelledby=\"with-focusable-elements-heading-1\">\n <a class=\"govuk-link\" href=\"#\">Link A</a>\n </div>\n </div>\n \n \n \n <div class=\"govuk-accordion__section \">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"with-focusable-elements-heading-2\">\n Section B\n </span>\n </h2>\n \n </div>\n <div id=\"with-focusable-elements-content-2\" class=\"govuk-accordion__section-content\" aria-labelledby=\"with-focusable-elements-heading-2\">\n <a class=\"govuk-link\" href=\"#\">Link B</a>\n </div>\n </div>\n \n \n</div>"
|
140
|
+
"html": "<div class=\"govuk-accordion\" data-module=\"govuk-accordion\" id=\"with-focusable-elements\">\n \n \n <div class=\"govuk-accordion__section \">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"with-focusable-elements-heading-1\">\n Section A\n </span>\n </h2>\n \n </div>\n <div id=\"with-focusable-elements-content-1\" class=\"govuk-accordion__section-content\" aria-labelledby=\"with-focusable-elements-heading-1\">\n <a class=\"govuk-link\" href=\"#\">Link A</a>\n </div>\n </div>\n \n \n \n <div class=\"govuk-accordion__section \">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"with-focusable-elements-heading-2\">\n Section B\n </span>\n </h2>\n \n </div>\n <div id=\"with-focusable-elements-content-2\" class=\"govuk-accordion__section-content\" aria-labelledby=\"with-focusable-elements-heading-2\">\n <a class=\"govuk-link\" href=\"#\">Link B</a>\n </div>\n </div>\n \n \n</div>",
|
141
|
+
"hidden": false
|
137
142
|
},
|
138
143
|
{
|
139
144
|
"name": "classes",
|
140
145
|
"options": {
|
146
|
+
"id": "accordion-classes",
|
141
147
|
"classes": "myClass",
|
142
148
|
"items": [
|
143
149
|
{
|
@@ -150,11 +156,13 @@
|
|
150
156
|
}
|
151
157
|
]
|
152
158
|
},
|
153
|
-
"html": "<div class=\"govuk-accordion myClass\" data-module=\"govuk-accordion\" id=\"\">\n \n \n <div class=\"govuk-accordion__section \">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"-heading-1\">\n Section A\n </span>\n </h2>\n \n </div>\n <div id=\"-content-1\" class=\"govuk-accordion__section-content\" aria-labelledby=\"-heading-1\">\n Some content\n </div>\n </div>\n \n \n</div>"
|
159
|
+
"html": "<div class=\"govuk-accordion myClass\" data-module=\"govuk-accordion\" id=\"accordion-classes\">\n \n \n <div class=\"govuk-accordion__section \">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"accordion-classes-heading-1\">\n Section A\n </span>\n </h2>\n \n </div>\n <div id=\"accordion-classes-content-1\" class=\"govuk-accordion__section-content\" aria-labelledby=\"accordion-classes-heading-1\">\n Some content\n </div>\n </div>\n \n \n</div>",
|
160
|
+
"hidden": true
|
154
161
|
},
|
155
162
|
{
|
156
163
|
"name": "attributes",
|
157
164
|
"options": {
|
165
|
+
"id": "accordion-attributes",
|
158
166
|
"attributes": {
|
159
167
|
"data-attribute": "value"
|
160
168
|
},
|
@@ -169,11 +177,13 @@
|
|
169
177
|
}
|
170
178
|
]
|
171
179
|
},
|
172
|
-
"html": "<div class=\"govuk-accordion\" data-module=\"govuk-accordion\" id=\"\" data-attribute=\"value\">\n \n \n <div class=\"govuk-accordion__section \">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"-heading-1\">\n Section A\n </span>\n </h2>\n \n </div>\n <div id=\"-content-1\" class=\"govuk-accordion__section-content\" aria-labelledby=\"-heading-1\">\n Some content\n </div>\n </div>\n \n \n</div>"
|
180
|
+
"html": "<div class=\"govuk-accordion\" data-module=\"govuk-accordion\" id=\"accordion-attributes\" data-attribute=\"value\">\n \n \n <div class=\"govuk-accordion__section \">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"accordion-attributes-heading-1\">\n Section A\n </span>\n </h2>\n \n </div>\n <div id=\"accordion-attributes-content-1\" class=\"govuk-accordion__section-content\" aria-labelledby=\"accordion-attributes-heading-1\">\n Some content\n </div>\n </div>\n \n \n</div>",
|
181
|
+
"hidden": true
|
173
182
|
},
|
174
183
|
{
|
175
184
|
"name": "custom heading level",
|
176
185
|
"options": {
|
186
|
+
"id": "accordion-heading",
|
177
187
|
"headingLevel": 3,
|
178
188
|
"items": [
|
179
189
|
{
|
@@ -186,11 +196,13 @@
|
|
186
196
|
}
|
187
197
|
]
|
188
198
|
},
|
189
|
-
"html": "<div class=\"govuk-accordion\" data-module=\"govuk-accordion\" id=\"\">\n \n \n <div class=\"govuk-accordion__section \">\n <div class=\"govuk-accordion__section-header\">\n <h3 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"-heading-1\">\n Section A\n </span>\n </h3>\n \n </div>\n <div id=\"-content-1\" class=\"govuk-accordion__section-content\" aria-labelledby=\"-heading-1\">\n Some content\n </div>\n </div>\n \n \n</div>"
|
199
|
+
"html": "<div class=\"govuk-accordion\" data-module=\"govuk-accordion\" id=\"accordion-heading\">\n \n \n <div class=\"govuk-accordion__section \">\n <div class=\"govuk-accordion__section-header\">\n <h3 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"accordion-heading-heading-1\">\n Section A\n </span>\n </h3>\n \n </div>\n <div id=\"accordion-heading-content-1\" class=\"govuk-accordion__section-content\" aria-labelledby=\"accordion-heading-heading-1\">\n Some content\n </div>\n </div>\n \n \n</div>",
|
200
|
+
"hidden": true
|
190
201
|
},
|
191
202
|
{
|
192
203
|
"name": "heading html",
|
193
204
|
"options": {
|
205
|
+
"id": "accordion-heading-html",
|
194
206
|
"items": [
|
195
207
|
{
|
196
208
|
"heading": {
|
@@ -202,11 +214,13 @@
|
|
202
214
|
}
|
203
215
|
]
|
204
216
|
},
|
205
|
-
"html": "<div class=\"govuk-accordion\" data-module=\"govuk-accordion\" id=\"\">\n \n \n <div class=\"govuk-accordion__section \">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"-heading-1\">\n <span class=\"myClass\">Section A</span>\n </span>\n </h2>\n \n </div>\n <div id=\"-content-1\" class=\"govuk-accordion__section-content\" aria-labelledby=\"-heading-1\">\n Some content\n </div>\n </div>\n \n \n</div>"
|
217
|
+
"html": "<div class=\"govuk-accordion\" data-module=\"govuk-accordion\" id=\"accordion-heading-html\">\n \n \n <div class=\"govuk-accordion__section \">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"accordion-heading-html-heading-1\">\n <span class=\"myClass\">Section A</span>\n </span>\n </h2>\n \n </div>\n <div id=\"accordion-heading-html-content-1\" class=\"govuk-accordion__section-content\" aria-labelledby=\"accordion-heading-html-heading-1\">\n Some content\n </div>\n </div>\n \n \n</div>",
|
218
|
+
"hidden": true
|
206
219
|
},
|
207
220
|
{
|
208
221
|
"name": "with falsey values",
|
209
222
|
"options": {
|
223
|
+
"id": "accordion-falsey",
|
210
224
|
"items": [
|
211
225
|
{
|
212
226
|
"heading": {
|
@@ -229,7 +243,8 @@
|
|
229
243
|
}
|
230
244
|
]
|
231
245
|
},
|
232
|
-
"html": "<div class=\"govuk-accordion\" data-module=\"govuk-accordion\" id=\"\">\n \n \n <div class=\"govuk-accordion__section \">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"-heading-1\">\n Section A\n </span>\n </h2>\n \n </div>\n <div id=\"-content-1\" class=\"govuk-accordion__section-content\" aria-labelledby=\"-heading-1\">\n Some content\n </div>\n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-accordion__section \">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"-heading-5\">\n Section B\n </span>\n </h2>\n \n </div>\n <div id=\"-content-5\" class=\"govuk-accordion__section-content\" aria-labelledby=\"-heading-5\">\n Some content\n </div>\n </div>\n \n \n</div>"
|
246
|
+
"html": "<div class=\"govuk-accordion\" data-module=\"govuk-accordion\" id=\"accordion-falsey\">\n \n \n <div class=\"govuk-accordion__section \">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"accordion-falsey-heading-1\">\n Section A\n </span>\n </h2>\n \n </div>\n <div id=\"accordion-falsey-content-1\" class=\"govuk-accordion__section-content\" aria-labelledby=\"accordion-falsey-heading-1\">\n Some content\n </div>\n </div>\n \n \n \n \n \n \n \n \n \n <div class=\"govuk-accordion__section \">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"accordion-falsey-heading-5\">\n Section B\n </span>\n </h2>\n \n </div>\n <div id=\"accordion-falsey-content-5\" class=\"govuk-accordion__section-content\" aria-labelledby=\"accordion-falsey-heading-5\">\n Some content\n </div>\n </div>\n \n \n</div>",
|
247
|
+
"hidden": true
|
233
248
|
}
|
234
249
|
]
|
235
250
|
}
|
@@ -6,7 +6,8 @@
|
|
6
6
|
"options": {
|
7
7
|
"href": "#"
|
8
8
|
},
|
9
|
-
"html": "<a href=\"#\" class=\"govuk-back-link\">Back</a>"
|
9
|
+
"html": "<a href=\"#\" class=\"govuk-back-link\">Back</a>",
|
10
|
+
"hidden": false
|
10
11
|
},
|
11
12
|
{
|
12
13
|
"name": "with custom text",
|
@@ -14,7 +15,8 @@
|
|
14
15
|
"href": "#",
|
15
16
|
"text": "Back to home"
|
16
17
|
},
|
17
|
-
"html": "<a href=\"#\" class=\"govuk-back-link\">Back to home</a>"
|
18
|
+
"html": "<a href=\"#\" class=\"govuk-back-link\">Back to home</a>",
|
19
|
+
"hidden": false
|
18
20
|
},
|
19
21
|
{
|
20
22
|
"name": "classes",
|
@@ -22,7 +24,8 @@
|
|
22
24
|
"classes": "app-back-link--custom-class",
|
23
25
|
"href": "#"
|
24
26
|
},
|
25
|
-
"html": "<a href=\"#\" class=\"govuk-back-link app-back-link--custom-class\">Back</a>"
|
27
|
+
"html": "<a href=\"#\" class=\"govuk-back-link app-back-link--custom-class\">Back</a>",
|
28
|
+
"hidden": true
|
26
29
|
},
|
27
30
|
{
|
28
31
|
"name": "html as text",
|
@@ -30,7 +33,8 @@
|
|
30
33
|
"text": "<b>Home</b>",
|
31
34
|
"href": "#"
|
32
35
|
},
|
33
|
-
"html": "<a href=\"#\" class=\"govuk-back-link\"><b>Home</b></a>"
|
36
|
+
"html": "<a href=\"#\" class=\"govuk-back-link\"><b>Home</b></a>",
|
37
|
+
"hidden": true
|
34
38
|
},
|
35
39
|
{
|
36
40
|
"name": "html",
|
@@ -38,7 +42,8 @@
|
|
38
42
|
"html": "<b>Back</b>",
|
39
43
|
"href": "#"
|
40
44
|
},
|
41
|
-
"html": "<a href=\"#\" class=\"govuk-back-link\"><b>Back</b></a>"
|
45
|
+
"html": "<a href=\"#\" class=\"govuk-back-link\"><b>Back</b></a>",
|
46
|
+
"hidden": true
|
42
47
|
},
|
43
48
|
{
|
44
49
|
"name": "attributes",
|
@@ -50,7 +55,8 @@
|
|
50
55
|
"aria-label": "Back to home"
|
51
56
|
}
|
52
57
|
},
|
53
|
-
"html": "<a href=\"#\" class=\"govuk-back-link\" data-test=\"attribute\" aria-label=\"Back to home\"><b>Back to home</b></a>"
|
58
|
+
"html": "<a href=\"#\" class=\"govuk-back-link\" data-test=\"attribute\" aria-label=\"Back to home\"><b>Back to home</b></a>",
|
59
|
+
"hidden": true
|
54
60
|
}
|
55
61
|
]
|
56
62
|
}
|