@sustaina/shared-ui 1.62.2 → 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
@@ -5650,17 +5650,15 @@ function MonthCal({
5650
5650
  const minMonth = effectiveMin?.getMonth();
5651
5651
  const maxYear = max?.getFullYear();
5652
5652
  const maxMonth = max?.getMonth();
5653
+ const selectedMonthYear = selectedMonthDate?.getFullYear();
5653
5654
  const [menuYear, setMenuYear] = React.useState(
5654
5655
  () => selectedMonthDate?.getFullYear() ?? today.getFullYear()
5655
5656
  );
5656
5657
  React.useEffect(() => {
5657
- if (selectedMonthDate) {
5658
- const year = selectedMonthDate.getFullYear();
5659
- if (year !== menuYear) {
5660
- setMenuYear(year);
5661
- }
5658
+ if (typeof selectedMonthYear === "number") {
5659
+ setMenuYear(selectedMonthYear);
5662
5660
  }
5663
- }, [selectedMonthDate]);
5661
+ }, [selectedMonthYear]);
5664
5662
  React.useEffect(() => {
5665
5663
  if (typeof minYear === "number" && menuYear < minYear) {
5666
5664
  setMenuYear(minYear);
@@ -17577,6 +17575,11 @@ var alignClassMap = {
17577
17575
  center: "justify-center",
17578
17576
  end: "justify-end"
17579
17577
  };
17578
+ var outerAlignClassMap = {
17579
+ start: "self-start",
17580
+ center: "self-center",
17581
+ end: "self-end"
17582
+ };
17580
17583
  var ProgressBar = ({
17581
17584
  percent = 0,
17582
17585
  size = "md",
@@ -17599,7 +17602,11 @@ var ProgressBar = ({
17599
17602
  const linecapClass = linecapMap[strokeLinecap];
17600
17603
  const posType = percentPosition?.type ?? "outer";
17601
17604
  const posAlign = percentPosition?.align ?? "end";
17605
+ const posSide = percentPosition?.side;
17602
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];
17603
17610
  const { className: sizeClass, style: sizeStyle } = resolveSize(size);
17604
17611
  const info = useMemo(() => {
17605
17612
  if (!showInfo) return null;
@@ -17610,11 +17617,13 @@ var ProgressBar = ({
17610
17617
  "div",
17611
17618
  {
17612
17619
  className: cn(
17613
- "flex w-full items-center gap-2 min-w-0",
17614
- 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",
17615
17623
  className
17616
17624
  ),
17617
17625
  children: [
17626
+ posSide === "top" && info && /* @__PURE__ */ jsx("span", { className: cn("text-xs shrink-0 tabular-nums", outerAlignClass), children: info }),
17618
17627
  /* @__PURE__ */ jsxs(
17619
17628
  "div",
17620
17629
  {
@@ -17653,7 +17662,8 @@ var ProgressBar = ({
17653
17662
  ]
17654
17663
  }
17655
17664
  ),
17656
- !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 })
17657
17667
  ]
17658
17668
  }
17659
17669
  );