{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "beer",
  "type": "registry:ui",
  "title": "beer",
  "description": "Animated beer icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/beer.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: 'BeerIcon' })\n\nwithDefaults(\n  defineProps<{\n    size?: number\n  }>(),\n  { size: 28 },\n)\n\n// after coffee-02: it tips, pours, and rights itself\n// generated from @hugeicons/core-free-icons\nconst iconVariants: Variants = {\n  normal: {\n    transform: 'rotate(0deg)',\n  },\n  animate: {\n    transform: ['rotate(0deg)', 'rotate(18.77deg)', 'rotate(22.95deg)', 'rotate(-2.09deg)', 'rotate(0deg)'],\n    transition: {\n      duration: 0.79,\n      times: [0, 0.28, 0.55, 0.82, 1],\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: 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.24414 19.4531C7.24414 18.9209 7.24374 18.6804 7.23145 18.4443C7.18703 17.5921 7.02523 16.7501 6.75 15.9424C6.67376 15.7187 6.58439 15.4952 6.38672 15.001L5.97754 13.9785C5.73357 13.3686 5.58979 13.0119 5.48731 12.6406C5.39264 12.2976 5.32563 11.9474 5.28613 11.5938C5.24338 11.2109 5.24414 10.826 5.24414 10.1689C5.24414 9.63568 5.24367 9.19179 5.27246 8.83008C5.30194 8.45988 5.36598 8.11163 5.5293 7.78125C5.79674 7.24037 6.23451 6.8026 6.77539 6.53516C7.10578 6.37184 7.45402 6.3078 7.82422 6.27832C8.18593 6.24953 8.62982 6.25 9.16309 6.25H10.9941C11.4084 6.25 11.7441 6.58579 11.7441 7C11.7441 7.41421 11.4084 7.75 10.9941 7.75H9.16309C8.60583 7.75 8.23173 7.7505 7.94336 7.77344C7.66335 7.79573 7.52899 7.83611 7.44043 7.87988C7.19449 8.00146 6.9956 8.20035 6.87402 8.44629C6.83025 8.53485 6.78987 8.66921 6.76758 8.94922C6.74464 9.23759 6.74414 9.61169 6.74414 10.1689C6.74414 10.8574 6.74504 11.1459 6.77637 11.4268C6.80709 11.7018 6.85995 11.9744 6.93359 12.2412C7.00881 12.5137 7.11431 12.7823 7.37012 13.4219L7.7793 14.4443C7.97145 14.9247 8.07821 15.1889 8.16992 15.458C8.48988 16.3969 8.67786 17.3757 8.72949 18.3662C8.74429 18.6501 8.74414 18.9357 8.74414 19.4531C8.74414 20.0008 8.74807 20.1548 8.77246 20.2666C8.87669 20.7441 9.25004 21.1175 9.72754 21.2217C9.83932 21.2461 9.99333 21.25 10.541 21.25H13.4473C13.995 21.25 14.149 21.2461 14.2607 21.2217C14.7382 21.1175 15.1116 20.7441 15.2158 20.2666C15.2402 20.1548 15.2441 20.0008 15.2441 19.4531C15.2441 18.9357 15.244 18.6501 15.2588 18.3662C15.3104 17.3757 15.4984 16.3969 15.8184 15.458C15.9101 15.1889 16.0168 14.9247 16.209 14.4443L16.6182 13.4219C16.874 12.7824 16.9795 12.5137 17.0547 12.2412C17.1283 11.9744 17.1812 11.7018 17.2119 11.4268C17.2432 11.1459 17.2441 10.8574 17.2441 10.1689C17.2441 9.61169 17.2436 9.23759 17.2207 8.94922C17.1984 8.66921 17.158 8.53485 17.1143 8.44629C16.9927 8.20035 16.7938 8.00146 16.5479 7.87988C16.4593 7.83611 16.3249 7.79573 16.0449 7.77344C15.7566 7.7505 15.3825 7.75 14.8252 7.75H13.9941C13.5799 7.75 13.2441 7.41421 13.2441 7C13.2441 6.58579 13.5799 6.25 13.9941 6.25H14.8252C15.3585 6.25 15.8024 6.24953 16.1641 6.27832C16.5343 6.3078 16.8825 6.37184 17.2129 6.53516C17.7538 6.8026 18.1915 7.24037 18.459 7.78125C18.6223 8.11164 18.6863 8.45988 18.7158 8.83008C18.7446 9.19179 18.7441 9.63568 18.7441 10.1689C18.7441 10.826 18.7449 11.2109 18.7021 11.5938C18.6627 11.9474 18.5956 12.2976 18.501 12.6406C18.3985 13.0119 18.2547 13.3686 18.0107 13.9785L17.6016 15.001C17.4039 15.4952 17.3145 15.7187 17.2383 15.9424C16.9631 16.7501 16.8013 17.5921 16.7568 18.4443C16.7445 18.6804 16.7441 18.9209 16.7441 19.4531C16.7441 19.9222 16.7483 20.2773 16.6807 20.5869C16.4513 21.637 15.6312 22.4571 14.5811 22.6865C14.2714 22.7541 13.9163 22.75 13.4473 22.75H10.541C10.072 22.75 9.71688 22.7541 9.40723 22.6865C8.35713 22.4571 7.53703 21.637 7.30762 20.5869C7.24003 20.2773 7.24414 19.9222 7.24414 19.4531Z\" fill=\"currentColor\" :variants=\"iconVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '11.99px 22.75px' }\" />\n            <motion.path d=\"M17.2578 5.5C17.2578 4.5335 16.4743 3.75 15.5078 3.75C15.2383 3.75 14.9848 3.81071 14.7588 3.91797C14.4326 4.07251 14.042 3.97282 13.83 3.68066C13.4199 3.11542 12.7567 2.75 12.0078 2.75C11.2589 2.75 10.5957 3.11542 10.1855 3.68066C9.97353 3.97282 9.58297 4.07251 9.25681 3.91797C9.03072 3.81071 8.77722 3.75 8.50778 3.75C7.54128 3.75 6.75778 4.5335 6.75778 5.5C6.75778 5.7693 6.8196 6.02281 6.9277 6.25H11.0078C11.422 6.25 11.7578 6.58579 11.7578 7C11.7578 7.41421 11.422 7.75 11.0078 7.75H6.50778C6.2719 7.75 6.04984 7.63879 5.90817 7.4502C5.50014 6.90695 5.25778 6.23077 5.25778 5.5C5.25778 3.70507 6.71286 2.25 8.50778 2.25C8.79693 2.25 9.07789 2.28807 9.34567 2.35938C10.0245 1.67524 10.9664 1.25 12.0078 1.25C13.0489 1.25 13.9902 1.67553 14.6689 2.35938C14.937 2.28792 15.2183 2.25 15.5078 2.25C17.3027 2.25 18.7578 3.70507 18.7578 5.5C18.7578 6.23077 18.5154 6.90695 18.1074 7.4502C17.9657 7.63879 17.7437 7.75 17.5078 7.75H14.0078C13.5936 7.75 13.2578 7.41421 13.2578 7C13.2578 6.58579 13.5936 6.25 14.0078 6.25H17.0879C17.196 6.02281 17.2578 5.7693 17.2578 5.5Z\" fill=\"currentColor\" :variants=\"iconVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '11.99px 22.75px' }\" />\n            <motion.path d=\"M10.2578 11.5V7C10.2578 6.58579 10.5936 6.25 11.0078 6.25C11.422 6.25 11.7578 6.58579 11.7578 7V11.5C11.7578 11.9142 12.0936 12.25 12.5078 12.25C12.922 12.25 13.2578 11.9142 13.2578 11.5V7C13.2578 6.58579 13.5936 6.25 14.0078 6.25C14.422 6.25 14.7578 6.58579 14.7578 7V11.5C14.7578 12.7426 13.7504 13.75 12.5078 13.75C11.2651 13.75 10.2578 12.7426 10.2578 11.5Z\" fill=\"currentColor\" :variants=\"iconVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '11.99px 22.75px' }\" />\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"
    }
  ]
}
