import type { Meta, StoryObj } from '@storybook/react'; import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DialogBody } from './dialog'; import { Button } from './button'; import { useState } from 'react'; const meta = { title: 'UI/Dialog', component: Dialog, tags: ['autodocs'], argTypes: { variant: { control: 'select', options: ['default', 'alert', 'confirm', 'info'], }, size: { control: 'select', options: ['sm', 'md', 'lg', 'xl'], }, title: { control: 'text' }, open: { control: 'boolean' }, }, } satisfies Meta; export default meta; type Story = StoryObj; export const Default: Story = { render: (args) => { const [open, setOpen] = useState(false); return ( <> setOpen(false)} title="Edit Profile" >

Make changes to your profile here. Click save when you're done.

); }, args: { variant: 'default', size: 'md', } }; export const Alert: Story = { render: (args) => { const [open, setOpen] = useState(false); return ( <> setOpen(false)} variant="alert" title="Are you absolutely sure?" onConfirm={() => setOpen(false)} confirmLabel="Delete Account" >

This action cannot be undone. This will permanently delete your account and remove your data from our servers.

); }, }; export const Composition: Story = { render: () => { const [open, setOpen] = useState(false); return (
{open && (
Composed Dialog Built using sub-components. Main content goes here.
)}
) } }