20 lines · 986 BRaw
| 1 | import type { ComponentProps } from "react"; |
| 2 | import { cn } from "../ui/cn"; |
| 3 | |
| 4 | function Root({ className, ...props }: ComponentProps<"div">) { |
| 5 | return <div className={cn("flex flex-col overflow-hidden rounded-panel bg-panel shadow-card", className)} {...props} />; |
| 6 | } |
| 7 | |
| 8 | function Secondary({ className, ...props }: ComponentProps<"div">) { |
| 9 | return <div className={cn("flex min-h-10 items-center gap-2 px-4 py-2 text-compact font-medium text-ink shadow-[inset_0_-1px_0_var(--hairline)] [&_svg]:size-4 [&_svg]:text-faint", className)} {...props} />; |
| 10 | } |
| 11 | |
| 12 | function Primary({ className, ...props }: ComponentProps<"div">) { |
| 13 | return <div className={cn("flex flex-col gap-2 p-4", className)} {...props} />; |
| 14 | } |
| 15 | |
| 16 | /** |
| 17 | * A card: a panel on a soft shadow ring. It gives a page its structure: every list, table, file and form sits |
| 18 | * in one. `Secondary` is its header row, divided by a hairline; `Primary` holds padded content. |
| 19 | */ |
| 20 | export const LayerCard = Object.assign(Root, { Primary, Secondary }); |