Files
buzz/desktop/src/shared/ui/OverlayPanelBackdrop.tsx
Taylor Ho e6738c5015 refactor(desktop): centralize auxiliary panel shell (#1343)
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: npub1223z34hd7vtwc6qj4s7flsxkj644nlre2nthu7lrrmkumhu3xddsrx9r6w <52a228d6edf316ec6812ac3c9fc0d696ab59fc7954d77e7be31eedcddf91335b@sprout-oss.stage.blox.sqprod.co>
2026-06-29 16:19:48 -06:00

41 lines
1.4 KiB
TypeScript

/**
* Shared constants and backdrop for thread/agent overlay panels
* that slide in from the right at narrow viewport widths.
*/
/** Base classes for every side panel `<aside>`. */
export const PANEL_BASE_CLASS =
"relative flex h-full shrink-0 flex-col border-l border-border/80 bg-background";
/**
* Extra classes applied when the panel is rendered as a floating overlay.
*
* Starts below the fixed top chrome (window drag region + global search and
* channel actions, ~44px tall) so the panel header doesn't collide with it at
* narrow widths. Matches the inline layout where the header sits below chrome.
*
* `h-auto` overrides the base `h-full`: with `fixed top-11 bottom-0`, height is
* driven by the top/bottom insets. Without it, `h-full` resolves to 100vh and
* the panel hangs below the viewport (100vh tall, but starting 44px down).
*/
export const PANEL_OVERLAY_CLASS =
"fixed bottom-0 right-0 top-11 z-40 h-auto shadow-xl max-w-[calc(100vw-2rem)]";
export const PANEL_ENTER_MOTION_CLASS = "buzz-side-panel-enter";
export const PANEL_ENTER_BASE_CLASS = `${PANEL_BASE_CLASS} ${PANEL_ENTER_MOTION_CLASS}`;
type OverlayPanelBackdropProps = {
onClose: () => void;
};
export function OverlayPanelBackdrop({ onClose }: OverlayPanelBackdropProps) {
return (
<div
className="fixed inset-0 z-30 bg-black/20"
onClick={onClose}
aria-hidden="true"
/>
);
}