@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.d.cts CHANGED
@@ -825,7 +825,7 @@ interface SlideToConfirmProps extends Omit<React$1.ComponentProps<"div">, "onDra
825
825
  declare function SlideToConfirm({ onConfirm, label, confirmedLabel, disabled, confirmed: controlledConfirmed, className, ...props }: SlideToConfirmProps): react_jsx_runtime.JSX.Element;
826
826
 
827
827
  interface StepperProps {
828
- /** Uppercase label above the amount, e.g. "Stake (USDT)". */
828
+ /** Sentence-case caption above the amount, e.g. "Stake (USDT)". */
829
829
  label?: React$1.ReactNode;
830
830
  value?: number;
831
831
  defaultValue?: number;
package/dist/index.d.ts CHANGED
@@ -825,7 +825,7 @@ interface SlideToConfirmProps extends Omit<React$1.ComponentProps<"div">, "onDra
825
825
  declare function SlideToConfirm({ onConfirm, label, confirmedLabel, disabled, confirmed: controlledConfirmed, className, ...props }: SlideToConfirmProps): react_jsx_runtime.JSX.Element;
826
826
 
827
827
  interface StepperProps {
828
- /** Uppercase label above the amount, e.g. "Stake (USDT)". */
828
+ /** Sentence-case caption above the amount, e.g. "Stake (USDT)". */
829
829
  label?: React$1.ReactNode;
830
830
  value?: number;
831
831
  defaultValue?: number;
package/dist/index.js CHANGED
@@ -7033,11 +7033,18 @@ function Stepper({
7033
7033
  }
7034
7034
  }, [currentValue, decimalPlaces, isFocused]);
7035
7035
  function commit(next) {
7036
- const clamped = clamp(next, min, max);
7037
- const rounded = decimalPlaces > 0 ? parseFloat(clamped.toFixed(decimalPlaces)) : Math.round(clamped);
7038
- if (!isControlled) setInternalValue(rounded);
7039
- setDisplayString(formatValue(rounded, decimalPlaces));
7040
- onValueChange == null ? void 0 : onValueChange(rounded);
7036
+ let committed;
7037
+ if (next <= min) {
7038
+ committed = min;
7039
+ } else if (next >= max) {
7040
+ committed = max;
7041
+ } else {
7042
+ const rounded = decimalPlaces > 0 ? parseFloat(next.toFixed(decimalPlaces)) : Math.round(next);
7043
+ committed = clamp(rounded, min, max);
7044
+ }
7045
+ if (!isControlled) setInternalValue(committed);
7046
+ setDisplayString(formatValue(committed, decimalPlaces));
7047
+ onValueChange == null ? void 0 : onValueChange(committed);
7041
7048
  }
7042
7049
  function handleDecrement() {
7043
7050
  commit(currentValue - step);