@react-spectrum/textfield 3.13.5 → 3.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (195) hide show
  1. package/dist/TextArea.main.js +9 -1
  2. package/dist/TextArea.main.js.map +1 -1
  3. package/dist/TextArea.mjs +10 -2
  4. package/dist/TextArea.module.js +10 -2
  5. package/dist/TextArea.module.js.map +1 -1
  6. package/dist/TextField.main.js +9 -1
  7. package/dist/TextField.main.js.map +1 -1
  8. package/dist/TextField.mjs +10 -2
  9. package/dist/TextField.module.js +10 -2
  10. package/dist/TextField.module.js.map +1 -1
  11. package/dist/TextFieldBase.main.js +17 -1
  12. package/dist/TextFieldBase.main.js.map +1 -1
  13. package/dist/TextFieldBase.mjs +18 -2
  14. package/dist/TextFieldBase.module.js +18 -2
  15. package/dist/TextFieldBase.module.js.map +1 -1
  16. package/dist/ar-AE.main.js +6 -0
  17. package/dist/ar-AE.main.js.map +1 -0
  18. package/dist/ar-AE.mjs +8 -0
  19. package/dist/ar-AE.module.js +8 -0
  20. package/dist/ar-AE.module.js.map +1 -0
  21. package/dist/bg-BG.main.js +6 -0
  22. package/dist/bg-BG.main.js.map +1 -0
  23. package/dist/bg-BG.mjs +8 -0
  24. package/dist/bg-BG.module.js +8 -0
  25. package/dist/bg-BG.module.js.map +1 -0
  26. package/dist/cs-CZ.main.js +6 -0
  27. package/dist/cs-CZ.main.js.map +1 -0
  28. package/dist/cs-CZ.mjs +8 -0
  29. package/dist/cs-CZ.module.js +8 -0
  30. package/dist/cs-CZ.module.js.map +1 -0
  31. package/dist/da-DK.main.js +6 -0
  32. package/dist/da-DK.main.js.map +1 -0
  33. package/dist/da-DK.mjs +8 -0
  34. package/dist/da-DK.module.js +8 -0
  35. package/dist/da-DK.module.js.map +1 -0
  36. package/dist/de-DE.main.js +6 -0
  37. package/dist/de-DE.main.js.map +1 -0
  38. package/dist/de-DE.mjs +8 -0
  39. package/dist/de-DE.module.js +8 -0
  40. package/dist/de-DE.module.js.map +1 -0
  41. package/dist/el-GR.main.js +6 -0
  42. package/dist/el-GR.main.js.map +1 -0
  43. package/dist/el-GR.mjs +8 -0
  44. package/dist/el-GR.module.js +8 -0
  45. package/dist/el-GR.module.js.map +1 -0
  46. package/dist/en-US.main.js +6 -0
  47. package/dist/en-US.main.js.map +1 -0
  48. package/dist/en-US.mjs +8 -0
  49. package/dist/en-US.module.js +8 -0
  50. package/dist/en-US.module.js.map +1 -0
  51. package/dist/es-ES.main.js +6 -0
  52. package/dist/es-ES.main.js.map +1 -0
  53. package/dist/es-ES.mjs +8 -0
  54. package/dist/es-ES.module.js +8 -0
  55. package/dist/es-ES.module.js.map +1 -0
  56. package/dist/et-EE.main.js +6 -0
  57. package/dist/et-EE.main.js.map +1 -0
  58. package/dist/et-EE.mjs +8 -0
  59. package/dist/et-EE.module.js +8 -0
  60. package/dist/et-EE.module.js.map +1 -0
  61. package/dist/fi-FI.main.js +6 -0
  62. package/dist/fi-FI.main.js.map +1 -0
  63. package/dist/fi-FI.mjs +8 -0
  64. package/dist/fi-FI.module.js +8 -0
  65. package/dist/fi-FI.module.js.map +1 -0
  66. package/dist/fr-FR.main.js +6 -0
  67. package/dist/fr-FR.main.js.map +1 -0
  68. package/dist/fr-FR.mjs +8 -0
  69. package/dist/fr-FR.module.js +8 -0
  70. package/dist/fr-FR.module.js.map +1 -0
  71. package/dist/he-IL.main.js +6 -0
  72. package/dist/he-IL.main.js.map +1 -0
  73. package/dist/he-IL.mjs +8 -0
  74. package/dist/he-IL.module.js +8 -0
  75. package/dist/he-IL.module.js.map +1 -0
  76. package/dist/hr-HR.main.js +6 -0
  77. package/dist/hr-HR.main.js.map +1 -0
  78. package/dist/hr-HR.mjs +8 -0
  79. package/dist/hr-HR.module.js +8 -0
  80. package/dist/hr-HR.module.js.map +1 -0
  81. package/dist/hu-HU.main.js +6 -0
  82. package/dist/hu-HU.main.js.map +1 -0
  83. package/dist/hu-HU.mjs +8 -0
  84. package/dist/hu-HU.module.js +8 -0
  85. package/dist/hu-HU.module.js.map +1 -0
  86. package/dist/intlStrings.main.js +108 -0
  87. package/dist/intlStrings.main.js.map +1 -0
  88. package/dist/intlStrings.mjs +110 -0
  89. package/dist/intlStrings.module.js +110 -0
  90. package/dist/intlStrings.module.js.map +1 -0
  91. package/dist/it-IT.main.js +6 -0
  92. package/dist/it-IT.main.js.map +1 -0
  93. package/dist/it-IT.mjs +8 -0
  94. package/dist/it-IT.module.js +8 -0
  95. package/dist/it-IT.module.js.map +1 -0
  96. package/dist/ja-JP.main.js +6 -0
  97. package/dist/ja-JP.main.js.map +1 -0
  98. package/dist/ja-JP.mjs +8 -0
  99. package/dist/ja-JP.module.js +8 -0
  100. package/dist/ja-JP.module.js.map +1 -0
  101. package/dist/ko-KR.main.js +6 -0
  102. package/dist/ko-KR.main.js.map +1 -0
  103. package/dist/ko-KR.mjs +8 -0
  104. package/dist/ko-KR.module.js +8 -0
  105. package/dist/ko-KR.module.js.map +1 -0
  106. package/dist/lt-LT.main.js +6 -0
  107. package/dist/lt-LT.main.js.map +1 -0
  108. package/dist/lt-LT.mjs +8 -0
  109. package/dist/lt-LT.module.js +8 -0
  110. package/dist/lt-LT.module.js.map +1 -0
  111. package/dist/lv-LV.main.js +6 -0
  112. package/dist/lv-LV.main.js.map +1 -0
  113. package/dist/lv-LV.mjs +8 -0
  114. package/dist/lv-LV.module.js +8 -0
  115. package/dist/lv-LV.module.js.map +1 -0
  116. package/dist/nb-NO.main.js +6 -0
  117. package/dist/nb-NO.main.js.map +1 -0
  118. package/dist/nb-NO.mjs +8 -0
  119. package/dist/nb-NO.module.js +8 -0
  120. package/dist/nb-NO.module.js.map +1 -0
  121. package/dist/nl-NL.main.js +6 -0
  122. package/dist/nl-NL.main.js.map +1 -0
  123. package/dist/nl-NL.mjs +8 -0
  124. package/dist/nl-NL.module.js +8 -0
  125. package/dist/nl-NL.module.js.map +1 -0
  126. package/dist/pl-PL.main.js +6 -0
  127. package/dist/pl-PL.main.js.map +1 -0
  128. package/dist/pl-PL.mjs +8 -0
  129. package/dist/pl-PL.module.js +8 -0
  130. package/dist/pl-PL.module.js.map +1 -0
  131. package/dist/pt-BR.main.js +6 -0
  132. package/dist/pt-BR.main.js.map +1 -0
  133. package/dist/pt-BR.mjs +8 -0
  134. package/dist/pt-BR.module.js +8 -0
  135. package/dist/pt-BR.module.js.map +1 -0
  136. package/dist/pt-PT.main.js +6 -0
  137. package/dist/pt-PT.main.js.map +1 -0
  138. package/dist/pt-PT.mjs +8 -0
  139. package/dist/pt-PT.module.js +8 -0
  140. package/dist/pt-PT.module.js.map +1 -0
  141. package/dist/ro-RO.main.js +6 -0
  142. package/dist/ro-RO.main.js.map +1 -0
  143. package/dist/ro-RO.mjs +8 -0
  144. package/dist/ro-RO.module.js +8 -0
  145. package/dist/ro-RO.module.js.map +1 -0
  146. package/dist/ru-RU.main.js +6 -0
  147. package/dist/ru-RU.main.js.map +1 -0
  148. package/dist/ru-RU.mjs +8 -0
  149. package/dist/ru-RU.module.js +8 -0
  150. package/dist/ru-RU.module.js.map +1 -0
  151. package/dist/sk-SK.main.js +6 -0
  152. package/dist/sk-SK.main.js.map +1 -0
  153. package/dist/sk-SK.mjs +8 -0
  154. package/dist/sk-SK.module.js +8 -0
  155. package/dist/sk-SK.module.js.map +1 -0
  156. package/dist/sl-SI.main.js +6 -0
  157. package/dist/sl-SI.main.js.map +1 -0
  158. package/dist/sl-SI.mjs +8 -0
  159. package/dist/sl-SI.module.js +8 -0
  160. package/dist/sl-SI.module.js.map +1 -0
  161. package/dist/sr-SP.main.js +6 -0
  162. package/dist/sr-SP.main.js.map +1 -0
  163. package/dist/sr-SP.mjs +8 -0
  164. package/dist/sr-SP.module.js +8 -0
  165. package/dist/sr-SP.module.js.map +1 -0
  166. package/dist/sv-SE.main.js +6 -0
  167. package/dist/sv-SE.main.js.map +1 -0
  168. package/dist/sv-SE.mjs +8 -0
  169. package/dist/sv-SE.module.js +8 -0
  170. package/dist/sv-SE.module.js.map +1 -0
  171. package/dist/tr-TR.main.js +6 -0
  172. package/dist/tr-TR.main.js.map +1 -0
  173. package/dist/tr-TR.mjs +8 -0
  174. package/dist/tr-TR.module.js +8 -0
  175. package/dist/tr-TR.module.js.map +1 -0
  176. package/dist/types.d.ts.map +1 -1
  177. package/dist/uk-UA.main.js +6 -0
  178. package/dist/uk-UA.main.js.map +1 -0
  179. package/dist/uk-UA.mjs +8 -0
  180. package/dist/uk-UA.module.js +8 -0
  181. package/dist/uk-UA.module.js.map +1 -0
  182. package/dist/zh-CN.main.js +6 -0
  183. package/dist/zh-CN.main.js.map +1 -0
  184. package/dist/zh-CN.mjs +8 -0
  185. package/dist/zh-CN.module.js +8 -0
  186. package/dist/zh-CN.module.js.map +1 -0
  187. package/dist/zh-TW.main.js +6 -0
  188. package/dist/zh-TW.main.js.map +1 -0
  189. package/dist/zh-TW.mjs +8 -0
  190. package/dist/zh-TW.module.js +8 -0
  191. package/dist/zh-TW.module.js.map +1 -0
  192. package/package.json +14 -13
  193. package/src/TextArea.tsx +8 -4
  194. package/src/TextField.tsx +8 -4
  195. package/src/TextFieldBase.tsx +18 -2
@@ -72,7 +72,15 @@ const $eec649e464f3832d$export$f5c9f3c2c4054eec = /*#__PURE__*/ (0, ($parcel$int
72
72
  inputValue,
73
73
  inputRef
74
74
  ]);
