import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
import "react";
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_components__ from "@tachybase/components";
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
import * as __WEBPACK_EXTERNAL_MODULE_antd__ from "antd";
import * as __WEBPACK_EXTERNAL_MODULE_antd_style__ from "antd-style";
import * as __WEBPACK_EXTERNAL_MODULE_classnames__ from "classnames";
function _tagged_template_literal(strings, raw) {
    if (!raw) raw = strings.slice(0);
    return Object.freeze(Object.defineProperties(strings, {
        raw: {
            value: Object.freeze(raw)
        }
    }));
}
function _templateObject() {
    const data = _tagged_template_literal([
        "\n      display: inline-flex;\n      .ant-color-picker-trigger-disabled {\n        cursor: default;\n      }\n    "
    ]);
    _templateObject = function() {
        return data;
    };
    return data;
}
const useStyles = (0, __WEBPACK_EXTERNAL_MODULE_antd_style__.createStyles)((param)=>{
    let { css } = param;
    return {
        color: css(_templateObject())
    };
});
const ColorPicker = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.connect)((props)=>{
    const { value, onChange, ...others } = props;
    return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
        role: "button",
        "aria-label": "color-picker-normal",
        style: {
            display: 'inline-block'
        },
        children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.ColorPicker, {
            value: value,
            trigger: "hover",
            ...others,
            destroyTooltipOnHide: true,
            getPopupContainer: (current)=>current,
            presets: [
                {
                    label: 'Recommended',
                    colors: [
                        '#8BBB11',
                        '#52C41A',
                        '#13A8A8',
                        '#1677FF',
                        '#F5222D',
                        '#FADB14',
                        '#FA8C164D',
                        '#FADB144D',
                        '#52C41A4D',
                        '#1677FF4D',
                        '#2F54EB4D',
                        '#722ED14D',
                        '#EB2F964D'
                    ]
                }
            ],
            onChange: (color)=>onChange(color.toHexString())
        })
    });
}, (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.mapProps)((props, field)=>({
        ...props
    })), (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.mapReadPretty)((props)=>{
    const prefixCls = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_components__.usePrefixCls)('description-color-picker', props);
    const { styles } = useStyles();
    return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
        role: "button",
        "aria-label": "color-picker-read-pretty",
        className: (0, __WEBPACK_EXTERNAL_MODULE_classnames__["default"])(prefixCls, styles.color, props.className),
        children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.ColorPicker, {
            disabled: true,
            value: props.value,
            size: "small",
            ...props
        })
    });
}));
const ColorPicker_rslib_entry_ = ColorPicker;
export { ColorPicker, ColorPicker_rslib_entry_ as default };
