PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.15
Yatra – Travel Booking & Tour Operator Software v3.0.15
3.0.15 3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 2.0.1 2.0.10 All 83 releases
yatra / resources / js / components / ui / table.tsx

table.tsx in Yatra – Travel Booking & Tour Operator Software 3.0.15, at resources/js/components/ui/table.tsx

74 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import * as React from "react";
2
3 const Table = React.forwardRef<
4 HTMLTableElement,
5 React.HTMLAttributes<HTMLTableElement>
6 >(({ className = "", ...props }, ref) => (
7 <div className="relative w-full overflow-auto">
8 <table
9 ref={ref}
10 className={`w-full caption-bottom text-sm ${className}`}
11 {...props}
12 />
13 </div>
14 ));
15 Table.displayName = "Table";
16
17 const TableHeader = React.forwardRef<
18 HTMLTableSectionElement,
19 React.HTMLAttributes<HTMLTableSectionElement>
20 >(({ className = "", ...props }, ref) => (
21 <thead ref={ref} className={`[&_tr]:border-b ${className}`} {...props} />
22 ));
23 TableHeader.displayName = "TableHeader";
24
25 const TableBody = React.forwardRef<
26 HTMLTableSectionElement,
27 React.HTMLAttributes<HTMLTableSectionElement>
28 >(({ className = "", ...props }, ref) => (
29 <tbody
30 ref={ref}
31 className={`[&_tr:last-child]:border-0 ${className}`}
32 {...props}
33 />
34 ));
35 TableBody.displayName = "TableBody";
36
37 const TableRow = React.forwardRef<
38 HTMLTableRowElement,
39 React.HTMLAttributes<HTMLTableRowElement>
40 >(({ className = "", ...props }, ref) => (
41 <tr
42 ref={ref}
43 className={`border-b transition-colors hover:bg-gray-50 dark:hover:bg-gray-800/50 data-[state=selected]:bg-gray-100 dark:data-[state=selected]:bg-gray-800 ${className}`}
44 {...props}
45 />
46 ));
47 TableRow.displayName = "TableRow";
48
49 const TableHead = React.forwardRef<
50 HTMLTableCellElement,
51 React.ThHTMLAttributes<HTMLTableCellElement>
52 >(({ className = "", ...props }, ref) => (
53 <th
54 ref={ref}
55 className={`h-12 px-4 text-left align-middle text-sm font-medium text-gray-500 dark:text-gray-400 [&:has([role=checkbox])]:pr-0 ${className}`}
56 {...props}
57 />
58 ));
59 TableHead.displayName = "TableHead";
60
61 const TableCell = React.forwardRef<
62 HTMLTableCellElement,
63 React.TdHTMLAttributes<HTMLTableCellElement>
64 >(({ className = "", ...props }, ref) => (
65 <td
66 ref={ref}
67 className={`p-4 align-middle text-sm [&:has([role=checkbox])]:pr-0 ${className}`}
68 {...props}
69 />
70 ));
71 TableCell.displayName = "TableCell";
72
73 export { Table, TableHeader, TableBody, TableHead, TableRow, TableCell };
74