revdev-components 0.286.0 → 0.287.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.
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { LevelGen } from "src/interfaces";
3
3
  export interface LevelBadgeProps {
4
- levels: LevelGen[];
4
+ value: LevelGen[];
5
5
  className?: string;
6
6
  children?: React.ReactNode;
7
7
  activeCode?: string;
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { LevelGen } from "src/interfaces";
3
3
  export interface LevelBarBadgeProps {
4
- levels: LevelGen[];
4
+ value: LevelGen[];
5
5
  className?: string;
6
6
  children?: React.ReactNode;
7
7
  texts?: {
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { LevelGen } from "src/interfaces";
3
3
  export interface LevelLetterBadgeProps {
4
- levels?: LevelGen | LevelGen[] | string;
4
+ value?: LevelGen | LevelGen[] | string;
5
5
  showRate?: boolean;
6
6
  showIndicator?: boolean;
7
7
  className?: string;
package/build/index.js CHANGED
@@ -6203,7 +6203,7 @@ var HelpTip = function (_a) {
6203
6203
  var s$8 = {"root":"index-module_root__W7fFh","bar":"index-module_bar__V-ymE","bar__active":"index-module_bar__active__-BwOz","rate":"index-module_rate__A2rzm","code":"index-module_code__aAnic"};
6204
6204
 
6205
6205
  var LevelBadge = function (_a) {
6206
- var levels = _a.levels, className = _a.className, texts = _a.texts, children = _a.children, activeCode = _a.activeCode;
6206
+ var levels = _a.value, className = _a.className, texts = _a.texts, children = _a.children, activeCode = _a.activeCode;
6207
6207
  var bars = React.useMemo(function () {
6208
6208
  var maxRate = Math.max.apply(Math, levels.map(function (x) { return x.rate || 0; }));
6209
6209
  return levels.map(function (x) { return [x.code.toUpperCase(), x.rate || 0, (x.rate || 0) / maxRate]; });
@@ -6233,7 +6233,7 @@ var LevelBadge = function (_a) {
6233
6233
  var s$7 = {"root":"index-module_root__rwG0M","level":"index-module_level__CNNnB","bar":"index-module_bar__cfjpr","bar__rate":"index-module_bar__rate__YLDa7","code":"index-module_code__1BHcb"};
6234
6234
 
6235
6235
  var LevelBarBadge = function (_a) {
6236
- var levels = _a.levels, className = _a.className, texts = _a.texts, children = _a.children, href = _a.href;
6236
+ var levels = _a.value, className = _a.className, texts = _a.texts, children = _a.children, href = _a.href;
6237
6237
  var bars = React.useMemo(function () {
6238
6238
  var maxRate = Math.max.apply(Math, levels.map(function (x) { return x.rate || 0; }));
6239
6239
  return levels.map(function (x) { return [x.code.toUpperCase(), x.rate || 0, (x.rate || 0) / maxRate]; });
@@ -6263,7 +6263,7 @@ var s$6 = {"root":"index-module_root__ogwMI","root__hasActive":"index-module_roo
6263
6263
 
6264
6264
  var LevelLetterBadge = function (_a) {
6265
6265
  var _b;
6266
- var value = _a.levels, showRate = _a.showRate, showIndicator = _a.showIndicator, className = _a.className, activeCode = _a.activeCode, title = _a.title, href = _a.href;
6266
+ var value = _a.value, showRate = _a.showRate, showIndicator = _a.showIndicator, className = _a.className, activeCode = _a.activeCode, title = _a.title, href = _a.href;
6267
6267
  var levels = React.useMemo(function () {
6268
6268
  if (typeof value === "string") {
6269
6269
  return [{ code: value }];
@@ -6290,7 +6290,7 @@ var LevelLetterBadge = function (_a) {
6290
6290
  var contentText = "".concat(code === null || code === void 0 ? void 0 : code.toUpperCase()).concat(typeof rate === "number" && showRate === true ? " ".concat(numeral(rate).format(".0")) : "");
6291
6291
  var content = (React.createElement("div", { className: s$6.content },
6292
6292
  React.createElement("div", null, contentText),
6293
- showIndicator && (React.createElement("div", { className: s$6.rate },
6293
+ showIndicator && typeof rate === "number" && (React.createElement("div", { className: s$6.rate },
6294
6294
  React.createElement("div", { style: { height: "".concat(numeral(rate).format("0%")) } })))));
6295
6295
  return (React.createElement(AppTooltip, { key: code, title: title ? title({ code: code, rate: rate }) : titleText }, href ? (React.createElement(AppLink, { href: href({ code: code }), className: levelClassName }, content)) : (React.createElement("div", { className: levelClassName }, content))));
6296
6296
  })));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "revdev-components",
3
- "version": "0.286.0",
3
+ "version": "0.287.0",
4
4
  "main": "build/index.js",
5
5
  "module": "build/index.esm.js",
6
6
  "scripts": {