import { cn } from '@gentleduck/libs/cn'
import { Badge as RxBadge } from '@gentleduck/registry-ui/badge'
import { Button as RxButton } from '@gentleduck/registry-ui/button'
import { CardContent, CardHeader, CardTitle, Card as RxCard } from '@gentleduck/registry-ui/card'
import { Input as RxInput } from '@gentleduck/registry-ui/input'
import { Textarea as RxTextarea } from '@gentleduck/registry-ui/textarea'
import type React from 'react'
export function Card({
title,
children,
actions,
}: {
title?: string
children: React.ReactNode
actions?: React.ReactNode
}) {
return (
{(title || actions) && (
{title && (
{title}
)}
{actions}
)}
{children}
)
}
export function Button({
children,
onClick,
variant = 'default',
disabled,
type = 'button',
className,
}: {
children: React.ReactNode
onClick?: () => void
variant?: 'default' | 'primary' | 'ghost' | 'danger'
disabled?: boolean
type?: 'button' | 'submit'
className?: string
}) {
const rxVariant =
variant === 'primary' ? 'default' : variant === 'danger' ? 'destructive' : variant === 'ghost' ? 'ghost' : 'outline'
return (
{children}
)
}
export function Field({ label, children }: { label: string; children: React.ReactNode }) {
return (
{label}
{children}
)
}
export function Input(props: React.InputHTMLAttributes) {
return
}
export function TextArea(props: React.TextareaHTMLAttributes) {
return
}
export function Badge({
children,
tone = 'neutral',
className,
}: {
children: React.ReactNode
tone?: 'neutral' | 'allow' | 'deny' | 'info' | 'warn'
className?: string
}) {
const variant =
tone === 'allow'
? 'default'
: tone === 'deny'
? 'destructive'
: tone === 'info'
? 'secondary'
: tone === 'warn'
? 'outline'
: 'outline'
const toneCls =
tone === 'allow'
? 'bg-lime-500/10 text-lime-400 border-lime-500/35 hover:bg-lime-500/15'
: tone === 'deny'
? 'bg-red-500/10 text-red-400 border-red-500/35 hover:bg-red-500/15'
: tone === 'info'
? 'bg-sky-500/10 text-sky-400 border-sky-500/35 hover:bg-sky-500/15'
: tone === 'warn'
? 'bg-amber-500/10 text-amber-400 border-amber-500/35 hover:bg-amber-500/15'
: ''
return (
{children}
)
}
export function Empty({ message }: { message: string }) {
return (
{message}
)
}
export function Alert({ kind, children }: { kind: 'error' | 'success'; children: React.ReactNode }) {
return (
{children}
)
}