@sustaina/shared-ui 1.57.0 → 1.58.0

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/index.mjs CHANGED
@@ -10123,18 +10123,37 @@ function DialogAlert({
10123
10123
  func?.();
10124
10124
  onOpenChange(false);
10125
10125
  }, [onCancel, onConfirm, onOpenChange, showCancel, variant]);
10126
+ const handleOpenChange = useCallback(
10127
+ (state) => {
10128
+ if (!state) {
10129
+ onCancel?.();
10130
+ }
10131
+ onOpenChange(state);
10132
+ },
10133
+ [onCancel, onOpenChange]
10134
+ );
10126
10135
  return /* @__PURE__ */ jsx(Dialog3, { open, onOpenChange: persistent ? () => {
10127
- } : onOpenChange, children: /* @__PURE__ */ jsxs(DialogContent3, { className: "max-w-md", showCloseButton: !persistent, children: [
10128
- /* @__PURE__ */ jsxs(DialogHeader3, { children: [
10129
- title && /* @__PURE__ */ jsx(DialogTitle3, { className: titleColorVariant[variant], children: t(title) }),
10130
- description && /* @__PURE__ */ jsx(DialogDescription3, { children: t(description) })
10131
- ] }),
10132
- outlet && outlet,
10133
- /* @__PURE__ */ jsxs("div", { className: `flex gap-2 ${alignClass}`, children: [
10134
- showCancel && /* @__PURE__ */ jsx(Button, { variant: "cancel", onClick: handleCancel, children: t(cancelText) }),
10135
- confirmText && /* @__PURE__ */ jsx(Button, { variant: dialogButtonVariantMap[variant], onClick: handleConfirm, children: t(confirmText) })
10136
- ] })
10137
- ] }) });
10136
+ } : handleOpenChange, children: /* @__PURE__ */ jsxs(
10137
+ DialogContent3,
10138
+ {
10139
+ className: "max-w-md",
10140
+ showCloseButton: !persistent,
10141
+ onInteractOutside: (e) => {
10142
+ e.preventDefault();
10143
+ },
10144
+ children: [
10145
+ /* @__PURE__ */ jsxs(DialogHeader3, { children: [
10146
+ title && /* @__PURE__ */ jsx(DialogTitle3, { className: titleColorVariant[variant], children: t(title) }),
10147
+ description && /* @__PURE__ */ jsx(DialogDescription3, { children: t(description) })
10148
+ ] }),
10149
+ outlet && outlet,
10150
+ /* @__PURE__ */ jsxs("div", { className: `flex gap-2 ${alignClass}`, children: [
10151
+ showCancel && /* @__PURE__ */ jsx(Button, { variant: "cancel", onClick: handleCancel, children: t(cancelText) }),
10152
+ confirmText && /* @__PURE__ */ jsx(Button, { variant: dialogButtonVariantMap[variant], onClick: handleConfirm, children: t(confirmText) })
10153
+ ] })
10154
+ ]
10155
+ }
10156
+ ) });
10138
10157
  }
10139
10158
 
10140
10159
  // src/components/dialog-alert/templates/index.ts