@sustaina/shared-ui 1.64.0 → 1.64.2

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
@@ -16904,10 +16904,10 @@ var createSourceInfo = (event) => ({
16904
16904
  source: event ? "event" : "prop"
16905
16905
  });
16906
16906
  var parseToNumber = (val) => {
16907
- if (typeof val === "number") return val;
16907
+ if (typeof val === "number") return Number.isFinite(val) ? val : void 0;
16908
16908
  if (typeof val === "string" && val !== "") {
16909
16909
  const parsed = parseFloat(val);
16910
- if (!isNaN(parsed)) return parsed;
16910
+ if (Number.isFinite(parsed)) return parsed;
16911
16911
  }
16912
16912
  return void 0;
16913
16913
  };
@@ -17299,14 +17299,16 @@ var InputNumber = ({
17299
17299
  });
17300
17300
  const handleValueChange = React__namespace.useCallback(
17301
17301
  (values, sourceInfo) => {
17302
+ const safeFloatValue = typeof values.floatValue === "number" && Number.isFinite(values.floatValue) ? values.floatValue : void 0;
17303
+ const normalizedValues = safeFloatValue === values.floatValue ? values : { ...values, floatValue: safeFloatValue };
17302
17304
  if (sourceInfo.source === "event") {
17303
17305
  isEditingRef.current = true;
17304
17306
  setDisplayOverride(values.value);
17305
17307
  }
17306
- setNumericValue(values.floatValue);
17308
+ setNumericValue(safeFloatValue);
17307
17309
  rawRef.current = values.value;
17308
- onValueChange?.(values, sourceInfo);
17309
- if (values.floatValue !== void 0) onStepChange?.(values.floatValue);
17310
+ onValueChange?.(normalizedValues, sourceInfo);
17311
+ if (safeFloatValue !== void 0) onStepChange?.(safeFloatValue);
17310
17312
  },
17311
17313
  [onValueChange, onStepChange]
17312
17314
  );
@@ -17413,8 +17415,8 @@ var ActionButton = ({ label, onPress, disabled, className }) => {
17413
17415
  onPress();
17414
17416
  },
17415
17417
  className: cn(
17416
- "action-menu-btn flex w-full items-center justify-start px-4 py-3 text-left",
17417
- "hover:bg-sus-secondary-green-3 hover:not-disabled:text-sus-primary-green-9 text-gray-800",
17418
+ "action-menu-btn flex w-full items-center justify-start rounded-sm px-2 py-1.5 text-left text-sm",
17419
+ "cursor-pointer text-gray-800 hover:bg-[#DDE8E2]",
17418
17420
  isDisabled && "cursor-not-allowed opacity-50 hover:bg-transparent text-gray-400",
17419
17421
  className
17420
17422
  ),
@@ -17459,14 +17461,14 @@ var ActionMenu = ({
17459
17461
  e.stopPropagation();
17460
17462
  setOpen((prev) => !prev);
17461
17463
  },
17462
- children: triggerButtonIcon ? triggerButtonIcon : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreVertical, { className: "w-5 h-5 text-gray-600" })
17464
+ children: triggerButtonIcon ? triggerButtonIcon : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreVertical, { className: "h-4 w-4 text-gray-600" })
17463
17465
  }
17464
17466
  ) }),
17465
17467
  /* @__PURE__ */ jsxRuntime.jsxs(
17466
17468
  PopoverContent,
17467
17469
  {
17468
17470
  className: cn(
17469
- "w-48 p-0 space-y-1 bg-sus-secondary-gray-2 border-none rounded-md overflow-hidden drop-shadow-[2px_0px_4px_rgba(0,0,0,0.1)]",
17471
+ "w-fit min-w-[10.5rem] p-1 bg-sus-secondary-gray-2 border-none rounded-md overflow-hidden drop-shadow-[2px_0px_4px_rgba(0,0,0,0.1)]",
17470
17472
  actionMenuClassName
17471
17473
  ),
17472
17474
  align: "end",