scificn-ui v0.1.0 integrated copy-paste per its docs: Button/Panel/Badge/Card/Alert in components/ui/, cn() helper in lib/utils.ts, theme tokens in app/globals.css. Deliberate deviation from upstream: --text-muted #4A4A40 -> #6B6B5C (+12pt lightness) for readability on the near-black background (default SCI-FI theme only). Landing page proves the integration; no game UI yet.
74 lines
2.0 KiB
TypeScript
74 lines
2.0 KiB
TypeScript
import * as React from 'react'
|
|
import { cn } from '@/lib/utils'
|
|
|
|
const Card = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
({ className, ...props }, ref) => (
|
|
<div
|
|
ref={ref}
|
|
className={cn(
|
|
'bg-[var(--surface)] border border-[var(--border)]',
|
|
'text-[var(--text-secondary)] font-mono',
|
|
className
|
|
)}
|
|
{...props}
|
|
/>
|
|
)
|
|
)
|
|
Card.displayName = 'Card'
|
|
|
|
const CardHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
({ className, ...props }, ref) => (
|
|
<div
|
|
ref={ref}
|
|
className={cn('flex flex-col gap-1.5 p-4 border-b border-[var(--border)]', className)}
|
|
{...props}
|
|
/>
|
|
)
|
|
)
|
|
CardHeader.displayName = 'CardHeader'
|
|
|
|
const CardTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(
|
|
({ className, ...props }, ref) => (
|
|
<h3
|
|
ref={ref}
|
|
className={cn(
|
|
'text-sm font-semibold uppercase tracking-widest text-[var(--color-green)]',
|
|
className
|
|
)}
|
|
{...props}
|
|
/>
|
|
)
|
|
)
|
|
CardTitle.displayName = 'CardTitle'
|
|
|
|
const CardDescription = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(
|
|
({ className, ...props }, ref) => (
|
|
<p
|
|
ref={ref}
|
|
className={cn('text-xs text-[var(--text-muted)]', className)}
|
|
{...props}
|
|
/>
|
|
)
|
|
)
|
|
CardDescription.displayName = 'CardDescription'
|
|
|
|
const CardContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
({ className, ...props }, ref) => (
|
|
<div ref={ref} className={cn('p-4', className)} {...props} />
|
|
)
|
|
)
|
|
CardContent.displayName = 'CardContent'
|
|
|
|
const CardFooter = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
({ className, ...props }, ref) => (
|
|
<div
|
|
ref={ref}
|
|
className={cn('flex items-center p-4 border-t border-[var(--border)]', className)}
|
|
{...props}
|
|
/>
|
|
)
|
|
)
|
|
CardFooter.displayName = 'CardFooter'
|
|
|
|
export { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter }
|