import React from "react"; import { loremIpsum } from "react-lorem-ipsum"; import { Meta, StoryFn } from "@storybook/react"; import { helpersArgTypes } from "../../../../../.storybook/helpers"; import { EdgeLabel } from "../EdgeLabel"; import { Badge, Icon, IconButton, OverflowText } from "./../../../../components"; import canonicalIcons from "./../../../../components/Icon/canonicalIconNames"; export default { title: "Extensions/React Flow/Custom EdgeLabel", component: EdgeLabel, argTypes: { depiction: { control: "select", options: [...Object.keys(canonicalIcons)], }, actions: { control: "select", options: ["Not set", "Icon button", "Icon button small", "Info badge", "Icon badge"], mapping: { "Not set": undefined, "Icon button": alert("Click info")} />, "Icon button small": ( alert("Click info")} /> ), "Info badge": Info, "Icon badge": ( ), }, }, intent: { ...helpersArgTypes.exampleIntent, }, }, } as Meta; const Template: StoryFn = (args) => ; const labelText = loremIpsum({ p: 1, avgSentencesPerParagraph: 1, avgWordsPerSentence: 8, random: false }).toString(); export const Default = Template.bind({}); Default.args = { text: labelText, "data-testid": "storybook-testid", "data-test-id": "storybook-test-id", }; export const ReverseEllipsisLabel = Template.bind({}); ReverseEllipsisLabel.args = { text: {labelText}, title: labelText, };