{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "diamond-02",
  "type": "registry:ui",
  "title": "diamond-02",
  "description": "Animated diamond icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/diamond-02.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: 'Diamond02Icon' })\n\nwithDefaults(\n  defineProps<{\n    size?: number\n  }>(),\n  { size: 28 },\n)\n\n// The gem pops into the light, its center facet flashes, and a large glint\n// catches its upper edge before everything settles cleanly.\nconst svgVariants: Variants = {\n  normal: {\n    translateY: 0,\n    rotate: 0,\n    scale: 1,\n    transition: { type: 'spring', duration: 0.3, bounce: 0 },\n  },\n  animate: {\n    translateY: [0, -1.1, 0.2, -0.35, 0],\n    rotate: [0, -4.5, 2.5, -0.75, 0],\n    scale: [1, 1.15, 0.985, 1.045, 1],\n    transition: {\n      duration: 0.85,\n      ease: 'easeInOut',\n      times: [0, 0.3, 0.5, 0.72, 1],\n    },\n  },\n};\n\nconst facetVariants: Variants = {\n  normal: {\n    visibility: 'visible',\n    scaleX: 1,\n    transition: { duration: 0.18, ease: 'easeOut' },\n  },\n  animate: {\n    visibility: ['visible', 'visible', 'visible', 'visible', 'visible'],\n    scaleX: [1, 0.55, 1.55, 0.82, 1],\n    transition: {\n      duration: 0.72,\n      delay: 0.05,\n      ease: 'easeInOut',\n      times: [0, 0.24, 0.48, 0.72, 1],\n    },\n  },\n};\n\nconst glintVariants: Variants = {\n  normal: {\n    visibility: 'hidden',\n    scale: 0.2,\n    rotate: -18,\n    transition: { duration: 0.16, ease: 'easeOut' },\n  },\n  animate: {\n    visibility: ['hidden', 'visible', 'visible', 'hidden'],\n    scale: [0.2, 1.35, 1.05, 0.45],\n    rotate: [-18, 0, 14, 26],\n    transition: {\n      duration: 0.68,\n      delay: 0.08,\n      ease: 'easeInOut',\n      times: [0, 0.34, 0.62, 1],\n    },\n  },\n};\n\nconst generatedGeometryVariants: Variants = {\n  normal: { visibility: 'hidden', transition: { duration: 0.08 } },\n  animate: { visibility: 'visible', transition: { duration: 0.08 } },\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          <motion.svg xmlns=\"http://www.w3.org/2000/svg\" :width=\"size\" :height=\"size\" viewBox=\"0 0 24 24\" fill=\"none\" overflow=\"visible\" :variants=\"svgVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 12px' }\">\n            <path d=\"M5.78223 4.18192C6.43007 3.68319 6.754 3.43383 7.12788 3.27323C7.29741 3.20041 7.47367 3.14158 7.65459 3.09741C8.0536 3 8.4767 3 9.32289 3H14.6771C15.5233 3 15.9464 3 16.3454 3.09741C16.5263 3.14158 16.7026 3.20041 16.8721 3.27323C17.246 3.43383 17.5699 3.68319 18.2178 4.18192C20.3644 5.83448 21.4378 6.66077 21.8057 7.73078C21.9694 8.20673 22.0305 8.70728 21.9858 9.20461C21.8852 10.3227 21.0379 11.346 19.3433 13.3925L15.3498 18.2153C13.8126 20.0718 13.044 21 12 21C10.956 21 10.1874 20.0718 8.65018 18.2153L4.65671 13.3925C2.96208 11.346 2.11476 10.3227 2.0142 9.20461C1.96947 8.70728 2.03064 8.20673 2.1943 7.73078C2.56224 6.66077 3.63557 5.83448 5.78223 4.18192Z\" stroke=\"currentColor\" stroke-width=\"1.5\" />\n            <motion.path d=\"M10 8.5H14\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"facetVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 8.5px' }\" />\n            <motion.g :variants=\"generatedGeometryVariants\" :animate=\"controls\" initial=\"normal\">\n              <motion.path d=\"M19.1 1.9V6.7M16.7 4.3H21.5\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\" :variants=\"glintVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '19.1px 4.3px' }\" />\n            </motion.g>\n          </motion.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"
    }
  ]
}
