govuk_publishing_components 43.3.0 → 43.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/govuk_publishing_components/icon-autocomplete-search-suggestion.svg +4 -0
  3. data/app/assets/javascripts/govuk_publishing_components/components/search-with-autocomplete.js +123 -0
  4. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +5 -4
  5. data/app/assets/stylesheets/govuk_publishing_components/components/_phase-banner.scss +0 -2
  6. data/app/assets/stylesheets/govuk_publishing_components/components/_search-with-autocomplete.scss +200 -0
  7. data/app/views/govuk_publishing_components/components/_layout_header.html.erb +16 -40
  8. data/app/views/govuk_publishing_components/components/_search.html.erb +16 -14
  9. data/app/views/govuk_publishing_components/components/_search_with_autocomplete.html.erb +27 -0
  10. data/app/views/govuk_publishing_components/components/docs/layout_header.yml +0 -41
  11. data/app/views/govuk_publishing_components/components/docs/phase_banner.yml +4 -0
  12. data/app/views/govuk_publishing_components/components/docs/search_with_autocomplete.yml +61 -0
  13. data/lib/govuk_publishing_components/version.rb +1 -1
  14. data/node_modules/accessible-autocomplete/CHANGELOG.md +390 -0
  15. data/node_modules/accessible-autocomplete/CODEOWNERS +2 -0
  16. data/node_modules/accessible-autocomplete/CONTRIBUTING.md +161 -0
  17. data/node_modules/accessible-autocomplete/LICENSE.txt +20 -0
  18. data/node_modules/accessible-autocomplete/Procfile +1 -0
  19. data/node_modules/accessible-autocomplete/README.md +490 -0
  20. data/node_modules/accessible-autocomplete/accessibility-criteria.md +42 -0
  21. data/node_modules/accessible-autocomplete/app.json +15 -0
  22. data/node_modules/accessible-autocomplete/babel.config.js +29 -0
  23. data/node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.css +3 -0
  24. data/node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.css.map +1 -0
  25. data/node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.js +2 -0
  26. data/node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.js.map +1 -0
  27. data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.preact.min.js +2 -0
  28. data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.preact.min.js.map +1 -0
  29. data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.react.min.js +2 -0
  30. data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.react.min.js.map +1 -0
  31. data/node_modules/accessible-autocomplete/examples/form-single.html +379 -0
  32. data/node_modules/accessible-autocomplete/examples/form.html +673 -0
  33. data/node_modules/accessible-autocomplete/examples/index.html +738 -0
  34. data/node_modules/accessible-autocomplete/examples/preact/index.html +346 -0
  35. data/node_modules/accessible-autocomplete/examples/react/index.html +347 -0
  36. data/node_modules/accessible-autocomplete/package.json +93 -0
  37. data/node_modules/accessible-autocomplete/postcss.config.js +16 -0
  38. data/node_modules/accessible-autocomplete/preact.js +1 -0
  39. data/node_modules/accessible-autocomplete/react.js +1 -0
  40. data/node_modules/accessible-autocomplete/scripts/check-staged.mjs +16 -0
  41. data/node_modules/accessible-autocomplete/src/autocomplete.css +167 -0
  42. data/node_modules/accessible-autocomplete/src/autocomplete.js +608 -0
  43. data/node_modules/accessible-autocomplete/src/dropdown-arrow-down.js +11 -0
  44. data/node_modules/accessible-autocomplete/src/status.js +125 -0
  45. data/node_modules/accessible-autocomplete/src/wrapper.js +60 -0
  46. data/node_modules/accessible-autocomplete/test/functional/dropdown-arrow-down.js +46 -0
  47. data/node_modules/accessible-autocomplete/test/functional/index.js +793 -0
  48. data/node_modules/accessible-autocomplete/test/functional/wrapper.js +339 -0
  49. data/node_modules/accessible-autocomplete/test/integration/index.js +309 -0
  50. data/node_modules/accessible-autocomplete/test/karma.config.js +46 -0
  51. data/node_modules/accessible-autocomplete/test/wdio.config.js +123 -0
  52. data/node_modules/accessible-autocomplete/webpack.config.mjs +244 -0
  53. metadata +46 -2
