/** * Select — over RAW object arrays via labelField/valueField (W2 §The Kit). * The model passes tool output straight in; no `asOptions` reshape needed. * `multiple` folds in MultiSelect. */ import { type ComponentProps } from "react"; import { type KitStyled, type KitEngine, type KitRendered } from "../tokens.js"; import { type KitOption } from "./options.js"; export type SelectOption = KitOption; interface SelectOwnProps extends KitStyled { label?: string; /** Raw items — primitives or objects. An item's own `disabled` and `group` * keys make it unselectable and file it under a heading. */ options: SelectOption[]; /** Object field for the visible label (defaults to the item itself). */ labelField?: string; /** Object field for the value (defaults to the item itself). */ valueField?: string; /** The chosen value — a list where `multiple`. */ value?: string | string[]; placeholder?: string; hint?: string; disabled?: boolean; required?: boolean; /** Allow selecting several values. */ multiple?: boolean; /** Bound change handler; receives the selected value(s). */ onChange?: (value: string | string[]) => void; } /** Plus any `