diff --git a/.storybook/preview.ts b/.storybook/preview.ts index 4bc24608e..2f7ea6340 100644 --- a/.storybook/preview.ts +++ b/.storybook/preview.ts @@ -1,7 +1,7 @@ import { Parameters } from '@storybook/addons'; -import { withThemer, themeNames } from '../docs/themer/react'; -import { withSpacer } from '../docs/spacer/react'; import { withIcons } from '../docs/icons/react'; +import { withSpacer } from '../docs/spacer/react'; +import { themeNames, withThemer } from '../docs/themer/react'; import { storySort } from './storySort'; import './styles.scss'; diff --git a/.storybook/storySort.ts b/.storybook/storySort.ts index 805de2e89..bdc5af03f 100644 --- a/.storybook/storySort.ts +++ b/.storybook/storySort.ts @@ -1,4 +1,4 @@ -import { StorySortComparator, Parameters } from '@storybook/addons'; +import { Parameters, StorySortComparator } from '@storybook/addons'; // sorts stories naturally by kind, then by ID export const storySort: StorySortComparator = ([_, a]: Story, [__, b]: Story) => diff --git a/docs/_core/_core.stories.tsx b/docs/_core/_core.stories.tsx index d96025c03..11b8feac9 100644 --- a/docs/_core/_core.stories.tsx +++ b/docs/_core/_core.stories.tsx @@ -1,5 +1,5 @@ -import React from 'react'; import { Primary, Stories } from '@storybook/addon-docs/blocks'; +import React from 'react'; const docsPage = () => ( <> diff --git a/docs/_core/borders/borders.stories.tsx b/docs/_core/borders/borders.stories.tsx index 18d8b0122..56fbccd15 100644 --- a/docs/_core/borders/borders.stories.tsx +++ b/docs/_core/borders/borders.stories.tsx @@ -1,5 +1,8 @@ +import { Primary, Stories, Title } from '@storybook/addon-docs/blocks'; import React from 'react'; -import { Title, Primary, Stories } from '@storybook/addon-docs/blocks'; +import { Examples } from './examples.story'; +import { Helpers } from './helpers.story'; +import { Intro } from './intro.story'; const docsPage = () => ( <> @@ -16,6 +19,4 @@ export default { }, }; -export { Intro } from './intro.story'; -export { Examples } from './examples.story'; -export { Helpers } from './helpers.story'; +export { Intro, Examples, Helpers }; diff --git a/docs/_core/borders/examples.story.tsx b/docs/_core/borders/examples.story.tsx index be0e26c9a..fd4ffb5e8 100644 --- a/docs/_core/borders/examples.story.tsx +++ b/docs/_core/borders/examples.story.tsx @@ -1,5 +1,5 @@ -import React from 'react'; import { BorderRadius, borderRadius } from '@onfido/castor'; +import React from 'react'; import styles from './borders.scss'; export const Examples = () => ( diff --git a/docs/_core/borders/helpers.story.tsx b/docs/_core/borders/helpers.story.tsx index 5630dce29..f3ae9a5f0 100644 --- a/docs/_core/borders/helpers.story.tsx +++ b/docs/_core/borders/helpers.story.tsx @@ -1,5 +1,5 @@ -import React from 'react'; import { Source } from '@storybook/components'; +import React from 'react'; export const Helpers = () => ( <> diff --git a/docs/_core/borders/intro.story.tsx b/docs/_core/borders/intro.story.tsx index 0be359deb..08646c156 100644 --- a/docs/_core/borders/intro.story.tsx +++ b/docs/_core/borders/intro.story.tsx @@ -1,5 +1,5 @@ -import React from 'react'; import { Source } from '@storybook/components'; +import React from 'react'; export const Intro = () => ( <> diff --git a/docs/_core/colors/colors.stories.tsx b/docs/_core/colors/colors.stories.tsx index 19e76a782..7ebe4a6b4 100644 --- a/docs/_core/colors/colors.stories.tsx +++ b/docs/_core/colors/colors.stories.tsx @@ -1,5 +1,7 @@ +import { Primary, Stories, Title } from '@storybook/addon-docs/blocks'; import React from 'react'; -import { Title, Primary, Stories } from '@storybook/addon-docs/blocks'; +import { Helpers } from './helpers.story'; +import { Intro } from './intro.story'; const docsPage = () => ( <> @@ -16,5 +18,4 @@ export default { }, }; -export { Intro } from './intro.story'; -export { Helpers } from './helpers.story'; +export { Intro, Helpers }; diff --git a/docs/_core/colors/helpers.story.tsx b/docs/_core/colors/helpers.story.tsx index c8dd8661c..d9e2d0085 100644 --- a/docs/_core/colors/helpers.story.tsx +++ b/docs/_core/colors/helpers.story.tsx @@ -1,5 +1,5 @@ -import React from 'react'; import { Source } from '@storybook/components'; +import React from 'react'; export const Helpers = () => ( <> diff --git a/docs/_core/colors/intro.story.tsx b/docs/_core/colors/intro.story.tsx index 1e714ec59..c0832bc4d 100644 --- a/docs/_core/colors/intro.story.tsx +++ b/docs/_core/colors/intro.story.tsx @@ -1,5 +1,5 @@ -import React from 'react'; import { Source } from '@storybook/components'; +import React from 'react'; export const Intro = () => ( <> diff --git a/docs/_core/intro.story.tsx b/docs/_core/intro.story.tsx index d997007ab..a8ec46ac2 100644 --- a/docs/_core/intro.story.tsx +++ b/docs/_core/intro.story.tsx @@ -1,5 +1,5 @@ -import React from 'react'; import { Source } from '@storybook/components'; +import React from 'react'; export const Intro = () => ( <> diff --git a/docs/_core/spacing/helpers.story.tsx b/docs/_core/spacing/helpers.story.tsx index cb8feb70e..bec24bbb7 100644 --- a/docs/_core/spacing/helpers.story.tsx +++ b/docs/_core/spacing/helpers.story.tsx @@ -1,5 +1,5 @@ -import React from 'react'; import { Source } from '@storybook/components'; +import React from 'react'; export const Helpers = () => ( <> diff --git a/docs/_core/spacing/spacing.stories.tsx b/docs/_core/spacing/spacing.stories.tsx index 109bf9cd1..ac66fe1a6 100644 --- a/docs/_core/spacing/spacing.stories.tsx +++ b/docs/_core/spacing/spacing.stories.tsx @@ -1,5 +1,8 @@ +import { Primary, Stories, Title } from '@storybook/addon-docs/blocks'; import React from 'react'; -import { Title, Primary, Stories } from '@storybook/addon-docs/blocks'; +import { Examples } from './examples.story'; +import { Helpers } from './helpers.story'; +import { Intro } from './intro.story'; const docsPage = () => ( <> @@ -16,6 +19,4 @@ export default { }, }; -export { Intro } from './intro.story'; -export { Examples } from './examples.story'; -export { Helpers } from './helpers.story'; +export { Intro, Examples, Helpers }; diff --git a/docs/_core/typography/examples.story.tsx b/docs/_core/typography/examples.story.tsx index 0984517eb..12efc6292 100644 --- a/docs/_core/typography/examples.story.tsx +++ b/docs/_core/typography/examples.story.tsx @@ -1,5 +1,5 @@ +import { font, FontName } from '@onfido/castor'; import React from 'react'; -import { FontName, font } from '@onfido/castor'; import styles from './typography.scss'; export const Examples = () => ( diff --git a/docs/_core/typography/helpers.story.tsx b/docs/_core/typography/helpers.story.tsx index 2b233393f..637a6d4bc 100644 --- a/docs/_core/typography/helpers.story.tsx +++ b/docs/_core/typography/helpers.story.tsx @@ -1,5 +1,5 @@ -import React from 'react'; import { Source } from '@storybook/components'; +import React from 'react'; export const Helpers = () => ( <> diff --git a/docs/_core/typography/typography.stories.tsx b/docs/_core/typography/typography.stories.tsx index b96b2032d..78863508e 100644 --- a/docs/_core/typography/typography.stories.tsx +++ b/docs/_core/typography/typography.stories.tsx @@ -1,5 +1,8 @@ +import { Primary, Stories, Title } from '@storybook/addon-docs/blocks'; import React from 'react'; -import { Title, Primary, Stories } from '@storybook/addon-docs/blocks'; +import { Examples } from './examples.story'; +import { Helpers } from './helpers.story'; +import { Intro } from './intro.story'; const docsPage = () => ( <> @@ -16,6 +19,4 @@ export default { }, }; -export { Intro } from './intro.story'; -export { Examples } from './examples.story'; -export { Helpers } from './helpers.story'; +export { Intro, Examples, Helpers }; diff --git a/docs/_react/_react.stories.tsx b/docs/_react/_react.stories.tsx index efcdc064e..7fcc1063b 100644 --- a/docs/_react/_react.stories.tsx +++ b/docs/_react/_react.stories.tsx @@ -1,5 +1,5 @@ -import React from 'react'; import { Primary, Stories } from '@storybook/addon-docs/blocks'; +import React from 'react'; const docsPage = () => ( <> diff --git a/docs/_react/intro.story.tsx b/docs/_react/intro.story.tsx index 81e9e2fdc..ff1c8df2c 100644 --- a/docs/_react/intro.story.tsx +++ b/docs/_react/intro.story.tsx @@ -1,5 +1,5 @@ -import React from 'react'; import { Source } from '@storybook/components'; +import React from 'react'; export const Intro = () => ( <> diff --git a/docs/icons/react.tsx b/docs/icons/react.tsx index 0b7f8c902..7a5128feb 100644 --- a/docs/icons/react.tsx +++ b/docs/icons/react.tsx @@ -1,5 +1,5 @@ -import React from 'react'; import { Icons } from '@onfido/castor-icons'; +import React from 'react'; export function withIcons(storyFn: () => JSX.Element): JSX.Element { const story = storyFn(); diff --git a/docs/index.ts b/docs/index.ts index 208bb2ac3..a8c36e91d 100644 --- a/docs/index.ts +++ b/docs/index.ts @@ -1,7 +1,6 @@ import tokens from './tokens.scss'; export * from './docs'; -export * from './storyOf'; export * from './Story'; - +export * from './storyOf'; export { tokens }; diff --git a/docs/storyOf/storyOf.tsx b/docs/storyOf/storyOf.tsx index 0559e7889..e6b53b522 100644 --- a/docs/storyOf/storyOf.tsx +++ b/docs/storyOf/storyOf.tsx @@ -1,4 +1,4 @@ -import React, { FC, ReactNode, Fragment, createElement } from 'react'; +import React, { createElement, FC, Fragment, ReactNode } from 'react'; import { Story } from '../Story'; import styles from './storyOf.scss'; diff --git a/docs/themer/react.tsx b/docs/themer/react.tsx index b6919a12c..14ce27b42 100644 --- a/docs/themer/react.tsx +++ b/docs/themer/react.tsx @@ -1,6 +1,6 @@ -import { useEffect } from 'react'; -import { StoryContext } from '@storybook/addons'; import { switchTheme } from '@onfido/castor'; +import { StoryContext } from '@storybook/addons'; +import { useEffect } from 'react'; import './themes.scss'; export function withThemer( diff --git a/examples/html-css-js-parcel/src/index.js b/examples/html-css-js-parcel/src/index.js index 4e360500c..ac6cfec96 100644 --- a/examples/html-css-js-parcel/src/index.js +++ b/examples/html-css-js-parcel/src/index.js @@ -1,4 +1,4 @@ -import './index.css'; import { App } from './app'; +import './index.css'; document.body.innerHTML = App(); diff --git a/examples/html-scss-ts-parcel/src/index.ts b/examples/html-scss-ts-parcel/src/index.ts index 5ba3bbadf..f1513d90a 100644 --- a/examples/html-scss-ts-parcel/src/index.ts +++ b/examples/html-scss-ts-parcel/src/index.ts @@ -1,4 +1,4 @@ -import './index.scss'; import { App } from './app'; +import './index.scss'; document.body.innerHTML = App(); diff --git a/examples/react-emotion-ts-parcel/src/App.tsx b/examples/react-emotion-ts-parcel/src/App.tsx index cb10a80a3..c97da73df 100644 --- a/examples/react-emotion-ts-parcel/src/App.tsx +++ b/examples/react-emotion-ts-parcel/src/App.tsx @@ -1,7 +1,7 @@ import styled from '@emotion/styled'; import { borderRadius, color, space } from '@onfido/castor'; +import { IconPassport, Icons } from '@onfido/castor-icons'; import { Button, Icon } from '@onfido/castor-react'; -import { Icons, IconPassport } from '@onfido/castor-icons'; import React from 'react'; export const App = () => ( diff --git a/examples/react-scss-js-webpack/src/App.jsx b/examples/react-scss-js-webpack/src/App.jsx index c8af9747c..b518933e1 100644 --- a/examples/react-scss-js-webpack/src/App.jsx +++ b/examples/react-scss-js-webpack/src/App.jsx @@ -1,5 +1,5 @@ +import { IconPassport, Icons } from '@onfido/castor-icons'; import { Button, Icon } from '@onfido/castor-react'; -import { Icons, IconPassport } from '@onfido/castor-icons'; import React from 'react'; import styles from './App.scss'; diff --git a/examples/react-scss-js-webpack/src/index.jsx b/examples/react-scss-js-webpack/src/index.jsx index 9fb1ede87..cc4eeec6a 100644 --- a/examples/react-scss-js-webpack/src/index.jsx +++ b/examples/react-scss-js-webpack/src/index.jsx @@ -1,8 +1,8 @@ +import '@onfido/castor/dist/castor.css'; +import '@onfido/castor/dist/themes/day.css'; import React from 'react'; import { render } from 'react-dom'; import { App } from './App'; -import '@onfido/castor/dist/castor.css'; -import '@onfido/castor/dist/themes/day.css'; import './index.css'; render(, document.getElementById('root')); diff --git a/examples/react-scss-ts-parcel/src/App.tsx b/examples/react-scss-ts-parcel/src/App.tsx index c8af9747c..b518933e1 100644 --- a/examples/react-scss-ts-parcel/src/App.tsx +++ b/examples/react-scss-ts-parcel/src/App.tsx @@ -1,5 +1,5 @@ +import { IconPassport, Icons } from '@onfido/castor-icons'; import { Button, Icon } from '@onfido/castor-react'; -import { Icons, IconPassport } from '@onfido/castor-icons'; import React from 'react'; import styles from './App.scss'; diff --git a/packages/react/src/button/button.react.stories.tsx b/packages/react/src/button/button.react.stories.tsx index 632ebc87f..3c8e92485 100644 --- a/packages/react/src/button/button.react.stories.tsx +++ b/packages/react/src/button/button.react.stories.tsx @@ -1,9 +1,9 @@ -import React, { SyntheticEvent } from 'react'; import { space } from '@onfido/castor'; import { IconName, iconNames } from '@onfido/castor-icons'; -import { Meta, Story, omit, storyOf } from '../../../../docs'; +import React, { SyntheticEvent } from 'react'; import { Icon } from '../'; -import { ButtonProps, Button } from './button.react'; +import { Meta, omit, Story, storyOf } from '../../../../docs'; +import { Button, ButtonProps } from './button.react'; export default { title: 'React/Button', diff --git a/packages/react/src/button/button.react.tsx b/packages/react/src/button/button.react.tsx index 52a55ef7f..d635b00fa 100755 --- a/packages/react/src/button/button.react.tsx +++ b/packages/react/src/button/button.react.tsx @@ -1,5 +1,5 @@ -import React, { HTMLAttributes } from 'react'; import { ButtonProps as BaseProps, c, classy, m } from '@onfido/castor'; +import React, { HTMLAttributes } from 'react'; export const Button: ButtonComponent = ({ kind = 'action', diff --git a/packages/react/src/icon/icon.react.stories.tsx b/packages/react/src/icon/icon.react.stories.tsx index 30a370d03..622b40114 100644 --- a/packages/react/src/icon/icon.react.stories.tsx +++ b/packages/react/src/icon/icon.react.stories.tsx @@ -1,8 +1,8 @@ -import React from 'react'; import { Color } from '@onfido/castor'; import { iconNames } from '@onfido/castor-icons'; -import { Meta, Story, omit, storyOf, tokens } from '../../../../docs'; -import { IconProps, Icon } from './icon.react'; +import React from 'react'; +import { Meta, omit, Story, storyOf, tokens } from '../../../../docs'; +import { Icon, IconProps } from './icon.react'; const colors = Object.keys(tokens).reduce((accumulator, name) => { const [, color] = name.match(/^--color-([a-z0-9-]+)$/) ?? []; diff --git a/packages/react/src/icon/icon.react.tsx b/packages/react/src/icon/icon.react.tsx index 5047269bd..753e06289 100644 --- a/packages/react/src/icon/icon.react.tsx +++ b/packages/react/src/icon/icon.react.tsx @@ -1,5 +1,5 @@ -import React from 'react'; import { c, classy, color, IconProps as BaseProps } from '@onfido/castor'; +import React from 'react'; /** * Please note that this component requires an SVG sprite to be inlined in your diff --git a/packages/react/src/input/input.react.stories.tsx b/packages/react/src/input/input.react.stories.tsx index 1d671b6d5..fc25ddb7a 100644 --- a/packages/react/src/input/input.react.stories.tsx +++ b/packages/react/src/input/input.react.stories.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { Meta, Story, omit, storyOf } from '../../../../docs'; -import { InputProps, Input } from './input.react'; +import { Meta, omit, Story, storyOf } from '../../../../docs'; +import { Input, InputProps } from './input.react'; export default { title: 'React/Input', diff --git a/packages/react/src/input/input.react.tsx b/packages/react/src/input/input.react.tsx index 406942246..35c22e784 100644 --- a/packages/react/src/input/input.react.tsx +++ b/packages/react/src/input/input.react.tsx @@ -1,5 +1,5 @@ +import { c, classy, InputProps as BaseProps, m } from '@onfido/castor'; import React from 'react'; -import { c, classy, m, InputProps as BaseProps } from '@onfido/castor'; export const Input = ({ type = 'text', diff --git a/packages/react/src/textarea/textarea.react.stories.tsx b/packages/react/src/textarea/textarea.react.stories.tsx index be71aea40..0b818940b 100644 --- a/packages/react/src/textarea/textarea.react.stories.tsx +++ b/packages/react/src/textarea/textarea.react.stories.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { Meta, Story, omit, storyOf } from '../../../../docs'; -import { TextareaProps, Textarea } from './textarea.react'; +import { Meta, omit, Story, storyOf } from '../../../../docs'; +import { Textarea, TextareaProps } from './textarea.react'; export default { title: 'React/Textarea', diff --git a/packages/react/src/textarea/textarea.react.tsx b/packages/react/src/textarea/textarea.react.tsx index 38ab93e33..a794fb0b5 100755 --- a/packages/react/src/textarea/textarea.react.tsx +++ b/packages/react/src/textarea/textarea.react.tsx @@ -1,5 +1,5 @@ -import React from 'react'; import { c, classy, m, TextareaProps as BaseProps } from '@onfido/castor'; +import React from 'react'; export const Textarea = ({ resize = 'vertical',