govuk_publishing_components 43.4.1 → 43.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/views/govuk_publishing_components/components/_radio.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/docs/inverse_header.yml +2 -30
- data/app/views/govuk_publishing_components/components/docs/radio.yml +15 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/accessible-autocomplete/CHANGELOG.md +8 -0
- data/node_modules/accessible-autocomplete/accessibility-criteria.md +2 -1
- data/node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.js +1 -1
- data/node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.js.map +1 -1
- data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.preact.min.js +1 -1
- data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.preact.min.js.map +1 -1
- data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.react.min.js +1 -1
- data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.react.min.js.map +1 -1
- data/node_modules/accessible-autocomplete/examples/ajax-source.html +300 -0
- data/node_modules/accessible-autocomplete/examples/form-single.html +4 -2
- data/node_modules/accessible-autocomplete/examples/index.html +7 -52
- data/node_modules/accessible-autocomplete/examples/suggestions.json +258 -0
- data/node_modules/accessible-autocomplete/package.json +15 -15
- data/node_modules/accessible-autocomplete/src/autocomplete.js +4 -2
- data/node_modules/accessible-autocomplete/test/functional/index.js +21 -5
- metadata +18 -2
@@ -0,0 +1,258 @@
|
|
1
|
+
[
|
2
|
+
"Afghanistan",
|
3
|
+
"Akrotiri",
|
4
|
+
"Albania",
|
5
|
+
"Algeria",
|
6
|
+
"American Samoa",
|
7
|
+
"Andorra",
|
8
|
+
"Angola",
|
9
|
+
"Anguilla",
|
10
|
+
"Antarctica",
|
11
|
+
"Antigua and Barbuda",
|
12
|
+
"Argentina",
|
13
|
+
"Armenia",
|
14
|
+
"Aruba",
|
15
|
+
"Ashmore and Cartier Islands",
|
16
|
+
"Australia",
|
17
|
+
"Austria",
|
18
|
+
"Azerbaijan",
|
19
|
+
"Bahamas, The",
|
20
|
+
"Bahrain",
|
21
|
+
"Bangladesh",
|
22
|
+
"Barbados",
|
23
|
+
"Bassas da India",
|
24
|
+
"Belarus",
|
25
|
+
"Belgium",
|
26
|
+
"Belize",
|
27
|
+
"Benin",
|
28
|
+
"Bermuda",
|
29
|
+
"Bhutan",
|
30
|
+
"Bolivia",
|
31
|
+
"Bosnia and Herzegovina",
|
32
|
+
"Botswana",
|
33
|
+
"Bouvet Island",
|
34
|
+
"Brazil",
|
35
|
+
"British Indian Ocean Territory",
|
36
|
+
"British Virgin Islands",
|
37
|
+
"Brunei",
|
38
|
+
"Bulgaria",
|
39
|
+
"Burkina Faso",
|
40
|
+
"Burma",
|
41
|
+
"Burundi",
|
42
|
+
"Cambodia",
|
43
|
+
"Cameroon",
|
44
|
+
"Canada",
|
45
|
+
"Cape Verde",
|
46
|
+
"Cayman Islands",
|
47
|
+
"Central African Republic",
|
48
|
+
"Chad",
|
49
|
+
"Chile",
|
50
|
+
"China",
|
51
|
+
"Christmas Island",
|
52
|
+
"Clipperton Island",
|
53
|
+
"Cocos (Keeling) Islands",
|
54
|
+
"Colombia",
|
55
|
+
"Comoros",
|
56
|
+
"Congo",
|
57
|
+
"Cook Islands",
|
58
|
+
"Coral Sea Islands",
|
59
|
+
"Costa Rica",
|
60
|
+
"Cote d\"Ivoire",
|
61
|
+
"Croatia",
|
62
|
+
"Cuba",
|
63
|
+
"Cyprus",
|
64
|
+
"Czech Republic",
|
65
|
+
"Denmark",
|
66
|
+
"Dhekelia",
|
67
|
+
"Djibouti",
|
68
|
+
"Dominica",
|
69
|
+
"Dominican Republic",
|
70
|
+
"Ecuador",
|
71
|
+
"Egypt",
|
72
|
+
"El Salvador",
|
73
|
+
"Equatorial Guinea",
|
74
|
+
"Eritrea",
|
75
|
+
"Estonia",
|
76
|
+
"Ethiopia",
|
77
|
+
"Europa Island",
|
78
|
+
"Falkland Islands",
|
79
|
+
"Faroe Islands",
|
80
|
+
"Fiji",
|
81
|
+
"Finland",
|
82
|
+
"France",
|
83
|
+
"French Guiana",
|
84
|
+
"French Polynesia",
|
85
|
+
"French Southern and Antarctic Lands",
|
86
|
+
"Gabon",
|
87
|
+
"Gambia,",
|
88
|
+
"Gaza Strip",
|
89
|
+
"Georgia",
|
90
|
+
"Germany",
|
91
|
+
"Ghana",
|
92
|
+
"Gibraltar",
|
93
|
+
"Glorioso Islands",
|
94
|
+
"Greece",
|
95
|
+
"Greenland",
|
96
|
+
"Grenada",
|
97
|
+
"Guadeloupe",
|
98
|
+
"Guam",
|
99
|
+
"Guatemala",
|
100
|
+
"Guernsey",
|
101
|
+
"Guinea",
|
102
|
+
"Guinea-Bissau",
|
103
|
+
"Guyana",
|
104
|
+
"Haiti",
|
105
|
+
"Heard Island and McDonald Islands",
|
106
|
+
"Holy See (Vatican City)",
|
107
|
+
"Honduras",
|
108
|
+
"Hong Kong",
|
109
|
+
"Hungary",
|
110
|
+
"Iceland",
|
111
|
+
"India",
|
112
|
+
"Indonesia",
|
113
|
+
"Iran",
|
114
|
+
"Iraq",
|
115
|
+
"Ireland",
|
116
|
+
"Isle of Man",
|
117
|
+
"Israel",
|
118
|
+
"Italy",
|
119
|
+
"Jamaica",
|
120
|
+
"Jan Mayen",
|
121
|
+
"Japan",
|
122
|
+
"Jersey",
|
123
|
+
"Jordan",
|
124
|
+
"Juan de Nova Island",
|
125
|
+
"Kazakhstan",
|
126
|
+
"Kenya",
|
127
|
+
"Kiribati",
|
128
|
+
"Korea, North",
|
129
|
+
"Korea, South",
|
130
|
+
"Kuwait",
|
131
|
+
"Kyrgyzstan",
|
132
|
+
"Laos",
|
133
|
+
"Latvia",
|
134
|
+
"Lebanon",
|
135
|
+
"Lesotho",
|
136
|
+
"Liberia",
|
137
|
+
"Libya",
|
138
|
+
"Liechtenstein",
|
139
|
+
"Lithuania",
|
140
|
+
"Luxembourg",
|
141
|
+
"Macau",
|
142
|
+
"Macedonia",
|
143
|
+
"Madagascar",
|
144
|
+
"Malawi",
|
145
|
+
"Malaysia",
|
146
|
+
"Maldives",
|
147
|
+
"Mali",
|
148
|
+
"Malta",
|
149
|
+
"Marshall Islands",
|
150
|
+
"Martinique",
|
151
|
+
"Mauritania",
|
152
|
+
"Mauritius",
|
153
|
+
"Mayotte",
|
154
|
+
"Mexico",
|
155
|
+
"Micronesia, Federated States of",
|
156
|
+
"Moldova",
|
157
|
+
"Monaco",
|
158
|
+
"Mongolia",
|
159
|
+
"Montserrat",
|
160
|
+
"Morocco",
|
161
|
+
"Mozambique",
|
162
|
+
"Namibia",
|
163
|
+
"Nauru",
|
164
|
+
"Navassa Island",
|
165
|
+
"Nepal",
|
166
|
+
"Netherlands",
|
167
|
+
"Netherlands Antilles",
|
168
|
+
"New Caledonia",
|
169
|
+
"New Zealand",
|
170
|
+
"Nicaragua",
|
171
|
+
"Niger",
|
172
|
+
"Nigeria",
|
173
|
+
"Niue",
|
174
|
+
"Norfolk Island",
|
175
|
+
"Northern Mariana Islands",
|
176
|
+
"Norway",
|
177
|
+
"Oman",
|
178
|
+
"Pakistan",
|
179
|
+
"Palau",
|
180
|
+
"Panama",
|
181
|
+
"Papua New Guinea",
|
182
|
+
"Paracel Islands",
|
183
|
+
"Paraguay",
|
184
|
+
"Peru",
|
185
|
+
"Philippines",
|
186
|
+
"Pitcairn Islands",
|
187
|
+
"Poland",
|
188
|
+
"Portugal",
|
189
|
+
"Puerto Rico",
|
190
|
+
"Qatar",
|
191
|
+
"Reunion",
|
192
|
+
"Romania",
|
193
|
+
"Russia",
|
194
|
+
"Rwanda",
|
195
|
+
"Saint Helena",
|
196
|
+
"Saint Kitts and Nevis",
|
197
|
+
"Saint Lucia",
|
198
|
+
"Saint Pierre and Miquelon",
|
199
|
+
"Saint Vincent and the Grenadines",
|
200
|
+
"Samoa",
|
201
|
+
"San Marino",
|
202
|
+
"Sao Tome and Principe",
|
203
|
+
"Saudi Arabia",
|
204
|
+
"Senegal",
|
205
|
+
"Serbia and Montenegro",
|
206
|
+
"Seychelles",
|
207
|
+
"Sierra Leone",
|
208
|
+
"Singapore",
|
209
|
+
"Slovakia",
|
210
|
+
"Slovenia",
|
211
|
+
"Solomon Islands",
|
212
|
+
"Somalia",
|
213
|
+
"South Africa",
|
214
|
+
"South Georgia and the South Sandwich Islands",
|
215
|
+
"Spain",
|
216
|
+
"Spratly Islands",
|
217
|
+
"Sri Lanka",
|
218
|
+
"Sudan",
|
219
|
+
"Suriname",
|
220
|
+
"Svalbard",
|
221
|
+
"Swaziland",
|
222
|
+
"Sweden",
|
223
|
+
"Switzerland",
|
224
|
+
"Syria",
|
225
|
+
"Taiwan",
|
226
|
+
"Tajikistan",
|
227
|
+
"Tanzania",
|
228
|
+
"Thailand",
|
229
|
+
"Timor-Leste",
|
230
|
+
"Togo",
|
231
|
+
"Tokelau",
|
232
|
+
"Tonga",
|
233
|
+
"Trinidad and Tobago",
|
234
|
+
"Tromelin Island",
|
235
|
+
"Tunisia",
|
236
|
+
"Turkey",
|
237
|
+
"Turkmenistan",
|
238
|
+
"Turks and Caicos Islands",
|
239
|
+
"Tuvalu",
|
240
|
+
"Uganda",
|
241
|
+
"Ukraine",
|
242
|
+
"United Arab Emirates",
|
243
|
+
"United Kingdom",
|
244
|
+
"United States",
|
245
|
+
"Uruguay",
|
246
|
+
"Uzbekistan",
|
247
|
+
"Vanuatu",
|
248
|
+
"Venezuela",
|
249
|
+
"Vietnam",
|
250
|
+
"Virgin Islands",
|
251
|
+
"Wake Island",
|
252
|
+
"Wallis and Futuna",
|
253
|
+
"West Bank",
|
254
|
+
"Western Sahara",
|
255
|
+
"Yemen",
|
256
|
+
"Zambia",
|
257
|
+
"Zimbabwe"
|
258
|
+
]
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "accessible-autocomplete",
|
3
|
-
"version": "3.0.
|
3
|
+
"version": "3.0.1",
|
4
4
|
"main": "dist/accessible-autocomplete.min.js",
|
5
5
|
"style": "dist/accessible-autocomplete.min.css",
|
6
6
|
"description": "An autocomplete component, built to be accessible.",
|
@@ -35,39 +35,39 @@
|
|
35
35
|
"@babel/plugin-transform-react-jsx": "^7.23.4",
|
36
36
|
"@babel/preset-env": "^7.23.9",
|
37
37
|
"@babel/register": "^7.23.7",
|
38
|
-
"@wdio/cli": "^8.
|
39
|
-
"@wdio/globals": "^8.
|
40
|
-
"@wdio/local-runner": "^8.
|
41
|
-
"@wdio/mocha-framework": "^8.
|
42
|
-
"@wdio/sauce-service": "^8.
|
43
|
-
"@wdio/spec-reporter": "^8.
|
44
|
-
"@wdio/static-server-service": "^8.
|
38
|
+
"@wdio/cli": "^8.39.1",
|
39
|
+
"@wdio/globals": "^8.39.1",
|
40
|
+
"@wdio/local-runner": "^8.39.1",
|
41
|
+
"@wdio/mocha-framework": "^8.39.0",
|
42
|
+
"@wdio/sauce-service": "^8.39.1",
|
43
|
+
"@wdio/spec-reporter": "^8.39.0",
|
44
|
+
"@wdio/static-server-service": "^8.39.0",
|
45
45
|
"autoprefixer": "^10.4.17",
|
46
46
|
"babel-loader": "^9.1.3",
|
47
47
|
"babel-plugin-istanbul": "^6.1.1",
|
48
|
-
"chai": "^5.1.
|
48
|
+
"chai": "^5.1.1",
|
49
49
|
"chalk": "^5.3.0",
|
50
50
|
"core-js": "^3.36.0",
|
51
51
|
"cross-env": "^7.0.3",
|
52
52
|
"css-loader": "^6.10.0",
|
53
53
|
"cssnano": "^6.0.3",
|
54
54
|
"cssnano-preset-default": "^6.0.3",
|
55
|
-
"devtools": "^8.
|
56
|
-
"dotenv": "^16.4.
|
57
|
-
"husky": "^9.
|
58
|
-
"karma": "^6.4.
|
55
|
+
"devtools": "^8.39.1",
|
56
|
+
"dotenv": "^16.4.5",
|
57
|
+
"husky": "^9.1.5",
|
58
|
+
"karma": "^6.4.4",
|
59
59
|
"karma-chrome-launcher": "^3.2.0",
|
60
60
|
"karma-mocha": "^2.0.1",
|
61
61
|
"karma-mocha-reporter": "^2.2.5",
|
62
62
|
"karma-sourcemap-loader": "^0.4.0",
|
63
63
|
"karma-webpack": "^5.0.1",
|
64
64
|
"mini-css-extract-plugin": "^2.8.0",
|
65
|
-
"mocha": "^10.
|
65
|
+
"mocha": "^10.7.0",
|
66
66
|
"npm-run-all": "^4.1.5",
|
67
67
|
"postcss": "^8.4.35",
|
68
68
|
"postcss-loader": "^8.1.0",
|
69
69
|
"preact": "^8.5.3",
|
70
|
-
"puppeteer": "^22.
|
70
|
+
"puppeteer": "^22.15.0",
|
71
71
|
"source-map-loader": "^5.0.0",
|
72
72
|
"standard": "^17.1.0",
|
73
73
|
"terser-webpack-plugin": "^5.3.9",
|
@@ -457,7 +457,7 @@ export default class Autocomplete extends Component {
|
|
457
457
|
'aria-describedby': ariaHint ? assistiveHintID : null,
|
458
458
|
'aria-expanded': menuOpen ? 'true' : 'false',
|
459
459
|
'aria-activedescendant': optionFocused ? `${id}__option--${focused}` : null,
|
460
|
-
'aria-
|
460
|
+
'aria-controls': `${id}__listbox`,
|
461
461
|
'aria-autocomplete': (this.hasAutoselect()) ? 'both' : 'list'
|
462
462
|
}
|
463
463
|
|
@@ -508,6 +508,8 @@ export default class Autocomplete extends Component {
|
|
508
508
|
}
|
509
509
|
|
510
510
|
const computedMenuAttributes = {
|
511
|
+
// set aria-labelledby first so that users can override it with menuAttributes
|
512
|
+
'aria-labelledby': id,
|
511
513
|
// Copy the attributes passed as props
|
512
514
|
...menuAttributes,
|
513
515
|
// And add the values computed for the autocomplete
|
@@ -596,7 +598,7 @@ export default class Autocomplete extends Component {
|
|
596
598
|
})}
|
597
599
|
|
598
600
|
{showNoOptionsFound && (
|
599
|
-
<li className={`${optionClassName} ${optionClassName}--no-results`}>{tNoResults()}</li>
|
601
|
+
<li className={`${optionClassName} ${optionClassName}--no-results`} role='option' aria-disabled='true'>{tNoResults()}</li>
|
600
602
|
)}
|
601
603
|
</ul>
|
602
604
|
|
@@ -111,15 +111,13 @@ describe('Autocomplete', () => {
|
|
111
111
|
})
|
112
112
|
|
113
113
|
describe('menuAttributes', () => {
|
114
|
-
it('renders with
|
115
|
-
render(<Autocomplete menuAttributes={{ '
|
114
|
+
it('renders with extra attributes on the menu', () => {
|
115
|
+
render(<Autocomplete menuAttributes={{ 'data-test': 'test' }} id='autocomplete-default' />, scratch)
|
116
116
|
|
117
117
|
const wrapperElement = scratch.getElementsByClassName('autocomplete__wrapper')[0]
|
118
118
|
const dropdownElement = wrapperElement.getElementsByTagName('ul')[0]
|
119
|
-
const inputElement = wrapperElement.getElementsByTagName('input')[0]
|
120
119
|
|
121
|
-
expect(dropdownElement.getAttribute('
|
122
|
-
expect(inputElement.getAttribute('id')).to.equal('autocomplete-default')
|
120
|
+
expect(dropdownElement.getAttribute('data-test')).to.equal('test')
|
123
121
|
})
|
124
122
|
|
125
123
|
describe('attributes computed by the component', () => {
|
@@ -174,6 +172,24 @@ describe('Autocomplete', () => {
|
|
174
172
|
expect(menuAttributes.className).to.equal('custom-className')
|
175
173
|
expect(menuAttributes.class).to.equal('custom-class')
|
176
174
|
})
|
175
|
+
|
176
|
+
it('adds `aria-labelledby` by default, based on the ID', () => {
|
177
|
+
render(<Autocomplete id='autocomplete-default' />, scratch)
|
178
|
+
|
179
|
+
const wrapperElement = scratch.getElementsByClassName('autocomplete__wrapper')[0]
|
180
|
+
const dropdownElement = wrapperElement.getElementsByTagName('ul')[0]
|
181
|
+
|
182
|
+
expect(dropdownElement.getAttribute('aria-labelledby')).to.equal('autocomplete-default')
|
183
|
+
})
|
184
|
+
|
185
|
+
it('overrides `aria-labelledby` if passed in menuAttributes', () => {
|
186
|
+
render(<Autocomplete menuAttributes={{ 'aria-labelledby': 'test' }} id='autocomplete-default' />, scratch)
|
187
|
+
|
188
|
+
const wrapperElement = scratch.getElementsByClassName('autocomplete__wrapper')[0]
|
189
|
+
const dropdownElement = wrapperElement.getElementsByTagName('ul')[0]
|
190
|
+
|
191
|
+
expect(dropdownElement.getAttribute('aria-labelledby')).to.equal('test')
|
192
|
+
})
|
177
193
|
})
|
178
194
|
|
179
195
|
it('renders with extra class on the input', () => {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk_publishing_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 43.
|
4
|
+
version: 43.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GOV.UK Dev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: govuk_app_config
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: ostruct
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: plek
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -965,11 +979,13 @@ files:
|
|
965
979
|
- node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.preact.min.js.map
|
966
980
|
- node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.react.min.js
|
967
981
|
- node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.react.min.js.map
|
982
|
+
- node_modules/accessible-autocomplete/examples/ajax-source.html
|
968
983
|
- node_modules/accessible-autocomplete/examples/form-single.html
|
969
984
|
- node_modules/accessible-autocomplete/examples/form.html
|
970
985
|
- node_modules/accessible-autocomplete/examples/index.html
|
971
986
|
- node_modules/accessible-autocomplete/examples/preact/index.html
|
972
987
|
- node_modules/accessible-autocomplete/examples/react/index.html
|
988
|
+
- node_modules/accessible-autocomplete/examples/suggestions.json
|
973
989
|
- node_modules/accessible-autocomplete/package.json
|
974
990
|
- node_modules/accessible-autocomplete/postcss.config.js
|
975
991
|
- node_modules/accessible-autocomplete/preact.js
|