{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "ai-dna",
  "type": "registry:ui",
  "title": "ai-dna",
  "description": "Animated ai dna icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/ai-dna.vue",
      "type": "registry:ui",
      "content": "<script setup lang=\"ts\">\nimport { motion, useAnimationControls } from 'motion-v'\nimport type { Variants } from 'motion-v'\nimport { useIconAnimation } from '../composables/useIconAnimation'\nimport type { AnimatedIconHandle } from '../types'\n\ndefineOptions({ inheritAttrs: false, name: 'AiDnaIcon' })\n\nwithDefaults(\n  defineProps<{\n    size?: number\n  }>(),\n  { size: 28 },\n)\n\n// the helix twists edge-on, narrowing then opening again, while the reader chip pulses\n// authored from scripts/authored\nconst helixVariants: Variants = {\n  normal: { transform: 'scaleX(1)' },\n  animate: {\n    transform: ['scaleX(1)', 'scaleX(0.74)', 'scaleX(1.08)', 'scaleX(1)'],\n    transition: {\n      duration: 0.76,\n      times: [0, 0.34, 0.7, 1],\n      ease: [\n        [0.77, 0, 0.175, 1],\n        [0.23, 1, 0.32, 1],\n        [0.23, 1, 0.32, 1],\n      ],\n    },\n  },\n};\n\nconst readerVariants: Variants = {\n  normal: { transform: 'scale(1)', opacity: 1 },\n  animate: {\n    transform: ['scale(1)', 'scale(0.92)', 'scale(1.05)', 'scale(1)'],\n    opacity: [1, 0.7, 1, 1],\n    transition: { duration: 0.6, delay: 0.14, times: [0, 0.32, 0.68, 1], ease: [0.23, 1, 0.32, 1] },\n  },\n};\n\nconst controls = useAnimationControls()\nconst { onMouseEnter, onMouseLeave, startAnimation, stopAnimation } = useIconAnimation({\n  controls,\n  loops: false,\n})\n\ndefineExpose<AnimatedIconHandle>({ startAnimation, stopAnimation })\n</script>\n\n<template>\n  <div class=\"hia-icon\" @mouseenter=\"onMouseEnter\" @mouseleave=\"onMouseLeave\" v-bind=\"$attrs\">\n          <svg xmlns=\"http://www.w3.org/2000/svg\" :width=\"size\" :height=\"size\" viewBox=\"0 0 24 24\" fill=\"none\" overflow=\"visible\">\n            <motion.path d=\"M7.49114 14.0015C3.00094 11.6015 3.00094 10.4015 3.00094 10.0015C3.00094 9.60146 3.00094 8.40146 7.49114 6.00146M7.49114 14.0015C3.00094 16.4015 3.00006 17.2015 3.00006 18.0015M7.49114 14.0015C11.9804 11.602 11.9804 10.402 11.9804 10.0017C11.9804 9.60147 11.9804 8.40099 7.49114 6.00146M7.49114 6.00146C11.9813 3.60146 11.9813 2.80146 11.9813 2.00146M7.49114 6.00146L5.30787 4.74576C3.00063 3.28295 3.00006 2.64221 3.00006 2.00146\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"helixVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '7.5px 10px' }\" />\n            <motion.path d=\"M14.4119 12.0005V13.9795M10.9249 15.5009H12.9768M18.9479 15.5009H20.9999M18.9479 18.4741H20.9999M10.9249 18.4741H12.9768M14.4119 20.0197V21.9987M17.4373 20.0197V21.9987M17.4266 12.0005V13.9795M13.9768 19.968H17.9479C18.5002 19.968 18.9479 19.5203 18.9479 18.968V14.9795C18.9479 14.4272 18.5002 13.9795 17.9479 13.9795H13.9768C13.4246 13.9795 12.9768 14.4272 12.9768 14.9795V18.968C12.9768 19.5203 13.4246 19.968 13.9768 19.968Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\" :variants=\"readerVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '16px 17px' }\" />\n          </svg>\n        </div>\n</template>\n"
    },
    {
      "path": "composables/useIconAnimation.ts",
      "type": "registry:lib",
      "content": "import { ref, toValue, type MaybeRefOrGetter } from 'vue'\nimport type { AnimatedIconHandle } from '../types'\n\nexport type IconPose = 'normal' | 'animate'\n\ntype AnimationControls = {\n  set: (variant: IconPose | Record<string, unknown>) => void\n  start: (variant: IconPose | Record<string, unknown>) => Promise<unknown>\n}\n\nexport function useReducedMotionFlag(\n  reduced?: MaybeRefOrGetter<boolean | undefined>,\n) {\n  if (typeof window === 'undefined') return () => false\n  return () => {\n    const override = reduced === undefined ? undefined : toValue(reduced)\n    if (override !== undefined) return override\n    return window.matchMedia('(prefers-reduced-motion: reduce)').matches\n  }\n}\n\nexport function useIconAnimation(options: {\n  controls: AnimationControls\n  loops?: boolean\n}): AnimatedIconHandle & {\n  onMouseEnter: () => void\n  onMouseLeave: () => void\n} {\n  const { controls, loops = false } = options\n  const isPlaying = ref(false)\n  let run = 0\n\n  const prefersReduced = () =>\n    typeof window !== 'undefined' &&\n    window.matchMedia('(prefers-reduced-motion: reduce)').matches\n\n  async function startAnimation() {\n    if (prefersReduced() || isPlaying.value) return\n\n    isPlaying.value = true\n    const current = ++run\n    controls.set('normal')\n    await controls.start('animate')\n    if (run === current) isPlaying.value = false\n  }\n\n  function stopAnimation() {\n    if (!loops) return\n    run += 1\n    isPlaying.value = false\n    void controls.start('normal')\n  }\n\n  return {\n    startAnimation,\n    stopAnimation,\n    onMouseEnter: () => {\n      void startAnimation()\n    },\n    onMouseLeave: () => {\n      stopAnimation()\n    },\n  }\n}\n"
    },
    {
      "path": "types/animated-icon.ts",
      "type": "registry:lib",
      "content": "export interface AnimatedIconHandle {\n  startAnimation: () => void\n  stopAnimation: () => void\n}\n\nexport interface AnimatedIconProps {\n  size?: number\n}\n"
    }
  ]
}
