@homebound/beam 4.16.1 → 4.18.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
@@ -13525,6 +13528,27 @@ function getVariantStyles(variant, type) {
13525
13528
  }
13526
13529
  };
13527
13530
  }
13531
+ if (variant === "bold") {
13532
+ return {
13533
+ background: {
13534
+ ...getBoldBackground(type),
13535
+ ...{
13536
+ color: "white"
13537
+ }
13538
+ },
13539
+ iconColor: "rgba(255, 255, 255, 1)" /* White */,
13540
+ typography: {
13541
+ fontWeight: "fw6",
13542
+ fontSize: "fz_10px",
13543
+ lineHeight: "lh_14px",
13544
+ textTransform: "ttu"
13545
+ },
13546
+ padding: {
13547
+ paddingLeft: "pl_6px",
13548
+ paddingRight: "pr_6px"
13549
+ }
13550
+ };
13551
+ }
13528
13552
  return {
13529
13553
  ...getPrimaryStyles(type),
13530
13554
  typography: {
@@ -13539,6 +13563,38 @@ function getVariantStyles(variant, type) {
13539
13563
  }
13540
13564
  };
13541
13565
  }
13566
+ function getBoldBackground(type) {
13567
+ switch (type) {
13568
+ case "info":
13569
+ return {
13570
+ backgroundColor: "bgBlue600"
13571
+ };
13572
+ case "update":
13573
+ return {
13574
+ backgroundColor: "bgYellow600"
13575
+ };
13576
+ case "warning":
13577
+ return {
13578
+ backgroundColor: "bgOrange600"
13579
+ };
13580
+ case "error":
13581
+ return {
13582
+ backgroundColor: "bgRed600"
13583
+ };
13584
+ case "success":
13585
+ return {
13586
+ backgroundColor: "bgGreen600"
13587
+ };
13588
+ case "ai":
13589
+ return {
13590
+ backgroundColor: "bgPurple600"
13591
+ };
13592
+ default:
13593
+ return {
13594
+ backgroundColor: "bgGray600"
13595
+ };
13596
+ }
13597
+ }
13542
13598
  function getPrimaryStyles(type) {
13543
13599
  switch (type) {
13544
13600
  case "info":
@@ -16519,9 +16575,9 @@ function Card(props) {
16519
16575
  icon: "verticalDots",
16520
16576
  color: isList ? "--b-on-surface-muted" /* OnSurfaceMuted */ : "--b-on-primary" /* OnPrimary */
16521
16577
  }, items: buttonMenuItems }) }),
