import React from "react"; import { ComponentStory, ComponentMeta } from "@storybook/react"; import { SunIcon } from "@radix-ui/react-icons"; import cx from "classnames"; import Popover from "../components/Popover"; export default { title: "Example/Popover", component: Popover, } as ComponentMeta; const Template: ComponentStory = (args) => ( ); const items = [ { id: "width", label: "Width", defaultValue: "100%", }, { id: "max-width", label: "Max. width", defaultValue: "300px", }, { id: "height", label: "Height", defaultValue: "25px", }, { id: "max-height", label: "Max. height", defaultValue: "none", }, ]; export const Primary = Template.bind({}); Primary.args = { trigger: ( ), contentAlignment: "start", arrowClassName: "fill-current text-white dark:text-gray-800", contentClassName: cx( "w-48 rounded-lg p-4 shadow-md md:w-56", "bg-white dark:bg-gray-800" ), content: ( <>

Dimensions

{items.map(({ id, label, defaultValue }) => { return (
); })}
), closeButtonClassName: cx( "absolute top-3.5 right-3.5 inline-flex items-center justify-center rounded-full p-1", "focus:outline-none focus-visible:ring focus-visible:ring-purple-500 focus-visible:ring-opacity-75" ), }; export const Secondary = Template.bind({}); Secondary.args = { trigger: (

This h1 tag is also a trigger

), arrowClassName: "fill-current text-white dark:text-gray-800", contentClassName: cx( "w-48 rounded-lg p-4 shadow-md md:w-56", "bg-sky-400 dark:bg-purple-800" ), content: (

any kind of content

in here

), closeButtonClassName: cx( "absolute top-3.5 right-3.5 inline-flex items-center justify-center rounded-full p-1", "focus:outline-none focus-visible:ring focus-visible:ring-purple-500 focus-visible:ring-opacity-75" ), closeButtonColor: "text-green-500", };