{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "alphabet-chinese",
  "type": "registry:ui",
  "title": "alphabet-chinese",
  "description": "Animated alphabet chinese icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/alphabet-chinese.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: 'AlphabetChineseIcon' })\n\nwithDefaults(\n  defineProps<{\n    size?: number\n  }>(),\n  { size: 28 },\n)\n\n// the character builds top to bottom: crown, then vertical, then the cross-stroke\n// authored from scripts/authored\nconst crossVariants: Variants = {\n  normal: { pathLength: 1, pathOffset: 0, visibility: 'visible' },\n  animate: {\n    pathLength: [1, 1, 0.12, 0, 0, 0.12, 1, 1],\n    pathOffset: [0, 0, 0.88, 1, 0, 0, 0, 0],\n    visibility: ['visible', 'visible', 'hidden', 'hidden', 'hidden', 'hidden', 'visible', 'visible'],\n    transition: {\n      duration: 0.7,\n      delay: 0.28,\n      times: [0, 0.06, 0.25, 0.28, 0.35, 0.39, 0.84, 1],\n      ease: [\n        'linear',\n        [0.77, 0, 0.175, 1],\n        'linear',\n        'linear',\n        'linear',\n        [0.77, 0, 0.175, 1],\n        'linear',\n      ],\n    },\n  },\n};\n\nconst verticalVariants: Variants = {\n  normal: { transform: 'scaleY(1)' },\n  animate: {\n    transform: ['scaleY(1)', 'scaleY(0.15)', 'scaleY(1.08)', 'scaleY(1)'],\n    transition: { duration: 0.56, delay: 0.14, times: [0, 0.16, 0.6, 1], ease: [0.23, 1, 0.32, 1] },\n  },\n};\n\nconst crownVariants: Variants = {\n  normal: { pathLength: 1, pathOffset: 0, visibility: 'visible' },\n  animate: {\n    pathLength: [1, 1, 0.12, 0, 0, 0.12, 1, 1],\n    pathOffset: [0, 0, 0.88, 1, 0, 0, 0, 0],\n    visibility: ['visible', 'visible', 'hidden', 'hidden', 'hidden', 'hidden', 'visible', 'visible'],\n    transition: {\n      duration: 0.7,\n      times: [0, 0.06, 0.25, 0.28, 0.35, 0.39, 0.84, 1],\n      ease: [\n        'linear',\n        [0.77, 0, 0.175, 1],\n        'linear',\n        'linear',\n        'linear',\n        [0.77, 0, 0.175, 1],\n        'linear',\n      ],\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=\"M7.02344 14H18.0234\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"crossVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 12px' }\" />\n            <motion.path d=\"M8.52344 9H14.7587C15.2218 9 15.4533 9 15.5109 9.1605C15.6967 9.67818 13.7549 11.4137 13.4567 11.7577C12.9682 12.3213 12.724 12.6031 12.5954 12.9615C12.4667 13.3198 12.4667 13.7184 12.4667 14.5154V18.075C12.4667 19.7377 11.5142 21 9.93177 21\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"verticalVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12.5px 9px' }\" />\n            <motion.path d=\"M5.0157 7.99997C4.9404 7.25983 5.06511 5.86347 7.00907 5.99998H17.4743C18.1117 6.03692 19.1963 6.46024 18.9693 7.99997M10.9958 3C11.5968 3.31337 12.67 4.51459 12.9892 6\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"crownVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 12px' }\" />\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"
    }
  ]
}
