import * as React from 'react'; import {withInfo} from '@storybook/addon-info'; import {boolean, select, text, withKnobs} from '@storybook/addon-knobs'; import {Button} from './Button'; import {alignMap, intentMap, sizeMap} from '../../utils/storybookEnums'; import {iconData} from '@unidata/icon'; import {ALIGN, INTENT, SIZE} from '../../constants'; import {storyLayout} from '../../index.stories'; // eslint-disable-next-line no-restricted-syntax export default { title: 'Button', decorators: [withInfo, withKnobs, storyLayout] }; export const simpleButton = () => { return ( <> {text('buttonText', 'button text')} > ); }; const ButtonDef = (props: any) => { return ( {text('buttonText', 'button text')} ); }; export const everyButtons = () => { const isGhost = boolean('isGhost', false); return ( {['', 'default', 'isActive', 'isMinimal', 'isDisabled'].map((type) => { return ( {type}: {Object.values(INTENT).map((intent) => { if (type === '') { return ( {intent} {isGhost === true ? ' + ghost' : ''} ); } return ( ); })} ); })} ); }; export const buttonWithIcons = () => { return Object.keys(iconData).map((iconKey) => { return ( <> {text('buttonText', 'button text')} > ); }); };