@dust-tt/sparkle 0.2.128 → 0.2.129
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.
|
@@ -5,6 +5,7 @@ type TextAreaProps = {
|
|
|
5
5
|
onChange: (value: string) => void;
|
|
6
6
|
error?: string | null;
|
|
7
7
|
showErrorLabel?: boolean;
|
|
8
|
+
className?: string;
|
|
8
9
|
};
|
|
9
|
-
export declare function TextArea({ placeholder, value, onChange, error, showErrorLabel, }: TextAreaProps): React.JSX.Element;
|
|
10
|
+
export declare function TextArea({ placeholder, value, onChange, error, showErrorLabel, className, }: TextAreaProps): React.JSX.Element;
|
|
10
11
|
export {};
|
package/dist/esm/index.js
CHANGED
|
@@ -55245,7 +55245,7 @@ function FilterChips(_a) {
|
|
|
55245
55245
|
}
|
|
55246
55246
|
|
|
55247
55247
|
function TextArea(_a) {
|
|
55248
|
-
var placeholder = _a.placeholder, value = _a.value, onChange = _a.onChange, error = _a.error, _b = _a.showErrorLabel, showErrorLabel = _b === void 0 ? false : _b;
|
|
55248
|
+
var placeholder = _a.placeholder, value = _a.value, onChange = _a.onChange, error = _a.error, _b = _a.showErrorLabel, showErrorLabel = _b === void 0 ? false : _b, className = _a.className;
|
|
55249
55249
|
var textareaRef = useRef(null);
|
|
55250
55250
|
useEffect(function () {
|
|
55251
55251
|
var textarea = textareaRef.current;
|
|
@@ -55255,9 +55255,9 @@ function TextArea(_a) {
|
|
|
55255
55255
|
}
|
|
55256
55256
|
}, [value]); // Re-run when value changes
|
|
55257
55257
|
return (React__default.createElement("div", { className: "s-flex s-flex-col s-gap-1 s-p-px" },
|
|
55258
|
-
React__default.createElement("textarea", { ref: textareaRef,
|
|
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
|
|
55259
55259
|
? "s-border-structure-100 focus:s-border-action-300 focus:s-ring-action-300"
|
|
55260
|
-
: "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"), placeholder: placeholder, value: value !== null && value !== void 0 ? value : "", onChange: function (e) {
|
|
55260
|
+
: "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) {
|
|
55261
55261
|
onChange(e.target.value);
|
|
55262
55262
|
} }),
|
|
55263
55263
|
error && showErrorLabel && (React__default.createElement("div", { className: "s-ml-2 s-text-sm s-text-warning-500" }, error))));
|