import { useState } from "react"
import type { Meta, StoryObj } from "@storybook/react-vite"
import {
Button,
DropdownMenu,
DropdownMenuCheckboxItem,
DropdownMenuContent,
DropdownMenuGroup,
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuRadioGroup,
DropdownMenuRadioItem,
DropdownMenuSeparator,
DropdownMenuShortcut,
DropdownMenuSub,
DropdownMenuSubContent,
DropdownMenuSubTrigger,
DropdownMenuTrigger,
} from "@hm-design/ui"
import { StoryPage, StoryPageHeader, StorySection } from "@/components/story-page"
import { ContextMenuFull } from "./context-menu-examples"
// Dropdown Menu is a Radix overlay (Portal), so the representative Story is a trigger that opens the real menu, the same way as
// Dialog. The verification Story starts open. Radix owns keyboard navigation, focus return and Escape.
// The representative page also shows the Context Menu specimen from ./context-menu-examples, so "팝업 메뉴" is the one
// sidebar item for both; the Context Menu Stories keep their IDs and direct URLs but are hidden from the sidebar.
function Full({ defaultOpen }: { defaultOpen?: boolean }) {
const [showStatus, setShowStatus] = useState(true)
const [showPanel, setShowPanel] = useState(false)
const [position, setPosition] = useState("bottom")
return (
내 계정
프로필 ⇧⌘P
설정 ⌘,결제보기
상태 표시줄
패널
위치상단하단오른쪽더 보기이메일로 공유링크 복사로그아웃
)
}
const meta = { title: "Components/Overlay/Dropdown Menu", component: DropdownMenu, parameters: { layout: "centered" } } satisfies Meta
export default meta
type Story = StoryObj
// Representative Story: the trigger opens the full menu (item, disabled, separator, checkbox, radio group, sub menu, destructive);
// right click the Context Menu area to open the same kinds of items.
export const All: Story = {
name: "Dropdown Menu",
parameters: { layout: "fullscreen", controls: { disable: true } },
render: () => (
),
}
// Verification Story: the same menu starting open, hidden from the sidebar (tag `verification`).
export const Open: Story = {
tags: ["verification"],
parameters: { layout: "fullscreen" },
render: () => (