{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "collapsible-advanced-options",
  "title": "Collapsible Advanced Options",
  "description": "The Advanced options disclosure at the foot of a form that says how many hidden settings were changed and can start open to reveal an error.",
  "registryDependencies": [
    "collapsible"
  ],
  "files": [
    {
      "path": "registry/patterns/collapsible-advanced-options/collapsible-advanced-options.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { ChevronRightIcon } from \"lucide-react\"\n\nimport {\n  Collapsible,\n  CollapsibleContent,\n  CollapsibleTrigger,\n} from \"@/components/ui/collapsible\"\n\nexport interface CollapsibleAdvancedOptionsProps {\n  children: React.ReactNode\n  /** Number of advanced fields currently changed from their defaults. */\n  changedCount?: number\n  label?: string\n  defaultOpen?: boolean\n}\n\n/**\n * The \"Advanced options\" disclosure at the foot of a form. When advanced fields\n * have been changed it says so in the label (\"Advanced options, 2 changed\") so\n * hidden settings are never a surprise, it opens by itself when asked to\n * show an error inside it (`defaultOpen`), and the chevron turns without\n * motion under `prefers-reduced-motion`.\n */\nexport function CollapsibleAdvancedOptions({\n  children,\n  changedCount = 0,\n  label = \"Advanced options\",\n  defaultOpen = false,\n}: CollapsibleAdvancedOptionsProps) {\n  return (\n    <Collapsible defaultOpen={defaultOpen} className=\"rounded-md border\">\n      <CollapsibleTrigger className=\"group focus-visible:ring-ring flex w-full items-center gap-2 rounded-md px-3 py-2 text-start text-sm font-medium outline-none focus-visible:ring-2\">\n        <ChevronRightIcon\n          aria-hidden=\"true\"\n          className=\"size-4 transition-transform group-data-[state=open]:rotate-90 motion-reduce:transition-none\"\n        />\n        {label}\n        {changedCount > 0 ? (\n          <span className=\"text-muted-foreground text-xs font-normal\">\n            <span className=\"sr-only\">, </span>\n            {changedCount} changed\n          </span>\n        ) : null}\n      </CollapsibleTrigger>\n      <CollapsibleContent className=\"grid gap-3 border-t p-3\">\n        {children}\n      </CollapsibleContent>\n    </Collapsible>\n  )\n}\n",
      "type": "registry:block"
    }
  ],
  "type": "registry:block"
}