@homebound/beam 2.370.2 → 2.371.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.
@@ -9,6 +9,7 @@ export interface PresentationFieldProps {
9
9
  labelLeftFieldWidth?: number | string;
10
10
  labelSuffix?: LabelSuffixStyle;
11
11
  borderless?: boolean;
12
+ borderOnHover?: boolean;
12
13
  compact?: boolean;
13
14
  typeScale?: Typography;
14
15
  visuallyDisabled?: false;
@@ -87,7 +87,7 @@ function setGridTableDefaults(opts) {
87
87
  * https://docs.google.com/document/d/1DFnlkDubK4nG_GLf_hB8yp0flnSNt_3IBh5iOicuaFM/edit#heading=h.9m9cpwgeqfc9
88
88
  */
89
89
  function GridTable(props) {
90
- var _a, _b, _c;
90
+ var _a, _b, _c, _d;
91
91
  const { id = "gridTable", as = "div", columns: _columns, rows, style: maybeStyle = defaults.style, rowStyles, stickyHeader = defaults.stickyHeader, stickyOffset = 0, xss, filter, filterMaxRows, fallbackMessage = "No rows found.", infoMessage, persistCollapse, resizeTarget, activeRowId, activeCellId, visibleColumnsStorageKey, infiniteScroll, onRowSelect, onRowDrop: droppedCallback, csvPrefixRows, } = props;
92
92
  const columnsWithIds = (0, react_1.useMemo)(() => (0, columns_1.assignDefaultColumnIds)(_columns), [_columns]);
93
93
  // We only use this in as=virtual mode, but keep this here for rowLookup to use
@@ -277,6 +277,7 @@ function GridTable(props) {
277
277
  const firstRowMessage = (noData && fallbackMessage) || (tooManyClientSideRows && "Hiding some rows, use filter...") || infoMessage;
278
278
  const borderless = (_a = style === null || style === void 0 ? void 0 : style.presentationSettings) === null || _a === void 0 ? void 0 : _a.borderless;
279
279
  const typeScale = (_b = style === null || style === void 0 ? void 0 : style.presentationSettings) === null || _b === void 0 ? void 0 : _b.typeScale;
280
+ const borderOnHover = (_c = style === null || style === void 0 ? void 0 : style.presentationSettings) === null || _c === void 0 ? void 0 : _c.borderOnHover;
280
281
  const fieldProps = (0, react_1.useMemo)(() => ({
281
282
  labelStyle: "hidden",
282
283
  numberAlignment: "right",
@@ -285,14 +286,15 @@ function GridTable(props) {
285
286
  // Avoid passing `undefined` as it will unset existing PresentationContext settings
286
287
  ...(borderless !== undefined ? { borderless } : {}),
287
288
  ...(typeScale !== undefined ? { typeScale } : {}),
288
- }), [borderless, typeScale]);
289
+ ...(borderOnHover !== undefined ? { borderOnHover } : {}),
290
+ }), [borderOnHover, borderless, typeScale]);
289
291
  // If we're running in Jest, force using `as=div` b/c jsdom doesn't support react-virtuoso.
290
292
  // This enables still putting the application's business/rendering logic under test, and letting it
291
293
  // just trust the GridTable impl that, at runtime, `as=virtual` will (other than being virtualized)
292
294
  // behave semantically the same as `as=div` did for its tests.
293
295
  const _as = as === "virtual" && runningInJest ? "div" : as;
294
296
  const rowStateContext = (0, react_1.useMemo)(() => ({ tableState: tableState }), [tableState]);
295
- return ((0, jsx_runtime_1.jsx)(TableState_1.TableStateContext.Provider, { value: rowStateContext, children: (0, jsx_runtime_1.jsxs)(PresentationContext_1.PresentationProvider, { fieldProps: fieldProps, wrap: (_c = style === null || style === void 0 ? void 0 : style.presentationSettings) === null || _c === void 0 ? void 0 : _c.wrap, children: [(0, jsx_runtime_1.jsx)("div", { ref: resizeRef, css: (0, components_1.getTableRefWidthStyles)(as === "virtual") }), renders[_as](style, id, columns, visibleDataRows, keptSelectedRows, firstRowMessage, stickyHeader, xss, virtuosoRef, tableHeadRows, stickyOffset, infiniteScroll)] }) }));
297
+ return ((0, jsx_runtime_1.jsx)(TableState_1.TableStateContext.Provider, { value: rowStateContext, children: (0, jsx_runtime_1.jsxs)(PresentationContext_1.PresentationProvider, { fieldProps: fieldProps, wrap: (_d = style === null || style === void 0 ? void 0 : style.presentationSettings) === null || _d === void 0 ? void 0 : _d.wrap, children: [(0, jsx_runtime_1.jsx)("div", { ref: resizeRef, css: (0, components_1.getTableRefWidthStyles)(as === "virtual") }), renders[_as](style, id, columns, visibleDataRows, keptSelectedRows, firstRowMessage, stickyHeader, xss, virtuosoRef, tableHeadRows, stickyOffset, infiniteScroll)] }) }));
296
298
  }
297
299
  // Determine which HTML element to use to build the GridTable
298
300
  const renders = {
@@ -1,6 +1,6 @@
1
1
  import { MutableRefObject } from "react";
2
2
  import { VirtuosoHandle } from "react-virtuoso";
3
- import { GridRowLookup, MaybeFn } from "../index";
3
+ import { GridRowLookup, GridTableScrollOptions, MaybeFn } from "../index";
4
4
  import { GridDataRow } from "./components/Row";
5
5
  import { DiscriminateUnion, Kinded } from "./types";
6
6
  import { TableState } from "./utils/TableState";
@@ -22,8 +22,11 @@ import { TableState } from "./utils/TableState";
22
22
  export declare function useGridTableApi<R extends Kinded>(): GridTableApi<R>;
23
23
  /** Provides an imperative API for an application page to interact with the table. */
24
24
  export type GridTableApi<R extends Kinded> = {
25
- /** Scrolls row `index` into view; only supported with `as=virtual` and after a `useEffect`. */
26
- scrollToIndex(index: number): void;
25
+ /** Scrolls row `index` into view; only supported with `as=virtual` and after a `useEffect`.
26
+ *
27
+ * Defaults "smooth" behavior; Use {index, behavior: "auto"} for instant scroll in cases where grid table has many, many records and the scroll effect is undesirable.
28
+ * */
29
+ scrollToIndex(index: GridTableScrollOptions): void;
27
30
  /** Returns the currently-visible rows. */
28
31
  getVisibleRows(): GridDataRow<R>[];
29
32
  /** Returns the currently-visible rows of the given `kind`. */
@@ -78,7 +81,7 @@ export declare class GridTableApiImpl<R extends Kinded> implements GridTableApi<
78
81
  constructor();
79
82
  /** Called once by the GridTable when it takes ownership of this api instance. */
80
83
  init(persistCollapse: string | undefined, virtuosoRef: MutableRefObject<VirtuosoHandle | null>): void;
81
- scrollToIndex(index: number): void;
84
+ scrollToIndex(index: GridTableScrollOptions): void;
82
85
  getSelectedRowIds(kind?: string): string[];
83
86
  private getSelectedRowIdsImpl;
84
87
  getSelectedRows(kind?: string): any;
@@ -50,7 +50,8 @@ class GridTableApiImpl {
50
50
  this.lookup = (0, index_1.createRowLookup)(this, virtuosoRef);
51
51
  }
52
52
  scrollToIndex(index) {
53
- this.virtuosoRef.current && this.virtuosoRef.current.scrollToIndex(index);
53
+ this.virtuosoRef.current &&
54
+ this.virtuosoRef.current.scrollToIndex(typeof index === "number" ? { index, behavior: "smooth" } : index);
54
55
  }
55
56
  getSelectedRowIds(kind) {
56
57
  return this.getSelectedRowIdsImpl(kind !== null && kind !== void 0 ? kind : undefined);
@@ -44,7 +44,7 @@ export interface GridStyle {
44
44
  nonHeaderRowHoverCss?: Properties;
45
45
  /** Default content to put into an empty cell */
46
46
  emptyCell?: ReactNode;
47
- presentationSettings?: Pick<PresentationFieldProps, "borderless" | "typeScale"> & Pick<PresentationContextProps, "wrap">;
47
+ presentationSettings?: Pick<PresentationFieldProps, "borderless" | "borderOnHover" | "typeScale"> & Pick<PresentationContextProps, "wrap">;
48
48
  /** Minimum table width in pixels. Used when calculating columns sizes */
49
49
  minWidthPx?: number;
50
50
  /** Css to apply at each level of a parent/child nested table. */
@@ -84,6 +84,8 @@ export interface GridStyleDef {
84
84
  vAlign?: "top" | "center" | "bottom";
85
85
  /** Defines the Typography for the table body's cells (not the header). This only applies to rows that are not nested/grouped */
86
86
  cellTypography?: Typography;
87
+ /** Defines if the table should highlight the row on hover. Defaults to true */
88
+ highlightOnHover?: boolean;
87
89
  }
88
90
  export declare const getTableStyles: (props?: GridStyleDef) => GridStyle;
89
91
  export declare const totalsRowHeight = 40;
@@ -8,7 +8,7 @@ const utils_1 = require("../../utils");
8
8
  function memoizedTableStyles() {
9
9
  const cache = {};
10
10
  return (props = {}) => {
11
- const { inlineEditing = false, grouped = false, rowHeight = "flexible", cellHighlight = false, allWhite = false, bordered = false, vAlign = "center", cellTypography = "xs", } = props;
11
+ const { inlineEditing = false, grouped = false, rowHeight = "flexible", cellHighlight = false, allWhite = false, bordered = false, vAlign = "center", cellTypography = "xs", highlightOnHover = true, } = props;
12
12
  const key = (0, utils_1.safeKeys)(props)
13
13
  .sort()
14
14
  .map((k) => `${k}_${props[k]}`)
@@ -64,9 +64,14 @@ function memoizedTableStyles() {
64
64
  lastRowCss: bordered
65
65
  ? Css_1.Css.addIn("& > *:first-of-type", Css_1.Css.borderRadius("0 0 0 8px").$).addIn("& > *:last-of-type", Css_1.Css.borderRadius("0 0 8px 0").$).$
66
66
  : Css_1.Css.addIn("> *", Css_1.Css.bsh0.$).$,
67
- presentationSettings: { borderless: true, typeScale: "xs", wrap: rowHeight === "flexible" },
67
+ presentationSettings: {
68
+ borderless: true,
69
+ typeScale: "xs",
70
+ wrap: rowHeight === "flexible",
71
+ borderOnHover: highlightOnHover,
72
+ },
68
73
  levels: grouped ? groupedLevels : defaultLevels,
69
- rowHoverColor: Css_1.Palette.Blue100,
74
+ rowHoverColor: Css_1.Palette.Blue50,
70
75
  keptGroupRowCss: Css_1.Css.bgYellow100.gray900.xsMd.df.aic.$,
71
76
  keptLastRowCss: Css_1.Css.boxShadow("inset 0px -14px 8px -11px rgba(63,63,63,.18)").$,
72
77
  };
@@ -117,6 +122,7 @@ function resolveStyles(style) {
117
122
  rowHover: true,
118
123
  vAlign: true,
119
124
  cellTypography: true,
125
+ highlightOnHover: true,
120
126
  };
121
127
  const keys = (0, utils_1.safeKeys)(style);
122
128
  const defKeys = (0, utils_1.safeKeys)(defKeysRecord);
@@ -72,4 +72,6 @@ export type GridDataRow<R extends Kinded> = {
72
72
  /** Whether this row is draggable, usually to allow drag & drop reordering of rows */
73
73
  draggable?: boolean;
74
74
  } & IfAny<R, AnyObject, DiscriminateUnion<R, "kind", R["kind"]>>;
75
+ export declare const BorderHoverParent = "BorderHoverParent";
76
+ export declare const BorderHoverChild = "BorderHoverChild";
75
77
  export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Row = void 0;
3
+ exports.BorderHoverChild = exports.BorderHoverParent = exports.Row = void 0;
4
4
  const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
5
5
  const mobx_react_1 = require("mobx-react");
6
6
  const react_1 = require("react");
@@ -75,7 +75,7 @@ function RowImpl(props) {
75
75
  const dragOverCallback = (0, react_1.useCallback)((row, evt) => onDragOver === null || onDragOver === void 0 ? void 0 : onDragOver(row, evt), [onDragOver]);
76
76
  // when the event is not called, we still need to call preventDefault
77
77
  const onDragOverDebounced = (0, use_debounce_1.useDebouncedCallback)(dragOverCallback, 100);
78
- const RowContent = () => ((0, jsx_runtime_1.jsx)(RowTag, { css: rowCss, ...others, "data-gridrow": true, ...getCount(row.id), ref: ref, children: isKeptGroupRow ? ((0, jsx_runtime_1.jsx)(KeptGroupRow_1.KeptGroupRow, { as: as, style: style, columnSizes: columnSizes, row: row, colSpan: columns.length })) : (columns.map((column, columnIndex) => {
78
+ const RowContent = () => ((0, jsx_runtime_1.jsx)(RowTag, { css: rowCss, ...others, "data-gridrow": true, ...getCount(row.id), ref: ref, className: exports.BorderHoverParent, children: isKeptGroupRow ? ((0, jsx_runtime_1.jsx)(KeptGroupRow_1.KeptGroupRow, { as: as, style: style, columnSizes: columnSizes, row: row, colSpan: columns.length })) : (columns.map((column, columnIndex) => {
79
79
  var _a, _b;
80
80
  // If the expandable column was hidden, then we need to look at the previous column to format the `expandHeader` and 'header' kinds correctly.
81
81
  const maybeExpandedColumn = expandColumnHidden ? columns[columnIndex - 1] : column;
@@ -251,3 +251,6 @@ function RowImpl(props) {
251
251
  */
252
252
  // Declared as a const + `as typeof RowImpl` to work with generics, see https://github.com/DefinitelyTyped/DefinitelyTyped/issues/37087#issuecomment-656596623
253
253
  exports.Row = (0, mobx_react_1.observer)(RowImpl);
254
+ // Used by TextFieldBase to set a border when the row is being hovered over
255
+ exports.BorderHoverParent = "BorderHoverParent";
256
+ exports.BorderHoverChild = "BorderHoverChild";
@@ -11,6 +11,15 @@ export type RenderAs = "div" | "table" | "virtual";
11
11
  export type Direction = "ASC" | "DESC";
12
12
  export type MaybeFn<T> = T | (() => T);
13
13
  export type GridCellAlignment = "left" | "right" | "center";
14
+ export type GridTableScrollOptions = number | {
15
+ /** The index of the row to scroll to */
16
+ index: number;
17
+ behavior?: "auto" | "smooth";
18
+ /**
19
+ * How to position the row in the viewport
20
+ */
21
+ align?: "start" | "center" | "end";
22
+ };
14
23
  /**
15
24
  * Given an ADT of type T, performs a look up and returns the type of kind K.
16
25
  *
@@ -2,7 +2,7 @@ import type { NumberFieldAria } from "@react-aria/numberfield";
2
2
  import { InputHTMLAttributes, LabelHTMLAttributes, MutableRefObject, ReactNode, TextareaHTMLAttributes } from "react";
3
3
  import { Only } from "../Css";
4
4
  import { BeamTextFieldProps, TextFieldXss } from "../interfaces";
5
- export interface TextFieldBaseProps<X> extends Pick<BeamTextFieldProps<X>, "label" | "required" | "errorMsg" | "errorInTooltip" | "onBlur" | "onFocus" | "helperText" | "labelStyle" | "placeholder" | "compact" | "borderless" | "visuallyDisabled" | "fullWidth" | "xss">, Partial<Pick<BeamTextFieldProps<X>, "onChange">> {
5
+ export interface TextFieldBaseProps<X> extends Pick<BeamTextFieldProps<X>, "label" | "required" | "errorMsg" | "errorInTooltip" | "onBlur" | "onFocus" | "helperText" | "labelStyle" | "placeholder" | "compact" | "borderless" | "borderOnHover" | "visuallyDisabled" | "fullWidth" | "xss">, Partial<Pick<BeamTextFieldProps<X>, "onChange">> {
6
6
  labelProps?: LabelHTMLAttributes<HTMLLabelElement>;
7
7
  inputProps: InputHTMLAttributes<HTMLInputElement> | TextareaHTMLAttributes<HTMLTextAreaElement>;
8
8
  inputRef?: MutableRefObject<HTMLInputElement | HTMLTextAreaElement | null>;
@@ -8,6 +8,7 @@ const components_1 = require("../components");
8
8
  const HelperText_1 = require("../components/HelperText");
9
9
  const Label_1 = require("../components/Label");
10
10
  const PresentationContext_1 = require("../components/PresentationContext");
11
+ const Row_1 = require("../components/Table/components/Row");
11
12
  const Css_1 = require("../Css");
12
13
  const labelUtils_1 = require("../forms/labelUtils");
13
14
  const useGetRef_1 = require("../hooks/useGetRef");
@@ -17,11 +18,11 @@ const defaultTestId_1 = require("../utils/defaultTestId");
17
18
  const useTestIds_1 = require("../utils/useTestIds");
18
19
  // Used by both TextField and TextArea
19
20
  function TextFieldBase(props) {
20
- var _a, _b, _c, _d, _e, _f, _g, _h;
21
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
21
22
  const { fieldProps, wrap = false } = (0, PresentationContext_1.usePresentationContext)();
22
23
  const { labelLeftFieldWidth = "50%" } = fieldProps !== null && fieldProps !== void 0 ? fieldProps : {};
23
- const { label, required, labelProps, inputProps, inputRef, inputWrapRef, groupProps, compact = (_a = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.compact) !== null && _a !== void 0 ? _a : false, errorMsg, helperText, multiline = false, onChange, onBlur, onFocus, xss, endAdornment, startAdornment, labelStyle = (_b = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.labelStyle) !== null && _b !== void 0 ? _b : "above", contrast = false, borderless = (_c = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.borderless) !== null && _c !== void 0 ? _c : false, textAreaMinHeight = 96, clearable = false, tooltip, visuallyDisabled = (_d = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.visuallyDisabled) !== null && _d !== void 0 ? _d : true, errorInTooltip = (_e = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.errorInTooltip) !== null && _e !== void 0 ? _e : false, hideErrorMessage = false, alwaysShowHelperText = false, fullWidth = (_f = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.fullWidth) !== null && _f !== void 0 ? _f : false, unfocusedPlaceholder, selectOnFocus = true, } = props;
24
- const typeScale = (_g = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.typeScale) !== null && _g !== void 0 ? _g : (inputProps.readOnly && labelStyle !== "hidden" ? "smMd" : "sm");
24
+ const { label, required, labelProps, inputProps, inputRef, inputWrapRef, groupProps, compact = (_a = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.compact) !== null && _a !== void 0 ? _a : false, errorMsg, helperText, multiline = false, onChange, onBlur, onFocus, xss, endAdornment, startAdornment, labelStyle = (_b = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.labelStyle) !== null && _b !== void 0 ? _b : "above", contrast = false, borderless = (_c = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.borderless) !== null && _c !== void 0 ? _c : false, borderOnHover = (_d = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.borderOnHover) !== null && _d !== void 0 ? _d : false, textAreaMinHeight = 96, clearable = false, tooltip, visuallyDisabled = (_e = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.visuallyDisabled) !== null && _e !== void 0 ? _e : true, errorInTooltip = (_f = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.errorInTooltip) !== null && _f !== void 0 ? _f : false, hideErrorMessage = false, alwaysShowHelperText = false, fullWidth = (_g = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.fullWidth) !== null && _g !== void 0 ? _g : false, unfocusedPlaceholder, selectOnFocus = true, } = props;
25
+ const typeScale = (_h = fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.typeScale) !== null && _h !== void 0 ? _h : (inputProps.readOnly && labelStyle !== "hidden" ? "smMd" : "sm");
25
26
  const internalProps = props.internalProps || {};
26
27
  const { compound = false, forceFocus = false, forceHover = false } = internalProps;
27
28
  const errorMessageId = `${inputProps.id}-error`;
@@ -37,9 +38,12 @@ function TextFieldBase(props) {
37
38
  const compactFieldHeight = 32;
38
39
  const [bgColor, hoverBgColor, disabledBgColor] = contrast
39
40
  ? [Css_1.Palette.Gray700, Css_1.Palette.Gray600, Css_1.Palette.Gray700]
40
- : borderless && !compound
41
- ? [Css_1.Palette.Gray100, Css_1.Palette.Gray200, Css_1.Palette.Gray200]
42
- : [Css_1.Palette.White, Css_1.Palette.Gray100, Css_1.Palette.Gray100];
41
+ : borderOnHover
42
+ ? // Use transparent backgrounds to blend with the table row hover color
43
+ [Css_1.Palette.Transparent, Css_1.Palette.Blue100, Css_1.Palette.Gray100]
44
+ : borderless && !compound
45
+ ? [Css_1.Palette.Gray100, Css_1.Palette.Gray200, Css_1.Palette.Gray200]
46
+ : [Css_1.Palette.White, Css_1.Palette.Gray100, Css_1.Palette.Gray100];
43
47
  const fieldMaxWidth = (0, utils_1.getFieldWidth)(fullWidth);
44
48
  const fieldStyles = {
45
49
  container: Css_1.Css.df.fdc.w100.maxw(fieldMaxWidth).relative.if(labelStyle === "left").maxw100.fdr.gap2.jcsb.aic.$,
@@ -58,6 +62,12 @@ function TextFieldBase(props) {
58
62
  : Css_1.Css.bcGray300.if(contrast).bcGray700.$),
59
63
  // Do not add borders to compound fields. A compound field is responsible for drawing its own borders
60
64
  ...(!compound ? Css_1.Css.ba.$ : {}),
65
+ ...(borderOnHover && Css_1.Css.br4.ba.bcTransparent.add("transition", "border-color 200ms").$),
66
+ ...(borderOnHover && Css_1.Css.if(isHovered).bgBlue100.ba.bcBlue300.$),
67
+ ...{
68
+ // Highlight the field when hovering over the row in a table, unless some other edit component (including ourselves) is hovered
69
+ [`.${Row_1.BorderHoverParent}:hover:not(:has(.${Row_1.BorderHoverChild}:hover)) &`]: Css_1.Css.ba.bcBlue300.$,
70
+ },
61
71
  // When multiline is true, then we want to allow the field to grow to the height of the content, but not shrink below the minHeight
62
72
  // Otherwise, set fixed heights values accordingly.
63
73
  ...(multiline
@@ -83,11 +93,13 @@ function TextFieldBase(props) {
83
93
  ...Css_1.Css.w100.mw0.outline0.fg1.bgColor(bgColor).$,
84
94
  // Not using Truss's inline `if` statement here because `addIn` properties do not respect the if statement.
85
95
  ...(contrast && Css_1.Css.addIn("&::selection", Css_1.Css.bgGray800.$).$),
96
+ // Make the background transparent when highlighting the field on hover
97
+ ...(borderOnHover && Css_1.Css.bgTransparent.$),
86
98
  // For "multiline" fields we add top and bottom padding of 7px for compact, or 11px for non-compact, to properly match the height of the single line fields
87
99
  ...(multiline ? Css_1.Css.br4.pyPx(compact ? 7 : 11).add("resize", "none").$ : Css_1.Css.truncate.$),
88
100
  },
89
101
  hover: Css_1.Css.bgColor(hoverBgColor).if(contrast).bcGray600.$,
90
- focus: Css_1.Css.bcBlue700.if(contrast).bcBlue500.$,
102
+ focus: Css_1.Css.bcBlue700.if(contrast).bcBlue500.if(borderOnHover).bgBlue100.bcBlue500.$,
91
103
  disabled: visuallyDisabled
92
104
  ? Css_1.Css.cursorNotAllowed.gray600.bgColor(disabledBgColor).if(contrast).gray500.$
93
105
  : Css_1.Css.cursorNotAllowed.$,
@@ -123,8 +135,8 @@ function TextFieldBase(props) {
123
135
  ...fieldStyles.inputWrapperReadOnly,
124
136
  ...(multiline ? Css_1.Css.fdc.aifs.gap2.$ : Css_1.Css.if(wrap === false).truncate.$),
125
137
  ...xss,
126
- }, "data-readonly": "true", ...tid, children: [labelStyle === "inline" && label && ((0, jsx_runtime_1.jsx)(Label_1.InlineLabel, { multiline: multiline, labelProps: labelProps, label: label, ...tid.label })), multiline
127
- ? (_h = inputProps.value) === null || _h === void 0 ? void 0 : _h.split("\n\n").map((p, i) => ((0, jsx_runtime_1.jsx)("p", { css: Css_1.Css.py1.$, children: p.split("\n").map((sentence, j) => ((0, jsx_runtime_1.jsxs)("span", { children: [sentence, (0, jsx_runtime_1.jsx)("br", {})] }, j))) }, i)))
138
+ }, className: Row_1.BorderHoverChild, "data-readonly": "true", ...tid, children: [labelStyle === "inline" && label && ((0, jsx_runtime_1.jsx)(Label_1.InlineLabel, { multiline: multiline, labelProps: labelProps, label: label, ...tid.label })), multiline
139
+ ? (_j = inputProps.value) === null || _j === void 0 ? void 0 : _j.split("\n\n").map((p, i) => ((0, jsx_runtime_1.jsx)("p", { css: Css_1.Css.py1.$, children: p.split("\n").map((sentence, j) => ((0, jsx_runtime_1.jsxs)("span", { children: [sentence, (0, jsx_runtime_1.jsx)("br", {})] }, j))) }, i)))
128
140
  : inputProps.value] })) : ((0, jsx_runtime_1.jsxs)("div", { css: {
129
141
  ...fieldStyles.inputWrapper,
130
142
  ...(inputProps.disabled ? fieldStyles.disabled : {}),
@@ -133,7 +145,9 @@ function TextFieldBase(props) {
133
145
  // Only show error styles if the field is not disabled, following the pattern that the error message is also hidden
134
146
  ...(errorMsg && !inputProps.disabled ? fieldStyles.error : {}),
135
147
  ...Css_1.Css.if(multiline).aifs.oh.mhPx(textAreaMinHeight).$,
136
- }, ...hoverProps, ref: inputWrapRef, onClick: unfocusedPlaceholder ? handleUnfocusedPlaceholderClick : undefined, children: [labelStyle === "inline" && label && ((0, jsx_runtime_1.jsx)(Label_1.InlineLabel, { multiline: multiline, labelProps: labelProps, label: label, ...tid.label })), startAdornment && (0, jsx_runtime_1.jsx)("span", { css: Css_1.Css.df.aic.asc.fs0.br4.pr1.$, children: startAdornment }), unfocusedPlaceholder && ((0, jsx_runtime_1.jsx)("div", {
148
+ },
149
+ // Class name used for the grid table on row hover for highlighting
150
+ className: Row_1.BorderHoverChild, ...hoverProps, ref: inputWrapRef, onClick: unfocusedPlaceholder ? handleUnfocusedPlaceholderClick : undefined, children: [labelStyle === "inline" && label && ((0, jsx_runtime_1.jsx)(Label_1.InlineLabel, { multiline: multiline, labelProps: labelProps, label: label, ...tid.label })), startAdornment && (0, jsx_runtime_1.jsx)("span", { css: Css_1.Css.df.aic.asc.fs0.br4.pr1.$, children: startAdornment }), unfocusedPlaceholder && ((0, jsx_runtime_1.jsx)("div", {
137
151
  // Setting -1 tabIndex as this is a scrollable container, which is focusable by default.
138
152
  // However, we want the user's focus to move to the field element, which will hide this container.
139
153
  tabIndex: -1, ...tid.unfocusedPlaceholderContainer, css: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homebound/beam",
3
- "version": "2.370.2",
3
+ "version": "2.371.1",
4
4
  "author": "Homebound",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",