// ComponentsOverview.tsx — Components 탭 Overview 카드 그리드
import type { DesignTheme } from './designTheme';
// ---------- 타입 ----------
interface OverviewCard {
id: string;
label: string;
thumbnail: (isDark: boolean) => React.ReactNode;
}
// ---------- 썸네일 구현 ----------
const ButtonsThumbnail = ({ isDark }: { isDark: boolean }) => {
const accent = isDark ? '#4cd7f6' : '#06b6d4';
const secondaryBg = isDark ? 'rgba(255,255,255,0.07)' : '#e2e8f0';
const secondaryText = isDark ? 'rgba(223,226,243,0.85)' : '#475569';
const outlineBorder = isDark ? 'rgba(76,215,246,0.40)' : 'rgba(6,182,212,0.50)';
const buttons = [
{ label: 'Primary', bg: accent, border: accent, color: isDark ? '#0a0e1a' : '#ffffff' },
{ label: 'Secondary', bg: secondaryBg, border: 'transparent', color: secondaryText },
{ label: 'Outline', bg: 'transparent', border: outlineBorder, color: accent },
];
return (
{buttons.map(({ label, bg, border, color }) => (
{label}
))}
);
};
const TextInputsThumbnail = ({ isDark }: { isDark: boolean }) => {
const labelColor = isDark ? 'rgba(194,198,214,0.80)' : '#64748b';
const inputBg = isDark ? 'rgba(255,255,255,0.04)' : '#ffffff';
const inputBorder = isDark ? 'rgba(255,255,255,0.12)' : '#cbd5e1';
const placeholderColor = isDark ? 'rgba(140,144,159,0.60)' : '#94a3b8';
const accentBorder = isDark ? '#4cd7f6' : '#06b6d4';
return (
{/* 라벨 + 기본 입력 */}
{/* 포커스 상태 입력 */}
);
};
// ---------- 카드 정의 ----------
const OVERVIEW_CARDS: OverviewCard[] = [
{
id: 'buttons',
label: 'Buttons',
thumbnail: (isDark) => ,
},
{
id: 'text-field',
label: 'Text Field',
thumbnail: (isDark) => ,
},
];
// ---------- Props ----------
interface ComponentsOverviewProps {
theme: DesignTheme;
onNavigate: (id: string) => void;
}
// ---------- 컴포넌트 ----------
const ComponentsOverview = ({ theme, onNavigate }: ComponentsOverviewProps) => {
const t = theme;
const isDark = t.mode === 'dark';
const cardBg = isDark ? 'rgba(255,255,255,0.03)' : '#f5f5f5';
const cardBorder = isDark ? 'rgba(255,255,255,0.06)' : '#e5e5e5';
const thumbnailBorderBottom = isDark ? 'rgba(255,255,255,0.06)' : '#e0e0e0';
return (
{/* ── 헤더 영역 ── */}
Components
Overview
재사용 가능한 UI 컴포넌트 카탈로그입니다.
{/* ── 3열 카드 그리드 ── */}
{OVERVIEW_CARDS.map((card) => (
onNavigate(card.id)}
onMouseEnter={(e) => {
const el = e.currentTarget;
el.style.transform = 'scale(1.025)';
el.style.boxShadow = isDark
? '0 8px 24px rgba(0,0,0,0.35)'
: '0 6px 18px rgba(0,0,0,0.10)';
el.style.borderColor = isDark ? 'rgba(76,215,246,0.22)' : 'rgba(6,182,212,0.28)';
}}
onMouseLeave={(e) => {
const el = e.currentTarget;
el.style.transform = 'scale(1)';
el.style.boxShadow = 'none';
el.style.borderColor = cardBorder;
}}
>
{/* 썸네일 영역 */}
{card.thumbnail(isDark)}
{/* 카드 라벨 */}
{card.label}
))}
);
};
export default ComponentsOverview;