UNPKG

@grafana/ui

Version:
31 lines (28 loc) 923 B
import { jsx } from 'react/jsx-runtime'; import { css } from '@emotion/css'; import { useStyles2 } from '../../themes/ThemeContext.mjs'; const Divider = ({ direction = "horizontal", spacing = 2 }) => { const styles = useStyles2(getStyles, spacing); if (direction === "vertical") { return /* @__PURE__ */ jsx("div", { className: styles.verticalDivider }); } else { return /* @__PURE__ */ jsx("hr", { className: styles.horizontalDivider }); } }; Divider.displayName = "Divider"; const getStyles = (theme, spacing) => { return { horizontalDivider: css({ borderTop: `1px solid ${theme.colors.border.weak}`, margin: theme.spacing(spacing, 0), width: "100%" }), verticalDivider: css({ borderRight: `1px solid ${theme.colors.border.weak}`, margin: theme.spacing(0, spacing), height: "100%" }) }; }; export { Divider }; //# sourceMappingURL=Divider.mjs.map