@dnb/eufemia
Version:
DNB Eufemia Design System UI Library
36 lines (35 loc) • 1.6 kB
TypeScript
/**
* Web StepIndicator Context
*
*/
import React from 'react';
import type { ContextProps } from '../../shared/Context';
import type { StepIndicatorData, StepIndicatorMode, StepIndicatorProps } from './StepIndicator';
import type { StepIndicatorItemProps } from './StepIndicatorItem';
type StepIndicatorContextValues = StepIndicatorProviderProps & StepIndicatorProviderStates & ContextProps;
declare const StepIndicatorContext: React.Context<StepIndicatorContextValues>;
export default StepIndicatorContext;
export type StepIndicatorProviderProps = Omit<StepIndicatorProps, 'mode' | 'data'> & {
/**
* Defines the data/steps showing up in a JavaScript Array or JSON format like `[{title,isCurrent}]`. See parameters and the example above.
*/
data?: StepIndicatorData;
/**
* Defines how the StepIndicator should work. Use `static` for non-interactive steps. Use `strict` for a chronological step order, also, the user can navigate between visited steps. Use `loose` if the user should be able to navigate freely.
*/
mode?: StepIndicatorMode;
children: React.ReactNode;
};
type StepIndicatorProviderStates = {
data: (string | StepIndicatorItemProps)[];
activeStep: number;
open: boolean;
listOfReachedSteps: number[];
countSteps: number;
stepsLabel: string;
filterAttributes: string[];
setActiveStep: React.Dispatch<React.SetStateAction<number>>;
openHandler: () => void;
closeHandler: () => void;
};
export declare function StepIndicatorProvider(props: StepIndicatorProviderProps): import("react/jsx-runtime").JSX.Element;