UNPKG

@adaptui/react

Version:

Collection of headless components/hooks that are accessible, composable, customizable from low level to build your own UI & Design System powered by Reakit

25 lines (21 loc) 569 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.clamp = clamp; exports.valueToPercent = valueToPercent; function clamp(value, min, max) { if (value == null) return null; return Math.min(Math.max(value, min), max); } /** * Convert a value to percentage based on lower and upper bound values * * @param value the value in number * @param min the minimum value * @param max the maximum value */ function valueToPercent(value, min, max) { return (value - min) * 100 / (max - min); } //# sourceMappingURL=__utils.js.map