diff --git a/UNRELEASED.md b/UNRELEASED.md index 377868f2190..f8f22820cae 100644 --- a/UNRELEASED.md +++ b/UNRELEASED.md @@ -32,5 +32,6 @@ Use [the changelog guidelines](https://git.io/polaris-changelog-guidelines) to f ### Code quality - Replaced all occurrences of `_.pick` with a custom pick function ([#1020](https://github.com/Shopify/polaris-react/pull/1020)) +- Deleted the icons index file that would re-export icons, and replaced it with direct imports ([#1195](https://github.com/Shopify/polaris-react/pull/1195)) ### Deprecations diff --git a/src/components/Banner/Banner.tsx b/src/components/Banner/Banner.tsx index 7f55d7b766c..90de9e83d21 100644 --- a/src/components/Banner/Banner.tsx +++ b/src/components/Banner/Banner.tsx @@ -1,5 +1,12 @@ import * as React from 'react'; import {classNames, variationName} from '@shopify/react-utilities/styles'; +import { + CircleTickMajorTwotone, + FlagMajorTwotone, + CircleAlertMajorTwotone, + CircleDisabledMajorTwotone, + CircleInformationMajorTwotone, +} from '@shopify/polaris-icons'; import { Action, @@ -13,14 +20,6 @@ import ButtonGroup from '../ButtonGroup'; import UnstyledLink from '../UnstyledLink'; import Icon, {Props as IconProps} from '../Icon'; -import { - CircleTickMajorTwotone, - FlagMajorTwotone, - CircleAlertMajorTwotone, - CircleDisabledMajorTwotone, - CircleInformationMajorTwotone, -} from '../../icons'; - import styles from './Banner.scss'; export type Status = 'success' | 'info' | 'warning' | 'critical'; diff --git a/src/components/Banner/tests/Banner.test.tsx b/src/components/Banner/tests/Banner.test.tsx index b1c5ad740f0..a23ffc9e23b 100644 --- a/src/components/Banner/tests/Banner.test.tsx +++ b/src/components/Banner/tests/Banner.test.tsx @@ -1,15 +1,15 @@ import * as React from 'react'; import {mountWithAppProvider} from 'test-utilities'; -import {Button, Icon, UnstyledLink, Heading} from 'components'; -import Banner from '..'; - import { CircleAlertMajorTwotone, CircleDisabledMajorTwotone, CircleTickMajorTwotone, CircleInformationMajorTwotone, FlagMajorTwotone, -} from '../../../icons'; +} from '@shopify/polaris-icons'; + +import {Button, Icon, UnstyledLink, Heading} from 'components'; +import Banner from '..'; describe('', () => { it('renders a title', () => { diff --git a/src/components/DropZone/DropZone.tsx b/src/components/DropZone/DropZone.tsx index 8dc8d7da92a..f443d60adcf 100755 --- a/src/components/DropZone/DropZone.tsx +++ b/src/components/DropZone/DropZone.tsx @@ -6,8 +6,12 @@ import { addEventListener, removeEventListener, } from '@shopify/javascript-utilities/events'; -import capitalize from '../../utilities/capitalize'; +import { + DragDropMajorMonotone, + CircleAlertMajorMonotone, +} from '@shopify/polaris-icons'; +import capitalize from '../../utilities/capitalize'; import Icon from '../Icon'; import Stack from '../Stack'; import Caption from '../Caption'; @@ -16,8 +20,6 @@ import VisuallyHidden from '../VisuallyHidden'; import Labelled, {Action} from '../Labelled'; import {withAppProvider, WithAppProviderProps} from '../AppProvider'; -import {DragDropMajorMonotone, CircleAlertMajorMonotone} from '../../icons'; - import {FileUpload, Provider} from './components'; import {fileAccepted, getDataTransferFiles} from './utils'; diff --git a/src/components/DropZone/components/FileUpload/FileUpload.tsx b/src/components/DropZone/components/FileUpload/FileUpload.tsx index 8e3c248c25a..64f16bf5b03 100755 --- a/src/components/DropZone/components/FileUpload/FileUpload.tsx +++ b/src/components/DropZone/components/FileUpload/FileUpload.tsx @@ -1,5 +1,6 @@ import * as React from 'react'; import {classNames} from '@shopify/react-utilities/styles'; +import {DragDropMajorMonotone} from '@shopify/polaris-icons'; import {WithContextTypes} from '../../../../types'; import compose from '../../../../utilities/react-compose'; @@ -16,7 +17,6 @@ import withContext from '../../../WithContext'; import withRef from '../../../WithRef'; import {DropZoneContext} from '../../types'; -import {DragDropMajorMonotone} from '../../../../icons'; import {fileUpload, imageUpload} from '../../images'; import {Consumer} from '../Context'; diff --git a/src/components/Icon/Icon.tsx b/src/components/Icon/Icon.tsx index 86f2ec231d1..4e6a6542af5 100644 --- a/src/components/Icon/Icon.tsx +++ b/src/components/Icon/Icon.tsx @@ -1,8 +1,6 @@ import * as React from 'react'; import {SVGSource} from '@shopify/images'; import {classNames, variationName} from '@shopify/react-utilities/styles'; -import {withAppProvider, WithAppProviderProps} from '../AppProvider'; - import { PlusMinor, AlertMinor, @@ -56,7 +54,9 @@ import { SaveMinor, SearchMinor, ViewMinor, -} from '../../icons'; +} from '@shopify/polaris-icons'; + +import {withAppProvider, WithAppProviderProps} from '../AppProvider'; import styles from './Icon.scss'; diff --git a/src/components/ResourceList/ResourceList.tsx b/src/components/ResourceList/ResourceList.tsx index 69669343f0f..443052b7c22 100644 --- a/src/components/ResourceList/ResourceList.tsx +++ b/src/components/ResourceList/ResourceList.tsx @@ -3,6 +3,8 @@ import * as React from 'react'; import {autobind, debounce} from '@shopify/javascript-utilities/decorators'; import {classNames} from '@shopify/react-utilities/styles'; import {createUniqueIDFactory} from '@shopify/javascript-utilities/other'; +import {EnableSelectionMinor} from '@shopify/polaris-icons'; + import Button from '../Button'; import EventListener from '../EventListener'; import Sticky from '../Sticky'; @@ -10,7 +12,6 @@ import Spinner from '../Spinner'; import {withAppProvider, WithAppProviderProps} from '../AppProvider'; import Select, {SelectOption} from '../Select'; import EmptySearchResult from '../EmptySearchResult'; -import {EnableSelectionMinor} from '../../icons'; import { BulkActions, diff --git a/src/icons/index.ts b/src/icons/index.ts deleted file mode 100644 index 38ffdc45be9..00000000000 --- a/src/icons/index.ts +++ /dev/null @@ -1,61 +0,0 @@ -export { - PlusMinor, - AlertMinor, - ArrowDownMinor, - ArrowLeftMinor, - ArrowRightMinor, - ArrowUpMinor, - ArrowUpDownMinor, - CalendarMinor, - MobileCancelMajorMonotone, - CancelSmallMinor, - CaretDownMinor, - CaretUpMinor, - TickSmallMinor, - ChevronDownMinor, - ChevronLeftMinor, - ChevronRightMinor, - ChevronUpMinor, - CircleAlertMajorMonotone, - CircleAlertMajorTwotone, - CircleDisabledMajorTwotone, - CircleCancelMinor, - CircleTickMajorTwotone, - CircleChevronDownMinor, - CircleChevronLeftMinor, - CircleChevronRightMinor, - CircleChevronUpMinor, - CircleInformationMajorTwotone, - CirclePlusMinor, - CirclePlusOutlineMinor, - ConversationMinor, - DeleteMinor, - CircleDisableMinor, - DisputeMinor, - DragDropMajorMonotone, - DuplicateMinor, - EmbedMinor, - EnableSelectionMinor, - ExportMinor, - ExternalMinor, - FlagMajorTwotone, - QuestionMarkMajorTwotone, - HomeMajorMonotone, - HorizontalDotsMinor, - ImportMinor, - LogOutMinor, - MobileHamburgerMajorMonotone, - NoteMinor, - NotificationMajorMonotone, - OnlineStoreMajorTwotone, - OrdersMajorTwotone, - PrintMinor, - ProductsMajorTwotone, - ProfileMinor, - MinusMinor, - RefreshMinor, - RiskMinor, - SaveMinor, - SearchMinor, - ViewMinor, -} from '@shopify/polaris-icons';