@geomak/ui 6.7.0 → 6.8.0

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
@@ -1809,6 +1809,59 @@ function CardCarousel({
1809
1809
  )) })
1810
1810
  ] });
1811
1811
  }
1812
+ var VALUE_SIZE = {
1813
+ sm: "text-xl",
1814
+ md: "text-3xl",
1815
+ lg: "text-4xl"
1816
+ };
1817
+ var TONE2 = {
1818
+ good: "text-status-success",
1819
+ bad: "text-status-error",
1820
+ neutral: "text-foreground-muted"
1821
+ };
1822
+ var ArrowUp = /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.2, "aria-hidden": "true", className: "h-3.5 w-3.5", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 19V5M5 12l7-7 7 7" }) });
1823
+ var ArrowDown = /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.2, "aria-hidden": "true", className: "h-3.5 w-3.5", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 5v14M5 12l7 7 7-7" }) });
1824
+ function Statistic({
1825
+ label,
1826
+ value,
1827
+ prefix,
1828
+ suffix,
1829
+ icon,
1830
+ delta,
1831
+ helpText,
1832
+ size = "md",
1833
+ align = "left",
1834
+ className = "",
1835
+ style
1836
+ }) {
1837
+ const dir = delta?.direction ?? "neutral";
1838
+ const positiveIsGood = delta?.positiveIsGood ?? true;
1839
+ const deltaTone = dir === "neutral" ? "neutral" : dir === "up" === positiveIsGood ? "good" : "bad";
1840
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1841
+ "div",
1842
+ {
1843
+ className: ["flex gap-3", align === "center" ? "flex-col items-center text-center" : "items-start", className].filter(Boolean).join(" "),
1844
+ style,
1845
+ children: [
1846
+ icon && align === "left" && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-lg bg-accent/10 text-accent", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "h-5 w-5 inline-flex items-center justify-center", children: icon }) }),
1847
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
1848
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs font-medium uppercase tracking-wide text-foreground-muted", children: label }),
1849
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `mt-1 flex items-baseline gap-0.5 font-semibold text-foreground tabular-nums ${VALUE_SIZE[size]} ${align === "center" ? "justify-center" : ""}`, children: [
1850
+ prefix && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground-muted text-[0.6em] font-medium self-center", children: prefix }),
1851
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "leading-none", children: value }),
1852
+ suffix && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground-muted text-[0.5em] font-medium self-center", children: suffix })
1853
+ ] }),
1854
+ delta && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `mt-1.5 flex items-center gap-1 text-sm font-medium ${align === "center" ? "justify-center" : ""} ${TONE2[deltaTone]}`, children: [
1855
+ dir === "up" ? ArrowUp : dir === "down" ? ArrowDown : null,
1856
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: delta.value }),
1857
+ delta.label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground-muted font-normal", children: delta.label })
1858
+ ] }),
1859
+ helpText && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1 text-xs text-foreground-muted", children: helpText })
1860
+ ] })
1861
+ ]
1862
+ }
1863
+ );
1864
+ }
1812
1865
  var NotificationContext = React16.createContext({
1813
1866
  open: () => void 0,
1814
1867
  close: () => void 0
@@ -7581,6 +7634,7 @@ exports.SkeletonCard = SkeletonCard;
7581
7634
  exports.SkeletonCircle = SkeletonCircle;
7582
7635
  exports.SkeletonText = SkeletonText;
7583
7636
  exports.Slider = Slider;
7637
+ exports.Statistic = Statistic;
7584
7638
  exports.Switch = Switch;
7585
7639
  exports.Table = Table;
7586
7640
  exports.Tabs = Tabs_default;