@valu/block-components 0.2.0 → 0.2.1

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.js CHANGED
@@ -2233,6 +2233,22 @@ var SummaryCell = styled.td`
2233
2233
  color: ${tokens2.gray600};
2234
2234
  font-variant-numeric: tabular-nums;
2235
2235
  `;
2236
+ var FillerCell = styled.td`
2237
+ width: 100%;
2238
+ padding: 0;
2239
+ `;
2240
+ var FillerHeaderCell = styled.th`
2241
+ width: 100%;
2242
+ padding: 0;
2243
+
2244
+ ${(p) => p.$sticky && css`
2245
+ position: sticky;
2246
+ top: 0;
2247
+ z-index: ${tokens2.zHeader};
2248
+ background: ${tokens2.bg};
2249
+ box-shadow: ${tokens2.shadowStickyTop};
2250
+ `};
2251
+ `;
2236
2252
  var CellControlWrap = styled.div`
2237
2253
  display: inline-flex;
2238
2254
  align-items: center;
@@ -2301,7 +2317,8 @@ var MatrixHeader = ({
2301
2317
  children: renderHeader ? renderHeader(col) : col.label
2302
2318
  },
2303
2319
  col.id
2304
- ))
2320
+ )),
2321
+ /* @__PURE__ */ jsx(FillerHeaderCell, { "aria-hidden": true, $sticky: stickyHeader })
2305
2322
  ] }) });
2306
2323
  }
2307
2324
  const TOP_ROW_HEIGHT = "36px";
@@ -2358,7 +2375,8 @@ var MatrixHeader = ({
2358
2375
  },
2359
2376
  group.id
2360
2377
  );
2361
- })
2378
+ }),
2379
+ /* @__PURE__ */ jsx(FillerHeaderCell, { "aria-hidden": true, rowSpan: 2, $sticky: stickyHeader })
2362
2380
  ] }),
2363
2381
  /* @__PURE__ */ jsx("tr", { children: groups.map((group) => {
2364
2382
  const open = isExpanded(group, expandedGroups);
@@ -2570,7 +2588,8 @@ var MatrixRowView = ({
2570
2588
  },
2571
2589
  `${group.id}::${col.id}`
2572
2590
  ));
2573
- })
2591
+ }),
2592
+ /* @__PURE__ */ jsx(FillerCell, { "aria-hidden": true })
2574
2593
  ] });
2575
2594
  };
2576
2595
  var EmotionCacheProvider2 = ({ children }) => {
@@ -2653,6 +2672,7 @@ var Matrix = (props) => {
2653
2672
  renderHeader,
2654
2673
  stickyHeader = true,
2655
2674
  stickyFirstColumn = true,
2675
+ rowHeaderWidth = 220,
2656
2676
  maxHeight = DEFAULT_MAX_HEIGHT,
2657
2677
  caption,
2658
2678
  labels,
@@ -2672,9 +2692,16 @@ var Matrix = (props) => {
2672
2692
  onChange: onExpandedChange
2673
2693
  });
2674
2694
  const maxHeightCss = typeof maxHeight === "number" ? `${maxHeight}px` : maxHeight;
2675
- const masterLeftOffset = "220px";
2695
+ const cssLength = (v) => typeof v === "number" ? `${v}px` : v;
2696
+ const rowHeaderWidthCss = cssLength(rowHeaderWidth);
2697
+ const masterWidthCss = master ? cssLength(master.width ?? 96) : "0";
2698
+ const masterLeftOffset = rowHeaderWidthCss;
2676
2699
  return /* @__PURE__ */ jsx(EmotionCacheProvider2, { children: /* @__PURE__ */ jsx(Root2, { id: rootId, className, children: /* @__PURE__ */ jsx(Viewport, { $maxHeight: maxHeightCss, children: /* @__PURE__ */ jsxs(Table, { children: [
2677
2700
  caption && /* @__PURE__ */ jsx(Caption, { children: caption }),
2701
+ /* @__PURE__ */ jsxs("colgroup", { children: [
2702
+ /* @__PURE__ */ jsx("col", { style: { width: rowHeaderWidthCss } }),
2703
+ master && /* @__PURE__ */ jsx("col", { style: { width: masterWidthCss } })
2704
+ ] }),
2678
2705
  /* @__PURE__ */ jsx(
2679
2706
  MatrixHeader,
2680
2707
  {