Skip to content
Myr

table.tsx

This file

Path

apps/web/src/components/ui/table.tsx

113 lines · 2.3 KiB · TypeScript

Last changed by

Draw text, controls, prose and code from one set of tokensoscabrielbefore adoption60f862e

History of this file

Take 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–11why, one step back
1import { cn } from "cn";
2import * as React from "react";34function Table({ className, ...props }: React.ComponentProps<"table">) {5 return (6 <div7 data-slot="table-container"8 className="relative w-full overflow-x-auto"9 >10 <table11 data-slot="table"

Draw text, controls, prose and code from one set of tokensoscabrielbefore adoption60f862e

line 12why, one step back
12 className={cn("text-ui w-full caption-bottom", 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 13–97why, one step back
13 {...props}
14 />15 </div>16 );17}1819function TableHeader({ className, ...props }: React.ComponentProps<"thead">) {20 return (21 <thead22 data-slot="table-header"23 className={cn("[&_tr]:border-b", className)}24 {...props}25 />26 );27}2829function TableBody({ className, ...props }: React.ComponentProps<"tbody">) {30 return (31 <tbody32 data-slot="table-body"33 className={cn("[&_tr:last-child]:border-0", className)}34 {...props}35 />36 );37}3839function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">) {40 return (41 <tfoot42 data-slot="table-footer"43 className={cn(44 "bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",45 className46 )}47 {...props}48 />49 );50}5152function TableRow({ className, ...props }: React.ComponentProps<"tr">) {53 return (54 <tr55 data-slot="table-row"56 className={cn(57 "hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",58 className59 )}60 {...props}61 />62 );63}6465function TableHead({ className, ...props }: React.ComponentProps<"th">) {66 return (67 <th68 data-slot="table-head"69 className={cn(70 "text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0",71 className72 )}73 {...props}74 />75 );76}7778function TableCell({ className, ...props }: React.ComponentProps<"td">) {79 return (80 <td81 data-slot="table-cell"82 className={cn(83 "p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",84 className85 )}86 {...props}87 />88 );89}9091function TableCaption({92 className,93 ...props94}: React.ComponentProps<"caption">) {95 return (96 <caption97 data-slot="table-caption"

Draw text, controls, prose and code from one set of tokensoscabrielbefore adoption60f862e

line 98why, one step back
98 className={cn("text-muted-foreground text-label mt-4", 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 99–113why, one step back
99 {...props}
100 />101 );102}103104export {105 Table,106 TableHeader,107 TableBody,108 TableFooter,109 TableHead,110 TableRow,111 TableCell,112 TableCaption,113};