@grafana/ui
Version:
Grafana Components Library
1 lines • 2.21 kB
Source Map (JSON)
{"version":3,"file":"FeatureInfoBox.mjs","sources":["../../../../src/components/InfoBox/FeatureInfoBox.tsx"],"sourcesContent":["import { css } from '@emotion/css';\nimport { memo, forwardRef } from 'react';\n\nimport { FeatureState, GrafanaTheme2 } from '@grafana/data';\n\nimport { useStyles2 } from '../../themes/ThemeContext';\nimport { FeatureBadge } from '../FeatureBadge/FeatureBadge';\n\nimport { InfoBox, InfoBoxProps } from './InfoBox';\n\nexport interface FeatureInfoBoxProps extends Omit<InfoBoxProps, 'title' | 'urlTitle'> {\n title: string;\n featureState?: FeatureState;\n}\n\n/** @deprecated use Alert with severity info */\nexport const FeatureInfoBox = memo(\n forwardRef<HTMLDivElement, FeatureInfoBoxProps>(({ title, featureState, ...otherProps }, ref) => {\n const styles = useStyles2(getFeatureInfoBoxStyles);\n\n const titleEl = featureState ? (\n <>\n <div className={styles.badge}>\n <FeatureBadge featureState={featureState} />\n </div>\n <h3>{title}</h3>\n </>\n ) : (\n <h3>{title}</h3>\n );\n return <InfoBox branded title={titleEl} urlTitle=\"Read documentation\" ref={ref} {...otherProps} />;\n })\n);\n\nFeatureInfoBox.displayName = 'FeatureInfoBox';\n\nconst getFeatureInfoBoxStyles = (theme: GrafanaTheme2) => {\n return {\n badge: css({\n marginBottom: theme.spacing(1),\n }),\n };\n};\n"],"names":[],"mappings":";;;;;;;;AAgBO,MAAM,cAAA,GAAiB,IAAA;AAAA,EAC5B,UAAA,CAAgD,CAAC,EAAE,KAAA,EAAO,cAAc,GAAG,UAAA,IAAc,GAAA,KAAQ;AAC/F,IAAA,MAAM,MAAA,GAAS,WAAW,uBAAuB,CAAA;AAEjD,IAAA,MAAM,OAAA,GAAU,+BACd,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,SAAI,SAAA,EAAW,MAAA,CAAO,OACrB,QAAA,kBAAA,GAAA,CAAC,YAAA,EAAA,EAAa,cAA4B,CAAA,EAC5C,CAAA;AAAA,sBACA,GAAA,CAAC,QAAI,QAAA,EAAA,KAAA,EAAM;AAAA,KAAA,EACb,CAAA,mBAEA,GAAA,CAAC,IAAA,EAAA,EAAI,QAAA,EAAA,KAAA,EAAM,CAAA;AAEb,IAAA,uBAAO,GAAA,CAAC,OAAA,EAAA,EAAQ,OAAA,EAAO,IAAA,EAAC,KAAA,EAAO,SAAS,QAAA,EAAS,oBAAA,EAAqB,GAAA,EAAW,GAAG,UAAA,EAAY,CAAA;AAAA,EAClG,CAAC;AACH;AAEA,cAAA,CAAe,WAAA,GAAc,gBAAA;AAE7B,MAAM,uBAAA,GAA0B,CAAC,KAAA,KAAyB;AACxD,EAAA,OAAO;AAAA,IACL,OAAO,GAAA,CAAI;AAAA,MACT,YAAA,EAAc,KAAA,CAAM,OAAA,CAAQ,CAAC;AAAA,KAC9B;AAAA,GACH;AACF,CAAA;;;;"}