{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "buttons",
  "type": "registry:ui",
  "title": "Buttons and links",
  "description": "Buttons in five looks and three sizes, a busy state with a spinner, and links for text and navigation.",
  "author": "Eugen Eşanu <https://eugenesanu.com>",
  "dependencies": [
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/ui/button.tsx",
      "type": "registry:ui",
      "target": "@components/filters-ui/ui/button.tsx",
      "content": "\"use client\";\n\nimport { useEffect, useRef, useState, type ButtonHTMLAttributes, type ReactNode } from \"react\";\nimport { cn } from \"../lib/cn\";\nimport { BUTTON_BASE, buttonClasses, type ButtonSize, type ButtonVariant } from \"./button-classes\";\n\nexport type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {\n  /** Default \"primary\". */\n  variant?: ButtonVariant;\n  /** \"sm\" 32px, \"md\" 40px, \"lg\" 44px. Default \"md\". */\n  size?: ButtonSize;\n  /** An icon before the label, drawn in currentColor. */\n  before?: ReactNode;\n  /** An icon after the label. */\n  after?: ReactNode;\n  /** While a request runs: presses do nothing and, after 150ms, a spinner takes the label's place for at least 400ms. */\n  busy?: boolean;\n};\n\nfunction Spinner() {\n  return (\n    <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\" focusable=\"false\" className=\"size-4 animate-spin\">\n      <circle cx=\"8\" cy=\"8\" r=\"6.5\" stroke=\"currentColor\" strokeOpacity=\"0.25\" strokeWidth=\"2\" />\n      <path d=\"M8 1.5A6.5 6.5 0 0 1 14.5 8\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" />\n    </svg>\n  );\n}\n\n/** \"idle\", then \"busy\" once a request has run 150ms, kept at least 400ms, then \"leaving\" for the spinner's exit. */\nfunction useSpinner(busy: boolean) {\n  const [phase, setPhase] = useState<\"idle\" | \"busy\" | \"leaving\">(\"idle\");\n  const since = useRef(0);\n  useEffect(() => {\n    let timer: ReturnType<typeof setTimeout> | undefined;\n    if (busy && phase !== \"busy\") {\n      timer = setTimeout(\n        () => {\n          since.current = Date.now();\n          setPhase(\"busy\");\n        },\n        phase === \"leaving\" ? 0 : 150,\n      );\n    } else if (!busy && phase === \"busy\") {\n      timer = setTimeout(() => setPhase(\"leaving\"), Math.max(0, 400 - (Date.now() - since.current)));\n    } else if (!busy && phase === \"leaving\") {\n      timer = setTimeout(() => setPhase(\"idle\"), 200);\n    }\n    return () => clearTimeout(timer);\n  }, [busy, phase]);\n  return phase;\n}\n\nconst SWAP = \"transition-[opacity,translate,filter] ease-in-out motion-reduce:transition-none\";\n\n/**\n * A button in five looks and three sizes, 10px corners. It presses to 0.97 and shows a 2px --fu-accent-soft focus ring.\n * It is never drawn disabled: while busy it keeps its look, its width and its focus, and ignores presses.\n */\nexport function Button({\n  variant = \"primary\",\n  size = \"md\",\n  before,\n  after,\n  busy = false,\n  type = \"button\",\n  className,\n  children,\n  onClick,\n  ...props\n}: ButtonProps) {\n  const phase = useSpinner(busy);\n  const blocked = busy || phase === \"busy\";\n\n  return (\n    <button\n      type={type}\n      aria-busy={blocked || undefined}\n      onClick={(event) => {\n        // Also stops a submit button from sending its form.\n        if (blocked) {\n          event.preventDefault();\n          return;\n        }\n        onClick?.(event);\n      }}\n      className={buttonClasses({ variant, size, before: before != null, after: after != null, className })}\n      {...props}\n    >\n      <span\n        className={cn(\n          \"inline-flex items-center gap-[inherit]\",\n          SWAP,\n          phase === \"busy\" ? \"-translate-y-1 opacity-0 blur-[2px] duration-150\" : \"delay-[110ms] duration-[170ms]\",\n        )}\n      >\n        {before != null && (\n          <span aria-hidden=\"true\" className=\"inline-flex shrink-0\">\n            {before}\n          </span>\n        )}\n        {children}\n        {after != null && (\n          <span aria-hidden=\"true\" className=\"inline-flex shrink-0\">\n            {after}\n          </span>\n        )}\n      </span>\n      {phase !== \"idle\" && (\n        <span aria-hidden=\"true\" className=\"pointer-events-none absolute inset-0 grid place-items-center\">\n          <span\n            className={cn(\n              \"grid\",\n              SWAP,\n              phase === \"busy\"\n                ? \"translate-y-0 opacity-100 blur-none delay-[110ms] duration-[170ms] starting:translate-y-1 starting:opacity-0 starting:blur-[2px]\"\n                : \"-translate-y-1 opacity-0 blur-[2px] duration-150\",\n            )}\n          >\n            <Spinner />\n          </span>\n        </span>\n      )}\n    </button>\n  );\n}\n\nexport type IconButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, \"children\" | \"aria-label\"> & {\n  /** The accessible name, e.g. \"Copy link\". Required: the icon alone says nothing to a screen reader. */\n  label: string;\n  /** \"sm\" 32px, \"md\" 36px, \"lg\" 44px square. Default \"md\". */\n  size?: ButtonSize;\n  /** \"ghost\": no fill until hovered. \"secondary\": a --fu-surface-3 square. Default \"ghost\". */\n  variant?: \"ghost\" | \"secondary\";\n  children: ReactNode;\n};\n\nconst ICON_TAP = \"pointer-coarse:after:absolute pointer-coarse:after:content-['']\";\n\nconst ICON_SIZES: Record<ButtonSize, string> = {\n  sm: cn(\"size-8 [&_svg]:size-4\", ICON_TAP, \"pointer-coarse:after:-inset-1.5\"),\n  md: cn(\"size-9 [&_svg]:size-5\", ICON_TAP, \"pointer-coarse:after:-inset-1\"),\n  lg: \"size-11 [&_svg]:size-5\",\n};\n\n/** A square button holding one icon, --fu-mute until hovered. */\nexport function IconButton({ label, size = \"md\", variant = \"ghost\", type = \"button\", className, children, ...props }: IconButtonProps) {\n  return (\n    <button\n      type={type}\n      aria-label={label}\n      className={cn(\n        BUTTON_BASE,\n        ICON_SIZES[size],\n        \"text-[var(--fu-mute,#BDBDBD)] hover:bg-[var(--fu-hover,#333333)] hover:text-[var(--fu-text,#F8F5F1)]\",\n        variant === \"secondary\" ? \"bg-[var(--fu-surface-3,#2A2A2A)] forced-colors:border forced-colors:border-[ButtonText]\" : \"bg-transparent\",\n        className,\n      )}\n      {...props}\n    >\n      <span aria-hidden=\"true\" className=\"inline-flex\">\n        {children}\n      </span>\n    </button>\n  );\n}\n"
    },
    {
      "path": "registry/lib/cn.ts",
      "type": "registry:lib",
      "target": "@components/filters-ui/lib/cn.ts",
      "content": "import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n"
    },
    {
      "path": "registry/ui/button-classes.ts",
      "type": "registry:ui",
      "target": "@components/filters-ui/ui/button-classes.ts",
      "content": "import { cn } from \"../lib/cn\";\n\n// The button looks as class names. Kept apart from button.tsx, a client module, so server pages can call them too.\n\nexport type ButtonVariant = \"primary\" | \"secondary\" | \"ghost\" | \"quiet\" | \"quiet-accent\";\nexport type ButtonSize = \"sm\" | \"md\" | \"lg\";\n\nexport const BUTTON_BASE = cn(\n  \"relative inline-flex shrink-0 cursor-pointer items-center justify-center rounded-[10px] font-[inherit] font-medium whitespace-nowrap no-underline select-none\",\n  \"[-webkit-tap-highlight-color:transparent] transition-[background-color,color,scale] duration-200 ease-[cubic-bezier(0.22,1,0.36,1)]\",\n  \"active:scale-[0.97] active:duration-75 motion-reduce:transition-none motion-reduce:active:scale-100\",\n  \"outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-solid focus-visible:outline-[var(--fu-accent-soft,#8FAAFF)]\",\n  \"aria-busy:cursor-progress aria-busy:active:scale-100\",\n);\n\nconst VARIANTS: Record<ButtonVariant, string> = {\n  primary:\n    \"bg-[var(--fu-accent,#3B57E6)] text-[var(--fu-on-accent,#FFFFFF)] hover:bg-[var(--fu-accent-hover,#3450D4)] forced-colors:border forced-colors:border-[ButtonText]\",\n  secondary:\n    \"bg-[var(--fu-surface-3,#2A2A2A)] text-[var(--fu-text,#F8F5F1)] hover:bg-[var(--fu-hover,#333333)] forced-colors:border forced-colors:border-[ButtonText]\",\n  ghost: \"bg-transparent text-[var(--fu-text,#F8F5F1)] hover:bg-[var(--fu-hover-wash,rgb(255_255_255/0.14))]\",\n  quiet: \"bg-transparent text-[var(--fu-mute,#BDBDBD)] hover:text-[var(--fu-text,#F8F5F1)]\",\n  \"quiet-accent\":\n    \"bg-transparent text-[var(--fu-accent-soft,#8FAAFF)] decoration-1 underline-offset-[5px] hover:text-[var(--fu-accent-pale,#D1DDFF)] [@media(hover:hover)]:hover:underline\",\n};\n\n// Below 44px a touch screen gets a taller invisible target through ::after.\nconst TAP = \"pointer-coarse:after:absolute pointer-coarse:after:inset-x-0 pointer-coarse:after:content-['']\";\n\nconst SIZES: Record<ButtonSize, { box: string; before: string; after: string }> = {\n  sm: { box: cn(\"h-8 gap-1.5 px-3 text-[13px] leading-5 [&_svg]:size-4\", TAP, \"pointer-coarse:after:-inset-y-1.5\"), before: \"ps-2.5\", after: \"pe-2.5\" },\n  md: { box: cn(\"h-10 gap-2 px-3.5 text-[15px] leading-5 [&_svg]:size-4\", TAP, \"pointer-coarse:after:-inset-y-0.5\"), before: \"ps-3\", after: \"pe-3\" },\n  lg: { box: \"h-11 gap-2 px-4 text-[15px] leading-5 [&_svg]:size-[18px]\", before: \"ps-3.5\", after: \"pe-3.5\" },\n};\n\n/** The classes of a button, for a link or a router link that should look like one. */\nexport function buttonClasses({\n  variant = \"primary\",\n  size = \"md\",\n  before = false,\n  after = false,\n  className,\n}: { variant?: ButtonVariant; size?: ButtonSize; before?: boolean; after?: boolean; className?: string } = {}) {\n  return cn(BUTTON_BASE, VARIANTS[variant], SIZES[size].box, before && SIZES[size].before, after && SIZES[size].after, className);\n}\n"
    },
    {
      "path": "registry/ui/copy-button.tsx",
      "type": "registry:ui",
      "target": "@components/filters-ui/ui/copy-button.tsx",
      "content": "\"use client\";\n\nimport { useEffect, useRef, useState, type ButtonHTMLAttributes } from \"react\";\nimport { cn } from \"../lib/cn\";\nimport { buttonClasses, type ButtonSize, type ButtonVariant } from \"./button-classes\";\nimport { CheckIcon, CopyIcon } from \"./icons\";\n\n/** Writes text to the clipboard. Falls back to a hidden textarea where the async API is missing or refused. */\nexport async function copyToClipboard(text: string) {\n  try {\n    if (window.isSecureContext && navigator.clipboard) {\n      await navigator.clipboard.writeText(text);\n      return true;\n    }\n  } catch {}\n  const area = document.createElement(\"textarea\");\n  area.value = text;\n  area.setAttribute(\"readonly\", \"\");\n  area.style.position = \"fixed\";\n  area.style.opacity = \"0\";\n  area.style.pointerEvents = \"none\";\n  document.body.appendChild(area);\n  const active = document.activeElement as HTMLElement | null;\n  area.select();\n  let done = false;\n  try {\n    done = document.execCommand(\"copy\");\n  } catch {}\n  area.remove();\n  active?.focus();\n  return done;\n}\n\ntype State = \"idle\" | \"copied\" | \"failed\";\n\nconst EASE = \"ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-none\";\nconst SHOWN = \"scale-100 opacity-100 blur-none\";\nconst GONE = \"scale-50 opacity-0 blur-[2px]\";\n\n/** The copy glyph turns into a check that draws itself in, then turns back. Decorative: the button carries the name. */\nexport function CopyGlyph({ copied, className }: { copied: boolean; className?: string }) {\n  return (\n    <span aria-hidden=\"true\" className={cn(\"relative inline-grid size-[1em] shrink-0 place-items-center [&>*]:[grid-area:1/1]\", className)}>\n      <CopyIcon className={cn(\"size-full transition-[scale,opacity,filter] duration-200\", EASE, copied ? GONE : SHOWN)} />\n      <CheckIcon\n        strokeWidth={2.5}\n        className={cn(\n          \"size-full text-[var(--fu-accent-soft,#8FAAFF)] transition-[scale,opacity,filter] duration-200\",\n          EASE,\n          // The check path is about 23 units long, so a 23 dash offset hides it and 0 draws it.\n          \"[&_path]:[stroke-dasharray:23] [&_path]:transition-[stroke-dashoffset] [&_path]:duration-[320ms] [&_path]:ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:[&_path]:transition-none\",\n          copied ? cn(SHOWN, \"[&_path]:[stroke-dashoffset:0] [&_path]:delay-[80ms]\") : cn(GONE, \"[&_path]:[stroke-dashoffset:23]\"),\n        )}\n      />\n    </span>\n  );\n}\n\nexport type CopyButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, \"onClick\" | \"children\" | \"type\"> & {\n  /** What to copy. A function is read at press time, for text that is costly to build. */\n  text: string | (() => string);\n  /** The visible words. Leave out for an icon-only square, which then needs `aria-label`. */\n  label?: string;\n  /** Shown for 1.6s after a copy. Default \"Copied\". */\n  copiedLabel?: string;\n  /** What screen readers hear after a copy, e.g. \"Prompt copied\". Default: copiedLabel. */\n  announce?: string;\n  /** Default \"secondary\". */\n  variant?: ButtonVariant;\n  /** Default \"md\". */\n  size?: ButtonSize;\n  /** Show the copy glyph before the words. Default true. */\n  icon?: boolean;\n  /** Called after each attempt. */\n  onCopy?: (ok: boolean) => void;\n};\n\nconst ICON_SQUARE: Record<ButtonSize, string> = {\n  sm: \"w-8 px-0 [&_svg]:size-4\",\n  md: \"w-10 px-0 [&_svg]:size-[18px]\",\n  lg: \"w-11 px-0 [&_svg]:size-5\",\n};\n\n// The glyph's box is exactly its icon's size, so the icon centres on the words and the gap is the button's own.\nconst GLYPH: Record<ButtonSize, string> = { sm: \"size-4\", md: \"size-4\", lg: \"size-[18px]\" };\nconst SQUARE_GLYPH: Record<ButtonSize, string> = { sm: \"size-4\", md: \"size-[18px]\", lg: \"size-5\" };\n\n/**\n * Copies text and confirms it in place: \"Copy\" and its glyph blur over to \"Copied\" with a check that draws in, and a\n * polite status tells screen readers. The button keeps its width, its focus and its look, with even space on both\n * sides of whatever it shows; a second press inside the 1.6s window copies again and is announced again. On failure\n * it says \"Failed\". Icon-only, it also shows a small \"Copy\" / \"Copied\" tip on hover and keyboard focus.\n */\nexport function CopyButton({\n  text,\n  label,\n  copiedLabel = \"Copied\",\n  announce,\n  variant = \"secondary\",\n  size = \"md\",\n  icon = true,\n  onCopy,\n  className,\n  \"aria-label\": ariaLabel,\n  ...props\n}: CopyButtonProps) {\n  const [state, setState] = useState<State>(\"idle\");\n  const [status, setStatus] = useState(\"\");\n  const reset = useRef<ReturnType<typeof setTimeout>>(undefined);\n  const speak = useRef<ReturnType<typeof setTimeout>>(undefined);\n  useEffect(\n    () => () => {\n      clearTimeout(reset.current);\n      clearTimeout(speak.current);\n    },\n    [],\n  );\n\n  const copy = async () => {\n    const ok = await copyToClipboard(typeof text === \"function\" ? text() : text);\n    setState(ok ? \"copied\" : \"failed\");\n    onCopy?.(ok);\n    // Emptied first, so a repeat copy inside the window is read out again.\n    setStatus(\"\");\n    clearTimeout(speak.current);\n    speak.current = setTimeout(() => setStatus(ok ? (announce ?? copiedLabel) : \"Copy failed\"), 60);\n    clearTimeout(reset.current);\n    reset.current = setTimeout(() => {\n      setState(\"idle\");\n      setStatus(\"\");\n    }, 1600);\n  };\n\n  const copied = state === \"copied\";\n  const iconOnly = label === undefined;\n  const words: Record<State, string | undefined> = { idle: label, copied: copiedLabel, failed: \"Failed\" };\n\n  return (\n    <>\n      <button\n        type=\"button\"\n        onClick={copy}\n        aria-label={iconOnly ? (copied ? copiedLabel : (ariaLabel ?? \"Copy\")) : ariaLabel}\n        data-state={state}\n        className={cn(\n          buttonClasses({ variant, size }),\n          iconOnly && ICON_SQUARE[size],\n          \"group/copy\",\n          className,\n        )}\n        {...props}\n      >\n        {iconOnly ? (\n          icon && <CopyGlyph copied={copied} className={SQUARE_GLYPH[size]} />\n        ) : (\n          // Each state, glyph and words, sits unseen in one grid cell, so the widest sets the width. The shown state lies\n          // centred over them, with the same space on both sides, and the states blur over into each other.\n          <span className=\"relative inline-grid [gap:inherit]\">\n            {(Object.keys(words) as State[]).map((key) => (\n              <span key={key} aria-hidden=\"true\" className=\"invisible inline-flex items-center [gap:inherit] [grid-area:1/1]\">\n                {icon && <span className={cn(\"shrink-0\", GLYPH[size])} />}\n                {words[key]}\n              </span>\n            ))}\n            {(Object.keys(words) as State[]).map((key) => (\n              <span\n                key={key}\n                aria-hidden={key !== state || undefined}\n                className={cn(\n                  \"absolute inset-0 flex items-center justify-center [gap:inherit] transition-[opacity,filter] duration-150 ease-in-out motion-reduce:transition-none\",\n                  key === state ? \"opacity-100 blur-none\" : \"pointer-events-none opacity-0 blur-[2px]\",\n                )}\n              >\n                {icon && <CopyGlyph copied={key === \"copied\" && copied} className={GLYPH[size]} />}\n                {words[key]}\n              </span>\n            ))}\n          </span>\n        )}\n        {iconOnly && (\n          <span\n            aria-hidden=\"true\"\n            className={cn(\n              \"pointer-events-none absolute bottom-[calc(100%+6px)] left-1/2 z-[2] -translate-x-1/2 rounded-[8px] px-2 py-1 whitespace-nowrap\",\n              \"bg-[var(--fu-text,#F8F5F1)] text-[12px] leading-4 font-medium text-[var(--fu-surface-1,#171717)]\",\n              \"translate-y-1 opacity-0 transition-[opacity,translate] duration-150 ease-in-out motion-reduce:transition-none\",\n              \"[@media(hover:hover)]:group-hover/copy:translate-y-0 [@media(hover:hover)]:group-hover/copy:opacity-100\",\n              \"group-focus-visible/copy:translate-y-0 group-focus-visible/copy:opacity-100\",\n              copied && \"translate-y-0 opacity-100\",\n            )}\n          >\n            {copied ? copiedLabel : state === \"failed\" ? \"Failed\" : (ariaLabel ?? \"Copy\")}\n          </span>\n        )}\n      </button>\n      <span className=\"sr-only\" role=\"status\" aria-live=\"polite\">\n        {status}\n      </span>\n    </>\n  );\n}\n"
    },
    {
      "path": "registry/ui/icons.tsx",
      "type": "registry:ui",
      "target": "@components/filters-ui/ui/icons.tsx",
      "content": "import type { ReactNode, SVGProps } from \"react\";\n\n/*\n * Icon paths from Lucide (https://lucide.dev), ISC License.\n * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT).\n * All other copyright (c) for Lucide are held by Lucide Contributors 2022.\n * Permission to use, copy, modify, and/or distribute this software for any purpose with or\n * without fee is hereby granted, provided that the above copyright notice and this permission\n * notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS\n * SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE\n * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,\n * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n * PERFORMANCE OF THIS SOFTWARE.\n */\n\nexport type IconProps = Omit<SVGProps<SVGSVGElement>, \"children\"> & { size?: number };\n\nfunction Icon({ size = 20, strokeWidth = 2, children, ...props }: IconProps & { children: ReactNode }) {\n  return (\n    <svg\n      width={size}\n      height={size}\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      strokeWidth={strokeWidth}\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n      aria-hidden=\"true\"\n      focusable=\"false\"\n      {...props}\n    >\n      {children}\n    </svg>\n  );\n}\n\nexport function ChevronDownIcon(props: IconProps) {\n  return (\n    <Icon {...props}>\n      <path d=\"m6 9 6 6 6-6\" />\n    </Icon>\n  );\n}\n\nexport function XIcon(props: IconProps) {\n  return (\n    <Icon {...props}>\n      <path d=\"M18 6 6 18\" />\n      <path d=\"m6 6 12 12\" />\n    </Icon>\n  );\n}\n\nexport function CheckIcon(props: IconProps) {\n  return (\n    <Icon {...props}>\n      <path d=\"M20 6 9 17l-5-5\" />\n    </Icon>\n  );\n}\n\nexport function SearchIcon(props: IconProps) {\n  return (\n    <Icon {...props}>\n      <circle cx=\"11\" cy=\"11\" r=\"8\" />\n      <path d=\"m21 21-4.3-4.3\" />\n    </Icon>\n  );\n}\n\nexport function ArrowUpRightIcon(props: IconProps) {\n  return (\n    <Icon {...props}>\n      <path d=\"M7 7h10v10\" />\n      <path d=\"M7 17 17 7\" />\n    </Icon>\n  );\n}\n\nexport function PlusIcon(props: IconProps) {\n  return (\n    <Icon {...props}>\n      <path d=\"M5 12h14\" />\n      <path d=\"M12 5v14\" />\n    </Icon>\n  );\n}\n\nexport function CopyIcon(props: IconProps) {\n  return (\n    <Icon {...props}>\n      <rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\" />\n      <path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\" />\n    </Icon>\n  );\n}\n\nexport function SlidersIcon(props: IconProps) {\n  return (\n    <Icon {...props}>\n      <path d=\"M21 4h-7\" />\n      <path d=\"M10 4H3\" />\n      <path d=\"M21 12h-9\" />\n      <path d=\"M8 12H3\" />\n      <path d=\"M21 20h-5\" />\n      <path d=\"M12 20H3\" />\n      <path d=\"M14 2v4\" />\n      <path d=\"M8 10v4\" />\n      <path d=\"M16 18v4\" />\n    </Icon>\n  );\n}\n\nexport function ArrowRightIcon(props: IconProps) {\n  return (\n    <Icon {...props}>\n      <path d=\"M5 12h14\" />\n      <path d=\"m12 5 7 7-7 7\" />\n    </Icon>\n  );\n}\n\nexport function SearchXIcon(props: IconProps) {\n  return (\n    <Icon {...props}>\n      <path d=\"m13.5 8.5-5 5\" />\n      <path d=\"m8.5 8.5 5 5\" />\n      <circle cx=\"11\" cy=\"11\" r=\"8\" />\n      <path d=\"m21 21-4.3-4.3\" />\n    </Icon>\n  );\n}\n\nexport function StarIcon(props: IconProps) {\n  return (\n    <Icon {...props}>\n      <path d=\"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z\" />\n    </Icon>\n  );\n}\n\nexport function HistoryIcon(props: IconProps) {\n  return (\n    <Icon {...props}>\n      <path d=\"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\" />\n      <path d=\"M3 3v5h5\" />\n      <path d=\"M12 7v5l4 2\" />\n    </Icon>\n  );\n}\n\nexport function ListTreeIcon(props: IconProps) {\n  return (\n    <Icon {...props}>\n      <path d=\"M21 12h-8\" />\n      <path d=\"M21 6H8\" />\n      <path d=\"M21 18h-8\" />\n      <path d=\"M3 6v4c0 1.1.9 2 2 2h3\" />\n      <path d=\"M3 10v6c0 1.1.9 2 2 2h3\" />\n    </Icon>\n  );\n}\n\nexport function CircleAlertIcon(props: IconProps) {\n  return (\n    <Icon {...props}>\n      <circle cx=\"12\" cy=\"12\" r=\"10\" />\n      <path d=\"M12 8v4\" />\n      <path d=\"M12 16h.01\" />\n    </Icon>\n  );\n}\n"
    },
    {
      "path": "registry/ui/link.tsx",
      "type": "registry:ui",
      "target": "@components/filters-ui/ui/link.tsx",
      "content": "import type { AnchorHTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"../lib/cn\";\nimport { ArrowUpRightIcon, ChevronDownIcon } from \"./icons\";\n\nexport type LinkVariant = \"inline\" | \"quiet\";\n\nexport type LinkStyle = {\n  /** \"inline\": accent text, always underlined, for a link inside a sentence. \"quiet\": muted text that lights up, for navigation. Default \"inline\". */\n  variant?: LinkVariant;\n  /** A quiet link's colour at rest: \"mute\" (--fu-mute) or \"dim\" (--fu-dim). Default \"mute\". */\n  tone?: \"mute\" | \"dim\";\n  /** A quiet link's height: \"md\" 36px, \"lg\" 44px (a header). Default \"md\". */\n  size?: \"md\" | \"lg\";\n  className?: string;\n};\n\nconst FOCUS =\n  \"rounded-[4px] outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-solid focus-visible:outline-[var(--fu-accent-soft,#8FAAFF)] [-webkit-tap-highlight-color:transparent]\";\n\n/** The classes of a link, for a router link such as next/link. Pair a quiet one with LinkArrow for an arrow that nudges on hover. */\nexport function linkClasses({ variant = \"inline\", tone = \"mute\", size = \"md\", className }: LinkStyle = {}) {\n  return cn(\n    \"group/link transition-[color,text-decoration-color] duration-200 ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-none\",\n    FOCUS,\n    variant === \"inline\"\n      ? cn(\n          \"text-[var(--fu-accent-soft,#8FAAFF)] underline decoration-1 underline-offset-[3px] decoration-[color:var(--fu-link-line,rgb(143_170_255/0.4))]\",\n          \"transition-[color,text-decoration-color,text-underline-offset]\",\n          \"hover:text-[var(--fu-accent-pale,#D1DDFF)] hover:decoration-[color:var(--fu-accent-pale,#D1DDFF)] hover:underline-offset-[5px] active:opacity-80\",\n        )\n      : cn(\n          \"relative inline-flex items-center gap-1 text-[14px] leading-5 whitespace-nowrap no-underline hover:text-[var(--fu-text,#F8F5F1)]\",\n          tone === \"dim\" ? \"text-[var(--fu-dim,#929292)]\" : \"text-[var(--fu-mute,#BDBDBD)]\",\n          size === \"lg\" ? \"h-11\" : \"h-9 pointer-coarse:after:absolute pointer-coarse:after:inset-x-0 pointer-coarse:after:-inset-y-1 pointer-coarse:after:content-['']\",\n        ),\n    className,\n  );\n}\n\n/** A 16px chevron that nudges 2px its way while its link is hovered. Back links point and nudge back: left, or right in RTL. */\nexport function LinkArrow({ direction = \"forward\", className }: { direction?: \"forward\" | \"back\"; className?: string }) {\n  return (\n    <ChevronDownIcon\n      size={16}\n      className={cn(\n        \"shrink-0 transition-[translate] duration-200 ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-none\",\n        direction === \"back\"\n          ? \"rotate-90 group-hover/link:-translate-x-0.5 rtl:-rotate-90 rtl:group-hover/link:translate-x-0.5\"\n          : \"-rotate-90 group-hover/link:translate-x-0.5 rtl:rotate-90 rtl:group-hover/link:-translate-x-0.5\",\n        className,\n      )}\n    />\n  );\n}\n\n/** A quiet link's words: a 1px line draws in under them from the start edge while the link is hovered or focused. */\nexport function LinkText({ children, className }: { children: ReactNode; className?: string }) {\n  return (\n    <span\n      className={cn(\n        \"bg-[linear-gradient(currentColor,currentColor)] bg-[length:0%_1px] bg-[position:0_100%] rtl:bg-[position:100%_100%] bg-no-repeat pb-px\",\n        \"transition-[background-size] duration-300 ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-none\",\n        \"[@media(hover:hover)]:group-hover/link:bg-[length:100%_1px] group-focus-visible/link:bg-[length:100%_1px]\",\n        className,\n      )}\n    >\n      {children}\n    </span>\n  );\n}\n\n/** The up-right arrow after a link that opens a new tab, with the words a screen reader needs. */\nexport function ExternalMark() {\n  return (\n    <>\n      <ArrowUpRightIcon\n        size={12}\n        strokeWidth={2.5}\n        className={cn(\n          \"ms-1 inline-block shrink-0 align-[-1px] opacity-70\",\n          \"transition-[translate] duration-200 ease-[cubic-bezier(0.22,1,0.36,1)] group-hover/link:translate-x-px group-hover/link:-translate-y-px motion-reduce:transition-none\",\n        )}\n      />\n      <span className=\"sr-only\"> (opens in a new tab)</span>\n    </>\n  );\n}\n\nexport type TextLinkProps = AnchorHTMLAttributes<HTMLAnchorElement> &\n  LinkStyle & {\n    /** A chevron before (\"back\") or after (\"forward\") the words. */\n    arrow?: \"forward\" | \"back\";\n  };\n\n/**\n * A link: \"inline\" inside a sentence (--fu-accent-soft, underlined, so colour is never its only mark) or \"quiet\" for\n * navigation (muted, no underline). target=\"_blank\" adds an up-right arrow, \"opens in a new tab\" and rel=\"noopener\".\n * An action with no URL is a Button with variant \"quiet\", not a link.\n */\nexport function TextLink({ variant, tone, size, arrow, target, rel, className, children, ...props }: TextLinkProps) {\n  const external = target === \"_blank\";\n  return (\n    <a target={target} rel={rel ?? (external ? \"noopener\" : undefined)} className={linkClasses({ variant, tone, size, className })} {...props}>\n      {arrow === \"back\" && <LinkArrow direction=\"back\" />}\n      {variant === \"quiet\" ? <LinkText>{children}</LinkText> : children}\n      {arrow === \"forward\" && <LinkArrow />}\n      {external && <ExternalMark />}\n    </a>\n  );\n}\n"
    }
  ],
  "meta": {
    "addedIn": "1.0.0",
    "updatedIn": "1.3.5"
  }
}
