{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "auth-silk",
  "title": "Auth: Silk",
  "description": "Black, with satin drapes of liquid metal. A magic-link form with a chrome-ringed button.",
  "dependencies": [
    "lucide-react",
    "motion"
  ],
  "registryDependencies": [
    "utils",
    "@animate-ui/icons-arrow-left",
    "@animate-ui/icons-fingerprint",
    "@animate-ui/icons-loader-circle"
  ],
  "files": [
    {
      "path": "components/blocks/auth-silk.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Mail } from \"lucide-react\"\nimport { AnimateIcon } from \"@/components/animate-ui/icons/icon\"\nimport { ArrowLeft } from \"@/components/animate-ui/icons/arrow-left\"\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\"\n\nimport {\n  AfterglowMark,\n  GitHubMark,\n  GoogleMark,\n  SubmitLabel,\n  checkEmail,\n  useSubmit,\n  type Provider,\n} from \"@/components/ui/auth-parts\"\nimport { LiquidMetal, MetalRim } from \"@/components/ui/liquid-metal\"\nimport { MetalButton } from \"@/components/ui/metal-button\"\nimport { cn } from \"@/lib/utils\"\n\ntype AuthSilkProps = {\n  /** sends the magic link; throw to show an error under the field */\n  onSubmit?: (values: { email: string }) => Promise<void> | void\n  onProvider?: (provider: Provider) => void\n  className?: string\n}\n\nconst GRAIN =\n  \"url(\\\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E\\\")\"\n\nconst quiet =\n  \"inline-flex h-10 cursor-pointer items-center justify-center gap-2 rounded-[10px] border border-white/[0.08] bg-white/[0.04] text-[13px] font-medium text-white/90 shadow-[inset_0_1px_0_oklch(1_0_0/5%)] transition-[background-color,border-color,scale] duration-150 ease-out motion-reduce:transition-none outline-none hover:border-white/[0.14] hover:bg-white/[0.07] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white/40 motion-safe:active:scale-[0.98] [&_svg]:size-4\"\n\n// black, with satin drapes of liquid metal in two corners and one quiet column\nexport function AuthSilk({ onSubmit, onProvider, className }: AuthSilkProps) {\n  const reduceMotion = useReducedMotion()\n  const id = React.useId()\n  const [email, setEmail] = React.useState(\"\")\n  const [emailError, setEmailError] = React.useState<string>()\n  const [returning, setReturning] = React.useState(false)\n  const { status, error, run, reset } = useSubmit(onSubmit)\n  const problem = emailError ?? error\n\n  function handleSubmit(event: React.FormEvent<HTMLFormElement>) {\n    event.preventDefault()\n    const next = checkEmail(email)\n    setEmailError(next)\n    if (!next) run({ email: email.trim() })\n  }\n\n  // the resting state is the same either way, so server and client agree\n  const swap = {\n    initial: reduceMotion ? { opacity: 0 } : { opacity: 0, y: 8, filter: \"blur(4px)\" },\n    animate: { opacity: 1, y: 0, filter: \"blur(0px)\" },\n    exit: reduceMotion\n      ? { opacity: 0, transition: { duration: 0.12 } }\n      : { opacity: 0, y: -6, filter: \"blur(4px)\", transition: { duration: 0.12 } },\n    transition: { duration: 0.3, ease: [0.22, 1, 0.36, 1] as const },\n  }\n\n  return (\n    <div\n      className={cn(\n        \"dark relative isolate flex min-h-[44rem] w-full items-center justify-center overflow-hidden bg-[oklch(0.08_0.002_285)] px-6 py-20 text-white\",\n        className\n      )}\n    >\n      <Drapes />\n\n      <div className=\"w-full max-w-[21rem]\">\n        <AnimatePresence mode=\"wait\" initial={false}>\n          {status === \"done\" ? (\n            <motion.div key=\"sent\" className=\"flex flex-col items-center text-center\" {...swap}>\n              <Tile>\n                <Mail />\n              </Tile>\n              <h1 className=\"mt-6 text-[22px] font-medium tracking-[-0.02em]\">Check your email</h1>\n              <p className=\"mt-2 text-[13px] leading-relaxed text-white/50\">\n                We sent a sign-in link to\n                <br />\n                <span className=\"text-white/90\">{email.trim()}</span>\n              </p>\n              <div className=\"mt-8 grid w-full grid-cols-2 gap-2.5\">\n                <a href=\"https://mail.google.com\" target=\"_blank\" rel=\"noreferrer\" className={quiet}>\n                  Open Gmail\n                </a>\n                <a href=\"https://outlook.live.com\" target=\"_blank\" rel=\"noreferrer\" className={quiet}>\n                  Open Outlook\n                </a>\n              </div>\n              <AnimateIcon animateOnHover asChild>\n                <button\n                  type=\"button\"\n                  onClick={() => {\n                    setReturning(true)\n                    reset()\n                  }}\n                  className=\"mt-6 inline-flex cursor-pointer items-center gap-1.5 rounded text-[13px] text-white/50 transition-colors duration-150 outline-none hover:text-white focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white/40\"\n                >\n                  <ArrowLeft aria-hidden className=\"size-3.5\" />\n                  Use a different email\n                </button>\n              </AnimateIcon>\n            </motion.div>\n          ) : (\n            <motion.div key=\"form\" className=\"flex flex-col\" {...swap}>\n              <div className=\"flex flex-col items-center text-center\">\n                <Tile>\n                  <AfterglowMark />\n                </Tile>\n                <h1 className=\"mt-6 text-[22px] font-medium tracking-[-0.02em]\">Log in to Afterglow</h1>\n                <p className=\"mt-2 text-[13px] text-white/50\">\n                  Don&rsquo;t have an account?{\" \"}\n                  <a href=\"#\" className=\"text-white/90 transition-colors duration-150 hover:text-white\">\n                    Sign up\n                  </a>\n                </p>\n              </div>\n\n              <div className=\"mt-8 grid grid-cols-2 gap-2.5\">\n                <button type=\"button\" className={quiet} onClick={() => onProvider?.(\"google\")}>\n                  <GoogleMark mono />\n                  Google\n                </button>\n                <button type=\"button\" className={quiet} onClick={() => onProvider?.(\"github\")}>\n                  <GitHubMark />\n                  GitHub\n                </button>\n              </div>\n\n              <div className=\"my-6 flex items-center gap-3 text-xs text-white/35\">\n                <span className=\"h-px flex-1 bg-linear-to-r from-transparent to-white/12\" />\n                or\n                <span className=\"h-px flex-1 bg-linear-to-l from-transparent to-white/12\" />\n              </div>\n\n              <form noValidate onSubmit={handleSubmit} className=\"flex flex-col\">\n                <label htmlFor={`${id}-email`} className=\"text-[13px] text-white/60\">\n                  Email\n                </label>\n                <input\n                  id={`${id}-email`}\n                  type=\"email\"\n                  autoComplete=\"email\"\n                  spellCheck={false}\n                  autoFocus={returning}\n                  placeholder=\"you@company.com\"\n                  value={email}\n                  onChange={(event) => setEmail(event.target.value)}\n                  aria-invalid={problem ? true : undefined}\n                  aria-describedby={problem ? `${id}-error` : undefined}\n                  className=\"mt-2 h-10 rounded-[10px] border border-white/10 bg-black/50 px-3 text-sm text-white shadow-[inset_0_1px_2px_oklch(0_0_0/60%)] transition-[border-color,box-shadow] duration-150 outline-none placeholder:text-white/25 focus:border-white/25 focus:ring-4 focus:ring-white/[0.06] aria-invalid:border-[oklch(0.7_0.15_25/55%)]\"\n                />\n                <AnimatePresence initial={false}>\n                  {problem && (\n                    <motion.p\n                      id={`${id}-error`}\n                      className=\"text-xs text-[oklch(0.76_0.13_25)]\"\n                      initial={{ opacity: 0, height: 0, marginTop: 0 }}\n                      animate={{ opacity: 1, height: \"auto\", marginTop: 8 }}\n                      exit={{ opacity: 0, height: 0, marginTop: 0 }}\n                      transition={{ duration: 0.15 }}\n                    >\n                      {problem}\n                    </motion.p>\n                  )}\n                </AnimatePresence>\n                <MetalButton\n                  type=\"submit\"\n                  className=\"mt-4 w-full rounded-[10px] disabled:opacity-100\"\n                  disabled={status === \"loading\"}\n                >\n                  <SubmitLabel loading={status === \"loading\"}>Continue with email</SubmitLabel>\n                </MetalButton>\n              </form>\n\n              <p className=\"mt-8 text-center text-xs leading-relaxed text-white/35\">\n                By continuing, you agree to our{\" \"}\n                <a href=\"#\" className=\"underline decoration-white/20 underline-offset-2 hover:text-white/60\">\n                  Terms\n                </a>{\" \"}\n                and{\" \"}\n                <a href=\"#\" className=\"underline decoration-white/20 underline-offset-2 hover:text-white/60\">\n                  Privacy Policy\n                </a>\n                .\n              </p>\n            </motion.div>\n          )}\n        </AnimatePresence>\n      </div>\n    </div>\n  )\n}\n\n// a dark tile edged in moving chrome, for the logo and the inbox icon\nfunction Tile({ children }: { children: React.ReactNode }) {\n  return (\n    <span className=\"relative isolate grid size-12 place-items-center rounded-[14px] bg-[linear-gradient(oklch(0.22_0.004_285),oklch(0.11_0.004_285))] text-white/90 shadow-[0_10px_24px_-8px_oklch(0_0_0/90%),inset_0_1px_0_oklch(1_0_0/10%)] [&_svg]:size-6\">\n      <MetalRim className=\"-z-10\" />\n      {children}\n    </span>\n  )\n}\n\nfunction Drapes() {\n  return (\n    <div aria-hidden className=\"absolute inset-0 -z-10\">\n      {/* one sheet of satin metal, folded into long diagonals, showing only at two corners */}\n      <div className=\"absolute inset-0 mask-[linear-gradient(62deg,#000_2%,transparent_36%,transparent_64%,#000_98%)]\">\n        <LiquidMetal pattern=\"silk\" softness={0.6} brightness={-0.24} scale={0.8} tint={[1, 1, 1]} speed={0.5} quality={0.6} />\n      </div>\n      {/* a pool of black behind the column, so text always sits on dark */}\n      <div className=\"absolute inset-0 bg-[radial-gradient(30%_46%_at_50%_50%,oklch(0.08_0.002_285)_40%,transparent)]\" />\n      <div className=\"absolute inset-0 opacity-[0.07] mix-blend-overlay\" style={{ backgroundImage: GRAIN }} />\n    </div>\n  )\n}\n",
      "type": "registry:block",
      "target": "components/blocks/auth-silk.tsx"
    },
    {
      "path": "components/ui/metal-button.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { motion, useReducedMotion, type HTMLMotionProps } from \"motion/react\"\n\nimport { LiquidMetal, MetalRim } from \"@/components/ui/liquid-metal\"\nimport { cn } from \"@/lib/utils\"\n\nconst sizes = {\n  sm: \"h-9 gap-1.5 px-4 text-[13px] [&_svg]:size-3.5\",\n  md: \"h-10 gap-2 px-5 text-sm [&_svg]:size-4\",\n  lg: \"h-12 gap-2.5 px-6 text-[15px] [&_svg]:size-[18px]\",\n}\n\ntype MetalButtonProps = Omit<HTMLMotionProps<\"button\">, \"children\"> & {\n  /** rim is a dark button ringed in flowing chrome; silver is solid brushed metal */\n  variant?: \"rim\" | \"silver\"\n  size?: keyof typeof sizes\n  children?: React.ReactNode\n}\n\nfunction MetalButton({\n  variant = \"rim\",\n  size = \"md\",\n  className,\n  children,\n  type = \"button\",\n  ...props\n}: MetalButtonProps) {\n  const reduceMotion = useReducedMotion()\n  const silver = variant === \"silver\"\n\n  return (\n    <motion.button\n      data-slot=\"metal-button\"\n      data-variant={variant}\n      type={type}\n      className={cn(\n        \"relative isolate inline-flex shrink-0 cursor-pointer items-center justify-center rounded-full font-medium whitespace-nowrap outline-none select-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-60\",\n        \"shadow-[0_8px_24px_-12px_oklch(0_0_0/70%),0_1px_2px_oklch(0_0_0/40%)]\",\n        silver\n          ? \"text-[oklch(0.2_0.004_285)] [text-shadow:0_1px_0_oklch(1_0_0/45%)]\"\n          : \"bg-[linear-gradient(oklch(0.21_0.004_285),oklch(0.13_0.004_285))] text-white\",\n        sizes[size],\n        className\n      )}\n      whileTap={{ scale: reduceMotion ? 1 : 0.97 }}\n      transition={{ type: \"spring\", duration: 0.22, bounce: 0 }}\n      {...props}\n    >\n      {silver ? (\n        <LiquidMetal className=\"-z-10\" softness={1} brightness={0.8} scale={0.4} tint={[1, 0.92, 0.84]} />\n      ) : (\n        <MetalRim className=\"-z-10\" width={2} />\n      )}\n      {/* a bevel: light along the top edge, shade along the bottom */}\n      <span\n        aria-hidden\n        className={cn(\n          \"pointer-events-none absolute rounded-[inherit]\",\n          silver\n            ? \"inset-0 shadow-[inset_0_1px_0_oklch(1_0_0/60%),inset_0_-1px_0_oklch(0_0_0/20%)]\"\n            : \"inset-[2px] shadow-[inset_0_1px_0_oklch(1_0_0/12%)]\"\n        )}\n      />\n      <span className=\"relative inline-flex items-center gap-[inherit]\">{children}</span>\n    </motion.button>\n  )\n}\n\nexport { MetalButton, type MetalButtonProps }\n",
      "type": "registry:ui"
    },
    {
      "path": "components/ui/liquid-metal.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { useReducedMotion } from \"motion/react\"\n\nimport { ringMask } from \"@/lib/afterglow\"\nimport { cn } from \"@/lib/utils\"\n\n/*\n * Liquid metal: a slowly flowing metal surface, drawn by a small WebGL shader.\n * The surface is sine waves bent by other sine waves; each pixel reflects a\n * photo-studio backdrop (dark floor, bright horizon), which reads as metal.\n * Softness blurs that horizon, turning mirror chrome into brushed satin.\n *\n * Every piece on the page shares one WebGL context: it draws each piece in\n * turn and copies the frame into that piece's own canvas. Browsers cap live\n * contexts at about 16, so this keeps any number of pieces running.\n */\n\nconst VERTEX = `\nattribute vec2 position;\nvarying vec2 vUv;\nvoid main() {\n  vUv = position * 0.5 + 0.5;\n  gl_Position = vec4(position, 0.0, 1.0);\n}`\n\nconst FRAGMENT = `\nprecision highp float;\nvarying vec2 vUv;\nuniform vec2 uResolution;\nuniform float uTime;\nuniform vec3 uTint;\nuniform float uBrightness;\nuniform float uScale;\nuniform float uSoftness;\nuniform float uSilk;\n\n// round ripples, like a pool of mercury\nfloat liquid(vec2 p, float t) {\n  vec2 q = p;\n  q += 0.55 * vec2(sin(q.y * 1.3 + t * 1.1), sin(q.x * 1.1 - t * 0.9));\n  q += 0.28 * vec2(sin(q.y * 2.3 - t * 0.7), sin(q.x * 2.1 + t * 1.3));\n  return 0.5 * sin(q.x * 1.4 + t * 0.4) + 0.5 * sin(q.y * 1.7 - t * 0.3);\n}\n\n// long diagonal folds, like draped silk\nfloat silk(vec2 p, float t) {\n  vec2 d = normalize(vec2(1.0, 0.55));\n  float u = dot(p, d);\n  float v = dot(p, vec2(-d.y, d.x));\n  float w = u + 0.45 * sin(v * 0.9 + t * 0.8) + 0.2 * sin(v * 2.1 - t * 0.6);\n  return 0.65 * sin(w * 1.7 + t * 0.35) + 0.35 * sin(w * 3.1 - v * 0.4 - t * 0.25);\n}\n\nfloat height(vec2 p, float t) {\n  return mix(liquid(p, t), silk(p, t), uSilk);\n}\n\nfloat studio(float y, float soft) {\n  float edge = mix(0.03, 0.5, soft);\n  float ground = 0.05 + 0.12 * smoothstep(-1.2, -0.15, y);\n  float sky = 0.5 + 0.42 * smoothstep(0.05, 1.0, y);\n  float v = mix(ground, sky, smoothstep(-edge, edge, y));\n  v += mix(0.75, 0.28, soft) * exp(-pow((y - 0.03) * mix(26.0, 3.0, soft), 2.0));\n  v += 0.2 * exp(-pow((y - 0.6) * 8.0, 2.0));\n  return v;\n}\n\nvoid main() {\n  vec2 p = (vUv - 0.5) * vec2(uResolution.x / uResolution.y, 1.0) * 2.2 * uScale;\n  float t = uTime * 0.25;\n  float e = 0.01;\n  float h = height(p, t);\n  float dx = (height(p + vec2(e, 0.0), t) - h) / e;\n  float dy = (height(p + vec2(0.0, e), t) - h) / e;\n  float k = mix(0.8, 0.32, uSoftness);\n  vec3 n = normalize(vec3(-dx * k, -dy * k, 1.0));\n  vec3 r = reflect(vec3(0.0, 0.0, -1.0), n);\n  float y = r.y * 1.1 + p.y * 0.12 + 0.12 + uBrightness;\n  float v = studio(y, uSoftness) + mix(0.3, 0.12, uSoftness) * pow(max(r.x, 0.0), 5.0);\n  vec3 color = vec3(v);\n  color = mix(color, color * uTint, 0.4 * smoothstep(0.35, 1.0, v));\n  gl_FragColor = vec4(color, 1.0);\n}`\n\n// shown before the first frame, and wherever WebGL isn't available\nconst CHROME_FALLBACK =\n  \"conic-gradient(from 200deg at 35% 45%, #18181b, #e9e2da 14%, #2a2a2e 27%, #a29c95 41%, #141416 55%, #f3ece4 69%, #38383c 83%, #18181b)\"\nconst SATIN_FALLBACK =\n  \"linear-gradient(155deg, #2a2a2e, #8d8984 40%, #d6d1cb 52%, #5a5a5e 75%, #1c1c1f)\"\n\ntype Settings = {\n  speed: number\n  tint: [number, number, number]\n  brightness: number\n  scale: number\n  softness: number\n  silk: number\n  maxAspect: number\n  still: boolean\n}\n\ntype Piece = {\n  canvas: HTMLCanvasElement\n  context: CanvasRenderingContext2D\n  settings: Settings\n  start: number\n  visible: boolean\n  painted: boolean\n}\n\ntype Renderer = {\n  canvas: HTMLCanvasElement\n  gl: WebGLRenderingContext\n  uniforms: Record<string, WebGLUniformLocation | null>\n}\n\nconst pieces = new Set<Piece>()\nlet renderer: Renderer | null = null\nlet unavailable = false\nlet frame = 0\n\nfunction createRenderer(): Renderer | null {\n  const canvas = document.createElement(\"canvas\")\n  const gl = canvas.getContext(\"webgl\", { antialias: false, alpha: false })\n  if (!gl) return null\n  const compile = (type: number, source: string) => {\n    const shader = gl.createShader(type)!\n    gl.shaderSource(shader, source)\n    gl.compileShader(shader)\n    return shader\n  }\n  const program = gl.createProgram()!\n  gl.attachShader(program, compile(gl.VERTEX_SHADER, VERTEX))\n  gl.attachShader(program, compile(gl.FRAGMENT_SHADER, FRAGMENT))\n  gl.linkProgram(program)\n  if (!gl.getProgramParameter(program, gl.LINK_STATUS)) return null\n  gl.useProgram(program)\n  // one triangle that covers the whole viewport\n  gl.bindBuffer(gl.ARRAY_BUFFER, gl.createBuffer())\n  gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 3, -1, -1, 3]), gl.STATIC_DRAW)\n  const position = gl.getAttribLocation(program, \"position\")\n  gl.enableVertexAttribArray(position)\n  gl.vertexAttribPointer(position, 2, gl.FLOAT, false, 0, 0)\n  const names = [\"uResolution\", \"uTime\", \"uTint\", \"uBrightness\", \"uScale\", \"uSoftness\", \"uSilk\"]\n  const uniforms = Object.fromEntries(names.map((name) => [name, gl.getUniformLocation(program, name)]))\n\n  canvas.addEventListener(\"webglcontextlost\", (event) => {\n    event.preventDefault()\n    cancelAnimationFrame(frame)\n    frame = 0\n    renderer = null\n    for (const piece of pieces) {\n      piece.painted = false\n      piece.canvas.style.opacity = \"0\"\n    }\n    // build a fresh context once the browser has recovered\n    window.setTimeout(wake, 1000)\n  })\n  return { canvas, gl, uniforms }\n}\n\nfunction paint(piece: Piece, now: number) {\n  const { canvas, gl, uniforms } = renderer!\n  const { width, height } = piece.canvas\n  // the shared canvas only grows, and each piece draws into its bottom-left corner\n  if (canvas.width < width || canvas.height < height) {\n    canvas.width = Math.max(canvas.width, width)\n    canvas.height = Math.max(canvas.height, height)\n  }\n  const s = piece.settings\n  gl.viewport(0, 0, width, height)\n  gl.uniform2f(uniforms.uResolution, width, height)\n  // under reduced motion, hold one pleasing frame\n  gl.uniform1f(uniforms.uTime, s.still ? 3 : ((now - piece.start) / 1000) * s.speed + 3)\n  gl.uniform3f(uniforms.uTint, ...s.tint)\n  gl.uniform1f(uniforms.uBrightness, s.brightness)\n  // past maxAspect, ripples stretch across wide shapes instead of repeating\n  const aspect = width / height\n  gl.uniform1f(uniforms.uScale, s.maxAspect && aspect > s.maxAspect ? (s.scale * s.maxAspect) / aspect : s.scale)\n  gl.uniform1f(uniforms.uSoftness, s.softness)\n  gl.uniform1f(uniforms.uSilk, s.silk)\n  gl.drawArrays(gl.TRIANGLES, 0, 3)\n  piece.context.drawImage(canvas, 0, canvas.height - height, width, height, 0, 0, width, height)\n  piece.painted = true\n  piece.canvas.style.opacity = \"1\"\n}\n\nfunction tick(now: number) {\n  frame = 0\n  if (!renderer) return\n  let moving = false\n  for (const piece of pieces) {\n    if (!piece.visible || piece.canvas.width < 2) continue\n    if (piece.settings.still && piece.painted) continue\n    paint(piece, now)\n    if (!piece.settings.still) moving = true\n  }\n  if (moving) frame = requestAnimationFrame(tick)\n}\n\nfunction wake() {\n  if (frame || unavailable) return\n  if (!renderer) {\n    renderer = createRenderer()\n    if (!renderer) {\n      unavailable = true\n      return\n    }\n  }\n  frame = requestAnimationFrame(tick)\n}\n\ntype LiquidMetalProps = React.ComponentProps<\"div\"> & {\n  /** 1 is a slow drift */\n  speed?: number\n  /** warms or cools the highlights, as r, g, b from 0 to 1 */\n  tint?: [number, number, number]\n  /** 0.5 renders at half resolution, plenty for thin rims */\n  quality?: number\n  /** shifts the reflection toward the bright sky; 0.8 is mostly silver */\n  brightness?: number\n  /** below 1 makes the ripples broader, good for small or wide shapes */\n  scale?: number\n  /** 0 is mirror chrome, 1 is soft brushed satin */\n  softness?: number\n  /** \"silk\" lays the ripples out as long diagonal folds */\n  pattern?: \"liquid\" | \"silk\"\n  /** wider than this width-to-height ratio, ripples stretch instead of repeating */\n  maxAspect?: number\n}\n\nfunction LiquidMetal({\n  speed = 1,\n  tint = [1, 0.82, 0.66],\n  quality = 1,\n  brightness = 0,\n  scale = 1,\n  softness = 0,\n  pattern = \"liquid\",\n  maxAspect = 0,\n  className,\n  style,\n  ...props\n}: LiquidMetalProps) {\n  const reduceMotion = useReducedMotion()\n  const rootRef = React.useRef<HTMLDivElement>(null)\n  const [r, g, b] = tint\n\n  React.useEffect(() => {\n    const root = rootRef.current\n    if (!root) return\n    const canvas = document.createElement(\"canvas\")\n    canvas.className = \"absolute inset-0 size-full opacity-0 transition-opacity duration-300\"\n    const context = canvas.getContext(\"2d\", { alpha: false })\n    if (!context) return\n    root.appendChild(canvas)\n\n    const piece: Piece = {\n      canvas,\n      context,\n      settings: {\n        speed,\n        tint: [r, g, b],\n        brightness,\n        scale,\n        softness,\n        silk: pattern === \"silk\" ? 1 : 0,\n        maxAspect,\n        still: !!reduceMotion,\n      },\n      start: performance.now(),\n      visible: false,\n      painted: false,\n    }\n    pieces.add(piece)\n\n    const visibility = new IntersectionObserver(([entry]) => {\n      piece.visible = entry.isIntersecting\n      if (piece.visible) wake()\n    })\n    visibility.observe(canvas)\n\n    const sizing = new ResizeObserver(() => {\n      const ratio = Math.min(window.devicePixelRatio || 1, 2) * quality\n      canvas.width = Math.max(1, Math.round(canvas.clientWidth * ratio))\n      canvas.height = Math.max(1, Math.round(canvas.clientHeight * ratio))\n      // resizing clears the canvas, so paint again\n      piece.painted = false\n      wake()\n    })\n    sizing.observe(canvas)\n\n    return () => {\n      visibility.disconnect()\n      sizing.disconnect()\n      pieces.delete(piece)\n      canvas.remove()\n    }\n  }, [b, brightness, g, maxAspect, pattern, quality, r, reduceMotion, scale, softness, speed])\n\n  return (\n    <div\n      ref={rootRef}\n      data-slot=\"liquid-metal\"\n      aria-hidden\n      className={cn(\"pointer-events-none absolute inset-0 overflow-hidden rounded-[inherit]\", className)}\n      style={{ background: softness >= 0.5 ? SATIN_FALLBACK : CHROME_FALLBACK, ...style }}\n      {...props}\n    />\n  )\n}\n\ntype MetalRimProps = Omit<React.ComponentProps<\"span\">, \"children\"> & {\n  /** thickness of the ring in px */\n  width?: number\n  brightness?: number\n  quality?: number\n}\n\n/*\n * A hairline of chrome around its parent (give the parent a radius and\n * position). A steady edge, lit from above, sits under the moving metal; the\n * metal is screen-blended on top, so its dark patches never break the ring.\n */\nfunction MetalRim({ width = 1, brightness = 0.35, quality = 0.6, className, style, ...props }: MetalRimProps) {\n  return (\n    <span\n      aria-hidden\n      data-slot=\"metal-rim\"\n      className={cn(\"pointer-events-none absolute inset-0 rounded-[inherit]\", className)}\n      style={{ ...ringMask, padding: width, ...style }}\n      {...props}\n    >\n      <span className=\"absolute inset-0 rounded-[inherit] bg-[linear-gradient(180deg,oklch(0.78_0.01_80),oklch(0.36_0.004_285)_40%,oklch(0.3_0.004_285)_70%,oklch(0.55_0.006_80))]\" />\n      <LiquidMetal className=\"mix-blend-screen\" quality={quality} brightness={brightness} maxAspect={3.2} />\n    </span>\n  )\n}\n\nexport { LiquidMetal, MetalRim, type LiquidMetalProps, type MetalRimProps }\n",
      "type": "registry:ui"
    },
    {
      "path": "components/ui/auth-parts.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Eye, EyeOff, KeyRound } from \"lucide-react\"\nimport { AnimateIcon } from \"@/components/animate-ui/icons/icon\"\nimport { Fingerprint } from \"@/components/animate-ui/icons/fingerprint\"\nimport { LoaderCircle as Loader2 } from \"@/components/animate-ui/icons/loader-circle\"\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\n/* Shared pieces for the auth blocks: brand marks, provider buttons, fields,\n   a divider and a small hook that runs a submit with loading and error states. */\n\nfunction GoogleMark({ mono = false, ...props }: React.ComponentProps<\"svg\"> & { mono?: boolean }) {\n  // mono draws the G in the current text color, for quiet monochrome buttons\n  const fill = (color: string) => (mono ? \"currentColor\" : color)\n  return (\n    <svg viewBox=\"0 0 24 24\" aria-hidden {...props}>\n      <path fill={fill(\"#4285F4\")} d=\"M23.5 12.27c0-.85-.08-1.67-.22-2.45H12v4.64h6.45a5.52 5.52 0 0 1-2.4 3.62v3h3.88c2.27-2.09 3.57-5.17 3.57-8.81Z\" />\n      <path fill={fill(\"#34A853\")} d=\"M12 24c3.24 0 5.96-1.07 7.94-2.92l-3.88-3c-1.07.72-2.45 1.15-4.06 1.15-3.12 0-5.77-2.11-6.71-4.95H1.28v3.1A12 12 0 0 0 12 24Z\" />\n      <path fill={fill(\"#FBBC05\")} d=\"M5.29 14.28a7.2 7.2 0 0 1 0-4.56v-3.1H1.28a12 12 0 0 0 0 10.76l4.01-3.1Z\" />\n      <path fill={fill(\"#EA4335\")} d=\"M12 4.77c1.76 0 3.34.61 4.59 1.8l3.44-3.44A11.97 11.97 0 0 0 12 0 12 12 0 0 0 1.28 6.62l4.01 3.1C6.23 6.88 8.88 4.77 12 4.77Z\" />\n    </svg>\n  )\n}\n\n// the afterglow mark: a sun setting on the horizon, centered in its 24px box\nfunction AfterglowMark(props: React.ComponentProps<\"svg\">) {\n  return (\n    <svg viewBox=\"0 0 24 24\" aria-hidden {...props}>\n      <path d=\"M5.5 11a6.5 6.5 0 0 1 13 0Z\" fill=\"currentColor\" />\n      <path d=\"M3 14h18M7 18h10\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" />\n    </svg>\n  )\n}\n\nfunction GitHubMark(props: React.ComponentProps<\"svg\">) {\n  return (\n    <svg viewBox=\"0 0 16 16\" aria-hidden fill=\"currentColor\" {...props}>\n      <path d=\"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8Z\" />\n    </svg>\n  )\n}\n\nconst providers = {\n  google: { label: \"Google\", icon: <GoogleMark /> },\n  github: { label: \"GitHub\", icon: <GitHubMark /> },\n  sso: { label: \"SSO\", icon: <KeyRound /> },\n  passkey: { label: \"passkey\", icon: <Fingerprint aria-hidden /> },\n}\n\ntype Provider = keyof typeof providers\n\ntype ProviderButtonProps = Omit<React.ComponentProps<\"button\">, \"children\"> & {\n  provider: Provider\n  /** \"Continue with\", \"Log in with\"… */\n  verb?: string\n  /** a small \"Last used\" badge in the corner */\n  lastUsed?: boolean\n}\n\nfunction ProviderButton({\n  provider,\n  verb = \"Continue with\",\n  lastUsed,\n  className,\n  type = \"button\",\n  ...props\n}: ProviderButtonProps) {\n  const { label, icon } = providers[provider]\n  return (\n    <AnimateIcon animateOnHover asChild>\n      <button\n        type={type}\n        className={cn(\n          \"relative inline-flex h-10 w-full cursor-pointer items-center justify-center gap-2.5 rounded-lg border bg-background/60 px-4 text-sm font-medium transition-[background-color,scale] duration-150 ease-out motion-reduce:transition-none outline-none hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring motion-safe:enabled:active:scale-[0.98] disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0\",\n          className\n        )}\n        {...props}\n      >\n        {icon}\n        <span>{verb ? `${verb} ${label}` : label}</span>\n        {lastUsed && (\n          <span className=\"absolute -top-2 right-2 rounded-full border bg-card px-1.5 py-px text-[10px] font-medium text-muted-foreground\">\n            Last used\n          </span>\n        )}\n      </button>\n    </AnimateIcon>\n  )\n}\n\nfunction Divider({ children = \"or\", className }: { children?: React.ReactNode; className?: string }) {\n  return (\n    <div className={cn(\"flex items-center gap-3 text-xs text-muted-foreground\", className)}>\n      <span className=\"h-px flex-1 bg-border\" />\n      {children}\n      <span className=\"h-px flex-1 bg-border\" />\n    </div>\n  )\n}\n\ntype FieldProps = Omit<React.ComponentProps<\"input\">, \"size\"> & {\n  label: string\n  /** shown under the field and announced by screen readers */\n  error?: string\n  /** a link or action placed at the end of the label row, e.g. \"Forgot?\" */\n  aside?: React.ReactNode\n  /** classes for the input's box, so each theme can style it */\n  boxClassName?: string\n  labelClassName?: string\n}\n\nfunction Field({\n  label,\n  error,\n  aside,\n  type = \"text\",\n  className,\n  boxClassName,\n  labelClassName,\n  id,\n  ...props\n}: FieldProps) {\n  const autoId = React.useId()\n  const inputId = id ?? autoId\n  const errorId = `${inputId}-error`\n  const [reveal, setReveal] = React.useState(false)\n  const password = type === \"password\"\n\n  return (\n    <div className={cn(\"flex flex-col gap-1.5\", className)}>\n      <div className=\"flex items-center justify-between\">\n        <label htmlFor={inputId} className={cn(\"text-sm font-medium\", labelClassName)}>\n          {label}\n        </label>\n        {aside}\n      </div>\n      <div\n        className={cn(\n          \"flex h-10 items-center rounded-lg border bg-background/60 px-3 transition-[border-color,box-shadow] duration-150 focus-within:border-foreground/40 focus-within:ring-3 focus-within:ring-foreground/10\",\n          error && \"border-glow-2/70 focus-within:border-glow-2 focus-within:ring-glow-2/15\",\n          boxClassName\n        )}\n      >\n        <input\n          id={inputId}\n          type={password && reveal ? \"text\" : type}\n          aria-invalid={error ? true : undefined}\n          aria-describedby={error ? errorId : undefined}\n          className=\"h-full min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground/70\"\n          {...props}\n        />\n        {password && (\n          <button\n            type=\"button\"\n            aria-label={reveal ? \"Hide password\" : \"Show password\"}\n            aria-pressed={reveal}\n            onClick={() => setReveal((v) => !v)}\n            className=\"-mr-1 grid size-7 cursor-pointer place-items-center rounded-md text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/60 [&_svg]:size-4\"\n          >\n            {reveal ? <EyeOff /> : <Eye />}\n          </button>\n        )}\n      </div>\n      <AnimatePresence initial={false}>\n        {error && (\n          <motion.p\n            id={errorId}\n            className=\"text-xs text-glow-2\"\n            initial={{ opacity: 0, height: 0 }}\n            animate={{ opacity: 1, height: \"auto\" }}\n            exit={{ opacity: 0, height: 0 }}\n            transition={{ duration: 0.15 }}\n          >\n            {error}\n          </motion.p>\n        )}\n      </AnimatePresence>\n    </div>\n  )\n}\n\ntype Status = \"idle\" | \"loading\" | \"done\"\n\n/**\n * Runs an async submit with loading and error states. The block calls\n * `run(values)`; your `onSubmit` does the real work and throws to show an error.\n */\nfunction useSubmit<T>(onSubmit?: (values: T) => Promise<void> | void) {\n  const [status, setStatus] = React.useState<Status>(\"idle\")\n  const [error, setError] = React.useState<string>()\n\n  async function run(values: T) {\n    setError(undefined)\n    setStatus(\"loading\")\n    try {\n      await onSubmit?.(values)\n      setStatus(\"done\")\n    } catch (reason) {\n      setError(reason instanceof Error ? reason.message : \"Something went wrong. Try again.\")\n      setStatus(\"idle\")\n    }\n  }\n\n  return { status, error, setError, run, reset: () => setStatus(\"idle\") }\n}\n\n// a label that swaps to a spinner while the form is busy\nfunction SubmitLabel({ loading, children }: { loading: boolean; children: React.ReactNode }) {\n  const reduceMotion = useReducedMotion()\n  return (\n    <span className=\"grid place-items-center\">\n      <AnimatePresence initial={false} mode=\"popLayout\">\n        <motion.span\n          key={loading ? \"loading\" : \"label\"}\n          className=\"col-start-1 row-start-1 inline-flex items-center gap-2\"\n          initial={reduceMotion ? { opacity: 0 } : { opacity: 0, scale: 0.25, filter: \"blur(4px)\" }}\n          animate={{ opacity: 1, scale: 1, filter: \"blur(0px)\" }}\n          exit={reduceMotion ? { opacity: 0 } : { opacity: 0, scale: 0.25, filter: \"blur(4px)\" }}\n          transition={{ type: \"spring\", duration: 0.3, bounce: 0 }}\n        >\n          {loading ? <Loader2 className=\"size-4 animate-spin\" aria-label=\"Loading\" /> : children}\n        </motion.span>\n      </AnimatePresence>\n    </span>\n  )\n}\n\nconst EMAIL = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/\n\nfunction checkEmail(value: string) {\n  if (!value.trim()) return \"Enter your email address.\"\n  if (!EMAIL.test(value.trim())) return \"That doesn't look like an email address.\"\n  return undefined\n}\n\nexport {\n  AfterglowMark,\n  Divider,\n  Field,\n  GitHubMark,\n  GoogleMark,\n  ProviderButton,\n  SubmitLabel,\n  checkEmail,\n  useSubmit,\n  type FieldProps,\n  type Provider,\n  type ProviderButtonProps,\n}\n",
      "type": "registry:ui"
    },
    {
      "path": "lib/afterglow.ts",
      "content": "import type { CSSProperties } from \"react\"\nimport type { TargetAndTransition, Transition } from \"motion/react\"\n\n// shared spring presets, every component picks from these\nexport const springs = {\n  snappy: { stiffness: 520, damping: 34, mass: 0.6 },\n  soft: { stiffness: 260, damping: 26, mass: 0.8 },\n  glide: { stiffness: 120, damping: 20, mass: 1 },\n} as const\n\nexport type SpringName = keyof typeof springs\n\nexport function spring(name: SpringName): Transition {\n  return { type: \"spring\", ...springs[name] }\n}\n\n// how a glow fades once its source moves away: slow, with a long tail\nexport const afterglow = {\n  linger: 0.9,\n  ease: [0.22, 1, 0.36, 1],\n} as const satisfies { linger: number; ease: Transition[\"ease\"] }\n\n// paints only the padding ring of an element, used for glowing borders\nexport const ringMask: CSSProperties = {\n  WebkitMask:\n    \"linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)\",\n  WebkitMaskComposite: \"xor\",\n  mask: \"linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)\",\n  maskComposite: \"exclude\",\n}\n\n// small icon gestures, played when a control is pressed or selected\nexport const iconGestures = {\n  pop: { scale: [1, 1.2, 1] },\n  ring: { rotate: [0, -18, 14, -9, 4, 0], scale: [1, 1.12, 1] },\n  // a gear looks the same after half a turn, so it can rest there and snap back unseen\n  turn: { rotate: [0, 180], scale: [1, 1.12, 1] },\n  hop: { y: [0, -3, 0], scale: [1, 1.1, 1] },\n  nudge: { x: [0, 2.5, 0], scale: [1, 1.1, 1] },\n} satisfies Record<string, TargetAndTransition>\n\nexport type IconGesture = keyof typeof iconGestures\n\n// leaving a gesture is instant: every gesture already ends at, or looks like, its resting pose\nexport const iconRest: TargetAndTransition = { scale: 1, rotate: 0, x: 0, y: 0, transition: { duration: 0 } }\n",
      "type": "registry:lib"
    }
  ],
  "cssVars": {
    "theme": {
      "color-glow": "var(--glow)",
      "color-glow-foreground": "var(--glow-foreground)",
      "color-glow-2": "var(--glow-2)",
      "color-glow-3": "var(--glow-3)",
      "color-glass": "var(--glass)",
      "color-gloss-highlight": "var(--gloss-highlight)",
      "shadow-gloss": "inset 0 1px 0 0 var(--gloss-highlight), inset 0 -1px 0 0 var(--gloss-shade), 0 0 0 1px var(--gloss-edge), 0 1px 2px 0 var(--gloss-depth), 0 4px 12px -4px var(--gloss-depth)",
      "shadow-glass": "inset 0 1px 0 0 var(--gloss-highlight), inset 0 -10px 24px -18px var(--gloss-shade), inset 0 0 0 1px var(--gloss-edge), 0 2px 6px -1px var(--gloss-depth), 0 18px 40px -12px var(--gloss-depth)",
      "shadow-well": "inset 0 1px 3px 0 var(--gloss-depth), inset 0 0 0 1px var(--gloss-edge), 0 1px 0 0 var(--gloss-highlight)"
    },
    "light": {
      "glow": "oklch(0.7 0.19 45)",
      "glow-foreground": "oklch(0.22 0.05 40)",
      "glow-2": "oklch(0.64 0.22 12)",
      "glow-3": "oklch(0.56 0.21 300)",
      "glass": "oklch(1 0 0 / 55%)",
      "gloss-highlight": "oklch(1 0 0 / 95%)",
      "gloss-shade": "oklch(0.3 0.03 285 / 10%)",
      "gloss-depth": "oklch(0.32 0.03 285 / 20%)",
      "gloss-edge": "oklch(0.22 0.02 285 / 10%)",
      "liquid-tint": "oklch(1 0 0 / 18%)",
      "liquid-fallback": "oklch(1 0 0 / 55%)",
      "liquid-rim": "oklch(1 0 0 / 95%)",
      "liquid-edge": "oklch(0.2 0.02 285 / 10%)",
      "liquid-shadow": "oklch(0.22 0.02 285 / 26%)",
      "liquid-glow": "oklch(1 0 0 / 55%)",
      "liquid-shade": "oklch(0.25 0.03 285 / 14%)"
    },
    "dark": {
      "glow": "oklch(0.8 0.16 55)",
      "glow-foreground": "oklch(0.22 0.05 40)",
      "glow-2": "oklch(0.7 0.2 15)",
      "glow-3": "oklch(0.65 0.2 300)",
      "glass": "oklch(0.19 0 0 / 55%)",
      "gloss-highlight": "oklch(1 0 0 / 16%)",
      "gloss-shade": "oklch(0 0 0 / 30%)",
      "gloss-depth": "oklch(0.04 0 0 / 60%)",
      "gloss-edge": "oklch(1 0 0 / 9%)",
      "liquid-tint": "oklch(0.2 0 0 / 22%)",
      "liquid-fallback": "oklch(0.2 0 0 / 45%)",
      "liquid-rim": "oklch(1 0 0 / 60%)",
      "liquid-edge": "oklch(1 0 0 / 10%)",
      "liquid-shadow": "oklch(0 0 0 / 50%)",
      "liquid-glow": "oklch(1 0 0 / 24%)",
      "liquid-shade": "oklch(0 0 0 / 28%)"
    }
  },
  "type": "registry:block"
}