import { Meta, Story } from '@storybook/react'; import { useState } from 'react'; import * as React from 'react'; import { Modal, ModalProps, ModalSize } from '../Modals'; import { Button } from '../Button'; import { Card } from '../Card'; import { Text } from '../Text'; const sizes: ModalSize[] = ['auto', 'sm', 'md', 'lg', 'xl', 'screen']; const meta: Meta = { title: 'Components/Modals', component: Modal, argTypes: { size: { options: sizes, control: { type: 'radio' }, }, ref: { table: { disable: true, }, }, onClose: { table: { disable: true, }, }, open: { table: { disable: true, }, }, }, parameters: { controls: { expanded: true, sort: 'alpha' }, }, }; export default meta; const Template: Story = (args) => { const [parentOpen, setParentOpen] = useState(false); const [firstChildOpen, setFirstChildOpen] = useState(false); const [secondChildOpen, setSecondChildOpen] = useState(false); return ( <> setParentOpen(false)}>

This is a parent modal

setFirstChildOpen(false)}>

This is a child modal

setSecondChildOpen(false)}>

This is a second child modal

); }; const DefaultTemplate: Story = (args) => { return