@stereopt/data-table 0.1.10 → 0.1.11

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
@@ -121,6 +121,49 @@ function TableCell({ className, ...props }) {
121
121
  );
122
122
  }
123
123
 
124
+ // src/components/ui/input.tsx
125
+ var import_jsx_runtime2 = require("react/jsx-runtime");
126
+ function Input({ className, type, ...props }) {
127
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
128
+ "input",
129
+ {
130
+ className: cn(
131
+ "h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
132
+ className
133
+ ),
134
+ "data-slot": "input",
135
+ type,
136
+ ...props
137
+ }
138
+ );
139
+ }
140
+
141
+ // src/dataTable/DataTableControls.tsx
142
+ var import_jsx_runtime3 = require("react/jsx-runtime");
143
+ var DataTableControls = ({
144
+ table,
145
+ search,
146
+ filters
147
+ }) => {
148
+ const value = table.getState().globalFilter ?? "";
149
+ const setValue = table.setGlobalFilter;
150
+ if (!filters || !search) return null;
151
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex items-center gap-4 pb-4", children: [
152
+ search && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
153
+ Input,
154
+ {
155
+ className: "max-w-sm",
156
+ onChange: (event) => setValue(() => event.target.value),
157
+ placeholder: search?.placeholder,
158
+ value
159
+ }
160
+ ),
161
+ filters?.map((filter) => {
162
+ return null;
163
+ })
164
+ ] });
165
+ };
166
+
124
167
  // src/components/ui/button.tsx
125
168
  var import_class_variance_authority = require("class-variance-authority");
126
169
 
@@ -170,7 +213,7 @@ function composeRefs(...refs) {
170
213
  }
171
214
 
172
215
  // node_modules/@radix-ui/react-slot/dist/index.mjs
173
- var import_jsx_runtime2 = require("react/jsx-runtime");
216
+ var import_jsx_runtime4 = require("react/jsx-runtime");
174
217
  // @__NO_SIDE_EFFECTS__
175
218
  function createSlot(ownerName) {
176
219
  const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
@@ -188,9 +231,9 @@ function createSlot(ownerName) {
188
231
  return child;
189
232
  }
190
233
  });
191
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: React2.isValidElement(newElement) ? React2.cloneElement(newElement, void 0, newChildren) : null });
234
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: React2.isValidElement(newElement) ? React2.cloneElement(newElement, void 0, newChildren) : null });
192
235
  }
193
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children });
236
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children });
194
237
  });
195
238
  Slot2.displayName = `${ownerName}.Slot`;
196
239
  return Slot2;
@@ -217,7 +260,7 @@ var SLOTTABLE_IDENTIFIER = /* @__PURE__ */ Symbol("radix.slottable");
217
260
  // @__NO_SIDE_EFFECTS__
218
261
  function createSlottable(ownerName) {
219
262
  const Slottable2 = ({ children }) => {
220
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children });
263
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children });
221
264
  };
222
265
  Slottable2.displayName = `${ownerName}.Slottable`;
223
266
  Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
@@ -266,7 +309,7 @@ function getElementRef(element) {
266
309
  }
267
310
 
268
311
  // src/components/ui/button.tsx
269
- var import_jsx_runtime3 = require("react/jsx-runtime");
312
+ var import_jsx_runtime5 = require("react/jsx-runtime");
270
313
  var buttonVariants = (0, import_class_variance_authority.cva)(
271
314
  "group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
272
315
  {
@@ -304,7 +347,7 @@ function Button({
304
347
  ...props
305
348
  }) {
306
349
  const Comp = asChild ? dist_exports.Root : "button";
307
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
350
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
308
351
  Comp,
309
352
  {
310
353
  className: cn(buttonVariants({ variant, size, className })),
@@ -437,25 +480,25 @@ var __iconNode4 = [
437
480
  var ChevronsRight = createLucideIcon("chevrons-right", __iconNode4);
438
481
 
439
482
  // src/dataTable/pagination/DataTablePagination.tsx
440
- var import_jsx_runtime4 = require("react/jsx-runtime");
483
+ var import_jsx_runtime6 = require("react/jsx-runtime");
441
484
  function DataTablePagination({
442
485
  table
443
486
  }) {
444
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-center justify-between px-2 pt-4", children: [
445
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "text-muted-foreground flex-1 text-sm", children: [
487
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center justify-between px-2 pt-4", children: [
488
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "text-muted-foreground flex-1 text-sm", children: [
446
489
  table.getFilteredRowModel().rows.length,
447
490
  " rows"
448
491
  ] }),
449
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-center space-x-6 lg:space-x-8", children: [
450
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex w-[100px] items-center justify-center text-sm font-medium", children: [
492
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center space-x-6 lg:space-x-8", children: [
493
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex w-[100px] items-center justify-center text-sm font-medium", children: [
451
494
  "Page ",
452
495
  table.getState().pagination.pageIndex + 1,
453
496
  " of",
454
497
  " ",
455
498
  table.getPageCount() || 1
456
499
  ] }),
457
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-center space-x-2", children: [
458
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
500
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center space-x-2", children: [
501
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
459
502
  Button,
460
503
  {
461
504
  className: "hidden size-8 lg:flex",
@@ -464,12 +507,12 @@ function DataTablePagination({
464
507
  size: "icon",
465
508
  variant: "outline",
466
509
  children: [
467
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "sr-only", children: "Go to first page" }),
468
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ChevronsLeft, {})
510
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "sr-only", children: "Go to first page" }),
511
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ChevronsLeft, {})
469
512
  ]
