/*! Strand UI | MIT License | dillingerstaffing.com */ import type { JSX } from "preact"; import { forwardRef } from "preact/compat"; import { cx } from "../../internal/index.js"; export interface SelectOption { value: string; label: string; } export interface SelectProps extends Omit, "onChange"> { options: SelectOption[]; disabled?: boolean; value?: string; onChange?: (e: JSX.TargetedEvent) => void; /** Error styling and `aria-invalid`. */ error?: boolean; /** Disabled first option shown until a value is chosen. */ placeholder?: string; } /** * Native select with a styled wrapper. * * @example * {placeholder && ( )} {options.map((opt) => ( ))}