govuk_publishing_components 12.20.0 → 12.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss +8 -0
- data/app/views/govuk_publishing_components/components/_contextual_breadcrumbs.html.erb +8 -8
- data/app/views/govuk_publishing_components/components/_contextual_footer.html.erb +10 -0
- data/app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb +5 -14
- data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +5 -3
- data/app/views/govuk_publishing_components/components/_related_navigation.html.erb +10 -6
- data/app/views/govuk_publishing_components/components/docs/contextual_breadcrumbs.yml +3 -2
- data/app/views/govuk_publishing_components/components/docs/contextual_footer.yml +71 -0
- data/app/views/govuk_publishing_components/components/docs/contextual_sidebar.yml +18 -9
- data/app/views/govuk_publishing_components/components/docs/layout_footer.yml +17 -0
- data/app/views/govuk_publishing_components/components/docs/related_navigation.yml +53 -0
- data/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb +10 -5
- data/config/locales/en.yml +5 -6
- data/lib/govuk_publishing_components.rb +0 -2
- data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +0 -4
- data/lib/govuk_publishing_components/presenters/related_navigation_helper.rb +108 -90
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/govuk-frontend/components/back-link/README.md +4 -73
- data/node_modules/govuk-frontend/components/breadcrumbs/README.md +4 -238
- data/node_modules/govuk-frontend/components/button/README.md +4 -174
- data/node_modules/govuk-frontend/components/character-count/README.md +4 -340
- data/node_modules/govuk-frontend/components/character-count/template.njk +0 -3
- data/node_modules/govuk-frontend/components/checkboxes/README.md +4 -705
- data/node_modules/govuk-frontend/components/checkboxes/template.njk +1 -0
- data/node_modules/govuk-frontend/components/date-input/README.md +4 -563
- data/node_modules/govuk-frontend/components/date-input/template.njk +1 -0
- data/node_modules/govuk-frontend/components/details/README.md +4 -128
- data/node_modules/govuk-frontend/components/error-message/README.md +4 -58
- data/node_modules/govuk-frontend/components/error-summary/README.md +4 -94
- data/node_modules/govuk-frontend/components/fieldset/README.md +4 -92
- data/node_modules/govuk-frontend/components/file-upload/README.md +4 -199
- data/node_modules/govuk-frontend/components/file-upload/template.njk +1 -0
- data/node_modules/govuk-frontend/components/footer/README.md +4 -91
- data/node_modules/govuk-frontend/components/footer/_footer.scss +22 -13
- data/node_modules/govuk-frontend/components/header/README.md +4 -351
- data/node_modules/govuk-frontend/components/hint/README.md +5 -77
- data/node_modules/govuk-frontend/components/input/README.md +4 -407
- data/node_modules/govuk-frontend/components/input/template.njk +1 -0
- data/node_modules/govuk-frontend/components/inset-text/README.md +4 -76
- data/node_modules/govuk-frontend/components/label/README.md +5 -97
- data/node_modules/govuk-frontend/components/panel/README.md +4 -93
- data/node_modules/govuk-frontend/components/phase-banner/README.md +4 -67
- data/node_modules/govuk-frontend/components/radios/README.md +4 -665
- data/node_modules/govuk-frontend/components/radios/template.njk +1 -0
- data/node_modules/govuk-frontend/components/select/README.md +4 -257
- data/node_modules/govuk-frontend/components/select/template.njk +1 -0
- data/node_modules/govuk-frontend/components/skip-link/README.md +4 -57
- data/node_modules/govuk-frontend/components/table/README.md +4 -368
- data/node_modules/govuk-frontend/components/tabs/README.md +4 -242
- data/node_modules/govuk-frontend/components/tag/README.md +4 -77
- data/node_modules/govuk-frontend/components/textarea/README.md +4 -193
- data/node_modules/govuk-frontend/components/textarea/template.njk +1 -0
- data/node_modules/govuk-frontend/components/warning-text/README.md +4 -63
- data/node_modules/govuk-frontend/components/warning-text/_warning-text.scss +1 -2
- data/node_modules/govuk-frontend/core/_lists.scss +17 -8
- data/node_modules/govuk-frontend/package.json +10 -10
- metadata +4 -5
- data/app/views/govuk_publishing_components/components/_taxonomy_navigation.html.erb +0 -116
- data/app/views/govuk_publishing_components/components/docs/taxonomy_navigation.yml +0 -119
- data/lib/govuk_publishing_components/presenters/taxonomy_navigation.rb +0 -47
@@ -1,253 +1,15 @@
|
|
1
1
|
# Tabs
|
2
2
|
|
3
|
-
##
|
3
|
+
## Installation
|
4
4
|
|
5
|
-
|
5
|
+
See the [main README quick start guide](https://github.com/alphagov/govuk-frontend#quick-start) for how to install this component.
|
6
6
|
|
7
|
-
## Guidance
|
7
|
+
## Guidance and Examples
|
8
8
|
|
9
9
|
Find out when to use the tabs component in your service in the [GOV.UK Design System](https://design-system.service.gov.uk/components/tabs).
|
10
10
|
|
11
|
-
## Quick start examples
|
12
|
-
|
13
|
-
### Tabs
|
14
|
-
|
15
|
-
[Preview this example in the Frontend review app](http://govuk-frontend-review.herokuapp.com/components/tabs/preview)
|
16
|
-
|
17
|
-
#### Markup
|
18
|
-
|
19
|
-
<div class="govuk-tabs" data-module="tabs">
|
20
|
-
<h2 class="govuk-tabs__title">
|
21
|
-
Contents
|
22
|
-
</h2>
|
23
|
-
|
24
|
-
<ul class="govuk-tabs__list">
|
25
|
-
|
26
|
-
<li class="govuk-tabs__list-item">
|
27
|
-
<a class="govuk-tabs__tab govuk-tabs__tab--selected" href="#past-day">
|
28
|
-
Past day
|
29
|
-
</a>
|
30
|
-
</li>
|
31
|
-
|
32
|
-
<li class="govuk-tabs__list-item">
|
33
|
-
<a class="govuk-tabs__tab" href="#past-week">
|
34
|
-
Past week
|
35
|
-
</a>
|
36
|
-
</li>
|
37
|
-
|
38
|
-
<li class="govuk-tabs__list-item">
|
39
|
-
<a class="govuk-tabs__tab" href="#past-month">
|
40
|
-
Past month
|
41
|
-
</a>
|
42
|
-
</li>
|
43
|
-
|
44
|
-
<li class="govuk-tabs__list-item">
|
45
|
-
<a class="govuk-tabs__tab" href="#past-year">
|
46
|
-
Past year
|
47
|
-
</a>
|
48
|
-
</li>
|
49
|
-
|
50
|
-
</ul>
|
51
|
-
|
52
|
-
<section class="govuk-tabs__panel" id="past-day">
|
53
|
-
<h2 class="govuk-heading-l">Past day</h2>
|
54
|
-
<table class="govuk-table">
|
55
|
-
<thead class="govuk-table__head">
|
56
|
-
<tr class="govuk-table__row">
|
57
|
-
<th class="govuk-table__header" scope="col">Case manager</th>
|
58
|
-
<th class="govuk-table__header" scope="col">Cases opened</th>
|
59
|
-
<th class="govuk-table__header" scope="col">Cases closed</th>
|
60
|
-
</tr>
|
61
|
-
</thead>
|
62
|
-
<tbody class="govuk-table__body">
|
63
|
-
<tr class="govuk-table__row">
|
64
|
-
<td class="govuk-table__cell">David Francis</td>
|
65
|
-
<td class="govuk-table__cell">3</td>
|
66
|
-
<td class="govuk-table__cell">0</td>
|
67
|
-
</tr>
|
68
|
-
<tr class="govuk-table__row">
|
69
|
-
<td class="govuk-table__cell">Paul Farmer</td>
|
70
|
-
<td class="govuk-table__cell">1</td>
|
71
|
-
<td class="govuk-table__cell">0</td>
|
72
|
-
</tr>
|
73
|
-
<tr class="govuk-table__row">
|
74
|
-
<td class="govuk-table__cell">Rita Patel</td>
|
75
|
-
<td class="govuk-table__cell">2</td>
|
76
|
-
<td class="govuk-table__cell">0</td>
|
77
|
-
</tr>
|
78
|
-
</tbody>
|
79
|
-
</table>
|
80
|
-
|
81
|
-
</section>
|
82
|
-
|
83
|
-
<section class="govuk-tabs__panel govuk-tabs__panel--hidden" id="past-week">
|
84
|
-
<h2 class="govuk-heading-l">Past week</h2>
|
85
|
-
<table class="govuk-table">
|
86
|
-
<thead class="govuk-table__head">
|
87
|
-
<tr class="govuk-table__row">
|
88
|
-
<th class="govuk-table__header" scope="col">Case manager</th>
|
89
|
-
<th class="govuk-table__header" scope="col">Cases opened</th>
|
90
|
-
<th class="govuk-table__header" scope="col">Cases closed</th>
|
91
|
-
</tr>
|
92
|
-
</thead>
|
93
|
-
<tbody class="govuk-table__body">
|
94
|
-
<tr class="govuk-table__row">
|
95
|
-
<td class="govuk-table__cell">David Francis</td>
|
96
|
-
<td class="govuk-table__cell">24</td>
|
97
|
-
<td class="govuk-table__cell">18</td>
|
98
|
-
</tr>
|
99
|
-
<tr class="govuk-table__row">
|
100
|
-
<td class="govuk-table__cell">Paul Farmer</td>
|
101
|
-
<td class="govuk-table__cell">16</td>
|
102
|
-
<td class="govuk-table__cell">20</td>
|
103
|
-
</tr>
|
104
|
-
<tr class="govuk-table__row">
|
105
|
-
<td class="govuk-table__cell">Rita Patel</td>
|
106
|
-
<td class="govuk-table__cell">24</td>
|
107
|
-
<td class="govuk-table__cell">27</td>
|
108
|
-
</tr>
|
109
|
-
</tbody>
|
110
|
-
</table>
|
111
|
-
|
112
|
-
</section>
|
113
|
-
|
114
|
-
<section class="govuk-tabs__panel govuk-tabs__panel--hidden" id="past-month">
|
115
|
-
<h2 class="govuk-heading-l">Past month</h2>
|
116
|
-
<table class="govuk-table">
|
117
|
-
<thead class="govuk-table__head">
|
118
|
-
<tr class="govuk-table__row">
|
119
|
-
<th class="govuk-table__header" scope="col">Case manager</th>
|
120
|
-
<th class="govuk-table__header" scope="col">Cases opened</th>
|
121
|
-
<th class="govuk-table__header" scope="col">Cases closed</th>
|
122
|
-
</tr>
|
123
|
-
</thead>
|
124
|
-
<tbody class="govuk-table__body">
|
125
|
-
<tr class="govuk-table__row">
|
126
|
-
<td class="govuk-table__cell">David Francis</td>
|
127
|
-
<td class="govuk-table__cell">98</td>
|
128
|
-
<td class="govuk-table__cell">95</td>
|
129
|
-
</tr>
|
130
|
-
<tr class="govuk-table__row">
|
131
|
-
<td class="govuk-table__cell">Paul Farmer</td>
|
132
|
-
<td class="govuk-table__cell">122</td>
|
133
|
-
<td class="govuk-table__cell">131</td>
|
134
|
-
</tr>
|
135
|
-
<tr class="govuk-table__row">
|
136
|
-
<td class="govuk-table__cell">Rita Patel</td>
|
137
|
-
<td class="govuk-table__cell">126</td>
|
138
|
-
<td class="govuk-table__cell">142</td>
|
139
|
-
</tr>
|
140
|
-
</tbody>
|
141
|
-
</table>
|
142
|
-
|
143
|
-
</section>
|
144
|
-
|
145
|
-
<section class="govuk-tabs__panel govuk-tabs__panel--hidden" id="past-year">
|
146
|
-
<h2 class="govuk-heading-l">Past year</h2>
|
147
|
-
<table class="govuk-table">
|
148
|
-
<thead class="govuk-table__head">
|
149
|
-
<tr class="govuk-table__row">
|
150
|
-
<th class="govuk-table__header" scope="col">Case manager</th>
|
151
|
-
<th class="govuk-table__header" scope="col">Cases opened</th>
|
152
|
-
<th class="govuk-table__header" scope="col">Cases closed</th>
|
153
|
-
</tr>
|
154
|
-
</thead>
|
155
|
-
<tbody class="govuk-table__body">
|
156
|
-
<tr class="govuk-table__row">
|
157
|
-
<td class="govuk-table__cell">David Francis</td>
|
158
|
-
<td class="govuk-table__cell">1380</td>
|
159
|
-
<td class="govuk-table__cell">1472</td>
|
160
|
-
</tr>
|
161
|
-
<tr class="govuk-table__row">
|
162
|
-
<td class="govuk-table__cell">Paul Farmer</td>
|
163
|
-
<td class="govuk-table__cell">1129</td>
|
164
|
-
<td class="govuk-table__cell">1083</td>
|
165
|
-
</tr>
|
166
|
-
<tr class="govuk-table__row">
|
167
|
-
<td class="govuk-table__cell">Rita Patel</td>
|
168
|
-
<td class="govuk-table__cell">1539</td>
|
169
|
-
<td class="govuk-table__cell">1265</td>
|
170
|
-
</tr>
|
171
|
-
</tbody>
|
172
|
-
</table>
|
173
|
-
|
174
|
-
</section>
|
175
|
-
|
176
|
-
</div>
|
177
|
-
|
178
|
-
#### Macro
|
179
|
-
|
180
|
-
{% from "tabs/macro.njk" import govukTabs %}
|
181
|
-
|
182
|
-
{{ govukTabs({
|
183
|
-
"items": [
|
184
|
-
{
|
185
|
-
"label": "Past day",
|
186
|
-
"id": "past-day",
|
187
|
-
"panel": {
|
188
|
-
"html": "<h2 class=\"govuk-heading-l\">Past day</h2>\n<table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <th class=\"govuk-table__header\" scope=\"col\">Case manager</th>\n <th class=\"govuk-table__header\" scope=\"col\">Cases opened</th>\n <th class=\"govuk-table__header\" scope=\"col\">Cases closed</th>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__cell\">David Francis</td>\n <td class=\"govuk-table__cell\">3</td>\n <td class=\"govuk-table__cell\">0</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__cell\">Paul Farmer</td>\n <td class=\"govuk-table__cell\">1</td>\n <td class=\"govuk-table__cell\">0</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__cell\">Rita Patel</td>\n <td class=\"govuk-table__cell\">2</td>\n <td class=\"govuk-table__cell\">0</td>\n </tr>\n </tbody>\n</table>\n"
|
189
|
-
}
|
190
|
-
},
|
191
|
-
{
|
192
|
-
"label": "Past week",
|
193
|
-
"id": "past-week",
|
194
|
-
"panel": {
|
195
|
-
"html": "<h2 class=\"govuk-heading-l\">Past week</h2>\n<table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <th class=\"govuk-table__header\" scope=\"col\">Case manager</th>\n <th class=\"govuk-table__header\" scope=\"col\">Cases opened</th>\n <th class=\"govuk-table__header\" scope=\"col\">Cases closed</th>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__cell\">David Francis</td>\n <td class=\"govuk-table__cell\">24</td>\n <td class=\"govuk-table__cell\">18</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__cell\">Paul Farmer</td>\n <td class=\"govuk-table__cell\">16</td>\n <td class=\"govuk-table__cell\">20</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__cell\">Rita Patel</td>\n <td class=\"govuk-table__cell\">24</td>\n <td class=\"govuk-table__cell\">27</td>\n </tr>\n </tbody>\n</table>\n"
|
196
|
-
}
|
197
|
-
},
|
198
|
-
{
|
199
|
-
"label": "Past month",
|
200
|
-
"id": "past-month",
|
201
|
-
"panel": {
|
202
|
-
"html": "<h2 class=\"govuk-heading-l\">Past month</h2>\n<table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <th class=\"govuk-table__header\" scope=\"col\">Case manager</th>\n <th class=\"govuk-table__header\" scope=\"col\">Cases opened</th>\n <th class=\"govuk-table__header\" scope=\"col\">Cases closed</th>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__cell\">David Francis</td>\n <td class=\"govuk-table__cell\">98</td>\n <td class=\"govuk-table__cell\">95</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__cell\">Paul Farmer</td>\n <td class=\"govuk-table__cell\">122</td>\n <td class=\"govuk-table__cell\">131</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__cell\">Rita Patel</td>\n <td class=\"govuk-table__cell\">126</td>\n <td class=\"govuk-table__cell\">142</td>\n </tr>\n </tbody>\n</table>\n"
|
203
|
-
}
|
204
|
-
},
|
205
|
-
{
|
206
|
-
"label": "Past year",
|
207
|
-
"id": "past-year",
|
208
|
-
"panel": {
|
209
|
-
"html": "<h2 class=\"govuk-heading-l\">Past year</h2>\n<table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <th class=\"govuk-table__header\" scope=\"col\">Case manager</th>\n <th class=\"govuk-table__header\" scope=\"col\">Cases opened</th>\n <th class=\"govuk-table__header\" scope=\"col\">Cases closed</th>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__cell\">David Francis</td>\n <td class=\"govuk-table__cell\">1380</td>\n <td class=\"govuk-table__cell\">1472</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__cell\">Paul Farmer</td>\n <td class=\"govuk-table__cell\">1129</td>\n <td class=\"govuk-table__cell\">1083</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <td class=\"govuk-table__cell\">Rita Patel</td>\n <td class=\"govuk-table__cell\">1539</td>\n <td class=\"govuk-table__cell\">1265</td>\n </tr>\n </tbody>\n</table>\n"
|
210
|
-
}
|
211
|
-
}
|
212
|
-
]
|
213
|
-
}) }}
|
214
|
-
|
215
|
-
## Requirements
|
216
|
-
|
217
|
-
### Build tool configuration
|
218
|
-
|
219
|
-
When compiling the Sass files you'll need to define includePaths to reference the node_modules directory. Below is a sample configuration using gulp
|
220
|
-
|
221
|
-
.pipe(sass({
|
222
|
-
includePaths: 'node_modules/'
|
223
|
-
}))
|
224
|
-
|
225
|
-
### Static asset path configuration
|
226
|
-
|
227
|
-
In order to include the images used in the components, you need to configure your app to show these assets. Below is a sample configuration using Express js:
|
228
|
-
|
229
|
-
app.use('/assets', express.static(path.join(__dirname, '/node_modules/govuk-frontend/assets')))
|
230
|
-
|
231
11
|
## Component options
|
232
12
|
|
233
13
|
Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
|
234
14
|
|
235
|
-
See [options table](https://design-system.service.gov.uk/components/tabs/#options-example-default) for details.
|
236
|
-
|
237
|
-
### Setting up Nunjucks views and paths
|
238
|
-
|
239
|
-
Below is an example setup using express configure views:
|
240
|
-
|
241
|
-
nunjucks.configure('node_modules/govuk-frontend/components', {
|
242
|
-
autoescape: true,
|
243
|
-
cache: false,
|
244
|
-
express: app
|
245
|
-
})
|
246
|
-
|
247
|
-
## Contribution
|
248
|
-
|
249
|
-
Guidelines can be found at [on our Github repository.](https://github.com/alphagov/govuk-frontend/blob/master/CONTRIBUTING.md "link to contributing guidelines on our github repository")
|
250
|
-
|
251
|
-
## License
|
252
|
-
|
253
|
-
MIT
|
15
|
+
See [options table](https://design-system.service.gov.uk/components/tabs/#options-example-default) for details.
|
@@ -1,88 +1,15 @@
|
|
1
1
|
# Tag
|
2
2
|
|
3
|
-
##
|
3
|
+
## Installation
|
4
4
|
|
5
|
-
|
5
|
+
See the [main README quick start guide](https://github.com/alphagov/govuk-frontend#quick-start) for how to install this component.
|
6
6
|
|
7
|
-
## Guidance
|
7
|
+
## Guidance and Examples
|
8
8
|
|
9
9
|
Find out when to use the tag component in your service in the [GOV.UK Design System](https://design-system.service.gov.uk/components/tag).
|
10
10
|
|
11
|
-
## Quick start examples
|
12
|
-
|
13
|
-
### Tag
|
14
|
-
|
15
|
-
[Preview this example in the Frontend review app](http://govuk-frontend-review.herokuapp.com/components/tag/preview)
|
16
|
-
|
17
|
-
#### Markup
|
18
|
-
|
19
|
-
<strong class="govuk-tag">
|
20
|
-
alpha
|
21
|
-
</strong>
|
22
|
-
|
23
|
-
#### Macro
|
24
|
-
|
25
|
-
{% from "tag/macro.njk" import govukTag %}
|
26
|
-
|
27
|
-
{{ govukTag({
|
28
|
-
"text": "alpha"
|
29
|
-
}) }}
|
30
|
-
|
31
|
-
### Tag inactive
|
32
|
-
|
33
|
-
[Preview this example in the Frontend review app](http://govuk-frontend-review.herokuapp.com/components/tag/inactive/preview)
|
34
|
-
|
35
|
-
#### Markup
|
36
|
-
|
37
|
-
<strong class="govuk-tag govuk-tag--inactive">
|
38
|
-
alpha
|
39
|
-
</strong>
|
40
|
-
|
41
|
-
#### Macro
|
42
|
-
|
43
|
-
{% from "tag/macro.njk" import govukTag %}
|
44
|
-
|
45
|
-
{{ govukTag({
|
46
|
-
"text": "alpha",
|
47
|
-
"classes": "govuk-tag--inactive"
|
48
|
-
}) }}
|
49
|
-
|
50
|
-
## Requirements
|
51
|
-
|
52
|
-
### Build tool configuration
|
53
|
-
|
54
|
-
When compiling the Sass files you'll need to define includePaths to reference the node_modules directory. Below is a sample configuration using gulp
|
55
|
-
|
56
|
-
.pipe(sass({
|
57
|
-
includePaths: 'node_modules/'
|
58
|
-
}))
|
59
|
-
|
60
|
-
### Static asset path configuration
|
61
|
-
|
62
|
-
In order to include the images used in the components, you need to configure your app to show these assets. Below is a sample configuration using Express js:
|
63
|
-
|
64
|
-
app.use('/assets', express.static(path.join(__dirname, '/node_modules/govuk-frontend/assets')))
|
65
|
-
|
66
11
|
## Component options
|
67
12
|
|
68
13
|
Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
|
69
14
|
|
70
|
-
See [options table](https://design-system.service.gov.uk/components/tag/#options-example-default) for details.
|
71
|
-
|
72
|
-
### Setting up Nunjucks views and paths
|
73
|
-
|
74
|
-
Below is an example setup using express configure views:
|
75
|
-
|
76
|
-
nunjucks.configure('node_modules/govuk-frontend/components', {
|
77
|
-
autoescape: true,
|
78
|
-
cache: false,
|
79
|
-
express: app
|
80
|
-
})
|
81
|
-
|
82
|
-
## Contribution
|
83
|
-
|
84
|
-
Guidelines can be found at [on our Github repository.](https://github.com/alphagov/govuk-frontend/blob/master/CONTRIBUTING.md "link to contributing guidelines on our github repository")
|
85
|
-
|
86
|
-
## License
|
87
|
-
|
88
|
-
MIT
|
15
|
+
See [options table](https://design-system.service.gov.uk/components/tag/#options-example-default) for details.
|
@@ -1,204 +1,15 @@
|
|
1
1
|
# Textarea
|
2
2
|
|
3
|
-
##
|
3
|
+
## Installation
|
4
4
|
|
5
|
-
|
5
|
+
See the [main README quick start guide](https://github.com/alphagov/govuk-frontend#quick-start) for how to install this component.
|
6
6
|
|
7
|
-
## Guidance
|
7
|
+
## Guidance and Examples
|
8
8
|
|
9
9
|
Find out when to use the textarea component in your service in the [GOV.UK Design System](https://design-system.service.gov.uk/components/textarea).
|
10
10
|
|
11
|
-
## Quick start examples
|
12
|
-
|
13
|
-
### Textarea
|
14
|
-
|
15
|
-
[Preview this example in the Frontend review app](http://govuk-frontend-review.herokuapp.com/components/textarea/preview)
|
16
|
-
|
17
|
-
#### Markup
|
18
|
-
|
19
|
-
<div class="govuk-form-group">
|
20
|
-
<label class="govuk-label" for="more-detail">
|
21
|
-
Can you provide more detail?
|
22
|
-
</label>
|
23
|
-
|
24
|
-
<span id="more-detail-hint" class="govuk-hint">
|
25
|
-
Don't include personal or financial information, eg your National Insurance number or credit card details.
|
26
|
-
</span>
|
27
|
-
|
28
|
-
<textarea class="govuk-textarea" id="more-detail" name="more-detail" rows="5" aria-describedby="more-detail-hint"></textarea>
|
29
|
-
</div>
|
30
|
-
|
31
|
-
#### Macro
|
32
|
-
|
33
|
-
{% from "textarea/macro.njk" import govukTextarea %}
|
34
|
-
|
35
|
-
{{ govukTextarea({
|
36
|
-
"name": "more-detail",
|
37
|
-
"id": "more-detail",
|
38
|
-
"label": {
|
39
|
-
"text": "Can you provide more detail?"
|
40
|
-
},
|
41
|
-
"hint": {
|
42
|
-
"text": "Don't include personal or financial information, eg your National Insurance number or credit card details."
|
43
|
-
}
|
44
|
-
}) }}
|
45
|
-
|
46
|
-
### Textarea with error message
|
47
|
-
|
48
|
-
[Preview this example in the Frontend review app](http://govuk-frontend-review.herokuapp.com/components/textarea/with-error-message/preview)
|
49
|
-
|
50
|
-
#### Markup
|
51
|
-
|
52
|
-
<div class="govuk-form-group govuk-form-group--error">
|
53
|
-
<label class="govuk-label" for="no-ni-reason">
|
54
|
-
Why can't you provide a National Insurance number?
|
55
|
-
</label>
|
56
|
-
|
57
|
-
<span id="no-ni-reason-error" class="govuk-error-message">
|
58
|
-
You must provide an explanation
|
59
|
-
</span>
|
60
|
-
|
61
|
-
<textarea class="govuk-textarea govuk-textarea--error" id="no-ni-reason" name="no-ni-reason" rows="5" aria-describedby="no-ni-reason-error"></textarea>
|
62
|
-
</div>
|
63
|
-
|
64
|
-
#### Macro
|
65
|
-
|
66
|
-
{% from "textarea/macro.njk" import govukTextarea %}
|
67
|
-
|
68
|
-
{{ govukTextarea({
|
69
|
-
"name": "no-ni-reason",
|
70
|
-
"id": "no-ni-reason",
|
71
|
-
"label": {
|
72
|
-
"text": "Why can't you provide a National Insurance number?"
|
73
|
-
},
|
74
|
-
"errorMessage": {
|
75
|
-
"text": "You must provide an explanation"
|
76
|
-
}
|
77
|
-
}) }}
|
78
|
-
|
79
|
-
### Textarea with default value
|
80
|
-
|
81
|
-
[Preview this example in the Frontend review app](http://govuk-frontend-review.herokuapp.com/components/textarea/with-default-value/preview)
|
82
|
-
|
83
|
-
#### Markup
|
84
|
-
|
85
|
-
<div class="govuk-form-group">
|
86
|
-
<label class="govuk-label" for="full-address">
|
87
|
-
Full address
|
88
|
-
</label>
|
89
|
-
|
90
|
-
<textarea class="govuk-textarea" id="full-address" name="address" rows="5">221B Baker Street
|
91
|
-
London
|
92
|
-
NW1 6XE
|
93
|
-
</textarea>
|
94
|
-
</div>
|
95
|
-
|
96
|
-
#### Macro
|
97
|
-
|
98
|
-
{% from "textarea/macro.njk" import govukTextarea %}
|
99
|
-
|
100
|
-
{{ govukTextarea({
|
101
|
-
"id": "full-address",
|
102
|
-
"name": "address",
|
103
|
-
"value": "221B Baker Street\nLondon\nNW1 6XE\n",
|
104
|
-
"label": {
|
105
|
-
"text": "Full address"
|
106
|
-
}
|
107
|
-
}) }}
|
108
|
-
|
109
|
-
### Textarea with custom rows
|
110
|
-
|
111
|
-
[Preview this example in the Frontend review app](http://govuk-frontend-review.herokuapp.com/components/textarea/with-custom-rows/preview)
|
112
|
-
|
113
|
-
#### Markup
|
114
|
-
|
115
|
-
<div class="govuk-form-group">
|
116
|
-
<label class="govuk-label" for="full-address">
|
117
|
-
Full address
|
118
|
-
</label>
|
119
|
-
|
120
|
-
<textarea class="govuk-textarea" id="full-address" name="address" rows="8"></textarea>
|
121
|
-
</div>
|
122
|
-
|
123
|
-
#### Macro
|
124
|
-
|
125
|
-
{% from "textarea/macro.njk" import govukTextarea %}
|
126
|
-
|
127
|
-
{{ govukTextarea({
|
128
|
-
"id": "full-address",
|
129
|
-
"name": "address",
|
130
|
-
"label": {
|
131
|
-
"text": "Full address"
|
132
|
-
},
|
133
|
-
"rows": 8
|
134
|
-
}) }}
|
135
|
-
|
136
|
-
### Textarea with label as page heading
|
137
|
-
|
138
|
-
[Preview this example in the Frontend review app](http://govuk-frontend-review.herokuapp.com/components/textarea/with-label-as-page-heading/preview)
|
139
|
-
|
140
|
-
#### Markup
|
141
|
-
|
142
|
-
<div class="govuk-form-group">
|
143
|
-
<h1 class="govuk-label-wrapper">
|
144
|
-
<label class="govuk-label" for="textarea-with-page-heading">
|
145
|
-
Full address
|
146
|
-
</label>
|
147
|
-
|
148
|
-
</h1>
|
149
|
-
|
150
|
-
<textarea class="govuk-textarea" id="textarea-with-page-heading" name="address" rows="5"></textarea>
|
151
|
-
</div>
|
152
|
-
|
153
|
-
#### Macro
|
154
|
-
|
155
|
-
{% from "textarea/macro.njk" import govukTextarea %}
|
156
|
-
|
157
|
-
{{ govukTextarea({
|
158
|
-
"id": "textarea-with-page-heading",
|
159
|
-
"name": "address",
|
160
|
-
"label": {
|
161
|
-
"text": "Full address",
|
162
|
-
"isPageHeading": true
|
163
|
-
}
|
164
|
-
}) }}
|
165
|
-
|
166
|
-
## Requirements
|
167
|
-
|
168
|
-
### Build tool configuration
|
169
|
-
|
170
|
-
When compiling the Sass files you'll need to define includePaths to reference the node_modules directory. Below is a sample configuration using gulp
|
171
|
-
|
172
|
-
.pipe(sass({
|
173
|
-
includePaths: 'node_modules/'
|
174
|
-
}))
|
175
|
-
|
176
|
-
### Static asset path configuration
|
177
|
-
|
178
|
-
In order to include the images used in the components, you need to configure your app to show these assets. Below is a sample configuration using Express js:
|
179
|
-
|
180
|
-
app.use('/assets', express.static(path.join(__dirname, '/node_modules/govuk-frontend/assets')))
|
181
|
-
|
182
11
|
## Component options
|
183
12
|
|
184
13
|
Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
|
185
14
|
|
186
|
-
See [options table](https://design-system.service.gov.uk/components/textarea/#options-example-default) for details.
|
187
|
-
|
188
|
-
### Setting up Nunjucks views and paths
|
189
|
-
|
190
|
-
Below is an example setup using express configure views:
|
191
|
-
|
192
|
-
nunjucks.configure('node_modules/govuk-frontend/components', {
|
193
|
-
autoescape: true,
|
194
|
-
cache: false,
|
195
|
-
express: app
|
196
|
-
})
|
197
|
-
|
198
|
-
## Contribution
|
199
|
-
|
200
|
-
Guidelines can be found at [on our Github repository.](https://github.com/alphagov/govuk-frontend/blob/master/CONTRIBUTING.md "link to contributing guidelines on our github repository")
|
201
|
-
|
202
|
-
## License
|
203
|
-
|
204
|
-
MIT
|
15
|
+
See [options table](https://design-system.service.gov.uk/components/textarea/#options-example-default) for details.
|