{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "amphora",
  "type": "registry:ui",
  "title": "amphora",
  "description": "Animated amphora icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/amphora.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: 'AmphoraIcon' })\n\nwithDefaults(\n  defineProps<{\n    size?: number\n  }>(),\n  { size: 28 },\n)\n\n// the two handles lift the jar and the body settles back onto its foot\n// authored from scripts/authored\nconst bodyVariants: Variants = {\n  normal: { transform: 'translateY(0px) scaleY(1)' },\n  animate: {\n    transform: [\n      'translateY(0px) scaleY(1)',\n      'translateY(-1.3px) scaleY(1.04)',\n      'translateY(0.2px) scaleY(0.98)',\n      'translateY(0px) scaleY(1)',\n    ],\n    transition: { duration: 0.7, times: [0, 0.38, 0.72, 1], ease: [0.23, 1, 0.32, 1] },\n  },\n};\n\nconst rimVariants: Variants = {\n  normal: { transform: 'scaleX(1)' },\n  animate: {\n    transform: ['scaleX(1)', 'scaleX(1.08)', 'scaleX(1)'],\n    transition: { duration: 0.54, delay: 0.08, times: [0, 0.4, 1], ease: [0.23, 1, 0.32, 1] },\n  },\n};\n\nconst handleRightVariants: Variants = {\n  normal: { transform: 'rotate(0deg)' },\n  animate: {\n    transform: ['rotate(0deg)', 'rotate(-8deg)', 'rotate(2deg)', 'rotate(0deg)'],\n    transition: { duration: 0.66, times: [0, 0.36, 0.72, 1], ease: [0.23, 1, 0.32, 1] },\n  },\n};\n\nconst handleLeftVariants: Variants = {\n  normal: { transform: 'rotate(0deg)' },\n  animate: {\n    transform: ['rotate(0deg)', 'rotate(8deg)', 'rotate(-2deg)', 'rotate(0deg)'],\n    transition: { duration: 0.66, times: [0, 0.36, 0.72, 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=\"M14.5 9C14.5 5.5 16.5 3.83333 16.5 3C16.5 2.44772 16.0523 2 15.5 2H8.5C7.94772 2 7.5 2.44772 7.5 3C7.5 3.83333 9.5 5.5 9.5 9C9.5 12.5 6 13 6 16C6 16.7606 6.19285 17.5936 6.46853 18.4163C7.01669 20.0522 7.29077 20.8702 8.07582 21.4351C8.86088 22 9.87366 22 11.8992 22H12.1008C14.1263 22 15.1391 22 15.9242 21.4351C16.7092 20.8702 16.9833 20.0522 17.5315 18.4163C17.8072 17.5936 18 16.7606 18 16C18 13 14.5 12.5 14.5 9Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"bodyVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 22px' }\" />\n            <motion.path d=\"M9 6H15\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"rimVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 6px' }\" />\n            <motion.path d=\"M16.5 4H17.6207C18.3825 4 19 4.6175 19 5.37924C19 5.45959 18.9929 5.53979 18.979 5.61893L17.5 14\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"handleRightVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '16.5px 4px' }\" />\n            <motion.path d=\"M7.50006 4H6.37924C5.6175 4 5 4.6175 5 5.37924C5 5.45959 5.00702 5.53979 5.02099 5.61893L6.5 14\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"handleLeftVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '7.5px 4px' }\" />\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"
    }
  ]
}
