fix story
This commit is contained in:
parent
5287eb794a
commit
f88b960bbe
1 changed files with 12 additions and 2 deletions
|
|
@ -1,7 +1,8 @@
|
||||||
<script module lang="ts">
|
<script module lang="ts">
|
||||||
import { defineMeta } from '@storybook/addon-svelte-csf';
|
import { defineMeta } from '@storybook/addon-svelte-csf';
|
||||||
import Button from './Button.svelte';
|
|
||||||
import { fn } from '@storybook/test';
|
import { fn } from '@storybook/test';
|
||||||
|
import type { ComponentProps } from 'svelte';
|
||||||
|
import Button from './Button.svelte';
|
||||||
|
|
||||||
const { Story } = defineMeta({
|
const { Story } = defineMeta({
|
||||||
title: 'Actions/Button',
|
title: 'Actions/Button',
|
||||||
|
|
@ -10,6 +11,7 @@
|
||||||
onClick: fn(),
|
onClick: fn(),
|
||||||
},
|
},
|
||||||
argTypes: {
|
argTypes: {
|
||||||
|
block: { control: 'boolean' },
|
||||||
color: {
|
color: {
|
||||||
control: 'select',
|
control: 'select',
|
||||||
options: [
|
options: [
|
||||||
|
|
@ -25,9 +27,12 @@
|
||||||
'error',
|
'error',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
full: { control: 'boolean' },
|
||||||
|
glass: { control: 'boolean' },
|
||||||
outline: {
|
outline: {
|
||||||
control: 'boolean',
|
control: 'boolean',
|
||||||
},
|
},
|
||||||
|
responsive: { control: 'boolean' },
|
||||||
size: {
|
size: {
|
||||||
control: 'select',
|
control: 'select',
|
||||||
options: ['Default', 'xs', 'sm', 'lg'],
|
options: ['Default', 'xs', 'sm', 'lg'],
|
||||||
|
|
@ -37,8 +42,13 @@
|
||||||
control: 'select',
|
control: 'select',
|
||||||
options: ['button', 'reset', 'submit'],
|
options: ['button', 'reset', 'submit'],
|
||||||
},
|
},
|
||||||
|
wide: { control: 'boolean' },
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Story name="Default" args={{ label: 'Button', color: 'primary' }} />
|
{#snippet template({ children: _, ...props }: Partial<ComponentProps<typeof Button>>)}
|
||||||
|
<Button {...props}>Button</Button>
|
||||||
|
{/snippet}
|
||||||
|
|
||||||
|
<Story name="Default" args={{}} children={template} />
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue