{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "accordion-numbered",
  "title": "Numbered accordion",
  "description": "Styled accordion: the Numbered set. 5 decorative accordion variations (CircleAccordion, SquareAccordion, OutlineAccordion, FilledAccordion, GhostAccordion) on the ai2 token system, powered by framer-motion, reduced-motion aware and sized sm to xl. Part of the free styled layer.",
  "dependencies": [
    "motion@^12.42.2",
    "lucide-react@^1.23.0"
  ],
  "registryDependencies": [
    "@ai2/tokens"
  ],
  "files": [
    {
      "path": "registry/ai2/styled/accordion-numbered.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { ChevronDown } from \"lucide-react\"\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\n/* Numbered accordion family: 5 step-numbered accordions. Every row starts with\n   a token step-number chip; the variants change the chip's shape and fill.\n   Every export is a complete accordion: internal single-open state, a button\n   header with aria-expanded, framer height auto animation. Colour comes ONLY\n   from tokens. Alpha via color-mix. Under reduced-motion opening and closing are\n   instant. Size = padding + text scale. Renders without props too. */\n\nexport type StyledSize = \"sm\" | \"md\" | \"lg\" | \"xl\"\n\nexport interface StyledAccordionItem {\n  value: string\n  title: React.ReactNode\n  content: React.ReactNode\n}\n\ninterface StyledAccordionProps {\n  className?: string\n  size?: StyledSize\n  items?: StyledAccordionItem[]\n  defaultOpen?: string\n}\n\nconst headerPad: Record<StyledSize, string> = {\n  sm: \"px-3 py-2.5 text-sm\",\n  md: \"px-4 py-3 text-sm\",\n  lg: \"px-5 py-4 text-base\",\n  xl: \"px-6 py-5 text-lg\",\n}\n\nconst bodyPad: Record<StyledSize, string> = {\n  sm: \"pl-11 pr-3 pb-2.5 text-sm\",\n  md: \"pl-12 pr-4 pb-3 text-sm\",\n  lg: \"pl-14 pr-5 pb-4 text-base\",\n  xl: \"pl-16 pr-6 pb-5 text-base\",\n}\n\nconst iconSize: Record<StyledSize, string> = {\n  sm: \"size-4\",\n  md: \"size-4\",\n  lg: \"size-5\",\n  xl: \"size-5\",\n}\n\nconst chipSize: Record<StyledSize, string> = {\n  sm: \"size-5 text-xs\",\n  md: \"size-6 text-xs\",\n  lg: \"size-7 text-sm\",\n  xl: \"size-8 text-sm\",\n}\n\nconst defaultItems: StyledAccordionItem[] = [\n  {\n    value: \"item-1\",\n    title: \"What is included?\",\n    content:\n      \"Every plan ships the full component library, semantic tokens, and lifetime updates for the tier you own.\",\n  },\n  {\n    value: \"item-2\",\n    title: \"How does installation work?\",\n    content:\n      \"Add any component with a single CLI command. Files land in your project and stay fully editable.\",\n  },\n  {\n    value: \"item-3\",\n    title: \"Can I use it in production?\",\n    content:\n      \"Yes. The system is framework agnostic, self contained, and safe to ship to any number of projects.\",\n  },\n]\n\nfunction useSingleOpen(defaultOpen?: string) {\n  const [open, setOpen] = React.useState<string | null>(defaultOpen ?? null)\n  const toggle = React.useCallback(\n    (value: string) => setOpen((cur) => (cur === value ? null : value)),\n    []\n  )\n  return { open, toggle }\n}\n\nconst headerBase =\n  \"flex w-full items-center gap-3 text-left font-medium outline-none transition-colors focus-visible:ring-[3px] focus-visible:ring-ring/50\"\n\nfunction Panel({\n  isOpen,\n  size,\n  children,\n}: {\n  isOpen: boolean\n  size: StyledSize\n  children: React.ReactNode\n}) {\n  const reduce = useReducedMotion()\n  return (\n    <AnimatePresence initial={false}>\n      {isOpen && (\n        <motion.div\n          key=\"panel\"\n          initial={reduce ? false : { height: 0, opacity: 0 }}\n          animate={{ height: \"auto\", opacity: 1 }}\n          exit={{ height: 0, opacity: 0 }}\n          transition={\n            reduce ? { duration: 0 } : { duration: 0.25, ease: [0.4, 0, 0.2, 1] }\n          }\n          className=\"overflow-hidden\"\n        >\n          <div className={cn(bodyPad[size], \"text-muted-foreground\")}>\n            {children}\n          </div>\n        </motion.div>\n      )}\n    </AnimatePresence>\n  )\n}\n\nfunction Chevron({ isOpen, size }: { isOpen: boolean; size: StyledSize }) {\n  const reduce = useReducedMotion()\n  return (\n    <motion.span\n      aria-hidden\n      className=\"ml-auto shrink-0 text-muted-foreground\"\n      animate={{ rotate: isOpen ? 180 : 0 }}\n      transition={reduce ? { duration: 0 } : { duration: 0.2 }}\n    >\n      <ChevronDown className={iconSize[size]} />\n    </motion.span>\n  )\n}\n\n/* Shared numbered shell: one frame, rows divided by a token line, a step-number\n   chip on each row. chipClass carries each variant's shape/fill technique. */\nfunction NumberedShell({\n  props,\n  chipClass,\n}: {\n  props: StyledAccordionProps\n  chipClass: string\n}) {\n  const { className, size = \"md\", items = defaultItems, defaultOpen } = props\n  const { open, toggle } = useSingleOpen(defaultOpen)\n  return (\n    <div\n      data-slot=\"styled-accordion\"\n      className={cn(\n        \"overflow-hidden rounded-xl border border-border bg-background\",\n        className\n      )}\n    >\n      {items.map((item, i) => {\n        const isOpen = open === item.value\n        return (\n          <div key={item.value} className={cn(i > 0 && \"border-t border-border\")}>\n            <button\n              type=\"button\"\n              aria-expanded={isOpen}\n              onClick={() => toggle(item.value)}\n              className={cn(\n                headerBase,\n                headerPad[size],\n                \"hover:bg-[color-mix(in_oklab,var(--color-foreground)_5%,transparent)]\"\n              )}\n            >\n              <span\n                aria-hidden\n                className={cn(\n                  \"inline-flex shrink-0 items-center justify-center font-semibold tabular-nums\",\n                  chipSize[size],\n                  chipClass\n                )}\n              >\n                {i + 1}\n              </span>\n              <span className=\"min-w-0\">{item.title}</span>\n              <Chevron isOpen={isOpen} size={size} />\n            </button>\n            <Panel isOpen={isOpen} size={size}>\n              {item.content}\n            </Panel>\n          </div>\n        )\n      })}\n    </div>\n  )\n}\n\n/* Circle: yuvarlak yumusak-primary chip. */\nexport function CircleAccordion(props: StyledAccordionProps) {\n  return (\n    <NumberedShell\n      props={props}\n      chipClass=\"rounded-full bg-[color-mix(in_oklab,var(--color-primary)_15%,transparent)] text-primary\"\n    />\n  )\n}\n\n/* Square: yuvarlatilmis kare yumusak-surface chip. */\nexport function SquareAccordion(props: StyledAccordionProps) {\n  return (\n    <NumberedShell\n      props={props}\n      chipClass=\"rounded-md bg-surface-2 text-foreground\"\n    />\n  )\n}\n\n/* Outline: cizgili yuvarlak chip, seffaf dolgu. */\nexport function OutlineAccordion(props: StyledAccordionProps) {\n  return (\n    <NumberedShell\n      props={props}\n      chipClass=\"rounded-full border border-border text-muted-foreground\"\n    />\n  )\n}\n\n/* Filled: dolu primary chip, ust-metin. */\nexport function FilledAccordion(props: StyledAccordionProps) {\n  return (\n    <NumberedShell\n      props={props}\n      chipClass=\"rounded-full bg-primary text-primary-foreground\"\n    />\n  )\n}\n\n/* Ghost: no frame, only colored number text. */\nexport function GhostAccordion(props: StyledAccordionProps) {\n  return (\n    <NumberedShell props={props} chipClass=\"rounded-full text-primary\" />\n  )\n}\n",
      "type": "registry:component",
      "target": "components/ui/accordion-numbered.tsx"
    }
  ],
  "categories": [
    "styled",
    "accordion"
  ],
  "type": "registry:component"
}