{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "eye-off",
  "type": "registry:ui",
  "title": "eye-off",
  "description": "Animated eye off icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/eye-off.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: 'EyeOffIcon' })\n\nwithDefaults(\n  defineProps<{\n    size?: number\n  }>(),\n  { size: 28 },\n)\n\nconst EYE_OFF_LOWER_PATH =\n  'M6.43385 6.51953C4.22009 7.89049 2.93281 9.86457 2.31858 11.0339C2.10621 11.4382 2.00003 11.6403 2 12.0082C1.99997 12.3761 2.10584 12.5777 2.3176 12.981C3.32862 14.9066 6.16702 19.0195 11.9669 19.0195C14.2454 19.0195 16.0669 18.3848 17.5 17.4972';\n\nconst EYE_OFF_PUPIL_PATH =\n  'M9.87868 9.87868C9.33579 10.4216 9 11.1716 9 12C9 13.6569 10.3431 15 12 15C12.8284 15 13.5784 14.6642 14.1213 14.1213';\n\nconst EYE_OFF_UPPER_PATH =\n  'M10 5.14847C10.5934 5.05255 11.224 5 11.8936 5C17.7747 5 20.6528 9.05385 21.6779 10.9517C21.8927 11.3492 22 11.548 22 11.9106C22 12.2733 21.8921 12.4727 21.6765 12.8717C21.3678 13.4428 20.8916 14.2085 20.2167 15';\n\n// These bridges continue directly from the three interrupted source paths.\nconst EYE_UPPER_CONTINUATION =\n  'M6.43385 6.51953C7.518 5.841 8.69 5.36 10 5.14847';\nconst EYE_LOWER_CONTINUATION =\n  'M20.2167 15C19.493 15.972 18.594 16.86 17.5 17.4972';\nconst EYE_PUPIL_CONTINUATION =\n  'M14.1213 14.1213C14.6642 13.5784 15 12.8284 15 12C15 10.3431 13.6569 9 12 9C11.1716 9 10.4216 9.33579 9.87868 9.87868';\n\nconst EYE_OFF_DURATION = 1.18;\nconst EYE_OFF_TIMES = [\n  0, 0.05, 0.1, 0.16, 0.24, 0.34, 0.44, 0.56, 0.68, 0.76, 0.82, 0.87,\n  0.92, 0.97, 1,\n];\n\nfunction createContinuationVariants(pathLength: number[]): Variants {\n  return {\n    normal: {\n      pathLength: 0,\n      transition: { duration: 0.2, ease: [0.23, 1, 0.32, 1] },\n    },\n    animate: {\n      pathLength,\n      transition: {\n        duration: EYE_OFF_DURATION,\n        ease: 'linear',\n        times: EYE_OFF_TIMES,\n      },\n    },\n  };\n}\n\nconst upperContinuationVariants = createContinuationVariants([\n  0, 0, 0, 0.12, 0.62, 1, 1, 1, 1, 1, 0.62, 0.2, 0, 0, 0,\n]);\n\nconst lowerContinuationVariants = createContinuationVariants([\n  0, 0, 0, 0, 0.25, 0.7, 1, 1, 1, 1, 1, 1, 0.8, 0.3, 0,\n]);\n\nconst pupilContinuationVariants = createContinuationVariants([\n  0, 0, 0, 0, 0.4, 0.82, 1, 1, 1, 1, 1, 0.75, 0.25, 0, 0,\n]);\n\n// One complete slash clears the eye toward the bottom right.\nconst departingSlashVariants: Variants = {\n  normal: {\n    transform: 'translate(0px, 0px)',\n    transition: { duration: 0.2, ease: [0.23, 1, 0.32, 1] },\n  },\n  animate: {\n    transform: [\n      'translate(0px, 0px)',\n      'translate(0.8px, 0.8px)',\n      'translate(4px, 4px)',\n      'translate(24px, 24px)',\n      'translate(24px, 24px)',\n      'translate(24px, 24px)',\n      'translate(24px, 24px)',\n      'translate(24px, 24px)',\n      'translate(24px, 24px)',\n      'translate(24px, 24px)',\n      'translate(24px, 24px)',\n      'translate(24px, 24px)',\n      'translate(24px, 24px)',\n      'translate(24px, 24px)',\n      'translate(24px, 24px)',\n    ],\n    transition: {\n      duration: EYE_OFF_DURATION,\n      ease: 'linear',\n      times: EYE_OFF_TIMES,\n    },\n  },\n};\n\n// A second complete slash returns from the top left after the visible-eye hold.\n// The continuations close in the same upper, pupil, lower order it crosses.\nconst arrivingSlashVariants: Variants = {\n  normal: {\n    transform: 'translate(-24px, -24px)',\n    transition: { duration: 0.2, ease: [0.23, 1, 0.32, 1] },\n  },\n  animate: {\n    transform: [\n      'translate(-24px, -24px)',\n      'translate(-24px, -24px)',\n      'translate(-24px, -24px)',\n      'translate(-24px, -24px)',\n      'translate(-24px, -24px)',\n      'translate(-24px, -24px)',\n      'translate(-24px, -24px)',\n      'translate(-24px, -24px)',\n      'translate(-24px, -24px)',\n      'translate(-24px, -24px)',\n      'translate(-18px, -18px)',\n      'translate(-9px, -9px)',\n      'translate(-3px, -3px)',\n      'translate(-0.6px, -0.6px)',\n      'translate(0px, 0px)',\n    ],\n    transition: {\n      duration: EYE_OFF_DURATION,\n      ease: 'linear',\n      times: EYE_OFF_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=\"hidden\">\n            <path :d=\"EYE_OFF_LOWER_PATH\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" />\n            <path :d=\"EYE_OFF_PUPIL_PATH\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\" />\n            <motion.path d=\"M2 2L22 22\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"departingSlashVariants\" :animate=\"controls\" initial=\"normal\" />\n            <path :d=\"EYE_OFF_UPPER_PATH\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" />\n            <motion.g :variants=\"generatedGeometryVariants\" :animate=\"controls\" initial=\"normal\">\n              <motion.path :d=\"EYE_UPPER_CONTINUATION\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\" :variants=\"upperContinuationVariants\" :animate=\"controls\" initial=\"normal\" />\n              <motion.path :d=\"EYE_LOWER_CONTINUATION\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\" :variants=\"lowerContinuationVariants\" :animate=\"controls\" initial=\"normal\" />\n              <motion.path :d=\"EYE_PUPIL_CONTINUATION\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\" :variants=\"pupilContinuationVariants\" :animate=\"controls\" initial=\"normal\" />\n              <motion.path d=\"M2 2L22 22\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"arrivingSlashVariants\" :animate=\"controls\" initial=\"normal\" />\n            </motion.g>\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"
    }
  ]
}
