@grafana/ui
Version:
Grafana Components Library
1 lines • 1.51 kB
Source Map (JSON)
{"version":3,"file":"Legend.mjs","sources":["../../../../src/components/Forms/Legend.tsx"],"sourcesContent":["import { css, cx } from '@emotion/css';\nimport { ReactNode } from 'react';\nimport * as React from 'react';\n\nimport { GrafanaTheme2 } from '@grafana/data';\n\nimport { useStyles2 } from '../../themes/ThemeContext';\n\nexport interface LabelProps extends React.HTMLAttributes<HTMLLegendElement> {\n children: string | ReactNode;\n description?: string;\n}\n\nexport const getLegendStyles = (theme: GrafanaTheme2) => {\n return {\n legend: css({\n fontSize: theme.typography.h3.fontSize,\n fontWeight: theme.typography.fontWeightRegular,\n margin: theme.spacing(0, 0, 2, 0),\n }),\n };\n};\n\nexport const Legend = ({ children, className, ...legendProps }: LabelProps) => {\n const styles = useStyles2(getLegendStyles);\n\n return (\n <legend className={cx(styles.legend, className)} {...legendProps}>\n {children}\n </legend>\n );\n};\n"],"names":[],"mappings":";;;;AAaa,MAAA,eAAA,GAAkB,CAAC,KAAyB,KAAA;AACvD,EAAO,OAAA;AAAA,IACL,QAAQ,GAAI,CAAA;AAAA,MACV,QAAA,EAAU,KAAM,CAAA,UAAA,CAAW,EAAG,CAAA,QAAA;AAAA,MAC9B,UAAA,EAAY,MAAM,UAAW,CAAA,iBAAA;AAAA,MAC7B,QAAQ,KAAM,CAAA,OAAA,CAAQ,CAAG,EAAA,CAAA,EAAG,GAAG,CAAC;AAAA,KACjC;AAAA,GACH;AACF;AAEO,MAAM,SAAS,CAAC,EAAE,UAAU,SAAW,EAAA,GAAG,aAA8B,KAAA;AAC7E,EAAM,MAAA,MAAA,GAAS,WAAW,eAAe,CAAA;AAEzC,EACE,uBAAA,GAAA,CAAC,QAAO,EAAA,EAAA,SAAA,EAAW,EAAG,CAAA,MAAA,CAAO,QAAQ,SAAS,CAAA,EAAI,GAAG,WAAA,EAClD,QACH,EAAA,CAAA;AAEJ;;;;"}