govuk_publishing_components 11.0.0 → 11.1.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/javascripts/govuk_publishing_components/admin_scripts.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/radio.js +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +11 -3
- data/app/assets/stylesheets/govuk_publishing_components/admin_styles.scss +2 -4
- data/app/assets/stylesheets/govuk_publishing_components/admin_styles_ie8.scss +2 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_back-link.scss +2 -6
- data/app/assets/stylesheets/govuk_publishing_components/components/_button.scss +3 -9
- data/app/assets/stylesheets/govuk_publishing_components/components/_details.scss +2 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_error-message.scss +2 -6
- data/app/assets/stylesheets/govuk_publishing_components/components/_file-upload.scss +3 -7
- data/app/assets/stylesheets/govuk_publishing_components/components/_hint.scss +2 -6
- data/app/assets/stylesheets/govuk_publishing_components/components/_input.scss +3 -7
- data/app/assets/stylesheets/govuk_publishing_components/components/_inset-text.scss +2 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_label.scss +2 -6
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-footer.scss +2 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +2 -13
- data/app/assets/stylesheets/govuk_publishing_components/components/_panel.scss +2 -6
- data/app/assets/stylesheets/govuk_publishing_components/components/_radio.scss +3 -8
- data/app/assets/stylesheets/govuk_publishing_components/components/_select.scss +2 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_skip-link.scss +2 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_table.scss +15 -10
- data/app/assets/stylesheets/govuk_publishing_components/components/_tabs.scss +2 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_textarea.scss +3 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_button.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_govuk-frontend-settings.scss +5 -0
- data/app/views/govuk_publishing_components/components/_admin_analytics.html.erb +10 -0
- data/app/views/govuk_publishing_components/components/_file_upload.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_input.html.erb +7 -5
- data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +43 -1
- data/app/views/govuk_publishing_components/components/_textarea.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/docs/admin_analytics.yml +9 -0
- data/app/views/govuk_publishing_components/components/docs/details.yml +1 -2
- data/app/views/govuk_publishing_components/components/docs/input.yml +9 -0
- data/app/views/govuk_publishing_components/components/docs/inset_text.yml +1 -2
- data/app/views/govuk_publishing_components/components/docs/layout_footer.yml +117 -3
- data/app/views/govuk_publishing_components/components/docs/select.yml +1 -2
- data/app/views/govuk_publishing_components/components/docs/textarea.yml +1 -2
- data/config/initializers/assets.rb +1 -1
- data/lib/govuk_publishing_components.rb +1 -0
- data/lib/govuk_publishing_components/app_helpers/environment.rb +18 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/govuk-frontend/all.js +3 -1
- data/node_modules/govuk-frontend/assets/images/favicon.ico +0 -0
- data/node_modules/govuk-frontend/components/back-link/macro-options.json +32 -0
- data/node_modules/govuk-frontend/components/breadcrumbs/README.md +12 -0
- data/node_modules/govuk-frontend/components/breadcrumbs/macro-options.json +40 -0
- data/node_modules/govuk-frontend/components/breadcrumbs/template.njk +1 -1
- data/node_modules/govuk-frontend/components/button/_button.scss +4 -9
- data/node_modules/govuk-frontend/components/button/macro-options.json +62 -0
- data/node_modules/govuk-frontend/components/checkboxes/_checkboxes.scss +2 -4
- data/node_modules/govuk-frontend/components/checkboxes/macro-options.json +129 -0
- data/node_modules/govuk-frontend/components/date-input/README.md +19 -7
- data/node_modules/govuk-frontend/components/date-input/macro-options.json +85 -0
- data/node_modules/govuk-frontend/components/date-input/template.njk +2 -22
- data/node_modules/govuk-frontend/components/details/_details.scss +3 -0
- data/node_modules/govuk-frontend/components/details/macro-options.json +50 -0
- data/node_modules/govuk-frontend/components/error-message/macro-options.json +32 -0
- data/node_modules/govuk-frontend/components/error-summary/README.md +12 -0
- data/node_modules/govuk-frontend/components/error-summary/_error-summary.scss +7 -3
- data/node_modules/govuk-frontend/components/error-summary/macro-options.json +70 -0
- data/node_modules/govuk-frontend/components/error-summary/template.njk +1 -1
- data/node_modules/govuk-frontend/components/fieldset/_fieldset.scss +1 -2
- data/node_modules/govuk-frontend/components/fieldset/macro-options.json +58 -0
- data/node_modules/govuk-frontend/components/file-upload/macro-options.json +53 -0
- data/node_modules/govuk-frontend/components/footer/README.md +48 -0
- data/node_modules/govuk-frontend/components/footer/_footer.scss +10 -2
- data/node_modules/govuk-frontend/components/footer/macro-options.json +100 -0
- data/node_modules/govuk-frontend/components/footer/template.njk +19 -12
- data/node_modules/govuk-frontend/components/header/README.md +14 -2
- data/node_modules/govuk-frontend/components/header/_header.scss +9 -1
- data/node_modules/govuk-frontend/components/header/macro-options.json +88 -0
- data/node_modules/govuk-frontend/components/header/template.njk +2 -2
- data/node_modules/govuk-frontend/components/hint/macro-options.json +32 -0
- data/node_modules/govuk-frontend/components/input/README.md +1 -1
- data/node_modules/govuk-frontend/components/input/_input.scss +1 -3
- data/node_modules/govuk-frontend/components/input/macro-options.json +52 -0
- data/node_modules/govuk-frontend/components/inset-text/macro-options.json +32 -0
- data/node_modules/govuk-frontend/components/label/macro-options.json +38 -0
- data/node_modules/govuk-frontend/components/panel/README.md +5 -5
- data/node_modules/govuk-frontend/components/panel/_panel.scss +1 -3
- data/node_modules/govuk-frontend/components/panel/macro-options.json +44 -0
- data/node_modules/govuk-frontend/components/panel/template.njk +1 -2
- data/node_modules/govuk-frontend/components/phase-banner/macro-options.json +33 -0
- data/node_modules/govuk-frontend/components/radios/_radios.scss +10 -4
- data/node_modules/govuk-frontend/components/radios/macro-options.json +135 -0
- data/node_modules/govuk-frontend/components/radios/template.njk +1 -1
- data/node_modules/govuk-frontend/components/select/README.md +63 -0
- data/node_modules/govuk-frontend/components/select/_select.scss +1 -4
- data/node_modules/govuk-frontend/components/select/macro-options.json +79 -0
- data/node_modules/govuk-frontend/components/select/template.njk +4 -1
- data/node_modules/govuk-frontend/components/skip-link/macro-options.json +32 -0
- data/node_modules/govuk-frontend/components/table/_table.scss +7 -4
- data/node_modules/govuk-frontend/components/table/macro-options.json +108 -0
- data/node_modules/govuk-frontend/components/tabs/README.md +29 -5
- data/node_modules/govuk-frontend/components/tabs/_tabs.scss +1 -1
- data/node_modules/govuk-frontend/components/tabs/macro-options.json +58 -0
- data/node_modules/govuk-frontend/components/tabs/tabs.js +3 -1
- data/node_modules/govuk-frontend/components/tabs/template.njk +3 -2
- data/node_modules/govuk-frontend/components/tag/macro-options.json +26 -0
- data/node_modules/govuk-frontend/components/textarea/_textarea.scss +4 -3
- data/node_modules/govuk-frontend/components/textarea/macro-options.json +65 -0
- data/node_modules/govuk-frontend/components/warning-text/macro-options.json +32 -0
- data/node_modules/govuk-frontend/core/_links.scss +1 -14
- data/node_modules/govuk-frontend/core/_lists.scss +0 -18
- data/node_modules/govuk-frontend/helpers/_grid.scss +1 -2
- data/node_modules/govuk-frontend/helpers/_links.scss +52 -1
- data/node_modules/govuk-frontend/overrides/_width.scss +4 -0
- data/node_modules/govuk-frontend/package.json +19 -19
- data/node_modules/govuk-frontend/settings/_colours-applied.scss +10 -0
- data/node_modules/govuk-frontend/settings/_compatibility.scss +3 -3
- data/node_modules/govuk-frontend/settings/_typography-responsive.scss +10 -3
- data/node_modules/govuk-frontend/template.njk +1 -1
- data/node_modules/govuk-frontend/utilities/_visually-hidden.scss +0 -5
- metadata +32 -2
|
@@ -78,8 +78,7 @@
|
|
|
78
78
|
|
|
79
79
|
.govuk-radios__input + .govuk-radios__label::before {
|
|
80
80
|
content: "";
|
|
81
|
-
|
|
82
|
-
box-sizing: border-box;
|
|
81
|
+
box-sizing: border-box;
|
|
83
82
|
position: absolute;
|
|
84
83
|
top: 0;
|
|
85
84
|
left: 0;
|
|
@@ -115,8 +114,7 @@
|
|
|
115
114
|
// https://accessibility.blog.gov.uk/2017/03/27/how-users-change-colours-on-websites/
|
|
116
115
|
outline: $govuk-focus-width solid transparent;
|
|
117
116
|
outline-offset: $govuk-focus-width;
|
|
118
|
-
|
|
119
|
-
box-shadow: 0 0 0 $govuk-radios-focus-width $govuk-focus-colour;
|
|
117
|
+
box-shadow: 0 0 0 $govuk-radios-focus-width $govuk-focus-colour;
|
|
120
118
|
}
|
|
121
119
|
|
|
122
120
|
// Selected state
|
|
@@ -145,6 +143,14 @@
|
|
|
145
143
|
clear: none;
|
|
146
144
|
}
|
|
147
145
|
}
|
|
146
|
+
|
|
147
|
+
// Prevent inline modifier being used with conditional reveals
|
|
148
|
+
&.govuk-radios--conditional {
|
|
149
|
+
.govuk-radios__item {
|
|
150
|
+
margin-right: 0;
|
|
151
|
+
float: none;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
148
154
|
}
|
|
149
155
|
|
|
150
156
|
.govuk-radios__divider {
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"name": "fieldset",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"required": false,
|
|
6
|
+
"description": "Options for the fieldset component (e.g. legend).",
|
|
7
|
+
"isComponent": true
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"name": "hint",
|
|
11
|
+
"type": "object",
|
|
12
|
+
"required": false,
|
|
13
|
+
"description": "Options for the hint component (e.g. text).",
|
|
14
|
+
"isComponent": true
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"name": "errorMessage",
|
|
18
|
+
"type": "object",
|
|
19
|
+
"required": false,
|
|
20
|
+
"description": "Options for the errorMessage component (e.g. text).",
|
|
21
|
+
"isComponent": true
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "idPrefix",
|
|
25
|
+
"type": "string",
|
|
26
|
+
"required": false,
|
|
27
|
+
"description": "String to prefix id for each checkbox item if no id is specified on each item. If `idPrefix` is not passed, fallback to using the name attribute instead."
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "name",
|
|
31
|
+
"type": "string",
|
|
32
|
+
"required": true,
|
|
33
|
+
"description": "Name attribute for each radio item."
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"name": "items",
|
|
37
|
+
"type": "array",
|
|
38
|
+
"required": true,
|
|
39
|
+
"description": "Array of radio items objects.",
|
|
40
|
+
"params": [
|
|
41
|
+
{
|
|
42
|
+
"name": "text",
|
|
43
|
+
"type": "string",
|
|
44
|
+
"required": true,
|
|
45
|
+
"description": "If `html` is set, this is not required. Text to use within each radio item label. If `html` is provided, the `text` argument will be ignored."
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "html",
|
|
49
|
+
"type": "string",
|
|
50
|
+
"required": true,
|
|
51
|
+
"description": "If `text` is set, this is not required. HTML to use within each radio item label. If `html` is provided, the `text` argument will be ignored."
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "id",
|
|
55
|
+
"type": "string",
|
|
56
|
+
"required": false,
|
|
57
|
+
"description": "Specific id attribute for the radio item. If omitted, then `idPrefix` string will be applied."
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "name",
|
|
61
|
+
"type": "string",
|
|
62
|
+
"required": true,
|
|
63
|
+
"description": "Specific name for the radio item. If omitted, then component global `name` string will be applied."
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "value",
|
|
67
|
+
"type": "string",
|
|
68
|
+
"required": true,
|
|
69
|
+
"description": "Value for the radio input."
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"name": "label",
|
|
73
|
+
"type": "object",
|
|
74
|
+
"required": false,
|
|
75
|
+
"description": "Provide attributes and classes to each radio item label.",
|
|
76
|
+
"isComponent": true
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "hint",
|
|
80
|
+
"type": "object",
|
|
81
|
+
"required": false,
|
|
82
|
+
"description": "Provide hint to each checkbox item.",
|
|
83
|
+
"isComponent": true
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "divider",
|
|
87
|
+
"type": "string",
|
|
88
|
+
"required": false,
|
|
89
|
+
"description": "Divider text to separate radio items, for example the text \"or\"."
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"name": "checked",
|
|
93
|
+
"type": "boolean",
|
|
94
|
+
"required": false,
|
|
95
|
+
"description": "If true, radio will be checked."
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"name": "conditional",
|
|
99
|
+
"type": "string",
|
|
100
|
+
"required": false,
|
|
101
|
+
"description": "If true, content provided will be revealed when the item is checked."
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"name": "conditional.html",
|
|
105
|
+
"type": "html",
|
|
106
|
+
"required": false,
|
|
107
|
+
"description": "Provide content for the conditional reveal."
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"name": "disabled",
|
|
111
|
+
"type": "boolean",
|
|
112
|
+
"required": false,
|
|
113
|
+
"description": "If true, radio will be disabled."
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"name": "attributes",
|
|
117
|
+
"type": "object",
|
|
118
|
+
"required": false,
|
|
119
|
+
"description": "HTML attributes (for example data attributes) to add to the radio input tag."
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"name": "classes",
|
|
125
|
+
"type": "string",
|
|
126
|
+
"required": false,
|
|
127
|
+
"description": "Classes to add to the radio container."
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"name": "attributes",
|
|
131
|
+
"type": "object",
|
|
132
|
+
"required": false,
|
|
133
|
+
"description": "HTML attributes (for example data attributes) to add to the radio input tag."
|
|
134
|
+
}
|
|
135
|
+
]
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
text: params.errorMessage.text
|
|
42
42
|
}) | indent(2) | trim }}
|
|
43
43
|
{% endif %}
|
|
44
|
-
<div class="govuk-radios {%- if params.classes %} {{ params.classes }}{% endif %}"
|
|
44
|
+
<div class="govuk-radios {%- if params.classes %} {{ params.classes }}{% endif %}{%- if isConditional %} govuk-radios--conditional{% endif -%}"
|
|
45
45
|
{%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}
|
|
46
46
|
{%- if isConditional %} data-module="radios"{% endif -%}>
|
|
47
47
|
{% for item in params.items %}
|
|
@@ -176,6 +176,57 @@ Find out when to use the select component in your service in the [GOV.UK Design
|
|
|
176
176
|
]
|
|
177
177
|
}) }}
|
|
178
178
|
|
|
179
|
+
### Select with full width override
|
|
180
|
+
|
|
181
|
+
[Preview this example in the Frontend review app](http://govuk-frontend-review.herokuapp.com/components/select/with-full-width-override/preview)
|
|
182
|
+
|
|
183
|
+
#### Markup
|
|
184
|
+
|
|
185
|
+
<div class="govuk-form-group">
|
|
186
|
+
<label class="govuk-label" for="select-1">
|
|
187
|
+
Label text goes here
|
|
188
|
+
</label>
|
|
189
|
+
|
|
190
|
+
<select class="govuk-select govuk-!-width-full" id="select-1" name="select-1">
|
|
191
|
+
|
|
192
|
+
<option value="1">GOV.UK frontend option 1</option>
|
|
193
|
+
|
|
194
|
+
<option value="2" selected>GOV.UK frontend option 2</option>
|
|
195
|
+
|
|
196
|
+
<option value="3" disabled>GOV.UK frontend option 3</option>
|
|
197
|
+
|
|
198
|
+
</select>
|
|
199
|
+
</div>
|
|
200
|
+
|
|
201
|
+
#### Macro
|
|
202
|
+
|
|
203
|
+
{% from "select/macro.njk" import govukSelect %}
|
|
204
|
+
|
|
205
|
+
{{ govukSelect({
|
|
206
|
+
"id": "select-1",
|
|
207
|
+
"name": "select-1",
|
|
208
|
+
"classes": "govuk-!-width-full",
|
|
209
|
+
"label": {
|
|
210
|
+
"text": "Label text goes here"
|
|
211
|
+
},
|
|
212
|
+
"items": [
|
|
213
|
+
{
|
|
214
|
+
"value": 1,
|
|
215
|
+
"text": "GOV.UK frontend option 1"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"value": 2,
|
|
219
|
+
"text": "GOV.UK frontend option 2",
|
|
220
|
+
"selected": true
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"value": 3,
|
|
224
|
+
"text": "GOV.UK frontend option 3",
|
|
225
|
+
"disabled": true
|
|
226
|
+
}
|
|
227
|
+
]
|
|
228
|
+
}) }}
|
|
229
|
+
|
|
179
230
|
## Requirements
|
|
180
231
|
|
|
181
232
|
### Build tool configuration
|
|
@@ -304,6 +355,18 @@ If you are using Nunjucks,then macros take the following arguments
|
|
|
304
355
|
|
|
305
356
|
<tr class="govuk-table__row">
|
|
306
357
|
|
|
358
|
+
<th class="govuk-table__header" scope="row">item.attributes</th>
|
|
359
|
+
|
|
360
|
+
<td class="govuk-table__cell ">object</td>
|
|
361
|
+
|
|
362
|
+
<td class="govuk-table__cell ">No</td>
|
|
363
|
+
|
|
364
|
+
<td class="govuk-table__cell ">Any extra HTML attributes (for example data attributes) to the select option tag.</td>
|
|
365
|
+
|
|
366
|
+
</tr>
|
|
367
|
+
|
|
368
|
+
<tr class="govuk-table__row">
|
|
369
|
+
|
|
307
370
|
<th class="govuk-table__header" scope="row">label</th>
|
|
308
371
|
|
|
309
372
|
<td class="govuk-table__cell ">object</td>
|
|
@@ -11,10 +11,7 @@
|
|
|
11
11
|
@include govuk-font($size: 19, $line-height: 1.25);
|
|
12
12
|
@include govuk-focusable;
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
box-sizing: border-box; // should this be global?
|
|
17
|
-
width: 100%;
|
|
14
|
+
box-sizing: border-box; // should this be global?
|
|
18
15
|
height: 40px;
|
|
19
16
|
|
|
20
17
|
padding: govuk-spacing(1); // was 5px 4px 4px - size of it should be adjusted to match other form elements
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"name": "id",
|
|
4
|
+
"type": "string",
|
|
5
|
+
"required": true,
|
|
6
|
+
"description": "Id for each select box."
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"name": "name",
|
|
10
|
+
"type": "string",
|
|
11
|
+
"required": true,
|
|
12
|
+
"description": "Name property for the select."
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "items",
|
|
16
|
+
"type": "array",
|
|
17
|
+
"required": true,
|
|
18
|
+
"description": "Array of option items for the select.",
|
|
19
|
+
"params": [
|
|
20
|
+
{
|
|
21
|
+
"name": "value",
|
|
22
|
+
"type": "string",
|
|
23
|
+
"required": false,
|
|
24
|
+
"description": "Value for the option item."
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "text",
|
|
28
|
+
"type": "string",
|
|
29
|
+
"required": true,
|
|
30
|
+
"description": "Text for the option item."
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "selected",
|
|
34
|
+
"type": "boolean",
|
|
35
|
+
"required": false,
|
|
36
|
+
"description": "Sets the option as the selected."
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "disabled",
|
|
40
|
+
"type": "boolean",
|
|
41
|
+
"required": false,
|
|
42
|
+
"description": "Sets the option item as disabled."
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "label",
|
|
48
|
+
"type": "object",
|
|
49
|
+
"required": false,
|
|
50
|
+
"description": "Label text or HTML by specifying value for either text or html keys.",
|
|
51
|
+
"isComponent": true
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "hint",
|
|
55
|
+
"type": "object",
|
|
56
|
+
"required": false,
|
|
57
|
+
"description": "Options for the hint component.",
|
|
58
|
+
"isComponent": true
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"name": "errorMessage",
|
|
62
|
+
"type": "object",
|
|
63
|
+
"required": false,
|
|
64
|
+
"description": "Options for the errorMessage component (e.g. text).",
|
|
65
|
+
"isComponent": true
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"name": "classes",
|
|
69
|
+
"type": "string",
|
|
70
|
+
"required": false,
|
|
71
|
+
"description": "Classes to add to the anchor tag."
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "attributes",
|
|
75
|
+
"type": "object",
|
|
76
|
+
"required": false,
|
|
77
|
+
"description": "HTML attributes (for example data attributes) to add to the anchor tag."
|
|
78
|
+
}
|
|
79
|
+
]
|
|
@@ -38,7 +38,10 @@
|
|
|
38
38
|
<select class="govuk-select
|
|
39
39
|
{%- if params.classes %} {{ params.classes }}{% endif %}{%- if params.errorMessage %} govuk-select--error{% endif %}" id="{{ params.id }}" name="{{ params.name }}" {%- if describedBy %} aria-describedby="{{ describedBy }}"{% endif %} {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor %}>
|
|
40
40
|
{% for item in params.items %}
|
|
41
|
-
<option value="{{ item.value }}"
|
|
41
|
+
<option value="{{ item.value }}"
|
|
42
|
+
{{-" selected" if item.selected }}
|
|
43
|
+
{{-" disabled" if item.disabled }}
|
|
44
|
+
{%- for attribute, value in item.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>{{ item.text }}</option>
|
|
42
45
|
{% endfor %}
|
|
43
46
|
</select>
|
|
44
47
|
</div>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"name": "text",
|
|
4
|
+
"type": "string",
|
|
5
|
+
"required": true,
|
|
6
|
+
"description": "If `html` is set, this is not required. Text to use within the skip link component. If `html` is provided, the `text` argument will be ignored."
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"name": "html",
|
|
10
|
+
"type": "string",
|
|
11
|
+
"required": true,
|
|
12
|
+
"description": "If `text` is set, this is not required. HTML to use within the skip link component. If `html` is provided, the `text` argument will be ignored."
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "href",
|
|
16
|
+
"type": "string",
|
|
17
|
+
"required": true,
|
|
18
|
+
"description": "The value of the skip link href attribute. Defaults to"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "classes",
|
|
22
|
+
"type": "string",
|
|
23
|
+
"required": false,
|
|
24
|
+
"description": "Classes to add to the skip link."
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "attributes",
|
|
28
|
+
"type": "object",
|
|
29
|
+
"required": false,
|
|
30
|
+
"description": "HTML attributes (for example data attributes) to add to the skip link."
|
|
31
|
+
}
|
|
32
|
+
]
|
|
@@ -15,16 +15,19 @@
|
|
|
15
15
|
|
|
16
16
|
.govuk-table__header {
|
|
17
17
|
@include govuk-typography-weight-bold;
|
|
18
|
-
|
|
19
|
-
padding: govuk-spacing(2) govuk-spacing(4) govuk-spacing(2) 0;
|
|
20
|
-
border-bottom: 1px solid $govuk-border-colour;
|
|
21
|
-
text-align: left;
|
|
22
18
|
}
|
|
23
19
|
|
|
20
|
+
.govuk-table__header,
|
|
24
21
|
.govuk-table__cell {
|
|
25
22
|
padding: govuk-spacing(2) govuk-spacing(4) govuk-spacing(2) 0;
|
|
26
23
|
border-bottom: 1px solid $govuk-border-colour;
|
|
27
24
|
text-align: left;
|
|
25
|
+
// GOV.UK Elements sets the font-size and line-height for all headers and cells
|
|
26
|
+
// in tables.
|
|
27
|
+
@include govuk-compatibility(govuk_elements) {
|
|
28
|
+
font-size: inherit;
|
|
29
|
+
line-height: inherit;
|
|
30
|
+
}
|
|
28
31
|
}
|
|
29
32
|
|
|
30
33
|
.govuk-table__cell--numeric {
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"name": "rows",
|
|
4
|
+
"type": "array",
|
|
5
|
+
"required": true,
|
|
6
|
+
"description": "Array of table rows and cells.",
|
|
7
|
+
"params": [
|
|
8
|
+
{
|
|
9
|
+
"name": "text",
|
|
10
|
+
"type": "string",
|
|
11
|
+
"required": true,
|
|
12
|
+
"description": "If `html` is set, this is not required. Text for cells in table rows. If `html` is provided, the `text` argument will be ignored."
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "html",
|
|
16
|
+
"type": "string",
|
|
17
|
+
"required": true,
|
|
18
|
+
"description": "If `text` is set, this is not required. HTML for cells in table rows. If `html` is provided, the `text` argument will be ignore"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "format",
|
|
22
|
+
"type": "string",
|
|
23
|
+
"required": false,
|
|
24
|
+
"description": "Specify format of a cell. Currently we only use \"numeric\"."
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "colspan",
|
|
28
|
+
"type": "integer",
|
|
29
|
+
"required": false,
|
|
30
|
+
"description": "Specify how many columns a cell extends."
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "rowspan",
|
|
34
|
+
"type": "integer",
|
|
35
|
+
"required": false,
|
|
36
|
+
"description": "Specify how many rows a cell extends."
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"name": "head",
|
|
42
|
+
"type": "array",
|
|
43
|
+
"required": false,
|
|
44
|
+
"description": "Array of table head cells.",
|
|
45
|
+
"params": [
|
|
46
|
+
{
|
|
47
|
+
"name": "text",
|
|
48
|
+
"type": "string",
|
|
49
|
+
"required": false,
|
|
50
|
+
"description": "If `html` is set, this is not required. Text for table head cells. If `html` is provided, the `text` argument will be ignored."
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "html",
|
|
54
|
+
"type": "string",
|
|
55
|
+
"required": false,
|
|
56
|
+
"description": "If `text` is set, this is not required. HTML for table head cells. If `html` is provided, the `text` argument will be ignore"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "format",
|
|
60
|
+
"type": "string",
|
|
61
|
+
"required": false,
|
|
62
|
+
"description": "Specify format of a cell. Currently we only use \"numeric\"."
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"name": "colspan",
|
|
66
|
+
"type": "integer",
|
|
67
|
+
"required": false,
|
|
68
|
+
"description": "Specify how many columns a cell extends."
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "rowspan",
|
|
72
|
+
"type": "integer",
|
|
73
|
+
"required": false,
|
|
74
|
+
"description": "Specify how many rows a cell extends."
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "caption",
|
|
80
|
+
"type": "string",
|
|
81
|
+
"required": false,
|
|
82
|
+
"description": "Caption text"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"name": "captionClasses",
|
|
86
|
+
"type": "string",
|
|
87
|
+
"required": false,
|
|
88
|
+
"description": "Classes for caption text size. Classes should correspond to the available typography heading classes."
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"name": "firstCellIsHeader",
|
|
92
|
+
"type": "boolean",
|
|
93
|
+
"required": false,
|
|
94
|
+
"description": "If set to true, first cell in table row will be a TH instead of a TD."
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"name": "classes",
|
|
98
|
+
"type": "string",
|
|
99
|
+
"required": false,
|
|
100
|
+
"description": "Classes to add to the table container."
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"name": "attributes",
|
|
104
|
+
"type": "object",
|
|
105
|
+
"required": false,
|
|
106
|
+
"description": "HTML attributes (for example data attributes) to add to the table container."
|
|
107
|
+
}
|
|
108
|
+
]
|