@homebound/beam 3.100.0 → 3.101.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.cts CHANGED
@@ -5257,6 +5257,7 @@ declare class RowState<R extends Kinded> {
5257
5257
  * at which point this would become `"top" | "bottom"`.
5258
5258
  */
5259
5259
  pinned: boolean;
5260
+ private _aiMode;
5260
5261
  /** Whether we are dragged over. */
5261
5262
  isDraggedOver: DraggedOver;
5262
5263
  /**
@@ -5284,6 +5285,8 @@ declare class RowState<R extends Kinded> {
5284
5285
  get row(): GridDataRow<R>;
5285
5286
  /** Accepts a new unstable row, i.e. each `createRows` creates a new row literal. */
5286
5287
  set row(row: GridDataRow<R>);
5288
+ /** True when `row.aiMode` is true or its function returns true. */
5289
+ get aiMode(): boolean;
5287
5290
  /**
5288
5291
  * Whether we match a client-side filter; true if no filter is in place.
5289
5292
  *
@@ -5448,6 +5451,8 @@ type GridDataRow<R extends Kinded> = {
5448
5451
  draggable?: boolean;
5449
5452
  /** Image src for the row, to be used for card view */
5450
5453
  imgSrc?: string;
5454
+ /** Paints the row with `Tokens.AiFieldBg`. Use `() => boolean` to read MobX without rebuilding `rows`. */
5455
+ aiMode?: MaybeFn<boolean>;
5451
5456
  /**
5452
5457
  * Full-width content rendered with this row (no separator between them).
5453
5458
  * Plain content / render fn defaults to `"trailing"`; use `{ position, content }` for `"leading"`.
package/dist/index.d.ts CHANGED
@@ -5257,6 +5257,7 @@ declare class RowState<R extends Kinded> {
5257
5257
  * at which point this would become `"top" | "bottom"`.
5258
5258
  */
5259
5259
  pinned: boolean;
5260
+ private _aiMode;
5260
5261
  /** Whether we are dragged over. */
5261
5262
  isDraggedOver: DraggedOver;
5262
5263
  /**
@@ -5284,6 +5285,8 @@ declare class RowState<R extends Kinded> {
5284
5285
  get row(): GridDataRow<R>;
5285
5286
  /** Accepts a new unstable row, i.e. each `createRows` creates a new row literal. */
5286
5287
  set row(row: GridDataRow<R>);
5288
+ /** True when `row.aiMode` is true or its function returns true. */
5289
+ get aiMode(): boolean;
5287
5290
  /**
5288
5291
  * Whether we match a client-side filter; true if no filter is in place.
5289
5292
  *
@@ -5448,6 +5451,8 @@ type GridDataRow<R extends Kinded> = {
5448
5451
  draggable?: boolean;
5449
5452
  /** Image src for the row, to be used for card view */
5450
5453
  imgSrc?: string;
5454
+ /** Paints the row with `Tokens.AiFieldBg`. Use `() => boolean` to read MobX without rebuilding `rows`. */
5455
+ aiMode?: MaybeFn<boolean>;
5451
5456
  /**
5452
5457
  * Full-width content rendered with this row (no separator between them).
5453
5458
  * Plain content / render fn defaults to `"trailing"`; use `{ position, content }` for `"leading"`.
package/dist/index.js CHANGED
@@ -6710,6 +6710,7 @@ var RowState = class {
6710
6710
  {
6711
6711
  _row: false,
6712
6712
  _data: observable2.ref,
6713
+ _aiMode: observable2.ref,
6713
6714
  isCalculatingDirectMatch: false
6714
6715
  },
6715
6716
  { name: `RowState@${row.id}` }
@@ -6739,6 +6740,7 @@ var RowState = class {
6739
6740
  * at which point this would become `"top" | "bottom"`.
6740
6741
  */
6741
6742
  pinned = false;
6743
+ _aiMode;
6742
6744
  /** Whether we are dragged over. */
6743
6745
  isDraggedOver = 0 /* None */;
6744
6746
  /**
@@ -6769,6 +6771,11 @@ var RowState = class {
6769
6771
  set row(row) {
6770
6772
  this._row = row;
6771
6773
  this._data = row.data;
6774
+ if (this._aiMode !== row.aiMode) this._aiMode = row.aiMode;
6775
+ }
6776
+ /** True when `row.aiMode` is true or its function returns true. */
6777
+ get aiMode() {
6778
+ return !!maybeApply(this._aiMode);
6772
6779
  }
6773
6780
  /**
6774
6781
  * Whether we match a client-side filter; true if no filter is in place.
@@ -9048,7 +9055,8 @@ function RowImpl(props) {
9048
9055
  isKept: isKeptRow,
9049
9056
  isLastKeptRow,
9050
9057
  pinned,
9051
- level
9058
+ level,
9059
+ aiMode
9052
9060
  } = rs;
9053
9061
  const isHeader = row.kind === HEADER;
9054
9062
  const isTotals = row.kind === TOTALS;
@@ -9074,7 +9082,7 @@ function RowImpl(props) {
9074
9082
  paddingBottom: "pb_25px"
9075
9083
  }
9076
9084
  };
9077
- const rowHoverBg = maybeCssVar(style.rowHoverColor !== void 0 && style.rowHoverColor !== "none" ? style.rowHoverColor : "--b-surface-hover" /* SurfaceHover */);
9085
+ const rowHoverBg = maybeCssVar(aiMode && !reservedRowKinds.includes(row.kind) ? "rgba(237, 233, 254, 1)" /* Purple100 */ : style.rowHoverColor !== void 0 && style.rowHoverColor !== "none" ? style.rowHoverColor : "--b-surface-hover" /* SurfaceHover */);
9078
9086
  const rowCss = {
9079
9087
  ...!reservedRowKinds.includes(row.kind) && style.nonHeaderRowCss,
9080
9088
  ...isFirstBodyRow && style.firstBodyRowCss,
@@ -9264,6 +9272,12 @@ function RowImpl(props) {
9264
9272
  ...isLastKeptRow && style.keptLastRowCss,
9265
9273
  // Apply the blue highlight to every runtime-pinned row's cells (wins over `isActive`)
9266
9274
  ...pinned && style.pinnedRowCss,
9275
+ // AI wash wins over pinned/active; reserved kinds never get it.
9276
+ ...aiMode && !reservedRowKinds.includes(row.kind) && {
9277
+ backgroundColor: ["bgColor_var", {
9278
+ "--backgroundColor": "var(--b-ai-field-bg)"
9279
+ }]
9280
+ },
9267
9281
  // Apply cell highlight styles to active cell and hover
9268
9282
  ...{
9269
9283
  ...applyCellHighlight && isCellActive ? {
@@ -17346,6 +17360,7 @@ function RowGroup(props) {
17346
17360
  }
17347
17361
 
17348
17362
  // src/components/Table/components/TableCard.tsx
17363
+ import { observer as observer2 } from "mobx-react";
17349
17364
  import { useMemo as useMemo27 } from "react";
17350
17365
  import { useFocusRing as useFocusRing11 } from "react-aria";
17351
17366
  import { Link as Link4 } from "react-router-dom";
@@ -17507,7 +17522,7 @@ import { Fragment as Fragment24, jsx as jsx97, jsxs as jsxs51 } from "react/jsx-
17507
17522
  var __maybeInc13 = (inc) => {
17508
17523
  return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
17509
17524
  };
17510
- function TableCard(props) {
17525
+ function TableCardImpl(props) {
17511
17526
  const {
17512
17527
  rs,
17513
17528
  columns,
@@ -17564,8 +17579,9 @@ function TableCard(props) {
17564
17579
  }
17565
17580
  if (!title) return null;
17566
17581
  const onClick = rowStyle?.onClick;
17567
- return /* @__PURE__ */ jsx97(TableCardView, { ...tid, imgSrc: rs.row.imgSrc ?? "", title, leftEyebrow, rightEyebrow, badge, badgeTags, status, data: dataBlocks, progress, interactiveFooter, to: rowStyle?.rowLink?.(rs.row), onClick: onClick ? () => onClick(rs.row, api) : void 0, height, imageFit });
17582
+ return /* @__PURE__ */ jsx97(TableCardView, { ...tid, imgSrc: rs.row.imgSrc ?? "", title, leftEyebrow, rightEyebrow, badge, badgeTags, status, data: dataBlocks, progress, interactiveFooter, to: rowStyle?.rowLink?.(rs.row), onClick: onClick ? () => onClick(rs.row, api) : void 0, height, imageFit, aiMode: rs.aiMode });
17568
17583
  }
17584
+ var TableCard = observer2(TableCardImpl);
17569
17585
  function TableCardView(props) {
17570
17586
  const {
17571
17587
  title,
@@ -17581,7 +17597,8 @@ function TableCardView(props) {
17581
17597
  to,
17582
17598
  onClick,
17583
17599
  height = 430,
17584
- imageFit = "cover"
17600
+ imageFit = "cover",
17601
+ aiMode = false
17585
17602
  } = props;
17586
17603
  const tid = useTestIds(props, "tableCardView");
17587
17604
  const action = to || onClick;
@@ -17731,7 +17748,7 @@ function TableCardView(props) {
17731
17748
  "--borderColor": "var(--b-field-border-default)"
17732
17749
  }],
17733
17750
  backgroundColor: ["bgColor_var", {
17734
- "--backgroundColor": "var(--b-surface-raised)"
17751
+ "--backgroundColor": maybeCssVar31(aiMode ? "--b-ai-field-bg" /* AiFieldBg */ : "--b-surface-raised" /* SurfaceRaised */)
17735
17752
  }],
17736
17753
  height: ["h_var", {
17737
17754
  "--height": `${height}px`
@@ -22318,7 +22335,7 @@ function useActiveSection(sectionsWithRefs) {
22318
22335
  });
22319
22336
  useEffect26(() => {
22320
22337
  if (!("IntersectionObserver" in window)) return;
22321
- const observer2 = new IntersectionObserver((entries) => debouncedIntersectionCallback(entries), {
22338
+ const observer3 = new IntersectionObserver((entries) => debouncedIntersectionCallback(entries), {
22322
22339
  /**
22323
22340
  * Creating rules to determine when a section is "in view" is a real challenge given the section sizes
22324
22341
  * are unknown and will likely be mixed (optimizing for large sections makes tracking small sections
@@ -22334,7 +22351,7 @@ function useActiveSection(sectionsWithRefs) {
22334
22351
  ref
22335
22352
  }) => {
22336
22353
  if (ref.current) {
22337
- observer2.observe(ref.current);
22354
+ observer3.observe(ref.current);
22338
22355
  }
22339
22356
  });
22340
22357
  return () => {
@@ -22342,7 +22359,7 @@ function useActiveSection(sectionsWithRefs) {
22342
22359
  ref
22343
22360
  }) => {
22344
22361
  if (ref.current) {
22345
- observer2.unobserve(ref.current);
22362
+ observer3.unobserve(ref.current);
22346
22363
  }
22347
22364
  });
22348
22365
  };