Files
metabuilder/hooks
johndoe6345789 78a54228df feat(hooks): Create centralized hooks npm package
- Added @metabuilder/hooks workspace package at root
- Consolidated 30 React hooks from across codebase into single module
- Implemented conditional exports for tree-shaking support
- Added comprehensive package.json with build/lint/typecheck scripts
- Created README.md documenting hook categories and usage patterns
- Updated root package.json workspaces array to include hooks
- Supports multi-version peer dependencies (React 18/19, Redux 8/9)

Usage:
  import { useDashboardLogic } from '@metabuilder/hooks'
  import { useLoginLogic } from '@metabuilder/hooks/useLoginLogic'

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-01-23 19:17:17 +00:00
..

React Hooks Collection

This folder contains all custom React hooks from across the MetaBuilder codebase, consolidated for easy discovery and reuse.

Hooks by Category

Authentication

  • useLoginLogic.ts - Login form logic and state
  • useRegisterLogic.ts - Registration form logic and state
  • usePasswordValidation.ts - Password validation rules and feedback
  • useAuthForm.ts - Generic authentication form handling

Dashboard & UI

  • useDashboardLogic.ts - Dashboard state and layout management
  • useResponsiveSidebar.ts - Responsive sidebar state
  • useHeaderLogic.ts - Header navigation and state
  • useProjectSidebarLogic.ts - Project sidebar logic

Storage & Data

  • useStorageDataHandlers.ts - Data storage operations
  • useStorageSettingsHandlers.ts - Settings storage handlers
  • useStorageSwitchHandlers.ts - Storage mode switching

Design Tools

  • useFaviconDesigner.ts - Favicon design functionality
  • useDragResize.ts - Drag and resize interactions

Development & Build

  • use-github-build-status.ts - GitHub build status monitoring

Utilities

  • I18nNavigation.ts - Internationalization navigation
  • ToastContext.tsx - Toast notification context

Store & Redux

  • hooks.ts - Redux store hooks
  • index.ts - Hook exports

Usage

To use a hook, import it directly:

import { useDashboardLogic } from '@/hooks/useDashboardLogic'

Or configure your build tool to alias the hooks folder:

{
  "compilerOptions": {
    "paths": {
      "@hooks/*": ["./hooks/*"]
    }
  }
}

Then use:

import { useLoginLogic } from '@hooks/useLoginLogic'

Adding New Hooks

When creating new hooks, add them here for centralized management:

  1. Create the hook in its feature directory
  2. Export it from that location
  3. Copy it to this folder for centralized discovery

Source Locations

Hooks are sourced from:

  • workflowui/src/hooks/
  • codegen/src/hooks/
  • codegen/src/components/ (component-specific hooks)
  • redux/hooks-*/src/
  • redux/hooks/src/
  • pastebin/src/store/
  • fakemui/react/components/ (component utilities)