From 6378047bc4e12642ec7188f7387562f82731d05e Mon Sep 17 00:00:00 2001 From: Michael Datelle Date: Wed, 19 Feb 2025 14:23:52 -0500 Subject: [PATCH] feat: add unraid-ui documentation (#1142) ## Summary by CodeRabbit - **Chores** - Improved repository management to prevent unnecessary tracking of the `.pnpm-store` directory. - **Documentation** - Updated installation and configuration guidelines for the UI component library. - Refined instructions for Tailwind configuration, now utilizing TypeScript. - Expanded guidance for component development and Storybook best practices, providing clearer examples and workflows. --------- Co-authored-by: mdatelle --- .gitignore | 2 +- unraid-ui/README.md | 173 +++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 165 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index f20530830..df5cd377e 100644 --- a/.gitignore +++ b/.gitignore @@ -94,4 +94,4 @@ deploy/* fb_keepalive # pnpm store -.pnpm-store \ No newline at end of file +.pnpm-store diff --git a/unraid-ui/README.md b/unraid-ui/README.md index 11e8f3db0..459382fb3 100644 --- a/unraid-ui/README.md +++ b/unraid-ui/README.md @@ -24,31 +24,44 @@ npm install vue@^3.3.0 tailwindcss@^3.0.0 Import the component library styles in your main entry file: ```typescript -import "@unraid/ui/style.css"; +import '@unraid/ui/style.css'; ``` ### 2. Configure TailwindCSS -Add the following to your `tailwind.config.js`: +Create a `tailwind.config.ts` file with the following configuration: -```javascript -module.exports = { +```typescript +import tailwindConfig from '@unraid/ui/tailwind.config.ts'; +import type { Config } from 'tailwindcss'; + +export default { + presets: [tailwindConfig], content: [ // ... your content paths - "./node_modules/@unraid/ui/**/*.{js,vue,ts}", + './components/**/*.{js,vue,ts}', + './layouts/**/*.vue', + './pages/**/*.vue', ], theme: { - extend: {}, + extend: { + // your theme extensions + }, }, - plugins: [require("tailwindcss-animate"), require("@tailwindcss/typography")], -}; +} satisfies Partial; ``` +This configuration: + +- Uses the Unraid UI library's Tailwind config as a preset +- Properly types your configuration with TypeScript +- Allows you to extend the base theme while maintaining all Unraid UI defaults + ## Usage ```vue