// TextFieldContent.tsx — WING-OPS Text Field 컴포넌트 상세 페이지 (다크/라이트 테마 지원) import type { DesignTheme } from './designTheme'; // ---------- 타입 ---------- interface InputFieldStyle { bg: string; border: string; textColor: string; placeholderColor: string; borderWidth?: string; opacity?: string; } interface StateRow { state: string; badge: string; placeholder: string; hasCursor: boolean; style: InputFieldStyle; showClear?: boolean; showSparkle?: boolean; } // ---------- 헬퍼 데이터 ---------- const getDarkStateRows = (): StateRow[] => [ { state: 'Enabled', badge: 'Enabled', placeholder: '플레이스홀더', hasCursor: false, style: { bg: '#1e293b', border: '#334155', textColor: '#e2e8f0', placeholderColor: '#64748b' }, }, { state: 'Focused', badge: 'Focused', placeholder: '플레이스홀더', hasCursor: true, style: { bg: '#1e293b', border: '#e2e8f0', textColor: '#e2e8f0', placeholderColor: '#64748b', borderWidth: '2px', }, }, { state: 'Error', badge: 'Error', placeholder: '플레이스홀더', hasCursor: false, style: { bg: '#1e293b', border: '#ef4444', textColor: '#e2e8f0', placeholderColor: '#64748b' }, }, { state: 'Error Focused', badge: 'Error Focused', placeholder: '플레이스홀더', hasCursor: true, style: { bg: '#1e293b', border: '#ef4444', textColor: '#e2e8f0', placeholderColor: '#64748b', borderWidth: '2px', }, }, { state: 'Disabled', badge: 'Disabled', placeholder: '플레이스홀더', hasCursor: false, style: { bg: 'rgba(255,255,255,0.02)', border: '#1e293b', textColor: '#e2e8f0', placeholderColor: '#64748b', opacity: '0.4', }, }, { state: 'Read Only', badge: 'Read Only', placeholder: '플레이스홀더', hasCursor: false, style: { bg: 'rgba(255,255,255,0.02)', border: '#334155', textColor: '#e2e8f0', placeholderColor: '#64748b', }, }, { state: 'AI Loading', badge: 'AI Loading', placeholder: '단서를 모아서 추리 중...', hasCursor: false, showSparkle: true, style: { bg: 'rgba(255,255,255,0.02)', border: '#334155', textColor: '#e2e8f0', placeholderColor: '#64748b', }, }, ]; const getLightStateRows = (): StateRow[] => [ { state: 'Enabled', badge: 'Enabled', placeholder: '플레이스홀더', hasCursor: false, style: { bg: '#fff', border: '#d1d5db', textColor: '#1f2937', placeholderColor: '#9ca3af' }, }, { state: 'Focused', badge: 'Focused', placeholder: '플레이스홀더', hasCursor: true, style: { bg: '#fff', border: '#1f2937', textColor: '#1f2937', placeholderColor: '#9ca3af', borderWidth: '2px', }, }, { state: 'Error', badge: 'Error', placeholder: '플레이스홀더', hasCursor: false, style: { bg: '#fff', border: '#ef4444', textColor: '#1f2937', placeholderColor: '#9ca3af' }, }, { state: 'Error Focused', badge: 'Error Focused', placeholder: '플레이스홀더', hasCursor: true, style: { bg: '#fff', border: '#ef4444', textColor: '#1f2937', placeholderColor: '#9ca3af', borderWidth: '2px', }, }, { state: 'Disabled', badge: 'Disabled', placeholder: '플레이스홀더', hasCursor: false, style: { bg: '#f9fafb', border: '#e5e7eb', textColor: '#1f2937', placeholderColor: '#9ca3af', opacity: '0.4', }, }, { state: 'Read Only', badge: 'Read Only', placeholder: '플레이스홀더', hasCursor: false, style: { bg: '#f9fafb', border: '#d1d5db', textColor: '#1f2937', placeholderColor: '#9ca3af' }, }, { state: 'AI Loading', badge: 'AI Loading', placeholder: '단서를 모아서 추리 중...', hasCursor: false, showSparkle: true, style: { bg: '#f9fafb', border: '#d1d5db', textColor: '#1f2937', placeholderColor: '#9ca3af' }, }, ]; // ---------- Props ---------- interface TextFieldContentProps { theme: DesignTheme; } // ---------- 컴포넌트 ---------- export const TextFieldContent = ({ theme }: TextFieldContentProps) => { const t = theme; const isDark = t.mode === 'dark'; const sectionCardBg = isDark ? 'rgba(255,255,255,0.03)' : '#f5f5f5'; const dividerColor = isDark ? 'rgba(255,255,255,0.08)' : '#e5e7eb'; const annotationColor = '#8b5cf6'; // 입력 필드 공통 스타일 (Anatomy, Guideline용) const fieldBg = isDark ? '#1e293b' : '#fff'; const fieldBorder = isDark ? '#334155' : '#d1d5db'; const fieldText = isDark ? '#e2e8f0' : '#1f2937'; const fieldPlaceholder = isDark ? '#64748b' : '#9ca3af'; const stateRows = isDark ? getDarkStateRows() : getLightStateRows(); return (
Components
사용자로부터 텍스트 데이터를 입력받는 기본 입력 컴포넌트입니다.
단일 행 텍스트를 입력받는 필드입니다.
입력 필드의 외곽 영역입니다. 테두리, 곡률, 내부 여백을 정의합니다.
height: 44px (Medium)
padding: 12px (좌우)
border-radius: 6px
값이 입력되지 않았을 때 표시되는 안내 텍스트입니다. 입력 시 사라집니다.
입력 필드의 용도를 설명하는 텍스트입니다. 필수 항목은 * 표시로 구분합니다.
사용자가 실제로 입력한 텍스트입니다. 플레이스홀더보다 진한 색상으로 표시됩니다.
입력값이 있을 때 표시되는 초기화 버튼입니다. 클릭 시 입력값을 삭제합니다.
입력 필드 하단에 표시되는 보조 텍스트입니다. 안내 또는 에러 메시지로 사용됩니다.
여러 줄의 텍스트를 입력받는 필드입니다.
텍스트 영역의 외곽 컨테이너입니다. 기본 높이 112px이며 사용자가 리사이즈할 수 있습니다.
height: 112px (default)
padding: 12px
border-radius: 6px
resize: vertical
값이 입력되지 않았을 때 표시되는 안내 텍스트입니다.
텍스트 영역의 용도를 설명하는 라벨입니다.
사용자가 입력한 여러 줄의 텍스트입니다.
입력값 초기화 버튼입니다. 텍스트 영역 우상단에 표시됩니다.
텍스트 영역 하단의 도움말 또는 에러 메시지입니다.