{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"gloss-pill","type":"registry:ui","title":"Gloss Pill","description":"A glossy glass pill with a specular hotspot and rim light that glide after the pointer.","dependencies":[],"registryDependencies":[],"files":[{"path":"registry/ui/gloss-pill.tsx","type":"registry:ui","content":"\"use client\";\n\nimport type { ButtonHTMLAttributes, PointerEvent } from \"react\";\n\nexport interface GlossPillProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n  /** Color of the specular highlight and edge light. */\n  tint?: string;\n}\n\n// Registered properties so the highlight glides instead of jumping.\nconst css = `\n@property --specular-x{syntax:\"<length-percentage>\";inherits:true;initial-value:50%}\n@property --specular-y{syntax:\"<length-percentage>\";inherits:true;initial-value:0%}\n.gloss-pill{transition:--specular-x .18s ease-out,--specular-y .18s ease-out,scale .2s,background-color .3s}\n@media (prefers-reduced-motion:reduce){.gloss-pill{transition:none}}`;\n\nexport function GlossPill({\n  tint = \"#ffffff\",\n  className,\n  children,\n  onPointerMove,\n  onPointerLeave,\n  ...props\n}: GlossPillProps) {\n  const track = (e: PointerEvent<HTMLButtonElement>) => {\n    const r = e.currentTarget.getBoundingClientRect();\n    e.currentTarget.style.setProperty(\"--specular-x\", `${e.clientX - r.left}px`);\n    e.currentTarget.style.setProperty(\"--specular-y\", `${e.clientY - r.top}px`);\n    onPointerMove?.(e);\n  };\n  const reset = (e: PointerEvent<HTMLButtonElement>) => {\n    e.currentTarget.style.removeProperty(\"--specular-x\");\n    e.currentTarget.style.removeProperty(\"--specular-y\");\n    onPointerLeave?.(e);\n  };\n  const mix = (pct: number) => `color-mix(in srgb, ${tint} ${pct}%, transparent)`;\n\n  return (\n    <button\n      type=\"button\"\n      {...props}\n      onPointerMove={track}\n      onPointerLeave={reset}\n      className={`gloss-pill group relative isolate inline-flex h-12 items-center justify-center gap-2 overflow-hidden rounded-full bg-foreground/[.06] px-8 text-sm font-medium text-foreground shadow-[inset_0_1px_0_rgb(255_255_255/.22),inset_0_-1px_0_rgb(0_0_0/.12),0_12px_32px_-12px_rgb(0_0_0/.55)] backdrop-blur-xl backdrop-saturate-150 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring enabled:hover:bg-foreground/[.1] enabled:active:scale-[0.97] disabled:cursor-not-allowed disabled:opacity-50 ${className ?? \"\"}`}\n    >\n      <style href=\"gloss-pill\" precedence=\"default\">\n        {css}\n      </style>\n      {/* Glossy cap on the top half. */}\n      <span aria-hidden className=\"absolute inset-x-3 top-px -z-10 h-1/2 rounded-t-full bg-gradient-to-b from-white/25 to-white/0\" />\n      {/* Specular hotspot under the pointer. */}\n      <span\n        aria-hidden\n        className=\"absolute inset-0 -z-10 opacity-40 transition-opacity duration-300 group-enabled:group-hover:opacity-100 group-enabled:group-active:opacity-100\"\n        style={{\n          background: `radial-gradient(70px 42px at var(--specular-x) var(--specular-y), ${mix(55)}, ${mix(12)} 55%, transparent 80%)`,\n        }}\n      />\n      {/* Edge light: a pointer-centered glow masked down to a 1px rim. */}\n      <span\n        aria-hidden\n        className=\"absolute inset-0 rounded-[inherit] p-px opacity-60 transition-opacity duration-300 group-enabled:group-hover:opacity-100\"\n        style={{\n          background: `radial-gradient(110px circle at var(--specular-x) var(--specular-y), ${tint}, ${mix(18)} 70%)`,\n          mask: \"linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0)\",\n        }}\n      />\n      {children}\n    </button>\n  );\n}\n"}]}