npm package: @forge-shared/hooks-utils
Description: A collection of reusable React hooks and utility functions for modern web development
Author: MedOx
Latest version: 1.2.0

# forge-shared

A collection of reusable React hooks and utility functions for modern web development.

## Features

- 🎣 **React Hooks** - Custom hooks for common patterns
- 🛠️ **Utilities** - Helper functions for everyday tasks
- 📦 **Tree-shakeable** - Import only what you need
- 🔒 **Type-safe** - Full TypeScript support
- ✅ **Well-tested** - Comprehensive test coverage

## Installation

This package requires **Bun** (v1.1+) as the package manager.

```bash
bun install
```

## Usage

### Import Everything

```typescript
import { useBoolean, useDebounce, classes, cookies } from 'forge-shared';
```

### Import Specific Modules

```typescript
// Hooks only
import { useBoolean, useDebounce } from 'forge-shared/hooks';

// Utils only
import { classes, cookies } from 'forge-shared/utils';

// Specific hook
import { useBoolean } from 'forge-shared/hooks/use-boolean';

// Specific util
import { classes } from 'forge-shared/utils/classes';
```

## Available Hooks

- `use-back-to-top` - Scroll to top functionality
- `use-boolean` - Boolean state management
- `use-client-rect` - Get client rectangle dimensions
- `use-cookies` - Cookie management
- `use-copy-to-clipboard` - Copy text to clipboard
- `use-countdown-date` - Countdown to a specific date
- `use-countdown-seconds` - Countdown timer in seconds
- `use-debounce` - Debounce values
- `use-double-click` - Handle double click events
- `use-is-client` - Check if running on client
- `use-local-storage` - LocalStorage management
- `use-multi-select` - Multi-select state management
- `use-popover` - Popover state management
- `use-popover-hover` - Hover-based popover
- `use-scroll-offset-top` - Track scroll offset from top
- `use-set-state` - SetState-like hook
- `use-tabs` - Tab state management

## Available Utils

- `active-link` - Active link detection
- `classes` - CSS class name utilities
- `color` - Color manipulation utilities
- `cookies` - Cookie utilities
- `css-variables` - CSS variable utilities
- `font` - Font utilities
- `local-storage` - LocalStorage utilities
- `object` - Object manipulation utilities
- `refs` - Ref utilities
- `right-to-left` - RTL support utilities
- `transform-number` - Number transformation utilities
- `url` - URL utilities
- `uuidv4` - UUID v4 generation

## Development

### Prerequisites

- [Bun](https://bun.sh) v1.1.38 or higher
- Node.js (for npm publishing if needed)

### Setup

```bash
# Install dependencies
bun install
```

### Scripts

```bash
# Development (watch mode)
bun run dev

# Build
bun run build

# Run tests
bun run test

# Watch tests
bun run test:watch

# Lint
bun run lint

# Fix linting issues
bun run lint:fix

# Format code
bun run fm:fix

# Check formatting
bun run fm:check

# Type checking
bun run check-types

# Clean build artifacts
bun run clean

# Rebuild from scratch
bun run re:build

# Update dependencies
bun run check:update
```

## Project Structure

```
forge-shared/
├── src/
│   ├── hooks/          # React hooks
│   └── utils/          # Utility functions
├── dist/               # Build output
├── package.json
├── tsconfig.json
├── eslint.config.mjs
├── tsup.config.ts
└── vitest.config.ts
```

## Requirements

- React ^18.0.0 || ^19.0.0
- React DOM ^18.0.0 || ^19.0.0
- TypeScript ^5.0.0

## License

MIT © MedOx