@homebound/beam 2.126.2 → 2.128.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.
@@ -47,6 +47,8 @@ export declare const Icons: {
47
47
  starFilled: import("@emotion/react/jsx-runtime").JSX.Element;
48
48
  cloudSave: import("@emotion/react/jsx-runtime").JSX.Element;
49
49
  attachment: import("@emotion/react/jsx-runtime").JSX.Element;
50
+ archive: import("@emotion/react/jsx-runtime").JSX.Element;
51
+ unarchive: import("@emotion/react/jsx-runtime").JSX.Element;
50
52
  errorCircle: import("@emotion/react/jsx-runtime").JSX.Element;
51
53
  checkCircle: import("@emotion/react/jsx-runtime").JSX.Element;
52
54
  infoCircle: import("@emotion/react/jsx-runtime").JSX.Element;
@@ -48,6 +48,8 @@ exports.Icons = {
48
48
  starFilled: ((0, jsx_runtime_1.jsx)("path", { d: "M10.2822 4.15376C10.823 2.48976 13.1771 2.48976 13.7178 4.15376L14.8988 7.78807L18.1239 7.78819L18.125 7.78819L18.7202 7.78821C20.4699 7.78828 21.1973 10.0272 19.7818 11.0557L19.3009 11.4051L19.2994 11.4062L16.6904 13.3019L17.8711 16.9363C18.4117 18.6004 16.5072 19.9841 15.0917 18.9557L14.6111 18.6066L14.6092 18.6052L12 16.7097L9.39081 18.6052L8.90836 18.9557C7.49282 19.9841 5.5883 18.6004 6.12891 16.9363L7.30965 13.3019L4.21817 11.0557C2.80271 10.0272 3.53017 7.78828 5.27983 7.78821L5.87502 7.78819L5.87615 7.78819L9.10121 7.78807L10.0979 4.72089L10.2822 4.15376Z" }, void 0)),
49
49
  cloudSave: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("path", { d: "M9 19H7C4.243 19 2 16.757 2 14C2 11.82 3.609 9.792 5.757 9.15C6.85 6.611 9.244 5 12 5C15.56 5 18.507 7.67 18.944 11.112C20.695 11.538 22 13.12 22 15C22 17.206 20.206 19 18 19H15H9ZM15 17H18C19.103 17 20 16.103 20 15C20 13.897 19.103 13 18 13H17V12C17 9.243 14.757 7 12 7C9.895 7 8.149 8.274 7.446 10.325L7.254 10.883L6.673 10.985C5.199 11.244 4 12.596 4 14C4 15.654 5.346 17 7 17H9H15Z" }, void 0), (0, jsx_runtime_1.jsx)("rect", { x: "9.67139", y: "14.6567", width: "6", height: "1.5", transform: "rotate(-45 9.67139 14.6567)" }, void 0), (0, jsx_runtime_1.jsx)("rect", { x: "9.31787", y: "12.1819", width: "3.5", height: "1.5", transform: "rotate(45 9.31787 12.1819)" }, void 0)] }, void 0)),
50
50
  attachment: ((0, jsx_runtime_1.jsx)("path", { d: "M5.70034 11.879L13.2477 4.15188C14.7481 2.61751 17.2048 2.61457 18.7439 4.15187C20.2147 5.69292 20.2456 8.1905 18.7439 9.72637L12.1677 16.4463C11.1677 17.4455 9.53953 17.4417 8.57861 16.4145L8.5763 16.4121C7.61217 15.4147 7.64468 13.8162 8.60983 12.8511L8.6113 12.8496L13.7859 7.56715C13.9307 7.42307 14.1608 7.40384 14.3248 7.56783L15.121 8.36403L15.1269 8.3691C15.2788 8.49929 15.2951 8.72507 15.1451 8.90458L9.9755 14.146C9.84287 14.2789 9.78341 14.4569 9.77747 14.6231C9.77157 14.7885 9.81776 14.9643 9.92515 15.0986L9.93923 15.1162L9.95684 15.1303C10.2011 15.3257 10.5715 15.346 10.8022 15.1153L17.3808 8.39291L17.3829 8.39073C18.1402 7.59359 18.1402 6.28461 17.3829 5.48747L17.3793 5.48379C16.6171 4.72167 15.3745 4.72167 14.6124 5.48379L14.6107 5.48549L7.06489 13.211L7.06402 13.2118C5.72803 14.5488 5.72839 16.7596 7.02689 18.0962C8.32851 19.4362 10.437 19.436 11.7387 18.0962L17.9191 11.7721C18.0556 11.6365 18.2859 11.6367 18.422 11.7728L19.2542 12.605L19.2601 12.6101C19.4197 12.7469 19.4187 12.9691 19.2846 13.1031L19.283 13.1048L13.1015 19.43C11.0256 21.5403 7.70624 21.5062 5.66445 19.4304C3.62176 17.3177 3.65669 13.9573 5.70034 11.879Z" }, void 0)),
