"use client"; import { useId, type CSSProperties } from "react"; export type Choice = { value: string; label: string; description?: string; disabled?: boolean; }; type ChoiceProps = { label: string; options: readonly Choice[]; value: string; onValueChange: (value: string) => void; name?: string; disabled?: boolean; className?: string; }; export function RadioGroup({ label, options, value, onValueChange, name, disabled, className = "", }: ChoiceProps) { const id = useId(); return (
); } export function SegmentedControl({ label, options, value, onValueChange, name, disabled, className = "", }: ChoiceProps) { const id = useId(); return ( ); } export function NumberField({ label, value, onValueChange, min = -Infinity, max = Infinity, step = 1, disabled = false, className = "", }: { label: string; value: number; onValueChange: (value: number) => void; min?: number; max?: number; step?: number; disabled?: boolean; className?: string; }) { const id = useId(); const update = (n: number) => { if (Number.isFinite(n)) onValueChange(Math.min(max, Math.max(min, n))); }; const increment = Math.max(Number.EPSILON, Math.abs(step)); return (