{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "site-shell",
  "title": "Site Shell",
  "description": "The whole shell of a site in one order: theme provider, skip link, header, page, footer and a theme control.",
  "dependencies": [
    "@vllnt/ui@^0.3.0"
  ],
  "registryDependencies": [],
  "files": [
    {
      "path": "registry/default/site-shell/site-shell.tsx",
      "content": "import type { ReactNode } from \"react\";\n\nimport { SiteMain } from \"@vllnt/ui\";\nimport { SiteFrame } from \"@vllnt/ui\";\nimport { ThemeBar } from \"@vllnt/ui\";\n\n/**\n * What a visitor can set on a site. Each key holds the text of one setting, and\n * never the props of the component that shows it today.\n */\nexport type SiteShellSettings = {\n  /**\n   * The theme control and its text. Without it the site has no control and\n   * follows the system.\n   */\n  theme?: {\n    label: string;\n    /** The text of each choice. */\n    options: Record<\"dark\" | \"light\" | \"system\", string>;\n  };\n};\n\n/** Props for {@link SiteShell}. */\nexport type SiteShellProps = {\n  /** The page. */\n  children: ReactNode;\n  /** The footer: `SiteFooter`, or the app's own component around it. */\n  footer: ReactNode;\n  /** The header: `SiteHeader`, or the app's own component around it. */\n  header: ReactNode;\n  /** Classes for the `main` element, e.g. `flex-1` in a flex column body. */\n  mainClassName?: string;\n  /** The settings the site offers. The shell decides where each one sits. */\n  settings?: SiteShellSettings;\n  /** The text of the skip link, which jumps to the page. */\n  skipLabel: string;\n};\n\n/**\n * The whole shell of a site, inside `body`: the theme provider, the skip link,\n * the header, the page, the footer and the settings. It holds no brand, link or\n * copy: the header and footer you pass carry them.\n *\n * An app gives the parts and their text; the shell decides the order and where\n * each part sits. So a part that moves in the design (the theme control into a\n * settings panel, say) moves here, and no app layout changes.\n *\n * The order is the skip link, the header, `main#main`, the footer and the theme\n * bar. The footer sits outside `main`. The app keeps `html` and `body`, its\n * fonts and its own providers.\n *\n * @example\n * <SiteShell\n *   footer={<SiteFooter {...footer} />}\n *   header={<SiteHeader {...header} />}\n *   settings={{\n *     theme: {\n *       label: \"Theme\",\n *       options: { dark: \"Dark\", light: \"Light\", system: \"System\" },\n *     },\n *   }}\n *   skipLabel=\"Skip to content\"\n * >\n *   {children}\n * </SiteShell>\n */\nconst SiteShell = /* @__PURE__ */ named(\n  \"SiteShell\",\n  ({\n    children,\n    footer,\n    header,\n    mainClassName,\n    settings,\n    skipLabel,\n  }: SiteShellProps): React.ReactElement => (\n    <SiteFrame skipLabel={skipLabel}>\n      {header}\n      <SiteMain\n        {...(mainClassName === undefined ? {} : { className: mainClassName })}\n      >\n        {children}\n      </SiteMain>\n      {footer}\n      {settings?.theme ? <ThemeBar {...settings.theme} /> : null}\n    </SiteFrame>\n  ),\n);\n\nexport { SiteShell };\n\nfunction named<TComponent extends object>(\n  displayName: string,\n  component: TComponent,\n): TComponent & { displayName: string };\nfunction named<TComponent extends object, TStatics extends object>(\n  displayName: string,\n  component: TComponent,\n  statics: () => TStatics,\n): TComponent & TStatics & { displayName: string };\nfunction named(\n  displayName: string,\n  component: object,\n  statics?: () => object,\n): object {\n  return Object.assign(component, statics?.(), { displayName });\n}\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component",
  "version": "0.3.0",
  "stability": "stable",
  "platforms": [
    "web"
  ]
}
