@grafana/ui
Version:
Grafana Components Library
36 lines (31 loc) • 1.07 kB
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
var jsxRuntime = require('react/jsx-runtime');
var css = require('@emotion/css');
var ThemeContext = require('../../themes/ThemeContext.cjs');
;
const Divider = ({ direction = "horizontal", spacing = 2 }) => {
const styles = ThemeContext.useStyles2(getStyles, spacing);
if (direction === "vertical") {
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.verticalDivider });
} else {
return /* @__PURE__ */ jsxRuntime.jsx("hr", { className: styles.horizontalDivider });
}
};
Divider.displayName = "Divider";
const getStyles = (theme, spacing) => {
return {
horizontalDivider: css.css({
borderTop: `1px solid ${theme.colors.border.weak}`,
margin: theme.spacing(spacing, 0),
width: "100%"
}),
verticalDivider: css.css({
borderRight: `1px solid ${theme.colors.border.weak}`,
margin: theme.spacing(0, spacing),
height: "100%"
})
};
};
exports.Divider = Divider;
//# sourceMappingURL=Divider.cjs.map