import React, { forwardRef } from 'react'
// ===========================================================================
// Button
// ===========================================================================
export const Button = forwardRef(function Button(
{ variant = 'secondary', size = 'md', className = '', children, disabled, ...rest }, ref
) {
const base =
'inline-flex items-center justify-center gap-1.5 font-medium rounded transition-colors duration-150 ease-standard ' +
'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand/30 ' +
'disabled:opacity-40 disabled:cursor-not-allowed select-none whitespace-nowrap'
const variants = {
primary: 'bg-brand text-brand-fg hover:bg-brand-hover',
secondary: 'bg-surface text-ink border border-border hover:bg-surface-subtle',
ghost: 'text-ink-muted hover:bg-surface-muted hover:text-ink',
danger: 'bg-surface text-danger border border-border hover:bg-danger-subtle hover:border-danger/30',
success: 'bg-success text-white hover:bg-success-strong',
link: 'text-brand hover:text-brand-hover underline-offset-2 hover:underline',
}
const sizes = {
sm: 'h-7 px-2.5 text-label-sm',
md: 'h-9 px-3.5 text-label-md',
lg: 'h-11 px-5 text-label-md',
icon: 'h-9 w-9 text-label-md',
}
return (
)
})
// ===========================================================================
// Card / Surface
// ===========================================================================
export function Card({ className = '', children, ...rest }) {
return (
{children}
)
}
export function CardHeader({ title, description, action, className = '' }) {
return (
{title}
{description &&
{description}
}
{action}
)
}
export function CardBody({ className = '', children }) {
return {children}
}
// ===========================================================================
// Input + TextArea
// ===========================================================================
export const Input = forwardRef(function Input({ className = '', invalid, ...rest }, ref) {
return (
)
})
export const TextArea = forwardRef(function TextArea({ className = '', rows = 3, invalid, ...rest }, ref) {
return (
)
})
export function Select({ className = '', children, ...rest }) {
return (
)
}
// ===========================================================================
// Field — label + control + hint pattern
// ===========================================================================
export function Field({ label, hint, error, required, children, className = '' }) {
return (
)
}
// ===========================================================================
// Badge / Pill
// ===========================================================================
export function Badge({ variant = 'neutral', children, className = '' }) {
const variants = {
neutral: 'bg-surface-muted text-ink-muted border-border',
brand: 'bg-brand-subtle text-brand border-brand/15',
success: 'bg-success-subtle text-success-strong border-success/15',
warning: 'bg-warning-subtle text-warning-strong border-warning/15',
danger: 'bg-danger-subtle text-danger-strong border-danger/15',
info: 'bg-info-subtle text-info-strong border-info/15',
}
return (
{children}
)
}
// ===========================================================================
// Stat — used in the audit metrics row
// ===========================================================================
export function Stat({ label, value, hint, accent }) {
return (
{label}
{value}
{hint &&
{hint}
}
)
}
// ===========================================================================
// Empty state
// ===========================================================================
export function EmptyState({ title, description, action, icon }) {
return (
{icon &&
{icon}
}
{title}
{description &&
{description}
}
{action &&
{action}
}
)
}
// ===========================================================================
// PageHeader
// ===========================================================================
export function PageHeader({ title, description, actions }) {
return (
{title}
{description &&
{description}
}
{actions &&
{actions}
}
)
}
// ===========================================================================
// Keyboard hint chip
// ===========================================================================
export function Kbd({ children }) {
return (
{children}
)
}