import type { Meta, StoryObj } from "@storybook/react" import React from "react" import { Button } from "../../action/button" import { Popover } from "./Popover" /** * A popover component that displays content in a floating panel. * * ## Props * - `Root`: Container for the popover * - `Trigger`: Element that triggers the popover * - `Content`: The popover content * - `Close`: Close button for the popover */ const meta = { title: "base/components/Popover", component: Popover.Root, tags: ["autodocs"], parameters: { layout: "centered", }, } satisfies Meta export default meta type Story = StoryObj /** * Basic popover with default settings. */ export const Default: Story = { render: () => (

Popover Title

This is the content of the popover. You can put any content here.

), } /** * Popover with different content types. */ export const ContentTypes: Story = { render: () => (

Information

This popover contains informational content with a longer description.

Contact Form

Options

  • Option 1
  • Option 2
  • Option 3
  • Option 4
), } /** * Popover with different sizes. */ export const Sizes: Story = { render: () => (

Small popover content

Medium Popover

This is a medium-sized popover with more content.

Large Popover

This is a large popover with extensive content. It can contain multiple paragraphs, forms, or other complex content structures.

Additional information or context can be displayed here.

), } /** * Popover with different positions. */ export const Positions: Story = { render: () => (

Popover appears on top

Popover appears on right

Popover appears on bottom

Popover appears on left

), } /** * Popover with rich content. */ export const RichContent: Story = { render: () => (
U

User Profile

user@example.com

Name: John Doe
Role: Administrator
Status: Active
), } /** * Popover with controlled state. */ export const Controlled: Story = { render: () => { const [open, setOpen] = React.useState(false) return (

Controlled Popover

This popover is controlled by React state. The button text changes based on the open state.

) }, } /** * Popover with custom styling. */ export const CustomStyling: Story = { render: () => (

Custom Styled Popover

This popover has custom styling with a gradient background and white text.

), }