51
+ archive: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("path", { "fill-rule": "evenodd", d: "M19 10H5L5 18H19V10ZM3 8V18C3 19.1046 3.89543 20 5 20H19C20.1046 20 21 19.1046 21 18V8H3Z" }, void 0), (0, jsx_runtime_1.jsx)("path", { "fill-rule": "evenodd", d: "M3.81818 6V8H20.1818V6H3.81818ZM2.90909 4C2.40701 4 2 4.44772 2 5V9C2 9.55228 2.40701 10 2.90909 10H21.0909C21.593 10 22 9.55228 22 9V5C22 4.44772 21.593 4 21.0909 4H2.90909Z" }, void 0), (0, jsx_runtime_1.jsx)("rect", { x: "8", y: "11", width: "8", height: "2", rx: "1" }, void 0)] }, void 0)),
52
+ unarchive: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("path", { d: "M13 12V8H16L12 3L8 8H11V12H13Z" }, void 0), (0, jsx_runtime_1.jsx)("path", { d: "M17 10H19V18H5L5 10H7V8H3V18C3 19.1046 3.89543 20 5 20H19C20.1046 20 21 19.1046 21 18V8H17V10Z" }, void 0), (0, jsx_runtime_1.jsx)("rect", { x: "8", y: "15", width: "8", height: "2", rx: "1" }, void 0)] }, void 0)),
51
53
  // Alerts
52
54
  errorCircle: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("path", { d: "M11.953 2C6.465 2 2 6.486 2 12C2 17.514 6.486 22 12 22C17.514 22 22 17.514 22 12C22 6.486 17.493 2 11.953 2ZM12 20C7.589 20 4 16.411 4 12C4 7.589 7.567 4 11.953 4C16.391 4 20 7.589 20 12C20 16.411 16.411 20 12 20Z" }, void 0), (0, jsx_runtime_1.jsx)("path", { d: "M11 7H13V14H11V7ZM11 15H13V17H11V15Z" }, void 0)] }, void 0)),
53
55
  checkCircle: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("path", { d: "M12 2C6.486 2 2 6.486 2 12C2 17.514 6.486 22 12 22C17.514 22 22 17.514 22 12C22 6.486 17.514 2 12 2ZM12 20C7.589 20 4 16.411 4 12C4 7.589 7.589 4 12 4C16.411 4 20 7.589 20 12C20 16.411 16.411 20 12 20Z" }, void 0), (0, jsx_runtime_1.jsx)("path", { d: "M9.99909 13.587L7.70009 11.292L6.28809 12.708L10.0011 16.413L16.7071 9.70697L15.2931 8.29297L9.99909 13.587Z" }, void 0)] }, void 0)),
