@flytedan/flytebot-design-system 0.11.4 → 0.11.6

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
@@ -3036,16 +3036,13 @@ function EntityRowMetrics({ metrics, className = "", style }) {
3036
3036
  return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: ["fd-erow-metrics", className].filter(Boolean).join(" "), style, children: metrics.map((m, i) => {
3037
3037
  const key = m.id || m.label || i;
3038
3038
  const className2 = ["fd-erow-metric", m.tone && m.tone !== "default" ? "is-" + m.tone : "", m.tooltip != null ? "is-described" : ""].filter(Boolean).join(" ");
3039
- const cellStyle = { "--erow-metric-w": (m.width || ENTITY_ROW_METRIC_WIDTH) + "px", color: METRIC_TONE_COLOR[m.tone || "default"] };
3039
+ const tone = { color: METRIC_TONE_COLOR[m.tone || "default"] };
3040
3040
  const content = /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(React17.Fragment, { children: [
3041
3041
  m.icon ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("i", { className: "ph ph-" + m.icon, "aria-hidden": "true" }) : null,
3042
3042
  /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "fd-erow-metric-value fd-tabular", children: m.value }),
3043
3043
  /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "fd-sr", children: " " + m.label })
3044
3044
  ] });
3045
- if (m.tooltip == null) {
3046
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: className2, style: cellStyle, title: m.label, children: content }, key);
3047
- }
3048
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Tooltip, { label: m.tooltip, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("button", { type: "button", className: className2, style: cellStyle, children: content }) }, key);
3045
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "fd-erow-cell", style: { "--erow-metric-w": (m.width || ENTITY_ROW_METRIC_WIDTH) + "px" }, children: m.tooltip == null ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: className2, style: tone, title: m.label, children: content }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Tooltip, { label: m.tooltip, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("button", { type: "button", className: className2, style: tone, children: content }) }) }, key);
3049
3046
  }) });
3050
3047
  }
