import { Story } from '@storybook/react'; import React from 'react'; import Tooltip from '../components/Tooltip/Tooltip'; const meta = { title: 'Components / Tooltip', component: Tooltip, parameters: { controls: { expanded: true }, }, }; export default meta; // callback: () => void; // focusCb?: () => void; // blurCb?: () => void; // position: 'bottom' | 'left' | 'right' | 'top'; // showQuestion?: boolean; // showInfo?: boolean; // theme: string; // themeTooltip: string; // themeWrapper?: string; // width: string; // showOnHover?: boolean; // buttonComponent?: React.ReactNode; // iconColor?: string; const Template: Story = (args) => (
); export const Default = Template.bind({}); Default.args = { id: 'MyTooltip', title: 'Hover over this', content:

And you'll see this

, callback: () => console.log('clicked tooltip'), focusCb: () => console.log('focused on tooltip'), blurCb: () => console.log('blurred the tooltip'), }; export const Question = Template.bind({}); Question.args = { id: 'MyTooltip', title: 'Hover over this', content:

And you'll see this

, callback: () => console.log('clicked tooltip'), focusCb: () => console.log('focused on tooltip'), blurCb: () => console.log('blurred the tooltip'), showQuestion: true, }; export const Info = Template.bind({}); Info.args = { id: 'MyTooltip', title: 'Hover over this', content:

And you'll see this

, callback: () => console.log('clicked tooltip'), focusCb: () => console.log('focused on tooltip'), blurCb: () => console.log('blurred the tooltip'), showInfo: true, }; export const Position = Template.bind({}); Position.args = { id: 'MyTooltip', title: 'New In box', content: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', position: 'left', showQuestion: true, }; export const ClickOnly = Template.bind({}); ClickOnly.args = { id: 'MyTooltip', title: 'Hover over this', content:

And you'll see this

, showOnHover: false, }; export const Width = Template.bind({}); Width.args = { id: 'MyTooltip', title: 'Hover over this', content:

And you'll see this

, width: 'w-48', }; export const Theme = Template.bind({}); Theme.args = { id: 'MyTooltip', title: 'Hover over this', content:

And you'll see this

, theme: 'bg-red-500', }; export const WrapperTheme = Template.bind({}); WrapperTheme.args = { id: 'MyTooltip', title: 'Hover over this', content:

And you'll see this

, themeWrapper: 'bg-red-500', }; export const TooltipTheme = Template.bind({}); TooltipTheme.args = { id: 'MyTooltip', title: 'Hover over this', content:

And you'll see this

, themeTooltip: 'bg-red-500', };