{
  "$schema": "https://shadcn-vue.com/schema/registry-item.json",
  "name": "building-office-2",
  "type": "registry:component",
  "title": "building-office-2",
  "description": "Animated building-office-2 icon for Vue",
  "author": "Aniket Pawar <pawaraniket508@gmail.com>",
  "registryDependencies": [],
  "dependencies": [
    "motion-v"
  ],
  "files": [
    {
      "path": "src/icons/building-office-2.vue",
      "type": "registry:component",
      "target": "~/src/components/heroicons-animated/building-office-2.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=\"M2.25 21h19.5m-18-18v18m10.5-18v18m6-13.5V21M6.75 21v-3.375c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21M3 3h12m-.75 4.5H21\"\n      />\n      <path ref=\"window1Ref\" d=\"M6.75 12.75h.75\" />\n      <path ref=\"window2Ref\" d=\"M6.75 9.75h.75\" />\n      <path ref=\"window3Ref\" d=\"M6.75 6.75h.75\" />\n      <path ref=\"window4Ref\" d=\"M10.5 12.75h.75\" />\n      <path ref=\"window5Ref\" d=\"M10.5 9.75h.75\" />\n      <path ref=\"window6Ref\" d=\"M10.5 6.75h.75\" />\n      <path ref=\"window7Ref\" d=\"M17.25 17h.008v.008h-.008v-.008Z\" />\n      <path ref=\"window8Ref\" d=\"M17.25 14h.008v.008h-.008v-.008Z\" />\n      <path ref=\"window9Ref\" d=\"M17.25 11h.008v.008h-.008v-.008Z\" />\n    </svg>\n  </div>\n</template>\n\n<script lang=\"ts\">\n  export default {\n    name: \"BuildingOffice2Icon\",\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 createWindowVariants = (custom: number) => ({\n    normal: {\n      opacity: 1,\n    },\n    animate: {\n      opacity: [0, 1],\n      transition: {\n        duration: 0.3,\n        ease: \"linear\",\n        delay: 0.1 + custom * 0.15,\n      },\n    },\n  });\n\n  const window0Variants = createWindowVariants(0);\n  const window1Variants = createWindowVariants(1);\n  const window2Variants = createWindowVariants(2);\n\n  const window1Ref = ref<SVGPathElement | null>(null);\n  const window2Ref = ref<SVGPathElement | null>(null);\n  const window3Ref = ref<SVGPathElement | null>(null);\n  const window4Ref = ref<SVGPathElement | null>(null);\n  const window5Ref = ref<SVGPathElement | null>(null);\n  const window6Ref = ref<SVGPathElement | null>(null);\n  const window7Ref = ref<SVGPathElement | null>(null);\n  const window8Ref = ref<SVGPathElement | null>(null);\n  const window9Ref = ref<SVGPathElement | null>(null);\n  const windowRefs = [\n    window1Ref,\n    window2Ref,\n    window3Ref,\n    window4Ref,\n    window5Ref,\n    window6Ref,\n    window7Ref,\n    window8Ref,\n    window9Ref,\n  ] as const;\n  const windowVariants = [\n    window0Variants,\n    window1Variants,\n    window2Variants,\n    window0Variants,\n    window1Variants,\n    window2Variants,\n    window0Variants,\n    window1Variants,\n    window2Variants,\n  ] as const;\n  const windowMotions = windowRefs.map((windowRef, index) =>\n    useMotion(windowRef, {\n      initial: windowVariants[index].normal,\n      enter: windowVariants[index].normal,\n    })\n  );\n\n  let isControlled = false;\n\n  const startAnimation = () => {\n    let index = 0;\n    for (const windowMotion of windowMotions) {\n      windowMotion.apply(windowVariants[index].animate);\n      index += 1;\n    }\n  };\n\n  const stopAnimation = () => {\n    let index = 0;\n    for (const windowMotion of windowMotions) {\n      windowMotion.apply(windowVariants[index].normal);\n      index += 1;\n    }\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"
    }
  ]
}