{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "archive-02",
  "type": "registry:ui",
  "title": "archive-02",
  "description": "Animated archive icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/archive-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: 'Archive02Icon' })\n\nwithDefaults(\n  defineProps<{\n    size?: number\n  }>(),\n  { size: 28 },\n)\n\n// A document with text slides through the bottom drawer's top seam.\nconst ARCHIVE_DOCUMENT =\n  'M6.9 11V4.5C6.9 3.9 7.4 3.4 8 3.4H16C16.6 3.4 17.1 3.9 17.1 4.5V11Z';\n\nconst ARCHIVE_DURATION = 0.94;\n\nconst ARCHIVE_TIMES = [\n  0, 0.05, 0.1, 0.16, 0.23, 0.31, 0.4, 0.5, 0.58, 0.65, 0.71,\n  0.76, 0.8, 0.84, 0.88, 0.93, 0.97, 1,\n];\n\nconst archiveDrawerVariants: Variants = {\n  normal: {\n    transform: 'translateY(0px)',\n    transition: { duration: 0.18, ease: [0.23, 1, 0.32, 1] },\n  },\n  animate: {\n    transform: [\n      'translateY(0px)',\n      'translateY(0.25px)',\n      'translateY(0.9px)',\n      'translateY(1.85px)',\n      'translateY(2.65px)',\n      'translateY(2.38px)',\n      'translateY(2.5px)',\n      'translateY(2.5px)',\n      'translateY(2.5px)',\n      'translateY(2.5px)',\n      'translateY(2.5px)',\n      'translateY(2.5px)',\n      'translateY(2.5px)',\n      'translateY(2.5px)',\n      'translateY(2.5px)',\n      'translateY(1.55px)',\n      'translateY(0.45px)',\n      'translateY(0px)',\n    ],\n    transition: {\n      duration: ARCHIVE_DURATION,\n      ease: [0.77, 0, 0.175, 1],\n      times: ARCHIVE_TIMES,\n    },\n  },\n};\n\nconst archiveDocumentVariants: Variants = {\n  normal: {\n    transform: 'translateY(11.3px)',\n    transition: { duration: 0.14, ease: [0.23, 1, 0.32, 1] },\n  },\n  animate: {\n    transform: [\n      'translateY(11.3px)',\n      'translateY(11.3px)',\n      'translateY(11.3px)',\n      'translateY(10.6px)',\n      'translateY(8.9px)',\n      'translateY(6.2px)',\n      'translateY(3.2px)',\n      'translateY(1.45px)',\n      'translateY(1.15px)',\n      'translateY(1.28px)',\n      'translateY(1.9px)',\n      'translateY(3.4px)',\n      'translateY(6.2px)',\n      'translateY(9.4px)',\n      'translateY(11.3px)',\n      'translateY(11.3px)',\n      'translateY(11.3px)',\n      'translateY(11.3px)',\n    ],\n    transition: {\n      duration: ARCHIVE_DURATION,\n      ease: [0.77, 0, 0.175, 1],\n      times: ARCHIVE_TIMES,\n    },\n  },\n};\nconst generatedGeometryVariants: Variants = {\n  normal: { visibility: 'hidden', transition: { duration: 0 } },\n  animate: { visibility: 'visible', transition: { duration: 0 } },\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            <defs>\n              <clipPath id=\"archive-document-window\" clipPathUnits=\"userSpaceOnUse\">\n                <rect x=\"0\" y=\"0\" width=\"24\" height=\"13.8\" />\n              </clipPath>\n              <mask id=\"archive-back-mask\" x=\"0\" y=\"0\" width=\"24\" height=\"24\" maskUnits=\"userSpaceOnUse\">\n                <rect x=\"0\" y=\"0\" width=\"24\" height=\"24\" fill=\"white\" />\n                <motion.g :variants=\"generatedGeometryVariants\" :animate=\"controls\" initial=\"normal\">\n                  <motion.rect x=\"6.1\" y=\"2.7\" width=\"11.8\" height=\"11.4\" rx=\"0.6\" fill=\"black\" :variants=\"archiveDocumentVariants\" :animate=\"controls\" initial=\"normal\" />\n                </motion.g>\n                <motion.rect x=\"0\" y=\"11\" width=\"24\" height=\"13\" fill=\"black\" :variants=\"archiveDrawerVariants\" :animate=\"controls\" initial=\"normal\" />\n              </mask>\n            </defs>\n            <path d=\"M4 13.5V11C4.00005 9.59977 4.00008 8.89966 4.27263 8.36485C4.5123 7.89455 4.89469 7.51218 5.365 7.27253C5.89981 7 6.59993 7 8.00015 7H16C17.4001 7 18.1002 7 18.635 7.27248C19.1054 7.51217 19.4878 7.89462 19.7275 8.36502C20 8.8998 20 9.59987 20 11V13.5\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" mask=\"url(#archive-back-mask)\" />\n            <g clip-path=\"url(#archive-document-window)\">\n              <motion.g :variants=\"generatedGeometryVariants\" :animate=\"controls\" initial=\"normal\">\n                <motion.g :variants=\"archiveDocumentVariants\" :animate=\"controls\" initial=\"normal\">\n                  <path :d=\"ARCHIVE_DOCUMENT\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" />\n                  <path d=\"M8.8 5.6H15.2M8.8 7.7H14.5M8.8 9.8H13.6\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"0.9\" />\n                </motion.g>\n              </motion.g>\n            </g>\n            <motion.path d=\"M7 21H16.9999C19.3569 21 20.5354 21 21.2677 20.2678C21.9999 19.5355 21.9999 18.357 21.9999 16C21.9999 13.643 21.9999 12.4645 21.2677 11.7322C20.5354 11 19.3569 11 16.9999 11H7C4.64302 11 3.46453 11 2.7323 11.7322C2.00007 12.4644 2.00005 13.6429 2 15.9999C1.99995 18.357 1.99993 19.5355 2.73217 20.2677C3.4644 21 4.64294 21 7 21Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"archiveDrawerVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 16px' }\" />\n            <path d=\"M6 7C6.00004 5.5998 6.00006 4.89969 6.27259 4.3649C6.51227 3.89457 6.89467 3.51218 7.36501 3.27252C7.89981 3 8.59991 3 10.0001 3H14C15.4001 3 16.1002 3 16.635 3.27248C17.1054 3.51217 17.4878 3.89462 17.7275 4.36502C18 4.8998 18 5.59987 18 7\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" />\n            <motion.path d=\"M16 15L15.7 15.4C15.1111 16.1851 14.8167 16.5777 14.3944 16.7889C13.9721 17 13.4814 17 12.5 17H11.5C10.5186 17 10.0279 17 9.60557 16.7889C9.18328 16.5777 8.88885 16.1851 8.3 15.4L8 15\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"archiveDrawerVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 16px' }\" />\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"
    }
  ]
}
