Add web frontend

This commit is contained in:
2026-02-13 23:15:12 -08:00
parent 5faa57a741
commit 16a668b6ee
37 changed files with 4149 additions and 69 deletions

View File

@@ -0,0 +1,33 @@
import { cva, type VariantProps } from "class-variance-authority";
import type { JSX } from "preact";
import { cn } from "@/lib/utils";
const buttonVariants = cva(
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
{
variants: {
variant: {
default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
ghost: "hover:bg-accent hover:text-accent-foreground",
},
size: {
default: "h-10 px-4 py-2",
sm: "h-8 rounded-md px-3 text-xs",
lg: "h-11 rounded-md px-8",
icon: "h-9 w-9",
},
},
defaultVariants: {
variant: "default",
size: "default",
},
}
);
type ButtonProps = JSX.ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<typeof buttonVariants>;
export function Button({ className, variant, size, ...props }: ButtonProps) {
return <button className={cn(buttonVariants({ variant, size }), className)} {...props} />;
}

View File

@@ -0,0 +1,14 @@
import type { JSX } from "preact";
import { cn } from "@/lib/utils";
export function Input({ className, ...props }: JSX.InputHTMLAttributes<HTMLInputElement>) {
return (
<input
className={cn(
"flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
className
)}
{...props}
/>
);
}

View File

@@ -0,0 +1,11 @@
import type { ComponentChildren } from "preact";
import { cn } from "@/lib/utils";
type ScrollAreaProps = {
className?: string;
children: ComponentChildren;
};
export function ScrollArea({ className, children }: ScrollAreaProps) {
return <div className={cn("overflow-y-auto", className)}>{children}</div>;
}

View File

@@ -0,0 +1,9 @@
import { cn } from "@/lib/utils";
type SeparatorProps = {
className?: string;
};
export function Separator({ className }: SeparatorProps) {
return <div className={cn("h-px w-full bg-border", className)} />;
}

View File

@@ -0,0 +1,14 @@
import type { JSX } from "preact";
import { cn } from "@/lib/utils";
export function Textarea({ className, ...props }: JSX.TextareaHTMLAttributes<HTMLTextAreaElement>) {
return (
<textarea
className={cn(
"flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
className
)}
{...props}
/>
);
}