@dust-tt/sparkle 0.2.245 → 0.2.246
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 +4 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/Dialog.d.ts +6 -5
- package/dist/esm/components/Dialog.d.ts.map +1 -1
- package/dist/esm/components/Dialog.js +4 -2
- package/dist/esm/components/Dialog.js.map +1 -1
- package/dist/esm/stories/Dialog.stories.d.ts.map +1 -1
- package/dist/esm/stories/Dialog.stories.js +6 -1
- package/dist/esm/stories/Dialog.stories.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Dialog.tsx +18 -10
- package/src/stories/Dialog.stories.tsx +14 -0
package/dist/cjs/index.js
CHANGED
|
@@ -103571,10 +103571,12 @@ DataTable.Caption = function Caption(_a) {
|
|
|
103571
103571
|
};
|
|
103572
103572
|
|
|
103573
103573
|
function Dialog(_a) {
|
|
103574
|
-
var
|
|
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;
|
|
103575
103575
|
var referentRef = React.useRef(null);
|
|
103576
103576
|
return (React.createElement(qe, { show: isOpen, as: React.Fragment, appear: true },
|
|
103577
|
-
React.createElement(_t, { as: "div", className: "s-relative s-z-50",
|
|
103577
|
+
React.createElement(_t, { as: "div", className: "s-relative s-z-50",
|
|
103578
|
+
// 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" },
|
|
103578
103580
|
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
103581
|
React.createElement("div", { className: "s-fixed s-inset-0 s-bg-structure-50/80 s-backdrop-blur-sm s-transition-opacity" })),
|
|
103580
103582
|
React.createElement("div", { className: "s-fixed s-inset-0 s-z-50" },
|