Files
Torkel Ödegaard 10badea19e Emotion: Upgrades emotion from 10 to 11 and updates all import paths (#32541)
* Babel: Updates babel dependencies to latest version

* Emotion: Upgrade form 10 to 11

* Fixing tests

* Updated to use emotion/css instead in test
2021-04-01 14:15:23 +02:00

36 lines
834 B
TypeScript

import React, { forwardRef, HTMLAttributes } from 'react';
import { css, cx } from '@emotion/css';
import { GrafanaTheme } from '@grafana/data';
import { useStyles } from '../../themes';
export interface Props extends HTMLAttributes<HTMLDivElement> {
className?: string;
}
export const ToolbarButtonRow = forwardRef<HTMLDivElement, Props>(({ className, children, ...rest }, ref) => {
const styles = useStyles(getStyles);
return (
<div ref={ref} className={cx(styles.wrapper, className)} {...rest}>
{children}
</div>
);
});
ToolbarButtonRow.displayName = 'ToolbarButtonRow';
const getStyles = (theme: GrafanaTheme) => ({
wrapper: css`
display: flex;
.button-group,
.toolbar-button {
margin-left: ${theme.spacing.sm};
&:first-child {
margin-left: 0;
}
}
`,
});