import { action } from 'storybook/actions'; import Button from '../button'; import { Position } from '../common'; import Popover from './Popover'; import { Meta, StoryObj } from '@storybook/react-webpack5'; type Story = StoryObj; const Content = () => ( <> You’ll get this rate as long as we receive your 10 EUR within the next 51 hours.
Test 1
Test 2
Test 3
); export default { component: Popover, title: 'Dialogs/Popover', args: { preferredPlacement: Position.BOTTOM, title: 'Guaranteed rate', content: , children: ( ), }, argTypes: { preferredPlacement: { control: 'select', options: [Position.TOP, Position.RIGHT, Position.BOTTOM, Position.LEFT], }, }, } satisfies Meta; export const Basic: Story = {}; /** * While it might be easier for sighted users to associate the content * of a `Popover` with the surrounding and trigger content, it's likely * much harder for people relying on the assistive-tech. * * For that reason, the `Popover` must always have an accessible name — * if `title` prop is set, the component will use it automatically, * otherwise `aria-label` must be provided instead. * * **NB:** If both props are provided, then screen readers will prioritise * `aria-label` over `title`. */ export const WithoutVisibleTitle: Story = { args: { preferredPlacement: Position.BOTTOM, title: undefined, 'aria-label': 'Guaranteed rate', content: , children: ( ), }, } satisfies Meta;