@algorithm-shift/design-system 1.2.62 → 1.2.63

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.js CHANGED
@@ -28331,10 +28331,10 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
28331
28331
  };
28332
28332
  var TextInputGroup_default = TextInputGroup;
28333
28333
 
28334
- // src/components/DataDisplay/Table/Table.tsx
28335
- var import_react26 = require("react");
28336
-
28337
28334
  // src/components/ui/data-table.tsx
28335
+ var React6 = __toESM(require("react"));
28336
+ var import_free_solid_svg_icons = require("@fortawesome/free-solid-svg-icons");
28337
+ var import_react_fontawesome2 = require("@fortawesome/react-fontawesome");
28338
28338
  var import_react_table = require("@tanstack/react-table");
28339
28339
 
28340
28340
  // src/components/ui/table.tsx
@@ -28426,72 +28426,277 @@ function TableCell({ className, ...props }) {
28426
28426
  var import_jsx_runtime47 = require("react/jsx-runtime");
28427
28427
  function DataTable({
28428
28428
  columns,
28429
- rowActions,
28430
28429
  data,
28431
28430
  loading,
28432
- getRowSelection,
28433
- onCellClick,
28434
- cellClickEnabled = () => false
28431
+ pagination = false,
28432
+ controlledPageIndex,
28433
+ onPageChange,
28434
+ pageSize = 10,
28435
+ paginationMode = "client",
28436
+ totalRecords = 0
28435
28437
  }) {
28438
+ const [sorting, setSorting] = React6.useState([]);
28439
+ const [columnFilters, setColumnFilters] = React6.useState([]);
28440
+ const [columnVisibility, setColumnVisibility] = React6.useState({});
28436
28441
  const table = (0, import_react_table.useReactTable)({
28437
28442
  data,
28438
28443
  columns,
28439
- enableRowSelection: true,
28440
- onRowSelectionChange: getRowSelection ? (updaterOrValue) => {
28441
- const value = typeof updaterOrValue === "function" ? updaterOrValue(table.getState().rowSelection) : updaterOrValue;
28442
- getRowSelection(value);
28443
- } : void 0,
28444
- getCoreRowModel: (0, import_react_table.getCoreRowModel)()
28444
+ state: {
28445
+ sorting,
28446
+ columnFilters,
28447
+ columnVisibility,
28448
+ pagination: {
28449
+ pageIndex: controlledPageIndex ?? 0,
28450
+ pageSize
28451
+ }
28452
+ },
28453
+ onSortingChange: setSorting,
28454
+ onColumnFiltersChange: setColumnFilters,
28455
+ onColumnVisibilityChange: setColumnVisibility,
28456
+ getCoreRowModel: (0, import_react_table.getCoreRowModel)(),
28457
+ getSortedRowModel: (0, import_react_table.getSortedRowModel)(),
28458
+ getFilteredRowModel: (0, import_react_table.getFilteredRowModel)(),
28459
+ getPaginationRowModel: pagination && paginationMode === "client" ? (0, import_react_table.getPaginationRowModel)() : void 0,
28460
+ manualPagination: paginationMode === "server",
28461
+ pageCount: paginationMode === "server" ? Math.ceil(totalRecords / pageSize) : void 0,
28462
+ onPaginationChange: (updater) => {
28463
+ const prev = table.getState().pagination;
28464
+ const next = typeof updater === "function" ? updater(prev) : updater;
28465
+ onPageChange?.(next.pageIndex, next.pageSize);
28466
+ }
28445
28467
  });
28446
- const handleCellClick = (rowData, columnId) => {
28447
- if (onCellClick) {
28448
- onCellClick(rowData, columnId);
28468
+ const getPageNumbers = (currentPage, totalPages, maxVisiblePages = 5) => {
28469
+ if (totalPages <= maxVisiblePages) {
28470
+ return Array.from({ length: totalPages }, (_, i) => i + 1);
28471
+ }
28472
+ const leftSiblingIndex = Math.max(currentPage - 1, 1);
28473
+ const rightSiblingIndex = Math.min(currentPage + 1, totalPages);
28474
+ const shouldShowLeftDots = leftSiblingIndex > 2;
28475
+ const shouldShowRightDots = rightSiblingIndex < totalPages - 1;
28476
+ if (!shouldShowLeftDots && shouldShowRightDots) {
28477
+ return [1, 2, 3, "...", totalPages];
28449
28478
  }
28479
+ if (shouldShowLeftDots && !shouldShowRightDots) {
28480
+ return [1, "...", totalPages - 2, totalPages - 1, totalPages];
28481
+ }
28482
+ if (shouldShowLeftDots && shouldShowRightDots) {
28483
+ return [1, "...", currentPage - 1, currentPage, currentPage + 1, "...", totalPages];
28484
+ }
28485
+ return [];
28450
28486
  };
28451
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "overflow-hidden rounded-md border w-full", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Table3, { children: [
28452
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableRow, { children: headerGroup.headers.map((header) => {
28453
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableHead, { children: header.isPlaceholder ? null : (0, import_react_table.flexRender)(
28454
- header.column.columnDef.header,
28455
- header.getContext()
28456
- ) }, header.id);
28457
- }) }, headerGroup.id)) }),
28458
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableBody, { children: loading ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: "Loading..." }) }) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_jsx_runtime47.Fragment, { children: table.getRowModel().rows?.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
28459
- TableRow,
28460
- {
28461
- "data-state": row.getIsSelected() && "selected",
28462
- className: "relative group",
28463
- children: [
28464
- row.getVisibleCells().map((cell) => {
28465
- const isCellClickable = cellClickEnabled(row.original, cell.column.id);
28466
- const dynamicClass = cell.column.columnDef.meta?.cellClass || "";
28467
- const dynamicStyle = cell.column.columnDef.meta?.cellStyle || {};
28468
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
28469
- TableCell,
28487
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "overflow-hidden rounded-md border w-full", children: [
28488
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "flex justify-end p-2", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Popover, { children: [
28489
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
28490
+ Button,
28491
+ {
28492
+ variant: "outline",
28493
+ size: "sm",
28494
+ className: "px-3 py-1 text-xs cursor-pointer",
28495
+ children: "Manage Columns"
28496
+ }
28497
+ ) }),
28498
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(PopoverContent, { align: "end", className: "w-48 p-3 space-y-2", children: [
28499
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "text-sm font-medium mb-2", children: "Show / Hide Columns" }),
28500
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("label", { className: "flex items-center gap-2 text-sm font-semibold border-b pb-2 mb-2", children: [
28501
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
28502
+ "input",
28503
+ {
28504
+ type: "checkbox",
28505
+ checked: table.getAllLeafColumns().every((col) => col.getIsVisible()),
28506
+ ref: (input) => {
28507
+ if (input) {
28508
+ input.indeterminate = table.getAllLeafColumns().some((col) => col.getIsVisible()) && !table.getAllLeafColumns().every((col) => col.getIsVisible());
28509
+ }
28510
+ },
28511
+ onChange: (e) => {
28512
+ table.getAllLeafColumns().forEach(
28513
+ (col) => col.toggleVisibility(e.target.checked)
28514
+ );
28515
+ }
28516
+ }
28517
+ ),
28518
+ "Toggle All"
28519
+ ] }),
28520
+ table.getAllLeafColumns().map((column) => /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("label", { className: "flex items-center gap-2 text-sm", children: [
28521
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
28522
+ "input",
28523
+ {
28524
+ type: "checkbox",
28525
+ checked: column.getIsVisible(),
28526
+ onChange: (e) => column.toggleVisibility(e.target.checked)
28527
+ }
28528
+ ),
28529
+ column.columnDef.header?.toString() ?? column.id
28530
+ ] }, column.id))
28531
+ ] })
28532
+ ] }) }),
28533
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Table3, { children: [
28534
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableHeader, { children: table.getHeaderGroups().map((hg) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableRow, { children: hg.headers.map((header) => {
28535
+ const canSort = header.column.getCanSort();
28536
+ const canFilter = header.column.getCanFilter();
28537
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableHead, { className: "relative select-none", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex items-center justify-between", children: [
28538
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
28539
+ "span",
28540
+ {
28541
+ className: `flex items-center gap-1 ${canSort ? "cursor-pointer" : ""}`,
28542
+ onClick: canSort ? header.column.getToggleSortingHandler() : void 0,
28543
+ children: [
28544
+ (0, import_react_table.flexRender)(header.column.columnDef.header, header.getContext()),
28545
+ canSort && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
28546
+ header.column.getIsSorted() === "asc" && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ArrowUp, { size: 14, className: "text-gray-500" }),
28547
+ header.column.getIsSorted() === "desc" && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ArrowDown, { size: 14, className: "text-gray-500" }),
28548
+ !header.column.getIsSorted() && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ArrowUpDown, { size: 14, className: "text-gray-400" })
28549
+ ] })
28550
+ ]
28551
+ }
28552
+ ),
28553
+ canFilter && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Popover, { children: [
28554
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
28555
+ "span",
28470
28556
  {
28471
- className: `${dynamicClass} ${isCellClickable ? "underline cursor-pointer" : ""}`,
28472
- style: dynamicStyle,
28473
- onClick: () => {
28474
- if (isCellClickable) {
28475
- handleCellClick(row.original, cell.column.id);
28557
+ role: "presentation",
28558
+ className: "pl-5 cursor-pointer",
28559
+ onClick: (e) => e.stopPropagation(),
28560
+ children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react_fontawesome2.FontAwesomeIcon, { icon: import_free_solid_svg_icons.faEllipsisH, className: "w-5 h-5 text-gray-500" })
28561
+ }
28562
+ ) }),
28563
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
28564
+ PopoverContent,
28565
+ {
28566
+ align: "start",
28567
+ sideOffset: 4,
28568
+ className: "w-50 p-3 z-[200] border-gray-300",
28569
+ avoidCollisions: true,
28570
+ children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
28571
+ "form",
28572
+ {
28573
+ onSubmit: (e) => {
28574
+ e.preventDefault();
28575
+ const formData = new FormData(e.currentTarget);
28576
+ const value = formData.get("filter");
28577
+ header.column.setFilterValue(value || void 0);
28578
+ },
28579
+ className: "space-y-2",
28580
+ children: [
28581
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("label", { htmlFor: "filter", className: "text-xs text-gray-500 font-normal", children: "Filter by value:" }),
28582
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
28583
+ "input",
28584
+ {
28585
+ name: "filter",
28586
+ placeholder: "Search",
28587
+ defaultValue: header.column.getFilterValue() ?? "",
28588
+ className: "border-gray-300 border-1 block p-3 rounded-md text-xs w-full h-9 focus:ring-0 focus:border-gray-300 focus-visible:ring-0 focus-visible:border-gray-300 focus-visible:outline-none mt-2 font-normal",
28589
+ autoComplete: "off"
28590
+ }
28591
+ ),
28592
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "justify-end flex", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
28593
+ Button,
28594
+ {
28595
+ type: "submit",
28596
+ className: "py-2 px-3 bg-[#12715B] text-white text-xs h-auto cursor-pointer",
28597
+ children: "Apply"
28598
+ }
28599
+ ) })
28600
+ ]
28476
28601
  }
