import { type Component, type ValidComponent, createMemo, splitProps, } from "solid-js"; import type { ElementOf, PolymorphicProps } from "../polymorphic"; import { SelectBase, type SelectBaseCommonProps, type SelectBaseOptions, type SelectBaseRenderProps, } from "./select-base"; export interface SelectSingleSelectionOptions { /** The controlled value of the select. */ value?: T | null; /** * The value of the select when initially rendered. * Useful when you do not need to control the value. */ defaultValue?: T; /** Event handler called when the value changes. */ onChange?: (value: T | null) => void; /** Whether the select allow multiple selection. */ multiple?: false; } export interface SelectMultipleSelectionOptions { /** The controlled value of the select. */ value?: T[]; /** * The value of the select when initially rendered. * Useful when you do not need to control the value. */ defaultValue?: T[]; /** Event handler called when the value changes. */ onChange?: (value: T[]) => void; /** Whether the select allow multiple selection. */ multiple: true; } export type SelectRootOptions = ( | SelectSingleSelectionOptions