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 { STORY_KICKER, StoryPage, StoryPageHeader, StorySection } from "@/components/story-page"
// 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.
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).
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: () => (