import { AnyFunction, FCC } from 'onekijs-framework'; import React, { ReactNode } from 'react'; import { GridSize } from '../grid/typings'; import { ModalProps } from '../modal/typings'; import { TabProps, TabsProps, TabsState, TabState, TabTitleProps } from '../tab/typings'; import { WizardService } from './WizardService'; export type ControlledWizardProps = WizardProps & { controller: WizardService; }; export type StepProps = TabProps & { optional?: boolean; showTitle?: boolean; help?: ReactNode; onTouch?: () => void; }; export type FormStepProps = StepProps & { name: string; }; export type StepState = TabState & { optional: boolean; }; export type StepTitleProps = TabTitleProps & { index: number; TitleContentComponent?: React.FC; }; export type UseWizardController = (props: WizardProps) => WizardService; export type WizardModalProps = ModalProps & WizardProps; export type WizardProps = Omit< TabsProps, 'controller' | 'Component' | 'TitleComponent' > & { cancelLabel?: ReactNode; controller?: WizardService; Component?: FCC>; doneLabel?: ReactNode; reviewLabel?: ReactNode; forwardOnly?: boolean; inModal?: boolean; nextLabel?: ReactNode; previousLabel?: string; stepSize?: GridSize; onCancel?: AnyFunction; onDone?: AnyFunction; onNext?: (currentStep: M, nextStep: M) => boolean; onPrevious?: (currentStep: M, previousStep: M) => boolean; title?: ReactNode; TitleComponent?: React.FC; TitleContentComponent?: React.FC; hasSummaryStep?: boolean; }; export type WizardState = TabsState & Pick, 'onCancel' | 'onDone' | 'onNext' | 'onPrevious'> & { forwardOnly?: boolean; submitting?: boolean; };