import React, { forwardRef } from 'react'
/**
* Nova Radio – single choice radio button.
*
* Usage (as a group):
* {options.map(o => (
*
* ))}
*
* Or use RadioGroup for a pre-built grouped set.
*/
export const Radio = forwardRef(function Radio(
{ label, hint, size = 18, id, className = '', ...rest },
ref,
) {
const dim = typeof size === 'number' ? `${size}px` : size
const inputId = id ?? (label ? `radio-${label.toLowerCase().replace(/\s+/g, '-')}` : undefined)
return (
)
})
/**
* RadioGroup – renders a set of Radio buttons from an options array.
*
* @prop {Array} options - [{ value, label, hint? }]
* @prop {string} value - currently selected value
* @prop {function} onChange - called with new value string
* @prop {string} name - unique name for radio group (required)
* @prop {string} label - group label
* @prop {string} error - validation error
* @prop {'vertical'|'horizontal'} direction
*/
export function RadioGroup({ options = [], value, onChange, name, label, error, direction = 'vertical', className = '' }) {
return (
)
}
export default Radio