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,123 @@
1
+ require('dotenv').config()
2
+ require('@babel/register')({
3
+ rootMode: 'upward'
4
+ })
5
+
6
+ const { join } = require('path')
7
+ const { cwd } = require('process')
8
+ const puppeteer = require('puppeteer')
9
+
10
+ const {
11
+ PORT = 4567,
12
+ SAUCE_ACCESS_KEY,
13
+ SAUCE_BUILD_NUMBER,
14
+ SAUCE_ENABLED,
15
+ SAUCE_USERNAME
16
+ } = process.env
17
+
18
+ /**
19
+ * Browsers for local tests
20
+ *
21
+ * @type {RemoteCapabilities}
22
+ */
23
+ const capabilitiesLocal = [
24
+ {
25
+ browserName: 'chrome',
26
+ 'goog:chromeOptions': {
27
+ args: ['--headless=new'],
28
+ binary: puppeteer.executablePath()
29
+ }
30
+ }
31
+ ]
32
+
33
+ /**
34
+ * Browsers for Sauce Labs tests
35
+ *
36
+ * @type {RemoteCapabilities}
37
+ */
38
+ const capabilitiesSauce = [
39
+ {
40
+ browserName: 'chrome',
41
+ browserVersion: 'latest',
42
+ platformName: 'Windows 10',
43
+ 'sauce:options': {
44
+ build: SAUCE_BUILD_NUMBER
45
+ }
46
+ },
47
+ {
48
+ browserName: 'firefox',
49
+ browserVersion: '55',
50
+ platformName: 'Windows 10',
51
+ 'sauce:options': {
52
+ build: SAUCE_BUILD_NUMBER
53
+ }
54
+ },
55
+ {
56
+ browserName: 'internet explorer',
57
+ browserVersion: 'latest',
58
+ platformName: 'Windows 10',
59
+ 'sauce:options': {
60
+ build: SAUCE_BUILD_NUMBER
61
+ }
62
+ }
63
+ ]
64
+
65
+ /**
66
+ * WebdriverIO config
67
+ *
68
+ * @type {Testrunner}
69
+ */
70
+ exports.config = {
71
+ user: SAUCE_USERNAME,
72
+ key: SAUCE_ACCESS_KEY,
73
+
74
+ // Use DevTools prototype for Puppeteer
75
+ automationProtocol: SAUCE_ENABLED === 'true'
76
+ ? 'webdriver'
77
+ : 'devtools',
78
+
79
+ baseUrl: `http://localhost:${PORT}`,
80
+
81
+ capabilities: SAUCE_ENABLED === 'true'
82
+ ? capabilitiesSauce
83
+ : capabilitiesLocal,
84
+
85
+ framework: 'mocha',
86
+ outputDir: join(cwd(), 'logs'),
87
+ reporters: ['spec'],
88
+
89
+ services: [
90
+ /**
91
+ * Web server options
92
+ *
93
+ * @type {[string, StaticServerOptions]}
94
+ */
95
+ ['static-server', {
96
+ folders: [
97
+ { mount: '/', path: join(cwd(), 'examples') },
98
+ { mount: '/dist/', path: join(cwd(), 'dist') }
99
+ ],
100
+ port: PORT
101
+ }],
102
+
103
+ /**
104
+ * Browser testing options
105
+ *
106
+ * @type {[string, SauceServiceConfig]}
107
+ */
108
+ ['sauce', {
109
+ // Optionally connect to Sauce Labs
110
+ sauceConnect: SAUCE_ENABLED === 'true'
111
+ }]
112
+ ],
113
+
114
+ specs: [join(cwd(), 'test/integration/**/*.js')],
115
+ waitforTimeout: 30 * 10000
116
+ }
117
+
118
+ /**
119
+ * @typedef {import('@wdio/types').Options.Testrunner} Testrunner
120
+ * @typedef {import('@wdio/types').Capabilities.RemoteCapabilities} RemoteCapabilities
121
+ * @typedef {import('@wdio/static-server-service').StaticServerOptions} StaticServerOptions
122
+ * @typedef {import('@wdio/sauce-service').SauceServiceConfig} SauceServiceConfig
123
+ */
@@ -0,0 +1,244 @@
1
+ import { join } from 'path'
2
+ import { cwd } from 'process'
3
+
4
+ import MiniCssExtractPlugin from 'mini-css-extract-plugin'
5
+ import TerserPlugin from 'terser-webpack-plugin'
6
+ import webpack from 'webpack'
7
+
8
+ const {
9
+ NODE_ENV = 'development',
10
+ PORT = 8080
11
+ } = process.env
12
+
13
+ /**
14
+ * Base webpack build mode
15
+ */
16
+ const mode = ['development', 'test'].includes(NODE_ENV)
17
+ ? 'development'
18
+ : 'production'
19
+
20
+ /**
21
+ * Base webpack config
22
+ *
23
+ * @satisfies {WebpackConfiguration}
24
+ */
25
+ const config = {
26
+ bail: mode === 'production',
27
+ context: join(cwd(), 'src'),
28
+
29
+ devtool: mode === 'development'
30
+ ? 'inline-source-map'
31
+ : 'source-map',
32
+
33
+ externalsType: 'umd',
34
+ mode,
35
+
36
+ module: {
37
+ rules: [
38
+ {
39
+ test: /\.css$/,
40
+ use: [
41
+ MiniCssExtractPlugin.loader,
42
+ 'css-loader',
43
+ 'postcss-loader'
44
+ ]
45
+ },
46
+ {
47
+ test: /\.js$/,
48
+ include: join(cwd(), 'src'),
49
+ enforce: 'pre',
50
+ loader: 'source-map-loader'
51
+ },
52
+ {
53
+ test: /\.js$/,
54
+ exclude: /node_modules/,
55
+ use: {
56
+ loader: 'babel-loader',
57
+ options: {
58
+ rootMode: 'upward'
59
+ }
60
+ }
61
+ }
62
+ ]
63
+ },
64
+
65
+ node: {
66
+ global: true,
67
+ __filename: false,
68
+ __dirname: false
69
+ },
70
+
71
+ optimization: {
72
+ emitOnErrors: mode === 'production',
73
+ minimize: mode === 'production',
74
+ minimizer: [new TerserPlugin({
75
+ extractComments: true,
76
+ terserOptions: {
77
+ format: { comments: false },
78
+
79
+ // Include sources content from dependency source maps
80
+ sourceMap: {
81
+ includeSources: true
82
+ },
83
+
84
+ // Compatibility workarounds
85
+ safari10: true
86
+ }
87
+ })]
88
+ },
89
+
90
+ output: {
91
+ path: join(cwd(), 'dist'),
92
+ publicPath: '/dist'
93
+ },
94
+
95
+ stats: {
96
+ colors: true
97
+ }
98
+ }
99
+
100
+ /**
101
+ * Bundle standalone 'accessible-autocomplete'
102
+ *
103
+ * @satisfies {WebpackConfiguration}
104
+ */
105
+ const bundleStandalone = {
106
+ ...config,
107
+
108
+ devServer: {
109
+ allowedHosts: 'all',
110
+ host: '0.0.0.0',
111
+ open: '/dist',
112
+ port: PORT,
113
+ static: [
114
+ {
115
+ directory: join(cwd(), 'examples'),
116
+ publicPath: '/dist',
117
+ watch: true
118
+ }
119
+ ]
120
+ },
121
+
122
+ entry: {
123
+ 'accessible-autocomplete': {
124
+ import: [
125
+ join(cwd(), 'src/autocomplete.css'),
126
+ join(cwd(), 'src/wrapper.js')
127
+ ],
128
+ filename: '[name].min.js',
129
+ library: {
130
+ export: 'default',
131
+ name: 'accessibleAutocomplete',
132
+ type: 'umd'
133
+ }
134
+ }
135
+ },
136
+
137
+ plugins: [
138
+ new webpack.DefinePlugin({
139
+ 'process.env.COMPONENT_LIBRARY': '"PREACT"',
140
+ 'process.env.NODE_ENV': `"${mode}"`
141
+ }),
142
+ new MiniCssExtractPlugin({
143
+ filename: '[name].min.css'
144
+ })
145
+ ]
146
+ }
147
+
148
+ /**
149
+ * Bundle for Preact 'accessible-autocomplete/preact.js'
150
+ *
151
+ * @satisfies {WebpackConfiguration}
152
+ */
153
+ const bundlePreact = {
154
+ ...config,
155
+
156
+ entry: {
157
+ 'accessible-autocomplete.preact': {
158
+ import: join(cwd(), 'src/autocomplete.js'),
159
+ filename: 'lib/[name].min.js',
160
+ library: {
161
+ name: 'Autocomplete',
162
+ type: 'umd',
163
+ umdNamedDefine: true
164
+ }
165
+ }
166
+ },
167
+
168
+ externals: {
169
+ preact: 'preact'
170
+ },
171
+
172
+ output: {
173
+ ...config.output,
174
+
175
+ // Support `window.preact` when not bundled
176
+ // e.g. with all dependencies included via unpkg.com
177
+ globalObject: 'this'
178
+ },
179
+
180
+ plugins: [
181
+ new webpack.DefinePlugin({
182
+ 'process.env.COMPONENT_LIBRARY': '"PREACT"',
183
+ 'process.env.NODE_ENV': `"${mode}"`
184
+ })
185
+ ]
186
+ }
187
+
188
+ /**
189
+ * Bundle for React 'accessible-autocomplete/react.js'
190
+ *
191
+ * @satisfies {WebpackConfiguration}
192
+ */
193
+ const bundleReact = {
194
+ ...config,
195
+
196
+ entry: {
197
+ 'accessible-autocomplete.react': {
198
+ import: join(cwd(), 'src/autocomplete.js'),
199
+ filename: 'lib/[name].min.js',
200
+ library: {
201
+ name: 'Autocomplete',
202
+ type: 'umd',
203
+ umdNamedDefine: true
204
+ }
205
+ }
206
+ },
207
+
208
+ externals: {
209
+ preact: {
210
+ amd: 'react',
211
+ commonjs: 'react',
212
+ commonjs2: 'react',
213
+ root: 'React'
214
+ }
215
+ },
216
+
217
+ output: {
218
+ ...config.output,
219
+
220
+ // Support extending `window.React` when not bundled
221
+ // e.g. with all dependencies included via unpkg.com
222
+ globalObject: 'this'
223
+ },
224
+
225
+ plugins: [
226
+ new webpack.DefinePlugin({
227
+ 'process.env.COMPONENT_LIBRARY': '"REACT"',
228
+ 'process.env.NODE_ENV': `"${mode}"`
229
+ })
230
+ ]
231
+ }
232
+
233
+ /**
234
+ * Multiple webpack config export
235
+ */
236
+ export default [
237
+ bundleStandalone,
238
+ bundlePreact,
239
+ bundleReact
240
+ ]
241
+
242
+ /**
243
+ * @typedef {import('webpack-dev-server').WebpackConfiguration} WebpackConfiguration
244
+ */
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.3.0
4
+ version: 43.4.1
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-19 00:00:00.000000000 Z
11
+ date: 2024-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config
@@ -388,6 +388,7 @@ files:
388
388
  - app/assets/images/govuk_publishing_components/govuk-schema-placeholder-16x9.png
