diff --git a/.gitignore b/.gitignore index 08cde4d2..61eb29d5 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,10 @@ functions/* .umi-production .umi-test +# next.js +.next/ +out/ + # screenshot screenshot .firebase diff --git a/NEXTJS_INTEGRATION.md b/NEXTJS_INTEGRATION.md new file mode 100644 index 00000000..cda16513 --- /dev/null +++ b/NEXTJS_INTEGRATION.md @@ -0,0 +1,201 @@ +# Next.js + React 19 + Tailwind CSS + CopilotKit Integration + +This document describes the integration of modern AI development stack with Ant Design Pro. + +## 🚀 What's New + +This integration adds support for: + +- **Next.js 15.1.5** - Modern React framework with React 19 support +- **Tailwind CSS 3.4** - Utility-first CSS framework, configured to work with Ant Design +- **CopilotKit 1.3.20** - AI assistant integration for modern development experience +- **React 19** - Latest React with experimental features +- **CSS-in-JS Compatibility** - Seamless integration with existing antd-style + +## 📁 Project Structure + +``` +ant-design-pro/ +├── next-pages/ # Next.js pages (new) +│ ├── _app.tsx # Next.js app configuration +│ ├── _document.tsx # HTML document structure +│ ├── index.tsx # Homepage with integration demo +│ ├── demo.tsx # Component showcase page +│ └── api/ +│ └── copilotkit.ts # AI assistant API endpoint +├── next-components/ # Next.js specific components (new) +├── styles/ # Global styles for Next.js (new) +│ └── globals.css # Tailwind CSS imports and custom styles +├── src/ # Original Umi.js source (unchanged) +├── config/ # Umi.js configuration (unchanged) +├── next.config.js # Next.js configuration (new) +├── tailwind.config.js # Tailwind CSS configuration (new) +└── postcss.config.js # PostCSS configuration (new) +``` + +## 🛠️ Development Commands + +### Umi.js (Original Workflow) +```bash +# Start Umi.js development server on port 8000 +npm run dev +npm run start:dev + +# Build Umi.js for production +npm run build + +# Preview Umi.js build +npm run preview +``` + +### Next.js (New AI Workflow) +```bash +# Start Next.js development server on port 3001 +npm run dev:next + +# Build Next.js for production +npm run build:next + +# Preview Next.js build +npm run preview:next +``` + +## 🎯 Key Features + +### 1. Dual Framework Support +- **Umi.js**: Traditional enterprise development workflow (port 8000) +- **Next.js**: Modern AI-powered development workflow (port 3001) +- Both frameworks can run simultaneously without conflicts + +### 2. Technology Integration +- **React 19**: Latest React features with experimental support +- **Ant Design 5.26.4**: Enterprise-class UI components +- **Tailwind CSS**: Utility-first styling that complements Ant Design +- **CSS-in-JS**: antd-style continues to work seamlessly +- **CopilotKit**: AI assistant for development help + +### 3. AI Features +- **AI Assistant**: Click the chat icon for development help +- **Context Awareness**: AI understands your current page and components +- **Form Assistance**: AI can help fill forms and suggest values +- **Code Suggestions**: Get help with React, Ant Design, and Tailwind + +## 🎨 Styling Approach + +### Ant Design + Tailwind CSS Harmony +```tsx +// You can use both Ant Design components and Tailwind classes + + + +``` + +### Configuration Details +- Tailwind CSS is configured with `important: '#__next'` to avoid conflicts +- Preflight is disabled to preserve Ant Design's base styles +- Custom color palette includes Ant Design colors +- Responsive breakpoints align with Ant Design's grid system + +## 🔧 API Integration + +### CopilotKit Setup +The AI assistant is configured with: +- Mock API endpoint (`/api/copilotkit`) for demonstration +- Context-aware responses about Ant Design Pro +- Form interaction capabilities +- Development guidance and suggestions + +### Production Setup +For production use, replace the mock API with: +```typescript +// In next-pages/_app.tsx + +``` + +## 🚀 Getting Started + +1. **Install Dependencies** (if not already installed): + ```bash + npm install + ``` + +2. **Start Development**: + ```bash + # For traditional development + npm run dev + + # For AI-powered development + npm run dev:next + ``` + +3. **Visit the Apps**: + - Umi.js App: http://localhost:8000 + - Next.js App: http://localhost:3001 + +4. **Try the AI Assistant**: + - Click the chat icon in the Next.js app + - Ask questions like "Help me create a user form" or "Show me Ant Design best practices" + +## 📚 Examples + +### Page Examples +- **Homepage** (`/`): Integration overview and feature showcase +- **Demo Page** (`/demo`): Comprehensive component examples with Tailwind styling + +### Component Examples +- Forms with AI assistance +- Tables with modern styling +- Statistics cards with gradients +- Responsive layouts using Tailwind Grid + +## 🤝 Compatibility + +### Browser Support +- Modern browsers with React 19 support +- Same browser support as Ant Design 5.x + +### Framework Coexistence +- Umi.js and Next.js run on different ports +- Shared TypeScript configuration +- Independent build processes +- No conflicts between routing systems + +## 📈 Migration Path + +### Gradual Adoption +1. **Phase 1**: Use Next.js for new AI-powered features +2. **Phase 2**: Migrate critical pages to Next.js as needed +3. **Phase 3**: Full migration if desired (optional) + +### Component Reuse +- Existing Ant Design components work in both frameworks +- Shared utilities and services can be used across frameworks +- CSS-in-JS styles remain compatible + +## 🔮 Future Enhancements + +- [ ] Advanced AI actions and workflows +- [ ] Integration with popular AI services (OpenAI, Claude, etc.) +- [ ] Automated testing with AI assistance +- [ ] Code generation capabilities +- [ ] Advanced Tailwind + Ant Design component library + +## 🆘 Troubleshooting + +### Common Issues +1. **Port Conflicts**: Ensure ports 8000 and 3001 are available +2. **Style Conflicts**: Tailwind's `important` setting prevents most conflicts +3. **TypeScript Errors**: Both frameworks share the same TypeScript config + +### Support +- Check the demo pages for working examples +- Use the AI assistant for development questions +- Refer to official documentation for each technology + +--- + +**Happy Coding! 🎉** + +This integration brings the best of modern AI development to the robust Ant Design Pro ecosystem. \ No newline at end of file diff --git a/next-env.d.ts b/next-env.d.ts new file mode 100644 index 00000000..52e831b4 --- /dev/null +++ b/next-env.d.ts @@ -0,0 +1,5 @@ +/// +/// + +// NOTE: This file should not be edited +// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information. diff --git a/next.config.js b/next.config.js new file mode 100644 index 00000000..931e911d --- /dev/null +++ b/next.config.js @@ -0,0 +1,66 @@ +/** @type {import('next').NextConfig} */ +const nextConfig = { + // Enable experimental features + experimental: { + // Enable React 19 experimental features + ppr: false, + }, + + // Configure TypeScript + typescript: { + ignoreBuildErrors: false, + }, + + // Configure ESLint + eslint: { + ignoreDuringBuilds: false, + }, + + // Configure static file serving + assetPrefix: process.env.NODE_ENV === 'production' ? '/next' : '', + basePath: process.env.NODE_ENV === 'production' ? '/next' : '', + + // Configure output directory to avoid conflicts with Umi + distDir: '.next', + + // Configure rewrites to coexist with Umi.js + async rewrites() { + return [ + { + source: '/next/:path*', + destination: '/:path*', + }, + ]; + }, + + // Webpack configuration for compatibility + webpack: (config, { isServer }) => { + // Add compatibility for CSS-in-JS libraries + if (!isServer) { + config.resolve.fallback = { + ...config.resolve.fallback, + fs: false, + module: false, + }; + } + + return config; + }, + + // Configure headers for better compatibility + async headers() { + return [ + { + source: '/(.*)', + headers: [ + { + key: 'X-Frame-Options', + value: 'DENY', + }, + ], + }, + ]; + }, +}; + +module.exports = nextConfig; diff --git a/package.json b/package.json index 457b1023..1b94f158 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,10 @@ "scripts": { "analyze": "cross-env ANALYZE=1 max build", "build": "max build", + "build:next": "next build", "deploy": "npm run build && npm run gh-pages", "dev": "npm run start:dev", + "dev:next": "next dev -p 3001", "gh-pages": "gh-pages -d dist", "i18n-remove": "pro i18n-remove --locale=zh-CN --write", "postinstall": "max setup", @@ -19,6 +21,7 @@ "openapi": "max openapi", "prepare": "husky", "preview": "npm run build && max preview --port 8000", + "preview:next": "npm run build:next && next start -p 3001", "record": "cross-env NODE_ENV=development UMI_ENV=test max record --scene=login", "serve": "umi-serve", "start": "cross-env UMI_ENV=dev max dev", @@ -43,7 +46,12 @@ "classnames": "^2.5.1", "dayjs": "^1.11.13", "react": "^19.1.0", - "react-dom": "^19.1.0" + "react-dom": "^19.1.0", + "next": "^15.1.5", + "tailwindcss": "^3.4.0", + "@copilotkit/react-core": "^1.3.20", + "@copilotkit/react-ui": "^1.3.20", + "@copilotkit/react-textarea": "^1.3.20" }, "devDependencies": { "@ant-design/pro-cli": "^3.3.0", @@ -70,7 +78,11 @@ "umi-presets-pro": "^2.0.3", "umi-serve": "^1.9.11", "@biomejs/biome": "^2.1.1", - "@types/node": "^24.0.13" + "@types/node": "^24.0.13", + "autoprefixer": "^10.4.16", + "postcss": "^8.4.32", + "@tailwindcss/typography": "^0.5.10", + "@tailwindcss/forms": "^0.5.7" }, "engines": { "node": ">=20.0.0" diff --git a/pages/_app.tsx b/pages/_app.tsx new file mode 100644 index 00000000..03b1b966 --- /dev/null +++ b/pages/_app.tsx @@ -0,0 +1,41 @@ +import '../styles/globals.css'; +import { CopilotKit } from '@copilotkit/react-core'; +import { CopilotPopup } from '@copilotkit/react-ui'; +import { ConfigProvider } from 'antd'; +import zhCN from 'antd/locale/zh_CN'; +import type { AppProps } from 'next/app'; +import 'dayjs/locale/zh-cn'; +import '@ant-design/v5-patch-for-react-19'; + +// Import Tailwind CSS styles +import '../styles/globals.css'; + +export default function App({ Component, pageProps }: AppProps) { + return ( + + +
+ {/* Next.js root container */} + + +
+
+
+ ); +} diff --git a/pages/_document.tsx b/pages/_document.tsx new file mode 100644 index 00000000..7879b84a --- /dev/null +++ b/pages/_document.tsx @@ -0,0 +1,36 @@ +import { Head, Html, Main, NextScript } from 'next/document'; + +export default function Document() { + return ( + + + + + + + + {/* Preload Alibaba Sans font */} + + + {/* Meta tags for AI/modern features */} + + + + + {/* Next.js root container */} +
+ + + + ); +} diff --git a/pages/api/copilotkit.ts b/pages/api/copilotkit.ts new file mode 100644 index 00000000..97fab7aa --- /dev/null +++ b/pages/api/copilotkit.ts @@ -0,0 +1,41 @@ +import { type NextRequest, NextResponse } from 'next/server'; + +// Simple mock CopilotKit API endpoint +// In a real application, this would connect to OpenAI or other AI services +export default async function handler(req: NextRequest) { + if (req.method !== 'POST') { + return NextResponse.json({ error: 'Method not allowed' }, { status: 405 }); + } + + try { + // Mock AI response - in production, integrate with OpenAI/Claude/etc + await req.json(); + + const mockResponses = [ + '我是 Ant Design Pro 的 AI 助手。我可以帮助您:\n\n1. 解答 React 组件开发问题\n2. 提供 Ant Design 使用建议\n3. 协助 Next.js 和 Tailwind CSS 集成\n4. 分享最佳实践', + '您可以使用以下 Ant Design 组件来构建现代化的管理界面:Button、Table、Form、Card、Layout 等。需要具体的使用示例吗?', + 'Next.js 与 Umi.js 可以并存使用。您可以:\n- 使用 npm run dev 启动 Umi.js\n- 使用 npm run dev:next 启动 Next.js\n- 根据项目需要选择合适的框架', + 'Tailwind CSS 已配置为与 Ant Design 兼容。您可以同时使用 Tailwind 的实用类和 Ant Design 的组件系统。', + ]; + + const response = + mockResponses[Math.floor(Math.random() * mockResponses.length)]; + + return NextResponse.json({ + choices: [ + { + message: { + content: response, + role: 'assistant', + }, + }, + ], + }); + } catch (error) { + console.error('CopilotKit API error:', error); + return NextResponse.json( + { error: 'Internal server error' }, + { status: 500 }, + ); + } +} diff --git a/pages/demo.tsx b/pages/demo.tsx new file mode 100644 index 00000000..fd39207a --- /dev/null +++ b/pages/demo.tsx @@ -0,0 +1,408 @@ +import { + BarChartOutlined, + RiseOutlined, + SettingOutlined, + ShoppingOutlined, + TeamOutlined, + UserOutlined, +} from '@ant-design/icons'; +import { useCopilotAction, useCopilotReadable } from '@copilotkit/react-core'; +import { + Avatar, + Button, + Card, + Col, + DatePicker, + Form, + Input, + Progress, + Row, + Select, + Space, + Statistic, + Switch, + Table, + Tag, + Typography, +} from 'antd'; +import Head from 'next/head'; +import React, { useState } from 'react'; + +const { Title, Text } = Typography; +const { Option } = Select; + +// Sample data for demonstration +const tableData = [ + { + key: '1', + name: 'John Brown', + age: 32, + address: 'New York No. 1 Lake Park', + tags: ['nice', 'developer'], + }, + { + key: '2', + name: 'Jim Green', + age: 42, + address: 'London No. 1 Lake Park', + tags: ['loser'], + }, + { + key: '3', + name: 'Joe Black', + age: 32, + address: 'Sidney No. 1 Lake Park', + tags: ['cool', 'teacher'], + }, +]; + +const columns = [ + { + title: 'Name', + dataIndex: 'name', + key: 'name', + render: (text: string) => ( + {text} + ), + }, + { + title: 'Age', + dataIndex: 'age', + key: 'age', + }, + { + title: 'Address', + dataIndex: 'address', + key: 'address', + }, + { + title: 'Tags', + key: 'tags', + dataIndex: 'tags', + render: (tags: string[]) => ( + + {tags.map((tag) => { + let color = tag.length > 5 ? 'geekblue' : 'green'; + if (tag === 'loser') { + color = 'volcano'; + } + return ( + + {tag.toUpperCase()} + + ); + })} + + ), + }, +]; + +export default function Demo() { + const [form] = Form.useForm(); + const [loading, setLoading] = useState(false); + + // Make demo data readable to AI + useCopilotReadable({ + description: + 'Demo page showing Ant Design components with Tailwind CSS styling', + value: { + page: 'demo', + components: ['Table', 'Form', 'Card', 'Statistics'], + users: tableData.length, + framework: 'Next.js + Ant Design + Tailwind', + }, + }); + + // Add CopilotKit action for form submission + useCopilotAction({ + name: 'submitDemoForm', + description: 'Submit the demo form with user data', + parameters: [ + { + name: 'name', + type: 'string', + description: 'User name', + required: true, + }, + { + name: 'email', + type: 'string', + description: 'User email', + required: true, + }, + ], + handler: async ({ name, email }) => { + form.setFieldsValue({ name, email }); + alert(`AI helped fill form: ${name} (${email})`); + }, + }); + + const onFinish = async (values: any) => { + setLoading(true); + // Simulate API call + await new Promise((resolve) => setTimeout(resolve, 1000)); + console.log('Form values:', values); + setLoading(false); + alert('Form submitted successfully!'); + }; + + return ( + <> + + Demo - Ant Design Pro + Next.js Integration + + +
+ {/* Header */} +
+
+ + <BarChartOutlined className="text-blue-600" /> + 演示页面 Demo Page + + + 展示 Ant Design + Tailwind CSS + Next.js + AI 的完美集成 + +
+
+ +
+ {/* Statistics Cards */} + + + + } + valueStyle={{ color: '#1890ff' }} + /> +
+ +
+
+ + + + } + valueStyle={{ color: '#52c41a' }} + /> +
+ +
+
+ + + + } + valueStyle={{ color: '#fa8c16' }} + /> +
+ +
+
+ + + + } + valueStyle={{ color: '#722ed1' }} + /> +
+ +
+
+ +
+ + + {/* Form Card */} + + + + 用户表单 User Form + + } + className="h-full" + > +
+ + } + className="rounded-lg" + /> + + + + + + + + + + + + + + + + + + + + + + + + +
+ + {/* AI助手提示 */} +
+ + 💡 AI 助手提示: 您可以询问 AI + 助手帮您填写表单, 比如说"帮我填写一个示例用户的信息" + +
+
+ + + {/* Table Card */} + + + + 用户列表 User List + + } + className="h-full" + > + + + {/* Tailwind CSS 样式展示 */} +
+ + 🎨 Tailwind CSS 样式展示 + +
+
+ Responsive Design +
+
+ Utility Classes +
+
+ Modern Gradients +
+
+ +
+
+
+
+
+
+ + + + + {/* Technology Integration Card */} + + + 🚀 技术集成展示 Technology Integration + + + + +
+ + N + + Next.js 15 + React 19 支持、服务端渲染、优化构建 +
+ + + +
+ + T + + Tailwind CSS + 实用类优先、响应式设计、现代样式 +
+ + + +
+ + AI + + CopilotKit + AI 助手集成、智能对话、自动化操作 +
+ + + + + + + ); +} diff --git a/pages/index.tsx b/pages/index.tsx new file mode 100644 index 00000000..58527e3e --- /dev/null +++ b/pages/index.tsx @@ -0,0 +1,236 @@ +import { + ApiOutlined, + BulbOutlined, + RocketOutlined, + ThunderboltOutlined, +} from '@ant-design/icons'; +import { useCopilotAction, useCopilotReadable } from '@copilotkit/react-core'; +import { Alert, Button, Card, Divider, Space, Typography } from 'antd'; +import Head from 'next/head'; +import React from 'react'; + +const { Title, Paragraph, Text } = Typography; + +export default function Home() { + // Make application state readable to the AI + useCopilotReadable({ + description: + 'The current page is the Ant Design Pro Next.js integration demo', + value: { + page: 'home', + features: ['nextjs', 'react19', 'tailwind', 'copilotkit', 'antd'], + }, + }); + + // Add a CopilotKit action + useCopilotAction({ + name: 'showFeatureDemo', + description: + 'Demonstrate a specific feature of the Ant Design Pro integration', + parameters: [ + { + name: 'feature', + type: 'string', + description: + 'The feature to demonstrate (nextjs, tailwind, antd, copilotkit)', + required: true, + }, + ], + handler: async ({ feature }) => { + alert(`Demonstrating ${feature} integration!`); + }, + }); + + return ( + <> + + Ant Design Pro + Next.js + AI Integration + + + +
+ {/* Header */} +
+
+
+
+ + + Ant Design Pro + Next.js + AI + +
+ + + + +
+
+
+ + {/* Main Content */} +
+
+ + 🎉 集成成功!Integration Success! + + + 成功将 Next.js + React 19 + Tailwind CSS + CopilotKit 集成到 Ant + Design Pro 中。 现在您可以享受现代化的 AI 开发体验,同时保持 Ant + Design 生态系统的强大功能。 + +
+ + {/* Success Alert */} +
+ +
+ + {/* Feature Cards */} +
+ + + Next.js + React 19 + + } + className="h-full hover:shadow-lg transition-shadow" + > +
+ ✅ Next.js 15.1.5 配置完成 +
+ ✅ React 19 实验性功能启用 +
+ ✅ TypeScript 完全支持 +
+ 端口: 3001 (与 Umi 并存) +
+
+ + + + Tailwind + Ant Design + + } + className="h-full hover:shadow-lg transition-shadow" + > +
+ ✅ Tailwind CSS 3.4 集成 +
+ ✅ 与 Ant Design 样式兼容 +
+ ✅ CSS-in-JS 继续工作 +
+
+
+
+
+
+
+
+ + + + CopilotKit AI + + } + className="h-full hover:shadow-lg transition-shadow" + > +
+ ✅ CopilotKit 1.3.20 集成 +
+ ✅ AI 助手弹窗可用 +
+ ✅ 可读取应用状态 +
+ 点击右下角试试 AI 助手! +
+
+
+ + + + {/* Usage Instructions */} +
+ + 🛠️ 使用说明 Usage Instructions + + +
+
+ 开发命令 Development Commands +
+
# 启动 Umi.js (原有工作流)
+
npm run dev
+
# 启动 Next.js (新 AI 工作流)
+
npm run dev:next
+
+
+ +
+ 构建命令 Build Commands +
+
# 构建 Umi.js 版本
+
npm run build
+
# 构建 Next.js 版本
+
npm run build:next
+
+
+
+ +
+ 🎯 AI 功能体验 + + 1. 点击右下角的 AI 助手图标 +
+ 2. 询问关于 Ant Design Pro 开发的问题 +
+ 3. AI 助手可以帮助您解决 React 组件、Ant Design 使用等问题 +
+
+
+ + {/* Action Buttons */} +
+ + + + +
+
+
+ + ); +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 00000000..12a703d9 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,6 @@ +module.exports = { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +}; diff --git a/styles/globals.css b/styles/globals.css new file mode 100644 index 00000000..81b505c1 --- /dev/null +++ b/styles/globals.css @@ -0,0 +1,91 @@ +@import "tailwindcss/base"; +@import "tailwindcss/components"; +@import "tailwindcss/utilities"; + +/* Global styles that work with both Ant Design and Tailwind */ +html, +body { + padding: 0; + margin: 0; + font-family: + -apple-system, + BlinkMacSystemFont, + Segoe UI, + Roboto, + Oxygen, + Ubuntu, + Cantarell, + Fira Sans, + Droid Sans, + Helvetica Neue, + sans-serif; +} + +/* Ensure compatibility with Ant Design */ +* { + box-sizing: border-box; +} + +/* Custom styles for AI/modern look */ +.gradient-text { + background: linear-gradient(to right, #2563eb, #7c3aed); + -webkit-background-clip: text; + background-clip: text; + -webkit-text-fill-color: transparent; +} + +.gradient-bg { + background: linear-gradient(to bottom right, #eff6ff, #e0e7ff); +} + +/* Animation classes */ +.animate-fade-in { + animation: fadeIn 0.5s ease-in-out; +} + +.animate-slide-up { + animation: slideUp 0.3s ease-out; +} + +@keyframes fadeIn { + from { + opacity: 0; + } + to { + opacity: 1; + } +} + +@keyframes slideUp { + from { + transform: translateY(20px); + opacity: 0; + } + to { + transform: translateY(0); + opacity: 1; + } +} + +/* Ensure Next.js works well with Ant Design */ +#__next { + min-height: 100vh; +} + +/* Custom scrollbar for modern look */ +::-webkit-scrollbar { + width: 6px; +} + +::-webkit-scrollbar-track { + background: #f1f1f1; +} + +::-webkit-scrollbar-thumb { + background: #888; + border-radius: 3px; +} + +::-webkit-scrollbar-thumb:hover { + background: #555; +} diff --git a/tailwind.config.js b/tailwind.config.js new file mode 100644 index 00000000..c20cffc5 --- /dev/null +++ b/tailwind.config.js @@ -0,0 +1,76 @@ +/** @type {import('tailwindcss').Config} */ +module.exports = { + content: [ + './pages/**/*.{js,ts,jsx,tsx,mdx}', + './next-components/**/*.{js,ts,jsx,tsx,mdx}', + './next-app/**/*.{js,ts,jsx,tsx,mdx}', + './src/**/*.{js,ts,jsx,tsx,mdx}', + ], + theme: { + extend: { + // Extend theme to work well with Ant Design + colors: { + // Ant Design primary colors + 'ant-primary': '#1890ff', + 'ant-success': '#52c41a', + 'ant-warning': '#faad14', + 'ant-error': '#f5222d', + + // Additional colors for AI/modern look + 'ai-blue': '#0066ff', + 'ai-purple': '#6366f1', + 'ai-gradient-start': '#667eea', + 'ai-gradient-end': '#764ba2', + }, + + // Typography that complements Ant Design + fontFamily: { + alibaba: ['AlibabaSans', 'sans-serif'], + mono: ['SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'monospace'], + }, + + // Spacing that aligns with Ant Design grid + spacing: { + 18: '4.5rem', + 88: '22rem', + }, + + // Animation for modern interactions + animation: { + 'fade-in': 'fadeIn 0.5s ease-in-out', + 'slide-up': 'slideUp 0.3s ease-out', + 'pulse-slow': 'pulse 3s infinite', + }, + + keyframes: { + fadeIn: { + '0%': { opacity: '0' }, + '100%': { opacity: '1' }, + }, + slideUp: { + '0%': { transform: 'translateY(20px)', opacity: '0' }, + '100%': { transform: 'translateY(0)', opacity: '1' }, + }, + }, + + // Box shadows that complement Ant Design + boxShadow: { + 'ant-card': + '0 1px 2px 0 rgba(0, 0, 0, 0.03), 0 1px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px 0 rgba(0, 0, 0, 0.02)', + 'ant-drawer': '0 4px 12px 0 rgba(0, 0, 0, 0.15)', + }, + }, + }, + plugins: [ + // Note: @tailwindcss/typography and @tailwindcss/forms plugins available as optional dependencies + ], + + // Important prefix to avoid conflicts with Ant Design + important: false, + + // Configure to work with CSS-in-JS + corePlugins: { + // Disable preflight to avoid conflicts with Ant Design styles + preflight: false, + }, +}; diff --git a/tsconfig.json b/tsconfig.json index 2fa95248..45da02b5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,7 @@ "baseUrl": "./", "target": "esnext", "moduleResolution": "node", - "jsx": "react-jsx", + "jsx": "preserve", "esModuleInterop": true, "experimentalDecorators": true, "strict": true, @@ -16,7 +16,14 @@ "@/*": ["./src/*"], "@@/*": ["./src/.umi/*"], "@@test/*": ["./src/.umi-test/*"] - } + }, + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "noEmit": true, + "incremental": true, + "module": "esnext", + "isolatedModules": true }, - "include": ["./**/*.d.ts", "./**/*.ts", "./**/*.tsx"] + "include": ["./**/*.d.ts", "./**/*.ts", "./**/*.tsx"], + "exclude": ["node_modules"] }