npm package: @keypix/ui
Description: A premium React component library built with TypeScript, Tailwind CSS, and Atomic Design principles. The most comprehensive and beautiful UI library available.
Author: Keypix Technologies
Latest version: 1.0.1

# 🎨 Keypix UI

> **A premium React component library built with TypeScript and Atomic Design principles. The most comprehensive and beautiful UI library available.**

[![npm version](https://badge.fury.io/js/keypix-ui.svg)](https://badge.fury.io/js/keypix-ui)
[![bundle size](https://img.shields.io/bundlephobia/minzip/keypix-ui)](https://bundlephobia.com/result?p=keypix-ui)
[![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
[![License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)

<div align="center">

![Keypix UI Demo](https://keypix.uz/favicon.png)

**Lightweight • Accessible • Customizable • TypeScript • Zero Config**

[📖 Documentation](https://ui.keypix.uz/docs) • [🎨 Live Demo](#live-demo) • [🚀 Quick Start](#quick-start) • [💡 Examples](#examples)

</div>

## ✨ Features

- 🚀 **Ultra Lightweight** - Only 13.47 KB gzipped
- 🎯 **Zero Configuration** - Works out of the box
- ♿ **Accessible** - WCAG 2.1 AA compliant
- 🎨 **Beautiful Design** - Modern, clean aesthetics
- 🔧 **Fully Customizable** - CSS variables & themes
- 📱 **Responsive** - Mobile-first approach
- 🌙 **Dark Mode** - Built-in theme switching
- ⚡ **High Performance** - Optimized for speed
- 🔒 **Type Safe** - Full TypeScript support
- 🧩 **Atomic Design** - Scalable component architecture

## 📦 Installation

```bash
npm install keypix-ui
# or
yarn add keypix-ui
# or
pnpm add keypix-ui
```

## 🚀 Quick Start

### 1. Install the library

```bash
npm install keypix-ui
```

### 2. Import and use components

```tsx
import { Button, Input, Card, ThemeProvider } from 'keypix-ui'

function App() {
  return (
    <ThemeProvider>
      <div className="keypix-p-8">
        <Card>
          <CardHeader>
            <CardTitle>Welcome to Keypix UI</CardTitle>
          </CardHeader>
          <CardContent>
            <Input placeholder="Enter your name" />
            <Button>Get Started</Button>
          </CardContent>
        </Card>
      </div>
    </ThemeProvider>
  )
}
```

**That's it!** 🎉 No configuration needed. Styles are automatically injected.

## 🎯 Auto-Styling

Keypix UI automatically applies global styles when imported, including:

```css
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  font-family: 'Inter', sans-serif;
}

*:focus,
*:active {
  outline: none;
}

html,
body {
  height: 100%;
}
```

These styles provide a clean foundation for your application. The Inter font is automatically loaded from Google Fonts.

## 🎨 Live Demo

See all components in action with our interactive demo:

```bash
# Clone the repository
git clone https://github.com/keypix-tech/ui.git
cd keypix-ui

# Install dependencies
npm install

# Start the demo
npm run dev
```

Then open [http://localhost:5173](http://localhost:5173) in your browser to see the complete component showcase with:
- All button variants and states
- Form inputs with validation
- Badges and avatars
- Loading spinners
- Search bars and modals
- Data tables
- Theme switching (Light/Dark/System)
- Responsive design examples

## 🎨 Components

### Atoms
- [Button](./docs/components/button.md) - Versatile button with multiple variants
- [Input](./docs/components/input.md) - Form input with validation states
- [Badge](./docs/components/badge.md) - Status indicators and labels
- [Avatar](./docs/components/avatar.md) - User profile images
- [Spinner](./docs/components/spinner.md) - Loading indicators

### Molecules
- [SearchBar](./docs/components/search-bar.md) - Search input with actions
- [Alert](./docs/components/alert.md) - Notification messages
- [Modal](./docs/components/modal.md) - Overlay dialogs

### Organisms
- [Header](./docs/components/header.md) - Page navigation
- [DataTable](./docs/components/data-table.md) - Tabular data display

### Providers
- [ThemeProvider](./docs/components/theme-provider.md) - Theme management

## 💡 Examples

### Basic Button Usage

```tsx
import { Button } from 'keypix-ui'

// Different variants
<Button variant="default">Default</Button>
<Button variant="secondary">Secondary</Button>
<Button variant="destructive">Delete</Button>
<Button variant="outline">Outline</Button>
<Button variant="ghost">Ghost</Button>
<Button variant="link">Link</Button>

// Different sizes
<Button size="sm">Small</Button>
<Button size="md">Medium</Button>
<Button size="lg">Large</Button>

// With loading state
<Button loading>Processing...</Button>

// With icons
<Button leftIcon={<DownloadIcon />}>Download</Button>
```

### Form with Validation

```tsx
import { Input, Button, Card } from 'keypix-ui'

function ContactForm() {
  const [email, setEmail] = useState('')
  const [error, setError] = useState('')

  return (
    <Card>
      <CardHeader>
        <CardTitle>Contact Us</CardTitle>
      </CardHeader>
      <CardContent>
        <Input
          type="email"
          placeholder="Enter your email"
          value={email}
          onChange={(e) => setEmail(e.target.value)}
          error={!!error}
          helperText={error}
        />
        <Button 
          onClick={handleSubmit}
          loading={isSubmitting}
          disabled={!email}
        >
          Send Message
        </Button>
      </CardContent>
    </Card>
  )
}
```

### Theme Switching

```tsx
import { ThemeProvider, useTheme, Button } from 'keypix-ui'

function ThemeToggle() {
  const { theme, setTheme } = useTheme()

  return (
    <div className="keypix-flex keypix-gap-2">
      <Button 
        variant={theme === 'light' ? 'default' : 'outline'}
        onClick={() => setTheme('light')}
      >
        Light
      </Button>
      <Button 
        variant={theme === 'dark' ? 'default' : 'outline'}
        onClick={() => setTheme('dark')}
      >
        Dark
      </Button>
      <Button 
        variant={theme === 'system' ? 'default' : 'outline'}
        onClick={() => setTheme('system')}
      >
        System
      </Button>
    </div>
  )
}

function App() {
  return (
    <ThemeProvider defaultTheme="system">
      <ThemeToggle />
      {/* Your app content */}
    </ThemeProvider>
  )
}
```

## 🎨 Customization

### CSS Variables

Keypix UI uses CSS variables for easy customization:

```css
:root {
  --primary: 221.2 83.2% 53.3%;
  --primary-foreground: 210 40% 98%;
  --secondary: 210 40% 96%;
  --secondary-foreground: 222.2 84% 4.9%;
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  --border: 214.3 31.8% 91.4%;
  --radius: 0.5rem;
}

.dark {
  --background: 222.2 84% 4.9%;
  --foreground: 210 40% 98%;
  /* ... other dark theme variables */
}
```

### Custom Theme

```tsx
import { ThemeProvider } from 'keypix-ui'

function App() {
  return (
    <ThemeProvider 
      defaultTheme="dark"
      storageKey="my-app-theme"
    >
      {/* Your app */}
    </ThemeProvider>
  )
}
```

### Component Styling

```tsx
// Using className prop
<Button className="keypix-bg-red-500 hover:keypix-bg-red-600">
  Custom Button
</Button>

// Using CSS variables
<Button style={{ '--primary': '220 13% 91%' }}>
  Custom Primary
</Button>
```

## 📱 Responsive Design

All components are mobile-first and responsive:

```tsx
// Responsive grid
<div className="keypix-grid keypix-grid-cols-1 md:keypix-grid-cols-2 lg:keypix-grid-cols-3 keypix-gap-4">
  <Card>Card 1</Card>
  <Card>Card 2</Card>
  <Card>Card 3</Card>
</div>

// Responsive spacing
<div className="keypix-p-4 md:keypix-p-6 lg:keypix-p-8">
  Content with responsive padding
</div>
```

## ♿ Accessibility

Keypix UI is built with accessibility in mind:

- **WCAG 2.1 AA compliant**
- **Keyboard navigation** support
- **Screen reader** friendly
- **High contrast** mode support
- **Reduced motion** preferences
- **ARIA attributes** on all components

```tsx
// Accessible button with proper labels
<Button 
  aria-label="Download file"
  aria-describedby="download-description"
>
  Download
</Button>
<div id="download-description" className="keypix-sr-only">
  Downloads the current file in PDF format
</div>
```

## 🔧 API Reference

### Button

```tsx
interface ButtonProps {
  variant?: 'default' | 'secondary' | 'destructive' | 'outline' | 'ghost' | 'link' | 'success' | 'warning' | 'info'
  size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'icon'
  loading?: boolean
  loadingText?: string
  leftIcon?: React.ReactNode
  rightIcon?: React.ReactNode
  fullWidth?: boolean
  disabled?: boolean
  ariaLabel?: string
  ariaDescription?: string
  ariaLive?: 'off' | 'polite' | 'assertive'
}
```

### Input

```tsx
interface InputProps {
  label?: string
  helperText?: string
  error?: boolean
  required?: boolean
  leftIcon?: React.ReactNode
  rightIcon?: React.ReactNode
  // ... all standard input props
}
```

[📖 Full API Documentation](./docs/api.md)

## 🧪 Testing

```tsx
import { render, screen } from '@testing-library/react'
import { Button } from 'keypix-ui'

test('renders button with text', () => {
  render(<Button>Click me</Button>)
  expect(screen.getByRole('button', { name: /click me/i })).toBeInTheDocument()
})

test('handles click events', () => {
  const handleClick = jest.fn()
  render(<Button onClick={handleClick}>Click me</Button>)
  
  fireEvent.click(screen.getByRole('button'))
  expect(handleClick).toHaveBeenCalledTimes(1)
})
```

## 📊 Performance

- **Bundle Size**: 13.47 KB gzipped
- **Loading Time**: 264ms on slow 3G
- **Runtime**: 94ms on Snapdragon 410
- **Tree Shaking**: Fully supported
- **Code Splitting**: Automatic

## 🛠️ Development

### Prerequisites

- Node.js 18+
- npm/yarn/pnpm

### Setup

```bash
git clone https://github.com/keypix-tech/ui.git
cd keypix-ui
npm install
```

### Scripts

```bash
# Development
npm run dev          # Start development server with demo

# Building
npm run build        # Build library
npm run build:clean  # Clean build

# Testing
npm run test         # Run tests
npm run test:watch   # Watch mode
npm run test:coverage # Coverage report

# Quality
npm run lint         # ESLint
npm run type-check   # TypeScript check
npm run size         # Bundle size analysis
```

### Contributing

1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests
5. Submit a pull request

[📋 Contributing Guidelines](./CONTRIBUTING.md)

## 📈 Roadmap

- [ ] **More Components**
  - [ ] DataGrid
  - [ ] DatePicker
  - [ ] MultiSelect
  - [ ] FileUpload
  - [ ] RichTextEditor

- [ ] **Enhanced Features**
  - [ ] Animation library
  - [ ] Form validation
  - [ ] Internationalization
  - [ ] Server-side rendering

- [ ] **Developer Experience**
  - [ ] CLI tool
  - [ ] VS Code extension
  - [ ] Figma plugin
  - [ ] Design tokens

- [ ] **Documentation**
  - [ ] Interactive playground
  - [ ] Video tutorials
  - [ ] Migration guides
  - [ ] Best practices

## 🤝 Community

- [📖 Documentation](https://ui.keypix.uz/docs)
- [🎨 Live Demo](#live-demo)
- [🐛 Issues](https://github.com/keypix-tech/ui/issues)
- [💬 Discussions](https://github.com/keypix-tech/ui/discussions)
- [📧 Email](mailto:keypixteam@gmail.com)

## 📄 License

MIT License - see the [LICENSE](LICENSE) file for details.

## 🙏 Acknowledgments

- [Tailwind CSS](https://tailwindcss.com/) for the utility-first approach
- [shadcn/ui](https://ui.shadcn.com/) for inspiration
- [Radix UI](https://www.radix-ui.com/) for accessibility patterns
- [React](https://reactjs.org/) for the amazing framework

---

<div align="center">

**Made with ❤️ by [Keypix Team](https://keypix.uz)**

[Website](https://ui.keypix.uz) • [GitHub](https://github.com/keypix-tech/ui) • [Twitter](https://twitter.com/keypixtech)

</div>