Liferay.Loader.define("layout-content-page-editor-web@2.0.166/page_editor/common/components/ColorPalette", ['module', 'exports', 'require', '@frontend-taglib-clay$clayui/button', 'frontend-js-react-web$classnames', 'frontend-js-react-web$prop-types', 'frontend-js-react-web$react', '../../app/config/index', '../../app/utils/useId'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.default = ColorPalette;

    var _button = _interopRequireDefault(require("@frontend-taglib-clay$clayui/button"));

    var _classnames = _interopRequireDefault(require("frontend-js-react-web$classnames"));

    var _propTypes = _interopRequireDefault(require("frontend-js-react-web$prop-types"));

    var _react = _interopRequireDefault(require("frontend-js-react-web$react"));

    var _index = require("../../app/config/index");

    var _useId = require("../../app/utils/useId");

    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { default: obj };
    }

    /**
     * SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
     * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
     */
    function ColorPalette(_ref) {
      var label = _ref.label,
          onClear = _ref.onClear,
          onColorSelect = _ref.onColorSelect,
          selectedColor = _ref.selectedColor;
      var colorPaletteId = (0, _useId.useId)();
      return (/*#__PURE__*/_react.default.createElement("div", {
          className: "page-editor__color-palette"
        }, label && /*#__PURE__*/_react.default.createElement("label", {
          htmlFor: colorPaletteId
        }, label), /*#__PURE__*/_react.default.createElement("div", {
          className: "palette-container",
          id: colorPaletteId
        }, /*#__PURE__*/_react.default.createElement("ul", {
          className: "list-unstyled palette-items-container"
        }, _index.config.themeColorsCssClasses.map(function (color) {
          return (/*#__PURE__*/_react.default.createElement("li", {
              className: (0, _classnames.default)('palette-item', {
                'palette-item-selected': color === selectedColor
              }),
              key: color
            }, /*#__PURE__*/_react.default.createElement(_button.default, {
              block: true,
              className: (0, _classnames.default)("bg-".concat(color), 'palette-item-inner', 'p-1', 'rounded-circle'),
              displayType: "unstyled",
              onClick: function onClick(event) {
                return onColorSelect(color, event);
              },
              small: true,
              title: color
            }))
          );
        }))), onClear && /*#__PURE__*/_react.default.createElement(_button.default, {
          displayType: "secondary",
          onClick: onClear,
          small: true
        }, Liferay.Language.get('clear')))
      );
    }
    //# sourceMappingURL=ColorPalette.js.map
  }
});
//# sourceMappingURL=ColorPalette.js.map