28477
- },
28478
- children: (0, import_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext())
28479
- },
28480
- cell.id
28481
- );
28482
- }),
28483
- rowActions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "absolute top-0 right-0 bg-white py-3 min-w-[100px] z-50 shadow-md flex items-center justify-center gap-3 p-2 opacity-0 group-hover:opacity-100 duration-300 h-full", children: rowActions.map((action, index) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("p", { className: "text-[#383838] text-[12px] cursor-pointer font-[400]", children: action.header }, index)) })
28484
- ]
28485
- },
28486
- row.id
28487
- )) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: "No results." }) }) }) })
28488
- ] }) });
28602
+ )
28603
+ }
28604
+ )
28605
+ ] })
28606
+ ] }) }, header.id);
28607
+ }) }, hg.id)) }),
28608
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableBody, { children: loading ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: "Loading..." }) }) : table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableRow, { children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableCell, { children: (0, import_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: "No results." }) }) })
28609
+ ] }),
28610
+ pagination && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex items-center justify-between py-3 px-2 text-sm w-full", children: [
28611
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { children: [
28612
+ "Page ",
28613
+ table.getState().pagination.pageIndex + 1,
28614
+ " of ",
28615
+ table.getPageCount()
28616
+ ] }),
28617
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex items-center gap-2", children: [
28618
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
28619
+ "button",
28620
+ {
28621
+ onClick: () => table.previousPage(),
28622
+ disabled: !table.getCanPreviousPage?.(),
28623
+ className: "px-2 py-1 border rounded disabled:opacity-50 cursor-pointer",
28624
+ children: "Prev"
28625
+ }
28626
+ ),
28627
+ getPageNumbers(
28628
+ table.getState().pagination.pageIndex + 1,
28629
+ table.getPageCount(),
28630
+ 5
28631
+ ).map((pageNum, index) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
28632
+ "button",
28633
+ {
28634
+ disabled: pageNum === "...",
28635
+ onClick: () => typeof pageNum === "number" && table.setPageIndex(pageNum - 1),
28636
+ className: `px-2 py-1 border rounded ${table.getState().pagination.pageIndex + 1 === pageNum ? "bg-[#12715B] text-white" : "bg-white"} ${pageNum === "..." ? "cursor-default" : "cursor-pointer"}`,
28637
+ children: pageNum
28638
+ },
28639
+ index
28640
+ )),
28641
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
28642
+ "button",
28643
+ {
28644
+ onClick: () => table.nextPage(),
28645
+ disabled: !table.getCanNextPage?.(),
28646
+ className: "px-2 py-1 border rounded disabled:opacity-50 cursor-pointer",
28647
+ children: "Next"
28648
+ }
28649
+ )
28650
+ ] })
28651
+ ] })
28652
+ ] });
28489
28653
  }
