@gravity-ui/uikit
Version:
Gravity UI base styling and components
21 lines (20 loc) • 1.08 kB
JavaScript
'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import * as React from 'react';
import { useRadio } from "../../hooks/private/index.js";
import { ControlLabel } from "../ControlLabel/index.js";
import { block } from "../utils/cn.js";
import "./Radio.css";
const b = block('radio');
export const Radio = React.forwardRef(function Radio(props, ref) {
const { size = 'm', disabled = false, content, children, title, style, className, qa } = props;
const { checked, inputProps } = useRadio(props);
const text = content || children;
const control = (_jsxs("span", { className: b('indicator'), children: [_jsx("span", { className: b('disc') }), _jsx("input", { ...inputProps, className: b('control') }), _jsx("span", { className: b('outline') })] }));
return (_jsx(ControlLabel, { ref: ref, title: title, style: style, size: size, disabled: disabled, className: b({
size,
disabled,
checked,
}, className), qa: qa, control: control, children: text }));
});
//# sourceMappingURL=Radio.js.map