import React from "react"; import { Meta, StoryFn } from "@storybook/react"; import { Button, Icon, OverflowText, OverviewItem, OverviewItemDepiction, OverviewItemDescription, OverviewItemLine, Toolbar, ToolbarSection, VisualTour, VisualTourProps, } from "../../../../index"; import stepDefinitionsEn from "./defaultTour"; export default { title: "Components/VisualTour", component: VisualTour, argTypes: {}, } as Meta; const Template: StoryFn = (args: VisualTourProps) => { const [isOpen, setIsOpen] = React.useState(); return (
Some text
Some other element for the tour.
Another element for the tour, not visible at first.
setIsOpen(false)} isOpen={typeof isOpen !== "undefined" ? isOpen : args.isOpen} />
); }; const stepDefinitions = stepDefinitionsEn; export const Default = Template.bind({}); const defaultArgs: VisualTourProps = { steps: [ { ...stepDefinitions.firstStep, }, { ...stepDefinitions.customContent, content: () => { const texts = stepDefinitions.customContent.texts; return ( {texts.firstLine} {texts.secondLine} ); }, }, { ...stepDefinitions.highlightElementA, highlightElementQuery: "#actionA", }, { ...stepDefinitions.highlightElementB, highlightElementQuery: "#actionB", }, { ...stepDefinitions.highlightElementLeft, highlightElementQuery: "#textSection", }, { ...stepDefinitions.highlightElementC, highlightElementQuery: "#actionC", }, { ...stepDefinitions.highlightElementD, highlightElementQuery: "#actionD", }, ], onClose: () => {}, isOpen: false, }; Default.args = defaultArgs;