{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "ai-smartwatch",
  "type": "registry:ui",
  "title": "ai-smartwatch",
  "description": "Animated ai smartwatch icon for Vue",
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "components/ui/ai-smartwatch.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: 'AiSmartwatchIcon' })\n\nwithDefaults(\n  defineProps<{\n    size?: number\n  }>(),\n  { size: 28 },\n)\n\n// the case takes a double beat and the three leads fire out to the right\n// authored from scripts/authored\nconst caseVariants: Variants = {\n  normal: { transform: 'scale(1)' },\n  animate: {\n    transform: ['scale(1)', 'scale(1.05)', 'scale(1)', 'scale(1.03)', 'scale(1)'],\n    transition: { duration: 0.78, times: [0, 0.18, 0.36, 0.54, 1], ease: [0.23, 1, 0.32, 1] },\n  },\n};\n\nconst leadTopVariants: Variants = {\n  normal: { transform: 'scale(1)', opacity: 1 },\n  animate: {\n    transform: ['scale(1)', 'scale(0.42)', 'scale(1.06)', 'scale(1)'],\n    opacity: [1, 0.4, 1, 1],\n    transition: { duration: 0.48, delay: 0.14, times: [0, 0.3, 0.68, 1], ease: [0.23, 1, 0.32, 1] },\n  },\n};\n\nconst leadBottomVariants: Variants = {\n  normal: { transform: 'scale(1)', opacity: 1 },\n  animate: {\n    transform: ['scale(1)', 'scale(0.42)', 'scale(1.06)', 'scale(1)'],\n    opacity: [1, 0.4, 1, 1],\n    transition: { duration: 0.48, delay: 0.21, times: [0, 0.3, 0.68, 1], ease: [0.23, 1, 0.32, 1] },\n  },\n};\n\nconst leadMiddleVariants: Variants = {\n  normal: { transform: 'scaleX(1)', opacity: 1 },\n  animate: {\n    transform: ['scaleX(1)', 'scaleX(0.42)', 'scaleX(1.06)', 'scaleX(1)'],\n    opacity: [1, 0.4, 1, 1],\n    transition: { duration: 0.48, delay: 0.07, times: [0, 0.3, 0.68, 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=\"M14.1213 17.1213C13.2426 18 11.8284 18 9 18C6.17157 18 4.75736 18 3.87868 17.1213C3 16.2426 3 14.8284 3 12C3 9.17157 3 7.75736 3.87868 6.87868C4.75736 6 6.17157 6 9 6C11.8284 6 13.2426 6 14.1213 6.87868\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\" :variants=\"caseVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '8.6px 12px' }\" />\n            <motion.path d=\"M20.25 6.75L18 9L16 9M19.5 6.75C19.5 7.16421 19.8358 7.5 20.25 7.5C20.6642 7.5 21 7.16421 21 6.75C21 6.33579 20.6642 6 20.25 6C19.8358 6 19.5 6.33579 19.5 6.75Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"leadTopVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '16px 9px' }\" />\n            <motion.path d=\"M20.25 17.25L18 15L16 15M19.5 17.25C19.5 16.8358 19.8358 16.5 20.25 16.5C20.6642 16.5 21 16.8358 21 17.25C21 17.6642 20.6642 18 20.25 18C19.8358 18 19.5 17.6642 19.5 17.25Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"leadBottomVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '16px 15px' }\" />\n            <motion.path d=\"M20.25 12L12 12M19.5 12C19.5 12.4142 19.8358 12.75 20.25 12.75C20.6642 12.75 21 12.4142 21 12C21 11.5858 20.6642 11.25 20.25 11.25C19.8358 11.25 19.5 11.5858 19.5 12Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" :variants=\"leadMiddleVariants\" :animate=\"controls\" initial=\"normal\" :style=\"{ transformOrigin: '12px 12px' }\" />\n            <path d=\"M13 6L12.7276 4.91043C12.3931 3.5724 12.2258 2.90339 11.7499 2.49004C11.6973 2.44433 11.6423 2.40141 11.5852 2.36145C11.0688 2 10.3792 2 9 2C7.6208 2 6.93119 2 6.41476 2.36145C6.35765 2.40141 6.30268 2.44433 6.25006 2.49004C5.77415 2.90339 5.6069 3.5724 5.27239 4.91043L5 6\" stroke=\"currentColor\" stroke-width=\"1.5\" />\n            <path d=\"M5 18L5.27239 19.0896C5.6069 20.4276 5.77415 21.0966 6.25006 21.51C6.30268 21.5557 6.35765 21.5986 6.41476 21.6386C6.93119 22 7.6208 22 9 22C10.3792 22 11.0688 22 11.5852 21.6386C11.6423 21.5986 11.6973 21.5557 11.7499 21.51C12.2258 21.0966 12.3931 20.4276 12.7276 19.0896L13 18\" stroke=\"currentColor\" stroke-width=\"1.5\" />\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"
    }
  ]
}
