@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.d.mts CHANGED
@@ -5,7 +5,7 @@ import { ClassValue } from 'clsx';
5
5
 
6
6
  interface ModalProps {
7
7
  isOpen: boolean;
8
- onClose?: () => void;
8
+ onModalClose?: () => void;
9
9
  title: string;
10
10
  children: React$1.ReactNode;
11
11
  size?: 'sm' | 'md' | 'lg' | 'xl';
@@ -13,7 +13,7 @@ interface ModalProps {
13
13
  className?: string;
14
14
  style?: React$1.CSSProperties;
15
15
  }
16
- declare function Modal({ isOpen, onClose, title, children, size, showCloseButton, className, style }: ModalProps): react_jsx_runtime.JSX.Element | null;
16
+ declare function Modal({ isOpen, onModalClose, title, children, size, showCloseButton, className, style }: ModalProps): react_jsx_runtime.JSX.Element | null;
17
17
 
18
18
  interface ElementProps {
19
19
  children?: React.ReactNode;
package/dist/index.d.ts CHANGED
@@ -5,7 +5,7 @@ import { ClassValue } from 'clsx';
5
5
 
6
6
  interface ModalProps {
7
7
  isOpen: boolean;
8
- onClose?: () => void;
8
+ onModalClose?: () => void;
9
9
  title: string;
10
10
  children: React$1.ReactNode;
11
11
  size?: 'sm' | 'md' | 'lg' | 'xl';
@@ -13,7 +13,7 @@ interface ModalProps {
13
13
  className?: string;
14
14
  style?: React$1.CSSProperties;
15
15
  }
16
- declare function Modal({ isOpen, onClose, title, children, size, showCloseButton, className, style }: ModalProps): react_jsx_runtime.JSX.Element | null;
16
+ declare function Modal({ isOpen, onModalClose, title, children, size, showCloseButton, className, style }: ModalProps): react_jsx_runtime.JSX.Element | null;
17
17
 
18
18
  interface ElementProps {
19
19
  children?: React.ReactNode;
package/dist/index.js CHANGED
@@ -107,7 +107,7 @@ function getInitials(name) {
107
107
  var import_jsx_runtime = require("react/jsx-runtime");
108
108
  function Modal({
109
109
  isOpen,
110
- onClose,
110
+ onModalClose,
111
111
  title,
112
112
  children,
113
113
  size = "md",
@@ -118,7 +118,7 @@ function Modal({
118
118
  (0, import_react.useEffect)(() => {
119
119
  const handleEscape = (e) => {
120
120
  if (e.key === "Escape") {
121
- onClose?.();
121
+ onModalClose?.();
122
122
  }
123
123
  };
124
124
  if (isOpen) {
@@ -129,7 +129,7 @@ function Modal({
129
129
  document.removeEventListener("keydown", handleEscape);
130
130
  document.body.style.overflow = "unset";
131
131
  };
132
- }, [isOpen, onClose]);
132
+ }, [isOpen, onModalClose]);
133
133
  if (!isOpen) return null;
134
134
  const sizeClasses = {
135
135
  sm: "w-md",
@@ -153,7 +153,7 @@ function Modal({
153
153
  showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
154
154
  "button",
155
155
  {
156
- onClick: onClose,
156
+ onClick: onModalClose,
157
157
  className: "text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors cursor-pointer",
158
158
  "aria-label": "Close modal",
159
159
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_fontawesome.FontAwesomeIcon, { icon: import_free_solid_svg_icons.faTimes, className: "w-5 h-5" })
@@ -28481,10 +28481,12 @@ function DataTable({
28481
28481
  state: {
28482
28482
  columnFilters,
28483
28483
  columnVisibility,
28484
- pagination: {
28485
- pageIndex: controlledPageIndex ?? 0,
28486
- pageSize
28487
- }
28484
+ ...paginationMode === "server" ? {
28485
+ pagination: {
28486
+ pageIndex: controlledPageIndex ?? 0,
28487
+ pageSize
28488
+ }
28489
+ } : {}
28488
28490
  },
28489
28491
  onColumnFiltersChange: setColumnFilters,
28490
28492
  onColumnVisibilityChange: setColumnVisibility,
@@ -28493,11 +28495,13 @@ function DataTable({
28493
28495
  getPaginationRowModel: pagination && paginationMode === "client" ? (0, import_react_table.getPaginationRowModel)() : void 0,
28494
28496
  manualPagination: paginationMode === "server",
28495
28497
  pageCount: paginationMode === "server" ? Math.ceil(totalRecords / pageSize) : void 0,
28496
- onPaginationChange: (updater) => {
28497
- const prev = table.getState().pagination;
28498
- const next = typeof updater === "function" ? updater(prev) : updater;
28499
- onPageChange?.(next.pageIndex, next.pageSize);
28500
- }
28498
+ ...paginationMode === "server" ? {
28499
+ onPaginationChange: (updater) => {
28500
+ const prev = table.getState().pagination;
28501
+ const next = typeof updater === "function" ? updater(prev) : updater;
28502
+ onPageChange?.(next.pageIndex, next.pageSize);
28503
+ }
28504
+ } : {}
28501
28505
  });
28502
28506
  const getPageNumbers = (currentPage, totalPages, maxVisiblePages = 5) => {
28503
28507
  if (totalPages <= maxVisiblePages) {