Spaces:
Build error
Build error
Upload components/ui/badge.jsx with huggingface_hub
Browse files- components/ui/badge.jsx +26 -0
components/ui/badge.jsx
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as React from "react"
|
| 2 |
+
import { cva } from "class-variance-authority"
|
| 3 |
+
import { cn } from "@/lib/utils"
|
| 4 |
+
|
| 5 |
+
const badgeVariants = cva(
|
| 6 |
+
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
| 7 |
+
{
|
| 8 |
+
variants: {
|
| 9 |
+
variant: {
|
| 10 |
+
default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
|
| 11 |
+
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
| 12 |
+
destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
| 13 |
+
outline: "text-foreground",
|
| 14 |
+
},
|
| 15 |
+
},
|
| 16 |
+
defaultVariants: {
|
| 17 |
+
variant: "default",
|
| 18 |
+
},
|
| 19 |
+
}
|
| 20 |
+
)
|
| 21 |
+
|
| 22 |
+
function Badge({ className, variant, ...props }) {
|
| 23 |
+
return <div className={cn(badgeVariants({ variant }), className)} {...props} />
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
export { Badge, badgeVariants }
|