import type { Meta, StoryObj } from "@storybook/react" import { Button } from "../../action/button" import { DropdownMenu } from "./DropdownMenu" /** * A dropdown menu component that appears on click. * * ## Props * - `Root`: Container for the dropdown menu * - `Trigger`: Element that triggers the dropdown menu * - `Content`: The dropdown menu content * - `Item`: Individual menu item * - `Label`: Section label * - `Separator`: Visual separator * - `Sub`: Submenu container * - `SubTrigger`: Submenu trigger * - `SubContent`: Submenu content * - `CheckboxItem`: Checkbox menu item * - `RadioGroup`: Radio group container * - `RadioItem`: Radio menu item */ const meta = { title: "base/selection/DropdownMenu", component: DropdownMenu.Root, tags: ["autodocs"], parameters: { layout: "centered", }, } satisfies Meta export default meta type Story = StoryObj /** * Basic dropdown menu with default settings. */ export const Default: Story = { render: () => ( Profile Settings Help Logout ), } /** * Dropdown menu with different item types. */ export const ItemTypes: Story = { render: () => ( Regular Item Disabled Item Checkbox Item Unchecked Item Option 1 Option 2 Option 3 ), } /** * Dropdown menu with submenus. */ export const WithSubmenus: Story = { render: () => ( File Edit View Zoom In Zoom Out Reset Zoom Tools Settings Preferences Advanced Developer Tools Console Help ), } /** * Dropdown menu with labels and separators. */ export const WithLabels: Story = { render: () => ( Account Profile Settings Billing Actions New Project Import Export Preferences Notifications Auto-save Dark Mode ), } /** * Dropdown menu with keyboard shortcuts. */ export const WithShortcuts: Story = { render: () => ( New File
⌘N
Open File
⌘O
Save
⌘S
Undo
⌘Z
Redo
⌘⇧Z
Find
⌘F
Replace
⌘H
), } /** * Dropdown menu with icons. */ export const WithIcons: Story = { render: () => ( 📄 New File 📁 Open File 💾 Save 💾💾 Save As 📤 Export 📥 Import ⚙️ Settings ❓ Help ), } /** * Dropdown menu with radio groups. */ export const RadioGroups: Story = { render: () => ( Theme Light Dark Auto Language English Spanish French German Font Size Small Medium Large ), }