@homebound/beam 2.329.0 → 2.330.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.
@@ -235,7 +235,7 @@ function renderDiv(style, id, columns, visibleDataRows, keptSelectedRows, firstR
235
235
  ...Css_1.Css.if(stickyHeader).sticky.topPx(stickyOffset).z(utils_1.zIndices.stickyHeader).$,
236
236
  }, children: tableHeadRows }), (0, jsx_runtime_1.jsxs)("div", { css: {
237
237
  ...(style.betweenRowsCss ? Css_1.Css.addIn(`& > div > *`, style.betweenRowsCss).$ : {}),
238
- ...(style.firstNonHeaderRowCss ? Css_1.Css.addIn(`& > div:first-of-type > *`, style.firstNonHeaderRowCss).$ : {}),
238
+ ...(style.firstNonHeaderRowCss ? Css_1.Css.addIn(`& > div:first-of-type`, style.firstNonHeaderRowCss).$ : {}),
239
239
  ...(style.lastRowCss && Css_1.Css.addIn("& > div:last-of-type", style.lastRowCss).$),
240
240
  }, children: [keptSelectedRows, firstRowMessage && ((0, jsx_runtime_1.jsx)("div", { css: { ...style.firstRowMessageCss }, "data-gridrow": true, children: firstRowMessage })), visibleDataRows] })] }));
241
241
  }
