import { ComponentMeta } from '@storybook/react'; import { Spinner, SpinnerColor, SpinnerSize, SpinnerDisplay } from '@tih/ui'; import React from 'react'; const spinnerColors: ReadonlyArray = ['default', 'inherit']; const spinnerDisplays: ReadonlyArray = ['block', 'inline']; const spinnerSizes: ReadonlyArray = ['xs', 'sm', 'md', 'lg']; export default { title: 'Spinner', component: Spinner, argTypes: { color: { options: spinnerColors, control: { type: 'select' }, }, display: { options: spinnerDisplays, control: { type: 'select' }, }, label: { control: 'string', }, size: { options: spinnerSizes, control: { type: 'select' }, }, }, } as ComponentMeta; export const Basic = { args: { label: 'Loading data', size: 'md', }, }; export function Size() { return (
{spinnerSizes.map((size) => ( ))}
); } export function Display() { return (
{spinnerSizes.map((size) => ( ))}
); }