@dust-tt/sparkle 0.2.254-rc-1 → 0.2.254-rc-2

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
@@ -107753,7 +107753,7 @@ var modalStyles = (_a = {},
107753
107753
  _a);
107754
107754
  var getModalClasses = function (type) { return modalStyles[type] || {}; };
107755
107755
  function Modal(_a) {
107756
- 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;
107756
+ var action = _a.action, alertModal = _a.alertModal, children = _a.children, className = _a.className, hasChanged = _a.hasChanged, isOpen = _a.isOpen, isSaving = _a.isSaving, onClose = _a.onClose, onSave = _a.onSave, _b = _a.saveLabel, saveLabel = _b === void 0 ? "Save" : _b, savingLabel = _a.savingLabel, title = _a.title, _c = _a.variant, variant = _c === void 0 ? "side-sm" : _c;
107757
107757
  var type = variantToType[variant];
107758
107758
  if (variant === "dialogue") {
107759
107759
  console.warn("Dialogue variant of Modal is deprecated. Please use either another variant of Modal or the Dialog component.");
@@ -107774,8 +107774,8 @@ function Modal(_a) {
107774
107774
  var _d = getModalClasses(type), containerClasses = _d.containerClasses, transitionEnterFrom = _d.transitionEnterFrom, transitionLeaveFrom = _d.transitionLeaveFrom, transitionEnterTo = _d.transitionEnterTo, transitionLeaveTo = _d.transitionLeaveTo, panelClasses = _d.panelClasses, innerContainerClasses = _d.innerContainerClasses;
107775
107775
  return (React.createElement(qe, { show: isOpen, as: React.Fragment, appear: true },
107776
107776
  React.createElement(_t, { as: "div", className: "s-fixed s-absolute s-inset-0 s-z-50 s-overflow-hidden", onClose: function () {
107777
- // We allow closing the modal by clicking outside of it only if there are no changes
107778
- if (!hasChanged) {
107777
+ // Close modal on outside click if no changes or not an alert.
107778
+ if (!hasChanged && !alertModal) {
107779
107779
  onClose();
107780
107780
  }
107781
107781
  } },
@@ -107784,7 +107784,7 @@ function Modal(_a) {
107784
107784
  React.createElement("div", { className: classNames(containerClasses, variantSize[variant]) },
107785
107785
  React.createElement(qe.Child, { as: React.Fragment, enter: "s-ease-out s-duration-300", enterFrom: transitionEnterFrom, enterTo: transitionEnterTo, leave: "s-ease-in s-duration-200", leaveFrom: transitionLeaveFrom, leaveTo: transitionLeaveTo },
107786
107786
  React.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]) },
107787
- React.createElement(BarHeader, { title: title || "", leftActions: action ? React.createElement(Button, __assign({}, action)) : undefined, rightActions: React.createElement(BarHeader.ButtonBar, __assign({}, buttonBarProps)) }),
107787
+ React.createElement(BarHeader, { title: title || "", leftActions: action ? React.createElement(Button, __assign({}, action)) : undefined, rightActions: alertModal ? undefined : (React.createElement(BarHeader.ButtonBar, __assign({}, buttonBarProps))) }),
107788
107788
  React.createElement("div", { className: classNames("s-pb-6 s-pt-16", innerContainerClasses, className !== null && className !== void 0 ? className : "") }, children)))))));
107789
107789
  }
107790
107790