{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "body-weight",
  "type": "registry:ui",
  "title": "body-weight",
  "description": "Animated body weight icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/body-weight.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: 'BodyWeightIcon' })\n\nwithDefaults(\n  defineProps<{\n    size?: number\n  }>(),\n  { size: 28 },\n)\n\n// after thumbs-up: the load dips, drives up, and comes back under control\n// generated from @hugeicons/core-free-icons\nconst iconVariants: Variants = {\n  normal: {\n    transform: 'translateY(0px) scaleY(1)',\n  },\n  animate: {\n    transform: ['translateY(0px) scaleY(1)', 'translateY(1.11px) scaleY(0.94)', 'translateY(-2.83px) scaleY(1.04)', 'translateY(-2.43px) scaleY(1)', 'translateY(0px) scaleY(1)'],\n    transition: {\n      duration: 0.81,\n      times: [0, 0.18, 0.5, 0.68, 1],\n      ease: [0.23, 1, 0.32, 1],\n    },\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=\"M12.0018 14.0034V12.3621M12.0018 14.0034C10.3356 14.0034 8.66938 13.821 7.0032 13.4565M12.0018 14.0034C13.6684 14.0034 15.3351 13.8212 17.0018 13.4565M7.0032 13.4565C5.72831 13.1776 4.45343 12.7918 3.17854 12.2995C2.66898 12.1026 2.4142 12.0042 2.23938 11.7788C1.94932 11.4049 2.00174 10.8841 2.00174 10.4387C2.00174 9.20572 2.00174 7.58804 2.30254 7.26609C2.872 6.65661 3.95909 7.21761 4.59137 7.42272C9.53162 9.02529 14.4719 9.02529 19.4122 7.42272C20.0444 7.21761 21.1315 6.65661 21.701 7.26609C22.0018 7.58804 22.0018 9.20572 22.0018 10.4387C22.0018 11.0571 22.0018 11.3663 21.8658 11.6217C21.6568 12.0141 21.2154 12.1487 20.825 12.2995C19.5506 12.7916 18.2762 13.1776 17.0018 13.4565M7.0032 13.4565L7.00174 11.8149M17.0018 13.4565V11.8149\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"iconVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12.01px 21px' }\" />\n            <motion.path d=\"M19.002 19.0096C14.3353 20.3458 9.66862 20.3458 5.00195 19.0096\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"iconVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12.01px 21px' }\" />\n            <motion.path d=\"M19.191 2.99805C18.6141 4.30938 18.0839 6.55739 18.0839 7.58772M4.81544 2.99805C5.39237 4.30938 5.92253 6.55739 5.92253 7.58772M5.39913 15.5107C4.96029 16.8915 3.80051 19.6218 4.00426 21.0026M18.6142 15.5107C19.0531 16.8915 20.2129 19.6218 20.0091 21.0026\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"iconVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12.01px 21px' }\" />\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"
    }
  ]
}
