Skip to content

Commit

Permalink
Fix bpkButton ts imports (#2949)
Browse files Browse the repository at this point in the history
Importing ts types should be done with the type keyword. When the
code is transpiled, these imports are stripped out.

If we don't add the keyword, the import of Props sticks around, and if
consumers evaluate the code at all, it will fail as the module has no
export named Props as it's already been stripped out.

Co-authored-by: Chris Moore <[email protected]>
  • Loading branch information
runmoore and runmoore authored Aug 3, 2023
1 parent a3214b5 commit 3bccbbf
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/bpk-component-button/src/BpkButtonBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

/* @flow strict */

import { Props, propTypes, defaultProps } from './common-types';
import { type Props, propTypes, defaultProps } from './common-types';
import COMMON_STYLES from './BpkButtonBase.module.scss';

// This was originally depended upon from the bpk-react-utils package, however
Expand Down
2 changes: 1 addition & 1 deletion packages/bpk-component-button/src/BpkButtonDestructive.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

/* @flow strict */

import { Props, defaultProps, propTypes } from './common-types';
import { type Props, defaultProps, propTypes } from './common-types';
import BpkButtonBase, { cssModules } from './BpkButtonBase';
import STYLES from './BpkButtonDestructive.module.scss';

Expand Down
2 changes: 1 addition & 1 deletion packages/bpk-component-button/src/BpkButtonFeatured.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

/* @flow strict */

import { Props, defaultProps, propTypes } from './common-types';
import { type Props, defaultProps, propTypes } from './common-types';
import BpkButtonBase, { cssModules } from './BpkButtonBase';
import STYLES from './BpkButtonFeatured.module.scss';

Expand Down
6 changes: 5 additions & 1 deletion packages/bpk-component-button/src/BpkButtonLink.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@

/* @flow strict */

import { Props as CommonProps, defaultProps, propTypes } from './common-types';
import {
type Props as CommonProps,
defaultProps,
propTypes,
} from './common-types';
import BpkButtonBase, { cssModules } from './BpkButtonBase';
import STYLES from './BpkButtonLink.module.scss';

Expand Down
6 changes: 5 additions & 1 deletion packages/bpk-component-button/src/BpkButtonLinkOnDark.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@

/* @flow strict */

import { Props as CommonProps, defaultProps, propTypes } from './common-types';
import {
type Props as CommonProps,
defaultProps,
propTypes,
} from './common-types';
import BpkButtonBase, { cssModules } from './BpkButtonBase';
import STYLES from './BpkButtonLinkOnDark.module.scss';

Expand Down
2 changes: 1 addition & 1 deletion packages/bpk-component-button/src/BpkButtonPrimary.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

/* @flow strict */

import { Props, defaultProps, propTypes } from './common-types';
import { type Props, defaultProps, propTypes } from './common-types';
import BpkButtonBase from './BpkButtonBase';

// TODO: BpkButtonBase has the primary button style as it wasn't removed to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

/* @flow strict */

import { Props, defaultProps, propTypes } from './common-types';
import { type Props, defaultProps, propTypes } from './common-types';
import BpkButtonBase, { cssModules } from './BpkButtonBase';
import STYLES from './BpkButtonPrimaryOnDark.module.scss';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

/* @flow strict */

import { Props, defaultProps, propTypes } from './common-types';
import { type Props, defaultProps, propTypes } from './common-types';
import BpkButtonBase, { cssModules } from './BpkButtonBase';
import STYLES from './BpkButtonPrimaryOnLight.module.scss';

Expand Down
2 changes: 1 addition & 1 deletion packages/bpk-component-button/src/BpkButtonSecondary.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

/* @flow strict */

import { Props, defaultProps, propTypes } from './common-types';
import { type Props, defaultProps, propTypes } from './common-types';
import BpkButtonBase, { cssModules } from './BpkButtonBase';
import STYLES from './BpkButtonSecondary.module.scss';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

/* @flow strict */

import { Props, defaultProps, propTypes } from './common-types';
import { type Props, defaultProps, propTypes } from './common-types';
import BpkButtonBase, { cssModules } from './BpkButtonBase';
import STYLES from './BpkButtonSecondaryOnDark.module.scss';

Expand Down

0 comments on commit 3bccbbf

Please sign in to comment.