@homebound/beam 2.415.3 → 2.415.5

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
@@ -4090,7 +4090,16 @@ function Tooltip(props) {
4090
4090
  ] });
4091
4091
  }
4092
4092
  function Popper(props) {
4093
- const { triggerRef, content, placement = "auto", xss, bgColor = "rgba(36, 36, 36, 1)" /* Gray900 */, onMouseEnter, onMouseLeave } = props;
4093
+ const {
4094
+ triggerRef,
4095
+ content,
4096
+ placement = "auto",
4097
+ xss,
4098
+ bgColor = "rgba(36, 36, 36, 1)" /* Gray900 */,
4099
+ onMouseEnter,
4100
+ onMouseLeave,
4101
+ ...ariaProps
4102
+ } = props;
4094
4103
  const popperRef = useRef2(null);
4095
4104
  const [arrowRef, setArrowRef] = useState2(null);
4096
4105
  const targetElement = triggerRef.current ? triggerRef.current.children[0] ?? triggerRef.current.parentElement : null;
@@ -4108,6 +4117,7 @@ function Popper(props) {
4108
4117
  ref: popperRef,
4109
4118
  style: styles.popper,
4110
4119
  ...attributes.popper,
4120
+ ...ariaProps,
4111
4121
  onMouseEnter,
4112
4122
  onMouseLeave,
4113
4123
  css: {
@@ -11669,6 +11679,14 @@ function NumberField(props) {
11669
11679
  }, [type, numberFormatOptions, defaultFormatOptions, numFractionDigits]);
11670
11680
  const numberParser = useMemo18(() => new NumberParser(locale, formatOptions), [locale, formatOptions]);
11671
11681
  const valueRef = useRef29({ wip: false });
11682
+ const lastSentRef = useRef29(void 0);
11683
+ const propValue = value === void 0 ? Number.NaN : value / factor;
11684
+ if (valueRef.current.wip && !Object.is(valueRef.current.value, propValue)) {
11685
+ const lastSentInternal = lastSentRef.current === void 0 ? Number.NaN : lastSentRef.current / factor;
11686
+ if (!Object.is(propValue, lastSentInternal)) {
11687
+ valueRef.current.value = propValue;
11688
+ }
11689
+ }
11672
11690
  const useProps = {
11673
11691
  locale,
11674
11692
  // We want percents && cents to be integers, useNumberFieldState excepts them as decimals
@@ -11679,9 +11697,11 @@ function NumberField(props) {
11679
11697
  },
11680
11698
  onFocus: () => {
11681
11699
  valueRef.current = { wip: true, value: value === void 0 ? Number.NaN : value / factor };
11700
+ lastSentRef.current = value;
11682
11701
  },
11683
11702
  onBlur: () => {
11684
11703
  valueRef.current = { wip: false };
11704
+ lastSentRef.current = void 0;
11685
11705
  },
11686
11706
  onKeyDown: (e) => {
11687
11707
  if (e.key === "Enter") {
@@ -11715,7 +11735,9 @@ function NumberField(props) {
11715
11735
  }),
11716
11736
  onChange: (rawInputValue) => {
11717
11737
  const parsedValue = numberParser.parse(rawInputValue || "");
11718
- onChange(formatValue(parsedValue, factor, numFractionDigits, numIntegerDigits, positiveOnly));
11738
+ const formatted = formatValue(parsedValue, factor, numFractionDigits, numIntegerDigits, positiveOnly);
11739
+ lastSentRef.current = formatted;
11740
+ onChange(formatted);
11719
11741
  },
11720
11742
  inputRef,
11721
11743
  onBlur,
@@ -14365,7 +14387,7 @@ function Modal(props) {
14365
14387
  onClose: closeModal,
14366
14388
  isDismissable: true,
14367
14389
  shouldCloseOnInteractOutside: (el) => {
14368
- return allowClosing && !(el.closest(".tribute-container") || el.closest("[role='dialog']") || el.closest("[role='alert']"));
14390
+ return allowClosing && !(el.closest(".tribute-container") || el.closest("[role='dialog']") || el.closest("[role='alert']") || el.closest("[role='tooltip']"));
14369
14391
  }
14370
14392
  },
14371
14393
  ref