{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "accordion",
  "title": "Accordion",
  "author": "AlgorizeTech",
  "description": "Ask the user to pick one of 6 accordion variants: https://avaraui.com/view/accordion. This item holds 6 of them as looks of one component (default, ghost, bordered, elevated, filled, brand-reveal). Skip the question if the user already named one. A data-driven accordion taking an array of items, with five distinct variants and an optional stack entrance that deals the items into place. Use it for FAQs and any list of collapsible sections.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "https://avaraui.com/r/ui-accordion.json",
    "utils"
  ],
  "files": [
    {
      "path": "src/components/custom/blocks/Accordion.tsx",
      "content": "\"use client\";\n\nimport {\n  AccordionContent,\n  AccordionItem,\n  AccordionTrigger,\n  Accordion as ShadCNAccordion,\n} from \"@/components/custom/ui/accordion\"; // Adjust path to your shadcn accordion if needed\nimport { cn } from \"@/lib/utils\";\nimport {\n  ArrowDown,\n  ArrowUpRight,\n  ChevronDown,\n  Code,\n  CreditCard,\n  FileText,\n  HelpCircle,\n  Lock,\n  MessageCircle,\n  Palette,\n  Plus,\n  RefreshCw,\n  Scale,\n  Shield,\n  Smartphone,\n  Sparkles,\n  Users,\n} from \"lucide-react\";\nimport React from \"react\";\n\n// Icon Map for MDX/String compatibility\nconst ICON_MAP: Record<string, React.ElementType> = {\n  HelpCircle,\n  Shield,\n  Users,\n  CreditCard,\n  FileText,\n  Smartphone,\n  Code,\n  Plus,\n  ArrowDown,\n  ChevronDown,\n  Lock,\n  MessageCircle,\n  Palette,\n  RefreshCw,\n  Scale,\n  Sparkles,\n};\n\nexport type AccordionDataItem = {\n  value: string;\n  title: string;\n  icon?: React.ReactNode | string;\n  content: string[] | React.ReactNode;\n};\n\nexport type AccordionVariant =\n  | \"default\"\n  | \"bordered\"\n  | \"filled\"\n  | \"ghost\"\n  | \"elevated\"\n  | \"brand-reveal\"\n  /** @deprecated Alias of \"filled\". */\n  | \"card-filled\";\n\nexport type CustomAccordionProps = {\n  type?: \"single\" | \"multiple\";\n  collapsible?: boolean;\n  defaultValue?: string | string[] | null;\n  accordionData?: AccordionDataItem[];\n  brands?: BrandItem[];\n  variant?: AccordionVariant;\n  /**\n   * \"stack\" starts every item piled on the first one, like a deck of cards,\n   * and deals them down into place once the accordion scrolls into view.\n   * Skipped automatically when the visitor prefers reduced motion.\n   */\n  animation?: \"none\" | \"stack\";\n  className?: string;\n  itemClassName?: string;\n  triggerClassName?: string;\n  contentClassName?: string;\n  expandIcon?: React.ReactNode | string;\n  expandIconClassName?: string;\n};\n\ntype VariantStyles = {\n  list: string;\n  item: string;\n  trigger: string;\n  /** Wrapper around the item's own icon. */\n  iconWrap: string;\n  title: string;\n  /** Wrapper around the expand/collapse icon. */\n  expand: string;\n  expandIcon: \"plus\" | \"chevron\";\n  content: string;\n  /** Extra content padding when the row carries an icon, so text aligns with the title. Dropped below `sm`, where the column is too narrow to spend on an indent. */\n  contentWithIcon?: string;\n  /** Draws a thin line from the icon down the answer. */\n  thread?: boolean;\n};\n\nconst VARIANTS: Record<Exclude<AccordionVariant, \"card-filled\" | \"brand-reveal\">, VariantStyles> = {\n  // \"Lift\": closed rows are quiet hairline rows; the open one lifts out as a card.\n  default: {\n    list: \"flex flex-col\",\n    item: cn(\n      \"relative rounded-2xl border-b border-border transition-all duration-300 ease-out last:border-b-0\",\n      \"data-[state=open]:my-2 data-[state=open]:border-b-transparent data-[state=open]:bg-card\",\n      \"data-[state=open]:ring-1 data-[state=open]:ring-border\",\n      \"data-[state=open]:shadow-[0_1px_2px_rgb(0_0_0/0.04),0_20px_44px_-20px_rgb(0_0_0/0.22)]\",\n      \"data-[state=open]:first:mt-0 data-[state=open]:last:mb-0 sm:data-[state=open]:-mx-3 sm:data-[state=open]:px-3\",\n      \"has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring/60\",\n    ),\n    trigger: \"items-center gap-4 px-4 py-4\",\n    iconWrap: cn(\n      \"flex size-10 shrink-0 items-center justify-center rounded-xl bg-muted text-muted-foreground transition-all duration-300\",\n      \"group-hover:bg-primary/10 group-hover:text-primary\",\n      \"group-data-[state=open]:bg-primary group-data-[state=open]:text-primary-foreground group-data-[state=open]:shadow-lg group-data-[state=open]:shadow-primary/30\",\n    ),\n    title: \"text-[15px] font-medium tracking-[-0.01em] text-foreground\",\n    expand: cn(\n      \"flex size-7 shrink-0 items-center justify-center rounded-full border border-border text-muted-foreground transition-all duration-300\",\n      \"group-hover:border-foreground/30 group-hover:text-foreground\",\n      \"group-data-[state=open]:rotate-45 group-data-[state=open]:border-foreground/30 group-data-[state=open]:text-foreground\",\n    ),\n    expandIcon: \"plus\",\n    content: \"relative px-4 pb-5 pr-12 text-muted-foreground\",\n    contentWithIcon: \"sm:pl-[4.5rem]\",\n    thread: true,\n  },\n\n  // \"Rail\": one outlined panel; a primary rail grows down the open row.\n  bordered: {\n    list: \"divide-y divide-border overflow-hidden rounded-2xl border border-border bg-card\",\n    item: cn(\n      \"relative transition-colors duration-300\",\n      \"before:absolute before:inset-y-0 before:left-0 before:w-[3px] before:origin-top before:scale-y-0 before:bg-primary before:transition-transform before:duration-300 before:ease-out\",\n      \"data-[state=open]:bg-primary/[0.04] data-[state=open]:before:scale-y-100 dark:data-[state=open]:bg-primary/[0.08]\",\n      \"has-[:focus-visible]:bg-muted/60\",\n    ),\n    trigger: \"items-center gap-3.5 px-5 py-4\",\n    iconWrap:\n      \"flex shrink-0 items-center justify-center text-muted-foreground transition-colors duration-300 group-hover:text-primary group-data-[state=open]:text-primary\",\n    title: \"text-[15px] font-medium text-foreground\",\n    expand:\n      \"flex shrink-0 items-center justify-center text-muted-foreground transition-transform duration-300 group-data-[state=open]:rotate-180 group-data-[state=open]:text-primary\",\n    expandIcon: \"chevron\",\n    content: \"px-5 pb-5 pr-12 text-muted-foreground\",\n    contentWithIcon: \"sm:pl-[3.25rem]\",\n  },\n\n  // \"Inverted\": muted blocks; the open one flips entirely to the accent.\n  filled: {\n    list: \"flex flex-col gap-2\",\n    item: cn(\n      \"rounded-2xl bg-muted/70 transition-colors duration-300\",\n      \"data-[state=open]:bg-primary data-[state=open]:text-primary-foreground\",\n      \"has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring/60 has-[:focus-visible]:ring-offset-2 has-[:focus-visible]:ring-offset-background\",\n    ),\n    trigger: \"items-center gap-4 px-5 py-4\",\n    iconWrap: cn(\n      \"flex size-8 shrink-0 items-center justify-center rounded-lg bg-background text-foreground transition-colors duration-300\",\n      \"group-data-[state=open]:bg-primary-foreground/15 group-data-[state=open]:text-primary-foreground\",\n    ),\n    title:\n      \"text-[15px] font-medium text-foreground transition-colors duration-300 group-data-[state=open]:text-primary-foreground\",\n    expand: cn(\n      \"flex shrink-0 items-center justify-center text-muted-foreground transition-all duration-300\",\n      \"group-data-[state=open]:rotate-180 group-data-[state=open]:text-primary-foreground\",\n    ),\n    expandIcon: \"chevron\",\n    content: \"px-5 pb-5 pr-12 text-primary-foreground/85\",\n    contentWithIcon: \"sm:pl-[4.25rem]\",\n  },\n\n  // \"Cards\": separated cards; the open one rises on a primary ring.\n  elevated: {\n    list: \"flex flex-col gap-3\",\n    item: cn(\n      \"rounded-2xl border border-border bg-card shadow-[0_1px_2px_rgb(0_0_0/0.04)] transition-all duration-300 ease-out\",\n      \"data-[state=open]:-translate-y-0.5 data-[state=open]:border-transparent data-[state=open]:ring-2 data-[state=open]:ring-primary/40 data-[state=open]:ring-offset-2 data-[state=open]:ring-offset-background\",\n      \"data-[state=open]:shadow-[0_24px_48px_-24px_rgb(0_0_0/0.28)]\",\n      \"has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring/60\",\n    ),\n    trigger: \"items-center gap-4 px-5 py-4\",\n    iconWrap: cn(\n      \"flex size-9 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground transition-colors duration-300\",\n      \"group-hover:text-foreground group-data-[state=open]:bg-primary/12 group-data-[state=open]:text-primary\",\n    ),\n    title: \"text-[15px] font-medium text-foreground\",\n    expand:\n      \"flex shrink-0 items-center justify-center text-muted-foreground transition-transform duration-300 group-data-[state=open]:rotate-180\",\n    expandIcon: \"chevron\",\n    content: \"px-5 pb-5 pr-12 text-muted-foreground\",\n    contentWithIcon: \"sm:pl-[4.25rem]\",\n  },\n\n  // \"Editorial\": nothing but type and hairlines.\n  ghost: {\n    list: \"divide-y divide-border\",\n    item: \"has-[:focus-visible]:bg-muted/40\",\n    trigger: \"items-center gap-4 py-5\",\n    iconWrap:\n      \"flex shrink-0 items-center justify-center text-muted-foreground transition-colors duration-300 group-data-[state=open]:text-primary\",\n    title:\n      \"text-lg font-medium tracking-tight text-foreground transition-[transform,color] duration-300 group-hover:translate-x-1 group-data-[state=open]:text-primary\",\n    expand:\n      \"flex shrink-0 items-center justify-center text-muted-foreground transition-transform duration-300 group-data-[state=open]:rotate-45\",\n    expandIcon: \"plus\",\n    content: \"max-w-prose pb-6 pr-10 text-[15px] leading-relaxed text-muted-foreground\",\n    contentWithIcon: \"sm:pl-8\",\n  },\n};\n\n/** Vertical gap, in px, each deeper card peeks out below the one above it while stacked. */\nconst STACK_PEEK = 7;\n/** How much smaller each deeper card is while stacked. */\nconst STACK_SHRINK = 0.035;\n\n/**\n * Piles the items on top of the first one, then deals them into place with a\n * stagger once the list is in view. Web Animations API, set up in a layout\n * effect: the very first paint already shows the stacked deck, so nothing\n * flashes. `setStacking(false)` fires when the last card lands so the items can\n * drop the opaque background they need while overlapping.\n */\nfunction useStackEntrance(\n  listRef: React.RefObject<HTMLDivElement | null>,\n  enabled: boolean,\n  setStacking: (value: boolean) => void,\n) {\n  React.useLayoutEffect(() => {\n    if (!enabled) return;\n    const list = listRef.current;\n    const reduceMotion =\n      typeof window !== \"undefined\" &&\n      window.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches;\n    if (!list || reduceMotion || typeof list.animate !== \"function\") {\n      setStacking(false);\n      return;\n    }\n\n    const nodes = Array.from(\n      list.querySelectorAll<HTMLElement>(\":scope > [data-stack-item]\"),\n    );\n    if (nodes.length < 2) {\n      setStacking(false);\n      return;\n    }\n\n    // Re-assert on every run: a strict-mode replay (or a later re-mount) has\n    // already been through the cleanup below, which switched it off.\n    setStacking(true);\n\n    const baseTop = nodes[0].offsetTop;\n    const animations = nodes.map((node, i) => {\n      const startY = baseTop - node.offsetTop + i * STACK_PEEK;\n      const startScale = Math.max(1 - i * STACK_SHRINK, 0.7);\n      node.style.zIndex = String(nodes.length - i);\n      node.style.transformOrigin = \"top center\";\n      const animation = node.animate(\n        [\n          { transform: `translateY(${startY}px) scale(${startScale})` },\n          { transform: \"translateY(0px) scale(1)\" },\n        ],\n        {\n          duration: 720,\n          delay: 140 + i * 90,\n          easing: \"cubic-bezier(0.22, 1, 0.36, 1)\",\n          fill: \"backwards\",\n        },\n      );\n      animation.pause();\n      return animation;\n    });\n\n    let finished = false;\n    const land = () => {\n      if (finished) return;\n      finished = true;\n      nodes.forEach((node) => {\n        node.style.zIndex = \"\";\n        node.style.transformOrigin = \"\";\n      });\n      setStacking(false);\n    };\n    Promise.all(animations.map((a) => a.finished)).then(land, () => {});\n\n    const play = () => animations.forEach((a) => a.play());\n    let observer: IntersectionObserver | null = null;\n    if (\"IntersectionObserver\" in window) {\n      observer = new IntersectionObserver(\n        (entries) => {\n          if (entries.some((entry) => entry.isIntersecting)) {\n            play();\n            observer?.disconnect();\n          }\n        },\n        { threshold: 0.15 },\n      );\n      observer.observe(list);\n    } else {\n      play();\n    }\n\n    return () => {\n      observer?.disconnect();\n      animations.forEach((a) => a.cancel());\n      land();\n    };\n  }, [listRef, enabled, setStacking]);\n}\n\nfunction StandardAccordion({\n  type = \"single\",\n  collapsible = true,\n  defaultValue = null,\n  accordionData = [],\n  variant = \"default\",\n  animation = \"none\",\n  className = \"\",\n  itemClassName = \"\",\n  triggerClassName = \"\",\n  contentClassName = \"\",\n  expandIcon = null,\n  expandIconClassName,\n}: CustomAccordionProps) {\n  const safeVariant =\n    variant === \"card-filled\" || variant === \"brand-reveal\"\n      ? \"filled\"\n      : (variant as keyof typeof VARIANTS) in VARIANTS\n        ? (variant as keyof typeof VARIANTS)\n        : \"default\";\n  const styles = VARIANTS[safeVariant];\n\n  /** Radix wants an array here when `type` is \"multiple\". */\n  const multipleDefault = Array.isArray(defaultValue)\n    ? defaultValue\n    : defaultValue\n      ? [defaultValue]\n      : [];\n  /** ...and a single string otherwise. */\n  const singleDefault = Array.isArray(defaultValue)\n    ? defaultValue[0]\n    : (defaultValue ?? undefined);\n\n  const ResolvedExpandIcon =\n    typeof expandIcon === \"string\" ? ICON_MAP[expandIcon] : null;\n  const DefaultExpandIcon = styles.expandIcon === \"plus\" ? Plus : ChevronDown;\n\n  const listRef = React.useRef<HTMLDivElement>(null);\n  const [stacking, setStacking] = React.useState(animation === \"stack\");\n  const [multipleValue, setMultipleValue] =\n    React.useState<string[]>(multipleDefault);\n  useStackEntrance(listRef, animation === \"stack\", setStacking);\n\n  const shellClassName = cn(\"relative w-full\", styles.list, className);\n\n  const items = accordionData.map((item) => {\n    const ItemIcon =\n      typeof item.icon === \"string\" ? ICON_MAP[item.icon] : null;\n    const hasIcon = Boolean(item.icon);\n    return (\n      <AccordionItem\n        key={item.value}\n        value={item.value}\n        data-stack-item=\"\"\n        className={cn(\n          styles.item,\n          // Overlapping cards need an opaque surface while the deck deals out.\n          stacking &&\n            \"rounded-2xl bg-background ring-1 ring-border shadow-[0_12px_32px_-16px_rgb(0_0_0/0.25)]\",\n          itemClassName,\n        )}\n      >\n        <AccordionTrigger\n          expandIcon={\n            <span className={styles.expand} aria-hidden=\"true\">\n              {ResolvedExpandIcon ? (\n                <ResolvedExpandIcon className=\"size-4\" />\n              ) : expandIcon ? (\n                expandIcon\n              ) : (\n                <DefaultExpandIcon className=\"size-4\" strokeWidth={1.75} />\n              )}\n            </span>\n          }\n          expandIconClassName={expandIconClassName}\n          className={cn(\n            \"group cursor-pointer outline-none focus-visible:ring-0\",\n            styles.trigger,\n            triggerClassName,\n          )}\n        >\n          <div className=\"flex w-full min-w-0 items-center gap-4\">\n            {hasIcon && (\n              <span className={styles.iconWrap}>\n                {ItemIcon ? (\n                  <ItemIcon className=\"size-4\" strokeWidth={1.75} />\n                ) : (\n                  (item.icon as React.ReactNode)\n                )}\n              </span>\n            )}\n            <span className={cn(\"min-w-0 text-left\", styles.title)}>\n              {item.title}\n            </span>\n          </div>\n        </AccordionTrigger>\n        <AccordionContent\n          className={cn(\n            \"text-sm\",\n            styles.content,\n            hasIcon && styles.contentWithIcon,\n            styles.thread &&\n              hasIcon &&\n              \"before:absolute before:bottom-5 before:left-[2.25rem] before:top-0 before:hidden before:w-px before:bg-gradient-to-b before:from-primary/50 before:to-transparent sm:before:block\",\n            contentClassName,\n          )}\n        >\n          <div className=\"space-y-3\">\n            {Array.isArray(item.content) ? (\n              item.content.map((paragraph, index) => (\n                <p key={index} className=\"leading-relaxed\">\n                  {paragraph}\n                </p>\n              ))\n            ) : (\n              <div>{item.content}</div>\n            )}\n          </div>\n        </AccordionContent>\n      </AccordionItem>\n    );\n  });\n\n  if (type === \"single\") {\n    return (\n      <ShadCNAccordion\n        ref={listRef}\n        type=\"single\"\n        collapsible={collapsible}\n        className={shellClassName}\n        defaultValue={singleDefault}\n      >\n        {items}\n      </ShadCNAccordion>\n    );\n  }\n\n  if (!collapsible) {\n    return (\n      <ShadCNAccordion\n        ref={listRef}\n        type=\"multiple\"\n        className={shellClassName}\n        value={multipleValue}\n        onValueChange={(newVal) => {\n          // Never allow removing items that were previously opened\n          const merged = Array.from(new Set([...multipleValue, ...newVal]));\n          setMultipleValue(merged);\n        }}\n      >\n        {items}\n      </ShadCNAccordion>\n    );\n  }\n\n  return (\n    <ShadCNAccordion\n      ref={listRef}\n      type=\"multiple\"\n      className={shellClassName}\n      defaultValue={multipleDefault}\n    >\n      {items}\n    </ShadCNAccordion>\n  );\n}\n\nexport function Accordion(props: CustomAccordionProps) {\n  if (props.variant === \"brand-reveal\") {\n    return (\n      <BrandLogoAccordion\n        brands={props.brands}\n        className={props.className}\n      />\n    );\n  }\n\n  return <StandardAccordion {...props} />;\n}\n\n/* ═══════════════════════════════════════════════\n   BRAND LOGO REVEAL ACCORDION COMPONENT\n   Horizontal interactive accordion for client & partner showcase.\n   Inspired by Framer Brand Logo Reveal.\n   ═══════════════════════════════════════════════ */\n\nexport type BrandItem = {\n  id: string;\n  name: string;\n  caption: string;\n  index?: string;\n  logo?: React.ReactNode | string;\n  link?: string;\n  linkText?: string;\n};\n\nexport type BrandLogoAccordionProps = {\n  brands?: BrandItem[];\n  title?: string;\n  defaultActiveId?: string;\n  height?: number | string;\n  autoplay?: boolean;\n  autoplayInterval?: number;\n  pauseOnHover?: boolean;\n  className?: string;\n  onBrandChange?: (brand: BrandItem, index: number) => void;\n};\n\nfunction AcmeMark({ className = \"h-5 w-auto\" }: { className?: string }) {\n  return (\n    <svg viewBox=\"0 0 32 32\" fill=\"none\" className={className}>\n      <path d=\"M16 3L28 10V22L16 29L4 22V10L16 3Z\" stroke=\"currentColor\" strokeWidth=\"2.5\" strokeLinejoin=\"round\" />\n      <path d=\"M16 3V29M4 10L28 22M28 10L4 22\" stroke=\"currentColor\" strokeWidth=\"1.75\" strokeLinejoin=\"round\" opacity=\"0.6\" />\n    </svg>\n  );\n}\n\nfunction NorthstarMark({ className = \"h-5 w-auto\" }: { className?: string }) {\n  return (\n    <svg viewBox=\"0 0 32 32\" fill=\"currentColor\" className={className}>\n      <path d=\"M16 2L18.8 11.2L28 14L18.8 16.8L16 26L13.2 16.8L4 14L13.2 11.2L16 2Z\" />\n      <circle cx=\"16\" cy=\"14\" r=\"2.5\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" opacity=\"0.4\" />\n    </svg>\n  );\n}\n\nfunction VertexMark({ className = \"h-5 w-auto\" }: { className?: string }) {\n  return (\n    <svg viewBox=\"0 0 32 32\" fill=\"none\" className={className}>\n      <path d=\"M16 4L28 26H4L16 4Z\" stroke=\"currentColor\" strokeWidth=\"2.5\" strokeLinejoin=\"round\" />\n      <path d=\"M16 12L22 23H10L16 12Z\" fill=\"currentColor\" opacity=\"0.6\" />\n    </svg>\n  );\n}\n\nfunction HorizonMark({ className = \"h-5 w-auto\" }: { className?: string }) {\n  return (\n    <svg viewBox=\"0 0 32 32\" fill=\"none\" className={className}>\n      <path d=\"M7 16A9 9 0 0125 16\" stroke=\"currentColor\" strokeWidth=\"2.5\" strokeLinecap=\"round\" />\n      <path d=\"M4 21H28\" stroke=\"currentColor\" strokeWidth=\"2.5\" strokeLinecap=\"round\" />\n      <path d=\"M8 26H24\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" opacity=\"0.6\" />\n    </svg>\n  );\n}\n\nfunction SummitMark({ className = \"h-5 w-auto\" }: { className?: string }) {\n  return (\n    <svg viewBox=\"0 0 32 32\" fill=\"none\" className={className}>\n      <path d=\"M3 25L12 8L18 17L22 11L29 25H3Z\" stroke=\"currentColor\" strokeWidth=\"2.5\" strokeLinejoin=\"round\" />\n      <path d=\"M12 8V25M22 11V25\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeDasharray=\"2 2\" opacity=\"0.5\" />\n    </svg>\n  );\n}\n\nfunction AtlasMark({ className = \"h-5 w-auto\" }: { className?: string }) {\n  return (\n    <svg viewBox=\"0 0 32 32\" fill=\"none\" className={className}>\n      <circle cx=\"16\" cy=\"16\" r=\"12\" stroke=\"currentColor\" strokeWidth=\"2\" />\n      <ellipse cx=\"16\" cy=\"16\" rx=\"12\" ry=\"5\" stroke=\"currentColor\" strokeWidth=\"2\" />\n      <ellipse cx=\"16\" cy=\"16\" rx=\"5\" ry=\"12\" stroke=\"currentColor\" strokeWidth=\"2\" opacity=\"0.6\" />\n    </svg>\n  );\n}\n\nfunction NovaMark({ className = \"h-5 w-auto\" }: { className?: string }) {\n  return (\n    <svg viewBox=\"0 0 32 32\" fill=\"currentColor\" className={className}>\n      <path d=\"M16 2L18 12L28 14L18 16L16 26L14 16L4 14L14 12L16 2Z\" />\n      <circle cx=\"16\" cy=\"14\" r=\"1.5\" fill=\"currentColor\" />\n    </svg>\n  );\n}\n\nfunction EvergreenMark({ className = \"h-5 w-auto\" }: { className?: string }) {\n  return (\n    <svg viewBox=\"0 0 32 32\" fill=\"none\" className={className}>\n      <path d=\"M16 4L9 12H13L7 20H12L6 28H26L20 20H25L19 12H23L16 4Z\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinejoin=\"round\" />\n      <path d=\"M16 4V28\" stroke=\"currentColor\" strokeWidth=\"2\" opacity=\"0.5\" />\n    </svg>\n  );\n}\n\nconst BRAND_MARKS: Record<string, React.ComponentType<{ className?: string }>> = {\n  acme: AcmeMark,\n  northstar: NorthstarMark,\n  vertex: VertexMark,\n  horizon: HorizonMark,\n  summit: SummitMark,\n  atlas: AtlasMark,\n  nova: NovaMark,\n  evergreen: EvergreenMark,\n};\n\nfunction renderBrandLogo(item: BrandItem, mode: \"spine\" | \"inner\") {\n  if (React.isValidElement(item.logo)) {\n    return item.logo;\n  }\n  if (typeof item.logo === \"string\") {\n    const BuiltinMark = BRAND_MARKS[item.logo.toLowerCase()];\n    if (BuiltinMark) {\n      return (\n        <BuiltinMark\n          className={cn(\n            mode === \"spine\"\n              ? \"size-4 object-contain\"\n              : \"size-6 sm:size-7 object-contain text-primary dark:text-primary\"\n          )}\n        />\n      );\n    }\n    return (\n      <img\n        src={item.logo}\n        alt={item.name}\n        draggable={false}\n        loading=\"lazy\"\n        className={cn(\n          \"object-contain\",\n          mode === \"spine\"\n            ? \"h-4 w-auto max-w-[70px] filter grayscale opacity-60\"\n            : \"h-6 sm:h-7 w-auto max-w-[120px]\"\n        )}\n      />\n    );\n  }\n  const Fallback = BRAND_MARKS[item.id.toLowerCase()] || AcmeMark;\n  return (\n    <Fallback\n      className={cn(\n        mode === \"spine\"\n          ? \"size-4 object-contain\"\n          : \"size-6 sm:size-7 object-contain text-primary dark:text-primary\"\n      )}\n    />\n  );\n}\n\nexport const DEFAULT_BRANDS: BrandItem[] = [\n  {\n    id: \"acme\",\n    name: \"Acme Technologies\",\n    caption: \"Website redesign and product marketing platform.\",\n    index: \"01\",\n    logo: \"acme\",\n  },\n  {\n    id: \"northstar\",\n    name: \"Northstar Studio\",\n    caption: \"Complete brand identity and responsive website.\",\n    index: \"02\",\n    logo: \"northstar\",\n  },\n  {\n    id: \"vertex\",\n    name: \"Vertex Solutions\",\n    caption: \"SaaS landing page with conversion focused design.\",\n    index: \"03\",\n    logo: \"vertex\",\n  },\n  {\n    id: \"horizon\",\n    name: \"Horizon Labs\",\n    caption: \"Design system and scalable UI components.\",\n    index: \"04\",\n    logo: \"horizon\",\n  },\n  {\n    id: \"summit\",\n    name: \"Summit Ventures\",\n    caption: \"Investor website with premium editorial experience.\",\n    index: \"05\",\n    logo: \"summit\",\n  },\n  {\n    id: \"atlas\",\n    name: \"Atlas Digital\",\n    caption: \"E-commerce experience with performance optimization.\",\n    index: \"06\",\n    logo: \"atlas\",\n  },\n  {\n    id: \"nova\",\n    name: \"Nova Creative\",\n    caption: \"Interactive portfolio and motion driven website.\",\n    index: \"07\",\n    logo: \"nova\",\n  },\n  {\n    id: \"evergreen\",\n    name: \"Evergreen Capital\",\n    caption: \"Corporate website with modern brand refresh.\",\n    index: \"08\",\n    logo: \"evergreen\",\n  },\n];\n\nexport function BrandLogoAccordion({\n  brands = DEFAULT_BRANDS,\n  title,\n  defaultActiveId,\n  height = 300,\n  autoplay = true,\n  autoplayInterval = 4000,\n  pauseOnHover = true,\n  className = \"\",\n  onBrandChange,\n}: BrandLogoAccordionProps) {\n  const initialIndex = defaultActiveId\n    ? Math.max(0, brands.findIndex((b) => b.id === defaultActiveId))\n    : 0;\n\n  const [activeIndex, setActiveIndex] = React.useState(initialIndex);\n  const [isPaused, setIsPaused] = React.useState(false);\n  const [progress, setProgress] = React.useState(0);\n  const containerRef = React.useRef<HTMLDivElement>(null);\n\n  const activeIndexRef = React.useRef(activeIndex);\n  activeIndexRef.current = activeIndex;\n\n  const brandsRef = React.useRef(brands);\n  brandsRef.current = brands;\n\n  const onBrandChangeRef = React.useRef(onBrandChange);\n  onBrandChangeRef.current = onBrandChange;\n\n  const selectBrand = React.useCallback((index: number) => {\n    setActiveIndex(index);\n    setProgress(0);\n    const b = brandsRef.current[index];\n    if (b) {\n      onBrandChangeRef.current?.(b, index);\n    }\n  }, []);\n\n  // Autoplay ticker with smooth progress animation\n  React.useEffect(() => {\n    if (!autoplay || brands.length <= 1) return;\n\n    if (\n      typeof window !== \"undefined\" &&\n      window.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches\n    ) {\n      return;\n    }\n\n    const stepMs = 50;\n    const increment = (stepMs / autoplayInterval) * 100;\n\n    const interval = setInterval(() => {\n      if (isPaused) return;\n\n      setProgress((prev) => {\n        if (prev + increment >= 100) {\n          const next = (activeIndexRef.current + 1) % brandsRef.current.length;\n          selectBrand(next);\n          return 0;\n        }\n        return prev + increment;\n      });\n    }, stepMs);\n\n    return () => clearInterval(interval);\n  }, [autoplay, autoplayInterval, isPaused, brands.length, selectBrand]);\n\n  const totalCount = brands.length;\n  const totalFormatted = String(totalCount).padStart(2, \"0\");\n\n  return (\n    <div className={cn(\"w-full select-none\", className)}>\n      {title && (\n        <div className=\"text-[11px] font-semibold tracking-[0.22em] uppercase text-muted-foreground/60 mb-3 px-1\">\n          {title}\n        </div>\n      )}\n\n      <div\n        ref={containerRef}\n        role=\"tablist\"\n        aria-label={title || \"Brand showcase\"}\n        onMouseEnter={() => pauseOnHover && setIsPaused(true)}\n        onMouseLeave={() => pauseOnHover && setIsPaused(false)}\n        style={{\n          minHeight: typeof height === \"number\" ? `${height}px` : height,\n        }}\n        className={cn(\n          \"relative flex flex-col md:flex-row w-full gap-[1px] rounded-2xl overflow-hidden border border-border/80 bg-border/70 dark:bg-border/40 shadow-sm\",\n        )}\n      >\n        {brands.map((item, idx) => {\n          const isOpen = activeIndex === idx;\n          const formattedIndex = item.index || String(idx + 1).padStart(2, \"0\");\n\n          return (\n            <div\n              key={item.id}\n              role=\"tab\"\n              id={`brand-tab-${item.id}`}\n              aria-selected={isOpen}\n              aria-expanded={isOpen}\n              tabIndex={0}\n              onClick={() => selectBrand(idx)}\n              onKeyDown={(e) => {\n                if (e.key === \"Enter\" || e.key === \" \") {\n                  e.preventDefault();\n                  selectBrand(idx);\n                } else if (e.key === \"ArrowRight\" || e.key === \"ArrowDown\") {\n                  e.preventDefault();\n                  selectBrand((idx + 1) % brands.length);\n                } else if (e.key === \"ArrowLeft\" || e.key === \"ArrowUp\") {\n                  e.preventDefault();\n                  selectBrand((idx - 1 + brands.length) % brands.length);\n                }\n              }}\n              className={cn(\n                \"relative overflow-hidden cursor-pointer flex transition-[flex-grow,flex-basis,background,color] duration-1000 ease-[cubic-bezier(0.16,1,0.3,1)] outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-inset\",\n                isOpen\n                  ? \"flex-1 bg-zinc-950 text-zinc-50 dark:bg-zinc-900 dark:text-zinc-100 min-w-0 md:min-w-[280px]\"\n                  : \"flex-[0_0_54px] md:flex-[0_0_95px] lg:flex-[0_0_105px] bg-card text-foreground hover:bg-muted/70 dark:bg-zinc-950/60 dark:hover:bg-zinc-900/80\"\n              )}\n            >\n              {/* Spine (Collapsed State) */}\n              <div\n                aria-hidden={isOpen}\n                className={cn(\n                  \"absolute inset-0 flex transition-opacity ease-in-out\",\n                  \"flex-row md:flex-col items-center justify-between px-5 md:px-0 md:py-6\",\n                  isOpen\n                    ? \"opacity-0 pointer-events-none duration-300 delay-0\"\n                    : \"opacity-100 duration-500 delay-300\"\n                )}\n              >\n                <div className=\"shrink-0 flex items-center justify-center opacity-60\">\n                  {renderBrandLogo(item, \"spine\")}\n                </div>\n\n                <span className=\"md:[writing-mode:vertical-rl] md:rotate-180 text-[11px] font-semibold tracking-[0.2em] uppercase opacity-60 whitespace-nowrap\">\n                  {item.name}\n                </span>\n\n                <span className=\"text-[10px] font-mono tracking-[0.14em] opacity-40\">\n                  {formattedIndex}\n                </span>\n              </div>\n\n              {/* Inner Content (Expanded State) */}\n              <div\n                className={cn(\n                  \"relative flex flex-col justify-between w-full h-full p-6 sm:p-8 min-w-[260px] box-border transition-all ease-[cubic-bezier(0.16,1,0.3,1)]\",\n                  isOpen\n                    ? \"opacity-100 translate-x-0 duration-700 delay-300\"\n                    : \"opacity-0 -translate-x-3 pointer-events-none absolute inset-0 duration-300 delay-0\"\n                )}\n              >\n                {/* Counter */}\n                <div className=\"text-[11px] font-mono tracking-[0.22em] opacity-55\">\n                  {formattedIndex} / {totalFormatted}\n                </div>\n\n                {/* Brand Details */}\n                <div className=\"my-auto py-4\">\n                  <div className=\"inline-flex items-center justify-center size-12 rounded-xl bg-white/10 dark:bg-white/10 border border-white/15 shadow-sm backdrop-blur-sm mb-4 p-2.5\">\n                    {renderBrandLogo(item, \"inner\")}\n                  </div>\n                  <div className=\"text-[12px] font-bold uppercase tracking-[0.18em] opacity-60\">\n                    {item.name}\n                  </div>\n                  <p className=\"mt-2 text-sm sm:text-[14.5px] leading-relaxed opacity-85 max-w-[34ch] font-normal text-pretty\">\n                    {item.caption}\n                  </p>\n                  {item.link && (\n                    <a\n                      href={item.link}\n                      target=\"_blank\"\n                      rel=\"noopener noreferrer\"\n                      onClick={(e) => e.stopPropagation()}\n                      className=\"inline-flex items-center gap-1.5 mt-3.5 text-[12px] font-medium text-primary hover:underline underline-offset-4 opacity-90 transition-opacity\"\n                    >\n                      <span>{item.linkText || \"Visit website\"}</span>\n                      <ArrowUpRight className=\"size-3.5\" />\n                    </a>\n                  )}\n                </div>\n\n                {/* Progress bar line */}\n                {autoplay && (\n                  <div\n                    aria-hidden=\"true\"\n                    className=\"absolute left-0 right-0 bottom-0 h-[2.5px] bg-foreground/15 dark:bg-white/15 overflow-hidden\"\n                  >\n                    <div\n                      className=\"h-full bg-primary transition-all duration-75 ease-linear\"\n                      style={{ width: `${progress}%` }}\n                    />\n                  </div>\n                )}\n              </div>\n            </div>\n          );\n        })}\n      </div>\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/custom/blocks/Accordion.tsx"
    }
  ],
  "docs": "Named export: Accordion. Pass `accordionData` as { value, title, icon?, content } — content accepts a string array or a node. `type` is single | multiple; set `collapsible` to let the last open section close. Variants: default (open row lifts out as a card) | bordered (rail on the open row) | filled (open row inverts to primary) | elevated (cards, open one on a ring) | ghost (type and hairlines). `animation=\"stack\"` piles the items and deals them out on scroll-in via the Web Animations API; skipped under reduced motion. Wraps the `ui-accordion` Radix primitive. For a single section, `collapsible` is lighter.",
  "categories": [
    "layout"
  ],
  "type": "registry:component"
}
