import type { Meta, StoryObj } from '@storybook/react' import { SvgInformationCircle } from '@chainlink/blocks-icons' import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TooltipArrow, } from './Tooltip' const meta = { title: 'Blocks/Tooltip', component: Tooltip, subcomponents: { TooltipTrigger, TooltipContent, TooltipArrow, }, decorators: [ (Story) => ( ), ], argTypes: { delayDuration: { control: 'number', description: 'Duration from when the mouse enters the trigger until the tooltip opens.', table: { type: { summary: 'number' }, defaultValue: { summary: '700' }, }, }, }, args: { delayDuration: 700, }, } satisfies Meta export default meta type Story = StoryObj export const Default: Story = { render: (_args) => (
This is a helpful tooltip with useful information.
), } export const AllSides: Story = { render: (_args) => (
Tooltip on Left Tooltip on Top Tooltip on Bottom Tooltip on Right
), } export const AllAlignments: Story = { render: (_args) => (
Align End Align Center Align Start
), } export const NoArrow: Story = { render: (_args) => (
Tooltip without Arrow
), } export const CustomTrigger: Story = { render: (_args) => (
This tooltip has a custom button trigger
), parameters: { docs: { description: { story: 'Use asChild on TooltipTrigger when the hover or focus target should be an existing element.', }, }, }, } export const LongContent: Story = { render: (_args) => (
This is a longer tooltip that demonstrates how the component handles content that spans multiple lines and requires more space to display properly.
), parameters: { docs: { description: { story: 'Constrain long tooltip content with a max width so supplementary text wraps cleanly.', }, }, }, } export const WithDelay: Story = { render: (_args) => (
Instant tooltip (0ms delay) Slow tooltip (2s delay)
), parameters: { docs: { description: { story: 'Use delayDuration when the tooltip should appear faster or slower than the provider default.', }, }, }, }