import { type Meta, type StoryObj } from '@storybook/react' import { Workflow } from '../' import { WorkflowControls } from './controls' const meta = { title: 'Pages/Workflow/Components/ProgressStepper', component: Workflow.ProgressStepper, argTypes: { currentStepId: WorkflowControls.currentStepId, }, args: { currentStepId: 'preview-step', steps: [ { label: 'Settings', id: 'settings-step' }, { label: 'Questions', id: 'questions-step' }, { label: 'Preview', id: 'preview-step' }, { label: 'Employees', id: 'employees-step' }, { label: 'Schedule', id: 'schedule-step' }, ], isComplete: false, }, } satisfies Meta export default meta type Story = StoryObj /** *

This component is used in the `Footer` to track progress of the Workflows steps.

*

It has no reverse variant and should only be used in the Worflow's `Footer` component.

*/ export const Playground: Story = { parameters: { docs: { canvas: { sourceState: 'shown', }, }, }, } /**

To ensure WCAG AA compliance, there are 3 visually destinct states.

*

These are reflected in their accessible names for screen reader: "Completed", "Current" and "Not started"

*/ export const ProgressStates: Story = { args: { currentStepId: 'questions-step', }, } /** *

You can use the `isComplete` follow a successful submission to render all steps as complete.

*/ export const AllStepsComplete: Story = { args: { currentStepId: 'schedule-step', isComplete: true, }, } export const FewerSteps: Story = { args: { currentStepId: 'questions-step', steps: [ { label: 'Settings', id: 'settings-step' }, { label: 'Questions', id: 'questions-step' }, { label: 'Preview', id: 'preview-step' }, ], }, } /** *

We have baked in a container query to ensure the component can be responsive.

*

When a step reaches its minimum size (4.5rem), it will hide the display name to maximise realestate.

*/ export const EightSteps: Story = { args: { currentStepId: 'questions-step', steps: [ ...meta.args.steps, { label: 'Plan', id: 'plan-step' }, { label: 'Provision', id: 'provision-step' }, { label: 'Procure', id: 'procure-step' }, ], }, }