@flytedan/flytebot-design-system 0.76.0 → 0.77.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
@@ -930,6 +930,7 @@ __export(index_exports, {
930
930
  CHAT_UNAVAILABLE: () => CHAT_UNAVAILABLE,
931
931
  COPIED_FEEDBACK_MS: () => COPIED_FEEDBACK_MS,
932
932
  CORNER_STACK_INSET_PROPERTY: () => CORNER_STACK_INSET_PROPERTY,
933
+ CORNER_STACK_OFFSET_PROPERTY: () => CORNER_STACK_OFFSET_PROPERTY,
933
934
  Calendar: () => Calendar,
934
935
  Card: () => Card,
935
936
  CardGrid: () => CardGrid,
@@ -1036,6 +1037,7 @@ __export(index_exports, {
1036
1037
  RoadmapTimeline: () => RoadmapTimeline,
1037
1038
  RunActions: () => RunActions,
1038
1039
  RuntimeKit: () => RuntimeKit,
1040
+ SHEET_OPEN_ATTRIBUTE: () => SHEET_OPEN_ATTRIBUTE,
1039
1041
  SaturationDistribution: () => SaturationDistribution,
1040
1042
  ScoreMeter: () => ScoreMeter,
1041
1043
  ScreenHead: () => ScreenHead,
@@ -1140,10 +1142,12 @@ __export(index_exports, {
1140
1142
  useLayerZIndex: () => useLayerZIndex,
1141
1143
  useOverlayLayout: () => useOverlayLayout,
1142
1144
  usePopoverPosition: () => usePopoverPosition,
1145
+ usePublishCornerStackOffset: () => usePublishCornerStackOffset,
1143
1146
  useResponsiveRail: () => useResponsiveRail,
1144
1147
  useRuntimeMode: () => useRuntimeMode,
1145
1148
  useServerTable: () => useServerTable,
1146
1149
  useSessionContext: () => useSessionContext,
1150
+ useSheetOpenMark: () => useSheetOpenMark,
1147
1151
  useStackedLayer: () => useStackedLayer,
1148
1152
  useStagedFiles: () => useStagedFiles,
1149
1153
  useToast: () => useToast,
@@ -2423,6 +2427,30 @@ function CornerStackPortal({ slot, children }) {
2423
2427
  const element = useCornerStackSlot(slot);
2424
2428
  return element ? (0, import_react_dom5.createPortal)(children, element) : null;
2425
2429
  }
2430
+ var CORNER_STACK_OFFSET_PROPERTY = "--fd-corner-stack-offset";
2431
+ var SHEET_OPEN_ATTRIBUTE = "data-fd-sheet-open";
2432
+ function usePublishCornerStackOffset(ref, active) {
2433
+ useSlotEffect(() => {
2434
+ const el = ref.current;
2435
+ if (!active || !el) return;
2436
+ const root = document.documentElement;
2437
+ const publish = () => root.style.setProperty(CORNER_STACK_OFFSET_PROPERTY, `${el.getBoundingClientRect().width}px`);
2438
+ publish();
2439
+ const observer = typeof ResizeObserver === "function" ? new ResizeObserver(publish) : null;
2440
+ observer?.observe(el);
2441
+ return () => {
2442
+ observer?.disconnect();
2443
+ root.style.removeProperty(CORNER_STACK_OFFSET_PROPERTY);
2444
+ };
2445
+ }, [ref, active]);
2446
+ }
2447
+ function useSheetOpenMark(active) {
2448
+ useSlotEffect(() => {
2449
+ if (!active) return;
2450
+ document.documentElement.setAttribute(SHEET_OPEN_ATTRIBUTE, "");
2451
+ return () => document.documentElement.removeAttribute(SHEET_OPEN_ATTRIBUTE);
2452
+ }, [active]);
2453
+ }
2426
2454
 
2427
2455
  // src/components/loading/ProgressBar.tsx
2428
2456
  var import_jsx_runtime14 = require("react/jsx-runtime");
@@ -2819,6 +2847,8 @@ function DockedSidePanel({ open: open2, children: childrenNow, ...widthOptions }
2819
2847
  const { width, setWidth } = useResizableWidth(widthOptions);
2820
2848
  const drag = React19.useRef(null);
2821
2849
  const [resizing, setResizing] = React19.useState(false);
2850
+ const boxRef = React19.useRef(null);
2851
+ usePublishCornerStackOffset(boxRef, rendered);
2822
2852
  if (!rendered) return null;
2823
2853
  const onPointerDown = (e) => {
2824
2854
  e.preventDefault();
@@ -2842,6 +2872,7 @@ function DockedSidePanel({ open: open2, children: childrenNow, ...widthOptions }
2842
2872
  return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2843
2873
  "div",
2844
2874
  {
2875
+ ref: boxRef,
2845
2876
  className: ["fd-sidepanel", animateEnter ? "is-entering" : "", closing ? "is-closing" : "", resizing ? "is-resizing" : ""].filter(Boolean).join(" "),
2846
2877
  "data-open": open2 ? "true" : "false",
2847
2878
  style: { width },
@@ -2903,6 +2934,7 @@ function AppShell({
2903
2934
  initialOpen: initialNavOpen,
2904
2935
  onPersist: onNavOpenChange
2905
2936
  });
2937
+ useSheetOpenMark(Boolean(sidePanel?.open) && rail.overlay);
2906
2938
  return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
2907
2939
  "div",
2908
2940
  {
@@ -16632,6 +16664,7 @@ function useDocumentTitle(routeTitle, appName) {
16632
16664
  CHAT_UNAVAILABLE,
16633
16665
  COPIED_FEEDBACK_MS,
16634
16666
  CORNER_STACK_INSET_PROPERTY,
16667
+ CORNER_STACK_OFFSET_PROPERTY,
16635
16668
  Calendar,
16636
16669
  Card,
16637
16670
  CardGrid,
@@ -16738,6 +16771,7 @@ function useDocumentTitle(routeTitle, appName) {
16738
16771
  RoadmapTimeline,
16739
16772
  RunActions,
16740
16773
  RuntimeKit,
16774
+ SHEET_OPEN_ATTRIBUTE,
16741
16775
  SaturationDistribution,
16742
16776
  ScoreMeter,
16743
16777
  ScreenHead,
@@ -16842,10 +16876,12 @@ function useDocumentTitle(routeTitle, appName) {
16842
16876
  useLayerZIndex,
16843
16877
  useOverlayLayout,
16844
16878
  usePopoverPosition,
16879
+ usePublishCornerStackOffset,
16845
16880
  useResponsiveRail,
16846
16881
  useRuntimeMode,
16847
16882
  useServerTable,
16848
16883
  useSessionContext,
16884
+ useSheetOpenMark,
16849
16885
  useStackedLayer,
16850
16886
  useStagedFiles,
16851
16887
  useToast,