@homebound/beam 3.0.2 → 3.0.4

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.js CHANGED
@@ -20,8 +20,7 @@ import {
20
20
  } from "./chunk-ZPT2ZR5B.js";
21
21
 
22
22
  // src/Css.ts
23
- import { trussProps } from "@homebound/truss/runtime";
24
- import { RuntimeStyle, useRuntimeStyle } from "@homebound/truss/runtime";
23
+ import { trussProps, useRuntimeStyle as _useRuntimeStyle } from "@homebound/truss/runtime";
25
24
  var CssBuilder = class _CssBuilder {
26
25
  constructor(opts) {
27
26
  this.opts = opts;
@@ -3877,12 +3876,20 @@ var CssBuilder = class _CssBuilder {
3877
3876
  return this;
3878
3877
  }
3879
3878
  const newRules = typeof propOrStyles === "string" ? { [propOrStyles]: value } : propOrStyles;
3879
+ if (typeof propOrStyles !== "string" && newRules.$css) {
3880
+ throw new Error("add() received a Css expression \u2014 use with() to compose Css expressions");
3881
+ }
3880
3882
  const rules = this.selector ? { ...this.rules, [this.selector]: { ...this.rules[this.selector], ...newRules } } : { ...this.rules, ...newRules };
3881
3883
  return this.newCss({ rules });
3882
3884
  }
3883
- /** Inline a partial style hash, skipping any undefined values. */
3884
- addCss(props) {
3885
- return this.add(omitUndefinedValues(props));
3885
+ with(cssProp) {
3886
+ if (!this.enabled) {
3887
+ return this;
3888
+ }
3889
+ const { $css, ...rest } = cssProp;
3890
+ const filtered = omitUndefinedValues(rest);
3891
+ const rules = this.selector ? { ...this.rules, [this.selector]: { ...this.rules[this.selector], ...filtered } } : { ...this.rules, ...filtered };
3892
+ return this.newCss({ rules });
3886
3893
  }
3887
3894
  /** Marker for the build-time transform to append a raw className. */
3888
3895
  className(className) {
@@ -4016,6 +4023,16 @@ var Css = new CssBuilder({
4016
4023
  elseApplied: false,
4017
4024
  runtimeError: void 0
4018
4025
  });
4026
+ var RuntimeCss = new CssBuilder({
4027
+ rules: {},
4028
+ enabled: true,
4029
+ selector: void 0,
4030
+ elseApplied: false,
4031
+ runtimeError: void 0
4032
+ });
4033
+ function useRuntimeStyle(css2) {
4034
+ _useRuntimeStyle(css2);
4035
+ }
4019
4036
  var Breakpoints = /* @__PURE__ */ ((Breakpoints2) => {
4020
4037
  Breakpoints2["print"] = "@media print";
4021
4038
  Breakpoints2["sm"] = "@media screen and (max-width: 599px)";
@@ -4868,7 +4885,7 @@ function Chips(props) {
4868
4885
  whiteSpace: "whiteSpace_normal"
4869
4886
  },
4870
4887
  ...wrap !== false ? {
4871
- flexWrap: "flexWrap_wrap"
4888
+ flexWrap: "fww"
4872
4889
  } : {},
4873
4890
  ...xss
4874
4891
  }), children: values.map((value, i) => {
@@ -9431,7 +9448,14 @@ function OverlayTrigger(props) {
9431
9448
  isOpen: state.isOpen,
9432
9449
  onClose: state.close,
9433
9450
  placement: placement ? `bottom ${placement}` : "bottom left",
9434
- offset: showActiveBorder ? 4 : void 0
9451
+ offset: showActiveBorder ? 4 : void 0,
9452
+ // Prevents a react-aria ResizeObserver loop that prevents full scrollability in menus
9453
+ // that scroll when the trigger is inside a virtual GridTable with nested
9454
+ // scroll containers (e.g. stepper + layout + virtuoso), and the trigger is far
9455
+ // enough from the viewport edge that the calculated maxHeight differs significantly
9456
+ // This is a very specific set of circumstances that have appeared w/in blueprint
9457
+ // after we upgraded truss to v2
9458
+ maxHeight: window.visualViewport?.height ?? window.innerHeight
9435
9459
  });
9436
9460
  const tid = useTestIds(props, isTextButton(trigger) ? defaultTestId(labelOr(trigger, "overlayTrigger")) : isNavLinkButton(trigger) ? defaultTestId(trigger.navLabel) : isIconButton(trigger) ? trigger.icon : trigger.name);
9437
9461
  return (
@@ -11356,7 +11380,7 @@ function ComboBoxInput(props) {
11356
11380
  });
11357
11381
  return /* @__PURE__ */ jsx55(TextFieldBase, { ...otherProps, ...multilineProps, unfocusedPlaceholder: showChipSelection && /* @__PURE__ */ jsx55(Chips, { compact: otherProps.compact, values: chipLabels, wrap: allowWrap }), inputRef, inputWrapRef, errorMsg, contrast, xss: otherProps.labelStyle !== "inline" && !inputProps.readOnly ? {
11358
11382
  fontWeight: "fw5"
11359
- } : {}, startAdornment: showNumSelection && /* @__PURE__ */ jsx55(Tooltip, { title: /* @__PURE__ */ jsx55(SelectedOptionBullets, { labels: chipLabels }), children: /* @__PURE__ */ jsx55(CountBadge, { count: isTree ? selectedOptionsLabels?.length ?? 0 : state.selectionManager.selectedKeys.size, "data-testid": "selectedOptionsCount" }) }) || showFieldDecoration && fieldDecoration(selectedOptions[0]), endAdornment: !inputProps.readOnly && /* @__PURE__ */ jsx55("button", { ...buttonProps, disabled: inputProps.disabled, ref: buttonRef, ...trussProps38({
11383
+ } : void 0, startAdornment: showNumSelection && /* @__PURE__ */ jsx55(Tooltip, { title: /* @__PURE__ */ jsx55(SelectedOptionBullets, { labels: chipLabels }), children: /* @__PURE__ */ jsx55(CountBadge, { count: isTree ? selectedOptionsLabels?.length ?? 0 : state.selectionManager.selectedKeys.size, "data-testid": "selectedOptionsCount" }) }) || showFieldDecoration && fieldDecoration(selectedOptions[0]), endAdornment: !inputProps.readOnly && /* @__PURE__ */ jsx55("button", { ...buttonProps, disabled: inputProps.disabled, ref: buttonRef, ...trussProps38({
11360
11384
  ...{
11361
11385
  borderRadius: "br4",
11362
11386
  outline: "outline0",
@@ -21516,7 +21540,7 @@ export {
21516
21540
  RightPaneProvider,
21517
21541
  RightSidebar,
21518
21542
  Row,
21519
- RuntimeStyle,
21543
+ RuntimeCss,
21520
21544
  ScrollShadows,
21521
21545
  ScrollableContent,
21522
21546
  ScrollableParent,