vega-frontend-monorepo/libs/ui-toolkit/src/components/button/Button.stories.tsx

102 lines
2.0 KiB
TypeScript
Raw Normal View History

2022-03-01 09:26:26 +00:00
import { Story, Meta } from '@storybook/react';
2022-03-01 11:27:40 +00:00
import { Button } from './button';
2022-03-01 09:26:26 +00:00
export default {
component: Button,
title: 'Button',
} as Meta;
const Template: Story = (args) => (
<>
<div className="mb-8">
<Button {...args} />
</div>
{args['variant'] !== 'inline' && <Button {...args} disabled />}
</>
);
export const Primary = Template.bind({});
Primary.args = {
children: 'Primary',
};
export const Secondary = Template.bind({});
Secondary.args = {
children: 'Secondary',
variant: 'secondary',
};
export const Accent = Template.bind({});
Accent.args = {
children: 'Accent',
variant: 'accent',
};
export const Inline = Template.bind({});
Inline.args = {
children: 'Inline',
variant: 'inline',
};
2022-03-02 09:56:05 +00:00
2022-03-03 11:11:36 +00:00
export const NavAccent: Story = (args) => (
<>
<div className="mb-8">
<Button variant="accent" className="px-4">
Background
</Button>
</div>
<div className="mb-8">
2022-03-03 14:51:20 +00:00
<Button variant="accent" className="px-4" prependIconName="menu-open">
2022-03-03 11:11:36 +00:00
Background
</Button>
</div>
<div className="mb-8">
2022-03-03 14:51:20 +00:00
<Button variant="accent" className="px-4" appendIconName="menu-closed">
2022-03-03 11:11:36 +00:00
Background
</Button>
</div>
</>
);
export const NavInline: Story = (args) => (
<>
<div className="mb-8">
<Button variant="inline" className="uppercase">
Background
</Button>
</div>
<div className="mb-8">
<Button
variant="inline"
className="uppercase"
prependIconName="menu-open"
>
Background
</Button>
</div>
<div className="mb-8">
<Button
variant="inline"
className="uppercase"
appendIconName="menu-closed"
>
Background
</Button>
</div>
</>
);
2022-03-02 09:56:05 +00:00
export const IconPrepend = Template.bind({});
IconPrepend.args = {
children: 'Icon prepend',
prependIconName: 'search',
variant: 'accent',
};
export const IconAppend = Template.bind({});
IconAppend.args = {
children: 'Icon append',
appendIconName: 'search',
variant: 'accent',
};