{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "page-layout", "title": "Page Layout", "description": "Responsive page header, body, action, and aside composition.", "dependencies": [ "class-variance-authority" ], "registryDependencies": [ "https://zeron-ui.vercel.app/r/surfaces.json", "https://zeron-ui.vercel.app/r/nav-item.json", "https://zeron-ui.vercel.app/r/nav-menu.json", "utils" ], "files": [ { "path": "src/components/ui/page-layout.tsx", "content": "\"use client\";\n\nimport {\n createContext,\n forwardRef,\n useContext,\n type ComponentPropsWithoutRef,\n type ReactNode,\n} from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"@/lib/utils\";\nimport { NavItem, NavItemTrigger } from \"@/components/ui/nav-item\";\nimport { NavMenu, type NavMenuProps, useNavMenuOptional } from \"@/components/ui/nav-menu\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport type { IconComponent } from \"@/lib/icon-context\";\n\nexport type PageLayoutSize = \"sm\" | \"md\" | \"lg\" | \"full\";\nexport type PageLayoutGutter = \"default\" | \"none\";\nexport type PageSubnavLabelVisibility = \"all\" | \"active\";\n\nconst pageLayoutVariants = cva(\"mx-auto flex h-full w-full min-h-0 min-w-0 flex-col\", {\n variants: {\n size: {\n sm: \"max-w-[40rem]\",\n md: \"max-w-[56rem]\",\n lg: \"max-w-[75rem]\",\n full: \"max-w-none\",\n },\n gutter: {\n default: \"gap-2 p-3\",\n none: \"gap-2 p-0\",\n },\n },\n defaultVariants: { size: \"full\", gutter: \"default\" },\n});\n\nexport interface PageLayoutProps extends ComponentPropsWithoutRef<\"div\">, VariantProps {}\nexport type PageHeaderProps = ComponentPropsWithoutRef<\"header\">;\nexport interface PageHeaderContentProps extends ComponentPropsWithoutRef<\"div\"> {\n /** Optional decorative icon rendered before the header content. */\n icon?: IconComponent;\n}\nexport type PageTitleProps = ComponentPropsWithoutRef<\"h1\">;\nexport type PageDescriptionProps = ComponentPropsWithoutRef<\"p\">;\nexport type PageActionsProps = ComponentPropsWithoutRef<\"div\">;\nexport type PageContentProps = ComponentPropsWithoutRef<\"div\">;\nexport type PageBodyProps = ComponentPropsWithoutRef<\"div\">;\nexport type PageSubnavProps = ComponentPropsWithoutRef<\"nav\">;\nexport interface PageSubnavListProps extends Omit {\n /** Shows every icon label, or only the active item's label. Requires item icons for the collapsed state. */\n labelVisibility?: PageSubnavLabelVisibility;\n children: ReactNode;\n}\nexport interface PageSubnavItemProps extends useRender.ComponentProps<\"a\"> {\n /** Stable identifier used by PageSubnavList to determine the active link. */\n value: string;\n active?: boolean;\n /** Optional icon displayed before the item label. */\n icon?: IconComponent;\n /** Accessible label used when labelVisibility=\"active\" hides this item's visible label. */\n label?: string;\n}\n\nconst PageSubnavListContext = createContext<{ labelVisibility: PageSubnavLabelVisibility }>({\n labelVisibility: \"all\",\n});\n\nconst PageLayout = forwardRef(({ size, gutter, className, ...props }, ref) => (\n
\n));\n\nPageLayout.displayName = \"PageLayout\";\n\nconst PageHeader = forwardRef(({ className, ...props }, ref) => (\n
\n));\n\nPageHeader.displayName = \"PageHeader\";\n\nconst PageHeaderContent = forwardRef(\n ({ icon: Icon, className, children, ...props }, ref) => (\n \n {Icon && }\n {children}\n
\n )\n);\n\nPageHeaderContent.displayName = \"PageHeaderContent\";\n\nconst PageTitle = forwardRef(({ className, ...props }, ref) => (\n

\n));\n\nPageTitle.displayName = \"PageTitle\";\n\nconst PageDescription = forwardRef(({ className, ...props }, ref) => (\n

\n));\n\nPageDescription.displayName = \"PageDescription\";\n\nconst PageActions = forwardRef(({ className, ...props }, ref) => (\n

\n));\n\nPageActions.displayName = \"PageActions\";\n\nconst PageContent = forwardRef(({ className, ...props }, ref) => (\n \n));\n\nPageContent.displayName = \"PageContent\";\n\nconst PageBody = forwardRef(({ className, ...props }, ref) => (\n
\n));\n\nPageBody.displayName = \"PageBody\";\n\nconst PageSubnav = forwardRef(({ className, ...props }, ref) => (\n