@flytedan/flytebot-design-system 0.25.0 → 0.27.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.js CHANGED
@@ -2890,14 +2890,21 @@ function FilterBar({ fields = [], filters, onFilterChange, onFilterRemove, align
2890
2890
 
2891
2891
  // src/components/data/StatTile.tsx
2892
2892
  import { jsx as jsx42, jsxs as jsxs36 } from "react/jsx-runtime";
2893
+ function isZeroDelta(delta) {
2894
+ if (!delta) return false;
2895
+ const match = delta.match(/[\d.]+/);
2896
+ return match !== null && parseFloat(match[0]) === 0;
2897
+ }
2893
2898
  function StatTile({ label, value, sub, delta, invert = false, loading = false, compact: compact3 = false, className = "", ...rest }) {
2894
2899
  const isDecrease = delta?.startsWith("-") ?? false;
2900
+ const isZero = isZeroDelta(delta);
2895
2901
  const isGood = invert ? isDecrease : !isDecrease;
2902
+ const deltaToneClass = isZero ? "fd-stat-delta-neutral" : isGood ? "fd-stat-delta-up" : "fd-stat-delta-down";
2896
2903
  return /* @__PURE__ */ jsxs36("div", { className: ["fd-stat", compact3 ? "fd-stat-compact" : "", className].filter(Boolean).join(" "), ...rest, children: [
2897
2904
  loading ? /* @__PURE__ */ jsx42("span", { className: "fd-skel fd-skel-text", style: { display: "block", height: compact3 ? 20 : 28, width: "62%" } }) : /* @__PURE__ */ jsxs36("span", { className: "fd-stat-top", children: [
2898
2905
  /* @__PURE__ */ jsx42("span", { className: "fd-stat-figure", children: value }),
2899
- delta ? /* @__PURE__ */ jsxs36("span", { className: isGood ? "fd-stat-delta-up" : "fd-stat-delta-down", style: { fontWeight: 600, fontSize: "var(--body-sm-size)", flex: "none" }, children: [
2900
- /* @__PURE__ */ jsx42("i", { className: "ph ph-arrow-" + (isDecrease ? "down" : "up") + "-right", "aria-hidden": "true" }),
2906
+ delta ? /* @__PURE__ */ jsxs36("span", { className: deltaToneClass, style: { fontWeight: 600, fontSize: "var(--body-sm-size)", flex: "none" }, children: [
2907
+ /* @__PURE__ */ jsx42("i", { className: "ph ph-" + (isZero ? "minus" : "arrow-" + (isDecrease ? "down" : "up") + "-right"), "aria-hidden": "true" }),
2901
2908
  " ",
2902
2909
  delta
2903
2910
  ] }) : null