sforkowany z mirror/soapbox
Storybook: improve Button story
rodzic
dd7b6af97d
commit
d9d6708589
|
@ -100,4 +100,7 @@ const Button = React.forwardRef<HTMLButtonElement, IButton>((props, ref): JSX.El
|
||||||
return renderButton();
|
return renderButton();
|
||||||
});
|
});
|
||||||
|
|
||||||
export default Button;
|
export {
|
||||||
|
Button as default,
|
||||||
|
Button,
|
||||||
|
};
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import Button from 'soapbox/components/ui/button/button';
|
import { Button } from 'soapbox/components/ui';
|
||||||
|
|
||||||
// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
||||||
export default {
|
export default {
|
||||||
|
@ -10,32 +10,16 @@ export default {
|
||||||
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
||||||
argTypes: {
|
argTypes: {
|
||||||
text: { type: 'string', defaultValue: 'Button' },
|
text: { type: 'string', defaultValue: 'Button' },
|
||||||
theme: {
|
theme: { defaultValue: 'primary' },
|
||||||
control: 'select',
|
size: { defaultValue: 'md' },
|
||||||
options: [
|
disabled: { defaultValue: false },
|
||||||
'primary',
|
block: { defaultValue: false },
|
||||||
'secondary',
|
children: { table: { disable: true } },
|
||||||
'tertiary',
|
className: { table: { disable: true } },
|
||||||
'accent',
|
type: { table: { disable: true } },
|
||||||
'danger',
|
to: { table: { disable: true } },
|
||||||
'transparent',
|
icon: { table: { disable: true } },
|
||||||
'outline',
|
onClick: { table: { disable: true } },
|
||||||
'muted',
|
|
||||||
],
|
|
||||||
defaultValue: 'primary',
|
|
||||||
},
|
|
||||||
size: {
|
|
||||||
control: 'select',
|
|
||||||
options: [
|
|
||||||
'xs',
|
|
||||||
'sm',
|
|
||||||
'md',
|
|
||||||
'lg',
|
|
||||||
],
|
|
||||||
defaultValue: 'md',
|
|
||||||
},
|
|
||||||
disabled: { type: 'boolean', defaultValue: false },
|
|
||||||
onClick: { action: 'onClick' },
|
|
||||||
},
|
},
|
||||||
} as ComponentMeta<typeof Button>;
|
} as ComponentMeta<typeof Button>;
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue