import React from 'react'; import type { ReactNode } from 'react'; import type { DefaultProps } from '../../types'; export interface StepperProps extends DefaultProps { active?: number; steps: Array; bottomLabel?: boolean; orientation?: 'horizontal' | 'vertical'; /** * Frees the steps from `active`: none is completed or blocked by its * position alone, each one carries its own `completed` and `disabled`. * Required for free navigation — a linear stepper blocks every step * after `active`, so clicking ahead does nothing. * @optional */ nonLinear?: boolean; /** * Called with the index of the clicked step. It only turns the steps into * buttons alongside `nonLinear` — on its own the stepper stays the * read-only trail it has always been, so a handler injected by tooling * (Storybook auto-actions, a spread of props) cannot make it clickable. * @optional */ onStepClick?: (index: number) => void; } type TStep = { label: JSX.Element | string; icon?: JSX.Element | ((active?: boolean) => JSX.Element); /** * Overrides the completion the stepper would infer from `active`, and is * the only source of it under `nonLinear`. * @optional */ completed?: boolean; /** * Blocks the step: greyed out, and unreachable by mouse or keyboard when * `onStepClick` is set. * @optional */ disabled?: boolean; /** * Secondary line under the label — a percentage, a count. It lands inside * the label, so it also names the step for screen readers: `'45%'` reads * as part of the button. Inline content only. * @optional */ caption?: ReactNode; }; declare const Stepper: ({ active, bottomLabel, steps, padding, margin, nonLinear, onStepClick, style, ...otherProps }: StepperProps) => React.JSX.Element; export default Stepper;