@ai-matrx/design-system 0.20.11 → 0.20.13

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.
@@ -1039,7 +1039,7 @@ function TableSearch({ value, onChange, scope, onScopeChange, scopes, placeholde
1039
1039
  }, children: /* @__PURE__ */ jsx13(X, { "aria-hidden": "true", className: "h-3.5 w-3.5" }) }) }),
1040
1040
  /* @__PURE__ */ jsx13(TooltipContent, { children: "Clear search" })
1041
1041
  ] }) : null,
1042
- expanded ? /* @__PURE__ */ jsx13("div", { role: "group", "aria-label": "Search fields", className: "flex max-w-[60%] shrink-0 items-center overflow-x-auto", children: scopes.map((option) => /* @__PURE__ */ jsx13("button", { type: "button", "aria-pressed": scope === option.id, className: "flex h-11 shrink-0 items-center justify-center px-1 text-xs", onClick: () => onScopeChange(option.id), children: /* @__PURE__ */ jsx13("span", { className: scope === option.id ? "rounded-full bg-primary px-2 py-1 text-primary-foreground" : "rounded-full px-2 py-1 text-muted-foreground hover:bg-muted", children: option.label }) }, option.id)) }) : null
1042
+ expanded ? /* @__PURE__ */ jsx13("div", { role: "group", "aria-label": "Search fields", className: "flex shrink-0 items-center overflow-x-auto", style: { maxWidth: "min(60%, max(0px, calc(100% - 12rem)))" }, children: scopes.map((option) => /* @__PURE__ */ jsx13("button", { type: "button", "aria-pressed": scope === option.id, className: "flex h-11 shrink-0 items-center justify-center px-1 text-xs", onClick: () => onScopeChange(option.id), children: /* @__PURE__ */ jsx13("span", { className: scope === option.id ? "rounded-full bg-primary px-2 py-1 text-primary-foreground" : "rounded-full px-2 py-1 text-muted-foreground hover:bg-muted", children: option.label }) }, option.id)) }) : null
1043
1043
  ]
1044
1044
  }
1045
1045
  ) });
@@ -1302,7 +1302,8 @@ function useProgressiveTableRows({
1302
1302
  containers = [],
1303
1303
  onPageAdvance,
1304
1304
  enabled = true,
1305
- thresholdPx
1305
+ thresholdPx,
1306
+ numberedPageHasMore = false
1306
1307
  }) {
1307
1308
  const pageSize = safePageSize(rawPageSize);
1308
1309
  const hasExplicitRequestedPage = rawRequestedPage !== void 0;
@@ -1364,7 +1365,7 @@ function useProgressiveTableRows({
1364
1365
  };
1365
1366
  const warnedUnderfill = useRef4(null);
1366
1367
  useEffect2(() => {
1367
- if (!hasMore) return;
1368
+ if (!hasMore && !numberedPageHasMore) return;
1368
1369
  const surfaces = containers.map((entry) => entry && "current" in entry ? entry.current : entry).filter((entry) => entry !== null);
1369
1370
  const fillViewport = () => {
1370
1371
  for (const surface of surfaces) {
@@ -1376,8 +1377,11 @@ function useProgressiveTableRows({
1376
1377
  if (contentBottom <= 0 || contentBottom >= surface.clientHeight - 1) continue;
1377
1378
  if (warnedUnderfill.current !== progressionKey) {
1378
1379
  warnedUnderfill.current = progressionKey;
1379
- console.warn("[MatrxDataTable] The initial local batch leaves unused table height while more rows are already loaded. Revealing additional rows to fill the viewport; this is not a network fetch.");
1380
+ if (numberedPageHasMore) {
1381
+ console.warn("[MatrxDataTable] Numbered pagination leaves unused table height while later pages exist. Increase the page size, use a content-sized layout, or use progressive pagination to fill available height. The explicit numbered-page setting has been preserved.");
1382
+ } else console.warn("[MatrxDataTable] The initial local batch leaves unused table height while more rows are already loaded. Revealing additional rows to fill the viewport; this is not a network fetch.");
1380
1383
  }
1384
+ if (numberedPageHasMore) break;
1381
1385
  setProgression((current) => {
1382
1386
  if (current.key !== progressionKey) return current;
1383
1387
  const nextCount = Math.min(rows.length, visibleCount + pageSize);
@@ -1390,7 +1394,7 @@ function useProgressiveTableRows({
1390
1394
  const observer = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(fillViewport);
1391
1395
  for (const surface of surfaces) observer?.observe(surface);
1392
1396
  return () => observer?.disconnect();
1393
- }, [containers, hasMore, pageSize, progressionKey, rows.length, visibleCount]);
1397
+ }, [containers, hasMore, numberedPageHasMore, pageSize, progressionKey, rows.length, visibleCount]);
1394
1398
  const scroll = useScrollPagination({
1395
1399
  containers,
1396
1400
  queryKey: progressionKey,
@@ -9085,6 +9089,7 @@ function MatrxDataTableCore({
9085
9089
  }),
9086
9090
  containers: [scrollRef, cardsScrollRef],
9087
9091
  enabled: localProgressiveEnabled,
9092
+ numberedPageHasMore: !remoteQuery && !hidePagination && localPagination?.mode === "numbered" && safePage < pageCount,
9088
9093
  onPageAdvance: setPage
9089
9094
  });
9090
9095
  const paginated = useMemo7(() => {