revdev-components 0.248.0 → 0.251.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { LevelGen } from "src/interfaces";
|
|
3
|
+
export interface LevelLetterBadgeProps {
|
|
4
|
+
value: LevelGen | LevelGen[] | string;
|
|
5
|
+
className?: string;
|
|
6
|
+
activeCode?: string;
|
|
7
|
+
title?: (param: LevelGen) => string;
|
|
8
|
+
}
|
|
9
|
+
export declare const LevelLetterBadge: React.FC<LevelLetterBadgeProps>;
|
package/build/index.js
CHANGED
|
@@ -6082,13 +6082,13 @@ var s$4 = {"root":"index-module_root__W7fFh","bar":"index-module_bar__V-ymE","ba
|
|
|
6082
6082
|
var LevelBadge = function (_a) {
|
|
6083
6083
|
var levels = _a.levels, className = _a.className, texts = _a.texts, children = _a.children, activeCode = _a.activeCode;
|
|
6084
6084
|
var bars = React.useMemo(function () {
|
|
6085
|
-
var maxRate = Math.max.apply(Math, levels.map(function (x) { return x.rate; }));
|
|
6086
|
-
return levels.map(function (x) { return [x.code.toUpperCase(), x.rate, x.rate / maxRate]; });
|
|
6085
|
+
var maxRate = Math.max.apply(Math, levels.map(function (x) { return x.rate || 0; }));
|
|
6086
|
+
return levels.map(function (x) { return [x.code.toUpperCase(), x.rate || 0, (x.rate || 0) / maxRate]; });
|
|
6087
6087
|
}, [levels]);
|
|
6088
6088
|
var interText = React.useMemo(function () {
|
|
6089
6089
|
var _a;
|
|
6090
6090
|
return {
|
|
6091
|
-
refersTo: (_a = texts === null || texts === void 0 ? void 0 : texts.refersTo) !== null && _a !== void 0 ? _a : (function (level) { return "Level ".concat(level.code, " at ").concat(numeral(level.rate).format("0%")); }),
|
|
6091
|
+
refersTo: (_a = texts === null || texts === void 0 ? void 0 : texts.refersTo) !== null && _a !== void 0 ? _a : (function (level) { return "Level ".concat(level.code, " at ").concat(numeral(level.rate || 0).format("0%")); }),
|
|
6092
6092
|
};
|
|
6093
6093
|
}, [texts]);
|
|
6094
6094
|
if (bars.length === 0) {
|
|
@@ -6112,13 +6112,13 @@ var s$3 = {"root":"index-module_root__rwG0M","level":"index-module_level__CNNnB"
|
|
|
6112
6112
|
var LevelBarBadge = function (_a) {
|
|
6113
6113
|
var levels = _a.levels, className = _a.className, texts = _a.texts, children = _a.children;
|
|
6114
6114
|
var bars = React.useMemo(function () {
|
|
6115
|
-
var maxRate = Math.max.apply(Math, levels.map(function (x) { return x.rate; }));
|
|
6116
|
-
return levels.map(function (x) { return [x.code.toUpperCase(), x.rate, x.rate / maxRate]; });
|
|
6115
|
+
var maxRate = Math.max.apply(Math, levels.map(function (x) { return x.rate || 0; }));
|
|
6116
|
+
return levels.map(function (x) { return [x.code.toUpperCase(), x.rate || 0, (x.rate || 0) / maxRate]; });
|
|
6117
6117
|
}, [levels]);
|
|
6118
6118
|
var interText = React.useMemo(function () {
|
|
6119
6119
|
var _a;
|
|
6120
6120
|
return {
|
|
6121
|
-
refersTo: (_a = texts === null || texts === void 0 ? void 0 : texts.refersTo) !== null && _a !== void 0 ? _a : (function (level) { return "Level ".concat(level.code, " at ").concat(numeral(level.rate).format("0%")); }),
|
|
6121
|
+
refersTo: (_a = texts === null || texts === void 0 ? void 0 : texts.refersTo) !== null && _a !== void 0 ? _a : (function (level) { return "Level ".concat(level.code, " at ").concat(numeral(level.rate || 0).format("0%")); }),
|
|
6122
6122
|
};
|
|
6123
6123
|
}, [texts]);
|
|
6124
6124
|
if (bars.length === 0) {
|
package/build/styles.css
CHANGED
|
@@ -40,6 +40,9 @@
|
|
|
40
40
|
--levelBadgeRateColor: #555;
|
|
41
41
|
--levelBarBadgeBarColor: var(--passiveColor);
|
|
42
42
|
--levelBarBadgeBackgroundColor: rgb(15, 23, 42, 5.5%);
|
|
43
|
+
--levelLetterBadgeActiveBackgroundColor: rgb(15, 23, 42, 14%);
|
|
44
|
+
--levelLetterBadgeActiveTextColor: var(--color);
|
|
45
|
+
--levelLetterBadgeActiveBorderColor: color-mix(in srgb, var(--borderColor) 35%, var(--color));
|
|
43
46
|
--rowContentFontSize: 14px;
|
|
44
47
|
--rowContentTitleFontSize: 20px;
|
|
45
48
|
}
|