import type { ReactNode } from 'react'
import { cn } from './cn'
import { Card } from './Card'
import { ScrollArea } from './ScrollArea'
import { SidebarOnGround } from './Sidebar'
import { TopBar } from './TopBar'
/**
* The frame of an app, in the manners that pair with the TopBar's
* (Katerina, 2026-09-02: the two shells go together — the solid bar with
* the sidebar, the floating bar with the rail):
*
* - `solid` — the structured frame: a solid TopBar, the navigation
* column, the content beside it, sidebar and main scrolling
* independently (2026-09-02, verbatim from the structured app).
* - `floating` — the floating frame: the TopBar floats over the top
* edge, the rail stands on the app background, and the content lives
* in the rounded card beside it (2026-09-02, the floating app's frame
* geometry; its collapse animation and launcher stay in the app).
* - `inset` — the structured frame, the other way round: the TopBar and
* the Sidebar stand on the ground, and the content is a lighter card
* beside them (Katerina, 28 September: Linear's layout, in any theme).
*
* The banner belongs to the content area (her ruling, 2026-09-02): it
* renders at the top of the main column — inside the card, in the
* floating manner — never across the navigation.
*
* Layout only. What goes in each region is the caller's; this component
* has no data and no routes.
*/
export interface AppShellProps {
variant?: 'solid' | 'floating' | 'inset'
/** The top bar's menu button, in an app whose navigation collapses. */
menu?: ReactNode
/** The top bar's left: the app's logo mark, or its name as text. */
logo?: ReactNode
/** The top bar's centre: something of the caller's own. */
search?: ReactNode
/** What searching opens: the top bar then draws its search field and answers Ctrl+K (`TopBar`'s `onSearch`). */
onSearch?: () => void
/** The words in the top bar's search field. */
searchPlaceholder?: string
/** The top bar's right cluster — an `IdentityMenu`. */
identity?: ReactNode
/** A `Banner`, or nothing — drawn at the top of the content area. */
banner?: ReactNode
/** The navigation: a `Sidebar` in the solid manner, a `Rail` in the floating one. */
nav: ReactNode
children: ReactNode
}
export function AppShell({ variant = 'solid', menu, logo, search, onSearch, searchPlaceholder, identity, banner, nav, children }: AppShellProps) {
const bar =