import type { Meta, StoryObj } from '@storybook/nextjs' import { useEffect, useState } from 'react' import ContentDialog from '.' type Props = React.ComponentProps const meta = { title: 'Base/Feedback/ContentDialog', component: ContentDialog, parameters: { layout: 'fullscreen', docs: { description: { component: 'Sliding panel overlay used in the app detail view. Includes dimmed backdrop and animated entrance/exit transitions.', }, }, }, tags: ['autodocs'], argTypes: { className: { control: 'text', description: 'Additional classes applied to the sliding panel container.', }, show: { control: 'boolean', description: 'Controls visibility of the dialog.', }, onClose: { control: false, description: 'Invoked when the overlay/backdrop is clicked.', }, children: { control: false, table: { disable: true }, }, }, args: { show: false, children: null, }, } satisfies Meta export default meta type Story = StoryObj const DemoWrapper = (props: Props) => { const [open, setOpen] = useState(props.show) useEffect(() => { setOpen(props.show) }, [props.show]) return (
{ props.onClose?.() setOpen(false) }} >

Plan summary

Use this area to present rich content for the selected run, configuration details, or any supporting context.

Scrollable placeholder content. Add domain-specific information, activity logs, or editors in the real application.
) } export const Default: Story = { args: { children: null, }, render: args => , } export const NarrowPanel: Story = { render: args => , args: { className: 'max-w-[420px]', children: null, }, parameters: { docs: { description: { story: 'Applies a custom width class to show the dialog as a narrower information panel.', }, }, }, }