Well.tsx 733 B

123456789101112131415161718192021
  1. import { cx, css } from '@emotion/css';
  2. import React, { FC } from 'react';
  3. import { GrafanaTheme } from '@grafana/data';
  4. import { useStyles } from '@grafana/ui';
  5. type Props = React.HTMLAttributes<HTMLDivElement>;
  6. export const Well: FC<Props> = ({ children, className }) => {
  7. const styles = useStyles(getStyles);
  8. return <div className={cx(styles.wrapper, className)}>{children}</div>;
  9. };
  10. export const getStyles = (theme: GrafanaTheme) => ({
  11. wrapper: css`
  12. background-color: ${theme.colors.panelBg};
  13. border: solid 1px ${theme.colors.formInputBorder};
  14. border-radius: ${theme.border.radius.sm};
  15. padding: ${theme.spacing.xs} ${theme.spacing.sm};
  16. font-family: ${theme.typography.fontFamily.monospace};
  17. `,
  18. });