feat: polish intelligent answer interactions
This commit is contained in:
@@ -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} />;
|
||||
}
|
||||
Reference in New Issue
Block a user