{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "accessibility",
  "type": "registry:ui",
  "title": "accessibility",
  "description": "Animated accessibility icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/accessibility.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: 'AccessibilityIcon' })\n\nwithDefaults(\n  defineProps<{\n    size?: number\n  }>(),\n  { size: 28 },\n)\n\n// the wheel completes a full turn under the rider, who leans into the push\n// authored from scripts/authored\nconst wheelVariants: Variants = {\n  normal: { transform: 'rotate(0deg)' },\n  animate: {\n    transform: ['rotate(0deg)', 'rotate(360deg)'],\n    transition: { duration: 0.92, ease: [0.77, 0, 0.175, 1] },\n  },\n};\n\nconst riderVariants: Variants = {\n  normal: { transform: 'translateX(0px)' },\n  animate: {\n    transform: ['translateX(0px)', 'translateX(0.7px)', 'translateX(0px)'],\n    transition: { duration: 0.8, times: [0, 0.42, 1], ease: [0.23, 1, 0.32, 1] },\n  },\n};\n\nconst headVariants: Variants = {\n  normal: { transform: 'translateX(0px) translateY(0px)' },\n  animate: {\n    transform: [\n      'translateX(0px) translateY(0px)',\n      'translateX(0.5px) translateY(-0.4px)',\n      'translateX(0px) translateY(0px)',\n    ],\n    transition: { duration: 0.8, delay: 0.04, times: [0, 0.42, 1], ease: [0.23, 1, 0.32, 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=\"M13.0216 17.5C13.0216 19.7091 11.2307 21.5 9.02158 21.5C6.81244 21.5 5.02158 19.7091 5.02158 17.5C5.02158 15.2909 6.81244 13.5 9.02158 13.5\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"wheelVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '9px 17.5px' }\" />\n            <motion.path d=\"M9.02158 10.5L9.46879 9.60557C9.73775 9.06766 9.87223 8.7987 10.1139 8.64935C10.3555 8.5 10.6562 8.5 11.2576 8.5H14.2855C15.7359 8.5 16.4611 8.5 16.7542 8.97427C17.0473 9.44854 16.723 10.0972 16.0744 11.3944L14.5216 14.5M14.5216 14.5H16.5216C17.8784 14.5 18.5568 14.5 18.8536 14.9453C19.1505 15.3906 18.8896 16.0168 18.3677 17.2692L17.0216 20.5M14.5216 14.5C13.2222 14.5 12.5726 14.5 12.2726 14.0974C12.2455 14.0609 12.2208 14.0227 12.1989 13.9829C11.9565 13.5432 12.2253 12.9518 12.763 11.7689L14.0216 9\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"riderVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '9px 17.5px' }\" />\n            <motion.path d=\"M17.0216 5.5C17.85 5.5 18.5216 4.82843 18.5216 4C18.5216 3.17157 17.85 2.5 17.0216 2.5C16.1931 2.5 15.5216 3.17157 15.5216 4C15.5216 4.82843 16.1931 5.5 17.0216 5.5Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"headVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '17px 4px' }\" />\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"
    }
  ]
}
