@stereopt/data-table 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -64,6 +64,55 @@ function TableHeader({ className, ...props }) {
64
64
  }
65
65
  );
66
66
  }
67
+ function TableBody({ className, ...props }) {
68
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
69
+ "tbody",
70
+ {
71
+ "data-slot": "table-body",
72
+ className: cn("[&_tr:last-child]:border-0", className),
73
+ ...props
74
+ }
75
+ );
76
+ }
77
+ function TableRow({ className, ...props }) {
78
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
79
+ "tr",
80
+ {
81
+ "data-slot": "table-row",
82
+ className: cn(
83
+ "border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",
84
+ className
85
+ ),
86
+ ...props
87
+ }
88
+ );
89
+ }
90
+ function TableHead({ className, ...props }) {
91
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
92
+ "th",
93
+ {
94
+ "data-slot": "table-head",
95
+ className: cn(
96
+ "h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",
97
+ className
98
+ ),
99
+ ...props
100
+ }
101
+ );
102
+ }
103
+ function TableCell({ className, ...props }) {
104
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
105
+ "td",
106
+ {
107
+ "data-slot": "table-cell",
108
+ className: cn(
109
+ "p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",
110
+ className
111
+ ),
112
+ ...props
113
+ }
114
+ );
115
+ }
67
116
 
68
117
  // src/dataTable/DataTable.tsx
69
118
  var import_jsx_runtime2 = require("react/jsx-runtime");
@@ -74,8 +123,8 @@ function DataTable({ columns, data }) {
74
123
  getCoreRowModel: (0, import_react_table.getCoreRowModel)()
75
124
  });
76
125
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "rounded-md border overflow-hidden bg-red-500", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Table, { children: [
77
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TableHeader, { children: "Header Here" }),
78
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("pre", { children: JSON.stringify(table, null, 2) })
126
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TableHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TableHead, { children: "Head" }) }) }),
127
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TableBody, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TableCell, { children: "Cell" }) }) })
79
128
  ] }) }) });
80
129
  }
81
130
  // Annotate the CommonJS export names for ESM import in node:
package/dist/index.js CHANGED
@@ -40,6 +40,55 @@ function TableHeader({ className, ...props }) {
40
40
  }
41
41
  );
42
42
  }
43
+ function TableBody({ className, ...props }) {
44
+ return /* @__PURE__ */ jsx(
45
+ "tbody",
46
+ {
47
+ "data-slot": "table-body",
48
+ className: cn("[&_tr:last-child]:border-0", className),
49
+ ...props
50
+ }
51
+ );
52
+ }
53
+ function TableRow({ className, ...props }) {
54
+ return /* @__PURE__ */ jsx(
55
+ "tr",
56
+ {
57
+ "data-slot": "table-row",
58
+ className: cn(
59
+ "border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",
60
+ className
61
+ ),
62
+ ...props
63
+ }
64
+ );
65
+ }
66
+ function TableHead({ className, ...props }) {
67
+ return /* @__PURE__ */ jsx(
68
+ "th",
69
+ {
70
+ "data-slot": "table-head",
71
+ className: cn(
72
+ "h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",
73
+ className
74
+ ),
75
+ ...props
76
+ }
77
+ );
78
+ }
79
+ function TableCell({ className, ...props }) {
80
+ return /* @__PURE__ */ jsx(
81
+ "td",
82
+ {
83
+ "data-slot": "table-cell",
84
+ className: cn(
85
+ "p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",
86
+ className
87
+ ),
88
+ ...props
89
+ }
90
+ );
91
+ }
43
92
 
44
93
  // src/dataTable/DataTable.tsx
45
94
  import { jsx as jsx2, jsxs } from "react/jsx-runtime";
@@ -50,8 +99,8 @@ function DataTable({ columns, data }) {
50
99
  getCoreRowModel: getCoreRowModel()
51
100
  });
52
101
  return /* @__PURE__ */ jsx2("div", { className: "w-full", children: /* @__PURE__ */ jsx2("div", { className: "rounded-md border overflow-hidden bg-red-500", children: /* @__PURE__ */ jsxs(Table, { children: [
53
- /* @__PURE__ */ jsx2(TableHeader, { children: "Header Here" }),
54
- /* @__PURE__ */ jsx2("pre", { children: JSON.stringify(table, null, 2) })
102
+ /* @__PURE__ */ jsx2(TableHeader, { children: /* @__PURE__ */ jsx2(TableRow, { children: /* @__PURE__ */ jsx2(TableHead, { children: "Head" }) }) }),
103
+ /* @__PURE__ */ jsx2(TableBody, { children: /* @__PURE__ */ jsx2(TableRow, { children: /* @__PURE__ */ jsx2(TableCell, { children: "Cell" }) }) })
55
104
  ] }) }) });
56
105
  }
57
106
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stereopt/data-table",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Simple reusable React data table component",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",