@@ -0,0 +1,390 @@
1
+ # CHANGELOG
2
+
3
+ ## Unreleased
4
+
5
+ ## 3.0.0 - 2024-04-19
6
+
7
+ ### Breaking changes
8
+
9
+ #### Verify your code does not rely on removed polyfills
10
+
11
+ Following on from [our previous announcement](https://github.com/alphagov/design-system-team-internal/issues/561), the accessible autocomplete code is no longer transpiled and polyfilled to support IE8-10.
12
+
13
+ However, because the polyfills create or extend global objects, you might have other code in your service unintentionally relying on the inclusion of these polyfills. You might need to introduce your own polyfills or rewrite your JavaScript to avoid using the polyfilled features.
14
+
15
+ This change was introduced in [pull request #612: Update packages, configs + Node.js 20](https://github.com/alphagov/accessible-autocomplete/pull/612).
16
+
17
+ #### Check for minor visual changes in the rendering of the component
18
+
19
+ We've made some style adjustments to the stylesheet shipped with the component to make its colours, height, line-height and padding match those of the latest version of GOV.UK Frontend's `<input>`.
20
+
21
+ If you're using this stylesheet:
22
+ - check if our style update affects the rendering of the component in your service, and adjust if necessary
23
+ - if you were adding to the default style's to match GOV.UK Frontend's input,
24
+ look for CSS declarations you may now be able to remove
25
+
26
+ This change was introduced in [pull request #644: Align CSS styles with GOV.UK Frontend](https://github.com/alphagov/accessible-autocomplete/pull/644).
27
+
28
+ ### New features
29
+
30
+ #### Options to add classes to parts of the component
31
+
32
+ Use these new options to add your own classes to parts of the component:
33
+ - `inputClasses` for the `input` element
34
+ - `hintClasses` for the suggestion hint (`input` element appearing when the text typed by the user matches the start of an option)
35
+ - `menuClasses` for the `ul` element listing the options
36
+
37
+ You can also add custom classes to the `ul` listing the options through the new `menuAttributes` option, providing a `className` or `class` property.
38
+
39
+ This change was introduced in:
40
+ - [pull request #602: Add `inputClasses` option](https://github.com/alphagov/accessible-autocomplete/pull/602). Thanks to @andreyyudin for contributing this change.
41
+ - [pull request #649: Update options for styling component inputs](https://github.com/alphagov/accessible-autocomplete/pull/649)
42
+ - [pull request #650: Update ways of configuring menu attributes](https://github.com/alphagov/accessible-autocomplete/pull/650)
43
+
44
+ #### New class on the component's status
45
+
46
+ Use the new `autocomplete__status` class in your CSS (or `<CSS_NAMESPACE>__status` if you set [the `cssNamespace` option](https://github.com/alphagov/accessible-autocomplete?tab=readme-ov-file#cssnamespace-default-autocomplete)) to customise the styles of the component's status element (hidden element that makes announcements to assistive technologies).
47
+
48
+ This change was introduced in [pull request #620: Add className attribute to status component](https://github.com/alphagov/accessible-autocomplete/pull/620). Thanks to @lennym for contributing this change.
49
+
50
+ ### Fixes
51
+
52
+ - [Pull request #621: Handle query change when the text length does not change](https://github.com/alphagov/accessible-autocomplete/pull/621). Thanks to @archferns for contributing this change.
53
+ - [Pull request #591: Add `menuAttributes` to fix Axe's 'aria-input-field-name' error](https://github.com/alphagov/accessible-autocomplete/pull/591). Thanks to @mchughbri for contributing this change.
54
+ - [Pull request #600: Fix null aria attributes](https://github.com/alphagov/accessible-autocomplete/pull/600). Thanks to @mark-roberts-ho for contributing this change.
55
+ - [Pull request #606: Correct description of tStatusSelectedOption i18n option in README and tweak some wording for consistency with other parts of the README](https://github.com/alphagov/accessible-autocomplete/pull/606). Thanks to @ellamdav for contributing this change.
56
+
57
+ ## 2.0.4 - 2022-02-07
58
+
59
+ ### Fixes
60
+
61
+ - [Pull request #512: Make sure highlighted option is distinguishable in forced colors mode](https://github.com/alphagov/accessible-autocomplete/pull/512)
62
+
63
+ ## 2.0.3 - 2020-07-01
64
+
65
+ ### Fixes
66
+
67
+ - [Pull request #415: Make React bundle work server-side in a NodeJS environment](https://github.com/alphagov/accessible-autocomplete/pull/415)
68
+
69
+ ## 2.0.2 - 2020-01-30
70
+
71
+ ### Fixes
72
+
73
+ - [Pull request #388: Set aria-selected as a string instead of a boolean to avoid being dropped](https://github.com/alphagov/accessible-autocomplete/pull/388).
74
+ - [Pull request #400: Remove pointer events check](https://github.com/alphagov/accessible-autocomplete/pull/400).
75
+ - [Pull request #406: Make hint padding match input padding](https://github.com/alphagov/accessible-autocomplete/pull/406).
76
+ - [Pull request #407: Use a div element to wrap enhanced component](https://github.com/alphagov/accessible-autocomplete/pull/407).
77
+ - [Pull request #410: Fix long clicks not selecting options](https://github.com/alphagov/accessible-autocomplete/pull/410).
78
+
79
+ ## 2.0.1 - 2019-10-07
80
+
81
+ ### Fixes
82
+
83
+ - [Pull request #379: Ensure multiple autocompletes on one page do not have conflicting id attributes](https://github.com/alphagov/accessible-autocomplete/pull/379)
84
+
85
+ ## 2.0.0 - 2019-09-26
86
+
87
+ We recommend you update to the latest release using npm:
88
+
89
+ `npm install accessible-autocomplete@latest`
90
+
91
+ ### Breaking changes
92
+
93
+ You must make the following change when you migrate to this release, or your service may break.
94
+
95
+ #### Migrate to the new accessible focus state
96
+
97
+ The focus state [now meets the new WCAG 2.1 level AA requirements](https://designnotes.blog.gov.uk/2019/07/29/weve-made-the-gov-uk-design-system-more-accessible/).
98
+
99
+ You do not need to do anything if you’re using Sass.
100
+
101
+ If you’ve previously copied CSS from our code into your project, you must copy all the CSS from our [`accessible-autocomplete.min.css` file](https://github.com/alphagov/accessible-autocomplete/blob/v2.0.0/dist/accessible-autocomplete.min.css) into your CSS file.
102
+
103
+ If you’ve created custom CSS, you should check that your component meets WCAG 2.1 level AA requirements. You can [read how we made the GOV.UK Design System focus states accessible](https://design-system.service.gov.uk/get-started/focus-states/).
104
+
105
+ [Pull request #360: Update focus styles to meet WCAG 2.1 level AA non-text contrast requirements](https://github.com/alphagov/accessible-autocomplete/pull/360).
106
+
107
+ ### Fixes
108
+
109
+ #### Better compatibility with screen readers
110
+
111
+ The input field is now visible to all screen readers, because the input field now meets the Accessible Rich Internet Applications (ARIA) 1.0 standard instead of ARIA 1.1. ARIA 1.0 is better supported by the current versions of most screen readers.
112
+
113
+ Screen readers will now consistently tell users:
114
+
115
+ - when users have entered too few characters in the input field
116
+ - the correct number of search results, and what the results are
117
+ - which result users have highlighted
118
+ - how to use autocomplete in different screen readers - by reading hidden hint text
119
+
120
+ Screen readers will also now avoid telling users information they do not need to know after they highlight an option.
121
+
122
+ Thanks to [Mark Hunter](https://github.com/markhunter27), Chris Moore and everyone at HMRC who worked on these improvements.
123
+
124
+ [Pull request #355: Refinements to address accessibility issues](https://github.com/alphagov/accessible-autocomplete/pull/355)
125
+
126
+ ## 1.6.2 - 2018-11-13
127
+
128
+ - Update all packages and add `@babel/preset-env` for browser polyfills. Updates Preact and avoids React 16 `onFocusOut` warnings - thanks [@colinrotherham](https://github.com/colinrotherham)
129
+ ([#316](https://github.com/alphagov/accessible-autocomplete/pull/316))
130
+
131
+ - Fix mouse event issues in IE9-11 including looping `mouseout` and click event being prevented on child elements (e.g. bold text) - thanks [@colinrotherham](https://github.com/colinrotherham)
132
+ ([#310](https://github.com/alphagov/accessible-autocomplete/pull/310))
133
+
134
+ - Fix position being incorrectly reported as '1 of n' regardless of actual
135
+ position in list – thanks [@PRGfx](https://github.com/PRGfx)
136
+ ([#291](https://github.com/alphagov/accessible-autocomplete/pull/291))
137
+
138
+ - Fix spacebar input not being registered when seeing 'No results found'
139
+ message – thanks [@AdenFraser](https://github.com/AdenFraser)
140
+ ([#287](https://github.com/alphagov/accessible-autocomplete/pull/287))
141
+
142
+ - Update following dependencies (from "Current" to "Wanted"). This fixes failing WebdriverIO tests and updates JS Standard to use eslint 4.
143
+
144
+ | Package | Current | Wanted | Latest |
145
+ |------------------------------------------|---------|--------|--------|
146
+ | babel-eslint | 8.0.0 | 8.2.6 | 8.2.6 |
147
+ | babel-loader | 7.1.0 | 7.1.5 | 7.1.5 |
148
+ | babel-plugin-transform-decorators-legacy | 1.3.4 | 1.3.5 | 1.3.5 |
149
+ | babel-register | 6.24.1 | 6.26.0 | 6.26.0 |
150
+ | babel-runtime | 6.23.0 | 6.26.0 | 6.26.0 |
151
+ | chai | 4.0.2 | 4.1.2 | 4.1.2 |
152
+ | chalk | 2.0.1 | 2.4.1 | 2.4.1 |
153
+ | copy-webpack-plugin | 4.0.1 | 4.5.2 | 4.5.2 |
154
+ | coveralls | 2.13.1 | 2.13.3 | 3.0.2 |
155
+ | cross-env | 5.0.1 | 5.2.0 | 5.2.0 |
156
+ | csso-cli | 1.0.0 | 1.1.0 | 1.1.0 |
157
+ | husky | 0.14.1 | 0.14.3 | 0.14.3 |
158
+ | karma | 1.7.0 | 1.7.1 | 2.0.4 |
159
+ | karma-coverage | 1.1.1 | 1.1.2 | 1.1.2 |
160
+ | karma-mocha-reporter | 2.2.3 | 2.2.5 | 2.2.5 |
161
+ | karma-webpack | 2.0.3 | 2.0.13 | 3.0.0 |
162
+ | mocha | 3.4.2 | 3.5.3 | 5.2.0 |
163
+ | npm-run-all | 4.0.2 | 4.1.3 | 4.1.3 |
164
+ | phantomjs-prebuilt | 2.1.14 | 2.1.16 | 2.1.16 |
165
+ | preact | 8.1.0 | 8.2.9 | 8.2.9 |
166
+ | sinon-chai | 2.11.0 | 2.14.0 | 3.2.0 |
167
+ | source-map-loader | 0.2.1 | 0.2.3 | 0.2.3 |
168
+ | standard | 10.0.2 | 11.0.1 | 11.0.1 |
169
+ | wdio-mocha-framework | 0.5.10 | 0.5.13 | 0.6.2 |
170
+ | wdio-sauce-service | 0.4.0 | 0.4.10 | 0.4.10 |
171
+ | wdio-selenium-standalone-service | 0.0.8 | 0.0.10 | 0.0.10 |
172
+ | wdio-spec-reporter | 0.1.0 | 0.1.5 | 0.1.5 |
173
+ | webdriverio | 4.8.0 | 4.13.1 | 4.13.1 |
174
+ | webpack | 3.0.0 | 3.12.0 | 4.16.1 |
175
+ | webpack-dev-server | 2.5.0 | 2.11.2 | 3.1.4 |
176
+ | webpack-sources | 1.0.1 | 1.1.0 | 1.1.0 |
177
+
178
+ ## 1.6.1 - 2017-09-25
179
+
180
+ - Fix role attr by moving `role='combobox'` to wrapper and adding `role='textbox'` to the input. By [@tobias-g](https://github.com/tobias-g)
181
+ - Fix examples page by removing unrequired npm package `v8-lazy-parse-webpack-plugin`
182
+ - Fix scrolling on iOS by reverting #85, new issue raised to find better fix for clicking custom suggestions #177
183
+ - Fix selection and timeout race condition. By [@tobias-g](https://github.com/tobias-g)
184
+ - Fix dropdown on IE to ensure it isn't focusable. By [@tobias-g](https://github.com/tobias-g)
185
+
186
+ ## 1.6.0 - 2017-07-20
187
+
188
+ - [Feature] Allow customization of the dropdown arrow. By [@sventschui](https://github.com/sventschui).
189
+
190
+ ## 1.5.0 - 2017-07-18
191
+
192
+ - [Feature] Add ability to translate texts. Relates to #96. By [@sventschui](https://github.com/sventschui).
193
+
194
+ ## 1.4.2 - 2017-07-18
195
+
196
+ - Allow space to confirm an option, fixes #98.
197
+ - Add support for navigating lists on IE9, 10 and 11, fixes #193.
198
+
199
+ ## 1.4.1 - 2017-07-06
200
+
201
+ - Fix use of HTML entities in enhanced select options. #151. By [@dracos](https://github.com/dracos).
202
+
203
+ ## 1.4.0 - 2017-07-04
204
+
205
+ - [Feature] Add option to show all values on dropdown. By [@joelanman](https://github.com/joelanman).
206
+
207
+ ## 1.3.2 - 2017-07-03
208
+
209
+ - Redirect keypresses on an option to input, fixes #179.
210
+
211
+ ## 1.3.1 - 2017-06-08
212
+
213
+ - Fix `autoselect: false` not working when using `enhanceSelectElement`.
214
+
215
+ ## 1.3.0 - 2017-06-02
216
+
217
+ - [Feature] Add support for passing an array of strings to `source`. By [@joelanman](https://github.com/joelanman).
218
+
219
+ ## 1.2.1 - 2017-05-24
220
+
221
+ - Fix progressive enhancement in FireFox < 48. By [@revilossor](https://github.com/revilossor).
222
+
223
+ ## 1.2.0 - 2017-05-23
224
+
225
+ - [Feature] Export Preact and React bundles.
226
+
227
+ ## 1.1.0 - 2017-05-18
228
+
229
+ - [Feature] Add `required` option. By [@samtsai](https://github.com/samtsai).
230
+
231
+ ## 1.0.6 - 2017-05-17
232
+
233
+ - Update preact dependency to v8.1.0.
234
+
235
+ ## 1.0.5 - 2017-05-16
236
+
237
+ - Add support for handling null/placeholder options when using `enhanceSelectElement`. Use `preserveNullOptions: true` to include options with `value=''` in the autocomplete results when enhancing a select element. By @lennym.
238
+
239
+ ## 1.0.4 - 2017-05-15 (deprecated)
240
+
241
+ - This release does not contain any changes compared to the previous one and is due to a mistake in our build scripts.
242
+
243
+ ## 1.0.3 - 2017-05-15
244
+
245
+ - Do not copy `name` attribute when using `enhanceSelectElement`. By [@lennym](https://github.com/lennym).
246
+
247
+ ## 1.0.2 - 2017-05-12
248
+
249
+ - Add support for an empty `defaultValue` when enhancing a select element. By [@lennym](https://github.com/lennym).
250
+
251
+ ## 1.0.1 - 2017-05-12
252
+
253
+ - Update `style` property in package.json to reflect updated filename. By [@lennym](https://github.com/lennym).
254
+
255
+ ## 1.0.0 - 2017-05-10
256
+
257
+ - [Breaking] Default `autoselect` to `true` when using `enhanceSelectElement`.
258
+ - [Breaking] Make `id` a required attribute.
259
+ - [Breaking] Rename `onSelect` to `onConfirm`.
260
+ - [Breaking] Rename `selectOnBlur` to `confirmOnBlur`.
261
+ - Fix an issue where users couldn't click on custom suggestions on Chrome.
262
+
263
+ ## 0.6.0 - 2017-05-10
264
+
265
+ - [Breaking] Rename component from `accessible-typeahead` to `accessible-autocomplete`.
266
+ - Default `defaultValue` when progressively enhancing.
267
+ - Throw an error when `enhanceSelectElement` is called without a `selectElement`.
268
+ - Throw errors when `accessibleAutocomplete` is called without `element` or `source`.
269
+
270
+ ## 0.5.0 - 2017-05-09
271
+
272
+ - Test the typeahead with end to end tests.
273
+ - Don't display hints on browsers that don't support pointer-events.
274
+ - [Breaking] Rename `dist/styled.min.css` to `dist/accessible-typeahead.min.css`.
275
+ - [Breaking] Rename library main export from `AccessibleTypeahead` to `accessibleTypeahead`.
276
+ - Fix aria status region to more reliably trigger when the number of results stay the same.
277
+ - Fix hint rendering and being picked up by assistive technologies.
278
+ - More aria status region above input so it's more easily picked while navigating.
279
+
280
+ ## 0.4.2 - 2017-05-03
281
+
282
+ - Add touchEnd handler for iOS and touch devices, fixes custom suggestions.
283
+ - Add `style` declaration in package.json
284
+ - Add support for UMD/commonjs module definition.
285
+
286
+ ## 0.4.1 - 2017-04-26
287
+
288
+ - Minify `styled.css` for production.
289
+
290
+ ## 0.4.0 - 2017-04-11
291
+
292
+ - [Breaking] Don't focus suggestions when hovering them, add `:hover` CSS class.
293
+ - Add `showNoOptionsFound` property to allow users to disable this behaviour.
294
+ - Pass through unrecognised key events to input, allowing users to continue typing when they are focusing an option.
295
+
296
+ ## 0.3.5 - 2017-04-06
297
+
298
+ - Don't prepopulate `defaultValue` in `enhanceSelectElement`.
299
+
300
+ ## 0.3.4 - 2017-04-06
301
+
302
+ - Pass actual selected object into `onSelect`.
303
+ - Add `selectOnBlur` property to allow users to disable this behaviour.
304
+ - Add `placeholder` property.
305
+
306
+ ## 0.3.3 - 2017-04-04
307
+
308
+ - Add `templates.inputValue` and `templates.suggestion` properties. These allow users to override how the suggestions are displayed.
309
+
310
+ ## 0.3.2 - 2017-04-03
311
+
312
+ - Add `AccessibleTypeahead.enhanceSelectElement` function.
313
+ - Add `onSelect` property.
314
+
315
+ ## 0.3.1 - 2017-03-09
316
+
317
+ - Add ability to specify a `defaultValue` to prefill the input.
318
+ - When user has selected an option with the keyboard, blurring will select.
319
+ - When user has no selected but autoselect is on, blurring will select.
320
+ - Hovering no longer selects, just focuses.
321
+ - When hovering out of component, focus returns to selected.
322
+ - Allow enter to submit forms when menu isn't opened.
323
+ - Hide results when going under minLength.
324
+
325
+ ## 0.3.0 - 2017-03-09
326
+
327
+ - [Breaking] Add `displayMenu` property. The default is `inline` which was not the previous default.
328
+ - CSS colour changes, and more properties moved away from inline styles.
329
+ - Turn off native browser autocomplete so it doesn't interfere with typeahead overlay.
330
+ - Change the content and styling of the 'No results found' feature.
331
+
332
+ ## 0.2.4 - 2017-03-02
333
+
334
+ - Display "No options found" when there are no results.
335
+ - Add `autoselect` property. This refactors the `:focused` CSS class to `--focused`, but because previous styling should still work as before, is not a breaking change.
336
+ - Poll the input element periodically to pick up value changes. This makes it more resilient to direct modifications from applications like Dragon, or from interventions from other JavaScript snippets.
337
+
338
+ ## 0.2.3 - 2017-02-21
339
+
340
+ - Add `minLength` property, which:
341
+ - Tells the aria region to display text that the user should type in more characters;
342
+ - Doesn't call the `source` until that lower limit is reached.
343
+ - Select text only when component is unfocused.
344
+
345
+ ## 0.2.2 - 2017-02-16
346
+
347
+ - Fix focus/blur events on IE11.
348
+ - Fix value of `aria-expanded` attribute to be based on `menuOpen`.
349
+ - Remove `aria-activedescendant` attribute when no option selected.
350
+ - Set `aria-selected` on options when they are focused.
351
+ - Fix clicking on options on Safari.
352
+ - Use a darker blue in the styled example for better contrast ratios.
353
+ - Don't close menu when blurring options or input on iOS, to allow VoiceOver users the ability to select from the available options.
354
+ - Autoselect entire text region when focusing into the input.
355
+
356
+ ## 0.2.1 - 2017-02-03
357
+
358
+ - Don't close menu when closing the keyboard on iOS, to allow VoiceOver users the ability to select from the available options.
359
+ - Add ability to set `name` attribute on input.
360
+
361
+ ## 0.2.0 - 2017-01-31
362
+
363
+ - [Breaking] Change the CSS classes to our own instead of the jQuery typeahead ones.
364
+ - Allow importing styling from file in `examples/styled.css`.
365
+ - Tweak the styled example to fix two Safari bugs:
366
+ - fix scroll bar appearing in menu where none is necessary;
367
+ - fix weird margin separating the input from the menu.
368
+
369
+ ## 0.1.3 - 2017-01-31
370
+
371
+ - Don't apply focused CSS on hover, change handler to MouseOver instead of MouseMove.
372
+ - (WIP) Make enter select first option if `autoselect` is enabled. This feature is not finished yet.
373
+ - Close results when focusing out of component after hovering an element.
374
+ - Update styled example:
375
+ - unbold results;
376
+ - make height of options consistent with input;
377
+ - remove top border from results menu;
378
+ - remove default focus outline on options.
379
+ - Don't display the menu when there are no options.
380
+ - Prevent accidental form submission by `preventDefault`ing on enter key.
381
+ - Add form around basic example.
382
+
383
+ ## 0.1.2 - 2017-01-20
384
+
385
+ - Don't specify typeahead menu width inline. Allows custom CSS to override it.
386
+
387
+ ## 0.1.0 - 2017-01-19
388
+
389
+ - Initial release.
390
+ - Basic functionality, minimal styling, only two examples, incomplete tests.
@@ -0,0 +1,2 @@
1
+ # Ensure any changes to GitHub Actions workflows are reviewed by developers
2
+ .github/workflows/ @alphagov/design-system-developers
@@ -0,0 +1,161 @@
1
+ # Contributing
2
+
3
+ Contributions welcome, please raise a pull request.
4
+
5
+ If you want to help and want to get more familiar with the codebase, try starting with the ["good for beginners"](https://github.com/alphagov/accessible-autocomplete/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+for+beginners%22) issues. Feel free to request more guidance in the issue comments.
6
+
7
+ ## Requirements
8
+
9
+ You will need a recent version of Node and npm installed. Check the `.nvmrc` for a recommended version:
10
+
11
+ ```bash
12
+ $ node -v
13
+ v14.21.3
14
+ $ npm -v
15
+ v6.14.18
16
+ ```
17
+
18
+ To install Node (with npm) locally on macOS, we recommend [brew](https://brew.sh) with
19
+ [nvm](https://github.com/nvm-sh/nvm):
20
+
21
+ ```bash
22
+ brew install nvm
23
+ nvm install
24
+ ```
25
+
26
+ ## Project structure
27
+
28
+ ```
29
+ $ ls
30
+ dist/ # The compiled and ready to distribute build artefacts.
31
+ screenshots/ # Gets outputted by the end to end tests when something goes wrong.
32
+ examples/ # GitHub pages examples of using the autocomplete.
33
+ scripts/ # Build scripts that don't fit in `package.json`.
34
+ src/ # The source code for the library.
35
+ test/ # The tests for the library.
36
+ ```
37
+
38
+ ## Build tasks
39
+
40
+ To develop locally:
41
+
42
+ ```bash
43
+ npm install
44
+ npm run dev
45
+ ```
46
+
47
+ Contributions will need to pass the linter and tests. To run everything once:
48
+
49
+ ```bash
50
+ npm test
51
+ ```
52
+
53
+ To run the linter on its own:
54
+
55
+ ```bash
56
+ npm run standard
57
+ ```
58
+
59
+ To run the functional tests in dev mode (automatically reruns when a file changes):
60
+
61
+ ```bash
62
+ npm run karma:dev
63
+ ```
64
+
65
+ To run the integration tests locally with Chrome (specified in [wdio.config.js](test/wdio.config.js)):
66
+
67
+ ```bash
68
+ npm run wdio
69
+ ```
70
+
71
+ To run the integration tests on [Sauce Labs](https://saucelabs.com/), create a `.env` file with the following:
72
+
73
+ ```bash
74
+ SAUCE_ENABLED="true"
75
+ SAUCE_USERNAME="XXXXXXXX"
76
+ SAUCE_ACCESS_KEY="YYYYYYYY"
77
+ ```
78
+
79
+ And run the same command:
80
+
81
+ ```bash
82
+ npm run wdio
83
+ ```
84
+
85
+ Failed integration tests should output screenshots to the `./screenshots/` folder.
86
+
87
+ To build the project for distribution:
88
+
89
+ ```bash
90
+ npm run build
91
+ ```
92
+
93
+ You should do this and commit it before you attempt to `git push`, otherwise the prepush checks will prevent you from pushing.
94
+
95
+ ## Prepush checks
96
+
97
+ When you push to a branch, git will run a `npm run prepush` [script](scripts/check-staged.mjs) that will compile the build on your behalf to the `dist/` folder. If it then finds unstaged files in `dist/`, it will fail your push.
98
+
99
+ The solution is to commit the files, preferably as part of a separate commit:
100
+
101
+ ```bash
102
+ npm run build
103
+ git add dist/
104
+ git commit -m "Rebuild dist"
105
+ git push
106
+ ```
107
+
108
+ If you want to ignore the checks and push regardless:
109
+
110
+ ```bash
111
+ git push --no-verify
112
+ ```
113
+
114
+ ## PR nice to haves
115
+
116
+ - Tests for your feature or fix
117
+ - Updates to the README.md when necessary
118
+ - A 1 line update in CHANGELOG.md describing your changes
119
+
120
+ ## Cutting a new release
121
+
122
+ `git pull --rebase` and then run:
123
+
124
+ ```bash
125
+ git checkout -b "v1.2.3"
126
+ vim CHANGELOG.md # Update CHANGELOG, put all unreleased changes under new heading.
127
+ git commit -am "Update CHANGELOG"
128
+ npm version <major|minor|patch> -m "## 1.2.3 - 2017-01-13
129
+
130
+ - Change included in this release
131
+ - Another change included in this release"
132
+ ```
133
+
134
+ Then run:
135
+ ```bash
136
+ git push --tags --set-upstream origin refs/heads/v1.2.3:refs/heads/v1.2.3
137
+ ```
138
+
139
+ Create a pull request for the release and merge once it has been approved, then run:
140
+
141
+ ```bash
142
+ git checkout main
143
+ git pull --rebase
144
+ ```
145
+
146
+ ### Publish the release
147
+
148
+ 1. Sign in to npm (`npm login`) as `govuk-patterns-and-tools` using the credentials from BitWarden.
149
+ 2. Run `npm publish` to publish to npm.
150
+ 3. Open the ['create a new release' dialog](https://github.com/alphagov/accessible-autocomplete/releases/new) on GitHub.
151
+ 4. Select the latest tag version.
152
+ 5. Set 'v[VERSION-NUMBER]' as the title.
153
+ 6. Add the release notes from the changelog.
154
+ 7. Add a summary of highlights.
155
+ 8. Select **Publish release**.
156
+
157
+ You do not need to manually attach source code files to the release on GitHub.
158
+
159
+ Post a short summary of the release in the cross-government and GDS #govuk-design-system Slack channels. For example:
160
+
161
+ 🚀 We’ve just released Accessible Autocomplete v2.0.1. You can now use the acccessible autocomplete multiple times on one page. Thanks to @<SLACK-NAME> and @<SLACK-NAME> for helping with this release. [https://github.com/alphagov/accessible-autocomplete/releases/tag/v2.0.1](https://github.com/alphagov/accessible-autocomplete/releases/tag/v2.0.1)
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 Crown Copyright (Government Digital Service)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1 @@
1
+ web: python -m SimpleHTTPServer $PORT