@trading-game/design-intelligence-layer 1.0.6 → 1.0.7

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
@@ -7350,11 +7350,18 @@ function Stepper({
7350
7350
  }
7351
7351
  }, [currentValue, decimalPlaces, isFocused]);
7352
7352
  function commit(next) {
7353
- const clamped = clamp(next, min, max);
7354
- const rounded = decimalPlaces > 0 ? parseFloat(clamped.toFixed(decimalPlaces)) : Math.round(clamped);
7355
- if (!isControlled) setInternalValue(rounded);
7356
- setDisplayString(formatValue(rounded, decimalPlaces));
7357
- onValueChange == null ? void 0 : onValueChange(rounded);
7353
+ let committed;
7354
+ if (next <= min) {
7355
+ committed = min;
7356
+ } else if (next >= max) {
7357
+ committed = max;
7358
+ } else {
7359
+ const rounded = decimalPlaces > 0 ? parseFloat(next.toFixed(decimalPlaces)) : Math.round(next);
7360
+ committed = clamp(rounded, min, max);
7361
+ }
7362
+ if (!isControlled) setInternalValue(committed);
7363
+ setDisplayString(formatValue(committed, decimalPlaces));
7364
+ onValueChange == null ? void 0 : onValueChange(committed);
7358
7365
  }
7359
7366
  function handleDecrement() {
7360
7367
  commit(currentValue - step);