@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/cjs/index.js
CHANGED
|
@@ -55265,7 +55265,7 @@ function FilterChips(_a) {
|
|
|
55265
55265
|
}
|
|
55266
55266
|
|
|
55267
55267
|
function TextArea(_a) {
|
|
55268
|
-
var placeholder = _a.placeholder, value = _a.value, onChange = _a.onChange, error = _a.error, _b = _a.showErrorLabel, showErrorLabel = _b === void 0 ? false : _b;
|
|
55268
|
+
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;
|
|
55269
55269
|
var textareaRef = React.useRef(null);
|
|
55270
55270
|
React.useEffect(function () {
|
|
55271
55271
|
var textarea = textareaRef.current;
|
|
@@ -55275,9 +55275,9 @@ function TextArea(_a) {
|
|
|
55275
55275
|
}
|
|
55276
55276
|
}, [value]); // Re-run when value changes
|
|
55277
55277
|
return (React.createElement("div", { className: "s-flex s-flex-col s-gap-1 s-p-px" },
|
|
55278
|
-
React.createElement("textarea", { ref: textareaRef,
|
|
55278
|
+
React.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
|
|
55279
55279
|
? "s-border-structure-100 focus:s-border-action-300 focus:s-ring-action-300"
|
|
55280
|
-
: "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) {
|
|
55280
|
+
: "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) {
|
|
55281
55281
|
onChange(e.target.value);
|
|
55282
55282
|
} }),
|
|
55283
55283
|
error && showErrorLabel && (React.createElement("div", { className: "s-ml-2 s-text-sm s-text-warning-500" }, error))));
|