diff --git a/.storybook/main.js b/.storybook/main.js index cf45e8ed0..19532941d 100644 --- a/.storybook/main.js +++ b/.storybook/main.js @@ -3,6 +3,6 @@ module.exports = { addons: [ '@storybook/addon-links', '@storybook/addon-essentials', - '@storybook/preset-typescript', + // '@storybook/preset-typescript', ], } diff --git a/.storybook/webpack.config.js b/.storybook/webpack.config.js index 1c6556da0..6204804f4 100644 --- a/.storybook/webpack.config.js +++ b/.storybook/webpack.config.js @@ -1,20 +1,20 @@ const path = require('path') module.exports = ({ config }) => { - config.module.rules[0].use[0].loader = require.resolve('babel-loader') - config.module.rules[0].use[0].options.presets = [ - require.resolve('@babel/preset-react'), - require.resolve('@babel/preset-env'), - ] + // config.module.rules[0].use[0].loader = require.resolve('babel-loader') + // config.module.rules[0].use[0].options.presets = [ + // require.resolve('@babel/preset-react'), + // require.resolve('@babel/preset-env'), + // ] - config.module.rules.push({ - test: /\.(ts|tsx)$/, - loader: require.resolve('babel-loader'), - options: { - presets: [['react-app', { flow: false, typescript: true }]], - plugins: [], - }, - }) + // config.module.rules.push({ + // test: /\.(ts|tsx)$/, + // loader: require.resolve('babel-loader'), + // options: { + // presets: [['react-app', { flow: false, typescript: true }]], + // plugins: [], + // }, + // }) // Remove the existing css rule config.module.rules = config.module.rules.filter( diff --git a/src/components/Button/index.stories.tsx b/src/components/Button/index.stories.tsx new file mode 100644 index 000000000..1b75d2467 --- /dev/null +++ b/src/components/Button/index.stories.tsx @@ -0,0 +1,60 @@ +import React from 'react' +// also exported from '@storybook/react' if you can deal with breaking changes in 6.1 +import { Story, Meta } from '@storybook/react' + +import Button, { ButtonProps, ButtonSize } from './' + +const story: Meta = { + title: 'Button', + component: Button, + argTypes: { + disabled: { + control: { + type: 'boolean', + }, + }, + size: { + defaultValue: ButtonSize.Normal, + control: { + type: 'select', + options: [ButtonSize.Normal, ButtonSize.Small], + }, + }, + inverted: { + defaultValue: false, + control: { + type: 'boolean', + }, + }, + onClick: { action: 'click' }, + onFocus: { action: 'focus' }, + onBlur: { action: 'blur' }, + }, +} + +const Template: Story = (args: ButtonProps) => - ) -} diff --git a/stories/example/button.css b/stories/example/button.css deleted file mode 100644 index dc91dc763..000000000 --- a/stories/example/button.css +++ /dev/null @@ -1,30 +0,0 @@ -.storybook-button { - font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; - font-weight: 700; - border: 0; - border-radius: 3em; - cursor: pointer; - display: inline-block; - line-height: 1; -} -.storybook-button--primary { - color: white; - background-color: #1ea7fd; -} -.storybook-button--secondary { - color: #333; - background-color: transparent; - box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset; -} -.storybook-button--small { - font-size: 12px; - padding: 10px 16px; -} -.storybook-button--medium { - font-size: 14px; - padding: 11px 20px; -} -.storybook-button--large { - font-size: 16px; - padding: 12px 24px; -} diff --git a/stories/postcss.config.js b/stories/postcss.config.js deleted file mode 100644 index 4ba52ba2c..000000000 --- a/stories/postcss.config.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = {}