import type { Meta, StoryObj } from "@storybook/react-vite" import { Button, Input, Popover, PopoverClose, PopoverContent, PopoverTrigger } from "@hm-design/ui" import { StateBoard, type BoardState } from "@/components/story-board" import { StoryPage, StoryPageHeader, StorySection } from "@/components/story-page" // Popover is a non-modal Radix overlay (Portal). The representative Story opens the real panels from their triggers; // the verification Story starts one open. Radix owns outside click / Escape close and focus return. function Info({ defaultOpen }: { defaultOpen?: boolean }) { return (

프로젝트 안내

일정과 담당자 정보를 현재 화면 위에서 확인합니다. 바깥을 누르거나 Esc를 누르면 닫힙니다.

) } function FormPanel() { return (
) } function Aligned({ align }: { align: "start" | "center" | "end" }) { return (

{`align="${align}"`}

) } const meta = { title: "Components/Overlay/Popover", component: Popover, parameters: { layout: "centered" } } satisfies Meta export default meta type Story = StoryObj // Representative-page layout (Storybook presentation only): equal columns on PC (iframe width 1000px and up), fewer below that // (200px minimum). Each specimen sits in its own single-column StateBoard (min larger than any column), so every subtitle and divider // has the width of its column; a section with fewer specimens than columns leaves the remaining columns empty. The trigger keeps its // own size (the wrapper div stretches, the inline-flex trigger does not). Overlays open in a portal, so this layout never affects them. function SpecimenGrid({ states, columns = 4 }: { states: BoardState[]; columns?: 4 | 5 }) { return (
{states.map((state) => ( {state.children}
}]} /> ))} ) } // Representative Story: Overview is merged into Variants (Basic is its first item); each align trigger sits in its own column. export const All: Story = { name: "Popover", parameters: { layout: "fullscreen", controls: { disable: true } }, render: () => ( }, { id: "align-start", label: "Align Start", children: }, { id: "align-center", label: "Align Center", children: }, { id: "align-end", label: "Align End", children: }, ]} /> }]} /> ), } export const Open: Story = { tags: ["verification"], parameters: { layout: "fullscreen" }, render: () => (
), }