add storybook
This commit is contained in:
37
src/stories/Button.stories.ts
Normal file
37
src/stories/Button.stories.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import type { Meta, StoryObj } from '@storybook/vue3'
|
||||
|
||||
import { UiBtn, colors, icons } from '..'
|
||||
|
||||
const iconNames = Object.keys(icons)
|
||||
|
||||
const meta = {
|
||||
title: 'Example/Button',
|
||||
component: UiBtn,
|
||||
tags: ['autodocs'],
|
||||
argTypes: {
|
||||
label: { control: 'text' },
|
||||
type: { control: 'select', options: ['button', 'submit'] },
|
||||
color: { control: 'select', options: colors },
|
||||
icon: { control: 'select', options: iconNames },
|
||||
disabled: { control: 'boolean' },
|
||||
onClick: { action: 'clicked' }
|
||||
},
|
||||
args: {}
|
||||
} satisfies Meta<typeof UiBtn>
|
||||
|
||||
export default meta
|
||||
|
||||
type Story = StoryObj<typeof meta>
|
||||
|
||||
export const Default: Story = {
|
||||
args: {
|
||||
label: 'Button',
|
||||
}
|
||||
}
|
||||
|
||||
export const Accent: Story = {
|
||||
args: {
|
||||
label: 'Accent',
|
||||
color: 'accent'
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user