75
- if (props.placeholder && process.env.NODE_ENV !== 'production') console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/TextArea.html#help-text');
75
+ let hasWarned = (0, $5VIId$react.useRef)(false);
76
+ (0, $5VIId$react.useEffect)(()=>{
77
+ if (props.placeholder && !hasWarned.current && process.env.NODE_ENV !== 'production') {
78
+ console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/TextArea.html#help-text');
79
+ hasWarned.current = true;
80
+ }
81
+ }, [
82
+ props.placeholder
83
+ ]);
76
84
  let result = (0, $5VIId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D,EAAG,EAAE,CAAC;YAC1F,MAAM,KAAK,CAAC,QAAQ,GAAG;YACvB,MAAM,KAAK,CAAC,SAAS,GAAG;QAC1B;IACF,GAAG;QAAC;QAAS;QAAU,MAAM,MAAM;KAAC;IAEpC,CAAA,GAAA,qCAAc,EAAE;QACd,IAAI,SAAS,OAAO,EAClB;IAEJ,GAAG;QAAC;QAAgB;QAAY;KAAS;IAEzC,IAAI,MAAM,WAAW,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,cAChD,QAAQ,IAAI,CAAC;IAGf,IAAI,SAAS,CAAA,GAAA,sCAAW,EAAE;QACxB,GAAG,KAAK;QACR,UAAU,CAAA,GAAA,2BAAI,EAAE,UAAU;QAC1B,kBAAkB;IACpB,GAAG;IAEH,qBACE,0DAAC,CAAA,GAAA,uCAAY;QACV,GAAG,UAAU;QACd,KAAK;QACL,UAAU;QACT,GAAG,MAAM;QACV,WAAA;QACA,YAAY;QACZ,SAAS;QACT,YAAY;QACZ,YAAY;;AAElB","sources":["packages/@react-spectrum/textfield/src/TextArea.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 {chain, useLayoutEffect} from '@react-aria/utils';\nimport React, {Ref, useCallback, useRef} from 'react';\nimport {SpectrumTextAreaProps, SpectrumTextFieldBaseProps, TextFieldRef} from '@react-types/textfield';\nimport {TextFieldBase} from './TextFieldBase';\nimport {useControlledState} from '@react-stately/utils';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useTextField} from '@react-aria/textfield';\n\n/**\n * TextAreas are multiline text inputs, useful for cases where users have\n * a sizable amount of text to enter. They allow for all customizations that\n * are available to text fields.\n */\nexport const TextArea = React.forwardRef(function TextArea(props: SpectrumTextAreaProps, ref: Ref<TextFieldRef<HTMLTextAreaElement>>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {\n isDisabled = false,\n isQuiet = false,\n isReadOnly = false,\n isRequired = false,\n onChange,\n ...otherProps\n } = props;\n\n // not in stately because this is so we know when to re-measure, which is a spectrum design\n let [inputValue, setInputValue] = useControlledState(props.value, props.defaultValue ?? '', () => {});\n let inputRef = useRef<HTMLTextAreaElement>(null);\n\n let onHeightChange = useCallback(() => {\n // Quiet textareas always grow based on their text content.\n // Standard textareas also grow by default, unless an explicit height is set.\n if ((isQuiet || !props.height) && inputRef.current) {\n let input = inputRef.current;\n let prevAlignment = input.style.alignSelf;\n let prevOverflow = input.style.overflow;\n // Firefox scroll position is lost when overflow: 'hidden' is applied so we skip applying it.\n // The measure/applied height is also incorrect/reset if we turn on and off\n // overflow: hidden in Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1787062\n let isFirefox = 'MozAppearance' in input.style;\n if (!isFirefox) {\n input.style.overflow = 'hidden';\n }\n input.style.alignSelf = 'start';\n input.style.height = 'auto';\n // offsetHeight - clientHeight accounts for the border/padding.\n input.style.height = `${input.scrollHeight + (input.offsetHeight - input.clientHeight)}px`;\n input.style.overflow = prevOverflow;\n input.style.alignSelf = prevAlignment;\n }\n }, [isQuiet, inputRef, props.height]);\n\n useLayoutEffect(() => {\n if (inputRef.current) {\n onHeightChange();\n }\n }, [onHeightChange, inputValue, inputRef]);\n\n if (props.placeholder && process.env.NODE_ENV !== 'production') {\n console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/TextArea.html#help-text');\n }\n\n let result = useTextField({\n ...props,\n onChange: chain(onChange, setInputValue),\n inputElementType: 'textarea'\n }, inputRef);\n\n return (\n <TextFieldBase\n {...otherProps as SpectrumTextFieldBaseProps}\n ref={ref}\n inputRef={inputRef}\n {...result}\n multiLine\n isDisabled={isDisabled}\n isQuiet={isQuiet}\n isReadOnly={isReadOnly}\n isRequired={isRequired} />\n );\n});\n"],"names":[],"version":3,"file":"TextArea.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAgBM,MAAM,0DAAW,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,SAAS,KAA4B,EAAE,GAA2C;IAClI,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,qCAAW,EAAE;IACrB,IAAI,cACF,aAAa,gBACb,UAAU,mBACV,aAAa,mBACb,aAAa,iBACb,QAAQ,EACR,GAAG,YACJ,GAAG;QAG8D;IADlE,2FAA2F;IAC3F,IAAI,CAAC,YAAY,cAAc,GAAG,CAAA,GAAA,2CAAiB,EAAE,MAAM,KAAK,EAAE,CAAA,sBAAA,MAAM,YAAY,cAAlB,iCAAA,sBAAsB,IAAI,KAAO;IACnG,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAuB;IAE3C,IAAI,iBAAiB,CAAA,GAAA,wBAAU,EAAE;QAC/B,2DAA2D;QAC3D,6EAA6E;QAC7E,IAAI,AAAC,CAAA,WAAW,CAAC,MAAM,MAAM,AAAD,KAAM,SAAS,OAAO,EAAE;YAClD,IAAI,QAAQ,SAAS,OAAO;YAC5B,IAAI,gBAAgB,MAAM,KAAK,CAAC,SAAS;YACzC,IAAI,eAAe,MAAM,KAAK,CAAC,QAAQ;YACvC,6FAA6F;YAC7F,2EAA2E;YAC3E,mFAAmF;YACnF,IAAI,YAAY,mBAAmB,MAAM,KAAK;YAC9C,IAAI,CAAC,WACH,MAAM,KAAK,CAAC,QAAQ,GAAG;YAEzB,MAAM,KAAK,CAAC,SAAS,GAAG;YACxB,MAAM,KAAK,CAAC,MAAM,GAAG;YACrB,+DAA+D;YAC/D,MAAM,KAAK,CAAC,MAAM,GAAG,GAAG,MAAM,YAAY,GAAI,CAAA,MAAM,YAAY,GAAG,MAAM,YAAY,AAAD,EAAG,EAAE,CAAC;YAC1F,MAAM,KAAK,CAAC,QAAQ,GAAG;YACvB,MAAM,KAAK,CAAC,SAAS,GAAG;QAC1B;IACF,GAAG;QAAC;QAAS;QAAU,MAAM,MAAM;KAAC;IAEpC,CAAA,GAAA,qCAAc,EAAE;QACd,IAAI,SAAS,OAAO,EAClB;IAEJ,GAAG;QAAC;QAAgB;QAAY;KAAS;IAEzC,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,CAAC;YACb,UAAU,OAAO,GAAG;QACtB;IACF,GAAG;QAAC,MAAM,WAAW;KAAC;IAEtB,IAAI,SAAS,CAAA,GAAA,sCAAW,EAAE;QACxB,GAAG,KAAK;QACR,UAAU,CAAA,GAAA,2BAAI,EAAE,UAAU;QAC1B,kBAAkB;IACpB,GAAG;IAEH,qBACE,0DAAC,CAAA,GAAA,uCAAY;QACV,GAAG,UAAU;QACd,KAAK;QACL,UAAU;QACT,GAAG,MAAM;QACV,WAAA;QACA,YAAY;QACZ,SAAS;QACT,YAAY;QACZ,YAAY;;AAElB","sources":["packages/@react-spectrum/textfield/src/TextArea.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 {chain, useLayoutEffect} from '@react-aria/utils';\nimport React, {Ref, useCallback, useEffect, useRef} from 'react';\nimport {SpectrumTextAreaProps, SpectrumTextFieldBaseProps, TextFieldRef} from '@react-types/textfield';\nimport {TextFieldBase} from './TextFieldBase';\nimport {useControlledState} from '@react-stately/utils';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useTextField} from '@react-aria/textfield';\n\n/**\n * TextAreas are multiline text inputs, useful for cases where users have\n * a sizable amount of text to enter. They allow for all customizations that\n * are available to text fields.\n */\nexport const TextArea = React.forwardRef(function TextArea(props: SpectrumTextAreaProps, ref: Ref<TextFieldRef<HTMLTextAreaElement>>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {\n isDisabled = false,\n isQuiet = false,\n isReadOnly = false,\n isRequired = false,\n onChange,\n ...otherProps\n } = props;\n\n // not in stately because this is so we know when to re-measure, which is a spectrum design\n let [inputValue, setInputValue] = useControlledState(props.value, props.defaultValue ?? '', () => {});\n let inputRef = useRef<HTMLTextAreaElement>(null);\n\n let onHeightChange = useCallback(() => {\n // Quiet textareas always grow based on their text content.\n // Standard textareas also grow by default, unless an explicit height is set.\n if ((isQuiet || !props.height) && inputRef.current) {\n let input = inputRef.current;\n let prevAlignment = input.style.alignSelf;\n let prevOverflow = input.style.overflow;\n // Firefox scroll position is lost when overflow: 'hidden' is applied so we skip applying it.\n // The measure/applied height is also incorrect/reset if we turn on and off\n // overflow: hidden in Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1787062\n let isFirefox = 'MozAppearance' in input.style;\n if (!isFirefox) {\n input.style.overflow = 'hidden';\n }\n input.style.alignSelf = 'start';\n input.style.height = 'auto';\n // offsetHeight - clientHeight accounts for the border/padding.\n input.style.height = `${input.scrollHeight + (input.offsetHeight - input.clientHeight)}px`;\n input.style.overflow = prevOverflow;\n input.style.alignSelf = prevAlignment;\n }\n }, [isQuiet, inputRef, props.height]);\n\n useLayoutEffect(() => {\n if (inputRef.current) {\n onHeightChange();\n }\n }, [onHeightChange, inputValue, inputRef]);\n\n let hasWarned = useRef(false);\n useEffect(() => {\n if (props.placeholder && !hasWarned.current && process.env.NODE_ENV !== 'production') {\n console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/TextArea.html#help-text');\n hasWarned.current = true;\n }\n }, [props.placeholder]);\n\n let result = useTextField({\n ...props,\n onChange: chain(onChange, setInputValue),\n inputElementType: 'textarea'\n }, inputRef);\n\n return (\n <TextFieldBase\n {...otherProps as SpectrumTextFieldBaseProps}\n ref={ref}\n inputRef={inputRef}\n {...result}\n multiLine\n isDisabled={isDisabled}\n isQuiet={isQuiet}\n isReadOnly={isReadOnly}\n isRequired={isRequired} />\n );\n});\n"],"names":[],"version":3,"file":"TextArea.main.js.map"}
package/dist/TextArea.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {TextFieldBase as $599adb75312e6492$export$d22444a338b6e3c2} from "./TextFieldBase.mjs";
2
2
  import {useLayoutEffect as $hi3T0$useLayoutEffect, chain as $hi3T0$chain} from "@react-aria/utils";
3
- import $hi3T0$react, {useRef as $hi3T0$useRef, useCallback as $hi3T0$useCallback} from "react";
3
+ import $hi3T0$react, {useRef as $hi3T0$useRef, useCallback as $hi3T0$useCallback, useEffect as $hi3T0$useEffect} from "react";
4
4
  import {useControlledState as $hi3T0$useControlledState} from "@react-stately/utils";
5
5
  import {useFormProps as $hi3T0$useFormProps} from "@react-spectrum/form";
6
6
  import {useProviderProps as $hi3T0$useProviderProps} from "@react-spectrum/provider";
@@ -62,7 +62,15 @@ const $cc187bf91f8eea73$export$f5c9f3c2c4054eec = /*#__PURE__*/ (0, $hi3T0$react
62
62
  inputValue,
63
63
  inputRef
64
64
  ]);
65
- if (props.placeholder && process.env.NODE_ENV !== 'production') console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/TextArea.html#help-text');
65
+ let hasWarned = (0, $hi3T0$useRef)(false);
66
+ (0, $hi3T0$useEffect)(()=>{
67
+ if (props.placeholder && !hasWarned.current && process.env.NODE_ENV !== 'production') {
68
+ console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/TextArea.html#help-text');
69
+ hasWarned.current = true;
70
+ }
71
+ }, [
72
+ props.placeholder
73
+ ]);
66
74
  let result = (0, $hi3T0$useTextField)({
67
75
  ...props,
68
76
  onChange: (0, $hi3T0$chain)(onChange, setInputValue),
@@ -1,6 +1,6 @@
1
1
  import {TextFieldBase as $599adb75312e6492$export$d22444a338b6e3c2} from "./TextFieldBase.module.js";
2
2
  import {useLayoutEffect as $hi3T0$useLayoutEffect, chain as $hi3T0$chain} from "@react-aria/utils";
3
- import $hi3T0$react, {useRef as $hi3T0$useRef, useCallback as $hi3T0$useCallback} from "react";
3
+ import $hi3T0$react, {useRef as $hi3T0$useRef, useCallback as $hi3T0$useCallback, useEffect as $hi3T0$useEffect} from "react";
4
4
  import {useControlledState as $hi3T0$useControlledState} from "@react-stately/utils";
5
5
  import {useFormProps as $hi3T0$useFormProps} from "@react-spectrum/form";
6
6
  import {useProviderProps as $hi3T0$useProviderProps} from "@react-spectrum/provider";
@@ -62,7 +62,15 @@ const $cc187bf91f8eea73$export$f5c9f3c2c4054eec = /*#__PURE__*/ (0, $hi3T0$react
62
62
  inputValue,
63
63
  inputRef
64
64
  ]);
65
- if (props.placeholder && process.env.NODE_ENV !== 'production') console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/TextArea.html#help-text');
65
+ let hasWarned = (0, $hi3T0$useRef)(false);
66
+ (0, $hi3T0$useEffect)(()=>{
67
+ if (props.placeholder && !hasWarned.current && process.env.NODE_ENV !== 'production') {
68
+ console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/TextArea.html#help-text');
69
+ hasWarned.current = true;
70
+ }
71
+ }, [
72
+ props.placeholder
73
+ ]);
66
74
  let result = (0, $hi3T0$useTextField)({
67
75
  ...props,
68
76
  onChange: (0, $hi3T0$chain)(onChange, setInputValue),
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAgBM,MAAM,0DAAW,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,SAAS,KAA4B,EAAE,GAA2C;IAClI,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,mBAAW,EAAE;IACrB,IAAI,cACF,aAAa,gBACb,UAAU,mBACV,aAAa,mBACb,aAAa,iBACb,QAAQ,EACR,GAAG,YACJ,GAAG;QAG8D;IADlE,2FAA2F;IAC3F,IAAI,CAAC,YAAY,cAAc,GAAG,CAAA,GAAA,yBAAiB,EAAE,MAAM,KAAK,EAAE,CAAA,sBAAA,MAAM,YAAY,cAAlB,iCAAA,sBAAsB,IAAI,KAAO;IACnG,IAAI,WAAW,CAAA,GAAA,aAAK,EAAuB;IAE3C,IAAI,iBAAiB,CAAA,GAAA,kBAAU,EAAE;QAC/B,2DAA2D;QAC3D,6EAA6E;QAC7E,IAAI,AAAC,CAAA,WAAW,CAAC,MAAM,MAAM,AAAD,KAAM,SAAS,OAAO,EAAE;YAClD,IAAI,QAAQ,SAAS,OAAO;YAC5B,IAAI,gBAAgB,MAAM,KAAK,CAAC,SAAS;YACzC,IAAI,eAAe,MAAM,KAAK,CAAC,QAAQ;YACvC,6FAA6F;YAC7F,2EAA2E;YAC3E,mFAAmF;YACnF,IAAI,YAAY,mBAAmB,MAAM,KAAK;YAC9C,IAAI,CAAC,WACH,MAAM,KAAK,CAAC,QAAQ,GAAG;YAEzB,MAAM,KAAK,CAAC,SAAS,GAAG;YACxB,MAAM,KAAK,CAAC,MAAM,GAAG;YACrB,+DAA+D;YAC/D,MAAM,KAAK,CAAC,MAAM,GAAG,GAAG,MAAM,YAAY,GAAI,CAAA,MAAM,YAAY,GAAG,MAAM,YAAY,AAAD,EAAG,EAAE,CAAC;YAC1F,MAAM,KAAK,CAAC,QAAQ,GAAG;YACvB,MAAM,KAAK,CAAC,SAAS,GAAG;QAC1B;IACF,GAAG;QAAC;QAAS;QAAU,MAAM,MAAM;KAAC;IAEpC,CAAA,GAAA,sBAAc,EAAE;QACd,IAAI,SAAS,OAAO,EAClB;IAEJ,GAAG;QAAC;QAAgB;QAAY;KAAS;IAEzC,IAAI,MAAM,WAAW,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,cAChD,QAAQ,IAAI,CAAC;IAGf,IAAI,SAAS,CAAA,GAAA,mBAAW,EAAE;QACxB,GAAG,KAAK;QACR,UAAU,CAAA,GAAA,YAAI,EAAE,UAAU;QAC1B,kBAAkB;IACpB,GAAG;IAEH,qBACE,gCAAC,CAAA,GAAA,yCAAY;QACV,GAAG,UAAU;QACd,KAAK;QACL,UAAU;QACT,GAAG,MAAM;QACV,WAAA;QACA,YAAY;QACZ,SAAS;QACT,YAAY;QACZ,YAAY;;AAElB","sources":["packages/@react-spectrum/textfield/src/TextArea.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 {chain, useLayoutEffect} from '@react-aria/utils';\nimport React, {Ref, useCallback, useRef} from 'react';\nimport {SpectrumTextAreaProps, SpectrumTextFieldBaseProps, TextFieldRef} from '@react-types/textfield';\nimport {TextFieldBase} from './TextFieldBase';\nimport {useControlledState} from '@react-stately/utils';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useTextField} from '@react-aria/textfield';\n\n/**\n * TextAreas are multiline text inputs, useful for cases where users have\n * a sizable amount of text to enter. They allow for all customizations that\n * are available to text fields.\n */\nexport const TextArea = React.forwardRef(function TextArea(props: SpectrumTextAreaProps, ref: Ref<TextFieldRef<HTMLTextAreaElement>>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {\n isDisabled = false,\n isQuiet = false,\n isReadOnly = false,\n isRequired = false,\n onChange,\n ...otherProps\n } = props;\n\n // not in stately because this is so we know when to re-measure, which is a spectrum design\n let [inputValue, setInputValue] = useControlledState(props.value, props.defaultValue ?? '', () => {});\n let inputRef = useRef<HTMLTextAreaElement>(null);\n\n let onHeightChange = useCallback(() => {\n // Quiet textareas always grow based on their text content.\n // Standard textareas also grow by default, unless an explicit height is set.\n if ((isQuiet || !props.height) && inputRef.current) {\n let input = inputRef.current;\n let prevAlignment = input.style.alignSelf;\n let prevOverflow = input.style.overflow;\n // Firefox scroll position is lost when overflow: 'hidden' is applied so we skip applying it.\n // The measure/applied height is also incorrect/reset if we turn on and off\n // overflow: hidden in Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1787062\n let isFirefox = 'MozAppearance' in input.style;\n if (!isFirefox) {\n input.style.overflow = 'hidden';\n }\n input.style.alignSelf = 'start';\n input.style.height = 'auto';\n // offsetHeight - clientHeight accounts for the border/padding.\n input.style.height = `${input.scrollHeight + (input.offsetHeight - input.clientHeight)}px`;\n input.style.overflow = prevOverflow;\n input.style.alignSelf = prevAlignment;\n }\n }, [isQuiet, inputRef, props.height]);\n\n useLayoutEffect(() => {\n if (inputRef.current) {\n onHeightChange();\n }\n }, [onHeightChange, inputValue, inputRef]);\n\n if (props.placeholder && process.env.NODE_ENV !== 'production') {\n console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/TextArea.html#help-text');\n }\n\n let result = useTextField({\n ...props,\n onChange: chain(onChange, setInputValue),\n inputElementType: 'textarea'\n }, inputRef);\n\n return (\n <TextFieldBase\n {...otherProps as SpectrumTextFieldBaseProps}\n ref={ref}\n inputRef={inputRef}\n {...result}\n multiLine\n isDisabled={isDisabled}\n isQuiet={isQuiet}\n isReadOnly={isReadOnly}\n isRequired={isRequired} />\n );\n});\n"],"names":[],"version":3,"file":"TextArea.module.js.map"}
1
+ {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAgBM,MAAM,0DAAW,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,SAAS,KAA4B,EAAE,GAA2C;IAClI,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,mBAAW,EAAE;IACrB,IAAI,cACF,aAAa,gBACb,UAAU,mBACV,aAAa,mBACb,aAAa,iBACb,QAAQ,EACR,GAAG,YACJ,GAAG;QAG8D;IADlE,2FAA2F;IAC3F,IAAI,CAAC,YAAY,cAAc,GAAG,CAAA,GAAA,yBAAiB,EAAE,MAAM,KAAK,EAAE,CAAA,sBAAA,MAAM,YAAY,cAAlB,iCAAA,sBAAsB,IAAI,KAAO;IACnG,IAAI,WAAW,CAAA,GAAA,aAAK,EAAuB;IAE3C,IAAI,iBAAiB,CAAA,GAAA,kBAAU,EAAE;QAC/B,2DAA2D;QAC3D,6EAA6E;QAC7E,IAAI,AAAC,CAAA,WAAW,CAAC,MAAM,MAAM,AAAD,KAAM,SAAS,OAAO,EAAE;YAClD,IAAI,QAAQ,SAAS,OAAO;YAC5B,IAAI,gBAAgB,MAAM,KAAK,CAAC,SAAS;YACzC,IAAI,eAAe,MAAM,KAAK,CAAC,QAAQ;YACvC,6FAA6F;YAC7F,2EAA2E;YAC3E,mFAAmF;YACnF,IAAI,YAAY,mBAAmB,MAAM,KAAK;YAC9C,IAAI,CAAC,WACH,MAAM,KAAK,CAAC,QAAQ,GAAG;YAEzB,MAAM,KAAK,CAAC,SAAS,GAAG;YACxB,MAAM,KAAK,CAAC,MAAM,GAAG;YACrB,+DAA+D;YAC/D,MAAM,KAAK,CAAC,MAAM,GAAG,GAAG,MAAM,YAAY,GAAI,CAAA,MAAM,YAAY,GAAG,MAAM,YAAY,AAAD,EAAG,EAAE,CAAC;YAC1F,MAAM,KAAK,CAAC,QAAQ,GAAG;YACvB,MAAM,KAAK,CAAC,SAAS,GAAG;QAC1B;IACF,GAAG;QAAC;QAAS;QAAU,MAAM,MAAM;KAAC;IAEpC,CAAA,GAAA,sBAAc,EAAE;QACd,IAAI,SAAS,OAAO,EAClB;IAEJ,GAAG;QAAC;QAAgB;QAAY;KAAS;IAEzC,IAAI,YAAY,CAAA,GAAA,aAAK,EAAE;IACvB,CAAA,GAAA,gBAAQ,EAAE;QACR,IAAI,MAAM,WAAW,IAAI,CAAC,UAAU,OAAO,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,cAAc;YACpF,QAAQ,IAAI,CAAC;YACb,UAAU,OAAO,GAAG;QACtB;IACF,GAAG;QAAC,MAAM,WAAW;KAAC;IAEtB,IAAI,SAAS,CAAA,GAAA,mBAAW,EAAE;QACxB,GAAG,KAAK;QACR,UAAU,CAAA,GAAA,YAAI,EAAE,UAAU;QAC1B,kBAAkB;IACpB,GAAG;IAEH,qBACE,gCAAC,CAAA,GAAA,yCAAY;QACV,GAAG,UAAU;QACd,KAAK;QACL,UAAU;QACT,GAAG,MAAM;QACV,WAAA;QACA,YAAY;QACZ,SAAS;QACT,YAAY;QACZ,YAAY;;AAElB","sources":["packages/@react-spectrum/textfield/src/TextArea.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 {chain, useLayoutEffect} from '@react-aria/utils';\nimport React, {Ref, useCallback, useEffect, useRef} from 'react';\nimport {SpectrumTextAreaProps, SpectrumTextFieldBaseProps, TextFieldRef} from '@react-types/textfield';\nimport {TextFieldBase} from './TextFieldBase';\nimport {useControlledState} from '@react-stately/utils';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useTextField} from '@react-aria/textfield';\n\n/**\n * TextAreas are multiline text inputs, useful for cases where users have\n * a sizable amount of text to enter. They allow for all customizations that\n * are available to text fields.\n */\nexport const TextArea = React.forwardRef(function TextArea(props: SpectrumTextAreaProps, ref: Ref<TextFieldRef<HTMLTextAreaElement>>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {\n isDisabled = false,\n isQuiet = false,\n isReadOnly = false,\n isRequired = false,\n onChange,\n ...otherProps\n } = props;\n\n // not in stately because this is so we know when to re-measure, which is a spectrum design\n let [inputValue, setInputValue] = useControlledState(props.value, props.defaultValue ?? '', () => {});\n let inputRef = useRef<HTMLTextAreaElement>(null);\n\n let onHeightChange = useCallback(() => {\n // Quiet textareas always grow based on their text content.\n // Standard textareas also grow by default, unless an explicit height is set.\n if ((isQuiet || !props.height) && inputRef.current) {\n let input = inputRef.current;\n let prevAlignment = input.style.alignSelf;\n let prevOverflow = input.style.overflow;\n // Firefox scroll position is lost when overflow: 'hidden' is applied so we skip applying it.\n // The measure/applied height is also incorrect/reset if we turn on and off\n // overflow: hidden in Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1787062\n let isFirefox = 'MozAppearance' in input.style;\n if (!isFirefox) {\n input.style.overflow = 'hidden';\n }\n input.style.alignSelf = 'start';\n input.style.height = 'auto';\n // offsetHeight - clientHeight accounts for the border/padding.\n input.style.height = `${input.scrollHeight + (input.offsetHeight - input.clientHeight)}px`;\n input.style.overflow = prevOverflow;\n input.style.alignSelf = prevAlignment;\n }\n }, [isQuiet, inputRef, props.height]);\n\n useLayoutEffect(() => {\n if (inputRef.current) {\n onHeightChange();\n }\n }, [onHeightChange, inputValue, inputRef]);\n\n let hasWarned = useRef(false);\n useEffect(() => {\n if (props.placeholder && !hasWarned.current && process.env.NODE_ENV !== 'production') {\n console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/TextArea.html#help-text');\n hasWarned.current = true;\n }\n }, [props.placeholder]);\n\n let result = useTextField({\n ...props,\n onChange: chain(onChange, setInputValue),\n inputElementType: 'textarea'\n }, inputRef);\n\n return (\n <TextFieldBase\n {...otherProps as SpectrumTextFieldBaseProps}\n ref={ref}\n inputRef={inputRef}\n {...result}\n multiLine\n isDisabled={isDisabled}\n isQuiet={isQuiet}\n isReadOnly={isReadOnly}\n isRequired={isRequired} />\n );\n});\n"],"names":[],"version":3,"file":"TextArea.module.js.map"}
@@ -34,7 +34,15 @@ const $34fd51d50eb4b056$export$2c73285ae9390cec = /*#__PURE__*/ (0, $em8OD$react
34
34
  props = (0, $em8OD$reactspectrumform.useFormProps)(props);
35
35
  let inputRef = (0, $em8OD$react.useRef)(null);
36
36
  let result = (0, $em8OD$reactariatextfield.useTextField)(props, inputRef);
37
- if (props.placeholder && process.env.NODE_ENV !== 'production') console.warn('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');
37
+ let hasWarned = (0, $em8OD$react.useRef)(false);
38
+ (0, $em8OD$react.useEffect)(()=>{
39
+ if (props.placeholder && !hasWarned.current && process.env.NODE_ENV !== 'production') {
40
+ console.warn('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');
41
+ hasWarned.current = true;
42
+ }
43
+ }, [
44
+ props.placeholder
45
+ ]);
38
46
  return /*#__PURE__*/ (0, ($parcel$interopDefault($em8OD$react))).createElement((0, $86793250183ac29e$exports.TextFieldBase), {
39
47
  ...props,
40
48
  ...result,
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAcM,MAAM,0DAAY,CAAA,GAAA,uBAAS,EAAE,SAAS,UAAU,KAA6B,EAAE,GAAsB;IAC1G,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,qCAAW,EAAE;IAErB,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAoB;IACxC,IAAI,SAAS,CAAA,GAAA,sCAAW,EAAE,OAAO;IAEjC,IAAI,MAAM,WAAW,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,cAChD,QAAQ,IAAI,CAAC;IAGf,qBACE,0DAAC,CAAA,GAAA,uCAAY;QACV,GAAG,KAAK;QACR,GAAG,MAAM;QACV,KAAK;QACL,UAAU;;AAEhB","sources":["packages/@react-spectrum/textfield/src/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 React, {forwardRef, Ref, useRef} from 'react';\nimport {SpectrumTextFieldProps, TextFieldRef} from '@react-types/textfield';\nimport {TextFieldBase} from './TextFieldBase';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useTextField} from '@react-aria/textfield';\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(props: SpectrumTextFieldProps, ref: Ref<TextFieldRef>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n\n let inputRef = useRef<HTMLInputElement>(null);\n let result = useTextField(props, inputRef);\n\n if (props.placeholder && process.env.NODE_ENV !== 'production') {\n console.warn('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\n return (\n <TextFieldBase\n {...props}\n {...result}\n ref={ref}\n inputRef={inputRef} />\n );\n});\n"],"names":[],"version":3,"file":"TextField.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAcM,MAAM,0DAAY,CAAA,GAAA,uBAAS,EAAE,SAAS,UAAU,KAA6B,EAAE,GAAsB;IAC1G,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,qCAAW,EAAE;IAErB,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAoB;IACxC,IAAI,SAAS,CAAA,GAAA,sCAAW,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,CAAC;YACb,UAAU,OAAO,GAAG;QACtB;IACF,GAAG;QAAC,MAAM,WAAW;KAAC;IAEtB,qBACE,0DAAC,CAAA,GAAA,uCAAY;QACV,GAAG,KAAK;QACR,GAAG,MAAM;QACV,KAAK;QACL,UAAU;;AAEhB","sources":["packages/@react-spectrum/textfield/src/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 React, {forwardRef, Ref, useEffect, useRef} from 'react';\nimport {SpectrumTextFieldProps, TextFieldRef} from '@react-types/textfield';\nimport {TextFieldBase} from './TextFieldBase';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useTextField} from '@react-aria/textfield';\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(props: SpectrumTextFieldProps, ref: Ref<TextFieldRef>) {\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('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 hasWarned.current = true;\n }\n }, [props.placeholder]);\n\n return (\n <TextFieldBase\n {...props}\n {...result}\n ref={ref}\n inputRef={inputRef} />\n );\n});\n"],"names":[],"version":3,"file":"TextField.main.js.map"}
@@ -1,5 +1,5 @@
1
1
  import {TextFieldBase as $599adb75312e6492$export$d22444a338b6e3c2} from "./TextFieldBase.mjs";
2
- import $9R76J$react, {forwardRef as $9R76J$forwardRef, useRef as $9R76J$useRef} from "react";
2
+ import $9R76J$react, {forwardRef as $9R76J$forwardRef, useRef as $9R76J$useRef, useEffect as $9R76J$useEffect} from "react";
3
3
  import {useFormProps as $9R76J$useFormProps} from "@react-spectrum/form";
4
4
  import {useProviderProps as $9R76J$useProviderProps} from "@react-spectrum/provider";
5
5
  import {useTextField as $9R76J$useTextField} from "@react-aria/textfield";
@@ -24,7 +24,15 @@ const $265457f9427aa380$export$2c73285ae9390cec = /*#__PURE__*/ (0, $9R76J$forwa
24
24
  props = (0, $9R76J$useFormProps)(props);
25
25
  let inputRef = (0, $9R76J$useRef)(null);
26
26
  let result = (0, $9R76J$useTextField)(props, inputRef);
27
- if (props.placeholder && process.env.NODE_ENV !== 'production') console.warn('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');
27
+ let hasWarned = (0, $9R76J$useRef)(false);
28
+ (0, $9R76J$useEffect)(()=>{
29
+ if (props.placeholder && !hasWarned.current && process.env.NODE_ENV !== 'production') {
30
+ console.warn('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');
31
+ hasWarned.current = true;
32
+ }
33
+ }, [
34
+ props.placeholder
35
+ ]);
28
36
  return /*#__PURE__*/ (0, $9R76J$react).createElement((0, $599adb75312e6492$export$d22444a338b6e3c2), {
29
37
  ...props,
30
38
  ...result,
@@ -1,5 +1,5 @@
1
1
  import {TextFieldBase as $599adb75312e6492$export$d22444a338b6e3c2} from "./TextFieldBase.module.js";
2
- import $9R76J$react, {forwardRef as $9R76J$forwardRef, useRef as $9R76J$useRef} from "react";
2
+ import $9R76J$react, {forwardRef as $9R76J$forwardRef, useRef as $9R76J$useRef, useEffect as $9R76J$useEffect} from "react";
3
3
  import {useFormProps as $9R76J$useFormProps} from "@react-spectrum/form";
4
4
  import {useProviderProps as $9R76J$useProviderProps} from "@react-spectrum/provider";
5
5
  import {useTextField as $9R76J$useTextField} from "@react-aria/textfield";
@@ -24,7 +24,15 @@ const $265457f9427aa380$export$2c73285ae9390cec = /*#__PURE__*/ (0, $9R76J$forwa
24
24
  props = (0, $9R76J$useFormProps)(props);
25
25
  let inputRef = (0, $9R76J$useRef)(null);
26
26
  let result = (0, $9R76J$useTextField)(props, inputRef);
27
- if (props.placeholder && process.env.NODE_ENV !== 'production') console.warn('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');
27
+ let hasWarned = (0, $9R76J$useRef)(false);
28
+ (0, $9R76J$useEffect)(()=>{
29
+ if (props.placeholder && !hasWarned.current && process.env.NODE_ENV !== 'production') {
30
+ console.warn('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');
31
+ hasWarned.current = true;
32
+ }
33
+ }, [
34
+ props.placeholder
35
+ ]);
28
36
  return /*#__PURE__*/ (0, $9R76J$react).createElement((0, $599adb75312e6492$export$d22444a338b6e3c2), {
29
37
  ...props,
30
38
  ...result,
@@ -1 +1 @@
1
- {"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAcM,MAAM,0DAAY,CAAA,GAAA,iBAAS,EAAE,SAAS,UAAU,KAA6B,EAAE,GAAsB;IAC1G,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,mBAAW,EAAE;IAErB,IAAI,WAAW,CAAA,GAAA,aAAK,EAAoB;IACxC,IAAI,SAAS,CAAA,GAAA,mBAAW,EAAE,OAAO;IAEjC,IAAI,MAAM,WAAW,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,cAChD,QAAQ,IAAI,CAAC;IAGf,qBACE,gCAAC,CAAA,GAAA,yCAAY;QACV,GAAG,KAAK;QACR,GAAG,MAAM;QACV,KAAK;QACL,UAAU;;AAEhB","sources":["packages/@react-spectrum/textfield/src/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 React, {forwardRef, Ref, useRef} from 'react';\nimport {SpectrumTextFieldProps, TextFieldRef} from '@react-types/textfield';\nimport {TextFieldBase} from './TextFieldBase';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useTextField} from '@react-aria/textfield';\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(props: SpectrumTextFieldProps, ref: Ref<TextFieldRef>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n\n let inputRef = useRef<HTMLInputElement>(null);\n let result = useTextField(props, inputRef);\n\n if (props.placeholder && process.env.NODE_ENV !== 'production') {\n console.warn('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\n return (\n <TextFieldBase\n {...props}\n {...result}\n ref={ref}\n inputRef={inputRef} />\n );\n});\n"],"names":[],"version":3,"file":"TextField.module.js.map"}
1
+ {"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAcM,MAAM,0DAAY,CAAA,GAAA,iBAAS,EAAE,SAAS,UAAU,KAA6B,EAAE,GAAsB;IAC1G,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,mBAAW,EAAE;IAErB,IAAI,WAAW,CAAA,GAAA,aAAK,EAAoB;IACxC,IAAI,SAAS,CAAA,GAAA,mBAAW,EAAE,OAAO;IAEjC,IAAI,YAAY,CAAA,GAAA,aAAK,EAAE;IACvB,CAAA,GAAA,gBAAQ,EAAE;QACR,IAAI,MAAM,WAAW,IAAI,CAAC,UAAU,OAAO,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,cAAc;YACpF,QAAQ,IAAI,CAAC;YACb,UAAU,OAAO,GAAG;QACtB;IACF,GAAG;QAAC,MAAM,WAAW;KAAC;IAEtB,qBACE,gCAAC,CAAA,GAAA,yCAAY;QACV,GAAG,KAAK;QACR,GAAG,MAAM;QACV,KAAK;QACL,UAAU;;AAEhB","sources":["packages/@react-spectrum/textfield/src/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 React, {forwardRef, Ref, useEffect, useRef} from 'react';\nimport {SpectrumTextFieldProps, TextFieldRef} from '@react-types/textfield';\nimport {TextFieldBase} from './TextFieldBase';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useTextField} from '@react-aria/textfield';\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(props: SpectrumTextFieldProps, ref: Ref<TextFieldRef>) {\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('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 hasWarned.current = true;\n }\n }, [props.placeholder]);\n\n return (\n <TextFieldBase\n {...props}\n {...result}\n ref={ref}\n inputRef={inputRef} />\n );\n});\n"],"names":[],"version":3,"file":"TextField.module.js.map"}
@@ -1,3 +1,4 @@
1
+ var $286a257fb3d9a493$exports = require("./intlStrings.main.js");
1
2
  require("./textfield.54643fd6.css");
2
3
  var $40cb3a00c193680f$exports = require("./textfield_vars_css.main.js");
3
4
  var $fWjzu$spectrumiconsuiAlertMedium = require("@spectrum-icons/ui/AlertMedium");
@@ -8,6 +9,7 @@ var $fWjzu$reactariautils = require("@react-aria/utils");
8
9
  var $fWjzu$react = require("react");
9
10
  var $fWjzu$reactariafocus = require("@react-aria/focus");
10
11
  var $fWjzu$reactariainteractions = require("@react-aria/interactions");
12
+ var $fWjzu$reactariai18n = require("@react-aria/i18n");
11
13
 
12
14
 
13
15
  function $parcel$interopDefault(a) {
@@ -38,6 +40,8 @@ $parcel$export(module.exports, "TextFieldBase", () => $86793250183ac29e$export$d
38
40
 
39
41
 
40
42
 
43
+
44
+
41
45
  const $86793250183ac29e$export$d22444a338b6e3c2 = /*#__PURE__*/ (0, $fWjzu$react.forwardRef)(function TextFieldBase(props, ref) {
42
46
  let { validationState: validationState = props.isInvalid ? 'invalid' : null, icon: icon, isQuiet: isQuiet = false, isDisabled: isDisabled, multiLine: multiLine, autoFocus: autoFocus, inputClassName: inputClassName, wrapperChildren: wrapperChildren, labelProps: labelProps, inputProps: inputProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, inputRef: userInputRef, isLoading: isLoading, loadingIndicator: loadingIndicator, validationIconClassName: validationIconClassName, disableFocusRing: disableFocusRing } = props;
43
47
  let { hoverProps: hoverProps, isHovered: isHovered } = (0, $fWjzu$reactariainteractions.useHover)({
@@ -65,10 +69,22 @@ const $86793250183ac29e$export$d22444a338b6e3c2 = /*#__PURE__*/ (0, $fWjzu$react
65
69
  size: 'S'
66
70
  });
67
71
  }
68
- let validationIcon = isInvalid ? /*#__PURE__*/ (0, ($parcel$interopDefault($fWjzu$react))).createElement((0, ($parcel$interopDefault($fWjzu$spectrumiconsuiAlertMedium))), null) : /*#__PURE__*/ (0, ($parcel$interopDefault($fWjzu$react))).createElement((0, ($parcel$interopDefault($fWjzu$spectrumiconsuiCheckmarkMedium))), null);
72
+ let stringFormatter = (0, $fWjzu$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($286a257fb3d9a493$exports))), '@react-spectrum/textfield');
73
+ let validId = (0, $fWjzu$reactariautils.useId)();
74
+ let validationIcon = isInvalid ? /*#__PURE__*/ (0, ($parcel$interopDefault($fWjzu$react))).createElement((0, ($parcel$interopDefault($fWjzu$spectrumiconsuiAlertMedium))), null) : /*#__PURE__*/ (0, ($parcel$interopDefault($fWjzu$react))).createElement((0, ($parcel$interopDefault($fWjzu$spectrumiconsuiCheckmarkMedium))), {
75
+ id: validId,
76
+ "aria-hidden": true,
77
+ "aria-label": stringFormatter.format('valid')
78
+ });
69
79
  let validation = /*#__PURE__*/ (0, $fWjzu$react.cloneElement)(validationIcon, {
70
80
  UNSAFE_className: (0, $fWjzu$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))), 'spectrum-Textfield-validationIcon', validationIconClassName)
71
81
  });
82
+ // Add validation icon IDREF to aria-describedby when validationState is valid
83
+ let inputPropsAriaDescribedBy = inputProps['aria-describedby'];
84
+ if (!isInvalid && validationState === 'valid' && !isLoading && !isDisabled && (!inputPropsAriaDescribedBy || !inputPropsAriaDescribedBy.includes(validId))) inputProps['aria-describedby'] = [
85
+ inputPropsAriaDescribedBy,
86
+ validId
87
+ ].join(' ').trim();
72
88
  let { focusProps: focusProps, isFocusVisible: isFocusVisible } = (0, $fWjzu$reactariafocus.useFocusRing)({
73
89
  isTextInput: true,
74
90
  autoFocus: autoFocus
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AA6BM,MAAM,0DAAgB,CAAA,GAAA,uBAAS,EAAE,SAAS,cAAc,KAAyB,EAAE,GAA8D;IACtJ,IAAI,mBACF,kBAAkB,MAAM,SAAS,GAAG,YAAY,YAChD,IAAI,WACJ,UAAU,mBACV,UAAU,aACV,SAAS,aACT,SAAS,kBACT,cAAc,mBACd,eAAe,cACf,UAAU,cACV,UAAU,oBACV,gBAAgB,qBAChB,iBAAiB,EACjB,UAAU,YAAY,aACtB,SAAS,oBACT,gBAAgB,2BAChB,uBAAuB,oBACv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;YAC7B,iCAAiC;YACjC,cAAc,CAAC,oBAAoB;QACrC;qBAGJ,0DAAC;QACE,GAAG,CAAA,GAAA,gCAAS,EAAE,YAAY,YAAY,WAAW;QAClD,KAAK;QACL,MAAM,YAAY,IAAI;QACtB,WACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAK,GACL,4BACA;YACE,gCAAgC;YAChC,cAAc;QAChB,GACA;QAGL,MACA,mBAAmB,CAAC,aAAa,CAAC,aAAa,aAAa,MAC5D,aAAa,kBACb;IAIL,qBACE,0DAAC,CAAA,GAAA,+BAAI;QACF,GAAG,KAAK;QACT,YAAY;QACZ,kBAAkB;QAClB,mBAAmB;QACnB,kBACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAK,GACL,8BACA;YACE,qCAAqC;QACvC;QAGJ,eAAe;QACf,KAAK;OACJ;AAGP","sources":["packages/@react-spectrum/textfield/src/TextFieldBase.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 AlertMedium from '@spectrum-icons/ui/AlertMedium';\nimport CheckmarkMedium from '@spectrum-icons/ui/CheckmarkMedium';\nimport {classNames, createFocusableRef} from '@react-spectrum/utils';\nimport {Field} from '@react-spectrum/label';\nimport {mergeProps} from '@react-aria/utils';\nimport {PressEvents, RefObject, ValidationResult} from '@react-types/shared';\nimport React, {cloneElement, forwardRef, HTMLAttributes, InputHTMLAttributes, LabelHTMLAttributes, ReactElement, Ref, TextareaHTMLAttributes, useImperativeHandle, useRef} from 'react';\nimport {SpectrumTextFieldProps, TextFieldRef} from '@react-types/textfield';\nimport styles from '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {useFocusRing} from '@react-aria/focus';\nimport {useHover} from '@react-aria/interactions';\n\ninterface TextFieldBaseProps extends Omit<SpectrumTextFieldProps, 'onChange' | 'validate'>, PressEvents, Partial<ValidationResult> {\n wrapperChildren?: ReactElement | ReactElement[],\n inputClassName?: string,\n validationIconClassName?: string,\n multiLine?: boolean,\n labelProps?: LabelHTMLAttributes<HTMLLabelElement>,\n inputProps: InputHTMLAttributes<HTMLInputElement> | TextareaHTMLAttributes<HTMLTextAreaElement>,\n descriptionProps?: HTMLAttributes<HTMLElement>,\n errorMessageProps?: HTMLAttributes<HTMLElement>,\n inputRef?: RefObject<HTMLInputElement | HTMLTextAreaElement | null>,\n loadingIndicator?: ReactElement,\n isLoading?: boolean,\n disableFocusRing?: boolean\n}\n\nexport const TextFieldBase = forwardRef(function TextFieldBase(props: TextFieldBaseProps, ref: Ref<TextFieldRef<HTMLInputElement | HTMLTextAreaElement>>) {\n let {\n validationState = props.isInvalid ? 'invalid' : null,\n icon,\n isQuiet = false,\n isDisabled,\n multiLine,\n autoFocus,\n inputClassName,\n wrapperChildren,\n labelProps,\n inputProps,\n descriptionProps,\n errorMessageProps,\n inputRef: userInputRef,\n isLoading,\n loadingIndicator,\n validationIconClassName,\n disableFocusRing\n } = props;\n let {hoverProps, isHovered} = useHover({isDisabled});\n let domRef = useRef<HTMLDivElement>(null);\n let defaultInputRef = useRef<HTMLInputElement | HTMLTextAreaElement>(null);\n let inputRef = userInputRef || defaultInputRef;\n\n // Expose imperative interface for ref\n useImperativeHandle(ref, () => ({\n ...createFocusableRef(domRef, inputRef),\n select() {\n if (inputRef.current) {\n inputRef.current.select();\n }\n },\n getInputElement() {\n return inputRef.current;\n }\n }));\n\n let ElementType: React.ElementType = multiLine ? 'textarea' : 'input';\n let isInvalid = validationState === 'invalid' && !isDisabled;\n\n if (icon) {\n let UNSAFE_className = classNames(\n styles,\n icon.props && (icon.props as any).UNSAFE_className,\n 'spectrum-Textfield-icon'\n );\n\n icon = cloneElement(icon, {\n UNSAFE_className,\n size: 'S'\n } as any);\n }\n\n let validationIcon = isInvalid ? <AlertMedium /> : <CheckmarkMedium />;\n let validation = cloneElement(validationIcon, {\n UNSAFE_className: classNames(\n styles,\n 'spectrum-Textfield-validationIcon',\n validationIconClassName\n )\n });\n\n let {focusProps, isFocusVisible} = useFocusRing({\n isTextInput: true,\n autoFocus\n });\n\n let textField = (\n <div\n className={\n classNames(\n styles,\n 'spectrum-Textfield',\n {\n 'spectrum-Textfield--invalid': isInvalid,\n 'spectrum-Textfield--valid': validationState === 'valid' && !isDisabled,\n 'spectrum-Textfield--loadable': loadingIndicator,\n 'spectrum-Textfield--quiet': isQuiet,\n 'spectrum-Textfield--multiline': multiLine,\n 'focus-ring': !disableFocusRing && isFocusVisible\n }\n )\n }>\n <ElementType\n {...mergeProps(inputProps, hoverProps, focusProps)}\n ref={inputRef as any}\n rows={multiLine ? 1 : undefined}\n className={\n classNames(\n styles,\n 'spectrum-Textfield-input',\n {\n 'spectrum-Textfield-inputIcon': icon,\n 'is-hovered': isHovered\n },\n inputClassName\n )\n } />\n {icon}\n {validationState && !isLoading && !isDisabled ? validation : null}\n {isLoading && loadingIndicator}\n {wrapperChildren}\n </div>\n );\n\n return (\n <Field\n {...props}\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n wrapperClassName={\n classNames(\n styles,\n 'spectrum-Textfield-wrapper',\n {\n 'spectrum-Textfield-wrapper--quiet': isQuiet\n }\n )\n }\n showErrorIcon={false}\n ref={domRef}>\n {textField}\n </Field>\n );\n});\n"],"names":[],"version":3,"file":"TextFieldBase.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AAgCM,MAAM,0DAAgB,CAAA,GAAA,uBAAS,EAAE,SAAS,cAAc,KAAyB,EAAE,GAA8D;IACtJ,IAAI,mBAC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ase.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 AlertMedium from '@spectrum-icons/ui/AlertMedium';\nimport CheckmarkMedium from '@spectrum-icons/ui/CheckmarkMedium';\nimport {classNames, createFocusableRef} from '@react-spectrum/utils';\nimport {Field} from '@react-spectrum/label';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {mergeProps, useId} from '@react-aria/utils';\nimport {PressEvents, RefObject, ValidationResult} from '@react-types/shared';\nimport React, {cloneElement, forwardRef, HTMLAttributes, InputHTMLAttributes, LabelHTMLAttributes, ReactElement, Ref, TextareaHTMLAttributes, useImperativeHandle, useRef} from 'react';\nimport {SpectrumTextFieldProps, TextFieldRef} from '@react-types/textfield';\nimport styles from '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {useFocusRing} from '@react-aria/focus';\nimport {useHover} from '@react-aria/interactions';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\ninterface TextFieldBaseProps extends Omit<SpectrumTextFieldProps, 'onChange' | 'validate'>, PressEvents, Partial<ValidationResult> {\n wrapperChildren?: ReactElement | ReactElement[],\n inputClassName?: string,\n validationIconClassName?: string,\n multiLine?: boolean,\n labelProps?: LabelHTMLAttributes<HTMLLabelElement>,\n inputProps: InputHTMLAttributes<HTMLInputElement> | TextareaHTMLAttributes<HTMLTextAreaElement>,\n descriptionProps?: HTMLAttributes<HTMLElement>,\n errorMessageProps?: HTMLAttributes<HTMLElement>,\n inputRef?: RefObject<HTMLInputElement | HTMLTextAreaElement | null>,\n loadingIndicator?: ReactElement,\n isLoading?: boolean,\n disableFocusRing?: boolean\n}\n\nexport const TextFieldBase = forwardRef(function TextFieldBase(props: TextFieldBaseProps, ref: Ref<TextFieldRef<HTMLInputElement | HTMLTextAreaElement>>) {\n let {\n validationState = props.isInvalid ? 'invalid' : null,\n icon,\n isQuiet = false,\n isDisabled,\n multiLine,\n autoFocus,\n inputClassName,\n wrapperChildren,\n labelProps,\n inputProps,\n descriptionProps,\n errorMessageProps,\n inputRef: userInputRef,\n isLoading,\n loadingIndicator,\n validationIconClassName,\n disableFocusRing\n } = props;\n let {hoverProps, isHovered} = useHover({isDisabled});\n let domRef = useRef<HTMLDivElement>(null);\n let defaultInputRef = useRef<HTMLInputElement | HTMLTextAreaElement>(null);\n let inputRef = userInputRef || defaultInputRef;\n\n // Expose imperative interface for ref\n useImperativeHandle(ref, () => ({\n ...createFocusableRef(domRef, inputRef),\n select() {\n if (inputRef.current) {\n inputRef.current.select();\n }\n },\n getInputElement() {\n return inputRef.current;\n }\n }));\n\n let ElementType: React.ElementType = multiLine ? 'textarea' : 'input';\n let isInvalid = validationState === 'invalid' && !isDisabled;\n\n if (icon) {\n let UNSAFE_className = classNames(\n styles,\n icon.props && (icon.props as any).UNSAFE_className,\n 'spectrum-Textfield-icon'\n );\n\n icon = cloneElement(icon, {\n UNSAFE_className,\n size: 'S'\n } as any);\n }\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/textfield');\n let validId = useId();\n let validationIcon = isInvalid\n ? <AlertMedium />\n : <CheckmarkMedium id={validId} aria-hidden aria-label={stringFormatter.format('valid')} />;\n let validation = cloneElement(validationIcon, {\n UNSAFE_className: classNames(\n styles,\n 'spectrum-Textfield-validationIcon',\n validationIconClassName\n )\n });\n\n // Add validation icon IDREF to aria-describedby when validationState is valid\n let inputPropsAriaDescribedBy = inputProps['aria-describedby'];\n if (\n !isInvalid && validationState === 'valid' && !isLoading && !isDisabled &&\n (!inputPropsAriaDescribedBy || !inputPropsAriaDescribedBy.includes(validId))\n ) {\n inputProps['aria-describedby'] = [inputPropsAriaDescribedBy, validId].join(' ').trim();\n }\n\n let {focusProps, isFocusVisible} = useFocusRing({\n isTextInput: true,\n autoFocus\n });\n\n let textField = (\n <div\n className={\n classNames(\n styles,\n 'spectrum-Textfield',\n {\n 'spectrum-Textfield--invalid': isInvalid,\n 'spectrum-Textfield--valid': validationState === 'valid' && !isDisabled,\n 'spectrum-Textfield--loadable': loadingIndicator,\n 'spectrum-Textfield--quiet': isQuiet,\n 'spectrum-Textfield--multiline': multiLine,\n 'focus-ring': !disableFocusRing && isFocusVisible\n }\n )\n }>\n <ElementType\n {...mergeProps(inputProps, hoverProps, focusProps)}\n ref={inputRef as any}\n rows={multiLine ? 1 : undefined}\n className={\n classNames(\n styles,\n 'spectrum-Textfield-input',\n {\n 'spectrum-Textfield-inputIcon': icon,\n 'is-hovered': isHovered\n },\n inputClassName\n )\n } />\n {icon}\n {validationState && !isLoading && !isDisabled ? validation : null}\n {isLoading && loadingIndicator}\n {wrapperChildren}\n </div>\n );\n\n return (\n <Field\n {...props}\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n wrapperClassName={\n classNames(\n styles,\n 'spectrum-Textfield-wrapper',\n {\n 'spectrum-Textfield-wrapper--quiet': isQuiet\n }\n )\n }\n showErrorIcon={false}\n ref={domRef}>\n {textField}\n </Field>\n );\n});\n"],"names":[],"version":3,"file":"TextFieldBase.main.js.map"}
@@ -1,13 +1,15 @@
1
+ import $264pK$intlStringsmodulejs from "./intlStrings.mjs";
1
2
  import "./textfield.54643fd6.css";
2
3
  import $264pK$textfield_vars_cssmodulejs from "./textfield_vars_css.mjs";
3
4
  import $264pK$spectrumiconsuiAlertMedium from "@spectrum-icons/ui/AlertMedium";
4
5
  import $264pK$spectrumiconsuiCheckmarkMedium from "@spectrum-icons/ui/CheckmarkMedium";
5
6
  import {createFocusableRef as $264pK$createFocusableRef, classNames as $264pK$classNames} from "@react-spectrum/utils";
6
7
  import {Field as $264pK$Field} from "@react-spectrum/label";
7
- import {mergeProps as $264pK$mergeProps} from "@react-aria/utils";
8
+ import {useId as $264pK$useId, mergeProps as $264pK$mergeProps} from "@react-aria/utils";
8
9
  import $264pK$react, {forwardRef as $264pK$forwardRef, useRef as $264pK$useRef, useImperativeHandle as $264pK$useImperativeHandle, cloneElement as $264pK$cloneElement} from "react";
9
10
  import {useFocusRing as $264pK$useFocusRing} from "@react-aria/focus";
10
11
  import {useHover as $264pK$useHover} from "@react-aria/interactions";
12
+ import {useLocalizedStringFormatter as $264pK$useLocalizedStringFormatter} from "@react-aria/i18n";
11
13
 
12
14
 
13
15
  function $parcel$interopDefault(a) {
@@ -32,6 +34,8 @@ function $parcel$interopDefault(a) {
32
34
 
33
35
 
34
36
 
37
+
38
+
35
39
  const $599adb75312e6492$export$d22444a338b6e3c2 = /*#__PURE__*/ (0, $264pK$forwardRef)(function TextFieldBase(props, ref) {
36
40
  let { validationState: validationState = props.isInvalid ? 'invalid' : null, icon: icon, isQuiet: isQuiet = false, isDisabled: isDisabled, multiLine: multiLine, autoFocus: autoFocus, inputClassName: inputClassName, wrapperChildren: wrapperChildren, labelProps: labelProps, inputProps: inputProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, inputRef: userInputRef, isLoading: isLoading, loadingIndicator: loadingIndicator, validationIconClassName: validationIconClassName, disableFocusRing: disableFocusRing } = props;
37
41
  let { hoverProps: hoverProps, isHovered: isHovered } = (0, $264pK$useHover)({
@@ -59,10 +63,22 @@ const $599adb75312e6492$export$d22444a338b6e3c2 = /*#__PURE__*/ (0, $264pK$forwa
59
63
  size: 'S'
60
64
  });
61
65
  }
62
- let validationIcon = isInvalid ? /*#__PURE__*/ (0, $264pK$react).createElement((0, $264pK$spectrumiconsuiAlertMedium), null) : /*#__PURE__*/ (0, $264pK$react).createElement((0, $264pK$spectrumiconsuiCheckmarkMedium), null);
66
+ let stringFormatter = (0, $264pK$useLocalizedStringFormatter)((0, ($parcel$interopDefault($264pK$intlStringsmodulejs))), '@react-spectrum/textfield');
67
+ let validId = (0, $264pK$useId)();
68
+ let validationIcon = isInvalid ? /*#__PURE__*/ (0, $264pK$react).createElement((0, $264pK$spectrumiconsuiAlertMedium), null) : /*#__PURE__*/ (0, $264pK$react).createElement((0, $264pK$spectrumiconsuiCheckmarkMedium), {
69
+ id: validId,
70
+ "aria-hidden": true,
71
+ "aria-label": stringFormatter.format('valid')
72
+ });
63
73
  let validation = /*#__PURE__*/ (0, $264pK$cloneElement)(validationIcon, {
64
74
  UNSAFE_className: (0, $264pK$classNames)((0, ($parcel$interopDefault($264pK$textfield_vars_cssmodulejs))), 'spectrum-Textfield-validationIcon', validationIconClassName)
65
75
  });
76
+ // Add validation icon IDREF to aria-describedby when validationState is valid
77
+ let inputPropsAriaDescribedBy = inputProps['aria-describedby'];
78
+ if (!isInvalid && validationState === 'valid' && !isLoading && !isDisabled && (!inputPropsAriaDescribedBy || !inputPropsAriaDescribedBy.includes(validId))) inputProps['aria-describedby'] = [
79
+ inputPropsAriaDescribedBy,
80
+ validId
81
+ ].join(' ').trim();
66
82
  let { focusProps: focusProps, isFocusVisible: isFocusVisible } = (0, $264pK$useFocusRing)({
67
83
  isTextInput: true,
68
84
  autoFocus: autoFocus
@@ -1,13 +1,15 @@
1
+ import $264pK$intlStringsmodulejs from "./intlStrings.module.js";
1
2
  import "./textfield.54643fd6.css";
2
3
  import $264pK$textfield_vars_cssmodulejs from "./textfield_vars_css.module.js";
3
4
  import $264pK$spectrumiconsuiAlertMedium from "@spectrum-icons/ui/AlertMedium";
4
5
  import $264pK$spectrumiconsuiCheckmarkMedium from "@spectrum-icons/ui/CheckmarkMedium";
5
6
  import {createFocusableRef as $264pK$createFocusableRef, classNames as $264pK$classNames} from "@react-spectrum/utils";
6
7
  import {Field as $264pK$Field} from "@react-spectrum/label";
7
- import {mergeProps as $264pK$mergeProps} from "@react-aria/utils";
8
+ import {useId as $264pK$useId, mergeProps as $264pK$mergeProps} from "@react-aria/utils";
8
9
  import $264pK$react, {forwardRef as $264pK$forwardRef, useRef as $264pK$useRef, useImperativeHandle as $264pK$useImperativeHandle, cloneElement as $264pK$cloneElement} from "react";
9
10
  import {useFocusRing as $264pK$useFocusRing} from "@react-aria/focus";
10
11
  import {useHover as $264pK$useHover} from "@react-aria/interactions";
12
+ import {useLocalizedStringFormatter as $264pK$useLocalizedStringFormatter} from "@react-aria/i18n";
11
13
 
12
14
 
13
15
  function $parcel$interopDefault(a) {
@@ -32,6 +34,8 @@ function $parcel$interopDefault(a) {
32
34
 
33
35
 
34
36
 
37
+
38
+
35
39
  const $599adb75312e6492$export$d22444a338b6e3c2 = /*#__PURE__*/ (0, $264pK$forwardRef)(function TextFieldBase(props, ref) {
36
40
  let { validationState: validationState = props.isInvalid ? 'invalid' : null, icon: icon, isQuiet: isQuiet = false, isDisabled: isDisabled, multiLine: multiLine, autoFocus: autoFocus, inputClassName: inputClassName, wrapperChildren: wrapperChildren, labelProps: labelProps, inputProps: inputProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, inputRef: userInputRef, isLoading: isLoading, loadingIndicator: loadingIndicator, validationIconClassName: validationIconClassName, disableFocusRing: disableFocusRing } = props;
37
41
  let { hoverProps: hoverProps, isHovered: isHovered } = (0, $264pK$useHover)({
@@ -59,10 +63,22 @@ const $599adb75312e6492$export$d22444a338b6e3c2 = /*#__PURE__*/ (0, $264pK$forwa
59
63
  size: 'S'
60
64
  });
61
65
  }
62
- let validationIcon = isInvalid ? /*#__PURE__*/ (0, $264pK$react).createElement((0, $264pK$spectrumiconsuiAlertMedium), null) : /*#__PURE__*/ (0, $264pK$react).createElement((0, $264pK$spectrumiconsuiCheckmarkMedium), null);
66
+ let stringFormatter = (0, $264pK$useLocalizedStringFormatter)((0, ($parcel$interopDefault($264pK$intlStringsmodulejs))), '@react-spectrum/textfield');
67
+ let validId = (0, $264pK$useId)();
68
+ let validationIcon = isInvalid ? /*#__PURE__*/ (0, $264pK$react).createElement((0, $264pK$spectrumiconsuiAlertMedium), null) : /*#__PURE__*/ (0, $264pK$react).createElement((0, $264pK$spectrumiconsuiCheckmarkMedium), {
69
+ id: validId,
70
+ "aria-hidden": true,
71
+ "aria-label": stringFormatter.format('valid')
72
+ });
63
73
  let validation = /*#__PURE__*/ (0, $264pK$cloneElement)(validationIcon, {
64
74
  UNSAFE_className: (0, $264pK$classNames)((0, ($parcel$interopDefault($264pK$textfield_vars_cssmodulejs))), 'spectrum-Textfield-validationIcon', validationIconClassName)
65
75
  });
76
+ // Add validation icon IDREF to aria-describedby when validationState is valid
77
+ let inputPropsAriaDescribedBy = inputProps['aria-describedby'];
78
+ if (!isInvalid && validationState === 'valid' && !isLoading && !isDisabled && (!inputPropsAriaDescribedBy || !inputPropsAriaDescribedBy.includes(validId))) inputProps['aria-describedby'] = [
79
+ inputPropsAriaDescribedBy,
80
+ validId
81
+ ].join(' ').trim();
66
82
  let { focusProps: focusProps, isFocusVisible: isFocusVisible } = (0, $264pK$useFocusRing)({
67
83
  isTextInput: true,
68
84
  autoFocus: autoFocus
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AA6BM,MAAM,0DAAgB,CAAA,GAAA,iBAAS,EAAE,SAAS,cAAc,KAAyB,EAAE,GAA8D;IACtJ,IAAI,mBACF,kBAAkB,MAAM,SAAS,GAAG,YAAY,YAChD,IAAI,WACJ,UAAU,mBACV,UAAU,aACV,SAAS,aACT,SAAS,kBACT,cAAc,mBACd,eAAe,cACf,UAAU,cACV,UAAU,oBACV,gBAAgB,qBAChB,iBAAiB,EACjB,UAAU,YAAY,aACtB,SAAS,oBACT,gBAAgB,2BAChB,uBAAuB,oBACvB,gBAAgB,EACjB,GAAG;IACJ,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;oBAAC;IAAU;IAClD,IAAI,SAAS,CAAA,GAAA,aAAK,EAAkB;IACpC,IAAI,kBAAkB,CAAA,GAAA,aAAK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A,GAAA,2DAAK,GACL,4BACA;YACE,gCAAgC;YAChC,cAAc;QAChB,GACA;QAGL,MACA,mBAAmB,CAAC,aAAa,CAAC,aAAa,aAAa,MAC5D,aAAa,kBACb;IAIL,qBACE,gCAAC,CAAA,GAAA,YAAI;QACF,GAAG,KAAK;QACT,YAAY;QACZ,kBAAkB;QAClB,mBAAmB;QACnB,kBACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,2DAAK,GACL,8BACA;YACE,qCAAqC;QACvC;QAGJ,eAAe;QACf,KAAK;OACJ;AAGP","sources":["packages/@react-spectrum/textfield/src/TextFieldBase.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 AlertMedium from '@spectrum-icons/ui/AlertMedium';\nimport CheckmarkMedium from '@spectrum-icons/ui/CheckmarkMedium';\nimport {classNames, createFocusableRef} from '@react-spectrum/utils';\nimport {Field} from '@react-spectrum/label';\nimport {mergeProps} from '@react-aria/utils';\nimport {PressEvents, RefObject, ValidationResult} from '@react-types/shared';\nimport React, {cloneElement, forwardRef, HTMLAttributes, InputHTMLAttributes, LabelHTMLAttributes, ReactElement, Ref, TextareaHTMLAttributes, useImperativeHandle, useRef} from 'react';\nimport {SpectrumTextFieldProps, TextFieldRef} from '@react-types/textfield';\nimport styles from '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {useFocusRing} from '@react-aria/focus';\nimport {useHover} from '@react-aria/interactions';\n\ninterface TextFieldBaseProps extends Omit<SpectrumTextFieldProps, 'onChange' | 'validate'>, PressEvents, Partial<ValidationResult> {\n wrapperChildren?: ReactElement | ReactElement[],\n inputClassName?: string,\n validationIconClassName?: string,\n multiLine?: boolean,\n labelProps?: LabelHTMLAttributes<HTMLLabelElement>,\n inputProps: InputHTMLAttributes<HTMLInputElement> | TextareaHTMLAttributes<HTMLTextAreaElement>,\n descriptionProps?: HTMLAttributes<HTMLElement>,\n errorMessageProps?: HTMLAttributes<HTMLElement>,\n inputRef?: RefObject<HTMLInputElement | HTMLTextAreaElement | null>,\n loadingIndicator?: ReactElement,\n isLoading?: boolean,\n disableFocusRing?: boolean\n}\n\nexport const TextFieldBase = forwardRef(function TextFieldBase(props: TextFieldBaseProps, ref: Ref<TextFieldRef<HTMLInputElement | HTMLTextAreaElement>>) {\n let {\n validationState = props.isInvalid ? 'invalid' : null,\n icon,\n isQuiet = false,\n isDisabled,\n multiLine,\n autoFocus,\n inputClassName,\n wrapperChildren,\n labelProps,\n inputProps,\n descriptionProps,\n errorMessageProps,\n inputRef: userInputRef,\n isLoading,\n loadingIndicator,\n validationIconClassName,\n disableFocusRing\n } = props;\n let {hoverProps, isHovered} = useHover({isDisabled});\n let domRef = useRef<HTMLDivElement>(null);\n let defaultInputRef = useRef<HTMLInputElement | HTMLTextAreaElement>(null);\n let inputRef = userInputRef || defaultInputRef;\n\n // Expose imperative interface for ref\n useImperativeHandle(ref, () => ({\n ...createFocusableRef(domRef, inputRef),\n select() {\n if (inputRef.current) {\n inputRef.current.select();\n }\n },\n getInputElement() {\n return inputRef.current;\n }\n }));\n\n let ElementType: React.ElementType = multiLine ? 'textarea' : 'input';\n let isInvalid = validationState === 'invalid' && !isDisabled;\n\n if (icon) {\n let UNSAFE_className = classNames(\n styles,\n icon.props && (icon.props as any).UNSAFE_className,\n 'spectrum-Textfield-icon'\n );\n\n icon = cloneElement(icon, {\n UNSAFE_className,\n size: 'S'\n } as any);\n }\n\n let validationIcon = isInvalid ? <AlertMedium /> : <CheckmarkMedium />;\n let validation = cloneElement(validationIcon, {\n UNSAFE_className: classNames(\n styles,\n 'spectrum-Textfield-validationIcon',\n validationIconClassName\n )\n });\n\n let {focusProps, isFocusVisible} = useFocusRing({\n isTextInput: true,\n autoFocus\n });\n\n let textField = (\n <div\n className={\n classNames(\n styles,\n 'spectrum-Textfield',\n {\n 'spectrum-Textfield--invalid': isInvalid,\n 'spectrum-Textfield--valid': validationState === 'valid' && !isDisabled,\n 'spectrum-Textfield--loadable': loadingIndicator,\n 'spectrum-Textfield--quiet': isQuiet,\n 'spectrum-Textfield--multiline': multiLine,\n 'focus-ring': !disableFocusRing && isFocusVisible\n }\n )\n }>\n <ElementType\n {...mergeProps(inputProps, hoverProps, focusProps)}\n ref={inputRef as any}\n rows={multiLine ? 1 : undefined}\n className={\n classNames(\n styles,\n 'spectrum-Textfield-input',\n {\n 'spectrum-Textfield-inputIcon': icon,\n 'is-hovered': isHovered\n },\n inputClassName\n )\n } />\n {icon}\n {validationState && !isLoading && !isDisabled ? validation : null}\n {isLoading && loadingIndicator}\n {wrapperChildren}\n </div>\n );\n\n return (\n <Field\n {...props}\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n wrapperClassName={\n classNames(\n styles,\n 'spectrum-Textfield-wrapper',\n {\n 'spectrum-Textfield-wrapper--quiet': isQuiet\n }\n )\n }\n showErrorIcon={false}\n ref={domRef}>\n {textField}\n </Field>\n );\n});\n"],"names":[],"version":3,"file":"TextFieldBase.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AAgCM,MAAM,0DAAgB,CAAA,GAAA,iBAAS,EAAE,SAAS,cAAc,KAAyB,EAAE,GAA8D;IACtJ,IAAI,mBACF,kBAAkB,MAAM,SAAS,GAAG,YAAY,YAChD,IAAI,WACJ,UAAU,mBACV,UAAU,aACV,SAAS,aACT,SAAS,kBACT,cAAc,mBACd,eAAe,cACf,UAAU,cACV,UAAU,oBACV,gBAAgB,qBAChB,iBAAiB,EACjB,UAAU,YAAY,aACtB,SAAS,oB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C,aAAa,oBAAoB,WAAW,CAAC,aAAa,CAAC,cAC3D,CAAA,CAAC,6BAA6B,CAAC,0BAA0B,QAAQ,CAAC,QAAO,GAE1E,UAAU,CAAC,mBAAmB,GAAG;QAAC;QAA2B;KAAQ,CAAC,IAAI,CAAC,KAAK,IAAI;IAGtF,IAAI,cAAC,UAAU,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,mBAAW,EAAE;QAC9C,aAAa;mBACb;IACF;IAEA,IAAI,0BACF,gCAAC;QACC,WACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,2DAAK,GACL,sBACA;YACE,+BAA+B;YAC/B,6BAA6B,oBAAoB,WAAW,CAAC;YAC7D,gCAAgC;YAChC,6BAA6B;YAC7B,iCAAiC;YACjC,cAAc,CAAC,oBAAoB;QACrC;qBAGJ,gCAAC;QACE,GAAG,CAAA,GAAA,iBAAS,EAAE,YAAY,YAAY,WAAW;QAClD,KAAK;QACL,MAAM,YAAY,IAAI;QACtB,WACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,2DAAK,GACL,4BACA;YACE,gCAAgC;YAChC,cAAc;QAChB,GACA;QAGL,MACA,mBAAmB,CAAC,aAAa,CAAC,aAAa,aAAa,MAC5D,aAAa,kBACb;IAIL,qBACE,gCAAC,CAAA,GAAA,YAAI;QACF,GAAG,KAAK;QACT,YAAY;QACZ,kBAAkB;QAClB,mBAAmB;QACnB,kBACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,2DAAK,GACL,8BACA;YACE,qCAAqC;QACvC;QAGJ,eAAe;QACf,KAAK;OACJ;AAGP","sources":["packages/@react-spectrum/textfield/src/TextFieldBase.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 AlertMedium from '@spectrum-icons/ui/AlertMedium';\nimport CheckmarkMedium from '@spectrum-icons/ui/CheckmarkMedium';\nimport {classNames, createFocusableRef} from '@react-spectrum/utils';\nimport {Field} from '@react-spectrum/label';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {mergeProps, useId} from '@react-aria/utils';\nimport {PressEvents, RefObject, ValidationResult} from '@react-types/shared';\nimport React, {cloneElement, forwardRef, HTMLAttributes, InputHTMLAttributes, LabelHTMLAttributes, ReactElement, Ref, TextareaHTMLAttributes, useImperativeHandle, useRef} from 'react';\nimport {SpectrumTextFieldProps, TextFieldRef} from '@react-types/textfield';\nimport styles from '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {useFocusRing} from '@react-aria/focus';\nimport {useHover} from '@react-aria/interactions';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\ninterface TextFieldBaseProps extends Omit<SpectrumTextFieldProps, 'onChange' | 'validate'>, PressEvents, Partial<ValidationResult> {\n wrapperChildren?: ReactElement | ReactElement[],\n inputClassName?: string,\n validationIconClassName?: string,\n multiLine?: boolean,\n labelProps?: LabelHTMLAttributes<HTMLLabelElement>,\n inputProps: InputHTMLAttributes<HTMLInputElement> | TextareaHTMLAttributes<HTMLTextAreaElement>,\n descriptionProps?: HTMLAttributes<HTMLElement>,\n errorMessageProps?: HTMLAttributes<HTMLElement>,\n inputRef?: RefObject<HTMLInputElement | HTMLTextAreaElement | null>,\n loadingIndicator?: ReactElement,\n isLoading?: boolean,\n disableFocusRing?: boolean\n}\n\nexport const TextFieldBase = forwardRef(function TextFieldBase(props: TextFieldBaseProps, ref: Ref<TextFieldRef<HTMLInputElement | HTMLTextAreaElement>>) {\n let {\n validationState = props.isInvalid ? 'invalid' : null,\n icon,\n isQuiet = false,\n isDisabled,\n multiLine,\n autoFocus,\n inputClassName,\n wrapperChildren,\n labelProps,\n inputProps,\n descriptionProps,\n errorMessageProps,\n inputRef: userInputRef,\n isLoading,\n loadingIndicator,\n validationIconClassName,\n disableFocusRing\n } = props;\n let {hoverProps, isHovered} = useHover({isDisabled});\n let domRef = useRef<HTMLDivElement>(null);\n let defaultInputRef = useRef<HTMLInputElement | HTMLTextAreaElement>(null);\n let inputRef = userInputRef || defaultInputRef;\n\n // Expose imperative interface for ref\n useImperativeHandle(ref, () => ({\n ...createFocusableRef(domRef, inputRef),\n select() {\n if (inputRef.current) {\n inputRef.current.select();\n }\n },\n getInputElement() {\n return inputRef.current;\n }\n }));\n\n let ElementType: React.ElementType = multiLine ? 'textarea' : 'input';\n let isInvalid = validationState === 'invalid' && !isDisabled;\n\n if (icon) {\n let UNSAFE_className = classNames(\n styles,\n icon.props && (icon.props as any).UNSAFE_className,\n 'spectrum-Textfield-icon'\n );\n\n icon = cloneElement(icon, {\n UNSAFE_className,\n size: 'S'\n } as any);\n }\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/textfield');\n let validId = useId();\n let validationIcon = isInvalid\n ? <AlertMedium />\n : <CheckmarkMedium id={validId} aria-hidden aria-label={stringFormatter.format('valid')} />;\n let validation = cloneElement(validationIcon, {\n UNSAFE_className: classNames(\n styles,\n 'spectrum-Textfield-validationIcon',\n validationIconClassName\n )\n });\n\n // Add validation icon IDREF to aria-describedby when validationState is valid\n let inputPropsAriaDescribedBy = inputProps['aria-describedby'];\n if (\n !isInvalid && validationState === 'valid' && !isLoading && !isDisabled &&\n (!inputPropsAriaDescribedBy || !inputPropsAriaDescribedBy.includes(validId))\n ) {\n inputProps['aria-describedby'] = [inputPropsAriaDescribedBy, validId].join(' ').trim();\n }\n\n let {focusProps, isFocusVisible} = useFocusRing({\n isTextInput: true,\n autoFocus\n });\n\n let textField = (\n <div\n className={\n classNames(\n styles,\n 'spectrum-Textfield',\n {\n 'spectrum-Textfield--invalid': isInvalid,\n 'spectrum-Textfield--valid': validationState === 'valid' && !isDisabled,\n 'spectrum-Textfield--loadable': loadingIndicator,\n 'spectrum-Textfield--quiet': isQuiet,\n 'spectrum-Textfield--multiline': multiLine,\n 'focus-ring': !disableFocusRing && isFocusVisible\n }\n )\n }>\n <ElementType\n {...mergeProps(inputProps, hoverProps, focusProps)}\n ref={inputRef as any}\n rows={multiLine ? 1 : undefined}\n className={\n classNames(\n styles,\n 'spectrum-Textfield-input',\n {\n 'spectrum-Textfield-inputIcon': icon,\n 'is-hovered': isHovered\n },\n inputClassName\n )\n } />\n {icon}\n {validationState && !isLoading && !isDisabled ? validation : null}\n {isLoading && loadingIndicator}\n {wrapperChildren}\n </div>\n );\n\n return (\n <Field\n {...props}\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n wrapperClassName={\n classNames(\n styles,\n 'spectrum-Textfield-wrapper',\n {\n 'spectrum-Textfield-wrapper--quiet': isQuiet\n }\n )\n }\n showErrorIcon={false}\n ref={domRef}>\n {textField}\n </Field>\n );\n});\n"],"names":[],"version":3,"file":"TextFieldBase.module.js.map"}
@@ -0,0 +1,6 @@
1
+ module.exports = {
2
+ "valid": `\u{635}\u{627}\u{644}\u{62D}`
3
+ };
4
+
5
+
6
+ //# sourceMappingURL=ar-AE.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":"AAAA,iBAAiB;IAAG,SAAS,CAAC,4BAAI,CAAC;AACnC","sources":["packages/@react-spectrum/textfield/intl/ar-AE.json"],"sourcesContent":["{\n \"valid\": \"صالح\"\n}\n"],"names":[],"version":3,"file":"ar-AE.main.js.map"}
package/dist/ar-AE.mjs ADDED
@@ -0,0 +1,8 @@
1
+ var $0913a66d7c610208$exports = {};
2
+ $0913a66d7c610208$exports = {
3
+ "valid": `\u{635}\u{627}\u{644}\u{62D}`
4
+ };
5
+
6
+
7
+ export {$0913a66d7c610208$exports as default};
8
+ //# sourceMappingURL=ar-AE.module.js.map
@@ -0,0 +1,8 @@
1
+ var $0913a66d7c610208$exports = {};
2
+ $0913a66d7c610208$exports = {
3
+ "valid": `\u{635}\u{627}\u{644}\u{62D}`
4
+ };
5
+
6
+
7
+ export {$0913a66d7c610208$exports as default};
8
+ //# sourceMappingURL=ar-AE.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";AAAA,4BAAiB;IAAG,SAAS,CAAC,4BAAI,CAAC;AACnC","sources":["packages/@react-spectrum/textfield/intl/ar-AE.json"],"sourcesContent":["{\n \"valid\": \"صالح\"\n}\n"],"names":[],"version":3,"file":"ar-AE.module.js.map"}
@@ -0,0 +1,6 @@
1
+ module.exports = {
2
+ "valid": `\u{412}\u{430}\u{43B}\u{438}\u{434}\u{435}\u{43D}`
3
+ };
4
+
5
+
6
+ //# sourceMappingURL=bg-BG.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":"AAAA,iBAAiB;IAAG,SAAS,CAAC,iDAAO,CAAC;AACtC","sources":["packages/@react-spectrum/textfield/intl/bg-BG.json"],"sourcesContent":["{\n \"valid\": \"Валиден\"\n}\n"],"names":[],"version":3,"file":"bg-BG.main.js.map"}
package/dist/bg-BG.mjs ADDED
@@ -0,0 +1,8 @@
1
+ var $068c9f18677c69da$exports = {};
2
+ $068c9f18677c69da$exports = {
3
+ "valid": `\u{412}\u{430}\u{43B}\u{438}\u{434}\u{435}\u{43D}`
4
+ };
5
+
6
+
7
+ export {$068c9f18677c69da$exports as default};
8
+ //# sourceMappingURL=bg-BG.module.js.map
@@ -0,0 +1,8 @@
1
+ var $068c9f18677c69da$exports = {};
2
+ $068c9f18677c69da$exports = {
3
+ "valid": `\u{412}\u{430}\u{43B}\u{438}\u{434}\u{435}\u{43D}`
4
+ };
5
+
6
+
7
+ export {$068c9f18677c69da$exports as default};
8
+ //# sourceMappingURL=bg-BG.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";AAAA,4BAAiB;IAAG,SAAS,CAAC,iDAAO,CAAC;AACtC","sources":["packages/@react-spectrum/textfield/intl/bg-BG.json"],"sourcesContent":["{\n \"valid\": \"Валиден\"\n}\n"],"names":[],"version":3,"file":"bg-BG.module.js.map"}
@@ -0,0 +1,6 @@
1
+ module.exports = {
2
+ "valid": `Platn\xe9`
3
+ };
4
+
5
+
6
+ //# sourceMappingURL=cs-CZ.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":"AAAA,iBAAiB;IAAG,SAAS,CAAC,SAAM,CAAC;AACrC","sources":["packages/@react-spectrum/textfield/intl/cs-CZ.json"],"sourcesContent":["{\n \"valid\": \"Platné\"\n}\n"],"names":[],"version":3,"file":"cs-CZ.main.js.map"}
package/dist/cs-CZ.mjs ADDED
@@ -0,0 +1,8 @@
1
+ var $e85df324f9ee0179$exports = {};
2
+ $e85df324f9ee0179$exports = {
3
+ "valid": `Platn\xe9`
4
+ };
5
+
6
+
7
+ export {$e85df324f9ee0179$exports as default};
8
+ //# sourceMappingURL=cs-CZ.module.js.map
@@ -0,0 +1,8 @@
1
+ var $e85df324f9ee0179$exports = {};
2
+ $e85df324f9ee0179$exports = {
3
+ "valid": `Platn\xe9`
4
+ };
5
+
6
+
7
+ export {$e85df324f9ee0179$exports as default};
8
+ //# sourceMappingURL=cs-CZ.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";AAAA,4BAAiB;IAAG,SAAS,CAAC,SAAM,CAAC;AACrC","sources":["packages/@react-spectrum/textfield/intl/cs-CZ.json"],"sourcesContent":["{\n \"valid\": \"Platné\"\n}\n"],"names":[],"version":3,"file":"cs-CZ.module.js.map"}
@@ -0,0 +1,6 @@
1
+ module.exports = {
2
+ "valid": `Gyldig`
3
+ };
4
+
5
+
6
+ //# sourceMappingURL=da-DK.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":"AAAA,iBAAiB;IAAG,SAAS,CAAC,MAAM,CAAC;AACrC","sources":["packages/@react-spectrum/textfield/intl/da-DK.json"],"sourcesContent":["{\n \"valid\": \"Gyldig\"\n}\n"],"names":[],"version":3,"file":"da-DK.main.js.map"}
package/dist/da-DK.mjs ADDED
@@ -0,0 +1,8 @@
1
+ var $cb6c30150c5ecac2$exports = {};
2
+ $cb6c30150c5ecac2$exports = {
3
+ "valid": `Gyldig`
4
+ };
5
+
6
+
7
+ export {$cb6c30150c5ecac2$exports as default};
8
+ //# sourceMappingURL=da-DK.module.js.map