mirror of
https://github.com/ershisan99/flashcards-example-project.git
synced 2025-12-18 05:09:23 +00:00
80 lines
1.4 KiB
TypeScript
80 lines
1.4 KiB
TypeScript
import type { Meta, StoryObj } from '@storybook/react'
|
|
|
|
import { Logout } from '@/assets'
|
|
|
|
import { Button } from './'
|
|
|
|
const meta = {
|
|
argTypes: {
|
|
variant: {
|
|
control: { type: 'radio' },
|
|
options: ['primary', 'secondary', 'tertiary', 'link'],
|
|
},
|
|
},
|
|
component: Button,
|
|
tags: ['autodocs'],
|
|
title: 'Components/Button',
|
|
} satisfies Meta<typeof Button>
|
|
|
|
export default meta
|
|
type Story = StoryObj<typeof meta>
|
|
|
|
export const Primary: Story = {
|
|
args: {
|
|
children: 'Primary Button',
|
|
disabled: false,
|
|
variant: 'primary',
|
|
},
|
|
}
|
|
export const PrimaryWithIcon: Story = {
|
|
args: {
|
|
children: (
|
|
<>
|
|
Sign out <Logout />
|
|
</>
|
|
),
|
|
disabled: false,
|
|
variant: 'primary',
|
|
},
|
|
}
|
|
|
|
export const Secondary: Story = {
|
|
args: {
|
|
children: 'Secondary Button',
|
|
disabled: false,
|
|
variant: 'secondary',
|
|
},
|
|
}
|
|
export const Tertiary: Story = {
|
|
args: {
|
|
children: 'Tertiary Button',
|
|
disabled: false,
|
|
variant: 'tertiary',
|
|
},
|
|
}
|
|
export const Link: Story = {
|
|
args: {
|
|
children: 'Link Button',
|
|
disabled: false,
|
|
variant: 'link',
|
|
},
|
|
}
|
|
|
|
export const FullWidth: Story = {
|
|
args: {
|
|
children: 'Full Width Button',
|
|
disabled: false,
|
|
fullWidth: true,
|
|
variant: 'primary',
|
|
},
|
|
}
|
|
|
|
export const AsLink: Story = {
|
|
args: {
|
|
as: 'a',
|
|
children: 'Link that looks like a button',
|
|
href: 'https://google.com',
|
|
variant: 'primary',
|
|
},
|
|
}
|