@ai-matrx/design-system 0.48.16 → 0.49.3

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.
Files changed (42) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +16 -0
  3. package/dist/data-table/copy-helpers.d.cts +1 -1
  4. package/dist/data-table/copy-helpers.d.ts +1 -1
  5. package/dist/data-table/filter-engine.d.cts +1 -1
  6. package/dist/data-table/filter-engine.d.ts +1 -1
  7. package/dist/data-table/host.d.cts +1 -1
  8. package/dist/data-table/host.d.ts +1 -1
  9. package/dist/data-table/index.cjs +215 -49
  10. package/dist/data-table/index.cjs.map +1 -1
  11. package/dist/data-table/index.d.cts +2 -2
  12. package/dist/data-table/index.d.ts +2 -2
  13. package/dist/data-table/index.js +215 -49
  14. package/dist/data-table/index.js.map +1 -1
  15. package/dist/data-table/infer-filter.d.cts +1 -1
  16. package/dist/data-table/infer-filter.d.ts +1 -1
  17. package/dist/data-table/layered-filters.d.cts +1 -1
  18. package/dist/data-table/layered-filters.d.ts +1 -1
  19. package/dist/data-table/pagination.cjs +23 -3
  20. package/dist/data-table/pagination.cjs.map +1 -1
  21. package/dist/data-table/pagination.d.cts +6 -1
  22. package/dist/data-table/pagination.d.ts +6 -1
  23. package/dist/data-table/pagination.js +23 -3
  24. package/dist/data-table/pagination.js.map +1 -1
  25. package/dist/data-table/query-control.d.cts +1 -1
  26. package/dist/data-table/query-control.d.ts +1 -1
  27. package/dist/data-table/types.cjs.map +1 -1
  28. package/dist/data-table/types.d.cts +1 -1
  29. package/dist/data-table/types.d.ts +1 -1
  30. package/dist/data-table/url-state.d.cts +1 -1
  31. package/dist/data-table/url-state.d.ts +1 -1
  32. package/dist/data-table/xlsx.d.cts +1 -1
  33. package/dist/data-table/xlsx.d.ts +1 -1
  34. package/dist/index.cjs +330 -325
  35. package/dist/index.cjs.map +1 -1
  36. package/dist/index.d.cts +11 -1
  37. package/dist/index.d.ts +11 -1
  38. package/dist/index.js +330 -325
  39. package/dist/index.js.map +1 -1
  40. package/dist/{types-bIcXnlYS.d.cts → types-ClxgLUFi.d.cts} +34 -1
  41. package/dist/{types-DVTNnzU5.d.ts → types-DlgTSJsC.d.ts} +34 -1
  42. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { h as MatrxDataTableProps, i as TableViewSnapshot, d as MatrxDataTableRecordControls, j as MatrxDataTableRead, k as ColumnMarker, M as MatrxColumnDef } from '../types-bIcXnlYS.cjs';
