import type * as G from "../../types/global"; import type { Attributes, ClassName } from "@reshaped/headless"; export type Size = "small" | "medium" | "large" | "xlarge"; type BaseProps = { /** Name of the input element */ name: string; /** Amount of characters in the pin */ valueLength?: number; /** Character pattern used in the input value */ pattern?: "alphabetic" | "numeric" | "alphanumeric"; /** Component size */ size?: G.Responsive; /** Input fields render variant */ variant?: "outline" | "faded"; /** Callback when the input value changes */ onChange?: G.ChangeHandler; /** Additional attributes for the input element */ inputAttributes?: Attributes<"input">; /** Additional classname for the root element */ className?: ClassName; /** Additional attributes for the root element */ attributes?: Attributes<"div">; }; export type ControlledProps = BaseProps & { /** Value of the input element, enables controlled mode */ value: string; /** Default value of the input element, enables uncontrolled mode */ defaultValue?: never; }; export type UncontrolledProps = BaseProps & { /** Value of the input element, enables controlled mode */ value?: never; /** Default value of the input element, enables uncontrolled mode */ defaultValue?: string; }; export type Props = ControlledProps | UncontrolledProps; export {};