import * as React from 'react'; import { FormControlProps } from '@mui/material/FormControl'; import { FormHelperTextProps } from '@mui/material/FormHelperText'; import { InputLabelProps } from '@mui/material/InputLabel'; import { TextFieldVariants } from '@mui/material/TextField'; import { PickersInputBaseProps, PickersInputPropsUsedByField } from "./PickersInputBase/PickersInputBase.types.js"; import type { PickersInputProps } from "./PickersInput/index.js"; import type { PickersOutlinedInputProps } from "./PickersOutlinedInput/index.js"; import type { PickersFilledInputProps } from "./PickersFilledInput/index.js"; export interface PickersTextFieldSlots { /** * The component used for the root slot. * @default FormControl */ root?: React.ElementType; /** * The component used for the input slot. * Defaults to one of `PickersInput`, `PickersFilledInput`, `PickersOutlinedInput` based on `variant`. * @default PickersOutlinedInput */ input?: React.ElementType; /** * The component used for the input label slot. * @default InputLabel */ inputLabel?: React.ElementType; /** * The component rendered as the underlying hidden `` element. * @default PickersInputBaseInput */ htmlInput?: React.ElementType; /** * The component used for the form helper text slot. * @default FormHelperText */ formHelperText?: React.ElementType; } export interface PickersTextFieldSlotProps { root?: Partial; input?: Partial; inputLabel?: Partial; htmlInput?: React.ComponentPropsWithRef<'input'>; formHelperText?: Partial; } export interface PickersTextFieldSlotsAndSlotProps { /** * The components used for each slot inside. * @default {} */ slots?: PickersTextFieldSlots; /** * The props used for each component slot. * @default {} */ slotProps?: PickersTextFieldSlotProps; } interface PickersTextFieldPropsUsedByField { onFocus: React.FocusEventHandler; onBlur: React.FocusEventHandler; disabled: boolean; /** * If `true`, the `input` will indicate an error. * @default false */ error: boolean; } export interface PickersBaseTextFieldProps extends PickersInputPropsUsedByField, PickersTextFieldPropsUsedByField, Omit { /** * The helper text content. */ helperText?: React.ReactNode; } export interface PickersStandardTextFieldProps extends PickersBaseTextFieldProps, PickersTextFieldSlotsAndSlotProps { /** * The variant to use. * @default 'outlined' */ variant?: 'standard'; } export interface PickersOutlinedTextFieldProps extends PickersBaseTextFieldProps, PickersTextFieldSlotsAndSlotProps { /** * The variant to use. * @default 'outlined' */ variant?: 'outlined'; } export interface PickersFilledTextFieldProps extends PickersBaseTextFieldProps, PickersTextFieldSlotsAndSlotProps { /** * The variant to use. * @default 'outlined' */ variant?: 'filled'; } export type PickersTextFieldProps = Variant extends 'filled' ? PickersFilledTextFieldProps : Variant extends 'standard' ? PickersStandardTextFieldProps : PickersOutlinedTextFieldProps; export {};