import type { Meta, StoryObj } from '@storybook/nextjs' import { fn } from 'storybook/test' import { useState } from 'react' import DrawerPlus from '.' const meta = { title: 'Base/Feedback/DrawerPlus', component: DrawerPlus, parameters: { layout: 'fullscreen', docs: { description: { component: 'Enhanced drawer built atop the base drawer component. Provides header/foot slots, mask control, and mobile breakpoints.', }, }, }, tags: ['autodocs'], } satisfies Meta export default meta type Story = StoryObj type DrawerPlusProps = React.ComponentProps const storyBodyElement: React.JSX.Element = (

DrawerPlus allows rich content with sticky header/footer and responsive masking on mobile. Great for editing flows or showing execution logs.

Body content scrolls if it exceeds the allotted height.
) const DrawerPlusDemo = (props: Partial) => { const [open, setOpen] = useState(false) const { body, title, foot, isShow: _isShow, onHide: _onHide, ...rest } = props const resolvedBody: React.JSX.Element = body ?? storyBodyElement return (
} isShow={open} onHide={() => setOpen(false)} title={title ?? 'Workflow execution details'} body={resolvedBody} foot={foot} />
) } export const Playground: Story = { render: args => , args: { isShow: false, onHide: fn(), title: 'Edit configuration', body: storyBodyElement, }, } export const WithFooter: Story = { render: (args) => { const FooterDemo = () => { const [open, setOpen] = useState(false) return (
setOpen(false)} title={args.title ?? 'Workflow execution details'} body={args.body ?? (

Populate the body with scrollable content. Footer stays pinned.

)} foot={
} />
) } return }, args: { isShow: false, onHide: fn(), title: 'Edit configuration!', body: storyBodyElement, }, }