forked from koshikraj/ottopus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcard.tsx
More file actions
40 lines (35 loc) · 1.13 KB
/
Copy pathcard.tsx
File metadata and controls
40 lines (35 loc) · 1.13 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
import type { HTMLAttributes } from 'react'
import { cn } from '@/lib/cn'
export interface CardProps extends HTMLAttributes<HTMLDivElement> {
/** Lifts the card off the page. Off by default — most surfaces sit flat. */
raised?: boolean
}
export function Card({ raised = false, className, ...props }: CardProps) {
return (
<div
className={cn(
'rounded-[var(--ot-radius-md)] border border-[var(--ot-border)] bg-[var(--ot-card)]',
raised && 'shadow-[var(--ot-shadow-card)]',
className,
)}
{...props}
/>
)
}
export function CardHeader({ className, ...props }: HTMLAttributes<HTMLDivElement>) {
return <div className={cn('px-5 pt-5 pb-3', className)} {...props} />
}
export function CardTitle({ className, ...props }: HTMLAttributes<HTMLHeadingElement>) {
return (
<h3
className={cn(
'font-display text-[17px] font-semibold tracking-[-0.02em] text-[var(--ot-text)]',
className,
)}
{...props}
/>
)
}
export function CardBody({ className, ...props }: HTMLAttributes<HTMLDivElement>) {
return <div className={cn('px-5 pb-5', className)} {...props} />
}