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

29 lines 1.25 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getLeftBarHeight = exports.getBottomBarWith = exports.getRightBarHeight = exports.getTopBarWith = void 0; const translateValue_1 = require("../../../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 (0, translateValue_1.translateValue)({ inputMin, inputMax, outputMin: 0, outputMax: MAX, value: percentage, }); }; const getTopBarWith = (percentage) => getBarMeasure(percentage, 0, FIRST_QUARTER); exports.getTopBarWith = getTopBarWith; const getRightBarHeight = (percentage) => getBarMeasure(percentage, FIRST_QUARTER, SECOND_QUARTER); exports.getRightBarHeight = getRightBarHeight; const getBottomBarWith = (percentage) => getBarMeasure(percentage, SECOND_QUARTER, THIRD_QUARTER); exports.getBottomBarWith = getBottomBarWith; const getLeftBarHeight = (percentage) => getBarMeasure(percentage, THIRD_QUARTER, MAX); exports.getLeftBarHeight = getLeftBarHeight; //# sourceMappingURL=animation.utils.js.map