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
@@ -51,7 +51,7 @@
|
|
51
51
|
"name": "href",
|
52
52
|
"type": "string",
|
53
53
|
"required": false,
|
54
|
-
"description": "Url of the navigation item anchor.
|
54
|
+
"description": "Url of the navigation item anchor."
|
55
55
|
},
|
56
56
|
{
|
57
57
|
"name": "active",
|
@@ -73,6 +73,18 @@
|
|
73
73
|
"required": false,
|
74
74
|
"description": "Classes for the navigation section of the header."
|
75
75
|
},
|
76
|
+
{
|
77
|
+
"name": "navigationLabel",
|
78
|
+
"type": "string",
|
79
|
+
"required": false,
|
80
|
+
"description": "Text for the `aria-label` attribute of the navigation. Defaults to \"Navigation menu\"."
|
81
|
+
},
|
82
|
+
{
|
83
|
+
"name": "menuButtonLabel",
|
84
|
+
"type": "string",
|
85
|
+
"required": false,
|
86
|
+
"description": "Text for the `aria-label` attribute of the button that toggles the navigation. Defaults to \"Show or hide navigation menu\"."
|
87
|
+
},
|
76
88
|
{
|
77
89
|
"name": "containerClasses",
|
78
90
|
"type": "string",
|
@@ -60,15 +60,19 @@
|
|
60
60
|
</a>
|
61
61
|
{% endif %}
|
62
62
|
{% if params.navigation %}
|
63
|
-
<button type="button" class="govuk-header__menu-button govuk-js-header-toggle" aria-controls="navigation" aria-label="Show or hide
|
63
|
+
<button type="button" class="govuk-header__menu-button govuk-js-header-toggle" aria-controls="navigation" aria-label="{{ params.menuButtonLabel | default('Show or hide navigation menu') }}">Menu</button>
|
64
64
|
<nav>
|
65
|
-
<ul id="navigation" class="govuk-header__navigation {{ params.navigationClasses if params.navigationClasses }}" aria-label="
|
65
|
+
<ul id="navigation" class="govuk-header__navigation {{ params.navigationClasses if params.navigationClasses }}" aria-label="{{ params.navigationLabel | default('Navigation menu') }}">
|
66
66
|
{% for item in params.navigation %}
|
67
|
-
{% if item.
|
67
|
+
{% if item.text or item.html %}
|
68
68
|
<li class="govuk-header__navigation-item{{ ' govuk-header__navigation-item--active' if item.active }}">
|
69
|
-
|
69
|
+
{% if item.href %}
|
70
|
+
<a class="govuk-header__link" href="{{ item.href }}"{% for attribute, value in item.attributes %} {{attribute}}="{{value}}"{% endfor %}>
|
71
|
+
{% endif %}
|
70
72
|
{{ item.html | safe if item.html else item.text }}
|
71
|
-
|
73
|
+
{% if item.href %}
|
74
|
+
</a>
|
75
|
+
{% endif %}
|
72
76
|
</li>
|
73
77
|
{% endif %}
|
74
78
|
{% endfor %}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
{
|
2
|
+
"component": "hint",
|
3
|
+
"fixtures": [
|
4
|
+
{
|
5
|
+
"name": "default",
|
6
|
+
"options": {
|
7
|
+
"text": "It's on your National Insurance card, benefit letter, payslip or P60.\nFor example, 'QQ 12 34 56 C'.\n"
|
8
|
+
},
|
9
|
+
"html": "<div class=\"govuk-hint\">\n It's on your National Insurance card, benefit letter, payslip or P60.\nFor example, 'QQ 12 34 56 C'.\n\n</div>"
|
10
|
+
},
|
11
|
+
{
|
12
|
+
"name": "with html",
|
13
|
+
"options": {
|
14
|
+
"html": "It's on your National Insurance card, benefit letter, payslip or <a class=\"govuk-link\" href=\"#\">P60</a>.\nFor example, 'QQ 12 34 56 C'.\n"
|
15
|
+
},
|
16
|
+
"html": "<div class=\"govuk-hint\">\n It's on your National Insurance card, benefit letter, payslip or <a class=\"govuk-link\" href=\"#\">P60</a>.\nFor example, 'QQ 12 34 56 C'.\n\n</div>"
|
17
|
+
},
|
18
|
+
{
|
19
|
+
"name": "classes",
|
20
|
+
"options": {
|
21
|
+
"id": "example-hint",
|
22
|
+
"classes": "app-hint--custom-modifier"
|
23
|
+
},
|
24
|
+
"html": "<div id=\"example-hint\" class=\"govuk-hint app-hint--custom-modifier\">\n \n</div>"
|
25
|
+
},
|
26
|
+
{
|
27
|
+
"name": "id",
|
28
|
+
"options": {
|
29
|
+
"id": "my-hint"
|
30
|
+
},
|
31
|
+
"html": "<div id=\"my-hint\" class=\"govuk-hint\">\n \n</div>"
|
32
|
+
},
|
33
|
+
{
|
34
|
+
"name": "html as text",
|
35
|
+
"options": {
|
36
|
+
"text": "Unexpected <strong>bold text</strong> in body"
|
37
|
+
},
|
38
|
+
"html": "<div class=\"govuk-hint\">\n Unexpected <strong>bold text</strong> in body\n</div>"
|
39
|
+
},
|
40
|
+
{
|
41
|
+
"name": "attributes",
|
42
|
+
"options": {
|
43
|
+
"attributes": {
|
44
|
+
"data-attribute": "my data value"
|
45
|
+
}
|
46
|
+
},
|
47
|
+
"html": "<div class=\"govuk-hint\" data-attribute=\"my data value\">\n \n</div>"
|
48
|
+
}
|
49
|
+
]
|
50
|
+
}
|
@@ -93,4 +93,95 @@
|
|
93
93
|
max-width: 5.4ex;
|
94
94
|
}
|
95
95
|
|
96
|
+
.govuk-input__wrapper {
|
97
|
+
display: -webkit-box;
|
98
|
+
display: -ms-flexbox;
|
99
|
+
display: flex;
|
100
|
+
|
101
|
+
.govuk-input {
|
102
|
+
-webkit-box-flex: 0;
|
103
|
+
-ms-flex: 0 1 auto;
|
104
|
+
flex: 0 1 auto;
|
105
|
+
}
|
106
|
+
|
107
|
+
.govuk-input:focus {
|
108
|
+
// Hack to stop focus style being overlapped by the suffix
|
109
|
+
z-index: 1;
|
110
|
+
}
|
111
|
+
|
112
|
+
// Split prefix/suffix onto separate lines on narrow screens
|
113
|
+
@include govuk-media-query($until: mobile) {
|
114
|
+
display: block;
|
115
|
+
|
116
|
+
.govuk-input {
|
117
|
+
// Set max-width to override potential width override class on the input
|
118
|
+
max-width: 100%;
|
119
|
+
}
|
120
|
+
}
|
121
|
+
}
|
122
|
+
|
123
|
+
.govuk-input__prefix,
|
124
|
+
.govuk-input__suffix {
|
125
|
+
@include govuk-font($size: 19);
|
126
|
+
|
127
|
+
box-sizing: border-box;
|
128
|
+
display: inline-block;
|
129
|
+
min-width: 40px;
|
130
|
+
@if $govuk-typography-use-rem {
|
131
|
+
min-width: govuk-px-to-rem(40px);
|
132
|
+
}
|
133
|
+
height: 40px;
|
134
|
+
@if $govuk-typography-use-rem {
|
135
|
+
height: govuk-px-to-rem(40px);
|
136
|
+
}
|
137
|
+
|
138
|
+
padding: govuk-spacing(1);
|
139
|
+
border: $govuk-border-width-form-element solid $govuk-input-border-colour;
|
140
|
+
background-color: govuk-colour("light-grey", $legacy: "grey-3");
|
141
|
+
|
142
|
+
text-align: center;
|
143
|
+
@include govuk-media-query($until: tablet) {
|
144
|
+
line-height: 1.6;
|
145
|
+
}
|
146
|
+
white-space: nowrap;
|
147
|
+
|
148
|
+
// Emphasise non-editable status of prefixes and suffixes
|
149
|
+
cursor: default;
|
150
|
+
|
151
|
+
-webkit-box-flex: 0;
|
152
|
+
|
153
|
+
-ms-flex: 0 0 auto;
|
154
|
+
|
155
|
+
flex: 0 0 auto;
|
156
|
+
|
157
|
+
// Split prefix/suffix onto separate lines on narrow screens
|
158
|
+
@include govuk-media-query($until: mobile) {
|
159
|
+
display: block;
|
160
|
+
height: 100%;
|
161
|
+
white-space: normal;
|
162
|
+
}
|
163
|
+
}
|
164
|
+
|
165
|
+
.govuk-input__prefix {
|
166
|
+
@include govuk-media-query($until: mobile) {
|
167
|
+
border-bottom: 0;
|
168
|
+
}
|
169
|
+
@include govuk-media-query($from: mobile) {
|
170
|
+
@include govuk-not-ie8 {
|
171
|
+
border-right: 0;
|
172
|
+
}
|
173
|
+
}
|
174
|
+
}
|
175
|
+
|
176
|
+
// Split prefix/suffix onto separate lines on narrow screens
|
177
|
+
.govuk-input__suffix {
|
178
|
+
@include govuk-media-query($until: mobile) {
|
179
|
+
border-top: 0;
|
180
|
+
}
|
181
|
+
@include govuk-media-query($from: mobile) {
|
182
|
+
@include govuk-not-ie8 {
|
183
|
+
border-left: 0;
|
184
|
+
}
|
185
|
+
}
|
186
|
+
}
|
96
187
|
}
|
@@ -0,0 +1,538 @@
|
|
1
|
+
{
|
2
|
+
"component": "input",
|
3
|
+
"fixtures": [
|
4
|
+
{
|
5
|
+
"name": "default",
|
6
|
+
"options": {
|
7
|
+
"label": {
|
8
|
+
"text": "National Insurance number"
|
9
|
+
},
|
10
|
+
"id": "input-example",
|
11
|
+
"name": "test-name"
|
12
|
+
},
|
13
|
+
"html": "<div class=\"govuk-form-group\">\n <label class=\"govuk-label\" for=\"input-example\">\n National Insurance number\n </label>\n\n<input class=\"govuk-input\" id=\"input-example\" name=\"test-name\" type=\"text\">\n</div>"
|
14
|
+
},
|
15
|
+
{
|
16
|
+
"name": "with hint text",
|
17
|
+
"options": {
|
18
|
+
"label": {
|
19
|
+
"text": "National insurance number"
|
20
|
+
},
|
21
|
+
"hint": {
|
22
|
+
"text": "It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’."
|
23
|
+
},
|
24
|
+
"id": "input-with-hint-text",
|
25
|
+
"name": "test-name-2"
|
26
|
+
},
|
27
|
+
"html": "<div class=\"govuk-form-group\">\n <label class=\"govuk-label\" for=\"input-with-hint-text\">\n National insurance number\n </label>\n\n \n \n <div id=\"input-with-hint-text-hint\" class=\"govuk-hint\">\n It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’.\n </div>\n\n<input class=\"govuk-input\" id=\"input-with-hint-text\" name=\"test-name-2\" type=\"text\" aria-describedby=\"input-with-hint-text-hint\">\n</div>"
|
28
|
+
},
|
29
|
+
{
|
30
|
+
"name": "with error message",
|
31
|
+
"options": {
|
32
|
+
"label": {
|
33
|
+
"text": "National Insurance number"
|
34
|
+
},
|
35
|
+
"hint": {
|
36
|
+
"text": "It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’."
|
37
|
+
},
|
38
|
+
"id": "input-with-error-message",
|
39
|
+
"name": "test-name-3",
|
40
|
+
"errorMessage": {
|
41
|
+
"text": "Error message goes here"
|
42
|
+
}
|
43
|
+
},
|
44
|
+
"html": "<div class=\"govuk-form-group govuk-form-group--error\">\n <label class=\"govuk-label\" for=\"input-with-error-message\">\n National Insurance number\n </label>\n\n \n \n <div id=\"input-with-error-message-hint\" class=\"govuk-hint\">\n It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’.\n </div>\n\n\n \n \n <span id=\"input-with-error-message-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error:</span> Error message goes here\n </span>\n<input class=\"govuk-input govuk-input--error\" id=\"input-with-error-message\" name=\"test-name-3\" type=\"text\" aria-describedby=\"input-with-error-message-hint input-with-error-message-error\">\n</div>"
|
45
|
+
},
|
46
|
+
{
|
47
|
+
"name": "with width-2 class",
|
48
|
+
"options": {
|
49
|
+
"label": {
|
50
|
+
"text": "National insurance number"
|
51
|
+
},
|
52
|
+
"hint": {
|
53
|
+
"text": "It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’."
|
54
|
+
},
|
55
|
+
"id": "input-width-2",
|
56
|
+
"name": "test-width-2",
|
57
|
+
"classes": "govuk-input--width-2"
|
58
|
+
},
|
59
|
+
"html": "<div class=\"govuk-form-group\">\n <label class=\"govuk-label\" for=\"input-width-2\">\n National insurance number\n </label>\n\n \n \n <div id=\"input-width-2-hint\" class=\"govuk-hint\">\n It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’.\n </div>\n\n<input class=\"govuk-input govuk-input--width-2\" id=\"input-width-2\" name=\"test-width-2\" type=\"text\" aria-describedby=\"input-width-2-hint\">\n</div>"
|
60
|
+
},
|
61
|
+
{
|
62
|
+
"name": "with width-3 class",
|
63
|
+
"options": {
|
64
|
+
"label": {
|
65
|
+
"text": "National insurance number"
|
66
|
+
},
|
67
|
+
"hint": {
|
68
|
+
"text": "It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’."
|
69
|
+
},
|
70
|
+
"id": "input-width-3",
|
71
|
+
"name": "test-width-3",
|
72
|
+
"classes": "govuk-input--width-3"
|
73
|
+
},
|
74
|
+
"html": "<div class=\"govuk-form-group\">\n <label class=\"govuk-label\" for=\"input-width-3\">\n National insurance number\n </label>\n\n \n \n <div id=\"input-width-3-hint\" class=\"govuk-hint\">\n It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’.\n </div>\n\n<input class=\"govuk-input govuk-input--width-3\" id=\"input-width-3\" name=\"test-width-3\" type=\"text\" aria-describedby=\"input-width-3-hint\">\n</div>"
|
75
|
+
},
|
76
|
+
{
|
77
|
+
"name": "with width-4 class",
|
78
|
+
"options": {
|
79
|
+
"label": {
|
80
|
+
"text": "National insurance number"
|
81
|
+
},
|
82
|
+
"hint": {
|
83
|
+
"text": "It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’."
|
84
|
+
},
|
85
|
+
"id": "input-width-4",
|
86
|
+
"name": "test-width-4",
|
87
|
+
"classes": "govuk-input--width-4"
|
88
|
+
},
|
89
|
+
"html": "<div class=\"govuk-form-group\">\n <label class=\"govuk-label\" for=\"input-width-4\">\n National insurance number\n </label>\n\n \n \n <div id=\"input-width-4-hint\" class=\"govuk-hint\">\n It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’.\n </div>\n\n<input class=\"govuk-input govuk-input--width-4\" id=\"input-width-4\" name=\"test-width-4\" type=\"text\" aria-describedby=\"input-width-4-hint\">\n</div>"
|
90
|
+
},
|
91
|
+
{
|
92
|
+
"name": "with width-5 class",
|
93
|
+
"options": {
|
94
|
+
"label": {
|
95
|
+
"text": "National insurance number"
|
96
|
+
},
|
97
|
+
"hint": {
|
98
|
+
"text": "It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’."
|
99
|
+
},
|
100
|
+
"id": "input-width-5",
|
101
|
+
"name": "test-width-5",
|
102
|
+
"classes": "govuk-input--width-5"
|
103
|
+
},
|
104
|
+
"html": "<div class=\"govuk-form-group\">\n <label class=\"govuk-label\" for=\"input-width-5\">\n National insurance number\n </label>\n\n \n \n <div id=\"input-width-5-hint\" class=\"govuk-hint\">\n It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’.\n </div>\n\n<input class=\"govuk-input govuk-input--width-5\" id=\"input-width-5\" name=\"test-width-5\" type=\"text\" aria-describedby=\"input-width-5-hint\">\n</div>"
|
105
|
+
},
|
106
|
+
{
|
107
|
+
"name": "with width-10 class",
|
108
|
+
"options": {
|
109
|
+
"label": {
|
110
|
+
"text": "National insurance number"
|
111
|
+
},
|
112
|
+
"hint": {
|
113
|
+
"text": "It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’."
|
114
|
+
},
|
115
|
+
"id": "input-width-10",
|
116
|
+
"name": "test-width-10",
|
117
|
+
"classes": "govuk-input--width-10"
|
118
|
+
},
|
119
|
+
"html": "<div class=\"govuk-form-group\">\n <label class=\"govuk-label\" for=\"input-width-10\">\n National insurance number\n </label>\n\n \n \n <div id=\"input-width-10-hint\" class=\"govuk-hint\">\n It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’.\n </div>\n\n<input class=\"govuk-input govuk-input--width-10\" id=\"input-width-10\" name=\"test-width-10\" type=\"text\" aria-describedby=\"input-width-10-hint\">\n</div>"
|
120
|
+
},
|
121
|
+
{
|
122
|
+
"name": "with width-20 class",
|
123
|
+
"options": {
|
124
|
+
"label": {
|
125
|
+
"text": "National insurance number"
|
126
|
+
},
|
127
|
+
"hint": {
|
128
|
+
"text": "It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’."
|
129
|
+
},
|
130
|
+
"id": "input-width-20",
|
131
|
+
"name": "test-width-20",
|
132
|
+
"classes": "govuk-input--width-20"
|
133
|
+
},
|
134
|
+
"html": "<div class=\"govuk-form-group\">\n <label class=\"govuk-label\" for=\"input-width-20\">\n National insurance number\n </label>\n\n \n \n <div id=\"input-width-20-hint\" class=\"govuk-hint\">\n It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’.\n </div>\n\n<input class=\"govuk-input govuk-input--width-20\" id=\"input-width-20\" name=\"test-width-20\" type=\"text\" aria-describedby=\"input-width-20-hint\">\n</div>"
|
135
|
+
},
|
136
|
+
{
|
137
|
+
"name": "with width-30 class",
|
138
|
+
"options": {
|
139
|
+
"label": {
|
140
|
+
"text": "National insurance number"
|
141
|
+
},
|
142
|
+
"hint": {
|
143
|
+
"text": "It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’."
|
144
|
+
},
|
145
|
+
"id": "input-width-30",
|
146
|
+
"name": "test-width-30",
|
147
|
+
"classes": "govuk-input--width-30"
|
148
|
+
},
|
149
|
+
"html": "<div class=\"govuk-form-group\">\n <label class=\"govuk-label\" for=\"input-width-30\">\n National insurance number\n </label>\n\n \n \n <div id=\"input-width-30-hint\" class=\"govuk-hint\">\n It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’.\n </div>\n\n<input class=\"govuk-input govuk-input--width-30\" id=\"input-width-30\" name=\"test-width-30\" type=\"text\" aria-describedby=\"input-width-30-hint\">\n</div>"
|
150
|
+
},
|
151
|
+
{
|
152
|
+
"name": "with label as page heading",
|
153
|
+
"options": {
|
154
|
+
"label": {
|
155
|
+
"text": "National Insurance number",
|
156
|
+
"isPageHeading": true
|
157
|
+
},
|
158
|
+
"id": "input-with-page-heading",
|
159
|
+
"name": "test-name"
|
160
|
+
},
|
161
|
+
"html": "<div class=\"govuk-form-group\">\n <h1 class=\"govuk-label-wrapper\">\n <label class=\"govuk-label\" for=\"input-with-page-heading\">\n National Insurance number\n </label>\n </h1>\n\n<input class=\"govuk-input\" id=\"input-with-page-heading\" name=\"test-name\" type=\"text\">\n</div>"
|
162
|
+
},
|
163
|
+
{
|
164
|
+
"name": "with optional form-group classes",
|
165
|
+
"options": {
|
166
|
+
"label": {
|
167
|
+
"text": "National Insurance number"
|
168
|
+
},
|
169
|
+
"id": "input-example",
|
170
|
+
"name": "test-name",
|
171
|
+
"formGroup": {
|
172
|
+
"classes": "extra-class"
|
173
|
+
}
|
174
|
+
},
|
175
|
+
"html": "<div class=\"govuk-form-group extra-class\">\n <label class=\"govuk-label\" for=\"input-example\">\n National Insurance number\n </label>\n\n<input class=\"govuk-input\" id=\"input-example\" name=\"test-name\" type=\"text\">\n</div>"
|
176
|
+
},
|
177
|
+
{
|
178
|
+
"name": "with autocomplete attribute",
|
179
|
+
"options": {
|
180
|
+
"label": {
|
181
|
+
"text": "Postcode"
|
182
|
+
},
|
183
|
+
"id": "input-with-autocomplete-attribute",
|
184
|
+
"name": "postcode",
|
185
|
+
"autocomplete": "postal-code"
|
186
|
+
},
|
187
|
+
"html": "<div class=\"govuk-form-group\">\n <label class=\"govuk-label\" for=\"input-with-autocomplete-attribute\">\n Postcode\n </label>\n\n<input class=\"govuk-input\" id=\"input-with-autocomplete-attribute\" name=\"postcode\" type=\"text\" autocomplete=\"postal-code\">\n</div>"
|
188
|
+
},
|
189
|
+
{
|
190
|
+
"name": "with pattern attribute",
|
191
|
+
"options": {
|
192
|
+
"label": {
|
193
|
+
"text": "Numbers only"
|
194
|
+
},
|
195
|
+
"id": "input-with-pattern-attribute",
|
196
|
+
"name": "numbers-only",
|
197
|
+
"type": "number",
|
198
|
+
"pattern": "[0-9]*"
|
199
|
+
},
|
200
|
+
"html": "<div class=\"govuk-form-group\">\n <label class=\"govuk-label\" for=\"input-with-pattern-attribute\">\n Numbers only\n </label>\n\n<input class=\"govuk-input\" id=\"input-with-pattern-attribute\" name=\"numbers-only\" type=\"number\" pattern=\"[0-9]*\">\n</div>"
|
201
|
+
},
|
202
|
+
{
|
203
|
+
"name": "with spellcheck enabled",
|
204
|
+
"options": {
|
205
|
+
"label": {
|
206
|
+
"text": "Spellcheck is enabled"
|
207
|
+
},
|
208
|
+
"id": "input-with-spellcheck-enabled",
|
209
|
+
"name": "spellcheck",
|
210
|
+
"type": "text",
|
211
|
+
"spellcheck": true
|
212
|
+
},
|
213
|
+
"html": "<div class=\"govuk-form-group\">\n <label class=\"govuk-label\" for=\"input-with-spellcheck-enabled\">\n Spellcheck is enabled\n </label>\n\n<input class=\"govuk-input\" id=\"input-with-spellcheck-enabled\" name=\"spellcheck\" type=\"text\" spellcheck=\"true\">\n</div>"
|
214
|
+
},
|
215
|
+
{
|
216
|
+
"name": "with spellcheck disabled",
|
217
|
+
"options": {
|
218
|
+
"label": {
|
219
|
+
"text": "Spellcheck is disabled"
|
220
|
+
},
|
221
|
+
"id": "input-with-spellcheck-disabled",
|
222
|
+
"name": "spellcheck",
|
223
|
+
"type": "text",
|
224
|
+
"spellcheck": false
|
225
|
+
},
|
226
|
+
"html": "<div class=\"govuk-form-group\">\n <label class=\"govuk-label\" for=\"input-with-spellcheck-disabled\">\n Spellcheck is disabled\n </label>\n\n<input class=\"govuk-input\" id=\"input-with-spellcheck-disabled\" name=\"spellcheck\" type=\"text\" spellcheck=\"false\">\n</div>"
|
227
|
+
},
|
228
|
+
{
|
229
|
+
"name": "with prefix",
|
230
|
+
"options": {
|
231
|
+
"label": {
|
232
|
+
"text": "Amount, in pounds"
|
233
|
+
},
|
234
|
+
"id": "input-with-prefix",
|
235
|
+
"name": "amount",
|
236
|
+
"prefix": {
|
237
|
+
"text": "£"
|
238
|
+
}
|
239
|
+
},
|
240
|
+
"html": "<div class=\"govuk-form-group\">\n <label class=\"govuk-label\" for=\"input-with-prefix\">\n Amount, in pounds\n </label>\n\n<div class=\"govuk-input__wrapper\">\n <div class=\"govuk-input__prefix\" aria-hidden=\"true\">£</div>\n <input class=\"govuk-input\" id=\"input-with-prefix\" name=\"amount\" type=\"text\"></div>\n</div>"
|
241
|
+
},
|
242
|
+
{
|
243
|
+
"name": "with suffix",
|
244
|
+
"options": {
|
245
|
+
"label": {
|
246
|
+
"text": "Weight, in kilograms"
|
247
|
+
},
|
248
|
+
"id": "input-with-suffix",
|
249
|
+
"name": "weight",
|
250
|
+
"suffix": {
|
251
|
+
"text": "kg"
|
252
|
+
}
|
253
|
+
},
|
254
|
+
"html": "<div class=\"govuk-form-group\">\n <label class=\"govuk-label\" for=\"input-with-suffix\">\n Weight, in kilograms\n </label>\n\n<div class=\"govuk-input__wrapper\"><input class=\"govuk-input\" id=\"input-with-suffix\" name=\"weight\" type=\"text\">\n <div class=\"govuk-input__suffix\" aria-hidden=\"true\">kg</div>\n </div>\n</div>"
|
255
|
+
},
|
256
|
+
{
|
257
|
+
"name": "with prefix and suffix",
|
258
|
+
"options": {
|
259
|
+
"label": {
|
260
|
+
"text": "Cost per item, in pounds"
|
261
|
+
},
|
262
|
+
"id": "input-with-prefix-suffix",
|
263
|
+
"name": "cost",
|
264
|
+
"prefix": {
|
265
|
+
"text": "£"
|
266
|
+
},
|
267
|
+
"suffix": {
|
268
|
+
"text": "per item"
|
269
|
+
}
|
270
|
+
},
|
271
|
+
"html": "<div class=\"govuk-form-group\">\n <label class=\"govuk-label\" for=\"input-with-prefix-suffix\">\n Cost per item, in pounds\n </label>\n\n<div class=\"govuk-input__wrapper\">\n <div class=\"govuk-input__prefix\" aria-hidden=\"true\">£</div>\n <input class=\"govuk-input\" id=\"input-with-prefix-suffix\" name=\"cost\" type=\"text\">\n <div class=\"govuk-input__suffix\" aria-hidden=\"true\">per item</div>\n </div>\n</div>"
|
272
|
+
},
|
273
|
+
{
|
274
|
+
"name": "with prefix and long suffix",
|
275
|
+
"options": {
|
276
|
+
"label": {
|
277
|
+
"text": "Cost per item, in pounds, per household member"
|
278
|
+
},
|
279
|
+
"id": "input-with-prefix-suffix",
|
280
|
+
"name": "cost",
|
281
|
+
"prefix": {
|
282
|
+
"text": "£"
|
283
|
+
},
|
284
|
+
"suffix": {
|
285
|
+
"text": "per household member"
|
286
|
+
}
|
287
|
+
},
|
288
|
+
"html": "<div class=\"govuk-form-group\">\n <label class=\"govuk-label\" for=\"input-with-prefix-suffix\">\n Cost per item, in pounds, per household member\n </label>\n\n<div class=\"govuk-input__wrapper\">\n <div class=\"govuk-input__prefix\" aria-hidden=\"true\">£</div>\n <input class=\"govuk-input\" id=\"input-with-prefix-suffix\" name=\"cost\" type=\"text\">\n <div class=\"govuk-input__suffix\" aria-hidden=\"true\">per household member</div>\n </div>\n</div>"
|
289
|
+
},
|
290
|
+
{
|
291
|
+
"name": "with prefix and suffix and error",
|
292
|
+
"options": {
|
293
|
+
"label": {
|
294
|
+
"text": "Cost per item, in pounds"
|
295
|
+
},
|
296
|
+
"id": "input-with-prefix-suffix",
|
297
|
+
"name": "cost",
|
298
|
+
"prefix": {
|
299
|
+
"text": "£"
|
300
|
+
},
|
301
|
+
"suffix": {
|
302
|
+
"text": "per item"
|
303
|
+
},
|
304
|
+
"errorMessage": {
|
305
|
+
"text": "Error message goes here"
|
306
|
+
}
|
307
|
+
},
|
308
|
+
"html": "<div class=\"govuk-form-group govuk-form-group--error\">\n <label class=\"govuk-label\" for=\"input-with-prefix-suffix\">\n Cost per item, in pounds\n </label>\n\n\n \n \n <span id=\"input-with-prefix-suffix-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error:</span> Error message goes here\n </span>\n<div class=\"govuk-input__wrapper\">\n <div class=\"govuk-input__prefix\" aria-hidden=\"true\">£</div>\n <input class=\"govuk-input govuk-input--error\" id=\"input-with-prefix-suffix\" name=\"cost\" type=\"text\" aria-describedby=\"input-with-prefix-suffix-error\">\n <div class=\"govuk-input__suffix\" aria-hidden=\"true\">per item</div>\n </div>\n</div>"
|
309
|
+
},
|
310
|
+
{
|
311
|
+
"name": "with prefix and suffix and width modifier",
|
312
|
+
"options": {
|
313
|
+
"label": {
|
314
|
+
"text": "Cost per item, in pounds"
|
315
|
+
},
|
316
|
+
"id": "input-with-prefix-suffix",
|
317
|
+
"name": "cost",
|
318
|
+
"classes": "govuk-input--width-5",
|
319
|
+
"prefix": {
|
320
|
+
"text": "£"
|
321
|
+
},
|
322
|
+
"suffix": {
|
323
|
+
"text": "per item"
|
324
|
+
}
|
325
|
+
},
|
326
|
+
"html": "<div class=\"govuk-form-group\">\n <label class=\"govuk-label\" for=\"input-with-prefix-suffix\">\n Cost per item, in pounds\n </label>\n\n<div class=\"govuk-input__wrapper\">\n <div class=\"govuk-input__prefix\" aria-hidden=\"true\">£</div>\n <input class=\"govuk-input govuk-input--width-5\" id=\"input-with-prefix-suffix\" name=\"cost\" type=\"text\">\n <div class=\"govuk-input__suffix\" aria-hidden=\"true\">per item</div>\n </div>\n</div>"
|
327
|
+
},
|
328
|
+
{
|
329
|
+
"name": "classes",
|
330
|
+
"options": {
|
331
|
+
"classes": "app-input--custom-modifier"
|
332
|
+
},
|
333
|
+
"html": "<div class=\"govuk-form-group\">\n \n\n<input class=\"govuk-input app-input--custom-modifier\" id=\"\" name=\"\" type=\"text\">\n</div>"
|
334
|
+
},
|
335
|
+
{
|
336
|
+
"name": "custom type",
|
337
|
+
"options": {
|
338
|
+
"type": "number"
|
339
|
+
},
|
340
|
+
"html": "<div class=\"govuk-form-group\">\n \n\n<input class=\"govuk-input\" id=\"\" name=\"\" type=\"number\">\n</div>"
|
341
|
+
},
|
342
|
+
{
|
343
|
+
"name": "value",
|
344
|
+
"options": {
|
345
|
+
"value": "QQ 12 34 56 C"
|
346
|
+
},
|
347
|
+
"html": "<div class=\"govuk-form-group\">\n \n\n<input class=\"govuk-input\" id=\"\" name=\"\" type=\"text\" value=\"QQ 12 34 56 C\">\n</div>"
|
348
|
+
},
|
349
|
+
{
|
350
|
+
"name": "with describedBy",
|
351
|
+
"options": {
|
352
|
+
"describedBy": "some-id"
|
353
|
+
},
|
354
|
+
"html": "<div class=\"govuk-form-group\">\n \n\n<input class=\"govuk-input\" id=\"\" name=\"\" type=\"text\" aria-describedby=\"some-id\">\n</div>"
|
355
|
+
},
|
356
|
+
{
|
357
|
+
"name": "attributes",
|
358
|
+
"options": {
|
359
|
+
"attributes": {
|
360
|
+
"data-attribute": "my data value"
|
361
|
+
}
|
362
|
+
},
|
363
|
+
"html": "<div class=\"govuk-form-group\">\n \n\n<input class=\"govuk-input\" id=\"\" name=\"\" type=\"text\" data-attribute=\"my data value\">\n</div>"
|
364
|
+
},
|
365
|
+
{
|
366
|
+
"name": "hint with describedBy",
|
367
|
+
"options": {
|
368
|
+
"describedBy": "some-id",
|
369
|
+
"hint": {
|
370
|
+
"text": "It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’."
|
371
|
+
}
|
372
|
+
},
|
373
|
+
"html": "<div class=\"govuk-form-group\">\n \n\n \n \n <div id=\"undefined-hint\" class=\"govuk-hint\">\n It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’.\n </div>\n\n<input class=\"govuk-input\" id=\"\" name=\"\" type=\"text\" aria-describedby=\"some-id undefined-hint\">\n</div>"
|
374
|
+
},
|
375
|
+
{
|
376
|
+
"name": "error with describedBy",
|
377
|
+
"options": {
|
378
|
+
"describedBy": "some-id",
|
379
|
+
"errorMessage": {
|
380
|
+
"text": "Error message"
|
381
|
+
}
|
382
|
+
},
|
383
|
+
"html": "<div class=\"govuk-form-group govuk-form-group--error\">\n \n\n\n \n \n <span id=\"undefined-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error:</span> Error message\n </span>\n<input class=\"govuk-input govuk-input--error\" id=\"\" name=\"\" type=\"text\" aria-describedby=\"some-id undefined-error\">\n</div>"
|
384
|
+
},
|
385
|
+
{
|
386
|
+
"name": "with error and hint",
|
387
|
+
"options": {
|
388
|
+
"errorMessage": {
|
389
|
+
"text": "Error message"
|
390
|
+
},
|
391
|
+
"hint": {
|
392
|
+
"text": "Hint"
|
393
|
+
}
|
394
|
+
},
|
395
|
+
"html": "<div class=\"govuk-form-group govuk-form-group--error\">\n \n\n \n \n <div id=\"undefined-hint\" class=\"govuk-hint\">\n Hint\n </div>\n\n\n \n \n <span id=\"undefined-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error:</span> Error message\n </span>\n<input class=\"govuk-input govuk-input--error\" id=\"\" name=\"\" type=\"text\" aria-describedby=\"undefined-hint undefined-error\">\n</div>"
|
396
|
+
},
|
397
|
+
{
|
398
|
+
"name": "with error, hint and describedBy",
|
399
|
+
"options": {
|
400
|
+
"errorMessage": {
|
401
|
+
"text": "Error message"
|
402
|
+
},
|
403
|
+
"hint": {
|
404
|
+
"text": "Hint"
|
405
|
+
},
|
406
|
+
"describedBy": "some-id"
|
407
|
+
},
|
408
|
+
"html": "<div class=\"govuk-form-group govuk-form-group--error\">\n \n\n \n \n <div id=\"undefined-hint\" class=\"govuk-hint\">\n Hint\n </div>\n\n\n \n \n <span id=\"undefined-error\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error:</span> Error message\n </span>\n<input class=\"govuk-input govuk-input--error\" id=\"\" name=\"\" type=\"text\" aria-describedby=\"some-id undefined-hint undefined-error\">\n</div>"
|
409
|
+
},
|
410
|
+
{
|
411
|
+
"name": "inputmode",
|
412
|
+
"options": {
|
413
|
+
"inputmode": "decimal"
|
414
|
+
},
|
415
|
+
"html": "<div class=\"govuk-form-group\">\n \n\n<input class=\"govuk-input\" id=\"\" name=\"\" type=\"text\" inputmode=\"decimal\">\n</div>"
|
416
|
+
},
|
417
|
+
{
|
418
|
+
"name": "with prefix with html as text",
|
419
|
+
"options": {
|
420
|
+
"label": {
|
421
|
+
"text": "Amount, in pounds"
|
422
|
+
},
|
423
|
+
"id": "input-with-prefix",
|
424
|
+
"name": "amount",
|
425
|
+
"prefix": {
|
426
|
+
"text": "<span>£</span>"
|
427
|
+
}
|
428
|
+
},
|
429
|
+
"html": "<div class=\"govuk-form-group\">\n <label class=\"govuk-label\" for=\"input-with-prefix\">\n Amount, in pounds\n </label>\n\n<div class=\"govuk-input__wrapper\">\n <div class=\"govuk-input__prefix\" aria-hidden=\"true\"><span>£</span></div>\n <input class=\"govuk-input\" id=\"input-with-prefix\" name=\"amount\" type=\"text\"></div>\n</div>"
|
430
|
+
},
|
431
|
+
{
|
432
|
+
"name": "with prefix with html",
|
433
|
+
"options": {
|
434
|
+
"label": {
|
435
|
+
"html": "Amount, in pounds"
|
436
|
+
},
|
437
|
+
"id": "input-with-prefix",
|
438
|
+
"name": "amount",
|
439
|
+
"prefix": {
|
440
|
+
"html": "<span>£</span>"
|
441
|
+
}
|
442
|
+
},
|
443
|
+
"html": "<div class=\"govuk-form-group\">\n <label class=\"govuk-label\" for=\"input-with-prefix\">\n Amount, in pounds\n </label>\n\n<div class=\"govuk-input__wrapper\">\n <div class=\"govuk-input__prefix\" aria-hidden=\"true\"><span>£</span></div>\n <input class=\"govuk-input\" id=\"input-with-prefix\" name=\"amount\" type=\"text\"></div>\n</div>"
|
444
|
+
},
|
445
|
+
{
|
446
|
+
"name": "with prefix with classes",
|
447
|
+
"options": {
|
448
|
+
"label": {
|
449
|
+
"text": "Amount, in pounds"
|
450
|
+
},
|
451
|
+
"id": "input-with-prefix-element",
|
452
|
+
"name": "amount",
|
453
|
+
"prefix": {
|
454
|
+
"text": "£",
|
455
|
+
"classes": "app-input__prefix--custom-modifier"
|
456
|
+
}
|
457
|
+
},
|
458
|
+
"html": "<div class=\"govuk-form-group\">\n <label class=\"govuk-label\" for=\"input-with-prefix-element\">\n Amount, in pounds\n </label>\n\n<div class=\"govuk-input__wrapper\">\n <div class=\"govuk-input__prefix app-input__prefix--custom-modifier\" aria-hidden=\"true\">£</div>\n <input class=\"govuk-input\" id=\"input-with-prefix-element\" name=\"amount\" type=\"text\"></div>\n</div>"
|
459
|
+
},
|
460
|
+
{
|
461
|
+
"name": "with prefix with attributes",
|
462
|
+
"options": {
|
463
|
+
"label": {
|
464
|
+
"text": "Amount, in pounds"
|
465
|
+
},
|
466
|
+
"id": "input-with-prefix-element",
|
467
|
+
"name": "amount",
|
468
|
+
"prefix": {
|
469
|
+
"text": "£",
|
470
|
+
"attributes": {
|
471
|
+
"data-attribute": "value"
|
472
|
+
}
|
473
|
+
}
|
474
|
+
},
|
475
|
+
"html": "<div class=\"govuk-form-group\">\n <label class=\"govuk-label\" for=\"input-with-prefix-element\">\n Amount, in pounds\n </label>\n\n<div class=\"govuk-input__wrapper\">\n <div class=\"govuk-input__prefix\" aria-hidden=\"true\" data-attribute=\"value\">£</div>\n <input class=\"govuk-input\" id=\"input-with-prefix-element\" name=\"amount\" type=\"text\"></div>\n</div>"
|
476
|
+
},
|
477
|
+
{
|
478
|
+
"name": "with suffix with html as text",
|
479
|
+
"options": {
|
480
|
+
"label": {
|
481
|
+
"text": "Weight, in kilograms"
|
482
|
+
},
|
483
|
+
"id": "input-with-suffix",
|
484
|
+
"name": "weight",
|
485
|
+
"suffix": {
|
486
|
+
"text": "<span>kg</span>"
|
487
|
+
}
|
488
|
+
},
|
489
|
+
"html": "<div class=\"govuk-form-group\">\n <label class=\"govuk-label\" for=\"input-with-suffix\">\n Weight, in kilograms\n </label>\n\n<div class=\"govuk-input__wrapper\"><input class=\"govuk-input\" id=\"input-with-suffix\" name=\"weight\" type=\"text\">\n <div class=\"govuk-input__suffix\" aria-hidden=\"true\"><span>kg</span></div>\n </div>\n</div>"
|
490
|
+
},
|
491
|
+
{
|
492
|
+
"name": "with suffix with html",
|
493
|
+
"options": {
|
494
|
+
"label": {
|
495
|
+
"text": "Weight, in kilograms"
|
496
|
+
},
|
497
|
+
"id": "input-with-suffix",
|
498
|
+
"name": "weight",
|
499
|
+
"suffix": {
|
500
|
+
"html": "<span>kg</span>"
|
501
|
+
}
|
502
|
+
},
|
503
|
+
"html": "<div class=\"govuk-form-group\">\n <label class=\"govuk-label\" for=\"input-with-suffix\">\n Weight, in kilograms\n </label>\n\n<div class=\"govuk-input__wrapper\"><input class=\"govuk-input\" id=\"input-with-suffix\" name=\"weight\" type=\"text\">\n <div class=\"govuk-input__suffix\" aria-hidden=\"true\"><span>kg</span></div>\n </div>\n</div>"
|
504
|
+
},
|
505
|
+
{
|
506
|
+
"name": "with suffix with classes",
|
507
|
+
"options": {
|
508
|
+
"label": {
|
509
|
+
"text": "Weight, in kilograms"
|
510
|
+
},
|
511
|
+
"id": "input-with-suffix",
|
512
|
+
"name": "weight",
|
513
|
+
"suffix": {
|
514
|
+
"html": "<span>kg</span>",
|
515
|
+
"classes": "app-input__suffix--custom-modifier"
|
516
|
+
}
|
517
|
+
},
|
518
|
+
"html": "<div class=\"govuk-form-group\">\n <label class=\"govuk-label\" for=\"input-with-suffix\">\n Weight, in kilograms\n </label>\n\n<div class=\"govuk-input__wrapper\"><input class=\"govuk-input\" id=\"input-with-suffix\" name=\"weight\" type=\"text\">\n <div class=\"govuk-input__suffix app-input__suffix--custom-modifier\" aria-hidden=\"true\"><span>kg</span></div>\n </div>\n</div>"
|
519
|
+
},
|
520
|
+
{
|
521
|
+
"name": "with suffix with attributes",
|
522
|
+
"options": {
|
523
|
+
"label": {
|
524
|
+
"text": "Weight, in kilograms"
|
525
|
+
},
|
526
|
+
"id": "input-with-suffix",
|
527
|
+
"name": "weight",
|
528
|
+
"suffix": {
|
529
|
+
"html": "<span>kg</span>",
|
530
|
+
"attributes": {
|
531
|
+
"data-attribute": "value"
|
532
|
+
}
|
533
|
+
}
|
534
|
+
},
|
535
|
+
"html": "<div class=\"govuk-form-group\">\n <label class=\"govuk-label\" for=\"input-with-suffix\">\n Weight, in kilograms\n </label>\n\n<div class=\"govuk-input__wrapper\"><input class=\"govuk-input\" id=\"input-with-suffix\" name=\"weight\" type=\"text\">\n <div class=\"govuk-input__suffix\" aria-hidden=\"true\" data-attribute=\"value\"><span>kg</span></div>\n </div>\n</div>"
|
536
|
+
}
|
537
|
+
]
|
538
|
+
}
|