|
| 1 | +# Unraid UI |
| 2 | + |
| 3 | +A Vue 3 component library providing a set of reusable, accessible UI components for Unraid development. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- ⚡️ Built with Vue 3 and TypeScript |
| 8 | +- 🎭 Storybook documentation |
| 9 | +- ✅ Tested components |
| 10 | +- 🎪 Built on top of TailwindCSS and Shadcn/UI |
| 11 | + |
| 12 | +## Installation |
| 13 | + |
| 14 | +Make sure you have the peer dependencies installed: |
| 15 | + |
| 16 | +```bash |
| 17 | +npm install vue@^3.3.0 tailwindcss@^3.0.0 |
| 18 | +``` |
| 19 | + |
| 20 | +## Setup |
| 21 | + |
| 22 | +### 1. Add CSS |
| 23 | + |
| 24 | +Import the component library styles in your main entry file: |
| 25 | + |
| 26 | +```typescript |
| 27 | +import "@unraid/ui/style.css"; |
| 28 | +``` |
| 29 | + |
| 30 | +### 2. Configure TailwindCSS |
| 31 | + |
| 32 | +Add the following to your `tailwind.config.js`: |
| 33 | + |
| 34 | +```javascript |
| 35 | +module.exports = { |
| 36 | + content: [ |
| 37 | + // ... your content paths |
| 38 | + "./node_modules/@unraid/ui/**/*.{js,vue,ts}", |
| 39 | + ], |
| 40 | + theme: { |
| 41 | + extend: {}, |
| 42 | + }, |
| 43 | + plugins: [require("tailwindcss-animate"), require("@tailwindcss/typography")], |
| 44 | +}; |
| 45 | +``` |
| 46 | + |
| 47 | +## Usage |
| 48 | + |
| 49 | +```vue |
| 50 | +<script setup lang="ts"> |
| 51 | +import { Button } from "@unraid/ui"; |
| 52 | +</script> |
| 53 | +
|
| 54 | +<template> |
| 55 | + <Button variant="primary"> Click me </Button> |
| 56 | +</template> |
| 57 | +``` |
| 58 | + |
| 59 | +## Development |
| 60 | + |
| 61 | +### Local Development |
| 62 | + |
| 63 | +Install dependencies: |
| 64 | + |
| 65 | +```bash |
| 66 | +npm install |
| 67 | +``` |
| 68 | + |
| 69 | +Start Storybook development server: |
| 70 | + |
| 71 | +```bash |
| 72 | +npm run storybook |
| 73 | +``` |
| 74 | + |
| 75 | +This will start Storybook at [http://localhost:6006](http://localhost:6006) |
| 76 | + |
| 77 | +### Building |
| 78 | + |
| 79 | +```bash |
| 80 | +npm run build |
| 81 | +``` |
| 82 | + |
| 83 | +### Testing |
| 84 | + |
| 85 | +Run tests: |
| 86 | + |
| 87 | +```bash |
| 88 | +npm run test |
| 89 | +``` |
| 90 | + |
| 91 | +Run tests with UI: |
| 92 | + |
| 93 | +```bash |
| 94 | +npm run test:ui |
| 95 | +``` |
| 96 | + |
| 97 | +Generate coverage report: |
| 98 | + |
| 99 | +```bash |
| 100 | +npm run coverage |
| 101 | +``` |
| 102 | + |
| 103 | +### Type Checking |
| 104 | + |
| 105 | +```bash |
| 106 | +npm run typecheck |
| 107 | +``` |
| 108 | + |
| 109 | +## Scripts |
| 110 | + |
| 111 | +- `dev`: Start development server |
| 112 | +- `build`: Build for production |
| 113 | +- `preview`: Preview production build |
| 114 | +- `test`: Run tests |
| 115 | +- `test:ui`: Run tests with UI |
| 116 | +- `coverage`: Generate test coverage |
| 117 | +- `clean`: Remove build artifacts |
| 118 | +- `typecheck`: Run type checking |
| 119 | +- `storybook`: Start Storybook development server |
| 120 | +- `build-storybook`: Build Storybook for production |
| 121 | + |
| 122 | +## License |
0 commit comments