import type { Meta, StoryObj } from '@storybook/nextjs' import { useEffect, useState } from 'react' import Dialog from '.' const meta = { title: 'Base/Feedback/Dialog', component: Dialog, parameters: { layout: 'fullscreen', docs: { description: { component: 'Modal dialog built on Headless UI. Provides animated overlay, title slot, and optional footer region.', }, }, }, tags: ['autodocs'], argTypes: { className: { control: 'text', description: 'Additional classes applied to the panel.', }, titleClassName: { control: 'text', description: 'Extra classes for the title element.', }, bodyClassName: { control: 'text', description: 'Extra classes for the content area.', }, footerClassName: { control: 'text', description: 'Extra classes for the footer container.', }, title: { control: 'text', description: 'Dialog title.', }, show: { control: 'boolean', description: 'Controls visibility of the dialog.', }, onClose: { control: false, description: 'Called when the dialog backdrop or close handler fires.', }, }, args: { title: 'Manage API Keys', show: false, children: null, }, } satisfies Meta export default meta type Story = StoryObj const DialogDemo = (props: React.ComponentProps) => { const [open, setOpen] = useState(props.show) useEffect(() => { setOpen(props.show) }, [props.show]) return (
{ props.onClose?.() setOpen(false) }} >

Centralize API key management for collaborators. You can revoke, rotate, or generate new keys directly from this dialog.

This placeholder area represents a form or table that would live inside the dialog body.
) } export const Default: Story = { render: args => , args: { footer: ( <> ), }, } export const WithoutFooter: Story = { render: args => , args: { footer: undefined, title: 'Read-only summary', }, parameters: { docs: { description: { story: 'Demonstrates the dialog when no footer actions are provided.', }, }, }, } export const CustomStyling: Story = { render: args => , args: { className: 'max-w-[560px] bg-white/95 backdrop-blur', bodyClassName: 'bg-gray-50 rounded-xl p-5', footerClassName: 'justify-between px-4 pb-4 pt-4', titleClassName: 'text-lg text-primary-600', footer: ( <> Last synced 2 minutes ago
), }, parameters: { docs: { description: { story: 'Applies custom classes to the panel, body, title, and footer to match different surfaces.', }, }, }, }