@sustaina/shared-ui 1.57.0 → 1.58.1

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
@@ -9954,7 +9954,7 @@ function DialogHeader2({ className, children, ...props }) {
9954
9954
  SheetPrimitive__namespace.Close,
9955
9955
  {
9956
9956
  "data-slot": "dialog-close",
9957
- className: "absolute right-4 top-4 rounded-xs opacity-80 hover:opacity-100 transition-opacity focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2",
9957
+ className: "absolute right-4 top-4 rounded-xs opacity-80 hover:opacity-100 transition-opacity focus:outline-hidden",
9958
9958
  children: [
9959
9959
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, { className: "size-4" }),
9960
9960
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
@@ -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