@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.mjs CHANGED
@@ -16861,10 +16861,10 @@ var createSourceInfo = (event) => ({
16861
16861
  source: event ? "event" : "prop"
16862
16862
  });
16863
16863
  var parseToNumber = (val) => {
16864
- if (typeof val === "number") return val;
16864
+ if (typeof val === "number") return Number.isFinite(val) ? val : void 0;
16865
16865
  if (typeof val === "string" && val !== "") {
16866
16866
  const parsed = parseFloat(val);
16867
- if (!isNaN(parsed)) return parsed;
16867
+ if (Number.isFinite(parsed)) return parsed;
16868
16868
  }
16869
16869
  return void 0;
16870
16870
  };
@@ -17256,14 +17256,16 @@ var InputNumber = ({
17256
17256
  });
17257
17257
  const handleValueChange = React.useCallback(
17258
17258
  (values, sourceInfo) => {
17259
+ const safeFloatValue = typeof values.floatValue === "number" && Number.isFinite(values.floatValue) ? values.floatValue : void 0;
17260
+ const normalizedValues = safeFloatValue === values.floatValue ? values : { ...values, floatValue: safeFloatValue };
17259
17261
  if (sourceInfo.source === "event") {
17260
17262
  isEditingRef.current = true;
17261
17263
  setDisplayOverride(values.value);
17262
17264
  }
17263
- setNumericValue(values.floatValue);
17265
+ setNumericValue(safeFloatValue);
17264
17266
  rawRef.current = values.value;
17265
- onValueChange?.(values, sourceInfo);
17266
- if (values.floatValue !== void 0) onStepChange?.(values.floatValue);
17267
+ onValueChange?.(normalizedValues, sourceInfo);
17268
+ if (safeFloatValue !== void 0) onStepChange?.(safeFloatValue);
17267
17269
  },
17268
17270
  [onValueChange, onStepChange]
17269
17271
  );
@@ -17370,8 +17372,8 @@ var ActionButton = ({ label, onPress, disabled, className }) => {
17370
17372
  onPress();
17371
17373
  },
17372
17374
  className: cn(
17373
- "action-menu-btn flex w-full items-center justify-start px-4 py-3 text-left",
17374
- "hover:bg-sus-secondary-green-3 hover:not-disabled:text-sus-primary-green-9 text-gray-800",
17375
+ "action-menu-btn flex w-full items-center justify-start rounded-sm px-2 py-1.5 text-left text-sm",
17376
+ "cursor-pointer text-gray-800 hover:bg-[#DDE8E2]",
17375
17377
  isDisabled && "cursor-not-allowed opacity-50 hover:bg-transparent text-gray-400",
17376
17378
  className
17377
17379
  ),
@@ -17416,14 +17418,14 @@ var ActionMenu = ({
17416
17418
  e.stopPropagation();
17417
17419
  setOpen((prev) => !prev);
17418
17420
  },
17419
- children: triggerButtonIcon ? triggerButtonIcon : /* @__PURE__ */ jsx(MoreVertical, { className: "w-5 h-5 text-gray-600" })
17421
+ children: triggerButtonIcon ? triggerButtonIcon : /* @__PURE__ */ jsx(MoreVertical, { className: "h-4 w-4 text-gray-600" })
17420
17422
  }
17421
17423
  ) }),
17422
17424
  /* @__PURE__ */ jsxs(
17423
17425
  PopoverContent,
17424
17426
  {
17425
17427
  className: cn(
17426
- "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)]",
17428
+ "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)]",
17427
17429
  actionMenuClassName
17428
17430
  ),
17429
17431
  align: "end",