/**
 * @erpforce/common - ERP Common UI Library
 * 
 * This is the main entry point for the @erpforce/common library.
 * It exports only stable functionality that doesn't require peer dependencies.
 * 
 * For full functionality, install the required peer dependencies:
 * @see https://www.npmjs.com/package/@erpforce/common#peer-dependencies
 */

// ===== CORE EXPORTS (No external dependencies) =====

/**
 * Library Configuration System
 * Provides configuration management for application-specific business logic
 */
export {
  configureLibrary,
  getLibraryConfig,
  getConfigFunction,
  type LibraryConfig
} from './config';

/**
 * Static Assets
 * Pre-bundled images and icons that work without external dependencies
 */
export { default as images } from './assets/images';

/**
 * Constants
 * Basic constants and configuration values
 */
export { DEFAULT_LANG, LANGUAGES } from './constants/all-language';
export { S3_BUCKET_URL } from './constants/common';
export { modules } from './constants';

// ===== TYPE EXPORTS =====

/**
 * Core TypeScript type definitions
 * These types are available for use in consuming applications
 */
export type {
  // Base component interfaces
  BaseComponentProps,
  ThemeConfig,
  ERPUIProviderProps,
  
  // Data interfaces
  SelectOption,
  TableColumn,
  PaginationProps,
  FormField,
  ApiResponse,
  Language,
  
  // Context interfaces
  LanguageContextType,
  AuthContextType,
  PageContextType,
  PermissionContextType,
  
  // User and permission interfaces
  User,
  Permission,
  
  // Redux integration interfaces
  LibraryReduxSlices,
  ReduxIntegration
} from './types';

/**
 * Additional commonly used types from contexts
 * Exported for convenience when working with page state and views
 */
export type {
  PageState,
  ViewType,
  SavedViewType,
  GeneratedColumnsState
} from './contexts';

// ===== OPTIONAL EXPORTS (Require peer dependencies) =====

/**
 * IMPORTANT: The following exports require peer dependencies to be installed.
 * 
 * To use components, hooks, contexts, theme, and utilities, install:
 * 
 * Required peer dependencies:
 * - react (>=18.0.0)
 * - react-dom (>=18.0.0)
 * - @mui/material (>=5.0.0)
 * - @mui/icons-material (>=5.0.0)
 * - @emotion/react (>=11.0.0)
 * - @emotion/styled (>=11.0.0)
 * 
 * Optional peer dependencies (for specific features):
 * - react-redux (>=8.0.0) - for Redux integration
 * - @reduxjs/toolkit (>=1.9.0) - for Redux store management
 * - react-router-dom (>=6.0.0) - for routing utilities
 * - react-i18next (>=12.0.0) - for internationalization
 * - dayjs (>=1.11.0) - for date utilities
 * - lodash (>=4.17.0) - for utility functions
 * - axios (>=1.0.0) - for API utilities
 * - notistack (>=3.0.0) - for notifications
 * - socket.io-client (>=4.0.0) - for real-time features
 * - moment-timezone (>=0.5.0) - for timezone handling
 * - libphonenumber-js (>=1.10.0) - for phone validation
 * - yup (>=1.0.0) - for form validation
 * - material-react-table (>=1.0.0) - for advanced tables
 * - react-querybuilder (>=6.0.0) - for query building
 * 
 * Installation example:
 * ```bash
 * npm install @mui/material @mui/icons-material @emotion/react @emotion/styled
 * npm install react-redux @reduxjs/toolkit react-router-dom react-i18next
 * npm install dayjs lodash axios notistack
 * ```
 * 
 * After installing peer dependencies, you can import:
 * 
 * Components:
 * ```typescript
 * import { Button, TextField, DataGrid } from '@erpforce/common/components';
 * ```
 * 
 * Hooks:
 * ```typescript
 * import { useAuth, useLanguage, usePermissions } from '@erpforce/common/hooks';
 * ```
 * 
 * Contexts:
 * ```typescript
 * import { AuthProvider, LanguageProvider } from '@erpforce/common/contexts';
 * ```
 * 
 * Theme:
 * ```typescript
 * import { createLightTheme, createDarkTheme } from '@erpforce/common/theme';
 * ```
 * 
 * Utilities:
 * ```typescript
 * import { formatDate, validateEmail } from '@erpforce/common/utils';
 * ```
 * 
 * Redux:
 * ```typescript
 * import { createStore, slices } from '@erpforce/common/redux';
 * ```
 * 
 * API Clients:
 * ```typescript
 * import { AccountingAPI, InventoryAPI } from '@erpforce/common/api-client';
 * ```
 * 
 * Note: Direct barrel exports (export * from './components') are intentionally
 * disabled to prevent dependency resolution errors. Use specific imports instead.
 */

// Component and feature exports (require peer dependencies)
export * from './components';
export * from './hooks';
export * from './contexts';
export * from './theme';
export * from './utils';
export * from './redux';
export * from './api-client';
export * from './layout';

/**
 * Views
 * Ready-to-use views and page templates including:
 * - Template Editor (Email/PDF editor with WYSIWYG capabilities)
 * 
 * Usage:
 * ```typescript
 * import { 
 *   Templates, 
 *   AddTemplate, 
 *   templateEditorRoutes,
 *   SectionFlowEditor,
 *   type ElementType,
 *   type SectionData 
 * } from '@erpforce/common/views';
 * ```
 */
export * from './views';

export { enqueueSnackbar, closeSnackbar } from 'notistack';