@uipath/apollo-react 6.15.0 → 6.15.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.
|
@@ -78,7 +78,7 @@ const StyledTextareaAutosize = (0, styles_namespaceObject.styled)(material_names
|
|
|
78
78
|
cursor: 'default'
|
|
79
79
|
}
|
|
80
80
|
}));
|
|
81
|
-
const ApTextArea = /*#__PURE__*/ external_react_default().forwardRef(({ label, value, placeholder, readOnly = false, required = false, disabled = false, errorMessage, helperText, width, rows = 4, minRows, maxRows, characterLimit, resize = 'vertical', dataTestid, onChange, ...restProps }, ref)=>{
|
|
81
|
+
const ApTextArea = /*#__PURE__*/ external_react_default().forwardRef(({ label, value, placeholder, readOnly = false, required = false, disabled = false, errorMessage, helperText, width, rows = 4, minRows, maxRows, characterLimit, resize = 'vertical', dataTestid, onChange, id, ...restProps }, ref)=>{
|
|
82
82
|
const [cursorPosition, setCursorPosition] = (0, external_react_namespaceObject.useState)(null);
|
|
83
83
|
const textareaRef = (0, external_react_namespaceObject.useRef)(null);
|
|
84
84
|
const hasError = Boolean(errorMessage);
|
|
@@ -115,38 +115,24 @@ const ApTextArea = /*#__PURE__*/ external_react_default().forwardRef(({ label, v
|
|
|
115
115
|
}, [
|
|
116
116
|
ref
|
|
117
117
|
]);
|
|
118
|
-
const
|
|
119
|
-
const
|
|
118
|
+
const instanceId = (0, external_react_namespaceObject.useId)();
|
|
119
|
+
const labelId = label ? `textarea-label-${instanceId}` : void 0;
|
|
120
|
+
const helperId = helperText || errorMessage ? `textarea-helper-${instanceId}` : void 0;
|
|
121
|
+
const textareaId = id ?? `textarea-${instanceId}`;
|
|
120
122
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(material_namespaceObject.Box, {
|
|
121
123
|
sx: {
|
|
122
124
|
width: width || '100%'
|
|
123
125
|
},
|
|
124
126
|
children: [
|
|
125
|
-
label && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(material_namespaceObject.
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
children:
|
|
130
|
-
variant: apollo_core_namespaceObject.FontVariantToken.fontSizeM,
|
|
131
|
-
id: labelId,
|
|
132
|
-
style: {
|
|
133
|
-
color: 'var(--color-foreground)'
|
|
134
|
-
},
|
|
135
|
-
children: [
|
|
136
|
-
label,
|
|
137
|
-
required && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(material_namespaceObject.Box, {
|
|
138
|
-
component: "span",
|
|
139
|
-
sx: {
|
|
140
|
-
color: 'var(--color-error-text)',
|
|
141
|
-
marginLeft: apollo_core_default().Spacing.SpacingMicro
|
|
142
|
-
},
|
|
143
|
-
children: "*"
|
|
144
|
-
})
|
|
145
|
-
]
|
|
146
|
-
})
|
|
127
|
+
label && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(material_namespaceObject.InputLabel, {
|
|
128
|
+
id: labelId,
|
|
129
|
+
htmlFor: textareaId,
|
|
130
|
+
required: required,
|
|
131
|
+
children: label
|
|
147
132
|
}),
|
|
148
133
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(StyledTextareaAutosize, {
|
|
149
134
|
ref: combinedRef,
|
|
135
|
+
id: textareaId,
|
|
150
136
|
value: stringValue,
|
|
151
137
|
placeholder: placeholder,
|
|
152
138
|
readOnly: readOnly,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApTextArea.d.ts","sourceRoot":"","sources":["../../../../src/material/components/ap-text-area/ApTextArea.tsx"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"ApTextArea.d.ts","sourceRoot":"","sources":["../../../../src/material/components/ap-text-area/ApTextArea.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAGpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAuD1D,eAAO,MAAM,UAAU,6FAyKtB,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, TextareaAutosize } from "@mui/material";
|
|
2
|
+
import { Box, InputLabel, TextareaAutosize } from "@mui/material";
|
|
3
3
|
import { styled } from "@mui/material/styles";
|
|
4
4
|
import apollo_core, { FontVariantToken } from "@uipath/apollo-core";
|
|
5
|
-
import react, { useCallback, useRef, useState } from "react";
|
|
5
|
+
import react, { useCallback, useId, useRef, useState } from "react";
|
|
6
6
|
import { ApTypography } from "../ap-typography/index.js";
|
|
7
7
|
const StyledTextareaAutosize = styled(TextareaAutosize, {
|
|
8
8
|
shouldForwardProp: (prop)=>'hasError' !== prop && 'width' !== prop && 'resize' !== prop
|
|
@@ -39,7 +39,7 @@ const StyledTextareaAutosize = styled(TextareaAutosize, {
|
|
|
39
39
|
cursor: 'default'
|
|
40
40
|
}
|
|
41
41
|
}));
|
|
42
|
-
const ApTextArea = /*#__PURE__*/ react.forwardRef(({ label, value, placeholder, readOnly = false, required = false, disabled = false, errorMessage, helperText, width, rows = 4, minRows, maxRows, characterLimit, resize = 'vertical', dataTestid, onChange, ...restProps }, ref)=>{
|
|
42
|
+
const ApTextArea = /*#__PURE__*/ react.forwardRef(({ label, value, placeholder, readOnly = false, required = false, disabled = false, errorMessage, helperText, width, rows = 4, minRows, maxRows, characterLimit, resize = 'vertical', dataTestid, onChange, id, ...restProps }, ref)=>{
|
|
43
43
|
const [cursorPosition, setCursorPosition] = useState(null);
|
|
44
44
|
const textareaRef = useRef(null);
|
|
45
45
|
const hasError = Boolean(errorMessage);
|
|
@@ -76,38 +76,24 @@ const ApTextArea = /*#__PURE__*/ react.forwardRef(({ label, value, placeholder,
|
|
|
76
76
|
}, [
|
|
77
77
|
ref
|
|
78
78
|
]);
|
|
79
|
-
const
|
|
80
|
-
const
|
|
79
|
+
const instanceId = useId();
|
|
80
|
+
const labelId = label ? `textarea-label-${instanceId}` : void 0;
|
|
81
|
+
const helperId = helperText || errorMessage ? `textarea-helper-${instanceId}` : void 0;
|
|
82
|
+
const textareaId = id ?? `textarea-${instanceId}`;
|
|
81
83
|
return /*#__PURE__*/ jsxs(Box, {
|
|
82
84
|
sx: {
|
|
83
85
|
width: width || '100%'
|
|
84
86
|
},
|
|
85
87
|
children: [
|
|
86
|
-
label && /*#__PURE__*/ jsx(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
children:
|
|
91
|
-
variant: FontVariantToken.fontSizeM,
|
|
92
|
-
id: labelId,
|
|
93
|
-
style: {
|
|
94
|
-
color: 'var(--color-foreground)'
|
|
95
|
-
},
|
|
96
|
-
children: [
|
|
97
|
-
label,
|
|
98
|
-
required && /*#__PURE__*/ jsx(Box, {
|
|
99
|
-
component: "span",
|
|
100
|
-
sx: {
|
|
101
|
-
color: 'var(--color-error-text)',
|
|
102
|
-
marginLeft: apollo_core.Spacing.SpacingMicro
|
|
103
|
-
},
|
|
104
|
-
children: "*"
|
|
105
|
-
})
|
|
106
|
-
]
|
|
107
|
-
})
|
|
88
|
+
label && /*#__PURE__*/ jsx(InputLabel, {
|
|
89
|
+
id: labelId,
|
|
90
|
+
htmlFor: textareaId,
|
|
91
|
+
required: required,
|
|
92
|
+
children: label
|
|
108
93
|
}),
|
|
109
94
|
/*#__PURE__*/ jsx(StyledTextareaAutosize, {
|
|
110
95
|
ref: combinedRef,
|
|
96
|
+
id: textareaId,
|
|
111
97
|
value: stringValue,
|
|
112
98
|
placeholder: placeholder,
|
|
113
99
|
readOnly: readOnly,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/apollo-react",
|
|
3
|
-
"version": "6.15.
|
|
3
|
+
"version": "6.15.1",
|
|
4
4
|
"description": "Apollo Design System - React component library with Material UI theming",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -218,8 +218,8 @@
|
|
|
218
218
|
"use-sync-external-store": "^1.2.0",
|
|
219
219
|
"zod": "^4.3.5",
|
|
220
220
|
"zustand": "^5.0.9",
|
|
221
|
-
"@uipath/apollo-
|
|
222
|
-
"@uipath/apollo-
|
|
221
|
+
"@uipath/apollo-core": "5.12.0",
|
|
222
|
+
"@uipath/apollo-wind": "2.32.1"
|
|
223
223
|
},
|
|
224
224
|
"devDependencies": {
|
|
225
225
|
"@lingui/cli": "^5.6.1",
|