@flytedan/flytebot-design-system 0.65.0 → 0.66.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 +9 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +20 -2
- package/dist/index.d.ts +20 -2
- package/dist/index.js +38 -31
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/styles/components.css +38 -0
package/dist/index.cjs
CHANGED
|
@@ -5967,12 +5967,13 @@ function isZeroDelta(delta) {
|
|
|
5967
5967
|
const match = delta.match(/[\d.]+/);
|
|
5968
5968
|
return match !== null && parseFloat(match[0]) === 0;
|
|
5969
5969
|
}
|
|
5970
|
-
function StatTile(
|
|
5970
|
+
function StatTile(props) {
|
|
5971
|
+
const { label, value, sub, delta, invert = false, loading = false, compact: compact3 = false, className = "", ...rest } = props;
|
|
5971
5972
|
const isDecrease = delta?.startsWith("-") ?? false;
|
|
5972
5973
|
const isZero = isZeroDelta(delta);
|
|
5973
5974
|
const isGood = invert ? isDecrease : !isDecrease;
|
|
5974
5975
|
const deltaToneClass = isZero ? "fd-stat-delta-neutral" : isGood ? "fd-stat-delta-up" : "fd-stat-delta-down";
|
|
5975
|
-
|
|
5976
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [
|
|
5976
5977
|
loading ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "fd-skel fd-skel-text", style: { display: "block", height: compact3 ? 20 : 28, width: "62%" } }) : /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("span", { className: "fd-stat-top", children: [
|
|
5977
5978
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "fd-stat-figure", children: value }),
|
|
5978
5979
|
delta ? /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("span", { className: "fd-stat-delta " + deltaToneClass, children: [
|
|
@@ -5984,6 +5985,12 @@ function StatTile({ label, value, sub, delta, invert = false, loading = false, c
|
|
|
5984
5985
|
!loading && sub ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "fd-stat-sub", children: sub }) : null,
|
|
5985
5986
|
loading ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "fd-skel fd-skel-text", style: { display: "block", height: 10, width: "40%", marginTop: 8 } }) : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "fd-stat-label", style: { display: "block" }, children: label })
|
|
5986
5987
|
] });
|
|
5988
|
+
const classes = (...extra) => ["fd-stat", ...extra, compact3 ? "fd-stat-compact" : "", className].filter(Boolean).join(" ");
|
|
5989
|
+
if (rest.onPress) {
|
|
5990
|
+
const { onPress, pressed = false, disabled = false, ...buttonRest } = rest;
|
|
5991
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("button", { type: "button", className: classes("fd-stat-pressable"), "aria-pressed": pressed, disabled: disabled || loading, onClick: onPress, ...buttonRest, children: content });
|
|
5992
|
+
}
|
|
5993
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: classes(), ...rest, children: content });
|
|
5987
5994
|
}
|
|
5988
5995
|
|
|
5989
5996
|
// src/components/data/CodeBlock.tsx
|