"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "OrderTypesCheckbox", {
    enumerable: true,
    get: function() {
        return OrderTypesCheckbox;
    }
});
const _jsxruntime = require("react/jsx-runtime");
const _types = require("@orderly.network/types");
const _lucidereact = require("lucide-react");
const OrderTypesCheckbox = ({ value, onValueChange })=>{
    return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
        className: "orderly-flex orderly-items-center orderly-space-x-3",
        children: [
            /*#__PURE__*/ (0, _jsxruntime.jsx)(OrderTypeItem, {
                active: value === _types.OrderType.POST_ONLY,
                label: "Post only",
                value: _types.OrderType.POST_ONLY,
                onClick: onValueChange
            }),
            /*#__PURE__*/ (0, _jsxruntime.jsx)(OrderTypeItem, {
                active: value === _types.OrderType.IOC,
                label: "IOC",
                value: _types.OrderType.IOC,
                onClick: onValueChange
            }),
            /*#__PURE__*/ (0, _jsxruntime.jsx)(OrderTypeItem, {
                active: value === _types.OrderType.FOK,
                label: "FOK",
                value: _types.OrderType.FOK,
                onClick: onValueChange
            })
        ]
    });
};
const OrderTypeItem = (props)=>{
    let clsName = "orderly-flex orderly-items-center orderly-gap-1 orderly-cursor-pointer";
    if (props.active) {
        clsName += " orderly-text-base-contrast";
    } else {
        clsName += " orderly-text-base-contrast-54";
    }
    return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
        className: clsName,
        onClick: ()=>{
            props.onClick(props.active ? "" : props.value);
        },
        children: [
            /*#__PURE__*/ (0, _jsxruntime.jsx)("button", {
                type: "button",
                className: "orderly-order-entry-radio-button orderly-w-[14px] orderly-h-[14px] orderly-rounded-full orderly-border-2 orderly-border-base-contrast-20",
                children: props.active && // @ts-ignore
                /*#__PURE__*/ (0, _jsxruntime.jsx)(_lucidereact.Circle, {
                    className: "orderly-order-entry-radio-circle orderly-w-[10px] orderly-h-[10px] orderly-text-link orderly-bg-link orderly-rounded-full"
                })
            }),
            /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
                className: "orderly-text-3xs",
                children: props.label
            })
        ]
    });
};

//# sourceMappingURL=orderTypes.js.map