Storybook: improve Button story

renovate/loader-utils-3.x
Alex Gleason 2023-02-02 23:00:51 -06:00
rodzic dd7b6af97d
commit d9d6708589
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
2 zmienionych plików z 15 dodań i 28 usunięć

Wyświetl plik

@ -100,4 +100,7 @@ const Button = React.forwardRef<HTMLButtonElement, IButton>((props, ref): JSX.El
return renderButton();
});
export default Button;
export {
Button as default,
Button,
};

Wyświetl plik

@ -1,7 +1,7 @@
import { ComponentStory, ComponentMeta } from '@storybook/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
export default {
@ -10,32 +10,16 @@ export default {
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
argTypes: {
text: { type: 'string', defaultValue: 'Button' },
theme: {
control: 'select',
options: [
'primary',
'secondary',
'tertiary',
'accent',
'danger',
'transparent',
'outline',
'muted',
],
defaultValue: 'primary',
},
size: {
control: 'select',
options: [
'xs',
'sm',
'md',
'lg',
],
defaultValue: 'md',
},
disabled: { type: 'boolean', defaultValue: false },
onClick: { action: 'onClick' },
theme: { defaultValue: 'primary' },
size: { defaultValue: 'md' },
disabled: { defaultValue: false },
block: { defaultValue: false },
children: { table: { disable: true } },
className: { table: { disable: true } },
type: { table: { disable: true } },
to: { table: { disable: true } },
icon: { table: { disable: true } },
onClick: { table: { disable: true } },
},
} as ComponentMeta<typeof Button>;