@dust-tt/sparkle 0.2.246 → 0.2.248

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.
package/dist/cjs/index.js CHANGED
@@ -103571,12 +103571,13 @@ DataTable.Caption = function Caption(_a) {
103571
103571
  };
103572
103572
 
103573
103573
  function Dialog(_a) {
103574
- var _b = _a.alertDialog, alertDialog = _b === void 0 ? false : _b, _c = _a.backgroundType, backgroundType = _c === void 0 ? "none" : _c, _d = _a.cancelLabel, cancelLabel = _d === void 0 ? "Cancel" : _d, children = _a.children, disabled = _a.disabled, isOpen = _a.isOpen, isSaving = _a.isSaving, onCancel = _a.onCancel, onValidate = _a.onValidate, title = _a.title, _e = _a.validateLabel, validateLabel = _e === void 0 ? "Ok" : _e, _f = _a.validateVariant, validateVariant = _f === void 0 ? "primary" : _f;
103574
+ var _b;
103575
+ var _c = _a.backgroundType, backgroundType = _c === void 0 ? "none" : _c, children = _a.children, disabled = _a.disabled, isOpen = _a.isOpen, isSaving = _a.isSaving, title = _a.title, _d = _a.validateLabel, validateLabel = _d === void 0 ? "Ok" : _d, _e = _a.validateVariant, validateVariant = _e === void 0 ? "primary" : _e, onValidate = _a.onValidate, props = __rest(_a, ["backgroundType", "children", "disabled", "isOpen", "isSaving", "title", "validateLabel", "validateVariant", "onValidate"]);
103575
103576
  var referentRef = React.useRef(null);
103576
103577
  return (React.createElement(qe, { show: isOpen, as: React.Fragment, appear: true },
103577
103578
  React.createElement(_t, { as: "div", className: "s-relative s-z-50",
103578
103579
  // If it's an alert dialog, we don't want to close it when clicking outside.
103579
- onClose: alertDialog ? function () { } : onCancel, role: alertDialog ? "alertdialog" : "dialog" },
103580
+ onClose: props.alertDialog ? function () { } : props.onCancel, role: props.alertDialog ? "alertdialog" : "dialog" },
103580
103581
  React.createElement(qe.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" },
103581
103582
  React.createElement("div", { className: "s-fixed s-inset-0 s-bg-structure-50/80 s-backdrop-blur-sm s-transition-opacity" })),
103582
103583
  React.createElement("div", { className: "s-fixed s-inset-0 s-z-50" },
@@ -103588,7 +103589,7 @@ function Dialog(_a) {
103588
103589
  React.createElement("div", { className: "s-flex s-w-full s-justify-end" },
103589
103590
  React.createElement(Button.List, null,
103590
103591
  !isSaving && (React.createElement(React.Fragment, null,
103591
- React.createElement(Button, { label: cancelLabel, variant: "tertiary", onClick: onCancel }),
103592
+ props.onCancel && (React.createElement(Button, { label: (_b = props.cancelLabel) !== null && _b !== void 0 ? _b : "Cancel", variant: "tertiary", onClick: props.onCancel })),
103592
103593
  React.createElement(Button, { disabled: disabled, label: validateLabel, variant: validateVariant, onClick: onValidate }))),
103593
103594
  isSaving && React.createElement(Spinner, { variant: "color" }))),
103594
103595
  backgroundType !== "none" && (React.createElement("div", { className: "s-absolute s-bottom-0 s-left-0 s-right-0 s-top-0 s-z-0" },