mrlib-ui
Version:
Modern React UI component library with TypeScript, Tailwind CSS, and multi-language support
344 lines (253 loc) ⢠8.04 kB
Markdown
# ā” mrlib - Modern React UI Library
A UI component library designed to create modern, lightweight and clean React applications.
## ⨠Features
- ā” **Fast Development**: Optimized build process with Vite
- šØ **Modern Design**: Modern interface inspired by clean and minimal design principles
- š± **Responsive**: Perfect appearance on all devices
- š§ **TypeScript**: Type safety and enhanced developer experience
- š”ļø **Modern Tools**: ESLint, Prettier and other development tools
- š **Ready Components**: UI components and hooks you can start coding with immediately
- š **Dark Mode**: Full Tailwind CSS compatible dark mode support
- š **Multi-language**: Turkish and English language support
## š Quick Start
### Requirements
- Node.js 18+
- npm or yarn
### Installation
```bash
# Clone the project
git clone <repository-url>
cd mrlib
# Install dependencies
npm install
# Start development server
npm run dev
```
Open [http://localhost:3009](http://localhost:3009) in your browser.
## š Project Structure
```
src/
āāā components/ # UI components
ā āāā ui/ # Basic UI components
ā ā āāā Button.tsx
ā ā āāā Card.tsx
ā ā āāā Input.tsx
ā ā āāā Modal.tsx
ā ā āāā Toast.tsx
ā ā āāā Tooltip.tsx
ā ā āāā Select.tsx
ā ā āāā Checkbox.tsx
ā ā āāā Radio.tsx
ā ā āāā Switch.tsx
ā ā āāā Slider.tsx
ā ā āāā Progress.tsx
ā ā āāā Badge.tsx
ā ā āāā Avatar.tsx
ā ā āāā Container.tsx
ā ā āāā Divider.tsx
ā ā āāā Spacer.tsx
ā ā āāā Tabs.tsx
ā ā āāā Accordion.tsx
ā ā āāā DatePicker.tsx
ā ā āāā Table.tsx
ā ā āāā List.tsx
ā ā āāā Textarea.tsx
ā ā āāā Alert.tsx
ā ā āāā Skeleton.tsx
ā ā āāā Drawer.tsx
ā ā āāā Breadcrumb.tsx
ā ā āāā FileUpload.tsx
ā ā āāā Dropdown.tsx
ā āāā Header.tsx
ā āāā Hero.tsx
ā āāā Features.tsx
ā āāā Footer.tsx
āāā contexts/ # React Contexts
ā āāā ThemeContext.tsx
ā āāā ToastContext.tsx
ā āāā LanguageContext.tsx
āāā hooks/ # Custom hooks
ā āāā useToggle.ts
ā āāā useDebounce.ts
ā āāā useLocalStorage.ts
ā āāā useResponsive.ts
ā āāā useClipboard.ts
ā āāā useScrollPosition.ts
ā āāā useMediaQuery.ts
ā āāā index.ts
āāā utils/ # Helper functions
ā āāā cn.ts
ā āāā format.ts
ā āāā validation.ts
ā āāā index.ts
āāā types/ # TypeScript type definitions
ā āāā index.ts
āāā pages/ # Page components
ā āāā Documentation.tsx
ā āāā Examples.tsx
āāā App.tsx
āāā main.tsx
āāā index.css
āāā index.ts
```
## šØ Design System
### Color Palette
Color palette inspired by modern and clean design language:
- **Primary**: Modern Blue (#007AFF)
- **Success**: Modern Green (#34C759)
- **Warning**: Modern Orange (#FF9500)
- **Error**: Modern Red (#FF3B30)
- **Gray Scale**: Modern Gray (50-900)
- **Dark Mode**: Premium dark gray tones for sophisticated dark theme
- **Premium Palettes**: Gold, Silver, Platinum, Rose Gold, Emerald, Sapphire, Amethyst, Ruby, Topaz, Pearl, Onyx (50-900 shades)
### Typography
- **Font Family**: SF Pro Display/Text (Apple's system font)
- **Font Sizes**: Responsive and consistent typography scales
### Components
#### Button
```tsx
import { Button } from '@/components/ui/Button'
// Basic usage
<Button variant="primary" size="md">
Click
</Button>
// Loading state
<Button loading={true}>
Loading...
</Button>
// Different variants
<Button variant="secondary">Secondary</Button>
<Button variant="ghost">Ghost</Button>
<Button variant="destructive">Destructive</Button>
```
#### Card
```tsx
import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/Card'
<Card>
<CardHeader>
<CardTitle>Title</CardTitle>
</CardHeader>
<CardContent>
Content goes here
</CardContent>
</Card>
```
#### Input
```tsx
import { Input } from '@/components/ui/Input'
<Input
label="Email"
type="email"
placeholder="email@example.com"
error="Please enter a valid email"
/>
```
#### Modal
```tsx
import { Modal } from '@/components/ui/Modal'
<Modal
isOpen={isOpen}
onClose={() => setIsOpen(false)}
title="Modal Title"
>
Modal content goes here
</Modal>
```
## šŖ Custom Hooks
### useToggle
To toggle boolean state:
```tsx
import { useToggle } from '@/hooks'
const [isOpen, toggle, setIsOpen] = useToggle(false)
```
### useDebounce
To delay a value by specified time:
```tsx
import { useDebounce } from '@/hooks'
const debouncedValue = useDebounce(searchTerm, 300)
```
### useLocalStorage
For state synchronized with LocalStorage:
```tsx
import { useLocalStorage } from '@/hooks'
const [theme, setTheme] = useLocalStorage('theme', 'light')
```
### useResponsive
To track screen size:
```tsx
import { useResponsive } from '@/hooks'
const { isMobile, isTablet, isDesktop } = useResponsive()
```
### useClipboard
For clipboard operations:
```tsx
import { useClipboard } from '@/hooks'
const { copy, copied } = useClipboard()
```
## š Dark Mode
Dark mode support is fully integrated with Tailwind CSS:
```tsx
import { useTheme } from '@/contexts/ThemeContext'
const { theme, setTheme } = useTheme()
// Change theme
setTheme('dark') // 'light' | 'dark' | 'system'
```
## š Multi-language Support
Turkish and English language support:
```tsx
import { useLanguage } from '@/contexts/LanguageContext'
const { language, setLanguage, t } = useLanguage()
// Use translations
const title = t('nav.home') // 'Ana Sayfa' or 'Home'
```
## š ļø Development
### Commands
```bash
# Development server
npm run dev
# Production build
npm run build
# Type checking
npm run type-check
# Linting
npm run lint
# Preview
npm run preview
```
### Configuration
- **Vite**: Modern build tool and dev server
- **TypeScript**: Type safety
- **Tailwind CSS**: Utility-first CSS framework
- **ESLint**: Code linting
- **PostCSS**: CSS processing
- **Framer Motion**: Animations
- **Zod**: Schema validation
## š¦ Packaging
To use this starter kit in your own project:
```bash
# Build
npm run build
# Ready files will be created in dist folder
```
## š¤ Contributing
1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Create a Pull Request
## š License
This project is licensed under the MIT License.
## š Acknowledgments
- [React](https://react.dev/) - UI library
- [Vite](https://vitejs.dev/) - Build tool
- [Tailwind CSS](https://tailwindcss.com/) - CSS framework
- [Lucide React](https://lucide.dev/) - Icon library
- [Framer Motion](https://www.framer.com/motion/) - Animation library
- [Zod](https://zod.dev/) - Schema validation
- Modern design principles - Design inspiration
---
**Note**: This starter kit is created inspired by modern design principles.
## š Documentation
Visit [http://localhost:3009/docs](http://localhost:3009/docs) for detailed documentation.
## šÆ Examples
Visit [http://localhost:3009/examples](http://localhost:3009/examples) for live examples.