Skip to content

Commit

Permalink
npx react-codemod update-react-imports polaris-react/src
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-page committed Mar 13, 2023
1 parent cc6eb32 commit c795ac9
Show file tree
Hide file tree
Showing 486 changed files with 349 additions and 561 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {useCallback, useState} from 'react';
import { useCallback, useState } from 'react';
import type {ComponentMeta} from '@storybook/react';
import {AccountConnection, Link} from '@shopify/polaris';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';

import type {Action} from '../../types';
import {Avatar} from '../Avatar';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import {mountWithApp} from 'tests/utilities';
import {matchMedia} from '@shopify/jest-dom-mocks';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {useCallback, useState} from 'react';
import { useCallback, useState } from 'react';
import type {ComponentMeta} from '@storybook/react';
import {
ActionList,
Expand Down
2 changes: 1 addition & 1 deletion polaris-react/src/components/ActionList/ActionList.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {useRef} from 'react';
import { useRef } from 'react';

import {
wrapFocusNextFocusableMenuItem,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';

import {classNames} from '../../../../utilities/css';
import type {ActionListItemDescriptor} from '../../../../types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import {mountWithApp} from 'tests/utilities';

import {Item} from '../Item';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react';

import {Item} from '../Item';
import {Box} from '../../../Box';
import {Text} from '../../../Text';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import {mountWithApp} from 'tests/utilities';

import {Item} from '../../Item';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import {ImportMinor, ExportMinor} from '@shopify/polaris-icons';
import {mountWithApp} from 'tests/utilities';

Expand Down
2 changes: 0 additions & 2 deletions polaris-react/src/components/ActionMenu/ActionMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react';

import {classNames} from '../../utilities/css';
import type {
ActionListSection,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {useCallback, useMemo, useRef, useState} from 'react';
import { useCallback, useMemo, useRef, useState } from 'react';

import type {
ActionListItemDescriptor,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {useCallback, useState} from 'react';
import { useCallback, useState } from 'react';
import {mountWithApp} from 'tests/utilities';

import {ActionMenuProps, ActionMenu} from '../../..';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {useCallback} from 'react';
import { useCallback } from 'react';

import type {ActionListSection, MenuGroupDescriptor} from '../../../../types';
import {ActionList} from '../../../ActionList';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import {mountWithApp} from 'tests/utilities';

import {ActionList} from '../../../../ActionList';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import {HorizontalDotsMinor} from '@shopify/polaris-icons';

import type {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import {HorizontalDotsMinor} from '@shopify/polaris-icons';
import {mountWithApp} from 'tests/utilities';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, {useEffect, useRef} from 'react';
import { useEffect, useRef } from 'react';
import * as React from 'react';

import {classNames} from '../../../../utilities/css';
import {Tooltip} from '../../../Tooltip';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import {mountWithApp} from 'tests/utilities';

import type {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {ReactNode, useEffect} from 'react';
import { ReactNode, useEffect } from 'react';

import {useIsAfterInitialMount} from '../../utilities/use-is-after-initial-mount';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {useEffect} from 'react';
import { useEffect } from 'react';
import {mountWithApp} from 'tests/utilities';

import {AfterInitialMount} from '../AfterInitialMount';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {useCallback, useState} from 'react';
import { useCallback, useState } from 'react';
import type {ComponentMeta} from '@storybook/react';
import {
AppProvider,
Expand Down
3 changes: 2 additions & 1 deletion polaris-react/src/components/AppProvider/AppProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, {Component} from 'react';
import { Component } from 'react';
import * as React from 'react';

import {EphemeralPresenceManager} from '../EphemeralPresenceManager';
import {MediaQueryProvider} from '../MediaQueryProvider';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, {useContext} from 'react';
import { useContext } from 'react';
import * as React from 'react';
import {matchMedia} from '@shopify/jest-dom-mocks';
import {mountWithApp} from 'tests/utilities';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {useCallback, useMemo, useState} from 'react';
import { useCallback, useMemo, useState } from 'react';
import type {ComponentMeta} from '@storybook/react';
import {
Autocomplete,
Expand Down
3 changes: 2 additions & 1 deletion polaris-react/src/components/Autocomplete/Autocomplete.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, {useMemo, useCallback} from 'react';
import { useMemo, useCallback } from 'react';
import * as React from 'react';

import type {
ActionListItemDescriptor,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, {useMemo} from 'react';
import { useMemo } from 'react';
import * as React from 'react';

import type {ActionListItemDescriptor} from '../../../../types';
import {Badge} from '../../../Badge';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import {mountWithListboxProvider} from 'tests/utilities/listbox';

import {Listbox} from '../../../../Listbox';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {memo} from 'react';
import { memo } from 'react';

import type {OptionDescriptor, ArrayElement} from '../../../../types';
import {Listbox} from '../../../Listbox';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import {mountWithListboxProvider} from 'tests/utilities/listbox';

import {Listbox} from '../../../../Listbox';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import {mountWithApp, ReactTestingElement, CustomRoot} from 'tests/utilities';

import {TextField} from '../../TextField';
Expand Down
2 changes: 1 addition & 1 deletion polaris-react/src/components/Avatar/Avatar.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {useCallback, useState} from 'react';
import { useCallback, useState } from 'react';
import type {ComponentMeta} from '@storybook/react';
import {
ActionList,
Expand Down
2 changes: 1 addition & 1 deletion polaris-react/src/components/Avatar/Avatar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {useState, useCallback, useEffect} from 'react';
import { useState, useCallback, useEffect } from 'react';

import {classNames, variationName} from '../../utilities/css';
import {useI18n} from '../../utilities/i18n';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import {mountWithApp} from 'tests/utilities';

import {Image} from '../../Image';
Expand Down
1 change: 0 additions & 1 deletion polaris-react/src/components/Avatar/tests/Avatar.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import {mountWithApp} from 'tests/utilities';

import {Image} from '../../Image';
Expand Down
2 changes: 1 addition & 1 deletion polaris-react/src/components/Backdrop/Backdrop.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {Dispatch, SetStateAction} from 'react';
import { Dispatch, SetStateAction } from 'react';

import {classNames} from '../../utilities/css';
import {ScrollLock} from '../ScrollLock';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import {mountWithApp} from 'tests/utilities';

import {Backdrop} from '..';
Expand Down
1 change: 0 additions & 1 deletion polaris-react/src/components/Badge/Badge.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import type {ComponentMeta} from '@storybook/react';
import {Badge} from '@shopify/polaris';

Expand Down
2 changes: 1 addition & 1 deletion polaris-react/src/components/Badge/Badge.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {useContext} from 'react';
import { useContext } from 'react';

import {classNames, variationName} from '../../utilities/css';
import {useI18n} from '../../utilities/i18n';
Expand Down
2 changes: 0 additions & 2 deletions polaris-react/src/components/Badge/components/Pip/Pip.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react';

import {classNames, variationName} from '../../../../utilities/css';
import type {Progress, Status} from '../../types';
import {Text} from '../../../Text';
Expand Down
1 change: 0 additions & 1 deletion polaris-react/src/components/Badge/tests/Badge.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import {mountWithApp} from 'tests/utilities';
import {GlobeMinor} from '@shopify/polaris-icons';

Expand Down
2 changes: 1 addition & 1 deletion polaris-react/src/components/Banner/Banner.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {useCallback, useEffect, useRef, useState} from 'react';
import { useCallback, useEffect, useRef, useState } from 'react';
import type {ComponentMeta} from '@storybook/react';
import {
Stack,
Expand Down
9 changes: 2 additions & 7 deletions polaris-react/src/components/Banner/Banner.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import React, {
forwardRef,
useRef,
useState,
useContext,
useImperativeHandle,
} from 'react';
import { forwardRef, useRef, useState, useContext, useImperativeHandle } from 'react';
import * as React from 'react';
import {
CancelSmallMinor,
CircleTickMajor,
Expand Down
3 changes: 2 additions & 1 deletion polaris-react/src/components/Banner/tests/Banner.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, {useEffect, useRef} from 'react';
import { useEffect, useRef } from 'react';
import * as React from 'react';
import {
CirclePlusMinor,
CircleTickMajor,
Expand Down
1 change: 0 additions & 1 deletion polaris-react/src/components/Bleed/Bleed.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import type {ComponentMeta} from '@storybook/react';
import {Card, Bleed, Box, Divider, LegacyStack, Text} from '@shopify/polaris';

Expand Down
2 changes: 1 addition & 1 deletion polaris-react/src/components/Bleed/Bleed.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import type {SpacingSpaceScale} from '@shopify/polaris-tokens';

import {
Expand Down
2 changes: 1 addition & 1 deletion polaris-react/src/components/Bleed/tests/Bleed.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import {mountWithApp} from 'tests/utilities';

import {Bleed} from '../Bleed';
Expand Down
1 change: 0 additions & 1 deletion polaris-react/src/components/Box/Box.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import type {ComponentMeta} from '@storybook/react';
import {Stack, Box, Icon} from '@shopify/polaris';
import {PaintBrushMajor} from '@shopify/polaris-icons';
Expand Down
3 changes: 2 additions & 1 deletion polaris-react/src/components/Box/Box.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, {createElement, forwardRef} from 'react';
import { createElement, forwardRef } from 'react';
import * as React from 'react';
import type {
ColorsActionTokenAlias,
ColorsBackdropTokenAlias,
Expand Down
2 changes: 1 addition & 1 deletion polaris-react/src/components/Box/tests/Box.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import {mountWithApp} from 'tests/utilities';
import type {ColorsTokenName, ShapeTokenName} from '@shopify/polaris-tokens';

Expand Down
1 change: 0 additions & 1 deletion polaris-react/src/components/Breadcrumbs/Breadcrumbs.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import {ArrowLeftMinor} from '@shopify/polaris-icons';

import {Icon} from '../Icon';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import {mountWithApp} from 'tests/utilities';

import type {CallbackAction, LinkAction} from '../../../types';
Expand Down
2 changes: 1 addition & 1 deletion polaris-react/src/components/BulkActions/BulkActions.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {PureComponent, createRef} from 'react';
import { PureComponent, createRef } from 'react';
import {Transition} from 'react-transition-group';

import {debounce} from '../../utilities/debounce';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {useRef} from 'react';
import { useRef } from 'react';
import {HorizontalDotsMinor} from '@shopify/polaris-icons';

import type {DisableableAction} from '../../../../types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react';

import {Popover} from '../../../Popover';
import {ActionList} from '../../../ActionList';
import {BulkActionButton} from '../BulkActionButton';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import {mountWithApp} from 'tests/utilities';

import {ActionList} from '../../../../ActionList';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import {intersectionObserver} from '@shopify/jest-dom-mocks';
import {mountWithApp} from 'tests/utilities';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import {Transition, CSSTransition} from 'react-transition-group';
import {mountWithApp} from 'tests/utilities';

Expand Down
2 changes: 1 addition & 1 deletion polaris-react/src/components/Button/Button.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {useCallback, useState} from 'react';
import { useCallback, useState } from 'react';
import type {ComponentMeta} from '@storybook/react';
import {Button, ButtonGroup} from '@shopify/polaris';

Expand Down
3 changes: 2 additions & 1 deletion polaris-react/src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, {useCallback, useState} from 'react';
import { useCallback, useState } from 'react';
import * as React from 'react';
import {
CaretDownMinor,
CaretUpMinor,
Expand Down
1 change: 0 additions & 1 deletion polaris-react/src/components/Button/tests/Button.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import {
CaretDownMinor,
CaretUpMinor,
Expand Down
2 changes: 1 addition & 1 deletion polaris-react/src/components/Button/utils.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';

import type {ComplexAction} from '../../types';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import type {ComponentMeta} from '@storybook/react';
import {Button, ButtonGroup} from '@shopify/polaris';

Expand Down
2 changes: 1 addition & 1 deletion polaris-react/src/components/ButtonGroup/ButtonGroup.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';

import {classNames} from '../../utilities/css';
import {elementChildren} from '../../utilities/components';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';

import {useToggle} from '../../../../utilities/use-toggle';
import {classNames} from '../../../../utilities/css';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import {mountWithApp} from 'tests/utilities';

import {Button} from '../../../../Button';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import {mountWithApp} from 'tests/utilities';

import {Button} from '../../Button';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import type {ComponentMeta} from '@storybook/react';
import {Badge, CalloutCard, Text} from '@shopify/polaris';

Expand Down
Loading

0 comments on commit c795ac9

Please sign in to comment.