@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.cjs CHANGED
@@ -4467,7 +4467,16 @@ function Tooltip(props) {
4467
4467
  ] });
4468
4468
  }
4469
4469
  function Popper(props) {
4470
- const { triggerRef, content, placement = "auto", xss, bgColor = "rgba(36, 36, 36, 1)" /* Gray900 */, onMouseEnter, onMouseLeave } = props;
4470
+ const {
4471
+ triggerRef,
4472
+ content,
4473
+ placement = "auto",
4474
+ xss,
4475
+ bgColor = "rgba(36, 36, 36, 1)" /* Gray900 */,
4476
+ onMouseEnter,
4477
+ onMouseLeave,
4478
+ ...ariaProps
4479
+ } = props;
4471
4480
  const popperRef = (0, import_react3.useRef)(null);
4472
4481
  const [arrowRef, setArrowRef] = (0, import_react3.useState)(null);
4473
4482
  const targetElement = triggerRef.current ? triggerRef.current.children[0] ?? triggerRef.current.parentElement : null;
@@ -4485,6 +4494,7 @@ function Popper(props) {
4485
4494
  ref: popperRef,
4486
4495
  style: styles.popper,
4487
4496
  ...attributes.popper,
4497
+ ...ariaProps,
4488
4498
  onMouseEnter,
4489
4499
  onMouseLeave,
4490
4500
  css: {
@@ -12028,6 +12038,14 @@ function NumberField(props) {
12028
12038
  }, [type, numberFormatOptions, defaultFormatOptions, numFractionDigits]);
12029
12039
  const numberParser = (0, import_react57.useMemo)(() => new import_number.NumberParser(locale, formatOptions), [locale, formatOptions]);
12030
12040
  const valueRef = (0, import_react57.useRef)({ wip: false });
12041
+ const lastSentRef = (0, import_react57.useRef)(void 0);
12042
+ const propValue = value === void 0 ? Number.NaN : value / factor;
12043
+ if (valueRef.current.wip && !Object.is(valueRef.current.value, propValue)) {
12044
+ const lastSentInternal = lastSentRef.current === void 0 ? Number.NaN : lastSentRef.current / factor;
12045
+ if (!Object.is(propValue, lastSentInternal)) {
12046
+ valueRef.current.value = propValue;
12047
+ }
12048
+ }
12031
12049
  const useProps = {
12032
12050
  locale,
12033
12051
  // We want percents && cents to be integers, useNumberFieldState excepts them as decimals
@@ -12038,9 +12056,11 @@ function NumberField(props) {
12038
12056
  },
12039
12057
  onFocus: () => {
12040
12058
  valueRef.current = { wip: true, value: value === void 0 ? Number.NaN : value / factor };
12059
+ lastSentRef.current = value;
12041
12060
  },
12042
12061
  onBlur: () => {
12043
12062
  valueRef.current = { wip: false };
12063
+ lastSentRef.current = void 0;
12044
12064
  },
12045
12065
  onKeyDown: (e) => {
12046
12066
  if (e.key === "Enter") {
@@ -12074,7 +12094,9 @@ function NumberField(props) {
12074
12094
  }),
12075
12095
  onChange: (rawInputValue) => {
12076
12096
  const parsedValue = numberParser.parse(rawInputValue || "");
12077
- onChange(formatValue(parsedValue, factor, numFractionDigits, numIntegerDigits, positiveOnly));
12097
+ const formatted = formatValue(parsedValue, factor, numFractionDigits, numIntegerDigits, positiveOnly);
12098
+ lastSentRef.current = formatted;
12099
+ onChange(formatted);
12078
12100
  },
12079
12101
  inputRef,
12080
12102
  onBlur,
@@ -14724,7 +14746,7 @@ function Modal(props) {
14724
14746
  onClose: closeModal,
14725
14747
  isDismissable: true,
14726
14748
  shouldCloseOnInteractOutside: (el) => {
14727
- return allowClosing && !(el.closest(".tribute-container") || el.closest("[role='dialog']") || el.closest("[role='alert']"));
14749
+ return allowClosing && !(el.closest(".tribute-container") || el.closest("[role='dialog']") || el.closest("[role='alert']") || el.closest("[role='tooltip']"));
14728
14750
  }
14729
14751
  },
14730
14752
  ref