{"version":3,"file":"XAxesLabels-DReR9dHE.cjs","names":[],"sources":["../src/Components/Elements/Axes/XAxesLabels.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { motion } from 'motion/react';\r\n\r\nimport type { AnimateDataType } from '@/Types';\r\n\r\ninterface Props {\r\n  value: number | string | React.ReactNode;\r\n  y: number;\r\n  x: number;\r\n  width: number;\r\n  height: number;\r\n  style?: React.CSSProperties;\r\n  className?: string;\r\n  alignment?: 'top' | 'bottom';\r\n  animate: AnimateDataType;\r\n  isInView: boolean;\r\n}\r\n\r\nexport function XAxesLabels(props: Props) {\r\n  const {\r\n    value,\r\n    y,\r\n    x,\r\n    style,\r\n    className,\r\n    width,\r\n    height,\r\n    alignment = 'top',\r\n    animate,\r\n    isInView,\r\n  } = props;\r\n  return (\r\n    <motion.g\r\n      key={y}\r\n      variants={{\r\n        initial: {\r\n          x,\r\n          y,\r\n        },\r\n        whileInView: {\r\n          x,\r\n          y,\r\n          transition: { duration: animate.duration },\r\n        },\r\n      }}\r\n      initial='initial'\r\n      animate={isInView ? 'whileInView' : 'initial'}\r\n      exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n    >\r\n      <foreignObject width={width} height={height} y={0} x={0}>\r\n        <div\r\n          className={`flex flex-col items-center h-full ${\r\n            alignment === 'top' ? 'justify-start' : 'justify-end'\r\n          }`}\r\n        >\r\n          {typeof value === 'string' || typeof value === 'number' ? (\r\n            <p\r\n              className={cn(\r\n                'fill-content-primary text-xs m-0 py-0 px-1.5 text-center leading-xs',\r\n                className,\r\n              )}\r\n              style={{\r\n                ...style,\r\n              }}\r\n            >\r\n              {value}\r\n            </p>\r\n          ) : (\r\n            value\r\n          )}\r\n        </div>\r\n      </foreignObject>\r\n    </motion.g>\r\n  );\r\n}\r\n"],"mappings":"qHAkBA,SAAgB,EAAY,EAAc,CACxC,GAAM,CACJ,QACA,IACA,IACA,QACA,YACA,QACA,SACA,YAAY,MACZ,UACA,YACE,EACJ,OACE,EAAA,EAAA,KAAC,EAAA,EAAO,EAAR,CAEE,SAAU,CACR,QAAS,CACP,IACA,GACF,EACA,YAAa,CACX,IACA,IACA,WAAY,CAAE,SAAU,EAAQ,QAAS,CAC3C,CACF,EACA,QAAQ,UACR,QAAS,EAAW,cAAgB,UACpC,KAAM,CAAE,QAAS,EAAG,WAAY,CAAE,SAAU,EAAQ,QAAS,CAAE,YAE/D,EAAA,EAAA,KAAC,gBAAD,CAAsB,QAAe,SAAQ,EAAG,EAAG,EAAG,YACpD,EAAA,EAAA,KAAC,MAAD,CACE,UAAW,qCACT,IAAc,MAAQ,gBAAkB,yBAGzC,OAAO,GAAU,UAAY,OAAO,GAAU,UAC7C,EAAA,EAAA,KAAC,IAAD,CACE,WAAA,EAAA,EAAA,IACE,sEACA,CACF,EACA,MAAO,CACL,GAAG,CACL,WAEC,CACA,CAAA,EAEH,CAEC,CAAA,CACQ,CAAA,CACP,EAvCH,CAuCG,CAEd"}