import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import * as React from "react";
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
import { cn } from "../utils/css";
import { Circle } from "lucide-react";
import { Label } from "../label";
import { useId } from "react";
const RadioGroup = /*#__PURE__*/ React.forwardRef(({ className, ...props }, ref)=>{
    return /*#__PURE__*/ _jsx(RadioGroupPrimitive.Root, {
        className: cn("orderly-grid orderly-gap-2", className),
        ...props,
        ref: ref
    });
});
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
const RadioGroupItem = /*#__PURE__*/ React.forwardRef(({ className, children, ...props }, ref)=>{
    return /*#__PURE__*/ _jsx(RadioGroupPrimitive.Item, {
        ref: ref,
        className: 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__*/ _jsx(RadioGroupPrimitive.Indicator, {
            className: "orderly-flex orderly-items-center orderly-justify-center",
            children: /*#__PURE__*/ _jsx(Circle, {
                className: "orderly-h-[8px] orderly-w-[8px] orderly-fill-current orderly-text-current"
            })
        })
    });
});
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
const Radio = (props)=>{
    const { children, ...rest } = props;
    const uid = useId();
    const id = props.id || uid;
    return /*#__PURE__*/ _jsxs("div", {
        className: "orderly-flex orderly-gap-1 orderly-items-center",
        children: [
            /*#__PURE__*/ _jsx(RadioGroupItem, {
                ...rest,
                id: id
            }),
            /*#__PURE__*/ _jsx(Label, {
                htmlFor: id,
                children: children
            })
        ]
    });
};
export { RadioGroup, RadioGroupItem, Radio };

//# sourceMappingURL=radioGroup.js.map