@yamada-ui/react
Version:
React UI components of the Yamada, by the Yamada, for the Yamada built with React and Emotion
1 lines • 1.45 kB
Source Map (JSON)
{"version":3,"file":"motion.cjs","names":["styled","useSystem","motion"],"sources":["../../../../src/components/motion/motion.tsx"],"sourcesContent":["\"use client\"\n\nimport type { Dict } from \"../../utils\"\nimport type { HTMLMotionProps, MotionStyledComponent } from \"./index.types\"\nimport { motion } from \"motion/react\"\nimport { useMemo } from \"react\"\nimport { styled, useSystem } from \"../../core\"\nimport { cx } from \"../../utils\"\n\nconst forwardProps = [\"transition\"]\n\nconst Component = styled<\"div\", Dict>(\"div\", { forwardProps })\n\n/**\n * `Motion` is a component that allows for the easy implementation of a wide variety of animations.\n *\n * @see https://yamada-ui.com/docs/components/motion\n */\nexport const Motion = (({\n ref,\n as: asProp = \"div\",\n className,\n ...rest\n}: HTMLMotionProps) => {\n const system = useSystem()\n const as = useMemo(() => motion.create(asProp), [asProp])\n\n return (\n <Component\n ref={ref}\n as={as}\n className={cx(system.utils.getClassName(\"motion\"), className)}\n {...rest}\n />\n )\n}) as MotionStyledComponent<\"div\">\n"],"mappings":";;;;;;;;;;;;;;;AAWA,MAAM,YAAYA,uBAAoB,OAAO,EAAE,cAF1B,CAAC,aAAa,EAE0B,CAAC;;;;;;AAO9D,MAAa,WAAW,EACtB,KACA,IAAI,SAAS,OACb,UACA,GAAG,WACkB;CACrB,MAAM,SAASC,mCAAW;AAG1B,QACE,2CAAC;EACM;EACL,6BALqBC,oBAAO,OAAO,OAAO,EAAE,CAAC,OAAO,CAAC;EAMrD,qDAAc,OAAO,MAAM,aAAa,SAAS,EAAE,UAAU;EAC7D,GAAI;GACJ"}