@flytedan/flytebot-design-system 0.55.1 → 0.55.3

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
@@ -1856,6 +1856,9 @@ function AppShell({
1856
1856
  style: {
1857
1857
  flex: 1,
1858
1858
  minWidth: 0,
1859
+ // MP-298: positioned so absolutely positioned content inside (a chart's `.fd-sr` data
1860
+ // table) is contained and clipped by this scroller, never stretching the document.
1861
+ position: "relative",
1859
1862
  overflowY: "auto",
1860
1863
  padding: 24,
1861
1864
  maxWidth: contentMaxWidth,
@@ -5666,27 +5669,26 @@ var import_jsx_runtime57 = require("react/jsx-runtime");
5666
5669
  function useInlinePanel() {
5667
5670
  const [open2, setOpen] = React35.useState(false);
5668
5671
  const ref = React35.useRef(null);
5669
- const layer = useStackedLayer({ active: open2, containerRef: ref, onEscape: () => setOpen(false) });
5670
- const zIndex = useLayerZIndex(layer);
5671
- React35.useEffect(() => {
5672
- if (!open2) return;
5673
- const away = (e) => {
5674
- if (ref.current && !ref.current.contains(e.target)) setOpen(false);
5675
- };
5676
- document.addEventListener("pointerdown", away);
5677
- return () => document.removeEventListener("pointerdown", away);
5678
- }, [open2]);
5679
- return { open: open2, setOpen, ref, zIndex, layer };
5672
+ return { open: open2, setOpen, ref };
5680
5673
  }
5681
- function InlinePanelLayers({ panel, children }) {
5682
- return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(StackedLayerProvider, { layer: panel.layer, children });
5674
+ function InlinePanelSurface({ panel, align = "right", ...popover }) {
5675
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
5676
+ Popover,
5677
+ {
5678
+ open: panel.open,
5679
+ anchorRef: panel.ref,
5680
+ onClose: () => panel.setOpen(false),
5681
+ placement: align === "left" ? "bottom-start" : "bottom-end",
5682
+ ...popover
5683
+ }
5684
+ );
5683
5685
  }
5684
5686
 
5685
5687
  // src/components/data/SortMenu.tsx
5686
5688
  var import_jsx_runtime58 = require("react/jsx-runtime");
5687
5689
  function SortMenu({ fields = [], sort, onSort, align = "right", size = "md", className = "", ...rest }) {
5688
5690
  const panel = useInlinePanel();
5689
- const { open: open2, setOpen, ref, zIndex } = panel;
5691
+ const { open: open2, setOpen, ref } = panel;
5690
5692
  const cur = fields.find((f) => f.key === (sort && sort.key));
5691
5693
  const dir = sort && sort.dir;
5692
5694
  const arrow = (f, d) => {
@@ -5714,12 +5716,12 @@ function SortMenu({ fields = [], sort, onSort, align = "right", size = "md", cla
5714
5716
  }
5715
5717
  );
5716
5718
  };
5717
- return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("span", { className, style: { position: "relative", display: "inline-flex" }, ref, ...rest, children: [
5719
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("span", { className, style: { display: "inline-flex" }, ref, ...rest, children: [
5718
5720
  /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Button, { size, variant: "secondary", icon: dir === "asc" ? "sort-ascending" : "sort-descending", onClick: () => setOpen(!open2), children: [
5719
5721
  cur ? cur.label : "Unsorted",
5720
5722
  /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("i", { className: "ph ph-" + (dir === "asc" ? "arrow-up" : "arrow-down"), style: { fontSize: 12, marginLeft: 6, opacity: 0.75 } })
5721
5723
  ] }),
5722
- open2 ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(InlinePanelLayers, { panel, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "fd-view-enter", style: { position: "absolute", top: "calc(100% + 6px)", [align]: 0, zIndex, width: 280, maxWidth: "calc(100vw - 32px)", display: "block", background: "var(--surface)", border: "1px solid var(--border)", borderRadius: 10, boxShadow: "0 16px 44px rgba(11,13,17,.18)", padding: 8 }, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("span", { className: "fd-stack", style: { gap: 2 }, children: [
5724
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(InlinePanelSurface, { panel, align, offset: 6, width: 280, label: "Sort by", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("span", { className: "fd-stack", style: { gap: 2, padding: 8 }, children: [
5723
5725
  /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "fd-overline fd-muted", style: { padding: "4px 8px 6px" }, children: "Sort by" }),
5724
5726
  fields.map((f) => {
5725
5727
  const active = cur && cur.key === f.key;
@@ -5729,7 +5731,7 @@ function SortMenu({ fields = [], sort, onSort, align = "right", size = "md", cla
5729
5731
  arrow(f, "desc")
5730
5732
  ] }, f.key);
5731
5733
  })
5732
- ] }) }) }) : null
5734
+ ] }) })
5733
5735
  ] });
5734
5736
  }
