"use client" import * as React from "react" import { cn } from "../../lib/utils" import { Label } from "./label" import { RadioGroup, RadioGroupItem } from "./radio-group" /** * `RadioControl` is replacement for `@wordpress/components`' `RadioControl` - * **7 live usages across 4 files**. * * AN ADAPTER, NOT A RENAME. WP hands `onChange` the SELECTED VALUE, never the event: * * setBookingModeForm(value)} /> * * Radix hands `onValueChange` the value too, so the prop keeps WP's NAME purely so the call sites do * not have to change. * * `selected` is WP's name for the group's value, and `options` is WP's array. Both are reproduced * rather than renamed to Radix's `value` and a hand-written list of items, which is what keeps each * conversion a one-line import swap. * * `value` IS ALSO ACCEPTED, as a fallback for `selected`. One site spreads a react-hook-form * `{...field}`, which supplies `value` and no `selected` at all. Under WP that spread landed on * every radio input at once and overwrote each one's own value, so nothing was ever selected there; * reading it as the group's value is what that call site was reaching for. * * The group label is a `` wired with `aria-labelledby`, not a `