import { useState } from 'react'; import type { Meta, StoryObj } from '@storybook/react'; import { Button } from './Button'; import { Dropdown } from './Dropdown'; import { Form } from './Form'; import { InputField } from './InputField'; const meta = { title: 'Components/Form', component: Form, tags: ['autodocs'], parameters: { docs: { description: { component: 'Surface container with a title bar and a responsive content grid, intended for CMS forms.' } } }, argTypes: { title: { description: 'Form title displayed in the header bar.', control: 'text', table: { type: { summary: 'string' } } }, titleBarRight: { description: 'Optional node rendered on the right side of the title bar.', control: false, table: { type: { summary: 'ReactNode' } } }, children: { description: 'Form content rendered inside the responsive grid.', control: false, table: { type: { summary: 'ReactNode' } } }, className: { description: 'Extra CSS classes for the root container.', control: 'text', table: { type: { summary: 'string' } } } }, args: { title: 'Post details' } } satisfies Meta; export default meta; type Story = StoryObj; export const Basic: Story = { args: { children: ( <> ) } }; export const WithActions: Story = { render: (args) => { const [title, setTitle] = useState('Storybook powered CMS'); const [status, setStatus] = useState('draft'); return (
} >
setTitle(event.target.value)} size="full" />
); } };