forked from Dshield-xyz/Dshield
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCard.tsx
More file actions
55 lines (51 loc) · 1.21 KB
/
Copy pathCard.tsx
File metadata and controls
55 lines (51 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import { cva, type VariantProps } from "class-variance-authority";
import { cn } from "@/lib/cn";
const card = cva("aurora-border rounded-2xl border bg-zinc-900/70 backdrop-blur-sm", {
variants: {
border: {
default: "border-zinc-800",
brand: "border-brand-500/30 bg-brand-950/10",
},
interactive: {
true: "transition-all duration-300 hover:-translate-y-0.5 hover:border-brand-500/40 hover:shadow-lg hover:shadow-brand-950/40",
},
padding: {
none: "",
sm: "p-4",
md: "p-6",
},
},
defaultVariants: {
border: "default",
padding: "md",
},
});
export interface CardProps
extends React.HTMLAttributes<HTMLDivElement>,
VariantProps<typeof card> {}
export function Card({
className,
border,
interactive,
padding,
...props
}: CardProps) {
return (
<div
className={cn(card({ border, interactive, padding }), className)}
{...props}
/>
);
}
/** Small uppercase-weight section label used as a card heading. */
export function CardLabel({
className,
...props
}: React.HTMLAttributes<HTMLHeadingElement>) {
return (
<h3
className={cn("text-sm font-medium text-zinc-400", className)}
{...props}
/>
);
}