{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "app-sidebar-rail",
  "type": "registry:block",
  "title": "App sidebar, icon rail",
  "description": "",
  "categories": [
    "app"
  ],
  "dependencies": [
    "zod@^4.6.5"
  ],
  "registryDependencies": [
    "https://ui.klarhimmel.com/r/block-kit.json",
    "https://ui.klarhimmel.com/r/editing.json",
    "https://ui.klarhimmel.com/r/kit-sidebar.json",
    "https://ui.klarhimmel.com/r/sidebar.json",
    "https://ui.klarhimmel.com/r/tooltip.json"
  ],
  "files": [
    {
      "path": "src/blocks/app-sidebar-rail/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/app-sidebar-rail/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, t } from '../_shared/schema';\nimport { sidebarItem } from '../_shared/sidebar-schema';\n\nconst schema = z.object({\n  brand: t(30),\n  /** Names the navigation landmark. Not shown. */\n  navLabel: t(40),\n  items: z.array(sidebarItem).min(1).max(8),\n  /** The label of the page the person is on (matches one item). */\n  active: t(30),\n});\n\nexport const spec = defineSpec({\n  type: 'app-sidebar-rail',\n  aliases: ['app/sidebar-rail'],\n  name: 'App sidebar, icon rail',\n  category: 'app',\n  role: 'nav',\n  description: \"An app's side navigation as a narrow rail of icons beside every page: the product's initial on top and up to eight places whose names show in tooltips (on hover and keyboard focus). On a phone it folds into a menu.\",\n  schema,\n  defaults: {\n    brand: 'Name the product',\n    navLabel: 'Main navigation',\n    items: [\n      { label: 'First page', icon: 'gauge', href: '#overview' },\n      { label: 'Second page', icon: 'book', href: '#bookings' },\n      { label: 'Page three', icon: 'users', href: '#team' },\n      { label: 'Fourth page', icon: 'settings', href: '#settings' },\n    ],\n    active: 'First page',\n  },\n});\n"
    },
    {
      "path": "src/blocks/app-sidebar-rail/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/app-sidebar-rail/index.tsx",
      "content": "import { useId } from 'react';\nimport { Text, withHeadingLevel } from '../../editing';\nimport { TooltipProvider } from '../../ui/tooltip';\nimport { Sidebar, SidebarHeader, SidebarMenu, SidebarNav } from '../../ui/sidebar';\nimport { Place } from '../_shared/sidebar-kit';\nimport { spec } from './spec';\nimport type { BlockProps } from '../types';\nimport type { z } from 'zod';\n\nexport { spec };\ntype Props = z.infer<typeof spec.schema>;\n\n// The rail is 4rem wide: the product's initial on top, each place an icon whose name shows in a tooltip.\nfunction AppSidebarRail({ props }: BlockProps<Props>) {\n  const id = useId();\n  const initial = props.brand.trim().charAt(0);\n  return (\n    <TooltipProvider>\n      <Sidebar\n        rail\n        foldLabel=\"Menu\"\n        className=\"w-16\"\n        header={\n          <SidebarHeader action={initial ? <span aria-hidden className=\"grid size-9 place-items-center rounded-kh bg-kh-ink text-kh-small font-semibold text-kh-on-ink\">{initial}</span> : undefined}>\n            <Text path={['brand']} value={props.brand} as=\"span\" />\n          </SidebarHeader>\n        }\n      >\n        <span id={`${id}-n`} className=\"sr-only\">\n          <Text path={['navLabel']} value={props.navLabel} as=\"span\" />\n        </span>\n        <SidebarNav aria-labelledby={`${id}-n`}>\n          <SidebarMenu>{props.items.map((it, i) => <Place key={i} it={it} path={['items', i]} active={props.active} />)}</SidebarMenu>\n        </SidebarNav>\n      </Sidebar>\n    </TooltipProvider>\n  );\n}\n\nexport default withHeadingLevel(AppSidebarRail);\n"
    }
  ]
}
