import type { Meta, StoryObj } from '@storybook/react' import { SvgCog, SvgBrowserWebsite1, SvgCreditCard1, } from '@chainlink/blocks-icons' import { SvgUserSingleNeutral, SvgLogout, SvgMailSend } from '../../icons' import { Button } from '../Button' import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTag, DropdownMenuTrigger, } from './DropdownMenu' const meta = { title: 'Blocks/DropdownMenu', component: DropdownMenu, decorators: [ (Story) => (
), ], } satisfies Meta export default meta type Story = StoryObj export const Default: Story = { render: (_args) => ( My Account Profile Shift Cmd P Billing Cmd B Settings Cmd S Status Success ), } export const WithCheckboxes: Story = { render: (_args) => ( Notification Preferences Push notifications Marketing emails Product updates ), parameters: { docs: { description: { story: 'Use checkbox items for menu-scoped preferences that can be toggled without leaving the menu.', }, }, }, } export const WithIcons: Story = { render: (_args) => ( Profile Settings Website Billing NEW Support Log out ), parameters: { docs: { description: { story: 'Add icons when menu items need stronger visual scanning or are part of a larger action set.', }, }, }, } export const DefaultOpen: Story = { render: (_args, context) => { const openProp = context.viewMode === 'story' ? { defaultOpen: true } : {} return ( My Account Profile Shift Cmd P Billing Cmd B Settings Cmd S Status Success ) }, } export const SimpleMenu: Story = { render: (_args, context) => { const openProp = context.viewMode === 'story' ? { defaultOpen: true } : {} return ( Edit Copy Delete ) }, } export const WithSubMenu: Story = { render: (_args, context) => { const openProp = context.viewMode === 'story' ? { defaultOpen: true } : {} return ( Share Export PDF CSV JSON Print ) }, parameters: { docs: { description: { story: 'Use submenus for secondary actions that would otherwise make the primary menu too dense.', }, }, }, } export const DisabledStates: Story = { render: (_args, context) => { const openProp = context.viewMode === 'story' ? { defaultOpen: true } : {} return ( Enabled Item Disabled Item Group Item 1 Group Item 2 (Disabled) Another Enabled Item ) }, parameters: { docs: { description: { story: 'Use disabled menu items when an action exists but is temporarily unavailable.', }, }, }, }