{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "app-shell",
  "type": "registry:ui",
  "title": "AppShell",
  "description": "AppShell is the full-height frame a screen sits in: the Sidebar and the page, in the app's visual direction (flat, frame or inset) set by one prop.",
  "dependencies": [
    "class-variance-authority@^0.7.1"
  ],
  "registryDependencies": [
    "https://wideset.co/r/styles.json",
    "https://wideset.co/r/utils.json"
  ],
  "files": [
    {
      "path": "src/components/app-shell/AppShell.context.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/app-shell/AppShell.context.tsx",
      "content": "'use client';\n\nimport * as React from 'react';\n\nimport type { AppShellContextValue } from './AppShell.types';\n\n/** Read without the hook by parts that also work outside a shell (`Sidebar`). */\nexport const AppShellContext = React.createContext<AppShellContextValue | undefined>(undefined);\n\nexport const useAppShellContext = () => {\n  const context = React.useContext(AppShellContext);\n\n  if (context === undefined) {\n    throw new Error('useAppShellContext must be used within a <AppShell>');\n  }\n\n  return context;\n};\n"
    },
    {
      "path": "src/components/app-shell/AppShell.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/app-shell/AppShell.tsx",
      "content": "'use client';\n\nimport * as React from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport { AppShellContext } from './AppShell.context';\nimport type { AppShellProps, AppShellWithSubComponents } from './AppShell.types';\nimport { appShellVariants } from './AppShell.variants';\nimport { AppShellMain } from './AppShellMain';\n\nconst AppShell = React.forwardRef<HTMLDivElement, AppShellProps>(\n  ({ direction = 'inset', className, children, ...props }, ref) => {\n    const contextValue = React.useMemo(() => ({ direction }), [direction]);\n\n    return (\n      <AppShellContext.Provider value={contextValue}>\n        <div\n          ref={ref}\n          data-slot=\"app-shell\"\n          data-direction={direction}\n          className={cn(appShellVariants({ direction }), className)}\n          {...props}\n        >\n          {children}\n        </div>\n      </AppShellContext.Provider>\n    );\n  },\n) as AppShellWithSubComponents;\n\nAppShell.displayName = 'AppShell';\nAppShell.Main = AppShellMain;\n\nexport { AppShell };\n"
    },
    {
      "path": "src/components/app-shell/AppShell.types.ts",
      "type": "registry:ui",
      "target": "components/ui/wideset/app-shell/AppShell.types.ts",
      "content": "import type { VariantProps } from 'class-variance-authority';\nimport type * as React from 'react';\n\nimport type { appShellVariants } from './AppShell.variants';\nimport type { AppShellMain } from './AppShellMain';\n\n/** The app's visual direction: how the navigation and the page meet the window. */\nexport type AppShellDirection = NonNullable<VariantProps<typeof appShellVariants>['direction']>;\n\n/** Props for the full-height row that holds the `Sidebar` and `AppShell.Main`. */\nexport type AppShellProps = React.HTMLAttributes<HTMLDivElement> & {\n  /**\n   * The app's visual direction, chosen once for the whole app. A `Sidebar` inside takes the\n   * matching surface on its own; its `surface` prop overrides it.\n   * `inset`: the sidebar on the grey app frame, the page a raised white card inside it. The\n   * default, for apps with navigation and several regions.\n   * `flat`: one white surface; a line splits the sidebar from the page. For simple, dense tools.\n   * `frame`: the sidebar on a grey tint, the page white and full-bleed. For side-by-side panels.\n   * `canvas`: a grey page whose content sits in white sections, usually under a top bar. For pages\n   * made of separate modules (an overview, a wallet).\n   * @default 'inset'\n   */\n  direction?: AppShellDirection;\n  /** A `Sidebar` (or another navigation) followed by `AppShell.Main`. */\n  children?: React.ReactNode;\n};\n\n/** Props for the page area: a `<main>` styled for the shell's direction. */\nexport type AppShellMainProps = React.HTMLAttributes<HTMLElement> & {\n  /** The page: its header and content. `AppShell.Main` is its only scroll container. */\n  children?: React.ReactNode;\n};\n\nexport type AppShellContextValue = {\n  direction: AppShellDirection;\n};\n\nexport type AppShellWithSubComponents = React.ForwardRefExoticComponent<\n  AppShellProps & React.RefAttributes<HTMLDivElement>\n> & {\n  Main: typeof AppShellMain;\n};\n"
    },
    {
      "path": "src/components/app-shell/AppShell.variants.ts",
      "type": "registry:ui",
      "target": "components/ui/wideset/app-shell/AppShell.variants.ts",
      "content": "import { cva } from 'class-variance-authority';\n\n/**\n * The full-height row the sidebar and the page sit in. Flat and Frame lay everything on the\n * page's white (Static/Fill/Foreground); Inset shows the grey app frame (Static/Fill/Background)\n * around a raised page, as Figma's Screens › Calendar; Canvas makes that grey the page itself, as\n * Figma's Screens › Crypto.\n */\nexport const appShellVariants = cva('flex h-dvh', {\n  variants: {\n    direction: {\n      flat: 'bg-ws-static-foreground',\n      frame: 'bg-ws-static-foreground',\n      inset: 'bg-ws-static-background',\n      canvas: 'bg-ws-static-background',\n    },\n  },\n  defaultVariants: { direction: 'inset' },\n});\n\n/**\n * The page. Flat and Frame: full-bleed, the only scroll container. Inset: a white card 12px from\n * the top, right and bottom and 8px from the sidebar, 16px radius, `shadow-ws-low`; the page\n * scrolls inside it, so its corners stay put. Canvas: full-bleed on the grey, no fill of its own;\n * the screen's white sections are its content.\n */\nexport const appShellMainVariants = cva('ws-scrollbar min-w-0 flex-1 overflow-y-auto', {\n  variants: {\n    direction: {\n      flat: '',\n      frame: '',\n      inset:\n        'bg-ws-static-foreground rounded-ws-container-lg shadow-ws-low my-ws-7 mr-ws-7 ml-ws-5 relative flex flex-col',\n      canvas: '',\n    },\n  },\n  defaultVariants: { direction: 'inset' },\n});\n"
    },
    {
      "path": "src/components/app-shell/AppShellMain.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/app-shell/AppShellMain.tsx",
      "content": "'use client';\n\nimport * as React from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport { useAppShellContext } from './AppShell.context';\nimport type { AppShellMainProps } from './AppShell.types';\nimport { appShellMainVariants } from './AppShell.variants';\n\nconst AppShellMain = React.forwardRef<HTMLElement, AppShellMainProps>(\n  ({ className, ...props }, ref) => {\n    const { direction } = useAppShellContext();\n\n    return (\n      <main\n        ref={ref}\n        data-slot=\"app-shell-main\"\n        className={cn(appShellMainVariants({ direction }), className)}\n        {...props}\n      />\n    );\n  },\n);\n\nAppShellMain.displayName = 'AppShell.Main';\n\nexport { AppShellMain };\n"
    }
  ],
  "meta": {
    "version": "1.1.0",
    "commit": "a734f9f0"
  }
}
