platform-codebase/@packages/@providers/wizard-provider/src/index.ts

70 lines
1.9 KiB
TypeScript
Executable file

/**
* @lilith/wizard-provider
*
* Reusable multi-step wizard/onboarding system following Tier 1 Provider Pattern.
* Enables declarative step configuration with validation, persistence,
* conditional logic, and progress tracking.
*
* @example
* ```tsx
* import { WizardProvider, WizardContainer, useWizard } from '@lilith/wizard-provider';
*
* const steps = [
* { id: 'basics', title: 'Basics', component: BasicStep },
* { id: 'details', title: 'Details', component: DetailsStep },
* ];
*
* function App() {
* return (
* <WizardProvider wizardId="onboarding" steps={steps}>
* <WizardContainer />
* </WizardProvider>
* );
* }
* ```
*/
// Types - export all type definitions
export type {
// Core types
ValidationResult,
StepProps,
WizardStep,
WizardConfig,
WizardState,
WizardStorageData,
WizardContextValue,
WizardAction,
WizardEvent,
// Hook return types
UseWizardStepReturn,
UseWizardValidationReturn,
UseWizardProgressReturn,
// Component prop types
WizardProviderProps,
WizardContainerProps,
WizardProgressProps,
WizardNavigationProps,
WizardStepRendererProps,
} from './types';
// Provider & Context
export { WizardProvider, WizardContext } from './WizardProvider';
// Primary Hook
export { useWizard } from './useWizard';
// Specialized Hooks
export { useWizardStep } from './hooks/useWizardStep';
export { useWizardValidation } from './hooks/useWizardValidation';
export { useWizardProgress } from './hooks/useWizardProgress';
// UI Components
export { WizardContainer } from './components/WizardContainer';
export { WizardProgress } from './components/WizardProgress';
export { WizardNavigation } from './components/WizardNavigation';
export { WizardStepRenderer } from './components/WizardStepRenderer';
// Utilities
export { wizardStorage } from './wizard-storage';
export { wizardEvents } from './wizard-events';