4
- export { A as AnyOfColumnSearch, l as CellEditType, m as CellEditsMap, f as ColumnFilterKind, a as ColumnFilterValue, C as ColumnFiltersState, n as MatrxDataTableContextMenuConfig, g as MatrxDataTableCopyConfig, o as MatrxDataTableCoverageConfig, c as MatrxDataTableDensity, p as MatrxDataTableDetailConfig, q as MatrxDataTableEditConfig, r as MatrxDataTableEmptyState, s as MatrxDataTableExpandedDetailConfig, t as MatrxDataTableFacetsConfig, u as MatrxDataTableFilterUi, v as MatrxDataTableGroupingConfig, w as MatrxDataTableHierarchyConfig, x as MatrxDataTableHierarchyMove, y as MatrxDataTableMobileCardControls, z as MatrxDataTableMultiExpandedDetailConfig, B as MatrxDataTableQueryControl, e as MatrxDataTableQueryState, D as MatrxDataTableReadStatus, E as MatrxDataTableSelectionConfig, F as MatrxDataTableSingleExpandedDetailConfig, G as MatrxDataTableSourceProcessing, H as MatrxDataTableSpreadsheetConfig, I as MatrxDataTableStyleConfig, J as MatrxDataTableToolbar, K as MatrxDataTableUrlStateConfig, N as MatrxDataTableVirtualizeConfig, O as MatrxDataTableWindowConfig, P as MatrxTablePagination, Q as NumberFilterOp, R as SavedTableViewTab, U as SortDirection, S as SortState, V as SpreadsheetSelection, W as TableRankedSearchOptions, b as TableSavedViewsProps, T as TableSearchMatchMode, X as TableSearchRole, Y as TableSearchScope, Z as TableViewQuery, _ as TableViewTab, $ as TableViewTabs, a0 as TableViewTabsProps, a1 as TableViewTabsStore, a2 as TextFilterMode, a3 as ToolbarFacet, a4 as inferTableSearchRole, a5 as rankTableSearchRows, a6 as resolveTableSearchScopes } from '../types-bIcXnlYS.cjs';
3
+ import { h as MatrxDataTableProps, i as TableViewSnapshot, d as MatrxDataTableRecordControls, j as MatrxDataTableRead, k as ColumnMarker, M as MatrxColumnDef } from '../types-ClxgLUFi.cjs';
4
+ export { A as AnyOfColumnSearch, l as CellEditType, m as CellEditsMap, f as ColumnFilterKind, a as ColumnFilterValue, C as ColumnFiltersState, n as MatrxDataTableContextMenuConfig, g as MatrxDataTableCopyConfig, o as MatrxDataTableCoverageConfig, c as MatrxDataTableDensity, p as MatrxDataTableDetailConfig, q as MatrxDataTableEditConfig, r as MatrxDataTableEmptyState, s as MatrxDataTableExpandedDetailConfig, t as MatrxDataTableFacetsConfig, u as MatrxDataTableFilterUi, v as MatrxDataTableGroupingConfig, w as MatrxDataTableHierarchyConfig, x as MatrxDataTableHierarchyMove, y as MatrxDataTableMobileCardControls, z as MatrxDataTableMultiExpandedDetailConfig, B as MatrxDataTableQueryControl, e as MatrxDataTableQueryState, D as MatrxDataTableReadStatus, E as MatrxDataTableSelectionConfig, F as MatrxDataTableSingleExpandedDetailConfig, G as MatrxDataTableSourceProcessing, H as MatrxDataTableSpreadsheetConfig, I as MatrxDataTableStyleConfig, J as MatrxDataTableSummaryConfig, K as MatrxDataTableSummaryContext, N as MatrxDataTableSummaryMetric, O as MatrxDataTableToolbar, P as MatrxDataTableUrlStateConfig, Q as MatrxDataTableVirtualizeConfig, R as MatrxDataTableWindowConfig, U as MatrxTablePagination, V as NumberFilterOp, W as SavedTableViewTab, X as SortDirection, S as SortState, Y as SpreadsheetSelection, Z as TableRankedSearchOptions, b as TableSavedViewsProps, T as TableSearchMatchMode, _ as TableSearchRole, $ as TableSearchScope, a0 as TableViewQuery, a1 as TableViewTab, a2 as TableViewTabs, a3 as TableViewTabsProps, a4 as TableViewTabsStore, a5 as TextFilterMode, a6 as ToolbarFacet, a7 as inferTableSearchRole, a8 as rankTableSearchRows, a9 as resolveTableSearchScopes } from '../types-ClxgLUFi.cjs';
5
5
  import { TableReadFailureProps, TableStaleNoticeProps } from './host.cjs';
6
6
  export { MatrxDataTableHost, MatrxDataTableProvider, MatrxTableRowAlchemy, TableContextMenuBoundaryProps, TableDoors, TableEntityRefProps, TableLinkProps, TableMenuIconProps, TablePeekProps, TableSidePanelProps, TableToolbarActionProps, TableWindowPanelProps, useMatrxDataTableHost, useMatrxTableRowAlchemy } from './host.cjs';
