@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 +12 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +12 -5
- package/dist/index.js.map +1 -1
- package/docs/components/stepper.md +9 -6
- package/docs/foundations/typography.md +12 -0
- package/package.json +1 -1
- package/src/styles.css +7 -7
package/dist/index.cjs
CHANGED
|
@@ -7350,11 +7350,18 @@ function Stepper({
|
|
|
7350
7350
|
}
|
|
7351
7351
|
}, [currentValue, decimalPlaces, isFocused]);
|
|
7352
7352
|
function commit(next) {
|
|
7353
|
-
|
|
7354
|
-
|
|
7355
|
-
|
|
7356
|
-
|
|
7357
|
-
|
|
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);
|