{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "disclosure",
  "title": "Disclosure",
  "description": "A line of muted text with a chevron that shows or hides what is under it, such as a tool call’s input and output or a model’s reasoning.",
  "files": [
    {
      "path": "registry/components/dashboardblocks/disclosure.tsx",
      "content": "'use client'\n\nimport { IconPlaceholder } from '@/registry/icons/icon-placeholder'\nimport { type ComponentProps, createContext, useContext, useId, useState } from 'react'\n\nimport { cn } from '@/lib/utils'\n\ninterface DisclosureContextValue {\n  contentId: string\n  open: boolean\n  setOpen: (open: boolean) => void\n}\n\nconst DisclosureContext = createContext<DisclosureContextValue | null>(null)\n\nfunction useDisclosure() {\n  const context = useContext(DisclosureContext)\n  if (!context) throw new Error('Disclosure parts must be inside a Disclosure.')\n  return context\n}\n\ninterface DisclosureProps extends ComponentProps<'div'> {\n  defaultOpen?: boolean\n  onOpenChange?: (open: boolean) => void\n  open?: boolean\n}\n\n/** A line of muted text that shows or hides what's under it: a tool's input and output, a model's reasoning, a system prompt. */\nfunction Disclosure({\n  className,\n  defaultOpen = false,\n  onOpenChange,\n  open: openProp,\n  ...props\n}: DisclosureProps) {\n  const contentId = useId()\n  const [uncontrolled, setUncontrolled] = useState(defaultOpen)\n  const open = openProp ?? uncontrolled\n\n  function setOpen(next: boolean) {\n    setUncontrolled(next)\n    onOpenChange?.(next)\n  }\n\n  return (\n    <DisclosureContext.Provider value={{ contentId, open, setOpen }}>\n      <div\n        data-slot='disclosure'\n        data-open={open || undefined}\n        className={cn('flex min-w-0 flex-col items-start gap-2', className)}\n        {...props}\n      />\n    </DisclosureContext.Provider>\n  )\n}\n\nfunction DisclosureTrigger({\n  children,\n  className,\n  onClick,\n  ...props\n}: ComponentProps<'button'>) {\n  const { contentId, open, setOpen } = useDisclosure()\n  return (\n    <button\n      data-slot='disclosure-trigger'\n      type='button'\n      aria-expanded={open}\n      aria-controls={contentId}\n      onClick={(event) => {\n        onClick?.(event)\n        if (!event.defaultPrevented) setOpen(!open)\n      }}\n      className={cn(\n        'text-muted-foreground hover:text-foreground focus-visible:ring-ring/50 flex min-w-0 items-start gap-1 rounded-sm text-start text-sm text-pretty outline-none focus-visible:ring-3 [&_svg]:mt-0.5 [&_svg]:size-4 [&_svg]:shrink-0',\n        className,\n      )}\n      {...props}\n    >\n      <span className='min-w-0 break-words'>{children}</span>\n      <IconPlaceholder\n        lucide='ChevronRightIcon'\n        tabler='IconChevronRight'\n        hugeicons='ArrowRight01Icon'\n        phosphor='CaretRightIcon'\n        remixicon='RiArrowRightSLine'\n        aria-hidden\n        className={cn(\n          'motion-safe:transition-transform rtl:-scale-x-100',\n          open && 'rotate-90 rtl:scale-x-100',\n        )}\n      />\n    </button>\n  )\n}\n\nfunction DisclosureContent({ className, ...props }: ComponentProps<'div'>) {\n  const { contentId, open } = useDisclosure()\n  return (\n    <div\n      data-slot='disclosure-content'\n      id={contentId}\n      hidden={!open}\n      className={cn('flex w-full min-w-0 flex-col gap-2', className)}\n      {...props}\n    />\n  )\n}\n\nexport { Disclosure, DisclosureContent, DisclosureTrigger }\n\nexport type { DisclosureProps }\n",
      "type": "registry:component",
      "target": "@components/dashboardblocks/disclosure.tsx"
    }
  ],
  "type": "registry:component"
}
