Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APP-3274 - Update React imports to use standard style. #68

Merged
merged 5 commits into from
Nov 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import addons from '@storybook/addons';
import { addParameters } from '@storybook/react';
import { themes } from '@storybook/theming';
Expand Down
2 changes: 1 addition & 1 deletion spec/components/button/Button.spec.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 { shallow } from 'enzyme';

import Button from '../../../src/components/button/Button';
Expand Down
2 changes: 1 addition & 1 deletion spec/components/crop-content/CropContent.spec.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 { shallow } from 'enzyme';

import CropContent from '../../../src/components/crop-content/CropContent';
Expand Down
2 changes: 1 addition & 1 deletion spec/components/date-picker/DatePicker.spec.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 { mount, shallow } from 'enzyme';
import { act } from 'react-dom/test-utils';

Expand Down
2 changes: 1 addition & 1 deletion spec/components/date-picker/Header.spec.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 { shallow } from 'enzyme';

import Header from '../../../src/components/date-picker/Header';
Expand Down
2 changes: 1 addition & 1 deletion spec/components/date-picker/keyUtils.spec.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 { shallow } from 'enzyme';

import {
Expand Down
2 changes: 1 addition & 1 deletion spec/components/expandable-card/ExpandableCard.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { shallow } from 'enzyme';
import React from 'react';
import * as React from 'react';
import { ExpandableCard } from '../../../src/components';

/**
Expand Down
2 changes: 1 addition & 1 deletion spec/components/icon/icon.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { shallow } from 'enzyme';
import React from 'react';
import * as React from 'react';
import Icon from '../../../src/components/icon';

describe('Icon Component', () => {
Expand Down
2 changes: 1 addition & 1 deletion spec/components/input/TextArea.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { shallow } from 'enzyme';
import React from 'react';
import * as React from 'react';
import { TextArea } from '../../../src/components';
import { TextComponent, Types } from '../../../src/components/input/TextComponent';

Expand Down
2 changes: 1 addition & 1 deletion spec/components/input/TextComponent.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { shallow } from 'enzyme';
import React from 'react';
import * as React from 'react';
import { TextComponent, Types } from '../../../src/components/input/TextComponent';

import Icon from '../../../src/components/icon/Icon';
Expand Down
2 changes: 1 addition & 1 deletion spec/components/input/TextField.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { shallow } from 'enzyme';
import React from 'react';
import * as React from 'react';
import { TextField } from '../../../src/components';
import { TextComponent, Types } from '../../../src/components/input/TextComponent';

Expand Down
2 changes: 1 addition & 1 deletion spec/components/selection/Checkbox.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mount, shallow } from 'enzyme';
import React from 'react';
import * as React from 'react';
import { Checkbox } from '../../../src/components';
import SelectionTypes from '../../../src/components/selection/SelectionTypes';
import { SelectionInput } from '../../../src/components/selection/SelectionInput';
Expand Down
2 changes: 1 addition & 1 deletion spec/components/selection/Radio.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mount, shallow } from 'enzyme';
import React from 'react';
import * as React from 'react';
import { Radio } from '../../../src/components';
import SelectionTypes from '../../../src/components/selection/SelectionTypes';
import { SelectionInput } from '../../../src/components/selection/SelectionInput';
Expand Down
2 changes: 1 addition & 1 deletion spec/components/selection/SelectionInput.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { shallow } from 'enzyme';
import React from 'react';
import * as React from 'react';
import SelectionTypes from '../../../src/components/selection/SelectionTypes';

import { SelectionInput } from '../../../src/components/selection/SelectionInput';
Expand Down
2 changes: 1 addition & 1 deletion spec/components/tooltip/Tooltip.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { shallow } from 'enzyme';
import React from 'react';
import * as React from 'react';
import Tooltip from '../../../src/components/tooltip';

describe('Tooltip Component', () => {
Expand Down
2 changes: 1 addition & 1 deletion spec/components/typography/Typography.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { shallow } from 'enzyme';
import React from 'react';
import * as React from 'react';
import Typography from '../../../src/components/typography';

describe('Typography Component', () => {
Expand Down
2 changes: 1 addition & 1 deletion spec/components/validation/Validation.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { shallow } from 'enzyme';
import React from 'react';
import * as React from 'react';
import { TextField, Validation } from '../../../src/components';
import { Validators } from '../../../src/core/validators/validators';

Expand Down
2 changes: 1 addition & 1 deletion spec/core/hoc/ResizeDetectDiv.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-empty-function */

import { shallow } from 'enzyme';
import React from 'react';
import * as React from 'react';
import { ResizeDetectDivInternal } from '../../../src/core/hoc/ResizeDetectDiv';

describe('ResizeDetectDiv Component', () => {
Expand Down
2 changes: 1 addition & 1 deletion spec/core/hoc/Scale.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { shallow } from 'enzyme';
import React from 'react';
import * as React from 'react';
import Scale from '../../../src/core/hoc/Scale';

describe('Scale Component', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/button/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import classNames from 'classnames';

const prefix = 'tk-button';
Expand Down
2 changes: 1 addition & 1 deletion src/components/crop-content/CropContent.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import ResizeDetectDiv from '../../core/hoc/ResizeDetectDiv';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';

type CropContentProps = {
children?: React.ReactNode;
Expand Down
5 changes: 3 additions & 2 deletions src/components/date-picker/DatePicker.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import PropTypes from 'prop-types';
import React, { FunctionComponent, useEffect, useRef, useState } from 'react';
import * as PropTypes from 'prop-types';
import * as React from 'react';
import { FunctionComponent, useEffect, useRef, useState } from 'react';
import classNames from 'classnames';

import { usePopper } from 'react-popper';
Expand Down
4 changes: 2 additions & 2 deletions src/components/date-picker/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import PropTypes from 'prop-types';
import React from 'react';
import * as PropTypes from 'prop-types';
import * as React from 'react';

import Icon from '../icon/Icon';
import { addMonths, addYears } from 'date-fns';
Expand Down
2 changes: 1 addition & 1 deletion src/components/date-picker/utils/propTypesUtils.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';

export const modifierPropTypes = [
PropTypes.instanceOf(Date),
Expand Down
2 changes: 1 addition & 1 deletion src/components/expandable-card/ExpandableCard.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import * as React from 'react';
import styled from 'styled-components';

Expand Down
5 changes: 3 additions & 2 deletions src/components/icon/Icon.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import * as React from 'react';
import { FunctionComponent } from 'react';
import classnames from 'classnames';
import React, { FunctionComponent } from 'react';

export type IconProps = {
className?: string;
Expand Down
2 changes: 1 addition & 1 deletion src/components/input/TextArea.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 { TextComponentPropTypes, TextComponent, TextComponentProps, Types } from './TextComponent';

const TextArea:React.FC<TextComponentProps> = (props) => {
Expand Down
5 changes: 3 additions & 2 deletions src/components/input/TextComponent.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React, { useCallback, useMemo, useState } from 'react';
import * as React from 'react';
import { useCallback, useMemo, useState } from 'react';
import classNames from 'classnames';
import shortid from 'shortid';
import styled from 'styled-components';
import PropTypes from 'prop-types';
import * as PropTypes from 'prop-types';
import Icon from '../icon';
import Tooltip from '../tooltip';

Expand Down
2 changes: 1 addition & 1 deletion src/components/input/TextField.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 { TextComponentPropTypes, TextComponentProps, TextComponent, Types } from './TextComponent';

const TextField:React.FC<TextComponentProps> = (props) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/selection/Checkbox.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 SelectionTypes from './SelectionTypes';
import { SelectionInput, SelectionInputPropTypes } from './SelectionInput';

Expand Down
2 changes: 1 addition & 1 deletion src/components/selection/Radio.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 SelectionTypes from './SelectionTypes';
import { SelectionInput, SelectionInputPropTypes } from './SelectionInput';

Expand Down
5 changes: 3 additions & 2 deletions src/components/selection/SelectionInput.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useEffect, useMemo, useState } from 'react';
import PropTypes from 'prop-types';
import * as React from 'react';
import { useEffect, useMemo, useState } from 'react';
import * as PropTypes from 'prop-types';
import classNames from 'classnames';
import shortid from 'shortid';
import SelectionTypes from './SelectionTypes';
Expand Down
5 changes: 3 additions & 2 deletions src/components/tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useState } from 'react';
import PropTypes from 'prop-types';
import * as React from 'react';
import { useState } from 'react';
import * as PropTypes from 'prop-types';
import { usePopper } from 'react-popper';
import { CSSTransition } from 'react-transition-group';
import styled from 'styled-components';
Expand Down
4 changes: 2 additions & 2 deletions src/components/validation/Validation.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types';
import * as React from 'react';
import * as PropTypes from 'prop-types';
import { isEmpty } from 'lodash';
import classNames from 'classnames';
import { ValidatorFn } from '../../core/validators/validators';
Expand Down
2 changes: 1 addition & 1 deletion stories/Button.stories.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 { Button } from '../src/components';
import Icon from '../src/components/icon/Icon';
import './stories.scss';
Expand Down
2 changes: 1 addition & 1 deletion stories/Checkbox.stories.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 { Checkbox } from '../src/components';
import LabelPlacements from '../src/components/selection/LabelPlacements';
import SelectionStatus from '../src/components/selection/SelectionStatus';
Expand Down
2 changes: 1 addition & 1 deletion stories/CropContent.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { withKnobs, number } from '@storybook/addon-knobs';
import React from 'react';
import * as React from 'react';
import { CropContent } from '../src/components';

export const CropContentContainer: React.SFC = () => {
Expand Down
2 changes: 1 addition & 1 deletion stories/DatePicker.stories.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 { DatePicker, TextField } from '../src/components';

const Template = (args) => {
Expand Down
2 changes: 1 addition & 1 deletion stories/Docs.stories.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 GettingStartedDoc from '../docs/getting-started.md';

import ReactHtmlParser from 'html-react-parser';
Expand Down
2 changes: 1 addition & 1 deletion stories/ExpandableCard.stories.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 { ExpandableCard, Button, CropContent } from '../src/components';

export const ExpandableCardContainer: React.SFC = () => {
Expand Down
2 changes: 1 addition & 1 deletion stories/Icons.stories.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 Icon from '../src/components/icon/Icon';

export const Icons: React.SFC = () => (
Expand Down
2 changes: 1 addition & 1 deletion stories/Modal.stories.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 { Button, Icon, Modal, Typography } from '../src/components';
import { ModalBody, ModalFooter, ModalHeader, ModalTitle } from '../src/components';

Expand Down
2 changes: 1 addition & 1 deletion stories/Radio.stories.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 { Radio } from '../src/components';
import LabelPlacements from '../src/components/selection/LabelPlacements';
import { action } from '@storybook/addon-actions';
Expand Down
2 changes: 1 addition & 1 deletion stories/Scale.stories.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 { Button, Checkbox, Radio } from '../src/components';
import Icon from '../src/components/icon/Icon';
import './stories.scss';
Expand Down
2 changes: 1 addition & 1 deletion stories/TextArea.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { withKnobs, boolean, button, text } from '@storybook/addon-knobs';
import React from 'react';
import * as React from 'react';
import { TextArea } from '../src/components';
import { Validators } from '../src/core/validators/validators';

Expand Down
3 changes: 2 additions & 1 deletion stories/TextField.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { boolean, button, text, withKnobs } from '@storybook/addon-knobs';
import React, { useState } from 'react';
import * as React from 'react';
import { useState } from 'react';
import { TextField, Icon } from '../src/components';

import { Validators } from '../src/core/validators/validators';
Expand Down
3 changes: 2 additions & 1 deletion stories/Tooltip.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useState } from 'react';
import * as React from 'react';
import { useState } from 'react';
import { Tooltip } from '../src/components';
import Icon from '../src/components/icon';

Expand Down
2 changes: 1 addition & 1 deletion stories/Typography.stories.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 Typography from '../src/components/typography';


Expand Down
2 changes: 1 addition & 1 deletion stories/Validation.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { withKnobs } from '@storybook/addon-knobs';
import React from 'react';
import * as React from 'react';
import { DatePicker, TextArea, TextField, Validation } from '../src/components';
import { Validators } from '../src/core/validators/validators';

Expand Down