"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: all[name]
    });
}
_export(exports, {
    Radio: function() {
        return Radio;
    },
    RadioGroup: function() {
        return RadioGroup;
    },
    RadioGroupItem: function() {
        return RadioGroupItem;
    }
});
const _jsxruntime = require("react/jsx-runtime");
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
const _reactradiogroup = /*#__PURE__*/ _interop_require_wildcard(require("@radix-ui/react-radio-group"));
const _css = require("../utils/css");
const _lucidereact = require("lucide-react");
const _label = require("../label");
function _getRequireWildcardCache(nodeInterop) {
    if (typeof WeakMap !== "function") return null;
    var cacheBabelInterop = new WeakMap();
    var cacheNodeInterop = new WeakMap();
    return (_getRequireWildcardCache = function(nodeInterop) {
        return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
    })(nodeInterop);
}
function _interop_require_wildcard(obj, nodeInterop) {
    if (!nodeInterop && obj && obj.__esModule) {
        return obj;
    }
    if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
        return {
            default: obj
        };
    }
    var cache = _getRequireWildcardCache(nodeInterop);
    if (cache && cache.has(obj)) {
        return cache.get(obj);
    }
    var newObj = {
        __proto__: null
    };
    var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
    for(var key in obj){
        if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
            var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
            if (desc && (desc.get || desc.set)) {
                Object.defineProperty(newObj, key, desc);
            } else {
                newObj[key] = obj[key];
            }
        }
    }
    newObj.default = obj;
    if (cache) {
        cache.set(obj, newObj);
    }
    return newObj;
}
const RadioGroup = /*#__PURE__*/ _react.forwardRef(({ className, ...props }, ref)=>{
    return /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactradiogroup.Root, {
        className: (0, _css.cn)("orderly-grid orderly-gap-2", className),
        ...props,
        ref: ref
    });
});
RadioGroup.displayName = _reactradiogroup.Root.displayName;
const RadioGroupItem = /*#__PURE__*/ _react.forwardRef(({ className, children, ...props }, ref)=>{
    return /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactradiogroup.Item, {
        ref: ref,
        className: (0, _css.cn)("orderly-aspect-square orderly-h-[16px] orderly-w-[16px] orderly-rounded-full orderly-border-2 orderly-border-base-contrast/50 orderly-text-base-contrast/50 orderly-ring-offset-base-700 focus:orderly-outline-none focus-visible:orderly-ring-2 focus-visible:orderly-ring-ring focus-visible:orderly-ring-offset-2 disabled:orderly-cursor-not-allowed disabled:orderly-opacity-50", className),
        ...props,
        children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactradiogroup.Indicator, {
            className: "orderly-flex orderly-items-center orderly-justify-center",
            children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_lucidereact.Circle, {
                className: "orderly-h-[8px] orderly-w-[8px] orderly-fill-current orderly-text-current"
            })
        })
    });
});
RadioGroupItem.displayName = _reactradiogroup.Item.displayName;
const Radio = (props)=>{
    const { children, ...rest } = props;
    const uid = (0, _react.useId)();
    const id = props.id || uid;
    return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
        className: "orderly-flex orderly-gap-1 orderly-items-center",
        children: [
            /*#__PURE__*/ (0, _jsxruntime.jsx)(RadioGroupItem, {
                ...rest,
                id: id
            }),
            /*#__PURE__*/ (0, _jsxruntime.jsx)(_label.Label, {
                htmlFor: id,
                children: children
            })
        ]
    });
};

//# sourceMappingURL=radioGroup.js.map