import type { Meta, StoryObj } from "@storybook/react" import React from "react" import { Button } from "../../action/button" import { Tooltip } from "./Tooltip" /** * A tooltip component that displays additional information on hover. * * ## Props * - `content`: ReactNode - The content to display in the tooltip (required) * - `delayDuration`: number - Delay before showing the tooltip (default: 700) * - `side`: "top" | "right" | "bottom" | "left" (default: "top") * - `sideOffset`: number - Distance from the trigger element (default: 5) * - `align`: "start" | "center" | "end" (default: "center") * - `alignOffset`: number - Offset from the alignment edge (default: 0) * - `open`: boolean - Controlled open state * - `defaultOpen`: boolean - Default open state * - `width`: string - Width of the tooltip * - `minWidth`: string - Minimum width of the tooltip * - `maxWidth`: string - Maximum width of the tooltip */ const meta = { title: "base/communication/Tooltip", component: Tooltip, tags: ["autodocs"], args: { content: "This is a tooltip", }, parameters: { layout: "centered", }, } satisfies Meta export default meta type Story = StoryObj /** * Basic tooltip with default settings. */ export const Default: Story = { render: () => ( ), } /** * Tooltip with different content types. */ export const ContentTypes: Story = { render: () => (
), } /** * Tooltip with different positions. */ export const Positions: Story = { render: () => (
), } /** * Tooltip with different alignments. */ export const Alignments: Story = { render: () => (
), } /** * Tooltip with different delay durations. */ export const DelayDurations: Story = { render: () => (
), } /** * Tooltip with different trigger elements. */ export const TriggerElements: Story = { render: () => (
Link
â„šī¸
), } /** * Tooltip with custom styling. */ export const CustomStyling: Story = { render: () => (
), } /** * Tooltip with offset adjustments. */ export const WithOffsets: Story = { render: () => (
), } /** * Tooltip with width constraints. */ export const WidthConstraints: Story = { render: () => (
), } /** * Tooltip with controlled state. */ export const Controlled: Story = { render: () => { const [open, setOpen] = React.useState(false) return (
) }, }