diff --git a/frontend/index.html b/frontend/index.html index 0c71734..748232d 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -4,7 +4,7 @@ - regulation-rag + T-Systems Regulation Hub
diff --git a/frontend/src/components/layout/shell-config.ts b/frontend/src/components/layout/shell-config.ts deleted file mode 100644 index d23f21a..0000000 --- a/frontend/src/components/layout/shell-config.ts +++ /dev/null @@ -1,8 +0,0 @@ -export const shellFrameClassName = 'mx-auto w-full max-w-[1680px] px-8'; - -export const shellMeta = { - productLabel: 'T-Systems Regulation', - version: 'v1.0.0', - status: 'ONLINE', - surface: 'Desktop Web', -} as const; diff --git a/frontend/src/components/ui/Badge.tsx b/frontend/src/components/ui/Badge.tsx deleted file mode 100644 index 325d1b6..0000000 --- a/frontend/src/components/ui/Badge.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import React from 'react'; - -interface BadgeProps { - children: React.ReactNode; - color?: 'accent' | 'green' | 'orange' | 'red'; - size?: 'sm' | 'md'; -} - -const colorMap: Record = { - accent: { bg: 'var(--accent)', text: '#fff' }, - green: { bg: 'var(--success)', text: '#fff' }, - orange: { bg: 'var(--warn)', text: '#fff' }, - red: { bg: 'var(--danger)', text: '#fff' }, -}; - -export const Badge: React.FC = ({ - children, - color = 'accent', - size = 'sm', -}) => { - const sizeStyles: Record = { - sm: 'px-2 py-0.5 text-xs', - md: 'px-3 py-1 text-sm', - }; - - const c = colorMap[color] ?? colorMap.accent; - - return ( - - {children} - - ); -}; diff --git a/frontend/src/components/ui/Button.tsx b/frontend/src/components/ui/Button.tsx deleted file mode 100644 index d8df314..0000000 --- a/frontend/src/components/ui/Button.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import React from 'react'; - -interface ButtonProps { - variant?: 'primary' | 'secondary'; - size?: 'sm' | 'md' | 'lg'; - children: React.ReactNode; - onClick?: () => void; - disabled?: boolean; - className?: string; -} - -export const Button: React.FC = ({ - variant = 'primary', - size = 'md', - children, - onClick, - disabled = false, - className = '', -}) => { - const baseStyles = ` - inline-flex items-center justify-center - font-semibold rounded-xl cursor-pointer - transition-all duration-300 ease - disabled:cursor-not-allowed disabled:opacity-50 - `; - - const sizeStyles: Record = { - sm: 'px-3 py-1.5 text-xs', - md: 'px-5 py-3 text-sm', - lg: 'px-8 py-5 text-base', - }; - - const variantStyles: Record = { - primary: ` - bg-gradient-to-r from-t-accent to-t-accent-dark - text-white hover:shadow-t-accent hover:-translate-y-0.5 - hover:from-[#f0208a] hover:to-[#d01070] - `, - secondary: ` - bg-t-bg-hover border border-t-border - text-t-text2 hover:bg-t-bg-elevated - `, - }; - - return ( - - ); -}; diff --git a/frontend/src/components/ui/Card.tsx b/frontend/src/components/ui/Card.tsx deleted file mode 100644 index e757612..0000000 --- a/frontend/src/components/ui/Card.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import React from 'react'; - -interface CardProps { - accent?: boolean; - highlight?: boolean; - padding?: 'sm' | 'md' | 'lg'; - children: React.ReactNode; - className?: string; - onClick?: () => void; -} - -export const Card: React.FC = ({ - accent = false, - highlight = false, - padding = 'md', - children, - className = '', - onClick, -}) => { - const paddingStyles: Record = { - sm: 'p-4', - md: 'p-5', - lg: 'p-8', - }; - - return ( -
- {accent && ( -
- )} - {children} -
- ); -}; diff --git a/frontend/src/components/ui/Input.tsx b/frontend/src/components/ui/Input.tsx deleted file mode 100644 index 5acbc10..0000000 --- a/frontend/src/components/ui/Input.tsx +++ /dev/null @@ -1,49 +0,0 @@ -import React from 'react'; - -interface InputProps { - value: string; - onChange: (value: string) => void; - placeholder?: string; - onKeyDown?: (e: React.KeyboardEvent) => void; - className?: string; - type?: string; -} - -export const Input: React.FC = ({ - value, - onChange, - placeholder = '', - onKeyDown, - className = '', - type = 'text', -}) => { - return ( - onChange(e.target.value)} - onKeyDown={onKeyDown} - placeholder={placeholder} - className={` - w-full px-4 py-3 text-sm rounded-lg outline-none - focus:ring-1 - placeholder:text-[color:var(--muted)] - ${className} - `} - style={{ - backgroundColor: 'var(--surface)', - borderColor: 'var(--border)', - border: '1px solid var(--border)', - color: 'var(--fg)', - }} - onFocus={(e) => { - e.currentTarget.style.borderColor = 'var(--accent)'; - e.currentTarget.style.boxShadow = '0 0 0 1px var(--accent)'; - }} - onBlur={(e) => { - e.currentTarget.style.borderColor = 'var(--border)'; - e.currentTarget.style.boxShadow = 'none'; - }} - /> - ); -}; diff --git a/frontend/src/components/ui/ProgressBar.tsx b/frontend/src/components/ui/ProgressBar.tsx deleted file mode 100644 index 400e021..0000000 --- a/frontend/src/components/ui/ProgressBar.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import React from 'react'; - -interface ProgressBarProps { - percent: number; - color?: 'accent' | 'green' | 'orange' | 'red'; - showLabel?: boolean; -} - -const colorBg: Record = { - accent: 'linear-gradient(90deg, var(--accent), var(--accent-hover))', - green: 'linear-gradient(90deg, var(--success), #00ff88)', - orange: 'linear-gradient(90deg, var(--warn), #ffaa00)', - red: 'var(--danger)', -}; - -export const ProgressBar: React.FC = ({ - percent, - color = 'accent', - showLabel = false, -}) => { - return ( -
-
-
-
- {showLabel && ( - - {percent}% - - )} -
- ); -}; diff --git a/frontend/src/components/ui/ScoreBar.tsx b/frontend/src/components/ui/ScoreBar.tsx deleted file mode 100644 index d0f36a2..0000000 --- a/frontend/src/components/ui/ScoreBar.tsx +++ /dev/null @@ -1,49 +0,0 @@ -import React from 'react'; - -interface ScoreBarProps { - score: number; // 0-100 - label?: string; - accent?: boolean; -} - -export const ScoreBar: React.FC = ({ - score, - label, - accent = false, -}) => { - return ( -
- {label && ( -
- {label} -
- )} -
- {score} -
-
- {[...Array(10)].map((_, i) => ( -
- ))} -
-
- ); -}; diff --git a/frontend/src/components/ui/index.ts b/frontend/src/components/ui/index.ts index 2921125..1ac011c 100644 --- a/frontend/src/components/ui/index.ts +++ b/frontend/src/components/ui/index.ts @@ -1,6 +1 @@ -export { Button } from './Button'; -export { Card } from './Card'; -export { Input } from './Input'; -export { Badge } from './Badge'; -export { ProgressBar } from './ProgressBar'; -export { ScoreBar } from './ScoreBar'; \ No newline at end of file +// UI components — add exports here as new components are created diff --git a/frontend/src/types/index.ts b/frontend/src/types/index.ts index 5a4a4f7..a5de59c 100644 --- a/frontend/src/types/index.ts +++ b/frontend/src/types/index.ts @@ -1,4 +1,3 @@ // Re-export all types -export * from './theme'; export * from './doc'; export * from './compliance'; \ No newline at end of file diff --git a/frontend/src/types/theme.ts b/frontend/src/types/theme.ts deleted file mode 100644 index be683f7..0000000 --- a/frontend/src/types/theme.ts +++ /dev/null @@ -1,75 +0,0 @@ -// Theme types -export type ThemeMode = 'dark' | 'dim' | 'light'; - -export interface ThemeColors { - bg: string; - bgCard: string; - bgHover: string; - bgElevated: string; - border: string; - borderLight: string; - text: string; - text2: string; - text3: string; - accent: string; - accentDark: string; - accentLight: string; - green: string; - orange: string; - gradientAccent: string; -} - -export const darkTheme: ThemeColors = { - bg: '#0a0a12', - bgCard: '#12121f', - bgHover: '#1a1a2e', - bgElevated: '#1e1e30', - border: '#2a2a40', - borderLight: '#4a4a60', - text: '#fff', - text2: '#c0c0d0', - text3: '#9a9aaa', - accent: '#e20074', - accentDark: '#be0060', - accentLight: '#f04090', - green: '#00d4aa', - orange: '#ff8800', - gradientAccent: 'linear-gradient(135deg, #e20074, #be0060)', -}; - -// Dim theme — Indigo Dusk: deep navy-purple mid-tone, clearly between dark and light -export const dimTheme: ThemeColors = { - bg: '#1e1b2e', - bgCard: '#252237', - bgHover: '#2d2945', - bgElevated: '#292541', - border: '#3a3650', - borderLight: '#504c6e', - text: '#f0eeff', - text2: '#b8b4d8', - text3: '#7a7698', - accent: '#e20074', - accentDark: '#be0060', - accentLight: '#f04090', - green: '#00c4a0', - orange: '#ff8820', - gradientAccent: 'linear-gradient(135deg, #e20074, #be0060)', -}; - -export const lightTheme: ThemeColors = { - bg: '#ffffff', - bgCard: '#ffffff', - bgHover: '#f8f8fc', - bgElevated: '#fafafa', - border: '#e8e8f0', - borderLight: '#d0d0d8', - text: '#1a1a2e', - text2: '#4a4a5a', - text3: '#7a7a8a', - accent: '#e20074', - accentDark: '#be0060', - accentLight: '#f04090', - green: '#00b89c', - orange: '#ff7700', - gradientAccent: 'linear-gradient(135deg, #e20074, #be0060)', -}; \ No newline at end of file diff --git a/frontend/start.sh b/frontend/start.sh index c70ff74..ecca4ae 100644 --- a/frontend/start.sh +++ b/frontend/start.sh @@ -1,10 +1,7 @@ #!/bin/bash - -# 启动开发服务器 -# 端口: 8000 -# 监听: 0.0.0.0 - +# Start the Vite dev server. +# Port defaults to FRONTEND_PORT env var, or 5173 if unset (matches vite.config.ts default). cd "$(dirname "$0")" - -echo "Starting dev server on http://0.0.0.0:8001" -npx vite --host 0.0.0.0 --port 8001 \ No newline at end of file +PORT="${FRONTEND_PORT:-5173}" +echo "Starting dev server on http://0.0.0.0:${PORT}" +npx vite --host 0.0.0.0 --port "$PORT" diff --git a/frontend/tailwind.config.js b/frontend/tailwind.config.js index f70c87f..b800ed8 100644 --- a/frontend/tailwind.config.js +++ b/frontend/tailwind.config.js @@ -4,68 +4,30 @@ export default { "./index.html", "./src/**/*.{js,ts,jsx,tsx}", ], - darkMode: 'class', + darkMode: ['selector', '[data-theme="dark"]'], theme: { extend: { colors: { - // 动态主题色(通过CSS变量) - 't-bg': 'var(--t-bg)', - 't-bg-card': 'var(--t-bg-card)', - 't-bg-hover': 'var(--t-bg-hover)', - 't-bg-elevated': 'var(--t-bg-elevated)', - 't-border': 'var(--t-border)', - 't-border-light': 'var(--t-border-light)', - 't-text': 'var(--t-text)', - 't-text2': 'var(--t-text2)', - 't-text3': 'var(--t-text3)', - // 固定品牌色 + 't-bg': 'var(--bg)', + 't-surface': 'var(--surface)', + 't-fg': 'var(--fg)', + 't-muted': 'var(--muted)', + 't-border': 'var(--border)', 't-accent': '#e20074', - 't-accent-dark': '#be0060', - 't-accent-light': '#f04090', - // 动态状态色 - 't-green': 'var(--t-green)', - 't-orange': 'var(--t-orange)', - 't-red': '#ff4444', + 't-accent-hover': '#c8006a', + 't-success': 'var(--success)', + 't-warn': 'var(--warn)', + 't-danger': 'var(--danger)', }, fontFamily: { - 'tele': ['TeleNeo', 'Segoe UI', 'system-ui', 'sans-serif'], - 'mono': ['JetBrains Mono', 'monospace'], + 'display': ['TeleNeoWeb-Bold', 'Inter', 'sans-serif'], + 'body': ['TeleNeoWeb-Regular', 'Inter', 'sans-serif'], + 'mono': ['ui-monospace', 'JetBrains Mono', 'Menlo', 'monospace'], }, boxShadow: { - 't-glow': '0 0 20px rgba(226,0,116,0.15), 0 0 40px rgba(226,0,116,0.05)', - 't-card': '0 2px 8px rgba(226,0,116,0.04)', - 't-card-hover': '0 4px 16px rgba(226,0,116,0.08)', - 't-accent': '0 4px 20px rgba(226,0,116,0.4)', - }, - keyframes: { - 'pulse-glow': { - '0%, 100%': { - boxShadow: '0 0 12px rgba(226,0,116,0.5), 0 0 24px rgba(226,0,116,0.2)' - }, - '50%': { - boxShadow: '0 0 16px rgba(226,0,116,0.7), 0 0 32px rgba(226,0,116,0.3)' - }, - }, - 'slideUp': { - '0%': { opacity: '0', transform: 'translateY(10px)' }, - '100%': { opacity: '1', transform: 'translateY(0)' }, - }, - 'slideIn': { - '0%': { transform: 'translateX(100%)' }, - '100%': { transform: 'translateX(0)' }, - }, - 'slideOut': { - '0%': { transform: 'translateX(0)' }, - '100%': { transform: 'translateX(100%)' }, - }, - }, - animation: { - 'pulse-glow': 'pulse-glow 2s infinite', - 'slide-up': 'slideUp 0.3s ease', - 'slide-in': 'slideIn 0.3s ease-out', - 'slide-out': 'slideOut 0.3s ease-in', + 'card': 'var(--shadow-card)', }, }, }, plugins: [], -} \ No newline at end of file +}