"use client"; /** * Radio Group Field * * A simple radio button group with label, description, and error states. */ import { ANIMATION_CLASSES, getStaggerStyle, STAGGER_PRESETS, } from "../animations"; import { cx } from "../lib/utils"; import { OnboardingLabel } from "../primitives/onboarding-label"; import { OnboardingRadioGroup, OnboardingRadioGroupItem, } from "../primitives/onboarding-radio-group"; import type { RadioGroupFieldProps } from "../types/fields"; export function RadioGroupField({ id, label, description, required = false, options, value, onChange, orientation = "vertical", error, touched = false, animationIndex = 0, disabled = false, }: RadioGroupFieldProps) { return (
{label} {required && *} {description && (

{description}

)} {options.map((option) => (
{option.label} {option.description && ( {option.description} )}
))}
{touched && error && (

{error}

)}
); }