@brizy/ui
Version:
React elements in Brizy style
14 lines (13 loc) • 850 B
JavaScript
import { classNames } from "../classNamesFn";
import React from "react";
import { EditorIcon } from "../EditorIcon";
import { IconsName } from "../EditorIcon/types";
import { PaletteItem } from "./item";
import { BRZ_PREFIX } from "../constants";
export const ColorPalette = ({ className, palette, onChange, openSettings, value, }) => {
const wrapperClassName = classNames(className)("control__color-palette");
return (React.createElement("div", { className: wrapperClassName },
palette.map(({ id, hex }) => (React.createElement(PaletteItem, { key: id, id: id, value: value, hex: hex, onChange: onChange }))),
openSettings && (React.createElement("div", { className: `${BRZ_PREFIX}-control__color-palette__icon`, onClick: openSettings },
React.createElement(EditorIcon, { icon: IconsName.SettingsLegacy })))));
};