card.tsx
This file
Path
apps/web/src/components/ui/card.tsx
102 lines · 2.5 KiB · TypeScript
Last changed by
Draw text, controls, prose and code from one set of tokensoscabrielbefore adoption60f862e
History of this fileTake it
The walk stopped after 200 commits: lines older than 678c8b8 point at it.
Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 1–13why, one step back1import { cn } from "cn";2import * as React from "react";34function Card({5 className,6 size = "default",7 ...props8}: React.ComponentProps<"div"> & { size?: "default" | "sm" }) {9 return (10 <div11 data-slot="card"12 data-size={size}13 className={cn(Draw text, controls, prose and code from one set of tokensoscabrielbefore adoption60f862e
line 14why, one step back14 "group/card bg-card text-card-foreground ring-input text-ui flex flex-col gap-(--card-spacing) overflow-hidden rounded-none py-(--card-spacing) ring-1 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-none *:[img:last-child]:rounded-none",Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 15–39why, one step back15 className16 )}17 {...props}18 />19 );20}2122function CardHeader({ className, ...props }: React.ComponentProps<"div">) {23 return (24 <div25 data-slot="card-header"26 className={cn(27 "group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-none px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",28 className29 )}30 {...props}31 />32 );33}3435function CardTitle({ className, ...props }: React.ComponentProps<"div">) {36 return (37 <div38 data-slot="card-title"39 className={cn(Draw text, controls, prose and code from one set of tokensoscabrielbefore adoption60f862e
line 40why, one step back40 "text-want group-data-[size=sm]/card:text-ui font-semibold",Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 41–51why, one step back41 className42 )}43 {...props}44 />45 );46}4748function CardDescription({ className, ...props }: React.ComponentProps<"div">) {49 return (50 <div51 data-slot="card-description"Draw text, controls, prose and code from one set of tokensoscabrielbefore adoption60f862e
line 52why, one step back52 className={cn("text-muted-foreground text-ui", className)}Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 53–102why, one step back53 {...props}54 />55 );56}5758function CardAction({ className, ...props }: React.ComponentProps<"div">) {59 return (60 <div61 data-slot="card-action"62 className={cn(63 "col-start-2 row-span-2 row-start-1 self-start justify-self-end",64 className65 )}66 {...props}67 />68 );69}7071function CardContent({ className, ...props }: React.ComponentProps<"div">) {72 return (73 <div74 data-slot="card-content"75 className={cn("px-(--card-spacing)", className)}76 {...props}77 />78 );79}8081function CardFooter({ className, ...props }: React.ComponentProps<"div">) {82 return (83 <div84 data-slot="card-footer"85 className={cn(86 "flex items-center rounded-none border-t p-(--card-spacing)",87 className88 )}89 {...props}90 />91 );92}9394export {95 Card,96 CardHeader,97 CardFooter,98 CardTitle,99 CardAction,100 CardDescription,101 CardContent,102};