389
389
  - app/assets/images/govuk_publishing_components/govuk-schema-placeholder-1x1.png
390
390
  - app/assets/images/govuk_publishing_components/govuk-schema-placeholder-4x3.png
391
+ - app/assets/images/govuk_publishing_components/icon-autocomplete-search-suggestion.svg
391
392
  - app/assets/images/govuk_publishing_components/icon-close.svg
392
393
  - app/assets/images/govuk_publishing_components/icon-file-download.svg
393
394
  - app/assets/images/govuk_publishing_components/icon-important.svg
@@ -453,6 +454,7 @@ files:
453
454
  - app/assets/javascripts/govuk_publishing_components/components/print-link.js
454
455
  - app/assets/javascripts/govuk_publishing_components/components/radio.js
455
456
  - app/assets/javascripts/govuk_publishing_components/components/reorderable-list.js
457
+ - app/assets/javascripts/govuk_publishing_components/components/search-with-autocomplete.js
456
458
  - app/assets/javascripts/govuk_publishing_components/components/single-page-notification-button.js
457
459
  - app/assets/javascripts/govuk_publishing_components/components/skip-link.js
458
460
  - app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js
@@ -541,6 +543,7 @@ files:
541
543
  - app/assets/stylesheets/govuk_publishing_components/components/_radio.scss
