rbro-tat-uds 2.1.0 → 2.1.1

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.
@@ -39,11 +39,12 @@ const Bar = ({
39
39
  children: items.length > 0 && items.map((item, index) => {
40
40
  const thisColor = utils.colors[item.color] || utils.colors.gray_950;
41
41
  const percentage = item.value / max * 100;
42
+ const clampedPercentage = Math.min(Math.max(percentage, 0), 100);
42
43
  return /* @__PURE__ */ jsxRuntime.jsx(
43
44
  "div",
44
45
  {
45
46
  style: {
46
- width: `${percentage}%`,
47
+ width: `${clampedPercentage}%`,
47
48
  height: "100%",
48
49
  backgroundColor: thisColor
49
50
  }
@@ -2792,11 +2792,12 @@ const Bar = ({
2792
2792
  children: items.length > 0 && items.map((item, index) => {
2793
2793
  const thisColor = utils.colors[item.color] || utils.colors.gray_950;
2794
2794
  const percentage = item.value / max * 100;
2795
+ const clampedPercentage = Math.min(Math.max(percentage, 0), 100);
2795
2796
  return /* @__PURE__ */ jsxRuntime.jsx(
2796
2797
  "div",
2797
2798
  {
2798
2799
  style: {
2799
- width: `${percentage}%`,
2800
+ width: `${clampedPercentage}%`,
2800
2801
  height: "100%",
2801
2802
  backgroundColor: thisColor
2802
2803
  }
@@ -35,11 +35,12 @@ const Bar = ({
35
35
  children: items.length > 0 && items.map((item, index) => {
36
36
  const thisColor = colors[item.color] || colors.gray_950;
37
37
  const percentage = item.value / max * 100;
38
+ const clampedPercentage = Math.min(Math.max(percentage, 0), 100);
38
39
  return /* @__PURE__ */ jsx(
39
40
  "div",
40
41
  {
41
42
  style: {
42
- width: `${percentage}%`,
43
+ width: `${clampedPercentage}%`,
43
44
  height: "100%",
44
45
  backgroundColor: thisColor
45
46
  }
@@ -2769,11 +2769,12 @@ const Bar = ({
2769
2769
  children: items.length > 0 && items.map((item, index) => {
2770
2770
  const thisColor = colors[item.color] || colors.gray_950;
2771
2771
  const percentage = item.value / max * 100;
2772
+ const clampedPercentage = Math.min(Math.max(percentage, 0), 100);
2772
2773
  return /* @__PURE__ */ jsx(
2773
2774
  "div",
2774
2775
  {
2775
2776
  style: {
2776
- width: `${percentage}%`,
2777
+ width: `${clampedPercentage}%`,
2777
2778
  height: "100%",
2778
2779
  backgroundColor: thisColor
2779
2780
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rbro-tat-uds",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "type": "module",
5
5
  "main": "build/cjs/index.cjs",
6
6
  "module": "build/esm/index.js",