{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "apple-pie",
  "type": "registry:ui",
  "title": "apple-pie",
  "description": "Animated apple pie icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/apple-pie.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: 'ApplePieIcon' })\n\nwithDefaults(\n  defineProps<{\n    size?: number\n  }>(),\n  { size: 28 },\n)\n\n// steam puffs from the two slits, the crust settles, and the dish holds\n// authored from scripts/authored\nconst crustVariants: Variants = {\n  normal: { transform: 'scaleX(1)' },\n  animate: {\n    transform: ['scaleX(1)', 'scaleX(1.04)', 'scaleX(0.98)', 'scaleX(1)'],\n    transition: { duration: 0.6, delay: 0.08, times: [0, 0.34, 0.7, 1], ease: [0.23, 1, 0.32, 1] },\n  },\n};\n\nconst appleVariants: Variants = {\n  normal: { transform: 'translateY(0px) rotate(0deg)' },\n  animate: {\n    transform: [\n      'translateY(0px) rotate(0deg)',\n      'translateY(-1.1px) rotate(-8deg)',\n      'translateY(0.2px) rotate(2deg)',\n      'translateY(0px) rotate(0deg)',\n    ],\n    transition: { duration: 0.6, times: [0, 0.36, 0.7, 1], ease: [0.23, 1, 0.32, 1] },\n  },\n};\n\nconst slitRightVariants: Variants = {\n  normal: { transform: 'scaleY(1)', opacity: 1 },\n  animate: {\n    transform: ['scaleY(1)', 'scaleY(1.6)', 'scaleY(1)'],\n    opacity: [1, 0.45, 1],\n    transition: { duration: 0.5, delay: 0.12, times: [0, 0.4, 1], ease: [0.23, 1, 0.32, 1] },\n  },\n};\n\nconst slitLeftVariants: Variants = {\n  normal: { transform: 'scaleY(1)', opacity: 1 },\n  animate: {\n    transform: ['scaleY(1)', 'scaleY(1.6)', 'scaleY(1)'],\n    opacity: [1, 0.45, 1],\n    transition: { duration: 0.5, delay: 0.18, times: [0, 0.4, 1], ease: [0.23, 1, 0.32, 1] },\n  },\n};\n\nconst dishVariants: Variants = {\n  normal: { transform: 'scaleY(1)' },\n  animate: {\n    transform: ['scaleY(1)', 'scaleY(0.92)', 'scaleY(1.03)', 'scaleY(1)'],\n    transition: { duration: 0.56, delay: 0.1, times: [0, 0.32, 0.68, 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=\"M16.5 7C18.6111 8.09821 20.1802 9.94542 20.7578 12.1376C21.5 12.1376 22 13.1645 22 14.0106C22 16.3424 18.5658 16.7405 18 14.5165C17.4968 16.4945 14.5032 16.4945 14 14.5165C13.4968 16.4945 10.5032 16.4945 10 14.5165C9.49677 16.4945 6.50323 16.4945 6 14.5165C5.43417 16.7405 2 16.3424 2 14.0106C2 13.1645 2.5 12.1376 3.24224 12.1376C3.81984 9.94542 5.38887 8.09821 7.5 7\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"crustVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 11.9px' }\" />\n            <motion.path d=\"M12 4C13.1046 4 14 4.89543 14 6C14 7.10457 13.1046 8 12 8C10.8954 8 10 7.10457 10 6C10 4.89543 10.8954 4 12 4ZM12 4C12 3.5 12.4 2.4 14 2\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"appleVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 5px' }\" />\n            <motion.path d=\"M14.5 10.5L15 11.5\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"slitRightVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '14.8px 11px' }\" />\n            <motion.path d=\"M9.5 10.5L9 11.5\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"slitLeftVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '9.3px 11px' }\" />\n            <motion.path d=\"M3.5 16L4.13246 17.8974C4.79247 19.8774 5.12248 20.8675 5.90815 21.4337C6.69381 22 7.73739 22 9.82456 22H14.1754C16.2626 22 17.3062 22 18.0919 21.4337C18.8775 20.8675 19.2075 19.8774 19.8675 17.8974L20.5 16\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"dishVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 19px' }\" />\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"
    }
  ]
}
