feat: polish intelligent answer interactions

This commit is contained in:
2026-10-29 18:39:50 +08:00
parent 9474788db6
commit 1ee21d1c7f
26 changed files with 1762 additions and 327 deletions
+29
View File
@@ -0,0 +1,29 @@
import type { ComponentProps } from "react";
import { cva, type VariantProps } from "class-variance-authority";
import { cn } from "./cn";
const alertVariants = cva(
"relative grid w-full min-w-0 grid-cols-[0_1fr] items-start gap-y-1 rounded-lg border p-4 text-sm has-[>svg]:grid-cols-[1rem_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5",
{
variants: {
variant: {
default: "bg-card text-card-foreground",
destructive: "border-destructive/50 bg-card text-destructive"
}
},
defaultVariants: { variant: "default" }
}
);
// Local shadcn/ui composition, adapted to the application's semantic tokens.
export function Alert({ className, variant, ...props }: ComponentProps<"div"> & VariantProps<typeof alertVariants>) {
return <div data-slot="alert" role="alert" className={cn(alertVariants({ variant }), className)} {...props} />;
}
export function AlertTitle({ className, ...props }: ComponentProps<"div">) {
return <div data-slot="alert-title" className={cn("col-start-2 min-w-0 font-medium leading-5", className)} {...props} />;
}
export function AlertDescription({ className, ...props }: ComponentProps<"div">) {
return <div data-slot="alert-description" className={cn("col-start-2 min-w-0 text-sm leading-6", className)} {...props} />;
}