{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "shiny-text",
  "title": "Shiny text",
  "description": "A soft light band sweeps across muted text on a loop or on hover, made for badges like \"New: AI receptionist\". Pure CSS.",
  "dependencies": [],
  "registryDependencies": [
    "https://goodui.dev/r/goodui-motion.json"
  ],
  "files": [
    {
      "path": "registry/components/text/shiny-text.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { cn } from \"@/lib/utils\"\nimport { GooduiTokens } from \"@/lib/goodui-motion\"\n\n// The band sweeps left to right, then rests off-screen for the last part of the cycle.\nconst CSS = `\n@keyframes pc-shiny-text-sweep { 0% { background-position: 100% 0 } 65%, 100% { background-position: 0% 0 } }\n.pc-shiny-text {\n  --pc-shiny-base: var(--muted-foreground);\n  --pc-shiny-shine: var(--foreground);\n  --pc-shiny-dir: 110deg;\n  color: var(--pc-shiny-base);\n}\n.pc-shiny-text[data-tone=\"ink\"] { --pc-shiny-base: color-mix(in oklab, var(--foreground) 72%, transparent); --pc-shiny-shine: var(--foreground) }\n.pc-shiny-text[data-tone=\"metal\"] { --pc-shiny-base: oklch(0.45 0.012 260); --pc-shiny-shine: oklch(0.82 0.02 260) }\n.pc-shiny-text[data-tone=\"accent\"] { --pc-shiny-base: var(--muted-foreground); --pc-shiny-shine: var(--chart-1) }\n:where(.dark) .pc-shiny-text[data-tone=\"metal\"] { --pc-shiny-base: oklch(0.62 0.01 260); --pc-shiny-shine: oklch(0.99 0.004 260) }\n.pc-shiny-text:dir(rtl) { --pc-shiny-dir: 250deg }\n@supports ((-webkit-background-clip: text) or (background-clip: text)) {\n  .pc-shiny-text {\n    color: transparent;\n    background-image: linear-gradient(var(--pc-shiny-dir), var(--pc-shiny-base) calc(50% - var(--pc-shiny-spread, 9%)), color-mix(in oklab, var(--pc-shiny-base), var(--pc-shiny-shine) 55%) calc(50% - var(--pc-shiny-spread, 9%) * .4), var(--pc-shiny-shine) 50%, color-mix(in oklab, var(--pc-shiny-base), var(--pc-shiny-shine) 55%) calc(50% + var(--pc-shiny-spread, 9%) * .4), var(--pc-shiny-base) calc(50% + var(--pc-shiny-spread, 9%)));\n    background-size: 250% 100%;\n    background-position: 0% 0;\n    background-repeat: no-repeat;\n    -webkit-background-clip: text;\n    background-clip: text;\n  }\n  .pc-shiny-text[data-trigger=\"loop\"] { animation: pc-shiny-text-sweep var(--pc-shiny-duration, 2.8s) var(--pc-ease-in-out) infinite }\n  .pc-shiny-text:dir(rtl) { animation-direction: reverse !important }\n  :is(a, button, [data-shiny-group]):is(:hover, :focus-visible) .pc-shiny-text[data-trigger=\"hover\"],\n  .pc-shiny-text[data-trigger=\"hover\"]:hover {\n    animation: pc-shiny-text-sweep var(--pc-shiny-duration, 2.8s) var(--pc-ease-in-out) infinite;\n  }\n}\n@media (prefers-reduced-motion: reduce) {\n  .pc-shiny-text, .pc-shiny-text[data-trigger] { animation: none !important; background-position: 0% 0 }\n}\n`\n\nexport type ShinyTextProps = React.HTMLAttributes<HTMLSpanElement> & {\n  /** Seconds per cycle (the sweep takes about two thirds of it). */\n  duration?: number\n  /** \"loop\" sweeps forever; \"hover\" sweeps while the text or its parent link/button is hovered or focused. */\n  trigger?: \"loop\" | \"hover\"\n  /** Preset: muted (default) sweeps foreground over muted, ink keeps the text strong, metal is steel, accent shines in the theme color. */\n  tone?: \"muted\" | \"ink\" | \"metal\" | \"accent\"\n  /** Text color at rest; overrides `tone`. */\n  baseColor?: string\n  /** Color of the light band; overrides `tone`. */\n  shineColor?: string\n  /** Half-width of the band, as a percent of the gradient. */\n  spread?: number\n}\n\n/** Muted text with a soft light band sweeping across it. Pure CSS (background-clip), static for reduced motion. */\nexport function ShinyText({\n  duration = 2.8,\n  trigger = \"loop\",\n  tone = \"muted\",\n  baseColor,\n  shineColor,\n  spread = 9,\n  className,\n  style,\n  children,\n  ...props\n}: ShinyTextProps) {\n  return (\n    <>\n      <GooduiTokens />\n      <style href=\"pc-shiny-text\" precedence=\"default\">\n        {CSS}\n      </style>\n      <span\n        data-trigger={trigger}\n        data-tone={tone}\n        className={cn(\"pc-shiny-text inline-block\", className)}\n        style={{\n          ...style,\n          [\"--pc-shiny-duration\" as string]: `${duration}s`,\n          [\"--pc-shiny-spread\" as string]: `${spread}%`,\n          ...(baseColor ? { [\"--pc-shiny-base\" as string]: baseColor } : {}),\n          ...(shineColor ? { [\"--pc-shiny-shine\" as string]: shineColor } : {}),\n        }}\n        {...props}\n      >\n        {children}\n      </span>\n    </>\n  )\n}\n",
      "type": "registry:component",
      "target": "components/goodui/shiny-text.tsx"
    }
  ],
  "categories": [
    "components",
    "text"
  ],
  "type": "registry:component"
}