{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "flag-triangle-right",
  "type": "registry:ui",
  "title": "flag-triangle-right",
  "description": "Animated flag triangle right icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/flag-triangle-right.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: 'FlagTriangleRightIcon' })\n\nwithDefaults(\n  defineProps<{\n    size?: number\n  }>(),\n  { size: 28 },\n)\n\n// after bookmark-01: the cloth snaps in a short wind, then hangs\n// generated from @hugeicons/core-free-icons\nconst iconVariants: Variants = {\n  normal: {\n    transform: 'rotate(0deg) translateX(0px)',\n  },\n  animate: {\n    transform: ['rotate(0deg) translateX(0px)', 'rotate(-11.29deg) translateX(1.51px)', 'rotate(4.71deg) translateX(-0.38px)', 'rotate(-1.88deg) translateX(0.19px)', 'rotate(0deg) translateX(0px)'],\n    transition: {\n      duration: 0.66,\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=\"M5 22C5 22.4142 5.33579 22.75 5.75 22.75C6.16421 22.75 6.5 22.4142 6.5 22H5.75H5ZM10.0047 3.12627L10.3338 2.45235V2.45235L10.0047 3.12627ZM14.7407 5.43925L14.4116 6.11317V6.11317L14.7407 5.43925ZM14.8139 10.8056L14.4662 10.141L14.4662 10.141L14.8139 10.8056ZM5.75 15.5484H5V16.7873L6.09772 16.2129L5.75 15.5484ZM6.44448 2.16767L6.84651 2.80082L6.84651 2.80082L6.44448 2.16767ZM10.0047 3.12627L9.67558 3.80019L14.4116 6.11317L14.7407 5.43925L15.0699 4.76532L10.3338 2.45235L10.0047 3.12627ZM14.8139 10.8056L14.4662 10.141L5.40228 14.8838L5.75 15.5484L6.09772 16.2129L15.1616 11.4701L14.8139 10.8056ZM5.75 15.5484H6.5V5.82793H5.75H5V15.5484H5.75ZM14.7407 5.43925L14.4116 6.11317C15.6001 6.69362 16.413 7.09284 16.9407 7.4545C17.4711 7.81802 17.4988 8.0002 17.5 8.08417L18.2499 8.07394L18.9998 8.06371C18.9883 7.22062 18.427 6.65467 17.7887 6.21721C17.1477 5.77789 16.2123 5.32329 15.0699 4.76532L14.7407 5.43925ZM14.8139 10.8056L15.1616 11.4701C16.2885 10.8804 17.211 10.3999 17.8398 9.94292C18.4658 9.48789 19.0113 8.90667 18.9998 8.06371L18.2499 8.07394L17.5 8.08417C17.5011 8.16827 17.4782 8.35134 16.9578 8.72959C16.4402 9.10587 15.6384 9.52764 14.4662 10.141L14.8139 10.8056ZM10.0047 3.12627L10.3338 2.45235C9.40131 1.99692 8.62503 1.61555 7.99431 1.41649C7.35177 1.21369 6.6688 1.13681 6.04244 1.53453L6.44448 2.16767L6.84651 2.80082C6.91463 2.75756 7.05652 2.69345 7.54285 2.84694C8.041 3.00416 8.6976 3.32257 9.67558 3.80019L10.0047 3.12627ZM5.75 5.82793H6.5C6.5 4.73008 6.50195 3.99148 6.57887 3.46722C6.65431 2.95303 6.77555 2.84587 6.84651 2.80082L6.44448 2.16767L6.04244 1.53453C5.41893 1.93045 5.19293 2.58033 5.09475 3.24947C4.99805 3.90855 5 4.77959 5 5.82793H5.75ZM5.75 22H6.5V9H5.75H5V22H5.75Z\" fill=\"currentColor\" :variants=\"iconVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 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"
    }
  ]
}