7
7
  import { CopyControlProps } from './copy-types.cjs';
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { h as MatrxDataTableProps, i as TableViewSnapshot, d as MatrxDataTableRecordControls, j as MatrxDataTableRead, k as ColumnMarker, M as MatrxColumnDef } from '../types-DVTNnzU5.js';
4
- export { A as AnyOfColumnSearch, l as CellEditType, m as CellEditsMap, f as ColumnFilterKind, a as ColumnFilterValue, C as ColumnFiltersState, n as MatrxDataTableContextMenuConfig, g as MatrxDataTableCopyConfig, o as MatrxDataTableCoverageConfig, c as MatrxDataTableDensity, p as MatrxDataTableDetailConfig, q as MatrxDataTableEditConfig, r as MatrxDataTableEmptyState, s as MatrxDataTableExpandedDetailConfig, t as MatrxDataTableFacetsConfig, u as MatrxDataTableFilterUi, v as MatrxDataTableGroupingConfig, w as MatrxDataTableHierarchyConfig, x as MatrxDataTableHierarchyMove, y as MatrxDataTableMobileCardControls, z as MatrxDataTableMultiExpandedDetailConfig, B as MatrxDataTableQueryControl, e as MatrxDataTableQueryState, D as MatrxDataTableReadStatus, E as MatrxDataTableSelectionConfig, F as MatrxDataTableSingleExpandedDetailConfig, G as MatrxDataTableSourceProcessing, H as MatrxDataTableSpreadsheetConfig, I as MatrxDataTableStyleConfig, J as MatrxDataTableToolbar, K as MatrxDataTableUrlStateConfig, N as MatrxDataTableVirtualizeConfig, O as MatrxDataTableWindowConfig, P as MatrxTablePagination, Q as NumberFilterOp, R as SavedTableViewTab, U as SortDirection, S as SortState, V as SpreadsheetSelection, W as TableRankedSearchOptions, b as TableSavedViewsProps, T as TableSearchMatchMode, X as TableSearchRole, Y as TableSearchScope, Z as TableViewQuery, _ as TableViewTab, $ as TableViewTabs, a0 as TableViewTabsProps, a1 as TableViewTabsStore, a2 as TextFilterMode, a3 as ToolbarFacet, a4 as inferTableSearchRole, a5 as rankTableSearchRows, a6 as resolveTableSearchScopes } from '../types-DVTNnzU5.js';
3
+ import { h as MatrxDataTableProps, i as TableViewSnapshot, d as MatrxDataTableRecordControls, j as MatrxDataTableRead, k as ColumnMarker, M as MatrxColumnDef } from '../types-DlgTSJsC.js';
4
+ export { A as AnyOfColumnSearch, l as CellEditType, m as CellEditsMap, f as ColumnFilterKind, a as ColumnFilterValue, C as ColumnFiltersState, n as MatrxDataTableContextMenuConfig, g as MatrxDataTableCopyConfig, o as MatrxDataTableCoverageConfig, c as MatrxDataTableDensity, p as MatrxDataTableDetailConfig, q as MatrxDataTableEditConfig, r as MatrxDataTableEmptyState, s as MatrxDataTableExpandedDetailConfig, t as MatrxDataTableFacetsConfig, u as MatrxDataTableFilterUi, v as MatrxDataTableGroupingConfig, w as MatrxDataTableHierarchyConfig, x as MatrxDataTableHierarchyMove, y as MatrxDataTableMobileCardControls, z as MatrxDataTableMultiExpandedDetailConfig, B as MatrxDataTableQueryControl, e as MatrxDataTableQueryState, D as MatrxDataTableReadStatus, E as MatrxDataTableSelectionConfig, F as MatrxDataTableSingleExpandedDetailConfig, G as MatrxDataTableSourceProcessing, H as MatrxDataTableSpreadsheetConfig, I as MatrxDataTableStyleConfig, J as MatrxDataTableSummaryConfig, K as MatrxDataTableSummaryContext, N as MatrxDataTableSummaryMetric, O as MatrxDataTableToolbar, P as MatrxDataTableUrlStateConfig, Q as MatrxDataTableVirtualizeConfig, R as MatrxDataTableWindowConfig, U as MatrxTablePagination, V as NumberFilterOp, W as SavedTableViewTab, X as SortDirection, S as SortState, Y as SpreadsheetSelection, Z as TableRankedSearchOptions, b as TableSavedViewsProps, T as TableSearchMatchMode, _ as TableSearchRole, $ as TableSearchScope, a0 as TableViewQuery, a1 as TableViewTab, a2 as TableViewTabs, a3 as TableViewTabsProps, a4 as TableViewTabsStore, a5 as TextFilterMode, a6 as ToolbarFacet, a7 as inferTableSearchRole, a8 as rankTableSearchRows, a9 as resolveTableSearchScopes } from '../types-DlgTSJsC.js';
5
5
  import { TableReadFailureProps, TableStaleNoticeProps } from './host.js';
6
6
  export { MatrxDataTableHost, MatrxDataTableProvider, MatrxTableRowAlchemy, TableContextMenuBoundaryProps, TableDoors, TableEntityRefProps, TableLinkProps, TableMenuIconProps, TablePeekProps, TableSidePanelProps, TableToolbarActionProps, TableWindowPanelProps, useMatrxDataTableHost, useMatrxTableRowAlchemy } from './host.js';
7
7
  import { CopyControlProps } from './copy-types.js';
@@ -34934,6 +34934,16 @@ var selectTriggerVariants = cva2(
34934
34934
  }
34935
34935
  }
34936
34936
  );
