import type { Meta, StoryObj } from '@storybook/nextjs' import { useEffect, useState } from 'react' import Modal from '.' const meta = { title: 'Base/Feedback/Modal', component: Modal, parameters: { layout: 'fullscreen', docs: { description: { component: 'Lightweight modal wrapper with optional header/description, close icon, and high-priority stacking for dropdown overlays.', }, }, }, tags: ['autodocs'], argTypes: { className: { control: 'text', description: 'Extra classes applied to the modal panel.', }, wrapperClassName: { control: 'text', description: 'Additional wrapper classes for the dialog.', }, isShow: { control: 'boolean', description: 'Controls whether the modal is visible.', }, title: { control: 'text', description: 'Heading displayed at the top of the modal.', }, description: { control: 'text', description: 'Secondary text beneath the title.', }, closable: { control: 'boolean', description: 'Whether the close icon should be shown.', }, overflowVisible: { control: 'boolean', description: 'Allows content to overflow the modal panel.', }, highPriority: { control: 'boolean', description: 'Lifts the modal above other high z-index elements like dropdowns.', }, onClose: { control: false, description: 'Callback invoked when the modal requests to close.', }, }, args: { isShow: false, title: 'Create new API key', description: 'Generate a scoped key for this workspace. You can revoke it at any time.', closable: true, }, } satisfies Meta export default meta type Story = StoryObj const ModalDemo = (props: React.ComponentProps) => { const [open, setOpen] = useState(props.isShow) useEffect(() => { setOpen(props.isShow) }, [props.isShow]) return (
{ props.onClose?.() setOpen(false) }} >

Provide a descriptive name for this key so collaborators know its purpose. Restrict usage with scopes to limit access.

Form fields and validation messaging would appear here. This placeholder keeps the story lightweight.
) } export const Default: Story = { render: args => , } export const HighPriorityOverflow: Story = { render: args => , args: { highPriority: true, overflowVisible: true, description: 'Demonstrates the modal configured to sit above dropdowns while letting the body content overflow.', className: 'max-w-[540px]', }, parameters: { docs: { description: { story: 'Shows the modal with `highPriority` and `overflowVisible` enabled, useful when nested within complex surfaces.', }, }, }, }