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

16 lines (15 loc) 437 B
export 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 */ export function valueToPercent(value, min, max) { return (value - min) * 100 / (max - min); } //# sourceMappingURL=__utils.js.map