@manusiakemos/laravel-tanstack-react 0.1.0 → 0.1.1

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
@@ -2,6 +2,11 @@
2
2
 
3
3
  var reactTable = require('@tanstack/react-table');
4
4
  var react = require('react');
5
+ var lucideReact = require('lucide-react');
6
+ var clsx = require('clsx');
7
+ var tailwindMerge = require('tailwind-merge');
8
+ var jsxRuntime = require('react/jsx-runtime');
9
+ var classVarianceAuthority = require('class-variance-authority');
5
10
 
6
11
  // src/hooks/useDataTable.ts
7
12
 
@@ -205,9 +210,642 @@ function useDataTable(options) {
205
210
  });
206
211
  return { table, data, meta, loading, error, refetch };
207
212
  }
213
+ function cn(...inputs) {
214
+ return tailwindMerge.twMerge(clsx.clsx(inputs));
215
+ }
216
+ var Table = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
217
+ "table",
218
+ {
219
+ ref,
220
+ className: cn("w-full caption-bottom text-sm", className),
221
+ ...props
222
+ }
223
+ ) }));
224
+ Table.displayName = "Table";
225
+ var TableHeader = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
226
+ TableHeader.displayName = "TableHeader";
227
+ var TableBody = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
228
+ "tbody",
229
+ {
230
+ ref,
231
+ className: cn("[&_tr:last-child]:border-0", className),
232
+ ...props
233
+ }
234
+ ));
235
+ TableBody.displayName = "TableBody";
236
+ var TableFooter = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
237
+ "tfoot",
238
+ {
239
+ ref,
240
+ className: cn(
241
+ "border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
242
+ className
243
+ ),
244
+ ...props
245
+ }
246
+ ));
247
+ TableFooter.displayName = "TableFooter";
248
+ var TableRow = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
249
+ "tr",
250
+ {
251
+ ref,
252
+ className: cn(
253
+ "border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
254
+ className
255
+ ),
256
+ ...props
257
+ }
258
+ ));
259
+ TableRow.displayName = "TableRow";
260
+ var TableHead = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
261
+ "th",
262
+ {
263
+ ref,
264
+ className: cn(
265
+ "h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",
266
+ className
267
+ ),
268
+ ...props
269
+ }
270
+ ));
271
+ TableHead.displayName = "TableHead";
272
+ var TableCell = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
273
+ "td",
274
+ {
275
+ ref,
276
+ className: cn(
277
+ "p-4 align-middle [&:has([role=checkbox])]:pr-0",
278
+ className
279
+ ),
280
+ ...props
281
+ }
282
+ ));
283
+ TableCell.displayName = "TableCell";
284
+ var TableCaption = react.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
285
+ "caption",
286
+ {
287
+ ref,
288
+ className: cn("mt-4 text-sm text-muted-foreground", className),
289
+ ...props
290
+ }
291
+ ));
292
+ TableCaption.displayName = "TableCaption";
293
+ function DataTable(props) {
294
+ const {
295
+ table,
296
+ loading = false,
297
+ emptyMessage = "No results.",
298
+ loadingMessage = "Loading...",
299
+ className,
300
+ classNames,
301
+ onRowClick
302
+ } = props;
303
+ const columnCount = table.getAllColumns().length;
304
+ const rows = table.getRowModel().rows;
305
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("rounded-md border", className, classNames?.root), children: /* @__PURE__ */ jsxRuntime.jsxs(Table, { className: classNames?.table, children: [
306
+ /* @__PURE__ */ jsxRuntime.jsx(TableHeader, { className: classNames?.header, children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsxRuntime.jsx(TableRow, { className: classNames?.headerRow, children: headerGroup.headers.map((header) => {
307
+ const canSort = header.column.getCanSort();
308
+ const sortDir = header.column.getIsSorted();
309
+ return /* @__PURE__ */ jsxRuntime.jsx(
310
+ TableHead,
311
+ {
312
+ className: cn(
313
+ canSort && "cursor-pointer select-none",
314
+ classNames?.head
315
+ ),
316
+ onClick: canSort ? header.column.getToggleSortingHandler() : void 0,
317
+ children: header.isPlaceholder ? null : /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-1", children: [
318
+ reactTable.flexRender(
319
+ header.column.columnDef.header,
320
+ header.getContext()
321
+ ),
322
+ canSort && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: sortDir === "asc" ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowUp, { className: "h-3.5 w-3.5" }) : sortDir === "desc" ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowDown, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsUpDown, { className: "h-3.5 w-3.5 opacity-50" }) })
323
+ ] })
324
+ },
325
+ header.id
326
+ );
327
+ }) }, headerGroup.id)) }),
328
+ /* @__PURE__ */ jsxRuntime.jsx(TableBody, { className: classNames?.body, children: loading ? /* @__PURE__ */ jsxRuntime.jsx(TableRow, { children: /* @__PURE__ */ jsxRuntime.jsx(
329
+ TableCell,
330
+ {
331
+ colSpan: columnCount,
332
+ className: cn(
333
+ "h-24 text-center text-muted-foreground",
334
+ classNames?.loading
335
+ ),
336
+ children: loadingMessage
337
+ }
338
+ ) }) : rows.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(TableRow, { children: /* @__PURE__ */ jsxRuntime.jsx(
339
+ TableCell,
340
+ {
341
+ colSpan: columnCount,
342
+ className: cn(
343
+ "h-24 text-center text-muted-foreground",
344
+ classNames?.empty
345
+ ),
346
+ children: emptyMessage
347
+ }
348
+ ) }) : rows.map((row) => /* @__PURE__ */ jsxRuntime.jsx(
349
+ TableRow,
350
+ {
351
+ className: cn(
352
+ onRowClick && "cursor-pointer",
353
+ classNames?.row
354
+ ),
355
+ onClick: onRowClick ? () => onRowClick(row.original) : void 0,
356
+ children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: classNames?.cell, children: reactTable.flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))
357
+ },
358
+ row.id
359
+ )) })
360
+ ] }) });
361
+ }
362
+ var buttonVariants = classVarianceAuthority.cva(
363
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
364
+ {
365
+ variants: {
366
+ variant: {
367
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
368
+ destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
369
+ outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
370
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
371
+ ghost: "hover:bg-accent hover:text-accent-foreground",
372
+ link: "text-primary underline-offset-4 hover:underline"
373
+ },
374
+ size: {
375
+ default: "h-10 px-4 py-2",
376
+ sm: "h-9 rounded-md px-3",
377
+ lg: "h-11 rounded-md px-8",
378
+ icon: "h-10 w-10"
379
+ }
380
+ },
381
+ defaultVariants: {
382
+ variant: "default",
383
+ size: "default"
384
+ }
385
+ }
386
+ );
387
+ var Button = react.forwardRef(
388
+ ({ className, variant, size, type = "button", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
389
+ "button",
390
+ {
391
+ ref,
392
+ type,
393
+ className: cn(buttonVariants({ variant, size }), className),
394
+ ...props
395
+ }
396
+ )
397
+ );
398
+ Button.displayName = "Button";
399
+ var Input = react.forwardRef(
400
+ ({ className, type = "text", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
401
+ "input",
402
+ {
403
+ ref,
404
+ type,
405
+ className: cn(
406
+ "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
407
+ className
408
+ ),
409
+ ...props
410
+ }
411
+ )
412
+ );
413
+ Input.displayName = "Input";
414
+ var DEFAULT_DEBOUNCE_MS = 300;
415
+ function DataTableSearch(props) {
416
+ const {
417
+ table,
418
+ debounce = true,
419
+ placeholder = "Search...",
420
+ submitLabel,
421
+ className,
422
+ inputClassName,
423
+ buttonClassName,
424
+ inputProps,
425
+ onSearch,
426
+ render
427
+ } = props;
428
+ const isDebounced = debounce !== false;
429
+ const debounceMs = typeof debounce === "number" ? debounce : DEFAULT_DEBOUNCE_MS;
430
+ const appliedValue = table.getState().globalFilter ?? "";
431
+ const [value, setValue] = react.useState(appliedValue);
432
+ const debounced = useDebouncedValue(value, debounceMs);
433
+ const commit = (next) => {
434
+ if (next === appliedValue) return;
435
+ table.setGlobalFilter(next);
436
+ onSearch?.(next);
437
+ };
438
+ react.useEffect(() => {
439
+ if (!isDebounced) return;
440
+ commit(debounced);
441
+ }, [debounced, isDebounced, table]);
442
+ react.useEffect(() => {
443
+ setValue(appliedValue);
444
+ }, [appliedValue]);
445
+ const submit = () => commit(value);
446
+ if (render) {
447
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: render({ value, setValue, submit, appliedValue }) });
448
+ }
449
+ const handleFormSubmit = (e) => {
450
+ e.preventDefault();
451
+ submit();
452
+ };
453
+ if (isDebounced) {
454
+ return /* @__PURE__ */ jsxRuntime.jsx(
455
+ Input,
456
+ {
457
+ type: "search",
458
+ value,
459
+ onChange: (e) => setValue(e.target.value),
460
+ placeholder,
461
+ className: cn(className, inputClassName),
462
+ ...inputProps
463
+ }
464
+ );
465
+ }
466
+ return /* @__PURE__ */ jsxRuntime.jsxs(
467
+ "form",
468
+ {
469
+ onSubmit: handleFormSubmit,
470
+ className: cn("flex w-full max-w-md items-center gap-2", className),
471
+ children: [
472
+ /* @__PURE__ */ jsxRuntime.jsx(
473
+ Input,
474
+ {
475
+ type: "search",
476
+ value,
477
+ onChange: (e) => setValue(e.target.value),
478
+ placeholder,
479
+ className: inputClassName,
480
+ ...inputProps
481
+ }
482
+ ),
483
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "submit", className: buttonClassName, children: submitLabel ?? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
484
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "h-4 w-4", "aria-hidden": "true" }),
485
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Search" })
486
+ ] }) })
487
+ ]
488
+ }
489
+ );
490
+ }
491
+ var Select = react.forwardRef(
492
+ ({ className, multiple, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
493
+ "select",
494
+ {
495
+ ref,
496
+ multiple,
497
+ className: cn(
498
+ "flex w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
499
+ multiple ? "min-h-[6rem]" : "h-10",
500
+ className
501
+ ),
502
+ ...props
503
+ }
504
+ )
505
+ );
506
+ Select.displayName = "Select";
507
+ var DEFAULT_PAGE_SIZES = [10, 25, 50, 100];
508
+ function DataTablePagination(props) {
509
+ const {
510
+ table,
511
+ meta = null,
512
+ showPageSize = false,
513
+ pageSizeOptions = DEFAULT_PAGE_SIZES,
514
+ showFirstLast = false,
515
+ hideSummary = false,
516
+ labels,
517
+ className,
518
+ classNames,
519
+ buttonProps,
520
+ selectProps,
521
+ render
522
+ } = props;
523
+ const state = table.getState().pagination;
524
+ const pageIndex = state.pageIndex;
525
+ const pageSize = state.pageSize;
526
+ const pageCount = table.getPageCount();
527
+ const canPreviousPage = table.getCanPreviousPage();
528
+ const canNextPage = table.getCanNextPage();
529
+ const goToFirst = () => table.setPageIndex(0);
530
+ const goToPrevious = () => table.previousPage();
531
+ const goToNext = () => table.nextPage();
532
+ const goToLast = () => table.setPageIndex(Math.max(0, pageCount - 1));
533
+ const setPageSize = (size) => table.setPageSize(size);
534
+ if (render) {
535
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: render({
536
+ table,
537
+ meta,
538
+ pageIndex,
539
+ pageCount,
540
+ pageSize,
541
+ canPreviousPage,
542
+ canNextPage,
543
+ goToFirst,
544
+ goToPrevious,
545
+ goToNext,
546
+ goToLast,
547
+ setPageSize
548
+ }) });
549
+ }
550
+ const filtered = meta?.filtered ?? 0;
551
+ const total = meta?.total ?? null;
552
+ const summaryNode = labels?.summary ? labels.summary({ pageIndex, pageCount, pageSize, filtered, total }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
553
+ labels?.page ?? "Page",
554
+ " ",
555
+ pageIndex + 1,
556
+ " ",
557
+ labels?.of ?? "of",
558
+ " ",
559
+ Math.max(1, pageCount),
560
+ meta ? ` \xB7 ${filtered} rows` : null
561
+ ] });
562
+ return /* @__PURE__ */ jsxRuntime.jsxs(
563
+ "div",
564
+ {
565
+ className: cn(
566
+ "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
567
+ className,
568
+ classNames?.root
569
+ ),
570
+ children: [
571
+ !hideSummary && /* @__PURE__ */ jsxRuntime.jsx(
572
+ "div",
573
+ {
574
+ className: cn(
575
+ "text-sm text-muted-foreground",
576
+ classNames?.info
577
+ ),
578
+ children: summaryNode
579
+ }
580
+ ),
581
+ /* @__PURE__ */ jsxRuntime.jsxs(
582
+ "div",
583
+ {
584
+ className: cn(
585
+ "flex items-center gap-2",
586
+ classNames?.controls
587
+ ),
588
+ children: [
589
+ showPageSize && /* @__PURE__ */ jsxRuntime.jsxs(
590
+ "label",
591
+ {
592
+ className: cn(
593
+ "flex items-center gap-2 text-sm text-muted-foreground",
594
+ classNames?.pageSize
595
+ ),
596
+ children: [
597
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: labels?.rowsPerPage ?? "Rows per page:" }),
598
+ /* @__PURE__ */ jsxRuntime.jsx(
599
+ Select,
600
+ {
601
+ value: pageSize,
602
+ onChange: (e) => setPageSize(Number(e.target.value)),
603
+ className: cn("h-9 w-[5rem]", classNames?.select),
604
+ ...selectProps,
605
+ children: pageSizeOptions.map((size) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: size, children: size }, size))
606
+ }
607
+ )
608
+ ]
609
+ }
610
+ ),
611
+ showFirstLast && /* @__PURE__ */ jsxRuntime.jsx(
612
+ Button,
613
+ {
614
+ variant: "outline",
615
+ size: "icon",
616
+ onClick: goToFirst,
617
+ disabled: !canPreviousPage,
618
+ className: classNames?.button,
619
+ "aria-label": "Go to first page",
620
+ ...buttonProps,
621
+ children: labels?.first ?? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsLeft, { className: "h-4 w-4" })
622
+ }
623
+ ),
624
+ /* @__PURE__ */ jsxRuntime.jsx(
625
+ Button,
626
+ {
627
+ variant: "outline",
628
+ onClick: goToPrevious,
629
+ disabled: !canPreviousPage,
630
+ className: classNames?.button,
631
+ "aria-label": "Go to previous page",
632
+ ...buttonProps,
633
+ children: labels?.previous ?? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
634
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { className: "h-4 w-4" }),
635
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Previous" })
636
+ ] })
637
+ }
638
+ ),
639
+ /* @__PURE__ */ jsxRuntime.jsx(
640
+ Button,
641
+ {
642
+ variant: "outline",
643
+ onClick: goToNext,
644
+ disabled: !canNextPage,
645
+ className: classNames?.button,
646
+ "aria-label": "Go to next page",
647
+ ...buttonProps,
648
+ children: labels?.next ?? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
649
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Next" }),
650
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4" })
651
+ ] })
652
+ }
653
+ ),
654
+ showFirstLast && /* @__PURE__ */ jsxRuntime.jsx(
655
+ Button,
656
+ {
657
+ variant: "outline",
658
+ size: "icon",
659
+ onClick: goToLast,
660
+ disabled: !canNextPage,
661
+ className: classNames?.button,
662
+ "aria-label": "Go to last page",
663
+ ...buttonProps,
664
+ children: labels?.last ?? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsRight, { className: "h-4 w-4" })
665
+ }
666
+ )
667
+ ]
668
+ }
669
+ )
670
+ ]
671
+ }
672
+ );
673
+ }
674
+ function DataTableFilter(props) {
675
+ const { table, columnId, className, render } = props;
676
+ const column = table.getColumn(columnId);
677
+ if (!column) {
678
+ if (typeof console !== "undefined") {
679
+ console.warn(
680
+ `[DataTableFilter] Column "${columnId}" not found on table. Make sure a column with this id exists.`
681
+ );
682
+ }
683
+ return null;
684
+ }
685
+ const value = column.getFilterValue();
686
+ const setValue = (next) => {
687
+ if (next === void 0 || next === "" || Array.isArray(next) && next.length === 0) {
688
+ column.setFilterValue(void 0);
689
+ } else {
690
+ column.setFilterValue(next);
691
+ }
692
+ };
693
+ if (render) {
694
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: render({ value, setValue, column, table }) });
695
+ }
696
+ if (props.type === "multiselect") {
697
+ const arrayValue = Array.isArray(value) ? value : value ? [String(value)] : [];
698
+ return /* @__PURE__ */ jsxRuntime.jsx(
699
+ Select,
700
+ {
701
+ multiple: true,
702
+ value: arrayValue,
703
+ onChange: (e) => {
704
+ const selected = Array.from(e.target.selectedOptions).map((o) => o.value);
705
+ setValue(selected);
706
+ },
707
+ className: cn("w-auto min-w-[10rem]", className),
708
+ ...props.selectProps,
709
+ children: props.options.map((opt) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: opt.value, children: opt.label }, opt.value))
710
+ }
711
+ );
712
+ }
713
+ if (props.type === "input") {
714
+ return /* @__PURE__ */ jsxRuntime.jsx(
715
+ Input,
716
+ {
717
+ type: "text",
718
+ value: typeof value === "string" ? value : "",
719
+ onChange: (e) => setValue(e.target.value),
720
+ placeholder: props.placeholder,
721
+ className: cn("w-auto min-w-[10rem]", className),
722
+ ...props.inputProps
723
+ }
724
+ );
725
+ }
726
+ if ("options" in props && props.options) {
727
+ const includeEmpty = props.includeEmptyOption ?? true;
728
+ return /* @__PURE__ */ jsxRuntime.jsxs(
729
+ Select,
730
+ {
731
+ value: typeof value === "string" ? value : "",
732
+ onChange: (e) => setValue(e.target.value),
733
+ className: cn("w-auto min-w-[10rem]", className),
734
+ ...props.selectProps,
735
+ children: [
736
+ includeEmpty && /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: props.placeholder ?? "All" }),
737
+ props.options.map((opt) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: opt.value, children: opt.label }, opt.value))
738
+ ]
739
+ }
740
+ );
741
+ }
742
+ if (typeof console !== "undefined") {
743
+ console.warn(
744
+ `[DataTableFilter] No "options" or "render" prop provided for column "${columnId}". Nothing will render.`
745
+ );
746
+ }
747
+ return null;
748
+ }
749
+ function DataTableSplitLayout(props) {
750
+ const {
751
+ table,
752
+ meta = null,
753
+ loading = false,
754
+ filters,
755
+ actions,
756
+ search,
757
+ searchProps,
758
+ tableProps,
759
+ paginationProps,
760
+ className,
761
+ classNames
762
+ } = props;
763
+ const searchNode = search ?? /* @__PURE__ */ jsxRuntime.jsx(
764
+ DataTableSearch,
765
+ {
766
+ table,
767
+ placeholder: "Search...",
768
+ className: "w-full max-w-md",
769
+ ...searchProps
770
+ }
771
+ );
772
+ return /* @__PURE__ */ jsxRuntime.jsxs(
773
+ "div",
774
+ {
775
+ className: cn(
776
+ "flex flex-col gap-4",
777
+ className,
778
+ classNames?.root
779
+ ),
780
+ children: [
781
+ /* @__PURE__ */ jsxRuntime.jsxs(
782
+ "div",
783
+ {
784
+ className: cn(
785
+ "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
786
+ classNames?.toolbar
787
+ ),
788
+ children: [
789
+ /* @__PURE__ */ jsxRuntime.jsx(
790
+ "div",
791
+ {
792
+ className: cn(
793
+ "flex-1 min-w-0",
794
+ classNames?.toolbarLeft
795
+ ),
796
+ children: searchNode
797
+ }
798
+ ),
799
+ (filters || actions) && /* @__PURE__ */ jsxRuntime.jsxs(
800
+ "div",
801
+ {
802
+ className: cn(
803
+ "flex flex-wrap items-center gap-2",
804
+ classNames?.toolbarRight
805
+ ),
806
+ children: [
807
+ filters,
808
+ actions
809
+ ]
810
+ }
811
+ )
812
+ ]
813
+ }
814
+ ),
815
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames?.body, children: /* @__PURE__ */ jsxRuntime.jsx(DataTable, { table, loading, ...tableProps }) }),
816
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames?.footer, children: /* @__PURE__ */ jsxRuntime.jsx(
817
+ DataTablePagination,
818
+ {
819
+ table,
820
+ meta,
821
+ ...paginationProps
822
+ }
823
+ ) })
824
+ ]
825
+ }
826
+ );
827
+ }
208
828
 
829
+ exports.Button = Button;
830
+ exports.DataTable = DataTable;
209
831
  exports.DataTableError = DataTableError;
832
+ exports.DataTableFilter = DataTableFilter;
833
+ exports.DataTablePagination = DataTablePagination;
834
+ exports.DataTableSearch = DataTableSearch;
835
+ exports.DataTableSplitLayout = DataTableSplitLayout;
836
+ exports.Input = Input;
837
+ exports.Select = Select;
838
+ exports.Table = Table;
839
+ exports.TableBody = TableBody;
840
+ exports.TableCaption = TableCaption;
841
+ exports.TableCell = TableCell;
842
+ exports.TableFooter = TableFooter;
843
+ exports.TableHead = TableHead;
844
+ exports.TableHeader = TableHeader;
845
+ exports.TableRow = TableRow;
210
846
  exports.buildQueryString = buildQueryString;
847
+ exports.buttonVariants = buttonVariants;
848
+ exports.cn = cn;
211
849
  exports.defaultFetcher = defaultFetcher;
212
850
  exports.useDataTable = useDataTable;
213
851
  exports.useDebouncedValue = useDebouncedValue;