"use client" import * as React from "react" import { cn } from "../../lib/utils" import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "./select" /** * `SelectControl` is replacement for `@wordpress/components`' `SelectControl` - * **21 live usages across 13 files**. * * AN ADAPTER, NOT A RENAME, for two reasons. * * 1. `onChange` gets the VALUE. WP does not hand its handler a change event: * * setDueMode(value)} /> * * Radix hands `onValueChange` the value too, so the prop keeps WP's NAME purely so the call sites * do not have to change. WP also passes a second `{ event }` argument; Radix has no event to give * and no call site reads one, so the signature stops at the value rather than promising an event * that would always be undefined. * * 2. THE EMPTY OPTION. WP renders a native ` onChange(fromRadix(next)) : undefined} disabled={disabled} required={required} name={name} > {options.map((option, index) => ( {option.label} ))} {help && (

{help}

)} ) } export { SelectControl }