11import React from "react" ;
2- import { Meta , Story } from "@storybook/react" ;
2+ import { Meta , StoryFn } from "@storybook/react" ;
33
44import {
55 Button ,
@@ -21,7 +21,7 @@ export default {
2121 argTypes : { } ,
2222} as Meta < typeof VisualTour > ;
2323
24- const Template : Story < typeof VisualTour > = ( args : VisualTourProps ) => {
24+ const Template : StoryFn < typeof VisualTour > = ( args : VisualTourProps ) => {
2525 const [ closed , setClosed ] = React . useState < boolean > ( true ) ;
2626
2727 return (
@@ -38,6 +38,13 @@ const Template: Story<typeof VisualTour> = (args: VisualTourProps) => {
3838 </ Button >
3939 </ ToolbarSection >
4040 </ Toolbar >
41+ < div id = "actionC" style = { { margin : "1rem" , padding : "1rem" , border : "dotted 1px lightgray" } } >
42+ Some other element for the tour.
43+ </ div >
44+ < div style = { { height : "100vh" } } />
45+ < div id = "actionD" style = { { margin : "1rem" , padding : "1rem" , border : "dotted 1px lightgray" } } >
46+ Another element for the tour, not visible at first.
47+ </ div >
4148 { ! closed ? < VisualTour { ...args } onClose = { ( ) => setClosed ( true ) } /> : null }
4249 </ div >
4350 ) ;
@@ -68,11 +75,26 @@ const defaultArgs: VisualTourProps = {
6875 ) ,
6976 } ,
7077 {
71- title : "Highlight elements " ,
78+ title : "Highlight element A " ,
7279 content :
7380 "It's possible to highlight specific elements on a page. The step content is then displayed in a kind of tooltip instead of a modal." ,
7481 highlightElementQuery : "#actionA" ,
7582 } ,
83+ {
84+ title : "Highlight element B" ,
85+ content : "Context overlay for another highlighted element." ,
86+ highlightElementQuery : "#actionB" ,
87+ } ,
88+ {
89+ title : "Highlight element C" ,
90+ content : "Element outside tour container." ,
91+ highlightElementQuery : "#actionC" ,
92+ } ,
93+ {
94+ title : "Highlight element D" ,
95+ content : "Element not visible at first." ,
96+ highlightElementQuery : "#actionD" ,
97+ } ,
7698 ] ,
7799 onClose : ( ) => { } ,
78100} ;
0 commit comments