UNPKG

@grafana/ui

Version:
30 lines (25 loc) 1.01 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var jsxRuntime = require('react/jsx-runtime'); var css = require('@emotion/css'); var data = require('@grafana/data'); var ThemeContext = require('../../themes/ThemeContext.cjs'); "use strict"; const Counter = ({ value, variant = "secondary" }) => { const styles = ThemeContext.useStyles2(getStyles, variant); return /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles.counter, children: data.locale(value, 0).text }); }; const getStyles = (theme, variant) => ({ counter: css.css({ label: "counter", marginLeft: theme.spacing(1), borderRadius: theme.spacing(3), backgroundColor: variant === "primary" ? theme.colors.primary.main : theme.colors.secondary.main, padding: theme.spacing(0.25, 1), color: theme.colors.text.secondary, fontWeight: theme.typography.fontWeightMedium, fontSize: theme.typography.size.sm }) }); exports.Counter = Counter; //# sourceMappingURL=Counter.cjs.map