34937
+ function SelectChevron({ className, size = "default" }) {
34938
+ return /* @__PURE__ */ jsx11(
34939
+ RadixChevronDownIcon,
34940
+ {
34941
+ "aria-hidden": "true",
34942
+ "data-select-chevron": "",
34943
+ className: cn(size === "sm" ? "h-3.5 w-3.5" : "h-4 w-4", "shrink-0 opacity-50", className)
34944
+ }
34945
+ );
34946
+ }
34937
34947
  var SelectTrigger = React8.forwardRef(({ className, children, hideArrow = false, size, ...props }, ref) => /* @__PURE__ */ jsxs7(
34938
34948
  SelectPrimitive.Trigger,
34939
34949
  {
@@ -34942,7 +34952,7 @@ var SelectTrigger = React8.forwardRef(({ className, children, hideArrow = false,
34942
34952
  ...props,
34943
34953
  children: [
34944
34954
  children,
34945
- !hideArrow && /* @__PURE__ */ jsx11(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx11(RadixChevronDownIcon, { className: "h-4 w-4 shrink-0 opacity-50" }) })
34955
+ !hideArrow && /* @__PURE__ */ jsx11(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx11(SelectChevron, { size: size === "sm" ? "sm" : "default" }) })
34946
34956
  ]
34947
34957
  }
34948
34958
  ));
@@ -36369,7 +36379,8 @@ function GenericTablePagination({
36369
36379
  labelFormat,
36370
36380
  compact = false,
36371
36381
  hideEntriesInfo = false,
36372
- progressive
36382
+ progressive,
36383
+ countUnavailable
36373
36384
  }) {
36374
36385
  const host = useMatrxDataTableHost();
36375
36386
  const positivePageSizes = pageSizeOptions.filter((size) => size > 0);
@@ -36444,7 +36455,16 @@ function GenericTablePagination({
36444
36455
  "div",
36445
36456
  {
36446
36457
  className: cn("flex min-w-0 justify-center", infoContainerClassName),
36447
- children: showPageInfo && !hideEntriesInfo && /* @__PURE__ */ jsxs15(Fragment3, { children: [
36458
+ children: showPageInfo && !hideEntriesInfo && countUnavailable === "failed" ? /* @__PURE__ */ jsx23(
36459
+ "span",
36460
+ {
36461
+ role: "img",
36462
+ "aria-label": "Row count unavailable",
36463
+ title: "Row count unavailable",
36464
+ className: "truncate text-sm tabular-nums text-muted-foreground",
36465
+ children: /* @__PURE__ */ jsx23("span", { "aria-hidden": "true", children: "\u2014" })
36466
+ }
36467
+ ) : showPageInfo && !hideEntriesInfo && !countUnavailable && /* @__PURE__ */ jsxs15(Fragment3, { children: [
36448
36468
  /* @__PURE__ */ jsx23("span", { className: "truncate text-xs tabular-nums text-muted-foreground sm:hidden", children: labelFormat ? formatLabel(startItem, endItem, totalItems) : unknownTotal ? defaultLabelFormat(startItem, endItem, totalItems) : totalItems === 0 ? "0 rows" : progressive ? `${endItem}/${totalItems} ${progressive.loadedCount !== void 0 && progressive.loadedCount !== totalItems ? "matching" : "loaded"}` : `${startItem}\u2013${endItem} of ${totalItems}` }),
36449
36469
  /* @__PURE__ */ jsx23(
36450
36470
  "span",
@@ -48097,6 +48117,7 @@ function MatrxDataTableCore(coreProps) {
48097
48117
  selection: selectionConfig,
48098
48118
  rowActions,
48099
48119
  footerRows = [],
48120
+ summary,
48100
48121
  rowClassName,
48101
48122
  rowVersion,
48102
48123
  cellClassName,
@@ -48152,6 +48173,17 @@ function MatrxDataTableCore(coreProps) {
48152
48173
  const CHECKBOX_TAP_AREA = "h-4 w-4 touch-manipulation";
48153
48174
  const mobileCardsClass = mobileCardsBreakpoint === "lg" ? "lg:hidden" : "sm:hidden";
48154
48175
  const tableWithCardsClass = mobileCardsBreakpoint === "lg" ? "max-lg:hidden" : "max-sm:hidden";
48176
+ const cardsQuery = mobileCardsBreakpoint === "lg" ? "(max-width: 1023px)" : "(max-width: 639px)";
48177
+ const [cardsActive, setCardsActive] = useState25(null);
48178
+ useEffect20(() => {
48179
+ if (!mobileCards || typeof window === "undefined" || !window.matchMedia) return;
48180
+ const mql = window.matchMedia(cardsQuery);
48181
+ const read2 = () => setCardsActive(mql.matches);
48182
+ read2();
48183
+ mql.addEventListener?.("change", read2);
48184
+ return () => mql.removeEventListener?.("change", read2);
48185
+ }, [mobileCards, cardsQuery]);
48186
+ const inactiveProps = (active) => cardsActive === null || active ? {} : { inert: true, "aria-hidden": true };
48155
48187
  const controlledQuery = query?.mode === "controlled" || query?.mode === "controlled-local" || query?.mode === "controlled-append" ? query : null;
48156
48188
  const remoteQuery = query?.mode === "controlled" || query?.mode === "controlled-append" ? query : null;
48157
48189
  const sourceProcessing = query?.mode === "controlled" || query?.mode === "controlled-local" ? query.sourceProcessing : appendQuery?.sourceProcessing;
@@ -49466,6 +49498,48 @@ function MatrxDataTableCore(coreProps) {
49466
49498
  return def !== void 0 && f.value !== def;
49467
49499
  });
49468
49500
  const hasActiveFilters = activeFilterCount > 0 || Boolean(searchValue.trim()) || intelligentSearchEnabled && searchScope !== "all" || Boolean(anyOfValue.trim()) || completeLayeredFilterRules(layeredFilters).length > 0 || facetActive;
49501
+ const summaryIsFiltered = activeFilterCount > 0 || Boolean(searchValue.trim()) || Boolean(anyOfValue.trim()) || completeLayeredFilterRules(layeredFilters).length > 0 || facetActive;
49502
+ const summaryCoverage = remoteQuery?.mode === "controlled" ? "page" : appendQuery !== null || !allRowsAreLoaded ? "loaded" : "all";
49503
+ const summaryContext = {
49504
+ rows: processed,
49505
+ isFiltered: summaryIsFiltered,
49506
+ coverage: summaryCoverage
49507
+ };
49508
+ const summaryCanReadRows = !readView.failure && (!isLoading || data.length > 0);
49509
+ const summaryUsesSource = summary?.source !== void 0;
49510
+ const summaryCaption = (() => {
49511
+ if (summaryUsesSource) {
49512
+ const sourceCaption = summary?.source?.isFiltered ? "Filtered source totals" : "Source totals";
49513
+ return readView.stale ? `${sourceCaption} (stale)` : sourceCaption;
49514
+ }
49515
+ const base = summaryCoverage === "all" ? "rows" : summaryCoverage === "loaded" ? "loaded rows" : "current page";
49516
+ const caption = summaryIsFiltered ? `Filtered ${base}` : base === "rows" ? "All rows" : base[0].toUpperCase() + base.slice(1);
49517
+ return readView.stale ? `${caption} (stale)` : caption;
49518
+ })();
49519
+ const resolveSummaryValue = (sourceValue, callback) => {
49520
+ if (!summaryCanReadRows) {
49521
+ return readView.failure ? { value: "Unavailable", unavailable: true } : { value: "Loading", unavailable: false };
49522
+ }
49523
+ if (summaryUsesSource) {
49524
+ return sourceValue === void 0 ? { value: "Unavailable", unavailable: true } : { value: sourceValue, unavailable: false };
49525
+ }
49526
+ if (!callback) return { value: "Unavailable", unavailable: true };
49527
+ try {
49528
+ return { value: callback(summaryContext), unavailable: false };
49529
+ } catch {
49530
+ return { value: "Unavailable", unavailable: true };
49531
+ }
49532
+ };
49533
+ const summaryMetrics = summary?.metrics.map((metric) => ({
49534
+ id: metric.id,
49535
+ label: metric.label,
49536
+ ...resolveSummaryValue(summary.source?.metrics?.[metric.id], metric.value)
49537
+ })) ?? [];
49538
+ const summaryTotals = Object.entries(summary?.totals ?? {}).map(([id, value]) => ({
49539
+ id,
49540
+ ...resolveSummaryValue(summary?.source?.totals?.[id], value)
49541
+ }));
49542
+ const hasSummaryTotals = summaryTotals.length > 0;
49469
49543
  const changeCount = useMemo11(() => {
49470
49544
  let n2 = 0;
49471
49545
  for (const fields of Object.values(edits)) {
@@ -50367,7 +50441,16 @@ function MatrxDataTableCore(coreProps) {
50367
50441
  controlledQuery,
50368
50442
  emitControlledQueryChange
50369
50443
  ]);
50370
- const footerEpoch = useRenderEpoch([...chromeGeometry, footerRows]);
50444
+ const footerEpoch = useRenderEpoch([
50445
+ ...chromeGeometry,
50446
+ footerRows,
50447
+ summaryContext.rows,
50448
+ summaryContext.isFiltered,
50449
+ summaryContext.coverage,
50450
+ summaryCaption,
50451
+ summaryUsesSource,
50452
+ ...summaryTotals.flatMap((total) => [total.id, total.value, total.unavailable])
50453
+ ]);
50371
50454
  const paginationEpoch = useRenderEpoch([
50372
50455
  totalItems,
50373
50456
  sourceTotal,
@@ -50904,6 +50987,25 @@ function MatrxDataTableCore(coreProps) {
50904
50987
  notice,
50905
50988
  savedViewError ? /* @__PURE__ */ jsx50(ErrorBox, { className: "shrink-0 text-xs text-destructive", message: savedViewError, operation: "Save or apply a saved view", origin: "design-system/MatrxDataTable" }) : null,
50906
50989
  toolbarActionError ? /* @__PURE__ */ jsx50(ErrorBox, { className: "shrink-0 text-xs text-destructive", message: toolbarActionError, operation: "Run a table toolbar action", origin: "design-system/MatrxDataTable" }) : null,
50990
+ summaryMetrics.length > 0 ? /* @__PURE__ */ jsxs39(
50991
+ "section",
50992
+ {
50993
+ "data-matrx-table-summary": true,
50994
+ "data-matrx-table-summary-scope": summaryUsesSource ? "source" : summaryCoverage,
50995
+ "aria-label": `Table summary: ${summaryCaption}`,
50996
+ className: "flex shrink-0 flex-wrap items-stretch gap-2",
50997
+ children: [
50998
+ /* @__PURE__ */ jsx50("span", { className: "flex items-center px-1 text-xs font-medium text-muted-foreground", children: summaryCaption }),
50999
+ summaryMetrics.map((metric) => /* @__PURE__ */ jsxs39("div", { className: "min-w-24 rounded-md border border-border bg-card px-3 py-2 shadow-xs", children: [
51000
+ /* @__PURE__ */ jsx50("div", { className: "text-xs text-muted-foreground", children: metric.label }),
51001
+ /* @__PURE__ */ jsxs39("div", { className: "mt-0.5 text-sm font-semibold tabular-nums text-foreground", children: [
51002
+ metric.value,
51003
+ metric.unavailable ? /* @__PURE__ */ jsx50(ErrorBox, { as: "span", className: "sr-only", message: `${metric.label} is unavailable`, operation: "Summarize this table", origin: "design-system/MatrxDataTable" }) : null
51004
+ ] })
51005
+ ] }, metric.id))
51006
+ ]
51007
+ }
51008
+ ) : null,
50907
51009
  /* @__PURE__ */ jsx50(MatrxTableChrome, { part: "toolbar", epoch: toolbarEpoch, render: () => placeToolbar(!hideToolbar && (viewTabs || toolbar?.title || toolbar?.titleCount || showSearch || toolbar?.customSearch || toolbar?.anyOf || toolbar?.layeredFilters || toolbar?.facets && toolbar.facets.length > 0 || toolbar?.leading || toolbar?.actions || toolbar?.refresh || toolbar?.add || tableId && SavedViews || hasActiveFilters || showToolbarCopy || columns.length > 0) && /* @__PURE__ */ jsxs39(
50908
51010
  TableTitleRow,
50909
51011
  {
@@ -51240,6 +51342,7 @@ function MatrxDataTableCore(coreProps) {
51240
51342
  "div",
51241
51343
  {
51242
51344
  ref: cardsScrollRef,
51345
+ ...inactiveProps(cardsActive === true),
51243
51346
  "data-matrx-table-cards-scroll": true,
51244
51347
  "aria-busy": isLoading || isFetching,
51245
51348
  ...appendQuery === null ? {} : { style: { containerType: "inline-size" } },
@@ -51348,6 +51451,7 @@ function MatrxDataTableCore(coreProps) {
51348
51451
  "div",
51349
51452
  {
51350
51453
  ref: scrollRef,
51454
+ ...mobileCards ? inactiveProps(cardsActive === false) : {},
51351
51455
  "data-matrx-table-scroll": true,
51352
51456
  onScroll: updateScrollHint,
51353
51457
  ...spreadsheetEnabled ? {
@@ -51744,50 +51848,111 @@ function MatrxDataTableCore(coreProps) {
51744
51848
  }
51745
51849
  ) }) : null
51746
51850
  ] }),
51747
- /* @__PURE__ */ jsx50(MatrxTableChrome, { part: "footer", epoch: footerEpoch, render: () => footerRows.length > 0 ? /* @__PURE__ */ jsx50("tfoot", { className: "border-t-2 border-border bg-muted/50 font-semibold", children: footerRows.map((row, index) => /* @__PURE__ */ jsxs39("tr", { children: [
51748
- selection ? /* @__PURE__ */ jsx50("td", { className: "px-2 py-2" }) : null,
51749
- columnSpacers && columnSpacers.start > 0 ? /* @__PURE__ */ jsx50(
51750
- "td",
51751
- {
51752
- "aria-hidden": "true",
51753
- "data-matrx-table-column-spacer": "start",
51754
- className: "border-0 p-0",
51755
- style: { width: `${columnSpacers.start}px`, minWidth: `${columnSpacers.start}px` }
51756
- },
51757
- "matrx-column-spacer-start"
51758
- ) : null,
51759
- renderedColumns.map((column) => /* @__PURE__ */ jsx50(
51760
- "td",
51761
- {
51762
- className: cn(
51763
- "px-2 py-2 align-middle",
51764
- (column.compact || resolveColumnMarker(column) !== void 0) && "px-1",
51765
- column.className,
51766
- column.align === "center" && "text-center",
51767
- column.align === "right" && "text-right"
51768
- ),
51769
- style: columnWidthVar(
51770
- resolveColumnMarker(column) && column.width === void 0 ? 40 : column.width,
51771
- windowedWidthFor(columnId(column), column.width),
51772
- columnId(column),
51773
- resizableColumns && column.resizable !== false
51774
- ),
51775
- children: renderCell(row, column, index)
51776
- },
51777
- columnId(column)
51778
- )),
51779
- columnSpacers && columnSpacers.end > 0 ? /* @__PURE__ */ jsx50(
51780
- "td",
51781
- {
51782
- "aria-hidden": "true",
51783
- "data-matrx-table-column-spacer": "end",
51784
- className: "border-0 p-0",
51785
- style: { width: `${columnSpacers.end}px`, minWidth: `${columnSpacers.end}px` }
51786
- },
51787
- "matrx-column-spacer-end"
51788
- ) : null,
51789
- showActionsCol ? /* @__PURE__ */ jsx50("td", {}) : null
51790
- ] }, `footer-${index}`)) }) : null })
51851
+ /* @__PURE__ */ jsx50(MatrxTableChrome, { part: "footer", epoch: footerEpoch, render: () => footerRows.length > 0 || hasSummaryTotals ? /* @__PURE__ */ jsxs39("tfoot", { className: cn(
51852
+ "border-t-2 border-border bg-muted/50 font-semibold",
51853
+ hasSummaryTotals && "sticky bottom-0 z-10 bg-muted/95 backdrop-blur-sm"
51854
+ ), children: [
51855
+ hasSummaryTotals ? /* @__PURE__ */ jsxs39(Fragment12, { children: [
51856
+ /* @__PURE__ */ jsx50("tr", { "data-matrx-table-summary-total-caption": true, children: /* @__PURE__ */ jsxs39("td", { colSpan: renderedColSpan, className: "px-2 pt-2 text-xs font-medium text-muted-foreground", children: [
51857
+ summaryCaption,
51858
+ readView.stale ? /* @__PURE__ */ jsx50("span", { className: "ml-1 text-amber-700 dark:text-amber-300", children: "Retained rows may be out of date." }) : null
51859
+ ] }) }),
51860
+ /* @__PURE__ */ jsxs39("tr", { "data-matrx-table-summary-totals": true, children: [
51861
+ selection ? /* @__PURE__ */ jsx50("td", { className: "px-2 py-2" }) : null,
51862
+ columnSpacers && columnSpacers.start > 0 ? /* @__PURE__ */ jsx50(
51863
+ "td",
51864
+ {
51865
+ "aria-hidden": "true",
51866
+ "data-matrx-table-column-spacer": "start",
51867
+ className: "border-0 p-0",
51868
+ style: { width: `${columnSpacers.start}px`, minWidth: `${columnSpacers.start}px` }
51869
+ },
51870
+ "matrx-summary-column-spacer-start"
51871
+ ) : null,
51872
+ renderedColumns.map((column) => {
51873
+ const total = summaryTotals.find((candidate) => candidate.id === columnId(column));
51874
+ return /* @__PURE__ */ jsxs39(
51875
+ "td",
51876
+ {
51877
+ className: cn(
51878
+ "px-2 py-2 align-middle",
51879
+ (column.compact || resolveColumnMarker(column) !== void 0) && "px-1",
51880
+ column.className,
51881
+ column.align === "center" && "text-center",
51882
+ column.align === "right" && "text-right"
51883
+ ),
51884
+ style: columnWidthVar(
51885
+ resolveColumnMarker(column) && column.width === void 0 ? 40 : column.width,
51886
+ windowedWidthFor(columnId(column), column.width),
51887
+ columnId(column),
51888
+ resizableColumns && column.resizable !== false
51889
+ ),
51890
+ children: [
51891
+ total?.value,
51892
+ total?.unavailable ? /* @__PURE__ */ jsx50(ErrorBox, { as: "span", className: "sr-only", message: `${columnId(column)} total is unavailable`, operation: "Total this column", origin: "design-system/MatrxDataTable" }) : null
51893
+ ]
51894
+ },
51895
+ columnId(column)
51896
+ );
51897
+ }),
51898
+ columnSpacers && columnSpacers.end > 0 ? /* @__PURE__ */ jsx50(
51899
+ "td",
51900
+ {
51901
+ "aria-hidden": "true",
51902
+ "data-matrx-table-column-spacer": "end",
51903
+ className: "border-0 p-0",
51904
+ style: { width: `${columnSpacers.end}px`, minWidth: `${columnSpacers.end}px` }
51905
+ },
51906
+ "matrx-summary-column-spacer-end"
51907
+ ) : null,
51908
+ showActionsCol ? /* @__PURE__ */ jsx50("td", {}) : null
51909
+ ] })
51910
+ ] }) : null,
51911
+ footerRows.map((row, index) => /* @__PURE__ */ jsxs39("tr", { children: [
51912
+ selection ? /* @__PURE__ */ jsx50("td", { className: "px-2 py-2" }) : null,
51913
+ columnSpacers && columnSpacers.start > 0 ? /* @__PURE__ */ jsx50(
51914
+ "td",
51915
+ {
51916
+ "aria-hidden": "true",
51917
+ "data-matrx-table-column-spacer": "start",
51918
+ className: "border-0 p-0",
51919
+ style: { width: `${columnSpacers.start}px`, minWidth: `${columnSpacers.start}px` }
51920
+ },
51921
+ "matrx-column-spacer-start"
51922
+ ) : null,
51923
+ renderedColumns.map((column) => /* @__PURE__ */ jsx50(
51924
+ "td",
51925
+ {
51926
+ className: cn(
51927
+ "px-2 py-2 align-middle",
51928
+ (column.compact || resolveColumnMarker(column) !== void 0) && "px-1",
51929
+ column.className,
51930
+ column.align === "center" && "text-center",
51931
+ column.align === "right" && "text-right"
51932
+ ),
51933
+ style: columnWidthVar(
51934
+ resolveColumnMarker(column) && column.width === void 0 ? 40 : column.width,
51935
+ windowedWidthFor(columnId(column), column.width),
51936
+ columnId(column),
51937
+ resizableColumns && column.resizable !== false
51938
+ ),
51939
+ children: renderCell(row, column, index)
51940
+ },
51941
+ columnId(column)
51942
+ )),
51943
+ columnSpacers && columnSpacers.end > 0 ? /* @__PURE__ */ jsx50(
51944
+ "td",
51945
+ {
51946
+ "aria-hidden": "true",
51947
+ "data-matrx-table-column-spacer": "end",
51948
+ className: "border-0 p-0",
51949
+ style: { width: `${columnSpacers.end}px`, minWidth: `${columnSpacers.end}px` }
51950
+ },
51951
+ "matrx-column-spacer-end"
51952
+ ) : null,
51953
+ showActionsCol ? /* @__PURE__ */ jsx50("td", {}) : null
51954
+ ] }, `footer-${index}`))
51955
+ ] }) : null })
51791
51956
  ]
51792
51957
  }
51793
51958
  )
@@ -51953,6 +52118,7 @@ function MatrxDataTableCore(coreProps) {
51953
52118
  GenericTablePagination,
51954
52119
  {
51955
52120
  totalItems,
52121
+ ...readView.failure ? { countUnavailable: "failed" } : read?.status === "loading" && data.length === 0 ? { countUnavailable: "loading" } : {},
51956
52122
  ...paginationLabelFormat ? { labelFormat: paginationLabelFormat } : sourceTotal === void 0 ? {} : { labelFormat: (start, end, total) => `${formatCount(start)}\u2013${formatCount(end)} of ${formatCount(total)} matching \xB7 ${formatCount(data.length)} / ${formatCount(sourceTotal)} loaded` },
51957
52123
  ...localProgressiveEnabled ? { progressive: {
51958
52124
  shownCount: progressiveRows.shownCount,
@@ -52634,7 +52800,7 @@ var DropdownMenu = DropdownMenuPrimitive.Root;
52634
52800
  var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
52635
52801
  var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
52636
52802
  var MENU_SURFACE_CLASS = "z-[10001] min-w-[8rem] max-h-[var(--radix-dropdown-menu-content-available-height)] overflow-y-auto overflow-x-hidden overscroll-contain rounded-md border bg-popover p-1 text-popover-foreground";
52637
- var MENU_ITEM_CLASS = "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50";
52803
+ var MENU_ITEM_CLASS = "relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50";
52638
52804
  var MENU_INDICATOR_ITEM_CLASS = "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50";
52639
52805
  var DropdownMenuSubTrigger = React22.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs40(
52640
52806
  DropdownMenuPrimitive.SubTrigger,