/* wp:polyfill */
/**
 * External dependencies
 */
import clsx from 'clsx';

/**
 * WordPress dependencies
 */
import { __experimentalGrid as Grid } from '@wordpress/components';
import { View } from '@wordpress/primitives';
import { getColorClassName, __experimentalGetGradientClass } from '@wordpress/block-editor';

/**
 * Internal dependencies
 */
import { jsx as _jsx } from "react/jsx-runtime";
const ColorExamples = ({
  colors,
  type,
  templateColumns = '1fr 1fr',
  itemHeight = '52px'
}) => {
  if (!colors) {
    return null;
  }
  return /*#__PURE__*/_jsx(Grid, {
    templateColumns: templateColumns,
    rowGap: 8,
    columnGap: 16,
    children: colors.map(color => {
      const className = type === 'gradients' ? __experimentalGetGradientClass(color.slug) : getColorClassName('background-color', color.slug);
      const classes = clsx('edit-site-style-book__color-example', className);
      return /*#__PURE__*/_jsx(View, {
        className: classes,
        style: {
          height: itemHeight
        }
      }, color.slug);
    })
  });
};
export default ColorExamples;
//# sourceMappingURL=color-examples.js.map