2021-07-05 17:38:18 +02:00
|
|
|
import React from 'react';
|
|
|
|
|
2021-07-05 22:24:48 +02:00
|
|
|
import { action } from '@storybook/addon-actions';
|
2021-07-05 17:38:18 +02:00
|
|
|
import { Meta, Story } from '@storybook/react';
|
|
|
|
|
|
|
|
import Button, { ButtonType } from '@treejs/components/Button';
|
|
|
|
|
|
|
|
const Template: Story<ButtonType> = (args) => <Button {...args} />;
|
|
|
|
|
|
|
|
export const Default = Template.bind({});
|
|
|
|
Default.args = {
|
|
|
|
label: 'Button',
|
2021-07-05 22:24:48 +02:00
|
|
|
onClick: action('clicked'),
|
|
|
|
};
|
|
|
|
|
|
|
|
export const WithElement = Template.bind({});
|
|
|
|
WithElement.args = {
|
|
|
|
label: <b>Element</b>,
|
|
|
|
onClick: action('clicked'),
|
2021-07-05 17:38:18 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export default {
|
|
|
|
title: 'Components/Button',
|
|
|
|
component: Button,
|
2021-07-05 22:24:48 +02:00
|
|
|
parameters: {
|
|
|
|
layout: 'centered',
|
|
|
|
docs: {
|
|
|
|
page: require('./Button.stories.mdx').default,
|
|
|
|
},
|
|
|
|
},
|
2021-07-05 17:38:18 +02:00
|
|
|
} as Meta;
|