{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "motion-text-shimmer-wave",
  "title": "Text shimmer wave",
  "description": "A component that creates a wave-like shimmer effect on text.",
  "dependencies": [
    "motion"
  ],
  "registryDependencies": [
    "https://ui.ndekocode.dev/r/theme.json",
    "https://ui.ndekocode.dev/r/use-prefers-reduced-motion.json",
    "https://ui.ndekocode.dev/r/utils.json"
  ],
  "files": [
    {
      "path": "components/core/text-shimmer-wave.tsx",
      "content": "'use client';\nimport { motion, MotionConfig, Transition } from 'motion/react';\nimport { motionElementOf } from './motion-elements';\nimport { cn } from '@/lib/utils';\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\n\nexport type TextShimmerWaveProps = {\n  children: string;\n  as?: React.ElementType;\n  className?: string;\n  duration?: number;\n  zDistance?: number;\n  xDistance?: number;\n  yDistance?: number;\n  spread?: number;\n  scaleDistance?: number;\n  rotateYDistance?: number;\n  transition?: Transition;\n};\n\nfunction ReducedMotionConfig({ children }: { children: React.ReactNode }) {\n  const prefersReducedMotion = usePrefersReducedMotion();\n  if (!prefersReducedMotion) {\n    return children;\n  }\n  return <MotionConfig reducedMotion='always'>{children}</MotionConfig>;\n}\n\nexport function TextShimmerWave({\n  children,\n  as: Component = 'p',\n  className,\n  duration = 1,\n  zDistance = 10,\n  xDistance = 2,\n  yDistance = -2,\n  spread = 1,\n  scaleDistance = 1.1,\n  rotateYDistance = 10,\n  transition,\n}: TextShimmerWaveProps) {\n  const MotionComponent = motionElementOf(Component) as typeof motion.p;\n\n  return (\n    <ReducedMotionConfig>\n      <MotionComponent\n        className={cn(\n          'relative inline-block [perspective:500px]',\n          '[--base-color:var(--muted-foreground)] [--base-gradient-color:var(--foreground)]',\n          className\n        )}\n        style={{ color: 'var(--base-color)' }}\n      >\n        {children.split('').map((char, i) => {\n          const delay = (i * duration * (1 / spread)) / children.length;\n\n          return (\n            <motion.span\n              key={i}\n              className={cn(\n                'inline-block whitespace-pre [transform-style:preserve-3d]'\n              )}\n              initial={{\n                translateZ: 0,\n                scale: 1,\n                rotateY: 0,\n                color: 'var(--base-color)',\n              }}\n              animate={{\n                translateZ: [0, zDistance, 0],\n                translateX: [0, xDistance, 0],\n                translateY: [0, yDistance, 0],\n                scale: [1, scaleDistance, 1],\n                rotateY: [0, rotateYDistance, 0],\n                color: [\n                  'var(--base-color)',\n                  'var(--base-gradient-color)',\n                  'var(--base-color)',\n                ],\n              }}\n              transition={{\n                duration: duration,\n                repeat: Infinity,\n                repeatDelay: (children.length * 0.05) / spread,\n                delay,\n                ease: 'easeInOut',\n                ...transition,\n              }}\n            >\n              {char}\n            </motion.span>\n          );\n        })}\n      </MotionComponent>\n    </ReducedMotionConfig>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/core/text-shimmer-wave.tsx"
    },
    {
      "path": "components/core/motion-elements.ts",
      "content": "import { motion } from 'motion/react';\n\nconst MOTION_ELEMENTS = {\n  a: motion.a,\n  article: motion.article,\n  aside: motion.aside,\n  blockquote: motion.blockquote,\n  button: motion.button,\n  code: motion.code,\n  div: motion.div,\n  em: motion.em,\n  figure: motion.figure,\n  footer: motion.footer,\n  h1: motion.h1,\n  h2: motion.h2,\n  h3: motion.h3,\n  h4: motion.h4,\n  h5: motion.h5,\n  h6: motion.h6,\n  header: motion.header,\n  label: motion.label,\n  li: motion.li,\n  main: motion.main,\n  nav: motion.nav,\n  ol: motion.ol,\n  p: motion.p,\n  pre: motion.pre,\n  section: motion.section,\n  small: motion.small,\n  span: motion.span,\n  strong: motion.strong,\n  ul: motion.ul,\n};\n\ntype MotionElementTag = keyof typeof MOTION_ELEMENTS;\n\nfunction isMotionElementTag(tag: unknown): tag is MotionElementTag {\n  const isString = typeof tag === 'string';\n  return isString && tag in MOTION_ELEMENTS;\n}\n\n/**\n * The motion version of an HTML tag. A lookup such as `motion[tag]` is invisible to the bundler,\n * which drops the tags it never sees and breaks the production build, so every tag is listed here.\n */\nexport function motionElementOf(tag: unknown) {\n  if (isMotionElementTag(tag)) {\n    return MOTION_ELEMENTS[tag];\n  }\n  return MOTION_ELEMENTS.div;\n}\n",
      "type": "registry:component",
      "target": "components/core/motion-elements.ts"
    }
  ],
  "categories": [
    "motion"
  ],
  "type": "registry:component"
}