UNPKG

@base-ui-components/react

Version:

Base UI is a library of headless ('unstyled') React components and low-level hooks. You gain complete control over your app's CSS and accessibility features.

9 lines 329 B
import { clamp } from "../../utils/clamp.js"; import { valueToPercent } from "../../utils/valueToPercent.js"; export function valueArrayToPercentages(values, min, max) { const output = []; for (let i = 0; i < values.length; i += 1) { output.push(clamp(valueToPercent(values[i], min, max), 0, 100)); } return output; }