@algorithm-shift/design-system 1.2.69 → 1.2.71

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.mjs CHANGED
@@ -12,7 +12,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
12
12
  import { jsx, jsxs } from "react/jsx-runtime";
13
13
  function Modal({
14
14
  isOpen,
15
- onClose,
15
+ onModalClose,
16
16
  title,
17
17
  children,
18
18
  size = "md",
@@ -23,7 +23,7 @@ function Modal({
23
23
  useEffect(() => {
24
24
  const handleEscape = (e) => {
25
25
  if (e.key === "Escape") {
26
- onClose?.();
26
+ onModalClose?.();
27
27
  }
28
28
  };
29
29
  if (isOpen) {
@@ -34,7 +34,7 @@ function Modal({
34
34
  document.removeEventListener("keydown", handleEscape);
35
35
  document.body.style.overflow = "unset";
36
36
  };
37
- }, [isOpen, onClose]);
37
+ }, [isOpen, onModalClose]);
38
38
  if (!isOpen) return null;
39
39
  const sizeClasses = {
40
40
  sm: "w-md",
@@ -58,7 +58,7 @@ function Modal({
58
58
  showCloseButton && /* @__PURE__ */ jsx(
59
59
  "button",
60
60
  {
61
- onClick: onClose,
61
+ onClick: onModalClose,
62
62
  className: "text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors cursor-pointer",
63
63
  "aria-label": "Close modal",
64
64
  children: /* @__PURE__ */ jsx(FontAwesomeIcon, { icon: faTimes, className: "w-5 h-5" })
@@ -28392,10 +28392,12 @@ function DataTable({
28392
28392
  state: {
28393
28393
  columnFilters,
28394
28394
  columnVisibility,
28395
- pagination: {
28396
- pageIndex: controlledPageIndex ?? 0,
28397
- pageSize
28398
- }
28395
+ ...paginationMode === "server" ? {
28396
+ pagination: {
28397
+ pageIndex: controlledPageIndex ?? 0,
28398
+ pageSize
28399
+ }
28400
+ } : {}
28399
28401
  },
28400
28402
  onColumnFiltersChange: setColumnFilters,
28401
28403
  onColumnVisibilityChange: setColumnVisibility,
@@ -28404,11 +28406,13 @@ function DataTable({
28404
28406
  getPaginationRowModel: pagination && paginationMode === "client" ? getPaginationRowModel() : void 0,
28405
28407
  manualPagination: paginationMode === "server",
28406
28408
  pageCount: paginationMode === "server" ? Math.ceil(totalRecords / pageSize) : void 0,
28407
- onPaginationChange: (updater) => {
28408
- const prev = table.getState().pagination;
28409
- const next = typeof updater === "function" ? updater(prev) : updater;
28410
- onPageChange?.(next.pageIndex, next.pageSize);
28411
- }
28409
+ ...paginationMode === "server" ? {
28410
+ onPaginationChange: (updater) => {
28411
+ const prev = table.getState().pagination;
28412
+ const next = typeof updater === "function" ? updater(prev) : updater;
28413
+ onPageChange?.(next.pageIndex, next.pageSize);
28414
+ }
28415
+ } : {}
28412
28416
  });
28413
28417
  const getPageNumbers = (currentPage, totalPages, maxVisiblePages = 5) => {
28414
28418
  if (totalPages <= maxVisiblePages) {