diff --git a/.eslintrc b/.eslintrc index b6edf65af87..167143fb3c5 100644 --- a/.eslintrc +++ b/.eslintrc @@ -49,8 +49,7 @@ "jsx-a11y/mouse-events-have-key-events": "off", "jsx-a11y/click-events-have-key-events": "off", "jsx-a11y/no-noninteractive-element-interactions": "off", - "jsx-a11y/no-noninteractive-element-to-interactive-role": "off", - "import/no-cycle": "off" + "jsx-a11y/no-noninteractive-element-to-interactive-role": "off" }, "overrides": [ { diff --git a/UNRELEASED.md b/UNRELEASED.md index 3db95c0af31..b8547ddd36f 100644 --- a/UNRELEASED.md +++ b/UNRELEASED.md @@ -19,6 +19,6 @@ Use [the changelog guidelines](https://git.io/polaris-changelog-guidelines) to f ### Development workflow - Added a slight delay to the Percy screenshot script to give time for components to render fully ([#704](https://github.com/Shopify/polaris-react/pull/704)) -- Refactors to remove cyclical type imports ([#759](https://github.com/Shopify/polaris-react/pull/759) and [#754](https://github.com/Shopify/polaris-react/pull/754)) +- Refactors to remove cyclical type imports ([#759](https://github.com/Shopify/polaris-react/pull/759), [#754](https://github.com/Shopify/polaris-react/pull/754), and [#767](https://github.com/Shopify/polaris-react/pull/767)) ### Dependency upgrades diff --git a/src/components/ColorPicker/ColorPicker.tsx b/src/components/ColorPicker/ColorPicker.tsx index 06b18edabd6..7703794129b 100644 --- a/src/components/ColorPicker/ColorPicker.tsx +++ b/src/components/ColorPicker/ColorPicker.tsx @@ -3,7 +3,7 @@ import {clamp} from '@shopify/javascript-utilities/math'; import {autobind} from '@shopify/javascript-utilities/decorators'; import {hsbToRgb} from '../../utilities/color-transformers'; -import {HSBColor, HSBAColor} from './types'; +import {HSBColor, HSBAColor} from '../../utilities/color-types'; import {AlphaPicker, HuePicker, Slidable, Position} from './components'; import * as styles from './ColorPicker.scss'; diff --git a/src/components/ColorPicker/components/AlphaPicker/AlphaPicker.tsx b/src/components/ColorPicker/components/AlphaPicker/AlphaPicker.tsx index 743afe1a087..41daec6c821 100644 --- a/src/components/ColorPicker/components/AlphaPicker/AlphaPicker.tsx +++ b/src/components/ColorPicker/components/AlphaPicker/AlphaPicker.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import {autobind} from '@shopify/javascript-utilities/decorators'; import Slidable, {Position} from '../Slidable'; -import {HSBColor} from '../../types'; +import {HSBColor} from '../../../../utilities/color-types'; import {hsbToRgb} from '../../../../utilities/color-transformers'; import * as styles from '../../ColorPicker.scss'; import {calculateDraggerY, alphaForDraggerY} from './utilities'; diff --git a/src/components/ColorPicker/index.ts b/src/components/ColorPicker/index.ts index 6ef9761d056..6165f4ff93c 100644 --- a/src/components/ColorPicker/index.ts +++ b/src/components/ColorPicker/index.ts @@ -1,6 +1,6 @@ import ColorPicker from './ColorPicker'; -export * from './types'; +export * from '../../utilities/color-types'; export * from '../../utilities/color-transformers'; export {Props} from './ColorPicker'; diff --git a/src/components/ThemeProvider/utils/index.ts b/src/components/ThemeProvider/utils/index.ts index ef34b502c8c..95041e697e9 100644 --- a/src/components/ThemeProvider/utils/index.ts +++ b/src/components/ThemeProvider/utils/index.ts @@ -1,7 +1,7 @@ import tokens from '@shopify/polaris-tokens'; import {noop} from '@shopify/javascript-utilities/other'; import {needsVariantList} from '../config'; -import {HSLColor} from '../../ColorPicker'; +import {HSLColor} from '../../../utilities/color-types'; import { colorToHsla, hslToString, diff --git a/src/utilities/color-manipulation.ts b/src/utilities/color-manipulation.ts index 822f7060f29..08038f7fc58 100644 --- a/src/utilities/color-manipulation.ts +++ b/src/utilities/color-manipulation.ts @@ -1,4 +1,4 @@ -import {HSLColor, HSBColor} from '../components'; +import {HSLColor, HSBColor} from './color-types'; export function lightenColor(color: HSLColor | string, lighten = 0) { if (typeof color === 'string') { diff --git a/src/utilities/color-transformers.ts b/src/utilities/color-transformers.ts index 36d5206e539..f607233cc55 100644 --- a/src/utilities/color-transformers.ts +++ b/src/utilities/color-transformers.ts @@ -7,7 +7,7 @@ import { HSLColor, HSLAColor, HSBLAColor, -} from '../components'; +} from './color-types'; import {compose} from './compose'; export function rgbString(color: RGBColor | RGBAColor) { diff --git a/src/components/ColorPicker/types.ts b/src/utilities/color-types.ts similarity index 100% rename from src/components/ColorPicker/types.ts rename to src/utilities/color-types.ts diff --git a/src/utilities/color-validation.ts b/src/utilities/color-validation.ts index 083bae8e885..0438e25696c 100644 --- a/src/utilities/color-validation.ts +++ b/src/utilities/color-validation.ts @@ -1,4 +1,4 @@ -import {RGBColor, RGBAColor} from '../components'; +import {RGBColor, RGBAColor} from './color-types'; // implements: https://www.w3.org/WAI/ER/WD-AERT/#color-contrast export function isLight({red, green, blue}: RGBColor | RGBAColor): boolean { diff --git a/src/utilities/tests/color-manipulation.test.ts b/src/utilities/tests/color-manipulation.test.ts index f0754db3f27..e3448372a56 100644 --- a/src/utilities/tests/color-manipulation.test.ts +++ b/src/utilities/tests/color-manipulation.test.ts @@ -5,7 +5,7 @@ import { createDarkColor, createLightColor, } from '../color-manipulation'; -import {HSLColor} from '../../components'; +import {HSLColor} from '../color-types'; describe('lightenColor', () => { it("will return the color if it's of type string", () => {