import type { ReactNode } from "react"; import type { SelectPrimitiveRootProps } from "../primitives/Select"; /** * Props for the composable `Select.Root` chrome — a presentational * composition over `SelectPrimitive.Root`. Adds the optional field chrome * (label, description / error) and the field-state flags (`invalid`, * `status`, `readOnly`) that the styled trigger reads. Everything else passes * through to `SelectPrimitive.Root` (and therefore `@rn-primitives/select`). * * Deliberately RHF-free: no `name`, no `validations`. */ export interface SelectRootProps extends SelectPrimitiveRootProps { /** * Where the field label renders: `"inside"` the trigger (small, above the value) * or `"above"` it. DS-owned default (`"inside"`); overridable per instance. * The label content itself is authored via `Select.Label`. */ readonly labelPlacement?: "above" | "inside"; /** * Explicit accessible name for the trigger. Auto-derived from a string * `Select.Label`; supply this when the label content is a non-string * `ReactNode`, or to name a field that has no visible `Select.Label`. */ readonly accessibilityLabel?: string; /** * Supporting text rendered below the trigger. A string renders as neutral * `HelperText`; a `ReactNode` renders verbatim. Suppressed when `error` is * present. */ readonly description?: string | ReactNode; /** * Error message rendered below the trigger as critical `HelperText` (string) * or verbatim (`ReactNode`). Takes priority over `description` and applies * the critical trigger styling. */ readonly error?: string | ReactNode; /** * Applies the critical trigger styling without rendering an error message. */ readonly invalid?: boolean; /** * `critical` applies the critical trigger styling. Defaults to `neutral`. */ readonly status?: "neutral" | "critical"; /** * Renders the trigger as non-interactive read-only presentation (subtle * surface, no chevron, value as text). `disabled` takes precedence. */ readonly readOnly?: boolean; }