@dust-tt/sparkle 0.2.130 → 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.
@@ -17,5 +17,6 @@ export type ModalProps = {
17
17
  savingLabel?: string;
18
18
  title?: string;
19
19
  variant?: "full-screen" | "side-sm" | "side-md" | "dialogue";
20
+ className?: string;
20
21
  };
21
- export declare function Modal({ isOpen, onClose, action, children, hasChanged, onSave, saveLabel, isSaving, savingLabel, title, variant, }: ModalProps): React.JSX.Element;
22
+ export declare function Modal({ isOpen, onClose, action, children, hasChanged, onSave, saveLabel, isSaving, savingLabel, title, variant, className, }: ModalProps): React.JSX.Element;
package/dist/esm/index.js CHANGED
@@ -54989,7 +54989,7 @@ var modalStyles = (_a = {},
54989
54989
  _a);
54990
54990
  var getModalClasses = function (type) { return modalStyles[type] || {}; };
54991
54991
  function Modal(_a) {
54992
- var isOpen = _a.isOpen, onClose = _a.onClose, action = _a.action, children = _a.children, hasChanged = _a.hasChanged, onSave = _a.onSave, _b = _a.saveLabel, saveLabel = _b === void 0 ? "Save" : _b, isSaving = _a.isSaving, savingLabel = _a.savingLabel, title = _a.title, _c = _a.variant, variant = _c === void 0 ? "side-sm" : _c;
54992
+ var isOpen = _a.isOpen, onClose = _a.onClose, action = _a.action, children = _a.children, hasChanged = _a.hasChanged, onSave = _a.onSave, _b = _a.saveLabel, saveLabel = _b === void 0 ? "Save" : _b, isSaving = _a.isSaving, savingLabel = _a.savingLabel, title = _a.title, _c = _a.variant, variant = _c === void 0 ? "side-sm" : _c, className = _a.className;
54993
54993
  var type = variantToType[variant];
54994
54994
  if (variant === "dialogue") {
54995
54995
  console.warn("Dialogue variant of Modal is deprecated. Please use either another variant of Modal or the Dialog component.");
@@ -55016,7 +55016,7 @@ function Modal(_a) {
55016
55016
  React__default.createElement(tt.Child, { as: Fragment, enter: "s-ease-out s-duration-300", enterFrom: transitionEnterFrom, enterTo: transitionEnterTo, leave: "s-ease-in s-duration-200", leaveFrom: transitionLeaveFrom, leaveTo: transitionLeaveTo },
55017
55017
  React__default.createElement(_t.Panel, { className: classNames("s-absolute s-transform s-bg-structure-0 s-px-3 s-transition-all sm:s-px-4", panelClasses, variantSize[variant]) },
55018
55018
  React__default.createElement(BarHeader, { title: title || "", leftActions: action ? React__default.createElement(Button, __assign({}, action)) : undefined, rightActions: React__default.createElement(BarHeader.ButtonBar, __assign({}, buttonBarProps)) }),
55019
- React__default.createElement("div", { className: classNames("s-pb-6 s-pt-16", innerContainerClasses) }, children)))))));
55019
+ React__default.createElement("div", { className: classNames("s-pb-6 s-pt-16", innerContainerClasses, className !== null && className !== void 0 ? className : "") }, children)))))));
55020
55020
  }
55021
55021
 
55022
55022
  var reactConfetti_min = {exports: {}};
@@ -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))));