Skip to content

Commit

Permalink
spinner fixes (#3434)
Browse files Browse the repository at this point in the history
Co-authored-by: Mungo Dewar <mungodewar@skyscanner.net>
  • Loading branch information
metalix2 and mungodewar committed May 13, 2024
1 parent 1861cc2 commit 8eb7250
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 131 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@
* limitations under the License.
*/

/* @flow strict */

import PropTypes from 'prop-types';
import type { Node } from 'react';
import type { ReactElement } from 'react';
import { Children } from 'react';

import { SPINNER_TYPES } from '../../packages/bpk-component-spinner';
Expand All @@ -30,7 +28,7 @@ import STYLES from './SpinnerLayout.module.scss';
const getClassName = cssModules(STYLES);

type Props = {
children: Node,
children: Array<ReactElement<any, any>> | ReactElement<any, any> // Expect a single or array of React elements
};

const SpinnerLayout = (props: Props) => {
Expand Down
File renamed without changes.
File renamed without changes.
38 changes: 0 additions & 38 deletions packages/bpk-component-spinner/src/BpkExtraLargeSpinner.d.ts

This file was deleted.

4 changes: 3 additions & 1 deletion packages/bpk-component-spinner/src/BpkExtraLargeSpinner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ import { cssModules } from '../../bpk-react-utils';

import SPINNER_TYPES from './spinnerTypes';

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

import STYLES from './BpkSpinner.module.scss';

const getClassName = cssModules(STYLES);

type Props = {
type: keyof typeof SPINNER_TYPES,
type: SpinnerTypes,
className?: string,
};

Expand Down
41 changes: 0 additions & 41 deletions packages/bpk-component-spinner/src/BpkLargeSpinner.d.ts

This file was deleted.

4 changes: 3 additions & 1 deletion packages/bpk-component-spinner/src/BpkLargeSpinner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ import { cssModules } from '../../bpk-react-utils';

import SPINNER_TYPES from './spinnerTypes';

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

import STYLES from './BpkSpinner.module.scss';

const getClassName = cssModules(STYLES);

type Props = {
type: keyof typeof SPINNER_TYPES,
type: SpinnerTypes,
className?: string,
alignToButton: boolean,
};
Expand Down
41 changes: 0 additions & 41 deletions packages/bpk-component-spinner/src/BpkSpinner.d.ts

This file was deleted.

4 changes: 3 additions & 1 deletion packages/bpk-component-spinner/src/BpkSpinner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ import { cssModules } from '../../bpk-react-utils';

import SPINNER_TYPES from './spinnerTypes';

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

import STYLES from './BpkSpinner.module.scss';

const getClassName = cssModules(STYLES);

type Props = {
type: keyof typeof SPINNER_TYPES,
type: SpinnerTypes,
className?: string,
alignToButton: boolean,
};
Expand Down
10 changes: 6 additions & 4 deletions packages/bpk-component-spinner/src/spinnerTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
* limitations under the License.
*/

/* @flow strict */

export default {
const SPINNER_TYPES = {
primary: 'primary',
light: 'light',
dark: 'dark',
};
} as const;

export default SPINNER_TYPES;

export type SpinnerTypes = (typeof SPINNER_TYPES)[keyof typeof SPINNER_TYPES];

0 comments on commit 8eb7250

Please sign in to comment.