import { type ComponentProps, type ReactNode } from 'react'; /** * Unstyled Carbon `ProgressIndicator` / `ProgressStep`, the behaviour of the styled ProgressIndicator * without a single class (the rules of ``): an ordered list of steps — before * `currentIndex` complete, at it current, after it incomplete (a step's own `complete` wins). With * `interactive` a click on a step's `StepButton` jumps to it (`onChange`); the current and disabled * steps don't react, and without `interactive` the buttons stay out of the Tab order. * * Each direct child of `Root` is one step, by position, so a wrapper component around a `Step` works. * * State shows as data attributes to style on, on `Step` and `StepButton`: one of `data-complete`, * `data-current` or `data-incomplete`, and `data-invalid`, `data-disabled`, `data-clickable` (the * button jumps on a click); `data-orientation` (`horizontal` / `vertical`) on all three parts. * * ```tsx * …}> * * Draft * * * Review * * * ``` */ export type StepState = 'complete' | 'current' | 'incomplete'; /** The state of the step at `index` (Carbon): its own `complete`, else before / at / after the current index. */ export declare function stepState(index: number, currentIndex: number, complete?: boolean): StepState; export interface RootProps extends Omit, 'onChange' | 'children'> { /** The current step's index (controlled). */ currentIndex?: number; defaultCurrentIndex?: number; /** After the user jumps to another step. */ onChange?: (index: number) => void; vertical?: boolean; /** The user can jump between steps. */ interactive?: boolean; /** The steps, one per direct child. */ children: ReactNode; } interface ProgressIndicatorContextValue { currentIndex: number; vertical: boolean; interactive: boolean; /** Makes the step at `index` the current one and reports it. */ pick: (index: number) => void; } /** The state of the enclosing `ProgressIndicator.Root` (current index, vertical, interactive). */ export declare function useProgressIndicatorContext(part?: string): ProgressIndicatorContextValue; export declare function Root({ currentIndex, defaultCurrentIndex, onChange, vertical, interactive, children, ...rest }: Readonly): import("react").JSX.Element; export interface StepProps extends ComponentProps<'li'> { /** Done regardless of `currentIndex`. */ complete?: boolean; invalid?: boolean; /** Shown, but the button can't be focused or clicked. */ disabled?: boolean; } interface StepContextValue { index: number; state: StepState; invalid: boolean; disabled: boolean; vertical: boolean; interactive: boolean; /** A click jumps here: interactive, not disabled, not the current step. */ clickable: boolean; pick: (index: number) => void; } /** The state of the enclosing `ProgressIndicator.Step` (index, state, invalid, disabled, clickable …). */ export declare function useStepContext(part?: string): StepContextValue; /** One step (`
  • `): its state from its position and the current index, for its `StepButton`. */ export declare function Step({ complete, invalid, disabled, children, ...rest }: Readonly): import("react").JSX.Element; /** * The step's button: `aria-current="step"` on the current one, out of the Tab order when disabled * or not interactive; a click jumps to the step when it is clickable. */ export declare function StepButton(props: Readonly, 'type'>>): import("react").JSX.Element; export {};