import { Tooltip } from "./index"; import { DocsPage } from "@shared/stories/DocsTemplate"; import type { Meta, StoryObj } from "@storybook/react"; const meta: Meta = { title: "Components/Tooltip", component: Tooltip, tags: ["autodocs"], parameters: { layout: "centered", docs: { page: DocsPage, description: { component: "A tooltip component that displays additional information when hovering over an element.", }, }, }, argTypes: { tooltipMsg: { control: { type: "text" }, description: "Tooltip message to display", }, className: { control: { type: "text" }, description: "Additional CSS classes", }, children: { control: { type: "text" }, description: "Element that triggers the tooltip", }, }, args: { tooltipMsg: "This is a tooltip message", children: "Hover me", }, }; export default meta; type Story = StoryObj; // Default tooltip export const Default: Story = { args: {}, }; // With message export const WithMessage: Story = { args: { tooltipMsg: "This is a helpful tooltip message", children: "Hover to see tooltip", }, }; // With button export const WithButton: Story = { args: { tooltipMsg: "Click to submit the form", children: ( ), }, }; // With icon export const WithIcon: Story = { args: { tooltipMsg: "More information", children: ( i ), }, }; // With link export const WithLink: Story = { args: { tooltipMsg: "Visit our documentation", children: ( Learn more ), }, }; // Long message export const LongMessage: Story = { args: { tooltipMsg: "This is a longer tooltip message that demonstrates how the tooltip handles extended text content. It should wrap appropriately to remain readable.", children: "Hover for long message", }, }; // Different children export const DifferentChildren: Story = { render: () => (
Text ? Link
), parameters: { docs: { description: { story: "Tooltip with different types of children elements.", }, }, }, }; // Custom styling export const CustomStyling: Story = { args: { tooltipMsg: "Custom styled tooltip", className: "custom-tooltip", children: "Hover me", }, }; // Multiple tooltips export const Multiple: Story = { render: () => (
), parameters: { docs: { description: { story: "Multiple tooltips displayed together.", }, }, }, }; // All variants showcase export const AllVariants: Story = { render: () => (

With Text

Hover me

With Button

With Icon

i

Long Message

Hover for long message
), parameters: { docs: { description: { story: "Showcase of all tooltip variants and use cases.", }, }, }, };