import { chakra } from '@chakra-ui/react'; import { motion } from 'framer-motion'; import type { BoxProps } from '@chakra-ui/react'; import type { CustomDomComponent, Transition, MotionProps } from 'framer-motion'; type MCComponent = Parameters[0]; type MCOptions = Parameters[1]; type MakeMotionProps

= React.PropsWithChildren< Omit & Omit & { transition?: Transition } >; /** * Combine `chakra` and `motion` factories. * * @param component Component or string * @param options `chakra` options * @returns Chakra component with motion props. */ export function motionChakra

( component: MCComponent, options?: MCOptions, ): CustomDomComponent> { // @ts-expect-error I don't know how to fix this. return motion

(chakra(component, options)); } export const AnimatedDiv = motionChakra('div');