govuk_publishing_components 43.4.0 → 43.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/lib/govuk_publishing_components/version.rb +1 -1
  3. data/node_modules/accessible-autocomplete/CHANGELOG.md +390 -0
  4. data/node_modules/accessible-autocomplete/CODEOWNERS +2 -0
  5. data/node_modules/accessible-autocomplete/CONTRIBUTING.md +161 -0
  6. data/node_modules/accessible-autocomplete/LICENSE.txt +20 -0
  7. data/node_modules/accessible-autocomplete/Procfile +1 -0
  8. data/node_modules/accessible-autocomplete/README.md +490 -0
  9. data/node_modules/accessible-autocomplete/accessibility-criteria.md +42 -0
  10. data/node_modules/accessible-autocomplete/app.json +15 -0
  11. data/node_modules/accessible-autocomplete/babel.config.js +29 -0
  12. data/node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.css +3 -0
  13. data/node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.css.map +1 -0
  14. data/node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.js +2 -0
  15. data/node_modules/accessible-autocomplete/dist/accessible-autocomplete.min.js.map +1 -0
  16. data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.preact.min.js +2 -0
  17. data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.preact.min.js.map +1 -0
  18. data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.react.min.js +2 -0
  19. data/node_modules/accessible-autocomplete/dist/lib/accessible-autocomplete.react.min.js.map +1 -0
  20. data/node_modules/accessible-autocomplete/examples/form-single.html +379 -0
  21. data/node_modules/accessible-autocomplete/examples/form.html +673 -0
  22. data/node_modules/accessible-autocomplete/examples/index.html +738 -0
  23. data/node_modules/accessible-autocomplete/examples/preact/index.html +346 -0
  24. data/node_modules/accessible-autocomplete/examples/react/index.html +347 -0
  25. data/node_modules/accessible-autocomplete/package.json +93 -0
  26. data/node_modules/accessible-autocomplete/postcss.config.js +16 -0
  27. data/node_modules/accessible-autocomplete/preact.js +1 -0
  28. data/node_modules/accessible-autocomplete/react.js +1 -0
  29. data/node_modules/accessible-autocomplete/scripts/check-staged.mjs +16 -0
  30. data/node_modules/accessible-autocomplete/src/autocomplete.css +167 -0
  31. data/node_modules/accessible-autocomplete/src/autocomplete.js +608 -0
  32. data/node_modules/accessible-autocomplete/src/dropdown-arrow-down.js +11 -0
  33. data/node_modules/accessible-autocomplete/src/status.js +125 -0
  34. data/node_modules/accessible-autocomplete/src/wrapper.js +60 -0
  35. data/node_modules/accessible-autocomplete/test/functional/dropdown-arrow-down.js +46 -0
  36. data/node_modules/accessible-autocomplete/test/functional/index.js +793 -0
  37. data/node_modules/accessible-autocomplete/test/functional/wrapper.js +339 -0
  38. data/node_modules/accessible-autocomplete/test/integration/index.js +309 -0
  39. data/node_modules/accessible-autocomplete/test/karma.config.js +46 -0
  40. data/node_modules/accessible-autocomplete/test/wdio.config.js +123 -0
  41. data/node_modules/accessible-autocomplete/webpack.config.mjs +244 -0
  42. metadata +40 -1
@@ -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,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_publishing_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 43.4.0
4
+ version: 43.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
@@ -948,6 +948,45 @@ files:
948
948
  - lib/govuk_publishing_components/presenters/subscription_links_helper.rb
949
949
  - lib/govuk_publishing_components/presenters/translation_nav_helper.rb
950
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
951
990
  - node_modules/axe-core/LICENSE
952
991
  - node_modules/axe-core/LICENSE-3RD-PARTY.txt
953
992
  - node_modules/axe-core/README.md