28490
28654
 
28491
- // src/components/ui/pagination.tsx
28655
+ // src/components/DataDisplay/Table/Table.tsx
28492
28656
  var import_jsx_runtime48 = require("react/jsx-runtime");
28657
+ var Table4 = ({
28658
+ columns,
28659
+ data,
28660
+ rowActions,
28661
+ className,
28662
+ style,
28663
+ pagination = false,
28664
+ paginationMode = "client",
28665
+ itemsPerPage = 10,
28666
+ onPageChange,
28667
+ page,
28668
+ loading = false,
28669
+ totalRecords = 0,
28670
+ ...props
28671
+ }) => {
28672
+ const rawColumns = Array.isArray(columns) ? columns : [];
28673
+ const rawData = Array.isArray(data) ? data : [];
28674
+ const isControlled = typeof page === "number";
28675
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: `${className || ""} space-y-3`, style, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
28676
+ DataTable,
28677
+ {
28678
+ ...props,
28679
+ columns: rawColumns,
28680
+ data: rawData,
28681
+ rowActions,
28682
+ loading,
28683
+ pagination,
28684
+ pageSize: itemsPerPage,
28685
+ controlledPageIndex: isControlled ? page - 1 : void 0,
28686
+ onPageChange: (pageIndex, pageSize) => {
28687
+ onPageChange?.({ page: pageIndex + 1, itemsPerPage: pageSize });
28688
+ },
28689
+ paginationMode,
28690
+ totalRecords
28691
+ }
28692
+ ) });
28693
+ };
28694
+ var Table_default = Table4;
28695
+
28696
+ // src/components/ui/pagination.tsx
28697
+ var import_jsx_runtime49 = require("react/jsx-runtime");
28493
28698
  function Pagination({ className, ...props }) {
28494
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
28699
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
28495
28700
  "nav",
28496
28701
  {
28497
28702
  role: "navigation",
@@ -28506,7 +28711,7 @@ function PaginationContent({
28506
28711
  className,
28507
28712
  ...props
28508
28713
  }) {
28509
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
28714
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
28510
28715
  "ul",
28511
28716
  {
28512
28717
  "data-slot": "pagination-content",
@@ -28516,7 +28721,7 @@ function PaginationContent({
28516
28721
  );
28517
28722
  }
28518
28723
  function PaginationItem({ ...props }) {
28519
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("li", { "data-slot": "pagination-item", ...props });
28724
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("li", { "data-slot": "pagination-item", ...props });
28520
28725
  }
28521
28726
  function PaginationLink({
28522
28727
  className,
@@ -28524,7 +28729,7 @@ function PaginationLink({
28524
28729
  size = "icon",
28525
28730
  ...props
28526
28731
  }) {
28527
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
28732
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
28528
28733
  "a",
28529
28734
  {
28530
28735
  "aria-current": isActive ? "page" : void 0,
@@ -28545,7 +28750,7 @@ function PaginationPrevious({
28545
28750
  className,
28546
28751
  ...props
28547
28752
  }) {
28548
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
28753
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
28549
28754
  PaginationLink,
28550
28755
  {
28551
28756
  "aria-label": "Go to previous page",
@@ -28553,8 +28758,8 @@ function PaginationPrevious({
28553
28758
  className: cn("gap-1 px-2.5 sm:pl-2.5", className),
28554
28759
  ...props,
28555
28760
  children: [
28556
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ChevronLeft, {}),
28557
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "hidden sm:block", children: "Previous" })
28761
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ChevronLeft, {}),
28762
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "hidden sm:block", children: "Previous" })
28558
28763
  ]
28559
28764
  }
28560
28765
  );
@@ -28563,7 +28768,7 @@ function PaginationNext({
28563
28768
  className,
28564
28769
  ...props
28565
28770
  }) {
28566
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
28771
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
28567
28772
  PaginationLink,
28568
28773
  {
28569
28774
  "aria-label": "Go to next page",
@@ -28571,8 +28776,8 @@ function PaginationNext({
28571
28776
  className: cn("gap-1 px-2.5 sm:pr-2.5", className),
28572
28777
  ...props,
28573
28778
  children: [
28574
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "hidden sm:block", children: "Next" }),
28575
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ChevronRight, {})
28779
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "hidden sm:block", children: "Next" }),
28780
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ChevronRight, {})
28576
28781
  ]
28577
28782
  }
28578
28783
  );
