@@ -13,7 +13,117 @@ import deprecate from '../../prop-types/deprecate';
13
13
import { usePrefix } from '../../internal/usePrefix' ;
14
14
import { FormContext } from '../FluidForm/FormContext' ;
15
15
16
- function FluidTextArea ( { className, ...other } ) {
16
+ export interface FluidTextAreaProps {
17
+ /**
18
+ * Provide a custom className that is applied directly to the underlying
19
+ * `<textarea>` node
20
+ */
21
+ className ?: string ;
22
+
23
+ /**
24
+ * Specify the `cols` attribute for the underlying `<textarea>` node
25
+ */
26
+ cols ?: number ;
27
+
28
+ /**
29
+ * Optionally provide the default value of the `<textarea>`
30
+ */
31
+ defaultValue ?: string | number ;
32
+
33
+ /**
34
+ * Specify whether the control is disabled
35
+ */
36
+ disabled ?: boolean ;
37
+
38
+ /**
39
+ * Specify whether to display the character counter
40
+ */
41
+ enableCounter ?: boolean ;
42
+
43
+ /**
44
+ * Provide text that is used alongside the control label for additional help
45
+ */
46
+ helperText ?: React . ReactNode ;
47
+
48
+ /**
49
+ * Specify whether you want the underlying label to be visually hidden
50
+ */
51
+ hideLabel ?: boolean ;
52
+
53
+ /**
54
+ * Provide a unique identifier for the control
55
+ */
56
+ id ?: string ;
57
+
58
+ /**
59
+ * Specify whether the control is currently invalid
60
+ */
61
+ invalid ?: boolean ;
62
+
63
+ /**
64
+ * Provide the text that is displayed when the control is in an invalid state
65
+ */
66
+ invalidText ?: React . ReactNode ;
67
+
68
+ /**
69
+ * Provide the text that will be read by a screen reader when visiting this
70
+ * control
71
+ */
72
+ labelText : React . ReactNode ;
73
+
74
+ /**
75
+ * `true` to use the light version. For use on $ui-01 backgrounds only.
76
+ * Don't use this to make tile background color same as container background color.
77
+ */
78
+ light ?: boolean ;
79
+
80
+ /**
81
+ * Max character count allowed for the textarea. This is needed in order for enableCounter to display
82
+ */
83
+ maxCount ?: number ;
84
+
85
+ /**
86
+ * Optionally provide an `onChange` handler that is called whenever `<textarea>`
87
+ * is updated
88
+ */
89
+ onChange ?: React . ChangeEventHandler < HTMLTextAreaElement > ;
90
+
91
+ /**
92
+ * Optionally provide an `onClick` handler that is called whenever the
93
+ * `<textarea>` is clicked
94
+ */
95
+ onClick ?: React . MouseEventHandler < HTMLTextAreaElement > ;
96
+
97
+ /**
98
+ * Specify the placeholder attribute for the `<textarea>`
99
+ */
100
+ placeholder ?: string ;
101
+
102
+ /**
103
+ * Specify the rows attribute for the `<textarea>`
104
+ */
105
+ rows ?: number ;
106
+
107
+ /**
108
+ * Provide the current value of the `<textarea>`
109
+ */
110
+ value ?: string | number ;
111
+
112
+ /**
113
+ * Specify whether the control is currently in warning state
114
+ */
115
+ warn ?: boolean ;
116
+
117
+ /**
118
+ * Provide the text that is displayed when the control is in warning state
119
+ */
120
+ warnText ?: React . ReactNode ;
121
+ }
122
+
123
+ const FluidTextArea : React . FC < FluidTextAreaProps > = ( {
124
+ className,
125
+ ...other
126
+ } ) => {
17
127
const prefix = usePrefix ( ) ;
18
128
const classNames = classnames ( `${ prefix } --text-area--fluid` , className ) ;
19
129
@@ -22,7 +132,7 @@ function FluidTextArea({ className, ...other }) {
22
132
< TextArea className = { classNames } { ...other } />
23
133
</ FormContext . Provider >
24
134
) ;
25
- }
135
+ } ;
26
136
27
137
FluidTextArea . propTypes = {
28
138
/**
0 commit comments