@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/esm/index.js CHANGED
@@ -55250,14 +55250,20 @@ function TextArea(_a) {
55250
55250
  useEffect(function () {
55251
55251
  var textarea = textareaRef.current;
55252
55252
  if (textarea) {
55253
- textarea.style.height = "auto"; // Reset height to recalculate
55254
55253
  textarea.style.height = "".concat(textarea.scrollHeight, "px"); // Set to scroll height
55255
55254
  }
55256
55255
  }, [value]); // Re-run when value changes
55257
55256
  return (React__default.createElement("div", { className: "s-flex s-flex-col s-gap-1 s-p-px" },
55258
- React__default.createElement("textarea", { ref: textareaRef, className: classNames("s-min-h-60 overflow-y-auto s-block s-w-full s-min-w-0 s-rounded-xl s-text-sm s-transition-all s-duration-200 s-scrollbar-hide", !error
55257
+ React__default.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
55259
55258
  ? "s-border-structure-100 focus:s-border-action-300 focus:s-ring-action-300"
55260
55259
  : "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) {
55260
+ var newValue = e.target.value;
55261
+ var textAreaComponent = textareaRef.current;
55262
+ if (textAreaComponent &&
55263
+ (value === null || value === void 0 ? void 0 : value.length) &&
55264
+ newValue.length < value.length) {
55265
+ textAreaComponent.style.height = "auto"; // Reset height to recalculate
55266
+ }
55261
55267
  onChange(e.target.value);
55262
55268
  } }),
55263
55269
  error && showErrorLabel && (React__default.createElement("div", { className: "s-ml-2 s-text-sm s-text-warning-500" }, error))));