govuk_publishing_components 43.4.0 → 43.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/app/views/govuk_publishing_components/components/_radio.html.erb +2 -0
  3. data/app/views/govuk_publishing_components/components/docs/inverse_header.yml +2 -30
  4. data/app/views/govuk_publishing_components/components/docs/radio.yml +15 -0
  5. data/lib/govuk_publishing_components/version.rb +1 -1
  6. data/node_modules/accessible-autocomplete/CHANGELOG.md +398 -0
  7. data/node_modules/accessible-autocomplete/CODEOWNERS +2 -0
  8. data/node_modules/accessible-autocomplete/CONTRIBUTING.md +161 -0
  9. data/node_modules/accessible-autocomplete/LICENSE.txt +20 -0
  10. data/node_modules/accessible-autocomplete/Procfile +1 -0
  11. data/node_modules/accessible-autocomplete/README.md +490 -0
  12. data/node_modules/accessible-autocomplete/accessibility-criteria.md +43 -0
  13. data/node_modules/accessible-autocomplete/app.json +15 -0
  14. data/node_modules/accessible-autocomplete/babel.config.js +29 -0
  15. data/node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.css +3 -0
  16. data/node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.css.map +1 -0
  17. data/node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.js +2 -0
  18. data/node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.js.map +1 -0
  19. data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.preact.min.js +2 -0
  20. data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.preact.min.js.map +1 -0
  21. data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.react.min.js +2 -0
  22. data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.react.min.js.map +1 -0
  23. data/node_modules/accessible-autocomplete/examples/ajax-source.html +300 -0
  24. data/node_modules/accessible-autocomplete/examples/form-single.html +381 -0
  25. data/node_modules/accessible-autocomplete/examples/form.html +673 -0
  26. data/node_modules/accessible-autocomplete/examples/index.html +693 -0
  27. data/node_modules/accessible-autocomplete/examples/preact/index.html +346 -0
  28. data/node_modules/accessible-autocomplete/examples/react/index.html +347 -0
  29. data/node_modules/accessible-autocomplete/examples/suggestions.json +258 -0
  30. data/node_modules/accessible-autocomplete/package.json +93 -0
  31. data/node_modules/accessible-autocomplete/postcss.config.js +16 -0
  32. data/node_modules/accessible-autocomplete/preact.js +1 -0
  33. data/node_modules/accessible-autocomplete/react.js +1 -0
  34. data/node_modules/accessible-autocomplete/scripts/check-staged.mjs +16 -0
  35. data/node_modules/accessible-autocomplete/src/autocomplete.css +167 -0
  36. data/node_modules/accessible-autocomplete/src/autocomplete.js +610 -0
  37. data/node_modules/accessible-autocomplete/src/dropdown-arrow-down.js +11 -0
  38. data/node_modules/accessible-autocomplete/src/status.js +125 -0
  39. data/node_modules/accessible-autocomplete/src/wrapper.js +60 -0
  40. data/node_modules/accessible-autocomplete/test/functional/dropdown-arrow-down.js +46 -0
  41. data/node_modules/accessible-autocomplete/test/functional/index.js +809 -0
  42. data/node_modules/accessible-autocomplete/test/functional/wrapper.js +339 -0
  43. data/node_modules/accessible-autocomplete/test/integration/index.js +309 -0
  44. data/node_modules/accessible-autocomplete/test/karma.config.js +46 -0
  45. data/node_modules/accessible-autocomplete/test/wdio.config.js +123 -0
  46. data/node_modules/accessible-autocomplete/webpack.config.mjs +244 -0
  47. metadata +57 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 907217210fe22535516273b8a2bddec801e1ccf6d0105013c90d96ebcc8912c7
4
- data.tar.gz: 1db72b2071a73d7706b2beef1edc5ed1fc628c42433731234bcff19c68db6160
3
+ metadata.gz: 54db17f78b90649fa6445fc0676b54043c55bd4880545e1131d8c842c040059a
4
+ data.tar.gz: ac68880c1587230ac9d7640f146ed6ee3f2b52d4e9a8462d47204b13518b5aac
5
5
  SHA512:
