mirror of
https://github.com/dong-nz/cv.git
synced 2026-11-22 16:10:40 +07:00
- React + TypeScript + Vite + React Router v6 - Dark/light/system theme toggle (fixed cycle from 'system' state) - Multi-page SPA: Home, About, Experience, Projects, Engineering, Contact - Responsive layout with mobile menu - Data-driven sections (profile, skills, experience, projects) - CSS Modules-compatible with CSS variables for theming - Accessibility: skip-link, ARIA labels, keyboard navigation
32 lines
749 B
TypeScript
32 lines
749 B
TypeScript
import { forwardRef } from 'react'
|
|
import type { ComponentPropsWithoutRef } from 'react'
|
|
|
|
type CardVariant = 'default' | 'elevated' | 'featured'
|
|
|
|
interface CardProps extends ComponentPropsWithoutRef<'div'> {
|
|
variant?: CardVariant
|
|
children: React.ReactNode
|
|
}
|
|
|
|
const variantClasses: Record<CardVariant, string> = {
|
|
default: 'card',
|
|
elevated: 'card card-elevated',
|
|
featured: 'card card-featured',
|
|
}
|
|
|
|
export const Card = forwardRef<HTMLDivElement, CardProps>(
|
|
({ variant = 'default', className = '', children, ...props }, ref) => {
|
|
return (
|
|
<div
|
|
className={`${variantClasses[variant]} ${className}`.trim()}
|
|
ref={ref}
|
|
{...props}
|
|
>
|
|
{children}
|
|
</div>
|
|
)
|
|
}
|
|
)
|
|
|
|
Card.displayName = 'Card'
|