{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "fish",
  "type": "registry:ui",
  "title": "fish",
  "description": "Animated fish icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/fish.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: 'FishIcon' })\n\nwithDefaults(\n  defineProps<{\n    size?: number\n  }>(),\n  { size: 28 },\n)\n\n// after leaf-01: it flicks its tail and glides a body-length forward\n// generated from @hugeicons/core-free-icons\nconst iconVariants: Variants = {\n  normal: {\n    transform: 'translateX(0px) rotate(0deg)',\n  },\n  animate: {\n    transform: ['translateX(0px) rotate(0deg)', 'translateX(2.57px) rotate(-6.41deg)', 'translateX(3.42px) rotate(4.28deg)', 'translateX(0px) rotate(0deg)'],\n    transition: {\n      duration: 0.72,\n      ease: [0.77, 0, 0.175, 1],\n    },\n  },\n}\n\nconst controls = useAnimationControls()\nconst { onMouseEnter, onMouseLeave, startAnimation, stopAnimation } = useIconAnimation({\n  controls,\n  loops: true,\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=\"M21.8554 4.56319C21.7357 3.71328 21.6759 3.28832 21.1932 2.80607C20.7105 2.32383 20.2852 2.26403 19.4345 2.14445C17.1614 1.82493 13.3709 1.82152 10.3789 4.44809C10.1209 4.67453 9.99195 4.78776 9.87102 4.84734C9.75009 4.90691 9.60607 4.93539 9.31802 4.99234L7.75141 5.30207C6.84186 5.48189 6.38709 5.57181 6.16473 5.80243C5.93998 6.03554 5.83938 6.36142 5.89368 6.68051C5.94739 6.9962 6.27248 7.32641 6.92265 7.98683C7.15912 8.22702 7.27735 8.34712 7.34627 8.4749C7.42313 8.6174 7.45689 8.73604 7.46656 8.89763C7.47523 9.04252 7.43211 9.23238 7.34587 9.6121C7.14076 10.5152 7.0596 11.3997 7.05223 12.2156C7.04485 13.0332 7.04116 13.442 6.85757 13.7021C6.67398 13.9621 6.32883 14.0885 5.63851 14.3414L4.76876 14.6599C2.90665 15.3418 1.9756 15.6828 2.00049 16.242C2.02538 16.8012 2.98305 17.0582 4.8984 17.5723L4.96576 17.5904C5.52005 17.7392 5.7972 17.8136 5.99024 18.0064C6.18327 18.1992 6.25782 18.476 6.40691 19.0298L6.42306 19.0898C6.94109 21.0138 7.2001 21.9758 7.76091 21.9996C8.32172 22.0233 8.66118 21.0866 9.3401 19.2131L9.65112 18.3549C9.90236 17.6616 10.028 17.3149 10.2887 17.1304C10.5494 16.9458 10.9601 16.9419 11.7816 16.9341C12.5949 16.9264 13.4761 16.8455 14.3757 16.642C14.7561 16.556 14.9463 16.5129 15.0912 16.5216C15.2557 16.5315 15.3766 16.5663 15.5211 16.6456C15.6483 16.7154 15.7677 16.8344 16.0064 17.0726C16.6633 17.7278 16.9917 18.0554 17.3059 18.112C17.6295 18.1702 17.9614 18.0691 18.1974 17.8402C18.4265 17.6181 18.5159 17.1631 18.6948 16.2531L19.0055 14.6722C19.0622 14.3836 19.0906 14.2393 19.1503 14.1181C19.21 13.997 19.3236 13.8678 19.5508 13.6093C22.1786 10.6202 22.1752 6.83385 21.8554 4.56319Z\" stroke=\"currentColor\" fill-rule=\"evenodd\" clip-rule=\"evenodd\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"iconVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12.08px 11.92px' }\" />\n            <motion.path d=\"M16.5 6.25V6.5M17 6.5C17 6.77614 16.7761 7 16.5 7C16.2239 7 16 6.77614 16 6.5C16 6.22386 16.2239 6 16.5 6C16.7761 6 17 6.22386 17 6.5Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"iconVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12.08px 11.92px' }\" />\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"
    }
  ]
}
