@flytedan/flytebot-design-system 0.83.0 → 0.85.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
@@ -2195,6 +2195,7 @@ function Collapsible({
2195
2195
  subtitle,
2196
2196
  badge,
2197
2197
  icon,
2198
+ actions,
2198
2199
  defaultOpen = false,
2199
2200
  open: open2,
2200
2201
  onToggle,
@@ -2208,16 +2209,20 @@ function Collapsible({
2208
2209
  if (open2 === void 0) setInternal(!isOpen);
2209
2210
  if (onToggle) onToggle(!isOpen);
2210
2211
  };
2211
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: ["fd-coll", className].filter(Boolean).join(" "), "data-open": isOpen ? "true" : "false", ...rest, children: [
2212
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("button", { type: "button", className: "fd-coll-trigger", "aria-expanded": isOpen, onClick: toggle, children: [
2213
- icon ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "fd-coll-caret", style: { background: "var(--brand-soft)", color: "var(--brand)", transform: "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("i", { className: "ph ph-" + icon, "aria-hidden": "true" }) }) : null,
2214
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { style: { flex: 1, minWidth: 0 }, children: [
2215
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "fd-coll-title", style: { display: "block" }, children: title }),
2216
- subtitle ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "fd-coll-sub", style: { display: "block" }, children: subtitle }) : null
2217
- ] }),
2218
- badge,
2219
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "fd-coll-caret", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("i", { className: "ph ph-caret-down", "aria-hidden": "true" }) })
2212
+ const trigger = /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("button", { type: "button", className: "fd-coll-trigger", "aria-expanded": isOpen, onClick: toggle, children: [
2213
+ icon ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "fd-coll-caret", style: { background: "var(--brand-soft)", color: "var(--brand)", transform: "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("i", { className: "ph ph-" + icon, "aria-hidden": "true" }) }) : null,
2214
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { style: { flex: 1, minWidth: 0 }, children: [
2215
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "fd-coll-title", style: { display: "block" }, children: title }),
2216
+ subtitle ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "fd-coll-sub", style: { display: "block" }, children: subtitle }) : null
2220
2217
  ] }),
2218
+ badge,
2219
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "fd-coll-caret", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("i", { className: "ph ph-caret-down", "aria-hidden": "true" }) })
2220
+ ] });
2221
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: ["fd-coll", className].filter(Boolean).join(" "), "data-open": isOpen ? "true" : "false", ...rest, children: [
2222
+ actions ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "fd-coll-head", children: [
2223
+ trigger,
2224
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "fd-coll-actions", children: actions })
2225
+ ] }) : trigger,
2221
2226
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "fd-coll-panel", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "fd-coll-content", children }) }) })
2222
2227
  ] });
2223
2228
  }
@@ -2230,40 +2235,21 @@ var import_react_dom3 = require("react-dom");
2230
2235
  var React8 = __toESM(require("react"), 1);
2231
2236
  var PANEL_EXIT_MS = 210;
2232
2237
  function useClosingAnimation(open2, onClose, durationMs) {
2233
- const [exit, setExit] = React8.useState(null);
2238
+ const [exiting, setExiting] = React8.useState(false);
2234
2239
  const [wasOpen, setWasOpen] = React8.useState(open2);
2235
- const timer = React8.useRef(null);
2236
- const cancel = React8.useCallback(() => {
2237
- if (timer.current !== null) clearTimeout(timer.current);
2238
- timer.current = null;
2239
- }, []);
2240
2240
  if (open2 !== wasOpen) {
2241
2241
  setWasOpen(open2);
2242
- setExit(open2 || exit === "self" ? null : "parent");
2242
+ setExiting(!open2);
2243
2243
  }
2244
2244
  React8.useEffect(() => {
2245
- if (exit !== "parent") return;
2246
- timer.current = setTimeout(() => {
2247
- timer.current = null;
2248
- setExit(null);
2249
- }, durationMs);
2250
- return cancel;
2251
- }, [exit, durationMs, cancel]);
2252
- React8.useEffect(() => {
2253
- if (!open2 && exit === null) cancel();
2254
- }, [open2, exit, cancel]);
2255
- React8.useEffect(() => cancel, [cancel]);
2245
+ if (!exiting) return;
2246
+ const timer = setTimeout(() => setExiting(false), durationMs);
2247
+ return () => clearTimeout(timer);
2248
+ }, [exiting, durationMs]);
2256
2249
  const close2 = React8.useCallback(() => {
2257
- if (!onClose || !open2) return;
2258
- cancel();
2259
- setExit("self");
2260
- timer.current = setTimeout(() => {
2261
- timer.current = null;
2262
- onClose();
2263
- }, durationMs);
2264
- }, [onClose, open2, durationMs, cancel]);
2265
- const exiting = exit === "parent";
2266
- return { closing: exit !== null, close: close2, rendered: open2 || exiting, exiting };
2250
+ if (onClose && open2) onClose();
2251
+ }, [onClose, open2]);
2252
+ return { closing: exiting, close: close2, rendered: open2 || exiting, exiting };
2267
2253
  }
2268
2254
 
2269
2255
  // src/kits/inertWhen.ts
@@ -8397,6 +8383,7 @@ function ReferenceList(props) {
8397
8383
  className: "fd-ref-section",
8398
8384
  title: s.title,
8399
8385
  subtitle: s.subtitle,
8386
+ actions: s.actions,
8400
8387
  badge: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "fd-badge fd-badge-count", children: searching ? `${shown.length} of ${s.entries.length}` : s.entries.length }),
8401
8388
  open: open2,
8402
8389
  onToggle: (next) => {