@@ -245,7 +245,7 @@ function renderTable(style, id, columns, visibleDataRows, keptSelectedRows, firs
245
245
  ...Css_1.Css.w100.add("borderCollapse", "separate").add("borderSpacing", "0").$,
246
246
  ...Css_1.Css.addIn("& > tbody > tr > * ", style.betweenRowsCss || {})
247
247
  // removes border between header and second row
248
- .addIn("& > tbody > tr:first-of-type > *", style.firstNonHeaderRowCss || {}).$,
248
+ .addIn("& > tbody > tr:first-of-type", style.firstNonHeaderRowCss || {}).$,
249
249
  ...Css_1.Css.addIn("& > tbody > tr:last-of-type", style.lastRowCss).$,
250
250
  ...Css_1.Css.addIn("& > thead > tr:first-of-type", style.firstRowCss).$,
251
251
  ...style.rootCss,
@@ -364,7 +364,7 @@ const VirtualRoot = (0, memoize_one_1.default)((gs, _columns, id, xss) => {
364
364
  ...(isHeader
365
365
  ? Css_1.Css.addIn("& > div:first-of-type > *", gs.firstRowCss).$
366
366
  : {
367
- ...Css_1.Css.addIn("& > div:first-of-type > *", gs.firstNonHeaderRowCss).$,
367
+ ...Css_1.Css.addIn("& > div:first-of-type", gs.firstNonHeaderRowCss).$,
368
368
  ...Css_1.Css.addIn("& > div:last-of-type > *", gs.lastRowCss).$,
369
369
  }),
370
370
  ...gs.rootCss,
@@ -13,6 +13,8 @@ export interface GridStyle {
13
13
  lastRowCss?: Properties;
14
14
  /** Applied on the first row of the table (could be the Header or Totals row). */
15
15
  firstRowCss?: Properties;
16
+ /** Applied to every non-header row of the table */
17
+ nonHeaderRowCss?: Properties;
16
18
  /** Applied to the first non-header row, i.e. if you want to cancel out `betweenRowsCss`. */
17
19
  firstNonHeaderRowCss?: Properties;
18
20
  /** Applied to all cell divs (via a selector off the base div). */
@@ -37,7 +39,9 @@ export interface GridStyle {
37
39
  /** Applied if there is a fallback/overflow message showing. */
38
40
  firstRowMessageCss?: Properties;
39
41
  /** Applied on hover if a row has a rowLink/onClick set. */
40
- rowHoverColor?: Palette;
42
+ rowHoverColor?: Palette | "none";
43
+ /** Applied on hover of a row */
44
+ nonHeaderRowHoverCss?: Properties;
41
45
  /** Default content to put into an empty cell */
42
46
  emptyCell?: ReactNode;
43
47
  presentationSettings?: Pick<PresentationFieldProps, "borderless" | "typeScale"> & Pick<PresentationContextProps, "wrap">;
@@ -92,18 +92,16 @@ exports.condensedStyle = {
92
92
  exports.cardStyle = {
93
93
  ...exports.defaultStyle,
94
94
  betweenRowsCss: {},
95
- firstNonHeaderRowCss: Css_1.Css.mt2.$,
96
- cellCss: Css_1.Css.p2.my1.bt.bb.bGray400.$,
97
- firstCellCss: Css_1.Css.bl.add({ borderTopLeftRadius: "4px", borderBottomLeftRadius: "4px" }).$,
98
- lastCellCss: Css_1.Css.br.add({ borderTopRightRadius: "4px", borderBottomRightRadius: "4px" }).$,
95
+ nonHeaderRowCss: Css_1.Css.br4.overflowHidden.ba.bGray400.mt2.add("transition", "all 240ms").$,
96
+ firstRowCss: Css_1.Css.bl.br.bGray200.borderRadius("8px 8px 0 0").overflowHidden.$,
97
+ cellCss: Css_1.Css.p2.$,
99
98
  // Undo the card look & feel for the header
100
99
  headerCellCss: {
101
100
  ...exports.defaultStyle.headerCellCss,
102
- ...Css_1.Css.add({
103
- border: "none",
104
- borderRadius: "unset",
105
- }).p1.m0.xsMd.gray700.$,
101
+ ...Css_1.Css.p1.m0.xsMd.gray700.$,
106
102
  },
103
+ rowHoverColor: "none",
104
+ nonHeaderRowHoverCss: Css_1.Css.bshHover.bGray700.$,
107
105
  };
108
106
  function resolveStyles(style) {
109
107
  const defKeysRecord = {
@@ -28,14 +28,20 @@ function RowImpl(props) {
28
28
  const RowTag = as === "table" ? "tr" : "div";
29
29
  const sortOn = (_a = tableState.sortConfig) === null || _a === void 0 ? void 0 : _a.on;
30
30
  const revealOnRowHoverClass = "revealOnRowHover";
31
- const showRowHoverColor = !utils_1.reservedRowKinds.includes(row.kind) && !omitRowHover;
31
+ const showRowHoverColor = !utils_1.reservedRowKinds.includes(row.kind) && !omitRowHover && style.rowHoverColor !== "none";
32
32
  const rowStyleCellCss = (0, utils_1.maybeApplyFunction)(row, rowStyle === null || rowStyle === void 0 ? void 0 : rowStyle.cellCss);
33
33
  const rowCss = {
34
+ ...(!utils_1.reservedRowKinds.includes(row.kind) && style.nonHeaderRowCss),
34
35
  // Optionally include the row hover styles, by default they should be turned on.
35
36
  ...(showRowHoverColor && {
36
37
  // Even though backgroundColor is set on the cellCss, the hover target is the row.
37
38
  "&:hover > *": Css_1.Css.bgColor((_b = style.rowHoverColor) !== null && _b !== void 0 ? _b : Css_1.Palette.Blue100).$,
38
39
  }),
40
+ ...(!utils_1.reservedRowKinds.includes(row.kind) &&
41
+ style.nonHeaderRowHoverCss && {
42
+ // Need to spread this to make TS happy.
43
+ ":hover": { ...style.nonHeaderRowHoverCss },
44
+ }),
39
45
  // For virtual tables use `display: flex` to keep all cells on the same row. For each cell in the row use `flexNone` to ensure they stay their defined widths
40
46
  ...(as === "table" ? {} : Css_1.Css.relative.df.fg1.fs1.addIn("&>*", Css_1.Css.flexNone.$).$),
41
47
  // Apply `cursorPointer` to the row if it has a link or `onClick` value.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homebound/beam",
3
- "version": "2.329.0",
3
+ "version": "2.330.0",
4
4
  "author": "Homebound",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",