@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.cjs CHANGED
@@ -3129,14 +3129,21 @@ function FilterBar({ fields = [], filters, onFilterChange, onFilterRemove, align
3129
3129
 
3130
3130
  // src/components/data/StatTile.tsx
3131
3131
  var import_jsx_runtime42 = require("react/jsx-runtime");
3132
+ function isZeroDelta(delta) {
3133
+ if (!delta) return false;
3134
+ const match = delta.match(/[\d.]+/);
3135
+ return match !== null && parseFloat(match[0]) === 0;
3136
+ }
3132
3137
  function StatTile({ label, value, sub, delta, invert = false, loading = false, compact: compact3 = false, className = "", ...rest }) {
3133
3138
  const isDecrease = delta?.startsWith("-") ?? false;
3139
+ const isZero = isZeroDelta(delta);
3134
3140
  const isGood = invert ? isDecrease : !isDecrease;
3141
+ const deltaToneClass = isZero ? "fd-stat-delta-neutral" : isGood ? "fd-stat-delta-up" : "fd-stat-delta-down";
3135
3142
  return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: ["fd-stat", compact3 ? "fd-stat-compact" : "", className].filter(Boolean).join(" "), ...rest, children: [
3136
3143
  loading ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "fd-skel fd-skel-text", style: { display: "block", height: compact3 ? 20 : 28, width: "62%" } }) : /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { className: "fd-stat-top", children: [
3137
3144
  /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "fd-stat-figure", children: value }),
3138
- delta ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { className: isGood ? "fd-stat-delta-up" : "fd-stat-delta-down", style: { fontWeight: 600, fontSize: "var(--body-sm-size)", flex: "none" }, children: [
3139
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("i", { className: "ph ph-arrow-" + (isDecrease ? "down" : "up") + "-right", "aria-hidden": "true" }),
3145
+ delta ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { className: deltaToneClass, style: { fontWeight: 600, fontSize: "var(--body-sm-size)", flex: "none" }, children: [
3146
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("i", { className: "ph ph-" + (isZero ? "minus" : "arrow-" + (isDecrease ? "down" : "up") + "-right"), "aria-hidden": "true" }),
3140
3147
  " ",
3141
3148
  delta
3142
3149
  ] }) : null