@@ -28581,7 +28786,7 @@ function PaginationEllipsis({
28581
28786
  className,
28582
28787
  ...props
28583
28788
  }) {
28584
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
28789
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
28585
28790
  "span",
28586
28791
  {
28587
28792
  "aria-hidden": true,
@@ -28589,15 +28794,15 @@ function PaginationEllipsis({
28589
28794
  className: cn("flex size-9 items-center justify-center", className),
28590
28795
  ...props,
28591
28796
  children: [
28592
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Ellipsis, { className: "size-4" }),
28593
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "sr-only", children: "More pages" })
28797
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Ellipsis, { className: "size-4" }),
28798
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "sr-only", children: "More pages" })
28594
28799
  ]
28595
28800
  }
28596
28801
  );
28597
28802
  }
28598
28803
 
28599
28804
  // src/components/DataDisplay/Pagination/Pagination.tsx
28600
- var import_jsx_runtime49 = require("react/jsx-runtime");
28805
+ var import_jsx_runtime50 = require("react/jsx-runtime");
28601
28806
  var CustomPagination = ({
28602
28807
  totalPages,
28603
28808
  currentPage,
@@ -28643,10 +28848,10 @@ var CustomPagination = ({
28643
28848
  }
28644
28849
  };
28645
28850
  const pageNumbers = getPageNumbers();
28646
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-row gap-1 w-full items-center justify-between", children: [
28647
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex items-center gap-2", children: [
28648
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "text-sm text-muted-foreground whitespace-nowrap", children: "Items per page:" }),
28649
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
28851
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex flex-row gap-1 w-full items-center justify-between", children: [
28852
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-center gap-2", children: [
28853
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { className: "text-sm text-muted-foreground whitespace-nowrap", children: "Items per page:" }),
28854
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
28650
28855
  Select,
