import * as React from "react"; import { type VariantProps } from "../../utils.js"; import type { SelectOptionDto, SelectOptionFormatted } from "../domains/index.js"; import type { selectTriggerVariants } from "./components/index.js"; /** * Trigger */ type SelectTriggerVm = { placeholder: string; hasValue: boolean; displayResetAction: boolean; }; /** * SelectOptions */ type SelectOptionsVm = { options: SelectOptionFormatted[]; }; /** * SelectRenderer */ export type SelectRootVm = { value: string; }; /** * Select */ type SelectOption = SelectOptionDto | string; interface SelectPrimitiveProps { /** * Whether to display the reset action button. */ displayResetAction?: boolean; /** * Indicates if the field is disabled. */ disabled?: boolean; /** * Icon to display at the end of the select trigger. */ endIcon?: React.ReactElement; /** * Whether the select input is invalid. */ invalid?: VariantProps["invalid"]; /** * Callback function called when the value changes. */ onChange?: (value: string) => void; /** * Callback function called when the open state changes. */ onOpenChange?: (open: boolean) => void; /** * Callback function called when the value is reset. */ onValueReset?: () => void; /** * Array of options to display in the select dropdown. */ options?: SelectOption[]; /** * Placeholder text to display when no value is selected. */ placeholder?: string; /** * Size variant of the select trigger. */ size?: VariantProps["size"]; /** * Icon to display at the start of the select trigger. */ startIcon?: React.ReactElement; /** * The value of the select input. */ value?: string; /** * Style variant of the select trigger. */ variant?: VariantProps["variant"]; } declare const SelectPrimitive: (props: SelectPrimitiveProps) => React.JSX.Element; export { SelectPrimitive, type SelectPrimitiveProps, type SelectOptionsVm, type SelectTriggerVm, type SelectOption };