{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "database-backup",
  "type": "registry:ui",
  "title": "database-backup",
  "description": "Animated database backup icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/database-backup.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: 'DatabaseBackupIcon' })\n\nwithDefaults(\n  defineProps<{\n    size?: number\n  }>(),\n  { size: 28 },\n)\n\n// after database: a read head scans each platter from top to bottom\n// generated from @hugeicons/core-free-icons\nconst rowVariants: Variants = {\n  normal: {\n    transform: 'scaleX(1)',\n  },\n  animate: (i: number) => ({\n    transform: ['scaleX(1)', 'scaleX(0.68)', 'scaleX(1.04)', 'scaleX(0.98)', 'scaleX(1)'],\n    transition: { duration: 0.44, ease: [0.77, 0, 0.175, 1], times: [0, 0.28, 0.56, 0.76, 1], delay: i * 0.06 },\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.ellipse cx=\"10\" cy=\"5.00195\" rx=\"8\" ry=\"3\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"rowVariants\" :custom=\"0\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '2px 5px' }\" />\n            <motion.path d=\"M2 12.002C2 13.3998 4.54955 14.5744 8 14.9074\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"rowVariants\" :custom=\"1\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '8px 13.45px' }\" />\n            <motion.path d=\"M12.5 16.002C13 15.002 14 13.502 16 13.502C18.2091 13.502 20 15.2928 20 17.502C20 19.7111 18.2091 21.502 16 21.502C14.8053 21.502 13.7329 20.9782 13 20.1478\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"rowVariants\" :custom=\"4\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12.5px 17.5px' }\" />\n            <motion.path d=\"M10 22.002C5.58172 22.002 2 20.6588 2 19.002V5.00195M18 5.00195V10.002\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"rowVariants\" :custom=\"2\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '2px 13.5px' }\" />\n            <motion.path d=\"M15.0904 17.1196C15.5016 17.0697 15.7944 16.6959 15.7445 16.2847C15.6946 15.8735 15.3208 15.5806 14.9096 15.6305L15 16.375L15.0904 17.1196ZM12.1936 16.3083L11.6633 16.8387H11.6633L12.1936 16.3083ZM12.9351 13.1145C12.9973 12.7049 12.7156 12.3226 12.3061 12.2604C11.8966 12.1983 11.5142 12.4799 11.4521 12.8894L12.1936 13.002L12.9351 13.1145ZM15 16.375L14.9096 15.6305C14.4965 15.6806 13.9048 15.7406 13.3868 15.7505C13.1255 15.7556 12.908 15.7472 12.7515 15.7256C12.6733 15.7148 12.6303 15.7033 12.6139 15.6977C12.5884 15.689 12.6492 15.7032 12.724 15.778L12.1936 16.3083L11.6633 16.8387C11.8183 16.9937 12.0007 17.0734 12.1297 17.1174C12.2678 17.1645 12.4125 17.193 12.5465 17.2115C12.8147 17.2485 13.1207 17.2559 13.4156 17.2503C14.0098 17.2389 14.6608 17.1717 15.0904 17.1196L15 16.375ZM12.1936 16.3083L12.724 15.778C12.8172 15.8712 12.8169 15.9431 12.7965 15.8608C12.7819 15.8018 12.7672 15.7037 12.7584 15.5616C12.741 15.2799 12.752 14.9182 12.7784 14.5445C12.8044 14.1758 12.8436 13.8171 12.8767 13.5491C12.8932 13.4156 12.908 13.3057 12.9186 13.2297C12.9238 13.1917 12.9281 13.1623 12.931 13.1426C12.9324 13.1328 12.9335 13.1254 12.9342 13.1207C12.9345 13.1183 12.9348 13.1166 12.9349 13.1156C12.935 13.115 12.9351 13.1147 12.9351 13.1145C12.9351 13.1144 12.9351 13.1144 12.9351 13.1144C12.9351 13.1144 12.9351 13.1144 12.9351 13.1144C12.9351 13.1144 12.9351 13.1145 12.1936 13.002C11.4521 12.8894 11.4521 12.8895 11.4521 12.8896C11.4521 12.8896 11.452 12.8897 11.452 12.8898C11.452 12.89 11.452 12.8902 11.4519 12.8905C11.4519 12.891 11.4518 12.8917 11.4516 12.8925C11.4514 12.8942 11.451 12.8966 11.4505 12.8997C11.4496 12.9059 11.4483 12.9147 11.4467 12.926C11.4434 12.9486 11.4387 12.9812 11.4329 13.0226C11.4214 13.1053 11.4055 13.2231 11.388 13.3655C11.353 13.6494 11.3105 14.0356 11.2821 14.439C11.254 14.8375 11.2378 15.2752 11.2613 15.6542C11.2729 15.8426 11.2956 16.0402 11.3406 16.2216C11.3797 16.3796 11.4611 16.6365 11.6633 16.8387L12.1936 16.3083Z\" fill=\"currentColor\" :variants=\"rowVariants\" :custom=\"3\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '15.79px 14.73px' }\" />\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"
    }
  ]
}
