{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "section-shell",
  "title": "Section Shell",
  "files": [
    {
      "path": "components/ui/section-shell.tsx",
      "content": "import * as React from \"react\"\nimport { cn } from \"cn\"\n\ntype SectionShellContextValue = {\n  activeValue?: string\n  setActiveValue: (value: string) => void\n}\n\nconst SectionShellContext = React.createContext<SectionShellContextValue | null>(null)\n\nfunction SectionShell({\n  className,\n  value,\n  defaultValue,\n  onValueChange,\n  ...props\n}: React.ComponentProps<\"section\"> & {\n  value?: string\n  defaultValue?: string\n  onValueChange?: (value: string) => void\n}) {\n  const [uncontrolledValue, setUncontrolledValue] = React.useState(defaultValue)\n  const activeValue = value ?? uncontrolledValue\n  const setActiveValue = React.useCallback(\n    (nextValue: string) => {\n      if (value === undefined) setUncontrolledValue(nextValue)\n      onValueChange?.(nextValue)\n    },\n    [onValueChange, value]\n  )\n\n  const context = React.useMemo(\n    () => ({ activeValue, setActiveValue }),\n    [activeValue, setActiveValue]\n  )\n\n  return (\n    <SectionShellContext.Provider value={context}>\n      <section data-slot=\"section-shell\" className={cn(\"space-y-6\", className)} {...props} />\n    </SectionShellContext.Provider>\n  )\n}\n\nfunction SectionShellHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n  return <div data-slot=\"section-shell-header\" className={cn(\"flex items-start justify-between gap-4\", className)} {...props} />\n}\n\nfunction SectionShellTitle({ className, ...props }: React.ComponentProps<\"h2\">) {\n  return <h2 data-slot=\"section-shell-title\" className={cn(\"text-lg font-medium tracking-tight\", className)} {...props} />\n}\n\nfunction SectionShellDescription({ className, ...props }: React.ComponentProps<\"p\">) {\n  return <p data-slot=\"section-shell-description\" className={cn(\"mt-1 text-sm text-muted-foreground\", className)} {...props} />\n}\n\nfunction SectionShellContent({ className, ...props }: React.ComponentProps<\"div\">) {\n  return <div data-slot=\"section-shell-content\" className={cn(\"min-w-0\", className)} {...props} />\n}\n\nfunction SectionShellPanel({\n  className,\n  value,\n  ...props\n}: React.ComponentProps<\"div\"> & { value?: string }) {\n  const context = React.useContext(SectionShellContext)\n  if (value && context?.activeValue && value !== context.activeValue) return null\n\n  return (\n    <div\n      role={value ? \"tabpanel\" : undefined}\n      data-slot=\"section-shell-panel\"\n      data-value={value}\n      className={cn(\"min-w-0\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction SectionShellNav({ className, ...props }: React.ComponentProps<\"nav\">) {\n  return <nav data-slot=\"section-shell-nav\" className={cn(\"flex gap-1 overflow-x-auto border-b\", className)} {...props} />\n}\n\nfunction SectionShellNavItem({\n  className,\n  active = false,\n  href,\n  value,\n  onClick,\n  ...props\n}: React.ComponentProps<\"button\"> & {\n  active?: boolean\n  href?: string\n  value?: string\n}) {\n  const context = React.useContext(SectionShellContext)\n  const isActive = active || Boolean(value && context?.activeValue === value)\n  const Component = (href ? \"a\" : \"button\") as React.ElementType\n  return (\n    <Component\n      {...(!href ? { type: \"button\" } : { href })}\n      data-slot=\"section-shell-nav-item\"\n      data-active={isActive ? \"true\" : undefined}\n      role=\"tab\"\n      aria-selected={isActive}\n      className={cn(\n        \"border-b-2 border-transparent px-1 py-2 text-sm text-muted-foreground transition-colors hover:text-foreground\",\n        \"data-[active=true]:border-foreground data-[active=true]:text-foreground\",\n        className\n      )}\n      {...props}\n      onClick={(event: React.MouseEvent<HTMLElement>) => {\n        if (value && !href) context?.setActiveValue(value)\n        onClick?.(event as React.MouseEvent<HTMLButtonElement>)\n      }}\n    />\n  )\n}\n\nexport {\n  SectionShell,\n  SectionShellContent,\n  SectionShellDescription,\n  SectionShellHeader,\n  SectionShellNav,\n  SectionShellNavItem,\n  SectionShellPanel,\n  SectionShellTitle,\n}\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}