storybook: add Button and Spinner examples

This commit is contained in:
Yangshun Tay
2022-10-04 09:04:08 +08:00
parent de33d38e1b
commit 842837fb4e
15 changed files with 340 additions and 116 deletions

View File

@ -4,8 +4,10 @@ import type { UrlObject } from 'url';
import Spinner from '../Spinner';
export type ButtonAddOnPosition = 'end' | 'start';
export type ButtonDisplay = 'block' | 'inline';
export type ButtonSize = 'lg' | 'md' | 'sm';
export type ButtonType = 'button' | 'reset' | 'submit';
export type ButtonVariant =
| 'primary'
| 'secondary'
@ -14,7 +16,7 @@ export type ButtonVariant =
| 'tertiary';
type Props = Readonly<{
addonPosition?: 'end' | 'start';
addonPosition?: ButtonAddOnPosition;
'aria-controls'?: string;
className?: string;
display?: ButtonDisplay;
@ -26,7 +28,7 @@ type Props = Readonly<{
label: string;
onClick?: (event: React.MouseEvent<HTMLElement>) => void;
size?: ButtonSize;
type?: 'button' | 'submit';
type?: ButtonType;
variant: ButtonVariant;
}>;