@sustaina/shared-ui 1.62.3 → 1.63.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.
package/dist/index.d.mts CHANGED
@@ -1933,6 +1933,7 @@ type ProgressBarSize = "sm" | "md" | "lg" | number;
1933
1933
  type PercentPosition = {
1934
1934
  align?: "start" | "center" | "end";
1935
1935
  type?: "inner" | "outer";
1936
+ side?: "top" | "bottom" | "left" | "right";
1936
1937
  };
1937
1938
  type SuccessConfig = {
1938
1939
  percent: number;
package/dist/index.d.ts CHANGED
@@ -1933,6 +1933,7 @@ type ProgressBarSize = "sm" | "md" | "lg" | number;
1933
1933
  type PercentPosition = {
1934
1934
  align?: "start" | "center" | "end";
1935
1935
  type?: "inner" | "outer";
1936
+ side?: "top" | "bottom" | "left" | "right";
1936
1937
  };
1937
1938
  type SuccessConfig = {
1938
1939
  percent: number;
package/dist/index.js CHANGED
@@ -17618,6 +17618,11 @@ var alignClassMap = {
17618
17618
  center: "justify-center",
17619
17619
  end: "justify-end"
17620
17620
  };
17621
+ var outerAlignClassMap = {
17622
+ start: "self-start",
17623
+ center: "self-center",
17624
+ end: "self-end"
17625
+ };
17621
17626
  var ProgressBar = ({
17622
17627
  percent = 0,
17623
17628
  size = "md",
@@ -17640,7 +17645,11 @@ var ProgressBar = ({
17640
17645
  const linecapClass = linecapMap[strokeLinecap];
17641
17646
  const posType = percentPosition?.type ?? "outer";
17642
17647
  const posAlign = percentPosition?.align ?? "end";
17648
+ const posSide = percentPosition?.side;
17643
17649
  const isInner = posType === "inner";
17650
+ const isTopBottom = posSide === "top" || posSide === "bottom";
17651
+ const isLeftOuter = !isInner && !isTopBottom && (posSide === "left" || !posSide && posAlign === "start");
17652
+ const outerAlignClass = outerAlignClassMap[posAlign];
17644
17653
  const { className: sizeClass, style: sizeStyle } = resolveSize(size);
17645
17654
  const info = React.useMemo(() => {
17646
17655
  if (!showInfo) return null;
@@ -17651,11 +17660,13 @@ var ProgressBar = ({
17651
17660
  "div",
17652
17661
  {
17653
17662
  className: cn(
17654
- "flex w-full items-center gap-2 min-w-0",
17655
- posAlign === "start" && !isInner && "flex-row-reverse",
17663
+ "flex w-full min-w-0",
17664
+ isTopBottom ? "flex-col gap-1" : "items-center gap-2",
17665
+ isLeftOuter && "flex-row-reverse",
17656
17666
  className
17657
17667
  ),
17658
17668
  children: [
17669
+ posSide === "top" && info && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("text-xs shrink-0 tabular-nums", outerAlignClass), children: info }),
17659
17670
  /* @__PURE__ */ jsxRuntime.jsxs(
17660
17671
  "div",
17661
17672
  {
@@ -17694,7 +17705,8 @@ var ProgressBar = ({
17694
17705
  ]
17695
17706
  }
17696
17707
  ),
17697
- !isInner && info && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs shrink-0 tabular-nums", children: info })
17708
+ posSide === "bottom" && info && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("text-xs shrink-0 tabular-nums", outerAlignClass), children: info }),
17709
+ !isInner && !isTopBottom && info && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs shrink-0 tabular-nums", children: info })
17698
17710
  ]
17699
17711
  }
17700
17712
  );