{"version":3,"file":"InfoBox.cjs","sources":["../../../../src/components/InfoBox/InfoBox.tsx"],"sourcesContent":["import { css, cx } from '@emotion/css';\nimport * as React from 'react';\nimport type { JSX } from 'react';\n\nimport { GrafanaTheme2 } from '@grafana/data';\n\nimport { useStyles2 } from '../../themes/ThemeContext';\nimport { Alert, AlertVariant } from '../Alert/Alert';\nimport { Icon } from '../Icon/Icon';\n\nexport interface InfoBoxProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {\n  children: React.ReactNode;\n  /** Title of the box */\n  title?: string | JSX.Element;\n  /** Url of the read more link */\n  url?: string;\n  /** Text of the read more link */\n  urlTitle?: string;\n  /** Indicates whether or not box should be rendered with Grafana branding background */\n  branded?: boolean;\n  /** Color variant of the box */\n  severity?: AlertVariant;\n  /** Call back to be performed when box is dismissed */\n  onDismiss?: () => void;\n}\n\n/**\n * @deprecated use Alert with severity info.\n *\n * https://developers.grafana.com/ui/latest/index.html?path=/docs/information-deprecated-infobox--docs\n * */\nexport const InfoBox = React.memo(\n  React.forwardRef<HTMLDivElement, InfoBoxProps>(\n    ({ title, className, children, branded, url, urlTitle, onDismiss, severity = 'info', ...otherProps }, ref) => {\n      const styles = useStyles2(getStyles);\n\n      return (\n        // component is deprecated so no point fixing this\n        // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n        <Alert severity={severity} className={className} {...otherProps} ref={ref} title={title as string}>\n          <div>{children}</div>\n          {url && (\n            <a href={url} className={cx('external-link', styles.docsLink)} target=\"_blank\" rel=\"noreferrer\">\n              <Icon name=\"book\" /> {urlTitle || 'Read more'}\n            </a>\n          )}\n        </Alert>\n      );\n    }\n  )\n);\n\nInfoBox.displayName = 'InfoBox';\n\nconst getStyles = (theme: GrafanaTheme2) => ({\n  docsLink: css({\n    display: 'inline-block',\n    marginTop: theme.spacing(2),\n  }),\n});\n"],"names":["React","useStyles2","Alert","jsx","jsxs","cx","Icon","css"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A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