542
544
  - app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss
543
545
  - app/assets/stylesheets/govuk_publishing_components/components/_reorderable-list.scss
546
+ - app/assets/stylesheets/govuk_publishing_components/components/_search-with-autocomplete.scss
544
547
  - app/assets/stylesheets/govuk_publishing_components/components/_search.scss
545
548
  - app/assets/stylesheets/govuk_publishing_components/components/_secondary-navigation.scss
546
549
  - app/assets/stylesheets/govuk_publishing_components/components/_select.scss
@@ -686,6 +689,7 @@ files:
686
689
  - app/views/govuk_publishing_components/components/_related_navigation.html.erb
687
690
  - app/views/govuk_publishing_components/components/_reorderable_list.html.erb
688
691
  - app/views/govuk_publishing_components/components/_search.html.erb
692
+ - app/views/govuk_publishing_components/components/_search_with_autocomplete.html.erb
689
693
  - app/views/govuk_publishing_components/components/_secondary_navigation.html.erb
690
694
  - app/views/govuk_publishing_components/components/_select.html.erb
691
695
  - app/views/govuk_publishing_components/components/_share_links.html.erb
@@ -779,6 +783,7 @@ files:
779
783
  - app/views/govuk_publishing_components/components/docs/related_navigation.yml
780
784
  - app/views/govuk_publishing_components/components/docs/reorderable_list.yml
