@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.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
@@ -5693,17 +5693,15 @@ function MonthCal({
5693
5693
  const minMonth = effectiveMin?.getMonth();
5694
5694
  const maxYear = max?.getFullYear();
5695
5695
  const maxMonth = max?.getMonth();
5696
+ const selectedMonthYear = selectedMonthDate?.getFullYear();
5696
5697
  const [menuYear, setMenuYear] = React__namespace.useState(
5697
5698
  () => selectedMonthDate?.getFullYear() ?? today.getFullYear()
5698
5699
  );
5699
5700
  React__namespace.useEffect(() => {
5700
- if (selectedMonthDate) {
5701
- const year = selectedMonthDate.getFullYear();
5702
- if (year !== menuYear) {
5703
- setMenuYear(year);
5704
- }
5701
+ if (typeof selectedMonthYear === "number") {
5702
+ setMenuYear(selectedMonthYear);
5705
5703
  }
5706
- }, [selectedMonthDate]);
5704
+ }, [selectedMonthYear]);
5707
5705
  React__namespace.useEffect(() => {
5708
5706
  if (typeof minYear === "number" && menuYear < minYear) {
5709
5707
  setMenuYear(minYear);
@@ -17620,6 +17618,11 @@ var alignClassMap = {
17620
17618
  center: "justify-center",
17621
17619
  end: "justify-end"
17622
17620
  };
17621
+ var outerAlignClassMap = {
17622
+ start: "self-start",
17623
+ center: "self-center",
17624
+ end: "self-end"
17625
+ };
17623
17626
  var ProgressBar = ({
17624
17627
  percent = 0,
17625
17628
  size = "md",
@@ -17642,7 +17645,11 @@ var ProgressBar = ({
17642
17645
  const linecapClass = linecapMap[strokeLinecap];
17643
17646
  const posType = percentPosition?.type ?? "outer";
17644
17647
  const posAlign = percentPosition?.align ?? "end";
17648
+ const posSide = percentPosition?.side;
17645
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];
17646
17653
  const { className: sizeClass, style: sizeStyle } = resolveSize(size);
17647
17654
  const info = React.useMemo(() => {
17648
17655
  if (!showInfo) return null;
@@ -17653,11 +17660,13 @@ var ProgressBar = ({
17653
17660
  "div",
17654
17661
  {
17655
17662
  className: cn(
17656
- "flex w-full items-center gap-2 min-w-0",
17657
- 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",
17658
17666
  className
17659
17667
  ),
17660
17668
  children: [
17669
+ posSide === "top" && info && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("text-xs shrink-0 tabular-nums", outerAlignClass), children: info }),
17661
17670
  /* @__PURE__ */ jsxRuntime.jsxs(
17662
17671
  "div",
17663
17672
  {
@@ -17696,7 +17705,8 @@ var ProgressBar = ({
17696
17705
  ]
17697
17706
  }
17698
17707
  ),
17699
- !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 })
17700
17710
  ]
17701
17711
  }
17702
17712
  );