import { Box } from '@luke-ui/react/box'; import { Button } from '@luke-ui/react/button'; import { IconButton } from '@luke-ui/react/icon-button'; import { Stack } from '@luke-ui/react/stack'; import { Text } from '@luke-ui/react/text'; import { rootClassName, vars } from '@luke-ui/react/theme'; import { cx } from '@luke-ui/react/utils'; import { useRouterState } from '@tanstack/react-router'; import type { Root } from 'fumadocs-core/page-tree'; import type { CSSProperties } from 'react'; import { useState } from 'react'; import { Dialog, DialogTrigger } from 'react-aria-components/Dialog'; import { Modal, ModalOverlay } from 'react-aria-components/Modal'; import { useIsDocsSidebarLayout } from '../lib/docs-container-queries.js'; import { getActiveSiteDestination, siteDestinations } from '../lib/site-destinations.js'; import { DocsNav, DocsNavLink, docsNavPaneProps } from './docs-nav.js'; import * as styles from './docs-shell.css.js'; import { SiteNav } from './site-nav.js'; const drawerSiteNavBorder = { borderBlockEnd: `1px solid ${vars.color.border.decorative}`, } as const satisfies CSSProperties; export function DocsSiteNav({ tree }: { tree: Root }) { const pathname = useRouterState({ select: (state) => state.location.pathname }); const activeDestination = getActiveSiteDestination(pathname); const isDocsSidebarLayout = useIsDocsSidebarLayout(); const [isDrawerOpen, setIsDrawerOpen] = useState(false); // Crossing into the desktop layout must drop modal state, not only hide the dialog with CSS. if (isDocsSidebarLayout && isDrawerOpen) { setIsDrawerOpen(false); } return ( {/* No bars/menu glyph in the Luke UI set; match the Theme labelled control. */} {({ close }) => ( Navigation {siteDestinations.map((destination) => ( {destination.label} ))} )} ); }