3051
3048
  function EntityRow({
@@ -3401,8 +3398,10 @@ function TransferList({
3401
3398
  );
3402
3399
  };
3403
3400
  return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: ["fd-tlist", className].filter(Boolean).join(" "), children: [
3404
- renderSide("left", left, "right"),
3405
- renderSide("right", right, "left"),
3401
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "fd-tlist-panes", children: [
3402
+ renderSide("left", left, "right"),
3403
+ renderSide("right", right, "left")
3404
+ ] }),
3406
3405
  drag ? (0, import_react_dom4.createPortal)(
3407
3406
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
3408
3407
  "div",
@@ -8310,11 +8309,24 @@ function SaturationDistribution({ campuses = [], floorBand, floorScore, onSelect
8310
8309
  // src/components/planner/MixGap.tsx
8311
8310
  var React37 = __toESM(require("react"), 1);
8312
8311
  var import_jsx_runtime67 = require("react/jsx-runtime");
8312
+ var MIX_GAP_LAYOUT = {
8313
+ trackHeight: 30,
8314
+ barHeight: 20,
8315
+ targetWidth: 6,
8316
+ labelGap: 6,
8317
+ labelGutter: 50
8318
+ };
8319
+ var MIX_GAP_TARGET_STRIPE = "repeating-linear-gradient(135deg, var(--n-600) 0 2px, var(--n-300) 2px 4px)";
8320
+ function mixGapOffset(value, max) {
8321
+ return `calc((100% - ${MIX_GAP_LAYOUT.labelGutter}px) * ${value / max})`;
8322
+ }
8313
8323
  function MixGap({ rows = [], loading = false, className = "" }) {
8314
8324
  const max = Math.max(1, ...rows.flatMap((r) => [r.target, r.realized]));
8315
8325
  const [hover, setHover] = React37.useState(null);
8316
8326
  const toneOf = (gap) => gap >= -1 ? "ok" : gap >= -4 ? "warn" : "danger";
8317
8327
  const TONE = { ok: "var(--ok-solid)", warn: "var(--warn-solid)", danger: "var(--danger-solid)" };
8328
+ const { trackHeight, barHeight, targetWidth, labelGap } = MIX_GAP_LAYOUT;
8329
+ const barTop = (trackHeight - barHeight) / 2;
8318
8330
  return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: ["fd-stack", className].filter(Boolean).join(" "), style: { gap: 4 }, children: [
8319
8331
  /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "fd-row", style: { gap: 16, justifyContent: "flex-end", paddingBottom: 6, flexWrap: "wrap" }, children: [
8320
8332
  [["On target", TONE.ok], ["Close", TONE.warn], ["Short", TONE.danger]].map(([l, c]) => /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("span", { className: "fd-row fd-body-sm fd-muted", style: { gap: 6 }, children: [
@@ -8322,7 +8334,7 @@ function MixGap({ rows = [], loading = false, className = "" }) {
8322
8334
  l
8323
8335
  ] }, l)),
8324
8336
  /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("span", { className: "fd-row fd-body-sm fd-muted", style: { gap: 6 }, children: [
8325
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { style: { width: 3, height: 14, background: "var(--n-500)" } }),
8337
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { "data-mixgap-legend-target": "", style: { width: targetWidth, height: 16, borderRadius: 1, background: MIX_GAP_TARGET_STRIPE } }),
8326
8338
  "Target"
8327
8339
  ] })
8328
8340
  ] }),
@@ -8330,6 +8342,7 @@ function MixGap({ rows = [], loading = false, className = "" }) {
8330
8342
  const gap = r.realized - r.target;
8331
8343
  const tone = toneOf(gap);
8332
8344
  const tip = "Realized " + r.realized + "% vs " + r.target + "% target" + (gap < -1 ? " \xB7 " + Math.abs(gap).toFixed(0) + " pts short" : gap > 1 ? " \xB7 " + gap.toFixed(0) + " pts over" : " \xB7 on target") + (r.note ? " \u2014 " + r.note : "");
8345
+ const labelLeft = r.realized > r.target ? `calc(${mixGapOffset(r.realized, max)} + ${labelGap}px)` : `calc(${mixGapOffset(r.target, max)} + ${targetWidth / 2 + labelGap}px)`;
8333
8346
  return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
8334
8347
  "div",
8335
8348
  {
@@ -8339,14 +8352,14 @@ function MixGap({ rows = [], loading = false, className = "" }) {
8339
8352
  onMouseLeave: () => setHover(null),
8340
8353
  children: [
8341
8354
  /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { style: { width: 128, flex: "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(ChannelTag, { channel: r.channel, size: "sm" }) }),
8342
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { style: { position: "relative", flex: 1, height: 22, minWidth: 120 }, children: loading ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "fd-skel", style: { position: "absolute", inset: "5px 0", borderRadius: 3 } }) : /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_jsx_runtime67.Fragment, { children: [
8343
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { style: { position: "absolute", left: 0, top: 5, height: 12, width: r.realized / max * 100 + "%", background: TONE[tone], borderRadius: "2px 3px 3px 2px", transition: "width var(--dur-slow) var(--ease), background var(--dur-base) var(--ease)" } }),
8344
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { style: { position: "absolute", left: r.target / max * 100 + "%", top: 0, width: 3, height: 22, background: "var(--n-500)", borderRadius: 1 } }),
8345
- /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("span", { className: "fd-num", style: { position: "absolute", right: Math.max(r.realized, r.target) / max > 0.82 ? 0 : "auto", left: Math.max(r.realized, r.target) / max > 0.82 ? "auto" : "calc(" + Math.max(r.realized, r.target) / max * 100 + "% + 10px)", top: 2, fontSize: 12, color: "var(--text-muted)", whiteSpace: "nowrap", background: Math.max(r.realized, r.target) / max > 0.82 ? "var(--surface)" : "none", paddingLeft: 3 }, children: [
8355
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { style: { position: "relative", flex: 1, height: trackHeight, minWidth: 120 }, children: loading ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "fd-skel", style: { position: "absolute", left: 0, right: 0, top: barTop, height: barHeight, borderRadius: 3 } }) : /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_jsx_runtime67.Fragment, { children: [
8356
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { "data-mixgap-bar": "", style: { position: "absolute", left: 0, top: barTop, height: barHeight, width: mixGapOffset(r.realized, max), background: TONE[tone], borderRadius: "2px 3px 3px 2px", transition: "width var(--dur-slow) var(--ease), background var(--dur-base) var(--ease)" } }),
8357
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { "data-mixgap-target": "", style: { position: "absolute", left: `calc(${mixGapOffset(r.target, max)} - ${targetWidth / 2}px)`, top: 0, width: targetWidth, height: trackHeight, background: MIX_GAP_TARGET_STRIPE, borderRadius: 1 } }),
8358
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("span", { "data-mixgap-label": "", className: "fd-num", style: { position: "absolute", left: labelLeft, top: "50%", transform: "translateY(-50%)", fontSize: 12, color: "var(--text-muted)", whiteSpace: "nowrap" }, children: [
8346
8359
  r.realized,
8347
8360
  "%"
8348
8361
  ] }),
8349
- hover === r.channel ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "fd-tooltip", role: "tooltip", style: { position: "absolute", left: 0, right: "auto", bottom: 26, maxWidth: "min(340px, 100%)", whiteSpace: "normal", textAlign: "left", width: "max-content" }, children: tip }) : null
8362
+ hover === r.channel ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "fd-tooltip", role: "tooltip", style: { position: "absolute", left: 0, right: "auto", bottom: trackHeight + 4, maxWidth: "min(340px, 100%)", whiteSpace: "normal", textAlign: "left", width: "max-content" }, children: tip }) : null
8350
8363
  ] }) })
8351
8364
  ]
8352
8365
  },