@algorithm-shift/design-system 1.2.62 → 1.2.64

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