govuk_publishing_components 23.1.0 → 23.5.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/init.js +56 -0
- data/app/assets/javascripts/govuk_publishing_components/components/copy-to-clipboard.js +16 -14
- data/app/assets/javascripts/govuk_publishing_components/components/details.js +38 -34
- data/app/assets/javascripts/govuk_publishing_components/components/print-link.js +8 -7
- data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/magna-charta.js +9 -8
- data/app/assets/javascripts/govuk_publishing_components/lib/initial-focus.js +13 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_input.scss +0 -46
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +5 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak.scss +4 -0
- data/app/views/govuk_publishing_components/components/_input.html.erb +6 -6
- data/app/views/govuk_publishing_components/components/docs/govspeak.yml +14 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/govuk-frontend/govuk/all.js +31 -37
- data/node_modules/govuk-frontend/govuk/components/accordion/README.md +1 -1
- data/node_modules/govuk-frontend/govuk/components/accordion/_index.scss +0 -1
- data/node_modules/govuk-frontend/govuk/components/accordion/fixtures.json +235 -0
- data/node_modules/govuk-frontend/govuk/components/back-link/_index.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/back-link/fixtures.json +56 -0
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/_index.scss +0 -1
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/fixtures.json +172 -0
- data/node_modules/govuk-frontend/govuk/components/button/_index.scss +3 -3
- data/node_modules/govuk-frontend/govuk/components/button/fixtures.json +275 -0
- data/node_modules/govuk-frontend/govuk/components/character-count/fixtures.json +170 -0
- data/node_modules/govuk-frontend/govuk/components/checkboxes/_index.scss +13 -13
- data/node_modules/govuk-frontend/govuk/components/checkboxes/fixtures.json +1015 -0
- data/node_modules/govuk-frontend/govuk/components/date-input/fixtures.json +499 -0
- data/node_modules/govuk-frontend/govuk/components/details/_index.scss +0 -1
- data/node_modules/govuk-frontend/govuk/components/details/fixtures.json +83 -0
- data/node_modules/govuk-frontend/govuk/components/error-message/fixtures.json +66 -0
- data/node_modules/govuk-frontend/govuk/components/error-summary/_index.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/error-summary/fixtures.json +181 -0
- data/node_modules/govuk-frontend/govuk/components/fieldset/_index.scss +1 -1
- data/node_modules/govuk-frontend/govuk/components/fieldset/fixtures.json +93 -0
- data/node_modules/govuk-frontend/govuk/components/fieldset/macro-options.json +6 -0
- data/node_modules/govuk-frontend/govuk/components/fieldset/template.njk +5 -1
- data/node_modules/govuk-frontend/govuk/components/file-upload/fixtures.json +151 -0
- data/node_modules/govuk-frontend/govuk/components/footer/_index.scss +0 -1
- data/node_modules/govuk-frontend/govuk/components/footer/fixtures.json +482 -0
- data/node_modules/govuk-frontend/govuk/components/header/_index.scss +2 -5
- data/node_modules/govuk-frontend/govuk/components/header/fixtures.json +360 -0
- data/node_modules/govuk-frontend/govuk/components/header/header.js +665 -316
- data/node_modules/govuk-frontend/govuk/components/header/macro-options.json +13 -1
- data/node_modules/govuk-frontend/govuk/components/header/template.njk +9 -5
- data/node_modules/govuk-frontend/govuk/components/hint/_index.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/hint/fixtures.json +50 -0
- data/node_modules/govuk-frontend/govuk/components/hint/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/input/_index.scss +91 -0
- data/node_modules/govuk-frontend/govuk/components/input/fixtures.json +538 -0
- data/node_modules/govuk-frontend/govuk/components/input/macro-options.json +64 -0
- data/node_modules/govuk-frontend/govuk/components/input/template.njk +17 -0
- data/node_modules/govuk-frontend/govuk/components/inset-text/fixtures.json +49 -0
- data/node_modules/govuk-frontend/govuk/components/label/fixtures.json +75 -0
- data/node_modules/govuk-frontend/govuk/components/panel/_index.scss +6 -2
- data/node_modules/govuk-frontend/govuk/components/panel/fixtures.json +74 -0
- data/node_modules/govuk-frontend/govuk/components/phase-banner/fixtures.json +65 -0
- data/node_modules/govuk-frontend/govuk/components/radios/_index.scss +13 -13
- data/node_modules/govuk-frontend/govuk/components/radios/fixtures.json +1066 -0
- data/node_modules/govuk-frontend/govuk/components/radios/macro-options.json +2 -2
- data/node_modules/govuk-frontend/govuk/components/select/_index.scss +0 -1
- data/node_modules/govuk-frontend/govuk/components/select/fixtures.json +248 -0
- data/node_modules/govuk-frontend/govuk/components/skip-link/fixtures.json +72 -0
- data/node_modules/govuk-frontend/govuk/components/summary-list/README.md +1 -1
- data/node_modules/govuk-frontend/govuk/components/summary-list/_index.scss +2 -10
- data/node_modules/govuk-frontend/govuk/components/summary-list/fixtures.json +991 -0
- data/node_modules/govuk-frontend/govuk/components/table/fixtures.json +468 -0
- data/node_modules/govuk-frontend/govuk/components/tabs/_index.scss +3 -6
- data/node_modules/govuk-frontend/govuk/components/tabs/fixtures.json +229 -0
- data/node_modules/govuk-frontend/govuk/components/tag/_index.scss +0 -1
- data/node_modules/govuk-frontend/govuk/components/tag/fixtures.json +117 -0
- data/node_modules/govuk-frontend/govuk/components/textarea/_index.scss +0 -1
- data/node_modules/govuk-frontend/govuk/components/textarea/fixtures.json +199 -0
- data/node_modules/govuk-frontend/govuk/components/warning-text/_index.scss +0 -1
- data/node_modules/govuk-frontend/govuk/components/warning-text/fixtures.json +68 -0
- data/node_modules/govuk-frontend/govuk/helpers/_device-pixels.scss +3 -3
- data/node_modules/govuk-frontend/govuk/helpers/_font-faces.scss +9 -11
- data/node_modules/govuk-frontend/govuk/helpers/_links.scss +1 -3
- data/node_modules/govuk-frontend/govuk/helpers/_media-queries.scss +1 -5
- data/node_modules/govuk-frontend/govuk/helpers/_spacing.scss +2 -1
- data/node_modules/govuk-frontend/govuk/helpers/_typography.scss +7 -6
- data/node_modules/govuk-frontend/govuk/objects/_form-group.scss +0 -1
- data/node_modules/govuk-frontend/govuk/objects/_grid.scss +2 -3
- data/node_modules/govuk-frontend/govuk/objects/_main-wrapper.scss +0 -1
- data/node_modules/govuk-frontend/govuk/overrides/_display.scss +1 -1
- data/node_modules/govuk-frontend/govuk/overrides/_width.scss +1 -0
- data/node_modules/govuk-frontend/govuk/settings/_colours-applied.scss +0 -3
- data/node_modules/govuk-frontend/govuk/settings/_colours-organisations.scss +3 -0
- data/node_modules/govuk-frontend/govuk/settings/_colours-palette.scss +9 -2
- data/node_modules/govuk-frontend/govuk/settings/_compatibility.scss +0 -1
- data/node_modules/govuk-frontend/govuk/settings/_measurements.scss +0 -4
- data/node_modules/govuk-frontend/govuk/settings/_typography-font-families.scss +2 -2
- data/node_modules/govuk-frontend/govuk/settings/_typography-font.scss +11 -5
- data/node_modules/govuk-frontend/govuk/settings/_typography-responsive.scss +6 -2
- data/node_modules/govuk-frontend/govuk/tools/_font-url.scss +0 -3
- data/node_modules/govuk-frontend/govuk/tools/_image-url.scss +0 -3
- data/node_modules/govuk-frontend/govuk/utilities/_visually-hidden.scss +0 -1
- data/node_modules/govuk-frontend/govuk/vendor/_sass-mq.scss +0 -4
- data/node_modules/govuk-frontend/package.json +1 -1
- metadata +33 -4
- data/app/assets/javascripts/govuk_publishing_components/analytics/init.js.erb +0 -50
- data/app/assets/javascripts/govuk_publishing_components/components/initial-focus.js +0 -12
@@ -6,7 +6,7 @@ See the [main README quick start guide](https://github.com/alphagov/govuk-fronte
|
|
6
6
|
|
7
7
|
## Guidance and Examples
|
8
8
|
|
9
|
-
Find out when to use the
|
9
|
+
Find out when to use the accordion component in your service in the [GOV.UK Design System](https://design-system.service.gov.uk/components/accordion).
|
10
10
|
|
11
11
|
## Component options
|
12
12
|
|
@@ -0,0 +1,235 @@
|
|
1
|
+
{
|
2
|
+
"component": "accordion",
|
3
|
+
"fixtures": [
|
4
|
+
{
|
5
|
+
"name": "default",
|
6
|
+
"options": {
|
7
|
+
"id": "default-example",
|
8
|
+
"items": [
|
9
|
+
{
|
10
|
+
"heading": {
|
11
|
+
"text": "Section A"
|
12
|
+
},
|
13
|
+
"content": {
|
14
|
+
"html": "<ul class=\"govuk-list govuk-list--bullet\">\n <li>Example item 1</li>\n</ul>\n"
|
15
|
+
}
|
16
|
+
},
|
17
|
+
{
|
18
|
+
"heading": {
|
19
|
+
"text": "Section B"
|
20
|
+
},
|
21
|
+
"content": {
|
22
|
+
"html": "<ul class=\"govuk-list govuk-list--bullet\">\n <li>Example item 2</li>\n</ul>\n"
|
23
|
+
}
|
24
|
+
}
|
25
|
+
]
|
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>"
|
28
|
+
},
|
29
|
+
{
|
30
|
+
"name": "with additional descriptions",
|
31
|
+
"options": {
|
32
|
+
"id": "with-descriptions",
|
33
|
+
"items": [
|
34
|
+
{
|
35
|
+
"heading": {
|
36
|
+
"text": "Test"
|
37
|
+
},
|
38
|
+
"summary": {
|
39
|
+
"text": "Additional description"
|
40
|
+
},
|
41
|
+
"content": {
|
42
|
+
"html": "<ul class=\"govuk-list govuk-list--bullet\">\n <li>Example item 1</li>\n</ul>\n"
|
43
|
+
}
|
44
|
+
},
|
45
|
+
{
|
46
|
+
"heading": {
|
47
|
+
"text": "Test 2"
|
48
|
+
},
|
49
|
+
"summary": {
|
50
|
+
"html": "<span class=\"govuk-!-font-weight-regular\">Additional description</span>"
|
51
|
+
},
|
52
|
+
"content": {
|
53
|
+
"html": "<ul class=\"govuk-list govuk-list--bullet\">\n <li>Example item 2</li>\n</ul>\n"
|
54
|
+
}
|
55
|
+
}
|
56
|
+
]
|
57
|
+
},
|
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
|
+
},
|
60
|
+
{
|
61
|
+
"name": "with one section open",
|
62
|
+
"options": {
|
63
|
+
"id": "one-section-open-example",
|
64
|
+
"items": [
|
65
|
+
{
|
66
|
+
"heading": {
|
67
|
+
"text": "Section A"
|
68
|
+
},
|
69
|
+
"expanded": true,
|
70
|
+
"content": {
|
71
|
+
"html": "<ul class=\"govuk-list govuk-list--bullet\">\n <li>Example item 1</li>\n</ul>\n"
|
72
|
+
}
|
73
|
+
},
|
74
|
+
{
|
75
|
+
"heading": {
|
76
|
+
"text": "Section B"
|
77
|
+
},
|
78
|
+
"content": {
|
79
|
+
"html": "<ul class=\"govuk-list govuk-list--bullet\">\n <li>Example item 2</li>\n</ul>\n"
|
80
|
+
}
|
81
|
+
}
|
82
|
+
]
|
83
|
+
},
|
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>"
|
85
|
+
},
|
86
|
+
{
|
87
|
+
"name": "with all sections already open",
|
88
|
+
"options": {
|
89
|
+
"id": "all-sections-open-example",
|
90
|
+
"items": [
|
91
|
+
{
|
92
|
+
"heading": {
|
93
|
+
"text": "Section A"
|
94
|
+
},
|
95
|
+
"expanded": true,
|
96
|
+
"content": {
|
97
|
+
"html": "<ul class=\"govuk-list govuk-list--bullet\">\n <li>Example item 1</li>\n</ul>\n"
|
98
|
+
}
|
99
|
+
},
|
100
|
+
{
|
101
|
+
"heading": {
|
102
|
+
"text": "Section B"
|
103
|
+
},
|
104
|
+
"expanded": true,
|
105
|
+
"content": {
|
106
|
+
"html": "<ul class=\"govuk-list govuk-list--bullet\">\n <li>Example item 2</li>\n</ul>\n"
|
107
|
+
}
|
108
|
+
}
|
109
|
+
]
|
110
|
+
},
|
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>"
|
112
|
+
},
|
113
|
+
{
|
114
|
+
"name": "with focusable elements inside",
|
115
|
+
"options": {
|
116
|
+
"id": "with-focusable-elements",
|
117
|
+
"items": [
|
118
|
+
{
|
119
|
+
"heading": {
|
120
|
+
"text": "Section A"
|
121
|
+
},
|
122
|
+
"content": {
|
123
|
+
"html": "<a class=\"govuk-link\" href=\"#\">Link A</a>"
|
124
|
+
}
|
125
|
+
},
|
126
|
+
{
|
127
|
+
"heading": {
|
128
|
+
"text": "Section B"
|
129
|
+
},
|
130
|
+
"content": {
|
131
|
+
"html": "<a class=\"govuk-link\" href=\"#\">Link B</a>"
|
132
|
+
}
|
133
|
+
}
|
134
|
+
]
|
135
|
+
},
|
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>"
|
137
|
+
},
|
138
|
+
{
|
139
|
+
"name": "classes",
|
140
|
+
"options": {
|
141
|
+
"classes": "myClass",
|
142
|
+
"items": [
|
143
|
+
{
|
144
|
+
"heading": {
|
145
|
+
"text": "Section A"
|
146
|
+
},
|
147
|
+
"content": {
|
148
|
+
"text": "Some content"
|
149
|
+
}
|
150
|
+
}
|
151
|
+
]
|
152
|
+
},
|
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>"
|
154
|
+
},
|
155
|
+
{
|
156
|
+
"name": "attributes",
|
157
|
+
"options": {
|
158
|
+
"attributes": {
|
159
|
+
"data-attribute": "value"
|
160
|
+
},
|
161
|
+
"items": [
|
162
|
+
{
|
163
|
+
"heading": {
|
164
|
+
"text": "Section A"
|
165
|
+
},
|
166
|
+
"content": {
|
167
|
+
"text": "Some content"
|
168
|
+
}
|
169
|
+
}
|
170
|
+
]
|
171
|
+
},
|
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>"
|
173
|
+
},
|
174
|
+
{
|
175
|
+
"name": "custom heading level",
|
176
|
+
"options": {
|
177
|
+
"headingLevel": 3,
|
178
|
+
"items": [
|
179
|
+
{
|
180
|
+
"heading": {
|
181
|
+
"text": "Section A"
|
182
|
+
},
|
183
|
+
"content": {
|
184
|
+
"text": "Some content"
|
185
|
+
}
|
186
|
+
}
|
187
|
+
]
|
188
|
+
},
|
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>"
|
190
|
+
},
|
191
|
+
{
|
192
|
+
"name": "heading html",
|
193
|
+
"options": {
|
194
|
+
"items": [
|
195
|
+
{
|
196
|
+
"heading": {
|
197
|
+
"html": "<span class=\"myClass\">Section A</span>"
|
198
|
+
},
|
199
|
+
"content": {
|
200
|
+
"text": "Some content"
|
201
|
+
}
|
202
|
+
}
|
203
|
+
]
|
204
|
+
},
|
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>"
|
206
|
+
},
|
207
|
+
{
|
208
|
+
"name": "with falsey values",
|
209
|
+
"options": {
|
210
|
+
"items": [
|
211
|
+
{
|
212
|
+
"heading": {
|
213
|
+
"text": "Section A"
|
214
|
+
},
|
215
|
+
"content": {
|
216
|
+
"text": "Some content"
|
217
|
+
}
|
218
|
+
},
|
219
|
+
false,
|
220
|
+
"",
|
221
|
+
null,
|
222
|
+
{
|
223
|
+
"heading": {
|
224
|
+
"text": "Section B"
|
225
|
+
},
|
226
|
+
"content": {
|
227
|
+
"text": "Some content"
|
228
|
+
}
|
229
|
+
}
|
230
|
+
]
|
231
|
+
},
|
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>"
|
233
|
+
}
|
234
|
+
]
|
235
|
+
}
|
@@ -0,0 +1,56 @@
|
|
1
|
+
{
|
2
|
+
"component": "back-link",
|
3
|
+
"fixtures": [
|
4
|
+
{
|
5
|
+
"name": "default",
|
6
|
+
"options": {
|
7
|
+
"href": "#"
|
8
|
+
},
|
9
|
+
"html": "<a href=\"#\" class=\"govuk-back-link\">Back</a>"
|
10
|
+
},
|
11
|
+
{
|
12
|
+
"name": "with custom text",
|
13
|
+
"options": {
|
14
|
+
"href": "#",
|
15
|
+
"text": "Back to home"
|
16
|
+
},
|
17
|
+
"html": "<a href=\"#\" class=\"govuk-back-link\">Back to home</a>"
|
18
|
+
},
|
19
|
+
{
|
20
|
+
"name": "classes",
|
21
|
+
"options": {
|
22
|
+
"classes": "app-back-link--custom-class",
|
23
|
+
"href": "#"
|
24
|
+
},
|
25
|
+
"html": "<a href=\"#\" class=\"govuk-back-link app-back-link--custom-class\">Back</a>"
|
26
|
+
},
|
27
|
+
{
|
28
|
+
"name": "html as text",
|
29
|
+
"options": {
|
30
|
+
"text": "<b>Home</b>",
|
31
|
+
"href": "#"
|
32
|
+
},
|
33
|
+
"html": "<a href=\"#\" class=\"govuk-back-link\"><b>Home</b></a>"
|
34
|
+
},
|
35
|
+
{
|
36
|
+
"name": "html",
|
37
|
+
"options": {
|
38
|
+
"html": "<b>Back</b>",
|
39
|
+
"href": "#"
|
40
|
+
},
|
41
|
+
"html": "<a href=\"#\" class=\"govuk-back-link\"><b>Back</b></a>"
|
42
|
+
},
|
43
|
+
{
|
44
|
+
"name": "attributes",
|
45
|
+
"options": {
|
46
|
+
"href": "#",
|
47
|
+
"html": "<b>Back to home</b>",
|
48
|
+
"attributes": {
|
49
|
+
"data-test": "attribute",
|
50
|
+
"aria-label": "Back to home"
|
51
|
+
}
|
52
|
+
},
|
53
|
+
"html": "<a href=\"#\" class=\"govuk-back-link\" data-test=\"attribute\" aria-label=\"Back to home\"><b>Back to home</b></a>"
|
54
|
+
}
|
55
|
+
]
|
56
|
+
}
|
@@ -0,0 +1,172 @@
|
|
1
|
+
{
|
2
|
+
"component": "breadcrumbs",
|
3
|
+
"fixtures": [
|
4
|
+
{
|
5
|
+
"name": "default",
|
6
|
+
"options": {
|
7
|
+
"items": [
|
8
|
+
{
|
9
|
+
"text": "Section",
|
10
|
+
"href": "/section"
|
11
|
+
},
|
12
|
+
{
|
13
|
+
"text": "Sub-section",
|
14
|
+
"href": "/section/sub-section"
|
15
|
+
}
|
16
|
+
]
|
17
|
+
},
|
18
|
+
"html": "<div class=\"govuk-breadcrumbs \">\n <ol class=\"govuk-breadcrumbs__list\">\n \n \n <li class=\"govuk-breadcrumbs__list-item\">\n <a class=\"govuk-breadcrumbs__link\" href=\"/section\">Section</a>\n </li>\n \n \n \n <li class=\"govuk-breadcrumbs__list-item\">\n <a class=\"govuk-breadcrumbs__link\" href=\"/section/sub-section\">Sub-section</a>\n </li>\n \n \n </ol>\n</div>"
|
19
|
+
},
|
20
|
+
{
|
21
|
+
"name": "with one level",
|
22
|
+
"options": {
|
23
|
+
"items": [
|
24
|
+
{
|
25
|
+
"text": "Section",
|
26
|
+
"href": "/section"
|
27
|
+
}
|
28
|
+
]
|
29
|
+
},
|
30
|
+
"html": "<div class=\"govuk-breadcrumbs \">\n <ol class=\"govuk-breadcrumbs__list\">\n \n \n <li class=\"govuk-breadcrumbs__list-item\">\n <a class=\"govuk-breadcrumbs__link\" href=\"/section\">Section</a>\n </li>\n \n \n </ol>\n</div>"
|
31
|
+
},
|
32
|
+
{
|
33
|
+
"name": "with multiple levels",
|
34
|
+
"options": {
|
35
|
+
"items": [
|
36
|
+
{
|
37
|
+
"text": "Home",
|
38
|
+
"href": "/"
|
39
|
+
},
|
40
|
+
{
|
41
|
+
"text": "Section",
|
42
|
+
"href": "/section"
|
43
|
+
},
|
44
|
+
{
|
45
|
+
"text": "Sub-section",
|
46
|
+
"href": "/section/sub-section"
|
47
|
+
},
|
48
|
+
{
|
49
|
+
"text": "Sub Sub-section",
|
50
|
+
"href": "/section/sub-section/sub-sub-section"
|
51
|
+
}
|
52
|
+
]
|
53
|
+
},
|
54
|
+
"html": "<div class=\"govuk-breadcrumbs \">\n <ol class=\"govuk-breadcrumbs__list\">\n \n \n <li class=\"govuk-breadcrumbs__list-item\">\n <a class=\"govuk-breadcrumbs__link\" href=\"/\">Home</a>\n </li>\n \n \n \n <li class=\"govuk-breadcrumbs__list-item\">\n <a class=\"govuk-breadcrumbs__link\" href=\"/section\">Section</a>\n </li>\n \n \n \n <li class=\"govuk-breadcrumbs__list-item\">\n <a class=\"govuk-breadcrumbs__link\" href=\"/section/sub-section\">Sub-section</a>\n </li>\n \n \n \n <li class=\"govuk-breadcrumbs__list-item\">\n <a class=\"govuk-breadcrumbs__link\" href=\"/section/sub-section/sub-sub-section\">Sub Sub-section</a>\n </li>\n \n \n </ol>\n</div>"
|
55
|
+
},
|
56
|
+
{
|
57
|
+
"name": "without the home section",
|
58
|
+
"options": {
|
59
|
+
"items": [
|
60
|
+
{
|
61
|
+
"text": "Service Manual",
|
62
|
+
"href": "/service-manual"
|
63
|
+
},
|
64
|
+
{
|
65
|
+
"text": "Agile Delivery",
|
66
|
+
"href": "/service-manual/agile-delivery"
|
67
|
+
}
|
68
|
+
]
|
69
|
+
},
|
70
|
+
"html": "<div class=\"govuk-breadcrumbs \">\n <ol class=\"govuk-breadcrumbs__list\">\n \n \n <li class=\"govuk-breadcrumbs__list-item\">\n <a class=\"govuk-breadcrumbs__link\" href=\"/service-manual\">Service Manual</a>\n </li>\n \n \n \n <li class=\"govuk-breadcrumbs__list-item\">\n <a class=\"govuk-breadcrumbs__link\" href=\"/service-manual/agile-delivery\">Agile Delivery</a>\n </li>\n \n \n </ol>\n</div>"
|
71
|
+
},
|
72
|
+
{
|
73
|
+
"name": "with last breadcrumb as current page",
|
74
|
+
"options": {
|
75
|
+
"items": [
|
76
|
+
{
|
77
|
+
"text": "Home",
|
78
|
+
"href": "/"
|
79
|
+
},
|
80
|
+
{
|
81
|
+
"text": "Passports, travel and living abroad",
|
82
|
+
"href": "/browse/abroad"
|
83
|
+
},
|
84
|
+
{
|
85
|
+
"text": "Travel abroad"
|
86
|
+
}
|
87
|
+
]
|
88
|
+
},
|
89
|
+
"html": "<div class=\"govuk-breadcrumbs \">\n <ol class=\"govuk-breadcrumbs__list\">\n \n \n <li class=\"govuk-breadcrumbs__list-item\">\n <a class=\"govuk-breadcrumbs__link\" href=\"/\">Home</a>\n </li>\n \n \n \n <li class=\"govuk-breadcrumbs__list-item\">\n <a class=\"govuk-breadcrumbs__link\" href=\"/browse/abroad\">Passports, travel and living abroad</a>\n </li>\n \n \n \n <li class=\"govuk-breadcrumbs__list-item\" aria-current=\"page\">Travel abroad</li>\n \n \n </ol>\n</div>"
|
90
|
+
},
|
91
|
+
{
|
92
|
+
"name": "with collapse on mobile",
|
93
|
+
"options": {
|
94
|
+
"collapseOnMobile": true,
|
95
|
+
"items": [
|
96
|
+
{
|
97
|
+
"text": "Home",
|
98
|
+
"href": "/"
|
99
|
+
},
|
100
|
+
{
|
101
|
+
"text": "Education, training and skills",
|
102
|
+
"href": "/education"
|
103
|
+
},
|
104
|
+
{
|
105
|
+
"text": "Special educational needs and disability (SEND) and high needs",
|
106
|
+
"href": "/education/special-educational-needs-and-disability-send-and-high-needs"
|
107
|
+
}
|
108
|
+
]
|
109
|
+
},
|
110
|
+
"html": "<div class=\"govuk-breadcrumbs govuk-breadcrumbs--collapse-on-mobile\">\n <ol class=\"govuk-breadcrumbs__list\">\n \n \n <li class=\"govuk-breadcrumbs__list-item\">\n <a class=\"govuk-breadcrumbs__link\" href=\"/\">Home</a>\n </li>\n \n \n \n <li class=\"govuk-breadcrumbs__list-item\">\n <a class=\"govuk-breadcrumbs__link\" href=\"/education\">Education, training and skills</a>\n </li>\n \n \n \n <li class=\"govuk-breadcrumbs__list-item\">\n <a class=\"govuk-breadcrumbs__link\" href=\"/education/special-educational-needs-and-disability-send-and-high-needs\">Special educational needs and disability (SEND) and high needs</a>\n </li>\n \n \n </ol>\n</div>"
|
111
|
+
},
|
112
|
+
{
|
113
|
+
"name": "classes",
|
114
|
+
"options": {
|
115
|
+
"classes": "app-breadcrumbs--custom-modifier"
|
116
|
+
},
|
117
|
+
"html": "<div class=\"govuk-breadcrumbs app-breadcrumbs--custom-modifier\">\n <ol class=\"govuk-breadcrumbs__list\">\n \n </ol>\n</div>"
|
118
|
+
},
|
119
|
+
{
|
120
|
+
"name": "attributes",
|
121
|
+
"options": {
|
122
|
+
"attributes": {
|
123
|
+
"id": "my-navigation",
|
124
|
+
"role": "navigation"
|
125
|
+
}
|
126
|
+
},
|
127
|
+
"html": "<div class=\"govuk-breadcrumbs \" id=\"my-navigation\" role=\"navigation\">\n <ol class=\"govuk-breadcrumbs__list\">\n \n </ol>\n</div>"
|
128
|
+
},
|
129
|
+
{
|
130
|
+
"name": "item attributes",
|
131
|
+
"options": {
|
132
|
+
"items": [
|
133
|
+
{
|
134
|
+
"text": "Section 1",
|
135
|
+
"href": "/section",
|
136
|
+
"attributes": {
|
137
|
+
"data-attribute": "my-attribute",
|
138
|
+
"data-attribute-2": "my-attribute-2"
|
139
|
+
}
|
140
|
+
}
|
141
|
+
]
|
142
|
+
},
|
143
|
+
"html": "<div class=\"govuk-breadcrumbs \">\n <ol class=\"govuk-breadcrumbs__list\">\n \n \n <li class=\"govuk-breadcrumbs__list-item\">\n <a class=\"govuk-breadcrumbs__link\" href=\"/section\" data-attribute=\"my-attribute\" data-attribute-2=\"my-attribute-2\">Section 1</a>\n </li>\n \n \n </ol>\n</div>"
|
144
|
+
},
|
145
|
+
{
|
146
|
+
"name": "html as text",
|
147
|
+
"options": {
|
148
|
+
"items": [
|
149
|
+
{
|
150
|
+
"text": "<span>Section 1</span>"
|
151
|
+
}
|
152
|
+
]
|
153
|
+
},
|
154
|
+
"html": "<div class=\"govuk-breadcrumbs \">\n <ol class=\"govuk-breadcrumbs__list\">\n \n \n <li class=\"govuk-breadcrumbs__list-item\" aria-current=\"page\"><span>Section 1</span></li>\n \n \n </ol>\n</div>"
|
155
|
+
},
|
156
|
+
{
|
157
|
+
"name": "html",
|
158
|
+
"options": {
|
159
|
+
"items": [
|
160
|
+
{
|
161
|
+
"html": "<em>Section 1</em>"
|
162
|
+
},
|
163
|
+
{
|
164
|
+
"html": "<em>Section 2</em>",
|
165
|
+
"href": "/section-2"
|
166
|
+
}
|
167
|
+
]
|
168
|
+
},
|
169
|
+
"html": "<div class=\"govuk-breadcrumbs \">\n <ol class=\"govuk-breadcrumbs__list\">\n \n \n <li class=\"govuk-breadcrumbs__list-item\" aria-current=\"page\"><em>Section 1</em></li>\n \n \n \n <li class=\"govuk-breadcrumbs__list-item\">\n <a class=\"govuk-breadcrumbs__link\" href=\"/section-2\"><em>Section 2</em></a>\n </li>\n \n \n </ol>\n</div>"
|
170
|
+
}
|
171
|
+
]
|
172
|
+
}
|