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
|
@@ -74,8 +74,7 @@
|
|
|
74
74
|
|
|
75
75
|
.govuk-checkboxes__input + .govuk-checkboxes__label::before {
|
|
76
76
|
content: "";
|
|
77
|
-
|
|
78
|
-
box-sizing: border-box;
|
|
77
|
+
box-sizing: border-box;
|
|
79
78
|
position: absolute;
|
|
80
79
|
top: 0;
|
|
81
80
|
left: 0;
|
|
@@ -119,8 +118,7 @@
|
|
|
119
118
|
// https://accessibility.blog.gov.uk/2017/03/27/how-users-change-colours-on-websites/
|
|
120
119
|
outline: $govuk-focus-width solid transparent;
|
|
121
120
|
outline-offset: $govuk-focus-width;
|
|
122
|
-
|
|
123
|
-
box-shadow: 0 0 0 $govuk-focus-width $govuk-focus-colour;
|
|
121
|
+
box-shadow: 0 0 0 $govuk-focus-width $govuk-focus-colour;
|
|
124
122
|
}
|
|
125
123
|
|
|
126
124
|
// Selected state
|
|
@@ -0,0 +1,129 @@
|
|
|
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 not passed, fall back to using the name option instead."
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "name",
|
|
31
|
+
"type": "string",
|
|
32
|
+
"required": true,
|
|
33
|
+
"description": "Name attribute for all checkbox items."
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"name": "items",
|
|
37
|
+
"type": "array",
|
|
38
|
+
"required": true,
|
|
39
|
+
"description": "Array of checkbox 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 checkbox 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 checkbox 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 checkbox item. If omitted, then idPrefix option will be applied."
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "name",
|
|
61
|
+
"type": "string",
|
|
62
|
+
"required": true,
|
|
63
|
+
"description": "Specific name for the checkbox 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 checkbox input."
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"name": "label",
|
|
73
|
+
"type": "object",
|
|
74
|
+
"required": false,
|
|
75
|
+
"description": "Provide attributes and classes to each checkbox 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": "checked",
|
|
87
|
+
"type": "boolean",
|
|
88
|
+
"required": false,
|
|
89
|
+
"description": "If true, checkbox will be checked."
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"name": "conditional",
|
|
93
|
+
"type": "boolean",
|
|
94
|
+
"required": false,
|
|
95
|
+
"description": "If true, content provided will be revealed when the item is checked."
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"name": "conditional.html",
|
|
99
|
+
"type": "string",
|
|
100
|
+
"required": false,
|
|
101
|
+
"description": "Provide content for the conditional reveal."
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"name": "disabled",
|
|
105
|
+
"type": "boolean",
|
|
106
|
+
"required": false,
|
|
107
|
+
"description": "If true, checkbox will be disabled."
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"name": "attributes",
|
|
111
|
+
"type": "object",
|
|
112
|
+
"required": false,
|
|
113
|
+
"description": "HTML attributes (for example data attributes) to add to the checkbox input tag."
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"name": "classes",
|
|
119
|
+
"type": "string",
|
|
120
|
+
"required": false,
|
|
121
|
+
"description": "Classes to add to the checkboxes container."
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"name": "attributes",
|
|
125
|
+
"type": "object",
|
|
126
|
+
"required": false,
|
|
127
|
+
"description": "HTML attributes (for example data attributes) to add to the anchor tag."
|
|
128
|
+
}
|
|
129
|
+
]
|
|
@@ -70,7 +70,7 @@ Find out when to use the date input component in your service in the [GOV.UK Des
|
|
|
70
70
|
|
|
71
71
|
{{ govukDateInput({
|
|
72
72
|
"id": "dob",
|
|
73
|
-
"
|
|
73
|
+
"namePrefix": "dob",
|
|
74
74
|
"fieldset": {
|
|
75
75
|
"legend": {
|
|
76
76
|
"text": "What is your date of birth?"
|
|
@@ -250,7 +250,7 @@ Find out when to use the date input component in your service in the [GOV.UK Des
|
|
|
250
250
|
|
|
251
251
|
{{ govukDateInput({
|
|
252
252
|
"id": "dob-day-error",
|
|
253
|
-
"
|
|
253
|
+
"namePrefix": "dob-day-error",
|
|
254
254
|
"fieldset": {
|
|
255
255
|
"legend": {
|
|
256
256
|
"text": "What is your date of birth?"
|
|
@@ -342,7 +342,7 @@ Find out when to use the date input component in your service in the [GOV.UK Des
|
|
|
342
342
|
|
|
343
343
|
{{ govukDateInput({
|
|
344
344
|
"id": "dob-month-error",
|
|
345
|
-
"
|
|
345
|
+
"namePrefix": "dob-month-error",
|
|
346
346
|
"fieldset": {
|
|
347
347
|
"legend": {
|
|
348
348
|
"text": "What is your date of birth?"
|
|
@@ -434,7 +434,7 @@ Find out when to use the date input component in your service in the [GOV.UK Des
|
|
|
434
434
|
|
|
435
435
|
{{ govukDateInput({
|
|
436
436
|
"id": "dob-year-error",
|
|
437
|
-
"
|
|
437
|
+
"namePrefix": "dob-year-error",
|
|
438
438
|
"fieldset": {
|
|
439
439
|
"legend": {
|
|
440
440
|
"text": "What is your date of birth?"
|
|
@@ -522,7 +522,7 @@ Find out when to use the date input component in your service in the [GOV.UK Des
|
|
|
522
522
|
|
|
523
523
|
{{ govukDateInput({
|
|
524
524
|
"id": "dob",
|
|
525
|
-
"
|
|
525
|
+
"namePrefix": "dob",
|
|
526
526
|
"fieldset": {
|
|
527
527
|
"legend": {
|
|
528
528
|
"text": "What is your date of birth?"
|
|
@@ -589,13 +589,13 @@ If you are using Nunjucks,then macros take the following arguments
|
|
|
589
589
|
|
|
590
590
|
<tr class="govuk-table__row">
|
|
591
591
|
|
|
592
|
-
<th class="govuk-table__header" scope="row">
|
|
592
|
+
<th class="govuk-table__header" scope="row">namePrefix</th>
|
|
593
593
|
|
|
594
594
|
<td class="govuk-table__cell ">string</td>
|
|
595
595
|
|
|
596
596
|
<td class="govuk-table__cell ">No</td>
|
|
597
597
|
|
|
598
|
-
<td class="govuk-table__cell ">Optional
|
|
598
|
+
<td class="govuk-table__cell ">Optional prefix. This is used to prefix each `item.name` using `-`.</td>
|
|
599
599
|
|
|
600
600
|
</tr>
|
|
601
601
|
|
|
@@ -649,6 +649,18 @@ If you are using Nunjucks,then macros take the following arguments
|
|
|
649
649
|
|
|
650
650
|
<tr class="govuk-table__row">
|
|
651
651
|
|
|
652
|
+
<th class="govuk-table__header" scope="row">items.{}.label</th>
|
|
653
|
+
|
|
654
|
+
<td class="govuk-table__cell ">string</td>
|
|
655
|
+
|
|
656
|
+
<td class="govuk-table__cell ">No</td>
|
|
657
|
+
|
|
658
|
+
<td class="govuk-table__cell ">Optional item-specific label text. If provided, this will be used instead of the items.{}.name.</td>
|
|
659
|
+
|
|
660
|
+
</tr>
|
|
661
|
+
|
|
662
|
+
<tr class="govuk-table__row">
|
|
663
|
+
|
|
652
664
|
<th class="govuk-table__header" scope="row">hint</th>
|
|
653
665
|
|
|
654
666
|
<td class="govuk-table__cell ">object</td>
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"name": "id",
|
|
4
|
+
"type": "string",
|
|
5
|
+
"required": false,
|
|
6
|
+
"description": "This is used for the main component and to compose id attribute for each item."
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"name": "namePrefix",
|
|
10
|
+
"type": "string",
|
|
11
|
+
"required": false,
|
|
12
|
+
"description": "Optional prefix. This is used to prefix each `item.name` using `-`."
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "items",
|
|
16
|
+
"type": "array",
|
|
17
|
+
"required": true,
|
|
18
|
+
"description": "An array of input objects with name, value and classes.",
|
|
19
|
+
"params": [
|
|
20
|
+
{
|
|
21
|
+
"name": "id",
|
|
22
|
+
"type": "string",
|
|
23
|
+
"required": false,
|
|
24
|
+
"description": "Item-specific id. If provided, it will be used instead of the generated id."
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "name",
|
|
28
|
+
"type": "string",
|
|
29
|
+
"required": true,
|
|
30
|
+
"description": "Item-specific name attribute."
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "label",
|
|
34
|
+
"type": "string",
|
|
35
|
+
"required": true,
|
|
36
|
+
"description": "Item-specific label text. If provided, this will be used instead of `name` for item label text."
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "value",
|
|
40
|
+
"type": "string",
|
|
41
|
+
"required": false,
|
|
42
|
+
"description": "If provided, it will be used as the initial value of the input."
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "classes",
|
|
46
|
+
"type": "string",
|
|
47
|
+
"required": false,
|
|
48
|
+
"description": "Classes to add to date input item."
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "hint",
|
|
54
|
+
"type": "object",
|
|
55
|
+
"required": false,
|
|
56
|
+
"description": "Options for the hint component.",
|
|
57
|
+
"isComponent": true
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "errorMessage",
|
|
61
|
+
"type": "object",
|
|
62
|
+
"required": false,
|
|
63
|
+
"description": "Options for the error message.",
|
|
64
|
+
"isComponent": true
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "fieldset",
|
|
68
|
+
"type": "object",
|
|
69
|
+
"required": false,
|
|
70
|
+
"description": "Options for the fieldset component (e.g. legend).",
|
|
71
|
+
"isComponent": true
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "classes",
|
|
75
|
+
"type": "string",
|
|
76
|
+
"required": false,
|
|
77
|
+
"description": "Classes to add to the date-input container."
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"name": "attributes",
|
|
81
|
+
"type": "object",
|
|
82
|
+
"required": false,
|
|
83
|
+
"description": "HTML attributes (for example data attributes) to add to the date-input container."
|
|
84
|
+
}
|
|
85
|
+
]
|
|
@@ -53,26 +53,6 @@
|
|
|
53
53
|
{%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}
|
|
54
54
|
{%- if params.id %} id="{{ params.id }}"{% endif %}>
|
|
55
55
|
{% for item in dateInputItems %}
|
|
56
|
-
|
|
57
|
-
{# Maintain backwards compatibility by automatically adding input width
|
|
58
|
-
classes based on the input name:
|
|
59
|
-
|
|
60
|
-
- If there is a width class set on this item, do nothing.
|
|
61
|
-
- Otherwise, if the input's name is 'year', add a 4 char width class
|
|
62
|
-
- Otherwise, if the input's name is 'month' or 'day', add a 2 char width class
|
|
63
|
-
- Otherwise, do nothing.
|
|
64
|
-
|
|
65
|
-
@todo Remove this behaviour in the next breaking release:
|
|
66
|
-
https://github.com/alphagov/govuk-frontend/issues/905 #}
|
|
67
|
-
{% set inputWidthClass = '' %}
|
|
68
|
-
{% if not item.classes or not 'govuk-input--width-' in item.classes %}
|
|
69
|
-
{% if item.name == 'year' %}
|
|
70
|
-
{% set inputWidthClass = 'govuk-input--width-4 ' %}
|
|
71
|
-
{% elseif item.name == 'month' or item.name == 'day' %}
|
|
72
|
-
{% set inputWidthClass = 'govuk-input--width-2 ' %}
|
|
73
|
-
{% endif %}
|
|
74
|
-
{% endif %}
|
|
75
|
-
|
|
76
56
|
<div class="govuk-date-input__item">
|
|
77
57
|
{{ govukInput({
|
|
78
58
|
label: {
|
|
@@ -80,8 +60,8 @@
|
|
|
80
60
|
classes: "govuk-date-input__label"
|
|
81
61
|
},
|
|
82
62
|
id: item.id if item.id else (params.id + "-" + item.name),
|
|
83
|
-
classes: "govuk-date-input__input " +
|
|
84
|
-
name: (params.
|
|
63
|
+
classes: "govuk-date-input__input " + (item.classes if item.classes),
|
|
64
|
+
name: (params.namePrefix + "-" + item.name) if params.namePrefix else item.name,
|
|
85
65
|
value: item.value,
|
|
86
66
|
type: "number",
|
|
87
67
|
attributes: {
|
|
@@ -42,6 +42,9 @@
|
|
|
42
42
|
// -1px offset fixes gap between background and outline in Firefox
|
|
43
43
|
outline: ($govuk-focus-width + 1px) solid $govuk-focus-colour;
|
|
44
44
|
outline-offset: -1px;
|
|
45
|
+
// When focussed, the text colour needs to be darker to ensure that colour
|
|
46
|
+
// contrast is still acceptable
|
|
47
|
+
color: $govuk-focus-text-colour;
|
|
45
48
|
background: $govuk-focus-colour;
|
|
46
49
|
}
|
|
47
50
|
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"name": "summaryText",
|
|
4
|
+
"type": "string",
|
|
5
|
+
"required": true,
|
|
6
|
+
"description": "If `summmaryHtml` is set, this is not required. Text to use within the summary element (the visible part of the details element). If `summaryHtml` is provided, the `summaryText` argument will be ignored."
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"name": "summaryHtml",
|
|
10
|
+
"type": "string",
|
|
11
|
+
"required": true,
|
|
12
|
+
"description": "If `summmaryText` is set, this is not required. HTML to use within the summary element (the visible part of the details element). If `summaryHtml` is provided, the `summaryText` argument will be ignored."
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "text",
|
|
16
|
+
"type": "string",
|
|
17
|
+
"required": true,
|
|
18
|
+
"description": "If `html` is set, this is not required. Text to use within the disclosed part of the details element. If `html` is provided, the `text` argument will be ignored."
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "html",
|
|
22
|
+
"type": "string",
|
|
23
|
+
"required": true,
|
|
24
|
+
"description": "If `text` is set, this is not required. HTML to use within the disclosed part of the details element. If `html` is provided, the `text` argument will be ignored."
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "id",
|
|
28
|
+
"type": "string",
|
|
29
|
+
"required": false,
|
|
30
|
+
"description": "Id to add to the details element."
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "open",
|
|
34
|
+
"type": "boolean",
|
|
35
|
+
"required": false,
|
|
36
|
+
"description": "If true, details element will be expanded."
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "classes",
|
|
40
|
+
"type": "string",
|
|
41
|
+
"required": false,
|
|
42
|
+
"description": "Classes to add to the `<details>` element."
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "attributes",
|
|
46
|
+
"type": "object",
|
|
47
|
+
"required": false,
|
|
48
|
+
"description": "HTML attributes (for example data attributes) to add to the `<details>` element."
|
|
49
|
+
}
|
|
50
|
+
]
|
|
@@ -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 error message. 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 error message. If `html` is provided, the `text` argument will be ignored."
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "id",
|
|
16
|
+
"type": "string",
|
|
17
|
+
"required": false,
|
|
18
|
+
"description": "Id attribute to add to the error message span tag."
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "classes",
|
|
22
|
+
"type": "string",
|
|
23
|
+
"required": false,
|
|
24
|
+
"description": "Classes to add to the error message span tag."
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "attributes",
|
|
28
|
+
"type": "object",
|
|
29
|
+
"required": false,
|
|
30
|
+
"description": "HTML attributes (for example data attributes) to add to the error message span tag"
|
|
31
|
+
}
|
|
32
|
+
]
|
|
@@ -168,6 +168,18 @@ If you are using Nunjucks,then macros take the following arguments
|
|
|
168
168
|
|
|
169
169
|
<tr class="govuk-table__row">
|
|
170
170
|
|
|
171
|
+
<th class="govuk-table__header" scope="row">errorList.{}.attributes</th>
|
|
172
|
+
|
|
173
|
+
<td class="govuk-table__cell ">object</td>
|
|
174
|
+
|
|
175
|
+
<td class="govuk-table__cell ">No</td>
|
|
176
|
+
|
|
177
|
+
<td class="govuk-table__cell ">Any extra HTML attributes (for example data attributes) to add to the error link anchor.</td>
|
|
178
|
+
|
|
179
|
+
</tr>
|
|
180
|
+
|
|
181
|
+
<tr class="govuk-table__row">
|
|
182
|
+
|
|
171
183
|
<th class="govuk-table__header" scope="row">classes</th>
|
|
172
184
|
|
|
173
185
|
<td class="govuk-table__cell ">string</td>
|