@dust-tt/sparkle 0.2.116 → 0.2.119

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.
@@ -10,5 +10,5 @@ type ModalProps = {
10
10
  validateVariant?: "primary" | "primaryWarning";
11
11
  isSaving?: boolean;
12
12
  };
13
- export declare function Dialog({ isOpen, children, onCancel, onValidate, cancelLabel, validateLabel, validateVariant, title, }: ModalProps): React.JSX.Element;
13
+ export declare function Dialog({ isOpen, children, onCancel, onValidate, cancelLabel, validateLabel, validateVariant, title, isSaving, }: ModalProps): React.JSX.Element;
14
14
  export {};
@@ -10,6 +10,7 @@ type InputProps = {
10
10
  isPassword?: boolean;
11
11
  disabled?: boolean;
12
12
  className?: string;
13
+ label?: string;
13
14
  };
14
- export declare function Input({ placeholder, value, size, onChange, error, showErrorLabel, name, isPassword, disabled, className, }: InputProps): React.JSX.Element;
15
+ export declare function Input({ placeholder, value, size, onChange, error, showErrorLabel, name, isPassword, disabled, className, label, }: InputProps): React.JSX.Element;
15
16
  export {};
package/dist/esm/index.js CHANGED
@@ -32411,7 +32411,7 @@ function Banner(_a) {
32411
32411
  useEffect(function () {
32412
32412
  setIsDismissed(hidden);
32413
32413
  }, [hidden]);
32414
- return isDismissed ? (React__default.createElement(React__default.Fragment, null)) : (React__default.createElement("div", { className: classNames(variantClasses[variant], "sm:s-before:flex-1 s-flex s-min-h-16 s-items-center s-px-6 s-py-4 s-text-sm sm:s-px-3.5", className) },
32414
+ return isDismissed ? (React__default.createElement(React__default.Fragment, null)) : (React__default.createElement("div", { className: classNames(variantClasses[variant], "sm:s-before:flex-1 s-min-h-16 s-flex s-items-center s-px-6 s-py-4 s-text-sm sm:s-px-3.5", className) },
32415
32415
  children,
32416
32416
  allowDismiss && (React__default.createElement("div", { className: "s-flex s-flex-1 s-items-center s-justify-end" },
32417
32417
  React__default.createElement("span", { className: "s-sr-only" }, "Dismiss"),
@@ -33764,7 +33764,7 @@ function ElementModal(_a) {
33764
33764
  }
33765
33765
 
33766
33766
  function Dialog(_a) {
33767
- var isOpen = _a.isOpen, children = _a.children, onCancel = _a.onCancel, onValidate = _a.onValidate, _b = _a.cancelLabel, cancelLabel = _b === void 0 ? "Cancel" : _b, _c = _a.validateLabel, validateLabel = _c === void 0 ? "Ok" : _c, _d = _a.validateVariant, validateVariant = _d === void 0 ? "primary" : _d, title = _a.title;
33767
+ var isOpen = _a.isOpen, children = _a.children, onCancel = _a.onCancel, onValidate = _a.onValidate, _b = _a.cancelLabel, cancelLabel = _b === void 0 ? "Cancel" : _b, _c = _a.validateLabel, validateLabel = _c === void 0 ? "Ok" : _c, _d = _a.validateVariant, validateVariant = _d === void 0 ? "primary" : _d, title = _a.title, isSaving = _a.isSaving;
33768
33768
  return (React__default.createElement(tt, { show: isOpen, as: Fragment, appear: true },
33769
33769
  React__default.createElement(_t, { as: "div", className: "s-relative s-z-50", onClose: onCancel },
33770
33770
  React__default.createElement(tt.Child, { as: Fragment, enter: "s-ease-out s-duration-150", enterFrom: "s-opacity-0", enterTo: "s-opacity-100", leave: "s-ease-in s-duration-150", leaveFrom: "s-opacity-100", leaveTo: "s-opacity-0" },
@@ -33777,8 +33777,10 @@ function Dialog(_a) {
33777
33777
  React__default.createElement("div", { className: "s-text-base s-text-element-700" }, children),
33778
33778
  React__default.createElement("div", { className: "s-flex s-w-full s-justify-end" },
33779
33779
  React__default.createElement(Button.List, null,
33780
- React__default.createElement(Button, { label: cancelLabel, variant: "tertiary", onClick: onCancel }),
33781
- React__default.createElement(Button, { label: validateLabel, variant: validateVariant, onClick: onValidate }))))))))));
33780
+ !isSaving && (React__default.createElement(React__default.Fragment, null,
33781
+ React__default.createElement(Button, { label: cancelLabel, variant: "tertiary", onClick: onCancel }),
33782
+ React__default.createElement(Button, { label: validateLabel, variant: validateVariant, onClick: onValidate }))),
33783
+ isSaving && React__default.createElement(Spinner, null))))))))));
33782
33784
  }
33783
33785
 
33784
33786
  var sizeInputClasses = {
@@ -33786,8 +33788,9 @@ var sizeInputClasses = {
33786
33788
  md: "s-text-lg s-rounded-lg s-py-2 s-pl-4 s-pr-10",
33787
33789
  };
33788
33790
  function Input(_a) {
33789
- var placeholder = _a.placeholder, value = _a.value, _b = _a.size, size = _b === void 0 ? "sm" : _b, onChange = _a.onChange, error = _a.error, _c = _a.showErrorLabel, showErrorLabel = _c === void 0 ? false : _c, name = _a.name, _d = _a.isPassword, isPassword = _d === void 0 ? false : _d, _e = _a.disabled, disabled = _e === void 0 ? false : _e, _f = _a.className, className = _f === void 0 ? "" : _f;
33791
+ var placeholder = _a.placeholder, value = _a.value, _b = _a.size, size = _b === void 0 ? "sm" : _b, onChange = _a.onChange, error = _a.error, _c = _a.showErrorLabel, showErrorLabel = _c === void 0 ? false : _c, name = _a.name, _d = _a.isPassword, isPassword = _d === void 0 ? false : _d, _e = _a.disabled, disabled = _e === void 0 ? false : _e, _f = _a.className, className = _f === void 0 ? "" : _f, label = _a.label;
33790
33792
  return (React__default.createElement("div", { className: "s-flex s-flex-col s-gap-1 s-p-px" },
33793
+ label && (React__default.createElement("label", { htmlFor: name, className: "s-text-sm s-text-element-800 dark:s-text-element-800-dark" }, label)),
33791
33794
  React__default.createElement("input", { type: isPassword ? "password" : "text", name: name, id: name, className: classNames("s-w-full s-border-0 s-outline-none s-ring-1 focus:s-outline-none focus:s-ring-2", "s-bg-structure-50 s-text-element-900 s-placeholder-element-600", "dark:s-bg-structure-50-dark dark:s-text-element-800-dark dark:s-placeholder-element-600-dark", sizeInputClasses[size], "s-transition-all s-duration-300 s-ease-out", className !== null && className !== void 0 ? className : "", !error
33792
33795
  ? classNames("s-ring-structure-200 focus:s-ring-action-300", "dark:s-ring-structure-300-dark dark:focus:s-ring-action-300-dark")
33793
33796
  : classNames("s-ring-warning-200 focus:s-ring-warning-300", "dark:s-ring-warning-200-dark dark:focus:s-ring-warning-300-dark")), placeholder: placeholder, value: value !== null && value !== void 0 ? value : "", onChange: function (e) {