diff --git a/apps/desktop/src/components/InteractiveInput.tsx b/apps/desktop/src/components/InteractiveInput.tsx index 594bf60..25b8a28 100644 --- a/apps/desktop/src/components/InteractiveInput.tsx +++ b/apps/desktop/src/components/InteractiveInput.tsx @@ -163,13 +163,12 @@ export const InteractiveInput: React.FC = ({ disabled={disabled} maxLength={maxLength} className={` - block w-full rounded-lg border + block w-full rounded-lg border ${getStatusColor()} ${icon && iconPosition === 'left' || type === 'search' ? 'pl-10' : 'pl-3'} ${showClearButton || showPasswordToggle || getStatusIcon() || (icon && iconPosition === 'right') ? 'pr-10' : 'pr-3'} py-2.5 text-sm placeholder-gray-400 - focus:outline-none disabled:bg-gray-50 disabled:text-gray-500 disabled:cursor-not-allowed ${isFocused ? 'shadow-sm' : ''} ${error ? 'animate-error-shake' : ''} @@ -209,11 +208,6 @@ export const InteractiveInput: React.FC = ({ {icon} )} - - {/* 焦点指示器 */} - {isFocused && ( -
- )}
{/* 底部信息 */} @@ -285,147 +279,3 @@ export const SearchInput: React.FC = ({ /> ); }; - -/** - * 交互式文本区域组件 - */ -interface InteractiveTextareaProps { - value?: string; - onChange?: (value: string) => void; - onFocus?: () => void; - onBlur?: () => void; - placeholder?: string; - label?: string; - error?: string; - success?: string; - hint?: string; - required?: boolean; - disabled?: boolean; - rows?: number; - maxLength?: number; - className?: string; - textareaClassName?: string; -} - -export const InteractiveTextarea: React.FC = ({ - value = '', - onChange, - onFocus, - onBlur, - placeholder, - label, - error, - success, - hint, - required = false, - disabled = false, - rows = 4, - maxLength, - className = '', - textareaClassName = '', -}) => { - const [isFocused, setIsFocused] = useState(false); - const [internalValue, setInternalValue] = useState(value); - - useEffect(() => { - setInternalValue(value); - }, [value]); - - const handleChange = (e: React.ChangeEvent) => { - const newValue = e.target.value; - setInternalValue(newValue); - onChange?.(newValue); - }; - - const handleFocus = () => { - setIsFocused(true); - onFocus?.(); - }; - - const handleBlur = () => { - setIsFocused(false); - onBlur?.(); - }; - - const getStatusColor = () => { - if (error) return 'border-red-300 focus:border-red-500 focus:ring-red-500'; - if (success) return 'border-green-300 focus:border-green-500 focus:ring-green-500'; - return 'border-gray-300 focus:border-primary-500 focus:ring-primary-500'; - }; - - return ( -
- {/* 标签 */} - {label && ( - - )} - - {/* 文本区域容器 */} -
-