5735
5737
 
@@ -11289,7 +11291,7 @@ var import_jsx_runtime85 = require("react/jsx-runtime");
11289
11291
  function ModeSwitch({ canToggle = false, requestCount = 0, onClearLog, renderLog, onOpenSpec, summary }) {
11290
11292
  const mode2 = useRuntimeMode();
11291
11293
  const panel = useInlinePanel();
11292
- const { open: open2, setOpen, ref, zIndex } = panel;
11294
+ const { open: open2, setOpen, ref } = panel;
11293
11295
  if (!canToggle) return null;
11294
11296
  const test = mode2 === "test";
11295
11297
  const s = summary || RuntimeKit.summary();
@@ -11297,7 +11299,7 @@ function ModeSwitch({ canToggle = false, requestCount = 0, onClearLog, renderLog
11297
11299
  RuntimeKit.setMode(next);
11298
11300
  setOpen(false);
11299
11301
  };
11300
- return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("span", { style: { position: "relative", display: "inline-flex" }, ref, children: [
11302
+ return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("span", { style: { display: "inline-flex" }, ref, children: [
11301
11303
  /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
11302
11304
  "button",
11303
11305
  {
@@ -11313,7 +11315,7 @@ function ModeSwitch({ canToggle = false, requestCount = 0, onClearLog, renderLog
11313
11315
  ]
11314
11316
  }
11315
11317
  ),
11316
- open2 ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(InlinePanelLayers, { panel, children: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("span", { className: "fd-view-enter fd-mode-pop", style: { zIndex }, children: [
11318
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(InlinePanelSurface, { panel, align: "right", offset: 8, width: 400, className: "fd-mode-pop", label: test ? "Test mode" : "Live mode", children: [
11317
11319
  /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("span", { className: "fd-row", style: { gap: 10, padding: "12px 14px", borderBottom: "1px solid var(--border)" }, children: [
11318
11320
  /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("span", { className: "fd-badge " + (test ? "fd-badge-warning" : "fd-badge-neutral"), children: [
11319
11321
  /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("i", { className: "ph " + (test ? "ph-flask" : "ph-lightning"), "aria-hidden": "true" }),
@@ -11371,7 +11373,7 @@ function ModeSwitch({ canToggle = false, requestCount = 0, onClearLog, renderLog
11371
11373
  ] })
11372
11374
  ] }),
11373
11375
  test && renderLog ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { style: { display: "block", maxHeight: 340, overflowY: "auto", borderTop: "1px solid var(--border)" }, children: renderLog() }) : null
11374
- ] }) }) : null
11376
+ ] })
11375
11377
  ] });
11376
11378
  }
11377
11379
  function TestModeBar({ onExit }) {
@@ -13764,7 +13766,7 @@ function FolderPickerMenu({
13764
13766
  onPick
13765
13767
  }) {
13766
13768
  const panel = useInlinePanel();
13767
- const { open: open2, setOpen, ref, zIndex } = panel;
13769
+ const { open: open2, setOpen, ref } = panel;
13768
13770
  return /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("span", { className: "fd-fb-menu-anchor", ref, children: [
13769
13771
  /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
13770
13772
  IconButton,
@@ -13778,7 +13780,7 @@ function FolderPickerMenu({
13778
13780
  onClick: () => setOpen((v) => !v)
13779
13781
  }
13780
13782
  ),
13781
- open2 ? /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(InlinePanelLayers, { panel, children: /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "fd-fb-menu", role: "menu", "aria-label": label, style: { zIndex }, children: [
13783
+ /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(InlinePanelSurface, { panel, align: "right", offset: 4, width: 220, maxHeight: 280, role: "menu", label, children: /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "fd-fb-menu", children: [
13782
13784
  /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("span", { className: "fd-overline fd-muted fd-fb-menu-title", children: "Move to\u2026" }),
13783
13785
  destinations.map((d) => /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
13784
13786
  "button",
@@ -13798,7 +13800,7 @@ function FolderPickerMenu({
13798
13800
  },
13799
13801
  d.id ?? "__root__"
13800
13802
  ))
13801
- ] }) }) : null
13803
+ ] }) })
13802
13804
  ] });
13803
13805
  }
13804
13806
  function RowShell({ icon, name, meta, onOpen, draggableId, isDropTarget, onDropPayload, actions, className = "" }) {