@dnb/eufemia
Version:
DNB Eufemia Design System UI Library
36 lines (35 loc) • 1.69 kB
TypeScript
/**
* Web StepIndicator Context
*
*/
import React from 'react';
import { ContextProps } from '../../shared/Context';
import { StepIndicatorData, StepIndicatorMode, StepIndicatorProps } from './StepIndicator';
import { StepIndicatorItemProps } from './StepIndicatorItem';
export type StepIndicatorContextValues = StepIndicatorProviderProps & StepIndicatorProviderStates & ContextProps;
declare const StepIndicatorContext: React.Context<StepIndicatorContextValues>;
export default StepIndicatorContext;
export type StepIndicatorProviderProps = Omit<StepIndicatorProps, 'mode' | 'data' | 'sidebar_id' | 'step_title_extended'> & {
/**
* <em>(required)</em> defines the data/steps showing up in a JavaScript Array or JSON format like `[{title,is_current}]`. See parameters and the example above.
*/
data?: StepIndicatorData;
/**
* <em>(required)</em> 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;
};
export type StepIndicatorProviderStates = {
data: (string | StepIndicatorItemProps)[];
activeStep: number;
openState: 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;