UNPKG

@grafana/ui

Version:
56 lines (51 loc) 1.42 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var jsxRuntime = require('react/jsx-runtime'); var css = require('@emotion/css'); var ThemeContext = require('../../themes/ThemeContext.cjs'); var VizTooltipRow = require('./VizTooltipRow.cjs'); "use strict"; const VizTooltipContent = ({ items, children, isPinned = false, scrollable = false, maxHeight }) => { const styles = ThemeContext.useStyles2(getStyles); const scrollableStyle = scrollable ? { maxHeight, overflowY: "auto" } : {}; return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.wrapper, style: scrollableStyle, children: [ items.map(({ label, value, color, colorIndicator, colorPlacement, isActive, lineStyle, isHiddenFromViz }, i) => /* @__PURE__ */ jsxRuntime.jsx( VizTooltipRow.VizTooltipRow, { label, value, color, colorIndicator, colorPlacement, isActive, isPinned, lineStyle, showValueScroll: !scrollable, isHiddenFromViz }, i )), children ] }); }; const getStyles = (theme) => ({ wrapper: css.css({ display: "flex", flexDirection: "column", flex: 1, gap: 2, borderTop: `1px solid ${theme.colors.border.weak}`, padding: theme.spacing(1) }) }); exports.VizTooltipContent = VizTooltipContent; //# sourceMappingURL=VizTooltipContent.cjs.map