@polastack/design-system 0.1.39 → 0.1.40

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
@@ -2774,9 +2774,13 @@ function DataTable({
2774
2774
  setStickyOffsets(offsets);
2775
2775
  }
2776
2776
  }, [stickyColumns, columnVisibility]);
2777
- const getStickyStyle = (colIndex) => {
2778
- if (colIndex >= stickyColumns || stickyOffsets.length === 0) return void 0;
2777
+ const getCellStyle = (cell, colIndex) => {
2778
+ if (stickyColumns <= 0) return void 0;
2779
+ const size = cell.column.getSize();
2780
+ const base = { minWidth: size, width: size };
2781
+ if (colIndex >= stickyColumns || stickyOffsets.length === 0) return base;
2779
2782
  return {
2783
+ ...base,
2780
2784
  position: "sticky",
2781
2785
  left: stickyOffsets[colIndex] ?? 0,
2782
2786
  zIndex: 1
@@ -2794,7 +2798,7 @@ function DataTable({
2794
2798
  }
2795
2799
  ),
2796
2800
  /* @__PURE__ */ jsxs14(Table, { "aria-label": ariaLabel, className: stickyColumns > 0 ? "min-w-max" : void 0, children: [
2797
- /* @__PURE__ */ jsx33(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx33(TableRow, { ref: headerRowRef, children: headerGroup.headers.map((header, colIndex) => /* @__PURE__ */ jsx33(TableHead, { className: cn(gridCellClass, stickyHeadClass(colIndex)), style: getStickyStyle(colIndex), children: header.isPlaceholder ? null : header.column.getCanSort() ? /* @__PURE__ */ jsxs14(
2801
+ /* @__PURE__ */ jsx33(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx33(TableRow, { ref: headerRowRef, children: headerGroup.headers.map((header, colIndex) => /* @__PURE__ */ jsx33(TableHead, { className: cn(gridCellClass, stickyHeadClass(colIndex)), style: getCellStyle(header, colIndex), children: header.isPlaceholder ? null : header.column.getCanSort() ? /* @__PURE__ */ jsxs14(
2798
2802
  "button",
2799
2803
  {
2800
2804
  className: "flex items-center gap-1 -ml-2 px-2 py-1 rounded-md hover:bg-[var(--color-surface-muted)] transition-colors duration-fast",
@@ -2828,7 +2832,7 @@ function DataTable({
2828
2832
  onClick: () => row.toggleSelected(),
2829
2833
  className: "cursor-pointer"
2830
2834
  },
2831
- children: row.getVisibleCells().map((cell, colIndex) => /* @__PURE__ */ jsx33(TableCell, { className: cn(gridCellClass, stickyCellClass(colIndex)), style: getStickyStyle(colIndex), children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))
2835
+ children: row.getVisibleCells().map((cell, colIndex) => /* @__PURE__ */ jsx33(TableCell, { className: cn(gridCellClass, stickyCellClass(colIndex)), style: getCellStyle(cell, colIndex), children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))
2832
2836
  },
2833
2837
  row.id
2834
2838
  )) : /* @__PURE__ */ jsx33(TableRow, { children: /* @__PURE__ */ jsx33(