@ai-matrx/design-system 0.20.9 → 0.20.10

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.20.10
4
+
5
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
6
+ `git diff npm/design-system/v0.20.9..npm/design-system/v0.20.10 -- apps/shared/design-system`).
7
+ No source changes intended and no consumer action required.
8
+
3
9
  ## 0.20.9
4
10
 
5
11
  Automatic changed-only republish (docs/metadata drift since the last tag — see
@@ -1398,6 +1398,35 @@ function useProgressiveTableRows({
1398
1398
  onPageAdvance(nextPage);
1399
1399
  }
1400
1400
  };
1401
+ const warnedUnderfill = (0, import_react4.useRef)(null);
1402
+ (0, import_react4.useEffect)(() => {
1403
+ if (!hasMore) return;
1404
+ const surfaces = containers.map((entry) => entry && "current" in entry ? entry.current : entry).filter((entry) => entry !== null);
1405
+ const fillViewport = () => {
1406
+ for (const surface of surfaces) {
1407
+ if (surface.clientHeight <= 0 || surface.getClientRects().length === 0) continue;
1408
+ const content = surface.querySelector("table") ?? surface.lastElementChild;
1409
+ if (!content) continue;
1410
+ const bounds = surface.getBoundingClientRect();
1411
+ const contentBottom = content.getBoundingClientRect().bottom - bounds.top + surface.scrollTop;
1412
+ if (contentBottom <= 0 || contentBottom >= surface.clientHeight - 1) continue;
1413
+ if (warnedUnderfill.current !== progressionKey) {
1414
+ warnedUnderfill.current = progressionKey;
1415
+ 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.");
1416
+ }
1417
+ setProgression((current) => {
1418
+ if (current.key !== progressionKey) return current;
1419
+ const nextCount = Math.min(rows.length, visibleCount + pageSize);
1420
+ return current.shownCount >= nextCount ? current : { ...current, shownCount: nextCount };
1421
+ });
1422
+ break;
1423
+ }
1424
+ };
1425
+ fillViewport();
1426
+ const observer = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(fillViewport);
1427
+ for (const surface of surfaces) observer?.observe(surface);
1428
+ return () => observer?.disconnect();
1429
+ }, [containers, hasMore, pageSize, progressionKey, rows.length, visibleCount]);
1401
1430
  const scroll = useScrollPagination({
1402
1431
  containers,
1403
1432
  queryKey: progressionKey,
@@ -2002,6 +2031,7 @@ function GenericTablePagination({
2002
2031
  const startItem = totalItems === 0 ? 0 : progressive ? 1 : (currentPage - 1) * effectiveItemsPerPage + 1;
2003
2032
  const endItem = Math.min(progressive?.shownCount ?? currentPage * effectiveItemsPerPage, totalItems);
2004
2033
  const defaultLabelFormat = (start, end, total) => {
2034
+ if (progressive) return `${end} shown / ${total} loaded`;
2005
2035
  return compact ? `${start}-${end} of ${total}` : `Showing ${start} to ${end} of ${total} entries`;
2006
2036
  };
2007
2037
  const formatLabel = labelFormat || defaultLabelFormat;
@@ -2031,7 +2061,7 @@ function GenericTablePagination({
2031
2061
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2032
2062
  SelectTrigger,
2033
2063
  {
2034
- "aria-label": "Rows per page",
2064
+ "aria-label": progressive ? "Rows per batch" : "Rows per page",
2035
2065
  className: cn(
2036
2066
  "focus:ring-0",
2037
2067
  compact ? "h-11 min-w-20 rounded-md border border-border bg-card px-3 text-sm hover:bg-accent [&_svg]:size-5" : "h-8 w-[3.75rem] text-xs sm:w-36 sm:text-sm"
@@ -2053,13 +2083,7 @@ function GenericTablePagination({
2053
2083
  {
2054
2084
  className: cn("flex min-w-0 justify-center", infoContainerClassName),
2055
2085
  children: showPageInfo && !hideEntriesInfo && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
2056
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "truncate text-xs tabular-nums text-muted-foreground sm:hidden", children: [
2057
- startItem,
2058
- "-",
2059
- endItem,
2060
- " / ",
2061
- totalItems
2062
- ] }),
2086
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "truncate text-xs tabular-nums text-muted-foreground sm:hidden", children: progressive ? `${endItem}/${totalItems} loaded` : `${startItem}-${endItem} / ${totalItems}` }),
2063
2087
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2064
2088
  "span",
2065
2089
  {
@@ -10697,7 +10721,7 @@ function MatrxDataTableCore({
10697
10721
  onClick: appendQuery.pagination.retrySource ?? (appendQuery.pagination.hasNextPage ? appendQuery.pagination.loadNextPage : appendQuery.pagination.refresh),
10698
10722
  children: appendQuery.pagination.retrySource ? "Retry source" : appendQuery.pagination.hasNextPage ? "Retry" : "Reload rows"
10699
10723
  }
10700
- ) : appendQuery.pagination.hasNextPage || scrollPagination.error ? /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex shrink-0 gap-0", children: [
10724
+ ) : appendQuery.pagination.hasNextPage || scrollPagination.error ? /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex min-w-0 max-w-full flex-wrap gap-0", children: [
10701
10725
  /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
10702
10726
  Button,
10703
10727
  {