revdev-components 0.204.0 → 0.205.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.
- package/build/badges/level/index.d.ts +0 -1
- package/build/index.js +8 -12
- package/build/styles.css +14 -39
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -5809,15 +5809,14 @@ var HelpTip = function (_a) {
|
|
|
5809
5809
|
return (React.createElement(AppTooltip, { title: title || children, placement: "top" }, href ? (React.createElement(AppLink, { href: href, target: target }, iconNode)) : (iconNode)));
|
|
5810
5810
|
};
|
|
5811
5811
|
|
|
5812
|
-
var s = {"root":"index-module_root__W7fFh","
|
|
5812
|
+
var s = {"root":"index-module_root__W7fFh","bar":"index-module_bar__V-ymE","rate":"index-module_rate__A2rzm","code":"index-module_code__aAnic"};
|
|
5813
5813
|
|
|
5814
5814
|
var LevelBadge = function (_a) {
|
|
5815
|
-
var
|
|
5816
|
-
var levels = _a.levels, className = _a.className, texts = _a.texts, children = _a.children, _c = _a.mode, mode = _c === void 0 ? "default" : _c;
|
|
5815
|
+
var levels = _a.levels, className = _a.className, texts = _a.texts, children = _a.children;
|
|
5817
5816
|
var bars = React.useMemo(function () {
|
|
5818
5817
|
var maxRate = Math.max.apply(Math, levels.map(function (x) { return x.rate; }));
|
|
5819
5818
|
return levels.map(function (x) { return [x.code.toUpperCase(), x.rate, x.rate / maxRate]; });
|
|
5820
|
-
}, [levels
|
|
5819
|
+
}, [levels]);
|
|
5821
5820
|
var interText = React.useMemo(function () {
|
|
5822
5821
|
var _a;
|
|
5823
5822
|
return {
|
|
@@ -5827,17 +5826,14 @@ var LevelBadge = function (_a) {
|
|
|
5827
5826
|
if (bars.length === 0) {
|
|
5828
5827
|
return null;
|
|
5829
5828
|
}
|
|
5830
|
-
return (React.createElement("div", { className: classNames(s.root,
|
|
5829
|
+
return (React.createElement("div", { className: classNames(s.root, className) },
|
|
5831
5830
|
bars.map(function (_a) {
|
|
5832
5831
|
var code = _a[0], rate = _a[1], normalizedRate = _a[2];
|
|
5833
5832
|
return (React.createElement(AppTooltip, { key: code, title: interText.refersTo({ code: code, rate: rate }), placement: "top" },
|
|
5834
|
-
React.createElement("div", {
|
|
5835
|
-
React.createElement("div", { className: s.
|
|
5836
|
-
React.createElement("div", { className: s.
|
|
5837
|
-
|
|
5838
|
-
mode === "compact" ? (React.createElement("div", { className: s.code },
|
|
5839
|
-
React.createElement("span", null, code))) : null),
|
|
5840
|
-
mode === "default" && React.createElement("div", { className: s.label }, code))));
|
|
5833
|
+
React.createElement("div", { className: s.bar },
|
|
5834
|
+
React.createElement("div", { className: s.rate, style: { height: "".concat(normalizedRate * 100, "%") } },
|
|
5835
|
+
React.createElement("div", { className: s.code }, code)),
|
|
5836
|
+
React.createElement("div", { className: s.code }, code))));
|
|
5841
5837
|
}),
|
|
5842
5838
|
children));
|
|
5843
5839
|
};
|
package/build/styles.css
CHANGED
|
@@ -36,10 +36,8 @@
|
|
|
36
36
|
--iconDropBackgroundColor: white;
|
|
37
37
|
--helpTipMargin: none;
|
|
38
38
|
--helpTipFontSize: 0.8em;
|
|
39
|
-
--
|
|
40
|
-
--
|
|
41
|
-
--levelBadgeFrontColor: white;
|
|
42
|
-
--levelBadgeBackColor: #111;
|
|
39
|
+
--levelBadgeColor: #e4e4e4;
|
|
40
|
+
--levelBadgeRateColor: #555;
|
|
43
41
|
}
|
|
44
42
|
|
|
45
43
|
html,
|
|
@@ -673,56 +671,33 @@ body {
|
|
|
673
671
|
}
|
|
674
672
|
.index-module_root__W7fFh {
|
|
675
673
|
display: flex;
|
|
676
|
-
flex-
|
|
677
|
-
|
|
678
|
-
gap: 0.3em;
|
|
674
|
+
flex-flow: row nowrap;
|
|
675
|
+
gap: 0.2em;
|
|
679
676
|
color: var(--levelBadgeColor);
|
|
680
677
|
}
|
|
681
|
-
.index-module_root__default__cjtzX {
|
|
682
|
-
width: auto;
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
.index-module_level__J8dSJ {
|
|
686
|
-
display: flex;
|
|
687
|
-
flex-direction: column;
|
|
688
|
-
position: relative;
|
|
689
|
-
}
|
|
690
678
|
|
|
691
679
|
.index-module_bar__V-ymE {
|
|
692
|
-
height: 1.2em;
|
|
693
|
-
width: 1.4em;
|
|
694
680
|
display: flex;
|
|
695
|
-
align-items: flex-end;
|
|
696
681
|
justify-content: center;
|
|
682
|
+
align-items: center;
|
|
683
|
+
height: 1em;
|
|
684
|
+
width: 1.2em;
|
|
697
685
|
position: relative;
|
|
698
|
-
|
|
699
|
-
color: var(--levelBadgeBackColor);
|
|
700
|
-
z-index: 0;
|
|
686
|
+
line-height: 1em;
|
|
701
687
|
}
|
|
702
688
|
|
|
703
|
-
.index-
|
|
704
|
-
|
|
705
|
-
background-color: var(--levelBadgeColor);
|
|
706
|
-
position: relative;
|
|
707
|
-
overflow: hidden;
|
|
689
|
+
.index-module_rate__A2rzm {
|
|
690
|
+
position: absolute;
|
|
708
691
|
left: 0;
|
|
709
692
|
bottom: 0;
|
|
693
|
+
width: 100%;
|
|
694
|
+
overflow: hidden;
|
|
710
695
|
z-index: 1;
|
|
711
|
-
|
|
712
|
-
.index-module_bar__rate__w6r3z .index-module_code__aAnic {
|
|
713
|
-
color: var(--levelBadgeFrontColor);
|
|
714
|
-
z-index: 2;
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
.index-module_label__gftYy {
|
|
718
|
-
padding: 1px 0;
|
|
719
|
-
text-align: center;
|
|
720
|
-
}
|
|
721
|
-
.index-module_label__compact__-5Wt0 {
|
|
722
|
-
display: none;
|
|
696
|
+
color: var(--levelBadgeRateColor);
|
|
723
697
|
}
|
|
724
698
|
|
|
725
699
|
.index-module_code__aAnic {
|
|
700
|
+
z-index: 0;
|
|
726
701
|
position: absolute;
|
|
727
702
|
bottom: 0;
|
|
728
703
|
left: 50%;
|