|
| 1 | +<h1 align="center">🎨 react-ui-kit</h1> |
| 2 | + |
| 3 | +<p align="center"> |
| 4 | +Design system em <b>React + TypeScript</b> — componentes acessíveis, design tokens, dark mode e tree-shaking. |
| 5 | +</p> |
| 6 | + |
| 7 | +<p align="center"> |
| 8 | + <img src="https://img.shields.io/badge/React-20232A?style=flat&logo=react&logoColor=61DAFB"/> |
| 9 | + <img src="https://img.shields.io/badge/TypeScript-3178C6?style=flat&logo=typescript&logoColor=white"/> |
| 10 | + <img src="https://github.com/Samuelf27/react-ui-kit/actions/workflows/ci.yml/badge.svg"/> |
| 11 | + <img src="https://img.shields.io/badge/tests-8%20passing-34d399?style=flat"/> |
| 12 | + <img src="https://img.shields.io/badge/a11y-acessível-6f42c1?style=flat"/> |
| 13 | + <img src="https://img.shields.io/badge/license-MIT-green?style=flat"/> |
| 14 | +</p> |
| 15 | + |
| 16 | +<p align="center"> |
| 17 | + <a href="https://samuelf27.github.io/react-ui-kit/"><b>🔗 Documentação ao vivo</b></a> |
| 18 | +</p> |
| 19 | + |
| 20 | +--- |
| 21 | + |
| 22 | +## 📌 Sobre |
| 23 | + |
| 24 | +Uma **biblioteca de componentes** reutilizáveis — o tipo de infraestrutura de frontend que toda empresa de software mantém. Componentes acessíveis (ARIA, foco, labels), tematizáveis via **design tokens** (CSS variables) com **dark mode**, tipados em TypeScript e **tree-shakeable**. |
| 25 | + |
| 26 | +> A própria documentação é construída com os componentes da biblioteca (*dogfooding*). |
| 27 | +
|
| 28 | +## 📦 Instalação |
| 29 | + |
| 30 | +```bash |
| 31 | +npm install @samuelf27/react-ui-kit |
| 32 | +``` |
| 33 | + |
| 34 | +```tsx |
| 35 | +import { Button, Badge, Input } from '@samuelf27/react-ui-kit'; |
| 36 | +import '@samuelf27/react-ui-kit/styles.css'; // importe os estilos uma vez |
| 37 | + |
| 38 | +export default function App() { |
| 39 | + return <Button variant="primary">Salvar</Button>; |
| 40 | +} |
| 41 | +``` |
| 42 | + |
| 43 | +🌗 **Dark mode:** adicione a classe `dark` (ou `data-theme="dark"`) em um ancestral. |
| 44 | + |
| 45 | +## 🧩 Componentes |
| 46 | + |
| 47 | +`Button` · `Badge` · `Input` · `Card` · `Alert` · `Avatar` · `Spinner` · `Switch` |
| 48 | + |
| 49 | +Todos com props tipadas, `forwardRef` onde faz sentido e foco/ARIA adequados. |
| 50 | + |
| 51 | +## 🎨 Design tokens |
| 52 | + |
| 53 | +O tema é controlado por CSS variables (`--ui-primary`, `--ui-radius`, `--ui-fg`...). Sobrescreva no seu CSS para customizar a marca sem tocar nos componentes. |
| 54 | + |
| 55 | +## 🛠️ Desenvolvimento |
| 56 | + |
| 57 | +```bash |
| 58 | +npm install |
| 59 | +npm run dev # site de documentação (Vite) |
| 60 | +npm test # testes (Vitest + Testing Library) |
| 61 | +npm run typecheck # checagem de tipos |
| 62 | +npm run build:lib # gera dist/ (ESM + CJS + .d.ts + styles.css) |
| 63 | +``` |
| 64 | + |
| 65 | +## 🤖 CI/CD |
| 66 | + |
| 67 | +- **CI** (`ci.yml`): typecheck + testes + build da lib a cada push |
| 68 | +- **Deploy** (`deploy.yml`): publica a documentação no GitHub Pages |
| 69 | + |
| 70 | +## 📄 Licença |
| 71 | + |
| 72 | +[MIT](LICENSE) © Samuel Ferreira |
| 73 | + |
| 74 | +--- |
| 75 | + |
| 76 | +<p align="center"> |
| 77 | + <a href="https://github.com/Samuelf27">GitHub</a> · <a href="https://www.linkedin.com/in/samuel-ferreira27/">LinkedIn</a> |
| 78 | +</p> |
0 commit comments