UNPKG

ivt

Version:

Ivt Components Library

1 lines 3.65 kB
{"version":3,"file":"table-BkDUCjpn.mjs","sources":["../../src/components/ui/table/table.tsx"],"sourcesContent":["import { cn } from \"@/lib/utils\";\nimport React from \"react\";\n\nfunction Table({ className, ...props }: React.ComponentProps<\"table\">) {\n\treturn (\n\t\t<table\n\t\t\tdata-slot=\"table\"\n\t\t\tclassName={cn(\"w-full caption-bottom text-sm\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableHeader({ className, ...props }: React.ComponentProps<\"thead\">) {\n\treturn <thead data-slot=\"table-header\" className={cn(\"[&_tr]:border-b\", className)} {...props} />;\n}\n\nfunction TableBody({ className, ...props }: React.ComponentProps<\"tbody\">) {\n\treturn (\n\t\t<tbody\n\t\t\tdata-slot=\"table-body\"\n\t\t\tclassName={cn(\"[&_tr:last-child]:border-0\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableFooter({ className, ...props }: React.ComponentProps<\"tfoot\">) {\n\treturn (\n\t\t<tfoot\n\t\t\tdata-slot=\"table-footer\"\n\t\t\tclassName={cn(\"bg-muted/50 border-t font-medium [&>tr]:last:border-b-0\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableRow({ className, ...props }: React.ComponentProps<\"tr\">) {\n\treturn (\n\t\t<tr\n\t\t\tdata-slot=\"table-row\"\n\t\t\tclassName={cn(\n\t\t\t\t\"border-b-border-grid-container hover:bg-muted data-[disabled=true]:bg-muted data-[state=selected]:bg-body border-b transition-colors *:data-[disabled=true]:pointer-events-none *:data-[disabled=true]:opacity-50\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableHead({ className, ...props }: React.ComponentProps<\"th\">) {\n\treturn (\n\t\t<th\n\t\t\tdata-slot=\"table-head\"\n\t\t\tclassName={cn(\n\t\t\t\t\"text-foreground h-12 px-2 text-left align-middle font-medium *:data-[disabled=true]:pointer-events-none *:data-[disabled=true]:opacity-50 [&:has([role=checkbox])]:pr-0\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableCell({ className, ...props }: React.ComponentProps<\"td\">) {\n\treturn (\n\t\t<td\n\t\t\tdata-slot=\"table-cell\"\n\t\t\tclassName={cn(\"p-4 align-middle [&:has([role=checkbox])]:pr-0\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableCaption({ className, ...props }: React.ComponentProps<\"caption\">) {\n\treturn (\n\t\t<caption\n\t\t\tdata-slot=\"table-caption\"\n\t\t\tclassName={cn(\"text-muted-foreground mt-4 text-sm\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption };\n"],"names":["Table","className","props","React","table","data-slot","cn","TableHeader","thead","TableBody","tbody","TableFooter","tfoot","TableRow","tr","TableHead","th","TableCell","td","TableCaption","caption"],"mappings":"8DAGA,SAASA,GAAMC,UAAEA,KAAcC,IAC9B,OACCC,EAACC,cAAAA,QAAAA,CACAC,YAAU,QACVJ,UAAWK,EAAG,gCAAiCL,MAC3CC,GAGP,CAEA,SAASK,GAAYN,UAAEA,KAAcC,IACpC,OAAOC,EAACK,cAAAA,QAAAA,CAAMH,YAAU,eAAeJ,UAAWK,EAAG,kBAAmBL,MAAgBC,GACzF,CAEA,SAASO,GAAUR,UAAEA,KAAcC,IAClC,OACCC,EAACO,cAAAA,QAAAA,CACAL,YAAU,aACVJ,UAAWK,EAAG,6BAA8BL,MACxCC,GAGP,CAEA,SAASS,GAAYV,UAAEA,KAAcC,IACpC,OACCC,EAACS,cAAAA,QAAAA,CACAP,YAAU,eACVJ,UAAWK,EAAG,0DAA2DL,MACrEC,GAGP,CAEA,SAASW,GAASZ,UAAEA,KAAcC,IACjC,OACCC,EAACW,cAAAA,KAAAA,CACAT,YAAU,YACVJ,UAAWK,EACV,oNACAL,MAEGC,GAGP,CAEA,SAASa,GAAUd,UAAEA,KAAcC,IAClC,OACCC,EAACa,cAAAA,KAAAA,CACAX,YAAU,aACVJ,UAAWK,EACV,0KACAL,MAEGC,GAGP,CAEA,SAASe,GAAUhB,UAAEA,KAAcC,IAClC,OACCC,EAACe,cAAAA,KAAAA,CACAb,YAAU,aACVJ,UAAWK,EAAG,iDAAkDL,MAC5DC,GAGP,CAEA,SAASiB,GAAalB,UAAEA,KAAcC,IACrC,OACCC,EAACiB,cAAAA,UAAAA,CACAf,YAAU,gBACVJ,UAAWK,EAAG,qCAAsCL,MAChDC,GAGP"}