@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.js CHANGED
@@ -10166,18 +10166,37 @@ function DialogAlert({
10166
10166
  func?.();
10167
10167
  onOpenChange(false);
10168
10168
  }, [onCancel, onConfirm, onOpenChange, showCancel, variant]);
10169
+ const handleOpenChange = React.useCallback(
10170
+ (state) => {
10171
+ if (!state) {
10172
+ onCancel?.();
10173
+ }
10174
+ onOpenChange(state);
10175
+ },
10176
+ [onCancel, onOpenChange]
10177
+ );
10169
10178
  return /* @__PURE__ */ jsxRuntime.jsx(Dialog3, { open, onOpenChange: persistent ? () => {
10170
- } : onOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent3, { className: "max-w-md", showCloseButton: !persistent, children: [
10171
- /* @__PURE__ */ jsxRuntime.jsxs(DialogHeader3, { children: [
10172
- title && /* @__PURE__ */ jsxRuntime.jsx(DialogTitle3, { className: titleColorVariant[variant], children: t(title) }),
10173
- description && /* @__PURE__ */ jsxRuntime.jsx(DialogDescription3, { children: t(description) })
10174
- ] }),
10175
- outlet && outlet,
10176
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex gap-2 ${alignClass}`, children: [
10177
- showCancel && /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "cancel", onClick: handleCancel, children: t(cancelText) }),
10178
- confirmText && /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: dialogButtonVariantMap[variant], onClick: handleConfirm, children: t(confirmText) })
10179
- ] })
10180
- ] }) });
10179
+ } : handleOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(
10180
+ DialogContent3,
10181
+ {
10182
+ className: "max-w-md",
10183
+ showCloseButton: !persistent,
10184
+ onInteractOutside: (e) => {
10185
+ e.preventDefault();
10186
+ },
10187
+ children: [
10188
+ /* @__PURE__ */ jsxRuntime.jsxs(DialogHeader3, { children: [
10189
+ title && /* @__PURE__ */ jsxRuntime.jsx(DialogTitle3, { className: titleColorVariant[variant], children: t(title) }),
10190
+ description && /* @__PURE__ */ jsxRuntime.jsx(DialogDescription3, { children: t(description) })
10191
+ ] }),
10192
+ outlet && outlet,
10193
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex gap-2 ${alignClass}`, children: [
10194
+ showCancel && /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "cancel", onClick: handleCancel, children: t(cancelText) }),
10195
+ confirmText && /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: dialogButtonVariantMap[variant], onClick: handleConfirm, children: t(confirmText) })
10196
+ ] })
10197
+ ]
10198
+ }
10199
+ ) });
10181
10200
  }
10182
10201
 
10183
10202
  // src/components/dialog-alert/templates/index.ts