"use client" import * as React from "react" import { EDGE_RESIZE_HANDLE_CLASS, EDGE_RESIZE_HANDLE_LEFT_CLASS, startEdgeResizeDrag, verticalResizeSeparatorAria, } from "../../lib/edge-resize-handle" import { usePersistedState } from "../../lib/persisted-state" import { NAV_FLYOUT_CHROME, NAV_FLYOUT_INSET_LEFT, NAV_FLYOUT_INSET_RIGHT, NAV_FLYOUT_INSET_Y, SECONDARY_PANEL_BODY_STACK, navFlyoutMaxWidth, } from "../../lib/nav-flyout-inset" import { cn } from "../../lib/utils" export const SECONDARY_PANEL_WIDTH_DEFAULT = 256 export const SECONDARY_PANEL_WIDTH_MIN = 200 export const SECONDARY_PANEL_WIDTH_MAX = 480 export const SECONDARY_PANEL_WIDTH_KEY = "shell:secondary-panel-width" /** Default width for the Ask Leo right rail (panel mode). */ export const ASK_LEO_PANEL_WIDTH_DEFAULT = 320 export const ASK_LEO_PANEL_WIDTH_KEY = "shell:ask-leo-panel-width" export function clampSecondaryPanelWidth(width: number) { return Math.min( SECONDARY_PANEL_WIDTH_MAX, Math.max(SECONDARY_PANEL_WIDTH_MIN, width), ) } export interface NestedSecondaryPanelShellProps { /** When false, the shell is visually hidden (no width). */ open: boolean /** Icon-only rail (same width token as primary `Sidebar` collapsible icon mode). */ compact: boolean /** * High-zoom / mobile flyout — fixed panel stacked above the shell edge * (same anchor, higher z-index). Takes no flex layout space. */ overlay?: false | "mobile" | "desktop" /** Rail side — secondary nav is left; Ask Leo is right. */ side?: "left" | "right" /** `data-slot` on the outer `