myshell-react-lib 0.2.35 → 0.2.36

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/dist/index.cjs CHANGED
@@ -9706,9 +9706,6 @@ function getPercent(value1, total) {
9706
9706
  if (total === 0) return 0;
9707
9707
  return value1 / total * 100;
9708
9708
  }
9709
- function clamp2(value1, min3, max2) {
9710
- return Math.min(Math.max(value1, min3), max2);
9711
- }
9712
9709
  function isClient() {
9713
9710
  return typeof window !== "undefined" && typeof document !== "undefined";
9714
9711
  }
@@ -13859,26 +13856,23 @@ var import_jsx_runtime46 = require("react/jsx-runtime");
13859
13856
  var ProgressRoot = ProgressPrimitive.Root;
13860
13857
  var ProgressIndicator = ProgressPrimitive.Indicator;
13861
13858
  var Progress = function(param) {
13862
- var value1 = param.value, max2 = param.max, className = param.className, indicatorClassName = param.indicatorClassName, labelClassName = param.labelClassName, label = param.label, _param_height = param.height, height = _param_height === void 0 ? 20 : _param_height, _param_width = param.width, width = _param_width === void 0 ? 75 : _param_width, _param_minWidth = param.minWidth, minWidth = _param_minWidth === void 0 ? 60 : _param_minWidth, _param_maxWidth = param.maxWidth, maxWidth = _param_maxWidth === void 0 ? 220 : _param_maxWidth;
13863
- var widthValue = "".concat(clamp2(width + (Math.max(max2, value1).toString().length - 3) * 12, minWidth, maxWidth), "px");
13859
+ var value1 = param.value, max2 = param.max, className = param.className, indicatorClassName = param.indicatorClassName, children = param.children;
13860
+ var maxValue = Math.max(value1, max2);
13861
+ var percentage = Math.min(value1 / maxValue * 100, 100);
13864
13862
  return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(ProgressPrimitive.Root, {
13865
13863
  value: value1,
13866
- max: Math.max(value1, max2),
13867
- className: cn("relative overflow-hidden", className),
13868
- style: {
13869
- height: "".concat(height, "px"),
13870
- width: widthValue
13871
- },
13864
+ max: maxValue,
13865
+ className: cn("relative overflow-hidden w-auto", className),
13872
13866
  children: [
13873
13867
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ProgressPrimitive.Indicator, {
13874
- className: cn("h-full transition-all", indicatorClassName),
13868
+ className: cn("h-full transition-all absolute inset-0", indicatorClassName),
13875
13869
  style: {
13876
- width: "".concat(value1 / max2 * 100, "%")
13870
+ width: "".concat(percentage, "%")
13877
13871
  }
13878
13872
  }),
13879
- label && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", {
13880
- className: cn("absolute inset-0 flex items-center justify-center", labelClassName),
13881
- children: label
13873
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", {
13874
+ className: "z-10 h-full w-full",
13875
+ children: children
13882
13876
  })
13883
13877
  ]
13884
13878
  });