import * as react_jsx_runtime from 'react/jsx-runtime'; import * as React from 'react'; import { SecondaryPanelCloseTarget } from './app-shell-slots.js'; import '@exxatdesignux/product-framework'; import '../../lib/nav-active-state.js'; import './nav-render-types.js'; type ClosePanelOptions = { /** * Main app sidebar after the secondary panel closes. * - `restore` (default): snap back to the user's saved preference * (`sidebar_state_v2` cookie, or `defaultOpen` if unset). Use this when * leaving a page whose secondary panel caused an incidental collapse — the * rail returns to the state the user explicitly set elsewhere via ⌘B / the * sidebar button. * - `leave`: only clear the active panel — keep the rail in whatever state it * was in (rare; prefer `restore`). * - `expand`: force the full primary rail open. Use only when the product * explicitly wants the wide rail after dismiss. * - `collapse`: keep the icon rail. Use when the next route also wants compact. */ mainSidebar?: SecondaryPanelCloseTarget; }; type OpenPanelOptions = { /** Icon-only nested rail — used on focus shells (`/library/new`) so scope nav stays compact. */ compact?: boolean; }; interface SecondaryPanelContextValue { /** Currently active panel id, or null if none */ activePanel: string | null; /** * Focus shell (`NewFocusTemplate`) with nested library scope nav — primary * sidebar is hidden; secondary stays on the compact icon rail. */ focusShellSupersedesPrimarySidebar: boolean; /** Open a panel by id. Pass `{ compact: true }` to keep the icon rail. */ openPanel: (id: string, opts?: OpenPanelOptions) => void; /** Close the panel (programmatic / route cleanup). */ closePanel: (opts?: ClosePanelOptions) => void; /** Icon-only nested rail while the panel stays “open”. Cleared by {@link openPanel} / {@link closePanel}. */ secondaryPanelCompact: boolean; /** Narrow icon rail (primary-sidebar-style); keeps {@link activePanel} mounted. */ collapseActiveSecondaryPanel: () => void; /** * Flyout stack (mobile / ≥200% zoom): temporarily hide the secondary overlay * so the primary sidebar underneath is reachable. Cleared by {@link openPanel}. */ secondaryFlyoutHidden: boolean; hideSecondaryFlyout: () => void; showSecondaryFlyout: () => void; /** Flyout sheet visible (mobile / high zoom). False when user closed the sheet but stayed on the hub. */ secondaryFlyoutVisible: boolean; /** Hide the scope sheet only — keeps {@link activePanel} for `/library/all`. */ closeSecondaryFlyout: () => void; /** * Declare an app overlay that must not stay open behind a scope rail, and get * an unregister back. * * The shell already yields the layer to itself — opening a panel collapses the * primary sidebar and closes docked Leo — but Leo was named in this file, so * every other overlay an app owns had no way in. Prefer * {@link useExclusiveShellOverlay}, which registers and unregisters with the * overlay's own open state. */ registerExclusiveOverlay: (close: () => void) => () => void; } declare function useSecondaryPanel(): SecondaryPanelContextValue; /** * Close an app-owned overlay whenever a scope rail takes the layer. * * `open` is the overlay's own state, `close` its own closer: the shell decides * when the layer changes hands, and the overlay keeps deciding what closing * means. Registration follows `open`, so an unmounted or already-closed overlay * is never called. * * Use it for anything that occupies the rail's space or competes for the same * attention — a docked assistant, a drill-in, a persistent side panel. Not for * modal dialogs: those already trap focus, and closing one behind the user's back * loses whatever they were confirming. */ declare function useExclusiveShellOverlay(open: boolean, close: () => void): void; declare function SecondaryPanelProvider({ children }: { children: React.ReactNode; }): react_jsx_runtime.JSX.Element; declare function SecondaryPanel(): react_jsx_runtime.JSX.Element | null; declare function useAutoPanel(panelId: string): void; export { type ClosePanelOptions, type OpenPanelOptions, SecondaryPanel, SecondaryPanelProvider, useAutoPanel, useExclusiveShellOverlay, useSecondaryPanel };