/* wp:polyfill */
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _clsx = _interopRequireDefault(require("clsx"));
var _components = require("@wordpress/components");
var _primitives = require("@wordpress/primitives");
var _blockEditor = require("@wordpress/block-editor");
var _jsxRuntime = require("react/jsx-runtime");
/**
 * External dependencies
 */

/**
 * WordPress dependencies
 */

/**
 * Internal dependencies
 */

const ColorExamples = ({
  colors,
  type,
  templateColumns = '1fr 1fr',
  itemHeight = '52px'
}) => {
  if (!colors) {
    return null;
  }
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalGrid, {
    templateColumns: templateColumns,
    rowGap: 8,
    columnGap: 16,
    children: colors.map(color => {
      const className = type === 'gradients' ? (0, _blockEditor.__experimentalGetGradientClass)(color.slug) : (0, _blockEditor.getColorClassName)('background-color', color.slug);
      const classes = (0, _clsx.default)('edit-site-style-book__color-example', className);
      return /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.View, {
        className: classes,
        style: {
          height: itemHeight
        }
      }, color.slug);
    })
  });
};
var _default = exports.default = ColorExamples;
//# sourceMappingURL=color-examples.js.map