@ai-matrx/design-system 0.49.48 → 0.49.50

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.
@@ -43688,6 +43688,27 @@ function MatrxTableGroupHeaderRow({
43688
43688
  onToggle,
43689
43689
  dataAttributes
43690
43690
  }) {
43691
+ const startSpacerColumns = spacers && spacers.start > 0 ? 1 : 0;
43692
+ const desktopLabelSpan = leadingCols + 1 + startSpacerColumns;
43693
+ const mobileAggregateIndex = labelMobileHidden ? cells.findIndex((cell) => !cell.mobileHidden) : -1;
43694
+ const mobileAggregate = mobileAggregateIndex >= 0 ? cells[mobileAggregateIndex] : void 0;
43695
+ const mobileUsesActions = Boolean(labelMobileHidden && !mobileAggregate && showActionsCol);
43696
+ const mobileLabelSpan = Math.max(1, leadingCols + startSpacerColumns + (mobileAggregate ? 1 : 0) + (mobileUsesActions ? 1 : 0));
43697
+ const labelContent = /* @__PURE__ */ jsxs30("div", { className: "flex min-w-0 items-center gap-1.5", style: depth > 0 ? { paddingLeft: `${depth * 1.25}rem` } : void 0, children: [
43698
+ collapsible ? /* @__PURE__ */ jsx40(
43699
+ "button",
43700
+ {
43701
+ type: "button",
43702
+ onClick: onToggle,
43703
+ "aria-expanded": !collapsed,
43704
+ "aria-label": `${collapsed ? "Show" : "Hide"} ${label}`,
43705
+ className: "inline-flex h-5 w-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-accent hover:text-foreground",
43706
+ children: collapsed ? /* @__PURE__ */ jsx40(ChevronRight, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx40(ChevronDown, { className: "h-4 w-4" })
43707
+ }
43708
+ ) : /* @__PURE__ */ jsx40("span", { "aria-hidden": "true", className: "inline-block h-5 w-5 shrink-0" }),
43709
+ /* @__PURE__ */ jsx40("span", { className: "min-w-0 flex-1 truncate", children: labelSlot ?? /* @__PURE__ */ jsx40("span", { className: "text-sm font-semibold text-foreground", children: label }) }),
43710
+ /* @__PURE__ */ jsx40("span", { className: "whitespace-nowrap text-xs text-muted-foreground", children: summary })
43711
+ ] });
43691
43712
  return /* @__PURE__ */ jsxs30(
43692
43713
  "tr",
43693
43714
  {
@@ -43696,30 +43717,20 @@ function MatrxTableGroupHeaderRow({
43696
43717
  ...dataAttributes ?? {},
43697
43718
  className: cn("border-y border-border", depth === 0 ? "bg-muted/40" : "bg-muted/20"),
43698
43719
  children: [
43699
- Array.from({ length: leadingCols }).map((_, i) => /* @__PURE__ */ jsx40("td", { className: "px-2 py-1.5" }, `group-lead-${i}`)),
43700
- spacers && spacers.start > 0 ? /* @__PURE__ */ jsx40("td", { "aria-hidden": "true", className: "border-0 p-0", style: { width: `${spacers.start}px` } }) : null,
43701
43720
  /* @__PURE__ */ jsx40(
43702
43721
  "td",
43703
43722
  {
43723
+ colSpan: desktopLabelSpan,
43704
43724
  className: cn("px-2 py-1.5 align-middle", labelMobileHidden && "max-sm:hidden"),
43705
- children: /* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-1.5", style: depth > 0 ? { paddingLeft: `${depth * 1.25}rem` } : void 0, children: [
43706
- collapsible ? /* @__PURE__ */ jsx40(
43707
- "button",
43708
- {
43709
- type: "button",
43710
- onClick: onToggle,
43711
- "aria-expanded": !collapsed,
43712
- "aria-label": `${collapsed ? "Show" : "Hide"} ${label}`,
43713
- className: "inline-flex h-5 w-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-accent hover:text-foreground",
43714
- children: collapsed ? /* @__PURE__ */ jsx40(ChevronRight, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx40(ChevronDown, { className: "h-4 w-4" })
43715
- }
43716
- ) : /* @__PURE__ */ jsx40("span", { "aria-hidden": "true", className: "inline-block h-5 w-5 shrink-0" }),
43717
- labelSlot ?? /* @__PURE__ */ jsx40("span", { className: "truncate text-sm font-semibold text-foreground", children: label }),
43718
- /* @__PURE__ */ jsx40("span", { className: "whitespace-nowrap text-xs text-muted-foreground", children: summary })
43719
- ] })
43725
+ children: labelContent
43720
43726
  },
43721
43727
  labelColumnId ?? "group-label"
43722
43728
  ),
43729
+ labelMobileHidden ? /* @__PURE__ */ jsx40("td", { colSpan: mobileLabelSpan, className: "px-2 py-1.5 align-middle sm:hidden", children: /* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-2", children: [
43730
+ /* @__PURE__ */ jsx40("div", { className: "min-w-0 flex-1", children: labelContent }),
43731
+ mobileAggregate?.content !== void 0 && mobileAggregate?.content !== null ? /* @__PURE__ */ jsx40("span", { ...mobileAggregate.aggregate ? { "data-matrx-table-group-aggregate": mobileAggregate.id } : {}, className: cn("whitespace-nowrap text-xs font-medium text-muted-foreground", mobileAggregate.align === "right" && "text-right"), children: mobileAggregate.content }) : null,
43732
+ mobileUsesActions ? actions ?? null : null
43733
+ ] }) }) : null,
43723
43734
  cells.map((cell) => /* @__PURE__ */ jsx40(
43724
43735
  "td",
43725
43736
  {
@@ -43729,7 +43740,7 @@ function MatrxTableGroupHeaderRow({
43729
43740
  // right-aligned money column it reads as a different column's value.
43730
43741
  cell.align === "center" && "text-center",
43731
43742
  cell.align === "right" && "text-right",
43732
- cell.mobileHidden && "max-sm:hidden"
43743
+ (cell.mobileHidden || labelMobileHidden && cell === mobileAggregate) && "max-sm:hidden"
43733
43744
  ),
43734
43745
  children: cell.content !== void 0 && cell.content !== null ? /* @__PURE__ */ jsx40(
43735
43746
  "span",
@@ -43743,7 +43754,7 @@ function MatrxTableGroupHeaderRow({
43743
43754
  cell.id
43744
43755
  )),
43745
43756
  spacers && spacers.end > 0 ? /* @__PURE__ */ jsx40("td", { "aria-hidden": "true", className: "border-0 p-0", style: { width: `${spacers.end}px` } }) : null,
43746
- showActionsCol ? /* @__PURE__ */ jsx40("td", { className: "px-2 py-1.5 text-right", children: actions ?? null }) : null
43757
+ showActionsCol ? /* @__PURE__ */ jsx40("td", { className: cn("px-2 py-1.5 text-right", mobileUsesActions && "max-sm:hidden"), children: actions ?? null }) : null
43747
43758
  ]
43748
43759
  }
43749
43760
  );