16522
- tag && !isList && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "absolute l_1 tp_4px", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Tag, { type: tag.type, text: tag.text, ...tid.tag }) }),
16578
+ tag && !isList && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "absolute l_1 tp_4px", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Tag, { type: tag.type, variant: tag.variant, text: tag.text, ...tid.tag }) }),
16523
16579
  /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "df fdc aifs g_1", children: [
16524
- tag && isList && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Tag, { type: tag.type, text: tag.text, ...tid.tag }),
16580
+ tag && isList && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Tag, { type: tag.type, variant: tag.variant, text: tag.text, ...tid.tag }),
16525
16581
  /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { children: [
16526
16582
  /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { ...(0, import_runtime61.trussProps)({
16527
16583
  fontWeight: "fw6",
@@ -19295,7 +19351,7 @@ function TreeSelectFieldBase(props) {
19295
19351
  maxWidth: "maxw100"
19296
19352
  } : {}
19297
19353
  }), 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 }),
19354
+ /* @__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
19355
  state.isOpen && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
19300
19356
  Popover,
19301
19357
  {
@@ -19544,6 +19600,7 @@ function ComboBoxBase(props) {
19544
19600
  onAddNew,
19545
19601
  autoSort = true,
19546
19602
  hideChips = false,
19603
+ tooltip,
19547
19604
  ...otherProps
19548
19605
  } = props;
19549
19606
  const labelStyle = otherProps.labelStyle ?? fieldProps?.labelStyle ?? "above";
@@ -19776,7 +19833,7 @@ function ComboBoxBase(props) {
19776
19833
  maxWidth: "maxw100"
19777
19834
  } : {}
19778
19835
  }), 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 }),
19836
+ /* @__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
19837
  state.isOpen && /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
19781
19838
  Popover,
19782
19839
  {
@@ -20162,6 +20219,7 @@ function InlineFeedbackBanner(props) {
20162
20219
  const {
20163
20220
  type,
20164
20221
  tagText,
20222
+ tagVariant,
20165
20223
  description,
20166
20224
  actions = []
20167
20225
  } = props;
@@ -20174,10 +20232,12 @@ function InlineFeedbackBanner(props) {
20174
20232
  const tid = useTestIds(props, "inlineFeedbackBanner");
20175
20233
  const tagProps = tagText ? {
20176
20234
  type: tagType,
20235
+ variant: tagVariant,
20177
20236
  icon,
20178
20237
  text: tagText
20179
20238
  } : {
20180
20239
  type: tagType,
20240
+ variant: tagVariant,
20181
20241
  icon,
20182
20242
  text: fallbackTagText,
20183
20243
  iconOnly: true
@@ -20450,6 +20510,7 @@ var import_jsx_runtime116 = require("react/jsx-runtime");
20450
20510
  function LabeledGroupField(props) {
20451
20511
  const {
20452
20512
  label,
20513
+ tooltip,
20453
20514
  labelStyle,
20454
20515
  labelProps,
20455
20516
  groupProps,
@@ -20463,7 +20524,7 @@ function LabeledGroupField(props) {
20463
20524
  } = props;
20464
20525
  const isHiddenLabel = labelStyle === "hidden";
20465
20526
  const isLeftLabel = labelStyle === "left";
20466
- const labelElement = /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(Label, { label, ...labelProps, ...tid.label, suffix: labelSuffix, hidden: isHiddenLabel, inline: isLeftLabel });
20527
+ const labelElement = /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(Label, { label, ...labelProps, ...tid.label, suffix: labelSuffix, tooltip, hidden: isHiddenLabel, inline: isLeftLabel });
20467
20528
  return /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("div", { ...groupProps, ...(0, import_runtime87.trussProps)({
20468
20529
  width: "w100",
20469
20530
  ...isLeftLabel ? {
@@ -20491,6 +20552,7 @@ function CheckboxGroup(props) {
20491
20552
  const {
20492
20553
  options,
20493
20554
  label,
20555
+ tooltip,
20494
20556
  labelStyle = fieldProps?.labelStyle ?? "above",
20495
20557
  values,
20496
20558
  errorMsg,
@@ -20510,7 +20572,7 @@ function CheckboxGroup(props) {
20510
20572
  } = (0, import_react_aria39.useCheckboxGroup)(props, state);
20511
20573
  const tid = useTestIds(props, defaultTestId(label));
20512
20574
  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)({
20575
+ 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
20576
  display: "dg",
20515
20577
  gridTemplateColumns: ["gtc_var", {
20516
20578
  "--gridTemplateColumns": (0, import_runtime88.maybeCssVar)(`repeat(${columns}, auto)`)
@@ -20741,6 +20803,7 @@ var import_jsx_runtime121 = require("react/jsx-runtime");
20741
20803
  function DateFieldBase(props) {
20742
20804
  const {
20743
20805
  label,
20806
+ tooltip,
20744
20807
  disabled,
20745
20808
  required,
20746
20809
  value,
@@ -20933,7 +20996,7 @@ function DateFieldBase(props) {
20933
20996
  },
20934
20997
  endAdornment: !iconLeft && EndFieldButtons,
20935
20998
  startAdornment: !hideCalendarIcon && iconLeft && calendarButton,
20936
- tooltip: resolveTooltip(disabled, void 0, readOnly),
20999
+ tooltip: resolveTooltip(disabled, tooltip, readOnly),
20937
21000
  ...others
20938
21001
  }
20939
21002
  ),
@@ -21148,6 +21211,7 @@ function MultiLineSelectField(props) {
21148
21211
  getOptionValue = (opt) => opt.id,
21149
21212
  getOptionLabel = (opt) => opt.name,
21150
21213
  labelStyle,
21214
+ tooltip,
21151
21215
  ...otherProps
21152
21216
  } = props;
21153
21217
  const tid = useTestIds(props, "");
@@ -21163,7 +21227,7 @@ function MultiLineSelectField(props) {
21163
21227
  ...labelStyle === "left" ? {
21164
21228
  width: "w50"
21165
21229
  } : {}
21166
- }), children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(Label, { ...tid.label, label: props.label }) }),
21230
+ }), children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(Label, { ...tid.label, label: props.label, tooltip }) }),
21167
21231
  /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { ...(0, import_runtime91.trussProps)({
21168
21232
  ...labelStyle === "left" ? {
21169
21233
  width: "w50"
@@ -21739,6 +21803,7 @@ function MultiSelectCardGroup(props) {
21739
21803
  } = usePresentationContext();
21740
21804
  const {
21741
21805
  label,
21806
+ tooltip,
21742
21807
  labelStyle = fieldProps?.labelStyle ?? "above",
21743
21808
  values,
21744
21809
  options,
@@ -21773,7 +21838,7 @@ function MultiSelectCardGroup(props) {
21773
21838
  label,
21774
21839
  isDisabled
21775
21840
  }, 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({
21841
+ 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
21842
  view,
21778
21843
  hasDescription,
21779
21844
  layout,
@@ -21987,6 +22052,7 @@ function NumberField(props) {
21987
22052
  readOnly,
21988
22053
  type,
21989
22054
  label,
22055
+ tooltip,
21990
22056
  onBlur,
21991
22057
  onFocus,
21992
22058
  errorMsg,
@@ -22146,7 +22212,7 @@ function NumberField(props) {
22146
22212
  onFocus,
22147
22213
  errorMsg,
22148
22214
  helperText,
22149
- tooltip: resolveTooltip(disabled, void 0, readOnly),
22215
+ tooltip: resolveTooltip(disabled, tooltip, readOnly),
22150
22216
  ...proposalProps,
22151
22217
  ...otherProps
22152
22218
  }
@@ -22229,6 +22295,7 @@ function RadioGroupField(props) {
22229
22295
  errorMsg,
22230
22296
  helperText,
22231
22297
  layout = "vertical",
22298
+ tooltip,
22232
22299
  ...otherProps
22233
22300
  } = props;
22234
22301
  const name = (0, import_react99.useMemo)(() => `radio-group-${++nextNameId}`, []);
@@ -22262,7 +22329,7 @@ function RadioGroupField(props) {
22262
22329
  justifyContent: "jcsb"
22263
22330
  } : {}
22264
22331
  }), ...tid, children: [
22265
- /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(Label, { label, ...labelProps, ...tid.label, suffix: labelSuffix, hidden: labelStyle === "hidden" }),
22332
+ /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(Label, { label, ...labelProps, ...tid.label, suffix: labelSuffix, tooltip, hidden: labelStyle === "hidden" }),
22266
22333
  /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)("div", { ...radioGroupProps, children: [
22267
22334
  /* @__PURE__ */ (0, import_jsx_runtime143.jsx)("div", { ...(0, import_runtime100.trussProps)({
22268
22335
  display: "df",
@@ -22564,7 +22631,7 @@ function RichTextFieldImpl(props) {
22564
22631
  maxWidth: "maxw_550px"
22565
22632
  } : {}
22566
22633
  }), children: [
22567
- label && /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Label, { labelProps: {}, label }),
22634
+ label && /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Label, { labelProps: {}, label, tooltip: props.tooltip }),
22568
22635
  /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("div", { className: "beam-trix-editor", children: [
22569
22636
  /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("input", { type: "hidden", id: `input-${id}`, value }),
22570
22637
  (0, import_react101.createElement)("trix-editor", {
@@ -22587,7 +22654,7 @@ function RichTextFieldImpl(props) {
22587
22654
  maxWidth: "maxw_550px"
22588
22655
  } : {}
22589
22656
  }), children: [
22590
- label && /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Label, { label }),
22657
+ label && /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(Label, { label, tooltip: props.tooltip }),
22591
22658
  /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("div", { ...(0, import_runtime101.trussProps)({
22592
22659
  minHeight: "mh_120px",
22593
22660
  backgroundColor: ["bgColor_var", {
@@ -22732,6 +22799,7 @@ function SelectCardGroup(props) {
22732
22799
  } = usePresentationContext();
22733
22800
  const {
22734
22801
  label,
22802
+ tooltip,
22735
22803
  labelStyle = fieldProps?.labelStyle ?? "above",
22736
22804
  value,
22737
22805
  options,
@@ -22760,7 +22828,7 @@ function SelectCardGroup(props) {
22760
22828
  label,
22761
22829
  isDisabled
22762
22830
  }, 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({
22831
+ 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
22832
  view,
22765
22833
  hasDescription,
22766
22834
  layout,
@@ -23095,6 +23163,7 @@ function TextAreaField(props) {
23095
23163
  preventNewLines,
23096
23164
  onEnter,
23097
23165
  maxLines,
23166
+ tooltip,
23098
23167
  ...otherProps
23099
23168
  } = props;
23100
23169
  const { effectiveValue, proposalProps } = useAiProposal(value, proposedValue);
@@ -23134,7 +23203,7 @@ function TextAreaField(props) {
23134
23203
  inputRef,
23135
23204
  inputWrapRef,
23136
23205
  textAreaMinHeight: preventNewLines ? 0 : void 0,
23137
- tooltip: resolveTooltip(disabled, void 0, readOnly),
23206
+ tooltip: resolveTooltip(disabled, tooltip, readOnly),
23138
23207
  ...proposalProps
23139
23208
  }
23140
23209
  );
@@ -23202,6 +23271,7 @@ function TextField(props) {
23202
23271
  onEnter,
23203
23272
  onEscapeBubble,
23204
23273
  hideErrorMessage,
23274
+ tooltip,
23205
23275
  ...otherProps
23206
23276
  } = props;
23207
23277
  const { effectiveValue, proposalProps } = useAiProposal(value, proposedValue);
@@ -23244,7 +23314,7 @@ function TextField(props) {
23244
23314
  labelProps,
23245
23315
  inputProps,
23246
23316
  inputRef,
23247
- tooltip: resolveTooltip(disabled, void 0, readOnly),
23317
+ tooltip: resolveTooltip(disabled, tooltip, readOnly),
23248
23318
  hideErrorMessage,
23249
23319
  ...proposalProps
23250
23320
  }
@@ -23314,6 +23384,7 @@ function ToggleChipGroup(props) {
23314
23384
  const {
23315
23385
  values,
23316
23386
  label,
23387
+ tooltip,
23317
23388
  labelStyle = fieldProps?.labelStyle ?? "above",
23318
23389
  options,
23319
23390
  required,
@@ -23342,7 +23413,7 @@ function ToggleChipGroup(props) {
23342
23413
  justifyContent: "jcsb"
23343
23414
  } : {}
23344
23415
  }), children: [
23345
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(Label, { label, ...labelProps, hidden: labelStyle === "hidden", inline: labelStyle !== "above", suffix: labelSuffix }),
23416
+ /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(Label, { label, ...labelProps, ...tid.label, hidden: labelStyle === "hidden", inline: labelStyle !== "above", suffix: labelSuffix, tooltip }),
23346
23417
  /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("div", { ...(0, import_runtime104.trussProps)({
23347
23418
  display: "df",
23348
23419
  gap: "g_1",