@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.mjs CHANGED
@@ -17575,6 +17575,11 @@ var alignClassMap = {
17575
17575
  center: "justify-center",
17576
17576
  end: "justify-end"
17577
17577
  };
17578
+ var outerAlignClassMap = {
17579
+ start: "self-start",
17580
+ center: "self-center",
17581
+ end: "self-end"
17582
+ };
17578
17583
  var ProgressBar = ({
17579
17584
  percent = 0,
17580
17585
  size = "md",
@@ -17597,7 +17602,11 @@ var ProgressBar = ({
17597
17602
  const linecapClass = linecapMap[strokeLinecap];
17598
17603
  const posType = percentPosition?.type ?? "outer";
17599
17604
  const posAlign = percentPosition?.align ?? "end";
17605
+ const posSide = percentPosition?.side;
17600
17606
  const isInner = posType === "inner";
17607
+ const isTopBottom = posSide === "top" || posSide === "bottom";
17608
+ const isLeftOuter = !isInner && !isTopBottom && (posSide === "left" || !posSide && posAlign === "start");
17609
+ const outerAlignClass = outerAlignClassMap[posAlign];
17601
17610
  const { className: sizeClass, style: sizeStyle } = resolveSize(size);
17602
17611
  const info = useMemo(() => {
17603
17612
  if (!showInfo) return null;
@@ -17608,11 +17617,13 @@ var ProgressBar = ({
17608
17617
  "div",
17609
17618
  {
17610
17619
  className: cn(
17611
- "flex w-full items-center gap-2 min-w-0",
17612
- posAlign === "start" && !isInner && "flex-row-reverse",
17620
+ "flex w-full min-w-0",
17621
+ isTopBottom ? "flex-col gap-1" : "items-center gap-2",
17622
+ isLeftOuter && "flex-row-reverse",
17613
17623
  className
17614
17624
  ),
17615
17625
  children: [
17626
+ posSide === "top" && info && /* @__PURE__ */ jsx("span", { className: cn("text-xs shrink-0 tabular-nums", outerAlignClass), children: info }),
17616
17627
  /* @__PURE__ */ jsxs(
17617
17628
  "div",
17618
17629
  {
@@ -17651,7 +17662,8 @@ var ProgressBar = ({
17651
17662
  ]
17652
17663
  }
17653
17664
  ),
17654
- !isInner && info && /* @__PURE__ */ jsx("span", { className: "text-xs shrink-0 tabular-nums", children: info })
17665
+ posSide === "bottom" && info && /* @__PURE__ */ jsx("span", { className: cn("text-xs shrink-0 tabular-nums", outerAlignClass), children: info }),
17666
+ !isInner && !isTopBottom && info && /* @__PURE__ */ jsx("span", { className: "text-xs shrink-0 tabular-nums", children: info })
17655
17667
  ]
17656
17668
  }
17657
17669
  );