import type { Meta, StoryObj } from "@storybook/react-vite" // Usage: preserved native label fixtures do not define a new-screen exception. Use public Label // for supported fields (docs/components/label.md §5); copy only actions requested by the screen. import { Button, Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, Input } from "@hm-design/ui" import { STORY_KICKER, StoryPage, StoryPageHeader, StorySection } from "@/components/story-page" // Drawer is a modal vaul overlay (Portal). The representative Story opens the real Drawer from its triggers; drag the handle or // the panel down to dismiss. The same cases start open in the verification Stories. vaul owns the drag, Radix the focus and ARIA. const longText = "긴 내용은 Body 영역만 세로로 scroll 하고 Header와 Footer는 그대로 보입니다. " function Frame({ trigger, defaultOpen, title, description, children, actions, }: { trigger: string defaultOpen?: boolean title: string description?: string children: React.ReactNode actions?: React.ReactNode }) { return ( {title} {description ? {description} : null} {children} {actions} ) } const actions = ( <> ) function Basic({ defaultOpen }: { defaultOpen?: boolean }) { return (

짧은 내용은 내용 높이만큼만 차지합니다.

) } function FormCase({ defaultOpen }: { defaultOpen?: boolean }) { return (
) } function LongCase({ defaultOpen }: { defaultOpen?: boolean }) { return ( {Array.from({ length: 30 }, (_, i) => (

{longText}

))} ) } const meta = { title: "Components/Overlay/Drawer", component: Drawer, parameters: { layout: "centered" } } satisfies Meta export default meta type Story = StoryObj export const All: Story = { name: "Drawer", parameters: { layout: "fullscreen", controls: { disable: true } }, render: () => (
), } export const Open: Story = { tags: ["verification"], render: () => } export const Form: Story = { tags: ["verification"], render: () => } export const LongContent: Story = { tags: ["verification"], name: "Long Content", render: () => }