|
|
|
|
@ -5,7 +5,6 @@ import { GrafanaTheme2 } from '@grafana/data'; |
|
|
|
|
|
|
|
|
|
import { useStyles2 } from '../../themes'; |
|
|
|
|
import { getFocusStyles } from '../../themes/mixins'; |
|
|
|
|
import { Text } from '../Text/Text'; |
|
|
|
|
|
|
|
|
|
import { CardContainer, CardContainerProps, getCardContainerStyles } from './CardContainer'; |
|
|
|
|
|
|
|
|
|
@ -29,7 +28,6 @@ export interface Props extends Omit<CardContainerProps, 'disableEvents' | 'disab |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export interface CardInterface extends FC<Props> { |
|
|
|
|
Overline: typeof Overline; |
|
|
|
|
Heading: typeof Heading; |
|
|
|
|
Tags: typeof Tags; |
|
|
|
|
Figure: typeof Figure; |
|
|
|
|
@ -166,28 +164,6 @@ const getHeadingStyles = (theme: GrafanaTheme2) => ({ |
|
|
|
|
}), |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
/** Card text to be displayed above title */ |
|
|
|
|
const Overline = ({ children, className }: ChildProps) => { |
|
|
|
|
const styles = useStyles2(getOverlineStyles); |
|
|
|
|
return ( |
|
|
|
|
<div className={cx(styles.overline, className)}> |
|
|
|
|
{children && ( |
|
|
|
|
<Text color="info" weight="medium" variant="bodySmall"> |
|
|
|
|
{children} |
|
|
|
|
</Text> |
|
|
|
|
)} |
|
|
|
|
</div> |
|
|
|
|
); |
|
|
|
|
}; |
|
|
|
|
Overline.displayName = 'Overline'; |
|
|
|
|
|
|
|
|
|
const getOverlineStyles = (theme: GrafanaTheme2) => ({ |
|
|
|
|
overline: css({ |
|
|
|
|
gridArea: 'Overline', |
|
|
|
|
marginBottom: theme.spacing(0.5), |
|
|
|
|
}), |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
const Tags = ({ children, className }: ChildProps) => { |
|
|
|
|
const styles = useStyles2(getTagStyles); |
|
|
|
|
return <div className={cx(styles.tagList, className)}>{children}</div>; |
|
|
|
|
@ -384,7 +360,6 @@ export const getCardStyles = (theme: GrafanaTheme2) => { |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
Card.Overline = Overline; |
|
|
|
|
Card.Heading = Heading; |
|
|
|
|
Card.Tags = Tags; |
|
|
|
|
Card.Figure = Figure; |
|
|
|
|
|