@homebound/beam 4.16.1 → 4.17.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.cjs CHANGED
@@ -11727,6 +11727,7 @@ function TextFieldBase(props) {
11727
11727
  } = fieldProps ?? {};
11728
11728
  const {
11729
11729
  label,
11730
+ tooltip,
11730
11731
  required,
11731
11732
  labelProps,
11732
11733
  inputProps,
@@ -11748,7 +11749,6 @@ function TextFieldBase(props) {
11748
11749
  borderOnHover = fieldProps?.borderOnHover ?? false,
11749
11750
  textAreaMinHeight = 96,
11750
11751
  clearable = false,
11751
- tooltip,
11752
11752
  visuallyDisabled = fieldProps?.visuallyDisabled ?? true,
11753
11753
  errorInTooltip = fieldProps?.errorInTooltip ?? false,
11754
11754
  hideErrorMessage = false,
@@ -11769,6 +11769,9 @@ function TextFieldBase(props) {
11769
11769
  forceFocus = false,
11770
11770
  forceHover = false
11771
11771
  } = internalProps;
11772
+ const hasVisibleLabel = !!label && labelStyle !== "inline" && labelStyle !== "hidden" && !compound;
11773
+ const isInteractive = !inputProps.disabled && !inputProps.readOnly;
11774
+ const tooltipLocation = hasVisibleLabel ? "label" : !isInteractive ? "field" : void 0;
11772
11775
  const errorMessageId = `${inputProps.id}-error`;
11773
11776
  const labelSuffix = useLabelSuffix(required, inputProps.readOnly);
11774
11777
  const tid = useTestIds(props, defaultTestId(label));
@@ -12060,9 +12063,9 @@ function TextFieldBase(props) {
12060
12063
  };
12061
12064
  return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
12062
12065
  /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { ...(0, import_runtime31.trussProps)(fieldStyles.container), ...groupProps, ...focusWithinProps, children: [
12063
- label && labelStyle !== "inline" && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Label, { labelProps, hidden: labelStyle === "hidden" || compound, label, inline: labelStyle !== "above", suffix: labelSuffix, ...tid.label }),
12066
+ label && labelStyle !== "inline" && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Label, { labelProps, hidden: labelStyle === "hidden" || compound, label, inline: labelStyle !== "above", suffix: labelSuffix, tooltip: tooltipLocation === "label" ? tooltip : void 0, ...tid.label }),
12064
12067
  maybeTooltip({
12065
- title: tooltip,
12068
+ title: tooltipLocation === "field" ? tooltip : void 0,
12066
12069
  placement: "top",
12067
12070
  children: inputProps.readOnly ? /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { ...(0, import_runtime31.trussProps)({
12068
12071
  // Use input wrapper to get common styles, but then we need to override some
@@ -19295,7 +19298,7 @@ function TreeSelectFieldBase(props) {
19295
19298
  maxWidth: "maxw100"
19296
19299
  } : {}
19297
19300
  }), ref: comboBoxRef, children: [
19298
- /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(ComboBoxInput, { ...otherProps, fullWidth, labelStyle, buttonProps, buttonRef: triggerRef, inputProps, inputRef, inputWrapRef, listBoxRef, state, labelProps, selectedOptions: fieldState.selectedOptions, selectedOptionsLabels: fieldState.selectedOptionsLabels, getOptionValue, getOptionLabel, borderless, tooltip: resolveTooltip(disabled, void 0, readOnly), resetField, nothingSelectedText, isTree: true }),
19301
+ /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(ComboBoxInput, { ...otherProps, fullWidth, labelStyle, buttonProps, buttonRef: triggerRef, inputProps, inputRef, inputWrapRef, listBoxRef, state, labelProps, selectedOptions: fieldState.selectedOptions, selectedOptionsLabels: fieldState.selectedOptionsLabels, getOptionValue, getOptionLabel, borderless, tooltip: resolveTooltip(disabled, props.tooltip, readOnly), resetField, nothingSelectedText, isTree: true }),
19299
19302
  state.isOpen && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
19300
19303
  Popover,
19301
19304
  {
@@ -19544,6 +19547,7 @@ function ComboBoxBase(props) {
19544
19547
  onAddNew,
19545
19548
  autoSort = true,
19546
19549
  hideChips = false,
19550
+ tooltip,
19547
19551
  ...otherProps
19548
19552
  } = props;
19549
19553
  const labelStyle = otherProps.labelStyle ?? fieldProps?.labelStyle ?? "above";
@@ -19776,7 +19780,7 @@ function ComboBoxBase(props) {
19776
19780
  maxWidth: "maxw100"
19777
19781
  } : {}
19778
19782
  }), ref: comboBoxRef, children: [
19779
- /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(ComboBoxInput, { ...otherProps, inputStylePalette, fullWidth, buttonProps, buttonRef: triggerRef, inputProps, inputRef, inputWrapRef, listBoxRef, state, labelProps, selectedOptions, getOptionValue, getOptionLabel, nothingSelectedText, borderless, tooltip: resolveTooltip(disabled, void 0, readOnly), resetField, hideChips, ...proposalProps }),
19783
+ /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(ComboBoxInput, { ...otherProps, inputStylePalette, fullWidth, buttonProps, buttonRef: triggerRef, inputProps, inputRef, inputWrapRef, listBoxRef, state, labelProps, selectedOptions, getOptionValue, getOptionLabel, nothingSelectedText, borderless, tooltip: resolveTooltip(disabled, tooltip, readOnly), resetField, hideChips, ...proposalProps }),
19780
19784
  state.isOpen && /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
19781
19785
  Popover,
19782
19786
  {
@@ -20450,6 +20454,7 @@ var import_jsx_runtime116 = require("react/jsx-runtime");
20450
20454
  function LabeledGroupField(props) {
20451
20455
  const {
20452
20456
  label,
20457
+ tooltip,
20453
20458
  labelStyle,
20454
20459
  labelProps,
20455
20460
  groupProps,
@@ -20463,7 +20468,7 @@ function LabeledGroupField(props) {
20463
20468
  } = props;
20464
20469
  const isHiddenLabel = labelStyle === "hidden";
20465
20470
  const isLeftLabel = labelStyle === "left";
20466
- const labelElement = /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(Label, { label, ...labelProps, ...tid.label, suffix: labelSuffix, hidden: isHiddenLabel, inline: isLeftLabel });
20471
+ const labelElement = /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(Label, { label, ...labelProps, ...tid.label, suffix: labelSuffix, tooltip, hidden: isHiddenLabel, inline: isLeftLabel });
20467
20472
  return /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("div", { ...groupProps, ...(0, import_runtime87.trussProps)({
20468
20473
  width: "w100",
20469
20474
  ...isLeftLabel ? {
@@ -20491,6 +20496,7 @@ function CheckboxGroup(props) {
20491
20496
  const {
20492
20497
  options,
20493
20498
  label,
20499
+ tooltip,
20494
20500
  labelStyle = fieldProps?.labelStyle ?? "above",
20495
20501
  values,
20496
20502
  errorMsg,
@@ -20510,7 +20516,7 @@ function CheckboxGroup(props) {
20510
20516
  } = (0, import_react_aria39.useCheckboxGroup)(props, state);
20511
20517
  const tid = useTestIds(props, defaultTestId(label));
20512
20518
  const labelSuffix = useLabelSuffix(required, false);
20513
- return /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(LabeledGroupField, { label, labelStyle, labelProps, groupProps, errorMsg, helperText, labelSuffix, onBlur, onFocus, tid, children: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("div", { ...(0, import_runtime88.trussProps)({
20519
+ return /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(LabeledGroupField, { label, tooltip, labelStyle, labelProps, groupProps, errorMsg, helperText, labelSuffix, onBlur, onFocus, tid, children: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("div", { ...(0, import_runtime88.trussProps)({
20514
20520
  display: "dg",
20515
20521
  gridTemplateColumns: ["gtc_var", {
20516
20522
  "--gridTemplateColumns": (0, import_runtime88.maybeCssVar)(`repeat(${columns}, auto)`)
@@ -20741,6 +20747,7 @@ var import_jsx_runtime121 = require("react/jsx-runtime");
20741
20747
  function DateFieldBase(props) {
20742
20748
  const {
20743
20749
  label,
20750
+ tooltip,
20744
20751
  disabled,
20745
20752
  required,
20746
20753
  value,
@@ -20933,7 +20940,7 @@ function DateFieldBase(props) {
20933
20940
  },
20934
20941
  endAdornment: !iconLeft && EndFieldButtons,
20935
20942
  startAdornment: !hideCalendarIcon && iconLeft && calendarButton,
20936
- tooltip: resolveTooltip(disabled, void 0, readOnly),
20943
+ tooltip: resolveTooltip(disabled, tooltip, readOnly),
20937
20944
  ...others
20938
20945
  }
20939
20946
  ),
@@ -21148,6 +21155,7 @@ function MultiLineSelectField(props) {
21148
21155
  getOptionValue = (opt) => opt.id,
21149
21156
  getOptionLabel = (opt) => opt.name,
21150
21157
  labelStyle,
21158
+ tooltip,
21151
21159
  ...otherProps
21152
21160
  } = props;
21153
21161
  const tid = useTestIds(props, "");
@@ -21163,7 +21171,7 @@ function MultiLineSelectField(props) {
21163
21171
  ...labelStyle === "left" ? {
21164
21172
  width: "w50"
21165
21173
  } : {}
21166
- }), children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(Label, { ...tid.label, label: props.label }) }),
21174
+ }), children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(Label, { ...tid.label, label: props.label, tooltip }) }),
21167
21175
  /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { ...(0, import_runtime91.trussProps)({
21168
21176
  ...labelStyle === "left" ? {
21169
21177
  width: "w50"
@@ -21739,6 +21747,7 @@ function MultiSelectCardGroup(props) {
21739
21747
  } = usePresentationContext();
21740
21748
  const {
21741
21749
  label,
21750
+ tooltip,
21742
21751
  labelStyle = fieldProps?.labelStyle ?? "above",
21743
21752
  values,
21744
21753
  options,
@@ -21773,7 +21782,7 @@ function MultiSelectCardGroup(props) {
21773
21782
  label,
21774
21783
  isDisabled
21775
21784
  }, state);
21776
- return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(LabeledGroupField, { label, labelStyle, labelProps, groupProps, errorMsg, helperText, tid, children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)("div", { ...(0, import_runtime98.trussProps)(getSelectCardOptionsCss({
21785
+ return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(LabeledGroupField, { label, tooltip, labelStyle, labelProps, groupProps, errorMsg, helperText, tid, children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)("div", { ...(0, import_runtime98.trussProps)(getSelectCardOptionsCss({
21777
21786
  view,
21778
21787
  hasDescription,
21779
21788
  layout,
@@ -21987,6 +21996,7 @@ function NumberField(props) {
21987
21996
  readOnly,
21988
21997
  type,
21989
21998
  label,
21999
+ tooltip,
21990
22000
  onBlur,
21991
22001
  onFocus,
21992
22002
  errorMsg,
@@ -22146,7 +22156,7 @@ function NumberField(props) {
22146
22156
  onFocus,
22147
22157
  errorMsg,
22148
22158
  helperText,
22149
- tooltip: resolveTooltip(disabled, void 0, readOnly),
22159
+ tooltip: resolveTooltip(disabled, tooltip, readOnly),
22150
22160
  ...proposalProps,
22151
22161
  ...otherProps
22152
22162
  }
@@ -22229,6 +22239,7 @@ function RadioGroupField(props) {
22229
22239
  errorMsg,
22230
22240
  helperText,
22231
22241
  layout = "vertical",
22242
+ tooltip,
22232
22243
  ...otherProps
22233
22244
  } = props;
22234
22245
  const name = (0, import_react99.useMemo)(() => `radio-group-${++nextNameId}`, []);
@@ -22262,7 +22273,7 @@ function RadioGroupField(props) {
22262
22273
  justifyContent: "jcsb"
22263
22274
  } : {}
22264
22275
  }), ...tid, children: [
22265
- /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(Label, { label, ...labelProps, ...tid.label, suffix: labelSuffix, hidden: labelStyle === "hidden" }),
22276
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(Label, { label, ...labelProps, ...tid.label, suffix: labelSuffix, tooltip, hidden: labelStyle === "hidden" }),
22266
22277
  /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)("div", { ...radioGroupProps, children: [
22267
22278
  /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("div", { ...(0, import_runtime100.trussProps)({
22268
22279
  display: "df",
@@ -22564,7 +22575,7 @@ function RichTextFieldImpl(props) {
22564
22575
  maxWidth: "maxw_550px"
22565
22576
  } : {}
22566
22577
  }), children: [
22567
- label && /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Label, { labelProps: {}, label }),
22578
+ label && /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Label, { labelProps: {}, label, tooltip: props.tooltip }),
22568
22579
  /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("div", { className: "beam-trix-editor", children: [
22569
22580
  /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("input", { type: "hidden", id: `input-${id}`, value }),
22570
22581
  (0, import_react101.createElement)("trix-editor", {
@@ -22587,7 +22598,7 @@ function RichTextFieldImpl(props) {
22587
22598
  maxWidth: "maxw_550px"
22588
22599
  } : {}
22589
22600
  }), children: [
22590
- label && /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Label, { label }),
22601
+ label && /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Label, { label, tooltip: props.tooltip }),
22591
22602
  /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("div", { ...(0, import_runtime101.trussProps)({
22592
22603
  minHeight: "mh_120px",
22593
22604
  backgroundColor: ["bgColor_var", {
@@ -22732,6 +22743,7 @@ function SelectCardGroup(props) {
22732
22743
  } = usePresentationContext();
22733
22744
  const {
22734
22745
  label,
22746
+ tooltip,
22735
22747
  labelStyle = fieldProps?.labelStyle ?? "above",
22736
22748
  value,
22737
22749
  options,
@@ -22760,7 +22772,7 @@ function SelectCardGroup(props) {
22760
22772
  label,
22761
22773
  isDisabled
22762
22774
  }, state);
22763
- return /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(LabeledGroupField, { label, labelStyle, labelProps, groupProps: radioGroupProps, errorMsg, helperText, tid, children: /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { ...(0, import_runtime102.trussProps)(getSelectCardOptionsCss({
22775
+ return /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(LabeledGroupField, { label, tooltip, labelStyle, labelProps, groupProps: radioGroupProps, errorMsg, helperText, tid, children: /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { ...(0, import_runtime102.trussProps)(getSelectCardOptionsCss({
22764
22776
  view,
22765
22777
  hasDescription,
22766
22778
  layout,
@@ -23095,6 +23107,7 @@ function TextAreaField(props) {
23095
23107
  preventNewLines,
23096
23108
  onEnter,
23097
23109
  maxLines,
23110
+ tooltip,
23098
23111
  ...otherProps
23099
23112
  } = props;
23100
23113
  const { effectiveValue, proposalProps } = useAiProposal(value, proposedValue);
@@ -23134,7 +23147,7 @@ function TextAreaField(props) {
23134
23147
  inputRef,
23135
23148
  inputWrapRef,
23136
23149
  textAreaMinHeight: preventNewLines ? 0 : void 0,
23137
- tooltip: resolveTooltip(disabled, void 0, readOnly),
23150
+ tooltip: resolveTooltip(disabled, tooltip, readOnly),
23138
23151
  ...proposalProps
23139
23152
  }
23140
23153
  );
@@ -23202,6 +23215,7 @@ function TextField(props) {
23202
23215
  onEnter,
23203
23216
  onEscapeBubble,
23204
23217
  hideErrorMessage,
23218
+ tooltip,
23205
23219
  ...otherProps
23206
23220
  } = props;
23207
23221
  const { effectiveValue, proposalProps } = useAiProposal(value, proposedValue);
@@ -23244,7 +23258,7 @@ function TextField(props) {
23244
23258
  labelProps,
23245
23259
  inputProps,
23246
23260
  inputRef,
23247
- tooltip: resolveTooltip(disabled, void 0, readOnly),
23261
+ tooltip: resolveTooltip(disabled, tooltip, readOnly),
23248
23262
  hideErrorMessage,
23249
23263
  ...proposalProps
23250
23264
  }
@@ -23314,6 +23328,7 @@ function ToggleChipGroup(props) {
23314
23328
  const {
23315
23329
  values,
23316
23330
  label,
23331
+ tooltip,
23317
23332
  labelStyle = fieldProps?.labelStyle ?? "above",
23318
23333
  options,
23319
23334
  required,
@@ -23342,7 +23357,7 @@ function ToggleChipGroup(props) {
23342
23357
  justifyContent: "jcsb"
23343
23358
  } : {}
23344
23359
  }), children: [
23345
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(Label, { label, ...labelProps, hidden: labelStyle === "hidden", inline: labelStyle !== "above", suffix: labelSuffix }),
23360
+ /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(Label, { label, ...labelProps, ...tid.label, hidden: labelStyle === "hidden", inline: labelStyle !== "above", suffix: labelSuffix, tooltip }),
23346
23361
  /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("div", { ...(0, import_runtime104.trussProps)({
23347
23362
  display: "df",
23348
23363
  gap: "g_1",