import type { ReactNode } from "react" import type { Meta, StoryObj } from "@storybook/react-vite" import { NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, } from "@hm-design/ui" import { StateBoard } from "@/components/story-board" import { StoryPage, StoryPageHeader, StorySection } from "@/components/story-page" // Navigation Menu is for destinations (links), not commands. The representative Story opens the real menus with hover, click or // keyboard; the same specimens also exist as Stories tagged `verification` (hidden from the sidebar). Title + description children // inside a content link are marked with `data-description` for the secondary text. function Destination({ href, title, description, active }: { href: string; title: string; description?: string; active?: boolean }) { return ( {title} {description ? {description} : null} ) } function Specimen({ viewport = true }: { viewport?: boolean }) { return ( 제품
자료
회사 문의 준비 중
{viewport ? : null}
) } // Size specimens to their review area (including the panel's 8px padding + 1px border on each side). // Mobile uses the content's natural minimum width instead of a fixed desktop specimen width. const frame = (node: ReactNode) => (
{node}
) const meta = { title: "Components/Navigation/Navigation Menu", component: NavigationMenu, parameters: { layout: "padded" } } satisfies Meta export default meta type Story = StoryObj export const All: Story = { name: "Navigation Menu", parameters: { layout: "fullscreen", controls: { disable: true } }, render: () => ( ) }, ]} /> ) }, ]} /> ), } export const Default: Story = { tags: ["verification"], render: () => frame() } export const NoViewport: Story = { tags: ["verification"], name: "No Viewport", render: () => frame() } // Three enabled triggers with different widths exercise first / middle / last offsets in both positioning modes. export const IndicatorAlignment: Story = { tags: ["verification"], render: () => ( ({ id: viewport ? "viewport" : "no-viewport", label: `Indicator alignment · viewport=${viewport}`, children: frame( {["제품", "기술 자료", "지원 센터"].map((label) => ( {label} ))} {viewport ? : null} ), }))} /> ), }