470
513
  }
471
514
  ),
472
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
515
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
473
516
  Button,
474
517
  {
475
518
  className: "size-8",
@@ -478,12 +521,12 @@ function DataTablePagination({
478
521
  size: "icon",
479
522
  variant: "outline",
480
523
  children: [
481
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "sr-only", children: "Go to previous page" }),
482
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ChevronLeft, {})
524
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "sr-only", children: "Go to previous page" }),
525
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ChevronLeft, {})
483
526
  ]
484
527
  }
485
528
  ),
486
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
529
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
487
530
  Button,
488
531
  {
489
532
  className: "size-8",
@@ -492,12 +535,12 @@ function DataTablePagination({
492
535
  size: "icon",
493
536
  variant: "outline",
494
537
  children: [
495
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "sr-only", children: "Go to next page" }),
496
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ChevronRight, {})
538
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "sr-only", children: "Go to next page" }),
539
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ChevronRight, {})
497
540
  ]
498
541
  }
499
542
  ),
500
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
543
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
501
544
  Button,
502
545
  {
503
546
  className: "hidden size-8 lg:flex",
@@ -506,8 +549,8 @@ function DataTablePagination({
506
549
  size: "icon",
507
550
  variant: "outline",
508
551
  children: [
509
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "sr-only", children: "Go to last page" }),
510
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ChevronsRight, {})
552
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "sr-only", children: "Go to last page" }),
553
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ChevronsRight, {})
511
554
  ]
512
555
  }
513
556
  )
@@ -516,9 +559,19 @@ function DataTablePagination({
516
559
  ] });
517
560
  }
518
561
 
562
+ // src/lib/search.ts
563
+ var import_match_sorter_utils = require("@tanstack/match-sorter-utils");
564
+ var fuzzyFilterFn = (searchableColumns) => (row, columnId, filterValue, addMeta) => {
565
+ if (!searchableColumns) return false;
566
+ if (!searchableColumns.includes(columnId)) return false;
567
+ const itemRank = (0, import_match_sorter_utils.rankItem)(row.getValue(columnId), filterValue);
568
+ addMeta({ itemRank });
569
+ return itemRank.passed;
570
+ };
571
+
519
572
  // src/dataTable/DataTable.tsx
520
573
  var import_react_table = require("@tanstack/react-table");
521
- var import_jsx_runtime5 = require("react/jsx-runtime");
574
+ var import_jsx_runtime7 = require("react/jsx-runtime");
522
575
  function DataTable({
523
576
  columns,
524
577
  data,
@@ -532,15 +585,24 @@ function DataTable({
532
585
  getFilteredRowModel: (0, import_react_table.getFilteredRowModel)(),
533
586
  getFacetedRowModel: (0, import_react_table.getFacetedRowModel)(),
534
587
  getFacetedUniqueValues: (0, import_react_table.getFacetedUniqueValues)(),
588
+ globalFilterFn: fuzzyFilterFn(config?.search?.filterFields),
535
589
  autoResetPageIndex: false,
536
590
  initialState: {
537
591
  columnVisibility: config?.columnVisibility
538
592
  }
539
593
  });
540
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "w-full", children: [
541
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "rounded-md border overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Table, { children: [
542
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(TableHeader, { className: "bg-muted", children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(TableRow, { children: headerGroup.headers.map((header) => {
543
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
594
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "w-full", children: [
595
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
596
+ DataTableControls,
597
+ {
598
+ filters: config?.filters,
599
+ search: config?.search,
600
+ table
601
+ }
602
+ ),
603
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "rounded-md border overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Table, { children: [
604
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TableHeader, { className: "bg-muted", children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TableRow, { children: headerGroup.headers.map((header) => {
605
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
544
606
  TableHead,
545
607
  {
546
608
  colSpan: header.colSpan,
@@ -553,17 +615,17 @@ function DataTable({
553
615
  header.id
554
616
  );
555
617
  }) }, headerGroup.id)) }),
556
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(TableBody, { children: table.getRowModel().rows?.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
618
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TableBody, { children: table.getRowModel().rows?.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
557
619
  TableRow,
558
620
  {
559
621
  "data-state": row.getIsSelected() && "selected",
560
- children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(TableCell, { className: "truncate max-w-0", children: (0, import_react_table.flexRender)(
622
+ children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TableCell, { className: "truncate max-w-0", children: (0, import_react_table.flexRender)(
561
623
  cell.column.columnDef.cell,
562
624
  cell.getContext()
563
625
  ) }, cell.id))
564
626
  },
565
627
  row.id
566
- )) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
628
+ )) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
567
629
  TableCell,
568
630
  {
569
631
  className: "h-24 text-center",
@@ -572,7 +634,7 @@ function DataTable({
572
634
  }
573
635
  ) }) })
574
636
  ] }) }),
575
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(DataTablePagination, { table })
637
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DataTablePagination, { table })
576
638
  ] });
577
639
  }
578
640
  // Annotate the CommonJS export names for ESM import in node:
package/dist/index.d.cts CHANGED
@@ -1,6 +1,16 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ColumnDef } from '@tanstack/react-table';
3
3
 
4
+ type Filter<TData> = {
5
+ column: keyof TData;
6
+ type: "select" | "date";
7
+ };
8
+
9
+ type Search<TData> = {
10
+ filterFields: (keyof TData)[];
11
+ placeholder: string;
12
+ };
13
+ type Filters<TData> = Filter<TData>[];
4
14
  type ColumnVisibility<TData> = {
5
15
  [K in keyof TData]?: boolean;
6
16
  } & Record<string, boolean>;
