import React from 'react'; import type { Meta, StoryObj } from '@storybook/react-vite'; import { Button } from '../Button/Button'; import { Stack } from '../Stack/Stack'; import { Popover } from './Popover'; import { PopoverOverlay } from './PopoverOverlay'; import { PopoverTrigger } from './PopoverTrigger'; const meta: Meta = { title: 'UI kit/Popover', component: Popover, subcomponents: { 'Popover.Trigger': PopoverTrigger, 'Popover.Overlay': PopoverOverlay, }, tags: ['autodocs'], argTypes: { onOpenChange: { control: { disable: true } }, }, }; export default meta; type Story = StoryObj; const decorators: Story['decorators'] = [ Story => (
), ]; export const Default: Story = { args: {}, render: args => ( {({ props }) => } Popover content ), decorators, }; export const WithPadding: Story = { args: {}, render: args => ( {({ props }) => } Popover content with padding ), decorators, }; export const Elevation: Story = { args: {}, render: args => ( {({ props }) => } Low elevation {({ props }) => } Medium elevation {({ props }) => } High elevation ), decorators, }; export const TopPlacement: Story = { args: {}, render: args => ( {({ props }) => } I appear on top ), decorators, }; export const WithInteractiveContent: Story = { args: {}, render: args => ( {({ props }) => } {({ state }) => ( )} ), decorators, }; export const ControlledAndOpenByDefault: Story = { args: {}, render: args => { const [isOpen, setIsOpen] = React.useState(true); return ( {({ props }) => } This popover is open by default ); }, decorators, };