import React, { useState } from 'react' import { type Meta, type StoryObj } from '@storybook/react-vite' import { DocsTemplate } from '../../../.storybook' import GuidedTour from './GuidedTour' import Button from '../Button/Button' import EmptyState from '../EmptyState/EmptyState' import Icon from '../Icons/Icon' import Tag from '../Tag/Tag' import { toast } from '../Toast/Toast' const meta: Meta = { title: 'Components/GuidedTour', component: GuidedTour, parameters: { design: { type: 'figma', url: 'https://www.figma.com/design/RvhKD82948FMQnh5MyCi0o/Web-Design-System?node-id=121-606&t=jsd8kEmb1sJfCa2m-0', }, docs: { page: () => ( The GuidedTour component is a user onboarding tool designed to introduce new features or guide users through the application's interface. It provides step-by-step instructions and interactive prompts to help users understand the functionality and features effectively. The GuidedTour enhances user engagement, reduces the learning curve, and ensures a smooth onboarding experience for new users. } infoBullets={[ Use the GuidedTour component to introduce new features or changes to existing functionality, ensuring users are aware of recent updates. , ]} /> ), }, }, } export default meta type Story = StoryObj const Template: Story = { render: function Render(args) { const [show, setShow] = useState(false) const close = () => { setShow(false) } return (
Page Header
Here is some content that will not have a Guided tour associated with it.
Some text to display{' '} Pay Attention
Some text to display{' '}
Here is some content that will not have a Guided tour associated with it. Just a block of text here.
Here is some content that will not have a Guided tour associated with it. Just a block of text here.
Here is some content that will not have a Guided tour associated with it. Just a block of text here.
Second element to demo.
) }, } const steps = [ { header: 'Attention Tag', body: 'This tag is the first element on the tour. We want to point it out because Tags are cool.', selector: '.guided-tour__tag', }, { header: 'Line of Text', body: 'This is the text for the 2nd step. This is the text for the 2nd step. This is the text for the 2nd step. This is the text for the 2nd step. This is the text for the 2nd step. This is the text for the 2nd step.', selector: '.guided-tour__second-step', }, { header: 'Informational Icon', body: 'This is the text for the info icon step on this tour. We will have some great stuff to say.', selector: '.guided-tour__info-icon', }, { header: 'Some User Action', body: (
This is the text for the 4th step. This is the text for the 4th step. This is the text for the 4th step. This is the text for the 4th step.
), selector: '.guided-tour__maleUser-icon', }, { header: 'Empty State', body: 'This is the text the EmptyState component. We want to explain why this would be here.', selector: '.guided-tour__empty-state', }, ] export const Basic: Story = { ...Template, args: { stepHeaderText: 'New Feature', steps: steps, }, } export const WithNextClickHandler: Story = { ...Template, args: { stepHeaderText: 'New Feature', nextButtonCallout: (currentStep) => toast({ message: `Navigating to step ${currentStep + 1}`, type: 'info', }), steps: steps, }, }