Web interface (React/TS, shadcn, pure OpenAI-API client) under web/ (#23)

This commit is contained in:
ZacharyZcR
2026-07-10 16:07:29 +08:00
committed by GitHub
parent 8f99e12b5e
commit a2942b2172
21 changed files with 2810 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
import * as React from "react"
import { cn } from "@/lib/utils"
function Badge({ className, ...props }: React.ComponentProps<"span">) {
return <span data-slot="badge" className={cn("inline-flex items-center rounded-full border border-border px-2 py-0.5 text-[11px] font-medium text-muted-foreground", className)} {...props} />
}
export { Badge }
+26
View File
@@ -0,0 +1,26 @@
import * as React from "react"
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils"
const buttonVariants = cva(
"inline-flex items-center justify-center gap-2 rounded-lg text-sm font-medium transition-colors outline-none disabled:pointer-events-none disabled:opacity-45 focus-visible:ring-2 focus-visible:ring-ring",
{
variants: {
variant: {
default: "bg-primary text-primary-foreground shadow-[0_0_24px_-8px_var(--primary)] hover:bg-primary/90",
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
ghost: "text-muted-foreground hover:bg-secondary hover:text-foreground",
destructive: "bg-destructive/15 text-destructive hover:bg-destructive/25",
},
size: { default: "h-10 px-4", sm: "h-8 px-3 text-xs", icon: "size-10" },
},
defaultVariants: { variant: "default", size: "default" },
},
)
function Button({ className, variant, size, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants>) {
return <button data-slot="button" className={cn(buttonVariants({ variant, size, className }))} {...props} />
}
export { Button, buttonVariants }
+16
View File
@@ -0,0 +1,16 @@
import * as React from "react"
import { cn } from "@/lib/utils"
function Input({ className, type, ...props }: React.ComponentProps<"input">) {
return (
<input
type={type}
data-slot="input"
className={cn("h-10 w-full rounded-lg border border-border bg-input/50 px-3 text-sm outline-none transition focus:border-primary/60 focus:ring-2 focus:ring-primary/15", className)}
{...props}
/>
)
}
export { Input }
+15
View File
@@ -0,0 +1,15 @@
import * as React from "react"
import { cn } from "@/lib/utils"
function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
return (
<textarea
data-slot="textarea"
className={cn("min-h-20 w-full resize-none rounded-xl border border-border bg-transparent px-4 py-3 text-sm leading-6 outline-none placeholder:text-muted-foreground focus:border-primary/60", className)}
{...props}
/>
)
}
export { Textarea }