Tom Coleman 427ec4433d Rename docsPage to autodocs
And change semantics: `docsPage:true` = `autodocs: 'tag'` and `docsPage: 'automatic'` = `autodocs: true`.
2022-12-21 21:49:57 +11:00

50 lines
1.1 KiB
TypeScript

import type { Meta, StoryObj } from '@storybook/web-components';
import type { ButtonProps } from './Button';
import { Button } from './Button';
// More on how to set up stories at: https://storybook.js.org/docs/7.0/web-components/writing-stories/introduction
const meta: Meta<ButtonProps> = {
title: 'Example/Button',
tags: ['autodocs'],
render: (args) => Button(args),
argTypes: {
backgroundColor: { control: 'color' },
onClick: { action: 'onClick' },
size: {
control: { type: 'select' },
options: ['small', 'medium', 'large'],
},
},
};
export default meta;
type Story = StoryObj<ButtonProps>;
// More on writing stories with args: https://storybook.js.org/docs/7.0/web-components/writing-stories/args
export const Primary: Story = {
args: {
primary: true,
label: 'Button',
},
};
export const Secondary: Story = {
args: {
label: 'Button',
},
};
export const Large: Story = {
args: {
size: 'large',
label: 'Button',
},
};
export const Small: Story = {
args: {
size: 'small',
label: 'Button',
},
};