import { Meta, StoryObj } from '@storybook/react-webpack5'; import { fn } from 'storybook/test'; import Button from '.'; import LegacyButton from './LegacyButton'; // needed for the SB to show correct name in the Source blocks LegacyButton.displayName = 'Button'; const withContainer = (Story: any) => (
); const meta: Meta = { component: LegacyButton, title: 'Actions/Button/Legacy Button', tags: ['deprecated'], args: { size: undefined, priority: undefined, type: undefined, block: false, disabled: false, loading: false, href: undefined, as: undefined, target: undefined, htmlType: undefined, children: 'Button text', onClick: fn(), onBlur: fn(), onFocus: fn(), }, argTypes: { href: { control: 'text', description: 'If set together with `as="a"`, the component will render as an HTML anchor.', }, as: { control: { name: 'enum', options: ['button', 'a'], }, description: 'If set together with `href`, the component will render as an HTML anchor.', }, type: { type: { name: 'enum', value: ['accent', 'positive', 'negative'], }, description: '**NB**: `primary` | `pay` | `secondary` | `danger` | `link` are deprecated.\n\n', }, size: { type: { name: 'enum', value: ['lg', 'md', 'sm', 'xs'], }, description: '**NB**: `xs` is deprecated.\n\n', }, priority: { type: { name: 'enum', value: ['primary', 'secondary', 'tertiary'], }, }, block: { table: { defaultValue: { summary: 'false' }, }, }, v2: { table: { disable: true, }, }, }, decorators: [withContainer], }; export default meta; type Story = StoryObj; export const Basic: Story = {}; export const Secondary: Story = { args: { type: 'accent', priority: 'secondary', }, }; export const Tertiary: Story = { args: { type: 'accent', priority: 'tertiary', }, }; export const Negative: Story = { args: { type: 'negative', priority: 'primary', }, }; export const Loading: Story = { args: { loading: true, }, }; export const Variants: Story = { render: () => { return (
); }, }; export const SocialMedia: Story = { render: () => { return ( <>
); }, };