@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/cjs/index.js CHANGED
@@ -32431,7 +32431,7 @@ function Banner(_a) {
32431
32431
  React.useEffect(function () {
32432
32432
  setIsDismissed(hidden);
32433
32433
  }, [hidden]);
32434
- return isDismissed ? (React.createElement(React.Fragment, null)) : (React.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) },
32434
+ return isDismissed ? (React.createElement(React.Fragment, null)) : (React.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) },
32435
32435
  children,
32436
32436
  allowDismiss && (React.createElement("div", { className: "s-flex s-flex-1 s-items-center s-justify-end" },
32437
32437
  React.createElement("span", { className: "s-sr-only" }, "Dismiss"),
@@ -33784,7 +33784,7 @@ function ElementModal(_a) {
33784
33784
  }
33785
33785
 
33786
33786
  function Dialog(_a) {
33787
- 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;
33787
+ 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;
33788
33788
  return (React.createElement(tt, { show: isOpen, as: React.Fragment, appear: true },
33789
33789
  React.createElement(_t, { as: "div", className: "s-relative s-z-50", onClose: onCancel },
33790
33790
  React.createElement(tt.Child, { as: React.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" },
@@ -33797,8 +33797,10 @@ function Dialog(_a) {
33797
33797
  React.createElement("div", { className: "s-text-base s-text-element-700" }, children),
33798
33798
  React.createElement("div", { className: "s-flex s-w-full s-justify-end" },
33799
33799
  React.createElement(Button.List, null,
33800
- React.createElement(Button, { label: cancelLabel, variant: "tertiary", onClick: onCancel }),
33801
- React.createElement(Button, { label: validateLabel, variant: validateVariant, onClick: onValidate }))))))))));
33800
+ !isSaving && (React.createElement(React.Fragment, null,
33801
+ React.createElement(Button, { label: cancelLabel, variant: "tertiary", onClick: onCancel }),
33802
+ React.createElement(Button, { label: validateLabel, variant: validateVariant, onClick: onValidate }))),
33803
+ isSaving && React.createElement(Spinner, null))))))))));
33802
33804
  }
33803
33805
 
33804
33806
  var sizeInputClasses = {
@@ -33806,8 +33808,9 @@ var sizeInputClasses = {
33806
33808
  md: "s-text-lg s-rounded-lg s-py-2 s-pl-4 s-pr-10",
33807
33809
  };
33808
33810
  function Input(_a) {
33809
- 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;
33811
+ 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;
33810
33812
  return (React.createElement("div", { className: "s-flex s-flex-col s-gap-1 s-p-px" },
33813
+ label && (React.createElement("label", { htmlFor: name, className: "s-text-sm s-text-element-800 dark:s-text-element-800-dark" }, label)),
33811
33814
  React.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
33812
33815
  ? classNames("s-ring-structure-200 focus:s-ring-action-300", "dark:s-ring-structure-300-dark dark:focus:s-ring-action-300-dark")
33813
33816
  : 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) {