import React from 'react'; export type StepperOrientation = 'horizontal' | 'vertical'; export type StepperStepStatus = 'incomplete' | 'complete' | 'error'; export interface StepperProps extends React.HTMLAttributes { /** * Names the list. Defaults to "Progress"; give it the task's name when a page * carries more than one — "Checkout progress". */ label?: string; /** * `horizontal` for a page-width header above the form, `vertical` for a side * rail. Below 40rem a horizontal stepper hides every label but the current * one, so it does not need a second variant for mobile. */ orientation?: StepperOrientation; /** `StepperStep` elements, first step first. */ children?: React.ReactNode; /** * Every string the steps read out, for translation. English by default. * Given once here rather than on each step. */ labels?: StepperLabels; } /** What each step reads after its label. Numbers arrive formatted for the locale. */ export interface StepperLabels { /** Read before each label — "Step 2 of 4: ". Keep the separator. */ position?: (step: string, total: string) => string; /** "Not started". */ incomplete?: string; /** "Completed". */ complete?: string; /** "Has errors". */ error?: string; /** "Current step". */ current?: string; /** The current step when it has errors — "Current step, has errors". */ currentError?: string; } export interface StepperStepProps extends Omit, 'onClick'> { /** The step's name, in the user's language. */ children?: React.ReactNode; /** A short second line — what the step asks for, or a summary of the answer. */ description?: React.ReactNode; /** * Whether the step's answers have been accepted. Orthogonal to `isCurrent`: * a user who goes Back to step 1 is on a step that is both current and * complete. */ status?: StepperStepStatus; /** The step the user is on. Marked `aria-current="step"`. */ isCurrent?: boolean; /** * Makes a visited step a link back to it. Ignored on the current step and on * `incomplete` steps — see the component's comment for why. */ href?: string; /** As `href`, for a wizard that changes step without a route. */ onPress?: () => void; } /** * Stepper — where the user is in a task that has an order. * * WHY NOT TABS * * The `tablist` role announces peers that can be visited in any order, which is * the opposite of a wizard. This is an ordered list: the steps are a sequence, * and `ol` says so. Nothing here is a tab, and arrow keys do nothing. * * POSITION AND STATUS ARE TEXT, NOT ONLY DRAWING * * Every step renders "Step 2 of 5" and its status as visually hidden text. The * number in the circle is for the eye; a screen reader cannot be relied on to * announce list position, and a coloured ring carries nothing in forced-colours * mode. The complete and error glyphs also differ in SHAPE — a check and an * exclamation — so the states survive greyscale, which WCAG 1.4.1 requires. * * ONLY VISITED STEPS ARE LINKS * * `href` / `onPress` are honoured on `complete` and `error` steps that are not * current. An `incomplete` step renders as text even when given one, because * jumping forward past unanswered steps is exactly what a wizard exists to * prevent — and a link that is there but should not be followed is worse than * no link. The current step is text for the same reason Breadcrumb's is: a link * to where you already are is a dead control. * * IT DOES NOT ANNOUNCE STEP CHANGES * * The Wizard pattern moves focus to the new step's heading, which announces it. * A live region here as well would say the same thing twice, on every step. */ export declare const Stepper: React.ForwardRefExoticComponent>; export declare const StepperStep: React.ForwardRefExoticComponent>; //# sourceMappingURL=Stepper.d.ts.map