{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"faq-section","type":"registry:block","title":"FAQ section","description":"FAQs as an accordion, a topic rail, or a searchable list that highlights matches.","categories":["blocks"],"dependencies":["lucide-react","motion"],"registryDependencies":["https://ui.teamofsilicons.com/r/silicon-motion-tokens.json","https://ui.teamofsilicons.com/r/search-field.json","https://ui.teamofsilicons.com/r/segmented-control.json"],"files":[{"path":"registry/blocks/faq-section/faq-section.tsx","type":"registry:component","target":"@components/silicon-ui/blocks/faq-section/faq-section.tsx","content":"\"use client\";\n\nimport { forwardRef, useId, useMemo, useState } from \"react\";\nimport type { KeyboardEvent, ReactNode } from \"react\";\nimport { AnimatePresence, LayoutGroup, motion, useReducedMotion } from \"motion/react\";\nimport type { Variants } from \"motion/react\";\nimport { ArrowRight, Plus } from \"lucide-react\";\nimport { SearchField } from \"../../search-field/search-field\";\nimport SegmentedControl from \"../../segmented-control/segmented-control\";\nimport { motionTokens } from \"../../lib/motion-tokens\";\nimport styles from \"./faq-section.module.css\";\n\nexport type FaqSectionVariant = \"accordion\" | \"columns\" | \"search\";\n\nexport interface FaqItem {\n  /** Stable id used for open state. Defaults to the question. */\n  id?: string;\n  question: string;\n  /** Plain text answer; it is also what search matches. */\n  answer: string;\n  /** Groups questions in the columns variant. */\n  category?: string;\n}\n\nexport interface FaqSectionProps {\n  /** `accordion` is one centered list, `columns` groups questions beside a category rail, `search` filters as you type. */\n  variant?: FaqSectionVariant;\n  title?: string;\n  description?: string;\n  items?: FaqItem[];\n  /** Allow several answers open at once. Defaults to false. */\n  multiple?: boolean;\n  /** Open item ids (controlled). */\n  value?: string[];\n  /** Initially open item ids when uncontrolled. */\n  defaultValue?: string[];\n  onValueChange?: (value: string[]) => void;\n  /** Active category in the columns variant (controlled). */\n  category?: string;\n  onCategoryChange?: (category: string) => void;\n  /** Search text in the search variant (controlled). */\n  query?: string;\n  onQueryChange?: (query: string) => void;\n  /** A way to reach a person when the answer isn't here. Pass null to hide it. */\n  contact?: { label: string; description?: string; href?: string; onClick?: () => void } | null;\n  className?: string;\n}\n\ntype Bezier = [number, number, number, number];\nconst enter = [...motionTokens.ease.enter] as Bezier;\nconst standard = [...motionTokens.ease.standard] as Bezier;\nconst { duration } = motionTokens;\n\nexport const faqExampleItems: FaqItem[] = [\n  { question: \"What is Silicon UI?\", answer: \"Silicon UI is a free, open source library of React components and blocks built on Motion and Radix. You copy the source into your project, so every line is yours to change.\", category: \"General\" },\n  { question: \"Does it work with my design system?\", answer: \"Yes. Components read semantic tokens such as surface, border, and accent, so mapping them to your palette takes one stylesheet.\", category: \"General\" },\n  { question: \"Is reduced motion supported?\", answer: \"Every animation has a reduced motion branch. It keeps the final state, focus, and feedback while removing travel and looping.\", category: \"General\" },\n  { question: \"Which frameworks are supported?\", answer: \"Silicon UI targets React 19 and Next.js 16. The components are client components and also run in Vite and React Router apps.\", category: \"Technical\" },\n  { question: \"How do I install a component?\", answer: \"Run the shadcn CLI with the component name, or copy the files by hand. Each page lists the packages it needs.\", category: \"Technical\" },\n  { question: \"How do updates work?\", answer: \"New components and fixes ship in small releases. Run the CLI again to pull the latest version of anything you installed.\", category: \"Technical\" },\n  { question: \"Can I use Silicon UI in client projects?\", answer: \"Yes. Every component and block is MIT licensed, free for personal and commercial work.\", category: \"Licensing\" },\n  { question: \"Do I need to credit Silicon UI?\", answer: \"Keep the MIT license notice in the files you copy. A link back is welcome but never required.\", category: \"Licensing\" },\n];\n\nconst keyOf = (item: FaqItem) => item.id ?? item.question;\nconst normalize = (text: string) => text.toLowerCase().normalize(\"NFD\").replace(/[̀-ͯ]/g, \"\");\n\n/** Wraps each match of `query` in a mark, keeping the original casing. */\nfunction Highlight({ text, query }: { text: string; query: string }) {\n  const needle = normalize(query.trim());\n  if (!needle) return <>{text}</>;\n  const haystack = normalize(text);\n  const parts: ReactNode[] = [];\n  let from = 0, at = haystack.indexOf(needle);\n  while (at >= 0) {\n    if (at > from) parts.push(text.slice(from, at));\n    parts.push(<mark key={at} className={styles.mark}>{text.slice(at, at + needle.length)}</mark>);\n    from = at + needle.length;\n    at = haystack.indexOf(needle, from);\n  }\n  parts.push(text.slice(from));\n  return <>{parts}</>;\n}\n\n/** A short window of the answer around the first match, for closed items that match only in their answer. */\nfunction snippet(answer: string, query: string) {\n  const at = normalize(answer).indexOf(normalize(query.trim()));\n  if (at < 0) return null;\n  const start = Math.max(0, answer.lastIndexOf(\" \", Math.max(0, at - 36)) + 1);\n  const end = Math.min(answer.length, at + query.length + 60);\n  return `${start > 0 ? \"…\" : \"\"}${answer.slice(start, end).trim()}${end < answer.length ? \"…\" : \"\"}`;\n}\n\nconst panelVariants: Variants = {\n  open: { height: \"auto\", opacity: 1, transition: { height: motionTokens.spring.smooth, opacity: { duration: duration.fast, ease: enter } } },\n  closed: { height: 0, opacity: 0, transition: { height: motionTokens.spring.smooth, opacity: { duration: duration.instant, ease: standard } } },\n};\nconst contentVariants: Variants = {\n  open: { y: 0, filter: \"blur(0px)\", transition: { y: motionTokens.spring.smooth, filter: { duration: duration.fast, ease: enter } } },\n  closed: { y: -6, filter: `blur(${motionTokens.blur.subtle}px)`, transition: { duration: duration.instant, ease: standard } },\n};\nconst reducedPanel: Variants = { open: { height: \"auto\", opacity: 1, transition: { duration: 0 } }, closed: { height: 0, opacity: 0, transition: { duration: 0 } } };\n\n/** Arrow keys, Home, and End move between the questions of one list. */\nfunction onListKeyDown(event: KeyboardEvent<HTMLElement>) {\n  if (![\"ArrowDown\", \"ArrowUp\", \"Home\", \"End\"].includes(event.key)) return;\n  const triggers = Array.from(event.currentTarget.querySelectorAll<HTMLElement>(\"[data-faq-trigger]\"));\n  const index = triggers.indexOf(document.activeElement as HTMLElement);\n  if (index < 0) return;\n  event.preventDefault();\n  const next = event.key === \"Home\" ? 0 : event.key === \"End\" ? triggers.length - 1 : (index + (event.key === \"ArrowDown\" ? 1 : -1) + triggers.length) % triggers.length;\n  triggers[next]!.focus();\n}\n\nfunction Question({ item, open, onToggle, query = \"\", reduced, baseId, layout }: { item: FaqItem; open: boolean; onToggle: () => void; query?: string; reduced: boolean; baseId: string; layout?: boolean }) {\n  const key = keyOf(item);\n  const safe = `${baseId}-${key.replace(/[^a-zA-Z0-9_-]/g, \"\")}`;\n  const hint = query && !open && !normalize(item.question).includes(normalize(query.trim())) ? snippet(item.answer, query) : null;\n  return <motion.li className={styles.item} data-open={open ? \"\" : undefined}\n    layout={layout && !reduced ? \"position\" : false}\n    initial={layout ? (reduced ? { opacity: 0 } : { opacity: 0, height: 0 }) : false}\n    animate={{ opacity: 1, height: \"auto\" }}\n    exit={reduced ? { opacity: 0, transition: { duration: 0 } } : { opacity: 0, height: 0, transition: { height: motionTokens.spring.smooth, opacity: { duration: duration.instant } } }}\n    transition={reduced ? { duration: 0 } : { height: motionTokens.spring.smooth, opacity: { duration: duration.fast }, layout: motionTokens.spring.smooth }}>\n    <h3 className={styles.heading}>\n      <button type=\"button\" id={`${safe}-q`} className={styles.trigger} data-faq-trigger=\"\" aria-expanded={open} aria-controls={`${safe}-a`} onClick={onToggle}>\n        <span className={styles.question}><Highlight text={item.question} query={query} /></span>\n        <Plus className={styles.icon} size={18} strokeWidth={1.75} aria-hidden=\"true\" />\n      </button>\n    </h3>\n    <AnimatePresence initial={false}>\n      {hint && <motion.p key=\"hint\" className={styles.hint} initial={{ opacity: 0, height: 0 }} animate={{ opacity: 1, height: \"auto\" }} exit={{ opacity: 0, height: 0 }} transition={reduced ? { duration: 0 } : { height: motionTokens.spring.smooth, opacity: { duration: duration.fast } }}>\n        <Highlight text={hint} query={query} />\n      </motion.p>}\n    </AnimatePresence>\n    <AnimatePresence initial={false}>\n      {open && <motion.div key=\"answer\" id={`${safe}-a`} role=\"region\" aria-labelledby={`${safe}-q`} className={styles.panel} variants={reduced ? reducedPanel : panelVariants} initial=\"closed\" animate=\"open\" exit=\"closed\">\n        <motion.p className={styles.answer} variants={reduced ? undefined : contentVariants}><Highlight text={item.answer} query={query} /></motion.p>\n      </motion.div>}\n    </AnimatePresence>\n  </motion.li>;\n}\n\nfunction Contact({ contact }: { contact: NonNullable<FaqSectionProps[\"contact\"]> }) {\n  const inner = <><span className={styles.contactText}><span>{contact.label}</span>{contact.description && <span>{contact.description}</span>}</span><ArrowRight className={styles.contactArrow} size={16} strokeWidth={1.75} aria-hidden=\"true\" /></>;\n  return contact.href\n    ? <a className={styles.contact} href={contact.href} onClick={contact.onClick}>{inner}</a>\n    : <button type=\"button\" className={styles.contact} onClick={contact.onClick}>{inner}</button>;\n}\n\n/**\n * A frequently asked questions section in three layouts: one centered accordion, a category rail beside its questions,\n * and a searchable list that filters and highlights as you type. Answers open on a height spring with the icon turning\n * to a close mark; arrow keys move between questions.\n */\nexport const FaqSection = forwardRef<HTMLElement, FaqSectionProps>(function FaqSection({\n  variant = \"accordion\",\n  title = \"Frequently asked questions\",\n  description = \"Everything you need to know before you install your first component.\",\n  items = faqExampleItems,\n  multiple = false,\n  value,\n  defaultValue,\n  onValueChange,\n  category: categoryProp,\n  onCategoryChange,\n  query: queryProp,\n  onQueryChange,\n  contact = { label: \"Still have a question?\", description: \"Our team replies within a day.\" },\n  className,\n}, ref) {\n  const id = useId();\n  const reduced = !!useReducedMotion();\n  const [innerOpen, setInnerOpen] = useState<string[]>(defaultValue ?? (items[0] ? [keyOf(items[0])] : []));\n  const open = value ?? innerOpen;\n  const categories = useMemo(() => Array.from(new Set(items.map(item => item.category ?? \"General\"))), [items]);\n  const [innerCategory, setInnerCategory] = useState(categories[0] ?? \"General\");\n  const activeCategory = categoryProp ?? innerCategory;\n  const [direction, setDirection] = useState(0);\n  const [innerQuery, setInnerQuery] = useState(\"\");\n  const query = queryProp ?? innerQuery;\n\n  const setOpen = (next: string[]) => { if (value === undefined) setInnerOpen(next); onValueChange?.(next); };\n  const toggle = (key: string) => setOpen(open.includes(key) ? open.filter(entry => entry !== key) : multiple ? [...open, key] : [key]);\n  const chooseCategory = (next: string) => {\n    if (next === activeCategory) return;\n    setDirection(Math.sign(categories.indexOf(next) - categories.indexOf(activeCategory)));\n    if (categoryProp === undefined) setInnerCategory(next);\n    onCategoryChange?.(next);\n  };\n  const setQuery = (next: string) => { if (queryProp === undefined) setInnerQuery(next); onQueryChange?.(next); };\n\n  const needle = normalize(query.trim());\n  const results = variant === \"search\" && needle ? items.filter(item => normalize(`${item.question} ${item.answer}`).includes(needle)) : items;\n  const heading = <div className={styles.intro}>\n    <h2 id={`${id}-title`} className={styles.title}>{title}</h2>\n    {description && <p className={styles.description}>{description}</p>}\n  </div>;\n  const list = (entries: FaqItem[], layout = false) => <ul className={styles.list} onKeyDown={onListKeyDown}>\n    <AnimatePresence initial={false}>\n      {entries.map(item => <Question key={keyOf(item)} item={item} open={open.includes(keyOf(item))} onToggle={() => toggle(keyOf(item))} query={variant === \"search\" ? query : \"\"} reduced={reduced} baseId={id} layout={layout} />)}\n    </AnimatePresence>\n  </ul>;\n\n  return <section ref={ref} className={[styles.faq, styles[variant], className].filter(Boolean).join(\" \")} aria-labelledby={`${id}-title`}>\n    {variant === \"accordion\" && <div className={styles.stack}>\n      {heading}\n      {list(items)}\n      {contact && <Contact contact={contact} />}\n    </div>}\n\n    {variant === \"columns\" && <div className={styles.columnsGrid}>\n      <div className={styles.rail}>\n        {heading}\n        <LayoutGroup id={`${id}-rail`}>\n          <div className={styles.categories} role=\"group\" aria-label=\"Question topics\">\n            {categories.map(entry => {\n              const count = items.filter(item => (item.category ?? \"General\") === entry).length;\n              return <button key={entry} type=\"button\" className={styles.category} aria-pressed={entry === activeCategory} onClick={() => chooseCategory(entry)}>\n                {entry === activeCategory && <motion.span layoutId=\"category\" className={styles.categoryHighlight} transition={reduced ? { duration: 0 } : motionTokens.spring.morph} aria-hidden=\"true\" />}\n                <span>{entry}</span><span className={styles.count}>{count}</span>\n              </button>;\n            })}\n          </div>\n        </LayoutGroup>\n        {contact && <Contact contact={contact} />}\n      </div>\n      <div className={styles.stage}>\n        <AnimatePresence initial={false} mode=\"popLayout\" custom={direction}>\n          <motion.div key={activeCategory} className={styles.stageFace} custom={direction}\n            initial={reduced ? { opacity: 0 } : { opacity: 0, y: direction * 16, filter: `blur(${motionTokens.blur.subtle}px)` }}\n            animate={{ opacity: 1, y: 0, filter: \"blur(0px)\" }}\n            exit={reduced ? { opacity: 0, transition: { duration: 0 } } : { opacity: 0, y: direction * -12, filter: `blur(${motionTokens.blur.subtle}px)`, transition: { duration: duration.instant, ease: standard } }}\n            transition={reduced ? { duration: 0 } : { y: motionTokens.spring.smooth, opacity: { duration: duration.fast, ease: enter }, filter: { duration: duration.fast, ease: enter } }}>\n            {list(items.filter(item => (item.category ?? \"General\") === activeCategory))}\n          </motion.div>\n        </AnimatePresence>\n      </div>\n    </div>}\n\n    {variant === \"search\" && <div className={styles.stack}>\n      {heading}\n      <div className={styles.searchRow}>\n        <SearchField label=\"Search questions\" placeholder=\"Try install, license, or motion\" value={query} onValueChange={setQuery} />\n        <p className={styles.resultCount} aria-live=\"polite\">{needle ? `${results.length} ${results.length === 1 ? \"answer\" : \"answers\"}` : `${items.length} questions`}</p>\n      </div>\n      {list(results, true)}\n      <AnimatePresence initial={false}>\n        {needle && results.length === 0 && <motion.div key=\"empty\" className={styles.empty}\n          initial={reduced ? { opacity: 0 } : { opacity: 0, y: 8 }} animate={{ opacity: 1, y: 0 }} exit={{ opacity: 0, transition: { duration: duration.instant } }}\n          transition={{ duration: reduced ? 0 : duration.standard, ease: enter }}>\n          <p>No answers mention “{query.trim()}”.</p>\n          <button type=\"button\" className={styles.clear} onClick={() => setQuery(\"\")}>Clear search</button>\n        </motion.div>}\n      </AnimatePresence>\n      {contact && <Contact contact={contact} />}\n    </div>}\n  </section>;\n});\n\nFaqSection.displayName = \"FaqSection\";\n\nconst variantOptions = [{ value: \"accordion\", label: \"Accordion\" }, { value: \"columns\", label: \"Two column\" }, { value: \"search\", label: \"Searchable\" }];\n\n/** Preview: the FAQ with a switch between its three layouts. */\nexport function FaqSectionBlock({ variant: initial = \"accordion\" }: { variant?: FaqSectionVariant }) {\n  const [variant, setVariant] = useState<FaqSectionVariant>(initial);\n  const [asked, setAsked] = useState(false);\n  return <div className={styles.preview}>\n    <SegmentedControl label=\"FAQ layout\" options={variantOptions} value={variant} onValueChange={next => setVariant(next as FaqSectionVariant)} />\n    <div className={styles.frame}>\n      <FaqSection key={variant} variant={variant} contact={{ label: asked ? \"Message sent to support\" : \"Still have a question?\", description: asked ? \"Hannah will reply within a day.\" : \"Our team replies within a day.\", onClick: () => setAsked(true) }} />\n    </div>\n  </div>;\n}\n\nexport default FaqSectionBlock;\n"},{"path":"registry/blocks/faq-section/faq-section.module.css","type":"registry:component","target":"@components/silicon-ui/blocks/faq-section/faq-section.module.css","content":".faq { container: faq / inline-size; background: var(--background); color: var(--foreground); font-family: var(--font-body); letter-spacing: var(--tracking-body); }\n\n.stack { display: grid; gap: var(--space-block); max-width: 720px; margin: 0 auto; padding: var(--space-screen) var(--space-section); }\n.intro { display: grid; gap: var(--space-group); }\n.accordion .intro, .search .intro { justify-items: center; text-align: center; }\n.title { margin: 0; font-family: var(--font-display); font-size: var(--text-3xl); font-weight: var(--weight-medium); letter-spacing: var(--tracking-display); line-height: var(--leading-display); text-wrap: balance; }\n.description { max-width: 480px; margin: 0; color: var(--text-secondary); font-size: var(--text-base); line-height: var(--leading-body); text-wrap: pretty; }\n\n.list { margin: 0; padding: 0; border-top: 1px solid var(--border); list-style: none; }\n.item { overflow: hidden; border-bottom: 1px solid var(--border); }\n.heading { margin: 0; font: inherit; }\n.trigger { display: flex; width: 100%; min-height: 64px; align-items: center; justify-content: space-between; gap: var(--space-inset); border: 0; padding: var(--space-inset) var(--space-tight); background: none; color: var(--foreground); font: inherit; font-size: var(--text-base); font-weight: var(--weight-medium); line-height: var(--leading-body); text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }\n.question { min-width: 0; }\n.icon { flex: none; color: var(--text-muted); transition: transform var(--duration-spring) var(--ease-spring), color var(--duration-fast) var(--ease-standard); }\n.item[data-open] .icon { color: var(--foreground); transform: rotate(45deg); }\n@media (hover: hover) and (pointer: fine) { .trigger:hover .icon { color: var(--foreground); } }\n.panel { overflow: hidden; }\n.answer { margin: 0; padding: 0 var(--space-page) var(--space-comfort) var(--space-tight); color: var(--text-secondary); font-size: var(--text-base); line-height: 1.6; text-wrap: pretty; }\n.hint { overflow: hidden; margin: 0; padding: 0 var(--space-page) var(--space-inset) var(--space-tight); color: var(--text-muted); font-size: var(--text-sm); line-height: var(--leading-body); }\n.mark { border-radius: var(--radius-detail); padding: 0 1px; background: var(--accent-subtle); color: inherit; }\n\n.contact { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: var(--space-inset); border: 1px solid var(--border); border-radius: var(--radius-control); padding: var(--space-inset) var(--space-comfort); background: var(--surface); color: var(--foreground); font: inherit; text-align: left; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform var(--duration-fast) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard); }\n.contact:active { transform: scale(.99); }\n.contactText { display: grid; gap: var(--space-hair); min-width: 0; }\n.contactText > span:first-child { font-size: var(--text-sm); font-weight: var(--weight-medium); }\n.contactText > span:last-child:not(:first-child) { color: var(--text-muted); font-size: var(--text-sm); }\n.contactArrow { flex: none; color: var(--text-muted); transition: transform var(--duration-fast) var(--ease-standard); }\n@media (hover: hover) and (pointer: fine) {\n  .contact:hover { background: var(--surface-muted); }\n  .contact:hover .contactArrow { color: var(--foreground); transform: translateX(2px); }\n}\n\n/* Two column: a topic rail beside the questions for that topic. */\n.columnsGrid { display: grid; max-width: 1120px; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: start; gap: var(--space-stage); margin: 0 auto; padding: var(--space-screen) var(--space-block); }\n.rail { position: sticky; top: var(--space-section); display: grid; gap: var(--space-section); }\n.categories { display: grid; gap: var(--space-hair); }\n.category { position: relative; isolation: isolate; display: flex; height: 40px; align-items: center; justify-content: space-between; gap: var(--space-group); border: 0; border-radius: var(--radius-control); padding: 0 var(--space-group); background: none; color: var(--text-secondary); font: inherit; font-size: var(--text-sm); font-weight: var(--weight-medium); text-align: left; white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: color var(--duration-fast) var(--ease-standard); }\n.category[aria-pressed=\"true\"] { color: var(--foreground); }\n@media (hover: hover) and (pointer: fine) { .category:hover { color: var(--foreground); } }\n.categoryHighlight { position: absolute; z-index: -1; inset: 0; border-radius: inherit; corner-shape: inherit; background: var(--surface-muted); }\n.count { color: var(--text-muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }\n.stage { position: relative; min-width: 0; }\n.stageFace { width: 100%; }\n\n/* Searchable */\n.searchRow { display: grid; gap: var(--space-related); }\n.resultCount { margin: 0; color: var(--text-muted); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }\n.empty { display: grid; justify-items: center; gap: var(--space-group); padding: var(--space-section) 0; text-align: center; }\n.empty p { margin: 0; color: var(--text-secondary); font-size: var(--text-sm); }\n.clear { height: var(--control-height-sm); border: 1px solid var(--border); border-radius: var(--radius-control); padding: 0 var(--space-inset); background: var(--surface); color: var(--foreground); font: inherit; font-size: var(--text-sm); font-weight: var(--weight-medium); cursor: pointer; transition: transform var(--duration-fast) var(--ease-standard); }\n.clear:active { transform: scale(.97); }\n\n@container faq (min-width: 720px) { .title { font-size: var(--text-4xl); } }\n@container faq (max-width: 760px) {\n  .columnsGrid { grid-template-columns: minmax(0, 1fr); gap: var(--space-block); padding-inline: var(--space-section); }\n  .rail { position: static; }\n  .categories { display: flex; overflow-x: auto; scrollbar-width: none; }\n  .categories::-webkit-scrollbar { display: none; }\n  .category { flex: none; }\n}\n@container faq (max-width: 480px) {\n  .stack, .columnsGrid { padding: var(--space-page) var(--space-inset); }\n  .answer, .hint { padding-right: var(--space-related); }\n}\n\n.preview { display: grid; width: 100%; justify-items: center; gap: var(--space-inset); }\n.frame { width: 100%; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--background); }\n\n@media (prefers-reduced-motion: reduce) {\n  .icon, .contact, .contactArrow, .category, .clear { transition: none; }\n  .contact:active, .clear:active { transform: none; }\n}\n"},{"path":"registry/components/segmented-control/segmented-control.tsx","type":"registry:component","target":"@components/silicon-ui/segmented-control/segmented-control.tsx","content":"\"use client\";\n\nimport { useEffect, useId, useLayoutEffect, useRef, type KeyboardEvent, type ReactNode } from \"react\";\nimport { LayoutGroup, motion, useReducedMotion } from \"motion/react\";\nimport { motionTokens } from \"../lib/motion-tokens\";\nimport { FluidHoverHighlight, useFluidHover } from \"../lib/fluid-hover\";\nimport styles from \"./segmented-control.module.css\";\n\nexport interface Segment { value: string; label: string; /** Optional content after the label, such as a badge. */ accessory?: ReactNode; }\nexport interface SegmentedControlProps {\n  options: Segment[];\n  value: string;\n  onValueChange: (value: string) => void;\n  label?: string;\n  /** Called when the pointer or focus reaches an option, before it is chosen. Use it to start loading what that option shows. */\n  onOptionIntent?: (value: string) => void;\n  /** `sm` (default) or `xs`, a compact 24px control for dense UI such as an Edit/Read toggle in a toolbar. */\n  size?: \"sm\" | \"xs\";\n  className?: string;\n}\n\nexport default function SegmentedControl({ options, value, onValueChange, label, onOptionIntent, size = \"sm\", className }: SegmentedControlProps) {\n  const id = useId();\n  const reduced = useReducedMotion();\n  const track = useRef<HTMLDivElement>(null);\n  // Fluid hover: the nearest option is lit and a click in a gap picks it. Focus already moves the selection, so it leaves the fill alone.\n  const hover = useFluidHover(track, { items: \"[data-value]\", axis: \"x\", followFocus: false });\n\n  // When the options are wider than the container, the track scrolls inside itself. Edges fade only on the side with more to see.\n  useLayoutEffect(() => {\n    const node = track.current;\n    if (!node) return;\n    const edges = () => {\n      const rest = node.scrollWidth - node.clientWidth - node.scrollLeft;\n      node.toggleAttribute(\"data-fade-start\", node.scrollLeft > 1);\n      node.toggleAttribute(\"data-fade-end\", rest > 1);\n    };\n    edges();\n    node.addEventListener(\"scroll\", edges, { passive: true });\n    const observer = typeof ResizeObserver === \"undefined\" ? null : new ResizeObserver(edges);\n    observer?.observe(node);\n    return () => { node.removeEventListener(\"scroll\", edges); observer?.disconnect(); };\n  }, [options.length]);\n\n  // The selected option is always scrolled fully into view, with a little room so it clears the fade.\n  const first = useRef(true);\n  useEffect(() => {\n    const node = track.current;\n    const button = node?.querySelector<HTMLElement>('[aria-pressed=\"true\"]');\n    if (!node || !button || node.scrollWidth <= node.clientWidth) { first.current = false; return; }\n    const room = 20, start = button.offsetLeft - room, end = button.offsetLeft + button.offsetWidth + room - node.clientWidth;\n    const left = node.scrollLeft > start ? start : node.scrollLeft < end ? end : node.scrollLeft;\n    if (left !== node.scrollLeft) node.scrollTo({ left: Math.max(0, left), behavior: first.current || reduced ? \"auto\" : \"smooth\" });\n    first.current = false;\n  }, [value, reduced]);\n\n  // Arrow keys, Home and End move the selection like a tab list; only the selected option is a tab stop.\n  const selectedIndex = Math.max(0, options.findIndex(option => option.value === value));\n  const onKeyDown = (event: KeyboardEvent<HTMLButtonElement>) => {\n    const last = options.length - 1;\n    const target = event.key === \"ArrowRight\" || event.key === \"ArrowDown\" ? (selectedIndex === last ? 0 : selectedIndex + 1)\n      : event.key === \"ArrowLeft\" || event.key === \"ArrowUp\" ? (selectedIndex === 0 ? last : selectedIndex - 1)\n        : event.key === \"Home\" ? 0 : event.key === \"End\" ? last : -1;\n    if (target < 0 || !options[target]) return;\n    event.preventDefault();\n    onValueChange(options[target].value);\n    track.current?.querySelector<HTMLElement>(`[data-value=\"${CSS.escape(options[target].value)}\"]`)?.focus({ preventScroll: true });\n  };\n\n  return <div className={`${styles.root} ${className ?? \"\"}`} role=\"group\" aria-label={label} data-size={size}>\n    <LayoutGroup id={id}><motion.div ref={track} layoutScroll className={styles.track} {...hover.handlers}>\n      <FluidHoverHighlight hover={hover} className={styles.hover} />\n      {options.map((option, index) => <button key={option.value} id={`${id}-${option.value}`} className={styles.button} type=\"button\" data-value={option.value} aria-pressed={value === option.value} tabIndex={index === selectedIndex ? 0 : -1} onClick={() => onValueChange(option.value)} onKeyDown={onKeyDown} onPointerEnter={onOptionIntent ? () => onOptionIntent(option.value) : undefined} onFocus={onOptionIntent ? () => onOptionIntent(option.value) : undefined}>\n        {value === option.value && <motion.span className={styles.selection} layoutId=\"selection\" layoutDependency={value} transition={reduced ? { duration: 0 } : motionTokens.spring.morph} aria-hidden=\"true\" />}\n        <span className={styles.label}>{option.label}{option.accessory}</span>\n      </button>)}\n    </motion.div></LayoutGroup>\n  </div>;\n}\n"},{"path":"registry/components/segmented-control/segmented-control.module.css","type":"registry:component","target":"@components/silicon-ui/segmented-control/segmented-control.module.css","content":"/* The frame can shrink below its content inside flex and grid parents; the track then scrolls inside it. */\n.root { display: inline-flex; min-width: 0; max-width: 100%; flex-shrink: 1; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface-muted); }\n/* The track owns the stacking context so the gliding highlight passes under every label, not over earlier ones. */\n.track { --fade-start: 0px; --fade-end: 0px; position: relative; isolation: isolate; display: flex; min-width: 0; gap: var(--space-hair); overflow-x: auto; overscroll-behavior-x: contain; padding: var(--space-hair); border-radius: inherit; corner-shape: inherit; scrollbar-width: none; -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--fade-start), #000 calc(100% - var(--fade-end)), transparent); mask-image: linear-gradient(to right, transparent, #000 var(--fade-start), #000 calc(100% - var(--fade-end)), transparent); }\n.track::-webkit-scrollbar { display: none; }\n.track[data-fade-start] { --fade-start: 20px; }\n.track[data-fade-end] { --fade-end: 20px; }\n/* Items never scale or change weight; only the highlight travels and the label color follows it. */\n.button { position: relative; flex: 0 0 auto; min-height: var(--control-height-sm); border: 0; border-radius: calc(var(--radius-control) - var(--space-hair)); padding: 0 var(--space-group); background: transparent; color: var(--text-muted); font: inherit; font-size: var(--text-sm); font-weight: var(--weight-medium); white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: color var(--duration-fast) var(--ease-standard); }\n/* The frame around the options is 2px, as in Tabs: too thin to hold the keyboard ring outside an option, so it is drawn inside. */\n.button:focus-visible { --focus-outline-offset: -3px; }\n@media (hover: hover) and (pointer: fine) { .button:hover { color: var(--foreground); } }\n.button:active, .button[aria-pressed=\"true\"] { color: var(--foreground); }\n/* The hover fill glides under the options and under the selection, so the selected option never changes on hover. */\n.hover { z-index: -1; border-radius: calc(var(--radius-control) - var(--space-hair)); corner-shape: var(--corner-shape); background: color-mix(in oklab, var(--foreground) 5%, transparent); }\n.selection { position: absolute; z-index: -1; inset: 0; border: 1px solid var(--border); border-radius: inherit; corner-shape: inherit; background: var(--surface); box-shadow: var(--shadow-resting); }\n.label { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: var(--space-related); }\n/* Compact: 24px segments at the small type step. */\n.root[data-size=\"xs\"] .button { min-height: var(--control-height-xs); padding: 0 var(--space-related); font-size: var(--text-xs); }\n@media (max-width: 380px) { .button { padding: 0 var(--space-group); } }\n@media (prefers-reduced-motion: reduce) { .button { transition: none; } }\n"},{"path":"registry/components/search-field/search-field.tsx","type":"registry:component","target":"@components/silicon-ui/search-field/search-field.tsx","content":"\"use client\";\nimport { forwardRef, useId, useRef } from \"react\";\nimport type { InputHTMLAttributes } from \"react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\nimport { Search, X as Xmark } from \"lucide-react\";\nimport { motionTokens } from \"../lib/motion-tokens\";\nimport styles from \"./search-field.module.css\";\nexport interface SearchFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, \"type\"> { label: string; value: string; onValueChange: (value: string) => void }\nexport const SearchField = forwardRef<HTMLInputElement, SearchFieldProps>(function SearchField({ label, value, onValueChange, id, className, ...props }, ref) {\n  const generated = useId(); const controlId = id ?? generated; const reduced = useReducedMotion(); const inputRef = useRef<HTMLInputElement | null>(null);\n  const setRefs = (node: HTMLInputElement | null) => { inputRef.current = node; if (typeof ref === \"function\") ref(node); else if (ref) ref.current = node; };\n  // Clearing returns focus to the field, since the clear button unmounts under the pointer.\n  function clear() { onValueChange(\"\"); inputRef.current?.focus(); }\n  return <div className={styles.field}><label htmlFor={controlId}>{label}</label><div className={styles.shell} data-filled={value ? \"true\" : undefined}>\n    <Search width={18} height={18} aria-hidden=\"true\"/><input {...props} ref={setRefs} id={controlId} type=\"search\" value={value} onChange={event => onValueChange(event.target.value)} className={[styles.input, className].filter(Boolean).join(\" \")} />\n    {/* The clear button has a reserved slot, so the field never changes width when it appears or leaves. */}\n    <span className={styles.clearSlot}><AnimatePresence initial={false}>{value ? <motion.button key=\"clear\" type=\"button\" tabIndex={0} onClick={clear} aria-label=\"Clear search\" initial={reduced ? { opacity: 0 } : { opacity: 0, scale: .8, filter: `blur(${motionTokens.blur.subtle}px)` }} animate={{ opacity: 1, scale: 1, filter: \"blur(0px)\" }} exit={reduced ? { opacity: 0, transition: { duration: 0 } } : { opacity: 0, scale: .8, filter: `blur(${motionTokens.blur.subtle}px)`, transition: { duration: motionTokens.duration.instant, ease: [...motionTokens.ease.standard] } }} whileTap={reduced ? undefined : { scale: .96, transition: { duration: motionTokens.duration.instant, ease: [...motionTokens.ease.standard] } }} transition={reduced ? { duration: motionTokens.duration.instant } : { ...motionTokens.spring.snappy, opacity: { duration: motionTokens.duration.fast }, filter: { duration: motionTokens.duration.fast } }}><Xmark width={16} height={16} aria-hidden=\"true\" /></motion.button> : null}</AnimatePresence></span>\n  </div></div>;\n});\n"},{"path":"registry/components/search-field/search-field.module.css","type":"registry:component","target":"@components/silicon-ui/search-field/search-field.module.css","content":".field { display: grid; gap: var(--space-related); min-width: 0; }\n.field label { font-size: var(--text-sm); font-weight: var(--weight-medium); line-height: var(--leading-body); letter-spacing: var(--tracking-body); }\n/* Focus darkens the border; the shell never changes size. */\n.shell { display: flex; min-height: var(--control-height-md); align-items: center; gap: var(--space-related); border: 1px solid var(--border-strong); border-radius: var(--radius-control); padding: 0 var(--space-group); background: var(--surface); transition: border-color var(--duration-fast) var(--ease-standard); }\n@media (hover: hover) and (pointer: fine) { .shell:hover:not(:focus-within) { border-color: var(--foreground); } }\n.shell:focus-within { border-color: var(--foreground); }\n/* The glass wakes up with the field: muted at rest, full contrast while searching. */\n.shell > svg { flex: 0 0 auto; color: var(--text-muted); transition: color var(--duration-fast) var(--ease-standard); }\n.shell:focus-within > svg, .shell[data-filled=\"true\"] > svg { color: var(--foreground); }\n.input { width: 100%; min-width: 0; border: 0; background: transparent; color: var(--foreground); font: inherit; font-size: var(--text-sm); letter-spacing: var(--tracking-body); outline: 0; }\n.input:focus-visible { outline: 0; }\n.input::placeholder { color: var(--text-muted); }\n.input::-webkit-search-cancel-button { display: none; }\n.clearSlot { display: grid; width: 24px; height: 24px; flex: 0 0 auto; place-items: center; }\n.shell button { display: grid; width: 24px; height: 24px; flex: 0 0 auto; place-items: center; border: 0; border-radius: var(--radius-control); background: transparent; color: var(--text-muted); transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard); }\n@media (hover: hover) and (pointer: fine) { .shell button:hover { background: var(--surface-muted); color: var(--foreground); } }\n@media (prefers-reduced-motion: reduce) { .shell, .shell > svg, .shell button { transition: none; } }\n"},{"path":"lib/fluid-hover.tsx","type":"registry:lib","target":"@components/silicon-ui/lib/fluid-hover.tsx","content":"\"use client\";\n\n/**\n * Fluid hover: in a set of items (a menu, a list, tabs, a grid), the item nearest the pointer is lit, even while the\n * pointer is in a gap, the padding or past the last item, and one highlight springs between items. A click in a gap goes\n * to the lit item, so what is lit is what a click hits. A new pointer entry fades the highlight in where it lands instead\n * of sliding it over from the last item. The keyboard moves it without travel, and reduced motion keeps the fade but\n * drops the travel.\n *\n *   const list = useRef<HTMLUListElement>(null);\n *   const hover = useFluidHover(list, { items: \"[data-item]\" });\n *   <ul ref={list} className={styles.list} {...hover.handlers}>      // .list { position: relative }\n *     <FluidHoverHighlight hover={hover} className={styles.highlight} />\n *     …items…\n *   </ul>\n *\n * Adapted from Fluid Functionalism's use-fluid-hover and fluid-hover-highlight by Micka Touillaud (MIT),\n * https://github.com/mickadesign/fluid-functionalism. Items are found by a selector instead of registering themselves,\n * so a component adopts it without changing its items.\n */\nimport { useEffect, useEffectEvent, useRef, useState } from \"react\";\nimport type { FocusEvent, MouseEvent, PointerEvent, RefObject } from \"react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\nimport { motionTokens } from \"./motion-tokens\";\n\n/** An item's box in the container's own layout space (unaffected by transforms or scrolling). */\nexport interface FluidRect { top: number; left: number; width: number; height: number }\n\nexport interface FluidHoverState {\n  /** Where the highlight sits, or null when nothing is lit. */\n  rect: FluidRect | null;\n  /** The lit item. */\n  item: HTMLElement | null;\n  /** False when the highlight should jump (keyboard, a resize) rather than travel. */\n  glide: boolean;\n  /** Steps on each new pointer entry, so the highlight fades in where it lands. */\n  session: number;\n}\n\nexport interface FluidHoverOptions {\n  /** Selector for the items inside the container. */\n  items: string;\n  /** \"y\" for lists (default), \"x\" for a row of tabs, \"xy\" for grids. */\n  axis?: \"x\" | \"y\" | \"xy\";\n  /** Items the highlight skips (and a gap click never activates). Defaults to disabled or aria-disabled items. */\n  isItemDisabled?: (item: HTMLElement) => boolean;\n  /** \"skip\" (default) lights the nearest enabled item even over a disabled one; \"clear\" lights nothing over a disabled item (a calendar's unavailable days). */\n  disabled?: \"skip\" | \"clear\";\n  /** Route a click in a gap to the lit item. On by default; turn it off where empty space should stay inert. */\n  gapClick?: boolean;\n  /** Light the item that receives keyboard focus. On by default. */\n  followFocus?: boolean;\n}\n\nconst defaultDisabled = (item: HTMLElement) =>\n  item.matches(\":disabled, [aria-disabled='true'], [data-disabled]\");\n\n/** Controls that sit between items keep their own clicks. */\nconst CONTROL = \"input, textarea, select, button, a, summary, [contenteditable], [role='textbox'], [role='searchbox'], [role='button']\";\n\n/** The item's box relative to the container, summing offsets through positioned ancestors in between. */\nexport function rectOf(item: HTMLElement, container: HTMLElement): FluidRect {\n  let top = item.offsetTop, left = item.offsetLeft;\n  let parent = item.offsetParent as HTMLElement | null;\n  while (parent && parent !== container && container.contains(parent)) {\n    top += parent.offsetTop + parent.clientTop;\n    left += parent.offsetLeft + parent.clientLeft;\n    parent = parent.offsetParent as HTMLElement | null;\n  }\n  return { top, left, width: item.offsetWidth, height: item.offsetHeight };\n}\n\n/**\n * The item the pointer is inside, or else the one whose edge is nearest along the axis (both axes for a grid). Edges, not\n * centres, so a gap next to a wide item still lights the item the pointer is closer to.\n */\nexport function pickNearest(items: HTMLElement[], x: number, y: number, axis: \"x\" | \"y\" | \"xy\"): HTMLElement | null {\n  let nearest: HTMLElement | null = null, best = Infinity;\n  for (const item of items) {\n    const r = item.getBoundingClientRect();\n    if (!r.width && !r.height) continue;\n    if (x >= r.left && x <= r.right && y >= r.top && y <= r.bottom) return item;\n    const dx = Math.max(r.left - x, 0, x - r.right), dy = Math.max(r.top - y, 0, y - r.bottom);\n    const distance = axis === \"x\" ? dx : axis === \"y\" ? dy : Math.hypot(dx, dy);\n    if (distance < best) { best = distance; nearest = item; }\n  }\n  return nearest;\n}\n\n/** Hands a gap click to the item as a real mouse click (detail, modifiers and coordinates kept), so the item reads it as a pointer press, not a keyboard one. */\nfunction forwardClick(item: HTMLElement, event: MouseEvent<HTMLElement>) {\n  const { detail, clientX, clientY, screenX, screenY, ctrlKey, shiftKey, altKey, metaKey, button, buttons } = event;\n  item.dispatchEvent(new globalThis.MouseEvent(\"click\", { bubbles: true, cancelable: true, composed: true, view: window, detail, clientX, clientY, screenX, screenY, ctrlKey, shiftKey, altKey, metaKey, button, buttons }));\n}\n\n/** Whether an event happened inside the element whose handler hears it, not in a portalled child (a submenu, a tooltip). */\nconst isOwn = (event: { currentTarget: EventTarget; target: EventTarget }) =>\n  !(event.currentTarget instanceof Node) || !(event.target instanceof Node) || event.currentTarget.contains(event.target);\n\nexport function useFluidHover<T extends HTMLElement>(container: RefObject<T | null>, options: FluidHoverOptions) {\n  const { items: selector, axis = \"y\", isItemDisabled = defaultDisabled, disabled = \"skip\", gapClick = true, followFocus = true } = options;\n  const [state, setState] = useState<FluidHoverState>({ rect: null, item: null, glide: false, session: 0 });\n  const current = useRef(state);\n  const pointer = useRef(false);\n  const entering = useRef(false);\n  const frame = useRef(0);\n\n  function commit(next: FluidHoverState) {\n    const prev = current.current;\n    if (prev.item === next.item && prev.session === next.session && sameRect(prev.rect, next.rect)) return;\n    current.current = next;\n    setState(next);\n  }\n\n  function light(item: HTMLElement | null, glide: boolean) {\n    const root = container.current;\n    if (!root || !item) return commit({ ...current.current, rect: null, item: null, glide });\n    let session = current.current.session;\n    if (entering.current) { entering.current = false; session += 1; }\n    commit({ rect: rectOf(item, root), item, glide: glide && session === current.current.session, session });\n  }\n\n  const enabledItems = () => {\n    const root = container.current;\n    return root ? [...root.querySelectorAll<HTMLElement>(selector)].filter(item => !isItemDisabled(item)) : [];\n  };\n\n  // The lit item can move under a still highlight (a resize, content above it changing): follow it without travel.\n  const follow = useEffectEvent(() => { const { item } = current.current; if (item?.isConnected) light(item, false); });\n  useEffect(() => {\n    const root = container.current;\n    if (!root || typeof ResizeObserver === \"undefined\") return;\n    const observer = new ResizeObserver(() => follow());\n    observer.observe(root);\n    return () => observer.disconnect();\n  }, [container]);\n  useEffect(() => () => cancelAnimationFrame(frame.current), []);\n\n  const handlers = {\n    onMouseEnter: () => { entering.current = true; },\n    onMouseMove: (event: MouseEvent<T>) => {\n      if (!isOwn(event)) return;\n      pointer.current = true;\n      const { clientX, clientY } = event;\n      cancelAnimationFrame(frame.current);\n      frame.current = requestAnimationFrame(() => {\n        const over = disabled === \"clear\" ? document.elementFromPoint(clientX, clientY)?.closest<HTMLElement>(selector) : null;\n        light(over && isItemDisabled(over) ? null : pickNearest(enabledItems(), clientX, clientY, axis), true);\n      });\n    },\n    onMouseLeave: () => { cancelAnimationFrame(frame.current); entering.current = false; light(null, false); },\n    onKeyDownCapture: () => { pointer.current = false; },\n    onFocus: (event: FocusEvent<T>) => {\n      if (!followFocus || pointer.current || !isOwn(event)) return;\n      const item = event.target instanceof HTMLElement ? event.target.closest<HTMLElement>(selector) : null;\n      if (item && container.current?.contains(item) && !isItemDisabled(item)) light(item, false);\n    },\n    onBlur: (event: FocusEvent<T>) => {\n      if (!pointer.current && !event.currentTarget.contains(event.relatedTarget as Node | null)) light(null, false);\n    },\n    onClick: (event: MouseEvent<T>) => {\n      if (!gapClick || !isOwn(event)) return;\n      const target = event.target as Element;\n      if (!target.isConnected || target.closest(selector) || target.closest(CONTROL)) return;\n      const { item } = current.current;\n      if (item?.isConnected && !isItemDisabled(item)) forwardClick(item, event);\n    },\n  };\n\n  /** Clears the highlight at once, such as when a menu opens again. */\n  const reset = () => { cancelAnimationFrame(frame.current); entering.current = true; light(null, false); };\n\n  return { ...state, handlers, reset, light };\n}\n\nexport interface NearestItemOptions extends Omit<FluidHoverOptions, \"followFocus\"> {\n  /** Called with the nearest enabled item as the mouse moves over the container. */\n  onPick: (item: HTMLElement) => void;\n}\n\n/**\n * Fluid hover's picking without its highlight, for a list that already keeps its own active item and highlight (a listbox\n * with aria-activedescendant, a roving list): the mouse picks the nearest enabled item, gaps and padding included, and a\n * click in a gap goes to that item. Spread the result on the container.\n */\n// A hook only so callbacks that touch refs can be passed during render; it keeps no state.\nexport function useNearestItem<T extends HTMLElement>({ items: selector, axis = \"y\", isItemDisabled = defaultDisabled, gapClick = true, onPick }: NearestItemOptions) {\n  const nearest = (event: MouseEvent<T>) => {\n    if (!isOwn(event)) return null;\n    const items = [...event.currentTarget.querySelectorAll<HTMLElement>(selector)].filter(item => !isItemDisabled(item));\n    return pickNearest(items, event.clientX, event.clientY, axis);\n  };\n  return {\n    onPointerMove: (event: PointerEvent<T>) => { if (event.pointerType !== \"mouse\") return; const item = nearest(event); if (item) onPick(item); },\n    onClick: (event: MouseEvent<T>) => {\n      if (!gapClick) return;\n      const target = event.target as Element;\n      if (!target.isConnected || target.closest(selector) || target.closest(CONTROL)) return;\n      const item = nearest(event);\n      if (item) forwardClick(item, event);\n    },\n  };\n}\n\nconst sameRect = (a: FluidRect | null, b: FluidRect | null) =>\n  a === b || (!!a && !!b && a.top === b.top && a.left === b.left && a.width === b.width && a.height === b.height);\n\nexport interface FluidHoverHighlightProps {\n  /** The state from useFluidHover (or any { rect, glide, session }). */\n  hover: Pick<FluidHoverState, \"rect\" | \"glide\" | \"session\">;\n  /** Radius, fill, z-index. The container must be position: relative; the highlight is placed at its top-left corner. */\n  className?: string;\n  /** Extra attributes for styling, such as data-tone. */\n  tone?: string;\n}\n\n/** The one highlight a fluid hover set renders: it springs between items on transforms, and fades in and out. */\nexport function FluidHoverHighlight({ hover, className, tone }: FluidHoverHighlightProps) {\n  const reduced = useReducedMotion() ?? false;\n  const { rect, glide, session } = hover;\n  const place = rect ? { x: rect.left, y: rect.top, width: rect.width, height: rect.height } : undefined;\n  return (\n    <AnimatePresence initial={false}>\n      {place ? (\n        <motion.span key={session} className={className} data-tone={tone} aria-hidden=\"true\"\n          style={{ position: \"absolute\", top: 0, left: 0, pointerEvents: \"none\" }}\n          initial={{ opacity: 0, ...place }}\n          animate={{ opacity: 1, ...place }}\n          exit={{ opacity: 0, transition: motionTokens.spring.fast.exit }}\n          transition={{ default: glide && !reduced ? motionTokens.spring.fast : { duration: 0 }, opacity: { duration: motionTokens.duration.fast } }} />\n      ) : null}\n    </AnimatePresence>\n  );\n}\n"}],"docs":"Docs and live preview: https://ui.teamofsilicons.com/faq-section","meta":{"tier":"free","kind":"block","docs":"https://ui.teamofsilicons.com/faq-section","markdown":"https://ui.teamofsilicons.com/faq-section.md","status":"stable"}}