781
785
  - app/views/govuk_publishing_components/components/docs/search.yml
786
+ - app/views/govuk_publishing_components/components/docs/search_with_autocomplete.yml
782
787
  - app/views/govuk_publishing_components/components/docs/secondary_navigation.yml
783
788
  - app/views/govuk_publishing_components/components/docs/select.yml
784
789
  - app/views/govuk_publishing_components/components/docs/share_links.yml
@@ -943,6 +948,45 @@ files:
943
948
  - lib/govuk_publishing_components/presenters/subscription_links_helper.rb
944
949
  - lib/govuk_publishing_components/presenters/translation_nav_helper.rb
945
950
  - lib/govuk_publishing_components/version.rb
951
+ - node_modules/accessible-autocomplete/CHANGELOG.md
952
+ - node_modules/accessible-autocomplete/CODEOWNERS
953
+ - node_modules/accessible-autocomplete/CONTRIBUTING.md
954
+ - node_modules/accessible-autocomplete/LICENSE.txt
955
+ - node_modules/accessible-autocomplete/Procfile
956
+ - node_modules/accessible-autocomplete/README.md
957
+ - node_modules/accessible-autocomplete/accessibility-criteria.md
958
+ - node_modules/accessible-autocomplete/app.json
959
+ - node_modules/accessible-autocomplete/babel.config.js
960
+ - node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.css
961
+ - node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.css.map
962
+ - node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.js
963
+ - node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.js.map
964
+ - node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.preact.min.js
965
+ - node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.preact.min.js.map
966
+ - node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.react.min.js
967
+ - node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.react.min.js.map
968
+ - node_modules/accessible-autocomplete/examples/form-single.html
969
+ - node_modules/accessible-autocomplete/examples/form.html
970
+ - node_modules/accessible-autocomplete/examples/index.html
971
+ - node_modules/accessible-autocomplete/examples/preact/index.html
972
+ - node_modules/accessible-autocomplete/examples/react/index.html
973
+ - node_modules/accessible-autocomplete/package.json
974
+ - node_modules/accessible-autocomplete/postcss.config.js
975
+ - node_modules/accessible-autocomplete/preact.js
976
+ - node_modules/accessible-autocomplete/react.js
977
+ - node_modules/accessible-autocomplete/scripts/check-staged.mjs
978
+ - node_modules/accessible-autocomplete/src/autocomplete.css
979
+ - node_modules/accessible-autocomplete/src/autocomplete.js
980
+ - node_modules/accessible-autocomplete/src/dropdown-arrow-down.js
981
+ - node_modules/accessible-autocomplete/src/status.js
982
+ - node_modules/accessible-autocomplete/src/wrapper.js
983
+ - node_modules/accessible-autocomplete/test/functional/dropdown-arrow-down.js
984
+ - node_modules/accessible-autocomplete/test/functional/index.js
985
+ - node_modules/accessible-autocomplete/test/functional/wrapper.js
986
+ - node_modules/accessible-autocomplete/test/integration/index.js
987
+ - node_modules/accessible-autocomplete/test/karma.config.js
988
+ - node_modules/accessible-autocomplete/test/wdio.config.js
989
+ - node_modules/accessible-autocomplete/webpack.config.mjs
946
990
  - node_modules/axe-core/LICENSE
947
991
  - node_modules/axe-core/LICENSE-3RD-PARTY.txt
948
992
  - node_modules/axe-core/README.md