{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "shimmer-button",
  "title": "Shimmer Button",
  "description": "A pill CTA whose surface catches a sweeping band of light.",
  "dependencies": [
    "radix-ui"
  ],
  "registryDependencies": [
    "utils",
    "https://ui.cuelark.com/r/theme.json",
    "https://ui.cuelark.com/r/motion.json"
  ],
  "files": [
    {
      "path": "src/registry/cuelark/ui/shimmer-button.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Slot } from \"radix-ui\";\n\nimport { cuePing, gsap, motionScale, useGSAP } from \"@/lib/motion\";\nimport { cn } from \"@/lib/utils\";\n\ntype ShimmerButtonProps = React.ComponentProps<\"button\"> & {\n  asChild?: boolean;\n  /** Seconds between sweeps. */\n  interval?: number;\n};\n\n/**\n * A call-to-action whose surface catches the light: a soft band sweeps across it on a loop (GSAP timeline),\n * pausing while hovered so the button feels alive but never restless. Ink on paper, signal on press.\n */\nfunction ShimmerButton({ className, asChild, interval = 2.6, children, onPointerDown, ...props }: ShimmerButtonProps) {\n  const ref = React.useRef<HTMLButtonElement>(null);\n  const tl = React.useRef<gsap.core.Timeline | null>(null);\n\n  useGSAP(\n    () => {\n      const el = ref.current;\n      const band = el?.querySelector('[data-slot=\"shimmer-band\"]');\n      if (!el || !band || !motionScale(el)) return;\n      tl.current = gsap\n        .timeline({ repeat: -1, repeatDelay: interval })\n        .fromTo(band, { xPercent: -120 }, { xPercent: 220, duration: 1.1, ease: \"power2.inOut\" });\n    },\n    { scope: ref, dependencies: [interval] },\n  );\n\n  const Comp = asChild ? Slot.Root : \"button\";\n  return (\n    <Comp\n      ref={ref}\n      data-slot=\"shimmer-button\"\n      className={cn(\n        \"group/shimmer relative isolate inline-flex h-ctl-lg items-center justify-center gap-2 overflow-hidden rounded-full bg-primary px-5 text-sm font-medium text-primary-foreground shadow-[inset_0_1px_0_var(--cl-highlight),0_0_0_1px_color-mix(in_oklch,var(--primary),var(--foreground)_15%),0_8px_24px_-8px_color-mix(in_oklch,var(--primary),transparent_40%)] outline-none transition-[scale,box-shadow] duration-200 ease-cue focus-visible:ring-3 focus-visible:ring-ring/50 active:scale-[0.97] disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4\",\n        className,\n      )}\n      onPointerEnter={() => tl.current?.pause()}\n      onPointerLeave={() => tl.current?.resume()}\n      onPointerDown={(e: React.PointerEvent<HTMLButtonElement>) => {\n        onPointerDown?.(e);\n        cuePing(e.currentTarget, e);\n      }}\n      {...props}\n    >\n      <span\n        data-slot=\"shimmer-band\"\n        aria-hidden=\"true\"\n        className=\"pointer-events-none absolute inset-y-0 left-0 -z-10 w-1/2 -translate-x-full skew-x-[-20deg] bg-linear-to-r from-transparent via-primary-foreground/25 to-transparent\"\n      />\n      {asChild ? <Slot.Slottable>{children}</Slot.Slottable> : children}\n    </Comp>\n  );\n}\n\nexport { ShimmerButton };\nexport type { ShimmerButtonProps };\n",
      "type": "registry:ui"
    }
  ],
  "docs": "Docs and examples: https://ui.cuelark.com/components/shimmer-button",
  "categories": [
    "effects"
  ],
  "type": "registry:ui"
}