import { useState } from 'react'; import { MoonIcon, NumberCircleOneIcon, NumberCircleTwoIcon, SunIcon, } from '@phosphor-icons/react'; import type { Meta, StoryObj } from '@storybook/react-vite'; import { action } from 'storybook/actions'; import { useToggle } from '@/mastodon/hooks/useToggle'; import { Button } from '../button/redesign'; import { ToggleField } from '../form_fields/redesign'; import { Icon } from '../icon'; import type { DropdownProps } from './redesign'; import { Dropdown, DropdownItem, DropdownItemButton, DropdownPopover, } from './redesign'; const meta = { title: 'Redesign/Dropdown', args: { elevation: 1, }, argTypes: { elevation: { control: 'inline-radio', options: [1, 2], }, }, } satisfies Meta, 'children'>>; export default meta; type Story = StoryObj; const handleMenuItemClick = action('menu item click'); export const Simple: Story = { render(args) { return ( First item Second item ); }, }; export const Popover: Story = { render(args) { const [ref, setRef] = useState(null); const [open, { onToggle, onFalse }] = useToggle(); return (
First item Second item
); }, }; export const Controls: Story = { render(args) { const [sun, { onToggle }] = useToggle(); return ( First item
{sun ? ( ) : ( )}
); }, };