6
- metadata.gz: 52021a5d93c13d4478369b20a69f7813d28ecfdb5669e4489aa5d6322a88e1b621858f31a49ff02ae32c46e5bd27cd3b89cd07b4d85d80d4de6997061e081db5
7
- data.tar.gz: ff20583781681f2c7dac855929fd7302b156e0dbc7e1f1f6bbdf6770cd75d48b4f486bf3ab83d448089b160b2dfa14f4404c8efd13730ebcd65f94ecdfcde347
6
+ metadata.gz: 5fdc971290b9037889e7e2f303609171d117892533b3390374ebe60c5f2409eccdd8a55af265be76a23f3b747633392ab269ff100d9de3c8611784b1005ea769
7
+ data.tar.gz: ff848b675dbc62c6b454fe9b2142df504db3fbefdb14381afea3432e44f91b1706b28b530a026684e62ac54eb9dba5d3aaad0799895fc19d2220e40610c64b14
@@ -12,6 +12,7 @@
12
12
  heading ||= nil
13
13
  heading_caption ||= nil
14
14
  heading_size ||= nil
15
+ visually_hidden_heading ||= false
15
16
  small ||= false
16
17
  inline ||= false
17
18
  heading_level = shared_helper.get_heading_level
@@ -46,6 +47,7 @@
46
47
 
47
48
  legend_classes = %w(govuk-fieldset__legend)
48
49
  legend_classes << "govuk-fieldset__legend--#{size}"
50
+ legend_classes << "govuk-visually-hidden" if visually_hidden_heading
49
51
 
50
52
  aria = "#{hint_id} #{"#{error_id}" if has_error}".strip if hint or has_error
51
53
 
@@ -1,17 +1,13 @@
1
1
  name: Inverse header
2
2
  description: A wrapper to contain header content in white text
3
3
  body: |
4
- This component can be passed a block of template code and will wrap it in a blue header. This is as light-touch as possible and doesn't attempt to deal with the margins and paddings of its content. White text is enforced on content and would need to be overridden where unwanted. Implemented to accommodate topic and list page headings and breadcrumbs but unopinionated about its contents.
4
+ This component can be passed a block of template code and will wrap it in a blue header. This is as light-touch as possible and doesn't attempt to deal with the margins and paddings of its content. White text is enforced on content and would need to be overridden where unwanted. Implemented to accommodate topic and list page headings but unopinionated about its contents.
5
5
 
6
6
  If passing links to the block make sure to add [the inverse modifier](https://design-system.service.gov.uk/styles/typography/#links-on-dark-backgrounds).
7
-
8
7
  accessibility_criteria: |
9
8
  The component must:
10
9
 
11
10
  * be used in conjunction with content that renders a text contrast ratio higher than 4.5:1 against the header colour to meet WCAG AA.
12
-
13
- accessibility_excluded_rules:
14
- - skip-link # Examples of this component contain breadcrumbs, creating a reference to #content which is part of the layout
15
11
  examples:
16
12
  default:
17
13
  data:
@@ -45,31 +41,7 @@ examples:
45
41
  } %>
46
42
  <p class="publication-header__last-changed">Published 22 April 2016</p>
47
43
  <!-- end of example content -->
48
- with_breadcrumbs_and_paragraph:
49
- data:
50
- padding_top: false
51
- block: |
52
- <!-- example content -->
53
- <%= render "govuk_publishing_components/components/breadcrumbs", {
54
- collapse_on_mobile: true,
55
- breadcrumbs: [
56
- {
57
- title: "Section",
58
- url: "/section"
59
- },
60
- {
61
- title: "Education of disadvantaged children",
62
- url: "/section/sub-section"
63
- }
64
- ],
65
- inverse: true
66
- } %>
67
- <%= render "govuk_publishing_components/components/lead_paragraph", {
68
- text: "Schools and academies, further and higher education, apprenticeships and other skills training, student funding, early years.",
69
- inverse: true
70
- } %>
71
- <!-- end of example content -->
72
- with_link:
44
+ with_paragraph_and_link:
73
45
  data:
74
46
  block: |
75
47
  <p class="gem-c-lead-paragraph gem-c-lead-paragraph--inverse">
@@ -160,6 +160,21 @@ examples:
160
160
  text: "Yes"
