{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "collapsible-accent",
  "title": "Accent collapsible",
  "description": "Styled collapsible: the Accent set. 5 decorative collapsible variations (BarCollapsible, GrowCollapsible, GlowCollapsible, LeftCollapsible, FullCollapsible) 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/collapsible-accent.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/* Accent collapsible family: 5 collapsibles with a primary left bar. Each export\n   is a complete collapsible: a single trigger + a single expanding body, a button\n   with aria-expanded, and a framer height auto animation. Works controlled\n   (open/onOpenChange) and uncontrolled (defaultOpen). The difference is on the\n   LEFT BAR: a primary line that grows or glows while open (Bar, Grow, Glow, Left,\n   Full). Color comes ONLY from tokens. Alpha via color-mix. No transform under\n   reduced-motion. Size = padding + text scale. */\n\nexport type StyledSize = \"sm\" | \"md\" | \"lg\" | \"xl\"\n\ninterface StyledCollapsibleProps {\n  className?: string\n  size?: StyledSize\n  title?: React.ReactNode\n  children?: React.ReactNode\n  open?: boolean\n  defaultOpen?: boolean\n  onOpenChange?: (o: boolean) => void\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: \"px-3 pb-2.5 text-sm\",\n  md: \"px-4 pb-3 text-sm\",\n  lg: \"px-5 pb-4 text-base\",\n  xl: \"px-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 headerBase =\n  \"flex w-full items-center justify-between gap-3 text-left font-medium outline-none transition-colors focus-visible:ring-[3px] focus-visible:ring-ring/50\"\n\nconst defaultTitle = \"What is included?\"\n\nconst defaultChildren =\n  \"Every plan ships the full component library, semantic tokens, and lifetime updates for the tier you own. Add any component with a single CLI command and keep the files fully editable.\"\n\n/* Controlled and uncontrolled open state in a single hook. */\nfunction useControllableOpen({\n  open,\n  defaultOpen,\n  onOpenChange,\n}: {\n  open?: boolean\n  defaultOpen?: boolean\n  onOpenChange?: (o: boolean) => void\n}) {\n  const isControlled = open !== undefined\n  const [internal, setInternal] = React.useState<boolean>(defaultOpen ?? false)\n  const current = isControlled ? (open as boolean) : internal\n  const toggle = React.useCallback(() => {\n    const next = !current\n    if (!isControlled) setInternal(next)\n    onOpenChange?.(next)\n  }, [current, isControlled, onOpenChange])\n  return { isOpen: current, toggle }\n}\n\nfunction Chevron({ isOpen, size }: { isOpen: boolean; size: StyledSize }) {\n  const reduce = useReducedMotion()\n  return (\n    <motion.span\n      aria-hidden\n      className=\"shrink-0 text-muted-foreground\"\n      animate={reduce ? undefined : { rotate: isOpen ? 180 : 0 }}\n      transition={reduce ? { duration: 0 } : { type: \"spring\" as const, stiffness: 300, damping: 24 }}\n    >\n      <ChevronDown className={iconSize[size]} />\n    </motion.span>\n  )\n}\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\")}>{children}</div>\n        </motion.div>\n      )}\n    </AnimatePresence>\n  )\n}\n\n/* Shared shell: a primary bar on the left. When grow=true the bar grows from the top down while open (scaleY), otherwise it appears with opacity. glow adds a tinted shadow, and tintOpen gives a light primary surface while open. */\nfunction AccentShell({\n  props,\n  barWidth,\n  grow,\n  glow,\n  tintOpen,\n}: {\n  props: StyledCollapsibleProps\n  barWidth: string\n  grow?: boolean\n  glow?: boolean\n  tintOpen?: boolean\n}) {\n  const { className, size = \"md\", title = defaultTitle, children = defaultChildren } = props\n  const { isOpen, toggle } = useControllableOpen(props)\n  const reduce = useReducedMotion()\n  return (\n    <div\n      data-slot=\"styled-collapsible\"\n      className={cn(\n        \"relative overflow-hidden rounded-xl border border-border bg-background transition-colors\",\n        tintOpen && isOpen &&\n          \"bg-[color-mix(in_oklab,var(--color-primary)_6%,transparent)]\",\n        className\n      )}\n    >\n      <motion.span\n        aria-hidden\n        className={cn(\n          \"absolute inset-y-0 left-0 origin-top rounded-r bg-primary\",\n          barWidth,\n          glow && \"shadow-[0_0_12px_color-mix(in_oklab,var(--color-primary)_60%,transparent)]\"\n        )}\n        initial={false}\n        animate={\n          reduce\n            ? undefined\n            : grow\n              ? { scaleY: isOpen ? 1 : 0.35, opacity: isOpen ? 1 : 0.5 }\n              : { opacity: isOpen ? 1 : 0.4 }\n        }\n        transition={reduce ? { duration: 0 } : { type: \"spring\" as const, stiffness: 260, damping: 26 }}\n      />\n      <button\n        type=\"button\"\n        aria-expanded={isOpen}\n        onClick={toggle}\n        className={cn(\n          headerBase,\n          headerPad[size],\n          \"pl-5 hover:bg-[color-mix(in_oklab,var(--color-foreground)_5%,transparent)]\"\n        )}\n      >\n        {title}\n        <Chevron isOpen={isOpen} size={size} />\n      </button>\n      <div className=\"pl-2\">\n        <Panel isOpen={isOpen} size={size}>\n          {children}\n        </Panel>\n      </div>\n    </div>\n  )\n}\n\n/* Bar: a thin primary line that becomes fully opaque when on. */\nexport function BarCollapsible(props: StyledCollapsibleProps) {\n  return <AccentShell props={props} barWidth=\"w-1\" />\n}\n\n/* Grow: bar acikken tepeden asagi buyuyerek uzar. */\nexport function GrowCollapsible(props: StyledCollapsibleProps) {\n  return <AccentShell props={props} barWidth=\"w-1\" grow />\n}\n\n/* Glow: buyuyen bar + primary tonlu yumusak parilti. */\nexport function GlowCollapsible(props: StyledCollapsibleProps) {\n  return <AccentShell props={props} barWidth=\"w-1\" grow glow />\n}\n\n/* Left: a thick left bar, fully opaque when on (static height). */\nexport function LeftCollapsible(props: StyledCollapsibleProps) {\n  return <AccentShell props={props} barWidth=\"w-1.5\" />\n}\n\n/* Full: buyuyen bar + acikken hafif primary yuzey tinti. */\nexport function FullCollapsible(props: StyledCollapsibleProps) {\n  return <AccentShell props={props} barWidth=\"w-1.5\" grow tintOpen />\n}\n",
      "type": "registry:component",
      "target": "components/ui/collapsible-accent.tsx"
    }
  ],
  "categories": [
    "styled",
    "collapsible"
  ],
  "type": "registry:component"
}