@homebound/beam 4.56.0 → 4.56.2

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.cjs CHANGED
@@ -7277,13 +7277,13 @@ function hierarchyFirstContentCss(opts) {
7277
7277
  const {
7278
7278
  level,
7279
7279
  skipIndent,
7280
- maxLevel
7280
+ hasChildren
7281
7281
  } = opts;
7282
7282
  const paddingLeft = skipIndent ? void 0 : hierarchyIndentPaddingPx(level);
7283
- const type = hierarchyLevelType(level, maxLevel);
7284
- if (!type && paddingLeft === void 0) return void 0;
7283
+ const typeStyle = hierarchyLevelType(level, hasChildren);
7284
+ if (!typeStyle && paddingLeft === void 0) return void 0;
7285
7285
  return {
7286
- ...type ?? {},
7286
+ ...typeStyle ?? {},
7287
7287
  ...paddingLeft !== void 0 ? {
7288
7288
  paddingLeft: ["pl_var", {
7289
7289
  "--paddingLeft": `${paddingLeft}px`
@@ -7291,16 +7291,20 @@ function hierarchyFirstContentCss(opts) {
7291
7291
  } : {}
7292
7292
  };
7293
7293
  }
7294
- function hierarchyLevelType(level, maxLevel) {
7295
- if (level >= maxLevel) return void 0;
7296
- return level === 0 ? {
7294
+ function hierarchyLevelType(level, hasChildren) {
7295
+ if (level === 0) return hasChildren ? {
7297
7296
  fontWeight: "fw6",
7298
7297
  fontSize: "fz_14px",
7299
7298
  lineHeight: "lh_20px"
7300
- } : {
7299
+ } : void 0;
7300
+ return hasChildren ? {
7301
7301
  fontWeight: "fw6",
7302
7302
  fontSize: "fz_12px",
7303
7303
  lineHeight: "lh_16px"
7304
+ } : {
7305
+ fontWeight: "fw4",
7306
+ fontSize: "fz_12px",
7307
+ lineHeight: "lh_16px"
7304
7308
  };
7305
7309
  }
7306
7310
  var loadingTableCss = {
@@ -8831,8 +8835,6 @@ var RowStates = class {
8831
8835
  keptGroupRow;
8832
8836
  /** The first level of rows, i.e. not the header (or kept group), but the totals + top-level children. */
8833
8837
  topRows = [];
8834
- /** Deepest data-row level from the latest `setRows`. `0` when every body row is top-level. */
8835
- maxNestingLevel = 0;
8836
8838
  constructor(table) {
8837
8839
  this.table = table;
8838
8840
  this.header = this.createHeaderRow();
@@ -8860,8 +8862,7 @@ var RowStates = class {
8860
8862
  const map = this.map;
8861
8863
  const seenIds = /* @__PURE__ */ new Set();
8862
8864
  const maybeKept = new Set(this.map.values());
8863
- let maxNestingLevel = 0;
8864
- function addRowAndChildren(parent, row, level) {
8865
+ function addRowAndChildren(parent, row) {
8865
8866
  const key = row.id;
8866
8867
  if (seenIds.has(key)) {
8867
8868
  throw new Error(`Duplicate row id ${key}`);
@@ -8878,15 +8879,12 @@ var RowStates = class {
8878
8879
  state.removed = false;
8879
8880
  maybeKept.delete(state);
8880
8881
  }
8881
- const reserved = reservedRowKinds.includes(row.kind);
8882
- if (!reserved && level > maxNestingLevel) maxNestingLevel = level;
8883
- state.children = row.children?.map((child) => addRowAndChildren(state, child, reserved ? level : level + 1));
8882
+ state.children = row.children?.map((child) => addRowAndChildren(state, child));
8884
8883
  return state;
8885
8884
  }
8886
8885
  const headerRow = rows.find((r) => r.kind === HEADER);
8887
8886
  this.header.row = headerRow || missingHeader;
8888
- this.topRows = rows.filter((row) => row !== headerRow).map((row) => addRowAndChildren(this.header, row, 0));
8889
- this.maxNestingLevel = maxNestingLevel;
8887
+ this.topRows = rows.filter((row) => row !== headerRow).map((row) => addRowAndChildren(this.header, row));
8890
8888
  this.header.children = [this.keptGroupRow, ...this.topRows];
8891
8889
  for (const state of maybeKept) state.markRemoved();
8892
8890
  if (this.topRows.some((rs) => !reservedRowKinds.includes(rs.row.kind))) {
@@ -9088,8 +9086,6 @@ var TableState = class {
9088
9086
  persistCollapse;
9089
9087
  // The current list of rows, basically a useRef.current. Only shallow reactive.
9090
9088
  rows = [];
9091
- /** Deepest data-row level, set with the rows. `0` when the table has a single level. Every row's type is chosen from this. */
9092
- maxNestingLevel = 0;
9093
9089
  // The current list of columns, basically a useRef.current. Only ref reactive.
9094
9090
  columns = [];
9095
9091
  api;
@@ -9187,7 +9183,6 @@ var TableState = class {
9187
9183
  setRows(rows) {
9188
9184
  this.rowStates.setRows(rows);
9189
9185
  this.rows = rows;
9190
- this.maxNestingLevel = this.rowStates.maxNestingLevel;
9191
9186
  }
9192
9187
  setColumns(columns, visibleColumnsStorageKey) {
9193
9188
  if (columns !== this.columns) {
@@ -11381,7 +11376,7 @@ function RowImpl(props) {
11381
11376
  ...isBodyRow && applyFirstContentColumnStyles && hierarchyFirstContentCss({
11382
11377
  level,
11383
11378
  skipIndent: levelIndent !== void 0 || !hasCollapseColumn,
11384
- maxLevel: tableState.maxNestingLevel
11379
+ hasChildren: !!row.children?.length
11385
11380
  }),
11386
11381
  // Apply any declarative column border styling after header/body defaults.
11387
11382
  ...getColumnBorderCss(column2.border, style),
@@ -28204,7 +28199,8 @@ function GridTableLayoutActionsComponent(props) {
28204
28199
  activeFilterCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(CountBadge, { count: activeFilterCount }),
28205
28200
  /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(Icon, { icon: showFilters ? "chevronUp" : "chevronDown" })
28206
28201
  ] }), variant: "secondaryBlack", onClick: () => setShowFilters(!showFilters), active: showFilters, ...testId.filterButton }),
28207
- groupByInline && groupBy && /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(GroupByField, { ...groupBy }),
28202
+ groupByInline && groupBy && // Wrapping in a div to prevent the GroupByField from growing unnecessarily. The MenuSelectField has a `w100` width, which caused it to take up more space than necessary on this row.
28203
+ /* @__PURE__ */ (0, import_jsx_runtime200.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(GroupByField, { ...groupBy }) }),
28208
28204
  filtersInline && activeFilterCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(Button, { label: "Clear", variant: "tertiary", onClick: () => maybeCall(clearFilters), ...filterTid.clearBtn })
28209
28205
  ] }),
28210
28206
  hasRightItems && /* @__PURE__ */ (0, import_jsx_runtime200.jsxs)("div", { ref: rightRef, className: "df fs0 aic g_12px", children: [