UNPKG

@kubit-ui-web/react-components

Version:

Kubit React Components is a customizable, accessible library of React web components, designed to enhance your application's user experience

22 lines 883 B
import { translateValue } from '../../../utils/translateValue/translateValue'; const FIRST_QUARTER = 25; const SECOND_QUARTER = 50; const THIRD_QUARTER = 75; const MAX = 100; const getBarMeasure = (percentage, inputMin, inputMax) => { if (percentage > inputMax) { return MAX; } return translateValue({ inputMin, inputMax, outputMin: 0, outputMax: MAX, value: percentage, }); }; export const getTopBarWith = (percentage) => getBarMeasure(percentage, 0, FIRST_QUARTER); export const getRightBarHeight = (percentage) => getBarMeasure(percentage, FIRST_QUARTER, SECOND_QUARTER); export const getBottomBarWith = (percentage) => getBarMeasure(percentage, SECOND_QUARTER, THIRD_QUARTER); export const getLeftBarHeight = (percentage) => getBarMeasure(percentage, THIRD_QUARTER, MAX); //# sourceMappingURL=animation.utils.js.map