@madie/madie-design-system 1.2.47 → 1.2.49
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.
|
@@ -11,6 +11,7 @@ const TextArea = ({
|
|
|
11
11
|
disabled = false,
|
|
12
12
|
label,
|
|
13
13
|
inputProps,
|
|
14
|
+
maxLength = undefined,
|
|
14
15
|
...rest
|
|
15
16
|
}) => {
|
|
16
17
|
// coerce this to avoid issue passing props to dom.
|
|
@@ -90,7 +91,7 @@ const TextArea = ({
|
|
|
90
91
|
</FormHelperText>
|
|
91
92
|
)}
|
|
92
93
|
<TextareaAutosize
|
|
93
|
-
style={{ marginTop: "8px", maxWidth: "100%" }}
|
|
94
|
+
style={{ marginTop: "8px", maxWidth: "100%", }}
|
|
94
95
|
className={
|
|
95
96
|
error ? "text-area-variable error" : "text-area-variable"
|
|
96
97
|
}
|
|
@@ -99,7 +100,21 @@ const TextArea = ({
|
|
|
99
100
|
id={id}
|
|
100
101
|
{...inputProps}
|
|
101
102
|
{...rest}
|
|
102
|
-
/>
|
|
103
|
+
/>
|
|
104
|
+
{maxLength && !disabled && (
|
|
105
|
+
<span
|
|
106
|
+
style={{
|
|
107
|
+
fontFamily: "Rubik",
|
|
108
|
+
fontSize: 12,
|
|
109
|
+
color: "#717171",
|
|
110
|
+
position: "absolute",
|
|
111
|
+
bottom: -26,
|
|
112
|
+
right: 0,
|
|
113
|
+
}}
|
|
114
|
+
>
|
|
115
|
+
{rest.value?.length}/{maxLength} Characters
|
|
116
|
+
</span>
|
|
117
|
+
)}
|
|
103
118
|
</FormControl>
|
|
104
119
|
);
|
|
105
120
|
};
|
|
@@ -113,5 +128,6 @@ TextArea.propTypes = {
|
|
|
113
128
|
placeholder: PropTypes.string, // expects placeholder objects of { name: value } and inserts into the render item function.
|
|
114
129
|
label: PropTypes.string,
|
|
115
130
|
inputProps: PropTypes.any,
|
|
131
|
+
maxLength: PropTypes.number,
|
|
116
132
|
};
|
|
117
133
|
export default TextArea;
|
|
@@ -44,6 +44,7 @@ const TextField = ({
|
|
|
44
44
|
|
|
45
45
|
const extendedTextFieldStyles = {
|
|
46
46
|
borderRadius: "3px",
|
|
47
|
+
|
|
47
48
|
border: "none",
|
|
48
49
|
marginTop: "8px",
|
|
49
50
|
"& .MuiOutlinedInput-notchedOutline": {
|
|
@@ -170,7 +171,6 @@ const TextField = ({
|
|
|
170
171
|
id={id}
|
|
171
172
|
inputProps={{
|
|
172
173
|
...newInputProps,
|
|
173
|
-
maxLength: maxLength,
|
|
174
174
|
}}
|
|
175
175
|
{...rest}
|
|
176
176
|
/>
|
|
@@ -179,9 +179,9 @@ const TextField = ({
|
|
|
179
179
|
style={{
|
|
180
180
|
fontFamily: "Rubik",
|
|
181
181
|
fontSize: 12,
|
|
182
|
-
color: "#
|
|
182
|
+
color: "#717171",
|
|
183
183
|
position: "absolute",
|
|
184
|
-
bottom: -
|
|
184
|
+
bottom: -26,
|
|
185
185
|
right: 0,
|
|
186
186
|
}}
|
|
187
187
|
>
|