161
161
  - value: "no"
162
162
  text: "No"
163
+ with_visually_hidden_heading:
164
+ description: |
165
+ If the heading/legend on the radios is not required, it can be visually hidden using this
166
+ option. It will still be visible to screen readers.
167
+ data:
168
+ name: "radio-group-visually-hidden-heading"
169
+ heading: "What is your favourite colour?"
170
+ visually_hidden_heading: true
171
+ items:
172
+ - value: "red"
173
+ text: "Red"
174
+ - value: "green"
175
+ text: "Green"
176
+ - value: "blue"
177
+ text: "Blue"
163
178
  with_description:
164
179
  data:
165
180
  name: "radio-group-description"
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "43.4.0".freeze
2
+ VERSION = "43.5.0".freeze
3
3
  end
@@ -0,0 +1,398 @@
1
+ # CHANGELOG
2
+
3
+ ## Unreleased
4
+
5
+ ## 3.0.1 - 2024-09-12
6
+
7
+ ### Fixes
8
+
9
+ - [Pull request #727: Add `aria-controls` to aria props](https://github.com/alphagov/accessible-autocomplete/pull/727)
10
+ - [Pull request #724: Add accessibility controls to 'No results' list item](https://github.com/alphagov/accessible-autocomplete/pull/724)
11
+ - [Pull request #729: Move `aria-labelledby` into computed menu props](https://github.com/alphagov/accessible-autocomplete/pull/729)
12
+
13
+ ## 3.0.0 - 2024-04-19
14
+
15
+ ### Breaking changes
16
+
17
+ #### Verify your code does not rely on removed polyfills
18
+
19
+ 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.
20
+
21
+ 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.
22
+
23
+ This change was introduced in [pull request #612: Update packages, configs + Node.js 20](https://github.com/alphagov/accessible-autocomplete/pull/612).
24
+
25
+ #### Check for minor visual changes in the rendering of the component
26
+
27
+ 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>`.
28
+
29
+ If you're using this stylesheet:
30
+ - check if our style update affects the rendering of the component in your service, and adjust if necessary
31
+ - if you were adding to the default style's to match GOV.UK Frontend's input,
32
+ look for CSS declarations you may now be able to remove
33
+
34
+ This change was introduced in [pull request #644: Align CSS styles with GOV.UK Frontend](https://github.com/alphagov/accessible-autocomplete/pull/644).
35
+
36
+ ### New features
37
+
38
+ #### Options to add classes to parts of the component
39
+
40
+ Use these new options to add your own classes to parts of the component:
41
+ - `inputClasses` for the `input` element
42
+ - `hintClasses` for the suggestion hint (`input` element appearing when the text typed by the user matches the start of an option)
43
+ - `menuClasses` for the `ul` element listing the options
44
+
45
+ You can also add custom classes to the `ul` listing the options through the new `menuAttributes` option, providing a `className` or `class` property.
46
+
47
+ This change was introduced in:
48
+ - [pull request #602: Add `inputClasses` option](https://github.com/alphagov/accessible-autocomplete/pull/602). Thanks to @andreyyudin for contributing this change.
49
+ - [pull request #649: Update options for styling component inputs](https://github.com/alphagov/accessible-autocomplete/pull/649)
50
+ - [pull request #650: Update ways of configuring menu attributes](https://github.com/alphagov/accessible-autocomplete/pull/650)
51
+
52
+ #### New class on the component's status
53
+
54
+ 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).
55
+
56
+ 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.
57
+
58
+ ### Fixes
59
+
60
+ - [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.
61
+ - [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.
62
+ - [Pull request #600: Fix null aria attributes](https://github.com/alphagov/accessible-autocomplete/pull/600). Thanks to @mark-roberts-ho for contributing this change.
63
+ - [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.
64
+
65
+ ## 2.0.4 - 2022-02-07
66
+
67
+ ### Fixes
68
+
69
+ - [Pull request #512: Make sure highlighted option is distinguishable in forced colors mode](https://github.com/alphagov/accessible-autocomplete/pull/512)
70
+
71
+ ## 2.0.3 - 2020-07-01
72
+
73
+ ### Fixes
74
+
75
+ - [Pull request #415: Make React bundle work server-side in a NodeJS environment](https://github.com/alphagov/accessible-autocomplete/pull/415)
76
+
77
+ ## 2.0.2 - 2020-01-30
78
+
79
+ ### Fixes
80
+
81
+ - [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).
82
+ - [Pull request #400: Remove pointer events check](https://github.com/alphagov/accessible-autocomplete/pull/400).
83
+ - [Pull request #406: Make hint padding match input padding](https://github.com/alphagov/accessible-autocomplete/pull/406).
84
+ - [Pull request #407: Use a div element to wrap enhanced component](https://github.com/alphagov/accessible-autocomplete/pull/407).
85
+ - [Pull request #410: Fix long clicks not selecting options](https://github.com/alphagov/accessible-autocomplete/pull/410).
86
+
87
+ ## 2.0.1 - 2019-10-07
88
+
89
+ ### Fixes
90
+
91
+ - [Pull request #379: Ensure multiple autocompletes on one page do not have conflicting id attributes](https://github.com/alphagov/accessible-autocomplete/pull/379)
92
+
93
+ ## 2.0.0 - 2019-09-26
94
+
95
+ We recommend you update to the latest release using npm:
96
+
97
+ `npm install accessible-autocomplete@latest`
98
+
99
+ ### Breaking changes
100
+
101
+ You must make the following change when you migrate to this release, or your service may break.
102
+
103
+ #### Migrate to the new accessible focus state
104
+
105
+ 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/).
106
+
107
+ You do not need to do anything if you’re using Sass.
108
+
109
+ 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.
110
+
111
+ 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/).
112
+
113
+ [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).
114
+
115
+ ### Fixes
116
+
117
+ #### Better compatibility with screen readers
118
+
119
+ 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.
120
+
121
+ Screen readers will now consistently tell users:
122
+
123
+ - when users have entered too few characters in the input field
124
+ - the correct number of search results, and what the results are
125
+ - which result users have highlighted
126
+ - how to use autocomplete in different screen readers - by reading hidden hint text
127
+
128
+ Screen readers will also now avoid telling users information they do not need to know after they highlight an option.
129
+
130
+ Thanks to [Mark Hunter](https://github.com/markhunter27), Chris Moore and everyone at HMRC who worked on these improvements.
131
+
132
+ [Pull request #355: Refinements to address accessibility issues](https://github.com/alphagov/accessible-autocomplete/pull/355)
133
+
134
+ ## 1.6.2 - 2018-11-13
135
+
136
+ - 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)
137
+ ([#316](https://github.com/alphagov/accessible-autocomplete/pull/316))
138
+
139
+ - 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)
140
+ ([#310](https://github.com/alphagov/accessible-autocomplete/pull/310))
141
+
142
+ - Fix position being incorrectly reported as '1 of n' regardless of actual
143
+ position in list – thanks [@PRGfx](https://github.com/PRGfx)
144
+ ([#291](https://github.com/alphagov/accessible-autocomplete/pull/291))
145
+
146
+ - Fix spacebar input not being registered when seeing 'No results found'
147
+ message – thanks [@AdenFraser](https://github.com/AdenFraser)
148
+ ([#287](https://github.com/alphagov/accessible-autocomplete/pull/287))
149
+
150
+ - Update following dependencies (from "Current" to "Wanted"). This fixes failing WebdriverIO tests and updates JS Standard to use eslint 4.
151
+
152
+ | Package | Current | Wanted | Latest |
153
+ |------------------------------------------|---------|--------|--------|
154
+ | babel-eslint | 8.0.0 | 8.2.6 | 8.2.6 |
155
+ | babel-loader | 7.1.0 | 7.1.5 | 7.1.5 |
156
+ | babel-plugin-transform-decorators-legacy | 1.3.4 | 1.3.5 | 1.3.5 |
157
+ | babel-register | 6.24.1 | 6.26.0 | 6.26.0 |
158
+ | babel-runtime | 6.23.0 | 6.26.0 | 6.26.0 |
159
+ | chai | 4.0.2 | 4.1.2 | 4.1.2 |
160
+ | chalk | 2.0.1 | 2.4.1 | 2.4.1 |
161
+ | copy-webpack-plugin | 4.0.1 | 4.5.2 | 4.5.2 |
162
+ | coveralls | 2.13.1 | 2.13.3 | 3.0.2 |
163
+ | cross-env | 5.0.1 | 5.2.0 | 5.2.0 |
164
+ | csso-cli | 1.0.0 | 1.1.0 | 1.1.0 |
165
+ | husky | 0.14.1 | 0.14.3 | 0.14.3 |
166
+ | karma | 1.7.0 | 1.7.1 | 2.0.4 |
167
+ | karma-coverage | 1.1.1 | 1.1.2 | 1.1.2 |
168
+ | karma-mocha-reporter | 2.2.3 | 2.2.5 | 2.2.5 |
169
+ | karma-webpack | 2.0.3 | 2.0.13 | 3.0.0 |
170
+ | mocha | 3.4.2 | 3.5.3 | 5.2.0 |
171
+ | npm-run-all | 4.0.2 | 4.1.3 | 4.1.3 |
172
+ | phantomjs-prebuilt | 2.1.14 | 2.1.16 | 2.1.16 |
173
+ | preact | 8.1.0 | 8.2.9 | 8.2.9 |
174
+ | sinon-chai | 2.11.0 | 2.14.0 | 3.2.0 |
175
+ | source-map-loader | 0.2.1 | 0.2.3 | 0.2.3 |
176
+ | standard | 10.0.2 | 11.0.1 | 11.0.1 |
177
+ | wdio-mocha-framework | 0.5.10 | 0.5.13 | 0.6.2 |
178
+ | wdio-sauce-service | 0.4.0 | 0.4.10 | 0.4.10 |
179
+ | wdio-selenium-standalone-service | 0.0.8 | 0.0.10 | 0.0.10 |
180
+ | wdio-spec-reporter | 0.1.0 | 0.1.5 | 0.1.5 |
181
+ | webdriverio | 4.8.0 | 4.13.1 | 4.13.1 |
182
+ | webpack | 3.0.0 | 3.12.0 | 4.16.1 |
183
+ | webpack-dev-server | 2.5.0 | 2.11.2 | 3.1.4 |
184
+ | webpack-sources | 1.0.1 | 1.1.0 | 1.1.0 |
185
+
186
+ ## 1.6.1 - 2017-09-25
187
+
188
+ - Fix role attr by moving `role='combobox'` to wrapper and adding `role='textbox'` to the input. By [@tobias-g](https://github.com/tobias-g)
189
+ - Fix examples page by removing unrequired npm package `v8-lazy-parse-webpack-plugin`
190
+ - Fix scrolling on iOS by reverting #85, new issue raised to find better fix for clicking custom suggestions #177
191
+ - Fix selection and timeout race condition. By [@tobias-g](https://github.com/tobias-g)
192
+ - Fix dropdown on IE to ensure it isn't focusable. By [@tobias-g](https://github.com/tobias-g)
193
+
194
+ ## 1.6.0 - 2017-07-20
195
+
196
+ - [Feature] Allow customization of the dropdown arrow. By [@sventschui](https://github.com/sventschui).
197
+
198
+ ## 1.5.0 - 2017-07-18
199
+
200
+ - [Feature] Add ability to translate texts. Relates to #96. By [@sventschui](https://github.com/sventschui).
201
+
202
+ ## 1.4.2 - 2017-07-18
203
+
204
+ - Allow space to confirm an option, fixes #98.
205
+ - Add support for navigating lists on IE9, 10 and 11, fixes #193.
206
+
207
+ ## 1.4.1 - 2017-07-06
208
+
209
+ - Fix use of HTML entities in enhanced select options. #151. By [@dracos](https://github.com/dracos).
210
+
211
+ ## 1.4.0 - 2017-07-04
212
+
213
+ - [Feature] Add option to show all values on dropdown. By [@joelanman](https://github.com/joelanman).
214
+
215
+ ## 1.3.2 - 2017-07-03
216
+
217
+ - Redirect keypresses on an option to input, fixes #179.
218
+
219
+ ## 1.3.1 - 2017-06-08
220
+
221
+ - Fix `autoselect: false` not working when using `enhanceSelectElement`.
222
+
223
+ ## 1.3.0 - 2017-06-02
224
+
225
+ - [Feature] Add support for passing an array of strings to `source`. By [@joelanman](https://github.com/joelanman).
226
+
227
+ ## 1.2.1 - 2017-05-24
228
+
229
+ - Fix progressive enhancement in FireFox < 48. By [@revilossor](https://github.com/revilossor).
230
+
231
+ ## 1.2.0 - 2017-05-23
232
+
233
+ - [Feature] Export Preact and React bundles.
234
+
235
+ ## 1.1.0 - 2017-05-18
236
+
237
+ - [Feature] Add `required` option. By [@samtsai](https://github.com/samtsai).
238
+
239
+ ## 1.0.6 - 2017-05-17
240
+
241
+ - Update preact dependency to v8.1.0.
242
+
243
+ ## 1.0.5 - 2017-05-16
244
+
245
+ - 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.
246
+
247
+ ## 1.0.4 - 2017-05-15 (deprecated)
248
+
249
+ - This release does not contain any changes compared to the previous one and is due to a mistake in our build scripts.
250
+
251
+ ## 1.0.3 - 2017-05-15
252
+
253
+ - Do not copy `name` attribute when using `enhanceSelectElement`. By [@lennym](https://github.com/lennym).
254
+
255
+ ## 1.0.2 - 2017-05-12
256
+
257
+ - Add support for an empty `defaultValue` when enhancing a select element. By [@lennym](https://github.com/lennym).
258
+
259
+ ## 1.0.1 - 2017-05-12
260
+
261
+ - Update `style` property in package.json to reflect updated filename. By [@lennym](https://github.com/lennym).
262
+
263
+ ## 1.0.0 - 2017-05-10
264
+
265
+ - [Breaking] Default `autoselect` to `true` when using `enhanceSelectElement`.
266
+ - [Breaking] Make `id` a required attribute.
267
+ - [Breaking] Rename `onSelect` to `onConfirm`.
268
+ - [Breaking] Rename `selectOnBlur` to `confirmOnBlur`.
269
+ - Fix an issue where users couldn't click on custom suggestions on Chrome.
270
+
271
+ ## 0.6.0 - 2017-05-10
272
+
273
+ - [Breaking] Rename component from `accessible-typeahead` to `accessible-autocomplete`.
274
+ - Default `defaultValue` when progressively enhancing.
275
+ - Throw an error when `enhanceSelectElement` is called without a `selectElement`.
276
+ - Throw errors when `accessibleAutocomplete` is called without `element` or `source`.
277
+
278
+ ## 0.5.0 - 2017-05-09
279
+
280
+ - Test the typeahead with end to end tests.
281
+ - Don't display hints on browsers that don't support pointer-events.
282
+ - [Breaking] Rename `dist/styled.min.css` to `dist/accessible-typeahead.min.css`.
283
+ - [Breaking] Rename library main export from `AccessibleTypeahead` to `accessibleTypeahead`.
284
+ - Fix aria status region to more reliably trigger when the number of results stay the same.
285
+ - Fix hint rendering and being picked up by assistive technologies.
286
+ - More aria status region above input so it's more easily picked while navigating.
287
+
288
+ ## 0.4.2 - 2017-05-03
289
+
290
+ - Add touchEnd handler for iOS and touch devices, fixes custom suggestions.
291
+ - Add `style` declaration in package.json
292
+ - Add support for UMD/commonjs module definition.
293
+
294
+ ## 0.4.1 - 2017-04-26
295
+
296
+ - Minify `styled.css` for production.
297
+
298
+ ## 0.4.0 - 2017-04-11
299
+
300
+ - [Breaking] Don't focus suggestions when hovering them, add `:hover` CSS class.
301
+ - Add `showNoOptionsFound` property to allow users to disable this behaviour.
302
+ - Pass through unrecognised key events to input, allowing users to continue typing when they are focusing an option.
303
+
304
+ ## 0.3.5 - 2017-04-06
305
+
306
+ - Don't prepopulate `defaultValue` in `enhanceSelectElement`.
307
+
308
+ ## 0.3.4 - 2017-04-06
309
+
310
+ - Pass actual selected object into `onSelect`.
311
+ - Add `selectOnBlur` property to allow users to disable this behaviour.
312
+ - Add `placeholder` property.
313
+
314
+ ## 0.3.3 - 2017-04-04
315
+
316
+ - Add `templates.inputValue` and `templates.suggestion` properties. These allow users to override how the suggestions are displayed.
317
+
318
+ ## 0.3.2 - 2017-04-03
319
+
320
+ - Add `AccessibleTypeahead.enhanceSelectElement` function.
321
+ - Add `onSelect` property.
322
+
323
+ ## 0.3.1 - 2017-03-09
324
+
325
+ - Add ability to specify a `defaultValue` to prefill the input.
326
+ - When user has selected an option with the keyboard, blurring will select.
327
+ - When user has no selected but autoselect is on, blurring will select.
328
+ - Hovering no longer selects, just focuses.
329
+ - When hovering out of component, focus returns to selected.
330
+ - Allow enter to submit forms when menu isn't opened.
331
+ - Hide results when going under minLength.
332
+
333
+ ## 0.3.0 - 2017-03-09
334
+
335
+ - [Breaking] Add `displayMenu` property. The default is `inline` which was not the previous default.
336
+ - CSS colour changes, and more properties moved away from inline styles.
337
+ - Turn off native browser autocomplete so it doesn't interfere with typeahead overlay.
338
+ - Change the content and styling of the 'No results found' feature.
339
+
340
+ ## 0.2.4 - 2017-03-02
341
+
342
+ - Display "No options found" when there are no results.
343
+ - 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.
344
+ - 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.
345
+
346
+ ## 0.2.3 - 2017-02-21
347
+
348
+ - Add `minLength` property, which:
349
+ - Tells the aria region to display text that the user should type in more characters;
350
+ - Doesn't call the `source` until that lower limit is reached.
351
+ - Select text only when component is unfocused.
352
+
353
+ ## 0.2.2 - 2017-02-16
354
+
355
+ - Fix focus/blur events on IE11.
356
+ - Fix value of `aria-expanded` attribute to be based on `menuOpen`.
357
+ - Remove `aria-activedescendant` attribute when no option selected.
358
+ - Set `aria-selected` on options when they are focused.
359
+ - Fix clicking on options on Safari.
360
+ - Use a darker blue in the styled example for better contrast ratios.
361
+ - Don't close menu when blurring options or input on iOS, to allow VoiceOver users the ability to select from the available options.
362
+ - Autoselect entire text region when focusing into the input.
363
+
364
+ ## 0.2.1 - 2017-02-03
365
+
366
+ - Don't close menu when closing the keyboard on iOS, to allow VoiceOver users the ability to select from the available options.
367
+ - Add ability to set `name` attribute on input.
368
+
369
+ ## 0.2.0 - 2017-01-31
370
+
371
+ - [Breaking] Change the CSS classes to our own instead of the jQuery typeahead ones.
372
+ - Allow importing styling from file in `examples/styled.css`.
373
+ - Tweak the styled example to fix two Safari bugs:
374
+ - fix scroll bar appearing in menu where none is necessary;
375
+ - fix weird margin separating the input from the menu.
376
+
377
+ ## 0.1.3 - 2017-01-31
378
+
379
+ - Don't apply focused CSS on hover, change handler to MouseOver instead of MouseMove.
380
+ - (WIP) Make enter select first option if `autoselect` is enabled. This feature is not finished yet.
381
+ - Close results when focusing out of component after hovering an element.
382
+ - Update styled example:
383
+ - unbold results;
384
+ - make height of options consistent with input;
385
+ - remove top border from results menu;
386
+ - remove default focus outline on options.
387
+ - Don't display the menu when there are no options.
388
+ - Prevent accidental form submission by `preventDefault`ing on enter key.
389
+ - Add form around basic example.
390
+
391
+ ## 0.1.2 - 2017-01-20
392
+
393
+ - Don't specify typeahead menu width inline. Allows custom CSS to override it.
394
+
395
+ ## 0.1.0 - 2017-01-19
396
+
397
+ - Initial release.
398
+ - 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)