{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "body-part-six-pack",
  "type": "registry:ui",
  "title": "body-part-six-pack",
  "description": "Animated body part six pack icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/body-part-six-pack.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: 'BodyPartSixPackIcon' })\n\nwithDefaults(\n  defineProps<{\n    size?: number\n  }>(),\n  { size: 28 },\n)\n\n// after user: the figure shifts its weight from head to feet\n// generated from @hugeicons/core-free-icons\nconst headVariants: Variants = {\n  normal: {\n    transform: 'rotate(0deg)',\n  },\n  animate: {\n    transform: ['rotate(0deg)', 'rotate(15.43deg)', 'rotate(-3.86deg)', 'rotate(0deg)'],\n    transition: {\n      duration: 0.58,\n      ease: 'easeInOut',\n      times: [0, 0.4, 0.7, 1],\n    },\n  },\n}\n\nconst bodyVariants: Variants = {\n  normal: {\n    transform: 'translateY(0px)',\n  },\n  animate: {\n    transform: ['translateY(0px)', 'translateY(0.87px)', 'translateY(0px)'],\n    transition: {\n      duration: 0.29,\n      ease: 'easeOut',\n      delay: 0.28,\n    },\n  },\n}\n\nconst personVariants: Variants = {\n  normal: {\n    transform: 'translateY(0px)',\n  },\n  animate: {\n    transform: ['translateY(0px) scale(1)', 'translateY(-1.58px) scale(1.03)', 'translateY(0.53px) scale(0.98)', 'translateY(0px) scale(1)'],\n    transition: {\n      duration: 0.57,\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=\"M22 4V4.58579C22 4.7544 22 4.83871 21.9956 4.91994C21.9585 5.60243 21.6896 6.25181 21.2332 6.7606C21.1788 6.82116 21.1192 6.88077 21 7C20.8808 7.11923 20.8212 7.17884 20.7606 7.23317C20.2518 7.68957 19.6024 7.95855 18.9199 7.99559C18.8387 8 18.7544 8 18.5858 8H16.4142C16.2456 8 16.1613 8 16.0801 7.99559C15.3976 7.95855 14.7482 7.68957 14.2394 7.23317C14.1788 7.17884 14.1192 7.11923 14 7\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"headVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '18px 8px' }\" />\n            <motion.path d=\"M20.5 7.5L20 10L19.3078 12.4227C19.1036 13.1374 19 13.8771 19 14.6204V14.9315C19 15.31 19.0269 15.6881 19.0804 16.0628L19.5 20\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"bodyVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '19.75px 13.75px' }\" />\n            <motion.path d=\"M3.5 7.5L4 10L4.69219 12.4227C4.8964 13.1374 5 13.8771 5 14.6204V14.9315C5 15.31 4.97313 15.6881 4.9196 16.0628L4.5 20\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"personVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '4.25px 13.75px' }\" />\n            <motion.path d=\"M2 4V4.58579C2 4.7544 2 4.83871 2.00441 4.91994C2.04145 5.60243 2.31043 6.25181 2.76683 6.7606C2.82116 6.82116 2.88077 6.88077 3 7C3.11923 7.11923 3.17884 7.17884 3.2394 7.23317C3.74819 7.68957 4.39757 7.95855 5.08006 7.99559C5.16129 8 5.2456 8 5.41421 8H7.58579C7.7544 8 7.83871 8 7.91994 7.99559C8.60243 7.95855 9.25181 7.68957 9.7606 7.23317C9.82116 7.17884 9.88077 7.11923 10 7\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"personVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '6px 6px' }\" />\n            <motion.path d=\"M15 13H14C12.8954 13 12 12.1046 12 11C12 12.1046 11.1046 13 10 13H9\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"personVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 12px' }\" />\n            <motion.path d=\"M15 18H14C12.8954 18 12 17.1046 12 16C12 17.1046 11.1046 18 10 18H9\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"personVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 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"
    }
  ]
}
