Skip to content

Commit

Permalink
[NO JIRA]: Fix Spinner removing aria-hidden from element (#3673)
Browse files Browse the repository at this point in the history
  • Loading branch information
olliecurtis authored Nov 21, 2024
1 parent af4433c commit b62337b
Show file tree
Hide file tree
Showing 10 changed files with 79 additions and 8 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ coverage
/packages/bpk-component-flare/src/__generated__
/packages/bpk-component-icon/sm
/packages/bpk-component-icon/lg
/packages/bpk-component-spinner/src/spinners
/packages/bpk-stylesheets/base.js
*.d.ts
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/dist-storybook
/coverage
/packages/bpk-component-icon/*/
/packages/bpk-component-spinner/src/spinners
/packages/bpk-component-flare/src/__generated__
!/packages/bpk-component-icon/src
node_modules
Expand Down
40 changes: 40 additions & 0 deletions gulpfile.js/bpk-component-spinner/gulpfile.babel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Backpack - Skyscanner's Design System
*
* Copyright 2016 Skyscanner Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

const fs = require('fs');

const gulp = require('gulp');

const ICONS_FOLDER_PATH = './node_modules/@skyscanner/bpk-svgs/dist/js/spinners';

const rm = (path, options) =>
new Promise((resolve, reject) =>
fs.rm(path, options, (err, ...d) => (err ? reject(err) : resolve(...d))),
);
gulp.task('copy', () =>
gulp
.src(`${ICONS_FOLDER_PATH}/**/*`)
.pipe(gulp.dest('./packages/bpk-component-spinner/src/spinners')),
);

gulp.task('clean', () =>
Promise.all([
rm('./packages/bpk-component-spinner/src/spinners', { force: true, recursive: true }),
]),
);
gulp.task('generateSpinners', gulp.series('clean', 'copy'));
32 changes: 32 additions & 0 deletions gulpfile.js/bpk-component-spinner/gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Backpack - Skyscanner's Design System
*
* Copyright 2016 Skyscanner Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
In Babel 7+, Babel stops looking for config files once it finds a package.json. As this
is a monorepo and the Babel config file is in the repo root, we need to tell Babel to go
upwards up the tree to find it.
Without this, gulp will not run as gulpfile.babel.js won't be transpiled and we'll get syntax
errors.
*/

require('@babel/register')({
rootMode: 'upward',
});

require('./gulpfile.babel');
3 changes: 2 additions & 1 deletion gulpfile.js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ const gulp = require('gulp');

require('./bpk-component-flare/gulpfile');
require('./bpk-component-icon/gulpfile');
require('./bpk-component-spinner/gulpfile');

gulp.task('default', gulp.series('generateFlare', 'generateIcons'));
gulp.task('default', gulp.series('generateFlare', 'generateIcons', 'generateSpinners'));
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
* limitations under the License.
*/

import XlSpinner from '@skyscanner/bpk-svgs/dist/js/spinners/xl';

import { cssModules } from '../../bpk-react-utils';

import SPINNER_TYPES from './spinnerTypes';
import XlSpinner from './spinners/xl';

import type { SpinnerTypes } from './spinnerTypes';

Expand Down
2 changes: 1 addition & 1 deletion packages/bpk-component-spinner/src/BpkLargeSpinner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
* limitations under the License.
*/

import LgSpinner from '@skyscanner/bpk-svgs/dist/js/spinners/lg';

import { cssModules } from '../../bpk-react-utils';

import SPINNER_TYPES from './spinnerTypes';
import LgSpinner from './spinners/lg';

import type { SpinnerTypes } from './spinnerTypes';

Expand Down
2 changes: 1 addition & 1 deletion packages/bpk-component-spinner/src/BpkSpinner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
* limitations under the License.
*/

import SmSpinner from '@skyscanner/bpk-svgs/dist/js/spinners/sm';

import { cssModules } from '../../bpk-react-utils';

import SPINNER_TYPES from './spinnerTypes';
import SmSpinner from './spinners/sm';

import type { SpinnerTypes } from './spinnerTypes';

Expand Down
2 changes: 0 additions & 2 deletions packages/bpk-component-spinner/src/themeAttributes-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
* limitations under the License.
*/

/* @flow strict */

import themeAttributes from './themeAttributes';

describe('themeAttributes', () => {
Expand Down
2 changes: 0 additions & 2 deletions packages/bpk-component-spinner/src/themeAttributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,4 @@
* limitations under the License.
*/

/* @flow strict */

export default ['spinnerPrimaryColor'];

0 comments on commit b62337b

Please sign in to comment.