@ctlyst.id/internal-ui 5.6.8 → 5.7.0

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.d.mts CHANGED
@@ -261,7 +261,7 @@ interface DataTableProps<T> {
261
261
  onRowClick?: (data: T) => void;
262
262
  disabledRow?: (row: T) => boolean;
263
263
  highlightedRow?: (row: T) => boolean;
264
- highlightRowColor?: BackgroundProps['bg'];
264
+ highlightRowColor?: BackgroundProps['bg'] | ((row: T) => BackgroundProps['bg']);
265
265
  /** paddingRowX in px */
266
266
  paddingRowX?: number;
267
267
  }
package/dist/index.d.ts CHANGED
@@ -261,7 +261,7 @@ interface DataTableProps<T> {
261
261
  onRowClick?: (data: T) => void;
262
262
  disabledRow?: (row: T) => boolean;
263
263
  highlightedRow?: (row: T) => boolean;
264
- highlightRowColor?: BackgroundProps['bg'];
264
+ highlightRowColor?: BackgroundProps['bg'] | ((row: T) => BackgroundProps['bg']);
265
265
  /** paddingRowX in px */
266
266
  paddingRowX?: number;
267
267
  }
package/dist/index.js CHANGED
@@ -1767,12 +1767,13 @@ var DataTable = React6.forwardRef((props, ref) => {
1767
1767
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react31.Tbody, { ...styles == null ? void 0 : styles.tableBody, animation: `${fadeIn} 0.15s ease-out`, children: table.getRowModel().rows.map((row, index) => {
1768
1768
  const isDisabledRow = disabledRow && disabledRow(row.original);
1769
1769
  const isHighlightedRow = Object.keys(selectedRow != null ? selectedRow : {}).filter((key) => selectedRow == null ? void 0 : selectedRow[key]).includes(row.id) || highlightedRow && highlightedRow(row.original);
1770
+ const hgColor = typeof highlightRowColor === "function" ? highlightRowColor(row.original) : highlightRowColor;
1770
1771
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1771
1772
  import_react31.Tr,
1772
1773
  {
1773
1774
  "data-test-id": "-RU0hNYGRzeVM3HQ4cXHl",
1774
1775
  ...styles == null ? void 0 : styles.tableRow,
1775
- sx: { ...isHighlightedRow && getTableHighlightStyle(highlightRowColor) },
1776
+ sx: { ...isHighlightedRow && getTableHighlightStyle(hgColor) },
1776
1777
  "aria-disabled": isDisabledRow,
1777
1778
  "data-highlight": isHighlightedRow ? "true" : "false",
1778
1779
  css: import_react32.css`