{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"faq-section","type":"registry:block","title":"FAQ","description":"FAQ section with a heading, a spring accordion of questions and a \"still have questions\" contact card whose avatar stack pops in.","author":"GetUrUI <hello@geturui.dev>","dependencies":["motion","lucide-react"],"registryDependencies":["@geturui/accordion","@geturui/button"],"files":[{"path":"registry/geturui/blocks/faq-section.tsx","type":"registry:block","target":"components/blocks/faq-section.tsx","content":"\"use client\";\n\nimport * as React from \"react\";\nimport { motion } from \"motion/react\";\nimport { MessageCircle } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\nimport { Accordion, type AccordionItem } from \"@/components/ui/accordion\";\nimport { buttonClasses, Button } from \"@/components/ui/button\";\n\nconst REDUCE = \"(prefers-reduced-motion: reduce)\";\nconst subscribeReduce = (cb: () => void) => {\n  const m = window.matchMedia(REDUCE);\n  m.addEventListener(\"change\", cb);\n  return () => m.removeEventListener(\"change\", cb);\n};\n/** Reduced-motion preference that is false on the server and during hydration, so the first render matches. */\nfunction useReducedMotionSafe() {\n  return React.useSyncExternalStore(subscribeReduce, () => window.matchMedia(REDUCE).matches, () => false);\n}\n\nexport interface FaqContact {\n  title: string;\n  description: string;\n  actionLabel: string;\n  /** Renders the action as a link when set. */\n  href?: string;\n  onAction?: () => void;\n  /** Names for the initials avatar stack. */\n  team?: string[];\n  /** Small status line, e.g. \"Replies in about 2 hours\". */\n  responseTime?: string;\n}\n\nexport interface FaqSectionProps {\n  eyebrow?: string;\n  heading?: string;\n  subheading?: string;\n  items?: AccordionItem[];\n  /** Index open on mount; -1 for none. */\n  defaultOpen?: number;\n  /** Contact card under the heading. Pass null to hide. */\n  contact?: FaqContact | null;\n  /** \"split\" puts heading + contact beside the list on large screens; \"stacked\" centres everything. */\n  layout?: \"split\" | \"stacked\";\n  className?: string;\n}\n\nconst DEFAULT_ITEMS: AccordionItem[] = [\n  {\n    q: \"Do I need to install a package?\",\n    a: \"No. The CLI copies the component source into your project, so you own it. The only runtime dependencies are motion and lucide-react.\",\n  },\n  {\n    q: \"Does it work with my design system?\",\n    a: \"Every component reads CSS variables for surfaces, ink, brand and radii. Map them to your tokens once and the whole library follows.\",\n  },\n  {\n    q: \"How do Pro blocks get updated?\",\n    a: \"Run the add command again and review the diff. We note breaking changes in the changelog, and older versions stay available.\",\n  },\n  {\n    q: \"What about reduced motion?\",\n    a: \"Anything bigger than a fade checks the user's reduced-motion preference and falls back to a simple opacity change.\",\n  },\n  {\n    q: \"Can I use it in client projects?\",\n    a: \"Yes. Free components are MIT licensed, and the Pro licence covers unlimited client projects for your seats.\",\n  },\n];\n\nconst DEFAULT_CONTACT: FaqContact = {\n  title: \"Still have questions?\",\n  description: \"Talk to the people who build GetUrUI. We answer every message ourselves.\",\n  actionLabel: \"Message the team\",\n  team: [\"Nadia Kim\", \"Theo Laurent\", \"Ravi Shah\"],\n  responseTime: \"Replies in about 2 hours\",\n};\n\nfunction initials(name: string) {\n  return name\n    .split(/\\s+/)\n    .slice(0, 2)\n    .map((p) => p[0]?.toUpperCase())\n    .join(\"\");\n}\n\nfunction ContactCard({ contact }: { contact: FaqContact }) {\n  const reduce = useReducedMotionSafe();\n  const tones = [\"bg-volt-soft text-volt-ink\", \"bg-ember-soft text-ember-ink\", \"bg-surface-raised text-ink\"];\n  return (\n    <motion.aside\n      className=\"grid gap-4 rounded-lg border border-border bg-surface p-5\"\n      initial={reduce ? { opacity: 0 } : { opacity: 0, y: 12 }}\n      whileInView={{ opacity: 1, y: 0 }}\n      viewport={{ once: true }}\n      transition={{ type: \"spring\", stiffness: 280, damping: 30, delay: 0.1 }}\n    >\n      {contact.team && contact.team.length > 0 && (\n        <div className=\"flex items-center gap-3\">\n          <div className=\"flex -space-x-2\" aria-hidden>\n            {contact.team.slice(0, 4).map((n, i) => (\n              <motion.span\n                key={n}\n                className={cn(\"grid size-9 place-items-center rounded-full text-[12px] font-semibold ring-2 ring-surface\", tones[i % tones.length])}\n                initial={reduce ? false : { scale: 0.6, opacity: 0 }}\n                whileInView={{ scale: 1, opacity: 1 }}\n                viewport={{ once: true }}\n                transition={{ type: \"spring\", stiffness: 420, damping: 22, delay: 0.2 + i * 0.07 }}\n              >\n                {initials(n)}\n              </motion.span>\n            ))}\n          </div>\n          {contact.responseTime && (\n            <span className=\"inline-flex items-center gap-1.5 text-[12.5px] font-medium text-ink-muted\">\n              <span className=\"size-1.5 rounded-full bg-success text-success animate-pulse-dot\" aria-hidden />\n              {contact.responseTime}\n            </span>\n          )}\n        </div>\n      )}\n      <div className=\"grid gap-1\">\n        <h3 className=\"text-[15px] font-semibold text-ink\">{contact.title}</h3>\n        <p className=\"text-sm leading-[22px] text-ink-muted\">{contact.description}</p>\n      </div>\n      {contact.href ? (\n        <a href={contact.href} onClick={contact.onAction} className={buttonClasses({ variant: \"secondary\", className: \"justify-self-start\" })}>\n          <MessageCircle className=\"size-4\" aria-hidden />\n          {contact.actionLabel}\n        </a>\n      ) : (\n        <Button variant=\"secondary\" className=\"justify-self-start\" onClick={contact.onAction}>\n          <MessageCircle className=\"size-4\" aria-hidden />\n          {contact.actionLabel}\n        </Button>\n      )}\n    </motion.aside>\n  );\n}\n\n/** FAQ section: heading, a spring accordion of questions and a \"still have questions\" contact card with an avatar stack. */\nexport function FaqSection({\n  eyebrow = \"FAQ\",\n  heading = \"Questions, answered\",\n  subheading = \"Everything teams usually ask before they add their first component.\",\n  items = DEFAULT_ITEMS,\n  defaultOpen = 0,\n  contact = DEFAULT_CONTACT,\n  layout = \"split\",\n  className,\n}: FaqSectionProps) {\n  const split = layout === \"split\";\n  return (\n    <section className={cn(\"@container w-full px-4 py-16 sm:px-6 sm:py-24\", className)}>\n      <div className={cn(\"mx-auto grid gap-10\", split ? \"max-w-6xl @4xl:grid-cols-[minmax(0,1fr)_minmax(0,1.5fr)] @4xl:gap-16\" : \"max-w-3xl\")}>\n        <div className={cn(\"grid content-start gap-6\", split ? \"@4xl:sticky @4xl:top-24\" : \"justify-items-center text-center\")}>\n          <header className=\"grid gap-3\">\n            {eyebrow && <span className=\"text-[13px] font-semibold uppercase tracking-[1px] text-volt-ink\">{eyebrow}</span>}\n            <h2 className=\"text-balance font-display text-3xl font-semibold tracking-[-0.8px] text-ink @xl:text-[40px] @xl:leading-[1.1]\">{heading}</h2>\n            {subheading && <p className=\"text-balance text-base leading-7 text-ink-muted\">{subheading}</p>}\n          </header>\n          {split && contact && <ContactCard contact={contact} />}\n        </div>\n        <div className=\"grid content-start gap-6\">\n          <Accordion items={items} defaultOpen={defaultOpen} />\n          {!split && contact && (\n            <div className=\"text-left\">\n              <ContactCard contact={contact} />\n            </div>\n          )}\n        </div>\n      </div>\n    </section>\n  );\n}\n"},{"path":"LICENSE-geturui.md","type":"registry:file","target":"LICENSE-geturui.md","content":"MIT License\n\nCopyright (c) 2026 geturui.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"}],"categories":["blocks","faq","accordion","questions","support","contact"],"meta":{"tier":"free","license":"MIT","docs":"https://geturui.com/docs/faq-section"}}