import React from 'react';
import classNames from 'classnames';
import { ChartLegendItem } from './chart-legend-item';
import { jsx as _jsx } from "react/jsx-runtime";
/**
 * Legends for charts
 * @midnight-gray-supported
 * @alpine-light-supported
 */
export function ChartLegend({
  className = '',
  items,
  isInteractive,
  onChange,
  onMouseEnter,
  onMouseLeave,
  testId
}) {
  return /*#__PURE__*/_jsx("div", {
    className: classNames('chart-legend', className),
    "test-id": testId,
    children: items.map(item => {
      return /*#__PURE__*/_jsx(ChartLegendItem, {
        item: item,
        isInteractive: isInteractive,
        onChange: onChange,
        onMouseEnter: onMouseEnter,
        onMouseLeave: onMouseLeave
      }, item.key);
    })
  });
}