This commit is contained in:
@@ -12,35 +12,36 @@ const meta = {
|
||||
parameters: {
|
||||
docs: {
|
||||
description: {
|
||||
component: 'Surface container with a title bar and a responsive content grid, intended for CMS forms.'
|
||||
}
|
||||
}
|
||||
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' } }
|
||||
table: { type: { summary: 'string' } },
|
||||
},
|
||||
titleBarRight: {
|
||||
description: 'Optional node rendered on the right side of the title bar.',
|
||||
control: false,
|
||||
table: { type: { summary: 'ReactNode' } }
|
||||
table: { type: { summary: 'ReactNode' } },
|
||||
},
|
||||
children: {
|
||||
description: 'Form content rendered inside the responsive grid.',
|
||||
control: false,
|
||||
table: { type: { summary: 'ReactNode' } }
|
||||
table: { type: { summary: 'ReactNode' } },
|
||||
},
|
||||
className: {
|
||||
description: 'Extra CSS classes for the root container.',
|
||||
control: 'text',
|
||||
table: { type: { summary: 'string' } }
|
||||
}
|
||||
table: { type: { summary: 'string' } },
|
||||
},
|
||||
},
|
||||
args: {
|
||||
title: 'Post details'
|
||||
}
|
||||
title: 'Post details',
|
||||
},
|
||||
} satisfies Meta<typeof Form>;
|
||||
|
||||
export default meta;
|
||||
@@ -56,13 +57,13 @@ export const Basic: Story = {
|
||||
value="draft"
|
||||
choices={[
|
||||
{ id: 'draft', label: 'Draft' },
|
||||
{ id: 'published', label: 'Published' }
|
||||
{ id: 'published', label: 'Published' },
|
||||
]}
|
||||
/>
|
||||
<InputField label="Slug" type="text" value="a-short-post-title" />
|
||||
</>
|
||||
)
|
||||
}
|
||||
),
|
||||
},
|
||||
};
|
||||
|
||||
export const WithActions: Story = {
|
||||
@@ -71,10 +72,7 @@ export const WithActions: Story = {
|
||||
const [status, setStatus] = useState('draft');
|
||||
|
||||
return (
|
||||
<Form
|
||||
{...args}
|
||||
titleBarRight={<Button type="solid" size="sm" label="Save" />}
|
||||
>
|
||||
<Form {...args} titleBarRight={<Button type="solid" size="sm" label="Save" />}>
|
||||
<div className="col-span-2">
|
||||
<InputField
|
||||
label="Title"
|
||||
@@ -91,11 +89,11 @@ export const WithActions: Story = {
|
||||
choices={[
|
||||
{ id: 'draft', label: 'Draft' },
|
||||
{ id: 'review', label: 'In review' },
|
||||
{ id: 'published', label: 'Published' }
|
||||
{ id: 'published', label: 'Published' },
|
||||
]}
|
||||
/>
|
||||
<InputField label="Slug" type="text" value="storybook-powered-cms" />
|
||||
</Form>
|
||||
);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user