@@ -8,6 +18,8 @@ interface DataTableProps<TData, TValue> {
8
18
  columns: ColumnDef<TData, TValue>[];
9
19
  data: TData[];
10
20
  config?: {
21
+ search?: Search<TData>;
22
+ filters?: Filters<TData>;
11
23
  columnVisibility?: ColumnVisibility<TData>;
12
24
  };
13
25
  }
package/dist/index.d.ts CHANGED
@@ -1,6 +1,16 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ColumnDef } from '@tanstack/react-table';
3
3
 
4
+ type Filter<TData> = {
5
+ column: keyof TData;
6
+ type: "select" | "date";
7
+ };
8
+
9
+ type Search<TData> = {
10
+ filterFields: (keyof TData)[];
11
+ placeholder: string;
12
+ };
13
+ type Filters<TData> = Filter<TData>[];
4
14
  type ColumnVisibility<TData> = {
5
15
  [K in keyof TData]?: boolean;
6
16
  } & Record<string, boolean>;
@@ -8,6 +18,8 @@ interface DataTableProps<TData, TValue> {
8
18
  columns: ColumnDef<TData, TValue>[];
9
19
  data: TData[];
10
20
  config?: {
21
+ search?: Search<TData>;
22
+ filters?: Filters<TData>;
11
23
  columnVisibility?: ColumnVisibility<TData>;
12
24
  };
13
25
  }
package/dist/index.js CHANGED
@@ -90,6 +90,49 @@ function TableCell({ className, ...props }) {
90
90
  );
91
91
  }
92
92
 
93
+ // src/components/ui/input.tsx
94
+ import { jsx as jsx2 } from "react/jsx-runtime";
95
+ function Input({ className, type, ...props }) {
96
+ return /* @__PURE__ */ jsx2(
97
+ "input",
98
+ {
99
+ className: cn(
100
+ "h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
101
+ className
102
+ ),
103
+ "data-slot": "input",
104
+ type,
105
+ ...props
106
+ }
107
+ );
108
+ }
109
+
110
+ // src/dataTable/DataTableControls.tsx
111
+ import { jsx as jsx3, jsxs } from "react/jsx-runtime";
112
+ var DataTableControls = ({
113
+ table,
114
+ search,
115
+ filters
116
+ }) => {
117
+ const value = table.getState().globalFilter ?? "";
118
+ const setValue = table.setGlobalFilter;
119
+ if (!filters || !search) return null;
120
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4 pb-4", children: [
121
+ search && /* @__PURE__ */ jsx3(
122
+ Input,
123
+ {
124
+ className: "max-w-sm",
125
+ onChange: (event) => setValue(() => event.target.value),
126
+ placeholder: search?.placeholder,
127
+ value
128
+ }
129
+ ),
130
+ filters?.map((filter) => {
131
+ return null;
132
+ })
133
+ ] });
134
+ };
135
+
93
136
  // src/components/ui/button.tsx
94
137
  import { cva } from "class-variance-authority";
95
138
 
@@ -139,7 +182,7 @@ function composeRefs(...refs) {
139
182
  }
140
183
 
141
184
  // node_modules/@radix-ui/react-slot/dist/index.mjs
142
- import { Fragment as Fragment2, jsx as jsx2 } from "react/jsx-runtime";
185
+ import { Fragment as Fragment2, jsx as jsx4 } from "react/jsx-runtime";
143
186
  // @__NO_SIDE_EFFECTS__
144
187
  function createSlot(ownerName) {
145
188
  const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
@@ -157,9 +200,9 @@ function createSlot(ownerName) {
157
200
  return child;
158
201
  }
159
202
  });
160
- return /* @__PURE__ */ jsx2(SlotClone, { ...slotProps, ref: forwardedRef, children: React2.isValidElement(newElement) ? React2.cloneElement(newElement, void 0, newChildren) : null });
203
+ return /* @__PURE__ */ jsx4(SlotClone, { ...slotProps, ref: forwardedRef, children: React2.isValidElement(newElement) ? React2.cloneElement(newElement, void 0, newChildren) : null });
161
204
  }
162
- return /* @__PURE__ */ jsx2(SlotClone, { ...slotProps, ref: forwardedRef, children });
205
+ return /* @__PURE__ */ jsx4(SlotClone, { ...slotProps, ref: forwardedRef, children });
163
206
  });
164
207
  Slot2.displayName = `${ownerName}.Slot`;
165
208
  return Slot2;
@@ -186,7 +229,7 @@ var SLOTTABLE_IDENTIFIER = /* @__PURE__ */ Symbol("radix.slottable");
186
229
  // @__NO_SIDE_EFFECTS__
