{"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAwCM,MAAM,0DAAY,CAAA,GAAA,uBAAS,EAAE,SAAS,UAC3C,KAA6B,EAC7B,GAAsB;IAEtB,QAAQ,CAAA,GAAA,0CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,sCAAW,EAAE;IAErB,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAoB;IACxC,IAAI,SAAS,CAAA,GAAA,yCAAW,EAAE,OAAO;IAEjC,IAAI,YAAY,CAAA,GAAA,mBAAK,EAAE;IACvB,CAAA,GAAA,sBAAQ,EAAE;QACR,IAAI,MAAM,WAAW,IAAI,CAAC,UAAU,OAAO,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,cAAc;YACpF,QAAQ,IAAI,CACV;YAEF,UAAU,OAAO,GAAG;QACtB;IACF,GAAG;QAAC,MAAM,WAAW;KAAC;IAEtB,qBAAO,0DAAC,CAAA,GAAA,uCAAY;QAAG,GAAG,KAAK;QAAG,GAAG,MAAM;QAAE,KAAK;QAAK,UAAU;;AACnE","sources":["packages/@adobe/react-spectrum/src/textfield/TextField.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaTextFieldProps, useTextField} from 'react-aria/useTextField';\nimport {\n  FocusableRefValue,\n  SpectrumFieldValidation,\n  SpectrumLabelableProps,\n  SpectrumTextInputBase,\n  StyleProps\n} from '@react-types/shared';\nimport React, {forwardRef, ReactElement, Ref, useEffect, useRef} from 'react';\nimport {TextFieldBase} from './TextFieldBase';\nimport {useFormProps} from '../form/Form';\nimport {useProviderProps} from '../provider/Provider';\n\nexport interface SpectrumTextFieldProps\n  extends\n    SpectrumTextInputBase,\n    Omit<AriaTextFieldProps, 'isInvalid' | 'validationState'>,\n    SpectrumFieldValidation<string>,\n    SpectrumLabelableProps,\n    StyleProps {\n  /** An icon to display at the start of the input. */\n  icon?: ReactElement | null;\n  /** Whether the input should be displayed with a quiet style. */\n  isQuiet?: boolean;\n}\n\nexport interface TextFieldRef<\n  T extends HTMLInputElement | HTMLTextAreaElement = HTMLInputElement\n> extends FocusableRefValue<T, HTMLDivElement> {\n  select(): void;\n  getInputElement(): T | null;\n}\n\n/**\n * TextFields are text inputs that allow users to input custom text entries\n * with a keyboard. Various decorations can be displayed around the field to\n * communicate the entry requirements.\n */\nexport const TextField = forwardRef(function TextField(\n  props: SpectrumTextFieldProps,\n  ref: Ref<TextFieldRef>\n) {\n  props = useProviderProps(props);\n  props = useFormProps(props);\n\n  let inputRef = useRef<HTMLInputElement>(null);\n  let result = useTextField(props, inputRef);\n\n  let hasWarned = useRef(false);\n  useEffect(() => {\n    if (props.placeholder && !hasWarned.current && process.env.NODE_ENV !== 'production') {\n      console.warn(\n        'Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/TextField.html#help-text'\n      );\n      hasWarned.current = true;\n    }\n  }, [props.placeholder]);\n\n  return <TextFieldBase {...props} {...result} ref={ref} inputRef={inputRef} />;\n});\n"],"names":[],"version":3,"file":"TextField.cjs.map"}