UNPKG

@gravity-ui/uikit

Version:

Gravity UI base styling and components

17 lines (16 loc) 899 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ProgressWithValue = ProgressWithValue; const jsx_runtime_1 = require("react/jsx-runtime"); const ProgressInnerText_1 = require("./ProgressInnerText.js"); const constants_1 = require("./constants.js"); const utils_1 = require("./utils.js"); function ProgressWithValue(props) { const { value, loading, text } = props; const offset = (0, utils_1.getOffset)(value); if (!Number.isFinite(value)) { return null; } return ((0, jsx_runtime_1.jsx)("div", { className: (0, constants_1.progressBlock)('item', { theme: (0, utils_1.getTheme)(props), loading }), style: { transform: `translateX(calc(var(--g-flow-direction) * ${offset}%))` }, children: (0, jsx_runtime_1.jsx)(ProgressInnerText_1.ProgressInnerText, { offset: offset, text: text }) })); } //# sourceMappingURL=ProgressWithValue.js.map