{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "folder-open",
  "type": "registry:ui",
  "title": "folder-open",
  "description": "Animated folder open icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/folder-open.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: 'FolderOpenIcon' })\n\nwithDefaults(\n  defineProps<{\n    size?: number\n  }>(),\n  { size: 28 },\n)\n\n// the front flap hinges toward the viewer, revealing the contents before closing\nconst folderBackVariants: Variants = {\n  normal: { transform: 'translateY(0px)', transition: { type: 'spring', duration: 0.45, bounce: 0 } },\n  animate: {\n    transform: [\n      'translateY(0px)',\n      'translateY(-0.2px)',\n      'translateY(-0.55px)',\n      'translateY(-0.7px)',\n      'translateY(-0.55px)',\n      'translateY(-0.2px)',\n      'translateY(0px)',\n    ],\n    transition: { duration: 0.84, ease: [0.77, 0, 0.175, 1], times: [0, 0.14, 0.34, 0.5, 0.66, 0.86, 1] },\n  },\n};\n\nconst folderFlapVariants: Variants = {\n  normal: {\n    originX: 0.5,\n    originY: 1,\n    transform: 'perspective(70px) translateY(0px) rotateX(0deg) scaleY(1)',\n    transition: { type: 'spring', duration: 0.55, bounce: 0 },\n  },\n  animate: {\n    originX: 0.5,\n    originY: 1,\n    transform: [\n      'perspective(70px) translateY(0px) rotateX(0deg) scaleY(1)',\n      'perspective(70px) translateY(0.25px) rotateX(-10deg) scaleY(0.99)',\n      'perspective(70px) translateY(0.9px) rotateX(-28deg) scaleY(0.94)',\n      'perspective(70px) translateY(1.25px) rotateX(-36deg) scaleY(0.9)',\n      'perspective(70px) translateY(0.9px) rotateX(-28deg) scaleY(0.94)',\n      'perspective(70px) translateY(0.25px) rotateX(-10deg) scaleY(0.99)',\n      'perspective(70px) translateY(0px) rotateX(0deg) scaleY(1)',\n    ],\n    transition: { duration: 0.84, ease: [0.77, 0, 0.175, 1], times: [0, 0.14, 0.34, 0.5, 0.66, 0.86, 1] },\n  },\n};\n\nconst paperRiseVariants: Variants = {\n  normal: { transform: 'translateY(0px)' },\n  animate: {\n    transform: [\n      'translateY(0px)',\n      'translateY(-0.25px)',\n      'translateY(-0.9px)',\n      'translateY(-1.35px)',\n      'translateY(-0.9px)',\n      'translateY(-0.25px)',\n      'translateY(0px)',\n    ],\n    transition: { duration: 0.84, ease: [0.77, 0, 0.175, 1], times: [0, 0.14, 0.34, 0.5, 0.66, 0.86, 1] },\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=\"M2.5 20V8.87695C2.5 7.58945 2.5 6.9457 2.78533 6.47048C2.9541 6.18939 3.18939 5.9541 3.47048 5.78533C3.9457 5.5 4.59449 5.5 5.89206 5.5C6.52339 5.5 6.83906 5.5 7.12612 5.58819C7.31759 5.64702 7.49914 5.73428 7.66469 5.84705C7.91289 6.01611 8.10859 6.26074 8.5 6.75C8.89141 7.23926 9.08711 7.48389 9.33531 7.65295C9.50086 7.76572 9.68241 7.85298 9.87388 7.91181C10.1609 8 10.4742 8 11.1008 8H15C16.4045 8 17.1067 8 17.6111 8.33706C17.8295 8.48298 18.017 8.67048 18.1629 8.88886C18.5 9.39331 18.5 10.0955 18.5 11.5\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"folderBackVariants\" :animate=\"controls\" initial=\"normal\" />\n            <motion.path d=\"M4.42028 14.0144L3.63368 16.0144C2.65618 18.4998 2.16743 19.7425 2.7524 20.6213C3.33737 21.5 4.65337 21.5 7.28537 21.5H15.1903C16.4249 21.5 17.0422 21.5 17.5295 21.1795C18.0169 20.859 18.2702 20.2865 18.7769 19.1415L19.6618 17.1415C20.7866 14.5992 21.349 13.3281 20.7679 12.4141C20.1868 11.5 18.8163 11.5 16.0752 11.5H8.07196C6.78232 11.5 6.1375 11.5 5.63811 11.8439C5.13872 12.1877 4.89924 12.7966 4.42028 14.0144Z\" stroke=\"currentColor\" stroke-width=\"1.5\" :variants=\"folderFlapVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformBox: 'fill-box', transformStyle: 'preserve-3d' }\" />\n            <motion.path d=\"M11.5 4.51456C12.4151 3.28409 13.6662 2.55594 15.5125 2.50161C16.1155 2.48386 16.7152 2.61395 17.2682 2.85544C18.5748 3.42601 19.4185 4.15644 20 5.5L21.5 3\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"paperRiseVariants\" :animate=\"controls\" initial=\"normal\" />\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"
    }
  ]
}
