import React from "react"; import { loremIpsum } from "react-lorem-ipsum"; import { OverlaysProvider } from "@blueprintjs/core"; import { Meta, StoryFn } from "@storybook/react"; import { fn } from "storybook/test"; import { helpersArgTypes } from "../../../.storybook/helpers"; import { Tooltip } from "../../index"; export default { title: "Components/Tooltip", component: Tooltip, argTypes: { intent: { ...helpersArgTypes.exampleIntent, options: ["UNDEFINED", "primary", "accent", "success", "warning", "danger"], }, }, } as Meta; let forcedUpdateKey = 0; // @see https://github.com/storybookjs/storybook/issues/13375#issuecomment-1291011856 const Template: StoryFn = (args) => ( ); const testContent = loremIpsum({ p: 1, avgSentencesPerParagraph: 2, random: false, }).toString(); /** * Do not use empty `() => {}` functions as handler values. * This is basically an `undefined` but Storybook is currently not able to display this correctly. * @see https://github.com/storybookjs/storybook/issues/22930#issuecomment-1579741485 * */ export const Default = Template.bind({}); Default.args = { children: "hover me", content: testContent, addIndicator: true, onOpening: fn(), }; export const MarkdownSupport = Template.bind({}); MarkdownSupport.args = { ...Default.args, content: "### This is a headline" + "\n\n```\nblockcode\n" + testContent + "\n```\n\n" + testContent + " `" + testContent + "`", };