{"version":3,"file":"GraphTitle.cjs","names":[],"sources":["../src/Components/Typography/GraphTitle.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { H5, P } from '@undp/design-system-react/Typography';\r\nimport React from 'react';\r\n\r\ninterface Props {\r\n  text: string | React.ReactNode;\r\n  isDashboard?: boolean;\r\n  style?: React.CSSProperties;\r\n  className?: string;\r\n}\r\n\r\nexport function GraphTitle(props: Props) {\r\n  const { text, isDashboard, style, className } = props;\r\n  if (typeof text === 'string') {\r\n    if (text.trim() === '') return null;\r\n    if (isDashboard)\r\n      return (\r\n        <H5\r\n          marginBottom='base'\r\n          className={cn('font-bold pb-3 text-content-primary', className)}\r\n          aria-label='Dashboard title'\r\n          style={style}\r\n        >\r\n          {text}\r\n        </H5>\r\n      );\r\n    return (\r\n      <P\r\n        marginBottom='none'\r\n        className={cn('text-content-primary', className)}\r\n        aria-label='Graph title'\r\n        style={style}\r\n      >\r\n        {text}\r\n      </P>\r\n    );\r\n  }\r\n  if (React.isValidElement(text))\r\n    return (\r\n      <div className={className} style={style}>\r\n        {text}\r\n      </div>\r\n    );\r\n  console.error('GraphTitle: Invalid text type. Expected string or React element.');\r\n  return null;\r\n}\r\n"],"mappings":"4QAWA,SAAgB,EAAW,EAAc,CACvC,GAAM,CAAE,OAAM,cAAa,QAAO,aAAc,EAgChD,OA/BI,OAAO,GAAS,SACd,EAAK,KAAK,IAAM,GAAW,KAC3B,GAEA,EAAA,EAAA,KAAC,EAAA,GAAD,CACE,aAAa,OACb,WAAA,EAAA,EAAA,IAAc,sCAAuC,CAAS,EAC9D,aAAW,kBACJ,iBAEN,CACC,CAAA,GAGN,EAAA,EAAA,KAAC,EAAA,EAAD,CACE,aAAa,OACb,WAAA,EAAA,EAAA,IAAc,uBAAwB,CAAS,EAC/C,aAAW,cACJ,iBAEN,CACA,CAAA,EAGH,EAAA,QAAM,eAAe,CAAI,GAEzB,EAAA,EAAA,KAAC,MAAD,CAAgB,YAAkB,iBAC/B,CACE,CAAA,GAET,QAAQ,MAAM,kEAAkE,EACzE,KACT"}