@@ -33,6 +33,8 @@ export interface GridStyle {
33
33
  * rows are wrapper with Chrome rows.
34
34
  */
35
35
  headerCellCss?: Properties;
36
+ /** Applied to 'kind: "totals"' cells */
37
+ totalsCellCss?: Properties;
36
38
  /** Applied to the first cell of all rows, i.e. for table-wide padding or left-side borders. */
37
39
  firstCellCss?: Properties;
38
40
  /** Applied to the last cell of all rows, i.e. for table-wide padding or right-side borders. */
@@ -151,7 +153,7 @@ export interface GridTableProps<R extends Kinded, S, X> {
151
153
  rowLookup?: MutableRefObject<GridRowLookup<R> | undefined>;
152
154
  /** Whether the header row should be sticky. */
153
155
  stickyHeader?: boolean;
154
- stickyOffset?: string;
156
+ stickyOffset?: number;
155
157
  /** Configures sorting via a hash, does not need to be stable. */
156
158
  sorting?: GridSortConfig<S>;
157
159
  /** Shown in the first row slot, if there are no rows to show, i.e. 'No rows found'. */
@@ -88,7 +88,7 @@ exports.setGridTableDefaults = setGridTableDefaults;
88
88
  */
89
89
  function GridTable(props) {
90
90
  var _a, _b, _c, _d;
91
- const { id = "gridTable", as = "div", columns, rows, style: maybeStyle = defaults.style, rowStyles, stickyHeader = defaults.stickyHeader, stickyOffset = "0", xss, filter, filterMaxRows, fallbackMessage = "No rows found.", infoMessage, setRowCount, observeRows, persistCollapse, resizeTarget, activeRowId, } = props;
91
+ const { id = "gridTable", as = "div", columns, rows, style: maybeStyle = defaults.style, rowStyles, stickyHeader = defaults.stickyHeader, stickyOffset = 0, xss, filter, filterMaxRows, fallbackMessage = "No rows found.", infoMessage, setRowCount, observeRows, persistCollapse, resizeTarget, activeRowId, } = props;
92
92
  // We only use this in as=virtual mode, but keep this here for rowLookup to use
93
93
  const virtuosoRef = (0, react_1.useRef)(null);
94
94
  const tableRef = (0, react_1.useRef)(null);
@@ -121,15 +121,18 @@ function GridTable(props) {
121
121
  }
122
122
  return rows;
123
123
  }, [columns, rows, sortOn, sortState]);
124
+ let hasTotalsRow = false;
124
125
  // Filter rows - ensures parent rows remain in the list if any children match the filter.
125
126
  const filterRows = (0, react_1.useCallback)((acc, row) => {
126
127
  var _a, _b, _c;
127
128
  // Break up "foo bar" into `[foo, bar]` and a row must match both `foo` and `bar`
128
129
  const filters = (filter && filter.split(/ +/)) || [];
129
130
  const matches = row.kind === "header" ||
131
+ row.kind === "totals" ||
130
132
  filters.length === 0 ||
131
133
  !!row.pin ||
132
134
  filters.every((f) => columns.map((c) => applyRowFn(c, row, api, 0)).some((maybeContent) => matchesFilter(maybeContent, f)));
135
+ hasTotalsRow || (hasTotalsRow = row.kind === "totals");
133
136
  // If the row matches, add it in
134
137
  if (matches) {
135
138
  return acc.concat([[row, (_b = (_a = row.children) === null || _a === void 0 ? void 0 : _a.reduce(filterRows, [])) !== null && _b !== void 0 ? _b : []]]);
@@ -148,7 +151,7 @@ function GridTable(props) {
148
151
  return acc;
149
152
  }, [filter, collapsedIds, columns]);
150
153
  // Flatten + component-ize the sorted rows.
151
- let [headerRows, filteredRows] = (0, react_1.useMemo)(() => {
154
+ let [headerRows, filteredRows, totalsRows] = (0, react_1.useMemo)(() => {
152
155
  function makeRowComponent(row, level) {
153
156
  // We only pass sortState to header rows, b/c non-headers rows shouldn't have to re-render on sorting
154
157
  // changes, and so by not passing the sortProps, it means the data rows' React.memo will still cache them.
@@ -161,7 +164,8 @@ function GridTable(props) {
161
164
  style,
162
165
  rowStyles,
163
166
  stickyHeader,
164
- stickyOffset,
167
+ // If we have a totals row then add the height of the totals row (52px) to the `stickyOffset` for the "header" kind
168
+ stickyOffset: hasTotalsRow && row.kind === "header" ? 52 + stickyOffset : stickyOffset,
165
169
  openCards: nestedCards ? nestedCards.currentOpenCards() : undefined,
166
170
  columnSizes,
167
171
  level,
@@ -172,6 +176,7 @@ function GridTable(props) {
172
176
  }
173
177
  // Split out the header rows from the data rows so that we can put an `infoMessage` in between them (if needed).
174
178
  const headerRows = [];
179
+ const totalsRows = [];
175
180
  const filteredRows = [];
176
181
  // Misc state to track our nested card-ification, i.e. interleaved actual rows + chrome rows
177
182
  const nestedCards = !!style.nestedCards && new nestedCards_1.NestedCards(columns, filteredRows, style.nestedCards);
@@ -192,6 +197,10 @@ function GridTable(props) {
192
197
  headerRows.push([row[0], makeRowComponent(row[0], level)]);
193
198
  return;
194
199
  }
200
+ if (row[0].kind === "totals") {
201
+ totalsRows.push([row[0], makeRowComponent(row[0], level)]);
202
+ return;
203
+ }
195
204
  visit(row, level);
196
205
  addSpacer && nestedCards && i !== length - 1 && nestedCards.addSpacer();
197
206
  });
@@ -200,7 +209,7 @@ function GridTable(props) {
200
209
  // If nestedCards is set, we assume the top-level kind is a card, and so should add spacers between them
201
210
  visitRows(maybeSorted.reduce(filterRows, []), !!nestedCards, 0);
202
211
  nestedCards && nestedCards.done();
203
- return [headerRows, filteredRows];
212
+ return [headerRows, filteredRows, totalsRows];
204
213
  }, [
205
214
  as,
206
215
  maybeSorted,
@@ -252,7 +261,7 @@ function GridTable(props) {
252
261
  // behave semantically the same as `as=div` did for its tests.
253
262
  const _as = as === "virtual" && runningInJest ? "div" : as;
254
263
  const rowStateContext = (0, react_1.useMemo)(() => ({ rowState }), [rowState]);
255
- return ((0, jsx_runtime_1.jsx)(RowState_1.RowStateContext.Provider, Object.assign({ value: rowStateContext }, { children: (0, jsx_runtime_1.jsx)(PresentationContext_1.PresentationProvider, Object.assign({ fieldProps: fieldProps, wrap: (_c = style === null || style === void 0 ? void 0 : style.presentationSettings) === null || _c === void 0 ? void 0 : _c.wrap }, { children: renders[_as](style, id, columns, headerRows, filteredRows, firstRowMessage, stickyHeader, (_d = style.nestedCards) === null || _d === void 0 ? void 0 : _d.firstLastColumnWidth, xss, virtuosoRef, tableRef) }), void 0) }), void 0));
264
+ return ((0, jsx_runtime_1.jsx)(RowState_1.RowStateContext.Provider, Object.assign({ value: rowStateContext }, { children: (0, jsx_runtime_1.jsx)(PresentationContext_1.PresentationProvider, Object.assign({ fieldProps: fieldProps, wrap: (_c = style === null || style === void 0 ? void 0 : style.presentationSettings) === null || _c === void 0 ? void 0 : _c.wrap }, { children: renders[_as](style, id, columns, headerRows, totalsRows, filteredRows, firstRowMessage, stickyHeader, (_d = style.nestedCards) === null || _d === void 0 ? void 0 : _d.firstLastColumnWidth, xss, virtuosoRef, tableRef) }), void 0) }), void 0));
256
265
  }
257
266
  exports.GridTable = GridTable;
258
267
  // Determine which HTML element to use to build the GridTable
@@ -262,7 +271,7 @@ const renders = {
262
271
  virtual: renderVirtual,
263
272
  };
264
273
  /** Renders table using divs with flexbox rows, which is the default render */
265
- function renderDiv(style, id, columns, headerRows, filteredRows, firstRowMessage, _stickyHeader, firstLastColumnWidth, xss, _virtuosoRef, tableRef) {
274
+ function renderDiv(style, id, columns, headerRows, totalsRows, filteredRows, firstRowMessage, _stickyHeader, firstLastColumnWidth, xss, _virtuosoRef, tableRef) {
266
275
  return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ ref: tableRef, css: {
267
276
  /*
268
277
  Using (n + 3) here to target all rows that are after the first non-header row. Since n starts at 0, we can use
@@ -274,10 +283,10 @@ function renderDiv(style, id, columns, headerRows, filteredRows, firstRowMessage
274
283
  ...style.rootCss,
275
284
  ...(style.minWidthPx ? Css_1.Css.mwPx(style.minWidthPx).$ : {}),
276
285
  ...xss,
277
- }, "data-testid": id }, { children: [headerRows.map(([, node]) => node), firstRowMessage && ((0, jsx_runtime_1.jsx)("div", Object.assign({ css: { ...style.firstRowMessageCss }, "data-gridrow": true }, { children: firstRowMessage }), void 0)), filteredRows.map(([, node]) => node)] }), void 0));
286
+ }, "data-testid": id }, { children: [totalsRows.map(([, node]) => node), headerRows.map(([, node]) => node), firstRowMessage && ((0, jsx_runtime_1.jsx)("div", Object.assign({ css: { ...style.firstRowMessageCss }, "data-gridrow": true }, { children: firstRowMessage }), void 0)), filteredRows.map(([, node]) => node)] }), void 0));
278
287
  }
279
288
  /** Renders as a table, primarily/solely for good print support. */
280
- function renderTable(style, id, columns, headerRows, filteredRows, firstRowMessage, _stickyHeader, _firstLastColumnWidth, xss, _virtuosoRef, tableRef) {
289
+ function renderTable(style, id, columns, headerRows, totalsRows, filteredRows, firstRowMessage, _stickyHeader, _firstLastColumnWidth, xss, _virtuosoRef, tableRef) {
281
290
  return ((0, jsx_runtime_1.jsxs)("table", Object.assign({ ref: tableRef, css: {
282
291
  ...Css_1.Css.w100.add("borderCollapse", "collapse").$,
283
292
  ...Css_1.Css.addIn("& > tbody > tr ", style.betweenRowsCss || {})
@@ -286,7 +295,7 @@ function renderTable(style, id, columns, headerRows, filteredRows, firstRowMessa
286
295
  ...style.rootCss,
287
296
  ...(style.minWidthPx ? Css_1.Css.mwPx(style.minWidthPx).$ : {}),
288
297
  ...xss,
289
- }, "data-testid": id }, { children: [(0, jsx_runtime_1.jsx)("thead", { children: headerRows.map(([, node]) => node) }, void 0), (0, jsx_runtime_1.jsxs)("tbody", { children: [firstRowMessage && ((0, jsx_runtime_1.jsx)("tr", { children: (0, jsx_runtime_1.jsx)("td", Object.assign({ colSpan: columns.length, css: { ...style.firstRowMessageCss } }, { children: firstRowMessage }), void 0) }, void 0)), filteredRows.map(([, node]) => node)] }, void 0)] }), void 0));
298
+ }, "data-testid": id }, { children: [(0, jsx_runtime_1.jsx)("thead", { children: [...totalsRows, ...headerRows].map(([, node]) => node) }, void 0), (0, jsx_runtime_1.jsxs)("tbody", { children: [firstRowMessage && ((0, jsx_runtime_1.jsx)("tr", { children: (0, jsx_runtime_1.jsx)("td", Object.assign({ colSpan: columns.length, css: { ...style.firstRowMessageCss } }, { children: firstRowMessage }), void 0) }, void 0)), filteredRows.map(([, node]) => node)] }, void 0)] }), void 0));
290
299
  }
291
300
  /**
292
301
  * Uses react-virtuoso to render rows virtually.
@@ -308,7 +317,7 @@ function renderTable(style, id, columns, headerRows, filteredRows, firstRowMessa
308
317
  * [2]: https://github.com/tannerlinsley/react-virtual/issues/85
309
318
  * [3]: https://github.com/tannerlinsley/react-virtual/issues/108
310
319
  */
311
- function renderVirtual(style, id, columns, headerRows, filteredRows, firstRowMessage, stickyHeader, firstLastColumnWidth, xss, virtuosoRef, tableRef) {
320
+ function renderVirtual(style, id, columns, headerRows, totalsRows, filteredRows, firstRowMessage, stickyHeader, firstLastColumnWidth, xss, virtuosoRef, tableRef) {
312
321
  // eslint-disable-next-line react-hooks/rules-of-hooks
313
322
  const { footerStyle, listStyle } = (0, react_1.useMemo)(() => {
314
323
  var _a;
@@ -327,9 +336,15 @@ function renderVirtual(style, id, columns, headerRows, filteredRows, firstRowMes
327
336
  Footer: () => (0, jsx_runtime_1.jsx)("div", { css: footerStyle }, void 0),
328
337
  },
329
338
  // Pin/sticky both the header row(s) + firstRowMessage to the top
330
- topItemCount: (stickyHeader ? headerRows.length : 0) + (firstRowMessage ? 1 : 0), itemContent: (index) => {
331
- // Since we have two arrays of rows: `headerRows` and `filteredRow` we
339
+ topItemCount: (stickyHeader ? headerRows.length + totalsRows.length : 0) + (firstRowMessage ? 1 : 0), itemContent: (index) => {
340
+ // Since we have three arrays of rows: `headerRows`, `totalsRows`, and `filteredRow` we
332
341
  // must determine which one to render.
342
+ // Determine if we need to render a totals row
343
+ if (index < totalsRows.length) {
344
+ return totalsRows[index][1];
345
+ }
346
+ // Reset index
347
+ index -= totalsRows.length;
333
348
  // Determine if we need to render a header row
334
349
  if (index < headerRows.length) {
335
350
  return headerRows[index][1];
@@ -347,7 +362,7 @@ function renderVirtual(style, id, columns, headerRows, filteredRows, firstRowMes
347
362
  }
348
363
  // Lastly render `filteredRow`
349
364
  return filteredRows[index][1];
350
- }, totalCount: (headerRows.length || 0) + (firstRowMessage ? 1 : 0) + (filteredRows.length || 0) }, void 0));
365
+ }, totalCount: (headerRows.length || 0) + (totalsRows.length || 0) + (firstRowMessage ? 1 : 0) + (filteredRows.length || 0) }, void 0));
351
366
  }
352
367
  /**
353
368
  * A table might render two of these components to represent two virtual lists.
@@ -473,8 +488,9 @@ function GridRow(props) {
473
488
  const { as, columns, row, style, rowStyles, stickyHeader, stickyOffset, sortOn, sortState, setSortKey, openCards, columnSizes, level, getCount, api, ...others } = props;
474
489
  const { rowState } = (0, react_1.useContext)(RowState_1.RowStateContext);
475
490
  const isActive = (0, hooks_1.useComputed)(() => rowState.activeRowId === `${row.kind}_${row.id}`, [row, rowState]);
476
- // We treat the "header" kind as special for "good defaults" styling
491
+ // We treat the "header" and "totals" kind as special for "good defaults" styling
477
492
  const isHeader = row.kind === "header";
493
+ const isTotals = row.kind === "totals";
478
494
  const rowStyle = rowStyles === null || rowStyles === void 0 ? void 0 : rowStyles[row.kind];
479
495
  const Row = as === "table" ? "tr" : "div";
480
496
  const openCardStyles = typeof openCards === "string"
@@ -493,7 +509,7 @@ function GridRow(props) {
493
509
  }),
494
510
  ...maybeApplyFunction(row, rowStyle === null || rowStyle === void 0 ? void 0 : rowStyle.rowCss),
495
511
  // Maybe add the sticky header styles
496
- ...(isHeader && stickyHeader ? Css_1.Css.sticky.top(stickyOffset).z2.$ : undefined),
512
+ ...((isHeader || isTotals) && stickyHeader ? Css_1.Css.sticky.topPx(stickyOffset).z2.$ : undefined),
497
513
  ...(0, nestedCards_1.getNestedCardStyles)(row, openCardStyles, style, isActive),
498
514
  };
499
515
  let currentColspan = 1;
@@ -567,8 +583,10 @@ function GridRow(props) {
567
583
  ...getIndentationCss(style, rowStyle, columnIndex, maybeContent),
568
584
  // Then apply any header-specific override
569
585
  ...(isHeader && style.headerCellCss),
586
+ // Then apply any totals-specific override
587
+ ...(isTotals && style.totalsCellCss),
570
588
  // Or level-specific styling
571
- ...(!isHeader && !!style.levels && ((_d = style.levels[level]) === null || _d === void 0 ? void 0 : _d.cellCss)),
589
+ ...(!isHeader && !isTotals && !!style.levels && ((_d = style.levels[level]) === null || _d === void 0 ? void 0 : _d.cellCss)),
572
590
  // Level specific styling for the first content column
573
591
  ...(applyFirstContentColumnStyles && !!style.levels && ((_e = style.levels[level]) === null || _e === void 0 ? void 0 : _e.firstContentColumn)),
574
592
  // The specific cell's css (if any from GridCellContent)
@@ -770,7 +788,7 @@ function tableRowStyles(as, column) {
770
788
  : {};
771
789
  }
772
790
  function resolveStyles(style) {
773
- const defKeys = ["inlineEditing", "grouped", "totals", "rowHeight"];
791
+ const defKeys = ["inlineEditing", "grouped", "rowHeight"];
774
792
  const keys = (0, utils_1.safeKeys)(style);
775
793
  if (keys.length === 0 || keys.some((k) => defKeys.includes(k))) {
776
794
  return (0, styles_1.getTableStyles)(style);
@@ -85,7 +85,7 @@ class RowState {
85
85
  // Just mash the header + all rows + children as selected
86
86
  const map = new Map();
87
87
  map.set("header", "checked");
88
- (0, visitor_1.visit)(this.rows, (row) => this.visibleRows.has(row.id) && map.set(row.id, "checked"));
88
+ (0, visitor_1.visit)(this.rows, (row) => this.visibleRows.has(row.id) && row.kind !== "totals" && map.set(row.id, "checked"));
89
89
  this.selectedRows.replace(map);
90
90
  }
91
91
  else {
@@ -9,6 +9,5 @@ export interface GridStyleDef {
9
9
  inlineEditing?: boolean;
10
10
  grouped?: boolean;
11
11
  rowHeight?: "fixed" | "flexible";
12
- totals?: boolean;
13
12
  }
14
13
  export declare const getTableStyles: (props?: GridStyleDef | undefined) => GridStyle;
@@ -5,6 +5,7 @@ const Css_1 = require("../../Css");
5
5
  /** Our original table look & feel/style. */
6
6
  exports.defaultStyle = {
7
7
  rootCss: Css_1.Css.gray700.$,
8
+ totalsCellCss: Css_1.Css.bgWhite.$,
8
9
  betweenRowsCss: Css_1.Css.bt.bGray400.$,
9
10
  firstNonHeaderRowCss: Css_1.Css.add({ borderTopStyle: "none" }).$,
10
11
  cellCss: Css_1.Css.py2.px3.$,
@@ -42,8 +43,8 @@ exports.cardStyle = {
42
43
  function memoizedTableStyles() {
43
44
  const cache = {};
44
45
  return (props) => {
45
- const { inlineEditing = false, grouped = false, rowHeight = "flexible", totals = false } = props || {};
46
- const key = `${inlineEditing}|${grouped}|${rowHeight}|${totals}`;
46
+ const { inlineEditing = false, grouped = false, rowHeight = "flexible" } = props || {};
47
+ const key = `${inlineEditing}|${grouped}|${rowHeight}`;
47
48
  if (!cache[key]) {
48
49
  const groupedLevels = {
49
50
  0: {
@@ -57,13 +58,13 @@ function memoizedTableStyles() {
57
58
  emptyCell: "-",
58
59
  firstRowMessageCss: Css_1.Css.tc.py3.$,
59
60
  headerCellCss: Css_1.Css.gray700.xsEm.bgGray200.aic.nowrap.pxPx(12).hPx(40).$,
61
+ totalsCellCss: Css_1.Css.bgWhite.gray700.smEm.hPx(52).pt0.pbPx(12).boxShadow("none").$,
60
62
  cellCss: {
61
63
  ...Css_1.Css.gray900.xs.bgWhite.aic.pxPx(12).boxShadow(`inset 0 -1px 0 ${Css_1.Palette.Gray200}`).$,
62
64
  ...(rowHeight === "flexible" ? Css_1.Css.py2.$ : Css_1.Css.nowrap.hPx(inlineEditing ? 48 : 36).$),
63
- ...(totals ? Css_1.Css.gray700.smEm.hPx(40).mb1.bgWhite.boxShadow("none").$ : {}),
64
65
  },
65
66
  presentationSettings: { borderless: true, typeScale: "xs", wrap: rowHeight === "flexible" },
66
- levels: totals ? {} : grouped ? groupedLevels : defaultLevels,
67
+ levels: grouped ? groupedLevels : defaultLevels,
67
68
  };
68
69
  }
69
70
  return cache[key];
@@ -29,7 +29,7 @@ function Switch(props) {
29
29
  ...(labelStyle === "filter" && Css_1.Css.jcsb.aic.w("auto").sm.$),
30
30
  ...(isDisabled && Css_1.Css.cursorNotAllowed.gray400.$),
31
31
  }, "aria-label": label }, { children: [!hideLabel && labelStyle === "form" && (0, jsx_runtime_1.jsx)(Label_1.Label, { label: label }, void 0), !hideLabel && labelStyle === "filter" && (0, jsx_runtime_1.jsx)("span", { children: label }, void 0), (0, jsx_runtime_1.jsx)("div", Object.assign({ "aria-hidden": "true", css: {
32
- ...Css_1.Css.wPx(toggleWidth(compact)).hPx(toggleHeight(compact)).bgGray200.br12.relative.transition.$,
32
+ ...Css_1.Css.wPx(40).hPx(toggleHeight(compact)).bgGray200.br12.relative.transition.$,
33
33
  ...(isHovered && exports.switchHoverStyles),
34
34
  ...(isKeyboardFocus && exports.switchFocusStyles),
35
35
  ...(isDisabled && Css_1.Css.bgGray300.$),
@@ -49,8 +49,7 @@ exports.Switch = Switch;
49
49
  /** Styles */
50
50
  // Element sizes
51
51
  const toggleHeight = (isCompact) => (isCompact ? 16 : 24);
52
- const toggleWidth = (isCompact) => (isCompact ? 44 : 40);
53
- const circleDiameter = (isCompact) => (isCompact ? 14 : 20);
52
+ const circleDiameter = (isCompact) => (isCompact ? 12 : 20);
54
53
  // Switcher/Toggle element styles
55
54
  exports.switchHoverStyles = Css_1.Css.bgGray400.$;
56
55
  exports.switchFocusStyles = Css_1.Css.bshFocus.$;
@@ -60,7 +59,7 @@ const switchCircleDefaultStyles = (isCompact) => ({
60
59
  ...Css_1.Css.wPx(circleDiameter(isCompact))
61
60
  .hPx(circleDiameter(isCompact))
62
61
  .br100.bgWhite.bshBasic.absolute.leftPx(2)
63
- .topPx(isCompact ? 1 : 2).transition.df.aic.jcc.$,
62
+ .topPx(2).transition.df.aic.jcc.$,
64
63
  svg: Css_1.Css.hPx(toggleHeight(isCompact) / 2).wPx(toggleHeight(isCompact) / 2).$,
65
64
  });
66
65
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homebound/beam",
3
- "version": "2.126.2",
3
+ "version": "2.128.1",
4
4
  "author": "Homebound",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",