28651
28856
  {
28652
28857
  defaultValue: String(perPage),
@@ -28654,26 +28859,26 @@ var CustomPagination = ({
28654
28859
  onPageChange({ page: 1, itemsPerPage: Number(value) });
28655
28860
  },
28656
28861
  children: [
28657
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SelectTrigger, { className: "w-[100px]", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SelectValue, { placeholder: "Select" }) }),
28658
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(SelectContent, { children: [
28659
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SelectItem, { value: "5", children: "5" }),
28660
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SelectItem, { value: "10", children: "10" }),
28661
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SelectItem, { value: "20", children: "20" }),
28662
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SelectItem, { value: "50", children: "50" })
28862
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SelectTrigger, { className: "w-[100px]", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SelectValue, { placeholder: "Select" }) }),
28863
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(SelectContent, { children: [
28864
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SelectItem, { value: "5", children: "5" }),
28865
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SelectItem, { value: "10", children: "10" }),
28866
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SelectItem, { value: "20", children: "20" }),
28867
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SelectItem, { value: "50", children: "50" })
28663
28868
  ] })
28664
28869
  ]
28665
28870
  }
28666
28871
  )
28667
28872
  ] }),
28668
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Pagination, { className: "justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(PaginationContent, { children: [
28669
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
28873
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Pagination, { className: "justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(PaginationContent, { children: [
28874
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
28670
28875
  PaginationPrevious,
28671
28876
  {
28672
28877
  onClick: () => handlePageChange(currentPage - 1),
28673
28878
  className: currentPage === 1 ? "pointer-events-none opacity-50" : "cursor-pointer"
28674
28879
  }
28675
28880
  ) }),
