import React from 'react'; import { StoryFn, Meta } from '@storybook/react'; import { AlignItems, Display, FlexDirection, TextVariant, } from '../../../helpers/constants/design-system'; import { Box, IconName } from '..'; import { Text } from '../text'; import README from './README.mdx'; import { Button, ButtonSize, ButtonVariant } from '.'; export default { title: 'Components/ComponentLibrary/Button', component: Button, parameters: { docs: { page: README, }, controls: { sort: 'alpha' }, }, argTypes: { as: { control: 'select', options: ['button', 'a'], }, block: { control: 'boolean', }, children: { control: 'text', }, className: { control: 'text', }, danger: { control: 'boolean', }, disabled: { control: 'boolean', }, href: { control: 'text', }, startIconName: { control: 'select', options: Object.values(IconName), }, endIconName: { control: 'select', options: Object.values(IconName), }, startIconProps: { control: 'object', }, endIconProps: { control: 'object', }, loading: { control: 'boolean', }, size: { control: 'select', options: Object.values(ButtonSize), }, variant: { options: Object.values(ButtonVariant), control: 'select', }, }, args: { children: 'Button', }, } as Meta; const Template: StoryFn = (args) => ); export const SizeStory: StoryFn = (args) => ( <> {' '} inherits the font-size of the parent element. Inherit size only used for ButtonLink. ); SizeStory.storyName = 'Size'; export const Danger: StoryFn = (args) => ( {/* Test Anchor tag to match exactly as button */} ); export const Href: StoryFn = (args) => ( ); Href.args = { href: '/metamask', }; export const Block: StoryFn = (args) => ( <> ); export const As: StoryFn = (args) => ( ); export const Disabled = Template.bind({}); Disabled.args = { disabled: true, }; export const Loading = Template.bind({}); Loading.args = { loading: true, }; export const StartIconName = Template.bind({}); StartIconName.args = { startIconName: IconName.AddSquare, }; export const EndIconName = Template.bind({}); EndIconName.args = { endIconName: IconName.AddSquare, };