@@ -23,13 +23,11 @@ import type { InternalTheme, ThemeProp } from '../../types';
2323
2424export type TextFieldVariant = 'filled' | 'outlined' ;
2525
26- export type TextFieldStatus = 'error' | 'disabled' | ( 'error' | 'disabled' ) [ ] ;
27-
2826export interface TextFieldAccessoryProps {
2927 style : StyleProp < ViewStyle > ;
3028 multiline : boolean ;
31- editable : boolean ;
32- status ?: TextFieldStatus ;
29+ disabled : boolean ;
30+ error : boolean ;
3331}
3432
3533export type TextFieldSharedApi = {
@@ -123,10 +121,9 @@ export interface TextFieldProps extends TextInputProps {
123121 */
124122 variant ?: TextFieldVariant ;
125123 /**
126- * A style modifier for different input states. Accepts an array so both
127- * `'error'` and `'disabled'` can be active simultaneously.
124+ * When `true`, the field uses error styling and validation semantics (`aria-invalid`).
128125 */
129- status ?: TextFieldStatus ;
126+ error ?: boolean ;
130127 /**
131128 * The label text to display above the input.
132129 */
@@ -137,7 +134,7 @@ export interface TextFieldProps extends TextInputProps {
137134 labelProps ?: TextProps ;
138135 /**
139136 * Supporting text to display below the input (Material Design 3). When
140- * `status ` is `error `, this text is styled as an error message.
137+ * `error ` is `true `, this text is styled as an error message.
141138 */
142139 supportingText ?: string ;
143140 /**
@@ -213,10 +210,10 @@ export interface TextFieldProps extends TextInputProps {
213210 * <TextField.Icon {...props} icon="magnify" />
214211 * );
215212 *
216- * const ClearAccessory = ({ style, editable }) => (
213+ * const ClearAccessory = ({ style, disabled }) => (
217214 * <Pressable
218215 * style={style}
219- * disabled={!editable }
216+ * disabled={disabled }
220217 * onPress={() => setText('')}
221218 * accessibilityRole="button"
222219 * accessibilityLabel="Clear text"
@@ -245,7 +242,7 @@ function TextField(props: TextFieldProps) {
245242 /* eslint-disable @typescript-eslint/no-unused-vars -- peel TextField-only props before TextInput spread */
246243 const {
247244 ref,
248- status ,
245+ error ,
249246 label,
250247 supportingText,
251248 supportingTextProps,
@@ -345,8 +342,8 @@ function TextField(props: TextFieldProps) {
345342 { ! ! LeadingAccessory && (
346343 < LeadingAccessory
347344 style = { $leadingAccessoryStyles }
348- status = { status }
349- editable = { ! disabled }
345+ error = { hasError }
346+ disabled = { disabled }
350347 multiline = { ! ! textInputProps . multiline }
351348 />
352349 ) }
@@ -363,7 +360,6 @@ function TextField(props: TextFieldProps) {
363360 aria-disabled = { disabled }
364361 aria-invalid = { hasError }
365362 ref = { input }
366- editable = { ! disabled }
367363 onFocus = { onFocusHandler }
368364 onBlur = { onBlurHandler }
369365 selectionColor = { $selectionColor }
@@ -384,8 +380,8 @@ function TextField(props: TextFieldProps) {
384380 { TrailingAccessory ? (
385381 < TrailingAccessory
386382 style = { $trailingAccessoryStyles }
387- status = { status }
388- editable = { ! disabled }
383+ error = { hasError }
384+ disabled = { disabled }
389385 multiline = { ! ! textInputProps . multiline }
390386 />
391387 ) : hasError ? (
0 commit comments