187
230
  function createSlottable(ownerName) {
188
231
  const Slottable2 = ({ children }) => {
189
- return /* @__PURE__ */ jsx2(Fragment2, { children });
232
+ return /* @__PURE__ */ jsx4(Fragment2, { children });
190
233
  };
191
234
  Slottable2.displayName = `${ownerName}.Slottable`;
192
235
  Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
@@ -235,7 +278,7 @@ function getElementRef(element) {
235
278
  }
236
279
 
237
280
  // src/components/ui/button.tsx
238
- import { jsx as jsx3 } from "react/jsx-runtime";
281
+ import { jsx as jsx5 } from "react/jsx-runtime";
239
282
  var buttonVariants = cva(
240
283
  "group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
241
284
  {
@@ -273,7 +316,7 @@ function Button({
273
316
  ...props
274
317
  }) {
275
318
  const Comp = asChild ? dist_exports.Root : "button";
276
- return /* @__PURE__ */ jsx3(
319
+ return /* @__PURE__ */ jsx5(
277
320
  Comp,
278
321
  {
279
322
  className: cn(buttonVariants({ variant, size, className })),
@@ -406,25 +449,25 @@ var __iconNode4 = [
406
449
  var ChevronsRight = createLucideIcon("chevrons-right", __iconNode4);
407
450
 
408
451
  // src/dataTable/pagination/DataTablePagination.tsx
409
- import { jsx as jsx4, jsxs } from "react/jsx-runtime";
452
+ import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
410
453
  function DataTablePagination({
411
454
  table
412
455
  }) {
413
- return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-2 pt-4", children: [
414
- /* @__PURE__ */ jsxs("div", { className: "text-muted-foreground flex-1 text-sm", children: [
456
+ return /* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-between px-2 pt-4", children: [
457
+ /* @__PURE__ */ jsxs2("div", { className: "text-muted-foreground flex-1 text-sm", children: [
415
458
  table.getFilteredRowModel().rows.length,
416
459
  " rows"
417
460
  ] }),
418
- /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-6 lg:space-x-8", children: [
419
- /* @__PURE__ */ jsxs("div", { className: "flex w-[100px] items-center justify-center text-sm font-medium", children: [
461
+ /* @__PURE__ */ jsxs2("div", { className: "flex items-center space-x-6 lg:space-x-8", children: [
462
+ /* @__PURE__ */ jsxs2("div", { className: "flex w-[100px] items-center justify-center text-sm font-medium", children: [
420
463
  "Page ",
421
464
  table.getState().pagination.pageIndex + 1,
422
465
  " of",
423
466
  " ",
424
467
  table.getPageCount() || 1
425
468
  ] }),
426
- /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
427
- /* @__PURE__ */ jsxs(
469
+ /* @__PURE__ */ jsxs2("div", { className: "flex items-center space-x-2", children: [
470
+ /* @__PURE__ */ jsxs2(
428
471
  Button,
429
472
  {
430
473
  className: "hidden size-8 lg:flex",
@@ -433,12 +476,12 @@ function DataTablePagination({
433
476
  size: "icon",
434
477
  variant: "outline",
435
478
  children: [
436
- /* @__PURE__ */ jsx4("span", { className: "sr-only", children: "Go to first page" }),
437
- /* @__PURE__ */ jsx4(ChevronsLeft, {})
479
+ /* @__PURE__ */ jsx6("span", { className: "sr-only", children: "Go to first page" }),
480
+ /* @__PURE__ */ jsx6(ChevronsLeft, {})
438
481
  ]
439
482
  }
440
483
  ),
441
- /* @__PURE__ */ jsxs(
484
+ /* @__PURE__ */ jsxs2(
442
485
  Button,
443
486
  {
444
487
  className: "size-8",
@@ -447,12 +490,12 @@ function DataTablePagination({
447
490
  size: "icon",
448
491
  variant: "outline",
449
492
  children: [
450
- /* @__PURE__ */ jsx4("span", { className: "sr-only", children: "Go to previous page" }),
451
- /* @__PURE__ */ jsx4(ChevronLeft, {})
493
+ /* @__PURE__ */ jsx6("span", { className: "sr-only", children: "Go to previous page" }),
494
+ /* @__PURE__ */ jsx6(ChevronLeft, {})
452
495
  ]
453
496
  }
454
497
  ),
455
- /* @__PURE__ */ jsxs(
498
+ /* @__PURE__ */ jsxs2(
456
499
  Button,
457
500
  {
458
501
  className: "size-8",
@@ -461,12 +504,12 @@ function DataTablePagination({
461
504
  size: "icon",
462
505
  variant: "outline",
463
506
  children: [
464
- /* @__PURE__ */ jsx4("span", { className: "sr-only", children: "Go to next page" }),
465
- /* @__PURE__ */ jsx4(ChevronRight, {})
507
+ /* @__PURE__ */ jsx6("span", { className: "sr-only", children: "Go to next page" }),
508
+ /* @__PURE__ */ jsx6(ChevronRight, {})
466
509
  ]
467
510
  }
468
511
  ),
469
- /* @__PURE__ */ jsxs(
512
+ /* @__PURE__ */ jsxs2(
470
513
  Button,
471
514
  {
472
515
  className: "hidden size-8 lg:flex",
@@ -475,8 +518,8 @@ function DataTablePagination({
475
518
  size: "icon",
476
519
  variant: "outline",
477
520
  children: [
478
- /* @__PURE__ */ jsx4("span", { className: "sr-only", children: "Go to last page" }),
479
- /* @__PURE__ */ jsx4(ChevronsRight, {})
521
+ /* @__PURE__ */ jsx6("span", { className: "sr-only", children: "Go to last page" }),
522
+ /* @__PURE__ */ jsx6(ChevronsRight, {})
480
523
  ]
481
524
  }
482
525
  )
@@ -485,6 +528,16 @@ function DataTablePagination({
485
528
  ] });
486
529
  }
487
530
 
531
+ // src/lib/search.ts
532
+ import { rankItem } from "@tanstack/match-sorter-utils";
533
+ var fuzzyFilterFn = (searchableColumns) => (row, columnId, filterValue, addMeta) => {
534
+ if (!searchableColumns) return false;
535
+ if (!searchableColumns.includes(columnId)) return false;
536
+ const itemRank = rankItem(row.getValue(columnId), filterValue);
537
+ addMeta({ itemRank });
538
+ return itemRank.passed;
539
+ };
540
+
488
541
  // src/dataTable/DataTable.tsx
489
542
  import {
490
543
  flexRender,
@@ -495,7 +548,7 @@ import {
495
548
  getPaginationRowModel,
496
549
  useReactTable
497
550
  } from "@tanstack/react-table";
498
- import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
551
+ import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
499
552
  function DataTable({
500
553
  columns,
501
554
  data,
@@ -509,15 +562,24 @@ function DataTable({
509
562
  getFilteredRowModel: getFilteredRowModel(),
510
563
  getFacetedRowModel: getFacetedRowModel(),
511
564
  getFacetedUniqueValues: getFacetedUniqueValues(),
565
+ globalFilterFn: fuzzyFilterFn(config?.search?.filterFields),
512
566
  autoResetPageIndex: false,
513
567
  initialState: {
514
568
  columnVisibility: config?.columnVisibility
515
569
  }
516
570
  });
517
- return /* @__PURE__ */ jsxs2("div", { className: "w-full", children: [
518
- /* @__PURE__ */ jsx5("div", { className: "rounded-md border overflow-hidden", children: /* @__PURE__ */ jsxs2(Table, { children: [
519
- /* @__PURE__ */ jsx5(TableHeader, { className: "bg-muted", children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx5(TableRow, { children: headerGroup.headers.map((header) => {
520
- return /* @__PURE__ */ jsx5(
571
+ return /* @__PURE__ */ jsxs3("div", { className: "w-full", children: [
572
+ /* @__PURE__ */ jsx7(
573
+ DataTableControls,
574
+ {
575
+ filters: config?.filters,
576
+ search: config?.search,
577
+ table
578
+ }
579
+ ),
580
+ /* @__PURE__ */ jsx7("div", { className: "rounded-md border overflow-hidden", children: /* @__PURE__ */ jsxs3(Table, { children: [
581
+ /* @__PURE__ */ jsx7(TableHeader, { className: "bg-muted", children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx7(TableRow, { children: headerGroup.headers.map((header) => {
582
+ return /* @__PURE__ */ jsx7(
521
583
  TableHead,
522
584
  {
523
585
  colSpan: header.colSpan,
@@ -530,17 +592,17 @@ function DataTable({
530
592
  header.id
531
593
  );
532
594
  }) }, headerGroup.id)) }),
533
- /* @__PURE__ */ jsx5(TableBody, { children: table.getRowModel().rows?.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx5(
595
+ /* @__PURE__ */ jsx7(TableBody, { children: table.getRowModel().rows?.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx7(
534
596
  TableRow,
535
597
  {
536
598
  "data-state": row.getIsSelected() && "selected",
537
- children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx5(TableCell, { className: "truncate max-w-0", children: flexRender(
599
+ children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx7(TableCell, { className: "truncate max-w-0", children: flexRender(
538
600
  cell.column.columnDef.cell,
539
601
  cell.getContext()
540
602
  ) }, cell.id))
541
603
  },
542
604
  row.id
543
- )) : /* @__PURE__ */ jsx5(TableRow, { children: /* @__PURE__ */ jsx5(
605
+ )) : /* @__PURE__ */ jsx7(TableRow, { children: /* @__PURE__ */ jsx7(
544
606
  TableCell,
545
607
  {
546
608
  className: "h-24 text-center",
@@ -549,7 +611,7 @@ function DataTable({
549
611
  }
550
612
  ) }) })
551
613
  ] }) }),
552
- /* @__PURE__ */ jsx5(DataTablePagination, { table })
614
+ /* @__PURE__ */ jsx7(DataTablePagination, { table })
553
615
  ] });
554
616
  }
555
617
  export {
package/dist/styles.css CHANGED
@@ -88,35 +88,11 @@
88
88
  border-bottom-style: var(--tw-border-style);
89
89
  border-bottom-width: 1px;
90
90
  }
91
- .border-border {
92
- border-color: var(--color-border);
93
- }
94
91
  .border-transparent {
95
92
  border-color: transparent;
96
93
  }
97
- .bg-background {
98
- background-color: var(--color-background);
99
- }
100
- .bg-destructive\/10 {
101
- background-color: color-mix(in srgb, 0 84.2% 60.2% 10%, transparent);
102
- @supports (color: color-mix(in lab, red, red)) {
103
- background-color: color-mix(in oklab, var(--color-destructive) 10%, transparent);
104
- }
105
- }
106
- .bg-muted {
107
- background-color: var(--color-muted);
108
- }
109
- .bg-muted\/50 {
110
- background-color: color-mix(in srgb, 0 0% 96.1% 50%, transparent);
111
- @supports (color: color-mix(in lab, red, red)) {
112
- background-color: color-mix(in oklab, var(--color-muted) 50%, transparent);
113
- }
114
- }
115
- .bg-primary {
116
- background-color: var(--color-primary);
117
- }
118
- .bg-secondary {
119
- background-color: var(--color-secondary);
94
+ .bg-transparent {
95
+ background-color: transparent;
120
96
  }
121
97
  .bg-clip-padding {
122
98
  background-clip: padding-box;
@@ -136,24 +112,6 @@
136
112
  .whitespace-nowrap {
137
113
  white-space: nowrap;
138
114
  }
139
- .text-destructive {
140
- color: var(--color-destructive);
141
- }
142
- .text-foreground {
143
- color: var(--color-foreground);
144
- }
145
- .text-muted-foreground {
146
- color: var(--color-muted-foreground);
147
- }
148
- .text-primary {
149
- color: var(--color-primary);
150
- }
151
- .text-primary-foreground {
152
- color: var(--color-primary-foreground);
153
- }
154
- .text-secondary-foreground {
155
- color: var(--color-secondary-foreground);
156
- }
157
115
  .underline-offset-4 {
158
116
  text-underline-offset: 4px;
159
117
  }
@@ -161,6 +119,9 @@
161
119
  outline-style: var(--tw-outline-style);
162
120
  outline-width: 1px;
163
121
  }
122
+ .filter {
123
+ filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
124
+ }
164
125
  .transition-all {
165
126
  transition-property: all;
166
127
  transition-timing-function: var(--tw-ease, ease);
@@ -179,48 +140,20 @@
179
140
  -webkit-user-select: none;
180
141
  user-select: none;
181
142
  }
182
- .hover\:bg-destructive\/20 {
183
- &:hover {
184
- @media (hover: hover) {
185
- background-color: color-mix(in srgb, 0 84.2% 60.2% 20%, transparent);
186
- @supports (color: color-mix(in lab, red, red)) {
187
- background-color: color-mix(in oklab, var(--color-destructive) 20%, transparent);
188
- }
189
- }
143
+ .file\:inline-flex {
144
+ &::file-selector-button {
145
+ display: inline-flex;
190
146
  }
191
147
  }
192
- .hover\:bg-muted {
193
- &:hover {
194
- @media (hover: hover) {
195
- background-color: var(--color-muted);
196
- }
197
- }
198
- }
199
- .hover\:bg-muted\/50 {
200
- &:hover {
201
- @media (hover: hover) {
202
- background-color: color-mix(in srgb, 0 0% 96.1% 50%, transparent);
203
- @supports (color: color-mix(in lab, red, red)) {
204
- background-color: color-mix(in oklab, var(--color-muted) 50%, transparent);
205
- }
206
- }
207
- }
208
- }
209
- .hover\:bg-secondary\/80 {
210
- &:hover {
211
- @media (hover: hover) {
212
- background-color: color-mix(in srgb, 0 0% 96.1% 80%, transparent);
213
- @supports (color: color-mix(in lab, red, red)) {
214
- background-color: color-mix(in oklab, var(--color-secondary) 80%, transparent);
215
- }
216
- }
148
+ .file\:border-0 {
149
+ &::file-selector-button {
150
+ border-style: var(--tw-border-style);
151
+ border-width: 0px;
217
152
  }
218
153
  }
219
- .hover\:text-foreground {
220
- &:hover {
221
- @media (hover: hover) {
222
- color: var(--color-foreground);
223
- }
154
+ .file\:bg-transparent {
155
+ &::file-selector-button {
156
+ background-color: transparent;
224
157
  }
225
158
  }
226
159
  .hover\:underline {
@@ -230,41 +163,12 @@
230
163
  }
231
164
  }
232
165
  }
233
- .focus-visible\:border-destructive\/40 {
234
- &:focus-visible {
235
- border-color: color-mix(in srgb, 0 84.2% 60.2% 40%, transparent);
236
- @supports (color: color-mix(in lab, red, red)) {
237
- border-color: color-mix(in oklab, var(--color-destructive) 40%, transparent);
238
- }
239
- }
240
- }
241
- .focus-visible\:border-ring {
242
- &:focus-visible {
243
- border-color: var(--color-ring);
244
- }
245
- }
246
166
  .focus-visible\:ring-3 {
247
167
  &:focus-visible {
248
168
  --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
249
169
  box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
250
170
  }
251
171
  }
252
- .focus-visible\:ring-destructive\/20 {
253
- &:focus-visible {
254
- --tw-ring-color: color-mix(in srgb, 0 84.2% 60.2% 20%, transparent);
255
- @supports (color: color-mix(in lab, red, red)) {
256
- --tw-ring-color: color-mix(in oklab, var(--color-destructive) 20%, transparent);
257
- }
258
- }
259
- }
260
- .focus-visible\:ring-ring\/50 {
261
- &:focus-visible {
262
- --tw-ring-color: color-mix(in srgb, 0 0% 3.6% 50%, transparent);
263
- @supports (color: color-mix(in lab, red, red)) {
264
- --tw-ring-color: color-mix(in oklab, var(--color-ring) 50%, transparent);
265
- }
266
- }
267
- }
268
172
  .active\:not-aria-\[haspopup\]\:translate-y-px {
269
173
  &:active {
270
174
  &:not(*[aria-haspopup]) {
@@ -278,42 +182,14 @@
278
182
  pointer-events: none;
279
183
  }
280
184
  }
281
- .disabled\:opacity-50 {
185
+ .disabled\:cursor-not-allowed {
282
186
  &:disabled {
283
- opacity: 50%;
284
- }
285
- }
286
- .has-aria-expanded\:bg-muted\/50 {
287
- &:has(*[aria-expanded="true"]) {
288
- background-color: color-mix(in srgb, 0 0% 96.1% 50%, transparent);
289
- @supports (color: color-mix(in lab, red, red)) {
290
- background-color: color-mix(in oklab, var(--color-muted) 50%, transparent);
291
- }
292
- }
293
- }
294
- .aria-expanded\:bg-muted {
295
- &[aria-expanded="true"] {
296
- background-color: var(--color-muted);
297
- }
298
- }
299
- .aria-expanded\:bg-secondary {
300
- &[aria-expanded="true"] {
301
- background-color: var(--color-secondary);
302
- }
303
- }
304
- .aria-expanded\:text-foreground {
305
- &[aria-expanded="true"] {
306
- color: var(--color-foreground);
307
- }
308
- }
309
- .aria-expanded\:text-secondary-foreground {
310
- &[aria-expanded="true"] {
311
- color: var(--color-secondary-foreground);
187
+ cursor: not-allowed;
312
188
  }
313
189
  }
314
- .aria-invalid\:border-destructive {
315
- &[aria-invalid="true"] {
316
- border-color: var(--color-destructive);
190
+ .disabled\:opacity-50 {
191
+ &:disabled {
192
+ opacity: 50%;
317
193
  }
318
194
  }
319
195
  .aria-invalid\:ring-3 {
@@ -322,106 +198,6 @@
322
198
  box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
323
199
  }
324
200
  }
325
- .aria-invalid\:ring-destructive\/20 {
326
- &[aria-invalid="true"] {
327
- --tw-ring-color: color-mix(in srgb, 0 84.2% 60.2% 20%, transparent);
328
- @supports (color: color-mix(in lab, red, red)) {
329
- --tw-ring-color: color-mix(in oklab, var(--color-destructive) 20%, transparent);
330
- }
331
- }
332
- }
333
- .data-\[state\=selected\]\:bg-muted {
334
- &[data-state="selected"] {
335
- background-color: var(--color-muted);
336
- }
337
- }
338
- .dark\:border-input {
339
- @media (prefers-color-scheme: dark) {
340
- border-color: var(--color-input);
341
- }
342
- }
343
- .dark\:bg-destructive\/20 {
344
- @media (prefers-color-scheme: dark) {
345
- background-color: color-mix(in srgb, 0 84.2% 60.2% 20%, transparent);
346
- @supports (color: color-mix(in lab, red, red)) {
347
- background-color: color-mix(in oklab, var(--color-destructive) 20%, transparent);
348
- }
349
- }
350
- }
351
- .dark\:bg-input\/30 {
352
- @media (prefers-color-scheme: dark) {
353
- background-color: color-mix(in srgb, 0 0% 89.8% 30%, transparent);
354
- @supports (color: color-mix(in lab, red, red)) {
355
- background-color: color-mix(in oklab, var(--color-input) 30%, transparent);
356
- }
357
- }
358
- }
359
- .dark\:hover\:bg-destructive\/30 {
360
- @media (prefers-color-scheme: dark) {
361
- &:hover {
362
- @media (hover: hover) {
363
- background-color: color-mix(in srgb, 0 84.2% 60.2% 30%, transparent);
364
- @supports (color: color-mix(in lab, red, red)) {
365
- background-color: color-mix(in oklab, var(--color-destructive) 30%, transparent);
366
- }
367
- }
368
- }
369
- }
370
- }
371
- .dark\:hover\:bg-input\/50 {
372
- @media (prefers-color-scheme: dark) {
373
- &:hover {
374
- @media (hover: hover) {
375
- background-color: color-mix(in srgb, 0 0% 89.8% 50%, transparent);
376
- @supports (color: color-mix(in lab, red, red)) {
377
- background-color: color-mix(in oklab, var(--color-input) 50%, transparent);
378
- }
379
- }
380
- }
381
- }
382
- }
383
- .dark\:hover\:bg-muted\/50 {
384
- @media (prefers-color-scheme: dark) {
385
- &:hover {
386
- @media (hover: hover) {
387
- background-color: color-mix(in srgb, 0 0% 96.1% 50%, transparent);
388
- @supports (color: color-mix(in lab, red, red)) {
389
- background-color: color-mix(in oklab, var(--color-muted) 50%, transparent);
390
- }
391
- }
392
- }
393
- }
394
- }
395
- .dark\:focus-visible\:ring-destructive\/40 {
396
- @media (prefers-color-scheme: dark) {
397
- &:focus-visible {
398
- --tw-ring-color: color-mix(in srgb, 0 84.2% 60.2% 40%, transparent);
399
- @supports (color: color-mix(in lab, red, red)) {
400
- --tw-ring-color: color-mix(in oklab, var(--color-destructive) 40%, transparent);
401
- }
402
- }
403
- }
404
- }
405
- .dark\:aria-invalid\:border-destructive\/50 {
406
- @media (prefers-color-scheme: dark) {
407
- &[aria-invalid="true"] {
408
- border-color: color-mix(in srgb, 0 84.2% 60.2% 50%, transparent);
409
- @supports (color: color-mix(in lab, red, red)) {
410
- border-color: color-mix(in oklab, var(--color-destructive) 50%, transparent);
411
- }
412
- }
413
- }
414
- }
415
- .dark\:aria-invalid\:ring-destructive\/40 {
416
- @media (prefers-color-scheme: dark) {
417
- &[aria-invalid="true"] {
418
- --tw-ring-color: color-mix(in srgb, 0 84.2% 60.2% 40%, transparent);
419
- @supports (color: color-mix(in lab, red, red)) {
420
- --tw-ring-color: color-mix(in oklab, var(--color-destructive) 40%, transparent);
421
- }
422
- }
423
- }
424
- }
425
201
  .\[\&_svg\]\:pointer-events-none {
426
202
  & svg {
427
203
  pointer-events: none;
@@ -444,18 +220,6 @@
444
220
  border-width: 0px;
445
221
  }
446
222
  }
447
- .\[a\]\:hover\:bg-primary\/80 {
448
- &:is(a) {
449
- &:hover {
450
- @media (hover: hover) {
451
- background-color: color-mix(in srgb, 0 0% 9% 80%, transparent);
452
- @supports (color: color-mix(in lab, red, red)) {
453
- background-color: color-mix(in oklab, var(--color-primary) 80%, transparent);
454
- }
455
- }
456
- }
457
- }
458
- }
459
223
  .\[\&\>tr\]\:last\:border-b-0 {
460
224
  &>tr {
461
225
  &:last-child {
@@ -464,43 +228,6 @@
464
228
  }
465
229
  }
466
230
  }
467
- :root, :host {
468
- --color-background: 0 0% 100%;
469
- --color-foreground: 0 0% 3.6%;
470
- --color-muted: 0 0% 96.1%;
471
- --color-muted-foreground: 0 0% 45.1%;
472
- --color-destructive: 0 84.2% 60.2%;
473
- --color-border: 0 0% 89.8%;
474
- --color-input: 0 0% 89.8%;
475
- --color-primary: 0 0% 9%;
476
- --color-primary-foreground: 0 0% 98%;
477
- --color-secondary: 0 0% 96.1%;
478
- --color-secondary-foreground: 0 0% 9%;
479
- --color-ring: 0 0% 3.6%;
480
- }
481
- @media (prefers-color-scheme: dark) {
482
- :root {
483
- --color-background: 0 0% 3.6%;
484
- --color-foreground: 0 0% 98%;
485
- --color-card: 0 0% 3.6%;
486
- --color-card-foreground: 0 0% 98%;
487
- --color-popover: 0 0% 3.6%;
488
- --color-popover-foreground: 0 0% 98%;
489
- --color-muted: 0 0% 14.9%;
490
- --color-muted-foreground: 0 0% 63.9%;
491
- --color-accent: 0 0% 98%;
492
- --color-accent-foreground: 0 0% 9%;
493
- --color-destructive: 0 62.8% 30.6%;
494
- --color-destructive-foreground: 0 0% 98%;
495
- --color-border: 0 0% 14.9%;
496
- --color-input: 0 0% 14.9%;
497
- --color-primary: 0 0% 98%;
498
- --color-primary-foreground: 0 0% 9%;
499
- --color-secondary: 0 0% 14.9%;
500
- --color-secondary-foreground: 0 0% 98%;
501
- --color-ring: 0 0% 83.1%;
502
- }
503
- }
504
231
  @property --tw-border-style {
505
232
  syntax: "*";
506
233
  inherits: false;
@@ -511,6 +238,59 @@
511
238
  inherits: false;
512
239
  initial-value: solid;
513
240
  }
241
+ @property --tw-blur {
242
+ syntax: "*";
243
+ inherits: false;
244
+ }
245
+ @property --tw-brightness {
246
+ syntax: "*";
247
+ inherits: false;
248
+ }
249
+ @property --tw-contrast {
250
+ syntax: "*";
251
+ inherits: false;
252
+ }
253
+ @property --tw-grayscale {
254
+ syntax: "*";
255
+ inherits: false;
256
+ }
257
+ @property --tw-hue-rotate {
258
+ syntax: "*";
259
+ inherits: false;
260
+ }
261
+ @property --tw-invert {
262
+ syntax: "*";
263
+ inherits: false;
264
+ }
265
+ @property --tw-opacity {
266
+ syntax: "*";
267
+ inherits: false;
268
+ }
269
+ @property --tw-saturate {
270
+ syntax: "*";
271
+ inherits: false;
272
+ }
273
+ @property --tw-sepia {
274
+ syntax: "*";
275
+ inherits: false;
276
+ }
277
+ @property --tw-drop-shadow {
278
+ syntax: "*";
279
+ inherits: false;
280
+ }
281
+ @property --tw-drop-shadow-color {
282
+ syntax: "*";
283
+ inherits: false;
284
+ }
285
+ @property --tw-drop-shadow-alpha {
286
+ syntax: "<percentage>";
287
+ inherits: false;
288
+ initial-value: 100%;
289
+ }
290
+ @property --tw-drop-shadow-size {
291
+ syntax: "*";
292
+ inherits: false;
293
+ }
514
294
  @property --tw-shadow {
515
295
  syntax: "*";
516
296
  inherits: false;
@@ -596,6 +376,19 @@
596
376
  *, ::before, ::after, ::backdrop {
597
377
  --tw-border-style: solid;
598
378
  --tw-outline-style: solid;
379
+ --tw-blur: initial;
380
+ --tw-brightness: initial;
381
+ --tw-contrast: initial;
382
+ --tw-grayscale: initial;
383
+ --tw-hue-rotate: initial;
384
+ --tw-invert: initial;
385
+ --tw-opacity: initial;
386
+ --tw-saturate: initial;
387
+ --tw-sepia: initial;
388
+ --tw-drop-shadow: initial;
389
+ --tw-drop-shadow-color: initial;
390
+ --tw-drop-shadow-alpha: 100%;
391
+ --tw-drop-shadow-size: initial;
599
392
  --tw-shadow: 0 0 #0000;
600
393
  --tw-shadow-color: initial;
601
394
  --tw-shadow-alpha: 100%;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stereopt/data-table",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "Simple reusable React data table component",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -65,6 +65,7 @@
65
65
  },
66
66
  "dependencies": {
67
67
  "@tailwindcss/postcss": "^4.2.2",
68
+ "@tanstack/match-sorter-utils": "^8.19.4",
68
69
  "@tanstack/react-table": "^8.21.3",
69
70
  "class-variance-authority": "^0.7.1",
70
71
  "clsx": "^2.1.1",