@dust-tt/sparkle 0.2.245 → 0.2.247

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