"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.ChartLegend = ChartLegend;
var _react = _interopRequireDefault(require("react"));
var _classnames = _interopRequireDefault(require("classnames"));
var _chartLegendItem = require("./chart-legend-item");
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/**
 * Legends for charts
 * @midnight-gray-supported
 * @alpine-light-supported
 */
function ChartLegend({
  className = '',
  items,
  isInteractive,
  onChange,
  onMouseEnter,
  onMouseLeave,
  testId
}) {
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
    className: (0, _classnames.default)('chart-legend', className),
    "test-id": testId,
    children: items.map(item => {
      return /*#__PURE__*/(0, _jsxRuntime.jsx)(_chartLegendItem.ChartLegendItem, {
        item: item,
        isInteractive: isInteractive,
        onChange: onChange,
        onMouseEnter: onMouseEnter,
        onMouseLeave: onMouseLeave
      }, item.key);
    })
  });
}