# @cherrystudio/ui
Cherry Studio UI 组件库 - 为 Cherry Studio 设计的 React 组件集合
## 特性
- 🎨 基于 Tailwind CSS 的现代化设计
- 📦 支持 ESM 和 CJS 格式
- 🔷 完整的 TypeScript 支持
- 🚀 可以作为 npm 包发布
- 🔧 开箱即用的常用 hooks 和工具函数
## 安装
```bash
# 安装组件库
npm install @cherrystudio/ui
# 安装必需的 peer dependencies
npm install @heroui/react framer-motion react react-dom tailwindcss
```
## 配置
### 1. Tailwind CSS 配置
在你的项目根目录创建 `tailwind.config.js` 文件:
```javascript
const { heroui } = require('@heroui/react')
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
// 你的应用内容
'./src/**/*.{js,ts,jsx,tsx}',
'./app/**/*.{js,ts,jsx,tsx}',
'./pages/**/*.{js,ts,jsx,tsx}',
'./components/**/*.{js,ts,jsx,tsx}',
// 包含 @cherrystudio/ui 组件
'./node_modules/@cherrystudio/ui/dist/**/*.{js,ts,jsx,tsx}',
// 包含 HeroUI 主题
'./node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}'
],
theme: {
extend: {
// 你的自定义主题扩展
}
},
darkMode: 'class',
plugins: [
heroui({
// HeroUI 主题配置
// 参考: https://heroui.com/docs/customization/theme
})
]
}
```
### 2. CSS 导入
在你的主 CSS 文件中导入 Tailwind:
```css
@tailwind base;
@tailwind components;
@tailwind utilities;
```
### 3. Provider 配置
在你的 App 根组件中添加 HeroUI Provider:
```tsx
import { HeroUIProvider } from '@heroui/react'
function App() {
return (