{
  "$schema": "https://shadcn-vue.com/schema/registry-item.json",
  "name": "queue-list",
  "type": "registry:component",
  "title": "queue-list",
  "description": "Animated queue-list icon for Vue",
  "author": "Aniket Pawar <pawaraniket508@gmail.com>",
  "registryDependencies": [],
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "src/icons/queue-list.vue",
      "type": "registry:component",
      "target": "~/src/components/heroicons-animated/queue-list.vue",
      "content": "<template>\n  <div\n    :class=\"props.class\"\n    @mouseenter=\"handleMouseEnter\"\n    @mouseleave=\"handleMouseLeave\"\n    v-bind=\"$attrs\"\n  >\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      :width=\"props.size\"\n      :height=\"props.size\"\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      :stroke=\"props.color\"\n      :stroke-width=\"props.strokeWidth\"\n      stroke-linecap=\"round\"\n      stroke-linejoin=\"round\"\n    >\n      <path\n        d=\"M5.625 4.5H18.375C19.4105 4.5 20.25 5.33947 20.25 6.375C20.25 7.41053 19.4105 8.25 18.375 8.25H5.625C4.58947 8.25 3.75 7.41053 3.75 6.375C3.75 5.33947 4.58947 4.5 5.625 4.5Z\"\n      />\n      <path ref=\"item0Ref\" d=\"M3.75 19.5H20.25\" />\n      <path ref=\"item1Ref\" d=\"M3.75 15.75H20.25\" />\n      <path ref=\"item2Ref\" d=\"M3.75 12H20.25\" />\n    </svg>\n  </div>\n</template>\n\n<script lang=\"ts\">\n  export default {\n    name: \"QueueListIcon\",\n  };\n</script>\n\n<script setup lang=\"ts\">\n  import { useMotion } from \"../motion\";\n  import { ref } from \"vue\";\n\n  export interface Props {\n    size?: number;\n    class?: string;\n    color?: string;\n    strokeWidth?: number | string;\n  }\n\n  const props = withDefaults(defineProps<Props>(), {\n    size: 28,\n    color: \"currentColor\",\n    strokeWidth: 1.5,\n  });\n\n  const ITEM_DURATION = 0.2;\n  const INITIAL_DELAY = 0.1;\n  const STAGGER_DELAY = 0.15;\n\n  const LIST_ITEMS = [\n    { y: 19.5, path: \"M3.75 19.5H20.25\" },\n    { y: 15.75, path: \"M3.75 15.75H20.25\" },\n    { y: 12, path: \"M3.75 12H20.25\" },\n  ];\n\n  const createItemVariants = (delay: number) => ({\n    normal: {\n      opacity: 1,\n    },\n    animate: {\n      opacity: [0, 1],\n      transition: {\n        duration: ITEM_DURATION,\n        ease: \"easeOut\",\n        delay,\n      },\n    },\n  });\n\n  const item0Delay =\n    INITIAL_DELAY + (LIST_ITEMS.length - 1 - 0) * STAGGER_DELAY;\n  const item1Delay =\n    INITIAL_DELAY + (LIST_ITEMS.length - 1 - 1) * STAGGER_DELAY;\n  const item2Delay =\n    INITIAL_DELAY + (LIST_ITEMS.length - 1 - 2) * STAGGER_DELAY;\n\n  const item0Variants = createItemVariants(item0Delay);\n  const item1Variants = createItemVariants(item1Delay);\n  const item2Variants = createItemVariants(item2Delay);\n\n  const item0Ref = ref<SVGPathElement | null>(null);\n  const item1Ref = ref<SVGPathElement | null>(null);\n  const item2Ref = ref<SVGPathElement | null>(null);\n\n  const item0Motion = useMotion(item0Ref, {\n    initial: item0Variants.normal,\n    enter: item0Variants.normal,\n  });\n  const item1Motion = useMotion(item1Ref, {\n    initial: item1Variants.normal,\n    enter: item1Variants.normal,\n  });\n  const item2Motion = useMotion(item2Ref, {\n    initial: item2Variants.normal,\n    enter: item2Variants.normal,\n  });\n\n  let isControlled = false;\n\n  const startAnimation = () => {\n    item0Motion.apply(item0Variants.animate);\n    item1Motion.apply(item1Variants.animate);\n    item2Motion.apply(item2Variants.animate);\n  };\n\n  const stopAnimation = () => {\n    item0Motion.apply(item0Variants.normal);\n    item1Motion.apply(item1Variants.normal);\n    item2Motion.apply(item2Variants.normal);\n  };\n\n  const handleMouseEnter = () => {\n    if (!isControlled) {\n      startAnimation();\n    }\n  };\n\n  const handleMouseLeave = () => {\n    if (!isControlled) {\n      stopAnimation();\n    }\n  };\n\n  const setControlled = (value: boolean) => {\n    isControlled = value;\n  };\n\n  defineExpose({\n    startAnimation,\n    stopAnimation,\n    setControlled,\n  });\n</script>\n"
    },
    {
      "path": "src/motion.ts",
      "type": "registry:component",
      "target": "~/src/components/motion.ts",
      "content": "import { animate } from \"motion-v\";\nimport { isRef, watch, type Ref } from \"vue\";\n\ntype MotionElement = Element | SVGElement;\ntype MotionTarget =\n  | MotionElement\n  | Ref<MotionElement | null | undefined>\n  | null\n  | undefined;\n\ntype MotionTransition = Record<string, unknown>;\ntype MotionValues = Record<string, unknown>;\n\nexport interface MotionVariant extends MotionValues {\n  transition?: MotionTransition;\n}\n\nexport interface UseMotionOptions {\n  initial?: MotionVariant;\n  enter?: MotionVariant;\n}\n\ninterface MotionControls {\n  stop?: () => void;\n}\n\nexport interface MotionInstance {\n  apply: (variant: MotionVariant) => void;\n  stop: () => void;\n}\n\nconst isDomElement = (value: unknown): value is MotionElement => {\n  if (typeof window === \"undefined\") {\n    return false;\n  }\n  return value instanceof Element;\n};\n\nconst resolveElement = (target: MotionTarget): MotionElement | null => {\n  const element = isRef(target) ? target.value : target;\n  if (!element) {\n    return null;\n  }\n  return isDomElement(element) ? element : null;\n};\n\nconst takeTransformOrigin = (value: unknown): string | null => {\n  if (typeof value === \"string\") {\n    return value;\n  }\n  if (Array.isArray(value) && value.length > 0) {\n    // biome-ignore lint/style/useAtIndex: ES2020 lib target for package type-check does not include Array.prototype.at.\n    const lastValue = value[value.length - 1];\n    if (typeof lastValue === \"string\") {\n      return lastValue;\n    }\n  }\n  return null;\n};\n\nconst extractAnimatableValues = (\n  element: MotionElement,\n  values: MotionValues\n): MotionValues => {\n  const animatableValues: MotionValues = { ...values };\n  const transformOrigin = takeTransformOrigin(values.transformOrigin);\n\n  if (transformOrigin && \"style\" in element) {\n    element.style.transformOrigin = transformOrigin;\n    animatableValues.transformOrigin = undefined;\n  }\n\n  return animatableValues;\n};\n\nconst runAnimation = (\n  element: MotionElement,\n  controlsRef: { current: MotionControls | null },\n  variant: MotionVariant,\n  instant = false\n): void => {\n  if (typeof window === \"undefined\") {\n    return;\n  }\n\n  const { transition, ...values } = variant;\n  const animatableValues = extractAnimatableValues(element, values);\n\n  if (Object.keys(animatableValues).length === 0) {\n    return;\n  }\n\n  controlsRef.current?.stop?.();\n\n  const animationOptions = instant\n    ? ({ duration: 0 } as MotionTransition)\n    : (transition ?? {});\n\n  controlsRef.current = animate(\n    element,\n    animatableValues as Record<string, unknown>,\n    animationOptions\n  ) as MotionControls;\n};\n\nexport const useMotion = (\n  target: MotionTarget,\n  options: UseMotionOptions = {}\n): MotionInstance => {\n  const controlsRef: { current: MotionControls | null } = { current: null };\n\n  const initialize = (element: MotionElement): void => {\n    if (options.initial) {\n      runAnimation(element, controlsRef, options.initial, true);\n      return;\n    }\n    if (options.enter) {\n      runAnimation(element, controlsRef, options.enter, true);\n    }\n  };\n\n  const resolvedAtSetup = resolveElement(target);\n  if (resolvedAtSetup) {\n    initialize(resolvedAtSetup);\n  }\n\n  if (isRef(target)) {\n    watch(\n      () => target.value,\n      (element) => {\n        if (isDomElement(element)) {\n          initialize(element);\n        }\n      },\n      { immediate: true }\n    );\n  }\n\n  const apply = (variant: MotionVariant): void => {\n    if (typeof window === \"undefined\") {\n      return;\n    }\n    const element = resolveElement(target);\n    if (!element) {\n      return;\n    }\n    runAnimation(element, controlsRef, variant);\n  };\n\n  return {\n    apply,\n    stop: () => {\n      controlsRef.current?.stop?.();\n    },\n  };\n};\n"
    }
  ]
}