import { circleQuestion } from "@simplybusiness/icons"; import type { Meta, StoryObj } from "@storybook/react"; import { useState } from "react"; import type { PopoverProps } from ".."; import { Button, Flex, Icon, Modal, Popover } from ".."; import { excludeControls } from "../../utils"; import "./Popover.story.styles.css"; type StoryType = StoryObj; const meta: Meta = { title: "Components/Popover", component: Popover, argTypes: { ...excludeControls("trigger", "anchor", "children"), }, decorators: [Story => ], }; export const Default: StoryType = { render: (args: PopoverProps) => , args: { children: <>No way! Now I know everything I need to 🚀., trigger: , }, }; export const CustomTrigger: StoryType = { render: () => (
Occurrence Limit } > This is the maximum amount of money you'll get to cover a single incident that occurs during the policy period, regardless of when it's reported.
), }; export const NearBottomEdge: StoryType = { render: () => (
Open — flips to top}> Near the bottom edge: the popover flips above the trigger so it stays in the viewport.
), }; const InsideModalDemo = () => { const [open, setOpen] = useState(false); return ( <> setOpen(false)} closeLabel="Close"> Popover inside a modal

The popover must render above the modal backdrop. Click the trigger below.

Open popover}> Visible above the modal backdrop.
); }; export const InsideModal: StoryType = { render: () => , }; export default meta;