{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "collapsible-notice",
  "title": "Notice collapsible",
  "description": "Styled collapsible: the Notice set. 5 decorative collapsible variations (InfoCollapsible, SuccessCollapsible, WarningCollapsible, DangerCollapsible, MutedCollapsible) 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-notice.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport {\n  ChevronDown,\n  CircleCheck,\n  CircleDashed,\n  Info,\n  OctagonAlert,\n  TriangleAlert,\n} from \"lucide-react\"\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\n/* Notice collapsible family: 5 toned info-box collapsibles. Each export is a\n   complete collapsible: a leading lucide icon + a single trigger + a single\n   expanding body, a button with aria-expanded, and a framer height auto\n   animation. Works controlled (open/onOpenChange) and uncontrolled (defaultOpen).\n   Each variant uses its own semantic token family (info/success/warning/danger/\n   muted): a tinted surface + border + icon. Color comes ONLY from tokens. Alpha\n   via color-mix. No transform under reduced-motion. Size = padding + text\n   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 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=\"ml-auto 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], \"pl-11 text-muted-foreground\")}>{children}</div>\n        </motion.div>\n      )}\n    </AnimatePresence>\n  )\n}\n\n/* Shared shell: a toned surface plus border plus a leading icon. Every tone class arrives as a LITERAL string (Tailwind JIT cannot produce dynamic strings). */\nfunction NoticeShell({\n  props,\n  surface,\n  iconColor,\n  hover,\n  Icon,\n}: {\n  props: StyledCollapsibleProps\n  surface: string\n  iconColor: string\n  hover: string\n  Icon: React.ComponentType<{ className?: string }>\n}) {\n  const { className, size = \"md\", title = defaultTitle, children = defaultChildren } = props\n  const { isOpen, toggle } = useControllableOpen(props)\n  return (\n    <div\n      data-slot=\"styled-collapsible\"\n      className={cn(\"overflow-hidden rounded-xl border\", surface, className)}\n    >\n      <button\n        type=\"button\"\n        aria-expanded={isOpen}\n        onClick={toggle}\n        className={cn(headerBase, headerPad[size], hover)}\n      >\n        <span aria-hidden className={cn(\"shrink-0\", iconColor)}>\n          <Icon className={iconSize[size]} />\n        </span>\n        <span className=\"min-w-0 flex-1\">{title}</span>\n        <Chevron isOpen={isOpen} size={size} />\n      </button>\n      <Panel isOpen={isOpen} size={size}>\n        {children}\n      </Panel>\n    </div>\n  )\n}\n\n/* Info: mavi bilgi tonu. */\nexport function InfoCollapsible(props: StyledCollapsibleProps) {\n  return (\n    <NoticeShell\n      props={props}\n      surface=\"border-[color-mix(in_oklab,var(--color-info)_30%,transparent)] bg-[color-mix(in_oklab,var(--color-info)_10%,transparent)]\"\n      iconColor=\"text-info\"\n      hover=\"hover:bg-[color-mix(in_oklab,var(--color-info)_16%,transparent)]\"\n      Icon={Info}\n    />\n  )\n}\n\n/* Success: yesil basari tonu. */\nexport function SuccessCollapsible(props: StyledCollapsibleProps) {\n  return (\n    <NoticeShell\n      props={props}\n      surface=\"border-[color-mix(in_oklab,var(--color-success)_30%,transparent)] bg-[color-mix(in_oklab,var(--color-success)_10%,transparent)]\"\n      iconColor=\"text-success\"\n      hover=\"hover:bg-[color-mix(in_oklab,var(--color-success)_16%,transparent)]\"\n      Icon={CircleCheck}\n    />\n  )\n}\n\n/* Warning: sari uyari tonu. */\nexport function WarningCollapsible(props: StyledCollapsibleProps) {\n  return (\n    <NoticeShell\n      props={props}\n      surface=\"border-[color-mix(in_oklab,var(--color-warning)_30%,transparent)] bg-[color-mix(in_oklab,var(--color-warning)_10%,transparent)]\"\n      iconColor=\"text-warning\"\n      hover=\"hover:bg-[color-mix(in_oklab,var(--color-warning)_16%,transparent)]\"\n      Icon={TriangleAlert}\n    />\n  )\n}\n\n/* Danger: kirmizi tehlike tonu. */\nexport function DangerCollapsible(props: StyledCollapsibleProps) {\n  return (\n    <NoticeShell\n      props={props}\n      surface=\"border-[color-mix(in_oklab,var(--color-danger)_30%,transparent)] bg-[color-mix(in_oklab,var(--color-danger)_10%,transparent)]\"\n      iconColor=\"text-danger\"\n      hover=\"hover:bg-[color-mix(in_oklab,var(--color-danger)_16%,transparent)]\"\n      Icon={OctagonAlert}\n    />\n  )\n}\n\n/* Muted: notr sessiz ton. */\nexport function MutedCollapsible(props: StyledCollapsibleProps) {\n  return (\n    <NoticeShell\n      props={props}\n      surface=\"border-border bg-[color-mix(in_oklab,var(--color-foreground)_5%,transparent)]\"\n      iconColor=\"text-muted-foreground\"\n      hover=\"hover:bg-[color-mix(in_oklab,var(--color-foreground)_9%,transparent)]\"\n      Icon={CircleDashed}\n    />\n  )\n}\n",
      "type": "registry:component",
      "target": "components/ui/collapsible-notice.tsx"
    }
  ],
  "categories": [
    "styled",
    "collapsible"
  ],
  "type": "registry:component"
}