{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "sign-language-c",
  "type": "registry:ui",
  "title": "sign-language-c",
  "description": "Animated sign language c icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/sign-language-c.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: 'SignLanguageCIcon' })\n\nwithDefaults(\n  defineProps<{\n    size?: number\n  }>(),\n  { size: 28 },\n)\n\n// after edit-02: the open stroke of the sign language c writes along the direction of its path\n// generated from @hugeicons/core-free-icons\nconst nibVariants: Variants = {\n  normal: {\n    transform: 'rotate(0deg) translate(0px, 0px)',\n  },\n  animate: {\n    transform: ['rotate(0deg) translate(0px, 0px)', 'rotate(-8.62deg) translate(-0.43px, 0.65px)', 'rotate(4.31deg) translate(0.32px, -0.32px)', 'rotate(0deg) translate(0px, 0px)'],\n    transition: {\n      duration: 0.58,\n      ease: [0.23, 1, 0.32, 1],\n    },\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=\"M4 21V14.3936C4 11.7663 4 10.4526 4.35874 9.30431C4.86959 7.66915 6.67366 5.92189 8.07257 4.90417C8.96802 4.25272 9.81367 3.99439 11.8656 3.29139C12.193 3.17921 12.3568 3.12312 12.653 3.06783C12.9492 3.01253 13.0208 3.00972 13.164 3.00409C13.5303 2.98969 13.981 3.00996 14.4588 3.11939C14.802 3.19799 15.1425 3.32672 15.8236 3.58417L17.7348 4.36953C18.4651 4.66967 18.8346 5.48739 18.5771 6.23385C18.3041 7.02521 17.433 7.43653 16.6485 7.14453M10.1089 8C10.1089 8 12.7243 6.70713 13.7702 6.57906C14.3505 6.508 15.0351 6.64817 15.7358 6.8626L16.6485 7.14453M12 21C12.3639 19.5 14.1801 18.7963 14.1801 18.7963C15 18.5 16.2035 17.9258 16.7268 17.5L19.5607 15.6506C20.1896 15.1388 19.8804 14.3849 19.3133 14.0088C17.4785 12.7921 15.719 13.853 14.0259 14.6951C12.5527 15.4278 10.6179 14.3622 10.6179 12.7238C10.6179 10.4887 14.1046 9.45724 15.8849 10.1656L18.0793 10.8095C18.8889 11.0471 19.7378 10.5779 19.9513 9.77491C20.1441 9.04982 19.7492 8.29863 19.0358 8.03307L16.6485 7.14453\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"nibVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12.09px 11.99px' }\" />\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"
    }
  ]
}
