{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "sent",
  "type": "registry:ui",
  "title": "sent",
  "description": "Animated sent icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/sent.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: 'SentIcon' })\n\nwithDefaults(\n  defineProps<{\n    size?: number\n  }>(),\n  { size: 28 },\n)\n\nconst SENT_PLANE =\n  'M21.0477 3.05293C18.8697 0.707363 2.48648 6.4532 2.50001 8.551C2.51535 10.9299 8.89809 11.6617 10.6672 12.1581C11.7311 12.4565 12.016 12.7625 12.2613 13.8781C13.3723 18.9305 13.9301 21.4435 15.2014 21.4996C17.2278 21.5892 23.1733 5.342 21.0477 3.05293Z';\n\nconst SENT_DURATION = 0.92;\nconst SENT_TIMES = [\n  0, 0.07, 0.14, 0.22, 0.32, 0.43, 0.5, 0.54, 0.62, 0.71, 0.8, 0.88,\n  0.95, 1,\n];\n\n// The first plane pulls back, banks, and accelerates beyond the top-right\n// edge. A second full plane follows the same route from the bottom left.\nconst departingPlaneVariants: Variants = {\n  normal: {\n    transform: 'translate(0%, 0%) rotate(0deg)',\n    transition: { duration: 0.16, ease: [0.23, 1, 0.32, 1] },\n  },\n  animate: {\n    transform: [\n      'translate(0%, 0%) rotate(0deg)',\n      'translate(-3%, 3%) rotate(2.2deg)',\n      'translate(-1%, 1.5%) rotate(1.2deg)',\n      'translate(7%, -5%) rotate(-1deg)',\n      'translate(22%, -16%) rotate(-3.2deg)',\n      'translate(48%, -38%) rotate(-5.5deg)',\n      'translate(82%, -68%) rotate(-5deg)',\n      'translate(118%, -100%) rotate(-3.5deg)',\n      'translate(145%, -125%) rotate(-2deg)',\n      'translate(145%, -125%) rotate(-2deg)',\n      'translate(145%, -125%) rotate(-2deg)',\n      'translate(145%, -125%) rotate(-2deg)',\n      'translate(145%, -125%) rotate(-2deg)',\n      'translate(145%, -125%) rotate(-2deg)',\n    ],\n    transition: {\n      duration: SENT_DURATION,\n      ease: 'linear',\n      times: SENT_TIMES,\n    },\n  },\n};\n\nconst arrivingPlaneVariants: Variants = {\n  normal: {\n    transform: 'translate(-145%, 125%) rotate(-6deg)',\n    transition: { duration: 0.16, ease: [0.23, 1, 0.32, 1] },\n  },\n  animate: {\n    transform: [\n      'translate(-145%, 125%) rotate(-6deg)',\n      'translate(-145%, 125%) rotate(-6deg)',\n      'translate(-145%, 125%) rotate(-6deg)',\n      'translate(-145%, 125%) rotate(-6deg)',\n      'translate(-145%, 125%) rotate(-6deg)',\n      'translate(-145%, 125%) rotate(-6deg)',\n      'translate(-145%, 125%) rotate(-6deg)',\n      'translate(-118%, 102%) rotate(-6deg)',\n      'translate(-82%, 70%) rotate(-5deg)',\n      'translate(-50%, 41%) rotate(-4deg)',\n      'translate(-24%, 19%) rotate(-2.5deg)',\n      'translate(-7%, 4%) rotate(-0.8deg)',\n      'translate(-1%, 1%) rotate(0.8deg)',\n      'translate(0%, 0%) rotate(0deg)',\n    ],\n    transition: {\n      duration: SENT_DURATION,\n      ease: 'linear',\n      times: SENT_TIMES,\n    },\n  },\n};\n\nconst generatedGeometryVariants: Variants = {\n  normal: { visibility: 'hidden', transition: { duration: 0 } },\n  animate: { visibility: 'visible', transition: { duration: 0 } },\n};\n\n// Temporary launch trails grow behind the plane, move back toward the bottom\n// left, and clear before the replacement arrives.\nconst trailVariants: Variants = {\n  normal: { pathLength: 0, pathOffset: 0, visibility: 'hidden' },\n  animate: (i: number) => ({\n    pathLength: [0, 0.25, 1, 0.34, 0, 0],\n    pathOffset: [0, 0, 0, 0.66, 1, 1],\n    visibility: ['hidden', 'visible', 'visible', 'visible', 'hidden', 'hidden'],\n    transition: {\n      duration: 0.38,\n      delay: 0.06 + i * 0.028,\n      ease: 'linear',\n      times: [0, 0.14, 0.34, 0.58, 0.8, 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=\"hidden\">\n            <motion.g :variants=\"generatedGeometryVariants\" :animate=\"controls\" initial=\"normal\">\n              <motion.path d=\"M7.2 14.8L2.2 19.8\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\" :variants=\"trailVariants\" :custom=\"0\" :animate=\"controls\" initial=\"normal\" />\n              <motion.path d=\"M10.2 17.6L6.6 21.2\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\" :variants=\"trailVariants\" :custom=\"1\" :animate=\"controls\" initial=\"normal\" />\n              <motion.path d=\"M5.2 12.6L2 15.8\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\" :variants=\"trailVariants\" :custom=\"2\" :animate=\"controls\" initial=\"normal\" />\n            </motion.g>\n            <motion.g :variants=\"departingPlaneVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 12px' }\">\n              <path :d=\"SENT_PLANE\" stroke=\"currentColor\" stroke-width=\"1.5\" />\n              <path d=\"M11.4999 12.5L14.9999 9\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" />\n            </motion.g>\n            <motion.g :variants=\"generatedGeometryVariants\" :animate=\"controls\" initial=\"normal\">\n              <motion.g :variants=\"arrivingPlaneVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 12px' }\">\n                <path :d=\"SENT_PLANE\" stroke=\"currentColor\" stroke-width=\"1.5\" />\n                <path d=\"M11.4999 12.5L14.9999 9\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" />\n              </motion.g>\n            </motion.g>\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"
    }
  ]
}
