@madie/madie-design-system 1.2.45 → 1.2.47
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.
- package/components/Popover/index.js +2 -1
- package/components/TextField/index.jsx +20 -1
- package/dist/browser.js +1 -1
- package/dist/index.js +1 -1
- package/dist/react/index.js +92 -90
- package/dist/react/index.js.LICENSE.txt +5 -13
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
- package/test/components/TextField.test.js +26 -0
|
@@ -22,10 +22,11 @@ const MadiePopover = ({
|
|
|
22
22
|
}}
|
|
23
23
|
transformOrigin={{
|
|
24
24
|
vertical: "top",
|
|
25
|
-
horizontal: "
|
|
25
|
+
horizontal: "center",
|
|
26
26
|
}}
|
|
27
27
|
sx={{
|
|
28
28
|
".MuiPopover-paper": {
|
|
29
|
+
background: "none",
|
|
29
30
|
boxShadow: "none",
|
|
30
31
|
overflow: "visible",
|
|
31
32
|
".popover-content": {
|
|
@@ -19,6 +19,7 @@ const TextField = ({
|
|
|
19
19
|
inputProps,
|
|
20
20
|
labelColor = undefined,
|
|
21
21
|
textFieldStyles = {},
|
|
22
|
+
maxLength = undefined,
|
|
22
23
|
...rest
|
|
23
24
|
}) => {
|
|
24
25
|
// get a copy of input props
|
|
@@ -167,9 +168,26 @@ const TextField = ({
|
|
|
167
168
|
error={error}
|
|
168
169
|
disabled={disabled}
|
|
169
170
|
id={id}
|
|
170
|
-
inputProps={
|
|
171
|
+
inputProps={{
|
|
172
|
+
...newInputProps,
|
|
173
|
+
maxLength: maxLength,
|
|
174
|
+
}}
|
|
171
175
|
{...rest}
|
|
172
176
|
/>
|
|
177
|
+
{maxLength && !disabled && (
|
|
178
|
+
<span
|
|
179
|
+
style={{
|
|
180
|
+
fontFamily: "Rubik",
|
|
181
|
+
fontSize: 12,
|
|
182
|
+
color: "#333",
|
|
183
|
+
position: "absolute",
|
|
184
|
+
bottom: -20,
|
|
185
|
+
right: 0,
|
|
186
|
+
}}
|
|
187
|
+
>
|
|
188
|
+
{rest.value?.length}/{maxLength} Characters
|
|
189
|
+
</span>
|
|
190
|
+
)}
|
|
173
191
|
</FormControl>
|
|
174
192
|
);
|
|
175
193
|
};
|
|
@@ -186,5 +204,6 @@ TextField.propTypes = {
|
|
|
186
204
|
tooltipText: PropTypes.string,
|
|
187
205
|
inputProps: PropTypes.object,
|
|
188
206
|
labelColor: PropTypes.string,
|
|
207
|
+
maxLength: PropTypes.number,
|
|
189
208
|
};
|
|
190
209
|
export default TextField;
|