@dust-tt/sparkle 0.2.131 → 0.2.132
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/dist/cjs/index.js +8 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +8 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -55270,14 +55270,20 @@ function TextArea(_a) {
|
|
|
55270
55270
|
React.useEffect(function () {
|
|
55271
55271
|
var textarea = textareaRef.current;
|
|
55272
55272
|
if (textarea) {
|
|
55273
|
-
textarea.style.height = "auto"; // Reset height to recalculate
|
|
55274
55273
|
textarea.style.height = "".concat(textarea.scrollHeight, "px"); // Set to scroll height
|
|
55275
55274
|
}
|
|
55276
55275
|
}, [value]); // Re-run when value changes
|
|
55277
55276
|
return (React.createElement("div", { className: "s-flex s-flex-col s-gap-1 s-p-px" },
|
|
55278
|
-
React.createElement("textarea", { ref: textareaRef, className: classNames("
|
|
55277
|
+
React.createElement("textarea", { ref: textareaRef, className: classNames("overflow-y-auto s-block s-min-h-60 s-w-full s-min-w-0 s-rounded-xl s-text-sm s-transition-all s-duration-200 s-scrollbar-hide", !error
|
|
55279
55278
|
? "s-border-structure-100 focus:s-border-action-300 focus:s-ring-action-300"
|
|
55280
55279
|
: "s-border-red-500 focus:s-border-red-500 focus:s-ring-red-500", "s-border-structure-200 s-bg-structure-50", "s-resize-y", className !== null && className !== void 0 ? className : ""), placeholder: placeholder, value: value !== null && value !== void 0 ? value : "", onChange: function (e) {
|
|
55280
|
+
var newValue = e.target.value;
|
|
55281
|
+
var textAreaComponent = textareaRef.current;
|
|
55282
|
+
if (textAreaComponent &&
|
|
55283
|
+
(value === null || value === void 0 ? void 0 : value.length) &&
|
|
55284
|
+
newValue.length < value.length) {
|
|
55285
|
+
textAreaComponent.style.height = "auto"; // Reset height to recalculate
|
|
55286
|
+
}
|
|
55281
55287
|
onChange(e.target.value);
|
|
55282
55288
|
} }),
|
|
55283
55289
|
error && showErrorLabel && (React.createElement("div", { className: "s-ml-2 s-text-sm s-text-warning-500" }, error))));
|