import React from 'react'; import type { ComponentMeta } from '@storybook/react'; import type { SpinnerColor, SpinnerDisplay,SpinnerSize } from '@tih/ui'; import { Spinner } from '@tih/ui'; const spinnerColors: ReadonlyArray = ['default', 'inherit']; const spinnerDisplays: ReadonlyArray = ['block', 'inline']; const spinnerSizes: ReadonlyArray = ['xs', 'sm', 'md', 'lg']; export default { argTypes: { color: { control: { type: 'select' }, options: spinnerColors, }, display: { control: { type: 'select' }, options: spinnerDisplays, }, label: { control: 'text', }, size: { control: { type: 'select' }, options: spinnerSizes, }, }, component: Spinner, title: 'Spinner', } 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) => ( ))}
); }