diff --git a/.eslintrc b/.eslintrc index 26a405b7745..a5c78eff7b6 100644 --- a/.eslintrc +++ b/.eslintrc @@ -29,7 +29,7 @@ ], "babel/no-unused-expressions": "off", "import/named": "off", - "import/no-named-as-default": "off", + "import/no-default-export": ["error"], "react/button-has-type": "off", "react/no-array-index-key": "off", "react/jsx-fragments": ["error", "element"], diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 0765c4cccee..a9894a97b0e 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -49,7 +49,7 @@ Fixes #0000 import React from 'react'; import {Page} from '../src'; -export default function Playground() { +export function Playground() { return ( {/* Add the code you want to test in here */} diff --git a/.storybook/stories-from-readme.js b/.storybook/stories-from-readme.js index 6b1f5fa8f6d..7d5e9fe8dea 100644 --- a/.storybook/stories-from-readme.js +++ b/.storybook/stories-from-readme.js @@ -2,7 +2,7 @@ import React from 'react'; import {AppProvider, Heading} from '../src'; import {withA11y} from '@storybook/addon-a11y'; import {storiesOf} from '@storybook/react'; -import Playground from '../playground/Playground'; +import {Playground} from '../playground/Playground'; import en from '../locales/en.json'; /** diff --git a/UNRELEASED.md b/UNRELEASED.md index c809702eda2..6738509fde7 100644 --- a/UNRELEASED.md +++ b/UNRELEASED.md @@ -35,6 +35,8 @@ Use [the changelog guidelines](https://git.io/polaris-changelog-guidelines) to f ### Development workflow +- Update subcomponents to use named exports for components and better names props exports ([#2058](https://github.com/Shopify/polaris-react/pull/2058)) + ### Dependency upgrades ### Code quality diff --git a/playground/Playground.tsx b/playground/Playground.tsx index c62ea43d096..07040400b31 100644 --- a/playground/Playground.tsx +++ b/playground/Playground.tsx @@ -1,7 +1,7 @@ import React from 'react'; import {Page} from '../src'; -export default function Playground() { +export function Playground() { return ( {/* Add the code you want to test in here */} diff --git a/sewing-kit.config.ts b/sewing-kit.config.ts index 0bd50c4558b..890184c54c0 100644 --- a/sewing-kit.config.ts +++ b/sewing-kit.config.ts @@ -7,6 +7,7 @@ interface InitialOptions extends jest.InitialOptions { setupFilesAfterEnv: string[]; } +// eslint-disable-next-line import/no-default-export export default function sewingKitConfig( plugins: Plugins, env: Env, diff --git a/src/components/AccountConnection/AccountConnection.tsx b/src/components/AccountConnection/AccountConnection.tsx index bc2c3644d4d..cab374b3c42 100644 --- a/src/components/AccountConnection/AccountConnection.tsx +++ b/src/components/AccountConnection/AccountConnection.tsx @@ -1,16 +1,16 @@ import React from 'react'; import {Action} from '../../types'; -import Avatar from '../Avatar'; +import {Avatar} from '../Avatar'; import {buttonFrom} from '../Button'; -import Card from '../Card'; -import Stack from '../Stack'; -import TextStyle from '../TextStyle'; -import SettingAction from '../SettingAction'; +import {Card} from '../Card'; +import {Stack} from '../Stack'; +import {TextStyle} from '../TextStyle'; +import {SettingAction} from '../SettingAction'; import styles from './AccountConnection.scss'; -export interface Props { +export interface AccountConnectionProps { /** Content to display as title */ title?: React.ReactNode; /** Content to display as additional details */ @@ -27,7 +27,7 @@ export interface Props { action?: Action; } -export default function AccountConnection({ +export function AccountConnection({ connected = false, action, avatarUrl, @@ -35,7 +35,7 @@ export default function AccountConnection({ title, details, termsOfService, -}: Props) { +}: AccountConnectionProps) { const initials = accountName ? accountName .split(/\s+/) diff --git a/src/components/AccountConnection/index.ts b/src/components/AccountConnection/index.ts index 89414c38279..864745032b4 100644 --- a/src/components/AccountConnection/index.ts +++ b/src/components/AccountConnection/index.ts @@ -1,4 +1 @@ -import AccountConnection from './AccountConnection'; - -export {Props} from './AccountConnection'; -export default AccountConnection; +export {AccountConnection, AccountConnectionProps} from './AccountConnection'; diff --git a/src/components/AccountConnection/tests/AccountConnection.test.tsx b/src/components/AccountConnection/tests/AccountConnection.test.tsx index 58284f347e2..1533f052508 100644 --- a/src/components/AccountConnection/tests/AccountConnection.test.tsx +++ b/src/components/AccountConnection/tests/AccountConnection.test.tsx @@ -1,7 +1,7 @@ import React from 'react'; import {mountWithAppProvider} from 'test-utilities/legacy'; import {Avatar, buttonFrom} from 'components'; -import AccountConnection from '../AccountConnection'; +import {AccountConnection} from '../AccountConnection'; describe('', () => { describe('title', () => { diff --git a/src/components/ActionList/ActionList.tsx b/src/components/ActionList/ActionList.tsx index 4dcc670d580..4e6ee61fd93 100644 --- a/src/components/ActionList/ActionList.tsx +++ b/src/components/ActionList/ActionList.tsx @@ -4,7 +4,7 @@ import {Section} from './components'; import styles from './ActionList.scss'; -export interface Props { +export interface ActionListProps { /** Collection of actions for list */ items?: ActionListItemDescriptor[]; /** Collection of sectioned action items */ @@ -15,12 +15,12 @@ export interface Props { onActionAnyItem?: ActionListItemDescriptor['onAction']; } -export default function ActionList({ +export function ActionList({ items, sections = [], actionRole, onActionAnyItem, -}: Props) { +}: ActionListProps) { let finalSections: ActionListSection[] = []; if (items) { diff --git a/src/components/ActionList/components/Item/Item.tsx b/src/components/ActionList/components/Item/Item.tsx index 5f4004b2fe5..eefd9c302b5 100644 --- a/src/components/ActionList/components/Item/Item.tsx +++ b/src/components/ActionList/components/Item/Item.tsx @@ -2,17 +2,17 @@ import React from 'react'; import {classNames} from '../../../../utilities/css'; import {ActionListItemDescriptor} from '../../../../types'; -import Scrollable from '../../../Scrollable'; -import Icon from '../../../Icon'; -import UnstyledLink from '../../../UnstyledLink'; -import Badge from '../../../Badge'; -import TextStyle from '../../../TextStyle'; +import {Scrollable} from '../../../Scrollable'; +import {Icon} from '../../../Icon'; +import {UnstyledLink} from '../../../UnstyledLink'; +import {Badge} from '../../../Badge'; +import {TextStyle} from '../../../TextStyle'; import styles from '../../ActionList.scss'; -export type Props = ActionListItemDescriptor; +export type ItemProps = ActionListItemDescriptor; -export default function Item({ +export function Item({ id, badge, content, @@ -28,7 +28,7 @@ export default function Item({ ellipsis, active, role, -}: Props) { +}: ItemProps) { const className = classNames( styles.Item, disabled && styles.disabled, diff --git a/src/components/ActionList/components/Item/index.ts b/src/components/ActionList/components/Item/index.ts index 02c0b0e1951..e158f53cc0d 100644 --- a/src/components/ActionList/components/Item/index.ts +++ b/src/components/ActionList/components/Item/index.ts @@ -1,4 +1 @@ -import Item from './Item'; - -export {Props} from './Item'; -export default Item; +export {Item, ItemProps} from './Item'; diff --git a/src/components/ActionList/components/Item/tests/Item.test.tsx b/src/components/ActionList/components/Item/tests/Item.test.tsx index 523d917f9be..95fee1bf0f0 100644 --- a/src/components/ActionList/components/Item/tests/Item.test.tsx +++ b/src/components/ActionList/components/Item/tests/Item.test.tsx @@ -1,8 +1,8 @@ import React from 'react'; import {mountWithAppProvider} from 'test-utilities/legacy'; import {UnstyledLink} from 'components'; -import Item from '../Item'; -import TextStyle from '../../../../TextStyle'; +import {Item} from '../Item'; +import {TextStyle} from '../../../../TextStyle'; describe('', () => { it('adds a style property when the image prop is present', () => { diff --git a/src/components/ActionList/components/Section/Section.tsx b/src/components/ActionList/components/Section/Section.tsx index ac63d75f65d..da7d401fa03 100644 --- a/src/components/ActionList/components/Section/Section.tsx +++ b/src/components/ActionList/components/Section/Section.tsx @@ -1,10 +1,10 @@ import React from 'react'; -import Item from '../Item'; +import {Item} from '../Item'; import {ActionListItemDescriptor, ActionListSection} from '../../../../types'; import styles from '../../ActionList.scss'; -export interface Props { +export interface SectionProps { /** Section of action items */ section: ActionListSection; /** Should there be multiple sections */ @@ -15,12 +15,12 @@ export interface Props { onActionAnyItem?: ActionListItemDescriptor['onAction']; } -export default function Section({ +export function Section({ section, hasMultipleSections, actionRole, onActionAnyItem, -}: Props) { +}: SectionProps) { const handleAction = (itemOnAction: ActionListItemDescriptor['onAction']) => { return () => { if (itemOnAction) { diff --git a/src/components/ActionList/components/Section/index.ts b/src/components/ActionList/components/Section/index.ts index b147a6e4e4b..344c319971d 100644 --- a/src/components/ActionList/components/Section/index.ts +++ b/src/components/ActionList/components/Section/index.ts @@ -1,4 +1 @@ -import Section from './Section'; - -export {Props} from './Section'; -export default Section; +export {Section, SectionProps} from './Section'; diff --git a/src/components/ActionList/components/Section/tests/Section.test.tsx b/src/components/ActionList/components/Section/tests/Section.test.tsx index 060122fe33b..065ad046172 100644 --- a/src/components/ActionList/components/Section/tests/Section.test.tsx +++ b/src/components/ActionList/components/Section/tests/Section.test.tsx @@ -1,7 +1,7 @@ import React from 'react'; import {mountWithAppProvider} from 'test-utilities/legacy'; -import Item from '../../Item'; -import Section from '../Section'; +import {Item} from '../../Item'; +import {Section} from '../Section'; describe('
', () => { it('renders its items', () => { diff --git a/src/components/ActionList/components/index.ts b/src/components/ActionList/components/index.ts index 1d5c5674eaf..029ec98e8df 100644 --- a/src/components/ActionList/components/index.ts +++ b/src/components/ActionList/components/index.ts @@ -1,3 +1,3 @@ -export {default as Item, Props as ItemProps} from './Item'; +export {Item, ItemProps} from './Item'; -export {default as Section, Props as SectionProps} from './Section'; +export {Section, SectionProps} from './Section'; diff --git a/src/components/ActionList/index.ts b/src/components/ActionList/index.ts index 863aba5a1c5..28da31ede9b 100644 --- a/src/components/ActionList/index.ts +++ b/src/components/ActionList/index.ts @@ -1,4 +1 @@ -import ActionList from './ActionList'; - -export {Props} from './ActionList'; -export default ActionList; +export {ActionList, ActionListProps} from './ActionList'; diff --git a/src/components/ActionList/tests/ActionList.test.tsx b/src/components/ActionList/tests/ActionList.test.tsx index 9abab68b35c..b6f39825634 100644 --- a/src/components/ActionList/tests/ActionList.test.tsx +++ b/src/components/ActionList/tests/ActionList.test.tsx @@ -1,8 +1,8 @@ import React from 'react'; import {ImportMinor, ExportMinor} from '@shopify/polaris-icons'; import {mountWithAppProvider} from 'test-utilities/legacy'; -import ActionList from '../ActionList'; -import Badge from '../../Badge'; +import {ActionList} from '../ActionList'; +import {Badge} from '../../Badge'; import {Item, Section} from '../components'; describe('', () => { diff --git a/src/components/ActionMenu/ActionMenu.tsx b/src/components/ActionMenu/ActionMenu.tsx index 104a135a62d..8c78276f0ef 100644 --- a/src/components/ActionMenu/ActionMenu.tsx +++ b/src/components/ActionMenu/ActionMenu.tsx @@ -11,7 +11,7 @@ import {MenuAction, MenuGroup, RollupActions} from './components'; import styles from './ActionMenu.scss'; -export interface Props { +export interface ActionMenuProps { /** Collection of page-level secondary actions */ actions?: ComplexAction[]; /** Collection of page-level action groups */ @@ -24,7 +24,7 @@ interface State { activeMenuGroup?: string; } -export default class ActionMenu extends React.PureComponent { +export class ActionMenu extends React.PureComponent { state: State = { activeMenuGroup: undefined, }; @@ -100,7 +100,7 @@ export default class ActionMenu extends React.PureComponent { }; } -export function hasGroupsWithActions(groups: Props['groups'] = []) { +export function hasGroupsWithActions(groups: ActionMenuProps['groups'] = []) { return groups.length === 0 ? false : groups.some((group) => group.actions.length > 0); diff --git a/src/components/ActionMenu/components/MenuAction/MenuAction.tsx b/src/components/ActionMenu/components/MenuAction/MenuAction.tsx index b5da74f0730..fe93b06b308 100644 --- a/src/components/ActionMenu/components/MenuAction/MenuAction.tsx +++ b/src/components/ActionMenu/components/MenuAction/MenuAction.tsx @@ -5,17 +5,17 @@ import {classNames} from '../../../../utilities/css'; import {handleMouseUpByBlurring} from '../../../../utilities/focus'; import {ComplexAction} from '../../../../types'; -import Icon from '../../../Icon'; -import UnstyledLink from '../../../UnstyledLink'; +import {Icon} from '../../../Icon'; +import {UnstyledLink} from '../../../UnstyledLink'; import styles from './MenuAction.scss'; -export interface Props extends ComplexAction { +export interface MenuActionProps extends ComplexAction { /** Whether or not the action discloses a menu group */ disclosure?: boolean; } -export default function MenuAction({ +export function MenuAction({ content, accessibilityLabel, url, @@ -24,7 +24,7 @@ export default function MenuAction({ disclosure, disabled, onAction, -}: Props) { +}: MenuActionProps) { const iconMarkup = icon && ( diff --git a/src/components/ActionMenu/components/MenuAction/index.ts b/src/components/ActionMenu/components/MenuAction/index.ts index d255ea4d504..e59101fa10c 100644 --- a/src/components/ActionMenu/components/MenuAction/index.ts +++ b/src/components/ActionMenu/components/MenuAction/index.ts @@ -1 +1 @@ -export {default, Props} from './MenuAction'; +export {MenuAction, MenuActionProps} from './MenuAction'; diff --git a/src/components/ActionMenu/components/MenuAction/tests/MenuAction.test.tsx b/src/components/ActionMenu/components/MenuAction/tests/MenuAction.test.tsx index cf942d524e1..65970c0a75b 100644 --- a/src/components/ActionMenu/components/MenuAction/tests/MenuAction.test.tsx +++ b/src/components/ActionMenu/components/MenuAction/tests/MenuAction.test.tsx @@ -2,13 +2,13 @@ import React from 'react'; import {CaretDownMinor, SaveMinor} from '@shopify/polaris-icons'; import {mountWithAppProvider, trigger} from 'test-utilities/legacy'; -import Icon from '../../../../Icon'; -import UnstyledLink from '../../../../UnstyledLink'; +import {Icon} from '../../../../Icon'; +import {UnstyledLink} from '../../../../UnstyledLink'; -import MenuAction, {Props} from '../MenuAction'; +import {MenuAction} from '../MenuAction'; describe('', () => { - const mockProps: Props = { + const mockProps = { content: 'content', }; diff --git a/src/components/ActionMenu/components/MenuGroup/MenuGroup.tsx b/src/components/ActionMenu/components/MenuGroup/MenuGroup.tsx index b38b500c5c9..363b0835602 100644 --- a/src/components/ActionMenu/components/MenuGroup/MenuGroup.tsx +++ b/src/components/ActionMenu/components/MenuGroup/MenuGroup.tsx @@ -2,13 +2,13 @@ import React from 'react'; import {MenuGroupDescriptor} from '../../../../types'; -import ActionList from '../../../ActionList'; -import Popover from '../../../Popover'; -import MenuAction from '../MenuAction'; +import {ActionList} from '../../../ActionList'; +import {Popover} from '../../../Popover'; +import {MenuAction} from '../MenuAction'; import styles from './MenuGroup.scss'; -export interface Props extends MenuGroupDescriptor { +export interface MenuGroupProps extends MenuGroupDescriptor { /** Visually hidden menu description for screen readers */ accessibilityLabel?: string; /** Whether or not the menu is open */ @@ -19,7 +19,7 @@ export interface Props extends MenuGroupDescriptor { onClose(title: string): void; } -export default class MenuGroup extends React.Component { +export class MenuGroup extends React.Component { render() { const { accessibilityLabel, diff --git a/src/components/ActionMenu/components/MenuGroup/index.ts b/src/components/ActionMenu/components/MenuGroup/index.ts index dfa7f490c2d..abe8f075c8d 100644 --- a/src/components/ActionMenu/components/MenuGroup/index.ts +++ b/src/components/ActionMenu/components/MenuGroup/index.ts @@ -1 +1 @@ -export {default, Props} from './MenuGroup'; +export {MenuGroup, MenuGroupProps} from './MenuGroup'; diff --git a/src/components/ActionMenu/components/MenuGroup/tests/MenuGroup.test.tsx b/src/components/ActionMenu/components/MenuGroup/tests/MenuGroup.test.tsx index 297f3cb5790..5d19d261471 100644 --- a/src/components/ActionMenu/components/MenuGroup/tests/MenuGroup.test.tsx +++ b/src/components/ActionMenu/components/MenuGroup/tests/MenuGroup.test.tsx @@ -4,11 +4,11 @@ import {SaveMinor} from '@shopify/polaris-icons'; import {mountWithAppProvider, trigger} from 'test-utilities/legacy'; import {Popover, ActionList} from 'components'; -import MenuAction from '../../MenuAction'; -import MenuGroup, {Props} from '../MenuGroup'; +import {MenuAction} from '../../MenuAction'; +import {MenuGroup} from '../MenuGroup'; describe('', () => { - const mockProps: Props = { + const mockProps = { title: 'title', actions: [], active: undefined, @@ -80,7 +80,7 @@ describe('', () => { }); it('passes `actions` into the ', () => { - const mockActions: Props['actions'] = [ + const mockActions = [ {content: 'mock content 1'}, {content: 'mock content 2'}, ]; diff --git a/src/components/ActionMenu/components/RollupActions/RollupActions.tsx b/src/components/ActionMenu/components/RollupActions/RollupActions.tsx index d7332ecadfa..b56b8d2b2b4 100644 --- a/src/components/ActionMenu/components/RollupActions/RollupActions.tsx +++ b/src/components/ActionMenu/components/RollupActions/RollupActions.tsx @@ -7,20 +7,20 @@ import { withAppProvider, WithAppProviderProps, } from '../../../../utilities/with-app-provider'; -import ActionList from '../../../ActionList'; -import Button from '../../../Button'; -import Popover from '../../../Popover'; +import {ActionList} from '../../../ActionList'; +import {Button} from '../../../Button'; +import {Popover} from '../../../Popover'; import styles from './RollupActions.scss'; -export interface Props { +export interface RollupActionsProps { /** Collection of actions for the list */ items?: ActionListItemDescriptor[]; /** Collection of sectioned action items */ sections?: ActionListSection[]; } -type ComposedProps = Props & WithAppProviderProps; +type ComposedProps = RollupActionsProps & WithAppProviderProps; interface State { rollupOpen: boolean; @@ -77,4 +77,6 @@ class RollupActions extends React.PureComponent { }; } -export default withAppProvider()(RollupActions); +// Use named export once withAppProvider is refactored away +// eslint-disable-next-line import/no-default-export +export default withAppProvider()(RollupActions); diff --git a/src/components/ActionMenu/components/RollupActions/index.ts b/src/components/ActionMenu/components/RollupActions/index.ts index bb26a51e6f8..6d5beb40ea1 100644 --- a/src/components/ActionMenu/components/RollupActions/index.ts +++ b/src/components/ActionMenu/components/RollupActions/index.ts @@ -1 +1,3 @@ -export {default, Props} from './RollupActions'; +import RollupActions, {RollupActionsProps} from './RollupActions'; + +export {RollupActions, RollupActionsProps}; diff --git a/src/components/ActionMenu/components/RollupActions/tests/RollupActions.test.tsx b/src/components/ActionMenu/components/RollupActions/tests/RollupActions.test.tsx index 68b58bc1858..39ce26f6912 100644 --- a/src/components/ActionMenu/components/RollupActions/tests/RollupActions.test.tsx +++ b/src/components/ActionMenu/components/RollupActions/tests/RollupActions.test.tsx @@ -11,12 +11,12 @@ import { Section as ActionListSection, } from '../../../../ActionList/components'; -import RollupActions, {Props} from '../RollupActions'; +import RollupActions, {RollupActionsProps} from '../RollupActions'; -type Wrapper = ReactWrapper; +type Wrapper = ReactWrapper; describe('', () => { - const mockProps: Props = { + const mockProps = { items: undefined, sections: undefined, }; @@ -28,7 +28,7 @@ describe('', () => { }); describe('items', () => { - const mockItems: Props['items'] = [ + const mockItems = [ { content: 'mock content 1', url: 'https://www.google.com', @@ -68,7 +68,7 @@ describe('', () => { }); describe('sections', () => { - const mockSections: Props['sections'] = [ + const mockSections = [ { title: 'mock title 1', items: [ diff --git a/src/components/ActionMenu/components/index.ts b/src/components/ActionMenu/components/index.ts index f0d58cecee7..f55c125f03d 100644 --- a/src/components/ActionMenu/components/index.ts +++ b/src/components/ActionMenu/components/index.ts @@ -1,8 +1,5 @@ -export {default as MenuAction, Props as MenuActionProps} from './MenuAction'; +export {MenuAction, MenuActionProps} from './MenuAction'; -export {default as MenuGroup, Props as MenuGroupProps} from './MenuGroup'; +export {MenuGroup, MenuGroupProps} from './MenuGroup'; -export { - default as RollupActions, - Props as RollupActionsProps, -} from './RollupActions'; +export {RollupActions, RollupActionsProps} from './RollupActions'; diff --git a/src/components/ActionMenu/index.ts b/src/components/ActionMenu/index.ts index 8219331ee2b..127524de4c7 100644 --- a/src/components/ActionMenu/index.ts +++ b/src/components/ActionMenu/index.ts @@ -1 +1 @@ -export {default, Props, hasGroupsWithActions} from './ActionMenu'; +export {ActionMenu, ActionMenuProps, hasGroupsWithActions} from './ActionMenu'; diff --git a/src/components/ActionMenu/tests/ActionMenu.test.tsx b/src/components/ActionMenu/tests/ActionMenu.test.tsx index bfc513b8d95..5f76d4e3321 100644 --- a/src/components/ActionMenu/tests/ActionMenu.test.tsx +++ b/src/components/ActionMenu/tests/ActionMenu.test.tsx @@ -3,10 +3,14 @@ import {mountWithAppProvider, trigger} from 'test-utilities/legacy'; import {MenuGroupDescriptor, ActionListItemDescriptor} from '../../../types'; import {MenuAction, MenuGroup, RollupActions} from '../components'; -import ActionMenu, {Props, convertGroupToSection} from '../ActionMenu'; +import { + ActionMenu, + ActionMenuProps, + convertGroupToSection, +} from '../ActionMenu'; describe('', () => { - const mockProps: Props = { + const mockProps: ActionMenuProps = { actions: undefined, groups: undefined, rollup: undefined, @@ -18,7 +22,7 @@ describe('', () => { }); describe('actions', () => { - const mockActions: Props['actions'] = [ + const mockActions: ActionMenuProps['actions'] = [ {content: 'mock content 1'}, {content: 'mock content 2'}, ]; @@ -43,11 +47,11 @@ describe('', () => { }); describe('groups', () => { - const mockActions: Props['actions'] = [ + const mockActions: ActionMenuProps['actions'] = [ {content: 'mock content 1'}, {content: 'mock content 2'}, ]; - const mockGroups: Props['groups'] = [ + const mockGroups: ActionMenuProps['groups'] = [ { title: 'First group', actions: [...mockActions], @@ -81,7 +85,7 @@ describe('', () => { }); describe('', () => { - const mockActions: Props['actions'] = [ + const mockActions: ActionMenuProps['actions'] = [ {content: 'mock content 1'}, {content: 'mock content 2'}, ]; @@ -109,7 +113,7 @@ describe('', () => { }); it('does not render when there are `groups` with no `actions`', () => { - const mockGroupsWithoutActions: Props['groups'] = [ + const mockGroupsWithoutActions: ActionMenuProps['groups'] = [ { title: 'First group', actions: [], diff --git a/src/components/AppProvider/AppProvider.tsx b/src/components/AppProvider/AppProvider.tsx index c4292baa094..f8d3f963f0a 100644 --- a/src/components/AppProvider/AppProvider.tsx +++ b/src/components/AppProvider/AppProvider.tsx @@ -1,6 +1,6 @@ import React from 'react'; import {Theme} from '../../utilities/theme'; -import ThemeProvider from '../ThemeProvider'; +import {ThemeProvider} from '../ThemeProvider'; import {I18n, I18nContext, TranslationDictionary} from '../../utilities/i18n'; import { ScrollLockManager, @@ -23,7 +23,7 @@ interface State { link: LinkLikeComponent | undefined; } -export interface Props extends AppBridgeOptions { +export interface AppProviderProps extends AppBridgeOptions { /** A locale object or array of locale objects that overrides default translations */ i18n: TranslationDictionary | TranslationDictionary[]; /** A custom component to use for all links used by Polaris components */ @@ -32,11 +32,11 @@ export interface Props extends AppBridgeOptions { theme?: Theme; } -export default class AppProvider extends React.Component { +export class AppProvider extends React.Component { private stickyManager: StickyManager; private scrollLockManager: ScrollLockManager; - constructor(props: Props) { + constructor(props: AppProviderProps) { super(props); this.stickyManager = new StickyManager(); this.scrollLockManager = new ScrollLockManager(); @@ -62,7 +62,7 @@ export default class AppProvider extends React.Component { apiKey: prevApiKey, shopOrigin: prevShopOrigin, forceRedirect: prevForceRedirect, - }: Props) { + }: AppProviderProps) { const {i18n, linkComponent, apiKey, shopOrigin, forceRedirect} = this.props; if ( diff --git a/src/components/AppProvider/index.ts b/src/components/AppProvider/index.ts index 752fd25aa39..020b20af464 100644 --- a/src/components/AppProvider/index.ts +++ b/src/components/AppProvider/index.ts @@ -1 +1 @@ -export {default, Props} from './AppProvider'; +export {AppProvider, AppProviderProps} from './AppProvider'; diff --git a/src/components/AppProvider/tests/AppProvider.test.tsx b/src/components/AppProvider/tests/AppProvider.test.tsx index 4ef1fffc714..028947f96c6 100644 --- a/src/components/AppProvider/tests/AppProvider.test.tsx +++ b/src/components/AppProvider/tests/AppProvider.test.tsx @@ -1,7 +1,7 @@ import React, {useContext} from 'react'; import {mountWithAppProvider} from 'test-utilities/legacy'; import {LinkContext} from '../../../utilities/link'; -import AppProvider from '../AppProvider'; +import {AppProvider} from '../AppProvider'; describe('', () => { it('updates context when props change', () => { diff --git a/src/components/Autocomplete/Autocomplete.tsx b/src/components/Autocomplete/Autocomplete.tsx index 10a2916e1e3..fc2e1ad4c0c 100644 --- a/src/components/Autocomplete/Autocomplete.tsx +++ b/src/components/Autocomplete/Autocomplete.tsx @@ -7,12 +7,12 @@ import { } from '../../utilities/with-app-provider'; import {PreferredPosition} from '../PositionedOverlay'; import {OptionDescriptor} from '../OptionList'; -import Spinner from '../Spinner'; +import {Spinner} from '../Spinner'; import {TextField, ComboBox} from './components'; import styles from './Autocomplete.scss'; -export interface Props { +export interface AutocompleteProps { /** A unique identifier for the Autocomplete */ id?: string; /** Collection of options to be listed */ @@ -41,7 +41,7 @@ export interface Props { onLoadMoreResults?(): void; } -type CombinedProps = Props & WithAppProviderProps; +type CombinedProps = AutocompleteProps & WithAppProviderProps; class Autocomplete extends React.PureComponent { static TextField = TextField; @@ -99,4 +99,6 @@ class Autocomplete extends React.PureComponent { } } -export default withAppProvider()(Autocomplete); +// Use named export once withAppProvider is refactored away +// eslint-disable-next-line import/no-default-export +export default withAppProvider()(Autocomplete); diff --git a/src/components/Autocomplete/components/ComboBox/ComboBox.tsx b/src/components/Autocomplete/components/ComboBox/ComboBox.tsx index f24d3107864..97d652b4491 100644 --- a/src/components/Autocomplete/components/ComboBox/ComboBox.tsx +++ b/src/components/Autocomplete/components/ComboBox/ComboBox.tsx @@ -1,12 +1,12 @@ import React from 'react'; import {createUniqueIDFactory} from '@shopify/javascript-utilities/other'; -import OptionList, {OptionDescriptor} from '../../../OptionList'; -import ActionList from '../../../ActionList'; -import Popover from '../../../Popover'; +import {OptionList, OptionDescriptor} from '../../../OptionList'; +import {ActionList} from '../../../ActionList'; +import {Popover} from '../../../Popover'; import {PreferredPosition} from '../../../PositionedOverlay'; import {ActionListItemDescriptor, Key} from '../../../../types'; -import KeypressListener from '../../../KeypressListener'; -import EventListener from '../../../EventListener'; +import {KeypressListener} from '../../../KeypressListener'; +import {EventListener} from '../../../EventListener'; import {ComboBoxContext} from './context'; import styles from './ComboBox.scss'; @@ -23,7 +23,7 @@ interface State { popoverWasActive: boolean; } -export interface Props { +export interface ComboBoxProps { /** A unique identifier for the ComboBox */ id?: string; /** Collection of options to be listed */ @@ -54,14 +54,14 @@ export interface Props { onEndReached?(): void; } -export default class ComboBox extends React.PureComponent { +export class ComboBox extends React.PureComponent { static getDerivedStateFromProps( { options: nextOptions, selected: nextSelected, actionsBefore: nextActionsBefore, actionsAfter: nextActionsAfter, - }: Props, + }: ComboBoxProps, {navigableOptions, selectedOptions, comboBoxId}: State, ) { const optionsChanged = @@ -129,7 +129,7 @@ export default class ComboBox extends React.PureComponent { }); } - componentDidUpdate(_: Props, prevState: State) { + componentDidUpdate(_: ComboBoxProps, prevState: State) { const {contentBefore, contentAfter, emptyState} = this.props; const {navigableOptions, popoverWasActive} = this.state; diff --git a/src/components/Autocomplete/components/ComboBox/index.ts b/src/components/Autocomplete/components/ComboBox/index.ts index 0374b3c123b..94540f37e9e 100644 --- a/src/components/Autocomplete/components/ComboBox/index.ts +++ b/src/components/Autocomplete/components/ComboBox/index.ts @@ -1,4 +1 @@ -import ComboBox from './ComboBox'; - -export {Props} from './ComboBox'; -export default ComboBox; +export {ComboBox} from './ComboBox'; diff --git a/src/components/Autocomplete/components/ComboBox/tests/ComboBox.test.tsx b/src/components/Autocomplete/components/ComboBox/tests/ComboBox.test.tsx index 0a5786ebca4..de438d0da73 100644 --- a/src/components/Autocomplete/components/ComboBox/tests/ComboBox.test.tsx +++ b/src/components/Autocomplete/components/ComboBox/tests/ComboBox.test.tsx @@ -2,9 +2,9 @@ import React from 'react'; import {shallow} from 'enzyme'; import {OptionList, ActionList, Popover} from 'components'; import {mountWithAppProvider, trigger} from 'test-utilities/legacy'; -import TextField from '../../TextField'; +import {TextField} from '../../TextField'; import {Key} from '../../../../../types'; -import ComboBox from '..'; +import {ComboBox} from '..'; describe('', () => { const options = [ diff --git a/src/components/Autocomplete/components/TextField/TextField.tsx b/src/components/Autocomplete/components/TextField/TextField.tsx index 9a5dfa87538..42cefe79299 100644 --- a/src/components/Autocomplete/components/TextField/TextField.tsx +++ b/src/components/Autocomplete/components/TextField/TextField.tsx @@ -2,9 +2,9 @@ import React from 'react'; // eslint-disable-next-line shopify/strict-component-boundaries import {ComboBoxContext} from '../ComboBox/context'; -import BaseTextField, {Props as TextFieldProps} from '../../../TextField'; +import {TextField as BaseTextField, TextFieldProps} from '../../../TextField'; -export default function TextField(props: TextFieldProps) { +export function TextField(props: TextFieldProps) { return ( {({selectedOptionId, comboBoxId}) => ( diff --git a/src/components/Autocomplete/components/TextField/index.ts b/src/components/Autocomplete/components/TextField/index.ts index 7e9c49aabd9..35e9e6ed312 100644 --- a/src/components/Autocomplete/components/TextField/index.ts +++ b/src/components/Autocomplete/components/TextField/index.ts @@ -1,3 +1 @@ -import TextField from './TextField'; - -export default TextField; +export {TextField} from './TextField'; diff --git a/src/components/Autocomplete/components/index.ts b/src/components/Autocomplete/components/index.ts index bf0aef4ab91..8a65d0fe030 100644 --- a/src/components/Autocomplete/components/index.ts +++ b/src/components/Autocomplete/components/index.ts @@ -1,3 +1,3 @@ -export {default as ComboBox} from './ComboBox'; +export {ComboBox} from './ComboBox'; -export {default as TextField} from './TextField'; +export {TextField} from './TextField'; diff --git a/src/components/Autocomplete/index.ts b/src/components/Autocomplete/index.ts index b882e257dbf..2b5820e2f8e 100644 --- a/src/components/Autocomplete/index.ts +++ b/src/components/Autocomplete/index.ts @@ -1,4 +1,3 @@ -import Autocomplete from './Autocomplete'; +import Autocomplete, {AutocompleteProps} from './Autocomplete'; -export {Props} from './Autocomplete'; -export default Autocomplete; +export {Autocomplete, AutocompleteProps}; diff --git a/src/components/Autocomplete/tests/Autocomplete.test.tsx b/src/components/Autocomplete/tests/Autocomplete.test.tsx index 650ff4f16f7..3d9a618b4e4 100644 --- a/src/components/Autocomplete/tests/Autocomplete.test.tsx +++ b/src/components/Autocomplete/tests/Autocomplete.test.tsx @@ -3,7 +3,7 @@ import {CirclePlusMinor} from '@shopify/polaris-icons'; import {mountWithAppProvider, trigger} from 'test-utilities/legacy'; import {Spinner} from 'components'; import {Key} from '../../../types'; -import Autocomplete from '..'; +import {Autocomplete} from '..'; import {ComboBox} from '../components'; describe('', () => { diff --git a/src/components/Avatar/Avatar.tsx b/src/components/Avatar/Avatar.tsx index fb9269ef8a5..d7c4102bc7b 100644 --- a/src/components/Avatar/Avatar.tsx +++ b/src/components/Avatar/Avatar.tsx @@ -6,7 +6,7 @@ import { withAppProvider, WithAppProviderProps, } from '../../utilities/with-app-provider'; -import Image from '../Image'; +import {Image} from '../Image'; import styles from './Avatar.scss'; import * as avatars from './images'; @@ -20,7 +20,7 @@ const AVATAR_IMAGES = Object.keys(avatars).map( (key: keyof typeof avatars) => avatars[key], ); -export interface Props { +export interface AvatarProps { /** * Size of avatar * @default 'medium' @@ -44,10 +44,10 @@ interface State { prevSource?: string; } -type CombinedProps = Props & WithAppProviderProps; +type CombinedProps = AvatarProps & WithAppProviderProps; class Avatar extends React.PureComponent { - static getDerivedStateFromProps(props: Props, state: State) { + static getDerivedStateFromProps(props: AvatarProps, state: State) { if (props.source !== state.prevSource) { return { prevSource: props.source, @@ -173,4 +173,6 @@ function customerPlaceholder(name?: string) { : AVATAR_IMAGES[0]; } -export default withAppProvider()(Avatar); +// Use named export once withAppProvider is refactored away +// eslint-disable-next-line import/no-default-export +export default withAppProvider()(Avatar); diff --git a/src/components/Avatar/images/index.ts b/src/components/Avatar/images/index.ts index 1ab161e2bfb..c3188e8be61 100644 --- a/src/components/Avatar/images/index.ts +++ b/src/components/Avatar/images/index.ts @@ -1,9 +1,17 @@ export {default as avatarOne} from './avatar-1.svg'; + export {default as avatarTwo} from './avatar-2.svg'; + export {default as avatarThree} from './avatar-3.svg'; + export {default as avatarFour} from './avatar-4.svg'; + export {default as avatarFive} from './avatar-5.svg'; + export {default as avatarSix} from './avatar-6.svg'; + export {default as avatarSeven} from './avatar-7.svg'; + export {default as avatarEight} from './avatar-8.svg'; + export {default as avatarNine} from './avatar-9.svg'; diff --git a/src/components/Avatar/index.ts b/src/components/Avatar/index.ts index 84691244f0d..07d30c58cdf 100644 --- a/src/components/Avatar/index.ts +++ b/src/components/Avatar/index.ts @@ -1,4 +1,3 @@ -import Avatar from './Avatar'; +import Avatar, {AvatarProps} from './Avatar'; -export {Props} from './Avatar'; -export default Avatar; +export {Avatar, AvatarProps}; diff --git a/src/components/Backdrop/Backdrop.tsx b/src/components/Backdrop/Backdrop.tsx index b86ba81c074..d5ce7d9ab56 100644 --- a/src/components/Backdrop/Backdrop.tsx +++ b/src/components/Backdrop/Backdrop.tsx @@ -1,17 +1,17 @@ import React from 'react'; import {classNames} from '../../utilities/css'; -import ScrollLock from '../ScrollLock'; +import {ScrollLock} from '../ScrollLock'; import styles from './Backdrop.scss'; -export interface Props { +export interface BackdropProps { belowNavigation?: boolean; transparent?: boolean; onClick?(): void; onTouchStart?(): void; } -export default function Backdrop(props: Props) { +export function Backdrop(props: BackdropProps) { const {onClick, onTouchStart, belowNavigation, transparent} = props; const className = classNames( diff --git a/src/components/Backdrop/index.ts b/src/components/Backdrop/index.ts index 0a1ad6c806c..4161d9da33f 100644 --- a/src/components/Backdrop/index.ts +++ b/src/components/Backdrop/index.ts @@ -1,5 +1 @@ -import Backdrop from './Backdrop'; - -export {Props as BackdropProps} from './Backdrop'; - -export default Backdrop; +export {Backdrop, BackdropProps} from './Backdrop'; diff --git a/src/components/Backdrop/tests/Backdrop.test.tsx b/src/components/Backdrop/tests/Backdrop.test.tsx index 50e07309a5f..77feb776206 100644 --- a/src/components/Backdrop/tests/Backdrop.test.tsx +++ b/src/components/Backdrop/tests/Backdrop.test.tsx @@ -1,12 +1,12 @@ import React from 'react'; import {mountWithAppProvider, findByTestID} from 'test-utilities/legacy'; -import BackDrop from '..'; +import {Backdrop} from '..'; -describe('', () => { +describe('', () => { describe('onDismiss()', () => { it('is called when the backdrop is clicked', () => { const spy = jest.fn(); - const backdrop = mountWithAppProvider(); + const backdrop = mountWithAppProvider(); findByTestID(backdrop, 'Backdrop').simulate('click'); expect(spy).toHaveBeenCalled(); }); @@ -15,7 +15,7 @@ describe('', () => { describe('onTouchStart()', () => { it('is called when the backdrop is touched', () => { const spy = jest.fn(); - const backdrop = mountWithAppProvider(); + const backdrop = mountWithAppProvider(); findByTestID(backdrop, 'Backdrop').simulate('touchStart'); expect(spy).toHaveBeenCalled(); }); diff --git a/src/components/Badge/Badge.tsx b/src/components/Badge/Badge.tsx index e8c6497b0ce..116ac7dd8d2 100644 --- a/src/components/Badge/Badge.tsx +++ b/src/components/Badge/Badge.tsx @@ -1,14 +1,14 @@ import React from 'react'; import {classNames, variationName} from '../../utilities/css'; import {useI18n} from '../../utilities/i18n'; -import VisuallyHidden from '../VisuallyHidden'; +import {VisuallyHidden} from '../VisuallyHidden'; import styles from './Badge.scss'; export type Status = 'success' | 'info' | 'attention' | 'warning' | 'new'; export type Progress = 'incomplete' | 'partiallyComplete' | 'complete'; export type Size = 'small' | 'medium'; -export interface Props { +export interface BadgeProps { /** The content to display inside the badge. */ children?: string; /** Set the color of the badge for the given status. */ @@ -38,12 +38,12 @@ export const STATUS_LABELS: {[key in Status]: Status} = { const DEFAULT_SIZE = 'medium'; -export default function Badge({ +export function Badge({ children, status, progress, size = DEFAULT_SIZE, -}: Props) { +}: BadgeProps) { const intl = useI18n(); const className = classNames( diff --git a/src/components/Badge/index.ts b/src/components/Badge/index.ts index 5927026d97b..3ab47e3b088 100644 --- a/src/components/Badge/index.ts +++ b/src/components/Badge/index.ts @@ -1,4 +1,8 @@ -import Badge from './Badge'; - -export {Progress, Props, Status, PROGRESS_LABELS, STATUS_LABELS} from './Badge'; -export default Badge; +export { + Badge, + Progress, + BadgeProps, + Status, + PROGRESS_LABELS, + STATUS_LABELS, +} from './Badge'; diff --git a/src/components/Badge/tests/Badge.test.tsx b/src/components/Badge/tests/Badge.test.tsx index 486245e195d..c38b334b511 100644 --- a/src/components/Badge/tests/Badge.test.tsx +++ b/src/components/Badge/tests/Badge.test.tsx @@ -1,7 +1,7 @@ import React from 'react'; import {mountWithAppProvider} from 'test-utilities/legacy'; import {VisuallyHidden} from 'components'; -import Badge, {Status, Progress, PROGRESS_LABELS, STATUS_LABELS} from '..'; +import {Badge, Status, Progress, PROGRESS_LABELS, STATUS_LABELS} from '..'; describe('', () => { it('renders its children', () => { diff --git a/src/components/Banner/Banner.tsx b/src/components/Banner/Banner.tsx index 221830160b4..9d5eee169cd 100644 --- a/src/components/Banner/Banner.tsx +++ b/src/components/Banner/Banner.tsx @@ -16,25 +16,25 @@ import { LoadableAction, IconProps, } from '../../types'; -import Button, {buttonFrom} from '../Button'; -import Heading from '../Heading'; -import ButtonGroup from '../ButtonGroup'; -import UnstyledLink from '../UnstyledLink'; -import Icon from '../Icon'; +import {Button, buttonFrom} from '../Button'; +import {Heading} from '../Heading'; +import {ButtonGroup} from '../ButtonGroup'; +import {UnstyledLink} from '../UnstyledLink'; +import {Icon} from '../Icon'; import {WithinContentContext} from '../../utilities/within-content-context'; import styles from './Banner.scss'; -export type Status = 'success' | 'info' | 'warning' | 'critical'; +export type BannerStatus = 'success' | 'info' | 'warning' | 'critical'; -export interface Props { +export interface BannerProps { /** Title content for the banner. */ title?: string; /** Icon to display in the banner. Use only major, duotone icons */ icon?: IconProps['source']; /** Sets the status of the banner. */ - status?: Status; + status?: BannerStatus; /** The child elements to render in the banner. */ children?: React.ReactNode; /** Action for banner */ @@ -47,7 +47,7 @@ export interface Props { stopAnnouncements?: boolean; } -export default class Banner extends React.PureComponent { +export class Banner extends React.PureComponent { private wrapper = React.createRef(); public focus() { diff --git a/src/components/Banner/index.ts b/src/components/Banner/index.ts index e25dd863ec0..f5404b5b4d7 100644 --- a/src/components/Banner/index.ts +++ b/src/components/Banner/index.ts @@ -1,4 +1 @@ -import Banner from './Banner'; - -export {Props, Status} from './Banner'; -export default Banner; +export {Banner, BannerProps, BannerStatus} from './Banner'; diff --git a/src/components/Banner/tests/Banner.test.tsx b/src/components/Banner/tests/Banner.test.tsx index cc1593382d3..2e2f66f99bd 100644 --- a/src/components/Banner/tests/Banner.test.tsx +++ b/src/components/Banner/tests/Banner.test.tsx @@ -11,7 +11,7 @@ import {ReactWrapper} from 'enzyme'; import {mountWithAppProvider} from 'test-utilities/legacy'; import {BannerContext} from 'utilities/banner-context'; import {Button, Icon, UnstyledLink, Heading} from 'components'; -import Banner from '..'; +import {Banner} from '..'; import {WithinContentContext} from '../../../utilities/within-content-context'; describe('', () => { diff --git a/src/components/Breadcrumbs/Breadcrumbs.tsx b/src/components/Breadcrumbs/Breadcrumbs.tsx index 1aea69047e0..f00fde49dec 100644 --- a/src/components/Breadcrumbs/Breadcrumbs.tsx +++ b/src/components/Breadcrumbs/Breadcrumbs.tsx @@ -1,19 +1,19 @@ import React from 'react'; import {ChevronLeftMinor} from '@shopify/polaris-icons'; -import Icon from '../Icon'; -import UnstyledLink from '../UnstyledLink'; +import {Icon} from '../Icon'; +import {UnstyledLink} from '../UnstyledLink'; import {CallbackAction, LinkAction} from '../../types'; import {handleMouseUpByBlurring} from '../../utilities/focus'; import styles from './Breadcrumbs.scss'; -export interface Props { +export interface BreadcrumbsProps { /** Collection of breadcrumbs */ breadcrumbs: Array; } -export default class Breadcrumbs extends React.PureComponent { +export class Breadcrumbs extends React.PureComponent { render() { const {breadcrumbs} = this.props; const breadcrumb = breadcrumbs[breadcrumbs.length - 1]; diff --git a/src/components/Breadcrumbs/index.ts b/src/components/Breadcrumbs/index.ts index bc34b58ef38..7a663c9d3d9 100644 --- a/src/components/Breadcrumbs/index.ts +++ b/src/components/Breadcrumbs/index.ts @@ -1,4 +1 @@ -import Breadcrumbs from './Breadcrumbs'; - -export {Props} from './Breadcrumbs'; -export default Breadcrumbs; +export {Breadcrumbs, BreadcrumbsProps} from './Breadcrumbs'; diff --git a/src/components/Breadcrumbs/tests/Breadcrumbs.test.tsx b/src/components/Breadcrumbs/tests/Breadcrumbs.test.tsx index f50a5242404..4fee074cdf6 100644 --- a/src/components/Breadcrumbs/tests/Breadcrumbs.test.tsx +++ b/src/components/Breadcrumbs/tests/Breadcrumbs.test.tsx @@ -1,7 +1,7 @@ import React from 'react'; import {mountWithAppProvider} from 'test-utilities/legacy'; import {CallbackAction, LinkAction} from '../../../types'; -import Breadcrumbs from '../Breadcrumbs'; +import {Breadcrumbs} from '../Breadcrumbs'; describe('', () => { describe('url', () => { diff --git a/src/components/Button/Button.tsx b/src/components/Button/Button.tsx index ff60cef2549..b6c4a8fae8f 100644 --- a/src/components/Button/Button.tsx +++ b/src/components/Button/Button.tsx @@ -3,10 +3,10 @@ import {CaretDownMinor} from '@shopify/polaris-icons'; import {classNames, variationName} from '../../utilities/css'; import {handleMouseUpByBlurring} from '../../utilities/focus'; import {useI18n} from '../../utilities/i18n'; -import UnstyledLink from '../UnstyledLink'; -import Icon from '../Icon'; +import {UnstyledLink} from '../UnstyledLink'; +import {Icon} from '../Icon'; import {IconProps} from '../../types'; -import Spinner from '../Spinner'; +import {Spinner} from '../Spinner'; import styles from './Button.scss'; export type Size = 'slim' | 'medium' | 'large'; @@ -15,7 +15,7 @@ export type TextAlign = 'left' | 'right' | 'center'; export type IconSource = IconProps['source']; -export interface Props { +export interface ButtonProps { /** The content to display inside the button */ children?: string | string[]; /** A destination to link to, rendered in the href attribute of a link */ @@ -79,7 +79,7 @@ export interface Props { const DEFAULT_SIZE = 'medium'; -export default function Button({ +export function Button({ id, url, disabled, @@ -108,7 +108,7 @@ export default function Button({ size = DEFAULT_SIZE, textAlign, fullWidth, -}: Props) { +}: ButtonProps) { const intl = useI18n(); const isDisabled = disabled || loading; diff --git a/src/components/Button/index.ts b/src/components/Button/index.ts index e6a127b9fa9..c8cfe68b255 100644 --- a/src/components/Button/index.ts +++ b/src/components/Button/index.ts @@ -1,5 +1,2 @@ -import Button from './Button'; - export * from './utils'; export * from './Button'; -export default Button; diff --git a/src/components/Button/tests/Button.test.tsx b/src/components/Button/tests/Button.test.tsx index 6a584a97f22..aac21683bd1 100644 --- a/src/components/Button/tests/Button.test.tsx +++ b/src/components/Button/tests/Button.test.tsx @@ -2,7 +2,7 @@ import React from 'react'; import {PlusMinor} from '@shopify/polaris-icons'; import {mountWithAppProvider, trigger} from 'test-utilities/legacy'; import {UnstyledLink, Icon, Spinner} from 'components'; -import Button, {IconWrapper} from '../Button'; +import {Button, IconWrapper} from '../Button'; describe('