28676
- pageNumbers.map((pageNumber, index) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(PaginationItem, { children: pageNumber === "..." ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(PaginationEllipsis, {}) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
28881
+ pageNumbers.map((pageNumber, index) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(PaginationItem, { children: pageNumber === "..." ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(PaginationEllipsis, {}) : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
28677
28882
  PaginationLink,
28678
28883
  {
28679
28884
  onClick: () => handlePageChange(pageNumber),
@@ -28682,7 +28887,7 @@ var CustomPagination = ({
28682
28887
  children: pageNumber
28683
28888
  }
28684
28889
  ) }, index)),
28685
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
28890
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
28686
28891
  PaginationNext,
28687
28892
  {
28688
28893
  onClick: () => handlePageChange(currentPage + 1),
@@ -28694,78 +28899,6 @@ var CustomPagination = ({
28694
28899
  };
28695
28900
  var Pagination_default = CustomPagination;
28696
28901
 
28697
- // src/components/DataDisplay/Table/Table.tsx
28698
- var import_jsx_runtime50 = require("react/jsx-runtime");
28699
- var Table4 = ({
28700
- columns,
28701
- data,
28702
- rowActions,
28703
- className,
28704
- style,
28705
- pagination = false,
28706
- paginationMode = "client",
28707
- itemsPerPage = 10,
28708
- onPageChange,
28709
- page,
28710
- loading = false,
28711
- totalRecords = 0,
28712
- ...props
28713
- }) => {
28714
- const rawColumns = Array.isArray(columns) ? columns : [];
28715
- const rawData = Array.isArray(data) ? data : [];
28716
- const rawRowActions = Array.isArray(rowActions) ? rowActions : [];
28717
- const isControlled = typeof page === "number";
28718
- const [internalPage, setInternalPage] = (0, import_react26.useState)(1);
28719
- const currentPage = isControlled ? page : internalPage;
28720
- (0, import_react26.useEffect)(() => {
28721
- if (isControlled) return;
28722
- if (currentPage > 1 && !pagination) setInternalPage(1);
28723
- }, [pagination, isControlled]);
28724
- const enablePagination = pagination && (paginationMode === "server" ? totalRecords > itemsPerPage : rawData.length > itemsPerPage);
28725
- const handlePageChange = (options) => {
28726
- if (!isControlled) setInternalPage(options.page);
28727
- onPageChange?.(options);
28728
- };
28729
- const paginatedData = !enablePagination ? rawData : paginationMode === "server" ? rawData : rawData.slice(
28730
- (currentPage - 1) * itemsPerPage,
28731
- currentPage * itemsPerPage
28732
- );
28733
- const totalPages = enablePagination ? Math.max(
28734
- 1,
28735
- Math.ceil(
28736
- (paginationMode === "server" ? totalRecords : rawData.length) / itemsPerPage
28737
- )
28738
- ) : 1;
28739
- const isCellClickEnabled = (row, id) => {
28740
- const selectedColumn = (columns || [])?.find((col) => col.accessorKey === id);
28741
- if (!selectedColumn) return false;
28742
- return selectedColumn.isClickable ?? false;
28743
- };
28744
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: `${className || ""} space-y-3`, style, children: [
28745
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
28746
- DataTable,
28747
- {
28748
- ...props,
28749
- columns: rawColumns,
28750
- data: paginatedData,
28751
- rowActions: rawRowActions,
28752
- loading,
28753
- cellClickEnabled: isCellClickEnabled
28754
- }
28755
- ),
28756
- enablePagination && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
28757
- Pagination_default,
28758
- {
28759
- perPage: itemsPerPage,
28760
- totalPages,
28761
- currentPage,
28762
- onPageChange: handlePageChange
28763
- }
28764
- )
28765
- ] });
28766
- };
28767
- var Table_default = Table4;
28768
-
28769
28902
  // src/components/Navigation/Tabs/Tabs.tsx
28770
28903
  var import_link5 = __toESM(require("next/link"));
28771
28904
  var import_jsx_runtime51 = require("react/jsx-runtime");
@@ -28857,12 +28990,12 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode }) => {
28857
28990
  var Tabs_default = Tabs;
28858
28991
 
28859
28992
  // src/components/Navigation/Stages/Stages.tsx
28860
- var import_react27 = __toESM(require("react"));
28993
+ var import_react26 = __toESM(require("react"));
28861
28994
  var import_jsx_runtime52 = require("react/jsx-runtime");
28862
28995
  var StagesComponent = ({ stages, isShowBtn, buttonText, className, style }) => {
28863
28996
  return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className, style, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex items-center justify-between bg-red p-2 rounded-lg border border-gray-200 w-full", children: [
28864
28997
  /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("button", { className: "p-2 hover:bg-gray-100 rounded", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("svg", { className: "w-4 h-4 text-gray-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) }) }),
28865
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "flex items-center flex-1 px-2 flex-wrap gap-2", children: stages?.length > 0 && stages?.map((stage, index) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_react27.default.Fragment, { children: [
28998
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "flex items-center flex-1 px-2 flex-wrap gap-2", children: stages?.length > 0 && stages?.map((stage, index) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_react26.default.Fragment, { children: [
28866
28999
  /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
28867
29000
  "button",
28868
29001
  {
@@ -28894,10 +29027,10 @@ var import_jsx_runtime55 = require("react/jsx-runtime");
28894
29027
  var import_jsx_runtime56 = require("react/jsx-runtime");
28895
29028
 
28896
29029
  // src/components/ui/avatar.tsx
28897
- var React7 = __toESM(require("react"));
29030
+ var React8 = __toESM(require("react"));
28898
29031
  var AvatarPrimitive = __toESM(require("@radix-ui/react-avatar"));
28899
29032
  var import_jsx_runtime57 = require("react/jsx-runtime");
28900
- var Avatar = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
29033
+ var Avatar = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
28901
29034
  AvatarPrimitive.Root,
28902
29035
  {
28903
29036
  ref,
@@ -28909,7 +29042,7 @@ var Avatar = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
28909
29042
  }
28910
29043
  ));
28911
29044
  Avatar.displayName = AvatarPrimitive.Root.displayName;
28912
- var AvatarImage = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
29045
+ var AvatarImage = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
28913
29046
  AvatarPrimitive.Image,
28914
29047
  {
28915
29048
  ref,
@@ -28918,7 +29051,7 @@ var AvatarImage = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE
28918
29051
  }
28919
29052
  ));
28920
29053
  AvatarImage.displayName = AvatarPrimitive.Image.displayName;
28921
- var AvatarFallback = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
29054
+ var AvatarFallback = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
28922
29055
  AvatarPrimitive.Fallback,
28923
29056
  {
28924
29057
  ref,