UNPKG

@wix/design-system

Version:

@wix/design-system

24 lines (23 loc) 959 B
"use strict"; exports.__esModule = true; exports.getStarSizePx = exports.getRatingLabel = void 0; var _constants = require("../constants"); var getRatingLabel = (_ref, starValue) => { var _labelValues; var labelValues = _ref.labelValues; return (_labelValues = labelValues == null ? void 0 : labelValues[starValue - 1]) !== null && _labelValues !== void 0 ? _labelValues : String(starValue); }; exports.getRatingLabel = getRatingLabel; var getStarSizePx = _ref2 => { var readOnly = _ref2.readOnly, size = _ref2.size; var resolvedSize; if (readOnly) { resolvedSize = size !== null && size !== void 0 ? size : _constants.starRatingBarSizes.medium; } else { resolvedSize = size === _constants.starRatingBarSizes.medium ? _constants.starRatingBarSizes.medium : _constants.starRatingBarSizes.large; } return _constants.starRatingBarSizesInPx[resolvedSize]; }; exports.getStarSizePx = getStarSizePx; //# sourceMappingURL=common.js.map