import React, { useState } from 'react'; import type { ComponentMeta } from '@storybook/react'; import type { SlideOutEnterFrom, SlideOutSize } from '@tih/ui'; import { Button, SlideOut } from '@tih/ui'; const slideOutEnterFrom: ReadonlyArray = ['start', 'end']; const slideOutSize: ReadonlyArray = ['sm', 'md', 'lg', 'xl']; export default { argTypes: { enterFrom: { control: { type: 'select' }, options: slideOutEnterFrom, }, size: { control: { type: 'select' }, options: slideOutSize, }, title: { control: 'text', }, }, component: SlideOut, title: 'SlideOut', } as ComponentMeta; export function Basic({ children, enterFrom, size, title, }: Pick< React.ComponentProps, 'children' | 'enterFrom' | 'size' | 'title' >) { const [isShown, setIsShown] = useState(false); return (
); } Basic.args = { children:
Hello World
, enterFrom: 'end', size: 'md', title: 'Navigation', };