Import source: src/components/ui/badge
Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality.
This commit is contained in:
@@ -0,0 +1,26 @@
|
|||||||
|
import { cva, type VariantProps } from "class-variance-authority";
|
||||||
|
import { cn } from "@/lib/utils";
|
||||||
|
|
||||||
|
const badgeVariants = cva(
|
||||||
|
"inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-medium",
|
||||||
|
{
|
||||||
|
variants: {
|
||||||
|
variant: {
|
||||||
|
default: "bg-secondary/90 text-secondary-foreground ring-1 ring-border/70",
|
||||||
|
success: "bg-success/10 text-success ring-1 ring-success/30",
|
||||||
|
warning: "bg-warning/10 text-warning ring-1 ring-warning/30",
|
||||||
|
danger: "bg-destructive/10 text-destructive ring-1 ring-destructive/30",
|
||||||
|
outline: "bg-card/60 ring-1 ring-border/80",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
defaultVariants: { variant: "default" },
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
export function Badge({
|
||||||
|
className,
|
||||||
|
variant,
|
||||||
|
...props
|
||||||
|
}: React.HTMLAttributes<HTMLSpanElement> & VariantProps<typeof badgeVariants>) {
|
||||||
|
return <span className={cn(badgeVariants({ variant, className }))} {...props} />;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user