{"version":3,"file":"TextField.types.mjs","sourceRoot":"","sources":["../../../src/components/TextField/TextField.types.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;CACA,CAAC;AAGX;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,QAAQ;CACR,CAAC","sourcesContent":["import type { TextFieldPropsShared } from '@metamask/design-system-shared';\nimport type { ComponentPropsWithoutRef, Ref } from 'react';\n\nimport type { InputProps } from '../Input/Input.types';\n\n/**\n * TextField size variants (web-only, ADR-0003).\n *\n * The React Native `TextField` ships a fixed height and intentionally does not\n * expose a size prop, so this const object lives in the web package only.\n */\nexport const TextFieldSize = {\n  Sm: 'sm',\n  Md: 'md',\n  Lg: 'lg',\n} as const;\nexport type TextFieldSize = (typeof TextFieldSize)[keyof typeof TextFieldSize];\n\n/**\n * Native input `type` attribute values supported by the web TextField\n * (ADR-0003). React Native consumers use `inputProps.keyboardType` /\n * `inputProps.secureTextEntry` instead, so this is web-only.\n */\nexport const TextFieldType = {\n  Text: 'text',\n  Number: 'number',\n  Password: 'password',\n  Search: 'search',\n} as const;\nexport type TextFieldType = (typeof TextFieldType)[keyof typeof TextFieldType];\n\ntype TextFieldInputProps = Omit<\n  InputProps,\n  | 'autoFocus'\n  | 'id'\n  | 'isDisabled'\n  | 'isReadOnly'\n  | 'isStateStylesDisabled'\n  | 'maxLength'\n  | 'name'\n  | 'onBlur'\n  | 'onChange'\n  | 'onFocus'\n  | 'placeholder'\n  | 'required'\n  | 'type'\n  | 'value'\n>;\n\nexport type TextFieldProps = Omit<\n  ComponentPropsWithoutRef<'div'>,\n  'onBlur' | 'onChange' | 'onFocus' | 'onClick'\n> &\n  TextFieldPropsShared & {\n    /**\n     * The size of the text field. Controls the height.\n     *\n     * @default TextFieldSize.Md\n     */\n    size?: TextFieldSize;\n    /**\n     * The native input `type` attribute.\n     *\n     * @default TextFieldType.Text\n     */\n    type?: TextFieldType;\n    /**\n     * If true, truncates overflowing input text with an ellipsis.\n     *\n     * @default true\n     */\n    truncate?: boolean;\n    /**\n     * Max number of characters to allow.\n     */\n    maxLength?: number;\n    /**\n     * Name attribute of the inner `input` element.\n     */\n    name?: string;\n    /**\n     * `id` of the inner `input` element.\n     */\n    id?: string;\n    /**\n     * If true, the inner input is marked as required.\n     */\n    required?: boolean;\n    /**\n     * Additional props for the inner `Input`. Do not pass `value`,\n     * `placeholder`, `isDisabled`, `isReadOnly`, `onFocus`, `onBlur`,\n     * `onChange`, `id`, `name`, `type`, `maxLength`, or `required` here;\n     * use the TextField-level props above.\n     */\n    inputProps?: TextFieldInputProps;\n    /**\n     * Ref to the inner `input` element. The component `ref` targets the\n     * root `div`.\n     */\n    inputRef?: Ref<HTMLInputElement>;\n    /**\n     * Called when the inner input value changes.\n     */\n    onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;\n    /**\n     * Called when the inner input receives focus.\n     */\n    onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;\n    /**\n     * Called when the inner input loses focus.\n     */\n    onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;\n    /**\n     * Called when the root container is clicked. Focuses the inner input.\n     */\n    onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;\n    /**\n     * Optional additional CSS classes for the root container.\n     */\n    className?: string;\n    /**\n     * Optional inline styles for the root container.\n     */\n    style?: React.CSSProperties;\n  };\n"]}